Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Elm 2.4ME+ PL101 (25) -> Elm 2.4ME+ PL102 (25)

116 views
Skip to first unread message

Kari E. Hurtta

unread,
May 28, 2003, 3:37:05 PM5/28/03
to
Archive-name: elm2.4ME+/PL102

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/
files elm-2.4ME+PL102.patch.gz
and elm-2.4ME+102.tar.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL102.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+102.tar.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+102.tar.gz >
and <URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL102.patch.gz >

For apply patch use command
patch -p1 < {path...}/elm-2.4ME+PL102.patch
on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Files listed on OBSOLETE should have deleted (they are empty.)

Notice: ME+ series is not official Elm.
This patch is agaist Elm 2.4ME+ PL101 (25) ------------------------------------
Index: elm2.4.ME+.102cvs/hdrs/patchlevel.h
Prereq: 1070000000
*** elm2.4.ME+.101/hdrs/patchlevel.h 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/hdrs/patchlevel.h 2003-05-27 18:52:04.000000000 +0300
***************
*** 1,9 ****
! #define PATCHLEVEL "101 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.101
*/
! #define LAST_REPORT_TIME 1070000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"
! #define VERS_DATE "Mar, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Mar, 2003"
--- 1,9 ----
! #define PATCHLEVEL "102 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.102
*/
! #define LAST_REPORT_TIME 1080000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"
! #define VERS_DATE "May, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released May, 2003"
Index: elm2.4.ME+.102cvs/README.ME+
*** elm2.4.ME+.101/README.ME+ 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/README.ME+ 2003-05-28 21:02:27.000000000 +0300
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.549 2003/03/20 06:49:00 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.572 2003/05/28 18:02:27 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****
--- 13,597 ----
Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL102 (25) compared with Elm2.4ME+ PL101 (25)
+ ------------------------------------------------------------------
+
+ Undo Elm2.4ME+ PL101a (25), Elm2.4ME+ PL101b (25) and
+ Elm2.4ME+ PL101c (25) patches before applying this patch.
+
+ SUMMARY: This release collects patches 101a - 101c,
+ adds support for environment variables (on some
+ cases) to internal mailcap parser, changes
+ folder handling of nfrm, adds new tool
+ elmlibregister and fixes some bugs. Now dynamic
+ libraries (iconv, smtp, tls) are registered
+ on (post-)install time to global elm.rc, if wanted.
+
+ - Fix (harmless) error message
+ bin/elmregister: [on_current] Bad command letter: s
+ (occurs when upgrading version.)
+ - Fix elmregister message
+ Keeping link .../elmuninstall.1 from old version (was (null))
+
+ - Running of test= on internal mailcap parser was causing
+ segmentation violation
+
+ - Added to support for environment variables ($xxxx)
+ inside of " on internal mailcap parser (only environment
+ variables formed from letters are supported). Environment
+ variables outside of quotes are not supported
+ by internal mailcap parser.
+
+ - Fix crash on header editing screen
+
+ - "We're setting up Elm 2.4ME+ PL99b (25) for use as an
+ IMAP client to our mailserver, and I ran into a problem
+ when configuring the main elm.rc file.
+
+ I wanted to be able to set the incoming-mailbox variable
+ to be $USER@engmail, so that by default users would be
+ prompted for a password, and mail would be retrieved from
+ their engmail account.
+
+ However, when I set "incoming-mailbox = $USER@engmail"
+ and ran elm, I got:
+
+ Cannot initialize "incoming-mailbox" -
+ error expanding "$USER@engmail".
+
+ I traced the problem to the expand_path() routine in the
+ lib/expand.c file. The environment variable expansion was
+ using '/' as its only delimiter, so that the $USER portion
+ wasn't being split off from the remainder of the path, and
+ the environment variable lookup failed.
+
+ By adding '@' to the possible delimiters, the problem goes
+ away."
+ From: Paul D. McKone <pdmc...@engmail.uwaterloo.ca>
+
+ - Adding X-ELM-OSV, X-Mailer or Content-Name headers to
+ .elm/elmheaders was causing crash (now they are ignored.)
+
+ - Add fclose() to mailcap.c
+
+ - Do not ignore reply-to header on .elm/elmheaders.
+ Problem noted by: Rui Aguiar <rui...@it.pt>
+
+ - Fix crash
+ ISO2022 PANIC in cs_iso2022.c:836:state_add_raw
+ >>>Value not in range 0-255
+
+ - Fix Segmentation fault when viewing attachments when
+ attachment have a corrupted header
+ Content-Type: type=application/msword
+
+ - Print enconding on MIME structure Menu also when it
+ fits only partially to column
+
+ - Reprint error message after turning Raw off when
+ locking of mailbox fails.
+
+ - Changed error messages of "frm".
+
+ - If "frm -s new" or "nfrm" is given for folder instead
+ of mailbox, show 'new' messages. But also print error
+ message:
+ WARNING: %s is folder, not mailbox!
+ Delivery of new mail to folder when it is open may
+ corrupt it.
+ Setting default-folder-status = New disables warning.
+
+
+ - Fix for valgrind reported error
+ Conditional jump or move depends on uninitialised value(s)
+ at 0x80E9136: expand_dt_path (rc_handle.c:1130)
+ (actually loop condition did not depend
+ uninitialized value although one subexpresions value
+ was uninitialized on that situation.)
+
+ - Fix for valgrind reported error/warning
+ 1310 bytes in 177 blocks are definitely lost in
+ loss record 19 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F081B: safe_malloc (safemalloc.c:46)
+ by 0x80AE3B8: dequote_opt (charset.c:787)
+ by 0x80AE985: load_charset_map_info (charset.c:948)
+
+ - Fix for valgrind reported error/warning
+ 552 bytes in 68 blocks are definitely lost in loss
+ record 16 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F081B: safe_malloc (safemalloc.c:46)
+ by 0x80F4F29: set_dir_selection (savefolder.c:2141)
+ by 0x80F23A5: real_select_local (savefolder.c:747)
+
+ - Fix for valgrind reported error/warning
+ 528 bytes in 66 blocks are definitely lost in loss
+ record 16 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F081B: safe_malloc (safemalloc.c:46)
+ by 0x8105638: malloc_string (string.c:116)
+ by 0x8105873: new_string2 (string.c:180)
+ by 0x80C506A: hdr_text (hdrdecode.c:412)
+
+ - Fix for valgrind reported error/warning
+ 280 bytes in 35 blocks are definitely lost in loss
+ record 16 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0827: safe_malloc (safemalloc.c:46)
+ by 0x8105644: malloc_string (string.c:116)
+ by 0x810587F: new_string2 (string.c:180)
+ by 0x80C4D7B: hdr_comment (hdrdecode.c:272)
+
+ - Fix for valgrind reported error/warning
+ 96 bytes in 12 blocks are definitely lost in loss
+ record 11 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0833: safe_malloc (safemalloc.c:46)
+ by 0x8105650: malloc_string (string.c:116)
+ by 0x810588B: new_string2 (string.c:180)
+ by 0x80C4F1F: hdr_phrase (hdrdecode.c:348)
+
+ - Fix for valgrind reported error/warning
+ 224 bytes in 11 blocks are definitely lost in loss
+ record 16 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0847: safe_malloc (safemalloc.c:46)
+ by 0x81056D2: malloc_string (string.c:130)
+ by 0x8106B98: dup_string (string.c:678)
+ by 0x80DAD85: add_expanded_addr_ (outheaders.c:134)
+
+ - Fix for valgrind reported error/warning
+ 24 bytes in 1 blocks are definitely lost in loss
+ record 1 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F083B: safe_malloc (safemalloc.c:46)
+ by 0x80C6887: update_header_list (headers.c:575)
+ by 0x809C8BB: state_read_headers (parse_util.c:137)
+ by 0x809C7C8: file_read_headers (parse_util.c:104)
+ by 0x8076770: copy_message_2 (fileio.c:1048)
+
+ - Fix for valgrind reported error/warning
+ 52 bytes in 5 blocks are definitely lost in loss
+ record 6 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F087B: safe_malloc (safemalloc.c:46)
+ by 0x8105706: malloc_string (string.c:130)
+ by 0x81057CC: new_string (string.c:153)
+ by 0x80DB167: make_surface_addr (outheaders.c:235)
+ by 0x8059485: build_address_l (addr_util.c:452)
+
+ - Fix for valgrind reported error/warning
+ 32 bytes in 4 blocks are definitely lost in loss record 5 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F089F: safe_malloc (safemalloc.c:46)
+ by 0x81056BC: malloc_string (string.c:116)
+ by 0x810627F: cat_strings (string.c:434)
+ by 0x80C510B: hdr_text (hdrdecode.c:419)
+ by 0x80C51E6: hdr_to_string (hdrdecode.c:462)
+ by 0x80C5CC3: hdr_decode_from_text (headers.c:36)
+ by 0x80C71C4: give_decoded_header (headers.c:816)
+ by 0x809CB02: state_write_header (parse_util.c:197)
+
+ - Fix for valgrind reported error/warning
+ 32 bytes in 4 blocks are definitely lost in loss record 5 of 26
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F08B3: safe_malloc (safemalloc.c:46)
+ by 0x8104DD1: alloc_simple (streamsched.c:1047)
+
+ - Fix for valgrind reported error/warning
+ 16 bytes in 2 blocks are definitely lost in loss record 1 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F08B3: safe_malloc (safemalloc.c:46)
+ by 0x81056F8: malloc_string (string.c:116)
+ by 0x810582C: new_string (string.c:153)
+ by 0x807B350: enter_helper (in_utils.c:432)
+ by 0x807BECE: optionally_enter2 (in_utils.c:863)
+ by 0x807C01E: optionally_enter (in_utils.c:898)
+
+ - Fix for valgrind reported error/warning
+ 16 bytes in 2 blocks are definitely lost in loss record 1 of 26
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F08CB: safe_malloc (safemalloc.c:46)
+ by 0x80B33D7: cs_stream_from_ascii (cs_binary.c:1508)
+ by 0x8107089: stream_from_string (string.c:799)
+ by 0x807C049: optionally_enter (in_utils.c:909)
+
+ - Fix for valgrind reported error/warning
+ 140 bytes in 1 blocks are definitely lost in loss record 13 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0996: safe_realloc (safemalloc.c:62)
+ by 0x80E509D: mbx_prepare_read_pop (pop.c:1592)
+
+ - Fix for valgrind reported error/warning
+ 15 bytes in 1 blocks are definitely lost in loss record 1 of 26
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F09A2: safe_realloc (safemalloc.c:62)
+ by 0x80A1357: make_mailcap_arg (mailcap.c:918)
+ by 0x80A1EF8: mailcap_view_command (mailcap.c:1319)
+ by 0x80973A6: prompt_programs_1 (showmsg.c:131)
+ by 0x8097587: prompt_programs_1 (showmsg.c:188)
+ by 0x80975F1: prompt_programs (showmsg.c:211)
+
+ - Fix for valgrind reported error/warning
+ 32 bytes in 2 blocks are definitely lost in loss record 5 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0933: safe_malloc (safemalloc.c:46)
+ by 0x80C6973: update_header_list (headers.c:575)
+ by 0x80C6D3F: read_folder_headers (headers.c:700)
+ by 0x80D5771: prepare_message_access (mbox.c:1351)
+
+ - Fix for valgrind reported error/warning
+ 8 bytes in 1 blocks are definitely lost in loss record 1 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F094F: safe_malloc (safemalloc.c:46)
+ by 0x8105794: malloc_string (string.c:116)
+ by 0x8106CC8: dup_string (string.c:678)
+ by 0x812FEB5: sb_get_line_from_mem (sb_mem.c:69)
+ by 0x8109A89: get_line_from_stringbuffer (stringbuffer.c:177)
+ by 0x8067162: builtinplusplus (builtin++.c:176)
+
+ - Fix for valgrind reported error/warning
+ 55 bytes in 2 blocks are definitely lost in loss record 6 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F099F: safe_malloc (safemalloc.c:46)
+ by 0x80FDE2A: malloc_service_entry (service_list.c:198)
+
+ - Fix for valgrind reported error/warning
+ 3 bytes in 1 blocks are definitely lost in loss record 1 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F099F: safe_malloc (safemalloc.c:46)
+ by 0x81221FC: imap_got_header_line (imap.c:5794)
+ by 0x8122863: mbx_copy_header_imap (imap.c:5991)
+
+ - Fix for valgrind reported error/warning
+ 4050 bytes in 67 blocks are definitely lost in loss
+ record 21 of 24
+ at 0x4015E8A3: realloc (vg_clientfuncs.c:276)
+ by 0x80F0A6E: safe_realloc (safemalloc.c:62)
+ by 0x80E0025: elm_vmessage (output.c:1229)
+ by 0x80E0881: elm_message (output.c:1460)
+ by 0x8121F12: mbx_copy_envelope_imap (imap.c:5687)
+
+ - Fix for valgrind reported error/warning
+ 9 bytes in 1 blocks are definitely lost in loss record 2 of 30
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0B37: safe_strdup (safemalloc.c:78)
+ by 0x80FB31A: probe_imap_capa_lib (shared.c:1010)
+
+ - Fix for valgrind reported error/warning
+ 40 bytes in 1 blocks are definitely lost in loss record 6 of 29
+ at 0x4015E8A3: realloc (vg_clientfuncs.c:276)
+ by 0x80F0A6E: safe_realloc (safemalloc.c:62)
+ by 0x80E0209: elm_vmessage (output.c:1281)
+ by 0x80E0881: elm_message (output.c:1460)
+ by 0x4146ED0A: smtp_common_mailer_backend (smtp.c:1026)
+
+ - Fix for valgrind reported error
+ Invalid read of size 4
+ at 0x80C0994: debug_level_check (debug.c:256)
+ by 0x80F0B22: safe_realloc (safemalloc.c:69)
+ by 0x80C08B1: set_debugging (debug.c:214)
+
+ - Added "install_libs" target for testing top level Makefile
+
+ - Due on error on Makefile on doc/, elmrc-info (and possible
+ other files) was not installed.
+
+ - Added new tool elmlibregister, which check is libraries
+ given on use-library on elm.rc (or on .elm/elmrc) loadable.
+ Now Configure asks which libraries should be registered on
+ on (post-)install time. elmlibregister command is used to
+ add these libraries to use-library line on global elm.rc.
+
+ - Quotes was handled incorrectly on internal mailcap parser.
+
+ New tools:
+ elmlibregister
+
+ New files:
+ utils/elmlibregister.c
+ doc/elmlibregister.1
+
+ Changes of Elm2.4ME+ PL101c (25) compared with Elm2.4ME+ PL101b (25)
+ --------------------------------------------------------------------
+
+ [ This is out of branch patch. ]
+
+ SUMMARY: This patch fixes segmentation fault, when
+ when viewing attachment with unxepected
+ Content-Type, and fixes some memory leaks
+ and other errors found by memory checker
+ tools. Also other small changes are included
+ to this patch.
+
+ - Fix Segmentation fault when viewing attachments when
+ attachment have a corrupted header
+ Content-Type: type=application/msword
+
+ - Print enconding on MIME structure Menu also when it
+ fits only partially to column
+
+ - Reprint error message after turning Raw off when
+ locking of mailbox fails.
+
+ - Fix for valgrind reported error
+ Conditional jump or move depends on uninitialised value(s)
+ at 0x80E9136: expand_dt_path (rc_handle.c:1130)
+ (actually loop condition did not depend
+ uninitialized value although one subexpresions value
+ was uninitialized on that situation.)
+
+ - Fix for valgrind reported error/warning
+ 1310 bytes in 177 blocks are definitely lost in
+ loss record 19 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F081B: safe_malloc (safemalloc.c:46)
+ by 0x80AE3B8: dequote_opt (charset.c:787)
+ by 0x80AE985: load_charset_map_info (charset.c:948)
+
+ - Fix for valgrind reported error/warning
+ 552 bytes in 68 blocks are definitely lost in loss
+ record 16 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F081B: safe_malloc (safemalloc.c:46)
+ by 0x80F4F29: set_dir_selection (savefolder.c:2141)
+ by 0x80F23A5: real_select_local (savefolder.c:747)
+
+ - Fix for valgrind reported error/warning
+ 528 bytes in 66 blocks are definitely lost in loss
+ record 16 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F081B: safe_malloc (safemalloc.c:46)
+ by 0x8105638: malloc_string (string.c:116)
+ by 0x8105873: new_string2 (string.c:180)
+ by 0x80C506A: hdr_text (hdrdecode.c:412)
+
+ - Fix for valgrind reported error/warning
+ 280 bytes in 35 blocks are definitely lost in loss
+ record 16 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0827: safe_malloc (safemalloc.c:46)
+ by 0x8105644: malloc_string (string.c:116)
+ by 0x810587F: new_string2 (string.c:180)
+ by 0x80C4D7B: hdr_comment (hdrdecode.c:272)
+
+ - Fix for valgrind reported error/warning
+ 96 bytes in 12 blocks are definitely lost in loss
+ record 11 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0833: safe_malloc (safemalloc.c:46)
+ by 0x8105650: malloc_string (string.c:116)
+ by 0x810588B: new_string2 (string.c:180)
+ by 0x80C4F1F: hdr_phrase (hdrdecode.c:348)
+
+ - Fix for valgrind reported error/warning
+ 224 bytes in 11 blocks are definitely lost in loss
+ record 16 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0847: safe_malloc (safemalloc.c:46)
+ by 0x81056D2: malloc_string (string.c:130)
+ by 0x8106B98: dup_string (string.c:678)
+ by 0x80DAD85: add_expanded_addr_ (outheaders.c:134)
+
+ - Fix for valgrind reported error/warning
+ 24 bytes in 1 blocks are definitely lost in loss
+ record 1 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F083B: safe_malloc (safemalloc.c:46)
+ by 0x80C6887: update_header_list (headers.c:575)
+ by 0x809C8BB: state_read_headers (parse_util.c:137)
+ by 0x809C7C8: file_read_headers (parse_util.c:104)
+ by 0x8076770: copy_message_2 (fileio.c:1048)
+
+ - Fix for valgrind reported error/warning
+ 52 bytes in 5 blocks are definitely lost in loss
+ record 6 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F087B: safe_malloc (safemalloc.c:46)
+ by 0x8105706: malloc_string (string.c:130)
+ by 0x81057CC: new_string (string.c:153)
+ by 0x80DB167: make_surface_addr (outheaders.c:235)
+ by 0x8059485: build_address_l (addr_util.c:452)
+
+ - Fix for valgrind reported error/warning
+ 32 bytes in 4 blocks are definitely lost in loss record 5 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F089F: safe_malloc (safemalloc.c:46)
+ by 0x81056BC: malloc_string (string.c:116)
+ by 0x810627F: cat_strings (string.c:434)
+ by 0x80C510B: hdr_text (hdrdecode.c:419)
+ by 0x80C51E6: hdr_to_string (hdrdecode.c:462)
+ by 0x80C5CC3: hdr_decode_from_text (headers.c:36)
+ by 0x80C71C4: give_decoded_header (headers.c:816)
+ by 0x809CB02: state_write_header (parse_util.c:197)
+
+ - Fix for valgrind reported error/warning
+ 32 bytes in 4 blocks are definitely lost in loss record 5 of 26
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F08B3: safe_malloc (safemalloc.c:46)
+ by 0x8104DD1: alloc_simple (streamsched.c:1047)
+
+ - Fix for valgrind reported error/warning
+ 16 bytes in 2 blocks are definitely lost in loss record 1 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F08B3: safe_malloc (safemalloc.c:46)
+ by 0x81056F8: malloc_string (string.c:116)
+ by 0x810582C: new_string (string.c:153)
+ by 0x807B350: enter_helper (in_utils.c:432)
+ by 0x807BECE: optionally_enter2 (in_utils.c:863)
+ by 0x807C01E: optionally_enter (in_utils.c:898)
+
+ - Fix for valgrind reported error/warning
+ 16 bytes in 2 blocks are definitely lost in loss record 1 of 26
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F08CB: safe_malloc (safemalloc.c:46)
+ by 0x80B33D7: cs_stream_from_ascii (cs_binary.c:1508)
+ by 0x8107089: stream_from_string (string.c:799)
+ by 0x807C049: optionally_enter (in_utils.c:909)
+
+ - Fix for valgrind reported error/warning
+ 140 bytes in 1 blocks are definitely lost in loss record 13 of 24
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0996: safe_realloc (safemalloc.c:62)
+ by 0x80E509D: mbx_prepare_read_pop (pop.c:1592)
+
+ - Fix for valgrind reported error/warning
+ 15 bytes in 1 blocks are definitely lost in loss record 1 of 26
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F09A2: safe_realloc (safemalloc.c:62)
+ by 0x80A1357: make_mailcap_arg (mailcap.c:918)
+ by 0x80A1EF8: mailcap_view_command (mailcap.c:1319)
+ by 0x80973A6: prompt_programs_1 (showmsg.c:131)
+ by 0x8097587: prompt_programs_1 (showmsg.c:188)
+ by 0x80975F1: prompt_programs (showmsg.c:211)
+
+ - Fix for valgrind reported error/warning
+ 32 bytes in 2 blocks are definitely lost in loss record 5 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0933: safe_malloc (safemalloc.c:46)
+ by 0x80C6973: update_header_list (headers.c:575)
+ by 0x80C6D3F: read_folder_headers (headers.c:700)
+ by 0x80D5771: prepare_message_access (mbox.c:1351)
+
+ - Fix for valgrind reported error/warning
+ 8 bytes in 1 blocks are definitely lost in loss record 1 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F094F: safe_malloc (safemalloc.c:46)
+ by 0x8105794: malloc_string (string.c:116)
+ by 0x8106CC8: dup_string (string.c:678)
+ by 0x812FEB5: sb_get_line_from_mem (sb_mem.c:69)
+ by 0x8109A89: get_line_from_stringbuffer (stringbuffer.c:177)
+ by 0x8067162: builtinplusplus (builtin++.c:176)
+
+ - Fix for valgrind reported error/warning
+ 55 bytes in 2 blocks are definitely lost in loss record 6 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F099F: safe_malloc (safemalloc.c:46)
+ by 0x80FDE2A: malloc_service_entry (service_list.c:198)
+
+ - Fix for valgrind reported error/warning
+ 3 bytes in 1 blocks are definitely lost in loss record 1 of 25
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F099F: safe_malloc (safemalloc.c:46)
+ by 0x81221FC: imap_got_header_line (imap.c:5794)
+ by 0x8122863: mbx_copy_header_imap (imap.c:5991)
+
+ - Fix for valgrind reported error/warning
+ 4050 bytes in 67 blocks are definitely lost in loss
+ record 21 of 24
+ at 0x4015E8A3: realloc (vg_clientfuncs.c:276)
+ by 0x80F0A6E: safe_realloc (safemalloc.c:62)
+ by 0x80E0025: elm_vmessage (output.c:1229)
+ by 0x80E0881: elm_message (output.c:1460)
+ by 0x8121F12: mbx_copy_envelope_imap (imap.c:5687)
+
+ - Fix for valgrind reported error/warning
+ 9 bytes in 1 blocks are definitely lost in loss record 2 of 30
+ at 0x4015E30F: malloc (vg_clientfuncs.c:103)
+ by 0x80F0B37: safe_strdup (safemalloc.c:78)
+ by 0x80FB31A: probe_imap_capa_lib (shared.c:1010)
+
+ - Fix for valgrind reported error/warning
+ 40 bytes in 1 blocks are definitely lost in loss record 6 of 29
+ at 0x4015E8A3: realloc (vg_clientfuncs.c:276)
+ by 0x80F0A6E: safe_realloc (safemalloc.c:62)
+ by 0x80E0209: elm_vmessage (output.c:1281)
+ by 0x80E0881: elm_message (output.c:1460)
+ by 0x4146ED0A: smtp_common_mailer_backend (smtp.c:1026)
+
+ - Fix for valgrind reported error
+ Invalid read of size 4
+ at 0x80C0994: debug_level_check (debug.c:256)
+ by 0x80F0B22: safe_realloc (safemalloc.c:69)
+ by 0x80C08B1: set_debugging (debug.c:214)
+
+ Changes of Elm2.4ME+ PL101b (25) compared with Elm2.4ME+ PL101a (25)
+ --------------------------------------------------------------------
+
+ [ This is out of branch patch. ]
+
+ SUMMARY: This patch makes possible to set
+ incoming-mailbox = $USER@imap-sever on
+ elm.rc, fixes crash caused by certain
+ headers on .elm/elmheaders and
+ fixes another crash when displaying EUC
+ mail. Reply-To header on .elm/elmheaders
+ is no longer ignored.
+
+ - "We're setting up Elm 2.4ME+ PL99b (25) for use as an
+ IMAP client to our mailserver, and I ran into a problem
+ when configuring the main elm.rc file.
+
+ I wanted to be able to set the incoming-mailbox variable
+ to be $USER@engmail, so that by default users would be
+ prompted for a password, and mail would be retrieved from
+ their engmail account.
+
+ However, when I set "incoming-mailbox = $USER@engmail"
+ and ran elm, I got:
+
+ Cannot initialize "incoming-mailbox" -
+ error expanding "$USER@engmail".
+
+ I traced the problem to the expand_path() routine in the
+ lib/expand.c file. The environment variable expansion was
+ using '/' as its only delimiter, so that the $USER portion
+ wasn't being split off from the remainder of the path, and
+ the environment variable lookup failed.
+
+ By adding '@' to the possible delimiters, the problem goes
+ away."
+ From: Paul D. McKone <pdmc...@engmail.uwaterloo.ca>
+
+ - Adding X-ELM-OSV, X-Mailer or Content-Name headers to
+ .elm/elmheaders was causing crash (now they are ignored.)
+
+ - Do not ignore reply-to header on .elm/elmheaders.
+ Problem noted by: Rui Aguiar <rui...@it.pt>
+
+ - Fix crash
+ ISO2022 PANIC in cs_iso2022.c:836:state_add_raw
+ >>>Value not in range 0-255
+
+ Changes of Elm2.4ME+ PL101a (25) compared with Elm2.4ME+ PL101 (25)
+ -------------------------------------------------------------------
+
+ [ This is out of branch patch. ]
+
+ SUMMARY: This patch fixes crash on internal mailcap parser
+ and on header editing screen.
+
+ - Fix (harmless) error message
+ bin/elmregister: [on_current] Bad command letter: s
+ (occurs when upgrading version.)
+ - Fix elmregister message
+ Keeping link .../elmuninstall.1 from old version (was (null))
+
+ - Running of test= on internal mailcap parser was causing
+ segmentation violation
+
+ - Fix crash on header editing screen

Changes of Elm2.4ME+ PL101 (25) compared with Elm2.4ME+ PL100 (25)
------------------------------------------------------------------
Index: elm2.4.ME+.102cvs/Configure
*** elm2.4.ME+.101/Configure 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/Configure 2003-05-25 14:19:56.000000000 +0300
***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#
! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.144 2003/03/19 17:48:00 hurtta Exp $
#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#
! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.145 2003/05/25 11:19:56 hurtta Exp $
#

: sanity checks
***************
*** 316,321 ****
--- 316,322 ----
d_shared_rev=''
d_dlopen_libs=''
shared_list=''
+ shared_register=''
dlopen_lib='';
rpath_opt=''
soname_opt=''
***************
*** 6404,6409 ****
--- 6405,6450 ----
)
done

+ case "$shared_register" in
+ '')
+ dflt="$shared_list"
+ ;;
+ *)
+ dflt="$shared_register"
+ ;;
+ esac
+ $cat <<EOF
+
+ These shared libraries
+ $shared_list
+ may be registered after installation, by writing to the global elm.rc file
+ varible use-library. Give list which libraries from these should be registered.
+ Give "none" if no libraries should be registered automatically.
+
+ EOF
+
+ rp="Libraries for registeration? [$dflt]"
+ echo $n "$rp $c"
+ . myread
+
+ case "$ans" in
+ none)
+ shared_register=none
+ ;;
+ *)
+ shared_register=
+ for doconfig in $ans ; do
+ if $test -r ../shared_libs/$doconfig/config.res ; then
+ shared_register="$shared_register $doconfig"
+ else
+ echo "Library $doconfig not available"
+ fi
+ done
+ echo "Will register following libraries: $shared_register"
+ echo
+ ;;
+ esac
+
fi

: the "config.over" file can be used to patch configuration changes
***************
*** 6617,6622 ****
--- 6658,6664 ----
d_shared_rev='$d_shared_rev'
d_dlopen_libs='$d_dlopen_libs'
shared_list='$shared_list'
+ shared_register='$shared_register'
d_dynamic_main='$d_dynamic_main'
dynamic_opt='$dynamic_opt'
dlopen_lib="$dlopen_lib"
Index: elm2.4.ME+.102cvs/doc/elmlibregister.1
*** /tmp/2329-very-long-file-name-NULL-comes-in-here 2003-05-28 21:40:26.000000000 +0300
--- elm2.4.ME+.102cvs/doc/elmlibregister.1 2003-05-25 16:57:45.000000000 +0300
***************
*** 0 ****
--- 1,63 ----
+ .if n \{\
+ . ds ct "
+ .\}
+ .if t \{\
+ . ds ct \\(co
+ .\}
+ .TH ELMLIBREGISTER 1L "Elm Version 2.4ME+" "Kari Hurtta"
+ .SH NAME
+ elmlibregister - Registry of elm libraries to use-library line on elm.rc
+ .SH SYNOPSIS
+ .B #LIB#/elmlibregister
+ [
+ .B \-G
+ .B \-d
+ .I "\fIclass\fR=\fIdebugfile\fR:\fIlevel\fR"
+ .B \-I
+ .B \-w
+ target-file
+ ]
+ [ libtags... ]
+ .PP
+ .SH DESCRIPTION
+ .I Elmlibregister\^
+ is a part of the
+ .B Elm 2.4ME+
+ mail system.
+ Elmlibregister checks that libraries given on use-library on elm.rc
+ (or on .elm/elmrc) are loadable.
+ Configure asks which libraries should be registered on
+ on (post-)install time. Elmlibregister command is used to
+ add these libraries to use-library line on global elm.rc.
+ .PP
+ Options are:
+ .TP 1.0i
+ .B " -G"
+ Read global configuration files only (by default user
+ configuration files are read.)
+ .TP
+ .B " -d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR "
+ Debug - set specified debug level - Output to "$HOME/ELMLIBREGISTER:debug.info"
+ if
+ .I debugfile
+ is not given. Has no effect unless
+ .I elmrc-write
+ was compiled with debugging enabled.
+ .TP
+ .B " -w" target-file
+ Gives file for output.
+ .TP
+ .B " -I"
+ Use system RC file (#ETC#/elm.rc) or individual RC file
+ ($HOME/.elm/elmrc) as target file.
+ .SH AUTHOR
+ Kari Hurtta
+ .SH FILES
+ #ETC#/elm.rc system RC file
+ .br
+ $HOME/.elm/elmrc individual RC file
+ .br
+ .SH BUG REPORTS TO
+ Kari Hurtta hurtt...@ozone.fmi.fi
+ .SH COPYRIGHTS
+ \fB\*(ct\fRCopyright 2003 by Kari Hurtta
Index: elm2.4.ME+.102cvs/doc/Makefile.SH
*** elm2.4.ME+.101/doc/Makefile.SH 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/doc/Makefile.SH 2003-05-28 19:43:07.000000000 +0300
***************
*** 17,23 ****
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.25 2003/03/17 18:42:25 hurtta Exp $
#
# Makefile for the documentation of the ELM mail system
#
--- 17,23 ----
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.28 2003/05/28 16:43:07 hurtta Exp $
#
# Makefile for the documentation of the ELM mail system
#
***************
*** 51,56 ****
--- 51,73 ----
PACKER = $packer
!GROK!THIS!

+
+ case "$d_dlopen_libs" in
+ define) regman="\$(MAN)/elmlibregister\$(MANEXT)"
+ regcat="\$(CATMAN)/elmlibregister\$(CATMANEXT)\$(SUFFIX)"
+ regcatman="catman/elmregister\$(CATMANEXT)\$(SUFFIX)"
+ ;;
+ *) regman=
+ regcat=
+ regcatman=
+ ;;
+ esac
+ cat >>Makefile <<!GROK!THIS!
+ REGMAN = $regman
+ REGCAT = $regcat
+ REGCATMAN = $regcatman
+
+ !GROK!THIS!
if $test "$roff" != none ; then
cat >>Makefile <<!GROK!THIS!
# List of formatted guides (obsolete)
***************
*** 88,116 ****
;;
esac

- cat >>Makefile <<!GROK!THIS!
- all:
- @if \$(TEST) $catmansrc != none; then \$(MAKE) formatted_pages ; else true ; fi
-
- install_s: \$(LIB_LIST)
- @if \$(TEST) $mansrc != none; then \$(MAKE) install_man ; else true ; fi
- @if \$(TEST) $catmansrc != none; then \$(MAKE) install_catman ; else true ; fi
-
- uninstall_s:
- \$(REG) rm \$(LIB_LIST)
- @if \$(TEST) $mansrc != none; then \
- \$(REG) rm \$(MAN_LIST) \$(MAN)/wnewmail\$(MANEXT) \$(MAN)/nfrm\$(MANEXT) \$(MAN)/elmuninstall\$(MANEXT); \
- else \
- true ; \
- fi
- @if \$(TEST) $catmansrc != none; then \
- \$(REG) rm \$(CATMAN_LIST) \$(CATMAN)/wnewmail\$(CATMANEXT)\$(SUFFIX) \$(CATMAN)/nfrm\$(CATMANEXT)\$(SUFFIX) \$(CATMAN)/elmuninstall\$(CATMANEXT)\$(SUFFIX); \
- else \
- true ; \
- fi
-
- !GROK!THIS!
-
cat >>Makefile <<'!NO!SUBS!'

# Other variables
--- 105,110 ----
***************
*** 136,142 ****
$(MAN)/elmunidata$(MANEXT) \
$(MAN)/elmstringconvert$(MANEXT) \
$(MAN)/prlong$(MANEXT) \
! $(MAN)/elmregister$(MANEXT)

# List of installed catman pages (except for wnemail.1 - handled differently)
CATMAN_LIST = $(CATMAN)/answer$(CATMANEXT)$(SUFFIX) \
--- 130,137 ----
$(MAN)/elmunidata$(MANEXT) \
$(MAN)/elmstringconvert$(MANEXT) \
$(MAN)/prlong$(MANEXT) \
! $(MAN)/elmregister$(MANEXT) \
! $(REGMAN)

# List of installed catman pages (except for wnemail.1 - handled differently)
CATMAN_LIST = $(CATMAN)/answer$(CATMANEXT)$(SUFFIX) \
***************
*** 157,163 ****
$(CATMAN)/elmunidata$(CATMANEXT)$(SUFFIX) \
$(CATMAN)/elmstringconvert$(CATMANEXT)$(SUFFIX) \
$(CATMAN)/prlong$(CATMANEXT)$(SUFFIX) \
! $(CATMAN)/elmregister$(CATMANEXT)$(SUFFIX)

# List of formatted pages for catman
FORMATTED_PAGES_LIST = catman/answer$(CATMANEXT)$(SUFFIX) \
--- 152,159 ----
$(CATMAN)/elmunidata$(CATMANEXT)$(SUFFIX) \
$(CATMAN)/elmstringconvert$(CATMANEXT)$(SUFFIX) \
$(CATMAN)/prlong$(CATMANEXT)$(SUFFIX) \
! $(CATMAN)/elmregister$(CATMANEXT)$(SUFFIX) \
! $(REGCAT)

# List of formatted pages for catman
FORMATTED_PAGES_LIST = catman/answer$(CATMANEXT)$(SUFFIX) \
***************
*** 178,184 ****
catman/elmunidata$(CATMANEXT)$(SUFFIX) \
catman/elmstringconvert$(CATMANEXT)$(SUFFIX) \
catman/prlong$(CATMANEXT)$(SUFFIX) \
! catman/elmregister$(CATMANEXT)$(SUFFIX)

# List of files installed in LIB directory
LIB_LIST = $(LIB)/elm-help.0 \
--- 174,181 ----
catman/elmunidata$(CATMANEXT)$(SUFFIX) \
catman/elmstringconvert$(CATMANEXT)$(SUFFIX) \
catman/prlong$(CATMANEXT)$(SUFFIX) \
! catman/elmregister$(CATMANEXT)$(SUFFIX) \
! $(REGCATMAN)

# List of files installed in LIB directory
LIB_LIST = $(LIB)/elm-help.0 \
***************
*** 189,194 ****
--- 186,218 ----


# Targets
+
+ !NO!SUBS!
+
+ cat >>Makefile <<!GROK!THIS!
+ all:
+ @if \$(TEST) $catmansrc != none; then \$(MAKE) formatted_pages ; else true ; fi
+
+ install_s: \$(LIB_LIST)
+ @if \$(TEST) $mansrc != none; then \$(MAKE) install_man ; else true ; fi
+ @if \$(TEST) $catmansrc != none; then \$(MAKE) install_catman ; else true ; fi
+
+ uninstall_s:
+ \$(REG) rm \$(LIB_LIST)
+ @if \$(TEST) $mansrc != none; then \
+ \$(REG) rm \$(MAN_LIST) \$(MAN)/wnewmail\$(MANEXT) \$(MAN)/nfrm\$(MANEXT) \$(MAN)/elmuninstall\$(MANEXT); \
+ else \
+ true ; \
+ fi
+ @if \$(TEST) $catmansrc != none; then \
+ \$(REG) rm \$(CATMAN_LIST) \$(CATMAN)/wnewmail\$(CATMANEXT)\$(SUFFIX) \$(CATMAN)/nfrm\$(CATMANEXT)\$(SUFFIX) \$(CATMAN)/elmuninstall\$(CATMANEXT)\$(SUFFIX); \
+ else \
+ true ; \
+ fi
+
+ !GROK!THIS!
+
+ cat >>Makefile <<'!NO!SUBS!'
# The following are no-ops
lint:
clean:
***************
*** 231,236 ****
--- 255,262 ----
$(SED) $(SUBS) < prlong.1 > prlong.1.subs
elmregister.1.subs: elmregister.1
$(SED) $(SUBS) < elmregister.1 > elmregister.1.subs
+ elmlibregister.1.subs: elmlibregister.1
+ $(SED) $(SUBS) < elmlibregister.1 > elmlibregister.1.subs


formatted_pages: catman $(FORMATTED_PAGES_LIST)
***************
*** 313,318 ****
--- 339,347 ----
$(MAN)/elmregister$(MANEXT): elmregister.1.subs
$(REG) copy -m 444 $? $@

+ $(MAN)/elmlibregister$(MANEXT): elmlibregister.1.subs
+ $(REG) copy -m 444 $? $@
+

$(MAN)/wnewmail$(MANEXT): $(MAN)/newmail$(MANEXT)
$(REG) link $? $@
***************
*** 400,405 ****
--- 429,437 ----
$(CATMAN)/elmregister$(CATMANEXT)$(SUFFIX): catman/elmregister$(CATMANEXT)$(SUFFIX)
$(REG) copy -m 444 $? $@

+ $(CATMAN)/elmlibregister$(CATMANEXT)$(SUFFIX): catman/elmlibregister$(CATMANEXT)$(SUFFIX)
+ $(REG) copy -m 444 $? $@
+
# Dependencies and rules for making catman pages
catman/answer$(CATMANEXT)$(SUFFIX): answer.1.subs
$(MANROFF) $(MANROFF_OPTS) -man $? > catman/answer$(CATMANEXT)
***************
*** 573,578 ****
--- 605,619 ----
true ; \
fi

+ catman/elmlibregister$(CATMANEXT)$(SUFFIX): elmlibregister.1.subs
+ $(MANROFF) $(MANROFF_OPTS) -man $? > catman/elmlibregister$(CATMANEXT)
+ @if $(TEST) "$(PACKED)" = y ; then \
+ $(RM) $@ ; \
+ $(PACKER) catman/elmlibregister$(CATMANEXT) ; \
+ else \
+ true ; \
+ fi
+
# Dependencies and rules for formatting guides
documentation: $(FORMATTED_LIST)

Index: elm2.4.ME+.102cvs/hdrs/elmlib.h
*** elm2.4.ME+.101/hdrs/elmlib.h 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/hdrs/elmlib.h 2003-05-25 14:19:57.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmlib.h,v 1.186 2003/03/17 16:04:00 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.186 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! /* $Id: elmlib.h,v 1.188 2003/05/25 11:19:57 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.188 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 1091,1097 ****
SESSIONLOCK_REOPEN = 1,
SESSIONLOCK_TRUNCATE = 2,
SESSIONLOCK_CHECK = 3,
! SESSIONLOCK_NONE = 4};

typedef struct folder_type * folder_type_p;

--- 1091,1100 ----
SESSIONLOCK_REOPEN = 1,
SESSIONLOCK_TRUNCATE = 2,
SESSIONLOCK_CHECK = 3,
! SESSIONLOCK_NONE = 4,
! SESSIONLOCK_NONE_CHECKNEW = 0x80 + 4 /* not actually mode */
! };
!

typedef struct folder_type * folder_type_p;

***************
*** 1421,1426 ****
--- 1424,1431 ----
#endif

#ifdef USE_DLOPEN
+ extern void test_and_set_shared P_((char **argv,
+ int will_write)); /* For elmlibregister.c */
extern int use_sharedfunc P_((char **value, int enter));

extern void seed_rand_bits P_((const char *buf, int size,
Index: elm2.4.ME+.102cvs/hdrs/hdr_imp.h
*** elm2.4.ME+.101/hdrs/hdr_imp.h 2002-06-06 18:55:55.000000000 +0300
--- elm2.4.ME+.102cvs/hdrs/hdr_imp.h 2003-04-22 21:34:57.000000000 +0300
***************
*** 28,33 ****
--- 28,39 ----
int demime,
charset_t defcharset,
int replace));
+ int add_replyto_hdr P_((struct mailing_headers * headers,
+ header_ptr X,
+ const char *value,
+ int demime,
+ charset_t defcharset,
+ int replace));
int add_user_hdr P_((struct mailing_headers * headers,
header_ptr X,
const char *value,
Index: elm2.4.ME+.102cvs/hdrs/mbx_imp.h
*** elm2.4.ME+.101/hdrs/mbx_imp.h 2002-06-06 18:55:55.000000000 +0300
--- elm2.4.ME+.102cvs/hdrs/mbx_imp.h 2003-05-09 18:24:37.000000000 +0300
***************
*** 1,7 ****
! /* $Id: mbx_imp.h,v 1.61 2002/06/05 17:34:35 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! /* $Id: mbx_imp.h,v 1.62 2003/05/09 15:24:37 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 353,358 ****
--- 353,361 ----
FILE *fh_temp; /* current folder */
FILE *fh_folder; /* current folder */

+ #define FLAG1_CHECKNEW 0x01
+ int flags1; /* Set by sessionlock_folder() */
+
union {
struct SPOOL {
int lock_state;
Index: elm2.4.ME+.102cvs/hdrs/s_elmrc.h
*** elm2.4.ME+.101/hdrs/s_elmrc.h 2002-01-26 13:14:45.000000000 +0200
--- elm2.4.ME+.102cvs/hdrs/s_elmrc.h 2003-05-25 14:19:57.000000000 +0300
***************
*** 11,13 ****
--- 11,14 ----
#define ElmrcSavedAuto 0x9
#define ElmrcNoBothwI 0xa
#define ElmrcSavedAutoWrite 0xb
+ #define ElmrcSavedAutoLIB 0xc
Index: elm2.4.ME+.102cvs/hdrs/s_from.h
*** elm2.4.ME+.101/hdrs/s_from.h 2002-01-26 13:14:45.000000000 +0200
--- elm2.4.ME+.102cvs/hdrs/s_from.h 2003-05-09 19:13:44.000000000 +0300
***************
*** 7,14 ****
#define FromCouldntExpandFilename 0x5
#define FromNotRegularFile 0x6
#define FromNoMail 0x7
! #define FromCouldntOpenFolder 0x8
! #define FromCouldntOpenFolderPlural 0x9
#define FromStringNoMail 0xa
#define FromNoMesgInFolder 0xb
#define FromNoExplainMail 0xc
--- 7,14 ----
#define FromCouldntExpandFilename 0x5
#define FromNotRegularFile 0x6
#define FromNoMail 0x7
! #define FromCouldntOpenX 0x8
! #define FromCouldntOpenFolderOrMailbox 0x9
#define FromStringNoMail 0xa
#define FromNoMesgInFolder 0xb
#define FromNoExplainMail 0xc
***************
*** 38,40 ****
--- 38,43 ----
#define FromReadOrUnread 0x24
#define FromUnknown 0x25
#define FromArgsIngoringDebug 0x26
+ #define FromNotMailbox 0x27
+ #define FromNoMesgInMailbox 0x28
+ #define FromNoExplainMessagesMbox 0x29
Index: elm2.4.ME+.102cvs/hdrs/s_me.h
*** elm2.4.ME+.101/hdrs/s_me.h 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/hdrs/s_me.h 2003-05-25 14:19:57.000000000 +0300
***************
*** 315,317 ****
--- 315,321 ----
#define MeMailcapRunningOK 0x14f
#define MeUnknownTerminalFlag 0x150
#define MeFailLink 0x151
+ #define MeLibraryRegistered 0x152
+ #define MeLibraryUnRegistered 0x153
+ #define MeLibraryAvailable 0x154
+ #define MeLibraryUnavailable 0x155
Index: elm2.4.ME+.102cvs/lib/charset.c
*** elm2.4.ME+.101/lib/charset.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/charset.c 2003-05-17 19:13:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: charset.c,v 1.70 2002/11/10 11:25:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.70 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: charset.c,v 1.71 2003/05/17 16:13:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************
*** 985,990 ****
--- 985,991 ----
new_vals.MIBenum = 0;
}

+ free(val); val = NULL;

} else if (0 == strcmp(opt,"MIME-subset")) {
reallocation_needed = 1;
Index: elm2.4.ME+.102cvs/lib/cs_iso2022.c
*** elm2.4.ME+.101/lib/cs_iso2022.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/cs_iso2022.c 2003-05-26 18:19:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.31 2002/07/29 17:34:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.32 2003/05/26 15:19:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 2185,2191 ****

if (-1 != x) {
struct iso2022_setid ID;
- int setnum;
char *c = NULL;

if (x < 0 ||
--- 2185,2190 ----
***************
*** 2205,2211 ****
"Bad initial_bank (bank number)",
0);

! setnum=set_initial_bank(&c,ID,output_state,NULL,0,0);

if (c) {
int l = strlen(c);
--- 2204,2210 ----
"Bad initial_bank (bank number)",
0);

! set_initial_bank(&c,ID,output_state,NULL,0,0);

if (c) {
int l = strlen(c);
***************
*** 2282,2288 ****
int char_added = 0;

if (*need_reset) {
- int i;

RESET_ROUTINE(ret,len,alloced,output_state,iso2022_info);

--- 2281,2286 ----
Index: elm2.4.ME+.102cvs/lib/debug.c
*** elm2.4.ME+.101/lib/debug.c 2002-06-06 18:55:56.000000000 +0300
--- elm2.4.ME+.102cvs/lib/debug.c 2003-05-17 19:13:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: debug.c,v 1.18 2002/06/01 12:58:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: debug.c,v 1.19 2003/05/17 16:13:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 134,139 ****
--- 134,141 ----
char * match_filename = NULL;
struct class_level_pair C;

+ struct class_level_pair *tmp1;
+
DEBUG_VAR(temp,__FILE__,"");

char * ptr;
***************
*** 208,219 ****

if (home[0])
init_debug(X);
! debug_list = X;
}

! X->match = safe_realloc(X->match,
! (1 + X->match_count) * sizeof (X->match[0]));
! X->match[X->match_count++] = C;

if (!debug_list)
atexit(close_all);
--- 210,237 ----

if (home[0])
init_debug(X);
!
!
! debug_list = X;
}

!
! /* safe_realloc() calls DPRINT and therefore may refere X->match
! before it is assigned .. so we do not use safe_realloc()
! on here ... */
!
! tmp1 = realloc(X->match,
! (1 + X->match_count) * sizeof (X->match[0]));
!
! if (tmp1) {
! X->match = tmp1;
! X->match[X->match_count++] = C;
! } else {
! debug_action_call(&temp,
! "Can't alloc memory for class %s at debug level %d (size %d)\n",
! C.class,C.level,
! (1 + X->match_count) * sizeof (X->match[0]));
! }

if (!debug_list)
atexit(close_all);
Index: elm2.4.ME+.102cvs/lib/expand.c
*** elm2.4.ME+.101/lib/expand.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/lib/expand.c 2003-04-12 11:16:23.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: expand.c,v 1.15 2003/02/17 17:36:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: expand.c,v 1.16 2003/04/12 08:16:23 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 87,93 ****
int len, p;
char envname_buf[SLEN];

! if ((len = strcspn(src, "/")) == 0)
len = strlen(src);
src += len;
strnfcpy(envname_buf, envname_front, len,
--- 87,93 ----
int len, p;
char envname_buf[SLEN];

! if ((len = strcspn(src, "/@")) == 0)
len = strlen(src);
src += len;
strnfcpy(envname_buf, envname_front, len,
Index: elm2.4.ME+.102cvs/lib/getaddr.c
*** elm2.4.ME+.101/lib/getaddr.c 2002-01-26 13:14:45.000000000 +0200
--- elm2.4.ME+.102cvs/lib/getaddr.c 2003-05-17 19:13:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.19 2001/06/06 18:08:59 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.20 2003/05/17 16:13:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************
*** 672,682 ****
free(ptr->addr);
ptr->addr = NULL;

! free(ptr->fullname);
! ptr->fullname = NULL;

! free(ptr->comment);
! ptr->comment = NULL;
}
free(list);
}
--- 672,680 ----
free(ptr->addr);
ptr->addr = NULL;

! free_string(& (ptr->fullname));

! free_string (& (ptr->comment));
}
free(list);
}
Index: elm2.4.ME+.102cvs/lib/hdrdecode.c
*** elm2.4.ME+.101/lib/hdrdecode.c 2002-01-26 13:14:46.000000000 +0200
--- elm2.4.ME+.102cvs/lib/hdrdecode.c 2003-05-17 19:13:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrdecode.c,v 1.10 2001/08/25 11:56:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrdecode.c,v 1.11 2003/05/17 16:13:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************
*** 280,285 ****
--- 280,286 ----
/* Now compine strings */
newresult = cat_strings(ret,ok,1);
free_string(&ret);
+ free_string(&ok);
ret = newresult;


***************
*** 352,357 ****
--- 353,359 ----
/* Now compine strings */
newresult = cat_strings(ret,ok,1);
free_string(&ret);
+ free_string(&ok);
ret = newresult;

last_char = 0;
***************
*** 416,421 ****
--- 418,424 ----
/* Now compine strings */
newresult = cat_strings(ret,ok,1);
free_string(&ret);
+ free_string(&ok);
ret = newresult;

if (nostore) {
Index: elm2.4.ME+.102cvs/lib/headers.c
*** elm2.4.ME+.101/lib/headers.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/headers.c 2003-04-22 21:34:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: headers.c,v 1.22 2002/12/10 20:11:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: headers.c,v 1.24 2003/04/22 18:34:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 416,422 ****
{ "Comments", hdr_decode_from_text, no_add_to_mail_hdr },
{ "Return-path", hdr_decode_from_comment, add_env_from_hdr },
{ "Received", hdr_decode_from_comment, no_add_to_mail_hdr },
! { "Reply-To", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "From", hdr_decode_from_addr, add_from_hdr },
{ "Sender", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "Resent-Reply-To", hdr_decode_from_addr, no_add_to_mail_hdr },
--- 416,422 ----
{ "Comments", hdr_decode_from_text, no_add_to_mail_hdr },
{ "Return-path", hdr_decode_from_comment, add_env_from_hdr },
{ "Received", hdr_decode_from_comment, no_add_to_mail_hdr },
! { "Reply-To", hdr_decode_from_addr, add_replyto_hdr },
{ "From", hdr_decode_from_addr, add_from_hdr },
{ "Sender", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "Resent-Reply-To", hdr_decode_from_addr, no_add_to_mail_hdr },
***************
*** 473,481 ****
{ "Sensitivity", hdr_decode_from_comment, no_add_to_mail_hdr },

/* Our non-standard headers */
! { "X-ELM-OSV", hdr_decode_from_comment },
! { "X-Mailer", hdr_decode_from_text },
! { "Content-Name", hdr_decode_from_text },

/* Tailer */
{ NULL, hdr_decode_from_raw, no_add_to_mail_hdr }
--- 473,481 ----
{ "Sensitivity", hdr_decode_from_comment, no_add_to_mail_hdr },

/* Our non-standard headers */
! { "X-ELM-OSV", hdr_decode_from_comment, no_add_to_mail_hdr },
! { "X-Mailer", hdr_decode_from_text, no_add_to_mail_hdr },
! { "Content-Name", hdr_decode_from_text, no_add_to_mail_hdr },

/* Tailer */
{ NULL, hdr_decode_from_raw, no_add_to_mail_hdr }
Index: elm2.4.ME+.102cvs/lib/imap.c
*** elm2.4.ME+.101/lib/imap.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/imap.c 2003-05-17 19:13:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: imap.c,v 1.97 2002/11/30 20:34:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.97 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: imap.c,v 1.99 2003/05/17 16:13:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.99 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 4862,4867 ****
--- 4862,4868 ----

folder -> p->fh_temp = NULL;
folder -> p->fh_folder = NULL;
+ folder ->p->flags1 = 0;

folder -> p->a.imap_mbx.Ch = create_connection(&IMAP_connection);
folder -> p->a.imap_mbx.Ch->f = folder; /* Back link */
***************
*** 5699,5706 ****
"mbx_copy_envelope_imap: real_from() failed with generated separator line: %s\n",
tmp));

! if (data)
! free(data);
data = NULL;

goto clean;
--- 5700,5706 ----
"mbx_copy_envelope_imap: real_from() failed with generated separator line: %s\n",
tmp));

! free(data);
data = NULL;

goto clean;
***************
*** 5716,5729 ****
if (!mbx_copy_line_to_temp(folder,data,l)) {
status = 0;

! if (data)
! free(data);
data = NULL;

goto clean;
}
read_state_ptr -> fbytes += l;
read_state_ptr -> linecounter++;
}

read_state_ptr->a.imap_mbx.data_idx = 0;
--- 5716,5731 ----
if (!mbx_copy_line_to_temp(folder,data,l)) {
status = 0;

! free(data);
data = NULL;

goto clean;
}
read_state_ptr -> fbytes += l;
read_state_ptr -> linecounter++;
+
+ free(data);
+ data = NULL;
}

read_state_ptr->a.imap_mbx.data_idx = 0;
***************
*** 5795,5800 ****
--- 5797,5803 ----
memcpy(*buffer,
ref->header + read_state_ptr->a.imap_mbx.data_idx,
*len);
+ (*buffer)[*len] = '\0';

DPRINT(Debug,65,(&Debug,
"imap_got_header_line=1: len=%d, buffer=%.*s",
***************
*** 5928,5933 ****
--- 5931,5942 ----
}

hide:
+ if (buffer1) {
+ DPRINT(Debug,11,(&Debug, " ... Freeing buffer1=%s\n",buffer1));
+ free(buffer1);
+ buffer1 = NULL;
+ }
+
if (!imap_got_header_line(folder,read_state_ptr,&buffer1,&len1,ref)) {
status = 0;
goto clean;
Index: elm2.4.ME+.102cvs/lib/iso2022.c
*** elm2.4.ME+.101/lib/iso2022.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/iso2022.c 2003-05-26 18:19:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.20 2002/07/29 09:00:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.21 2003/05/26 15:19:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 1827,1833 ****
left_right = 1;

if (left_right >= 0) {
- enum iso2022_bank bank = bank_unspecified;

for (i= 0; iso2022_banks[i].keyword; i++)
if (0 == strcmp(iso2022_banks[i].keyword,value))
--- 1827,1832 ----
Index: elm2.4.ME+.102cvs/lib/localmbx.c
*** elm2.4.ME+.101/lib/localmbx.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/localmbx.c 2003-05-11 23:42:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.57 2002/12/11 17:58:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.59 2003/05/11 20:42:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.59 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************
*** 2036,2041 ****
--- 2036,2043 ----

folder ->p->fh_temp = NULL;
folder ->p->fh_folder = NULL;
+ folder ->p->flags1 = 0;
+
}

static void mbx_init_spool P_((struct folder_info *folder));
***************
*** 2055,2060 ****
--- 2057,2063 ----
bzero((void *)folder -> p,sizeof (struct private_data));
folder ->p->fh_temp = NULL;
folder ->p->fh_folder = NULL;
+ folder ->p->flags1 = 0;

folder -> p -> a.spool.lock_state = OFF;
#ifdef USE_DOTLOCK_LOCKING
***************
*** 3156,3180 ****
read_state_ptr -> linecounter = 0; /* Linecounter of current
message */
entry->offset = read_state_ptr -> fbytes; /* Offset of current message */
- entry->status = VISIBLE | UNREAD; /* Default status of message */

! switch(def_folder_status) {
! case FOLDER_STATUS_READ:
! entry->status = VISIBLE;
! break;
! case FOLDER_STATUS_OLD:
! entry->status = VISIBLE | UNREAD;
! break;
! case FOLDER_STATUS_NEW:
! entry->status = VISIBLE | NEW | UNREAD;
! break;
! default:
! DPRINT(Debug,1,(&Debug,
! "default-folder-status=%d BAD\n",
! def_folder_status));
}
- DPRINT(Debug,11,(&Debug, " status=%x -- def_folder_status=%d\n",
- entry->status,entry->status));

if (!mbx_read_buffered_line(folder,read_state_ptr,
&buffer,&len)) {
--- 3159,3192 ----
read_state_ptr -> linecounter = 0; /* Linecounter of current
message */
entry->offset = read_state_ptr -> fbytes; /* Offset of current message */

!
! if ( FLAG1_CHECKNEW & folder -> p -> flags1 ) {
! /* Really treat as mailbox and not as folder ... */
! entry->status = VISIBLE | NEW | UNREAD; /* Default status of message */
!
! } else {
!
! entry->status = VISIBLE | UNREAD; /* Default status of message */
!
! switch(def_folder_status) {
! case FOLDER_STATUS_READ:
! entry->status = VISIBLE;
! break;
! case FOLDER_STATUS_OLD:
! entry->status = VISIBLE | UNREAD;
! break;
! case FOLDER_STATUS_NEW:
! entry->status = VISIBLE | NEW | UNREAD;
! break;
! default:
! DPRINT(Debug,1,(&Debug,
! "default-folder-status=%d BAD\n",
! def_folder_status));
! }
! DPRINT(Debug,11,(&Debug, " status=%x -- def_folder_status=%d\n",
! entry->status,entry->status));
}

if (!mbx_read_buffered_line(folder,read_state_ptr,
&buffer,&len)) {
Index: elm2.4.ME+.102cvs/lib/mbox.c
*** elm2.4.ME+.101/lib/mbox.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/mbox.c 2003-05-17 19:13:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.43 2002/12/08 14:30:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.46 2003/05/17 16:13:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************
*** 874,879 ****
--- 874,883 ----
new_folder -> folder_type->init_it(new_folder);
}

+ /* HACK */
+ if (new_folder->p)
+ new_folder->p->flags1 = 0;
+
#if 0
DPRINT(Debug,1,(&Debug,
"New folder %s type %s temp file %s (%s)\n",
***************
*** 991,996 ****
--- 995,1020 ----
folder,folder->cur_folder_sys,folder -> folder_type,
folder->folder_type->type_name));

+ /* HACK */
+
+ if (folder->p)
+ folder->p->flags1 = 0;
+
+ switch (mode) {
+ case SESSIONLOCK_NONE_CHECKNEW:
+
+ if (folder->p)
+ folder->p->flags1 |= FLAG1_CHECKNEW;
+ else {
+ DPRINT(Debug,10,(&Debug,
+ "sessionlock_folder: SESSIONLOCK_NONE_CHECKNEW unsupported\n"));
+
+ }
+
+ mode = SESSIONLOCK_NONE;
+ break;
+ }
+
ret = folder->folder_type->sessionlock_it(folder,mode);

DPRINT(Debug,10,(&Debug,
***************
*** 1342,1348 ****


if (status > 0) {
! header_list_ptr parsed_headers;

DPRINT(Debug,12,(&Debug,
"prepare_message_access: hdr %ld body %ld\n",
--- 1366,1372 ----


if (status > 0) {
! header_list_ptr parsed_headers = NULL;

DPRINT(Debug,12,(&Debug,
"prepare_message_access: hdr %ld body %ld\n",
***************
*** 1356,1362 ****
DPRINT(Debug,10,(&Debug,
"prepare_message_access: parse_header callback failed (%d)\n",
status));
! goto fail2;
}

status = parse_body(folder,read_state_ptr,entry,parsed_headers,counter);
--- 1380,1386 ----
DPRINT(Debug,10,(&Debug,
"prepare_message_access: parse_header callback failed (%d)\n",
status));
! goto fail3;
}

status = parse_body(folder,read_state_ptr,entry,parsed_headers,counter);
***************
*** 1365,1370 ****
--- 1389,1398 ----
"prepare_message_access: parse_body callback failed (%d)\n",
status));
}
+ fail3:
+ if (parsed_headers) {
+ delete_headers(&parsed_headers);
+ }
}
fail2:

Index: elm2.4.ME+.102cvs/lib/outheaders.c
*** elm2.4.ME+.101/lib/outheaders.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/outheaders.c 2003-04-22 21:34:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.10 2002/07/04 15:40:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.11 2003/04/22 18:34:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 401,406 ****
--- 401,442 ----
}

#ifdef ANSI_C
+ hdr_add_to_mailing_hdr add_replyto_hdr;
+ #endif
+ int add_replyto_hdr(headers,X,value,demime,defcharset,replace)
+ struct mailing_headers * headers;
+ header_ptr X;
+ CONST char *value;
+ int demime;
+ charset_t defcharset;
+ int replace;
+ {
+ int j;
+
+ struct addr_item * TMP;
+
+ TMP = break_down_address(value,demime,defcharset);
+
+ if (replace)
+ free_expanded_address(&(headers->reply_to));
+
+ for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {
+ int pos = add_expanded_addr_(&(headers->reply_to),
+ TMP[j].addr,
+ TMP[j].fullname,
+ TMP[j].comment);
+ struct string *s = make_surface_addr(TMP[j]);
+ add_textual_addr_(&(headers->reply_to),s,pos,1);
+ free_string(&s);
+ }
+
+ free_addr_items(TMP);
+
+ return 1;
+ }
+
+
+ #ifdef ANSI_C
hdr_add_to_mailing_hdr add_env_from_hdr;
#endif
int add_env_from_hdr(headers,X,value,demime,defcharset,replace)
Index: elm2.4.ME+.102cvs/lib/pop.c
*** elm2.4.ME+.101/lib/pop.c 2002-06-06 18:55:57.000000000 +0300
--- elm2.4.ME+.102cvs/lib/pop.c 2003-05-17 19:13:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pop.c,v 1.42 2002/06/01 12:58:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: pop.c,v 1.44 2003/05/17 16:13:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 887,892 ****
--- 887,893 ----

folder ->p->fh_temp = NULL;
folder ->p->fh_folder = NULL;
+ folder ->p->flags1 = 0;

zero_remote_account(&(folder -> p->a.pop_mbx.C));

***************
*** 2530,2536 ****
int i;
for (i = 0; i < rs->a.pop_mbx.rfc822_size_count; i++)
rs->a.pop_mbx.rfc822_size_vector[i] = -1;
! rs->a.pop_mbx.uidl_vector = NULL;
}
rs->a.pop_mbx.rfc822_size_count = 0;
}
--- 2531,2538 ----
int i;
for (i = 0; i < rs->a.pop_mbx.rfc822_size_count; i++)
rs->a.pop_mbx.rfc822_size_vector[i] = -1;
! free(rs->a.pop_mbx.rfc822_size_vector);
! rs->a.pop_mbx.rfc822_size_vector = NULL;
}
rs->a.pop_mbx.rfc822_size_count = 0;
}
Index: elm2.4.ME+.102cvs/lib/rc_handle.c
*** elm2.4.ME+.101/lib/rc_handle.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/rc_handle.c 2003-05-17 19:13:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.11 2002/12/08 14:30:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.12 2003/05/17 16:13:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
****************************************************************************
***************
*** 1127,1133 ****
fieldname,val,recursive));
}

! for (p = val; (*p || start_val) && !quit_flag; p++) {
char * value = NULL;

/* Quarantee that we do not advance bast of \0 */
--- 1127,1133 ----
fieldname,val,recursive));
}

! for (p = val; !quit_flag && (*p || start_val); p++) {
char * value = NULL;

/* Quarantee that we do not advance bast of \0 */
Index: elm2.4.ME+.102cvs/lib/read_rc.c
*** elm2.4.ME+.101/lib/read_rc.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/lib/read_rc.c 2003-05-17 19:13:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.114 2003/03/19 17:48:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.114 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.115 2003/05/17 16:13:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.115 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************
*** 112,118 ****
int clear_pages = 0; /* flag: act like "page" (more -c)? */
int title_messages = 1; /* flag: title message display? */

! nl_catd elm_msg_cat = 0; /* message catalog */

char username[SLEN] = {0}; /* return address name! */
char home[SLEN] = {0}; /* home directory of user */
--- 112,122 ----
int clear_pages = 0; /* flag: act like "page" (more -c)? */
int title_messages = 1; /* flag: title message display? */

! nl_catd elm_msg_cat = 0; /* message catalog */
! /* WARNING: Elm's version uses 0 as failure
! System uses (nl_catd) -1 as failure !
! */
!

char username[SLEN] = {0}; /* return address name! */
char home[SLEN] = {0}; /* home directory of user */
***************
*** 398,431 ****
static int locale_error = 0;

void locale_init () {
-
#ifdef I_LOCALE
! char *res;

! if (setlocale(LC_ALL, "") == NULL) {
! lib_error(FRM("Elm: Unsupported locale (check $LANG)\n"));
! if (setlocale(LC_CTYPE,"") != NULL) {
! lib_error(FRM("Elm: ... but succeed setting of LC_CTYPE\n"));
! } else {
! lib_error(FRM("Elm: ... check also $LC_CTYPE\n"));
! }
! locale_error = 1;
! }
#endif

! elm_msg_cat = catopen("elm2.4me+", 0);

#ifdef I_LOCALE
! res = setlocale(LC_CTYPE,NULL);
! if (!res) {
! lib_error(FRM("Elm: Unable to get current locale (LC_CTYPE)\n"));
! locale_error = 1;
! } else
! strfcpy(display_locale,res, sizeof display_locale);
#endif

#ifdef HAVE_CODESET
! res = nl_langinfo(CODESET);

if (!res) {
lib_error(FRM("Elm: Unable to get CODESET for current locale\n"));
--- 402,452 ----
static int locale_error = 0;

void locale_init () {
#ifdef I_LOCALE
! char *res;
! #endif
!
! DPRINT(Debug,9,(&Debug,
! "locale_init: called = %d\n",
! locale_init_called));
!
! #ifdef I_LOCALE

! if (setlocale(LC_ALL, "") == NULL) {
! lib_error(FRM("Elm: Unsupported locale (check $LANG)\n"));
! if (setlocale(LC_CTYPE,"") != NULL) {
! lib_error(FRM("Elm: ... but succeed setting of LC_CTYPE\n"));
! } else {
! lib_error(FRM("Elm: ... check also $LC_CTYPE\n"));
! }
! locale_error = 1;
! }
#endif
+
+ /* WARNING: Elm's version uses 0 as failure
+ * System uses (nl_catd) -1 as failure !
+ */

!
! elm_msg_cat = catopen("elm2.4me+", 0);
! if (0 == elm_msg_cat ||
! (nl_catd) -1 == elm_msg_cat) {
! DPRINT(Debug,9,(&Debug,
! "locale_init: catopen elm2.4me+ failed\n"));
! }
! /* NOTE: elm_msg_cat 'leaks' on end of program ... */

#ifdef I_LOCALE
! res = setlocale(LC_CTYPE,NULL);
! if (!res) {
! lib_error(FRM("Elm: Unable to get current locale (LC_CTYPE)\n"));
! locale_error = 1;
! } else
! strfcpy(display_locale,res, sizeof display_locale);
#endif

#ifdef HAVE_CODESET
! res = nl_langinfo(CODESET);

if (!res) {
lib_error(FRM("Elm: Unable to get CODESET for current locale\n"));
Index: elm2.4.ME+.102cvs/lib/safemalloc.c
*** elm2.4.ME+.101/lib/safemalloc.c 2002-01-26 13:14:46.000000000 +0200
--- elm2.4.ME+.102cvs/lib/safemalloc.c 2003-05-26 18:19:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: safemalloc.c,v 1.9 2001/06/14 18:25:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: safemalloc.c,v 1.11 2003/05/26 15:19:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 90,97 ****
void safe_free(x)
malloc_t x;
{
- int i;
- char *p = x;
DPRINT(Debug,100,(&Debug,
"(safe)free(%p) ",x));

--- 90,95 ----
***************
*** 101,112 ****
"** FREE OF NULL POINTER\n"));
}

- for (i = 0; i < 30 && p && p[i]; i++) {
- DPRINT(Debug,100,(&Debug,
- "%c",
- isascii(p[i]) && isprint(p[i]) ? p[i] : '?'));
- }
-
free(x);
DPRINT(Debug,100,(&Debug,
"\n"));
--- 99,104 ----
Index: elm2.4.ME+.102cvs/lib/savefolder.c
*** elm2.4.ME+.101/lib/savefolder.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/lib/savefolder.c 2003-05-17 19:13:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.71 2003/02/28 10:48:14 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.72 2003/05/17 16:13:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.72 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************
*** 2231,2236 ****
--- 2231,2239 ----
{
(*dir)->type->browser_free_it(*dir);
clear_dir_vector(*dir);
+
+ if ((*dir)->selection)
+ clear_dir_selection(*dir);

if ((*dir)->dirname)
free_string(&((*dir)->dirname));
Index: elm2.4.ME+.102cvs/lib/service_list.c
*** elm2.4.ME+.101/lib/service_list.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/service_list.c 2003-05-17 19:13:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.22 2002/06/30 13:52:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.23 2003/05/17 16:13:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 910,915 ****
--- 910,918 ----
free((*Y)->option_list);
(*Y)->option_list = NULL;
(*Y)->option_count = 0;
+
+ /* Temporary entry is malloced ... */
+ free(*Y);
}
/* If not temporary, we assume that this entry is on list
and therefore that does not produce dangling pointer
Index: elm2.4.ME+.102cvs/lib/shared.c
*** elm2.4.ME+.101/lib/shared.c 2002-06-06 18:55:58.000000000 +0300
--- elm2.4.ME+.102cvs/lib/shared.c 2003-05-27 21:54:13.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared.c,v 1.42 2002/04/01 17:09:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared.c,v 1.47 2003/05/27 18:54:13 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 778,783 ****
--- 778,853 ----
return ret;
}

+ /* For elmlibregister.c -- if argv is NULL only check current list */
+ void test_and_set_shared (argv, will_write)
+ char **argv;
+ int will_write;
+ {
+ int i;
+
+ /* 1) Load current libraries */
+
+ load_shared_libs();
+
+ if (argv) {
+
+ /* 2) Test explicity argument list ....
+ */
+
+ int j;
+
+ for (j = 0; argv[j]; j++) {
+ struct ImpInfo * I;
+ int idx;
+
+ if (!tag_ok(argv[j])) {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeInvalidUseLib,
+ "use-library: %s: Invalid name"),
+ argv[j]);
+ continue;
+ }
+
+ I = give_impinfo(argv[j]);
+ idx = I - use_library_list;
+
+ /* Assume valid */
+ use_library_list[idx].valid = 1;
+ load_code(idx); /* Test validity */
+
+ if (use_library_list[idx].valid) {
+ if (will_write)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeLibraryRegistered,
+ "Library %s registered"),
+ argv[j]);
+ else
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeLibraryAvailable,
+ "Library %s is available"),
+ argv[j]);
+ }
+ }
+ }
+
+ for (i = 0; i < use_library_list_count; i++) {
+ if (!use_library_list[i].valid) {
+ if (will_write)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeLibraryUnRegistered,
+ "Library %s unregistered"),
+ use_library_list[i].tag);
+ else
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeLibraryUnavailable,
+ "Library %s is unavailable"),
+ use_library_list[i].tag);
+
+
+ }
+ }
+ }
+
struct POP_capa_libs {
char * capa;
char * capa_args;
***************
*** 1147,1152 ****
--- 1217,1230 ----
int * imap_capa_libcount;
{
if (*imap_capa_libs) {
+ int i;
+
+ for (i = 0; i < *imap_capa_libcount; i++) {
+ if ((*imap_capa_libs)[i].capa) {
+ free((*imap_capa_libs)[i].capa);
+ (*imap_capa_libs)[i].capa = NULL;
+ }
+ }
free(*imap_capa_libs);
*imap_capa_libs = NULL;
*imap_capa_libcount = 0;
***************
*** 1323,1328 ****
--- 1401,1410 ----
fprintf(F,"%s:\n",
use_library_list[i].tag);

+ DPRINT(Debug,8,(&Debug, " -- library %s -- %d options\n",
+ use_library_list[i].tag,
+ use_library_list[i].rc_option_count));
+
for (x = 0; x < use_library_list[i].rc_option_count; x++) {
int local_value;

***************
*** 1353,1363 ****
local_value =
use_library_list[i].rc_options[x].flags & FL_LOCAL;

! if (!valid_rc_type(use_library_list[i].rc_options[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,
"print_local_shared_options",
"Bad config item type",0);
!
use_library_list[i].
rc_options[x].dt_type->
print_value(F,
--- 1435,1452 ----
local_value =
use_library_list[i].rc_options[x].flags & FL_LOCAL;

! if (!valid_rc_type(use_library_list[i].rc_options[x].dt_type)) {
! DPRINT(Debug,1,(&Debug,
! "shlib/option %d -- \"%s\" BAD, flags=%0x (library=%s)\n",
! x,use_library_list[i].rc_options[x].name,
! save_info[x].flags,
! use_library_list[i].tag
! ));
!
panic("RC PANIC",__FILE__,__LINE__,
"print_local_shared_options",
"Bad config item type",0);
! }
use_library_list[i].
rc_options[x].dt_type->
print_value(F,
Index: elm2.4.ME+.102cvs/lib/streamsched.c
*** elm2.4.ME+.101/lib/streamsched.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/lib/streamsched.c 2003-05-17 19:13:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.28 2002/12/10 20:11:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.29 2003/05/17 16:13:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 180,185 ****
--- 180,190 ----
close(ss->this_stack[stack_idx].simple->socket);
ss->this_stack[stack_idx].simple->socket = -1;
}
+
+ ss->this_stack[stack_idx].simple->type = NULL;
+
+ free(ss->this_stack[stack_idx].simple);
+ ss->this_stack[stack_idx].simple = NULL;
}

static int ss_StreamNoAction P_((struct streamsched *ss, int stack_idx));
Index: elm2.4.ME+.102cvs/lib/terminal.c
*** elm2.4.ME+.101/lib/terminal.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/lib/terminal.c 2003-05-26 18:19:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.35 2003/02/16 18:30:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.36 2003/05/26 15:19:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 1423,1431 ****


if (-1 != x) {
- int n;
struct iso2022_setid ID;
- char * c = NULL;

if (x < 0 ||
x >= sizeof (iso2022_info->sets) /
--- 1423,1429 ----
***************
*** 1444,1450 ****
"Bad initial_bank (bank number)",
0);

! n = set_initial_bank(&ret,ID,terminal_info,NULL,0,0);

}
}
--- 1442,1448 ----
"Bad initial_bank (bank number)",
0);

! set_initial_bank(&ret,ID,terminal_info,NULL,0,0);

}
}
***************
*** 1573,1579 ****
int size;
int maybe_signal;
{
- int i;
int setpos = -1;

if (ID.bank < 0 || ID.bank >= ISO2022_BANK_NUM)
--- 1571,1576 ----
Index: elm2.4.ME+.102cvs/Makefile-1.SH
*** elm2.4.ME+.101/Makefile-1.SH 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/Makefile-1.SH 2003-05-25 14:19:57.000000000 +0300
***************
*** 27,33 ****
echo "Extracting Makefile-1 (with variable substitutions)"
cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.3 2003/03/17 18:55:52 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 27,33 ----
echo "Extracting Makefile-1 (with variable substitutions)"
cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.4 2003/05/25 11:19:57 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
***************
*** 55,61 ****
uninstall_s:
$(REG) rm $(LOCALETARG) $(LIB)/elm.map.bin/unidata.bin

! install_s: $(LIB) $(ETC) $(STAGE) $(ETC)/elm.rc $(LOCALETARG) $(LIB)/elm.map.bin/unidata.bin

$(ETC)/elm.rc: $(LIB)/elmrc-write doc/elmrc-info
$(REG) {$(LIB)/elmrc-write} -G -I -C {doc/elmrc-info}
--- 55,62 ----
uninstall_s:
$(REG) rm $(LOCALETARG) $(LIB)/elm.map.bin/unidata.bin

! install_s: $(LIB) $(ETC) $(STAGE) $(ETC)/elm.rc $(LOCALETARG) \
! $(LIB)/elm.map.bin/unidata.bin libreg

$(ETC)/elm.rc: $(LIB)/elmrc-write doc/elmrc-info
$(REG) {$(LIB)/elmrc-write} -G -I -C {doc/elmrc-info}
***************
*** 90,93 ****
$(STAGEP):
$(REG) mkdir $(STAGEP)

! !NO!SUBS!
\ No newline at end of file
--- 91,120 ----
$(STAGEP):
$(REG) mkdir $(STAGEP)

! !NO!SUBS!
!
!
! case "$d_dlopen_libs" in
! define)
! aa=
! if $test "$shared_register" != none ; then
! aa="$shared_register"
! fi
! cat >>Makefile-1 <<!SUBS!
!
! # Register new libraries and unregister removed libraries
! # Also libraries which are not loadable are unregistered
! libreg:
! \$(REG) {\$(LIB)/elmlibregister} -G -I $aa
! !SUBS!
!
! ;;
! *)
!
! cat >>Makefile-1 <<'!NO!SUBS!'
!
! !NO!SUBS!
! libreg:
!
! ;;
! esac
Index: elm2.4.ME+.102cvs/Makefile.SH
*** elm2.4.ME+.101/Makefile.SH 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/Makefile.SH 2003-05-18 09:52:49.000000000 +0300
***************
*** 21,27 ****
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.14 2003/03/17 11:36:20 hurtta Exp $
#
# Makefile for the entire ELM mail system
#
--- 21,27 ----
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.16 2003/05/18 06:52:49 hurtta Exp $
#
# Makefile for the entire ELM mail system
#
***************
*** 72,77 ****
--- 72,86 ----
uninstall: config.h config.sh installer
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) uninstall_s

+ # Helper target for testing
+ install_libs: config.h config.sh hdrs/sysdefs.h Makefile installer all
+ bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) install_libs_s
+ bin/elmregister replay
+
+ install_libs_s: config.h config.sh hdrs/sysdefs.h
+ cd lib; $(MAKE) $(MJ) $(MFLAGS) install_s
+ cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) install_s
+
# Targets that are simply executed in each subordinate makefile as is
all install_s uninstall_s lint clean: config.h config.sh hdrs/sysdefs.h Makefile
cd lib; $(MAKE) $(MJ) $(MFLAGS) $@
Index: elm2.4.ME+.102cvs/MANIFEST
*** elm2.4.ME+.101/MANIFEST 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/MANIFEST 2003-05-25 16:57:44.000000000 +0300
***************
*** 352,354 ****
--- 352,357 ----
utils/reghelper.c
hdrs/reghelper.h
doc/elmregister.1
+ utils/elmlibregister.c
+ doc/elmlibregister.1
+ doc/elmlibregister.1
Index: elm2.4.ME+.102cvs/melib/mailcap.c
*** elm2.4.ME+.101/melib/mailcap.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/melib/mailcap.c 2003-05-25 19:06:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.4 2003/03/18 20:20:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.8 2003/05/25 16:06:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 60,67 ****

struct agv1 {
enum arg_type { mv_literal,
! mv_filename, mv_type, mv_parameter } type;
!

struct arg {
int arg_len;
--- 60,68 ----

struct agv1 {
enum arg_type { mv_literal,
! mv_filename, mv_type, mv_parameter,
! mv_environ /* Environment variable inside of " */
! } type;

struct arg {
int arg_len;
***************
*** 620,625 ****
--- 621,656 ----
switch (entry_state) {
case mcES_arg:

+ if (mv_environ == arg_type) {
+
+ if(isascii(c) && isalpha(c)) {
+ /* OK */
+
+ } else if ('/' == c ||
+ '"' == c ||
+ ' ' == c ||
+ '\t' == c) {
+
+ /* Variable terminated ...
+ let next condition check it ...
+ */
+
+ arg_type = mv_literal;
+ add_mailcap_vector(vector,vector_count,arg_type,-1);
+
+ } else {
+
+ DPRINT(Debug,2,(&Debug,
+ "mailcap %s, line %d -- character %c unsupported on $\n",
+ mailcaps[mailcap_idx],
+ linenum,c));
+
+ entry_state = mcES_error;
+ break;
+
+ }
+
+ }

if (mv_literal == arg_type) {
/* Check unsupported characters --
***************
*** 630,645 ****

case '\'':

! if ( 0 == is_shell_quoted)
! is_shell_quoted = '\'';
! else if ( '\'' == is_shell_quoted)
is_shell_quoted = 0;

/* Quarantee that there is argument -- even when
'' was given
*/
add_mailcap_vector(vector,vector_count,arg_type,-1);
! break;

case '"':

--- 661,676 ----

case '\'':

! if ( 0 == is_shell_quoted)
! is_shell_quoted = '\'';
! else if ( '\'' == is_shell_quoted)
is_shell_quoted = 0;

/* Quarantee that there is argument -- even when
'' was given
*/
add_mailcap_vector(vector,vector_count,arg_type,-1);
! goto out_1; /* DO not add quote to string */

case '"':

***************
*** 652,659 ****
"" was given
*/
add_mailcap_vector(vector,vector_count,arg_type,-1);
! break;
!

case '#':
case '&':
--- 683,689 ----
"" was given
*/
add_mailcap_vector(vector,vector_count,arg_type,-1);
! goto out_1; /* DO not add quote to string */

case '#':
case '&':
***************
*** 676,681 ****
--- 706,740 ----
break; /* WAS OK */

case '$':
+
+ if ('"' == is_shell_quoted) {
+ /* variables inside of " are OK */
+
+ c = getc(F);
+
+ if (isascii(c) && isalpha(c)) {
+
+ arg_type = mv_environ;
+ add_mailcap_vector(vector,vector_count,arg_type,
+ -1);
+
+ /* c is added later */
+
+ break; /* OK */
+ } else {
+ DPRINT(Debug,2,(&Debug,
+ "mailcap %s, line %d -- shell special $%c unsupported\n",
+ mailcaps[mailcap_idx],
+ linenum,c));
+
+ entry_state = mcES_error;
+ break;
+ }
+
+ }
+
+
+
case '`':


***************
*** 706,711 ****
--- 765,773 ----
} else
add_mailcap_vector(vector,vector_count,
arg_type,c);
+
+ out_1:
+
break;

case mcES_keyword:
***************
*** 774,780 ****
if (mcES_error == entry_state) {
unsupported++;
} else if (mcES_arg == entry_state &&
! mv_literal == arg_type &&
is_shell_quoted) {
DPRINT(Debug,2,(&Debug,
"mailcap %s, line %d -- Shell quote %c not terminated before ;",
--- 836,844 ----
if (mcES_error == entry_state) {
unsupported++;
} else if (mcES_arg == entry_state &&
! (mv_literal == arg_type ||
! mv_environ == arg_type)
! &&
is_shell_quoted) {
DPRINT(Debug,2,(&Debug,
"mailcap %s, line %d -- Shell quote %c not terminated before ;",
***************
*** 879,884 ****
--- 943,950 ----
arg_free(&string);
free_mailcap_vector(&vector,&vector_count);

+ fclose(F);
+
}

mailcaps_readed = 1;
***************
*** 911,916 ****
--- 977,983 ----
switch(subvector[i].type) {
int tmp,l,l2;
CONST char *ma, *mi;
+ char *e;
char buffer[STRING];

case mv_literal:
***************
*** 922,927 ****
--- 989,1012 ----
ret[retlen] = '\0';
break;

+ case mv_environ:
+ e = getenv(subvector[i].arg.arg);
+ if (!e) {
+ DPRINT(Debug,12,(&Debug,
+ "make_mailcap_arg: Environ variable $%s not found, treating as \"\"\n",
+ subvector[i].arg.arg));
+ e = "";
+ }
+ l = strlen(e);
+
+ tmp = retlen + l;
+ ret = safe_realloc(ret,tmp+1);
+
+ memcpy(ret+retlen,e,l);
+ retlen = tmp;
+ ret[retlen] = '\0';
+ break;
+
case mv_filename:

if (fn_seen)
***************
*** 1108,1125 ****
*/


! /* This block is probably no required... */
! rewind(file_handle);
#ifdef _POSIX_VERSION
/* Synzronize underlying file descriptor */
! fflush(file_handle);
#else
! seek(fileno(file_handle),0,0);
#endif

! r = start_run(&RS,flags,argv,
! fn_seen && x->needsterminal ? -1 : fileno(file_handle),
! -1);

if (!r) {
if (raw)
--- 1193,1214 ----
*/


!
! if (file_handle) {
! /* This block is probably no required... */
! rewind(file_handle);
#ifdef _POSIX_VERSION
/* Synzronize underlying file descriptor */
! fflush(file_handle);
#else
! seek(fileno(file_handle),0,0);
#endif

! r = start_run(&RS,flags,argv,
! fn_seen && x->needsterminal ? -1 : fileno(file_handle),
! -1);
! } else
! r = start_run(&RS,flags,argv,-1,-1);

if (!r) {
if (raw)
Index: elm2.4.ME+.102cvs/melib/mime_decode.c
*** elm2.4.ME+.101/melib/mime_decode.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/melib/mime_decode.c 2003-04-25 23:25:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.52 2002/12/08 14:30:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.53 2003/04/25 20:25:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.53 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************
*** 309,318 ****
if (astext && *p == '\r')
store_ch = *p;
else {
if (*p == '\n' && astext && s_out->EOLN_is_CRLF)
state_putc('\r',s_out);

! state_putc(*p,s_out);
}
if (*p == '\n') {
nl = TRUE;
--- 309,321 ----
if (astext && *p == '\r')
store_ch = *p;
else {
+ unsigned char ch;
+
if (*p == '\n' && astext && s_out->EOLN_is_CRLF)
state_putc('\r',s_out);

! ch = *p;
! state_putc(ch,s_out);
}
if (*p == '\n') {
nl = TRUE;
Index: elm2.4.ME+.102cvs/melib/mime_parse.c
*** elm2.4.ME+.101/melib/mime_parse.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.102cvs/melib/mime_parse.c 2003-05-09 08:57:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.37 2002/12/08 14:30:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.38 2003/05/09 05:57:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************
*** 421,427 ****
trg->parser_data = NULL;
trg->handler_data = NULL;

! copy_parser_data(& (trg->parser_data), src->parser_data);

if (src->description) {
trg->description = dup_string(src->description);
--- 421,434 ----
trg->parser_data = NULL;
trg->handler_data = NULL;

! if (src->parser_data) {
! copy_parser_data(& (trg->parser_data), src->parser_data);
! } else {
! DPRINT(Debug,3,(&Debug,
! "mime_t_copy(src=%p,trg=%p): src->parser_data == NULL !\n",trg,src));
!
! }
!

if (src->description) {
trg->description = dup_string(src->description);
Index: elm2.4.ME+.102cvs/melib/mpar_leaf.c
*** elm2.4.ME+.101/melib/mpar_leaf.c 2002-03-20 09:04:48.000000000 +0200
--- elm2.4.ME+.102cvs/melib/mpar_leaf.c 2003-05-26 18:19:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mpar_leaf.c,v 1.3 2002/03/19 17:18:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mpar_leaf.c,v 1.4 2003/05/26 15:19:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 10,16 ****
--- 10,18 ----
#include "melib.h"
#include "mpar_imp.h"

+ #if 0
DEBUG_VAR(Debug,__FILE__,"mime");
+ #endif

#if ANSI_C
#define S_(x) static x;
Index: elm2.4.ME+.102cvs/melib/parse_util.c
*** elm2.4.ME+.101/melib/parse_util.c 2002-06-06 18:55:59.000000000 +0300
--- elm2.4.ME+.102cvs/melib/parse_util.c 2003-05-17 19:13:41.000000000 +0300
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: parse_util.c,v 1.20 2002/04/01 17:09:47 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: parse_util.c,v 1.21 2003/05/17 16:13:41 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 246,251 ****
--- 246,252 ----
*/
state_nlputs("\n",s);
}
+ free_string(&buffer);
}

void state_write_headers(s,hdr,filter,flag,demime,defcharset)
Index: elm2.4.ME+.102cvs/nls/C/C/C/s_elmrc.m
*** elm2.4.ME+.101/nls/C/C/C/s_elmrc.m 2002-01-26 13:14:46.000000000 +0200
--- elm2.4.ME+.102cvs/nls/C/C/C/s_elmrc.m 2003-05-25 14:19:57.000000000 +0300
***************
*** 21,23 ****
--- 21,25 ----
10 Can't specify both -w and -I options!
$ #SavedAutoWrite
11 # Saved automatically by ELMRC-WRITE %s\n#\n\n
+ $ #SavedAutoLIB
+ 12 # Saved automatically by ELMLIBREGISTER %s\n#\n\n
Index: elm2.4.ME+.102cvs/nls/C/C/C/s_from.m
*** elm2.4.ME+.101/nls/C/C/C/s_from.m 2002-01-26 13:14:46.000000000 +0200
--- elm2.4.ME+.102cvs/nls/C/C/C/s_from.m 2003-05-09 19:13:44.000000000 +0300
***************
*** 13,22 ****
6 "%s" is not a regular file!\n
$ #NoMail
7 No mail.\n
! $ #CouldntOpenFolder
! 8 Couldn't open folder "%s".\n
! $ #CouldntOpenFolderPlural
! 9 Couldn't open folders "%s" or "%s".\n
$ #StringNoMail
10 %s no mail.\n
$ #NoMesgInFolder
--- 13,22 ----
6 "%s" is not a regular file!\n
$ #NoMail
7 No mail.\n
! $ #CouldntOpenX
! 8 Couldn't open %s "%s".\n
! $ #CouldntOpenFolderOrMailbox
! 9 Couldn't open folder "%s" or mailbox "%s".\n
$ #StringNoMail
10 %s no mail.\n
$ #NoMesgInFolder
***************
*** 88,90 ****
--- 88,96 ----
37 unknown
$ #ArgsIngoringDebug
38 Warning: system created without debugging enabled - request ignored\n
+ $ #NotMailbox
+ 39 WARNING: %s is folder, not mailbox!\n Delivery of new mail to folder when it is open may corrupt it
+ $ #NoMesgInMailbox
+ 40 No messages in that mailbox!\n
+ $ #NoExplainMessagesMbox
+ 41 No %s messages in that mailbox.\n
Index: elm2.4.ME+.102cvs/nls/C/C/C/s_me.m
*** elm2.4.ME+.101/nls/C/C/C/s_me.m 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/nls/C/C/C/s_me.m 2003-05-25 14:19:57.000000000 +0300
***************
*** 635,637 ****
--- 635,645 ----
336 Unknown terminal flag %s (file %s)
$ #FailLink
337 Failed to link %s to %s
+ $ #LibraryRegistered
+ 338 Library %s registered
+ $ #LibraryUnRegistered
+ 339 Library %s unregistered
+ $ #LibraryAvailable
+ 340 Library %s is available
+ $ #LibraryUnavailable
+ 341 Library %s is unavailable
Index: elm2.4.ME+.102cvs/shared_libs/smtp/smtp.c
*** elm2.4.ME+.101/shared_libs/smtp/smtp.c 2002-12-15 12:00:26.000000000 +0200
--- elm2.4.ME+.102cvs/shared_libs/smtp/smtp.c 2003-05-17 19:13:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: smtp.c,v 1.39 2002/11/10 11:25:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: smtp.c,v 1.40 2003/05/17 16:13:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 1110,1120 ****
--- 1110,1125 ----
lib_error(FRM("Connection to %s server failed"),
((*C)->head->p.p1->SMTP_flags & SMTP_submission) ?
"Submission" : "SMTP");
+
+ free(from); from = NULL;
+
free_mail_send_state(C);
return 0; /* FAIL */
}
smtp_command_reset((*C)->head->p.p1);

+ free(from); from = NULL;
+
if ((*C)->addrs) {
int i;
int fail = 0;
Index: elm2.4.ME+.102cvs/src/addr_util.c
*** elm2.4.ME+.101/src/addr_util.c 2002-06-06 18:55:59.000000000 +0300
--- elm2.4.ME+.102cvs/src/addr_util.c 2003-05-17 19:13:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.35 2002/06/06 07:46:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.36 2003/05/17 16:13:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 458,464 ****
expanded->addrs[ptr->pos].comment);
ADD_TEXTUAL(result,temp,pos,1);

! free(temp);
} else {
DPRINT(Debug,1,
(&Debug,
--- 458,464 ----
expanded->addrs[ptr->pos].comment);
ADD_TEXTUAL(result,temp,pos,1);

! free_string(&temp);
} else {
DPRINT(Debug,1,
(&Debug,
Index: elm2.4.ME+.102cvs/src/attach_menu.c
*** elm2.4.ME+.101/src/attach_menu.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/src/attach_menu.c 2003-05-09 08:57:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.49 2003/02/28 09:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.50 2003/05/09 05:57:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************
*** 1896,1912 ****
goto out;


! if (col + strlen(Encoding) +3 >= Width)
! goto out;

! x = Width - strlen(Encoding) -3;
! while (col < x) {
! Writechar(' ');
! col++;
}

- PutLine0(row, x, Encoding);
-
out:
if (is_cur && has_highlighting && ! arrow_cursor)
EndInverse();
--- 1896,1916 ----
goto out;


! if (col + strlen(Encoding) +3 >= Width) {
! if (Width-col-7 < 1)
! goto out;
! PutLineX(row, col+1, FRM("%.*s..."),
! Width-col-7,Encoding);
! } else {
! x = Width - strlen(Encoding) -3;
! while (col < x) {
! Writechar(' ');
! col++;
! }

! PutLine0(row, x, Encoding);
}

out:
if (is_cur && has_highlighting && ! arrow_cursor)
EndInverse();
Index: elm2.4.ME+.102cvs/src/builtin++.c
*** elm2.4.ME+.101/src/builtin++.c 2002-06-06 18:55:59.000000000 +0300
--- elm2.4.ME+.102cvs/src/builtin++.c 2003-05-17 19:13:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.17 2002/06/01 12:58:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.18 2003/05/17 16:13:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************
*** 118,123 ****
--- 118,124 ----

/* Current line for outputting and position on it ... */
struct string * buffer = NULL;
+ int ret = '\0';
int X = 0;
struct string * search_pattern = NULL; /* Last seach string */

***************
*** 368,374 ****
case '+':
case PAGEDOWN_MARK:
if (is_end) {
! return (' ');
}
break;
case HOME_MARK:
--- 369,376 ----
case '+':
case PAGEDOWN_MARK:
if (is_end) {
! ret = ' ';
! goto finish;
}
break;
case HOME_MARK:
***************
*** 522,530 ****
quit:
case EOF:
default:
! return (ch == 'q' || ch == 'x' ? 0 : ch);
}
}
}


--- 524,540 ----
quit:
case EOF:
default:
! ret = (ch == 'q' || ch == 'x' ? 0 : ch);
! goto finish;
}
}
+
+ finish:
+ if (buffer)
+ free_string (&buffer);
+ DPRINT(Debug,9,(&Debug,
+ "builtin++ returning %c\n",ret));
+ return ret;
}


Index: elm2.4.ME+.102cvs/src/elm.c
*** elm2.4.ME+.101/src/elm.c 2002-06-06 18:56:00.000000000 +0300
--- elm2.4.ME+.102cvs/src/elm.c 2003-05-17 19:13:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.42 2002/04/01 17:09:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elm.c,v 1.43 2003/05/17 16:13:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 106,111 ****
--- 106,126 ----

#if DEBUG
init_debugfile("ELM");
+
+ /* HACK ....
+ uSER may want enable debug output for locale_init()
+
+ This gives wrong result if some options value start
+ with "-d"
+ */
+
+ for (i = 1; i < argc; i++) {
+ if ('-' == argv[i][0] &&
+ 'd' == argv[i][1] &&
+ argv[i][2]) {
+ set_debugging(& (argv[i][2]));
+ }
+ }
#endif

locale_init();
Index: elm2.4.ME+.102cvs/src/fileio.c
*** elm2.4.ME+.101/src/fileio.c 2002-06-06 18:56:00.000000000 +0300
--- elm2.4.ME+.102cvs/src/fileio.c 2003-05-17 19:13:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.49 2002/06/01 12:58:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.50 2003/05/17 16:13:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 1327,1336 ****
--- 1327,1343 ----
}

}
+
+ if (all_headers)
+ delete_headers(&all_headers);
+
return 1;

fail:

+ if (all_headers)
+ delete_headers(&all_headers);
+
return 0;

}
Index: elm2.4.ME+.102cvs/src/hdrconfg.c
*** elm2.4.ME+.101/src/hdrconfg.c 2002-12-15 12:00:26.000000000 +0200
--- elm2.4.ME+.102cvs/src/hdrconfg.c 2003-04-09 17:22:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.25 2002/11/30 20:34:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.27 2003/04/09 14:22:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 1245,1251 ****
}

free_it:
! free(ptr);
return ret_val;
}

--- 1245,1251 ----
}

free_it:
! free_string(ptr);
return ret_val;
}

***************
*** 1407,1413 ****
}

free_it:
! free(ptr);
return ret_val;
}

--- 1407,1413 ----
}

free_it:
! free_string(ptr);
return ret_val;
}

***************
*** 1704,1710 ****
}

free_it:
! free(ptr);
return ret_val;
}

--- 1704,1710 ----
}

free_it:
! free_string(ptr);
return ret_val;
}

Index: elm2.4.ME+.102cvs/src/in_utils.c
*** elm2.4.ME+.101/src/in_utils.c 2002-12-15 12:00:26.000000000 +0200
--- elm2.4.ME+.102cvs/src/in_utils.c 2003-05-17 19:13:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.23 2002/12/08 14:30:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.24 2003/05/17 16:13:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 911,916 ****
--- 911,917 ----
}
if (str) {
strfcpy(string,str,size);
+ free(str); str = NULL;
} else
string[0] = '\0';

***************
*** 918,923 ****
--- 919,928 ----
"optionally_enter=%d string=%s\n",
ret,string));

+
+ if (buffer)
+ free_string(&buffer);
+
return(ret);
}

Index: elm2.4.ME+.102cvs/src/newmbox.c
*** elm2.4.ME+.101/src/newmbox.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/src/newmbox.c 2003-05-09 15:46:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.66 2003/02/16 14:50:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.67 2003/05/09 12:46:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 836,841 ****
--- 836,842 ----
#else
sleep(5);
#endif
+ Raw_OFF(1); /* Raw(OFF) and reprint error message */
leave(0);
}

Index: elm2.4.ME+.102cvs/src/showmsg.c
*** elm2.4.ME+.101/src/showmsg.c 2002-12-15 12:00:26.000000000 +0200
--- elm2.4.ME+.102cvs/src/showmsg.c 2003-05-26 18:19:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.23 2002/12/08 14:30:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.25 2003/05/26 15:19:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 225,232 ****


if (q >= list_len) {
- int i;
- int x = 0;

PutLineX(elm_LINES-1,1,
CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,
--- 225,230 ----
***************
*** 370,375 ****
--- 368,382 ----
failure:

if (list) {
+ int i;
+
+ for (i = 0; i < list_len; i++) {
+ if (list[i].printable_command) {
+ free(list[i].printable_command);
+ list[i].printable_command = NULL;
+ }
+ }
+
free(list);
list = NULL;
}
Index: elm2.4.ME+.102cvs/utils/elmlibregister.c
*** /tmp/2329-very-long-file-name-NULL-comes-in-here 2003-05-28 21:40:26.000000000 +0300
--- elm2.4.ME+.102cvs/utils/elmlibregister.c 2003-05-25 14:19:57.000000000 +0300
***************
*** 0 ****
--- 1,404 ----
+ static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.2 2003/05/25 11:19:57 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
+ *****************************************************************************
+ * Some code based on ../src/save_optc.c
+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1992 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************/
+
+ #include "elmutil.h"
+ #include "s_me.h"
+ #include "s_elm.h"
+ #include "s_elmrc.h"
+
+ #include "rc_imp.h"
+ #include "save_opts.h"
+
+ #include "reghelper.h"
+
+ DEBUG_VAR(Debug,__FILE__,"util");
+
+ extern char *optarg;
+ extern int optind;
+
+ int register_fd = -1;
+ char * program_name = "elmrc-write";
+
+ int main(argc, argv)
+ int argc;
+ char *argv[];
+ {
+ int err = 0;
+ int global = 0;
+ int c;
+ int write_default = 0;
+ char * targetfile = NULL;
+ FILE * commentfile = NULL;
+
+ int x;
+
+ #if DEBUG
+ init_debugfile("ELMLIBREGISTER");
+ #endif
+ locale_init();
+
+ REGHELPER_INIT(argv[0]);
+
+ while ((c = getopt(argc, argv, "GId:w:C:")) != EOF) {
+
+ switch(c) {
+ case 'G':
+ global++;
+ break;
+
+ case 'I':
+ write_default++;
+ break;
+
+ case 'd':
+ #if DEBUG
+ set_debugging(optarg);
+ #else
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,
+ "Warning: system created without debugging enabled - request ignored\n"));
+ #endif
+ break;
+
+ case 'w' :
+ targetfile = optarg;
+ if (0 != access(targetfile,WRITE_ACCESS)) {
+ int errcode = errno;
+
+ if (errcode != ENOENT) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ targetfile, error_description(errcode));
+ err++;
+ goto fail;
+ }
+ }
+ break;
+
+ case 'C':
+ if (0 != access(optarg,READ_ACCESS)) {
+ int errcode = errno;
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
+ "File %.50s is not readable: %s"),
+ optarg, error_description(errcode));
+ err++;
+ goto fail;
+ }
+
+ commentfile = fopen(optarg,"r");
+ if (!commentfile) {
+ int errcode = errno;
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
+ "File %.50s is not readable: %s"),
+ optarg, error_description(errcode));
+ err++;
+ goto fail;
+
+ }
+ break;
+
+ case '?':
+ err = 1;
+ goto fail;
+ }
+
+ }
+
+ user_init();
+ init_defaults();
+
+ elm_sfprintf(version_buff, sizeof version_buff,
+ FRM("%s PL%s"), VERSION, PATCHLEVEL);
+
+
+ #ifdef DEBUG
+ {
+ int d = panic_dprint("\n\
+ ======================================================\n\
+ Debug output of the ELMLIBREGISTER program (version %s).\n",
+ version_buff);
+
+ if (d >= 50) {
+ #if 0
+ panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");
+
+ lower_prompt("WARNING: Debug file may include passwords -- edit it!");
+ error_sleep(5+sleepmsg);
+ #endif
+ }
+ }
+ #endif
+
+ if (!global)
+ read_rc_file(0);
+
+
+ if (optind < argc) {
+ test_and_set_shared(& argv[optind] , targetfile || write_default);
+ } else {
+ /* NO libraries .. only check current .... */
+ test_and_set_shared( NULL , targetfile || write_default);
+ }
+
+ for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
+ if (0 == strcmp(save_info[x].name,"use-library"))
+ save_info[x].flags |= FL_CHANGED | FL_LOCAL;
+ }
+
+ if (!commentfile) {
+ commentfile = fopen(ELMRC_INFO,"r");
+ if (!commentfile)
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet,
+ ElmrcSavingWithoutComments,
+ "Warning: saving without comments! Can't get to %s."),
+ ELMRC_INFO);
+ }
+
+ if (targetfile && write_default) {
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcNoBothwI,
+ "Can't specify both -w and -I options!"));
+ err++;
+ goto fail;
+
+ }
+ if (write_default)
+ targetfile = global ? system_rc_file : user_rc_file;
+
+
+ if (targetfile) {
+ char * tmp = elm_message(FRM("%s.N"),targetfile);
+ int errcode = can_open(tmp,"w");
+ int x;
+ FILE *f;
+
+
+ if (errcode) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ tmp, error_description(errcode));
+
+ err++;
+ free(tmp);
+ goto fail;
+ }
+ f = fopen(tmp,"w");
+ if (!f) {
+ int errcode = errno;
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ tmp, error_description(errcode));
+
+ err++;
+ free(tmp);
+ goto fail;
+ }
+
+ elm_fprintf(f,
+ CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoLIB,
+ "# Saved automatically by ELMLIBREGISTER %s\n#\n\n"),
+ version_buff);
+
+
+ if (commentfile) {
+ char line_buffer[SLEN];
+ int x;
+ int len;
+ int local_value;
+ int skip = 1;
+
+ while (0 < (len =
+ mail_gets(line_buffer, sizeof line_buffer,
+ commentfile))) {
+
+ int y = 0;
+
+
+ if (line_buffer[len-1] != '\n') {
+ DPRINT(Debug,1,(&Debug,
+ "Too long line (read len=%d): %s\n",
+ len,line_buffer));
+ break;
+ }
+ line_buffer[--len] = '\0';
+ if (0 == len)
+ continue;
+
+ if ('#' == line_buffer[0] || whitespace(line_buffer[0])) {
+
+ if (strncmp(line_buffer, "#$HDR", 5) == 0) {
+ skip = 0;
+ continue;
+ }
+
+ if (skip)
+ continue;
+
+ /* Copy initial comments */
+
+ fprintf(f,"%s\n",line_buffer);
+ continue;
+ }
+ skip = 1;
+
+
+ for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
+ y = strcmp(line_buffer, save_info[x].name);
+ if (y <= 0)
+ break;
+ }
+
+ if (x >= NUMBER_OF_SAVEABLE_OPTIONS || y != 0) {
+
+ DPRINT(Debug,15,(&Debug,
+ "Skipping option %s ... \n",
+ line_buffer));
+
+ continue;
+ }
+
+ if (global &&
+ ! (save_info[x].flags & FL_CHANGED) &&
+ ! (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping user option %s ... \n",
+ line_buffer));
+
+ continue;
+ }
+
+ if (!global &&
+ (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping system option %s ... \n",
+ line_buffer));
+
+ continue;
+ }
+
+ fprintf(f,"\n");
+
+ /* Copy comments */
+ while (0 < (len =
+ mail_gets(line_buffer, sizeof line_buffer,
+ commentfile))) {
+ if ('#' != line_buffer[0])
+ break;
+ fputs(line_buffer,f);
+ }
+
+ if (global)
+ local_value = save_info[x].flags & FL_CHANGED;
+ else
+ local_value = save_info[x].flags & FL_LOCAL;
+ if (!valid_rc_type(save_info[x].dt_type))
+ panic("RC PANIC",__FILE__,__LINE__,"main",
+ "Bad config item type",0);
+
+ save_info[x].dt_type->print_value(f,
+ & save_info[x],
+ !local_value);
+
+
+ save_info[x].flags |= FL_SAVED;
+ }
+ }
+
+ for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
+ int local_value;
+
+
+ if (save_info[x].flags & FL_SAVED)
+ continue;
+
+ if (global &&
+ ! (save_info[x].flags & FL_CHANGED) &&
+ ! (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping user option %s ... \n",
+ save_info[x].name));
+
+ continue;
+ }
+
+ if (!global &&
+ (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping system option %s ... \n",
+ save_info[x].name));
+
+ continue;
+ }
+
+ fprintf(f,"\n");
+
+ if (global)
+ local_value = save_info[x].flags & FL_CHANGED;
+ else
+ local_value = save_info[x].flags & FL_LOCAL;
+ if (!valid_rc_type(save_info[x].dt_type))
+ panic("RC PANIC",__FILE__,__LINE__,"main",
+ "Bad config item type",0);
+
+ save_info[x].dt_type->print_value(f,
+ & save_info[x],
+ !local_value);
+ }
+
+ print_local_shared_options(f,global);
+
+ if (EOF == fclose(f)) {
+ int errcode = errno;
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ tmp, error_description(errcode));
+
+ err++;
+ free(tmp);
+ goto fail;
+ }
+ if (0 != rename(tmp,targetfile)) {
+ int errcode = errno;
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
+ "Failed to rename temporary file to %.50s: %.30s"),
+ targetfile, error_description(errcode));
+
+ err++;
+ free(tmp);
+ goto fail;
+ }
+
+ log_config(targetfile);
+
+ free(tmp);
+ }
+
+ fail:
+ if (commentfile)
+ fclose(commentfile);
+
+ if (err)
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeProgFailed,
+ "%s failed; exit code=%d"),
+ argv[0],err);
+
+ return err;
+ }
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */
Index: elm2.4.ME+.102cvs/utils/elmregister.c
*** elm2.4.ME+.101/utils/elmregister.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/utils/elmregister.c 2003-05-26 18:19:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.6 2003/03/17 18:42:25 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.9 2003/05/26 15:19:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 959,966 ****
char *argv[];
int x;
{
- char buffer[ MAX_PIPE_LOG];
- char *ptr;

int read_pipe;
int t;
--- 959,964 ----
***************
*** 1425,1431 ****
program_name,src,trg);

if (0 == mkdir(trg,0755)) {
- int r = 0;

fprintf(stderr,
"%s: Directory %s created\n",
--- 1423,1428 ----
***************
*** 1937,1943 ****

char buffer[ MAX_PIPE_LOG];
char *ptr;
- int n;

int j;

--- 1934,1939 ----
***************
*** 2012,2018 ****
0 == strcmp("link", argv[x])) {
char buffer[ MAX_PIPE_LOG];
char *ptr;
- int n;

char * translated [2];
char * relative [2];
--- 2008,2013 ----
***************
*** 2355,2361 ****

char buffer[ MAX_PIPE_LOG];
char *ptr;
- int n;

int L = 4;

--- 2350,2355 ----
***************
*** 2431,2437 ****
int *mode;
int *is_dir;
{
- int l;

struct passwd * p = NULL;
struct group * g = NULL;
--- 2425,2430 ----
***************
*** 2445,2452 ****
exit(1); /* FAILURE */
}

- l = strlen(ptr->arg_ptrs[0])+ L + 2;
-
*src = make_rooted(ptr,ptr->arg_ptrs[0],installer_root);

if (ptr->user_ptr && 0 != strcmp(ptr->user_ptr,"-")) {
--- 2438,2443 ----
***************
*** 2573,2579 ****
for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {

char * src = NULL;
- int l = 0;

uid_t id_user = (uid_t)-1;
gid_t id_group = (gid_t)-1;
--- 2564,2569 ----
***************
*** 2792,2803 ****
LI->entries[i].log_count; ptr++) {

switch (ptr->command_letter) {
- char *trg;

case '\0': /* ENTRY DELETED */
break;

case '{':
case 'F':
case 'C':
case 'M':
--- 2782,2793 ----
LI->entries[i].log_count; ptr++) {

switch (ptr->command_letter) {

case '\0': /* ENTRY DELETED */
break;

case '{':
+ case 's':
case 'F':
case 'C':
case 'M':
***************
*** 2825,2831 ****
case 'R':
/* remove ... */
break;
!
default:
fprintf(stderr,
"%s: [on_current] Bad command letter: %c \n",
--- 2815,2822 ----
case 'R':
/* remove ... */
break;
!
!
default:
fprintf(stderr,
"%s: [on_current] Bad command letter: %c \n",
***************
*** 2865,2871 ****
fprintf(stderr,
"%s: (%s) Keeping link %s from old version (was %s)\n",
program_name,source->filename,ptr->arg_ptrs[1],
! ptr->arg_ptrs[2]
);
continue;
}
--- 2856,2862 ----
fprintf(stderr,
"%s: (%s) Keeping link %s from old version (was %s)\n",
program_name,source->filename,ptr->arg_ptrs[1],
! ptr->arg_ptrs[0]
);
continue;
}
***************
*** 3254,3261 ****
char * src = NULL;
char * trg;

- int l = 0;
-
uid_t id_user = (uid_t)-1;
gid_t id_group = (gid_t)-1;
int mode;
--- 3245,3250 ----
***************
*** 3409,3415 ****
{
struct stat X;
struct log_instance * target = NULL;
! int j,i;
int r = 0;

struct log_instance LI_source;
--- 3398,3404 ----
{
struct stat X;
struct log_instance * target = NULL;
! int i;
int r = 0;

struct log_instance LI_source;
***************
*** 3498,3504 ****
}

if (0 != strcmp(installer_root,"/")) {
- char *X;
int i;
int t;

--- 3487,3492 ----
Index: elm2.4.ME+.102cvs/utils/from.c
*** elm2.4.ME+.101/utils/from.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/utils/from.c 2003-05-09 19:13:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: from.c,v 1.41 2003/03/17 16:04:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: from.c,v 1.45 2003/05/09 16:13:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************
*** 246,251 ****
--- 246,252 ----
struct folder_info *folder = NULL;
struct read_folder_state * read_state_ptr = NULL;
CONST char *msg;
+ enum sessionlock_mode m;

/* copy next argument into infile */

***************
*** 286,293 ****

if (access(infile,ACCESS_EXISTS) == -1) {
lib_error(CATGETS(elm_msg_cat,
! FromSet,FromCouldntOpenFolderPlural,
! "Couldn't open folders \"%s\" or \"%s\".\n"),
argv[optind], infile);
continue; /* let's try the next file */
}
--- 287,294 ----

if (access(infile,ACCESS_EXISTS) == -1) {
lib_error(CATGETS(elm_msg_cat,
! FromSet,FromCouldntOpenFolderOrMailbox,
! "Couldn't open folder \"%s\" or mailbox \"%s\".\n"),
argv[optind], infile);
continue; /* let's try the next file */
}
***************
*** 325,333 ****
if (!folder)
continue;

! if (!sessionlock_folder(folder,SESSIONLOCK_NONE)) {
! lib_error(CATGETS(elm_msg_cat,FromSet,FromCouldntOpenFolder,
! "Couldn't open folder \"%s\".\n"), infile);
goto clean;
}

--- 326,351 ----
if (!folder)
continue;

! m = SESSIONLOCK_NONE;
! if ((selct == NEW_MSG) &&
! FOLDER_FILE == get_folder_mode(folder) &&
! FOLDER_STATUS_NEW != def_folder_status) {
!
!
! lib_error(CATGETS(elm_msg_cat,
! FromSet,FromNotMailbox,
! "WARNING: %s is folder, not mailbox!\n Delivery of new mail to folder when it is open may corrupt it.\n"),
! infile);
!
!
! m = SESSIONLOCK_NONE_CHECKNEW;
! }
!
!
! if (!sessionlock_folder(folder,m)) {
! CONST char * X = folder_type(folder);
! lib_error(CATGETS(elm_msg_cat,FromSet,FromCouldntOpenX,
! "Couldn't open %s \"%s\".\n"), X,infile);
goto clean;
}

***************
*** 361,370 ****
"%s no mail.\n"),
whos_mail(infile, realname));
else
! if (!summarize)
! printf(catgets(elm_msg_cat,FromSet,
! FromNoMesgInFolder,
! "No messages in that folder!\n"));
}
else
/* no selected messages then? */
--- 379,395 ----
"%s no mail.\n"),
whos_mail(infile, realname));
else
! if (!summarize) {
! if (get_folder_mode(folder) & FOLDER_MBOX)
! printf(catgets(elm_msg_cat,FromSet,
! FromNoMesgInMailbox,
! "No messages in that mailbox!\n"));
!
! else
! printf(catgets(elm_msg_cat,FromSet,
! FromNoMesgInFolder,
! "No messages in that folder!\n"));
! }
}
else
/* no selected messages then? */
***************
*** 375,385 ****
whos_mail(infile, realname),
explain(selct,NEG));
else
! if (!summarize)
! printf(catgets(elm_msg_cat,
! FromSet,FromNoExplainMessages,
! "No %s messages in that folder.\n"),
! explain(selct,NEG));
}
else
/* there's mail, but we just want a one-liner */
--- 400,417 ----
whos_mail(infile, realname),
explain(selct,NEG));
else
! if (!summarize) {
! if (get_folder_mode(folder) & FOLDER_MBOX)
! printf(catgets(elm_msg_cat,
! FromSet,FromNoExplainMessagesMbox,
! "No %s messages in that mailbox.\n"),
! explain(selct,NEG));
! else
! printf(catgets(elm_msg_cat,
! FromSet,FromNoExplainMessages,
! "No %s messages in that folder.\n"),
! explain(selct,NEG));
! }
}
else
/* there's mail, but we just want a one-liner */
Index: elm2.4.ME+.102cvs/utils/Makefile.SH
*** elm2.4.ME+.101/utils/Makefile.SH 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/utils/Makefile.SH 2003-05-25 20:29:02.000000000 +0300
***************
*** 16,22 ****
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.29 2003/03/17 11:36:21 hurtta Exp $
#
# Makefile for the Elm system utilities
#
--- 16,22 ----
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.31 2003/05/25 17:29:02 hurtta Exp $
#
# Makefile for the Elm system utilities
#
***************
*** 59,66 ****
--- 59,82 ----
*) strobj="../lib/strstr.o"
;;
esac
+ case "$d_dlopen_libs" in
+ define) regshared="\$(BIN)/elmlibregister-shared"
+ regnoshared="\$(LIB)/elmlibregister"
+ regsharedbin="\$(BIN)/elmlibregister"
+ regsharedobj=elmlibregister.o
+ ;;
+ *) regshared=
+ regnoshared=
+ regsharedbin=
+ regsharedobj=
+ ;;
+ esac
cat >>Makefile <<!GROK!THIS!
STROBJ = $strobj
+ REGSHARED = $regshared
+ REGNOSHARED = $regnoshared
+ REGSHAREDBIN = $regsharedbin
+ REGSHAREDOBJ = $regsharedobj
!GROK!THIS!

if $test "$d_shared" = "$define" ; then
***************
*** 78,84 ****
$(BIN)/elmrc-write-shared \
$(BIN)/elmterminal-shared \
$(BIN)/elmunidata-shared \
! $(BIN)/elmstringconvert-shared

# NOTE: No shared version for elmregister!
!NO!SUBS!
--- 94,101 ----
$(BIN)/elmrc-write-shared \
$(BIN)/elmterminal-shared \
$(BIN)/elmunidata-shared \
! $(BIN)/elmstringconvert-shared \
! $(REGSHARED)

# NOTE: No shared version for elmregister!
!NO!SUBS!
***************
*** 122,128 ****
$(LIB)/elmterminal \
$(LIB)/elmunidata \
$(LIB)/elmregister \
! $(LIB)/elmuninstall


# List of programs in bin directory
--- 139,146 ----
$(LIB)/elmterminal \
$(LIB)/elmunidata \
$(LIB)/elmregister \
! $(LIB)/elmuninstall \
! $(REGNOSHARED)


# List of programs in bin directory
***************
*** 144,150 ****
$(BIN)/elmunidata \
$(BIN)/elmstringconvert \
$(BIN)/elmregister \
! $(SHLIST)

# List of programs to $(LINT) - only C programs
LINT_LIST = answer_lint \
--- 162,169 ----
$(BIN)/elmunidata \
$(BIN)/elmstringconvert \
$(BIN)/elmregister \
! $(REGSHAREDBIN) \
! $(SHLIST)

# List of programs to $(LINT) - only C programs
LINT_LIST = answer_lint \
***************
*** 170,176 ****
elmterminal.o \
elmunidata.o \
elmstringconvert.o \
! elmregister.o

# Lists of source and object files for each C program
ANSWER_SRC = answer.c
--- 189,196 ----
elmterminal.o \
elmunidata.o \
elmstringconvert.o \
! elmregister.o \
! $(REGSHAREDOBJ)

# Lists of source and object files for each C program
ANSWER_SRC = answer.c
***************
*** 199,205 ****
ELMUNIDATA_OBJ = elmunidata.o reghelper.o
ELMSCONV_SRC = elmstringconvert.c
ELMSCONV_OBJ = elmstringconvert.o
!

# Standard targets
all: objects $(BINARY_LIST)
--- 219,225 ----
ELMUNIDATA_OBJ = elmunidata.o reghelper.o
ELMSCONV_SRC = elmstringconvert.c
ELMSCONV_OBJ = elmstringconvert.o
! ELMLIBREG_OBJ = elmlibregister.o reghelper.o

# Standard targets
all: objects $(BINARY_LIST)
***************
*** 246,251 ****
--- 266,274 ----
elmstringconvert.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h
reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h
+ elmlibregister.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
+ $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
+ $(INCLDIR)/reghelper.h

checkalias: checkalias.SH ; sh $?
listalias: listalias.SH ; sh $?
***************
*** 323,329 ****
cd ../lib; $(MAKE) strstr.o

$(BIN)/elmregister: elmregister.o reghelper.o ../lib/putenv.o $(STROBJ)
! $(CC) $(LFLAGS) -o $@ elmregister.o reghelper.o ../lib/putenv.o $(STROBJ)

# Rules to make shell scripts in bin directory
$(BIN)/checkalias: checkalias
--- 346,355 ----
cd ../lib; $(MAKE) strstr.o

$(BIN)/elmregister: elmregister.o reghelper.o ../lib/putenv.o $(STROBJ)
! $(CC) $(LFLAGS) -o $@ elmregister.o reghelper.o \
! ../lib/putenv.o $(STROBJ)
! $(BIN)/elmlibregister: $(ELMLIBREG_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMLIBREG_OBJ) ../lib/libutil.a $(LIB2)

# Rules to make shell scripts in bin directory
$(BIN)/checkalias: checkalias
***************
*** 423,434 ****
$(BIN)/prlong-shared: $(PRLONG_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(PRLONG_OBJ) ../shlib/libelmme-base.so $(LIB2)

! $(BIN)/elmcharset-shared: $(ELMCHARSET_OBJ) ../lib/libutil.a
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMCHARSET_OBJ) ../shlib/libelmme-base.so $(LIB2)

! $(BIN)/elmrc-write-shared: $(ELMRCWRITE_OBJ) ../lib/libutil.a
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so $(LIB2)

$(BIN)/elmterminal-shared: $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so $(LIB2)

--- 449,463 ----
$(BIN)/prlong-shared: $(PRLONG_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(PRLONG_OBJ) ../shlib/libelmme-base.so $(LIB2)

! $(BIN)/elmcharset-shared: $(ELMCHARSET_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMCHARSET_OBJ) ../shlib/libelmme-base.so $(LIB2)

! $(BIN)/elmrc-write-shared: $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so $(LIB2)

+ $(BIN)/elmlibregister-shared: $(ELMLIBREG_OBJ) ../shlib/libelmme-base.so
+ $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMLIBREG_OBJ) ../shlib/libelmme-base.so $(LIB2)
+
$(BIN)/elmterminal-shared: $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so $(LIB2)

***************
*** 481,486 ****
--- 510,519 ----
$(LIB)/elmunidata: $(BIN)/elmunidata-shared
$(REG) copy -m 555 $? $@

+
+ $(LIB)/elmlibregister: $(BIN)/elmlibregister-shared
+ $(REG) copy -m 555 $? $@
+
!NO!SUBS!

else
***************
*** 523,528 ****
--- 556,564 ----
$(LIB)/elmrc-write: $(BIN)/elmrc-write
$(REG) copy -m 555 $? $@

+ $(LIB)/elmlibregister: $(BIN)/elmlibregister
+ $(REG) copy -m 555 $? $@
+
$(LIB)/elmterminal: $(BIN)/elmterminal
$(REG) copy -m 555 $? $@

Index: elm2.4.ME+.102cvs/utils/reghelper.c
*** elm2.4.ME+.101/utils/reghelper.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102cvs/utils/reghelper.c 2003-05-26 18:19:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reghelper.c,v 1.2 2003/03/17 11:36:22 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: reghelper.c,v 1.3 2003/05/26 15:19:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 111,117 ****
int l_target = strlen(target_r);
int l_user = strlen(user);
int l_group = strlen(group);
- int n;

char buffer[ MAX_PIPE_LOG];
char *ptr;
--- 111,116 ----
***************
*** 165,171 ****
n = write(fd,buffer,L);

if (n < 0) {
- int err = errno;

if (EINTR == errno)
goto again;
--- 164,169 ----

Kari E. Hurtta

unread,
Jul 30, 2003, 5:59:33 AM7/30/03
to
Archive-name: elm2.4ME+/PL102a

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

file elm-2.4ME+PL102a.patch.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL102a.patch.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL102a.patch.gz >
via WWW.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL102a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

This is out of branch patch.

Notice: ME+ series is not official Elm.
This patch is agaist Elm 2.4ME+ PL102 (25) ------------------------------------
Index: elm2.4.ME+.102acvs/hdrs/patchlevel.h
Prereq: 1080000000
*** elm2.4.ME+.102/hdrs/patchlevel.h 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.102acvs/hdrs/patchlevel.h 2003-07-30 11:09:21.000000000 +0300
***************
*** 1,9 ****


! #define PATCHLEVEL "102 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.102
*/
! #define LAST_REPORT_TIME 1080000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"
! #define VERS_DATE "May, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released May, 2003"

--- 1,9 ----
! #define PATCHLEVEL "102a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.102
*/
! #define LAST_REPORT_TIME 1080000200

#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

! #define VERS_DATE "Jul, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jul, 2003"
Index: elm2.4.ME+.102acvs/README.ME+
*** elm2.4.ME+.102/README.ME+ 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.102acvs/README.ME+ 2003-07-30 11:08:22.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.572 2003/05/28 18:02:27 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.573.2.3 2003/07/30 08:08:22 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,49 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+

+ Changes of Elm2.4ME+ PL102a (25) compared with Elm2.4ME+ PL102 (25)
+ ------------------------------------------------------------------
+

+ [ This is out of branch patch. ]
+

+ SUMMARY: This patch fixes temp file leak
+ when forwarding with mimeforward = YES and
+ connection to wrong port when name have
+ several IP addresses and file
+ .elm/mail.services was used.
+
+ - Raw() was not masking NO_CHARSET from value (but
+ actually Raw is not called with NO_CHARSET flag)
+
+ - pagemultipart option was not handled correctly if
+ subtype of multipart was unknown.
+
+ - If .elm/mail.services was giving port for service
+ (for example POP), and there was several IP addresses for
+ name, wrong port was attempt on connection for other
+ than first address.
+
+ - "Elm leaves a /tmp/elmfwd.xxx file behind when you
+ forward a message"
+ Reported by: Konstantinos Konstantinides - Stream
+ <k...@corp.cirrus.com>
+ > That happened when mimeforward = YES. Changed
+ mime_t_clear() to take attention to unlink flag.
+
+

Changes of Elm2.4ME+ PL102 (25) compared with Elm2.4ME+ PL101 (25)

------------------------------------------------------------------

Index: elm2.4.ME+.102acvs/lib/remote_mbx.c
*** elm2.4.ME+.102/lib/remote_mbx.c 2002-06-06 18:55:58.000000000 +0300
--- elm2.4.ME+.102acvs/lib/remote_mbx.c 2003-07-29 22:27:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.42 2002/04/01 17:09:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.42.28.1 2003/07/29 19:27:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.28.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 411,420 ****

for (idx2 = 0; idx2 < se->port_count && 0 == r; idx2++) {
ra->hostaddr.sin.sin_port =
! htons(se->port_list[idx]);
r = connect_one_IN(ra,&cur_socket,&last_error);
if (r > 0)
! *got = se->port_list[idx];
}
} else {
int idx2;
--- 411,420 ----

for (idx2 = 0; idx2 < se->port_count && 0 == r; idx2++) {
ra->hostaddr.sin.sin_port =
! htons(se->port_list[idx2]);
r = connect_one_IN(ra,&cur_socket,&last_error);
if (r > 0)
! *got = se->port_list[idx2];
}
} else {
int idx2;
Index: elm2.4.ME+.102acvs/melib/mime_decode.c
*** elm2.4.ME+.102/melib/mime_decode.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.102acvs/melib/mime_decode.c 2003-07-28 09:10:33.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.53 2003/04/25 20:25:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.53 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.53.4.1 2003/07/28 06:10:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.53.4.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 1032,1038 ****
} else
flags |= subflag;
goto done;
! } else if (get_type_flags(p->TYPE) == MIME_TYPE_MULTIPART &&
pagemultipart) {
DPRINT(Debug,11,(&Debug,
"multipart_selector(%p) -- type: %p=%s/%s "
--- 1032,1038 ----
} else
flags |= subflag;
goto done;
! } else if (get_major_type_code(p->TYPE) == MIME_TYPE_MULTIPART &&
pagemultipart) {
DPRINT(Debug,11,(&Debug,
"multipart_selector(%p) -- type: %p=%s/%s "
Index: elm2.4.ME+.102acvs/melib/mime_parse.c
*** elm2.4.ME+.102/melib/mime_parse.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.102acvs/melib/mime_parse.c 2003-07-30 11:23:54.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.38 2003/05/09 05:57:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.38.4.1 2003/07/30 08:23:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.4.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 27,33 ****
mt->offset = mt->begin_offset = 0;
mt->length = -1;
mt->encoding = ENCODING_7BIT;
- mt->unlink = 0;
mt->TYPE = give_media_type2(MIME_TYPE_TEXT,"plain",0);
if (!mt->TYPE)
mime_panic(__FILE__,__LINE__,"mime_t_clear",
--- 27,32 ----
***************
*** 51,59 ****
free (mt->disposition_opts);
mt->disposition_opts = NULL;

! if (mt->pathname)
free (mt->pathname);
mt->pathname = NULL;
if (mt->dispname)
free_string(& (mt->dispname));

--- 50,81 ----
free (mt->disposition_opts);
mt->disposition_opts = NULL;

! if (mt->pathname) {
! if (mt->unlink) {
! DPRINT(Debug,15,(&Debug,
! "mime_t_clear: %s marked for unlink\n",
! mt->pathname));
!
! if (0 == unlink(mt->pathname)) {
! DPRINT(Debug,14,(&Debug,
! "mime_t_clear: %s unlinked\n",
! mt->pathname));
! }
! }
!
free (mt->pathname);
+
+ } else {
+ if (mt->unlink) {
+ DPRINT(Debug,3,(&Debug,
+ "mime_t_clear: ERROR: Pathname marked for unlink, but no pathname\n"));
+ }
+ }
+
mt->pathname = NULL;
+
+ mt->unlink = 0;
+
if (mt->dispname)
free_string(& (mt->dispname));

Index: elm2.4.ME+.102acvs/src/curses.c
*** elm2.4.ME+.102/src/curses.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.102acvs/src/curses.c 2003-06-13 19:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curses.c,v 1.36 2003/02/16 12:58:17 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: curses.c,v 1.37 2003/06/13 16:28:45 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
***************
*** 1596,1602 ****
int do_tite = (state & NO_TITE) == 0;
int do_charset = (state & NO_CHARSET) == 0;

! state = state & ~NO_TITE;

SIGDPRINT(Debug,4,(&Debug,
"curses: Raw: state=%d do_tite=%d do_charset=%d\n",
--- 1596,1602 ----
int do_tite = (state & NO_TITE) == 0;
int do_charset = (state & NO_CHARSET) == 0;

! state = state & ~NO_TITE & ~NO_CHARSET;

SIGDPRINT(Debug,4,(&Debug,
"curses: Raw: state=%d do_tite=%d do_charset=%d\n",

Kari E. Hurtta

unread,
Sep 27, 2003, 2:00:08 PM9/27/03
to
Archive-name: elm2.4ME+/PL107a

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

file elm-2.4ME+PL107.patcha.gz


Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL107a.patch.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL107a.patch.gz >

For apply patch use command=20
patch -p1 < {path...}/elm-2.4ME+PL107a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Notice: ME+ series is not official Elm.
This patch is agaist Elm 2.4ME+ PL107 (25) --------------------------------
Index: elm2.4.ME+.107a-cvs/hdrs/patchlevel.h
Prereq: 1094000000
*** elm2.4.ME+.107/hdrs/patchlevel.h 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.107a-cvs/hdrs/patchlevel.h 2003-09-27 18:48:46.000000000 +0300
***************
*** 1,8 ****
! #define PATCHLEVEL "107 (25)"
/* Used by Configure:
SHAREDTAG: .1.0.107
*/
! #define LAST_REPORT_TIME 1094000000


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

#define VERS_DATE "Sep, 2003" /* for elm -v option */
#define WHAT_STRING \
--- 1,8 ----
! #define PATCHLEVEL "107a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.107
*/
! #define LAST_REPORT_TIME 1096000000


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

#define VERS_DATE "Sep, 2003" /* for elm -v option */
#define WHAT_STRING \
Index: elm2.4.ME+.107a-cvs/README.ME+
*** elm2.4.ME+.107/README.ME+ 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.107a-cvs/README.ME+ 2003-09-27 19:47:42.000000000 +0300
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.638 2003/09/05 19:13:12 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.645 2003/09/27 16:47:42 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,115 ****


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

Changes of Elm2.4ME+ PL107 (25) compared with Elm2.4ME+ PL106 (25)
------------------------------------------------------------------

Note: You must create directory
! charset/MAPPINGS/MICSFT
before applying this patch!

! SUMMARY: This release fixes some charset definations,
! add some maps to distribution and new keyword
! to l)imit command.
!
! - Marked TIS-620 to be ISO-8859-11 on lib/precompiled_sets.c
! - Added some ISO-2022 codes.
! - changed codeset=VISCII to charset=VISCII on lib/precompiled_sets.c
! - changed codeset=DEC-MCS to charset=DEC-MCS on lib/precompiled_sets.c
! - Marked that windows-1250, windows-1253, windows-1254, windows-1256
and windows-1258 are superset of US-ASCII on lib/precompiled_sets.c
! - Marked that windows-1255 is superset of US-ASCII on lib/precompiled_sets.c
(it is not superset of ISO-8859-8).
! - Marked that windows-1257 is superset of US-ASCII on lib/precompiled_sets.c
(it is not superset of ISO-8859-13).
! - Map 0x80 - 0x9f to unicode 0x0080 - 0x009F on
! ISO-8859-1 map (function map_init_latin) on lib/cs_binary.c.
On that range there is no characters, but this way is mapping
! done on http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT

! - Added some files for ConfTool/mapfiles

NOTE: Answer 'y' to following Configure question

! Should Configure ignore existing elm.mimecharsets? [s]

otherwise generated elm.mimecharsets do not include
fixes from ConfTool/mapfiles.

! - Added ISO-2022-LIKE paramater to terminal.info
! - Accept 0x30..0x3F as final byte of ISO 2022 identification
(these are on private use)

! - Added new l)imit keyword:
! header {header_name}: {header_value}
! Note that this is SLOW! Currently this limit
! keyword do not do MIME decoding for headers.
!
! New files:
! charset/MAPPINGS/viscii.txt
! charset/MAPPINGS/dec-mcs.txt
! charset/MAPPINGS/ISO8859/8859-11.TXT
! charset/MAPPINGS/hp-roman8.txt
! charset/MAPPINGS/MICSFT/CP437.TXT
! charset/MAPPINGS/MICSFT/CP1250.TXT
! charset/MAPPINGS/MICSFT/CP1253.TXT
! charset/MAPPINGS/MICSFT/CP1254.TXT
! charset/MAPPINGS/MICSFT/CP1255.TXT
! charset/MAPPINGS/MICSFT/CP1256.TXT
! charset/MAPPINGS/MICSFT/CP1257.TXT
! charset/MAPPINGS/MICSFT/CP1258.TXT

Changes of Elm2.4ME+ PL106 (25) compared with Elm2.4ME+ PL105 (25)
------------------------------------------------------------------

! SUMMARY: This release fixes some compilation and installation
! problems on AIX, some bugs on folder leaving/syncing,
! current pointer handling when new mail was arriving,
! and saving error (introduced on PL105) of assembled
! message. Builtin pager now by default overrides
! $PAGER environment variable.
!
! - Fix compilation error on AIX:
! curses.c:556: error: parse error before '->' token
! curses.c: In function `ScreenSize':
! Problem noted by: Noam G. Nudelman <no...@mail.biu.ac.il>
! ( It still do not work on AIX ?)

- Fix installation error
gmake[2]: *** No rule to make target `libreg',
! needed by `install_s'. Stop.
on case where shared libraries are not used.
! Problem noted by: Noam G. Nudelman <no...@mail.biu.ac.il>

! - On leaving of folder action message was cleared immediately.

! - Current pointer location was not preserved when
! new mail arrived.

! - On syncing mailbox elm did not asked should messages
! to be deleted, if several mailbox was open and on
! last was no messages marked for deletion.

! - Saving of assembled message failed, because content_length
! was miscalculated (PL105 copied also Received: -headers
! from part 1 and these was not calculated.)

! - If builtin++ is selected as default pager, Configure
! now provides option that builtin pager is used even
! when environment variable $PAGER is set. That is now
! also default.

Changes of Elm2.4ME+ PL105 (25) compared with Elm2.4ME+ PL104 (25)
------------------------------------------------------------------
--- 13,133 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)
+ ------------------------------------------------------------------
+
+ SUMMARY: This patch corrects page when returning
+ from o)ptions screen and fixes some other
+ minor bugs.
+
+ - Return correct page after returning from
+ o)ptions screen when sorting order is changed.
+ Problem noted by: Ike Stoddard <forw...@oplink.net>
+
+ - Possible fix for error
+ STREAMSCHED PANIC in streamsched.c:1127:ss_noaction_routine
+ when IMAP / TLS connection is closed by server.
+
+ - Handle better "skipped " counter, when there is lot of
+ skipped mails.
+
Changes of Elm2.4ME+ PL107 (25) compared with Elm2.4ME+ PL106 (25)
------------------------------------------------------------------

Note: You must create directory
! charset/MAPPINGS/MICSFT
before applying this patch!

! SUMMARY: This release fixes some charset definations,
! add some maps to distribution and new keyword
! to l)imit command.
!
! - Marked TIS-620 to be ISO-8859-11 on lib/precompiled_sets.c
! - Added some ISO-2022 codes.
! - changed codeset=VISCII to charset=VISCII on lib/precompiled_sets.c
! - changed codeset=DEC-MCS to charset=DEC-MCS on lib/precompiled_sets.c
! - Marked that windows-1250, windows-1253, windows-1254, windows-1256
and windows-1258 are superset of US-ASCII on lib/precompiled_sets.c
! - Marked that windows-1255 is superset of US-ASCII on lib/precompiled_sets.c
(it is not superset of ISO-8859-8).
! - Marked that windows-1257 is superset of US-ASCII on lib/precompiled_sets.c
(it is not superset of ISO-8859-13).
! - Map 0x80 - 0x9f to unicode 0x0080 - 0x009F on
! ISO-8859-1 map (function map_init_latin) on lib/cs_binary.c.
On that range there is no characters, but this way is mapping
! done on http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT

! - Added some files for ConfTool/mapfiles

NOTE: Answer 'y' to following Configure question

! Should Configure ignore existing elm.mimecharsets? [s]

otherwise generated elm.mimecharsets do not include
fixes from ConfTool/mapfiles.

! - Added ISO-2022-LIKE paramater to terminal.info
! - Accept 0x30..0x3F as final byte of ISO 2022 identification
(these are on private use)

! - Added new l)imit keyword:
! header {header_name}: {header_value}
! Note that this is SLOW! Currently this limit
! keyword do not do MIME decoding for headers.
!
! New files:
! charset/MAPPINGS/viscii.txt
! charset/MAPPINGS/dec-mcs.txt
! charset/MAPPINGS/ISO8859/8859-11.TXT
! charset/MAPPINGS/hp-roman8.txt
! charset/MAPPINGS/MICSFT/CP437.TXT
! charset/MAPPINGS/MICSFT/CP1250.TXT
! charset/MAPPINGS/MICSFT/CP1253.TXT
! charset/MAPPINGS/MICSFT/CP1254.TXT
! charset/MAPPINGS/MICSFT/CP1255.TXT
! charset/MAPPINGS/MICSFT/CP1256.TXT
! charset/MAPPINGS/MICSFT/CP1257.TXT
! charset/MAPPINGS/MICSFT/CP1258.TXT

Changes of Elm2.4ME+ PL106 (25) compared with Elm2.4ME+ PL105 (25)
------------------------------------------------------------------

! SUMMARY: This release fixes some compilation and installation
! problems on AIX, some bugs on folder leaving/syncing,
! current pointer handling when new mail was arriving,
! and saving error (introduced on PL105) of assembled
! message. Builtin pager now by default overrides
! $PAGER environment variable.
!
! - Fix compilation error on AIX:
! curses.c:556: error: parse error before '->' token
! curses.c: In function `ScreenSize':
! Problem noted by: Noam G. Nudelman <no...@mail.biu.ac.il>
! ( It still do not work on AIX ?)

- Fix installation error
gmake[2]: *** No rule to make target `libreg',
! needed by `install_s'. Stop.
on case where shared libraries are not used.
! Problem noted by: Noam G. Nudelman <no...@mail.biu.ac.il>

! - On leaving of folder action message was cleared immediately.

! - Current pointer location was not preserved when
! new mail arrived.

! - On syncing mailbox elm did not asked should messages
! to be deleted, if several mailbox was open and on
! last was no messages marked for deletion.

! - Saving of assembled message failed, because content_length
! was miscalculated (PL105 copied also Received: -headers
! from part 1 and these was not calculated.)

! - If builtin++ is selected as default pager, Configure
! now provides option that builtin pager is used even
! when environment variable $PAGER is set. That is now
! also default.

Changes of Elm2.4ME+ PL105 (25) compared with Elm2.4ME+ PL104 (25)
------------------------------------------------------------------
***************
*** 168,176 ****
- Added '|' -command to message assembly mode (uses readmsg
and therefore requires that folder state information
$ELMSTATE is available.) That command naturally do not
! work if message assembly mode is started from view digest
as mailbox -mode (on that mode there is no usefull folder
! state information.)

Changes of Elm2.4ME+ PL104 (25) compared with Elm2.4ME+ PL103 (25)
------------------------------------------------------------------
--- 186,194 ----
- Added '|' -command to message assembly mode (uses readmsg
and therefore requires that folder state information
$ELMSTATE is available.) That command naturally do not
! work if message assembly mode is started from view digest
as mailbox -mode (on that mode there is no usefull folder
! state information.)

Changes of Elm2.4ME+ PL104 (25) compared with Elm2.4ME+ PL103 (25)
------------------------------------------------------------------
***************
*** 8413,8421 ****

term ISO-2022 charset-name
term ISO-2022 charset-definition
! term ISO-2022/DW charset-name
term ISO-2022/DW charset-definition
! term ISO-2022-LIKE charset-name bank-specification
term PRIVATE charset-name d/d d/d d/d
term PRIVATE charset-name [ condition ] d/d d/d d/d

--- 8431,8439 ----

term ISO-2022 charset-name
term ISO-2022 charset-definition
! term ISO-2022/DW charset-name
term ISO-2022/DW charset-definition
! term ISO-2022-LIKE charset-name bank-specification
term PRIVATE charset-name d/d d/d d/d
term PRIVATE charset-name [ condition ] d/d d/d d/d

***************
*** 8451,8463 ****

Read commensts about using of these from doc/terminal.info

! ISO-2022-LIKE indicates that terminal assign private
! codes for charset. That defination do not define iso 2022
! codes for charset, but it is used than these codes are
! defined for charset. For example that may be used on lines
! like

! vt200 ISO-2022-LIKE DEC-MCS left=bank-G0;bank-G0-94=4/2;right=bank-G2;bank-96=3/12


Flag keyword xterm-title specifies that terminal supports
--- 8469,8481 ----

Read commensts about using of these from doc/terminal.info

! ISO-2022-LIKE indicates that terminal assign private
! codes for charset. That defination do not define iso 2022
! codes for charset, but it is used than these codes are
! defined for charset. For example that may be used on lines
! like

! vt200 ISO-2022-LIKE DEC-MCS left=bank-G0;bank-G0-94=4/2;right=bank-G2;bank-96=3/12


Flag keyword xterm-title specifies that terminal supports
Index: elm2.4.ME+.107a-cvs/lib/streamsched.c
*** elm2.4.ME+.107/lib/streamsched.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.107a-cvs/lib/streamsched.c 2003-09-26 19:06:17.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.29 2003/05/17 16:13:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.31 2003/09/26 16:06:17 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 122,128 ****
if (n < 0) {
err = errno;
DPRINT(Debug,8,(&Debug,
! "ss_ReadFromSocket: read error %s (errno %d)\n",
error_description(err),err));
}

--- 122,128 ----
if (n < 0) {
err = errno;
DPRINT(Debug,8,(&Debug,
! "ss_WriteToSocket: read error %s (errno %d)\n",
error_description(err),err));
}

***************
*** 871,880 ****
if (ss->error_state) {

/* Let's hope that read_callback is available ... */
! DPRINT(Debug,4,(&Debug,
! " ... [%s] Signaling on error state: %s\n",
! Ident,ss->error_state));
! call_user_read_callback(ss);
}
}

--- 871,887 ----
if (ss->error_state) {

/* Let's hope that read_callback is available ... */
! if ( ss_noaction_routine == ss->read_act) {
! DPRINT(Debug,4,(&Debug,
! " ... [%s] Can't signal on error state: %s\n",
! Ident,ss->error_state));
!
! } else {
! DPRINT(Debug,4,(&Debug,
! " ... [%s] Signaling on error state: %s\n",
! Ident,ss->error_state));
! call_user_read_callback(ss);
! }
}
}

Index: elm2.4.ME+.107a-cvs/src/elm.c
*** elm2.4.ME+.107/src/elm.c 2003-08-11 11:21:18.000000000 +0300
--- elm2.4.ME+.107a-cvs/src/elm.c 2003-09-14 19:35:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.56 2003/08/11 06:53:24 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.57 2003/09/14 16:35:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 1204,1212 ****
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmOptions,
"Options"));
! if((i=options(current_mailbox)) > 0)
get_page(current, current_mailbox);
! else if(i < 0)
leave(0, &current_mailbox);
redraw++; /* always fix da screen... */
}
--- 1204,1213 ----
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmOptions,
"Options"));
! if((i=options(current_mailbox)) > 0) {
! current = get_current(current_mailbox);
get_page(current, current_mailbox);
! } else if(i < 0)
leave(0, &current_mailbox);
redraw++; /* always fix da screen... */
}
Index: elm2.4.ME+.107a-cvs/src/newmbox.c
*** elm2.4.ME+.107/src/newmbox.c 2003-08-16 09:58:21.000000000 +0300
--- elm2.4.ME+.107a-cvs/src/newmbox.c 2003-09-27 18:38:22.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.71 2003/08/14 14:14:22 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.76 2003/09/27 15:38:22 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 248,254 ****
{
int initialize = mode == COUNT_initialize;

! int width = elm_COLUMNS - 52;

if (initialize) {
counter->truncated_name = NULL;
--- 248,256 ----
{
int initialize = mode == COUNT_initialize;

! int width = elm_COLUMNS - 52
! - ((skipcount >= 10000) ? 1 : 0)
! - ((count >= 10000) ? 1 : 0);

if (initialize) {
counter->truncated_name = NULL;
***************
*** 295,307 ****
PutLineX(counter->count_x, counter->count_y,
FRM("%d (%02d%%) "), count,percent);

! if (skipcount > 0 || percent2 >= 0)
! PutLineX(counter->count_x, counter->count_y+12,
CATGETS(elm_msg_cat, ElmSet,
ElmSkippingInMessage,
" %d (%02d%%) skipped "),
! skipcount,percent2);
!
if (COUNT_finalize == mode) {
CarriageReturn();

--- 297,315 ----
PutLineX(counter->count_x, counter->count_y,
FRM("%d (%02d%%) "), count,percent);

! if (skipcount > 0 || percent2 >= 0) {
! int add = 12 - ((skipcount >= 100) ? 1 : 0)
! - ((skipcount >= 1000) ? 1 : 0)
! + ((count >= 10000) ? 1 : 0);
!
!
! PutLineX(counter->count_x, counter->count_y+add,
CATGETS(elm_msg_cat, ElmSet,
ElmSkippingInMessage,
" %d (%02d%%) skipped "),
! skipcount,percent2);
! }
!
if (COUNT_finalize == mode) {
CarriageReturn();

Kari E. Hurtta

unread,
Oct 12, 2003, 6:40:56 AM10/12/03
to
Archive-name: elm2.4ME+/PL108

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

files elm-2.4ME+PL108.patch.gz
and elm-2.4ME+108.tar.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL108.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+108.tar.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+108.tar.gz >
and <URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL108.patch.gz >

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL108.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Notice: ME+ series is not official Elm.
This patch is agaist Elm 2.4ME+ PL107 (25) --------------------------------

Note: You must create directory src/screen before applying this patch!

Undo Elm2.4ME+ PL107a (25) patch before applying this patch.

For apply patch use command

patch -p1 < {path...}/this-file


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Index: elm2.4.ME+.108-cvs/hdrs/patchlevel.h


Prereq: 1094000000
*** elm2.4.ME+.107/hdrs/patchlevel.h 2003-09-05 23:33:17.000000000 +0300

--- elm2.4.ME+.108-cvs/hdrs/patchlevel.h 2003-10-12 11:47:41.000000000 +0300
***************
*** 1,9 ****
! #define PATCHLEVEL "107 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.107


*/
! #define LAST_REPORT_TIME 1094000000

#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

! #define VERS_DATE "Sep, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Sep, 2003"
--- 1,9 ----
! #define PATCHLEVEL "108 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.108
*/
! #define LAST_REPORT_TIME 1097000000


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

! #define VERS_DATE "Oct, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Oct, 2003"
Index: elm2.4.ME+.108-cvs/README.ME+


*** elm2.4.ME+.107/README.ME+ 2003-09-05 23:33:17.000000000 +0300

--- elm2.4.ME+.108-cvs/README.ME+ 2003-10-12 11:47:40.000000000 +0300
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.638 2003/09/05 19:13:12 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.654 2003/10/12 08:47:40 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,115 ****


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

--- 13,210 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL108 (25) compared with Elm2.4ME+ PL107 (25)
+ ------------------------------------------------------------------
+
+ Note: You must create directory
+ src/screen
+ before applying this patch!
+
+ Undo Elm2.4ME+ PL107a (25) patch before applying this patch.
+
+ SUMMARY: This release collects PL107a patch, adds
+ invoke e)ditor command to header editing screen,
+ enhances internal mailcap parser and fixes some
+ bugs. New elmrc options
+ internal-mailcap-trusted-programs
+ and internal-mailcap-prompt-trusted are added.


+
+ - Return correct page after returning from
+ o)ptions screen when sorting order is changed.
+ Problem noted by: Ike Stoddard <forw...@oplink.net>
+
+ - Possible fix for error
+ STREAMSCHED PANIC in streamsched.c:1127:ss_noaction_routine
+ when IMAP / TLS connection is closed by server.
+
+ - Handle better "skipped " counter, when there is lot of
+ skipped mails.
+

+ - Cursor movement is changed little
+
+ - Added invoke e)ditor command to header editing screen.
+ Following headers are supported:
+ From:
+ To:
+ CC:
+ Bcc:
+ Reply-To:
+ Subject:
+
+ - Added elmrc variable internal-mailcap-trusted-programs
+ which lists programs for which Mailcap program selection
+ -screen answers 'Yes' by default. In all questions are
+ answered 'Yes' by default, Mailcap program selection -screen
+ is only set if new elmrc variable
+ internal-mailcap-prompt-trusted is set. If program
+ is on internal mailcap is with full path, it should be listed
+ on internal-mailcap-trusted-programs also with full path.
+ Note however that programs given on test= clause on
+ mailcap are executed always without prompting.
+
+ - Internal mailcap parser now support wildcarding of subtype,
+ for example image/*. However these wildcarded entries are
+ treated with lower priority than normal entries. So they
+ normally do not match if there is more specific entry.
+
+ - Avoid divizion be zero when opening non existing
+ (or empty?) mailbox.
+ From: Darren Reed <ava...@caligula.anu.edu.au>
+ ( Divizion by zero seems not be visible on all systems. )
+
+ New elmrc options:
+ internal-mailcap-trusted-programs
+ internal-mailcap-prompt-trusted
+
+ New files:
+ src/screen/def_screen.h
+ src/screen/Makefile.SH
+ src/screen/screen.c
+ src/screen/curs_input.c
+ src/screen/termbuffer.c
+ src/screen/termtitle.c
+ src/screen/termcharset.c
+ src/screen/cur_process.c
+
+ Removed files:
+ src/curses.c
+ hdrs/elm_curses.h
+
+ Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)
+ ------------------------------------------------------------------
+

--- 263,271 ----


- Added '|' -command to message assembly mode (uses readmsg
and therefore requires that folder state information
$ELMSTATE is available.) That command naturally do not
! work if message assembly mode is started from view digest
as mailbox -mode (on that mode there is no usefull folder
! state information.)

Changes of Elm2.4ME+ PL104 (25) compared with Elm2.4ME+ PL103 (25)
------------------------------------------------------------------
***************
*** 8413,8421 ****

term ISO-2022 charset-name
term ISO-2022 charset-definition
! term ISO-2022/DW charset-name
term ISO-2022/DW charset-definition
! term ISO-2022-LIKE charset-name bank-specification
term PRIVATE charset-name d/d d/d d/d
term PRIVATE charset-name [ condition ] d/d d/d d/d

--- 8508,8516 ----



term ISO-2022 charset-name
term ISO-2022 charset-definition
! term ISO-2022/DW charset-name
term ISO-2022/DW charset-definition
! term ISO-2022-LIKE charset-name bank-specification
term PRIVATE charset-name d/d d/d d/d
term PRIVATE charset-name [ condition ] d/d d/d d/d

***************
*** 8451,8463 ****

Read commensts about using of these from doc/terminal.info

! ISO-2022-LIKE indicates that terminal assign private
! codes for charset. That defination do not define iso 2022
! codes for charset, but it is used than these codes are
! defined for charset. For example that may be used on lines
! like

! vt200 ISO-2022-LIKE DEC-MCS left=bank-G0;bank-G0-94=4/2;right=bank-G2;bank-96=3/12


Flag keyword xterm-title specifies that terminal supports

--- 8546,8558 ----



Read commensts about using of these from doc/terminal.info

! ISO-2022-LIKE indicates that terminal assign private
! codes for charset. That defination do not define iso 2022
! codes for charset, but it is used than these codes are
! defined for charset. For example that may be used on lines
! like

! vt200 ISO-2022-LIKE DEC-MCS left=bank-G0;bank-G0-94=4/2;right=bank-G2;bank-96=3/12


Flag keyword xterm-title specifies that terminal supports

***************
*** 8924,8929 ****
--- 9019,9026 ----
imap-use-examine IMAP
incoming-mailbox (POP, IMAP)
internal-mailcaps MIME
+ internal-mailcap-trusted-programs MIME
+ internal-mailcap-prompt-trusted MIME
iso646-charsets MIME
keeppassfor PGP
local-fast-lookup -
Index: elm2.4.ME+.108-cvs/doc/elmrc-info
*** elm2.4.ME+.107/doc/elmrc-info 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/doc/elmrc-info 2003-10-11 11:42:10.000000000 +0300
***************
*** 1,4 ****
! #@(#)$Id: elmrc-info,v 1.53 2003/08/04 14:58:56 hurtta Exp $
# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----
! #@(#)$Id: elmrc-info,v 1.54 2003/10/11 08:42:10 hurtta Exp $
# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************
*** 775,781 ****
# List of mailcaps for internal mailcap support (without metmail).
# List may be space or ':' seperated. Separate values may be quoted.
# Set value to "none" to disable internal mailcap support.
! # See also: metamail-mailcaps

metamail-mailcaps
# List of mailcaps for metamail. List may be space or ':' seperated. Separate
--- 775,792 ----
# List of mailcaps for internal mailcap support (without metmail).
# List may be space or ':' seperated. Separate values may be quoted.
# Set value to "none" to disable internal mailcap support.
! # See also: metamail-mailcaps, internal-mailcap-trusted-programs
!
! internal-mailcap-trusted-programs
! # List of programs which are executed by default when using internal
! # mailcap. Programs given on test= are always executed without
! # prompting.
! # See also: internal-mailcap-prompt-trusted, internal-mailcaps
!
! internal-mailcap-prompt-trusted
! # If set, Mailcap program selection -screen is shown even when
! # all programs asked on screen are executed by default
! # See also: internal-mailcap-trusted-programs

metamail-mailcaps
# List of mailcaps for metamail. List may be space or ':' seperated. Separate
Index: elm2.4.ME+.108-cvs/hdrs/defs.h
*** elm2.4.ME+.107/hdrs/defs.h 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/hdrs/defs.h 2003-10-01 20:34:34.000000000 +0300
***************
*** 1,7 ****
! /* $Id: defs.h,v 1.38 2003/08/04 14:58:56 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
--- 1,7 ----
! /* $Id: defs.h,v 1.39 2003/10/01 17:34:34 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 309,316 ****
--- 309,319 ----
/* find tab stops preceding or following a given column position 'a', where
* the column position starts counting from 1, NOT 0!
* The external integer "tabspacing" must be declared to use this. */
+
+ /*
#define prev_tab(a) (((((a-1)/tabspacing))*tabspacing)+1)
#define next_tab(a) (((((a-1)/tabspacing)+1)*tabspacing)+1)
+ */

#define no_ret(s) { register int xyz; /* varname is for lint */ \
for (xyz=strlen(s)-1; xyz >= 0 && \
Index: elm2.4.ME+.108-cvs/hdrs/elm_curses.h
*** elm2.4.ME+.107/hdrs/elm_curses.h 2003-04-24 18:52:20.000000000 +0300
--- /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
***************
*** 1,78 ****
- /* $Id: elm_curses.h,v 1.8 2003/02/16 10:01:26 hurtta Exp $ */
-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
- *
- * Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
- ******************************************************************************
- * The Elm Mail System
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- ****************************************************************************/
-
- #define OFF 0
- #define ON 1
-
- extern int ClearScreen P_((void)),
- CleartoEOLN P_((void)),
- CleartoEOS P_((void)),
- MoveCursor P_((int, int)),
- StartBold P_((void)),
- EndBold P_((void)),
- StartUnderline P_((void)),
- EndUnderline P_((void)),
- StartHalfbright P_((void)),
- EndHalfbright P_((void)),
- StartInverse P_((void)),
- EndInverse P_((void)),
- RawState P_((void));
-
- /* This must be called before anything else!! */
- extern int InitScreen P_((void));
-
- extern void ScreenSize P_((int *lines, int *columns));
- extern void Write_to_screen P_((
- CONST char *format, CONST char *msg, ...
- ));
- extern void PutLine0 P_((int, int, CONST char *));
- extern void PutLineX P_((int, int, CONST char *, CONST char *, ...));
-
- extern void Writechar P_((int ch));
-
- extern int ReadCh P_((int));
- extern struct charset_state * ReadCh2 P_((int flags));
- extern void SetXYLocation P_((int x, int y));
- extern void CarriageReturn P_((void));
- extern void NewLine P_((void));
- extern void Raw P_((int state));
- extern void transmit_functions P_((int newstate));
- extern void GetXYLocation P_((int *x,int *y));
-
- extern int set_display_charset P_((charset_t set, int silent));
- extern void switch_display_charset P_((int to_display));
- extern charset_t * give_display_charsets P_((charset_t *storage,
- int max));
-
- extern int set_terminal_titles P_((char *title,char *icon));
-
- /* May be called from signal handler
- to_display = 0 -- suspended
- = 1 -- as set
- = 2 -- exiting
- */
- extern void switch_title P_((int to_display));
-
-
-
- extern struct string *curses_printable_clip P_((struct string *S,int *pos,int len,
- int *visible_len,int max_visible));
-
-
- #if POLL_METHOD
- int error_sleep P_((int seconds));
- #endif
- extern int raw_off_called P_((void));
- extern void WriteRaw P_((const char *str));
- extern void FlushBuffer P_((void));
-
--- 0 ----
Index: elm2.4.ME+.108-cvs/hdrs/elm.h
*** elm2.4.ME+.107/hdrs/elm.h 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/hdrs/elm.h 2003-10-01 20:34:34.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elm.h,v 1.16 2003/07/29 18:46:17 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************

--- 1,7 ----
! /* $Id: elm.h,v 1.17 2003/10/01 17:34:34 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
***************
*** 26,32 ****
*/

#include "elmlib.h"
- #include "elm_curses.h"

/******** static character string containing the version number *******/

--- 26,31 ----
Index: elm2.4.ME+.108-cvs/hdrs/elmlib.h
*** elm2.4.ME+.107/hdrs/elmlib.h 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.108-cvs/hdrs/elmlib.h 2003-10-11 14:35:49.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmlib.h,v 1.193 2003/08/19 14:34:12 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.193 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.196 2003/10/11 11:35:49 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.196 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 806,811 ****
--- 806,813 ----
extern char metamail_path[SLEN]; /* Metamail path or "none" if no metamail */
extern PATH metamail_mailcaps; /* mailcaps for metamail */
extern PATH internal_mailcaps; /* mailcaps for internal handler */
+ extern PATH internal_mailcap_t_programs; /* Execute program without asking */
+ extern int internal_mailcap_t_prompt; /* ... really? */
extern int metoo; /* flag: copy me on mail to alias? */
extern int mimeforward;
extern int mime_body_keywords; /* flag: if false the body is not parsed for keywords */
***************
*** 1111,1116 ****
--- 1113,1121 ----

/* lib/mbox.c */

+ #define OFF 0
+ #define ON 1
+
typedef struct header_list * header_list_ptr;

enum sessionlock_mode { SESSIONLOCK_NORMAL = 0,
***************
*** 2127,2133 ****
/* WARNING: May return codes > MIME_TYPE_VIDEO if unknow or bad type */
extern enum mime_major_type get_major_type_code P_((media_type_t T));
extern CONST char * get_major_type_name P_((media_type_t T));
!

#define MIME_RFC822 1
#define MIME_MIXED 2
--- 2132,2138 ----
/* WARNING: May return codes > MIME_TYPE_VIDEO if unknow or bad type */
extern enum mime_major_type get_major_type_code P_((media_type_t T));
extern CONST char * get_major_type_name P_((media_type_t T));
! extern CONST char * get_major_type_name2 P_((enum mime_major_type m));

#define MIME_RFC822 1
#define MIME_MIXED 2
***************
*** 2140,2145 ****
--- 2145,2152 ----
extern int get_type_flags P_((media_type_t T));
extern CONST char * get_subtype_name P_((media_type_t T));

+ extern enum mime_major_type give_major_type P_(( const char * major,
+ int create));

extern media_type_t give_media_type P_(( const char * major,
const char * minor,
Index: elm2.4.ME+.108-cvs/hdrs/elmutil.h
*** elm2.4.ME+.107/hdrs/elmutil.h 2002-01-26 13:14:45.000000000 +0200
--- elm2.4.ME+.108-cvs/hdrs/elmutil.h 2003-10-01 20:34:34.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmutil.h,v 1.9 2001/06/16 10:40:36 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! /* $Id: elmutil.h,v 1.10 2003/10/01 17:34:34 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 23,29 ****

#include "patchlevel.h"
#include "elmlib.h"
- #include "elm_curses.h"

/******** static character string containing the version number *******/

--- 23,28 ----
Index: elm2.4.ME+.108-cvs/hdrs/hdr_imp.h
*** elm2.4.ME+.107/hdrs/hdr_imp.h 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.108-cvs/hdrs/hdr_imp.h 2003-10-05 19:07:27.000000000 +0300
***************
*** 28,39 ****
--- 28,63 ----


int demime,
charset_t defcharset,
int replace));

+ int add_to_hdr P_((struct mailing_headers * headers,


+ header_ptr X,
+ const char *value,
+ int demime,
+ charset_t defcharset,
+ int replace));

+ int add_cc_hdr P_((struct mailing_headers * headers,


+ header_ptr X,
+ const char *value,
+ int demime,
+ charset_t defcharset,
+ int replace));

+ int add_bcc_hdr P_((struct mailing_headers * headers,


+ header_ptr X,
+ const char *value,
+ int demime,
+ charset_t defcharset,
+ int replace));
int add_replyto_hdr P_((struct mailing_headers * headers,

header_ptr X,
const char *value,

int demime,
charset_t defcharset,
int replace));

+ int add_subject_hdr P_((struct mailing_headers * headers,


+ header_ptr X,
+ const char *value,
+ int demime,
+ charset_t defcharset,
+ int replace));
int add_user_hdr P_((struct mailing_headers * headers,
header_ptr X,
const char *value,

Index: elm2.4.ME+.108-cvs/hdrs/headers.h
*** elm2.4.ME+.107/hdrs/headers.h 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/hdrs/headers.h 2003-10-01 20:34:34.000000000 +0300
***************
*** 1,7 ****
! /* $Id: headers.h,v 1.18 2003/07/29 18:46:17 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
--- 1,7 ----
! /* $Id: headers.h,v 1.19 2003/10/01 17:34:34 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 17,28 ****
#include <setjmp.h>

#include "elmlib.h"
- #include "elm_curses.h"

#include "mime.h"
! /*
! #include "me.h"
! */
/******** global variables accessable by all pieces of the program *******/


--- 17,25 ----
#include <setjmp.h>

#include "elmlib.h"

#include "mime.h"
!
/******** global variables accessable by all pieces of the program *******/


Index: elm2.4.ME+.108-cvs/hdrs/me.h
*** elm2.4.ME+.107/hdrs/me.h 2003-08-11 11:21:18.000000000 +0300
--- elm2.4.ME+.108-cvs/hdrs/me.h 2003-10-05 19:07:27.000000000 +0300
***************
*** 1,7 ****
! /* $Id: me.h,v 1.74 2003/08/10 10:03:35 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.74 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! /* $Id: me.h,v 1.76 2003/10/05 16:07:27 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 653,659 ****
charset_t hdr_charset));
extern void edit_headers P_((struct mailing_headers *headers,
struct mailer_info *mailer_info,
! charset_t hdr_charset));

extern struct string *hdr_to_expval P_((struct expanded_address addrs));
extern void hdr_to_buffer P_((struct expanded_address addrs,
--- 653,660 ----
charset_t hdr_charset));
extern void edit_headers P_((struct mailing_headers *headers,
struct mailer_info *mailer_info,
! charset_t hdr_charset,
! int hdr_encondig_supported));

extern struct string *hdr_to_expval P_((struct expanded_address addrs));
extern void hdr_to_buffer P_((struct expanded_address addrs,
***************
*** 674,679 ****
--- 675,681 ----

/* editmsg.c */

+ extern int have_editor P_((char *editor));
extern int edit_the_message P_((char *filename,
int already_has_text,
struct mailing_headers * headers,
***************
*** 970,975 ****
--- 972,1046 ----
extern int have_partial P_((struct MailboxView *parent_mailbox));


+ /* screen/screen.c */
+
+ extern int InitScreen P_((void));
+ extern void ScreenSize P_((int *lines, int *columns));
+ extern void Writechar P_((int ch));
+ extern void Write_to_screen P_((CONST char *format, CONST char *msg, ...));
+ extern void PutLine0 P_((int x, int y, CONST char *line));
+ extern void PutLineX P_((int line , int col, CONST char *, CONST char *, ...));
+ extern int CleartoEOLN P_((void));
+ extern int CleartoEOS P_((void));
+ extern int RawState P_((void));
+ extern void Raw P_((int state));
+ extern struct charset_state * ReadCh2 P_((int flags));
+ extern int ReadCh P_((int flags));
+ extern void GetXYLocation P_((int *x,int *y));
+ extern int ClearScreen P_((void));
+ extern int MoveCursor P_((int row, int col));
+ extern void CarriageReturn P_((void));
+ extern void NewLine P_((void));
+ extern int StartBold P_((void));
+ extern int EndBold P_((void));
+ extern int StartInverse P_((void));
+ extern int EndInverse P_((void));
+ extern int ClearScreen P_((void));
+ extern int get_tabspacing P_((void));
+ extern int StartUnderline P_((void));
+ extern int EndUnderline P_((void));
+ extern int StartHalfbright P_((void));
+ extern int EndHalfbright P_((void));
+
+ /* screen/curses.c */
+
+ extern void WriteRaw P_((const char *str));
+ extern struct string *curses_printable_clip P_((struct string *S,
+ int *pos,
+ int len,
+ int *visible_len,
+ int max_visible));
+ extern int raw_off_called P_((void));
+ extern void transmit_functions P_((int newstate));
+ extern void InvalidateLocation P_((void));
+
+ /* screen/curs_input.c */
+
+ #if POLL_METHOD
+ extern int error_sleep P_((int seconds));
+ #endif
+
+ /* screen/termcharcharset.c */
+
+ extern charset_t * give_display_charsets P_((charset_t *storage,
+ int max));
+
+ extern int set_display_charset P_((charset_t set,
+ int silent));
+ extern void switch_display_charset P_((int to_display));
+
+
+ /* screen/termtitle.c */
+
+ extern int set_terminal_titles P_((char *title,
+ char *icon));
+ extern void switch_title P_((int to_display));
+
+
+ /* screen/termbuffer.c */
+
+ extern void FlushBuffer P_((void));
+
/*
* Local Variables:
* mode:c
Index: elm2.4.ME+.108-cvs/hdrs/save_opts.h
*** elm2.4.ME+.107/hdrs/save_opts.h 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/hdrs/save_opts.h 2003-10-11 11:42:10.000000000 +0300
***************
*** 1,7 ****
! /* @(#)$Id: save_opts.h,v 1.71 2003/08/04 14:58:57 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! /* @(#)$Id: save_opts.h,v 1.72 2003/10/11 08:42:10 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.72 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 309,314 ****
--- 309,318 ----
#endif
{"incoming-mailbox", -1L,ZZZ_DT_STR(raw_defaultfile),
sizeof raw_defaultfile, NULL },
+ {"internal-mailcap-prompt-trusted", -1L,
+ ZZZ_DT_BOL(&internal_mailcap_t_prompt), 0, NULL },
+ {"internal-mailcap-trusted-programs",
+ -1L,ZZZ_DT_PATH(&internal_mailcap_t_programs), 0, NULL},
{"internal-mailcaps", -1L,ZZZ_DT_PATH(&internal_mailcaps), 0, NULL},
{"iso646-charsets", -1L,ZZZ_DT_FUNC(charset_iso646func),0, NULL},
{"keep", -1L,ZZZ_DT_SYN("keepempty"), 0, NULL},
Index: elm2.4.ME+.108-cvs/hdrs/s_elm.h
*** elm2.4.ME+.107/hdrs/s_elm.h 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.108-cvs/hdrs/s_elm.h 2003-10-05 19:07:27.000000000 +0300
***************
*** 1078,1080 ****
--- 1078,1087 ----
#define ElmAssemble 0x851
#define ElmNotCollected 0x852
#define ElmSearchingInMessageDone 0x853
+ #define ElmHdrmenuInstruct1 0x854
+ #define ElmHdrmenuInstruct1NoShell 0x855
+ #define ElmHdrEditComment 0x856
+ #define ElmHdrEditCommentEnc 0x857
+ #define ElmHdrEditCommentNo 0x858
+ #define ElmHdrNotSupported 0x859
+ #define ElmHdrGarbage 0x85a
Index: elm2.4.ME+.108-cvs/lib/headers.c
*** elm2.4.ME+.107/lib/headers.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.108-cvs/lib/headers.c 2003-10-05 19:07:27.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: headers.c,v 1.26 2003/09/02 18:52:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: headers.c,v 1.27 2003/10/05 16:07:27 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 412,418 ****

static struct header_info header_types[] = {
/* From STD 11 (RFC 822): */
! { "Subject", hdr_decode_from_text, no_add_to_mail_hdr },


{ "Comments", hdr_decode_from_text, no_add_to_mail_hdr },
{ "Return-path", hdr_decode_from_comment, add_env_from_hdr },
{ "Received", hdr_decode_from_comment, no_add_to_mail_hdr },

--- 412,418 ----

static struct header_info header_types[] = {
/* From STD 11 (RFC 822): */
! { "Subject", hdr_decode_from_text, add_subject_hdr },


{ "Comments", hdr_decode_from_text, no_add_to_mail_hdr },
{ "Return-path", hdr_decode_from_comment, add_env_from_hdr },
{ "Received", hdr_decode_from_comment, no_add_to_mail_hdr },

***************
*** 424,434 ****
{ "Resent-Sender", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "Date", hdr_decode_from_comment, no_add_to_mail_hdr },
{ "Resent-Date", hdr_decode_from_comment, no_add_to_mail_hdr },
! { "To", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "Resent-To", hdr_decode_from_addr, no_add_to_mail_hdr },
! { "cc", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "Resent-cc", hdr_decode_from_addr, no_add_to_mail_hdr },
! { "bcc", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "Resent-bcc", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "Message-ID", hdr_decode_from_comment, no_add_to_mail_hdr },
{ "Resent-Message-ID", hdr_decode_from_comment, no_add_to_mail_hdr },
--- 424,434 ----
{ "Resent-Sender", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "Date", hdr_decode_from_comment, no_add_to_mail_hdr },
{ "Resent-Date", hdr_decode_from_comment, no_add_to_mail_hdr },
! { "To", hdr_decode_from_addr, add_to_hdr },
{ "Resent-To", hdr_decode_from_addr, no_add_to_mail_hdr },
! { "cc", hdr_decode_from_addr, add_cc_hdr },
{ "Resent-cc", hdr_decode_from_addr, no_add_to_mail_hdr },
! { "bcc", hdr_decode_from_addr, add_bcc_hdr },
{ "Resent-bcc", hdr_decode_from_addr, no_add_to_mail_hdr },
{ "Message-ID", hdr_decode_from_comment, no_add_to_mail_hdr },
{ "Resent-Message-ID", hdr_decode_from_comment, no_add_to_mail_hdr },
Index: elm2.4.ME+.108-cvs/lib/Makefile.SH
*** elm2.4.ME+.107/lib/Makefile.SH 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/lib/Makefile.SH 2003-10-01 20:34:34.000000000 +0300
***************
*** 46,52 ****
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.85 2003/07/24 16:29:51 hurtta Exp $
#
# Makefile for the ELM mail program.
#
--- 46,52 ----
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.86 2003/10/01 17:34:34 hurtta Exp $
#
# Makefile for the ELM mail program.
#
***************
*** 372,382 ****
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elm.h: $(INCLDIR)/elm_curses.h $(INCLDIR)/defs.h $(INCLDIR)/melib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/elm_curses.h $(INCLDIR)/defs.h $(INCLDIR)/elmlib.h $(INCLDIR)/me.h
$(CHMOD) u+w $@
$(TOUCH) $@

--- 372,382 ----
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elm.h: $(INCLDIR)/defs.h $(INCLDIR)/melib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/elmlib.h $(INCLDIR)/me.h
$(CHMOD) u+w $@
$(TOUCH) $@

Index: elm2.4.ME+.108-cvs/lib/mediatype.c
*** elm2.4.ME+.107/lib/mediatype.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/lib/mediatype.c 2003-10-12 09:42:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.7 2003/08/04 14:58:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.10 2003/10/12 06:42:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 136,141 ****
--- 136,153 ----
return major_type_list[T->major_type_index].name;
}

+ CONST char * get_major_type_name2(m)
+ enum mime_major_type m;
+ {
+ if (m < 0 || m >= major_type_count)
+ panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_major_type_name2",
+ "Bad major_type_index",0);
+
+ return major_type_list[m].name;
+ }
+
+
+
int get_type_flags(T)
media_type_t T;
{
***************
*** 171,190 ****
return T->subtype;
}

! media_type_t give_media_type(major,minor,create)
const char * major;
- const char * minor;
int create;
{
int i;

for (i = 0; i < major_type_count; i++)
if (0 == istrcmp(major,major_type_list[i].name))
break;

if (i >= major_type_count) {
if (!create)
! return NULL;

if (!MAJOR_TYPE_MALLOCED) {
major_type_list = safe_malloc((major_type_count+1) *
--- 183,205 ----
return T->subtype;
}

! enum mime_major_type give_major_type(major,create)
const char * major;
int create;
{
int i;

+ if (NULL != strchr(major,'/'))
+ panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"give_major_type",
+ "Bad major type",0);
+
for (i = 0; i < major_type_count; i++)
if (0 == istrcmp(major,major_type_list[i].name))
break;

if (i >= major_type_count) {
if (!create)
! return MIME_TYPE_UNKNOWN;

if (!MAJOR_TYPE_MALLOCED) {
major_type_list = safe_malloc((major_type_count+1) *
***************
*** 205,214 ****
i = major_type_count++;

DPRINT(Debug,10,(&Debug,
! "give_media_type: Created major type %d: %s\n",
i,major_type_list[i].name));
}
! return give_media_type2((enum mime_major_type)i,minor,create);
}

media_type_t give_media_type2(major_type_code,minor,create)
--- 220,244 ----
i = major_type_count++;

DPRINT(Debug,10,(&Debug,
! "give_major_type: Created major type %d: %s\n",
i,major_type_list[i].name));
}
!
! return (enum mime_major_type)i;
! }
!
! media_type_t give_media_type(major,minor,create)
! const char * major;
! const char * minor;
! int create;
! {
!
! enum mime_major_type I1 = give_major_type(major,create);
!
! if (MIME_TYPE_UNKNOWN == I1)
! return NULL;
!
! return give_media_type2(I1,minor,create);
}

media_type_t give_media_type2(major_type_code,minor,create)
Index: elm2.4.ME+.108-cvs/lib/outheaders.c
*** elm2.4.ME+.107/lib/outheaders.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.108-cvs/lib/outheaders.c 2003-10-05 19:07:27.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.11 2003/04/22 18:34:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.12 2003/10/05 16:07:27 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

*****************************************************************************/
***************
*** 400,405 ****
--- 400,515 ----
return 1;
}

+
+ #ifdef ANSI_C
+ hdr_add_to_mailing_hdr add_to_hdr;
+ #endif
+ int add_to_hdr(headers,X,value,demime,defcharset,replace)


+ struct mailing_headers * headers;
+ header_ptr X;
+ CONST char *value;
+ int demime;
+ charset_t defcharset;
+ int replace;
+ {
+ int j;
+
+ struct addr_item * TMP;
+
+ TMP = break_down_address(value,demime,defcharset);
+
+ if (replace)

+ free_expanded_address(&(headers->to));


+
+ for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {

+ int pos = add_expanded_addr_(&(headers->to),


+ TMP[j].addr,
+ TMP[j].fullname,
+ TMP[j].comment);
+ struct string *s = make_surface_addr(TMP[j]);

+ add_textual_addr_(&(headers->to),s,pos,1);


+ free_string(&s);
+ }
+
+ free_addr_items(TMP);
+
+ return 1;
+ }
+
+
+ #ifdef ANSI_C

+ hdr_add_to_mailing_hdr add_cc_hdr;
+ #endif
+ int add_cc_hdr(headers,X,value,demime,defcharset,replace)


+ struct mailing_headers * headers;
+ header_ptr X;
+ CONST char *value;
+ int demime;
+ charset_t defcharset;
+ int replace;
+ {
+ int j;
+
+ struct addr_item * TMP;
+
+ TMP = break_down_address(value,demime,defcharset);
+
+ if (replace)

+ free_expanded_address(&(headers->cc));


+
+ for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {

+ int pos = add_expanded_addr_(&(headers->cc),


+ TMP[j].addr,
+ TMP[j].fullname,
+ TMP[j].comment);
+ struct string *s = make_surface_addr(TMP[j]);

+ add_textual_addr_(&(headers->cc),s,pos,1);


+ free_string(&s);
+ }
+
+ free_addr_items(TMP);
+
+ return 1;
+ }
+
+
+ #ifdef ANSI_C

+ hdr_add_to_mailing_hdr add_bcc_hdr;
+ #endif
+ int add_bcc_hdr(headers,X,value,demime,defcharset,replace)


+ struct mailing_headers * headers;
+ header_ptr X;
+ CONST char *value;
+ int demime;
+ charset_t defcharset;
+ int replace;
+ {
+ int j;
+
+ struct addr_item * TMP;
+
+ TMP = break_down_address(value,demime,defcharset);
+
+ if (replace)

+ free_expanded_address(&(headers->bcc));


+
+ for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {

+ int pos = add_expanded_addr_(&(headers->bcc),


+ TMP[j].addr,
+ TMP[j].fullname,
+ TMP[j].comment);
+ struct string *s = make_surface_addr(TMP[j]);

+ add_textual_addr_(&(headers->bcc),s,pos,1);


+ free_string(&s);
+ }
+
+ free_addr_items(TMP);
+
+ return 1;
+ }
+
+
+
#ifdef ANSI_C

hdr_add_to_mailing_hdr add_replyto_hdr;
#endif
***************
*** 471,476 ****
--- 581,609 ----
}


+ /* This replaces always */
+ #ifdef ANSI_C
+ hdr_add_to_mailing_hdr add_subject_hdr;
+ #endif
+
+ int add_subject_hdr(headers,X,value,demime,defcharset,replace)


+ struct mailing_headers * headers;
+ header_ptr X;

+ const char *value;


+ int demime;
+ charset_t defcharset;
+ int replace;
+ {

+ if (headers->subject)
+ free_string( & (headers->subject) );
+
+ headers->subject =
+ hdr_to_string(HDR_TEXT,value,defcharset,demime);


+
+ return 1;
+ }
+
+

#ifdef ANSI_C
hdr_add_to_mailing_hdr add_user_hdr;
***************
*** 485,497 ****
int replace;
{
if (replace) {
int i;
for (i = 0; i < headers->user_header_count; i++) {
! if (headers->user_header[i].value)
! free_string(&(headers->user_header[i].value));
! headers->user_header[i].name = NULL;
}
! headers->user_header_count = 0;
}

headers->user_header = safe_realloc(headers->user_header,
--- 618,648 ----
int replace;
{
if (replace) {
+
+ /* Only replace header with same name */
+
int i;
+ int count = 0;
+
for (i = 0; i < headers->user_header_count; i++) {
!
! if (X == headers->user_header[i].name) {
!
! if (headers->user_header[i].value)
! free_string(&(headers->user_header[i].value));
! headers->user_header[i].name = NULL;
! } else {
! headers->user_header[count] = headers->user_header[i];
!
! if (count != i) {
! headers->user_header[i].value = NULL;
! headers->user_header[i].name = NULL;
! }
! count++;
! }
!
}
! headers->user_header_count = count;
}

headers->user_header = safe_realloc(headers->user_header,
Index: elm2.4.ME+.108-cvs/lib/read_rc.c
*** elm2.4.ME+.107/lib/read_rc.c 2003-08-16 09:58:21.000000000 +0300
--- elm2.4.ME+.108-cvs/lib/read_rc.c 2003-10-11 11:42:11.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.117 2003/08/15 19:54:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.117 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.118 2003/10/11 08:42:11 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.118 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************

*** 264,269 ****
--- 264,276 ----
NULL, 0,NULL
};

+ PATH internal_mailcap_t_programs = {
+ 0,
+ NULL, 0, NULL
+ };
+ int internal_mailcap_t_prompt = 0;
+
+
int metoo = 0; /* flag: copy me on mail to alias? */
int mime_body_keywords = TRUE; /* flag: parse body looking for encode */
/* keywords */
Index: elm2.4.ME+.108-cvs/lib/streamsched.c


*** elm2.4.ME+.107/lib/streamsched.c 2003-05-28 21:49:27.000000000 +0300

--- elm2.4.ME+.108-cvs/lib/streamsched.c 2003-09-26 19:06:17.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.29 2003/05/17 16:13:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.31 2003/09/26 16:06:17 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

Index: elm2.4.ME+.108-cvs/Makefile.SH
*** elm2.4.ME+.107/Makefile.SH 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/Makefile.SH 2003-10-01 20:34:33.000000000 +0300
***************


*** 21,27 ****
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.17 2003/07/24 16:29:51 hurtta Exp $


#
# Makefile for the entire ELM mail system
#
--- 21,27 ----
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.18 2003/10/01 17:34:33 hurtta Exp $


#
# Makefile for the entire ELM mail system
#
***************

*** 87,92 ****
--- 87,93 ----
cd melib; $(MAKE) $(MJ) $(MFLAGS) $@
cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) $@
cd src/messages; $(MAKE) $(MJ) $(MFLAGS) $@
+ cd src/screen; $(MAKE) $(MJ) $(MFLAGS) $@
cd src; $(MAKE) $(MJ) $(MFLAGS) $@
cd utils; $(MAKE) $(MJ) $(MFLAGS) $@
cd doc; $(MAKE) $(MJ) $(MFLAGS) $@
Index: elm2.4.ME+.108-cvs/MANIFEST
*** elm2.4.ME+.107/MANIFEST 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.108-cvs/MANIFEST 2003-10-01 20:34:33.000000000 +0300
***************
*** 41,47 ****
doc/printmail.1
doc/readmsg.1
doc/tmac.n
- hdrs/elm_curses.h
hdrs/defs.h
hdrs/elm.h
hdrs/elmutil.h
--- 41,46 ----
***************
*** 149,155 ****
src/attach_menu.c
src/builtin++.c
src/calendar.c
- src/curses.c
src/date.c
src/delete.c
src/edit.c
--- 148,153 ----
***************
*** 380,382 ****
--- 378,389 ----
charset/MAPPINGS/MICSFT/CP1256.TXT
charset/MAPPINGS/MICSFT/CP1257.TXT
charset/MAPPINGS/MICSFT/CP1258.TXT
+ src/screen/def_screen.h
+ src/screen/Makefile.SH
+ src/screen/screen.c
+ src/screen/curs_input.c
+ src/screen/termbuffer.c
+ src/screen/termtitle.c
+ src/screen/termcharset.c
+ src/screen/cur_process.c
+ src/screen/curses.c
Index: elm2.4.ME+.108-cvs/melib/mailcap.c
*** elm2.4.ME+.107/melib/mailcap.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/melib/mailcap.c 2003-10-11 14:35:49.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.9 2003/08/01 08:22:11 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.10 2003/10/11 11:35:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 465,470 ****
--- 465,471 ----
struct mailcap_entry Entry; /* Temporary storage */
int unsupported = 0;
media_type_t T = NULL;
+ enum mime_major_type T_major = MIME_TYPE_UNKNOWN;

zero_mailcap_entry(&Entry);
arg_zero(&keyword);
***************
*** 538,544 ****
linenum,mailcaps[mailcap_idx]);

unsupported++;
! } else if (mcES_error == entry_state || !T) {
unsupported++;
} else
process_field(mailcaps[mailcap_idx],linenum,
--- 539,546 ----
linenum,mailcaps[mailcap_idx]);

unsupported++;
! } else if (mcES_error == entry_state ||
! !T && T_major == MIME_TYPE_UNKNOWN) {
unsupported++;
} else
process_field(mailcaps[mailcap_idx],linenum,
***************
*** 560,573 ****
entry->type = handle_mailcap_entry;
entry->p.mailcap = mailcap;

! register_mt_handler(T,entry);

! DPRINT(Debug,4,(&Debug,
! "Mailcap entry for %s/%s added (%s:%d)\n",
! get_major_type_name(T),
! get_subtype_name(T),
! mailcaps[mailcap_idx],
! linenum));

} else {
DPRINT(Debug,2,(&Debug,
--- 562,587 ----
entry->type = handle_mailcap_entry;
entry->p.mailcap = mailcap;

! if (T) {
! register_mt_handler(T,entry);
!
! DPRINT(Debug,4,(&Debug,
! "Mailcap entry for %s/%s added (%s:%d)\n",
! get_major_type_name(T),
! get_subtype_name(T),
! mailcaps[mailcap_idx],
! linenum));
! } else {
! register_mt_defhandler(T_major,entry);
!
! DPRINT(Debug,4,(&Debug,
! "Mailcap entry for default %s/* added (%s:%d)\n",
! get_major_type_name2(T_major),
! mailcaps[mailcap_idx],
! linenum));

!
! }

} else {
DPRINT(Debug,2,(&Debug,
***************
*** 578,583 ****
--- 592,598 ----

unsupported = 0;
T = NULL;
+ T_major = MIME_TYPE_UNKNOWN;

arg_free(&keyword);
arg_free(&string);
***************
*** 824,831 ****
c++;
}

! if (!c || 0 == strcmp(c,"*"))
unsupported++; /* Wild cards are not supported */
else
T = give_media_type(keyword.arg,c,1);
}
--- 839,848 ----
c++;
}

! if (!c)
unsupported++; /* Wild cards are not supported */
+ else if (0 == strcmp(c,"*"))
+ T_major = give_major_type(keyword.arg,1);
else
T = give_media_type(keyword.arg,c,1);
}
Index: elm2.4.ME+.108-cvs/melib/Makefile.SH
*** elm2.4.ME+.107/melib/Makefile.SH 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/melib/Makefile.SH 2003-10-01 20:34:34.000000000 +0300
***************
*** 16,22 ****
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.16 2003/08/04 14:58:57 hurtta Exp $
# Makefile for the ELM mail program.
#
# Variables
--- 16,22 ----
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17 2003/10/01 17:34:34 hurtta Exp $
# Makefile for the ELM mail program.
#
# Variables
***************
*** 101,111 ****
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elm.h: $(INCLDIR)/elm_curses.h $(INCLDIR)/defs.h $(INCLDIR)/melib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/elm_curses.h $(INCLDIR)/defs.h \
$(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@
--- 101,111 ----
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elm.h: $(INCLDIR)/defs.h $(INCLDIR)/melib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h \
$(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@
Index: elm2.4.ME+.108-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.107/nls/C/C/C/s_elm.m 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.108-cvs/nls/C/C/C/s_elm.m 2003-10-05 19:07:28.000000000 +0300
***************
*** 2259,2261 ****
--- 2259,2276 ----
2130 "%.2s-- %-3d <--- message not collected --->
$ #SearchingInMessageDone
2131 "Searching %d. Done "
+ $ #HdrmenuInstruct1
+ 2132 "Choose header, u)ser defined header, !)shell, invoke e)ditor, or <return>."
+ $ #HdrmenuInstruct1NoShell
+ 2133 "Choose header, u)ser defined header, invoke e)ditor, or <return>."
+ $ #HdrEditComment
+ 2134 "# Headers are automatically converted from %s charset and not need encoded\n"
+ $ #HdrEditCommentEnc
+ 2135 "# MIME enconding of headers is supported\n"
+ $ #HdrEditCommentNo
+ 2136 "# MIME enconding of headers is NOT supported\n"
+ $ #HdrNotSupported
+ 2137 "Editing of %s header is not supported."
+ $ #HdrGarbage
+ 2138 "Garbage on header file"
+
Index: elm2.4.ME+.108-cvs/OBSOLETE
*** elm2.4.ME+.107/OBSOLETE 2002-12-15 12:00:26.000000000 +0200
--- elm2.4.ME+.108-cvs/OBSOLETE 2003-10-01 20:34:33.000000000 +0300
***************
*** 32,34 ****
--- 32,36 ----
src/state.c
src/wildcards.c
src/wordwrap.c
+ src/curses.c
+ hdrs/elm_curses.h
Index: elm2.4.ME+.108-cvs/src/builtin++.c
*** elm2.4.ME+.107/src/builtin++.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/builtin++.c 2003-10-01 20:34:34.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.19 2003/07/29 18:46:18 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.20 2003/10/01 17:34:34 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 203,209 ****
switch(ch) {
case 0x0009: /* HT */
Writechar('\t');
! chars = ((chars / tabspacing ) +1) * tabspacing;
break;
case 0x000C: /* FF */
case 0x000B: /* VT */
--- 203,210 ----
switch(ch) {
case 0x0009: /* HT */
Writechar('\t');
! chars = ((chars / get_tabspacing() ) +1) *
! get_tabspacing();
break;
case 0x000C: /* FF */
case 0x000B: /* VT */
Index: elm2.4.ME+.108-cvs/src/curses.c
*** elm2.4.ME+.107/src/curses.c 2003-08-16 09:58:21.000000000 +0300
--- /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
***************
*** 1,2293 ****
- static char rcsid[] = "@(#)$Id: curses.c,v 1.39 2003/08/12 07:52:02 hurtta Exp $";
-
- /*****************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
- *
- * Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
- ******************************************************************************
- * The Elm Mail System
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- *
- *****************************************************************************/
-
- /** This library gives programs the ability to easily access the
- termcap information and write screen oriented and raw input
- programs. The routines can be called as needed, except that
- to use the cursor / screen routines there must be a call to
- InitScreen() first.
-
- **/
-
- /** NOTE THE ADDITION OF: the #ifndef ELM stuff around routines that
- we don't use. This is for code size and compile time speed...
- **/
-
- #include "def_elm.h"
- #include "s_elm.h"
- #include <errno.h>
-
- DEBUG_VAR(Debug,__FILE__,"ui");
-
- #ifdef I_CURSES
- #include <curses.h> /* <term.h> requires ... */
- #endif /* I_CURSES */
- #ifdef I_TERM
- #include <term.h> /* Defination for tgetent.h and so on ... */
- #endif /* I_TERM */
-
- #undef lines /* ... But undefine lines macro */
- #undef columns /* ... But undefine columns macro */
-
- #ifdef TERMIOS
- # include <termios.h>
- # ifndef sun
- # include <sys/ioctl.h> /* for TIOCGWINSZ */
- # endif
- #else
- # ifdef TERMIO
- # include <termio.h>
- # else
- # include <sgtty.h>
- # endif
- #endif
-
- #include <errno.h>
-
- #ifdef PTEM
- # include <sys/stream.h>
- # include <sys/ptem.h>
- #endif
-
- #ifdef SHORTNAMES
- # define _clearinverse _clrinv
- # define _cleartoeoln _clrtoeoln
- # define _cleartoeos _clr2eos
- # define _transmit_off xmit_off
- # define _transmit_on xmit_on
- #endif
-
- #ifdef TERMIOS
- struct termios _raw_tty,
- _original_tty;
- #define ttgetattr(fd,where) tcgetattr((fd),(where))
- #define ttsetattr(fd,where) tcsetattr((fd),TCSADRAIN,(where))
- #else /*TERMIOS*/
- # ifdef TERMIO
- struct termio _raw_tty,
- _original_tty;
- #define ttgetattr(fd,where) ioctl((fd),TCGETA,(where))
- #define ttsetattr(fd,where) ioctl((fd),TCSETAW,(where))
- # else
- struct tty_modes {
- struct sgttyb sgttyb;
- struct tchars tchars;
- } _raw_tty, _original_tty;
- static int ttgetattr P_((int,struct tty_modes *)); /* Prototype */
- static int ttsetattr P_((int,struct tty_modes *)); /* Prototype */
- # endif /*TERMIO*/
- #endif /*TERMIOS*/
-
- static int _inraw = 0; /* are we IN rawmode? */
-
- #define DEFAULT_LINES_ON_TERMINAL 24
- #define DEFAULT_COLUMNS_ON_TERMINAL 80
-
- static int _memory_locked = 0; /* are we IN memlock?? */
-
- static VOLATILE int _line = -1; /* initialize to "trash" */
- static VOLATILE int _col = -1;
-
- static int _intransmit = -1; /* are we transmitting keys? */
-
- static
- char *_clearscreen = NULL, *_moveto = NULL, *_up = NULL, *_down = NULL,
- *_right = NULL, *_left = NULL, *_setbold = NULL, *_clearbold = NULL,
- *_setunderline = NULL, *_clearunderline = NULL, *_sethalfbright = NULL,
- *_clearhalfbright = NULL, *_setinverse = NULL, *_clearinverse = NULL,
- *_cleartoeoln = NULL, *_cleartoeos = NULL, *_transmit_on = NULL,
- *_transmit_off = NULL, *_set_memlock = NULL, *_clear_memlock = NULL,
- *_start_termcap = NULL, *_end_termcap = NULL, *_bell = NULL,
-
- *_key_up = NULL, *_key_down = NULL, *_key_left = NULL, *_key_right = NULL,
- *_key_pageup = NULL, *_key_pagedown = NULL, *_key_home = NULL,
- *_key_help = NULL, *_key_find = NULL;
-
- static int _lines, _columns, _automargin, _eatnewlineglitch;
- int tabspacing;
- static int tabexpand = 0; /* Is terminal driver expanding tabs? */
-
- static char _terminal[1024]; /* Storage for terminal entry */
- static char _capabilities[1024]; /* String for cursor motion */
-
- static char *ptr = _capabilities; /* for buffering */
-
- static int cursor_control = 0;
- static int need_moveabsolute = 0;
-
- char *tgetstr(), /* Get termcap capability */
- *tgoto(); /* and the goto stuff */
-
- static int outchar P_((int c));
-
- static char terminal_type[40] = "";
-
- static charset_t target_display_charset = NULL;
- static struct charset_state * last_state = NULL;
- static screen_info_p last_display_state = NULL;
-
- static char *us2s P_((unsigned char *str));
- static char *us2s(str)
- unsigned char *str;
- {
- return (char *)str;
- }
-
-
- static void print_status_1 P_((struct run_state *rs,int sig,int exit_code));
- static void print_status_1(rs,sig,exit_code)
- struct run_state *rs;
- int sig, exit_code;
- {
- redraw:
- if (sig)
- PutLineX(elm_LINES,0,
- CATGETS(elm_msg_cat, ElmSet,
- ElmTerminatedWithSignal,
- "Terminated with signal %d. Press any key to continue: "),
- sig);
- else if (exit_code)
- PutLineX(elm_LINES,0,
- CATGETS(elm_msg_cat, ElmSet,
- ElmExitedWithStatus,
- "Exited with status %d. Press any key to continue: "),
- exit_code);
- else
- PutLineX(elm_LINES,0,
- CATGETS(elm_msg_cat, ElmSet,
- ElmDoneCont,
- "Done. Press any key to continue: "));
- if (ReadCh(REDRAW_MARK) == REDRAW_MARK)
- goto redraw;
- }
-
- static void print_status_cooked P_((struct run_state *rs,int sig,int exit_code));
- static void print_status_cooked(rs,sig,exit_code)
- struct run_state *rs;
- int sig, exit_code;
- {
- Raw(ON | NO_TITE);
-
- print_status_1(rs,sig,exit_code);
-
- Raw(OFF | NO_TITE);
- printf("\n\r");
- }
-
- static void print_status P_((struct run_state *rs,int sig,int exit_code));
- static void print_status(rs,sig,exit_code)
- struct run_state *rs;
- int sig, exit_code;
- {
- if (rs->raw == ON && ( SY_CLRWAIT & rs->options )) {
-
- print_status_1(rs,sig,exit_code);
- }
- }
-
- static void start_run_tty_init P_((void));
- static void start_run_tty_init()
- {
- MoveCursor(elm_LINES,0);
- CleartoEOLN();
- FlushBuffer();
- }
-
-
- static int terminal_fd = 1; /* Standard output, later terminal ... */
-
- static void PutLineS P_((struct string *S));
-
- int InitScreen()
- {
- /* Set up all this fun stuff: returns zero if all okay, or;
- -1 indicating no terminal name associated with this shell,
- -2..-n No termcap for this terminal type known
- */
-
- int tgetent(), /* get termcap entry */
- err;
- char *termenv;
- int fd;
-
- if ((termenv = getenv("TERM")) == NULL) return(-1);
-
- strfcpy(terminal_type, termenv, sizeof terminal_type);
-
- if ((err = tgetent(_terminal, terminal_type)) != 1)
- return(err-2);
-
- _line = 0; /* where are we right now?? */
- _col = 0; /* assume zero, zero... */
-
- fd = open("/dev/tty",O_RDWR);
- if (fd < 0) {
- DPRINT(Debug,4, (&Debug, "Opening of /dev/tty failed\n"));
- } else {
- FlushBuffer();
- terminal_fd = fd;
- DPRINT(Debug,4,(&Debug,
- "/dev/tty is fd %d\n",terminal_fd));
- }
-
-
- /* load in all those pesky values */
- _clearscreen = tgetstr("cl", &ptr);
- _moveto = tgetstr("cm", &ptr);
- _up = tgetstr("up", &ptr);
- _down = tgetstr("do", &ptr);
- _right = tgetstr("nd", &ptr);
- _left = tgetstr("bc", &ptr);
- _bell = tgetstr("bl", &ptr);
-
- _setbold = tgetstr("so", &ptr);
- _clearbold = tgetstr("se", &ptr);
- _setunderline = tgetstr("us", &ptr);
- _clearunderline = tgetstr("ue", &ptr);
- _setinverse = tgetstr("so", &ptr);
- _clearinverse = tgetstr("se", &ptr);
- _sethalfbright = tgetstr("hs", &ptr);
- _clearhalfbright = tgetstr("he", &ptr);
- _cleartoeoln = tgetstr("ce", &ptr);
- _cleartoeos = tgetstr("cd", &ptr);
- _lines = tgetnum("li");
- _columns = tgetnum("co");
- tabspacing = ((tabspacing=tgetnum("it"))<= 0 ? 8 : tabspacing);
- _automargin = tgetflag("am");
- _eatnewlineglitch = tgetflag("xn");
- _transmit_on = tgetstr("ks", &ptr);
- _transmit_off = tgetstr("ke", &ptr);
- _set_memlock = tgetstr("ml", &ptr);
- _clear_memlock = tgetstr("mu", &ptr);
- _start_termcap = tgetstr("ti", &ptr);
- _end_termcap = tgetstr("te", &ptr);
-
- _key_up = tgetstr("ku", &ptr);
- _key_down = tgetstr("kd", &ptr);
- _key_left = tgetstr("kl", &ptr);
- _key_right = tgetstr("kr", &ptr);
- _key_pageup = tgetstr("kP", &ptr);
- _key_pagedown = tgetstr("kN", &ptr);
- _key_home = tgetstr("kh", &ptr);
- _key_help = tgetstr("%1", &ptr);
- _key_find = tgetstr("@0", &ptr);
-
- if (_transmit_on && _transmit_off && _key_up && _key_down) {
- cursor_control = TRUE;
- }
-
- if (_setinverse && _clearinverse) {
- has_highlighting = TRUE;
- }
-
- if (!_left) {
- _left = "\b";
- }
-
- set_start_run_hooks(print_status,RawState,Raw,
- start_run_tty_init,ClearScreen,
- PutLineS, print_status_cooked
- );
-
- return 0;
- }
-
- charset_t * give_display_charsets(storage,max)
- charset_t *storage;
- int max;
- {
- int n = 0,i;
- max--;
-
- storage[n++] = display_charset;
-
- if (system_charset != display_charset &&
- n < max)
- storage[n++] = system_charset;
-
- if (allow_charset_switching)
- terminal_can_switch(terminal_type,storage,&n,max);
- storage[n] = NULL;
-
- SIGDPRINT(Debug,4,(&Debug,
- "Possible sets:"));
- for (i = 0; i < n; i++) {
- SIGDPRINT(Debug,4,(&Debug,
- " %s%c",
- storage[i]->MIME_name ? storage[i]->MIME_name :
- "<no MIME name>",
- i < n-1 ? ',' : '\n'));
- }
-
- return storage;
- }
-
- int set_display_charset(set,silent)
- charset_t set;
- int silent;
- {
- if (!terminal_can_switch_to(terminal_type,set,silent))
- return 0;
-
- target_display_charset = set;
- switch_display_charset(1);
- return 1;
- }
-
- static char * title_string = NULL; /* Malloced */
- static char * icon_string = NULL;
-
- static char * title_quit_string = NULL;
- static char * icon_quit_string = NULL;
-
- static CONST char ELM_EXITING[] = "Elm: exiting";
-
- static char * title_suspended_string = NULL;
- static char * icon_suspended_string = NULL;
-
- static CONST char ELM_SUSPENDED[] = "Elm: suspended";
-
- int set_terminal_titles(title,icon)
- char *title;
- char *icon;
- {
-
- /* These are not set when setting terminal to non-raw mode ..
- but instead only when exiting or suspended (winth ctrl-Z) */
- if(!title_quit_string)
- title_quit_string = catgets(elm_msg_cat, ElmSet, ElmTitleQuit,
- ELM_EXITING);
- if (!icon_quit_string)
- icon_quit_string = catgets(elm_msg_cat, ElmSet, ElmIconQuit,
- ELM_EXITING);
-
- if(!title_suspended_string)
- title_suspended_string = catgets(elm_msg_cat, ElmSet, ElmTitleSusp,
- ELM_SUSPENDED);
- if (!icon_suspended_string)
- icon_suspended_string = catgets(elm_msg_cat, ElmSet, ElmIconSusp,
- ELM_SUSPENDED);
-
-
- DPRINT(Debug,8,(&Debug,
- "Terminal (%s) title=%s icon=%s\n",
- terminal_type,
- title ? title : "<UNCHANGED>",
- icon ? icon : "<UNCHANGED>"));
-
- if (RawState()) {
- char *str = terminal_set_title(terminal_type,title,icon, NULL,0);
- int i;
-
- if (!str) {
- DPRINT(Debug,4,(&Debug,
- "Can't set terminal %s titles to %s and %s\n",
- terminal_type,
- title ? title : "<NULL>",
- icon ? icon : "<NULL>"));
- return 0;
- }
-
- DPRINT(Debug,4,(&Debug,
- "Setting terminal title ("));
- for (i = 0; str[i]; i++) {
- DPRINT(Debug,4,(&Debug,
- "%s%02X",
- i ? " " : "", str[i]));
- }
- DPRINT(Debug,4,(&Debug,
- ") [terminal %s]\n",terminal_type));
-
- for (i = 0; str[i]; i++) {
- outchar(str[i]);
- }
-
- }
-
- if (title)
- title_string = strmcpy(title_string,title);
- if (icon)
- icon_string = strmcpy(title_string,title);
-
-
- return 1;
- }
-
- /* May be called from signal handler
- to_display = 0 -- suspended
- = 1 -- as set
- = 2 -- exiting
- */
-
- void switch_title(to_display)
- int to_display;
- {
- char buffer[1024];
-
- char * str = NULL;
-
-
- switch (to_display) {
- case 0:
- str = terminal_set_title(terminal_type,
- title_suspended_string,
- icon_suspended_string,
- buffer, sizeof buffer);
- break;
- case 1:
- str = terminal_set_title(terminal_type,
- title_string,
- icon_string,
- buffer, sizeof buffer);
- break;
- case 2:
- str = terminal_set_title(terminal_type,
- title_quit_string,
- icon_quit_string,
- buffer, sizeof buffer);
- break;
- }
-
-
- if (str) {
- int i;
-
- SIGDPRINT(Debug,4,(&Debug,
- "Setting terminal title ("));
- for (i = 0; str[i]; i++) {
- SIGDPRINT(Debug,4,(&Debug,
- "%s%02X",
- i ? " " : "", str[i]));
- }
- SIGDPRINT(Debug,4,(&Debug,
- ") [terminal %s]\n",terminal_type));
-
- for (i = 0; str[i]; i++) {
- outchar(str[i]);
- }
-
- }
- }
-
- void switch_display_charset(to_display)
- int to_display;
- {
- char buffer[256];
-
- charset_t t;
- char * str;
-
- if (!target_display_charset)
- target_display_charset = display_charset;
-
-
- if (!last_display_state)
- last_display_state = create_terminal_info();
-
-
- t = to_display ? target_display_charset : system_charset;
-
- if (!t) {
- SIGDPRINT(Debug,4,(&Debug,
- "switch_display_charset: target charset is NULL\n"));
- return;
- }
-
- str = terminal_switch_to(terminal_type,t,&last_display_state,
- buffer, sizeof buffer);
-
- if (str) {
- int i;
-
- SIGDPRINT(Debug,4,(&Debug,
- "Setting display charset to %s (",
- t->MIME_name ? t->MIME_name : "<no MIME name>"));
- for (i = 0; str[i]; i++) {
- SIGDPRINT(Debug,4,(&Debug,
- "%s%02X",
- i ? " " : "", str[i]));
- }
- SIGDPRINT(Debug,4,(&Debug,
- ") [terminal %s]\n",terminal_type));
-
- for (i = 0; str[i]; i++) {
- outchar(str[i]);
- }
-
- display_charset = t;
-
- } else {
- SIGDPRINT(Debug,4,(&Debug,
- "No way to set terminal %s to charset %s\n",
- terminal_type,
- t->MIME_name ? t->MIME_name : "<no MIME name>"));
-
- }
- }
-
- /* NOTE: Is called from signal handler! */
- void transmit_functions(newstate)
- int newstate;
- {
- /** turn function key transmission to ON | OFF **/
-
- if (newstate != _intransmit) {
- _intransmit = newstate;
- if (newstate == ON)
- tputs(_transmit_on, 1, outchar);
- else
- tputs(_transmit_off, 1, outchar);
- FlushBuffer(); /* clear the output buffer */
- }
- }
-
- /****** now into the 'meat' of the routines...the cursor stuff ******/
-
- void ScreenSize(lines, columns)
- int *lines, *columns;
- {
- /** returns the number of lines and columns on the display. **/
-
- #ifdef TIOCGWINSZ
- struct winsize w;
-
- if (ioctl(1,TIOCGWINSZ,&w) != -1) {
- if (w.ws_row > 0)
- _lines = w.ws_row;
- if (w.ws_col > 0)
- _columns = w.ws_col;
- }
- #endif
-
- if (_lines == 0) _lines = DEFAULT_LINES_ON_TERMINAL;
- if (_columns == 0) _columns = DEFAULT_COLUMNS_ON_TERMINAL;
-
-
- /* WARNING: elm_LINES and elm_COLUMNS are inconsistent!
- *
- * elm_LINES == number of lines in screen -1
- * elm_COLUMNS == number of rows in screen
- *
- *
- * Check code in MoveCursor!
- *
- * row == 0 .. elm_LINES
- * col == 0 .. elm_COLUMNS-1
- *
- *
- * Who was this smart programmer!!!!!!!!!!!!!!!!!!!!!
- *
- * - K E H <hur...@ozone.FMI.FI>
- */
-
- *lines = _lines - 1;
- *columns = _columns;
- }
-
- void SetXYLocation(x,y)
- int x,y;
- {
- /* declare where the cursor is on the screen - useful after using
- * a function that moves cursor in predictable fasion but doesn't
- * set the static x and y variables used in this source file -
- * e.g. getpass().
- */
-
- _line = x;
- _col = y;
- }
-
- void GetXYLocation(x,y)
- int *x,*y;
- {
- /* return the current cursor location on the screen */
-
- *x = _line;
- *y = _col;
- }
-
- int ClearScreen()
- {
- /* clear the screen: returns -1 if not capable */
-
- _line = 0; /* clear leaves us at top... */
- _col = 0;
-
- redraw_screen = 0;
- _intransmit = -1; /* Re-set state */
-
- if (!_clearscreen)
- return(-1);
-
- tputs(_clearscreen, 1, outchar);
- FlushBuffer(); /* clear the output buffer */
- return(0);
- }
-
- static void moveabsolute P_((int col, int row));
-
- static int CursorUp(n)
- int n;
- {
- /** move the cursor up 'n' lines **/
- /** Calling function must check that _up is not null before calling **/
-
- if (need_moveabsolute)
- moveabsolute(_col, _line);
-
- _line = (_line-n > 0? _line - n: 0); /* up 'n' lines... */
-
- while (n-- > 0)
- tputs(_up, 1, outchar);
-
- return(0);
- }
-
- static int CursorDown(n)
- int n;
- {
- /** move the cursor down 'n' lines **/
- /** Caller must check that _down is not null before calling **/
-
- if (need_moveabsolute)
- moveabsolute(_col, _line);;
-
- _line = (_line+n <= elm_LINES? _line + n: elm_LINES); /* down 'n' lines... */
-
- while (n-- > 0)
- tputs(_down, 1, outchar);
-
- return(0);
- }
-
-
- static int CursorLeft(n)
- int n;
- {
- /** move the cursor 'n' characters to the left **/
- /** Caller must check that _left is not null before calling **/
-
- if (need_moveabsolute)
- moveabsolute(_col, _line);
-
- _col = (_col - n> 0? _col - n: 0); /* left 'n' chars... */
-
- while (n-- > 0)
- tputs(_left, 1, outchar);
-
- return(0);
- }
-
-
- static int CursorRight(n)
- int n;
- {
- /** move the cursor 'n' characters to the right (nondestructive) **/
- /** Caller must check that _right is not null before calling **/
-
- if (need_moveabsolute)
- moveabsolute(_col, _line);
-
- _col = (_col+n < elm_COLUMNS? _col + n: elm_COLUMNS);
- /* right 'n' chars... */
-
- while (n-- > 0)
- tputs(_right, 1, outchar);
-
- return(0);
- }
-
- static void moveabsolute(col, row)
- int col, row;
- {
-
- char *stuff, *tgoto();
-
- if (need_moveabsolute) {
- SIGDPRINT(Debug,4,(&Debug,
- "Curses: moveabsolute: Syncronizing cursos position (col=%d,row=%d)\n",
- col,row));
- }
-
- stuff = tgoto(_moveto, col, row);
- tputs(stuff, 1, outchar);
-
- if(need_moveabsolute)
- FlushBuffer();
-
- need_moveabsolute = 0;
- }
-
- int MoveCursor(row, col)
- int row, col;
- {
- /** move cursor to the specified row column on the screen.
- 0,0 is the top left! **/
-
- int scrollafter = 0;
-
- /* we don't want to change "rows" or we'll mangle scrolling... */
-
- if (need_moveabsolute)
- moveabsolute(_col, _line);;
-
- if (col < 0)
- col = 0;
- if (col >= elm_COLUMNS)
- col = elm_COLUMNS - 1;
- if (row < 0)
- row = 0;
- if (row > elm_LINES) {
- if (col == 0)
- scrollafter = row - elm_LINES;
- row = elm_LINES;
- }
-
- if (!_moveto)
- return(-1);
-
- if (row == _line) {
- if (col == _col)
- return(0); /* already there! */
-
- else if (abs(col - _col) < 5) { /* within 5 spaces... */
- if (col > _col && _right)
- CursorRight(col - _col);
- else if (col < _col && _left)
- CursorLeft(_col - col);
- else
- moveabsolute(col, row);
- }
- else /* move along to the new x,y loc */
- moveabsolute(col, row);
- }
- else if (_line == row-1 && col == 0) {
- if (_col != 0)
- outchar('\r');
- outchar('\n');
- }
- else if (col == _col && abs(row - _line) < 5) {
- if (row < _line && _up)
- CursorUp(_line - row);
- else if (row > _line && _down)
- CursorDown(row - _line);
- else
- moveabsolute(col, row);
- }
- else
- moveabsolute(col, row);
-
- _line = row; /* to ensure we're really there... */
- _col = col;
-
- if (scrollafter) {
- outchar('\r');
- while (scrollafter--) {
- outchar('\n');
- }
- }
-
- FlushBuffer();
- return(0);
- }
-
- void CarriageReturn()
- {
- /** move the cursor to the beginning of the current line **/
- Writechar('\r');
- }
-
- void NewLine()
- {
- /** move the cursor to the beginning of the next line **/
-
- Writechar('\r');
- Writechar('\n');
- FlushBuffer();
- }
-
- int StartBold()
- {
- /** start boldface/standout mode **/
-
- if (!_setbold)
- return(-1);
-
- tputs(_setbold, 1, outchar);
-
- return(0);
- }
-
- int EndBold()
- {
- /** compliment of startbold **/
-
- if (!_clearbold)
- return(-1);
-
- tputs(_clearbold, 1, outchar);
-
- return(0);
- }
-
- #ifndef ELM
-
- int StartUnderline()
- {
- /** start underline mode **/
-
- if (!_setunderline)
- return(-1);
-
- tputs(_setunderline, 1, outchar);
-
- return(0);
- }
-
-
- int EndUnderline()
- {
- /** the compliment of start underline mode **/
-
- if (!_clearunderline)
- return(-1);
-
- tputs(_clearunderline, 1, outchar);
-
- return(0);
- }
-
- int StartHalfbright()
- {
- /** start half intensity mode **/
-
- if (!_sethalfbright)
- return(-1);
-
- tputs(_sethalfbright, 1, outchar);
-
- return(0);
- }
-
- int EndHalfbright()
- {
- /** compliment of starthalfbright **/
-
- if (!_clearhalfbright)
- return(-1);
-
- tputs(_clearhalfbright, 1, outchar);
-
- return(0);
- }
-
- int StartInverse()
- {
- /** set inverse video mode **/
-
- if (!_setinverse)
- return(-1);
-
- tputs(_setinverse, 1, outchar);
-
- return(0);
- }
-
- int EndInverse()
- {
- /** compliment of startinverse **/
-
- if (!_clearinverse)
- return(-1);
-
- tputs(_clearinverse, 1, outchar);
-
- return(0);
- }
-
- int
- HasMemlock()
- {
- /** returns TRUE iff memory locking is available (a terminal
- feature that allows a specified portion of the screen to
- be "locked" & not cleared/scrolled... **/
-
- return ( _set_memlock && _clear_memlock );
- }
-
- static int _old_LINES;
-
- int
- StartMemlock()
- {
- /** mark the current line as the "last" line of the portion to
- be memory locked (always relative to the top line of the
- screen) Note that this will alter LINES so that it knows
- the top is locked. This means that (plus) the program
- will scroll nicely but (minus) End memlock MUST be called
- whenever we leave the locked-memory part of the program! **/
-
- if (! _set_memlock)
- return(-1);
-
- if (! _memory_locked) {
-
- _old_LINES = elm_LINES;
- elm_LINES -= _line; /* we can't use this for scrolling */
-
- tputs(_set_memlock, 1, outchar);
-
- _memory_locked = TRUE;
- }
-
- return(0);
- }
-
- int
- EndMemlock()
- {
- /** Clear the locked memory condition... **/
-
- if (! _set_memlock)
- return(-1);
-
- if (_memory_locked) {
- elm_LINES = _old_LINES; /* back to old setting */
-
- tputs(_clear_memlock, 1, outchar);
-
- _memory_locked = FALSE;
- }
- return(0);
- }
-
- #endif /* ndef ELM */
-
- VOLATILE static int wrappedlastchar = 0;
-
- static char outchar_write_buffer[2048];
- VOLATILE static char * buffer_ptr = &(outchar_write_buffer[0]);
-
- /* Note that there is several race conditions -- losing of characters possible
- (this may be called from signal handler)
- */
- void FlushBuffer P_((void))
- {
- int len;
-
- while (0 < (len = buffer_ptr-outchar_write_buffer)) {
- int L = write(terminal_fd,outchar_write_buffer,len);


- int err = errno;

-
- if (L < 0 &&
- ((err != EINTR)
- #ifdef EAGAIN
- && (err != EAGAIN)
- #endif
- #ifdef EWOULDBLOCK
- && (err != EWOULDBLOCK)
- #endif
- )) {
- SIGDPRINT(Debug,4,(&Debug,
- "FlushBuffer: Write failed errno=%d\n",err));
- break;
- }
-
- if (L > 0) {
- len = buffer_ptr-outchar_write_buffer;
-
- len -= L;
-
- DPRINT(Debug,9,(&Debug,
- "FlushBuffer: %d bytes writted to %d, %d left\n",
- L,terminal_fd,len));
-
- if (len > 0)
- memmove(outchar_write_buffer,outchar_write_buffer+L,len);
- if (len >= 0)
- buffer_ptr = outchar_write_buffer + len;
- else
- buffer_ptr = outchar_write_buffer;
-
- } else {
- DPRINT(Debug,2,(&Debug,
- "FlushBuffer: Looping...\n"));
- }
- }
- }
-
- /* Note that there is several race conditions -- losing of characters possible
- (this may be called from signal handler)
- */
- static int outchar(c)
- int c;
- {
-
- /** output the given character. From tputs... **/
- /** Note: this CANNOT be a macro! **/
-
- if (buffer_ptr >= outchar_write_buffer + sizeof (outchar_write_buffer))
- FlushBuffer();
-
- if (buffer_ptr < outchar_write_buffer + sizeof (outchar_write_buffer)) {
- VOLATILE char *p = buffer_ptr++;
-
- *p = c;
-
- SIGDPRINT(Debug,40,(&Debug,
- "outchar [%d] = %02X\n",
- p-outchar_write_buffer,*p));
-
- return (unsigned char)c;
- }
- SIGDPRINT(Debug,2,(&Debug,
- "outchar: Buffer full!\n"));
- return EOF;
- }
-
- /* called with value of -1 if just preprosessing needed
- (ie need_moveabsolute)
- */
- static int write_control P_((int ch));
- static int write_control(ch)
- int ch;
- {
- int justwrapped, nt;
-
- if (need_moveabsolute)
- moveabsolute(_col, _line);
-
- justwrapped = 0;
-
- switch (ch) {
- /* if return, just go to left column. */
- case 0x0D: /* CR */
- if (wrappedlastchar)
- justwrapped = 1; /* preserve wrap flag */
- else {
- outchar('\r');
- _col = 0;
- }
- break;
-
- /* if newline and terminal just did a newline without our asking,
- * do nothing, else output a newline and increment the line count */
- case 0x0A: /* LF */
- if (!wrappedlastchar) {
- outchar('\n');
- if (_line < elm_LINES)
- ++_line;
- }
- break;
-
- /* if backspace, move back one space if not already in column 0 */
- case 0x08: /* BS */
- if (_col != 0) {
- tputs(_left, 1, outchar);
- _col--;
- }
- else if (_line > 0) {
- _col = elm_COLUMNS - 1;
- _line--;
- moveabsolute (_col, _line);
- }
- /* else BACKSPACE does nothing */
- break;
-
- /* if bell, ring the bell but don't advance the column */
- case 0x07: /* BEL */
- if (_bell)
- tputs(_bell,1,outchar);
- else
- outchar(ch);
- break;
-
- /* if a tab, output it */
- case 0x09: /* HT */
- /* If terminal driver is expanding tabs, don't trust it ... */
- if (!tabexpand)
- outchar(ch);
- if((nt=next_tab(_col+1)) > prev_tab(elm_COLUMNS))
- _col = elm_COLUMNS-1;
- else
- _col = nt-1;
- if (tabexpand)
- moveabsolute (_col, _line);
- break;
- default: /* Is 'printable' character (or -1) */
- return 1;
- }
-
- wrappedlastchar = justwrapped;
- return 0; /* Need no printing */
- }
-
- static void increment_position P_((int len));
- static void increment_position(len)
- int len;
- {
- int justwrapped;
-
- justwrapped = 0;
-
- if (_col + len > elm_COLUMNS) {
- _col = 0;
- _line = 0;
- moveabsolute (_col, _line);
- panic("CURSES PANIC",__FILE__,__LINE__,"increment_position",
- "column position overflow",0);
- }
-
- /* if we only had one column left, simulate automargins if
- * the terminal doesn't have them */
- if (_col + len == elm_COLUMNS) {
- if (!_automargin || _eatnewlineglitch) {
- outchar('\r');
- outchar('\n');
- }
- if (_line < elm_LINES)
- ++_line;
- _col = 0;
- justwrapped = 1;
- }
- /* if we are here this means we have no interference from the
- * right margin - just increment the column position. */
- else {
- _col += len;
- }
-
- wrappedlastchar = justwrapped;
- }
-
- /* Called by signal handler ... */
-
- void WriteRaw(str)
- CONST char *str;
- {
- CONST char * p;
-
- for (p = str; *p; p++) {
- int ch = *p;
-
- /** write a character to the current screen location. **/
- int need_print = 1;
-
- ch &= 0xFF;
-
- need_print = write_control(ch);
-
- if (need_print) {
- outchar(ch);
- increment_position(1);
- }
- }
-
- FlushBuffer();
- }
-
-
-
- /* This assumes one byte charset */
- void Writechar(ch)
- int ch;
- {
- /** write a character to the current screen location. **/
- int need_print = 1;
-
- ch &= 0xFF;
-
- /* ASCII assumed */
- need_print = write_control(ch);
-
- if (need_print) {
- #ifndef ASCII_CTYPE
- if (display_charset == system_charset) {
- /* if some kind of non-printable character change to a '?' */
-
- if(!isprint((unsigned char)ch))
- ch = '?';
- } else
- #endif
- {
- /* If system (= locale) charset is not display charset
- * need ask from charset system is that character
- * printable -- complex and expensive!
- */
- struct charset_state *st = new_state(display_charset);
- add_streambyte_to_state(st,ch);
-
- if (!state_ready(st) || !state_printable(st))
- ch = '?';
- free_state(&st);
- }
- outchar(ch);
- increment_position(1);
- }
- }
-
- static int preinit_output P_((struct string *S, struct string **buffer,
- charset_t *stored_display));
- static int preinit_output(S,buffer,stored_display)
- struct string *S;
- struct string **buffer;
- charset_t *stored_display;
- {
- int sw = -1;
-
- if (S->string_type == display_charset)
- *buffer = S;
- else if (target_display_charset == display_charset &&
- S->string_type == system_charset) {
- sw = 1; /* Arrange return to back to display charset */
- *buffer = S;
- switch_display_charset(0); /* Print using system charset */
- } else if (allow_charset_switching &&
- 0 != (charset_properties(S->string_type) & CS_printable) &&
- set_display_charset(S->string_type,1)) {
- sw = 2; /* Arrange return to correct display charset */
- *buffer = S;
- } else
- *buffer = convert_string(display_charset,S,0);
-
- return sw;
- }
-
- static void postprocess_output P_((charset_t stored_display, int sw));
-
- static void postprocess_output(stored_display,sw)
- charset_t stored_display;
- int sw;
- {
- if (sw == 2)
- set_display_charset(stored_display,0);
- else if (sw != -1) {
- switch_display_charset(sw);
- }
- }
-
- struct string *curses_printable_clip(S,pos,len,visible_len,max_visible)
- struct string *S;
- int *pos;
- int len;
- int *visible_len;
- int max_visible;
- {
- struct string *buffer = NULL;
- charset_t stored_display = target_display_charset;
- int sw = -1;
-
- struct string *ret1 = NULL;
-
- sw = preinit_output(S,&buffer,&stored_display);
-
- DPRINT(Debug,35,(&Debug,
- "curses_printable_clip: S=%S cs=%s -- using %s\n",
- S,
- S->string_type->MIME_name ?
- S->string_type->MIME_name :
- "<no MIME name>",
- buffer->string_type->MIME_name ?
- buffer->string_type->MIME_name : "<no MIME name>"));
- DPRINT(Debug,35,(&Debug, "curses_printable_clip: len=%d max_visible=%d pos=%d\n",
- len,max_visible,*pos));
-
- if (last_display_state &&
- 0 != (CS_printable_len & charset_properties(buffer->string_type))) {
-
- int l1;
- struct cs_printable_len PRINTABLE_LEN;
-
- PRINTABLE_LEN.max_len = max_visible;
- PRINTABLE_LEN.ret_len = 0;
-
- l1 = estimate_clip_string(buffer,*pos,len,last_display_state,&PRINTABLE_LEN);
-
- DPRINT(Debug,35,(&Debug,
- "curses_printable_clip: l1=%d printable_len { max_len %d ret_len %d }\n",
- l1,PRINTABLE_LEN.max_len,PRINTABLE_LEN.ret_len));
-
-
- if (l1 < 0) {
- ret1 = NULL;
- *visible_len = -1;
- } else {
- *visible_len = PRINTABLE_LEN.ret_len;
- ret1 = clip_from_string(buffer,pos,l1);
- }
- } else {
- if (max_visible < len)
- len = max_visible;
-
- ret1 = clip_from_string(buffer,pos,len);
-
- *visible_len = string_len(ret1);
- }
-
- /* Free if converted */
- if (buffer != S)
- free_string(&buffer);
-
- postprocess_output(stored_display,sw);
-
- if (ret1) {
- DPRINT(Debug,35,(&Debug, "curses_printable_clip=%p=%S visible_len=%d pos=%d\n",
- ret1,ret1,*visible_len,*pos));
- }
- return ret1;
- }
-
-
-
- static void PutLineS(S)
- struct string *S;
- {
- int idx = 0;
- struct string *buffer = NULL;
- charset_t stored_display = target_display_charset;
- int sw = -1;
- int buffer_len;
-
- sw = preinit_output(S,&buffer,&stored_display);
-
-
- buffer_len = string_len(buffer);
-
- DPRINT(Debug,40,(&Debug,
- "PutLineS: S=%S cs=%s -- using %s\n",
- S,
- S->string_type->MIME_name ?
- S->string_type->MIME_name :
- "<no MIME name>",
- buffer->string_type->MIME_name ?
- buffer->string_type->MIME_name : "<no MIME name>"));
-
- while (idx < buffer_len) {
- char * s, *s1;
- uint16 ch;
- int old_idx = idx;
- int need_print;
- int len = 1;
- int q = 0;
- struct cs_printable_len PRINTABLE_LEN;
- struct cs_printable_len *printable_len = NULL;
-
- ch = give_unicode_from_string(buffer,idx);
-
- /* ASCII assumed */
- if (ch <= 31)
- need_print = write_control(ch);
- else
- need_print = write_control(-1); /* HACK for position of cursor */
- if (!need_print) {
- DPRINT(Debug,40,(&Debug,
- "PutLineS: [%d] unicode=%d (control)\n",
- idx,ch));
- idx++;
- continue; /* character 'printed' */
- }
-
- while (len < elm_COLUMNS-_col &&
- len + idx < buffer_len &&
- give_unicode_from_string(buffer,idx + len) > 31)
- len++;
-
- if (last_display_state &&
- 0 != (CS_printable_len & charset_properties(buffer->string_type))) {
-
- PRINTABLE_LEN.max_len = elm_COLUMNS-_col;
- PRINTABLE_LEN.ret_len = 0;
-
- printable_len = &PRINTABLE_LEN;
- }
- s = us2s(streamclip_from_string(buffer,&idx,len,last_display_state,printable_len));
-
- DPRINT(Debug,10,(&Debug,
- "PutLineS: [%d-%d] stream=",
- old_idx,idx-1,s));
-
- for (s1 = s; *s1; s1++) {
- #ifdef DEBUG
- if (isascii(*s1) && isprint(*s1) && '"' != *s1) {
- if (!q) { DPRINT(Debug,10,(&Debug," \"")); q = 1; }
- DPRINT(Debug,10,(&Debug,"%c",*s1));
- } else {
- if (q) { DPRINT(Debug,10,(&Debug,"\"")); q = 0; }
- DPRINT(Debug,10,(&Debug," %02X", (unsigned char)*s1));
- }
- #endif
- }
-
- if (q) { DPRINT(Debug,10,(&Debug,"\"")); q = 0; }
- if (printable_len) {
- DPRINT(Debug,10,(&Debug,
- " printable_len { max_len %d ret_len %d }",
- printable_len->max_len,printable_len->ret_len));
- }
- DPRINT(Debug,10,(&Debug,"\n"));
-
- for (s1 = s; *s1; s1++) {
- outchar(*s1);
- }
-
- if (printable_len)
- increment_position(printable_len->ret_len);
- else
- increment_position(idx-old_idx);
-
- if (idx == old_idx) {
- DPRINT(Debug,10,(&Debug,"No any characters printed...\n"));
- CleartoEOLN();
- Writechar('\r');
- Writechar('\n');
- }
-
- free(s);
- }
-
- /* Free if converted */
- if (buffer != S)
- free_string(&buffer);
-
- postprocess_output(stored_display,sw);
- }
-
- /*VARARGS2*/
-
- void Write_to_screen (
- #if ANSI_C
- CONST char *format, CONST char *msg, ...
- #else
- format, msg, va_alist
- #endif
- )
- #if !ANSI_C
- CONST char *format;
- CONST char *msg;
- va_dcl
- #endif
- {
- va_list vl;
- struct string *text;
-
- Va_start(vl, msg); /* defined in defs.h */
-
- /** This routine writes to the screen at the current location.
- when done, it increments lines & columns accordingly by
- looking for "\n" sequences... **/
-
- text = elm_smessage(0,format,msg,vl);
- PutLineS(text);
- free_string(&text);
-
- va_end(vl);
-
- }
-
- void PutLine0(x, y, line)
- int x,y;
- CONST char *line;
- {
- /** Write a zero argument line at location x,y **/
-
- MoveCursor(x,y);
- while(*line)
- Writechar(*line++);
-
- }
-
- void PutLineX(
- #if ANSI_C
- int x, int y, const char *format, const char *line, ...
- #else
- x, y, format, line, va_alist
- #endif
- )
- #if !ANSI_C
- int x;
- int y;
- CONST char *format;
- CONST char *line;
- va_dcl
- #endif
- {
- va_list vl;
- struct string *text;
-
- Va_start(vl, line); /* defined in defs.h */
-
- MoveCursor(x,y);
-
- text = elm_smessage(0,format,line,vl);
- PutLineS(text);
- free_string(&text);
-
- va_end(vl);
-
- }
-
- int CleartoEOLN()
- {
- /** clear to end of line **/
-
- if (need_moveabsolute)
- moveabsolute(_col, _line);
-
- if (!_cleartoeoln)
- return(-1);
-
- tputs(_cleartoeoln, 1, outchar);
-
- return(0);
- }
-
- int CleartoEOS()
- {
- /** clear to end of screen **/
-
- if (need_moveabsolute)
- moveabsolute(_col, _line);
-
- if (!_cleartoeos)
- return(-1);
-
- tputs(_cleartoeos, 1, outchar);
-
- return(0);
- }
-
-
- int RawState()
- {
- /** returns either 1 or 0, for ON or OFF **/
-
- FlushBuffer();
-
- return( _inraw );
- }
-
- #ifdef ultrix
- force_raw()
- {
- (void) ttsetattr(terminal_fd,&_original_tty);
- _inraw = 0;
- Raw(ON);
- }
- #endif
-
- #if POLL_METHOD
- static void clear_input_buffer P_((void));
- #endif
-
- /* NOTE: Is called from signal handler! */
- void Raw(state)
- int state;
- {
- int do_tite = (state & NO_TITE) == 0;
- int do_charset = (state & NO_CHARSET) == 0;
-
- state = state & ~NO_TITE & ~NO_CHARSET;
-
- SIGDPRINT(Debug,4,(&Debug,
- "curses: Raw: state=%d do_tite=%d do_charset=%d\n",
- state,do_tite,do_charset));
-
- /** state is either ON or OFF, as indicated by call **/
-
- if (state == OFF && _inraw) {
- SIGDPRINT(Debug,4,(&Debug,
- "curses: Raw: Setting Raw state OFF\n"));;
-
- #if POLL_METHOD
- clear_action(terminal_fd);
- clear_input_buffer();
- #endif
-
- if (cursor_control)
- transmit_functions(OFF);
-
- if (do_charset)
- switch_display_charset(0);
- /* We do NOT call switch_title(0) here because
- raw state off may be called because running of program
- */
-
- if (use_tite && _end_termcap && do_tite) {
- tputs(_end_termcap, 1, outchar);
- }
- FlushBuffer();
- (void) ttsetattr(terminal_fd,&_original_tty);
- _inraw = 0;
- }
- else if (state == ON && ! _inraw) {
-
- SIGDPRINT(Debug,4,(&Debug,
- "curses: Raw: Setting Raw state ON\n"));;
-
- (void) ttgetattr(terminal_fd, &_original_tty);
- (void) ttgetattr(terminal_fd, &_raw_tty); /** again! **/
-
- #if !defined(TERMIO) && !defined(TERMIOS)
- _raw_tty.sg_flags &= ~(ECHO); /* echo off */
- _raw_tty.sg_flags |= CBREAK; /* raw on */
-
- #else
- _raw_tty.c_lflag &= ~(ICANON | ECHO); /* noecho raw mode */
-
- _raw_tty.c_cc[VMIN] = '\01'; /* minimum # of chars to queue */
- _raw_tty.c_cc[VTIME] = '\0'; /* minimum time to wait for input */
-
-
- #if defined(OXTABS)
- /* Some systems use OXTABS bit */
- if (_raw_tty.c_oflag & OXTABS) {
- SIGDPRINT(Debug,4,(&Debug,
- "curses: [OXTABS] Terminal driver is expanding tabs...\n"));
- tabexpand = 1;
- } else {
- if (tabexpand)
- SIGDPRINT(Debug,4,(&Debug,
- "curses: [OXTABS] Terminal driver isn't expanding tabs...\n"));
- tabexpand = 0;
- }
- #endif /* defined(OXTABS) */
-
- #if defined(TABDLY) && !defined(OXTABS)
- /* Some systems expands tab when TABDLY is XTABS */
- if ((_raw_tty.c_oflag & TABDLY) ==
- #ifdef XTABS
- XTABS
- #else
- TAB3
- #endif
- ) {
- SIGDPRINT(Debug,4,(&Debug,
- "curses: [TABDLY] Terminal driver is expanding tabs...\n"));
- tabexpand = 1;
- } else {
- if (tabexpand)
- SIGDPRINT(Debug,4,(&Debug,
- "curses: [TABDLY] Terminal driver isn't expanding tabs...\n"));
- tabexpand = 0;
- }
- #endif /* defined(TABDLY) && !defined(OXTABS) */
-
- #if !defined(TABDLY) && !defined(OXTABS)
-
- /* If _POSIX_SOURCE is defined then OXTABS or TABDLY are not
- * defined -- so print warning anyway
- */
- SIGDPRINT(Debug,4,(&Debug,
- "curses: No information is terminal driver expanding tabs!\n"));
- #endif /* !defined(TABDLY) && !defined(OXTABS) */
-
- #endif
- (void) ttsetattr(terminal_fd, &_raw_tty);
- if (use_tite && _start_termcap && do_tite)
- tputs(_start_termcap, 1, outchar);
- _intransmit = -1; /* state unclear */
- _inraw = 1;
-
- if (do_charset) {
- switch_display_charset(1);
- switch_title(1);
- }
- need_moveabsolute = 1;
- }
- }
-
- int raw_off_called() {
- return need_moveabsolute;
- }
-
- #if !defined(TERMIO) && !defined(TERMIOS)
- static int ttgetattr(fd, where)
- int fd;
- struct tty_modes *where;
- {
- if (ioctl(fd, TIOCGETP, &where->sgttyb) < 0)
- return(-1);
- if (ioctl(fd, TIOCGETC, &where->tchars) < 0)
- return(-1);
- return(0);
- }
-
- static int ttsetattr(fd, where)
- int fd;
- struct tty_modes *where;
- {
- if (ioctl(fd, TIOCSETP, &where->sgttyb) < 0)
- return(-1);
- if (ioctl(fd, TIOCSETC, &where->tchars) < 0)
- return(-1);
- return(0);
- }
- #endif
-
- #if POLL_METHOD
- static unsigned char *read_buffer = NULL;
- static int read_buffer_len = 0;
- static int last_read_error = 0;
-
- static int background_read P_((int fd, void *data));
- static int background_read(fd,data)
- int fd;
- void *data;
- {
- int result;
- unsigned char ch;
-
- result = read(fd, &ch, 1);
-
- if (result < 0) {


- int err = errno;

-
- SIGDPRINT(Debug,4,(&Debug,
- "background_read: errno = %d [%s]\n",err,
- error_description(err)));
-
- if((err == EINTR)
- #ifdef EAGAIN
- || (err == EAGAIN)
- #endif
- #ifdef EWOULDBLOCK
- || (err == EWOULDBLOCK)
- #endif
- ) {
- return 1; /* Retry */
- }
-
- last_read_error = err;
- return 0;
- }
-
- if (0 == result) {
- SIGDPRINT(Debug,4,(&Debug,
- "background_read: Got zero bytes...\n"));
- last_read_error = -1;
- return 0;
- }
-
- read_buffer = safe_realloc(read_buffer,read_buffer_len+1);
- SIGDPRINT(Debug,20,(&Debug,
- "background_read(fd=%d)=1 [%d]",fd,read_buffer_len));
- SIGDPRINT(Debug,50,(&Debug,"=%d",ch));
- SIGDPRINT(Debug,20,(&Debug,"\n"));
-
- read_buffer[read_buffer_len++] = ch;
- last_read_error = 0;
-
- return 1;
- }
-
- static void clear_input_buffer()
- {
- SIGDPRINT(Debug,4,(&Debug,
- "Resetting background_read buffer (%d bytes)...\n",
- read_buffer_len));
- read_buffer_len = 0;
- last_read_error = 0;
- }
-
- int error_sleep(seconds)
- int seconds;
- {
- int ret;
- if (read_buffer_len > 0) {
- SIGDPRINT(Debug,5,(&Debug,
- "error_sleep(%d)=1 -- sleep skipped\n",
- seconds));
- return 1;
- }
- SIGDPRINT(Debug,5,(&Debug,
- "error_sleep(%d) ...\n",seconds));
- ret = wait_for_action_or_timeout(background_read,seconds);
- DPRINT(Debug,5,(&Debug,
- "error_sleep=%d\n",ret));
- return ret;
- }
- #endif
-
-
- struct charset_state * ReadCh2(flags)
- int flags;
- {
- int redraw = (flags & READCH_MASK);
- int cursorkeys = (flags & READCH_CURSOR) != 0;
- int nocursor = (flags & READCH_NOCURSOR) != 0 && cursor_control;
- int term_char = (flags & READCH_term_char) != 0;
- int x,y;
-
- unsigned char input_buffer[20];
-
- /*
- * read a character with Raw mode set!
- *
- * EAGAIN & EWOULDBLOCK are recognized just in case
- * O_NONBLOCK happens to be in effect.
- */
-
- /* This is static array so we can initialize it in here ...
- */
- static struct {
- char ** CONST str;
- CONST int result;
- int maybe;
- } keytable[] =
- { { &_key_up, UP_MARK, 0 },
- { &_key_down, DOWN_MARK, 0 },
- { &_key_left, LEFT_MARK, 0 },
- { &_key_right, RIGHT_MARK, 0 },
-
- { &_key_pageup, PAGEUP_MARK, 0 },
- { &_key_pagedown, PAGEDOWN_MARK, 0 },
-
- { &_key_home, HOME_MARK, 0 },
- { &_key_help, HELP_MARK, 0 },
- { &_key_find, FIND_MARK, 0 },
- { NULL, 0, 0 }
- };
-
- int read_p,found_key;
-
- #if POLL_METHOD
- change_action(terminal_fd,0,background_read,no_action_routine,
- no_action_routine,
- NULL);
- #endif
-
- GetXYLocation(&x,&y); /* Background actions may print error messages .. */
-
- if (!last_state) {
- last_state = new_state(system_charset);
- DPRINT(Debug,4,(&Debug,
- "Keyboard input charset is %s\n",
- last_state->charset->MIME_name ?
- last_state->charset->MIME_name :
- "<no MIME name>"));
- }
-
- if (state_ready(last_state)) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: starting reading new character (set %s)\n",
- last_state->charset->MIME_name ?
- last_state->charset->MIME_name :
- "<no MIME name>"));
- reset_state(last_state,0);
- }
- last_state->caller_flags = 0;
-
- reinit_ReadChar:
- read_p = 0;
- found_key = 0;
-
- FlushBuffer();
-
- if (redraw && !RawState()) { /* Check that we have in 'raw' mode */
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Going to Raw mode\n"));
- Raw(ON);
- ClearScreen();
-
- reset_state(last_state,1);
- last_state->caller_flags = redraw;
-
- return last_state;
- }
-
- if (redraw && redraw_screen) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Pending redraw...\n"));
- ClearScreen();
-
- reset_state(last_state,1);
- last_state->caller_flags = redraw;
-
- return last_state;
- }
-
- if ((_intransmit != ON || redraw_screen) &&
- cursorkeys && _transmit_on) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Enabling cursor keys...\n"));
- transmit_functions(ON);
- }
-
- if ((_intransmit != OFF || redraw_screen) &&
- nocursor && _transmit_off) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Disabling cursor keys...\n"));
- transmit_functions(OFF);
- }
-
- if (cursorkeys) {
- int i;
- DPRINT(Debug,8,(&Debug,
- "ReadCh2: Available function keys:"));
-
- for (i = 0; keytable[i].str != 0; i++) {
- char * CONST str = *(keytable[i].str);
- if(str && str[0] != '\0') {
- keytable[i].maybe = 1; /* Initially every function key is possible */
- SIGDPRINT(Debug,8,(&Debug,
- " [%d] %d",i,keytable[i].result));
- }
- }
- DPRINT(Debug,4,(&Debug,
- "\n"));
- }
-
- while (found_key == 0) {
- unsigned char ch;
- #if POLL_METHOD
- if (read_buffer_len < 1 && last_read_error == 0) {
- errno= 0;
- if(!wait_for_action(background_read)) {
- if (errno != 0) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: wait_for_action got error %d (%s)\n",
- errno, error_description(errno)));
- /* Return error: */
- if ((redraw && redraw_screen)
- || InGetPrompt /* GetPrompt wants to see errors! */
- ) {
- DPRINT(Debug,4,(&Debug,
- " ... return error to caller\n"));
- found_key = -1;
- continue;
- }
- if (errno == EINTR
- #ifdef EAGAIN
- || (errno == EAGAIN)
- #endif
- #ifdef EWOULDBLOCK
- || (errno == EWOULDBLOCK)
- #endif
- ) {
- DPRINT(Debug,4,(&Debug,
- " ... retry (ignored)\n"));
- } else
- found_key = -1;
- continue;
- }
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: interrupted (ignored)\n"));
- continue;
- }
- }
- if (read_buffer_len > 0) {
- ch = read_buffer[0];
- if (--read_buffer_len > 0)
- memmove(read_buffer,read_buffer+1,read_buffer_len);
- } else if (last_read_error != 0) {
- if (-1 == last_read_error) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: background_read got zero bytes...\n"));
- found_key = -1;
- continue;
- }
- /* Return error: */
- if ((redraw && redraw_screen)
- || InGetPrompt /* GetPrompt wants to see errors! */
- ) {
- found_key = -1;
- continue;
- }
- if (last_read_error != 0) {
- errno = last_read_error;
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: background_read got error %d (%s)\n",
- last_read_error,
- error_description(last_read_error)));
- found_key = -1;
- }
- continue; /* continue or quit */
- } else {
- DPRINT(Debug,1,(&Debug,
- "ReadCh2: SOFTWARE ERROR !!\n"));
- break;
- }
- #else
- int result;
-
- result = read(terminal_fd, &ch, 1);
-
- if (result < 0) {


- int err = errno;

- DPRINT(Debug,4,(&Debug,
- "ReadCh2: errno = %d [%s]\n",err,
- error_description(err)));
-
- /* Return error: */
- if (redraw && redraw_screen
- || InGetPrompt /* GetPrompt wants to see errors! */
- ) {
- found_key = -1;
- continue;
- }
- if((errno == EINTR)
- #ifdef EAGAIN
- || (errno == EAGAIN)
- #endif
- #ifdef EWOULDBLOCK
- || (errno == EWOULDBLOCK)
- #endif
- ) {
- continue; /* Retry */
- }
- break;
- }
- if (0 == result) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Got zero bytes...\n"));
- found_key = -1;
- continue;
- }
- #endif
-
- #ifdef USE_DLOPEN
- {
- union xxx_rand {
- int ch;
- char bytes[sizeof (int)];
- } A;
- A.ch = ch;
-
- seed_rand_bits(A.bytes, sizeof A,
- 3 /* Assume 3 bits per character ... */);
- }
- #endif
-
-
-
- DPRINT(Debug,50,(&Debug,
- "ReadCh2: Looking char %d (read_p=%d)\n",ch,read_p));
-
- if (term_char) {
- if (backspace == ch)
- found_key = TERMCH_backspace;
- if (kill_line == ch)
- found_key = TERMCH_kill_line;
- if (word_erase == ch)
- found_key = TERMCH_word_erase;
- if (interrupt_char == ch)
- found_key = TERMCH_interrupt_char;
- if (reprint_char == ch)
- found_key = TERMCH_reprint_char;
- if (eof_char == ch)
- found_key = TERMCH_eof_char;
- if (found_key) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: found termchar = %d (char=%02X)\n",
- found_key,ch));
- /* Soft reset state */
- reset_state(last_state,0);
- break;
- }
- }
-
- if (cursorkeys) {
- int match = 0;
- int i;
- for (i = 0; keytable[i].str != NULL; i++) {
- if (keytable[i].maybe) {
- unsigned char * CONST str =
- (unsigned char *) *(keytable[i].str);
- if (str[read_p] == ch) {
- match++;
- if (str[read_p+1] == '\0') {
- found_key = keytable[i].result;
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Found function key = %d (keytable = %d, read_p =%d)\n",
- found_key,i,read_p));
-
- /* Soft reset state */
- reset_state(last_state,0);
- }
- } else {
- keytable[i].maybe = 0;
- }
- }
- }
-
- if (read_p < sizeof input_buffer -1) {
- input_buffer[read_p] = ch;
- input_buffer[read_p+1] = '\0';
- }
-
- if (match == 0) { /* Not in keytable */
- if (read_p == 0)
- found_key = ch; /* Normal key */
- else {
- int i;
-
- /* But maybe escape sequence is valid state change ? */
-

- for (i = 0;

- i <= read_p && i < sizeof input_buffer -1;
- i++) {
-
- if (state_ready(last_state)) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Unsupporting -- function keys and state change sequences overlap? (OR BAD SEQUENCE) \n"));
- goto BAD_sequence;
- }
-
- if (!add_streambyte_to_state(last_state,
- input_buffer[i]))
- goto BAD_sequence;
-
- }
-
- if (state_ready(last_state))
- goto got_key;
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: need more bytes for character...\n"));
- goto reinit_ReadChar;
-
-
- BAD_sequence:
-
- /* Soft reset state */
- reset_state(last_state,0);
-
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Bad escape sequence; ch = %d, read_p = %d\n",
- ch,read_p));
- #ifdef DEBUG
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Sequence was:"));
- for (i = 0; i <= read_p && i < sizeof input_buffer -1; i++) {
- if (isascii(input_buffer[i]) && isprint(input_buffer[i])) {
- DPRINT(Debug,4,(&Debug," %c (0x%02X)",
- input_buffer[i],input_buffer[i]));
- } else {
- DPRINT(Debug,4,(&Debug," 0x%02X", input_buffer[i]));
- }
- }
- if (read_p > sizeof input_buffer -1)
- DPRINT(Debug,4,(&Debug," ..."));
- DPRINT(Debug,4,(&Debug,"\n"));
- #endif
-
- /* Ring a bell */
- Writechar('\007');
- goto reinit_ReadChar;
- }
- } else
- read_p++;
- } else
- found_key = ch;
-
- }
-
- if (found_key <= 0 && redraw && redraw_screen) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Redraw...\n"));
- if(!RawState()) { /* Check that we have in 'raw' mode */
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: Going to Raw mode\n"));
- Raw(ON);
- }
- ClearScreen();
-
- reset_state(last_state,1);
- last_state->caller_flags = redraw;
-
- return last_state;
- }
-
- MoveCursor(x,y);
- DPRINT(Debug,50,(&Debug,
- "ReadCh2: found_key=%d\n",found_key));
-
- if (found_key < 0) {
- reset_state(last_state,1);
- DPRINT(Debug,4,(&Debug,
- "ReadCh2=NULL (state)\n"));
- return NULL;
- } else {
- if (found_key >= 256) {
- reset_state(last_state,1);
- last_state->caller_flags = found_key;
- } else {
- last_state->caller_flags = 0;
- if (!add_streambyte_to_state(last_state,found_key)) {
- /* Ring a bell */
- Writechar('\007');
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: bad sequence...\n"));
- reset_state(last_state,1);
- }
- }
- }
-
- if (!state_ready(last_state) &&
- !last_state->caller_flags) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh2: need more bytes for character...\n"));
- goto reinit_ReadChar;
- }
-
- got_key:
- DPRINT(Debug,4,(&Debug,
- "ReadCh2=%p (state): caller_flags=%d, ready=%d\n",
- last_state,last_state->caller_flags,
- state_ready(last_state)));
- return last_state;
- }
-
-
- int ReadCh(flags)
- int flags;
- {
- int ret = 0;
-
- do {
- struct charset_state *ch = ReadCh2(flags);
-
- if (!ch) {
- ret = EOF;
- DPRINT(Debug,4,(&Debug,
- "ReadCh=EOF (errno=%d)\n",errno));
- } else if (ch -> caller_flags) {
- ret = ch -> caller_flags;
- DPRINT(Debug,4,(&Debug,
- "ReadCh=%d (flags)\n",ret));
- } else
- ret = state_is_onebyte(ch);
- if (!ret) {
- DPRINT(Debug,4,(&Debug,
- "ReadCh: Not a one byte character or zero byte!"));
- /* Ring a bell */
- Writechar('\007');
- } else {
- DPRINT(Debug,4,(&Debug,
- "ReadCh=%d (one byte character)\n",
- ret));
- }
- } while (0 == ret);
- return ret;
- }
-
-
-
-
- /*
- * Local Variables:
- * mode:c
- * c-basic-offset:4
- * End:
- */
-
-
--- 0 ----
Index: elm2.4.ME+.108-cvs/src/edit.c
*** elm2.4.ME+.107/src/edit.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/edit.c 2003-10-01 20:34:34.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: edit.c,v 1.13 2003/08/04 14:58:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: edit.c,v 1.14 2003/10/01 17:34:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 127,134 ****
}

Raw(ON);
/* a location not near the next request, so an absolute is used */
! SetXYLocation(0, 40);

return(1);
}
--- 127,135 ----
}

Raw(ON);
+
/* a location not near the next request, so an absolute is used */
! InvalidateLocation();

return(1);
}
Index: elm2.4.ME+.108-cvs/src/editmsg.c
*** elm2.4.ME+.107/src/editmsg.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/editmsg.c 2003-10-11 16:04:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.32 2003/07/29 18:46:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.35 2003/10/11 13:04:54 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************

***************
*** 481,488 ****
return retcode;
}

! static int have_editor P_((char *editor));
! static int have_editor(editor)
char *editor;
{
int return_value = 1;
--- 481,488 ----
return retcode;
}

!
! int have_editor(editor)
char *editor;
{
int return_value = 1;
***************
*** 535,541 ****
/** Invoke the users editor on the filename. Return when done.
**/

! char buffer[SLEN];
int stat, return_value = 0;
int err;
char * filename2 ;
--- 535,541 ----
/** Invoke the users editor on the filename. Return when done.
**/

! char * buffer = NULL;
int stat, return_value = 0;
int err;
char * filename2 ;
***************
*** 551,558 ****
else
filename2 = filename;

- buffer[0] = '\0';
-
if ((already_has_text ||
!have_editor(editor)) &&
0 != strcmp(alternative_editor, "EDITOR") &&
--- 551,556 ----
***************
*** 578,593 ****
"Invoking editor..."));
FlushBuffer();

! if (strlen(buffer) == 0) {
! if (in_string(editor, "%s"))
! elm_sfprintf(buffer, sizeof buffer,
! FRM(editor),
! filename2);
! else
! elm_sfprintf(buffer, sizeof buffer,
! FRM("%s %s"),
! editor, filename2);
! }

if (filename2 != filename) {
char linebuf[1024];
--- 576,588 ----
"Invoking editor..."));
FlushBuffer();

! if (in_string(editor, "%s"))
! buffer = elm_message(FRM(editor),
! filename2);
! else
! buffer = elm_message(FRM("%s %s"),
! editor, filename2);
!

if (filename2 != filename) {
char linebuf[1024];
***************
*** 632,640 ****
}

(void) elm_chown(filename2, userid, groupid);
-
Raw(OFF);
!
if ((stat = system_call(buffer, SY_ENAB_SIGHUP|SY_DUMPSTATE,
mailbox)) == -1) {
err = errno;
--- 627,634 ----
}

(void) elm_chown(filename2, userid, groupid);
Raw(OFF);
!
if ((stat = system_call(buffer, SY_ENAB_SIGHUP|SY_DUMPSTATE,
mailbox)) == -1) {
err = errno;
***************
*** 650,662 ****
sleep_message();
return_value = 1;
}
-
- enforce_newline(filename2);
-
Raw(ON);
-
- MoveCursor(elm_LINES, 0); /* dont know where we are, force last row, col 0 */

if (filename2 != filename) {
char linebuf[1024];

--- 644,653 ----
sleep_message();
return_value = 1;
}
Raw(ON);

+ enforce_newline(filename2);
+
if (filename2 != filename) {
char linebuf[1024];

***************
*** 705,710 ****
--- 696,705 ----
free(filename2);
}

+ if (buffer) {
+ free(buffer); buffer = NULL;
+ }
+
DPRINT(Debug,5,(&Debug,
"edit_the_message=%d\n",return_value));

Index: elm2.4.ME+.108-cvs/src/elm.c


*** elm2.4.ME+.107/src/elm.c 2003-08-11 11:21:18.000000000 +0300

--- elm2.4.ME+.108-cvs/src/elm.c 2003-09-14 19:35:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.56 2003/08/11 06:53:24 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.57 2003/09/14 16:35:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 1204,1212 ****
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmOptions,
"Options"));
! if((i=options(current_mailbox)) > 0)
get_page(current, current_mailbox);
! else if(i < 0)
leave(0, &current_mailbox);
redraw++; /* always fix da screen... */
}
--- 1204,1213 ----
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmOptions,
"Options"));
! if((i=options(current_mailbox)) > 0) {
! current = get_current(current_mailbox);
get_page(current, current_mailbox);
! } else if(i < 0)
leave(0, &current_mailbox);
redraw++; /* always fix da screen... */
}

Index: elm2.4.ME+.108-cvs/src/hdrconfg.c
*** elm2.4.ME+.107/src/hdrconfg.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/hdrconfg.c 2003-10-11 16:25:27.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.29 2003/07/29 18:46:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.33 2003/10/11 13:25:27 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 32,37 ****
--- 32,42 ----
#include "def_elm.h"
#include "s_elm.h"

+ #include <errno.h>
+ #ifndef ANSI_C
+ extern int errno;
+ #endif
+
DEBUG_VAR(Debug,__FILE__,"header");

static unsigned char *s2us P_((char *str));
***************
*** 427,440 ****
return 0;
}

! void edit_headers(headers,mailer_info,hdr_charset)
struct mailing_headers *headers;
struct mailer_info *mailer_info;
charset_t hdr_charset;
{
int c, do_redraw;
struct hdr_menu_item *h;
int precmd = 0;

/* expand out all of the header values */
/* menu displays expanded values, user edits unexpended versions */
--- 432,723 ----
return 0;
}

! enum mode_xx { mode_plain, mode_phrase, mode_comment };
!
! static void print_edit_string P_((enum mode_xx mode,FILE *F,charset_t edit_charset,
! int encondig_supported,struct string *s));
!
! static void print_edit_string(mode,F,edit_charset,encoding_supported,s)
! enum mode_xx mode;
! FILE *F;
! charset_t edit_charset;
! int encoding_supported;
! struct string *s;
! {
!
! int mime_code = encoding_supported &&
! s->string_type != edit_charset;
!
! char * s1 = NULL;
!
! switch (mode) {
! case mode_phrase:
! s1 = string_to_hdr(HDR_PHRASE,s, edit_charset,mime_code);
! break;
! case mode_comment: putc('(',F);
! s1 = string_to_hdr(HDR_COMMENT,s, edit_charset,mime_code);
! break;
! default:
! s1 = string_to_hdr(HDR_TEXT,s, edit_charset,mime_code);
! break;
! }
!
! fputs(s1,F);
!
! switch (mode) {
! case mode_comment: putc(')',F); break;
! }
!
! free(s1);
!
! }
!
! static void add_addr_header P_((FILE * F,charset_t edit_charset,
! int encoding_supported,char * name,
! struct expanded_address *a));
!
! static void add_addr_header(F,edit_charset,encoding_supported,name,a)
! FILE * F;
! charset_t edit_charset;
! int encoding_supported;
! char * name;
! struct expanded_address *a;
! {
! int i;
! int l = 0;
!
! fprintf(F,"%s: ",name);
!
! for (i = 0; i < a->addrs_len; i++) {
! struct string * f = a->addrs[i].fullname;
! char * ad = a->addrs[i].addr;
! struct string * c = a->addrs[i].comment;
!
! if (f && string_len(f) > 0) {
! print_edit_string (mode_phrase,F,edit_charset,encoding_supported,f);
! putc(' ',F);
! l += string_len(f);
! }
! putc('<',F);
! fputs(ad,F); l += strlen(ad);
! putc('>',F);
! if (c && string_len(c) > 0) {
! putc(' ',F);
! print_edit_string (mode_comment,F,edit_charset,encoding_supported,c);
! l += string_len(c);
! }
!
! if (i < a->addrs_len-1) {
! putc(',',F);
! if (l > 60) {
! putc('\n',F);
! l = 0;
! }
! putc(' ',F);
! }
! }
! putc('\n',F);
!
! }
!
! static void add_string_header P_((FILE * F,charset_t edit_charset,
! int encoding_supported,char * name,
! struct string *s));
!
! static void add_string_header(F,edit_charset,encoding_supported,name,s)
! FILE * F;
! charset_t edit_charset;
! int encoding_supported;
! char * name;
! struct string *s;
! {
! fprintf(F,"%s: ",name);
! print_edit_string (mode_plain,F,edit_charset,encoding_supported,s);
! putc('\n',F);
!
! }
!
!
! static void edit_headers_on_editor P_((struct mailing_headers *headers,
! char *editor, int encoding_supported));
! static void edit_headers_on_editor(headers,editor, encoding_supported)
! struct mailing_headers *headers;
! char *editor;
! int encoding_supported;
! {
! charset_t edit_charset = system_charset;
! FILE * F = NULL;
!
! char * filename = elm_message(FRM("%s%sHDR%d"),
! temp_dir, temp_file, getpid());
! char * buffer = NULL;
! char buffer1[32*1024];
! int stat;
! int c;
!
! if (in_string(editor, "%s"))
! buffer = elm_message(FRM(editor),
! filename);
! else
! buffer = elm_message(FRM("%s %s"),
! editor, filename);
!
!
! F = safeopen_rdwr(filename);
! if (!F)
! goto fail1;
!
! PutLineX(elm_LINES, 0, CATGETS(elm_msg_cat, ElmSet, ElmInvokeEditor,
! "Invoking editor..."));
! FlushBuffer();
!
!
! /* FIX: Following prints with display_charset and
! not with edit_charset (system_charset)
! */
!
!
! elm_fprintf(F,
! CATGETS(elm_msg_cat, ElmSet, ElmHdrEditComment,
! "# Headers are automatically converted from %s charset and not need encoded\n"),
! edit_charset->MIME_name ? edit_charset->MIME_name : "<no MIME name>");
!
! if (encoding_supported) {
! elm_fprintf(F,
! CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentEnc,
! "# MIME enconding of headers is supported\n"));
!
! } else {
! elm_fprintf(F,
! CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentNo,
! "# MIME enconding of headers is NOT supported\n"));
!
! }
!
!
! add_addr_header(F,edit_charset,encoding_supported,
! "From", & headers->from);
! add_addr_header(F,edit_charset,encoding_supported,
! "To", & headers->to);
! add_addr_header(F,edit_charset,encoding_supported,
! "Cc", & headers->cc);
! add_addr_header(F,edit_charset,encoding_supported,
! "Bcc", & headers->bcc);
! add_addr_header(F,edit_charset,encoding_supported,
! "Reply-To", & headers->reply_to);
! add_string_header(F,edit_charset,encoding_supported,
! "Subject", headers->subject);
!
! fclose(F);
!
! (void) elm_chown(filename, userid, groupid);
!
! Raw(OFF);
! /* FIX: SY_DUMPSTATE should perhaps be supported? */
! if ((stat = system_call(buffer, SY_ENAB_SIGHUP,
! NULL)) == -1) {
! int err = errno;
!
! Raw(ON);
! DPRINT(Debug,1,(&Debug,
! "System call failed with stat %d (edit_the_message)\n",
! stat));
! DPRINT(Debug,1,(&Debug,
! "** %s **\n", error_description(err)));
! ClearLine(elm_LINES-1);
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantInvokeEditor,
! "Can't invoke editor '%s' for composition."),
! editor);
! sleep_message();
!
! goto fail2;
! }
! Raw(ON);
!
! F = fopen(filename,"r");
! if (!F) {
! /* In than point opening should have succeed */
! int err = errno;
! lib_error(FRM("%s: %s"),filename,err);
!
! goto fail1;
! }
!
! /* Skip comment block */
!
! while ('#' == (c = getc(F))) {
!
! while ('\n' != (c = getc(F))) {
! if (EOF == c)
! break;
! }
! }
!
! if (EOF != c)
! ungetc(c,F);
!
!
! /* Read headers */
! while (0 < read_header_line(F,buffer1,sizeof buffer1,0)) {
!
! header_ptr header_name;
! char *k;
!
! if ('#' == buffer[0])
! continue;
!
! k = strchr(buffer1,':');
! if (!k)
! break;
! *k = '\0';
! k++;
!
! while (whitespace(*k))
! k++;
!
! header_name = find_header(buffer1,1);
!
! if (!add_to_mailing_header(headers,header_name,k,
! encoding_supported,
! edit_charset,1 /* REPLACE */ )) {
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmHdrNotSupported,
! "Editing of %s header is not supported."),
! buffer1);
! }
! }
!
! if (!feof(F))
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmHdrGarbage,
! "Garbage on header file"));
!
! fclose(F);
!
! fail2:
! unlink(filename);
!
! fail1:
!
! free(filename); filename = NULL;
! free(buffer); buffer = NULL;
!
! }
!
! void edit_headers(headers,mailer_info,hdr_charset, hdr_encoding_supported)
struct mailing_headers *headers;
struct mailer_info *mailer_info;
charset_t hdr_charset;
+ int hdr_encoding_supported;
{
int c, do_redraw;
struct hdr_menu_item *h;
int precmd = 0;
+
+
+ int editor_available =
+ strcmp(editor, "builtin") != 0 &&
+ strcmp(editor, "none") != 0;
+

/* expand out all of the header values */
/* menu displays expanded values, user edits unexpended versions */
***************
*** 471,488 ****
}

/* display the instructions */
#ifdef ALLOW_SUBSHELL
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct,
! "Choose header, u)ser defined header, !)shell, or <return>."));
#else
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstructNoShell,
! "Choose header, u)ser defined header, or <return>."));
#endif

/* prompt for command */
PutLineX(INPUT_LINE, 0,
CATGETS(elm_msg_cat, ElmSet,
--- 754,788 ----
}

/* display the instructions */
+ if (user_level > 0 && editor_available) {
+
#ifdef ALLOW_SUBSHELL
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1,
! "Choose header, u)ser defined header, !)shell, invoke e)ditor, or <return>."));
#else
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1NoShell,
! "Choose header, u)ser defined header, invoke e)ditor, or <return>."));
#endif

+ } else {
+
+ #ifdef ALLOW_SUBSHELL
+ print_format_center(INSTRUCT_LINE,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmHdrmenuInstruct,
+ "Choose header, u)ser defined header, !)shell, or <return>."));
+ #else
+ print_format_center(INSTRUCT_LINE,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmHdrmenuInstructNoShell,
+ "Choose header, u)ser defined header, or <return>."));
+ #endif
+
+ }
/* prompt for command */
PutLineX(INPUT_LINE, 0,
CATGETS(elm_msg_cat, ElmSet,
***************
*** 523,529 ****
case ctrl('L'):
do_redraw = TRUE;
break;
!
default:
for (h = hmenu_item_list ; h->menucmd > 0 ; ++h) {
if (h->menucmd == c) {
--- 823,839 ----
case ctrl('L'):
do_redraw = TRUE;
break;
!
! case 'e':
! editor_available &= have_editor(editor);
!
! if (editor_available)
! edit_headers_on_editor(headers,editor, hdr_encoding_supported);
!
! do_redraw = TRUE;
! break;
!
!
default:
for (h = hmenu_item_list ; h->menucmd > 0 ; ++h) {
if (h->menucmd == c) {
Index: elm2.4.ME+.108-cvs/src/in_utils.c
*** elm2.4.ME+.107/src/in_utils.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/in_utils.c 2003-10-01 20:34:34.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.27 2003/08/01 08:22:12 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.28 2003/10/01 17:34:34 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 657,663 ****
GetXYLocation(&line, &col);

if (!passwd &&
! ((col / tabspacing ) +1) * tabspacing
>= elm_COLUMNS) {
buffer = info->give_buffer(info,em_next);
if (!buffer)
--- 657,663 ----
GetXYLocation(&line, &col);

if (!passwd &&
! ((col / get_tabspacing() ) +1) * get_tabspacing()
>= elm_COLUMNS) {
buffer = info->give_buffer(info,em_next);
if (!buffer)
Index: elm2.4.ME+.108-cvs/src/mailmsg2.c
*** elm2.4.ME+.107/src/mailmsg2.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/mailmsg2.c 2003-10-05 19:07:28.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.69 2003/07/29 18:46:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.70 2003/10/05 16:07:28 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.70 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 64,71 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,
struct MailboxView *mailbox
! /* for system_call() */
!
)); /* Prototype */

static void mail_sent P_((union any_fd fd, char * title, struct run_state *rs,
--- 64,71 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,
struct MailboxView *mailbox
! /* for system_call() */,
! int encode_hdr
)); /* Prototype */

static void mail_sent P_((union any_fd fd, char * title, struct run_state *rs,
***************
*** 498,504 ****
mailer_info,
MIME_info.hdr_charset,
mailbox
! /* needed for system_call() */);
/* Empty ... */
if (-2 == code && !attachments.attachment_count) {
return need_redraw;
--- 498,505 ----
mailer_info,
MIME_info.hdr_charset,
mailbox
! /* needed for system_call() */,
! MIME_info.encode_hdr);
/* Empty ... */
if (-2 == code && !attachments.attachment_count) {
return need_redraw;
***************
*** 1043,1049 ****
dsn, headers, attachments,
file_set,
mailer_info,
! hdr_charset, mailbox
)
char *filename; /* pathname to mail mssg composition file */
int *form_p; /* pointer to form message state */
--- 1044,1051 ----
dsn, headers, attachments,
file_set,
mailer_info,
! hdr_charset, mailbox,
! encode_hdr
)
char *filename; /* pathname to mail mssg composition file */
int *form_p; /* pointer to form message state */
***************
*** 1055,1064 ****
int *dsn;
struct mailing_headers *headers;
struct Attachments *attachments;
! charset_t file_set; /* charset oof file (filename) */
struct mailer_info *mailer_info;
charset_t hdr_charset;
struct MailboxView *mailbox; /* needed for system_call() */
{
char *prompt_mssg = NULL; /* message to display prompting for cmd */
char prompt_menu[SLEN], /* menu of available commands */
--- 1057,1067 ----
int *dsn;
struct mailing_headers *headers;
struct Attachments *attachments;
! charset_t file_set; /* charset of file (filename) */
struct mailer_info *mailer_info;
charset_t hdr_charset;
struct MailboxView *mailbox; /* needed for system_call() */
+ int encode_hdr;
{
char *prompt_mssg = NULL; /* message to display prompting for cmd */
char prompt_menu[SLEN], /* menu of available commands */
***************
*** 1376,1382 ****
if (did_prompt)
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmVfyMenuHeaders,"Headers"));
! edit_headers(headers,mailer_info,hdr_charset);
*need_redraw_p = TRUE;
do_redraw = 1;
break;
--- 1379,1385 ----
if (did_prompt)
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmVfyMenuHeaders,"Headers"));
! edit_headers(headers,mailer_info,hdr_charset,encode_hdr);
*need_redraw_p = TRUE;
do_redraw = 1;
break;
Index: elm2.4.ME+.108-cvs/src/Makefile.SH
*** elm2.4.ME+.107/src/Makefile.SH 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/Makefile.SH 2003-10-01 20:34:34.000000000 +0300
***************
*** 31,37 ****

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.45 2003/08/04 14:58:58 hurtta Exp $
#
# Makefile for the ELM mail program.
#
--- 31,37 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.46 2003/10/01 17:34:34 hurtta Exp $
#
# Makefile for the ELM mail program.
#
***************
*** 112,118 ****
browser.c \
builtin++.c \
calendar.c \
- curses.c \
date.c \
delete.c \
digest.c \
--- 112,117 ----
***************
*** 175,181 ****
browser.o \
builtin++.o \
calendar.o \
- curses.o \
date.o \
delete.o \
digest.o \
--- 174,179 ----
***************
*** 229,237 ****
--- 227,237 ----
# Standard targets
all: Makefile $(BIN)/elm $(SHLIST)
cd messages; $(MAKE) $(MJ) $(MFLAGS) $@
+ cd screen; $(MAKE) $(MJ) $(MFLAGS) $@

install_s: Makefile $(DEST) $(DEST)/elm
cd messages; $(MAKE) $(MJ) $(MFLAGS) $@
+ cd screen; $(MAKE) $(MJ) $(MFLAGS) $@

$(DEST):
$(REG) mkdir $(DEST)
***************
*** 248,253 ****
--- 248,257 ----
messages/libmessages.a:
cd messages; $(MAKE) $(MJ) $(MFLAGS) all

+ screen/libscreen.a:
+ cd screen; $(MAKE) $(MJ) $(MFLAGS) all
+
+
!NO!SUBS!

if $test "X$etc" != "X$lib" ; then
***************
*** 279,284 ****
--- 283,289 ----
clean:
$(RM) $(ELM_OBJ) $(BIN)/elm $(SHLIST)
cd messages; $(MAKE) $(MJ) $(MFLAGS) $@
+ cd screen; $(MAKE) $(MJ) $(MFLAGS) $@


# Dependencies and rules
***************
*** 289,299 ****
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elm.h: $(INCLDIR)/elm_curses.h $(INCLDIR)/defs.h $(INCLDIR)/me.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/elm_curses.h $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

--- 294,304 ----
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elm.h: $(INCLDIR)/defs.h $(INCLDIR)/me.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

***************
*** 318,324 ****
browser.o: def_elm.h $(INCLDIR)/s_elm.h
builtin++.o: def_elm.h
calendar.o: def_elm.h
- curses.o: def_elm.h $(INCLDIR)/s_elm.h
date.o: def_elm.h
delete.o: def_elm.h $(INCLDIR)/s_elm.h
digest.o: def_elm.h $(INCLDIR)/s_elm.h
--- 323,328 ----
***************
*** 370,377 ****
utils.o: def_elm.h $(INCLDIR)/s_elm.h

# Dependencies and rules for compiling C programs
! $(BIN)/elm: $& $(ELM_OBJ) ../melib/libme.a ../lib/libutil.a messages/libmessages.a
! $(CC) $(LFLAGS) -o $@ $(ELM_OBJ) messages/libmessages.a ../melib/libme.a ../lib/libutil.a $(LIBS) $(LIB2)

# Dependencies and rules for installing C programs

--- 374,381 ----
utils.o: def_elm.h $(INCLDIR)/s_elm.h

# Dependencies and rules for compiling C programs
! $(BIN)/elm: $& $(ELM_OBJ) ../melib/libme.a ../lib/libutil.a messages/libmessages.a screen/libscreen.a
! $(CC) $(LFLAGS) -o $@ $(ELM_OBJ) messages/libmessages.a screen/libscreen.a ../melib/libme.a ../lib/libutil.a $(LIBS) $(LIB2)

# Dependencies and rules for installing C programs

***************
*** 382,389 ****

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/elm-shared: $& $(ELM_OBJ) ../melib/libme.a ../shlib/libelmme-base.so messages/libmessages.a
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELM_OBJ) messages/libmessages.a ../melib/libme.a ../shlib/libelmme-base.so $(LIBS) $(LIB2)


$(DEST)/elm: $(BIN)/elm-shared
--- 386,393 ----

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/elm-shared: $& $(ELM_OBJ) ../melib/libme.a ../shlib/libelmme-base.so messages/libmessages.a screen/libscreen.a
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELM_OBJ) messages/libmessages.a screen/libscreen.a ../melib/libme.a ../shlib/libelmme-base.so $(LIBS) $(LIB2)


$(DEST)/elm: $(BIN)/elm-shared
Index: elm2.4.ME+.108-cvs/src/messages/Makefile.SH
*** elm2.4.ME+.107/src/messages/Makefile.SH 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/messages/Makefile.SH 2003-10-01 20:34:34.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.4 2003/08/04 14:58:58 hurtta Exp $
# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.5 2003/10/01 17:34:34 hurtta Exp $
# Makefile for the ELM mail program.
#
# Variables
***************
*** 69,75 ****
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/elm_curses.h $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

--- 69,75 ----
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

Index: elm2.4.ME+.108-cvs/src/mime.c
*** elm2.4.ME+.107/src/mime.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/mime.c 2003-10-05 19:07:28.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime.c,v 1.27 2003/07/29 18:46:20 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mime.c,v 1.28 2003/10/05 16:07:28 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 56,61 ****
--- 56,62 ----
mime_info->encoding_top = ENCODING_7BIT;
mime_info->type_opts_top = NULL;
mime_info->hdr_charset = text_charset;
+
/* FIXME: is this correct?
... we also should avoid ISO2022 charsets on here
*/
***************
*** 1022,1029 ****
fputc('\n',dest); /* filler */
X->start_loc = ftell(dest);

! /* encoding rules are different for text and no text
! * for text we must do \n -> \r\n before base64 encoding */


{
--- 1023,1030 ----
fputc('\n',dest); /* filler */
X->start_loc = ftell(dest);

! /* Encoding rules are different for text and non-text.
! * For text we must do \n -> \r\n before base64 encoding */


{
Index: elm2.4.ME+.108-cvs/src/newmbox.c


*** elm2.4.ME+.107/src/newmbox.c 2003-08-16 09:58:21.000000000 +0300

--- elm2.4.ME+.108-cvs/src/newmbox.c 2003-10-11 20:04:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.71 2003/08/14 14:14:22 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.78 2003/10/11 17:04:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.78 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

***************
*** 748,755 ****

f += skipbytes;

! percent = (int)(f * 100.0 /
! storage->current_folder->mailfile_size);
/* calculation with integers overflow on big folders! */

/* Should be 100% now ... */
--- 756,766 ----

f += skipbytes;

! if (storage->current_folder->mailfile_size >0)
! percent = (int)(f * 100.0 /
! storage->current_folder->mailfile_size);
! else
! percent = 100;
/* calculation with integers overflow on big folders! */

/* Should be 100% now ... */
Index: elm2.4.ME+.108-cvs/src/screen/cur_process.c
*** /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
--- elm2.4.ME+.108-cvs/src/screen/cur_process.c 2003-10-01 20:34:34.000000000 +0300
***************
*** 0 ****
--- 1,70 ----
+ static char rcsid[] = "@(#)$Id: cur_process.c,v 1.2 2003/10/01 17:34:34 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

+ *****************************************************************************/
+
+ #include "def_screen.h"
+ #include "s_elm.h"
+
+
+ static void print_status_1 P_((struct run_state *rs,int sig,int exit_code));
+ static void print_status_1(rs,sig,exit_code)
+ struct run_state *rs;
+ int sig, exit_code;
+ {
+ redraw:
+ if (sig)
+ PutLineX(elm_LINES,0,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmTerminatedWithSignal,
+ "Terminated with signal %d. Press any key to continue: "),
+ sig);
+ else if (exit_code)
+ PutLineX(elm_LINES,0,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmExitedWithStatus,
+ "Exited with status %d. Press any key to continue: "),
+ exit_code);
+ else
+ PutLineX(elm_LINES,0,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmDoneCont,
+ "Done. Press any key to continue: "));
+ if (ReadCh(REDRAW_MARK) == REDRAW_MARK)
+ goto redraw;
+ }
+
+
+ void print_status_cooked(rs,sig,exit_code)
+ struct run_state *rs;
+ int sig, exit_code;
+ {
+ Raw(ON | NO_TITE);
+
+ print_status_1(rs,sig,exit_code);
+
+ Raw(OFF | NO_TITE);
+ printf("\n\r");
+ }
+
+
+ void print_status(rs,sig,exit_code)
+ struct run_state *rs;
+ int sig, exit_code;
+ {
+ if (rs->raw == ON && ( SY_CLRWAIT & rs->options )) {
+
+ print_status_1(rs,sig,exit_code);
+ }
+ }
+
+
+ void start_run_tty_init()
+ {
+ MoveCursor(elm_LINES,0);
+ CleartoEOLN();
+ FlushBuffer();
+ }
Index: elm2.4.ME+.108-cvs/src/screen/curses.c
*** /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
--- elm2.4.ME+.108-cvs/src/screen/curses.c 2003-10-12 09:42:38.000000000 +0300
***************
*** 0 ****
--- 1,1411 ----
+ static char rcsid[] = "@(#)$Id: curses.c,v 1.3 2003/10/12 06:42:38 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
+ *
+ * Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
+ *****************************************************************************
+ *
+ * Some code copied from ../curses.c. It have following copyright:
+ *


+ * Copyright (c) 1988-1992 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************/
+
+

+ #include "def_screen.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ #ifdef I_CURSES
+ #include <curses.h> /* <term.h> requires ... */
+ #endif /* I_CURSES */
+ #ifdef I_TERM
+ #include <term.h> /* Defination for tgetent.h and so on ... */
+ #undef lines /* ... But undefine lines macro */
+ #undef columns /* ... But undefine columns macro */
+ #endif /* I_TERM */
+
+ #ifdef TERMIOS
+ # include <termios.h>
+ # ifndef sun
+ # include <sys/ioctl.h> /* for TIOCGWINSZ */
+ # endif
+ #else
+ # ifdef TERMIO
+ # include <termio.h>
+ # else
+ # include <sgtty.h>
+ # endif
+ #endif
+
+ #include <errno.h>
+
+
+
+ /* Lose 'const' */
+ static char * cs2s P_((const char *str));
+ static char * cs2s(str)
+ CONST char *str;
+ {
+
+ return (char *)str;
+ }
+
+ static struct pg_modes {
+ int mode;
+ char * on;
+ char * off;
+
+ CONST char *set_on;
+ CONST char *set_off;
+
+ } set_modes[] = {
+
+ /* Possible incorrect -- was originally _setbold, _clearbold */
+ { pg_BOLD, NULL, NULL,
+ "so" /* Start standout mode */ ,
+ "se" /* End standout mode */ },
+
+ { pg_UNDERLINE, NULL, NULL,
+ "us" /* Start underlining */ ,
+ "ue" /* End underlining */ },
+
+
+ { pg_HALFBRIGHT, NULL, NULL,
+ "hs" /* ... not listed ... */ ,
+ "he" /* ... not listed ... */ },
+
+ { pg_INVERSE, NULL, NULL,
+ "so" /* Start standout mode */ ,
+ "se" /* End standout mode */ }
+ };
+
+ static
+ char *_clearscreen = NULL, *_moveto = NULL, *_up = NULL, *_down = NULL,
+ *_right = NULL, *_left = NULL,
+ *_cleartoeoln = NULL, *_cleartoeos = NULL, *_set_memlock = NULL,
+ *_clear_memlock = NULL,
+ *_start_termcap = NULL, *_end_termcap = NULL, *_bell = NULL;
+
+ char *_transmit_on = NULL, *_transmit_off = NULL;
+
+ char *_key_up = NULL, *_key_down = NULL, *_key_left = NULL, *_key_right = NULL,
+ *_key_pageup = NULL, *_key_pagedown = NULL, *_key_home = NULL,
+ *_key_help = NULL, *_key_find = NULL;
+
+ /* Some additional capacities not used in ../src/curses.c */
+
+ static
+ char *_up_many = NULL, *_down_many = NULL, *_left_many = NULL,
+ *_right_many = NULL;
+
+
+ #if 0 /* SCROLL */
+ static char *_set_scroll_region = NULL, *_scroll_down = NULL;
+
+ static char *_scroll_up = NULL, *_scroll_up_many = NULL;
+ #endif
+
+ static int _lines, _columns, _automargin, _eatnewlineglitch;
+
+ int _intransmit = -1; /* are we transmitting keys? */
+
+ char terminal_type[40] = "";
+ static char _terminal[1024]; /* Storage for terminal entry */
+ static char _capabilities[1024]; /* String for cursor motion */
+
+ static char *ptr = _capabilities; /* for buffering */
+
+ static VOLATILE int _line = -1; /* initialize to "trash" */
+ static VOLATILE int _col = -1;
+
+ int cursor_control = 0;
+ int cur_tabspacing = 8; /* Default? */
+
+ /* find tab stops preceding or following a given column position 'a', where
+ * the column position starts counting from 1, NOT 0!
+ */
+ #define prev_tab(a) (((((a-1)/cur_tabspacing))*cur_tabspacing)+1)
+ #define next_tab(a) (((((a-1)/cur_tabspacing)+1)*cur_tabspacing)+1)
+
+
+ #define DEFAULT_LINES_ON_TERMINAL 24
+ #define DEFAULT_COLUMNS_ON_TERMINAL 80
+
+
+ static char *us2s P_((unsigned char *str));
+ static char *us2s(str)
+ unsigned char *str;
+ {
+ return (char *)str;
+ }
+
+ int cur_InitScreen()
+ {
+ int i;
+ /* Set up all this fun stuff: returns zero if all okay, or;
+ -1 indicating no terminal name associated with this shell,
+ -2..-n No termcap for this terminal type known
+ */
+
+ int tgetent(), /* get termcap entry */
+ err;
+ char *termenv;
+ int fd;
+
+ if ((termenv = getenv("TERM")) == NULL) return(-1);
+
+ strfcpy(terminal_type, termenv, sizeof terminal_type);
+
+ if ((err = tgetent(_terminal, terminal_type)) != 1)
+ return(err-2);
+
+ /* _line, _col are asusmed to be trash -- do not
+ set them to zero now ...
+ */
+
+ fd = open("/dev/tty",O_RDWR);
+ if (fd < 0) {
+ DPRINT(Debug,4, (&Debug, "Opening of /dev/tty failed\n"));
+ } else {
+ FlushBuffer();
+ terminal_fd = fd;
+ DPRINT(Debug,4,(&Debug,
+ "/dev/tty is fd %d\n",terminal_fd));
+ }
+
+
+ /* load in all those pesky values */
+ _clearscreen = tgetstr("cl", &ptr); /* Clear screen and cursor home */
+ _moveto = tgetstr("cm", &ptr); /* Cursor move to row %1 and column %2
+ (on screen) */
+ _up = tgetstr("up", &ptr); /* Cursor up one line */
+ _down = tgetstr("do", &ptr); /* Cursor down one line */
+ _right = tgetstr("nd", &ptr); /* Cursor right one character */
+ _left = tgetstr("bc", &ptr); /* backspace, if not ^H */
+ _bell = tgetstr("bl", &ptr); /* Audio bell */
+
+
+ for (i =0 ; i < (sizeof set_modes) / sizeof (set_modes[0]); i++) {
+ set_modes[i].on = tgetstr(cs2s(set_modes[i].set_on),&ptr);
+ set_modes[i].off = tgetstr(cs2s(set_modes[i].set_off),&ptr);
+
+ switch(set_modes[i].mode) {
+
+ case pg_INVERSE:
+ if (set_modes[i].on && set_modes[i].off) {
+ has_highlighting = TRUE;


+ }
+ break;
+ }
+

+ }
+
+ _cleartoeoln = tgetstr("ce", &ptr); /* Clear to end of line */
+ _cleartoeos = tgetstr("cd", &ptr); /* Clear to end of screen */
+ _lines = tgetnum("li"); /* Number of lines */
+ _columns = tgetnum("co"); /* Number of columns */
+ cur_tabspacing = ((cur_tabspacing=tgetnum("it"))<= 0 ? 8 : cur_tabspacing);
+ /* Difference between tab positions */
+ _automargin = tgetflag("am"); /* Automatic margins which means automatic
+ line wrap */
+ _eatnewlineglitch = tgetflag("xn"); /* Newline/wraparound glitch */
+ _transmit_on = tgetstr("ks", &ptr); /* Turn keypad on */
+ _transmit_off = tgetstr("ke", &ptr); /* turn keypad off */
+ _set_memlock = tgetstr("ml", &ptr); /* ... not listed ... */
+ _clear_memlock = tgetstr("mu", &ptr); /* ... not listed ... */
+ _start_termcap = tgetstr("ti", &ptr); /* Begin program that uses cursor motion */
+ _end_termcap = tgetstr("te", &ptr); /* End program that uses cursor motion */
+
+
+ _key_up = tgetstr("ku", &ptr); /* Cursor up key */
+ _key_down = tgetstr("kd", &ptr); /* Cursor down key */
+ _key_left = tgetstr("kl", &ptr); /* Cursor left key */
+ _key_right = tgetstr("kr", &ptr); /* Cursor right key */
+ _key_pageup = tgetstr("kP", &ptr); /* Key for previous page */
+ _key_pagedown = tgetstr("kN", &ptr); /* Key for next page */
+ _key_home = tgetstr("kh", &ptr); /* Cursor home key */
+ _key_help = tgetstr("%1", &ptr); /* help key */
+ _key_find = tgetstr("@0", &ptr); /* find key */
+
+ /* Linux termcap lists following ....
+
+ mb Start blinking
+ md Start bold mode
+ me End all mode like so, us, mb, md and mr
+ mh Start half bright mode
+ mr Start reverse mode
+ us Start underlining
+ so Start standout mode
+
+ */
+
+
+ /* following strings are not copied from ../src/curses.c */
+
+ _up_many = tgetstr("UP", &ptr); /* Cursor up %1 lines */
+ _down_many = tgetstr("DO", &ptr); /* Cursor down %1 lines */
+ _left_many = tgetstr("LE", &ptr); /* Cursor left %1 lines */
+ _right_many = tgetstr("RI", &ptr); /* Cursor right %1 lines */
+
+ #if 0 /* SCROLL */
+ _set_scroll_region = tgetstr("cs", &ptr); /* Scroll region from
+ line %1 to %2 */
+ _scroll_down = tgetstr("sr", &ptr); /* Reverse scroll */
+
+ _scroll_up = tgetstr("sf", &ptr); /* Normal scroll one line
+ -- aka 'cursor down' */
+ _scroll_up_many = tgetstr("SF", &ptr); /* Normal scroll n line
+ -- aka 'cursor down' */
+
+ #endif
+
+ if (_transmit_on && _transmit_off && _key_up && _key_down) {
+ cursor_control = TRUE;
+ }
+
+
+ if (!_left) {
+ _left = "\b";
+ }
+
+ if (_lines == 0) _lines = DEFAULT_LINES_ON_TERMINAL;
+ if (_columns == 0) _columns = DEFAULT_COLUMNS_ON_TERMINAL;
+
+ return 0;
+ }
+
+ /* DO NOT return lines-1 (as ScreenSize() did) */
+
+ void cur_ScreenSize(lines, columns)
+ int *lines, *columns;
+ {
+ /** returns the number of lines and columns on the display. **/
+
+ #ifdef TIOCGWINSZ
+ struct winsize w;
+
+ if (ioctl(1,TIOCGWINSZ,&w) != -1) {
+ if (w.ws_row > 0)
+ _lines = w.ws_row;
+ if (w.ws_col > 0)
+ _columns = w.ws_col;
+ }
+ #endif
+
+ if (_lines == 0) _lines = DEFAULT_LINES_ON_TERMINAL;
+ if (_columns == 0) _columns = DEFAULT_COLUMNS_ON_TERMINAL;
+
+
+
+ *lines = _lines; /* This do not return lines-1
+ as ScreenSize() did
+ */
+ *columns = _columns;
+ }
+
+ void cur_GetXYLocation(x,y)
+ int *x,*y;
+ {
+ /* return the current cursor location on the screen */
+
+ *x = _line;
+ *y = _col;
+ }
+
+ static int need_moveabsolute = 0;
+
+ void InvalidateLocation()
+ {
+ need_moveabsolute = 1;
+ _line = 0;
+ _col = 0;
+ }
+
+ int cur_ClearScreen()
+ {
+ /* clear the screen: returns -1 if not capable */
+
+ _line = 0; /* clear leaves us at top... */
+ _col = 0;
+
+ redraw_screen = 0;
+ _intransmit = -1; /* Re-set state */
+
+ if (!_clearscreen)
+ return(-1);
+
+ tputs(_clearscreen, 1, outchar);
+ FlushBuffer(); /* clear the output buffer */
+ return(0);
+ }
+
+ static void moveabsolute P_((int col, int row));
+
+ void cur_CursorUp(n)
+ int n;
+ {
+ /** move the cursor up 'n' lines **/
+ /** Calling function must check that _up is not null before calling **/
+
+ if (need_moveabsolute)
+ moveabsolute(_col, _line);
+
+ _line = (_line-n > 0? _line - n: 0); /* up 'n' lines... */
+
+ if (n > 1 && _up_many) {
+ char *stuff, *tgoto();
+
+ stuff = tgoto(_up_many,0,n);
+ tputs(stuff, 1, outchar);
+
+ } else while (n-- > 0)
+ tputs(_up, 1, outchar);
+
+ }
+
+ void cur_CursorDown(n)
+ int n;
+ {
+ /** move the cursor down 'n' lines **/
+ /** Caller must check that _down is not null before calling **/
+
+ if (need_moveabsolute)
+ moveabsolute(_col, _line);;
+
+ _line = (_line+n < _lines? _line + n: _lines-1); /* down 'n' lines... */
+
+ if (n > 1 && _down_many) {
+ char *stuff, *tgoto();
+
+ stuff = tgoto(_down_many,0,n);
+ tputs(stuff, 1, outchar);
+
+ } else while (n-- > 0)
+ tputs(_down, 1, outchar);
+ }
+
+
+ void cur_CursorLeft(n)
+ int n;
+ {
+ /** move the cursor 'n' characters to the left **/
+ /** Caller must check that _left is not null before calling **/
+
+ if (need_moveabsolute)
+ moveabsolute(_col, _line);
+
+ _col = (_col - n> 0? _col - n: 0); /* left 'n' chars... */
+
+ if (n > 1 && _left_many) {
+ char *stuff, *tgoto();
+
+ stuff = tgoto(_left_many,0,n);
+ tputs(stuff, 1, outchar);
+
+ } else while (n-- > 0)
+ tputs(_left, 1, outchar);
+
+ }
+
+ static int cur_CursorRight(n)
+ int n;
+ {
+ /** move the cursor 'n' characters to the right (nondestructive) **/
+ /** Caller must check that _right is not null before calling **/
+
+ if (need_moveabsolute)
+ moveabsolute(_col, _line);
+
+ /* NOTE: if _col == _columns then it is outside of columns */
+
+ _col = (_col+n < _columns? _col + n: _columns);
+ /* right 'n' chars... */
+
+ if (n > 1 && _right_many) {
+ char *stuff, *tgoto();
+
+ stuff = tgoto(_right_many,0,n);
+ tputs(stuff, 1, outchar);
+
+ } else while (n-- > 0)
+ tputs(_right, 1, outchar);
+
+ return(0);
+ }
+
+ static void moveabsolute(col, row)
+ int col, row;
+ {
+
+ char *stuff, *tgoto();
+
+ if (need_moveabsolute) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "Curses: moveabsolute: Syncronizing cursos position (col=%d,row=%d)\n",
+ col,row));
+ }
+
+ stuff = tgoto(_moveto, col, row);
+ tputs(stuff, 1, outchar);
+
+ if(need_moveabsolute)
+ FlushBuffer();
+
+ need_moveabsolute = 0;
+ }
+
+ int cur_MoveCursor(row, col)
+ int row, col;
+ {
+ /** move cursor to the specified row column on the screen.
+ 0,0 is the top left! **/
+
+ int scrollafter = 0;
+
+ /* we don't want to change "rows" or we'll mangle scrolling... */
+
+ if (need_moveabsolute)
+ moveabsolute(_col, _line);;
+
+ if (col < 0)
+ col = 0;
+ if (col >= _columns)
+ col = _columns - 1;
+ if (row < 0)
+ row = 0;
+ if (row >= _lines) {
+ if (col == 0)
+ scrollafter = row - _lines +1;
+ row = _lines -1;
+ }
+
+ if (!_moveto)
+ return(-1);
+
+ if (row == _line) {
+ if (col == _col)
+ return(0); /* already there! */
+
+ else if (col == 0)
+ outchar('\r');
+
+ else if (abs(col - _col) < 5 /* within 5 spaces... */ ||
+ _left_many && _right_many
+ ) {
+ if (col > _col && _right)
+ cur_CursorRight(col - _col);
+ else if (col < _col && _left)
+ cur_CursorLeft(_col - col);
+ else
+ moveabsolute(col, row);
+ }
+ else /* move along to the new x,y loc */
+ moveabsolute(col, row);
+ }
+ else if (_line == row-1 && col == 0) {
+ if (_col != 0)
+ outchar('\r');
+ outchar('\n');
+ }
+ else if (col == _col && (abs(row - _line) < 5 ||
+ _up_many && _down_many
+ )) {
+ if (row < _line && _up)
+ cur_CursorUp(_line - row);
+ else if (row > _line && _down)
+ cur_CursorDown(row - _line);
+ else
+ moveabsolute(col, row);
+ }
+ else
+ moveabsolute(col, row);
+
+ _line = row; /* to ensure we're really there... */
+ _col = col;
+
+ if (scrollafter) {
+ DPRINT(Debug,49, (&Debug, " scrollafter=%d\n",scrollafter));
+
+ outchar('\r');
+
+ while (scrollafter--) {
+ outchar('\n');
+ }
+ }
+
+ FlushBuffer();
+ return(0);
+ }
+
+ void cur_changemode(mode,set,reset)
+ int *mode;
+ int set;
+ int reset;


+ {
+ int i;
+

+ for (i =0 ; i < (sizeof set_modes) / sizeof (set_modes[0]); i++) {
+
+ if ((set & set_modes[i].mode) && set_modes[i].on) {
+ tputs(set_modes[i].on, 1, outchar);
+ *mode |= set_modes[i].mode;
+ }
+
+ if ((reset & set_modes[i].mode) && set_modes[i].off) {
+ tputs(set_modes[i].off, 1, outchar);
+ *mode &= ~(set_modes[i].mode);


+ }
+
+ }
+
+ }
+

+ /* ----------------------------------------------------------- */
+
+ VOLATILE static int wrappedlastchar = 0;
+ static int tabexpand = 0; /* Is terminal driver expanding tabs? */
+ /* KESKEN */
+
+ /* called with value of -1 if just preprosessing needed
+ (ie need_moveabsolute)
+ */
+ static int write_control P_((int ch));
+ static int write_control(ch)
+ int ch;
+ {
+ int justwrapped, nt;
+
+ if (need_moveabsolute)
+ moveabsolute(_col, _line);
+
+ justwrapped = 0;
+
+ switch (ch) {
+ /* if return, just go to left column. */
+ case 0x0D: /* CR */
+ if (wrappedlastchar)
+ justwrapped = 1; /* preserve wrap flag */
+ else {
+ outchar('\r');
+ _col = 0;
+ }
+ break;
+
+ /* if newline and terminal just did a newline without our asking,
+ * do nothing, else output a newline and increment the line count */
+ case 0x0A: /* LF */
+ if (!wrappedlastchar) {
+ outchar('\n');
+ if (_line < _lines-1)
+ ++_line;
+ }
+ break;
+
+ /* if backspace, move back one space if not already in column 0 */
+ case 0x08: /* BS */
+ if (_col != 0) {
+ tputs(_left, 1, outchar);
+ _col--;
+ }
+ else if (_line > 0) {
+ _col = _columns - 1;
+ _line--;
+ moveabsolute (_col, _line);
+ }
+ /* else BACKSPACE does nothing */
+ break;
+
+ /* if bell, ring the bell but don't advance the column */
+ case 0x07: /* BEL */
+ if (_bell)
+ tputs(_bell,1,outchar);
+ else
+ outchar(ch);
+ break;
+
+ /* if a tab, output it */
+ case 0x09: /* HT */
+ /* If terminal driver is expanding tabs, don't trust it ... */
+ if (!tabexpand)
+ outchar(ch);
+ if((nt=next_tab(_col+1)) > prev_tab(_columns))
+ _col = _columns-1;
+ else
+ _col = nt-1;
+ if (tabexpand)
+ moveabsolute (_col, _line);
+ break;
+ default: /* Is 'printable' character (or -1) */


+ return 1;
+ }
+

+ wrappedlastchar = justwrapped;
+ return 0; /* Need no printing */
+ }
+
+ static void increment_position P_((int len));
+ static void increment_position(len)
+ int len;
+ {
+ int justwrapped;
+
+ justwrapped = 0;
+
+ if (_col + len > _columns) {
+ _col = 0;
+ _line = 0;
+ moveabsolute (_col, _line);
+ panic("CURSES PANIC",__FILE__,__LINE__,"increment_position",
+ "column position overflow",0);
+ }
+
+ /* if we only had one column left, simulate automargins if
+ * the terminal doesn't have them */
+ if (_col + len == _columns) {
+ if (!_automargin || _eatnewlineglitch) {
+ outchar('\r');
+ outchar('\n');
+ }
+ if (_line < _lines-1)
+ ++_line;
+ _col = 0;
+ justwrapped = 1;
+ }
+ /* if we are here this means we have no interference from the
+ * right margin - just increment the column position. */
+ else {
+ _col += len;
+ }
+
+ wrappedlastchar = justwrapped;
+ }
+
+ /* Called by signal handler ... */
+
+ void WriteRaw(str)
+ CONST char *str;
+ {
+ CONST char * p;
+
+
+ /* If WriteRaw() is called, then screen must be redraw
+ later ...
+ */
+ redraw_screen = 1;
+
+ for (p = str; *p; p++) {
+ int ch = *p;
+
+ /** write a character to the current screen location. **/
+ int need_print = 1;
+
+ ch &= 0xFF;
+
+ need_print = write_control(ch);
+
+ if (need_print) {
+ outchar(ch);
+ increment_position(1);
+ }
+ }
+
+ FlushBuffer();
+ }
+
+
+
+ /* This assumes one byte charset */
+ void cur_Writechar(ch)
+ int ch;
+ {
+ /** write a character to the current screen location. **/
+ int need_print = 1;
+
+ ch &= 0xFF;
+
+ /* ASCII assumed */
+ need_print = write_control(ch);
+
+ if (need_print) {
+ #ifndef ASCII_CTYPE
+ if (display_charset == system_charset) {
+ /* if some kind of non-printable character change to a '?' */
+
+ if(!isprint((unsigned char)ch))
+ ch = '?';
+ } else
+ #endif
+ {
+ /* If system (= locale) charset is not display charset
+ * need ask from charset system is that character
+ * printable -- complex and expensive!
+ */
+ struct charset_state *st = new_state(display_charset);
+ add_streambyte_to_state(st,ch);
+
+ if (!state_ready(st) || !state_printable(st))
+ ch = '?';
+ free_state(&st);
+ }
+ outchar(ch);
+ increment_position(1);
+ }
+ }
+
+
+ static int preinit_output P_((struct string *S, struct string **buffer,
+ charset_t *stored_display));
+ static int preinit_output(S,buffer,stored_display)
+ struct string *S;
+ struct string **buffer;
+ charset_t *stored_display;
+ {
+ int sw = -1;
+
+ if (S->string_type == display_charset)
+ *buffer = S;
+ else if (target_display_charset == display_charset &&
+ S->string_type == system_charset) {
+ sw = 1; /* Arrange return to back to display charset */
+ *buffer = S;
+ switch_display_charset(0); /* Print using system charset */
+ } else if (allow_charset_switching &&
+ 0 != (charset_properties(S->string_type) & CS_printable) &&
+ set_display_charset(S->string_type,1)) {
+ sw = 2; /* Arrange return to correct display charset */
+ *buffer = S;
+ } else
+ *buffer = convert_string(display_charset,S,0);
+
+ return sw;
+ }
+
+ static void postprocess_output P_((charset_t stored_display, int sw));
+
+ static void postprocess_output(stored_display,sw)
+ charset_t stored_display;
+ int sw;
+ {
+ if (sw == 2)
+ set_display_charset(stored_display,0);
+ else if (sw != -1) {
+ switch_display_charset(sw);
+ }
+ }
+
+ struct string *curses_printable_clip(S,pos,len,visible_len,max_visible)
+ struct string *S;
+ int *pos;
+ int len;
+ int *visible_len;
+ int max_visible;
+ {
+ struct string *buffer = NULL;
+ charset_t stored_display = target_display_charset;
+ int sw = -1;
+
+ struct string *ret1 = NULL;
+
+ sw = preinit_output(S,&buffer,&stored_display);
+
+ DPRINT(Debug,35,(&Debug,
+ "curses_printable_clip: S=%S cs=%s -- using %s\n",
+ S,
+ S->string_type->MIME_name ?
+ S->string_type->MIME_name :
+ "<no MIME name>",
+ buffer->string_type->MIME_name ?
+ buffer->string_type->MIME_name : "<no MIME name>"));
+ DPRINT(Debug,35,(&Debug, "curses_printable_clip: len=%d max_visible=%d pos=%d\n",
+ len,max_visible,*pos));
+
+ if (last_display_state &&
+ 0 != (CS_printable_len & charset_properties(buffer->string_type))) {
+
+ int l1;
+ struct cs_printable_len PRINTABLE_LEN;
+
+ PRINTABLE_LEN.max_len = max_visible;
+ PRINTABLE_LEN.ret_len = 0;
+
+ l1 = estimate_clip_string(buffer,*pos,len,last_display_state,&PRINTABLE_LEN);
+
+ DPRINT(Debug,35,(&Debug,
+ "curses_printable_clip: l1=%d printable_len { max_len %d ret_len %d }\n",
+ l1,PRINTABLE_LEN.max_len,PRINTABLE_LEN.ret_len));
+
+
+ if (l1 < 0) {
+ ret1 = NULL;
+ *visible_len = -1;
+ } else {
+ *visible_len = PRINTABLE_LEN.ret_len;
+ ret1 = clip_from_string(buffer,pos,l1);
+ }
+ } else {
+ if (max_visible < len)
+ len = max_visible;
+
+ ret1 = clip_from_string(buffer,pos,len);
+
+ *visible_len = string_len(ret1);
+ }
+
+ /* Free if converted */
+ if (buffer != S)
+ free_string(&buffer);
+
+ postprocess_output(stored_display,sw);
+
+ if (ret1) {
+ DPRINT(Debug,35,(&Debug, "curses_printable_clip=%p=%S visible_len=%d pos=%d\n",
+ ret1,ret1,*visible_len,*pos));
+ }
+ return ret1;
+ }
+
+ void cur_PutLineS(S)
+ struct string *S;
+ {
+ int idx = 0;
+ struct string *buffer = NULL;
+ charset_t stored_display = target_display_charset;
+ int sw = -1;
+ int buffer_len;
+
+
+
+
+ sw = preinit_output(S,&buffer,&stored_display);
+
+ buffer_len = string_len(buffer);
+
+ DPRINT(Debug,40,(&Debug,
+ "PutLineS: S=%S cs=%s -- using %s\n",
+ S,
+ S->string_type->MIME_name ?
+ S->string_type->MIME_name :
+ "<no MIME name>",
+ buffer->string_type->MIME_name ?
+ buffer->string_type->MIME_name : "<no MIME name>"));
+
+ while (idx < buffer_len) {
+ char * s, *s1;
+ uint16 ch;
+ int old_idx = idx;
+ int need_print;
+ int len = 1;
+ int q = 0;
+ struct cs_printable_len PRINTABLE_LEN;
+ struct cs_printable_len *printable_len = NULL;
+
+ ch = give_unicode_from_string(buffer,idx);
+
+ /* ASCII assumed */
+ if (ch <= 31)
+ need_print = write_control(ch);
+ else
+ need_print = write_control(-1); /* HACK for position of cursor */
+ if (!need_print) {
+ DPRINT(Debug,40,(&Debug,
+ "PutLineS: [%d] unicode=%d (control)\n",
+ idx,ch));
+ idx++;
+ continue; /* character 'printed' */
+ }
+
+ while (len < _columns-_col &&
+ len + idx < buffer_len &&
+ give_unicode_from_string(buffer,idx + len) > 31)
+ len++;
+
+ if (last_display_state &&
+ 0 != (CS_printable_len &
+ charset_properties(buffer->string_type))) {
+
+ PRINTABLE_LEN.max_len = _columns-_col;
+ PRINTABLE_LEN.ret_len = 0;
+
+ printable_len = &PRINTABLE_LEN;
+ }
+ s = us2s(streamclip_from_string(buffer,&idx,len,
+ last_display_state,printable_len));
+
+ DPRINT(Debug,10,(&Debug,
+ "PutLineS: [%d-%d] stream=",
+ old_idx,idx-1,s));
+
+ for (s1 = s; *s1; s1++) {
+ #ifdef DEBUG
+ if (isascii(*s1) && isprint(*s1) && '"' != *s1) {
+ if (!q) { DPRINT(Debug,10,(&Debug," \"")); q = 1; }
+ DPRINT(Debug,10,(&Debug,"%c",*s1));
+ } else {
+ if (q) { DPRINT(Debug,10,(&Debug,"\"")); q = 0; }
+ DPRINT(Debug,10,(&Debug," %02X", (unsigned char)*s1));


+ }
+ #endif
+ }
+

+ if (q) { DPRINT(Debug,10,(&Debug,"\"")); q = 0; }
+ if (printable_len) {
+ DPRINT(Debug,10,(&Debug,
+ " printable_len { max_len %d ret_len %d }",
+ printable_len->max_len,printable_len->ret_len));
+ }
+ DPRINT(Debug,10,(&Debug,"\n"));
+
+ for (s1 = s; *s1; s1++) {
+ outchar(*s1);
+ }
+
+ if (printable_len)
+ increment_position(printable_len->ret_len);
+ else
+ increment_position(idx-old_idx);
+
+ if (idx == old_idx) {
+ DPRINT(Debug,10,(&Debug,"No any characters printed...\n"));
+ CleartoEOLN();
+ cur_Writechar('\r');
+ cur_Writechar('\n');
+ }
+
+ free(s);
+ }
+
+ /* Free if converted */
+ if (buffer != S)
+ free_string(&buffer);
+
+ postprocess_output(stored_display,sw);
+ }
+
+ /*VARARGS2*/
+
+ void cur_Write_to_screen (
+ #if ANSI_C
+ CONST char *format, CONST char *msg, ...
+ #else
+ format, msg, va_alist
+ #endif
+ )
+ #if !ANSI_C
+ CONST char *format;
+ CONST char *msg;
+ va_dcl
+ #endif
+ {
+ va_list vl;
+ struct string *text;
+
+ Va_start(vl, msg); /* defined in defs.h */
+
+ /** This routine writes to the screen at the current location.
+ when done, it increments lines & columns accordingly by
+ looking for "\n" sequences... **/
+
+ text = elm_smessage(0,format,msg,vl);
+ cur_PutLineS(text);
+ free_string(&text);
+
+ va_end(vl);
+
+ }
+
+ void cur_PutLine0(x, y, line)
+ int x,y;
+ CONST char *line;
+ {
+ /** Write a zero argument line at location x,y **/
+
+ cur_MoveCursor(x,y);
+ while(*line)
+ cur_Writechar(*line++);
+ }
+
+ void cur_PutLineX(
+ #if ANSI_C
+ int x, int y, const char *format, const char *line, ...
+ #else
+ x, y, format, line, va_alist
+ #endif
+ )
+ #if !ANSI_C
+ int x;
+ int y;
+ CONST char *format;
+ CONST char *line;
+ va_dcl
+ #endif
+ {
+ va_list vl;
+ struct string *text;
+
+ Va_start(vl, line); /* defined in defs.h */
+
+ cur_MoveCursor(x,y);
+
+ text = elm_smessage(0,format,line,vl);
+ cur_PutLineS(text);
+ free_string(&text);
+
+ va_end(vl);
+
+ }
+
+ int cur_CleartoEOLN()
+ {
+ /** clear to end of line **/
+
+ if (need_moveabsolute)
+ moveabsolute(_col, _line);
+
+ if (!_cleartoeoln)
+ return(-1);
+
+ tputs(_cleartoeoln, 1, outchar);
+
+ return(0);
+ }
+
+
+ int cur_CleartoEOS()
+ {
+ /** clear to end of screen **/
+
+ if (need_moveabsolute)
+ moveabsolute(_col, _line);
+
+ if (!_cleartoeos)
+ return(-1);
+
+ tputs(_cleartoeos, 1, outchar);
+
+ return(0);
+ }
+
+ static int _inraw = 0; /* are we IN rawmode? */
+
+ int cur_RawState()
+ {
+ /** returns either 1 or 0, for ON or OFF **/
+
+ FlushBuffer();
+
+ return( _inraw );
+ }
+
+ #ifdef PTEM
+ # include <sys/stream.h>
+ # include <sys/ptem.h>
+ #endif
+
+ #ifdef TERMIOS
+ struct termios _raw_tty,
+ _original_tty;
+ #define ttgetattr(fd,where) tcgetattr((fd),(where))
+ #define ttsetattr(fd,where) tcsetattr((fd),TCSADRAIN,(where))
+ #else /*TERMIOS*/
+ # ifdef TERMIO
+ struct termio _raw_tty,
+ _original_tty;
+ #define ttgetattr(fd,where) ioctl((fd),TCGETA,(where))
+ #define ttsetattr(fd,where) ioctl((fd),TCSETAW,(where))
+ # else
+ struct tty_modes {
+ struct sgttyb sgttyb;
+ struct tchars tchars;
+ } _raw_tty, _original_tty;
+ static int ttgetattr P_((int,struct tty_modes *)); /* Prototype */
+ static int ttsetattr P_((int,struct tty_modes *)); /* Prototype */
+ # endif /*TERMIO*/
+ #endif /*TERMIOS*/
+
+ /* NOTE: Is called from signal handler! */
+ void cur_Raw(state)
+ int state;
+ {
+ int do_tite = (state & NO_TITE) == 0;
+ int do_charset = (state & NO_CHARSET) == 0;
+
+ state = state & ~NO_TITE & ~NO_CHARSET;
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "curses: Raw: state=%d do_tite=%d do_charset=%d\n",
+ state,do_tite,do_charset));
+
+ /** state is either ON or OFF, as indicated by call **/
+
+ if (state == OFF && _inraw) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "curses: Raw: Setting Raw state OFF\n"));;
+
+ #if POLL_METHOD
+ clear_action(terminal_fd);
+ clear_input_buffer();
+ #endif
+
+ if (cursor_control)
+ transmit_functions(OFF);
+
+ if (do_charset)
+ switch_display_charset(0);
+ /* We do NOT call switch_title(0) here because
+ raw state off may be called because running of program
+ */
+
+ if (use_tite && _end_termcap && do_tite) {
+ tputs(_end_termcap, 1, outchar);
+ }
+ FlushBuffer();
+ (void) ttsetattr(terminal_fd,&_original_tty);
+ _inraw = 0;
+ }
+ else if (state == ON && ! _inraw) {
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "curses: Raw: Setting Raw state ON\n"));;
+
+ (void) ttgetattr(terminal_fd, &_original_tty);
+ (void) ttgetattr(terminal_fd, &_raw_tty); /** again! **/
+
+ #if !defined(TERMIO) && !defined(TERMIOS)
+ _raw_tty.sg_flags &= ~(ECHO); /* echo off */
+ _raw_tty.sg_flags |= CBREAK; /* raw on */
+
+ #else
+ _raw_tty.c_lflag &= ~(ICANON | ECHO); /* noecho raw mode */
+
+ _raw_tty.c_cc[VMIN] = '\01'; /* minimum # of chars to queue */
+ _raw_tty.c_cc[VTIME] = '\0'; /* minimum time to wait for input */
+
+
+ #if defined(OXTABS)
+ /* Some systems use OXTABS bit */
+ if (_raw_tty.c_oflag & OXTABS) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "curses: [OXTABS] Terminal driver is expanding tabs...\n"));
+ tabexpand = 1;
+ } else {
+ if (tabexpand)
+ SIGDPRINT(Debug,4,(&Debug,
+ "curses: [OXTABS] Terminal driver isn't expanding tabs...\n"));
+ tabexpand = 0;
+ }
+ #endif /* defined(OXTABS) */
+
+ #if defined(TABDLY) && !defined(OXTABS)
+ /* Some systems expands tab when TABDLY is XTABS */
+ if ((_raw_tty.c_oflag & TABDLY) ==
+ #ifdef XTABS
+ XTABS
+ #else
+ TAB3
+ #endif
+ ) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "curses: [TABDLY] Terminal driver is expanding tabs...\n"));
+ tabexpand = 1;
+ } else {
+ if (tabexpand)
+ SIGDPRINT(Debug,4,(&Debug,
+ "curses: [TABDLY] Terminal driver isn't expanding tabs...\n"));
+ tabexpand = 0;
+ }
+ #endif /* defined(TABDLY) && !defined(OXTABS) */
+
+ #if !defined(TABDLY) && !defined(OXTABS)
+
+ /* If _POSIX_SOURCE is defined then OXTABS or TABDLY are not
+ * defined -- so print warning anyway
+ */
+ SIGDPRINT(Debug,4,(&Debug,
+ "curses: No information is terminal driver expanding tabs!\n"));
+ #endif /* !defined(TABDLY) && !defined(OXTABS) */
+
+ #endif
+ (void) ttsetattr(terminal_fd, &_raw_tty);
+ if (use_tite && _start_termcap && do_tite)
+ tputs(_start_termcap, 1, outchar);
+ _intransmit = -1; /* state unclear */
+ _inraw = 1;
+
+ if (do_charset) {
+ switch_display_charset(1);
+ switch_title(1);
+ }
+ need_moveabsolute = 1;
+ }
+ }
+
+
+ /* NOTE: Is called from signal handler! */
+ void transmit_functions(newstate)
+ int newstate;
+ {
+ /** turn function key transmission to ON | OFF **/
+
+ if (newstate != _intransmit) {
+ _intransmit = newstate;
+ if (newstate == ON)
+ tputs(_transmit_on, 1, outchar);
+ else
+ tputs(_transmit_off, 1, outchar);
+ FlushBuffer(); /* clear the output buffer */
+ }
+ }
+
+
+ #ifdef ultrix
+ force_raw()
+ {
+ (void) ttsetattr(terminal_fd,&_original_tty);
+ _inraw = 0;
+ Raw(ON);


+ }
+ #endif
+
+

+ int raw_off_called() {
+ return need_moveabsolute;
+ }
+
+ #if !defined(TERMIO) && !defined(TERMIOS)
+ static int ttgetattr P_((int fd,
+ struct tty_modes *where));
+ static int ttgetattr(fd, where)
+ int fd;
+ struct tty_modes *where;
+ {
+ if (ioctl(fd, TIOCGETP, &where->sgttyb) < 0)
+ return(-1);
+ if (ioctl(fd, TIOCGETC, &where->tchars) < 0)
+ return(-1);
+ return(0);
+ }
+
+ static int ttsetattr P_((int fd,
+ struct tty_modes *where));
+ static int ttsetattr(fd, where)
+ int fd;
+ struct tty_modes *where;
+ {
+ if (ioctl(fd, TIOCSETP, &where->sgttyb) < 0)
+ return(-1);
+ if (ioctl(fd, TIOCSETC, &where->tchars) < 0)
+ return(-1);
+ return(0);
+ }
+ #endif
+
+ /* ----- following are copied from ../src/curses.c as documentation
+ only ... they was not used on ELM ... also these termcap entries
+ seems not documented at least on Linux ....
+ */
+
+
+ #if 0
+
+ static int _memory_locked = 0; /* are we IN memlock?? */
+
+ int
+ HasMemlock()
+ {
+ /** returns TRUE iff memory locking is available (a terminal
+ feature that allows a specified portion of the screen to
+ be "locked" & not cleared/scrolled... **/
+
+ return ( _set_memlock && _clear_memlock );
+ }
+
+ static int _old_LINES;
+
+ int
+ StartMemlock()
+ {
+ /** mark the current line as the "last" line of the portion to
+ be memory locked (always relative to the top line of the
+ screen) Note that this will alter LINES so that it knows
+ the top is locked. This means that (plus) the program
+ will scroll nicely but (minus) End memlock MUST be called
+ whenever we leave the locked-memory part of the program! **/
+
+ if (! _set_memlock)
+ return(-1);
+
+ if (! _memory_locked) {
+
+ _old_LINES = elm_LINES;
+ elm_LINES -= _line; /* we can't use this for scrolling */
+
+ tputs(_set_memlock, 1, outchar);
+
+ _memory_locked = TRUE;
+ }
+
+ return(0);
+ }
+
+ int
+ EndMemlock()
+ {
+ /** Clear the locked memory condition... **/
+
+ if (! _set_memlock)
+ return(-1);
+
+ if (_memory_locked) {
+ elm_LINES = _old_LINES; /* back to old setting */
+
+ tputs(_clear_memlock, 1, outchar);
+
+ _memory_locked = FALSE;
+ }
+ return(0);
+ }
+
+ #endif /* ndef ELM */
+
+ /* ----------------------------------------------------------------------- */
+
+ #if 0 /* SCROLL */
+ static void set_scrolling_region P_((int line1, int line2));
+ static void set_scrolling_region(line1,line2)
+ int line1;
+ int line2;
+ {
+ char *stuff, *tgoto();
+
+ stuff = tgoto(_set_scroll_region,line1,line2);
+ tputs(stuff, 1, outchar);
+ }
+
+ void limit_position(row,col)
+ int *row;
+ int *col;
+ {
+ if (*row < 0)
+ *row = 0;
+ if (*col < 0)
+ *col = 0;
+ if (*col >= _columns)
+ *col = _columns - 1;
+
+ if (*row >= _lines) {
+ *row = _lines -1;
+ *col = _columns - 1;


+ }
+ }
+ #endif
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

+
+
Index: elm2.4.ME+.108-cvs/src/screen/curs_input.c
*** /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
--- elm2.4.ME+.108-cvs/src/screen/curs_input.c 2003-10-01 20:34:34.000000000 +0300
***************
*** 0 ****
--- 1,578 ----
+ static char rcsid[] = "@(#)$Id: curs_input.c,v 1.2 2003/10/01 17:34:34 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *

+ * Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
+ *****************************************************************************
+ *
+ * Some code copied from ../src/curses.c. It have following copyright:
+ *


+ * Copyright (c) 1988-1992 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************/
+
+

+ #include "def_screen.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ #include <errno.h>
+
+
+ #if POLL_METHOD
+ static unsigned char *read_buffer = NULL;
+ static int read_buffer_len = 0;
+ static int last_read_error = 0;
+
+ static int background_read P_((int fd, void *data));
+ static int background_read(fd,data)
+ int fd;
+ void *data;
+ {
+ int result;


+ unsigned char ch;
+

+ result = read(fd, &ch, 1);
+
+ if (result < 0) {
+ int err = errno;
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "background_read: errno = %d [%s]\n",err,
+ error_description(err)));
+
+ if((err == EINTR)
+ #ifdef EAGAIN
+ || (err == EAGAIN)
+ #endif
+ #ifdef EWOULDBLOCK
+ || (err == EWOULDBLOCK)
+ #endif
+ ) {
+ return 1; /* Retry */
+ }
+
+ last_read_error = err;
+ return 0;
+ }
+
+ if (0 == result) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "background_read: Got zero bytes...\n"));
+ last_read_error = -1;
+ return 0;
+ }
+
+ read_buffer = safe_realloc(read_buffer,read_buffer_len+1);
+ SIGDPRINT(Debug,20,(&Debug,
+ "background_read(fd=%d)=1 [%d]",fd,read_buffer_len));
+ SIGDPRINT(Debug,50,(&Debug,"=%d",ch));
+ SIGDPRINT(Debug,20,(&Debug,"\n"));
+
+ read_buffer[read_buffer_len++] = ch;
+ last_read_error = 0;


+
+ return 1;
+ }
+
+

+ void clear_input_buffer()
+ {
+ SIGDPRINT(Debug,4,(&Debug,
+ "Resetting background_read buffer (%d bytes)...\n",
+ read_buffer_len));
+ read_buffer_len = 0;
+ last_read_error = 0;
+ }
+
+ int error_sleep(seconds)
+ int seconds;
+ {
+ int ret;
+ if (read_buffer_len > 0) {
+ SIGDPRINT(Debug,5,(&Debug,
+ "error_sleep(%d)=1 -- sleep skipped\n",
+ seconds));
+ return 1;
+ }
+ SIGDPRINT(Debug,5,(&Debug,
+ "error_sleep(%d) ...\n",seconds));
+ ret = wait_for_action_or_timeout(background_read,seconds);
+ DPRINT(Debug,5,(&Debug,
+ "error_sleep=%d\n",ret));
+ return ret;


+ }
+ #endif
+
+

+ int cur_ReadCh(flags,break_flag)
+ int flags;
+ int break_flag;
+ {
+ int ret = 0;
+
+ do {
+ struct charset_state *ch = cur_ReadCh2(flags,break_flag);
+
+ if (!ch) {
+ ret = EOF;
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh=EOF (errno=%d)\n",errno));
+ } else if (ch -> caller_flags) {
+ ret = ch -> caller_flags;
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh=%d (flags)\n",ret));
+ } else
+ ret = state_is_onebyte(ch);
+ if (!ret) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh: Not a one byte character or zero byte!"));
+ /* Ring a bell */
+ Writechar('\007');
+ } else {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh=%d (one byte character)\n",
+ ret));
+ }
+ } while (0 == ret);
+ return ret;
+ }
+
+
+ struct charset_state * cur_ReadCh2(flags,break_flag)
+ int flags;
+ int break_flag;
+ {
+ int redraw = (flags & READCH_MASK);
+ int cursorkeys = (flags & READCH_CURSOR) != 0;
+ int nocursor = (flags & READCH_NOCURSOR) != 0 && cursor_control;
+ int term_char = (flags & READCH_term_char) != 0;
+ int x,y;
+
+ unsigned char input_buffer[20];
+
+ /*
+ * read a character with Raw mode set!
+ *
+ * EAGAIN & EWOULDBLOCK are recognized just in case
+ * O_NONBLOCK happens to be in effect.
+ */
+
+ /* This is static array so we can initialize it in here ...
+ */
+ static struct {
+ char ** CONST str;
+ CONST int result;
+ int maybe;
+ } keytable[] =
+ { { &_key_up, UP_MARK, 0 },
+ { &_key_down, DOWN_MARK, 0 },
+ { &_key_left, LEFT_MARK, 0 },
+ { &_key_right, RIGHT_MARK, 0 },
+
+ { &_key_pageup, PAGEUP_MARK, 0 },
+ { &_key_pagedown, PAGEDOWN_MARK, 0 },
+
+ { &_key_home, HOME_MARK, 0 },
+ { &_key_help, HELP_MARK, 0 },
+ { &_key_find, FIND_MARK, 0 },
+ { NULL, 0, 0 }
+ };
+
+ int read_p,found_key;
+
+ #if POLL_METHOD
+ change_action(terminal_fd,0,background_read,no_action_routine,
+ no_action_routine,
+ NULL);
+ #endif
+
+ cur_GetXYLocation(&x,&y); /* Background actions may print error messages .. */
+
+ if (!last_state) {
+ last_state = new_state(system_charset);
+ DPRINT(Debug,4,(&Debug,
+ "Keyboard input charset is %s\n",
+ last_state->charset->MIME_name ?
+ last_state->charset->MIME_name :
+ "<no MIME name>"));
+ }
+
+ if (state_ready(last_state)) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: starting reading new character (set %s)\n",
+ last_state->charset->MIME_name ?
+ last_state->charset->MIME_name :
+ "<no MIME name>"));
+ reset_state(last_state,0);
+ }
+ last_state->caller_flags = 0;
+
+ reinit_ReadChar:
+ read_p = 0;
+ found_key = 0;
+
+ FlushBuffer();
+
+ if (redraw && !cur_RawState()) { /* Check that we have in 'raw' mode */
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Going to Raw mode\n"));
+ cur_Raw(ON);
+ cur_ClearScreen();
+
+ reset_state(last_state,1);
+ last_state->caller_flags = redraw;
+
+ return last_state;
+ }
+
+ if (redraw && redraw_screen) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Pending redraw...\n"));
+ cur_ClearScreen();
+
+ reset_state(last_state,1);
+ last_state->caller_flags = redraw;
+
+ return last_state;
+ }
+
+ if ((_intransmit != ON || redraw_screen) &&
+ cursorkeys && _transmit_on) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Enabling cursor keys...\n"));
+ transmit_functions(ON);
+ }
+
+ if ((_intransmit != OFF || redraw_screen) &&
+ nocursor && _transmit_off) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Disabling cursor keys...\n"));
+ transmit_functions(OFF);
+ }
+
+ if (cursorkeys) {
+ int i;
+ DPRINT(Debug,8,(&Debug,
+ "ReadCh2: Available function keys:"));
+
+ for (i = 0; keytable[i].str != 0; i++) {
+ char * CONST str = *(keytable[i].str);
+ if(str && str[0] != '\0') {
+ keytable[i].maybe = 1; /* Initially every function key is possible */
+ SIGDPRINT(Debug,8,(&Debug,
+ " [%d] %d",i,keytable[i].result));
+ }
+ }
+ DPRINT(Debug,4,(&Debug,
+ "\n"));
+ }
+
+ while (found_key == 0) {
+ unsigned char ch;
+ #if POLL_METHOD
+ if (read_buffer_len < 1 && last_read_error == 0) {
+ errno= 0;
+ if(!wait_for_action(background_read)) {
+ if (errno != 0) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: wait_for_action got error %d (%s)\n",
+ errno, error_description(errno)));
+ /* Return error: */
+ if ((redraw && redraw_screen)
+ || break_flag /* GetPrompt wants to see errors! */
+ ) {
+ DPRINT(Debug,4,(&Debug,
+ " ... return error to caller\n"));
+ found_key = -1;
+ continue;
+ }
+ if (errno == EINTR
+ #ifdef EAGAIN
+ || (errno == EAGAIN)
+ #endif
+ #ifdef EWOULDBLOCK
+ || (errno == EWOULDBLOCK)
+ #endif
+ ) {
+ DPRINT(Debug,4,(&Debug,
+ " ... retry (ignored)\n"));
+ } else
+ found_key = -1;
+ continue;
+ }
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: interrupted (ignored)\n"));
+ continue;
+ }
+ }
+ if (read_buffer_len > 0) {
+ ch = read_buffer[0];
+ if (--read_buffer_len > 0)
+ memmove(read_buffer,read_buffer+1,read_buffer_len);
+ } else if (last_read_error != 0) {
+ if (-1 == last_read_error) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: background_read got zero bytes...\n"));
+ found_key = -1;
+ continue;
+ }
+ /* Return error: */
+ if ((redraw && redraw_screen)
+ || break_flag /* GetPrompt wants to see errors! */
+ ) {
+ found_key = -1;
+ continue;
+ }
+ if (last_read_error != 0) {
+ errno = last_read_error;
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: background_read got error %d (%s)\n",
+ last_read_error,
+ error_description(last_read_error)));
+ found_key = -1;
+ }
+ continue; /* continue or quit */
+ } else {
+ DPRINT(Debug,1,(&Debug,
+ "ReadCh2: SOFTWARE ERROR !!\n"));
+ break;
+ }
+ #else
+ int result;
+
+ result = read(terminal_fd, &ch, 1);
+
+ if (result < 0) {
+ int err = errno;
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: errno = %d [%s]\n",err,
+ error_description(err)));
+
+ /* Return error: */
+ if (redraw && redraw_screen
+ || break_flag /* GetPrompt wants to see errors! */
+ ) {
+ found_key = -1;
+ continue;
+ }
+ if((errno == EINTR)
+ #ifdef EAGAIN
+ || (errno == EAGAIN)
+ #endif
+ #ifdef EWOULDBLOCK
+ || (errno == EWOULDBLOCK)
+ #endif
+ ) {
+ continue; /* Retry */
+ }
+ break;
+ }
+ if (0 == result) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Got zero bytes...\n"));
+ found_key = -1;
+ continue;
+ }
+ #endif
+
+ #ifdef USE_DLOPEN
+ {
+ union xxx_rand {
+ int ch;
+ char bytes[sizeof (int)];
+ } A;
+ A.ch = ch;
+
+ seed_rand_bits(A.bytes, sizeof A,
+ 3 /* Assume 3 bits per character ... */);


+ }
+ #endif
+
+

+
+ DPRINT(Debug,50,(&Debug,
+ "ReadCh2: Looking char %d (read_p=%d)\n",ch,read_p));
+
+ if (term_char) {
+ if (backspace == ch)
+ found_key = TERMCH_backspace;
+ if (kill_line == ch)
+ found_key = TERMCH_kill_line;
+ if (word_erase == ch)
+ found_key = TERMCH_word_erase;
+ if (interrupt_char == ch)
+ found_key = TERMCH_interrupt_char;
+ if (reprint_char == ch)
+ found_key = TERMCH_reprint_char;
+ if (eof_char == ch)
+ found_key = TERMCH_eof_char;
+ if (found_key) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: found termchar = %d (char=%02X)\n",
+ found_key,ch));
+ /* Soft reset state */
+ reset_state(last_state,0);

+ break;
+ }
+ }
+

+ if (cursorkeys) {
+ int match = 0;
+ int i;
+ for (i = 0; keytable[i].str != NULL; i++) {
+ if (keytable[i].maybe) {
+ unsigned char * CONST str =
+ (unsigned char *) *(keytable[i].str);
+ if (str[read_p] == ch) {
+ match++;
+ if (str[read_p+1] == '\0') {
+ found_key = keytable[i].result;
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Found function key = %d (keytable = %d, read_p =%d)\n",
+ found_key,i,read_p));
+
+ /* Soft reset state */
+ reset_state(last_state,0);
+ }
+ } else {
+ keytable[i].maybe = 0;
+ }
+ }
+ }
+
+ if (read_p < sizeof input_buffer -1) {
+ input_buffer[read_p] = ch;
+ input_buffer[read_p+1] = '\0';
+ }
+
+ if (match == 0) { /* Not in keytable */
+ if (read_p == 0)
+ found_key = ch; /* Normal key */
+ else {
+ int i;
+
+ /* But maybe escape sequence is valid state change ? */
+
+ for (i = 0;
+ i <= read_p && i < sizeof input_buffer -1;
+ i++) {
+
+ if (state_ready(last_state)) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Unsupporting -- function keys and state change sequences overlap? (OR BAD SEQUENCE) \n"));
+ goto BAD_sequence;
+ }
+
+ if (!add_streambyte_to_state(last_state,
+ input_buffer[i]))
+ goto BAD_sequence;
+
+ }
+
+ if (state_ready(last_state))
+ goto got_key;
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: need more bytes for character...\n"));
+ goto reinit_ReadChar;
+
+
+ BAD_sequence:
+
+ /* Soft reset state */
+ reset_state(last_state,0);
+
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Bad escape sequence; ch = %d, read_p = %d\n",
+ ch,read_p));
+ #ifdef DEBUG
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Sequence was:"));
+ for (i = 0; i <= read_p && i < sizeof input_buffer -1; i++) {
+ if (isascii(input_buffer[i]) && isprint(input_buffer[i])) {
+ DPRINT(Debug,4,(&Debug," %c (0x%02X)",
+ input_buffer[i],input_buffer[i]));
+ } else {
+ DPRINT(Debug,4,(&Debug," 0x%02X", input_buffer[i]));
+ }
+ }
+ if (read_p > sizeof input_buffer -1)
+ DPRINT(Debug,4,(&Debug," ..."));
+ DPRINT(Debug,4,(&Debug,"\n"));
+ #endif
+
+ /* Ring a bell */
+ cur_Writechar('\007');
+ goto reinit_ReadChar;
+ }
+ } else
+ read_p++;
+ } else
+ found_key = ch;
+
+ }
+
+ if (found_key <= 0 && redraw && redraw_screen) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Redraw...\n"));
+ if(!cur_RawState()) { /* Check that we have in 'raw' mode */
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: Going to Raw mode\n"));
+ cur_Raw(ON);
+ }
+ cur_ClearScreen();
+
+ reset_state(last_state,1);
+ last_state->caller_flags = redraw;
+
+ return last_state;
+ }
+
+ cur_MoveCursor(x,y);
+ DPRINT(Debug,50,(&Debug,
+ "ReadCh2: found_key=%d\n",found_key));
+
+ if (found_key < 0) {
+ reset_state(last_state,1);
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2=NULL (state)\n"));
+ return NULL;
+ } else {
+ if (found_key >= 256) {
+ reset_state(last_state,1);
+ last_state->caller_flags = found_key;
+ } else {
+ last_state->caller_flags = 0;
+ if (!add_streambyte_to_state(last_state,found_key)) {
+ /* Ring a bell */
+ Writechar('\007');
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: bad sequence...\n"));
+ reset_state(last_state,1);
+ }
+ }
+ }
+
+ if (!state_ready(last_state) &&
+ !last_state->caller_flags) {
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2: need more bytes for character...\n"));
+ goto reinit_ReadChar;
+ }
+
+ got_key:
+ DPRINT(Debug,4,(&Debug,
+ "ReadCh2=%p (state): caller_flags=%d, ready=%d\n",
+ last_state,last_state->caller_flags,
+ state_ready(last_state)));
+ return last_state;
+ }


+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.108-cvs/src/screen/def_screen.h
*** /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
--- elm2.4.ME+.108-cvs/src/screen/def_screen.h 2003-10-01 20:34:35.000000000 +0300
***************
*** 0 ****
--- 1,95 ----
+ /* $Id: def_screen.h,v 1.2 2003/10/01 17:34:35 hurtta Exp $ */
+
+ #include "headers.h"
+ #include "me.h"
+
+
+ extern int InGetPrompt; /* set if in GetPrompt() in read() */


+ /* HACK */
+

+ #define pg_BOLD 0x01
+ #define pg_UNDERLINE 0x02
+ #define pg_HALFBRIGHT 0x04
+ #define pg_INVERSE 0x08
+
+
+ /* curses.c */
+
+
+ extern int cur_tabspacing; /* Default? */
+
+ extern int cur_InitScreen P_((void));
+
+ extern int terminal_fd;
+ extern int outchar P_((int c));
+
+ extern charset_t target_display_charset;
+ extern struct charset_state * last_state;
+ extern screen_info_p last_display_state;
+
+ extern char terminal_type[];
+
+ /* DO NOT return lines-1 (as ScreenSize() did) */
+
+ extern void cur_ScreenSize P_((int *lines, int *columns));
+ extern void cur_GetXYLocation P_((int *line, int *col));
+ extern int cur_ClearScreen P_((void));
+ extern void cur_CursorUp P_((int n));
+ extern void cur_CursorDown P_((int n));
+ extern void cur_CursorLeft P_((int n));
+ extern int cur_MoveCursor P_((int row, int col));
+
+ extern void cur_changemode P_((int *mode, int set, int reset));
+
+ /* This assumes one byte charset */
+ extern void cur_Writechar P_((int ch));
+
+ extern void cur_PutLineS P_((struct string *S));
+
+ extern void cur_Write_to_screen P_((const char *format,
+ const char *msg, ...));
+
+ extern void cur_PutLine0 P_((int x, int y, const char *line));
+ extern void cur_PutLineX P_((int x, int y, const char *format,
+ const char *line, ...));
+ extern int cur_CleartoEOLN P_((void));
+ extern int cur_CleartoEOS P_((void));
+
+ extern int cur_RawState P_((void));
+
+ /* NOTE: Is called from signal handler! */
+ extern void cur_Raw P_((int state));
+
+ void limit_position P_((int *row, int *col));
+
+ extern void transmit_functions P_((int newstate));
+
+
+ #if POLL_METHOD
+ extern void clear_input_buffer P_((void));
+ #endif
+
+ extern int cur_ReadCh P_((int flags, int break_flag));
+ extern struct charset_state * cur_ReadCh2 P_((int flags,
+ int break_flag));
+
+ extern int cursor_control;
+ extern int _intransmit; /* are we transmitting keys? */
+ extern char *_key_up, *_key_down, *_key_left, *_key_right,
+ *_key_pageup, *_key_pagedown, *_key_home,
+ *_key_help, *_key_find;
+ extern char *_transmit_on, *_transmit_off;
+
+ /* cur_process.c */
+
+
+ extern void print_status P_((struct run_state *rs,int sig,int exit_code));
+ extern void start_run_tty_init P_((void));
+ extern void print_status_cooked P_((struct run_state *rs,int sig,
+ int exit_code));


+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.108-cvs/src/screen/Makefile.SH
*** /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
--- elm2.4.ME+.108-cvs/src/screen/Makefile.SH 2003-10-01 20:34:34.000000000 +0300
***************
*** 0 ****
--- 1,89 ----
+ case $CONFIG in
+ '')
+ if test ! -f config.sh; then
+ ln ../config.sh . || \
+ ln ../../config.sh . || \
+ ln ../../../config.sh . || \
+ ln ../../../../config.sh . || \
+ (echo "Can't find config.sh."; exit 1)
+ fi
+ . ./config.sh
+ ;;
+ esac
+ case "$0" in
+ */*) cd `expr X$0 : 'X\(.*\)/'` ;;
+ esac
+
+ echo "Extracting src/screen/Makefile (with variable substitutions)"
+ cat >Makefile <<!GROK!THIS!
+ #!$make
+ # $Id: Makefile.SH,v 1.2 2003/10/01 17:34:34 hurtta Exp $
+ # Makefile for the ELM mail program.
+ #
+ # Variables
+ # Variables established by Configure
+ AR = ar
+ CC = $cc
+ CCFLAGS = $ccflags $picflag $xencf
+ CHMOD = $chmod
+ LINT = $lint
+ OPTIMIZE = $optimize
+ RANLIB = $ranlib
+ RM = $rm -f
+ TOUCH = $touch
+ TAGS = ctags


+
+ !GROK!THIS!
+
+ cat >>Makefile <<'!NO!SUBS!'

+ # Other general variables
+ CFLAGS = -I$(INCLDIR) $(CCFLAGS) $(OPTIMIZE) $(DEBUG)
+ INCLDIR = ../../hdrs
+ LINTFLAGS = -I$(INCLDIR)
+ SHELL = /bin/sh
+
+ OBJ = screen.o curses.o curs_input.o termbuffer.o \
+ termtitle.o termcharset.o cur_process.o
+
+ all: Makefile libscreen.a
+
+ install_s: Makefile libscreen.a
+
+ uninstall_s:
+
+ clean:
+ $(RM) $(OBJ) libscreen.a
+
+ Makefile: Makefile.SH ../../config.sh
+ @echo "You must run 'sh Configure -S' or 'sh Configure'"
+ exit 1
+
+ libscreen.a: $(OBJ)
+ $(AR) r $@ $?
+ $(RANLIB) $@
+
+ # Dependencies of header files upon other header files they include
+ .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/headers.h def_screen.h
+
+ $(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
+ $(CHMOD) u+w $@
+ $(TOUCH) $@
+
+ $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h
+ $(CHMOD) u+w $@
+ $(TOUCH) $@
+
+ def_screen.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h
+ $(CHMOD) u+w $@
+ $(TOUCH) $@
+
+ # Dependencies of C object files
+
+ screen.o: def_screen.h
+ curses.o: def_screen.h
+ curs_input.o: def_screen.h
+ termbuffer.o: def_screen.h
+ termtitle.o: def_screen.h
+ termcharset.o: def_screen.h
+ cur_process.o: def_screen.h $(INCLDIR)/s_elm.h
+ !NO!SUBS!
Index: elm2.4.ME+.108-cvs/src/screen/screen.c
*** /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
--- elm2.4.ME+.108-cvs/src/screen/screen.c 2003-10-12 09:42:38.000000000 +0300
***************
*** 0 ****
--- 1,345 ----
+ static char rcsid[] = "@(#)$Id: screen.c,v 1.4 2003/10/12 06:42:38 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

+ ******************************************************************************
+ * Some code copied from ../curses.c. It have following copyright:
+ *


+ * Copyright (c) 1988-1992 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
+ *

+ * However on that code there is no practically Elm 2.4 code (from where that
+ * copyright is) left. Only function names are same.
+ *****************************************************************************/
+
+
+
+ #include "def_screen.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ static void PutLineS P_((struct string *S));
+
+ static void PutLineS(S)
+ struct string *S;
+ {
+
+ DPRINT(Debug,49, (&Debug, "PutLineS(\"%S\")\n",S));
+
+ cur_PutLineS(S);
+ }
+
+
+ int InitScreen()
+ {
+ int r;
+
+ DPRINT(Debug,49, (&Debug, "InitScreen()\n"));
+
+ r = cur_InitScreen();
+
+ set_start_run_hooks(print_status,RawState,Raw,
+ start_run_tty_init,ClearScreen,
+ PutLineS, print_status_cooked
+ );
+
+ return r;
+ }
+
+
+ /* This assumes one byte charset */
+ void Writechar(ch)
+ int ch;
+ {
+ DPRINT(Debug,49, (&Debug, "Writechar('%c')\n",ch));
+
+ cur_Writechar(ch);
+ }
+
+ /*VARARGS2*/
+
+ void Write_to_screen (
+ #if ANSI_C
+ CONST char *format, CONST char *msg, ...
+ #else
+ format, msg, va_alist
+ #endif
+ )
+ #if !ANSI_C
+ CONST char *format;
+ CONST char *msg;
+ va_dcl
+ #endif
+ {
+ va_list vl;
+ struct string *text;
+
+ DPRINT(Debug,49, (&Debug, "Write_to_screen(format=\"%s\",...)\n",format));
+
+ Va_start(vl, msg); /* defined in defs.h */
+
+ /** This routine writes to the screen at the current location.
+ when done, it increments lines & columns accordingly by
+ looking for "\n" sequences... **/
+
+ text = elm_smessage(0,format,msg,vl);
+ PutLineS(text);
+ free_string(&text);
+
+ va_end(vl);
+
+ }
+
+ void PutLine0(x, y, line)
+ int x,y;
+ CONST char *line;
+ {
+ DPRINT(Debug,49, (&Debug, "PutLine0(%d,%d,\"%s\")\n",x,y,line));
+
+ cur_PutLine0(x,y,line);
+ }
+
+
+ void PutLineX(
+ #if ANSI_C
+ int x, int y, const char *format, const char *line, ...
+ #else
+ x, y, format, line, va_alist
+ #endif
+ )
+ #if !ANSI_C
+ int x;
+ int y;
+ CONST char *format;
+ CONST char *line;
+ va_dcl
+ #endif
+ {
+ va_list vl;
+ struct string *text;
+
+ DPRINT(Debug,49, (&Debug, "PutLineX(%d,%d,format=\"%s\",...)\n",x,y,format));
+
+ Va_start(vl, line); /* defined in defs.h */
+
+ MoveCursor(x,y);
+
+ text = elm_smessage(0,format,line,vl);
+ PutLineS(text);
+ free_string(&text);
+
+ va_end(vl);
+
+ }
+
+
+ int CleartoEOLN()
+ {
+ int r;
+
+ DPRINT(Debug,49, (&Debug, "CleartoEOLN()\n"));
+ r = cur_CleartoEOLN();
+
+ return r;
+ }
+
+ int CleartoEOS()
+ {
+ int r;
+
+ DPRINT(Debug,49, (&Debug, "CleartoEOS()\n"));
+ r = cur_CleartoEOS();
+
+ return r;
+ }
+
+ int RawState()
+ {
+ int r;
+
+ DPRINT(Debug,49, (&Debug, "RawState()\n"));
+
+ r = cur_RawState();
+
+ return r;
+ }
+
+ void Raw(state)
+ int state;
+ {
+ DPRINT(Debug,49, (&Debug, "Raw(%d)\n",state));
+
+ cur_Raw(state);
+ }
+
+ struct charset_state * ReadCh2(flags)
+ int flags;
+ {
+ struct charset_state *st;
+
+ DPRINT(Debug,49, (&Debug, "ReadCh2(%d)\n",flags));
+
+ st = cur_ReadCh2(flags,InGetPrompt);
+
+ return st;
+ }
+
+ int ReadCh(flags)
+ int flags;
+ {
+ int c;
+
+ DPRINT(Debug,49, (&Debug, "ReadCh(%d)\n",flags));
+
+ c = cur_ReadCh(flags,InGetPrompt);
+
+ return c;
+ }
+
+ void ScreenSize(lines, columns)
+ int *lines, *columns;
+ {
+
+ DPRINT(Debug,49, (&Debug, "ScreenSize(*,*)\n"));
+
+ /* cur_ScreenSize DO NOT return lines-1 (as ScreenSize() did) */
+
+ cur_ScreenSize(lines,columns);
+
+ ((*lines)--);
+
+ }
+
+ void GetXYLocation(x,y)
+ int *x,*y;
+ {
+ DPRINT(Debug,49, (&Debug, "GetXYLocation(*,*)\n"));
+
+ cur_GetXYLocation(x,y);
+ }
+
+ int ClearScreen()
+ {
+ int r;
+
+ DPRINT(Debug,49, (&Debug, "ClearScreen()\n"));
+
+ r = cur_ClearScreen();
+
+ return r;
+ }
+
+ int MoveCursor(row, col)
+ int row, col;
+ {
+ int r;
+
+ DPRINT(Debug,49, (&Debug, "MoveCursor(%d,%d)\n",row,col));
+
+ r = cur_MoveCursor(row, col);
+
+ return r;
+ }
+
+ void CarriageReturn()
+ {
+
+ DPRINT(Debug,49, (&Debug, "CarriageReturn()\n"));
+ /** move the cursor to the beginning of the current line **/
+ Writechar('\r');
+ }
+
+ void NewLine()
+ {
+ DPRINT(Debug,49, (&Debug, "NewLine()\n"));
+ /** move the cursor to the beginning of the next line **/
+
+ Writechar('\r');
+ Writechar('\n');
+ FlushBuffer();
+ }
+
+ int modes = 0;
+
+ int StartBold()
+ {
+ DPRINT(Debug,49, (&Debug, "StartBold()\n"));
+ cur_changemode(&modes, pg_BOLD,0);
+
+ return 0;
+ }
+
+ int EndBold()
+ {
+ DPRINT(Debug,49, (&Debug, "EndBold()\n"));
+ /** compliment of startbold **/
+
+ cur_changemode(&modes, 0, pg_BOLD);
+
+ return 0;
+ }
+
+ int StartInverse() {
+
+ DPRINT(Debug,49, (&Debug, "StartInverse()\n"));
+ cur_changemode(&modes, pg_INVERSE,0);
+
+ return 0;
+ }
+
+ int EndInverse() {
+
+ DPRINT(Debug,49, (&Debug, "EndInverse()\n"));
+ cur_changemode(&modes, 0, pg_INVERSE);
+
+ return 0;
+ }
+
+
+ int StartUnderline() {
+
+ DPRINT(Debug,49, (&Debug, "StartUnderline()\n"));
+ cur_changemode(&modes, pg_UNDERLINE,0);
+
+ return 0;
+ }
+
+ int EndUnderline() {
+
+ DPRINT(Debug,49, (&Debug, "EndUnderline()\n"));
+ cur_changemode(&modes, 0, pg_UNDERLINE);
+
+ return 0;
+ }
+
+ int StartHalfbright() {
+
+ DPRINT(Debug,49, (&Debug, "StartHalfbright()\n"));
+ cur_changemode(&modes, pg_HALFBRIGHT,0);
+
+ return 0;
+ }
+
+ int EndHalfbright() {
+
+ DPRINT(Debug,49, (&Debug, "EndHalfbright()\n"));
+ cur_changemode(&modes, 0, pg_HALFBRIGHT);
+
+ return 0;
+ }
+
+ int get_tabspacing()
+ {
+ DPRINT(Debug,49, (&Debug, "get_tabspacing()\n"));
+ return cur_tabspacing;
+ }


+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.108-cvs/src/screen/termbuffer.c
*** /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
--- elm2.4.ME+.108-cvs/src/screen/termbuffer.c 2003-10-01 20:34:35.000000000 +0300
***************
*** 0 ****
--- 1,106 ----
+ static char rcsid[] = "@(#)$Id: termbuffer.c,v 1.2 2003/10/01 17:34:35 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

+ *****************************************************************************/
+
+ #include "def_screen.h"
+ #include <errno.h>
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ int terminal_fd = 1; /* Standard output, later terminal ... */
+
+ static char outchar_write_buffer[2048];
+ VOLATILE static char * buffer_ptr = &(outchar_write_buffer[0]);
+
+ /* Note that there is several race conditions -- losing of characters possible
+ (this may be called from signal handler)
+ */
+ void FlushBuffer P_((void))
+ {
+ int len;
+
+ while (0 < (len = buffer_ptr-outchar_write_buffer)) {
+ int L = write(terminal_fd,outchar_write_buffer,len);
+ int err = errno;
+
+ if (L < 0 &&
+ ((err != EINTR)
+ #ifdef EAGAIN
+ && (err != EAGAIN)
+ #endif
+ #ifdef EWOULDBLOCK
+ && (err != EWOULDBLOCK)
+ #endif
+ )) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "FlushBuffer: Write failed errno=%d\n",err));
+ break;
+ }
+
+ if (L > 0) {
+ len = buffer_ptr-outchar_write_buffer;
+
+ len -= L;
+
+ DPRINT(Debug,9,(&Debug,
+ "FlushBuffer: %d bytes writted to %d, %d left\n",
+ L,terminal_fd,len));
+
+ if (len > 0)
+ memmove(outchar_write_buffer,outchar_write_buffer+L,len);
+ if (len >= 0)
+ buffer_ptr = outchar_write_buffer + len;
+ else
+ buffer_ptr = outchar_write_buffer;
+
+ } else {
+ DPRINT(Debug,2,(&Debug,
+ "FlushBuffer: Looping...\n"));
+ }
+ }
+ }
+
+ /* Note that there is several race conditions -- losing of characters possible
+ (this may be called from signal handler)
+ */
+ int outchar(c)
+ int c;
+ {
+
+ if (buffer_ptr >= outchar_write_buffer + sizeof (outchar_write_buffer))
+ FlushBuffer();
+
+ if (buffer_ptr < outchar_write_buffer + sizeof (outchar_write_buffer)) {
+ VOLATILE char *p = buffer_ptr++;
+
+ *p = c;
+
+ if (c >= ' ' && c < 127) { /* ASCII Assumed */
+ SIGDPRINT(Debug,40,(&Debug,
+ "outchar [%d] = %02X '%c'\n",
+ p-outchar_write_buffer,(unsigned char) *p,c));
+
+ } else {
+ SIGDPRINT(Debug,40,(&Debug,
+ "outchar [%d] = %02X\n",
+ p-outchar_write_buffer,(unsigned char) *p));
+ }
+
+ return (unsigned char)c;
+ }
+ SIGDPRINT(Debug,2,(&Debug,
+ "outchar: Buffer full!\n"));
+ return EOF;
+ }


+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.108-cvs/src/screen/termcharset.c
*** /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
--- elm2.4.ME+.108-cvs/src/screen/termcharset.c 2003-10-01 20:34:35.000000000 +0300
***************
*** 0 ****
--- 1,122 ----
+ static char rcsid[] = "@(#)$Id: termcharset.c,v 1.2 2003/10/01 17:34:35 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

+ *****************************************************************************/
+
+ #include "def_screen.h"
+
+ DEBUG_VAR(Debug,__FILE__,"elmpage");
+
+ charset_t target_display_charset = NULL;
+ struct charset_state * last_state = NULL;
+ screen_info_p last_display_state = NULL;
+
+
+ charset_t * give_display_charsets(storage,max)
+ charset_t *storage;
+ int max;
+ {
+ int n = 0,i;
+ max--;
+
+ storage[n++] = display_charset;
+
+ if (system_charset != display_charset &&
+ n < max)
+ storage[n++] = system_charset;
+
+ if (allow_charset_switching)
+ terminal_can_switch(terminal_type,storage,&n,max);
+ storage[n] = NULL;
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "Possible sets:"));
+ for (i = 0; i < n; i++) {
+ SIGDPRINT(Debug,4,(&Debug,
+ " %s%c",
+ storage[i]->MIME_name ? storage[i]->MIME_name :
+ "<no MIME name>",
+ i < n-1 ? ',' : '\n'));
+ }
+
+ return storage;
+ }
+
+
+ int set_display_charset(set,silent)
+ charset_t set;
+ int silent;
+ {
+ if (!terminal_can_switch_to(terminal_type,set,silent))
+ return 0;
+
+ target_display_charset = set;
+ switch_display_charset(1);


+ return 1;
+ }
+

+ void switch_display_charset(to_display)
+ int to_display;
+ {
+ char buffer[256];
+
+ charset_t t;
+ char * str;
+
+ if (!target_display_charset)
+ target_display_charset = display_charset;
+
+
+ if (!last_display_state)
+ last_display_state = create_terminal_info();
+
+
+ t = to_display ? target_display_charset : system_charset;
+
+ if (!t) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "switch_display_charset: target charset is NULL\n"));
+ return;
+ }
+
+ str = terminal_switch_to(terminal_type,t,&last_display_state,
+ buffer, sizeof buffer);
+
+ if (str) {
+ int i;
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "Setting display charset to %s (",
+ t->MIME_name ? t->MIME_name : "<no MIME name>"));
+ for (i = 0; str[i]; i++) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "%s%02X",
+ i ? " " : "", str[i]));
+ }
+ SIGDPRINT(Debug,4,(&Debug,
+ ") [terminal %s]\n",terminal_type));
+
+ for (i = 0; str[i]; i++) {
+ outchar(str[i]);
+ }
+
+ display_charset = t;
+
+ } else {
+ SIGDPRINT(Debug,4,(&Debug,
+ "No way to set terminal %s to charset %s\n",
+ terminal_type,
+ t->MIME_name ? t->MIME_name : "<no MIME name>"));
+
+ }
+ }
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.108-cvs/src/screen/termtitle.c
*** /tmp/4773-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-10-12 12:40:39.000000000 +0300
--- elm2.4.ME+.108-cvs/src/screen/termtitle.c 2003-10-01 20:34:35.000000000 +0300
***************
*** 0 ****
--- 1,158 ----
+ static char rcsid[] = "@(#)$Id: termtitle.c,v 1.2 2003/10/01 17:34:35 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

+ *****************************************************************************/
+
+ #include "def_screen.h"
+ #include "s_elm.h"
+
+ #include <errno.h>
+
+ DEBUG_VAR(Debug,__FILE__,"elmpage");
+
+
+ static char * title_string = NULL; /* Malloced */
+ static char * icon_string = NULL;
+
+ static char * title_quit_string = NULL;
+ static char * icon_quit_string = NULL;
+
+ static CONST char ELM_EXITING[] = "Elm: exiting";
+
+ static char * title_suspended_string = NULL;
+ static char * icon_suspended_string = NULL;
+
+ static CONST char ELM_SUSPENDED[] = "Elm: suspended";
+
+ int set_terminal_titles(title,icon)
+ char *title;
+ char *icon;
+ {
+
+ /* These are not set when setting terminal to non-raw mode ..
+ but instead only when exiting or suspended (winth ctrl-Z) */
+ if(!title_quit_string)
+ title_quit_string = catgets(elm_msg_cat, ElmSet, ElmTitleQuit,
+ ELM_EXITING);
+ if (!icon_quit_string)
+ icon_quit_string = catgets(elm_msg_cat, ElmSet, ElmIconQuit,
+ ELM_EXITING);
+
+ if(!title_suspended_string)
+ title_suspended_string = catgets(elm_msg_cat, ElmSet, ElmTitleSusp,
+ ELM_SUSPENDED);
+ if (!icon_suspended_string)
+ icon_suspended_string = catgets(elm_msg_cat, ElmSet, ElmIconSusp,
+ ELM_SUSPENDED);
+
+
+ DPRINT(Debug,8,(&Debug,
+ "Terminal (%s) title=%s icon=%s\n",
+ terminal_type,
+ title ? title : "<UNCHANGED>",
+ icon ? icon : "<UNCHANGED>"));
+
+ if (RawState()) {
+ char *str = terminal_set_title(terminal_type,title,icon, NULL,0);
+ int i;
+
+ if (!str) {
+ DPRINT(Debug,4,(&Debug,
+ "Can't set terminal %s titles to %s and %s\n",
+ terminal_type,
+ title ? title : "<NULL>",
+ icon ? icon : "<NULL>"));
+ return 0;
+ }
+
+ DPRINT(Debug,4,(&Debug,
+ "Setting terminal title ("));
+ for (i = 0; str[i]; i++) {
+ DPRINT(Debug,4,(&Debug,
+ "%s%02X",
+ i ? " " : "", str[i]));
+ }
+ DPRINT(Debug,4,(&Debug,
+ ") [terminal %s]\n",terminal_type));
+
+ for (i = 0; str[i]; i++) {
+ outchar(str[i]);
+ }
+
+ }
+
+ if (title)
+ title_string = strmcpy(title_string,title);
+ if (icon)
+ icon_string = strmcpy(title_string,title);
+

+
+ return 1;
+ }
+

+ /* May be called from signal handler
+ to_display = 0 -- suspended
+ = 1 -- as set
+ = 2 -- exiting
+ */
+
+ void switch_title(to_display)
+ int to_display;
+ {
+ char buffer[1024];
+
+ char * str = NULL;
+
+
+ switch (to_display) {
+ case 0:
+ str = terminal_set_title(terminal_type,
+ title_suspended_string,
+ icon_suspended_string,
+ buffer, sizeof buffer);
+ break;
+ case 1:
+ str = terminal_set_title(terminal_type,
+ title_string,
+ icon_string,
+ buffer, sizeof buffer);
+ break;
+ case 2:
+ str = terminal_set_title(terminal_type,
+ title_quit_string,
+ icon_quit_string,
+ buffer, sizeof buffer);


+ break;
+ }
+
+

+ if (str) {
+ int i;
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "Setting terminal title ("));
+ for (i = 0; str[i]; i++) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "%s%02X",
+ i ? " " : "", str[i]));
+ }
+ SIGDPRINT(Debug,4,(&Debug,
+ ") [terminal %s]\n",terminal_type));
+
+ for (i = 0; str[i]; i++) {
+ outchar(str[i]);


+ }
+
+ }
+ }
+

+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.108-cvs/src/showmsg.c
*** elm2.4.ME+.107/src/showmsg.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/showmsg.c 2003-10-11 11:42:11.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.27 2003/07/29 18:46:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.28 2003/10/11 08:42:11 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 131,139 ****
--- 131,153 ----
structure);

if (cmd) {
+
+ char ** trusted_programs =
+ give_dt_path_as_elems(&internal_mailcap_t_programs,
+ "internal-mailcap-trusted-programs");
+
+ int IS_OK = 0;
+
int i;
char *x;

+ if (trusted_programs) {
+ for (i = 0; trusted_programs[i]; i++) {
+ if (0 == strcmp(cmd,
+ trusted_programs[i]))
+ IS_OK++;
+ }
+ }
*list = safe_realloc(*list,
sizeof ((*list)[0]) * (*list_len +1));

***************
*** 152,157 ****
--- 166,176 ----
(*list)[*list_len].printable_command = cmd;
(*list)[*list_len].selected = 0;
(*list)[*list_len].col = elm_COLUMNS-7;
+
+ if (IS_OK) {
+ (*list)[*list_len].selected = 1;
+ (*list)[*list_len].structure->handler_data->use_entry = 1;
+ }

i = (*list_len)++;

***************
*** 205,210 ****
--- 224,230 ----
int list_len = 0;
int offset = 0;

+
update_prompt(&list,&list_len,&offset,-1);

prompt_programs_1(structure,&list,&list_len,&offset);
***************
*** 213,220 ****
--- 233,251 ----
int q = 0;
int ch;

+ /* Check if all programs was trusted ... */
+
+ while (q < list_len &&
+ list[q].selected &&
+ list[q].structure &&
+ list[q].structure->handler_data &&
+ list[q].structure->handler_data->use_entry)
+ q++;

r = FALSE;
+ if (q >= list_len && !internal_mailcap_t_prompt)
+ goto out;
+
PutLineX(elm_LINES-1,1,
CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,
"Answer questions, use m)etamail or q)uit menu: "));
***************
*** 364,369 ****
--- 395,402 ----
} while(ch);
}

+
+ out:
failure:

if (list) {
Index: elm2.4.ME+.108-cvs/src/syscall.c
*** elm2.4.ME+.107/src/syscall.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108-cvs/src/syscall.c 2003-10-01 20:34:34.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.26 2003/08/04 14:58:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.27 2003/10/01 17:34:34 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 360,366 ****
mailbox);

redraw2:
! SetXYLocation(0, 40); /* a location not near the next request, so an absolute is used */
PutLineX(elm_LINES, 0,
CATGETS(elm_msg_cat, ElmSet,
ElmPressAnyKeyToReturn,
--- 360,366 ----
mailbox);

redraw2:
! InvalidateLocation(); /* a location not near the next request, so an absolute is used */
PutLineX(elm_LINES, 0,
CATGETS(elm_msg_cat, ElmSet,
ElmPressAnyKeyToReturn,
Index: elm2.4.ME+.108-cvs/utils/Makefile.SH
*** elm2.4.ME+.107/utils/Makefile.SH 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.108-cvs/utils/Makefile.SH 2003-10-01 20:34:36.000000000 +0300


***************
*** 16,22 ****
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.31 2003/05/25 17:29:02 hurtta Exp $
#
# Makefile for the Elm system utilities
#
--- 16,22 ----
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.32 2003/10/01 17:34:36 hurtta Exp $


#
# Makefile for the Elm system utilities
#
***************

*** 373,383 ****
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elmutil.h: $(INCLDIR)/elm_curses.h $(INCLDIR)/defs.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/elm_curses.h $(INCLDIR)/defs.h
$(CHMOD) u+w $@
$(TOUCH) $@

--- 373,383 ----
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elmutil.h: $(INCLDIR)/defs.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h
$(CHMOD) u+w $@
$(TOUCH) $@

Kari E. Hurtta

unread,
Oct 22, 2003, 2:32:47 PM10/22/03
to
Archive-name: elm2.4ME+/PL108a

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

file elm-2.4ME+PL108a.patch.gz


Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL108a.patch.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL108a.patch.gz >

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL108a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)


Changes of Elm2.4ME+ PL108a (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

[ This is out of branch patch. ]

SUMMARY: This patch makes some fixes for elmregister,
and elm's search command ('/').

- elmregister was not fixing protections on
replay phase

- 'sh Configure -cfile' was not working, only
'sh Configure -c file' read 'file'.

- "I type in the same text string to search again, it goes
to the next matched line, but the surrounding lines are
from the original match hit (the screen is not being
updated)." ( about / -command)
Problem noted by: From: Bruce Momjian <ro...@candle.pha.pa.us>

- "The pgp message "[End of raw data]" is confused
as a file inclusion when it appears in a reply.
The following patch changes the message to
"[ End of raw data]", which doesn't get confused."
From: Bruce Momjian <ro...@candle.pha.pa.us>
[ Patch little modified. ]

- "With older elm versions, using '/', it remembered the
old search string, so I could do '/', <ENTER> to find
the next occurance of a single string. The new code
doesn't do that."
Reported by: Bruce Momjian <ro...@candle.pha.pa.us>
> Returned variables to static (and avoiding freeing
them on end of function)

- Moved most of informative messages of elmregister from
stderr to stdout.


Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL108 (25) --------------------------------

For apply patch use command
patch -p1 < {path...}/this-file
on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Index: elm2.4.ME+.108a-cvs/hdrs/patchlevel.h
Prereq: 1097000000
*** elm2.4.ME+.108/hdrs/patchlevel.h 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.108a-cvs/hdrs/patchlevel.h 2003-10-22 19:55:23.000000000 +0300
***************
*** 1,8 ****


! #define PATCHLEVEL "108 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.108
*/
! #define LAST_REPORT_TIME 1097000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

#define VERS_DATE "Oct, 2003" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "108a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.108
*/
! #define LAST_REPORT_TIME 1098000000


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

#define VERS_DATE "Oct, 2003" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.108a-cvs/README.ME+
*** elm2.4.ME+.108/README.ME+ 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.108a-cvs/README.ME+ 2003-10-22 20:51:47.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.654 2003/10/12 08:47:40 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.664 2003/10/22 17:51:47 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,18 ****
--- 13,56 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL108a (25) compared with Elm2.4ME+ PL108 (25)
+ ------------------------------------------------------------------
+
+ [ This is out of branch patch. ]
+
+ SUMMARY: This patch makes some fixes for elmregister,
+ and elm's search command ('/').
+
+ - elmregister was not fixing protections on
+ replay phase
+
+ - 'sh Configure -cfile' was not working, only
+ 'sh Configure -c file' read 'file'.
+
+ - "I type in the same text string to search again, it goes
+ to the next matched line, but the surrounding lines are
+ from the original match hit (the screen is not being
+ updated)." ( about / -command)
+ Problem noted by: From: Bruce Momjian <ro...@candle.pha.pa.us>
+
+ - "The pgp message "[End of raw data]" is confused
+ as a file inclusion when it appears in a reply.
+ The following patch changes the message to
+ "[ End of raw data]", which doesn't get confused."
+ From: Bruce Momjian <ro...@candle.pha.pa.us>
+ [ Patch little modified. ]
+
+ - "With older elm versions, using '/', it remembered the
+ old search string, so I could do '/', <ENTER> to find
+ the next occurance of a single string. The new code
+ doesn't do that."
+ Reported by: Bruce Momjian <ro...@candle.pha.pa.us>
+ > Returned variables to static (and avoiding freeing
+ them on end of function)
+
+ - Moved most of informative messages of elmregister from
+ stderr to stdout.


+
Changes of Elm2.4ME+ PL108 (25) compared with Elm2.4ME+ PL107 (25)

------------------------------------------------------------------

***************
*** 67,76 ****


treated with lower priority than normal entries. So they

normally do not match if there is more specific entry.

! - Avoid divizion be zero when opening non existing
(or empty?) mailbox.
From: Darren Reed <ava...@caligula.anu.edu.au>
! ( Divizion by zero seems not be visible on all systems. )

New elmrc options:
internal-mailcap-trusted-programs
--- 105,114 ----


treated with lower priority than normal entries. So they

normally do not match if there is more specific entry.

! - Avoid division be zero when opening non existing
(or empty?) mailbox.
From: Darren Reed <ava...@caligula.anu.edu.au>
! ( Division by zero seems not be visible on all systems. )

New elmrc options:
internal-mailcap-trusted-programs
***************
*** 93,98 ****
--- 131,138 ----


Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)

------------------------------------------------------------------



+ [ This is out of branch patch. ]

+
SUMMARY: This patch corrects page when returning

from o)ptions screen and fixes some other

minor bugs.
***************
*** 2227,2232 ****
--- 2267,2274 ----
Changes of Elm2.4ME+ PL97a (25) compared with Elm2.4ME+ PL97 (25)
----------------------------------------------------------------



+ [ This is out of branch patch. ]
+

- Fix state_printf panic "Embedded newlines are not supported"
on case when there is on ~/.elm/elmheaders
`backticked` command which produces output which does not
***************
*** 2584,2589 ****
--- 2626,2633 ----
Changes of Elm2.4ME+ PL95c (25) compared with Elm2.4ME+ PL95b (25)
------------------------------------------------------------------



+ [ This is out of branch patch. ]
+

- Do not use commands "mail" or "mailx" as mailer.
- Allow specify "none" as mailer on configuration time
(that requires that mailer is given on global elm.rc
Index: elm2.4.ME+.108a-cvs/Configure
*** elm2.4.ME+.108/Configure 2003-08-16 09:58:21.000000000 +0300
--- elm2.4.ME+.108a-cvs/Configure 2003-10-19 18:09:58.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.148 2003/08/15 20:03:45 hurtta Exp $


#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.149 2003/10/19 15:09:58 hurtta Exp $
#

: sanity checks
***************
*** 86,92 ****
echo "Extra library suffix: $libsuffix"
;;
-c*)
! config="`expr \"$1\" : '-s\(.*\)'`"
shift
case "$config" in
"")
--- 86,92 ----
echo "Extra library suffix: $libsuffix"
;;
-c*)
! config="`expr \"$1\" : '-c\(.*\)'`"
shift
case "$config" in
"")
Index: elm2.4.ME+.108a-cvs/melib/pgp_decode.c
*** elm2.4.ME+.108/melib/pgp_decode.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108a-cvs/melib/pgp_decode.c 2003-10-20 19:41:09.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.33 2003/08/04 14:58:57 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.34 2003/10/20 16:41:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 816,826 ****
if (was_binary)
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpInternalSkipping,
! "[Internal error while calling pgp, skipping...]\n"));
else {
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpInternalRawdata,
! "[Internal error while calling pgp, raw data follows]\n"));

fail:

--- 816,826 ----
if (was_binary)
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpInternalSkipping,
! "[ Internal error while calling pgp, skipping... ]\n"));
else {
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpInternalRawdata,
! "[ Internal error while calling pgp, raw data follows ]\n"));

fail:

***************
*** 842,848 ****

state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpRawEnd,
! "[End of raw data]\n"));
}
return;
}
--- 842,848 ----

state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpRawEnd,
! "[ End of raw data. ]\n"));
}
return;
}
Index: elm2.4.ME+.108a-cvs/nls/C/C/C/s_me.m
*** elm2.4.ME+.108/nls/C/C/C/s_me.m 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.108a-cvs/nls/C/C/C/s_me.m 2003-10-20 19:41:09.000000000 +0300
***************
*** 120,126 ****
$ #PgpBefore
63 [ There is text before PGP section. ]\n
$ #PgpRawEnd
! 64 [End of raw data]\n
$ #FailedSeekEnvelope
65 Failed to seek beginning of mail envelope (%ld)
$ #FailedSeekHeaders
--- 120,126 ----
$ #PgpBefore
63 [ There is text before PGP section. ]\n
$ #PgpRawEnd
! 64 [ End of raw data. ]\n
$ #FailedSeekEnvelope
65 Failed to seek beginning of mail envelope (%ld)
$ #FailedSeekHeaders
Index: elm2.4.ME+.108a-cvs/src/elm.c
*** elm2.4.ME+.108/src/elm.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.108a-cvs/src/elm.c 2003-10-19 17:38:00.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elm.c,v 1.57 2003/09/14 16:35:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.58 2003/10/19 14:38:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.58 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 775,780 ****
--- 775,781 ----

ViewDigest(mailbox);

+ current = get_current(mailbox);
(void)get_page(current, mailbox);
(*redraw)++;

***************
*** 1151,1156 ****
--- 1152,1158 ----

ViewPartial(current_mailbox);

+ current = get_current(current_mailbox);
(void)get_page(current, current_mailbox);
redraw++;

***************
*** 1683,1690 ****
* commands to a function. */

int i;
! int current = ifmain(get_current((mailbox)),
! alias_current);

#define SET_CURRENT(x) { if (inalias) alias_current = (x); \
else set_current((mailbox),(x)); }
--- 1685,1693 ----
* commands to a function. */

int i;
! #define GET_CURRENT ifmain(get_current((mailbox)), alias_current)
!
! int current = GET_CURRENT;

#define SET_CURRENT(x) { if (inalias) alias_current = (x); \
else set_current((mailbox),(x)); }
***************
*** 1717,1725 ****

}

! if (x)
nucurr = get_page(current, (mailbox));
! else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmPatternNotFound,
"pattern not found!"));
--- 1720,1729 ----

}

! if (x) {
! current = GET_CURRENT;
nucurr = get_page(current, (mailbox));
! } else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmPatternNotFound,
"pattern not found!"));
***************
*** 1948,1955 ****
items);
clear_error();
if (limit((mailbox)) != 0) {
! get_page(current, (mailbox));
! (*redraw)++;
} else {
(*nufoot)++;
}
--- 1952,1960 ----
items);
clear_error();
if (limit((mailbox)) != 0) {
! current = GET_CURRENT;
! get_page(current, (mailbox));
! (*redraw)++;
} else {
(*nufoot)++;
}
Index: elm2.4.ME+.108a-cvs/src/pattern.c
*** elm2.4.ME+.108/src/pattern.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.108a-cvs/src/pattern.c 2003-10-20 20:16:25.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pattern.c,v 1.25 2003/09/03 09:16:30 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pattern.c,v 1.26 2003/10/20 17:16:25 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************

***************
*** 275,288 ****

int i;

! struct string * pattern = NULL;
! struct string * alt_pattern = NULL;
int ret = 0 ;

int anywhere = FALSE;
int matched;


struct string * buffer = NULL;

struct string *buffer1 = NULL;
int val;

buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
--- 275,295 ----

int i;

! /* Elm 2.4 remebers old entered patterns, so we need to keep
! that static. This leaks these malloced areas on end of program */
!
! static struct string * pattern = NULL;
! static struct string * alt_pattern = NULL;
int ret = 0 ;

int anywhere = FALSE;
int matched;


struct string * buffer = NULL;

struct string *buffer1 = NULL;
+
+ struct string * SEARCH = NULL; /* SHARED: point either to
+ pattern or alt_pattern */
+
int val;

buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
***************
*** 322,329 ****
}

anywhere = TRUE;
! pattern = alt_pattern;
! alt_pattern = NULL;
}

if (0 == val) {
--- 329,335 ----
}

anywhere = TRUE;
! SEARCH = alt_pattern;
}

if (0 == val) {
***************
*** 332,346 ****
ret = 0;
goto out;
}
}

! if (pattern) {
if (inalias) {
for (i = alias_current; i < alias_message_count; i++) {
! matched = name_matches(i, pattern) || alias_matches(i, pattern);
if (! matched && anywhere) { /* Look only if no match yet */
! matched = comment_matches(i, pattern) ||
! address_matches(i, pattern);
}
if (matched) {
if (!alias_selected ||
--- 338,355 ----
ret = 0;
goto out;
}
+
+ anywhere = FALSE;
+ SEARCH = pattern;
}

! if (SEARCH) {
if (inalias) {
for (i = alias_current; i < alias_message_count; i++) {
! matched = name_matches(i, SEARCH) || alias_matches(i, SEARCH);
if (! matched && anywhere) { /* Look only if no match yet */
! matched = comment_matches(i, SEARCH) ||
! address_matches(i, SEARCH);
}
if (matched) {
if (!alias_selected ||
***************
*** 354,360 ****
}
else {
if (anywhere) {
! ret = match_in_message(pattern, mailbox);
}
else {
int current = get_current(mailbox);
--- 363,369 ----
}
else {
if (anywhere) {
! ret = match_in_message(SEARCH, mailbox);
}
else {
int current = get_current(mailbox);
***************
*** 364,371 ****
for (i = current; i < mc; i++) {
struct header_rec *hdr = give_header(mailbox,i);

! if (hdr && (from_matches(hdr, pattern) ||
! subject_matches(hdr, pattern))) {
if (!selected || (selected &&
hdr->status & VISIBLE)) {
current = ++i;
--- 373,380 ----
for (i = current; i < mc; i++) {
struct header_rec *hdr = give_header(mailbox,i);

! if (hdr && (from_matches(hdr, SEARCH) ||
! subject_matches(hdr, SEARCH))) {
if (!selected || (selected &&
hdr->status & VISIBLE)) {
current = ++i;
***************
*** 380,396 ****
}

out:
- if (pattern)
- free_string(&pattern);
- if (alt_pattern)
- free_string(&alt_pattern);
- if (buffer)
- free_string(&buffer);
- if (buffer1)
- free_string(&buffer1);
-

! return(ret);
}

int from_matches(mss, pattern)
--- 389,408 ----
}

out:

! /* NOTE:
! We do not free pattern and alt_pattern -- they are static
! and should have remembered, so that behauviour matches
! to Elm 2.4
! */
!
! if (buffer)
! free_string(&buffer);
! if (buffer1)
! free_string(&buffer1);
!
!
! return(ret);
}

int from_matches(mss, pattern)
Index: elm2.4.ME+.108a-cvs/utils/elmregister.c
*** elm2.4.ME+.108/utils/elmregister.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.108a-cvs/utils/elmregister.c 2003-10-21 22:05:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.9 2003/05/26 15:19:04 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.13 2003/10/21 19:05:44 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 110,115 ****
--- 110,117 ----
}
command = argv[x];

+ fflush(stdout);
+
pid = fork(); /* BRANCH child process */

if (0 == pid) {
***************
*** 136,142 ****

close(filedes[0]); /* read end */

! fprintf(stderr,"%s: Running %s ...\n",
program_name,command);

execvp(command,argv+x);
--- 138,144 ----

close(filedes[0]); /* read end */

! fprintf(stdout,"%s: Running %s ...\n",
program_name,command);

execvp(command,argv+x);
***************
*** 183,189 ****
*x = '\0';

if (0 == mkdir(Z,0755)) {
! fprintf(stderr,
"%s: parent directory %s created (of %s)\n",
program_name,Z,y);
}
--- 185,191 ----
*x = '\0';

if (0 == mkdir(Z,0755)) {
! fprintf(stdout,
"%s: parent directory %s created (of %s)\n",
program_name,Z,y);
}
***************
*** 311,317 ****
add_bytes(F,buffer1,&ptr);

if (buffer1[0] != c) {
! fprintf(stderr,"%s: Character %c not buffered (readinf from pipe or file)\n",
program_name,c);
exit(1);
}
--- 313,319 ----
add_bytes(F,buffer1,&ptr);

if (buffer1[0] != c) {
! fprintf(stderr,"%s: Character %c not buffered (reading from pipe or file)\n",
program_name,c);
exit(1);
}
***************
*** 809,815 ****

if (!y) {
y++;
! fprintf(stderr,
"%s: Trimming unlinked files from %s\n",
program_name,target->filename);
}
--- 811,817 ----

if (!y) {
y++;
! fprintf(stdout,
"%s: Trimming unlinked files from %s\n",
program_name,target->filename);
}
***************
*** 830,836 ****
&count);

if (count > 0) {
! fprintf(stderr,
"%s: (%s) File %s is removed -- removing from log\n",
program_name,translated,ptr2->arg_ptrs[j]);
*remove_count += count;
--- 832,838 ----
&count);

if (count > 0) {
! fprintf(stdout,
"%s: (%s) File %s is removed -- removing from log\n",
program_name,translated,ptr2->arg_ptrs[j]);
*remove_count += count;
***************
*** 877,883 ****
return;
}

! fprintf(stderr,"%s: Rewriting %s\n",program_name,target->filename);

for (i = 0; i < target->entries_count; i++) {
char buffer[ MAX_PIPE_LOG];
--- 879,885 ----
return;
}

! fprintf(stdout,"%s: Rewriting %s\n",program_name,target->filename);

for (i = 0; i < target->entries_count; i++) {
char buffer[ MAX_PIPE_LOG];
***************
*** 1009,1015 ****
#ifdef S_ISDIR
! S_ISDIR(X.st_mode)
#else
! S_IFDIR != (buf.st_mode & S_IFMT)
#endif
) {
fprintf(stderr,"%s: -R %s invalid (not a directory)\n",
--- 1011,1017 ----
#ifdef S_ISDIR
! S_ISDIR(X.st_mode)
#else
! S_IFDIR != (X.st_mode & S_IFMT)
#endif
) {
fprintf(stderr,"%s: -R %s invalid (not a directory)\n",
***************
*** 1056,1062 ****
make_package_dir(Z,installer_root);

if (0 == mkdir(Z,0755)) {
! fprintf(stderr,


"%s: Directory %s created\n",

program_name,Z);
} else if (errno != EEXIST) {
--- 1058,1064 ----
make_package_dir(Z,installer_root);

if (0 == mkdir(Z,0755)) {
! fprintf(stdout,


"%s: Directory %s created\n",

program_name,Z);
} else if (errno != EEXIST) {
***************
*** 1080,1086 ****

}

! fprintf(stderr,"%s: Creating %s\n",program_name,LI.filename);

LI.file = fdopen(t,"r+");
if (! LI.file) {
--- 1082,1088 ----

}

! fprintf(stdout,"%s: Creating %s\n",program_name,LI.filename);

LI.file = fdopen(t,"r+");
if (! LI.file) {
***************
*** 1370,1376 ****
}


! fprintf(stderr,"%s: File %s installed\n",program_name,target);

fclose(S);
free(tempname);
--- 1372,1378 ----
}


! fprintf(stdout,"%s: File %s installed\n",program_name,target);

fclose(S);
free(tempname);
***************
*** 1418,1430 ****
exit(1); /* FAILURE */
}

! fprintf(stderr,
"%s: Copying directory %s -> %s:\n",


program_name,src,trg);

if (0 == mkdir(trg,0755)) {

! fprintf(stderr,


"%s: Directory %s created\n",

program_name,trg);
} else if (errno != EEXIST) {
--- 1420,1432 ----
exit(1); /* FAILURE */
}

! fprintf(stdout,
"%s: Copying directory %s -> %s:\n",


program_name,src,trg);

if (0 == mkdir(trg,0755)) {

! fprintf(stdout,


"%s: Directory %s created\n",

program_name,trg);
} else if (errno != EEXIST) {
***************
*** 1643,1648 ****
--- 1645,1651 ----
exit(1); /* FAILURE */
}

+ fflush(stdout);
pid = fork();

if (-1 == pid) {
***************
*** 1660,1669 ****

*x = '\0';

! fprintf(stderr,
"%s: Copying %s to %s(/%s) with %s -r\n",
program_name,src,trg,x+1,ELMREGISTER_CP);
! fflush(stderr);

execlp(ELMREGISTER_CP,ELMREGISTER_CP,"-r",
src,trg,NULL);
--- 1663,1672 ----

*x = '\0';

! fprintf(stdout,
"%s: Copying %s to %s(/%s) with %s -r\n",
program_name,src,trg,x+1,ELMREGISTER_CP);
! fflush(stdout);

execlp(ELMREGISTER_CP,ELMREGISTER_CP,"-r",
src,trg,NULL);
***************
*** 1919,1925 ****
strncpy(X,rel_path,l+2);
X[l] = '/';

! fprintf(stderr,"%s: Adding / to -R %s: %s\n",
argv[0],rel_path,X);
rel_path = X;
}
--- 1922,1928 ----
strncpy(X,rel_path,l+2);
X[l] = '/';

! fprintf(stdout,"%s: Adding / to -R %s: %s\n",
argv[0],rel_path,X);
rel_path = X;
}
***************
*** 1974,1980 ****

for (j = 0; j < i; j++) {
if (0 == unlink(translated[j])) {
! fprintf(stderr,
"%s: File %s removed\n",
program_name,translated[j]);
}
--- 1977,1983 ----

for (j = 0; j < i; j++) {
if (0 == unlink(translated[j])) {
! fprintf(stdout,
"%s: File %s removed\n",
program_name,translated[j]);
}
***************
*** 2064,2070 ****
goto fail3;
}

! fprintf(stderr,"%s: Link %s installed\n",program_name,translated[1]);


ptr = buffer;
--- 2067,2073 ----
goto fail3;
}

! fprintf(stdout,"%s: Link %s installed\n",program_name,translated[1]);


ptr = buffer;
***************
*** 2245,2251 ****
r = chown(target_f,id_user,id_group);
}

! fprintf(stderr,
"%s: Directory %s created%s\n",
program_name,target_f,
r == -1 ? " (failed to set owner)" : "");
--- 2248,2254 ----
r = chown(target_f,id_user,id_group);
}

! fprintf(stdout,
"%s: Directory %s created%s\n",
program_name,target_f,
r == -1 ? " (failed to set owner)" : "");
***************
*** 2453,2459 ****
if (ptr->group_ptr && 0 != strcmp(ptr->group_ptr,"-")) {
g = getgrnam(ptr->group_ptr);

! if (!p)
fprintf(stderr,
"%s: [pick_one] '%c' Group %s not found\n",
program_name,ptr->command_letter,
--- 2456,2462 ----
if (ptr->group_ptr && 0 != strcmp(ptr->group_ptr,"-")) {
g = getgrnam(ptr->group_ptr);

! if (!g)
fprintf(stderr,
"%s: [pick_one] '%c' Group %s not found\n",
program_name,ptr->command_letter,
***************
*** 2589,2595 ****
char * translated = make_absolute(ptr,ptr->arg_ptrs[i]);

if (0 == unlink(translated)) {
! fprintf(stderr,
"%s: File %s removed\n",
program_name,translated);
}
--- 2592,2598 ----
char * translated = make_absolute(ptr,ptr->arg_ptrs[i]);

if (0 == unlink(translated)) {
! fprintf(stdout,
"%s: File %s removed\n",
program_name,translated);
}
***************
*** 2612,2618 ****
break;

case 'C':
! fprintf(stderr,
"%s: Config file %s (%s) not copied\n",
program_name,ptr->arg_ptrs[0],src);
break;
--- 2615,2621 ----
break;

case 'C':
! fprintf(stdout,
"%s: Config file %s (%s) not copied\n",
program_name,ptr->arg_ptrs[0],src);
break;
***************
*** 2644,2650 ****
goto fail3;
}

! fprintf(stderr,"%s: Link %s installed\n",program_name,file2);

/* NOTE: NULLs buffer and arg_ptrs from ptr */
move_record(target,last,ptr);
--- 2647,2653 ----
goto fail3;
}

! fprintf(stdout,"%s: Link %s installed\n",program_name,file2);

/* NOTE: NULLs buffer and arg_ptrs from ptr */
move_record(target,last,ptr);
***************
*** 2684,2690 ****
if (0 == mkdir(trg,mode)) {
int r = chown(trg,id_user,id_group);

! fprintf(stderr,
"%s: Directory %s created%s\n",
program_name,trg,
r == -1 ? " (failed to set owner)" : "");
--- 2687,2693 ----
if (0 == mkdir(trg,mode)) {
int r = chown(trg,id_user,id_group);

! fprintf(r == -1 ? stderr : stdout,
"%s: Directory %s created%s\n",
program_name,trg,
r == -1 ? " (failed to set owner)" : "");
***************
*** 2853,2859 ****

if (!on_current(source,ptr->arg_ptrs[1])) {
if ('M' != ptr->command_letter)
! fprintf(stderr,


"%s: (%s) Keeping link %s from old version (was %s)\n",
program_name,source->filename,ptr->arg_ptrs[1],

ptr->arg_ptrs[0]
--- 2856,2862 ----

if (!on_current(source,ptr->arg_ptrs[1])) {
if ('M' != ptr->command_letter)
! fprintf(stdout,


"%s: (%s) Keeping link %s from old version (was %s)\n",
program_name,source->filename,ptr->arg_ptrs[1],

ptr->arg_ptrs[0]
***************
*** 2873,2879 ****

if (!on_current(source,ptr->arg_ptrs[0])) {
if ('M' != ptr->command_letter)
! fprintf(stderr,
"%s: (%s) Keeping file %s is from old version\n",
program_name,source->filename,ptr->arg_ptrs[0]);
continue;
--- 2876,2882 ----

if (!on_current(source,ptr->arg_ptrs[0])) {
if ('M' != ptr->command_letter)
! fprintf(stdout,
"%s: (%s) Keeping file %s is from old version\n",
program_name,source->filename,ptr->arg_ptrs[0]);
continue;
***************
*** 2952,2958 ****
) {

if (0 == rmdir(ab)) {
! fprintf(stderr,
"%s: Stage directory %s uninstalled\n",
program_name,ab);
ok = 1;
--- 2955,2961 ----
) {

if (0 == rmdir(ab)) {
! fprintf(stdout,
"%s: Stage directory %s uninstalled\n",
program_name,ab);
ok = 1;
***************
*** 2960,2966 ****
} else {

if (0 == unlink(ab)) {
! fprintf(stderr,
"%s: Stage file %s uninstalled\n",
program_name,ab);
ok = 1;
--- 2963,2969 ----
} else {

if (0 == unlink(ab)) {
! fprintf(stdout,
"%s: Stage file %s uninstalled\n",
program_name,ab);
ok = 1;
***************
*** 2973,2979 ****
}

} else {
! fprintf(stderr,
"%s: Ignoring entry %s -- not in stage area (%s)\n",
program_name,ab,stage_dir);
ok = 1; /* JUST CLEAN */
--- 2976,2982 ----
}

} else {
! fprintf(stdout,
"%s: Ignoring entry %s -- not in stage area (%s)\n",
program_name,ab,stage_dir);
ok = 1; /* JUST CLEAN */
***************
*** 3033,3039 ****
char *ab = make_absolute(ptr,ptr->arg_ptrs[1]);

if (0 == unlink(ab)) {
! fprintf(stderr,
"%s: Link %s uninstalled\n",
program_name,ab);
ok = 1;
--- 3036,3042 ----
char *ab = make_absolute(ptr,ptr->arg_ptrs[1]);

if (0 == unlink(ab)) {
! fprintf(stdout,
"%s: Link %s uninstalled\n",
program_name,ab);
ok = 1;
***************
*** 3057,3063 ****
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

if (0 == rmdir(ab)) {
! fprintf(stderr,
"%s: Directory %s uninstalled\n",
program_name,ab);
ok = 1;
--- 3060,3066 ----
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

if (0 == rmdir(ab)) {
! fprintf(stdout,
"%s: Directory %s uninstalled\n",
program_name,ab);
ok = 1;
***************
*** 3080,3093 ****
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

if (0 == unlink(ab)) {
! fprintf(stderr,
"%s: File %s uninstalled\n",
program_name,ab);
ok = 1;
} else if (ENOENT == errno)
ok = 1;
else {
! fprintf(stderr,
"%s: Can't unlink %s\n",
program_name,ab);
exit_stat = 1;
--- 3083,3096 ----
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

if (0 == unlink(ab)) {
! fprintf(stdout,
"%s: File %s uninstalled\n",
program_name,ab);
ok = 1;
} else if (ENOENT == errno)
ok = 1;
else {
! fprintf(stdout,
"%s: Can't unlink %s\n",
program_name,ab);
exit_stat = 1;
***************
*** 3103,3116 ****
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

if (0 == unlink(ab)) {
! fprintf(stderr,
"%s: Config file %s uninstalled\n",
program_name,ab);
ok = 1;
} else if (ENOENT == errno)
ok = 1;
else {
! fprintf(stderr,
"%s: Can't unlink %s\n",
program_name,ab);
exit_stat = 1;
--- 3106,3119 ----
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

if (0 == unlink(ab)) {
! fprintf(stdout,
"%s: Config file %s uninstalled\n",
program_name,ab);
ok = 1;
} else if (ENOENT == errno)
ok = 1;
else {
! fprintf(stdout,
"%s: Can't unlink %s\n",
program_name,ab);
exit_stat = 1;
***************
*** 3320,3337 ****
}
translated[i] = NULL;

! fprintf(stderr,
"%s: Executing",program_name);
for (j = 0; j < i; j++)
! fprintf(stderr," %s",
ptr->arg_ptrs[j]);
! fprintf(stderr,
"\n%s: As",program_name);
for (j = 0; j < i; j++)
! fprintf(stderr," %s",
translated[j]);
! fprintf(stderr,"\n");
! fflush(stderr);

pipefd = create_pipe(i,translated,0,&pid,"/");

--- 3323,3340 ----
}
translated[i] = NULL;

! fprintf(stdout,
"%s: Executing",program_name);
for (j = 0; j < i; j++)
! fprintf(stdout," %s",
ptr->arg_ptrs[j]);
! fprintf(stdout,
"\n%s: As",program_name);
for (j = 0; j < i; j++)
! fprintf(stdout," %s",
translated[j]);
! fprintf(stdout,"\n");
! fflush(stdout);

pipefd = create_pipe(i,translated,0,&pid,"/");

***************
*** 3387,3392 ****
--- 3390,3557 ----
}
}

+ /* Fixing permissions */
+ for (ptr = entry->log;
+ ptr < entry->log + entry->log_count;
+ ptr++) {
+
+ switch (ptr->command_letter) {
+ char *X;
+ struct passwd * p;
+ struct group * g;
+ struct stat X1;
+ int mode;
+ uid_t user;
+ gid_t group;
+
+
+ case 'M':
+ case 'F':
+ case 'C':
+
+ p = NULL;
+ g = NULL;
+ mode = -1;
+ user = (uid_t)-1;
+ group = (gid_t)-1;
+
+ if (!ptr->arg_ptrs || !ptr->arg_ptrs[0]) {
+
+ fprintf(stderr,
+ "%s: [replay_list] '%c' no arg 0 \n",
+ program_name,ptr->command_letter);
+ exit(1); /* FAILURE */
+ }
+ X = make_rooted(ptr,ptr->arg_ptrs[0],"/");
+
+ if (ptr->user_ptr && 0 != strcmp(ptr->user_ptr,"-")) {
+ p = getpwnam(ptr->user_ptr);
+
+ if (!p)
+ fprintf(stderr,
+ "%s: [replay_list] '%c' User %s not found\n",
+ program_name,ptr->command_letter,
+ ptr->user_ptr);
+ else {
+ user = p->pw_uid;
+ group = p->pw_gid;
+ }
+ }
+
+ if (ptr->group_ptr && 0 != strcmp(ptr->group_ptr,"-")) {
+ g = getgrnam(ptr->group_ptr);
+
+ if (!g)
+ fprintf(stderr,
+ "%s: [replay_list] '%c' Group %s not found\n",
+ program_name,ptr->command_letter,
+ ptr->group_ptr);
+ else
+ group = g->gr_gid;
+
+ }
+
+ if (ptr->mode_ptr && 0 != strcmp(ptr->mode_ptr,"-") &&
+ 0 != strcmp(ptr->mode_ptr,"0")) {
+ char * x;
+ mode = strtol(ptr->mode_ptr,&x,8);
+
+ if (*x || 0 == mode)
+ mode = -1;
+ }
+
+ if (stat(X,&X1) < 0) {
+ fprintf(stderr,
+ "%s: (note) %s : %s not accessible\n",
+ program_name,
+ ptr->arg_ptrs[0],X);
+
+ Exit_status = 1; /* FAILURE */
+
+ goto failure1;


+ }
+
+
+ if (

+ #ifdef S_ISDIR
+ S_ISDIR(X1.st_mode)
+ #else
+ S_IFDIR == (X1.st_mode & S_IFMT)


+ #endif
+ ) {
+

+ if (ptr->command_letter != 'M') {
+ fprintf(stderr,
+ "%s: (note) %s : %s is directory when should not\n",
+ program_name,
+ ptr->arg_ptrs[0],X);
+
+ Exit_status = 1; /* FAILURE */
+
+ goto failure1;
+ }
+
+ } else {
+ if (ptr->command_letter == 'M') {
+ fprintf(stderr,
+ "%s: (note) %s : %s is not a directory\n",
+ program_name,
+ ptr->arg_ptrs[0],X);
+
+ Exit_status = 1; /* FAILURE */
+ goto failure1;
+ }
+ }
+
+ if (user != (uid_t)-1 || group != (gid_t)-1) {
+ if (X1.st_uid != user || X1.st_gid != group) {
+ if (-1 == chown(X,user,group)) {
+ fprintf(stderr,"%s: Failed to set owner/group of %s\n",
+ program_name,X);
+ Exit_status = 1; /* FAILURE */
+ goto failure1;
+ }
+ } else {
+ fprintf(stdout,"%s: Fixed owner/group of %s\n",
+ program_name,X);
+ }
+
+ /* Recheck mode */
+ if (stat(X,&X1) < 0) {
+ fprintf(stderr,
+ "%s: (note) %s : %s not accessible\n",
+ program_name,
+ ptr->arg_ptrs[0],X);
+
+ Exit_status = 1; /* FAILURE */
+
+ goto failure1;
+ }
+ }
+
+ if (mode > 0) {
+
+ if ((X1.st_mode & 0777) != mode) {
+ if (-1 == chmod(X,mode)) {
+ fprintf(stderr,"%s: Failed to set mode of %s\n",
+ program_name,X);
+ Exit_status = 1; /* FAILURE */
+ } else {
+ fprintf(stdout,"%s: Mode of %s fixed\n",
+ program_name,X);

+ }
+ }
+
+ }
+

+ failure1:
+ free(X); X = 0;
+ break;
+ default:


+ break;
+ }
+ }
+

return Exit_status;
}

***************
*** 3490,3503 ****
int i;
int t;

! fprintf (stderr,
"%s: Copying ELM files from %s to / \n",
program_name,installer_root);

LI_target.filename = filelist;

if (0 == mkdir(ETCHOME,0755)) {
! fprintf(stderr,


"%s: Directory %s created\n",

program_name,ETCHOME);
} else if (errno != EEXIST) {
--- 3655,3668 ----
int i;
int t;

! fprintf (stdout,
"%s: Copying ELM files from %s to / \n",
program_name,installer_root);

LI_target.filename = filelist;

if (0 == mkdir(ETCHOME,0755)) {
! fprintf(stdout,


"%s: Directory %s created\n",

program_name,ETCHOME);
} else if (errno != EEXIST) {
***************
*** 3568,3574 ****
last = & LI_source.entries[LI_source.entries_count-1];
}

! /* EXECUTE commands */
r = replay_list(&LI_source.entries[LI_source.entries_count-1],
&LI_source,target,last);

--- 3733,3739 ----
last = & LI_source.entries[LI_source.entries_count-1];
}

! /* EXECUTE commands and fix permissions */
r = replay_list(&LI_source.entries[LI_source.entries_count-1],
&LI_source,target,last);

***************
*** 3766,3771 ****
--- 3931,3940 ----

program_name = argv[0];

+ #if defined(ANSI_C) || defined(SETLINEBUF)
+ setlinebuf(stdout);
+ #endif
+
#if 0
if (register_pipe)
fprintf(stderr,"%s: $ELM_INSTALLER=%s\n",program_name,register_pipe);

Kari E. Hurtta

unread,
Nov 15, 2003, 12:57:27 PM11/15/03
to
Archive-name: elm2.4ME+/PL109

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

files elm-2.4ME+PL109.patch.gz
and elm-2.4ME+109.tar.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL109.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+109.tar.gz >
via WWW.

Page <URL: http://personal.inet.fi/atk/elmme/ > is not up
of date (450 Write error: No space left on device).

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL109.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Undo Elm2.4ME+ PL108a (25) patch before applying this patch.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL108 (25) --------------------------------
Index: elm2.4.ME+.109-cvs/hdrs/patchlevel.h


Prereq: 1097000000
*** elm2.4.ME+.108/hdrs/patchlevel.h 2003-10-12 12:48:03.000000000 +0300

--- elm2.4.ME+.109-cvs/hdrs/patchlevel.h 2003-11-15 17:23:31.000000000 +0200
***************
*** 1,9 ****


! #define PATCHLEVEL "108 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.108
*/
! #define LAST_REPORT_TIME 1097000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"
! #define VERS_DATE "Oct, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Oct, 2003"
--- 1,9 ----

! #define PATCHLEVEL "109 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.109
*/
! #define LAST_REPORT_TIME 1099000000


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

! #define VERS_DATE "Nov, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Nov, 2003"
Index: elm2.4.ME+.109-cvs/README.ME+


*** elm2.4.ME+.108/README.ME+ 2003-10-12 12:48:03.000000000 +0300

--- elm2.4.ME+.109-cvs/README.ME+ 2003-11-15 17:25:17.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.654 2003/10/12 08:47:40 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.670 2003/11/15 15:25:17 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,18 ****
--- 13,165 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL109 (25) compared with Elm2.4ME+ PL108 (25)
+ ------------------------------------------------------------------
+
+ Undo Elm2.4ME+ PL108a (25) patch before applying this patch.
+
+ SUMMARY: This release collects Elm2.4ME+ PL108a (25)
+ patch, adds elmrc variable "prompt-after-metamail",
+ changes iconv:auto-charset elmrc option
+ to also apply to defined but unknown charsets,
+ makes some changes to elm tools, adds binary
+ mmappable file for charset tables for types
+ ascii and one-byte-map and adds O)verride
+ charset command. On elm tools there is new
+ command "elmbindata".
+
+ - "I would like to suggest a small change in elm.
+
+ I use lynx as a HTML browser.
+ When I exit from the lynx, I get the message:
+
+ Press any key to return to index.
+
+ and the only possible action is returning to the
+ list of mail messages. This message seems to be unnecessary."
+ Requested by: Witold Witkowski <yawi...@cyf-kr.edu.pl>
+ - Renamed "promptafter" elmrc variable to
+ "prompt-after-pager". Added elmrc variable
+ "prompt-after-metamail" Elmrc variable "promptafter"
+ effects now both "prompt-after-pager" and
+ "prompt-after-metamail".

+ - iconv:auto-charset is now applied to charsets on
+ lib/precompiled_sets.c if that charset is marked as
+ unknown (ie. defination of predefined unknown
+ charset is ignored.)
+
+ NOTE: By default iconv:auto-charset is OFF. So that
+ change to be effective, use
+ iconv:auto-charset = ON
+ on elm.rc. This makes unknow charset to be
+ type "iconv" if iconv() is able to handle it.
+
+ WARNING: Some care should be taken so that system or
+ display charset does not result to have type
+ "iconv".
+
+ Look shared_libs/iconv/READ.ME+
+
+ - Use post_init_check() even when -G (global)
+ flag is given on tools of elm.
+
+ - Text form map files for charset types ascii and
+ one-byte-map from elm.map.txt directory (and elsewhere)
+ are stored to binary file elm.map.bin/unidata.bin.
+ File is then readed or mmapped (similar than
+ elm.map.bin/bindata.bin). File is generated with new
+ tool elmbindata.
+
+ - Added O)verride charset command to override charset=
+ parameter of current or tagged mails.


+
+ New elmrc options:

+ prompt-after-pager
+ prompt-after-metamail
+ bindata
+
+ New tools:
+ elmbindata
+
+ New files:
+ lib/bindata.c
+ lib/mmaputil.c
+ hdrs/mmaputil.h
+ hdrs/bindata.h
+ utils/elmbindata.c
+ utils/charmapcopy.c
+ utils/charmapcopy.h
+ doc/elmbindata.1
+
+ Changes of Elm2.4ME+ PL108a (25) compared with Elm2.4ME+ PL108 (25)
+ ------------------------------------------------------------------
+
+ [ This is out of branch patch. ]
+

+
Changes of Elm2.4ME+ PL108 (25) compared with Elm2.4ME+ PL107 (25)

------------------------------------------------------------------

***************
*** 67,76 ****

treated with lower priority than normal entries. So they

normally do not match if there is more specific entry.

! - Avoid divizion be zero when opening non existing
(or empty?) mailbox.
From: Darren Reed <ava...@caligula.anu.edu.au>
! ( Divizion by zero seems not be visible on all systems. )

New elmrc options:
internal-mailcap-trusted-programs

--- 214,223 ----


treated with lower priority than normal entries. So they

normally do not match if there is more specific entry.

! - Avoid division be zero when opening non existing
(or empty?) mailbox.
From: Darren Reed <ava...@caligula.anu.edu.au>
! ( Division by zero seems not be visible on all systems. )

New elmrc options:
internal-mailcap-trusted-programs
***************
*** 93,98 ****

--- 240,247 ----


Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)

------------------------------------------------------------------



+ [ This is out of branch patch. ]

+
SUMMARY: This patch corrects page when returning

from o)ptions screen and fixes some other

minor bugs.
***************
*** 2227,2232 ****

--- 2376,2383 ----


Changes of Elm2.4ME+ PL97a (25) compared with Elm2.4ME+ PL97 (25)
----------------------------------------------------------------

+ [ This is out of branch patch. ]
+

- Fix state_printf panic "Embedded newlines are not supported"
on case when there is on ~/.elm/elmheaders
`backticked` command which produces output which does not
***************
*** 2584,2589 ****

--- 2735,2742 ----


Changes of Elm2.4ME+ PL95c (25) compared with Elm2.4ME+ PL95b (25)
------------------------------------------------------------------

+ [ This is out of branch patch. ]
+

- Do not use commands "mail" or "mailx" as mailer.
- Allow specify "none" as mailer on configuration time
(that requires that mailer is given on global elm.rc

***************
*** 8763,8769 ****
Otherwise debug output is appended to {debugfile}.

If {class} is not given, it defaults to all classes.
! Posisble classes are printed to {debugfile}. Value 0
for {level} can be used to get just possible values
of {class}.

--- 8916,8922 ----
Otherwise debug output is appended to {debugfile}.

If {class} is not given, it defaults to all classes.
! Posible classes are printed to {debugfile}. Value 0
for {level} can be used to get just possible values
of {class}.

***************
*** 8938,8947 ****
p private (encrypted) message
f Includes message fragment
(message/partial)


New commands for Elm 2.4ME+ (compared with Elm 2.4)
! -------------------------------------------------

Subject (main) menu:

--- 9091,9101 ----
p private (encrypted) message
f Includes message fragment
(message/partial)
+ o Charset of message is overrided


New commands for Elm 2.4ME+ (compared with Elm 2.4)
! ---------------------------------------------------

Subject (main) menu:

***************
*** 8986,8991 ****
--- 9140,9150 ----

copy PL82 Changed default to ON

+ promptafter PL109 Renamed to prompt-after-pager.
+ promptafter effects now both
+ prompt-after-pager and
+ prompt-after-metamail.
+
New elmrc variables for Elm 2.4ME+ (compared with Elm 2.4)
--------------------------------------------------------

***************
*** 8996,9001 ****
--- 9155,9161 ----
auto-attachment MIME
auto-iso-8859 MIME
background-wait-time -
+ bindata -
browser-wildcard-matching -
charset-convert-ok MIME
convert-comment-to-fullname -
***************
*** 9155,9166 ****
is not possible it should be refused (but if it is not detected
result of conversion will be practically empty.)

- - All referenced one-byte-map maps are parsed and read to memory.
- This may cause quite big memory consumption if you have given
- mapping to a lot of charsets and you have many users running elm.
- That mapping information should be shared between processes to
- reduce memory consuption.
-
- All refrences iso2022 maps are parsed and read to memory.
This may cause quite big memory consumption specially because
eastern (multibyte) sets tend to be lot of characters. That
--- 9315,9320 ----
***************
*** 9211,9223 ****
close, indeed the problem was NOT related to 'newmail' but an
AIX bug.

! IBM has release a patch, and the 'aixterm' in AIX 4.3.3 must be
! update with fileset X11.apps.aixterm.4.3.3.26 (PTF U473920) is
! solved to problem."
From: Noam G. Nudelman <no...@mail.biu.ac.il>

- File /usr/share/locale/fi/charset gives charset name utf-8 on
! Linux Mandrake 7.2. This causes that Configure generates mapping
fi utf-8
to elm.mimecharsets. However that seems to have
incorrect mapping. You may want change this to
--- 9365,9378 ----
close, indeed the problem was NOT related to 'newmail' but an
AIX bug.

! IBM has release a patch, and the 'aixterm' in AIX 4.3.3 must
! be update with fileset X11.apps.aixterm.4.3.3.26 (PTF
! U473920) is solved to problem."
From: Noam G. Nudelman <no...@mail.biu.ac.il>

- File /usr/share/locale/fi/charset gives charset name utf-8 on
! Linux Mandrake 7.2. This causes that Configure generates
! mapping
fi utf-8
to elm.mimecharsets. However that seems to have
incorrect mapping. You may want change this to
Index: elm2.4.ME+.109-cvs/shared_libs/iconv/README.ME+
*** elm2.4.ME+.108/shared_libs/iconv/README.ME+ 2002-01-26 13:14:47.000000000 +0200
--- elm2.4.ME+.109-cvs/shared_libs/iconv/README.ME+ 2003-11-15 15:29:45.000000000 +0200
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/shared_libs/iconv/README.ME+,v 1.5 2001/10/31 18:23:34 hurtta Exp $

Shared library
==============
--- 1,4 ----
! $Header: /data/cvsroot/mail/elmme+/shared_libs/iconv/README.ME+,v 1.6 2003/11/15 13:29:45 hurtta Exp $

Shared library
==============
***************
*** 61,67 ****

Files libdir/elm.rc and ~/.elm/.elmrc
can be used specify some libelmme-iconv.so parameters.
! These is ince such parameter

auto-charset

--- 61,67 ----

Files libdir/elm.rc and ~/.elm/.elmrc
can be used specify some libelmme-iconv.so parameters.
! These is one such parameter

auto-charset

***************
*** 69,74 ****
--- 69,78 ----
define charset, if librray knows conversion from that charset name
to Unicode (namely UCS-2BE (or UCS-2) charset).

+ auto-charset is also applied to charsets on lib/precompiled_sets.c
+ if that charset is marked as unknown (ie. defination of predefined
+ unknown charsets are ignored.)
+
Section of these paramaters names to be prefixed with library
tag (ie. "iconv:"). Shared library specific parameters go after
other parameters on config file. For example
Index: elm2.4.ME+.109-cvs/Configure
*** elm2.4.ME+.108/Configure 2003-08-16 09:58:21.000000000 +0300
--- elm2.4.ME+.109-cvs/Configure 2003-10-19 18:09:58.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.148 2003/08/15 20:03:45 hurtta Exp $


#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.149 2003/10/19 15:09:58 hurtta Exp $
#


: sanity checks
***************
*** 86,92 ****
echo "Extra library suffix: $libsuffix"
;;
-c*)
! config="`expr \"$1\" : '-s\(.*\)'`"
shift
case "$config" in
"")
--- 86,92 ----
echo "Extra library suffix: $libsuffix"
;;
-c*)
! config="`expr \"$1\" : '-c\(.*\)'`"
shift
case "$config" in
"")

Index: elm2.4.ME+.109-cvs/doc/elmbindata.1
*** /tmp/5164-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-11-15 18:08:47.000000000 +0200
--- elm2.4.ME+.109-cvs/doc/elmbindata.1 2003-11-09 18:13:36.000000000 +0200
***************
*** 0 ****
--- 1,92 ----


+ .if n \{\
+ . ds ct "
+ .\}
+ .if t \{\
+ . ds ct \\(co
+ .\}

+ .TH ELMBINDATA 1L "Elm Version 2.4ME+" "Kari Hurtta"
+ .SH NAME
+ elmbindata -
+ .SH SYNOPSIS
+ .B #LIB#/elmbindata
+ [
+ .B \-B
+ .B \-b
+ bindata.bin


+ .B \-d
+ .I "\fIclass\fR=\fIdebugfile\fR:\fIlevel\fR"
+ .B \-I
+ .B \-w
+ target-file

+ .B \-T
+ text-target-directory
+ .B \-S
+ map-source-directory
+ ]
+ .SH DESCRIPTION
+ .I Elmbindata\^


+ is a part of the
+ .B Elm 2.4ME+
+ mail system.

+ .PP
+ Text form map files for charset types ascii and
+ one-byte-map from elm.map.txt directory (and elsewhere)
+ are stored to binary file elm.map.bin/unidata.bin.
+ File is then readed or mmapped (similar than
+ elm.map.bin/bindata.bin). File is generated with
+ elmbindata tool.


+ .PP
+ Options are:
+ .TP 1.0i
+ .B " -G"
+ Read global configuration files only (by default user
+ configuration files are read.)
+ .TP
+ .B " -d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR "
+ Debug - set specified debug level -

+ Output to "$HOME/ELMBINDATA:debug.info"


+ if
+ .I debugfile
+ is not given. Has no effect unless

+ .I elmmbindata


+ was compiled with debugging enabled.
+ .TP
+ .B " -w" target-file
+ Gives file for output.
+ .TP

+ .B " -T" text-target-directory
+ Gives directory for output of textual (un)dump of binary
+ mapping tables.
+ .B " -I"
+ Use system (or user) bindata file as target file.
+ .TP
+ .B " -B"
+ Use system (or user) bindata file as source file.
+ .TP
+ .B " -b" bindata.bin
+ Use given bindata file as (binary) source file.
+ .TP
+ .B " -S" map-source-directory
+ Specifies directory from where missing map files are directory
+ to elm.map.txt directory (actually given on map-text-dir elm.rc
+ option.)
+ .TP
+ If eitger -B or -b is given, then bindata is generated
+ from textual mapping files.
+ .SH AUTHOR


+ Kari Hurtta
+ .SH FILES
+ #ETC#/elm.rc system RC file
+ .br

+ #ETC#/elm.mimecharsets system charsets file


+ .br
+ $HOME/.elm/elmrc individual RC file
+ .br

+ $HOME/.elm/mime.charsets individual charsets file
+ .br
+ #LIB#/elm.map.bin/bindata.bin Default location for system bindata file


+ .br
+ .SH BUG REPORTS TO
+ Kari Hurtta hurtt...@ozone.fmi.fi
+ .SH COPYRIGHTS
+ \fB\*(ct\fRCopyright 2003 by Kari Hurtta

Index: elm2.4.ME+.109-cvs/doc/elmcharset.1
*** elm2.4.ME+.108/doc/elmcharset.1 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.109-cvs/doc/elmcharset.1 2003-11-09 18:13:36.000000000 +0200
***************
*** 57,62 ****
--- 57,63 ----
option.)
.TP
.B " -w" target-file
+ .TP
Gives file for output.
.B " -M"
Produce MBenum listing instead
***************
*** 74,77 ****
.SH BUG REPORTS TO
Kari Hurtta hurtt...@ozone.fmi.fi
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 1999-2002 by Kari Hurtta
--- 75,78 ----
.SH BUG REPORTS TO
Kari Hurtta hurtt...@ozone.fmi.fi
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 1999-2003 by Kari Hurtta
Index: elm2.4.ME+.109-cvs/doc/elm-help.0
*** elm2.4.ME+.108/doc/elm-help.0 2002-01-26 13:15:57.000000000 +0200
--- elm2.4.ME+.109-cvs/doc/elm-help.0 2003-11-11 18:18:03.000000000 +0200
***************
*** 43,48 ****
--- 43,50 ----
^N Next unread message, displaying current
if unread, then increment
o Change ELM options
+ O Override charset of current message or
+ tagged messages
p Print current message or tagged messages
P Print text of current message or
tagged messages
Index: elm2.4.ME+.109-cvs/doc/elmrc-info
*** elm2.4.ME+.108/doc/elmrc-info 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/doc/elmrc-info 2003-11-09 18:13:36.000000000 +0200
***************
*** 1,4 ****


! #@(#)$Id: elmrc-info,v 1.54 2003/10/11 08:42:10 hurtta Exp $
# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.56 2003/11/09 16:13:36 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************

*** 301,307 ****
pager
# program to use for displaying messages ('builtin' is recommended)

! promptafter
# prompt for a command after the external pager exits?

browser-wildcard-matching
--- 301,310 ----
pager
# program to use for displaying messages ('builtin' is recommended)

! prompt-after-metamail
! # prompt after the metamail exits?
!
! prompt-after-pager
# prompt for a command after the external pager exits?

browser-wildcard-matching
***************
*** 755,761 ****

map-bin-dir
# Default directory for map files (binary) (normally $lib/elm.map.bin)
! # See also: unidata, map-text-dir

unidata
# Binary unidata file, filename can be
--- 758,764 ----

map-bin-dir
# Default directory for map files (binary) (normally $lib/elm.map.bin)
! # See also: unidata, bindata, map-text-dir

unidata
# Binary unidata file, filename can be
***************
*** 768,773 ****
--- 771,791 ----
# directory
# See also: map-bin-dir

+ bindata
+ # Binary charset map file. Includes type=ascii and type=one-byte-map maps
+ # from map-text-dir (and elsewhere). If that variable is set both
+ # on global elm.rc and user's elm.rc then both files may be readed
+ # or mmapped.
+ # Filaname can be
+ # filename File is read from directory
+ # given on map-bin-dir directory
+ # (normally $lib/elm.map.bin)
+ # {rc}/filename File is readed from .elm subdirectory
+ # of user's home
+ # ~/filename File is readed from user's home
+ # directory
+ # See also: map-bin-dir
+
use-library
# Specify tags for shared libraries, which should be loaded

Index: elm2.4.ME+.109-cvs/doc/elmunidata.1
*** elm2.4.ME+.108/doc/elmunidata.1 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.109-cvs/doc/elmunidata.1 2003-11-09 18:13:36.000000000 +0200
***************
*** 47,59 ****
Gives file for output.
.TP
.B " -T" text-target-file
! Gives file for outpu of textual (un)dump of unicode data.
.TP
.B " -I"
Use system unidata file as target file.
.TP
! .B " -I"
Use system unidata file as source file.
.SH AUTHOR
Kari Hurtta
.SH FILES
--- 47,62 ----
Gives file for output.
.TP
.B " -T" text-target-file
! Gives file for output of textual (un)dump of unicode data.
.TP
.B " -I"
Use system unidata file as target file.
.TP
! .B " -B"
Use system unidata file as source file.
+ .TP
+ .B " -b" unidata.bin
+ Use given unidata file as (binary) source file.
.SH AUTHOR
Kari Hurtta
.SH FILES
Index: elm2.4.ME+.109-cvs/doc/Makefile.SH
*** elm2.4.ME+.108/doc/Makefile.SH 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.109-cvs/doc/Makefile.SH 2003-11-09 18:13:35.000000000 +0200
***************
*** 17,23 ****
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.28 2003/05/28 16:43:07 hurtta Exp $
#
# Makefile for the documentation of the ELM mail system
#
--- 17,23 ----
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.29 2003/11/09 16:13:35 hurtta Exp $
#
# Makefile for the documentation of the ELM mail system
#
***************
*** 128,133 ****
--- 128,134 ----
$(MAN)/elmrc-write$(MANEXT) \
$(MAN)/elmterminal$(MANEXT) \
$(MAN)/elmunidata$(MANEXT) \
+ $(MAN)/elmbindata$(MANEXT) \
$(MAN)/elmstringconvert$(MANEXT) \
$(MAN)/prlong$(MANEXT) \
$(MAN)/elmregister$(MANEXT) \
***************
*** 150,155 ****
--- 151,157 ----
$(CATMAN)/elmrc-write$(CATMANEXT)$(SUFFIX) \
$(CATMAN)/elmterminal$(CATMANEXT)$(SUFFIX) \
$(CATMAN)/elmunidata$(CATMANEXT)$(SUFFIX) \
+ $(CATMAN)/elmbindata$(CATMANEXT)$(SUFFIX) \
$(CATMAN)/elmstringconvert$(CATMANEXT)$(SUFFIX) \
$(CATMAN)/prlong$(CATMANEXT)$(SUFFIX) \
$(CATMAN)/elmregister$(CATMANEXT)$(SUFFIX) \
***************
*** 172,177 ****
--- 174,180 ----
catman/elmrc-write$(CATMANEXT)$(SUFFIX) \
catman/elmterminal$(CATMANEXT)$(SUFFIX) \
catman/elmunidata$(CATMANEXT)$(SUFFIX) \
+ catman/elmbindata$(CATMANEXT)$(SUFFIX) \
catman/elmstringconvert$(CATMANEXT)$(SUFFIX) \
catman/prlong$(CATMANEXT)$(SUFFIX) \
catman/elmregister$(CATMANEXT)$(SUFFIX) \
***************
*** 233,238 ****
--- 236,243 ----
$(SED) $(SUBS) < elmterminal.1 > elmterminal.1.subs
elmunidata.1.subs: elmunidata.1
$(SED) $(SUBS) < elmunidata.1 > elmunidata.1.subs
+ elmbindata.1.subs: elmbindata.1
+ $(SED) $(SUBS) < elmbindata.1 > elmbindata.1.subs
fastmail.1.subs: fastmail.1
$(SED) $(SUBS) < fastmail.1 > fastmail.1.subs
frm.1.subs: frm.1


***************
*** 300,305 ****
--- 305,313 ----

$(MAN)/elmunidata$(MANEXT): elmunidata.1.subs


$(REG) copy -m 444 $? $@

+ $(MAN)/elmbindata$(MANEXT): elmbindata.1.subs


+ $(REG) copy -m 444 $? $@
+

$(MAN)/fastmail$(MANEXT): fastmail.1.subs


$(REG) copy -m 444 $? $@

***************
*** 383,388 ****
--- 391,399 ----
$(CATMAN)/elmunidata$(CATMANEXT)$(SUFFIX): catman/elmunidata$(CATMANEXT)$(SUFFIX)


$(REG) copy -m 444 $? $@

+ $(CATMAN)/elmbindata$(CATMANEXT)$(SUFFIX): catman/elmbindata$(CATMANEXT)$(SUFFIX)


+ $(REG) copy -m 444 $? $@
+

$(CATMAN)/elmterminal$(CATMANEXT)$(SUFFIX): catman/elmterminal$(CATMANEXT)$(SUFFIX)


$(REG) copy -m 444 $? $@

***************
*** 496,501 ****
--- 507,521 ----
true ; \
fi

+ catman/elmbindata$(CATMANEXT)$(SUFFIX): elmbindata.1.subs
+ $(MANROFF) $(MANROFF_OPTS) -man $? > catman/elmbindata$(CATMANEXT)


+ @if $(TEST) "$(PACKED)" = y ; then \
+ $(RM) $@ ; \

+ $(PACKER) catman/elmbindata$(CATMANEXT) ; \


+ else \
+ true ; \
+ fi
+

catman/elmterminal$(CATMANEXT)$(SUFFIX): elmterminal.1.subs
$(MANROFF) $(MANROFF_OPTS) -man $? > catman/elmterminal$(CATMANEXT)
Index: elm2.4.ME+.109-cvs/hdrs/bindata.h
*** /tmp/5164-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-11-15 18:08:47.000000000 +0200
--- elm2.4.ME+.109-cvs/hdrs/bindata.h 2003-11-09 18:13:36.000000000 +0200
***************
*** 0 ****
--- 1,47 ----
+ /* $Id: bindata.h,v 1.2 2003/11/09 16:13:36 hurtta Exp $ */
+
+ #ifdef ANSI_C
+ struct bindata_mapped_data; /* Needed for prototype */
+ #endif
+
+ /* bindata.c */
+
+ extern void free_bindata P_((struct bindata_mapped_data * v));
+ extern int write_bindata P_((struct bindata_mapped_data *v,
+ const char *filename));
+ extern int get_bindata P_((struct bindata_mapped_data **ptr,
+ const char *filename));
+
+ extern struct bindata_mapped_data * malloc_bindata P_((int cscount));
+ extern int add_bindata_map P_((struct bindata_mapped_data * v,
+ uint16 bytevector[256],
+ unsigned char revvector[MAP_REV_MAP_DIV],
+ const char *filename));
+ extern void trim_bindata P_((struct bindata_mapped_data * v));
+
+ extern int write_bindata_text P_((struct bindata_mapped_data *v,
+ CONST char * dir,
+ char ***filelist));
+
+ extern struct bindata_mapped_data * default_bindata P_((void));
+
+ extern struct bindata_map * give_mapping P_((struct bindata_mapped_data *v,
+ const char *mapname));
+
+ extern uint16 lookup_binmap P_((unsigned int ch,
+ struct bindata_map *map,
+ int *found));
+ extern unsigned char lookup_binmap_rev P_((struct bindata_map *map,
+ unsigned int val,
+ int * found));
+
+ /* cs_binary.c */
+
+ extern struct bindata_mapped_data *generate_bindata P_((void));


+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.109-cvs/hdrs/cs_imp.h
*** elm2.4.ME+.108/hdrs/cs_imp.h 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109-cvs/hdrs/cs_imp.h 2003-11-15 17:50:22.000000000 +0200
***************
*** 1,5 ****
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

--- 1,5 ----
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 189,209 ****

#define ISO2022_SET_COUNT 10

extern struct map_info {
struct charset_type *map_type;
char *map_name;
int map_initialized;
map_init_map *map_init_it;
union {
! int dummy;
! struct map_ascii_upper ascii;
! struct bytemap bytemap;
! uint16 iso646[12];
! struct utfmap utfmap;
!
! /* Indexes to iso2022_map_list[] */
! int setlist[ISO2022_SET_COUNT];
} b;
} map_ascii, map_latin1, map_koi8r, map_cp1251, map_invariant, map_utf8,
map_utf7, map_cp1252, map_koi8u, map_885915,
map_ISO2022_ascii, map_ISO2022_ascii_latin1,
--- 189,241 ----

#define ISO2022_SET_COUNT 10

+ struct iso2022_m {
+ /* Indexes to iso2022_map_list[] */
+ int setlist[ISO2022_SET_COUNT];
+ };
+
+ struct iso646_m {
+ uint16 iso646[12];
+ };
+
+ typedef uint16 cs_map_bindataXX P_((unsigned int ch,
+ struct map_info *map,
+ int *found));
+
+
+ typedef unsigned char cs_map_bindataXX_rev P_((struct map_info *map,
+ unsigned int val,
+ int *found));
+
+ struct bindata_ops {
+ cs_map_bindataXX * map_it;
+ cs_map_bindataXX_rev * map_rev_it;
+ };
+
+
extern struct map_info {
struct charset_type *map_type;
char *map_name;
int map_initialized;
map_init_map *map_init_it;
union {
! void * dummy;
! struct map_ascii_upper * ascii;
! struct bytemap * bytemap;
! struct iso646_m * iso646;
! struct utfmap * utfmap;
! struct iso2022_m * setlist;
} b;
+ union {
+ void * dummy;
+ struct bindata_map * bindata;
+ } c;
+
+ union {
+ void * dummy;
+ struct bindata_ops * binary_ops;
+ } d;
+
} map_ascii, map_latin1, map_koi8r, map_cp1251, map_invariant, map_utf8,
map_utf7, map_cp1252, map_koi8u, map_885915,
map_ISO2022_ascii, map_ISO2022_ascii_latin1,
***************
*** 316,324 ****
extern int compress_unicode P_((uint16 *words, int *len));

extern struct charset_state * new_state_1 P_((charset_t set));
! extern FILE * open_mapname P_((const char *name, char **fn,
! int *index
! ));

extern struct charcode_info precompiled_sets[];
extern CONST int precompiled_size;
--- 348,355 ----
extern int compress_unicode P_((uint16 *words, int *len));

extern struct charset_state * new_state_1 P_((charset_t set));
! extern FILE * open_mapname P_((const char *name, char **fn));
! extern int is_on_mapdir P_((CONST char *name));

extern struct charcode_info precompiled_sets[];
extern CONST int precompiled_size;
***************
*** 370,376 ****

void read_map_format_a P_((const char *name, struct map_info *map_info,
struct iso2022_mapinfo *iso2022_map_info,
! FILE *F, int index_number,
set_map_callmap * pass_caller,
int field_count,
enum field_type *vector,
--- 401,407 ----

void read_map_format_a P_((const char *name, struct map_info *map_info,
struct iso2022_mapinfo *iso2022_map_info,
! FILE *F,
set_map_callmap * pass_caller,
int field_count,
enum field_type *vector,
***************
*** 445,450 ****
--- 476,485 ----
int setcount,
struct setlist *old_info));

+ /* bindata.c */
+
+ extern struct bindata_mapped_data * default_bindata P_((void));


+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.109-cvs/hdrs/defs.h
*** elm2.4.ME+.108/hdrs/defs.h 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/hdrs/defs.h 2003-11-10 22:37:46.000000000 +0200
***************
*** 1,7 ****


! /* $Id: defs.h,v 1.39 2003/10/01 17:34:34 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! /* $Id: defs.h,v 1.40 2003/11/10 20:37:46 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 488,494 ****
mime_t mime_rec; /** MIME information for this message **/

/* == charset_t, but it is not yet declared ... */
! struct charcode_info * header_charset; /* charset for headers ... */

struct mbx_hdr_info * mbx_info;

--- 488,495 ----
mime_t mime_rec; /** MIME information for this message **/

/* == charset_t, but it is not yet declared ... */
! struct charcode_info * header_charset; /* charset for headers ... */
! struct charcode_info * override_charset; /* For O)verride command */

struct mbx_hdr_info * mbx_info;

Index: elm2.4.ME+.109-cvs/hdrs/elmlib.h
*** elm2.4.ME+.108/hdrs/elmlib.h 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/hdrs/elmlib.h 2003-11-09 18:13:36.000000000 +0200
***************
*** 1,7 ****


! /* $Id: elmlib.h,v 1.196 2003/10/11 11:35:49 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.196 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.198 2003/11/09 16:13:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.198 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 645,650 ****
--- 645,651 ----
extern int init_defaults P_((void));

#define READ_FLAG_UNIDATA_INIT 1 /* Called from elmunidata routine */
+ #define READ_FLAG_BINDATA_INIT 2 /* Called from elmbindata routine */
extern int read_rc_file P_((int flags));
extern void post_init_check P_((int flag)); /* read_rc_file calls this */

***************
*** 668,673 ****
--- 669,678 ----
extern char unidata_path[SLEN]; /* $lib/elm.map.bin */
extern char raw_unidata_path[SLEN]; /* $lib/elm.map.bin */

+ extern char bindata_path[SLEN]; /* $lib/elm.map.bin */
+ extern char bindata_path_global[SLEN]; /* Used before user elm.rc is read */
+ extern char raw_bindata_path[SLEN]; /* $lib/elm.map.bin */
+
extern char user_rc_file[SLEN]; /* .elm/elmrc */
extern char user_text_file[SLEN]; /* .elm/aliases.text */
extern char user_data_file[SLEN]; /* .elm/aliases */
***************
*** 840,845 ****
--- 845,851 ----
extern char printout[SLEN]; /* how to print messages */
extern char raw_printout[SLEN]; /* unexpanded how to print messages */
extern int prompt_after_pager; /* flag: prompt after pager exits */
+ extern int prompt_after_metamail; /* flag: prompt after metamail exits */
extern int quote_forward; /* flag: fwd'd msgs quoted like replies */
extern int readdatapercentinc; /* data percent increment during new mbox read */
extern int readmsginc; /* msg cnt increment during new mbox read */
Index: elm2.4.ME+.109-cvs/hdrs/elmutil.h
*** elm2.4.ME+.108/hdrs/elmutil.h 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/hdrs/elmutil.h 2003-11-09 18:13:36.000000000 +0200
***************
*** 1,7 ****


! /* $Id: elmutil.h,v 1.10 2003/10/01 17:34:34 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! /* $Id: elmutil.h,v 1.11 2003/11/09 16:13:36 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 31,37 ****
/******** and another string for the copyright notice ********/

static char copyright[] = {
! "@(#) (C) Copyright 1986,1987, Dave Taylor\n@(#) (C) Copyright 1988-1992, The Usenet Community Trust\n" };



/******** global variables accessable by all pieces of the program *******/

--- 31,39 ----
/******** and another string for the copyright notice ********/

static char copyright[] = {
! "@(#) (C) Copyright 1986,1987, Dave Taylor\n@(#)\n\
! @(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
! @(#) (C) Copyright 1996-2003, Kari Hurtta\n" };



/******** global variables accessable by all pieces of the program *******/

Index: elm2.4.ME+.109-cvs/hdrs/me.h
*** elm2.4.ME+.108/hdrs/me.h 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/hdrs/me.h 2003-11-10 22:37:46.000000000 +0200
***************
*** 1,7 ****


! /* $Id: me.h,v 1.76 2003/10/05 16:07:27 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! /* $Id: me.h,v 1.77 2003/11/10 20:37:46 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.77 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 747,752 ****
--- 747,754 ----

/* showmsg.c */

+ extern void OverrideCharset P_((struct MailboxView *mailbox));
+
extern int show_msg P_((struct header_rec *current_header,
FILE *infile, int current, int message_count));

Index: elm2.4.ME+.109-cvs/hdrs/melib.h
*** elm2.4.ME+.108/hdrs/melib.h 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/hdrs/melib.h 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****
! /* $Id: melib.h,v 1.38 2003/08/04 14:58:56 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! /* $Id: melib.h,v 1.40 2003/11/11 16:18:04 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 26,32 ****
charset_t defcharset,
struct header_rec *mss));

! extern int pgp_selector P_((mime_t *p));

extern void pgp_SG_decoder P_((mime_t *body, mime_t *sign,
in_state_t *state_in,
--- 26,32 ----
charset_t defcharset,
struct header_rec *mss));

! extern int pgp_selector P_((mime_t *p, struct header_rec * hdr));

extern void pgp_SG_decoder P_((mime_t *body, mime_t *sign,
in_state_t *state_in,
***************
*** 100,106 ****

extern int is_rfc1522 P_((char *));

! extern int set_filter P_((mime_t *, out_state_t *, charset_t));
extern FILE *arrange_decoded P_((mime_t *ptr,in_state_t *state_in,
out_state_t *state_out,
in_state_t *newstate2,
--- 100,108 ----

extern int is_rfc1522 P_((char *));

! extern int set_filter P_((mime_t *ptr, out_state_t *stat,
! charset_t default_content_charset,
! charset_t override_charset));
extern FILE *arrange_decoded P_((mime_t *ptr,in_state_t *state_in,
out_state_t *state_out,
in_state_t *newstate2,
***************
*** 208,220 ****

extern void mime_selector_free P_((struct mime_selected_handler **p));

! extern int mime_classify_media P_((mime_t *p));
! extern int mime_classify_subparts P_((mime_t *ptr));
extern int mime_classify_best_alternative P_((mime_t *ptr,
! mime_t **ret));

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
! typedef int mime_run_selector P_((mime_t *p));
typedef mime_run_selector *mime_run_selector_t;

typedef void encrypted_decoder P_((mime_t *init, mime_t *data,
--- 210,223 ----

extern void mime_selector_free P_((struct mime_selected_handler **p));

! extern int mime_classify_media P_((mime_t *p,struct header_rec * hdr));
! extern int mime_classify_subparts P_((mime_t *ptr, struct header_rec * hdr));
extern int mime_classify_best_alternative P_((mime_t *ptr,
! mime_t **ret,
! struct header_rec * hdr));

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
! typedef int mime_run_selector P_((mime_t *p,struct header_rec * hdr));
typedef mime_run_selector *mime_run_selector_t;

typedef void encrypted_decoder P_((mime_t *init, mime_t *data,
***************
*** 332,338 ****
out_state_t *s_out,
charset_t defcharset,
struct header_rec *mss));
! extern int partial_selector P_((mime_t *p));

/* --------------- */

--- 335,341 ----
out_state_t *s_out,
charset_t defcharset,
struct header_rec *mss));
! extern int partial_selector P_((mime_t *p, struct header_rec * hdr));

/* --------------- */

Index: elm2.4.ME+.109-cvs/hdrs/mmaputil.h
*** /tmp/5164-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-11-15 18:08:47.000000000 +0200
--- elm2.4.ME+.109-cvs/hdrs/mmaputil.h 2003-11-09 18:13:36.000000000 +0200
***************
*** 0 ****
--- 1,18 ----
+ /* $Id: mmaputil.h,v 1.2 2003/11/09 16:13:36 hurtta Exp $ */
+
+ extern uint16 SWAP P_((int b));
+ extern uint16 pages P_((size_t len, int pagesize));
+
+ extern int write_range P_((int fd, off_t offset, size_t length,
+ unsigned char *ptr));
+
+ extern int read_range P_((int fd, off_t offset, size_t length,
+ unsigned char *ptr));


+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.109-cvs/hdrs/save_opts.h
*** elm2.4.ME+.108/hdrs/save_opts.h 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/hdrs/save_opts.h 2003-11-09 18:13:36.000000000 +0200
***************
*** 1,7 ****


! /* @(#)$Id: save_opts.h,v 1.72 2003/10/11 08:42:10 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.72 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! /* @(#)$Id: save_opts.h,v 1.74 2003/11/09 16:13:36 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.74 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
***************
*** 171,177 ****
static char *SIGS[]= {"remotesignature","localsignature",NULL};
static char *ALWAYS[]= {"alwayskeep", "!alwaysstore",NULL};

! static char *MAILCAPS[] = { "internal-mailcaps", "metamail-mailcaps", NULL};

static char * USERLEVELS[] = { "beginner", "intermediate", "expert", NULL };
static enumerate_list USERLEVEL = {3, &(USERLEVELS[0]) };
--- 171,179 ----
static char *SIGS[]= {"remotesignature","localsignature",NULL};
static char *ALWAYS[]= {"alwayskeep", "!alwaysstore",NULL};

! static char *MAILCAPS[] = { "internal-mailcaps", "metamail-mailcaps", NULL};
! static char *PROMPTAFTER[] = { "prompt-after-metamail",
! "prompt-after-pager", NULL};

static char * USERLEVELS[] = { "beginner", "intermediate", "expert", NULL };
static enumerate_list USERLEVEL = {3, &(USERLEVELS[0]) };
***************
*** 237,242 ****
--- 239,247 ----
#ifdef BACKGROUD_PROCESSES
{ "background-wait-time",-1L,ZZZ_DT_NUM(&background_wait_time), 0, NULL },
#endif
+ {"bindata", -1L,ZZZ_DT_STR(raw_bindata_path),
+ sizeof raw_bindata_path, NULL },
+
/* {"bounce", -1L,ZZZ_DT_SYN("bounceback"), 0, NULL},
{"bounceback", -1L,ZZZ_DT_NUM(&bounceback), 0, NULL},
*/
***************
*** 389,395 ****
sizeof prefixchars, NULL},
{"print", -1L,ZZZ_DT_STR(raw_printout), sizeof raw_printout, NULL},
{"printmail", -1L,ZZZ_DT_SYN("print"), 0, NULL},
! {"promptafter", -1L,ZZZ_DT_BOL(&prompt_after_pager), 0, NULL},
{"question", -1L,ZZZ_DT_SYN("ask"), 0, NULL},
{"quoteforward", -1L,ZZZ_DT_BOL(&quote_forward), 0, NULL},
{"readdatapercentinc", -1L,ZZZ_DT_NUM(&readdatapercentinc), 0, NULL},
--- 394,402 ----
sizeof prefixchars, NULL},
{"print", -1L,ZZZ_DT_STR(raw_printout), sizeof raw_printout, NULL},
{"printmail", -1L,ZZZ_DT_SYN("print"), 0, NULL},
! {"prompt-after-metamail",-1L,ZZZ_DT_BOL(&prompt_after_metamail), 0, NULL},
! {"prompt-after-pager", -1L,ZZZ_DT_BOL(&prompt_after_pager), 0, NULL},
! {"promptafter", -1L,ZZZ_DT_MLT(PROMPTAFTER), 0, NULL },
{"question", -1L,ZZZ_DT_SYN("ask"), 0, NULL},
{"quoteforward", -1L,ZZZ_DT_BOL(&quote_forward), 0, NULL},
{"readdatapercentinc", -1L,ZZZ_DT_NUM(&readdatapercentinc), 0, NULL},
Index: elm2.4.ME+.109-cvs/hdrs/s_elm.h
*** elm2.4.ME+.108/hdrs/s_elm.h 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/hdrs/s_elm.h 2003-11-10 22:37:46.000000000 +0200
***************
*** 989,995 ****
#define ElmUnknownIMAPCharset 0x7f8
#define ElmUnknownDef1Charset 0x7f9
#define ElmFailedReopenFolder 0x7fa
! #define ElmNoBinMapDir 0x7fb
#define ElmNoUnicodeData 0x7fc
#define ElmUnidataSetting 0x7fd
#define ElmMailServInfoSavedIn 0x7fe
--- 989,995 ----
#define ElmUnknownIMAPCharset 0x7f8
#define ElmUnknownDef1Charset 0x7f9
#define ElmFailedReopenFolder 0x7fa
! #define ElmNoBinMapDirX 0x7fb
#define ElmNoUnicodeData 0x7fc
#define ElmUnidataSetting 0x7fd
#define ElmMailServInfoSavedIn 0x7fe
***************
*** 1085,1087 ****
--- 1085,1097 ----
#define ElmHdrEditCommentNo 0x858
#define ElmHdrNotSupported 0x859
#define ElmHdrGarbage 0x85a
+ #define ElmBinaryMapData 0x85c
+ #define ElmOverrideCharset 0x85d
+ #define ElmNoMailToOverride 0x85e
+ #define ElmOverrideTagged 0x85f
+ #define ElmOverrideTaggedOne 0x860
+ #define ElmOverrideCurrentOver 0x861
+ #define ElmOverrideCurrent 0x862
+ #define ElmOverrideCSprompt 0x863
+ #define ElmUnknowCharset 0x864
+ #define ElmCharsetBadOverride 0x865
Index: elm2.4.ME+.109-cvs/hdrs/s_me.h
*** elm2.4.ME+.108/hdrs/s_me.h 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/hdrs/s_me.h 2003-11-10 22:37:46.000000000 +0200
***************
*** 325,327 ****
--- 325,331 ----
#define MeCorrupted 0x159
#define MeFragmentedSender 0x15a
#define MeAssembleCommand 0x15b
+ #define MeCreateDir 0x15c
+ #define MeCantCreateDir 0x15d
+ #define MeDecodeCharsetOverride 0x15e
+ #define MeDecodeUseOtoOverride 0x15f
Index: elm2.4.ME+.109-cvs/hdrs/unidata.h
*** elm2.4.ME+.108/hdrs/unidata.h 2002-01-26 13:15:58.000000000 +0200
--- elm2.4.ME+.109-cvs/hdrs/unidata.h 2003-11-09 18:13:36.000000000 +0200
***************
*** 1,7 ****
! /* $Id: unidata.h,v 1.5 2002/01/23 15:49:59 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! /* $Id: unidata.h,v 1.6 2003/11/09 16:13:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 9,32 ****

/* unidata.c --------------------------------------------------- */

- extern uint16 SWAP P_((int b));
- extern uint16 pages P_((size_t len, int pagesize));
- extern int read_range P_((int fd, off_t offset, size_t length,
- unsigned char *ptr));
- extern int write_range P_((int fd, off_t offset, size_t length,
- unsigned char *ptr));

#ifdef ANSI_C
! struct mapped_data; /* Needed for prototype */
#endif

! extern int get_unidata P_((struct mapped_data ** ptr, CONST char *filename));
! extern int read_unidata_text P_((struct mapped_data **ptr,
CONST char *filename, FILE *logfile,
int silent_gaps));
! extern void free_unidata P_((struct mapped_data * v));
! extern int write_unidata P_((struct mapped_data *v,CONST char *filename));
! extern int write_unidata_text P_((struct mapped_data *v, FILE *f));

/* UNICODE character types */

--- 9,26 ----

/* unidata.c --------------------------------------------------- */


#ifdef ANSI_C
! struct unidata_mapped_data; /* Needed for prototype */
#endif

! extern int get_unidata P_((struct unidata_mapped_data ** ptr, CONST char *filename));
! extern int read_unidata_text P_((struct unidata_mapped_data **ptr,
CONST char *filename, FILE *logfile,
int silent_gaps));
! extern void free_unidata P_((struct unidata_mapped_data * v));
! extern int write_unidata P_((struct unidata_mapped_data *v,CONST char *filename));
! extern int write_unidata_text P_((struct unidata_mapped_data *v, FILE *f));

/* UNICODE character types */

***************
*** 105,118 ****
uint16 decomp_len; /* decomposition length */
};

! /* Note: size == 0 if not unicode decompression wanted
! size : on bytes (sizeof)

Returns 0 = failure (not valid character)
1 = succeed
-1 = database bad
*/
! extern int unicode_lookup_character P_((struct mapped_data *v,
unsigned int unicode,
struct character_information *info,
uint16 unicode_out[],
--- 99,112 ----
uint16 decomp_len; /* decomposition length */
};

! /* Note: buffer_len == 0 if not unicode decompression wanted
! buffer_len : number of unicode characters

Returns 0 = failure (not valid character)
1 = succeed
-1 = database bad
*/
! extern int unicode_lookup_character P_((struct unidata_mapped_data *v,
unsigned int unicode,
struct character_information *info,
uint16 unicode_out[],
***************
*** 159,165 ****
= -1 incomplete input
*/

! int unicode_compress_input P_((struct mapped_data *v,
uint16 *unicode_res,
uint16 unicode_inp[],
int len,
--- 153,159 ----
= -1 incomplete input
*/

! int unicode_compress_input P_((struct unidata_mapped_data *v,
uint16 *unicode_res,
uint16 unicode_inp[],
int len,
***************
*** 167,171 ****

/* unicode.c --------------------------------------------------- */

! extern struct mapped_data * default_unidata P_((void));

--- 161,165 ----

/* unicode.c --------------------------------------------------- */

! extern struct unidata_mapped_data * default_unidata P_((void));

Index: elm2.4.ME+.109-cvs/lib/bindata.c
*** /tmp/5164-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-11-15 18:08:47.000000000 +0200
--- elm2.4.ME+.109-cvs/lib/bindata.c 2003-11-15 17:51:20.000000000 +0200
***************
*** 0 ****
--- 1,1179 ----
+ static char rcsid[] = "@(#)$Id: bindata.c,v 1.3 2003/11/15 15:51:20 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
+ *

+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
+ *****************************************************************************/
+

+ #include "headers.h"
+ #include "mmaputil.h"
+ #include "cs_imp.h"
+ #include "s_me.h"
+ #include "bindata.h"
+
+ #include <errno.h>


+ #ifndef ANSI_C
+ extern int errno;
+ #endif
+

+ DEBUG_VAR(Debug,__FILE__,"charset");
+
+ static unsigned char * us_str P_((char *str));
+ static unsigned char * us_str(str)
+ char *str;
+ {
+ return (unsigned char *)str;
+ }
+
+ #ifdef MMAP
+ #include <sys/mman.h>
+
+ #ifndef MAP_FAILED
+ #define MAP_FAILED (void *)(-1)
+ #endif
+
+ #endif
+
+ #define TEXT_MAGIC "ELMME+\n"
+ /* TEXT_MAGIC is 8 bytes (including \0) */
+
+ struct bindata_header_1 {
+ uint8 text_magic[sizeof TEXT_MAGIC];
+ uint16 magic;
+ uint16 header_size;
+ uint16 page_size;
+ uint16 map_rev_map_div; /* MAP_REV_MAP_DIV */
+
+ uint16 csets_size;
+ uint16 csets_pagecount;
+ };
+
+ #define MAP_FILENAME_SIZE 32
+
+ struct csets_1 { /* both type 'binary' and 'ascii_set' is used same record */
+ uint8 filename[MAP_FILENAME_SIZE]; /* filename on elm.map.txt
+ zero filled */
+ uint16 map[256]; /* charset byte to unicode */
+ uint8 revmap[MAP_REV_MAP_DIV]; /* unicode to charset byte mapping */
+ };
+
+
+ #define BINDATA_magic 0xFB01
+
+ enum bindata_format { bindata_bad = 0, bindata_format_1 = BINDATA_magic };
+
+ struct bindata_format_1 {
+ int byte_swapped;
+ int mmapped;
+
+ struct bindata_header_1 *header;
+ size_t header_length;
+
+ struct csets_1 *csets;
+ size_t csets_length;
+ off_t csets_offset;
+ int csets_count;
+ };
+
+
+ /* This macro requires ANSI C preprocessor */
+ #if __STDC__
+ #define SYSCALL(x) { int ret_=x; int err_=errno;\
+ if (ret_ == -1) \
+ DPRINT(Debug,1,(&Debug,"bindata: syscall %s failed: errno=%d (%s)\n", \
+ #x,err_,error_description(err_))); }
+ #else
+ #define SYSCALL(x) x
+ #endif
+
+ static void free_bindata_1 P_((struct bindata_format_1 *v));
+ static void free_bindata_1(v)
+ struct bindata_format_1 *v;
+ {
+ if (!v->mmapped) { /* malloced */
+ if (v->header_length)
+ free(v->header);
+ if (v->csets_length)
+ free(v->csets);
+ } else {
+ #ifdef MMAP
+ if (v->header_length)
+ SYSCALL(munmap((void *)v->header,v->header_length));
+ if (v->csets_length)
+ SYSCALL(munmap((void *)v->csets,v->csets_length));
+ #else
+ panic("BINDATA PANIC",__FILE__,__LINE__,"free_bindata_1",
+ "bindata: Internal error -- mmap not available",0);
+ #endif
+ v->mmapped = 0;
+ }
+ v->header = NULL;
+ v->csets = NULL;
+
+ v->header_length = 0;
+ v->csets_length = 0;
+ }
+
+ /* Allocate maximun needed space */
+ static void malloc_bindata_1 P_((struct bindata_format_1 *v, int cscount));
+ static void malloc_bindata_1(v,cscount)
+ struct bindata_format_1 *v;
+ int cscount;
+ {
+ #ifdef MMAP
+ uint16 pagesize = getpagesize();
+ #else
+ uint16 pagesize = 512;
+ #endif
+ uint16 header_pages, csets_pages;
+
+ v->byte_swapped = 0; /* generated -- not swapped */
+ v->mmapped = 0; /* malloced -- not mapped */
+
+ v->header_length = sizeof (struct bindata_header_1);
+ v->header = safe_malloc(v->header_length);
+ header_pages = pages(v->header_length,pagesize);
+
+
+ v->csets_length = cscount * sizeof (struct csets_1);
+ v->csets = safe_malloc(v->csets_length);
+ csets_pages = pages(v->csets_length,pagesize);
+ v->csets_count = 0;
+ v->csets_offset = pagesize * (off_t) header_pages;
+
+ strfcpy((char *)v->header->text_magic,
+ TEXT_MAGIC,sizeof v->header->text_magic);
+ v->header->magic = bindata_format_1;
+ v->header->header_size = sizeof (struct bindata_header_1);
+ v->header->page_size = pagesize;
+ v->header->map_rev_map_div = MAP_REV_MAP_DIV;
+ v->header->csets_size = sizeof (struct csets_1);
+ v->header->csets_pagecount = csets_pages;
+ }
+
+ #define READ_VALUE(x,byte_swapped) (byte_swapped ? SWAP(x) : x)
+
+ static void dump_header P_((struct bindata_format_1 *v,
+ int byte_swapped,
+ CONST char *filename));
+
+ static int write_bindata_1 P_((struct bindata_format_1 *v, int fd,
+ CONST char *filename));
+ static int write_bindata_1(v, fd, filename)
+ struct bindata_format_1 *v;
+ int fd;
+ CONST char *filename;
+ {
+ uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
+ uint16 csets_pages = READ_VALUE(v->header->csets_pagecount,
+ v->byte_swapped);
+
+ if (!write_range(fd,0,v->header_length,(unsigned char*)v->header)) {


+ int err = errno;
+

+ DPRINT(Debug,1,(&Debug,
+ "bindata: write_range failed: errno=%d (%s)\n", \
+ err,error_description(err)));
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ filename, error_description(err));


+
+ return 0;
+ }
+

+ if (!write_range(fd,v->csets_offset,v->csets_length,
+ (unsigned char *)(v->csets))) {


+ int err = errno;
+

+ DPRINT(Debug,1,(&Debug,
+ "bindata: write_range failed: errno=%d (%s)\n", \
+ err,error_description(err)));
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ filename, error_description(err));


+
+ return 0;
+ }
+

+ if (v->csets_length < csets_pages * (size_t) pagesize) {
+ /* Be sure that file is big enough */
+
+ if (!write_range(fd,
+ v->csets_offset +
+ csets_pages * (off_t) pagesize -1,
+ 1, us_str(" "))) {


+ int err = errno;
+

+ DPRINT(Debug,1,(&Debug,
+ "bindata: write_range failed: errno=%d (%s)\n", \
+ err,error_description(err)));
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ filename, error_description(err));

+ return 0;
+ }
+ }

+ dump_header(v,v->byte_swapped,filename);


+ return 1;
+ }
+

+ static void dump_header(v,byte_swapped,filename)
+ struct bindata_format_1 *v;
+ int byte_swapped;
+ CONST char *filename;
+ {
+ if (v->header) {
+ DPRINT(Debug,40,(&Debug,"============ Header dump: %-15s =======\n",
+ filename));
+ DPRINT(Debug,40,(&Debug,"BYTE SWAPPED = %d\n",byte_swapped));
+ DPRINT(Debug,40,(&Debug,
+ "magic %04X header_size %04X page_size %04X\n",
+ READ_VALUE(v->header->magic,v->byte_swapped),
+ READ_VALUE(v->header->header_size,v->byte_swapped),
+ READ_VALUE(v->header->page_size,v->byte_swapped)));
+ DPRINT(Debug,40,(&Debug,
+ "map_rev_map_div %04X csets_size %04X\n",
+ READ_VALUE(v->header->map_rev_map_div,v->byte_swapped),
+ READ_VALUE(v->header->csets_size,v->byte_swapped)));
+ DPRINT(Debug,40,(&Debug,
+ "csets_pagecount %04X\n",
+ READ_VALUE(v->header->csets_pagecount,v->byte_swapped)));
+ DPRINT(Debug,40,(&Debug,"============ End dump: %-15s =======\n",
+ filename));


+ }
+
+ }
+
+

+ static int calculate_sizes P_((struct bindata_format_1 *v,
+ CONST char *filename));
+
+ static int calculate_sizes (v,filename)
+ struct bindata_format_1 *v;
+ CONST char *filename;
+ {
+ uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
+ uint16 header_pages, csets_pages;
+
+ if (READ_VALUE(v->header->header_size,v->byte_swapped) !=
+ sizeof (struct bindata_header_1) ||
+ READ_VALUE(v->header->csets_size,v->byte_swapped) !=
+ sizeof (struct csets_1)) {
+
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeCorruptedMapfile,
+ "Mapfile %.30s is corrupted"),
+ filename);
+ DPRINT(Debug,1,(&Debug,"calculate_sizes failed #1 -- sizeof check\n"));


+ return 0;
+ }
+

+ if (READ_VALUE(v->header->map_rev_map_div,v->byte_swapped) !=
+ MAP_REV_MAP_DIV) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeCorruptedMapfile,
+ "Mapfile %.30s is corrupted"),
+ filename);
+ DPRINT(Debug,1,(&Debug,"calculate_sizes failed #2 -- MAP_REV_MAP_DIV\n"));


+ return 0;
+
+ }
+

+ header_pages = pages(v->header_length,pagesize);
+ v->csets_offset = pagesize * (off_t) header_pages;
+ csets_pages = READ_VALUE(v->header->csets_pagecount,v->byte_swapped);
+
+ v->csets_length = pagesize * (off_t) csets_pages;
+ /* May give too big value */
+ v->csets_count = v->csets_length / sizeof (struct csets_1);


+
+ return 1;
+ }
+

+ static void debug_output P_((struct bindata_format_1 *v,
+ int status, int pagesize, char *str,
+ CONST char *filename));
+ static void debug_output(v,status,pagesize,str,filename)
+ struct bindata_format_1 *v;
+ int status;
+ int pagesize;
+ char *str;
+ CONST char *filename;
+ {
+ DPRINT(Debug,1,(&Debug,
+ "%s: %s: status=%d, csets_count=%d, pagesize=%d\n",
+ filename,str,status,v->csets_count, pagesize));
+ DPRINT(Debug,1,(&Debug,
+ "%s: %s: header_length=%d, csets_length=%d,\n",
+ filename,str,v->header_length,v->csets_length));
+
+ if (v->header) {
+ DPRINT(Debug,5,(&Debug,
+ "%s: %s: swapped=%d, page_size=%d, csets_pages=%d\n",
+ filename,str,v->byte_swapped,
+ READ_VALUE(v->header->page_size,
+ v->byte_swapped),
+ READ_VALUE(v->header->csets_pagecount,
+ v->byte_swapped)));
+ }
+ }
+
+
+ static int read_bindata_1 P_((struct bindata_format_1 *v, int fd,
+ int byte_swapped, CONST char *filename));
+ static int read_bindata_1(v, fd, byte_swapped, filename)
+ struct bindata_format_1 *v;
+ int fd;
+ int byte_swapped;
+ CONST char *filename;
+ {
+ int status = 0;
+ uint16 pagesize;
+
+ v->byte_swapped = byte_swapped;
+ v->mmapped = 0;
+
+ v->header_length = sizeof (struct bindata_header_1);
+ v->header = safe_malloc(v->header_length);
+
+ if (!read_range(fd,0,v->header_length,(unsigned char*)v->header)) {


+ int err = errno;
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
+ "File %.50s is unreadable: %s"),
+ filename, error_description(err));
+
+ status = 0;
+ goto fail_1;
+ }
+
+ pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
+
+ dump_header(v,byte_swapped,filename);
+ if (!calculate_sizes(v,filename)) {
+ status = 0;
+ goto fail_1;
+ }
+
+ v->csets = safe_malloc(v->csets_length);
+ if (!read_range(fd,v->csets_offset,v->csets_length,
+ (unsigned char *)(v->csets))) {


+ int err = errno;
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
+ "File %.50s is unreadable: %s"),
+ filename, error_description(err));
+
+ status = 0;
+ goto fail_2;
+ }
+
+ status = 1;
+
+ if (!status) {
+
+ fail_2:
+ free(v->csets);
+ v->csets = NULL;
+ v->csets_length = 0;
+
+ fail_1:
+ free(v->header);
+ v->header = NULL;
+ v->header_length = 0;
+
+ }
+
+ debug_output(v,status,pagesize,"read",filename);
+
+ return status;
+ }
+
+
+ static int mmap_bindata_1 P_((struct bindata_format_1 *v, int fd,
+ int byte_swapped, CONST char *filename));
+ static int mmap_bindata_1(v, fd, byte_swapped, filename)
+ struct bindata_format_1 *v;
+ int fd;
+ int byte_swapped;
+ CONST char *filename;
+ {
+ int status = 0;
+ #ifdef MMAP
+ uint16 real_pagesize = getpagesize();
+ uint16 pagesize = 0;
+ void * result;
+
+ v->byte_swapped = byte_swapped;
+ v->mmapped = 1;
+
+ v->header_length = sizeof (struct bindata_header_1);
+ result = mmap(0,v->header_length,PROT_READ,MAP_SHARED,fd,0);
+ if (result == MAP_FAILED) {


+ int err = errno;
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
+ "Failed to mmap %.50s: %30s"),
+ filename, error_description(err));
+
+ v->header = NULL;
+ v->header_length = 0;
+ status = 0;
+ goto fail_1;
+ }
+
+ v->header = result;
+ pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
+
+ if (pagesize < real_pagesize || pagesize % real_pagesize != 0) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeIncompatiblePagesize,
+ "Pagesize of %.50s (%d) incompatible with system pagesize (%d)"),
+ filename, pagesize,real_pagesize);
+ status = 0;
+ goto fail_2;
+ }
+
+ dump_header(v,byte_swapped,filename);
+ if (!calculate_sizes(v,filename)) {
+ status = 0;
+ goto fail_2;
+ }
+
+ result = mmap(0,v->csets_length,PROT_READ,MAP_SHARED,fd,
+ v->csets_offset);
+ if (result == MAP_FAILED) {


+ int err = errno;
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
+ "Failed to mmap %.50s: %30s"),
+ filename, error_description(err));
+
+ v->csets = NULL;
+ v->csets_length = 0;
+ status = 0;
+ goto fail_2;
+ }
+ v->csets = result;
+
+
+ status = 1;
+
+ if (!status) {
+
+ fail_2:
+ SYSCALL(munmap((void *)v->header,v->header_length));
+ v->header = NULL;
+ v->header_length = 0;
+ }
+
+ fail_1:
+
+
+ debug_output(v,status,pagesize,"mmap",filename);
+ #endif
+
+ return status;
+ }
+
+ static void trim_bindata_1 P_((struct bindata_format_1 *v));
+ static void trim_bindata_1(v)
+ struct bindata_format_1 *v;
+ {
+ /* If malloced, truncate according of usage */
+ if (!v->mmapped && !v->byte_swapped) {
+ uint16 pagesize = v->header->page_size;
+
+ int n = v->csets_count;
+ if (n < 1) n = 1;
+
+ v->csets_length = n * sizeof (struct csets_1);
+ v->header->csets_pagecount = pages(v->csets_length,pagesize);
+ v->csets = safe_realloc(v->csets,v->csets_length);
+
+ }
+
+ /* zero fill unused area */
+ if (v->csets_count * sizeof (struct csets_1) < v->csets_length) {
+
+ /* bzero is defined on hdrs/defs.h
+ * notice pointer arithmetic
+ */
+ bzero((void *)(v->csets + v->csets_count),
+ v->csets_length - v->csets_count * sizeof (struct csets_1));
+ }
+ }
+
+
+ struct bindata_mapped_data {
+ enum bindata_format format;
+ union {
+ struct bindata_format_1 f1;
+ } v;
+ };
+
+ void free_bindata(v)
+ struct bindata_mapped_data * v;
+ {
+ switch(v->format) {
+ case bindata_format_1: free_bindata_1(&(v->v.f1));
+ break;
+ }
+ v->format = bindata_bad;
+ free(v);
+ }
+
+
+ int write_bindata(v,filename)
+ struct bindata_mapped_data *v;
+ CONST char *filename;
+ {
+ char *tmpname;
+ int fd, err;
+ int status = 0;
+
+ if (0 != access(filename,WRITE_ACCESS)) {


+ int err = errno;
+

+ DPRINT(Debug,1,(&Debug,
+ "bindata: access failed: errno=%d (%s)\n", \
+ err,error_description(err)));
+
+ if (err != ENOENT) {


+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ filename, error_description(err));


+
+ return 0;
+ }
+ }
+

+ tmpname = safe_strdup(filename);
+ tmpname = strmcat(tmpname,".N");
+
+ err = can_open(tmpname,"w");
+ if (err) {
+ DPRINT(Debug,1,(&Debug,
+ "bindata: can_open failed: code=%d (%s)\n", \
+ err,error_description(err)));
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ tmpname, error_description(err));
+
+ status = 0;


+ goto fail;
+ }
+

+ fd = open(tmpname,O_WRONLY|O_CREAT|O_EXCL,0644);
+ if (-1 == fd) {


+ int err = errno;
+

+ DPRINT(Debug,1,(&Debug,
+ "bindata: open failed: errno=%d (%s)\n", \
+ err,error_description(err)));
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ tmpname, error_description(err));
+ status = 0;


+ goto fail;
+ }
+

+ switch(v->format) {
+ case bindata_format_1:
+ status = write_bindata_1(&(v->v.f1),fd,tmpname);
+ break;
+ }
+
+ if (-1 == close(fd)) {


+ int err = errno;
+

+ DPRINT(Debug,1,(&Debug,
+ "bindata: close failed: errno=%d (%s)\n", \
+ err,error_description(err)));
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ tmpname, error_description(err));
+ status = 0;


+ goto fail;
+ }
+

+ if (status) {
+ if (-1 == rename(tmpname,filename)) {


+ int err = errno;

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
+ "Failed to rename temporary file to %.50s: %.30s"),

+ filename, error_description(err));
+ status = 0;


+ goto fail;
+ }
+ }
+

+ fail:
+ if (tmpname)
+ free(tmpname);
+ return status;
+ }
+
+
+
+ int get_bindata(ptr,filename)
+ struct bindata_mapped_data **ptr;
+ CONST char *filename;
+ {
+ struct bindata_mapped_data * res = *ptr;
+ int status = 0;
+
+ int fd, err;
+ uint8 text_magic[sizeof TEXT_MAGIC];
+ uint16 magic;
+ int n;
+
+ err = can_open(filename,"r");
+ if (err) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
+ "File %.50s is unreadable: %s"),
+ filename, error_description(err));


+ return 0;
+ }
+

+ fd = open(filename,O_RDONLY);
+ if (-1 == fd) {


+ int err = errno;
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
+ "File %.50s is unreadable: %s"),
+ filename, error_description(err));


+ return 0;
+ }
+

+ n = read(fd,text_magic, sizeof text_magic);
+ if (n != 8) { /* text_magic is assumed to be 8 bytes or
+ there is error
+ */
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeCorruptedMapfile,
+ "Mapfile %.30s is corrupted"),
+ filename);
+ close(fd);
+ DPRINT(Debug,1,(&Debug,"get_bindata failed #1 -- text_magic read\n"));


+ return 0;
+ }
+

+ if (0 != memcmp(text_magic,TEXT_MAGIC,8)) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeCorruptedMapfile,
+ "Mapfile %.30s is corrupted"),
+ filename);
+ close(fd);
+ DPRINT(Debug,1,(&Debug,
+ "get_bindata failed #1 -- text_magic is wrong: %.8s\n",
+ text_magic));


+ return 0;
+ }
+

+ n = read(fd,(void *)&magic, sizeof magic);
+ if (n != 2) { /* magic is assumed to be 2 bytes or
+ * there is 'Configure' error...
+ */
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeCorruptedMapfile,
+ "Mapfile %.30s is corrupted"),
+ filename);
+ close(fd);
+ DPRINT(Debug,1,(&Debug,"get_bindata failed #1 -- magic read\n"));


+ return 0;
+ }
+

+ if (res)
+ free_bindata(res);
+ res = NULL;
+
+ res = safe_malloc(sizeof (struct bindata_mapped_data));
+ res->format = bindata_bad;
+
+
+ if (bindata_format_1 == magic) {
+ res->format = bindata_format_1;
+ if (!mmap_bindata_1(&(res->v.f1),fd,0,filename) &&
+ !read_bindata_1(&(res->v.f1),fd,0,filename)) {
+ status = 0;
+ } else
+ status = 1;
+ } else if (bindata_format_1 == SWAP(magic)) {
+ res->format = bindata_format_1;
+ if (!mmap_bindata_1(&(res->v.f1),fd,1,filename) &&
+ !read_bindata_1(&(res->v.f1),fd,1,filename)) {
+ status = 0;
+ } else
+ status = 1;
+ } else {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeCorruptedMapfile,
+ "Mapfile %.30s is corrupted"),
+ filename);
+ DPRINT(Debug,1,(&Debug, "get_bindata failed #2 -- magic check\n"));
+ status = 0;
+ }
+
+ if (!status) {
+ if (res)
+ free(res);
+ res = NULL;
+ }
+ close(fd);
+
+ *ptr = res;
+ return status;
+ }
+
+ static char * u8s_to_cs P_((uint8 *s));
+ static char * u8s_to_cs(s)
+ uint8 *s;
+ {
+ return (char *)s;
+ }
+
+
+
+ static int add_bindata_1_map P_((struct bindata_format_1 *v,
+ uint16 bytevector[256],
+ unsigned char revvector[MAP_REV_MAP_DIV],
+ const char *filename));
+
+ static int add_bindata_1_map(v,bytevector,revvector,filename)
+ struct bindata_format_1 *v;
+ uint16 bytevector[256];
+ unsigned char revvector[MAP_REV_MAP_DIV];
+ const char *filename;
+ {
+ int status = 0,i;
+ struct csets_1 *y;
+ int L;
+
+ if (v->mmapped || v->byte_swapped) {
+ DPRINT(Debug,1,(&Debug,"add_bindata_1_map failed #1 -- not malloced\n"));


+ return 0;
+ }
+

+ if (strlen(filename) >= sizeof (y->filename)) {
+ DPRINT(Debug,1,(&Debug,"add_bindata_1_map failed #2 -- too long filename\n"));


+ return 0;
+ }
+
+

+ L = (v->csets_count+1) * sizeof (v->csets[0]);
+ if (v->csets_length < L) {
+ uint16 pagesize = v->header->page_size;
+ v->csets_length = L;
+ v->header->csets_pagecount = pages(v->csets_length,pagesize);
+ v->csets = safe_realloc(v->csets, v->csets_length);
+ }
+
+ y = & (v->csets[v->csets_count] );
+
+ /* strncpy will \0 fill remainig space if needed
+ There is \0 on end because strlen(filename) < sizeof (y->filename)
+ */
+ strncpy(u8s_to_cs(y->filename),filename,sizeof (y->filename));
+
+
+ for (i = 0; i < 256; i++)
+ y->map[i] = bytevector[i];
+ for (i = 0; i < MAP_REV_MAP_DIV; i++)
+ y->revmap[i] = revvector[i];
+
+ v->csets_count++;
+ status = 1;
+
+ return status;
+
+ }
+
+ int add_bindata_map(v,bytevector,revvector,filename)
+ struct bindata_mapped_data * v;
+ uint16 bytevector[256];
+ unsigned char revvector[MAP_REV_MAP_DIV];
+ const char *filename;
+ {
+ int r = 0;
+
+ switch(v->format) {
+ case bindata_format_1:
+ r = add_bindata_1_map(&(v->v.f1),
+ bytevector,revvector,filename);
+ break;
+ }
+

+ return r;
+ }
+

+ struct bindata_mapped_data * malloc_bindata(cscount)
+ int cscount;
+ {
+ struct bindata_mapped_data *v = safe_malloc(sizeof (*v));
+
+ v->format = bindata_format_1;
+ malloc_bindata_1(&(v->v.f1),cscount);
+
+ return v;
+ }
+
+
+ void trim_bindata(v)
+ struct bindata_mapped_data * v;
+ {
+
+ switch(v->format) {
+ case bindata_format_1:
+ trim_bindata_1(&(v->v.f1));


+ break;
+ }
+ }
+
+

+ static int write_bindata_text_1 P_((struct bindata_format_1 *v,
+ const char *dir, char ***filelist));
+ static int write_bindata_text_1(v, dir, filelist)
+ struct bindata_format_1 *v;
+ CONST char *dir;
+ char ***filelist;
+ {
+ int status = 0;
+ char **list = NULL;
+ int m,Y = 0;;
+
+ if (!v->csets_count)
+ goto fail1;
+
+ list = safe_malloc((v->csets_count +1) * sizeof (list[0]));
+
+ for (m = 0; m < v->csets_count; m++) {
+
+ char * name = NULL;
+ FILE *F;
+ int i;
+ int err;
+
+ if (! v->csets[m].filename[0])
+ continue;
+
+ name = elm_message(FRM("%s/%s"),
+ dir,v->csets[m].filename);
+
+ err = can_open(name,"w");
+ if (err) {
+ DPRINT(Debug,1,(&Debug,
+ "bindata: can_open failed: code=%d (%s)\n", \
+ err,error_description(err)));
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ name, error_description(err));
+
+ status = 0;


+ goto fail;
+ }
+

+ F = fopen(name,"w");
+ if (!F) {


+ int err = errno;

+ DPRINT(Debug,1,(&Debug,
+ "bindata: fopen failed: code=%d (%s)\n",
+ err,error_description(err)));
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ name, error_description(err));
+
+ status = 0;


+ goto fail;
+ }
+

+ fprintf(F,"# %s\n",v->csets[m].filename);
+
+ for (i = 0; i < 256; i++) {
+ uint16 x = READ_VALUE(v->csets[m].map[i],v->byte_swapped);
+
+ if (MAPPING_NONE == x) {
+ fprintf(F,
+ "0x%02X\t\t# NO VALUE\n",
+ i);
+ } else {
+ fprintf(F,
+ "0x%02X\t0x%04X\t#\n",
+ i,x);
+ }
+ }
+
+
+ if (EOF == fflush(F)) {


+ int err = errno;

+ DPRINT(Debug,1,(&Debug,
+ "bindata: fflush failed: code=%d (%s)\n", \
+ err,error_description(err)));
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ name, error_description(err));
+
+ status = 0;
+ }
+
+ fclose(F);
+
+ list[Y++] = name;
+ name = NULL;
+
+ fail:
+ if (name)
+ free(name);
+ }
+
+ fail1:
+ list[Y] = NULL;
+
+ *filelist = list;
+ return status;
+ }
+
+
+ int write_bindata_text(v,dir,filelist)
+ struct bindata_mapped_data *v;
+ CONST char * dir;
+ char ***filelist;
+ {
+ int status = 0;
+ char ** list = NULL;
+
+ switch(v->format) {
+ case bindata_format_1:
+ status = write_bindata_text_1(&(v->v.f1),dir,&list);
+ break;
+ }
+
+ *filelist = list;
+ return status;
+ }
+
+ struct bindata_map_1 {
+ struct bindata_format_1 *header;
+ int cset_number;
+ };
+
+ struct bindata_map {
+ enum bindata_format format;
+ union {
+ struct bindata_map_1 f1;
+ } v;
+ };
+
+ struct bindata_map * give_mapping_1 P_((struct bindata_format_1 *v,
+ const char *mapname));
+ struct bindata_map * give_mapping_1(v, mapname)
+ struct bindata_format_1 *v;
+ CONST char *mapname;
+ {
+ struct bindata_map *ret = NULL;
+ int m;
+
+ for (m = 0; m < v->csets_count; m++) {
+ if (0 == strcmp(u8s_to_cs(v->csets[m].filename),
+ mapname))
+ break;
+ }
+ if (m >= v->csets_count)
+ return NULL;
+
+ ret = safe_malloc(sizeof (*ret));
+ /* bzero is defined on hdrs/defs.h
+ */
+
+ bzero(ret, sizeof (*ret));
+
+ ret->format = bindata_format_1;
+ ret->v.f1.header = v;
+ ret->v.f1.cset_number = m;
+

+ return ret;
+ }
+

+ struct bindata_map * give_mapping(v,mapname)
+ struct bindata_mapped_data *v;
+ const char *mapname;
+ {
+ struct bindata_map *ret = NULL;
+
+ switch(v->format) {
+ case bindata_format_1:
+ ret = give_mapping_1(&(v->v.f1),mapname);

+ break;
+ }
+
+

+ return ret;
+ }
+
+

+ static unsigned char lookup_binmap_rev_1 P_((struct bindata_map_1 *map,
+ unsigned int val,
+ int * found));
+ static unsigned char lookup_binmap_rev_1(map,val,found)
+ struct bindata_map_1 *map;
+ unsigned int val;
+ int * found;
+ {
+ unsigned char c;
+ int i;
+
+ int byte_swapped = map->header->byte_swapped;
+ struct csets_1 * cset = & (map->header->csets[map->cset_number]);
+
+ /* map is two byte,
+ revmap is one byte
+ */
+
+ *found = 0;
+ c = cset->revmap[val % MAP_REV_MAP_DIV];
+
+ /* Check case no collision */
+ if (READ_VALUE(cset->map[c],byte_swapped) == val) {
+ *found = 1;


+ return c;
+ }
+

+ if (!c)
+ return 0;
+
+ /* Do scan on case of collision */
+ for (i = 0; i < 256; i++) {
+ if (val == READ_VALUE(cset->map[i],byte_swapped)) {
+ *found = 1;
+ return i;
+ }
+ }
+ return 0; /* Not found */
+ }
+
+ static uint16 lookup_binmap_1 P_((unsigned int ch,
+ struct bindata_map_1 *map,
+ int *found));
+ static uint16 lookup_binmap_1(ch,map,found)
+ unsigned int ch;
+ struct bindata_map_1 *map;
+ int *found;
+ {
+ uint16 val;
+
+ int byte_swapped = map->header->byte_swapped;
+ struct csets_1 * cset = & (map->header->csets[map->cset_number]);
+
+ /* map is two byte,
+ revmap is one byte
+ */
+
+ val = READ_VALUE(cset->map[ch],byte_swapped);
+ if (val != MAPPING_NONE) {
+ *found = 1;
+ return val;
+ }
+
+ return 0x003F; /* '?' */
+ }
+
+ unsigned char lookup_binmap_rev(map,val,found)
+ struct bindata_map *map;
+ unsigned int val;
+ int * found;
+ {
+ *found = 0;
+
+ switch(map->format) {
+ case bindata_format_1:
+ return lookup_binmap_rev_1(& (map->v.f1),val,found);
+ }


+
+ return 0;
+ }
+

+ uint16 lookup_binmap(ch,map,found)
+ unsigned int ch;
+ struct bindata_map *map;
+ int *found;
+ {
+ *found = 0;
+
+ switch(map->format) {
+ case bindata_format_1:
+ return lookup_binmap_1(ch,& (map->v.f1),found);
+ }
+
+ return 0x003F; /* '?' */
+ }
+
+ /* ---------------------------------------------------------------------- */
+
+ struct bindata_mapped_data * default_bindata()
+ {
+ static struct bindata_mapped_data * res = NULL;
+ static struct bindata_mapped_data * res_global = NULL;
+
+ if (! bindata_path[0]) {
+ DPRINT(Debug,4,(&Debug,
+ "BINDATA path not expanded yet.\n"));
+
+ if (bindata_path_global[0] &&
+ strcmp(bindata_path_global,"none") && !res_global) {
+ static int tried = 0;
+
+ if (!tried) {
+ DPRINT(Debug,4,(&Debug,
+ "Loading (global) BINDATA information ... (file %s)\n",
+ bindata_path_global));
+ if (!get_bindata(&res_global,bindata_path_global)) {
+ DPRINT(Debug,4,(&Debug,
+ "... loading of BINDATA information failed\n"));
+ }
+ tried = 1;
+ }
+ return res_global;
+ }
+
+ if (res_global) {
+ DPRINT(Debug,4,(&Debug,
+ " ... using global.\n"));
+ }
+ return res_global;
+ }
+
+ if (0 != strcmp(bindata_path,"none") && !res) {
+ static int tried = 0;
+
+ if (0 == strcmp(bindata_path,bindata_path_global) && res_global) {
+
+ DPRINT(Debug,4,(&Debug,
+ "Using global as user BINDATA ... (file %s)\n",
+ bindata_path));
+
+ res = res_global;
+ } else if (!tried) {
+ DPRINT(Debug,4,(&Debug,
+ "Loading (user) BINDATA information ... (file %s)\n",
+ bindata_path));
+ if (!get_bindata(&res,bindata_path)) {
+ DPRINT(Debug,4,(&Debug,
+ "... loading of BINDATA information failed\n"));
+ }
+ tried = 1;
+ }
+ }
+ return res;


+ }
+
+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.109-cvs/lib/charset.c
*** elm2.4.ME+.108/lib/charset.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.109-cvs/lib/charset.c 2003-11-09 18:13:37.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: charset.c,v 1.71 2003/05/17 16:13:40 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: charset.c,v 1.72 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.72 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************
*** 298,303 ****
--- 298,304 ----
int do_cs = 0;
struct charset_type * cs_type = NULL;
struct map_info * cs_map = NULL;
+ uint16 MIBenum = 0;

union compare_info D;
D.name = name;
***************
*** 310,316 ****
--- 311,339 ----
ret = ASCII_SET;
}

+ if (ret && &cs_unknown == ret->charset_type) {
+ DPRINT(Debug,9,(&Debug, "MIME_name_to_charset(%s), found=%p as unknown\n",
+ name,ret));
+
+ #ifdef USE_DLOPEN
+ if (!noautodef &&
+ cs_auto_charset(name,&cs_type,&cs_map)) {
+ DPRINT(Debug,9,(&Debug,
+ "MIME_name_to_charset: Using autocreate instead... (MIBenum=%d)\n",
+ (int) ret->MIBenum));
+ do_cs = 1;
+ create = 1;
+
+ ret-> flags &= ~SET_valid; /* Invalidate result so that
+ autocreated set is found instead
+ */
+ MIBenum = ret->MIBenum;

+ goto create_new;


+ }
+ #endif
+ }
+

if (ret) {
DPRINT(Debug,9,(&Debug, "MIME_name_to_charset(%s), found=%p",
name,ret));
***************
*** 395,400 ****
--- 418,424 ----
return NULL;
}

+ create_new:
new.flags = SET_nodata|SET_valid;
new.map_info = NULL;
new.MIME_name = safe_strdup(name);
***************
*** 411,417 ****
new.subtype = NULL;
}
new.iso2022_info = NULL;
! new.MIBenum = 0;
new.codeset = NULL;

ret = add_set(new);
--- 435,441 ----
new.subtype = NULL;
}
new.iso2022_info = NULL;
! new.MIBenum = MIBenum;
new.codeset = NULL;

ret = add_set(new);
Index: elm2.4.ME+.109-cvs/lib/cs_binary.c
*** elm2.4.ME+.108/lib/cs_binary.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109-cvs/lib/cs_binary.c 2003-11-12 20:20:10.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_binary.c,v 1.37 2003/08/31 11:26:15 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cs_binary.c,v 1.40 2003/11/12 18:20:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*

***************
*** 28,33 ****
--- 28,34 ----
#include "headers.h"
#include "s_me.h"
#include "cs_imp.h"
+ #include "bindata.h"

DEBUG_VAR(Debug,__FILE__,"charset");

***************
*** 43,48 ****
--- 44,99 ----
return (unsigned char *)str;
}

+ /* bindata ---------------------------------------------------------------- */
+
+ static uint16 lookup_binmap_0 P_((unsigned int ch,
+ struct map_info *map,
+ int *found));
+
+ static uint16 lookup_binmap_0(ch,map,found)
+ unsigned int ch;
+ struct map_info *map;
+ int *found;
+ {
+
+ *found = 0;
+
+ if (&cs_ascii != map->map_type &&
+ &cs_onebyte != map->map_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"lookup_binmap_0",
+ "Bad maptype",0);
+
+ return lookup_binmap(ch,map->c.bindata,found);
+ }
+
+ static unsigned char lookup_binmap_rev_0 P_((struct map_info *map,
+ unsigned int val,
+ int *found));
+
+ static unsigned char lookup_binmap_rev_0(map,val,found)
+ struct map_info *map;
+ unsigned int val;
+ int *found;
+ {
+
+ *found = 0;
+
+ if (&cs_ascii != map->map_type &&
+ &cs_onebyte != map->map_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"lookup_binmap_rev_0",
+ "Bad maptype",0);
+
+ return lookup_binmap_rev(map->c.bindata,val,found);
+ }
+
+ static struct bindata_ops bindata_ops = {
+ lookup_binmap_0,
+ lookup_binmap_rev_0
+ };
+
+
+ /* ascii ------------------------------------------------------------------ */
+
static void map_ascii_init_rev P_((struct map_info *map));
static void map_ascii_init_rev(map)
struct map_info *map;
***************
*** 51,68 ****
int col = 0;

for (i = 0; i < MAP_REV_MAP_DIV; i++)
! map->b.ascii.map_ascii_rev[i] = 0;

for (i = 0; i < 128; i++)
! map->b.ascii.map_ascii_rev[i] = i;

for (i = 0; i < 128; i++) {
unsigned char c = i + 128;
! uint16 val = map->b.ascii.map_ascii_upper[i];
if (val != MAPPING_NONE) {
! if (map->b.ascii.map_ascii_rev[val % MAP_REV_MAP_DIV])
col++;
! map->b.ascii.map_ascii_rev[val % MAP_REV_MAP_DIV] = c;
}
}

--- 102,119 ----
int col = 0;

for (i = 0; i < MAP_REV_MAP_DIV; i++)
! map->b.ascii->map_ascii_rev[i] = 0;

for (i = 0; i < 128; i++)
! map->b.ascii->map_ascii_rev[i] = i;

for (i = 0; i < 128; i++) {
unsigned char c = i + 128;
! uint16 val = map->b.ascii->map_ascii_upper[i];
if (val != MAPPING_NONE) {
! if (map->b.ascii->map_ascii_rev[val % MAP_REV_MAP_DIV])
col++;
! map->b.ascii->map_ascii_rev[val % MAP_REV_MAP_DIV] = c;
}
}

***************
*** 73,79 ****
}
}

! unsigned char cs_map_ascii_rev(map,val,found)
struct map_info *map;
unsigned int val;
int *found;
--- 124,133 ----
}
}

! static unsigned char cs_map_ascii_rev_0 P_((struct map_info *map,
! unsigned int val,
! int *found));
! static unsigned char cs_map_ascii_rev_0(map,val,found)
struct map_info *map;
unsigned int val;
int *found;
***************
*** 83,105 ****

*found = 0;

- if (val < 128) {
- *found = 1;
- return val;
- }
-
if (&cs_ascii != map->map_type)
! panic("STRING PANIC",__FILE__,__LINE__,"cs_map_ascii_rev",
"Bad maptype",0);

! c = map->b.ascii.map_ascii_rev[val % MAP_REV_MAP_DIV];
if (!c)
return 0x3F; /* '?' */
/* Can't be < 128, because val >= 128 here */
if (c < 128)
return 0x3F; /* '?' */
/* Check case no collision */
! if (map->b.ascii.map_ascii_upper[c - 128] == val) {
*found = 1;
return c;
}
--- 137,154 ----

*found = 0;

if (&cs_ascii != map->map_type)
! panic("STRING PANIC",__FILE__,__LINE__,"cs_map_ascii_rev_0",
"Bad maptype",0);

! c = map->b.ascii->map_ascii_rev[val % MAP_REV_MAP_DIV];
if (!c)
return 0x3F; /* '?' */
/* Can't be < 128, because val >= 128 here */
if (c < 128)
return 0x3F; /* '?' */
/* Check case no collision */
! if (map->b.ascii->map_ascii_upper[c - 128] == val) {
*found = 1;
return c;
}
***************
*** 107,113 ****
/* Do scan on case of collision */
for (i = 0; i < 128; i++) {
unsigned char c = i + 128;
! if (val == map->b.ascii.map_ascii_upper[i]) {
*found = 1;
return c;
}
--- 156,162 ----
/* Do scan on case of collision */
for (i = 0; i < 128; i++) {
unsigned char c = i + 128;
! if (val == map->b.ascii->map_ascii_upper[i]) {
*found = 1;
return c;
}
***************
*** 115,120 ****
--- 164,238 ----
return 0x3F; /* '?' */ /* Not found */
}

+ static uint16 cs_unicode_ascii_helper_0 P_((unsigned int ch,
+ struct map_info *map,
+ int *found));
+ static uint16 cs_unicode_ascii_helper_0(ch,map,found)
+ unsigned int ch;
+ struct map_info *map;
+ int *found;
+ {
+ uint16 val;
+
+ if (&cs_ascii != map->map_type || ch > 255)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_unicode_ascii_helper_0",
+ "Bad maptype or value",0);
+
+ val = map->b.ascii->map_ascii_upper[ch-128];
+ if (val != MAPPING_NONE) {
+ *found = 1;
+ return val;
+ }
+ return 0x003F; /* '?' */
+ }
+
+ static struct bindata_ops ascii_ops = {
+ cs_unicode_ascii_helper_0,
+ cs_map_ascii_rev_0
+ };
+
+ uint16 cs_unicode_ascii_helper_1(ch,map,found)
+ unsigned int ch;
+ struct map_info *map;
+ int *found;
+ {
+ if (ch <= 127) {
+ *found = 1;
+ return ch;
+ }
+
+ if (!map->map_initialized)
+ map->map_init_it(map);
+
+ if (&cs_ascii != map->map_type || ch > 255)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_unicode_ascii_helper_1",
+ "Bad maptype or value",0);
+
+ return map->d.binary_ops->map_it(ch,map,found);
+ }
+
+ unsigned char cs_map_ascii_rev(map,val,found)
+ struct map_info *map;
+ unsigned int val;
+ int *found;
+ {
+ unsigned char c;
+ int i;
+
+ *found = 0;
+
+ if (val < 128) {
+ *found = 1;
+ return val;
+ }
+
+ if (&cs_ascii != map->map_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_map_ascii_rev",
+ "Bad maptype",0);
+
+ return map->d.binary_ops->map_rev_it(map,val,found);
+ }
+
static void map_init_bad P_((struct map_info *map));
static void map_init_bad(map)
struct map_info *map;
***************
*** 161,171 ****
return 1;
}

! map_info -> b.ascii.map_ascii_upper[l1-128] = l2;

return 1;
}


static struct map_info * open_asciimap P_((const char *name));
static struct map_info * open_asciimap(name)
--- 279,321 ----
return 1;
}

! map_info -> b.ascii->map_ascii_upper[l1-128] = l2;

return 1;
}

+ static void add_text_to_asciimap P_((CONST char *name,
+ struct map_info *map,
+ FILE *F, char *fn));
+ static void add_text_to_asciimap(name,map,F,fn)
+ CONST char *name;
+ struct map_info *map;
+ FILE *F;
+ char *fn;
+ {
+ static enum field_type vector[3] = {
+ val_byte, val_unicode, val_comment
+ };
+ int l;
+
+ if (map -> map_type != &cs_ascii)
+ panic("STRING PANIC",__FILE__,__LINE__,"add_text_to_asciimap",
+ "map bad",0);
+
+ if (!map -> b.ascii)
+ map -> b.ascii = safe_malloc(sizeof (* (map -> b.ascii)));
+
+ for (l = 0; l < 128; l++)
+ map -> b.ascii->map_ascii_upper[l] = MAPPING_NONE;
+
+ read_map_format_a(name,map,NULL,
+ F,
+ set_asciimap_value,
+ 3,vector,fn);
+
+ map_ascii_init_rev(map);
+ }
+

static struct map_info * open_asciimap P_((const char *name));
static struct map_info * open_asciimap(name)
***************
*** 173,204 ****
{
struct map_info *ret = NULL;
char *fn = NULL;
! int Index = -1;
! FILE * F = open_mapname(name,&fn,&Index);

if (F) {
- static enum field_type vector[3] = {
- val_byte, val_unicode, val_comment
- };
- int l;

! ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_ascii;
ret -> map_name = safe_strdup(name);
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

! for (l = 0; l < 128; l++)
! ret -> b.ascii.map_ascii_upper[l] = MAPPING_NONE;

- read_map_format_a(name,ret,NULL,
- F,Index,
- set_asciimap_value,
- 3,vector,fn);
-
- map_ascii_init_rev(ret);
fclose(F);
}
if (fn)
free(fn);
return ret;
--- 323,373 ----
{
struct map_info *ret = NULL;
char *fn = NULL;
! FILE *F = NULL;
! struct bindata_mapped_data * F1 = default_bindata();
!
! if (F1) {
! struct bindata_map * X = give_mapping(F1,name);
!
! if (X) {
! ret = safe_malloc(sizeof (*ret));
! ret -> map_type = &cs_ascii;
! ret -> map_name = safe_strdup(name);
! ret -> b.ascii = NULL;
! ret -> c.bindata = X;
! ret -> d.binary_ops = &bindata_ops;
!
! ret -> map_initialized = 1;
! ret -> map_init_it = map_init_bad;

+ DPRINT(Debug,5,(&Debug,
+ "Map %s -- using bindata\n",ret->map_name));
+

+ return ret;
+ }
+ }
+

+ F = open_mapname(name,&fn);
if (F) {

! ret = safe_malloc(sizeof (*ret));
ret -> map_type = &cs_ascii;
ret -> map_name = safe_strdup(name);
+ ret -> b.ascii = safe_malloc(sizeof (* (ret -> b.ascii)));
+ ret -> c.dummy = NULL;
+ ret -> d.binary_ops = &ascii_ops;
+
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

! add_text_to_asciimap(name,ret,F,fn);

fclose(F);
+
+ DPRINT(Debug,5,(&Debug,
+ "Map %s -- using text data\n",ret->map_name));
}
+
if (fn)
free(fn);
return ret;
***************
*** 214,221 ****
{
int i;

for (i = 0; i < 128; i++) {
! map->b.ascii.map_ascii_upper[i] = MAPPING_NONE;
}
map_ascii_init_rev(map);
map->map_initialized = 1;
--- 383,391 ----
{
int i;

+ map -> b.ascii = safe_malloc(sizeof (* (map -> b.ascii)));
for (i = 0; i < 128; i++) {
! map->b.ascii->map_ascii_upper[i] = MAPPING_NONE;
}
map_ascii_init_rev(map);
map->map_initialized = 1;
***************
*** 226,232 ****


struct map_info map_ascii = {
! &cs_ascii, "US-ASCII", 0, map_init_us_ascii, 0 };

/* ISO-8859-1 ------------------------------------------------------------ */

--- 396,402 ----


struct map_info map_ascii = {
! &cs_ascii, "US-ASCII", 0, map_init_us_ascii, NULL, NULL, &ascii_ops };

/* ISO-8859-1 ------------------------------------------------------------ */

***************
*** 236,243 ****
{
int i;

for (i = 0; i < 128; i++) {
! map->b.ascii.map_ascii_upper[i] = i + 128;
}

map_ascii_init_rev(map);
--- 406,414 ----
{
int i;

+ map -> b.ascii = safe_malloc(sizeof (* (map -> b.ascii)));
for (i = 0; i < 128; i++) {
! map->b.ascii->map_ascii_upper[i] = i + 128;
}

map_ascii_init_rev(map);
***************
*** 248,254 ****
}

struct map_info map_latin1 = {
! &cs_ascii, "ISO-8859-1", 0, map_init_latin1, 0 };


/* KOI8-R ------------------------------------------------------------ */
--- 419,425 ----
}

struct map_info map_latin1 = {
! &cs_ascii, "ISO-8859-1", 0, map_init_latin1, NULL, NULL, &ascii_ops };


/* KOI8-R ------------------------------------------------------------ */
***************
*** 281,288 ****
{
int i;

for (i = 0; i < 128; i++) {
! map->b.ascii.map_ascii_upper[i] = koi82unicode[i];
}

map_ascii_init_rev(map);
--- 452,460 ----
{
int i;

+ map -> b.ascii = safe_malloc(sizeof (* (map -> b.ascii)));
for (i = 0; i < 128; i++) {
! map->b.ascii->map_ascii_upper[i] = koi82unicode[i];
}

map_ascii_init_rev(map);
***************
*** 293,299 ****
}

struct map_info map_koi8r = {
! &cs_ascii, "KOI8-R", 0, map_init_koi8r, 0 };

/* KOI8-U ------------------------------------------------------------ */

--- 465,471 ----
}

struct map_info map_koi8r = {
! &cs_ascii, "KOI8-R", 0, map_init_koi8r, NULL, NULL, &ascii_ops };

/* KOI8-U ------------------------------------------------------------ */

***************
*** 328,341 ****
struct charshort *replace;
int i;

/* Initialize with koi8r */
for (i = 0; i < 128; i++) {
! map->b.ascii.map_ascii_upper[i] = koi82unicode[i];
}

/* replace the few koi8-u specific additions: */
for (replace = koi8u_additions; replace->byte; replace++)
! map->b.ascii.map_ascii_upper[replace->byte-128] =
replace->unicode;

map_ascii_init_rev(map);
--- 500,514 ----
struct charshort *replace;
int i;

+ map -> b.ascii = safe_malloc(sizeof (* (map -> b.ascii)));
/* Initialize with koi8r */
for (i = 0; i < 128; i++) {
! map->b.ascii->map_ascii_upper[i] = koi82unicode[i];
}

/* replace the few koi8-u specific additions: */
for (replace = koi8u_additions; replace->byte; replace++)
! map->b.ascii->map_ascii_upper[replace->byte-128] =
replace->unicode;

map_ascii_init_rev(map);
***************
*** 346,352 ****
}

struct map_info map_koi8u = {
! &cs_ascii, "KOI8-U", 0, map_init_koi8u, 0 };

/* CP1251 ------------------------------------------------------------ */

--- 519,525 ----
}

struct map_info map_koi8u = {
! &cs_ascii, "KOI8-U", 0, map_init_koi8u, NULL, NULL, &ascii_ops };

/* CP1251 ------------------------------------------------------------ */

***************
*** 377,384 ****
{
int i;

for (i = 0; i < 128; i++) {
! map->b.ascii.map_ascii_upper[i] = cp12512unicode[i];
}

map_ascii_init_rev(map);
--- 550,558 ----
{
int i;

+ map -> b.ascii = safe_malloc(sizeof (* (map -> b.ascii)));
for (i = 0; i < 128; i++) {
! map->b.ascii->map_ascii_upper[i] = cp12512unicode[i];
}

map_ascii_init_rev(map);
***************
*** 389,395 ****
}

struct map_info map_cp1251 = {
! &cs_ascii, "CP1251", 0, map_init_cp1251, 0 };

/* CP1252 ------------------------------------------------------------ */

--- 563,569 ----
}

struct map_info map_cp1251 = {
! &cs_ascii, "CP1251", 0, map_init_cp1251, NULL, NULL, &ascii_ops };

/* CP1252 ------------------------------------------------------------ */

***************
*** 429,436 ****
{
int i;

for (i = 0; i < 128; i++) {
! map->b.ascii.map_ascii_upper[i] = cp12522unicode[i];
}

map_ascii_init_rev(map);
--- 603,611 ----
{
int i;

+ map -> b.ascii = safe_malloc(sizeof (* (map -> b.ascii)));
for (i = 0; i < 128; i++) {
! map->b.ascii->map_ascii_upper[i] = cp12522unicode[i];
}

map_ascii_init_rev(map);
***************
*** 440,446 ****
"Map %s initialized\n",map->map_name));
}

! struct map_info map_cp1252 = { &cs_ascii, "CP1252", 0, map_init_cp1252, 0 };


/* ISO-8859-15 ---------------------------------------------------------- */
--- 615,622 ----
"Map %s initialized\n",map->map_name));
}

! struct map_info map_cp1252 = { &cs_ascii, "CP1252", 0,
! map_init_cp1252, NULL, NULL, &ascii_ops };


/* ISO-8859-15 ---------------------------------------------------------- */
***************
*** 470,477 ****
{
int i;

for (i = 0; i < 128; i++) {
! map->b.ascii.map_ascii_upper[i] = iso8859152unicode[i];
}

map_ascii_init_rev(map);
--- 646,654 ----
{
int i;

+ map -> b.ascii = safe_malloc(sizeof (* (map -> b.ascii)));
for (i = 0; i < 128; i++) {
! map->b.ascii->map_ascii_upper[i] = iso8859152unicode[i];
}

map_ascii_init_rev(map);
***************
*** 482,488 ****
}


! struct map_info map_885915 = { &cs_ascii, "ISO-8859-15", 0, map_init_885915, 0 };

/* bytemap --------------------------------------------------------------- */

--- 659,666 ----
}


! struct map_info map_885915 = { &cs_ascii, "ISO-8859-15", 0, map_init_885915,
! NULL, NULL, &ascii_ops };

/* bytemap --------------------------------------------------------------- */

***************
*** 494,507 ****
int col = 0;

for (i = 0; i < MAP_REV_MAP_DIV; i++)
! map->b.bytemap.map_bytemap_rev[i] = 0;

for (i = 0; i < 256; i++) {
! uint16 val = map->b.bytemap.map[i];
if (val != MAPPING_NONE) {
! if (map->b.bytemap.map_bytemap_rev[val % MAP_REV_MAP_DIV])
col++;
! map->b.bytemap.map_bytemap_rev[val % MAP_REV_MAP_DIV] = i;
}
}

--- 672,685 ----
int col = 0;

for (i = 0; i < MAP_REV_MAP_DIV; i++)
! map->b.bytemap->map_bytemap_rev[i] = 0;

for (i = 0; i < 256; i++) {
! uint16 val = map->b.bytemap->map[i];
if (val != MAPPING_NONE) {
! if (map->b.bytemap->map_bytemap_rev[val % MAP_REV_MAP_DIV])
col++;
! map->b.bytemap->map_bytemap_rev[val % MAP_REV_MAP_DIV] = i;
}
}

***************
*** 512,518 ****
}
}

! unsigned char cs_map_bytemap_rev(map,val,found)
struct map_info *map;
unsigned int val;
int * found;
--- 690,699 ----
}
}

! static unsigned char cs_map_bytemap_rev_0 P_((struct map_info *map,
! unsigned int val,
! int * found));
! static unsigned char cs_map_bytemap_rev_0(map,val,found)
struct map_info *map;
unsigned int val;
int * found;
***************
*** 521,534 ****
int i;

if (&cs_onebyte != map->map_type)
! panic("STRING PANIC",__FILE__,__LINE__," cs_map_bytemap_rev",
"Bad maptype",0);

*found = 0;
! c = map->b.bytemap.map_bytemap_rev[val % MAP_REV_MAP_DIV];

/* Check case no collision */
! if (map->b.bytemap.map[c] == val) {
*found = 1;
return c;
}
--- 702,715 ----
int i;

if (&cs_onebyte != map->map_type)
! panic("STRING PANIC",__FILE__,__LINE__," cs_map_bytemap_rev_0",
"Bad maptype",0);

*found = 0;
! c = map->b.bytemap->map_bytemap_rev[val % MAP_REV_MAP_DIV];

/* Check case no collision */
! if (map->b.bytemap->map[c] == val) {
*found = 1;
return c;
}
***************
*** 538,544 ****

/* Do scan on case of collision */
for (i = 0; i < 256; i++) {
! if (val == map->b.bytemap.map[i]) {
*found = 1;
return i;
}
--- 719,725 ----

/* Do scan on case of collision */
for (i = 0; i < 256; i++) {
! if (val == map->b.bytemap->map[i]) {
*found = 1;
return i;
}
***************
*** 546,551 ****
--- 727,790 ----
return 0; /* Not found */
}

+ static uint16 cs_unicode_bytemap_helper_0 P_((unsigned int ch,
+ struct map_info *map,
+ int *found));
+ static uint16 cs_unicode_bytemap_helper_0(ch,map,found)
+ unsigned int ch;
+ struct map_info *map;
+ int *found;
+ {
+ uint16 val;
+
+ if (&cs_onebyte != map->map_type || ch > 255)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_unicode_bytemap_helper_0",
+ "Bad maptype or value",0);
+
+ val = map->b.bytemap->map[ch];
+ if (val != MAPPING_NONE) {
+ *found = 1;
+ return val;
+ }
+
+ return 0x003F; /* '?' */
+ }
+
+
+ static struct bindata_ops bytemap_ops = {
+ cs_unicode_bytemap_helper_0,
+ cs_map_bytemap_rev_0
+ };
+
+ uint16 cs_unicode_bytemap_helper_1(ch,map,found)
+ unsigned int ch;
+ struct map_info *map;
+ int *found;
+ {
+
+ if (&cs_onebyte != map->map_type || ch > 255)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_unicode_bytemap_helper_1",
+ "Bad maptype or value",0);
+
+ return map->d.binary_ops->map_it(ch,map,found);
+ }
+
+ unsigned char cs_map_bytemap_rev(map,val,found)
+ struct map_info *map;
+ unsigned int val;
+ int * found;
+ {
+ unsigned char c;
+ int i;
+
+ if (&cs_onebyte != map->map_type)
+ panic("STRING PANIC",__FILE__,__LINE__," cs_map_bytemap_rev",
+ "Bad maptype",0);
+
+ return map->d.binary_ops->map_rev_it(map,val,found);
+ }
+
+
#if ANSI_C
static set_map_callmap set_bytemap_value;
#endif
***************
*** 574,623 ****
return 0;
}

! map_info -> b.bytemap.map[l1] = l2;

return 1;
}

static struct map_info * open_bytemap P_((const char *name));
static struct map_info * open_bytemap(name)
CONST char *name;
{
struct map_info *ret = NULL;
char *fn = NULL;
! int Index = -1;
! FILE * F = open_mapname(name,&fn,&Index);

if (F) {
- static enum field_type vector[3] = {
- val_byte, val_unicode, val_comment
- };
- int l;

ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_onebyte;
ret -> map_name = safe_strdup(name);
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

! /* We assume that values < 32 are same control characters
! * on all sets -- after all MIME requires that on all
! * character sets characters CR and LF are on same position
! */
! for (l = 0; l < 32; l++)
! ret -> b.bytemap.map[l] = l;
!
! for (l = 32; l < 256; l++)
! ret -> b.bytemap.map[l] = MAPPING_NONE;

- read_map_format_a(name,ret,NULL,
- F,Index,
- set_bytemap_value,
- 3,vector,fn);
-
- map_bytemap_init_rev(ret);
fclose(F);
}
if (fn)
free(fn);
return ret;
--- 813,917 ----
return 0;
}

! map_info -> b.bytemap->map[l1] = l2;

return 1;
}

+ static void add_text_to_bytemap P_((CONST char *name,
+ struct map_info *map,
+ FILE *F, char *fn));
+ static void add_text_to_bytemap(name,map,F,fn)
+ CONST char *name;
+ struct map_info *map;
+ FILE *F;
+ char *fn;
+ {
+ static enum field_type vector[3] = {
+ val_byte, val_unicode, val_comment
+ };
+ int l;
+
+
+ if (map -> map_type != &cs_onebyte)
+ panic("STRING PANIC",__FILE__,__LINE__,"add_text_to_bytemap",
+ "map bad",0);
+
+ if (!map -> b.bytemap)
+ map -> b.bytemap = safe_malloc(sizeof (* (map -> b.bytemap)));
+
+
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position
+ */
+ for (l = 0; l < 32; l++)
+ map -> b.bytemap->map[l] = l;
+
+ for (l = 32; l < 256; l++)
+ map -> b.bytemap->map[l] = MAPPING_NONE;
+
+ read_map_format_a(name,map,NULL,
+ F,
+ set_bytemap_value,
+ 3,vector,fn);
+
+ map_bytemap_init_rev(map);
+ }
+
+
static struct map_info * open_bytemap P_((const char *name));
static struct map_info * open_bytemap(name)
CONST char *name;
{
struct map_info *ret = NULL;
char *fn = NULL;
!
! FILE *F = NULL;
! struct bindata_mapped_data * F1 = default_bindata();
!
! if (F1) {
! struct bindata_map * X = give_mapping(F1,name);
!
! if (X) {
! ret = safe_malloc(sizeof (*ret));
! ret -> map_type = &cs_onebyte;
! ret -> map_name = safe_strdup(name);
! ret -> b.bytemap = NULL;
! ret -> c.bindata = X;
! ret -> d.binary_ops = &bindata_ops;
!
! ret -> map_initialized = 1;
! ret -> map_init_it = map_init_bad;
!
! DPRINT(Debug,5,(&Debug,
! "Map %s -- using bindata\n",ret->map_name));
!
! return ret;
! }
! }
!
! F = open_mapname(name,&fn);

if (F) {

ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_onebyte;
ret -> map_name = safe_strdup(name);
+ ret -> b.bytemap = safe_malloc(sizeof (* (ret -> b.bytemap)));
+ ret -> c.dummy = NULL;
+ ret -> d.binary_ops = &bytemap_ops;
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

! add_text_to_bytemap(name,ret,F,fn);

fclose(F);
+
+ DPRINT(Debug,5,(&Debug,
+ "Map %s -- using text data\n",ret->map_name));
}
+
if (fn)
free(fn);
return ret;
***************
*** 670,676 ****

/* ISO 646 variant part */
for (i = 0; i < 12; i++) {
! if (map->b.iso646[i] == val) {
*found = 1;
return variant_vector[i];
}
--- 964,970 ----

/* ISO 646 variant part */
for (i = 0; i < 12; i++) {
! if (map->b.iso646->iso646[i] == val) {
*found = 1;
return variant_vector[i];
}
***************
*** 702,708 ****
map->map_init_it(map);

/* ISO 646 variant part */
! return map->b.iso646[idx];
}
return MAPPING_NONE;
}
--- 996,1002 ----
map->map_init_it(map);

/* ISO 646 variant part */
! return map->b.iso646->iso646[idx];
}
return MAPPING_NONE;
}
***************
*** 714,721 ****
struct map_info *map;
{
int i;
for (i = 0; i < 12; i++)
! map->b.iso646[i] = MAPPING_NONE;

map->map_initialized = 1;

--- 1008,1017 ----
struct map_info *map;
{
int i;
+
+ map -> b.iso646 = safe_malloc(sizeof (* (map -> b.iso646)));
for (i = 0; i < 12; i++)
! map->b.iso646->iso646[i] = MAPPING_NONE;

map->map_initialized = 1;

***************
*** 725,734 ****


struct map_info map_invariant = { &cs_iso646, "INVARIANT", 0,
! map_init_invariant, 0 };

/* ----------------------------------------------------------------------- */

static void cs_init_binary P_((struct string *str));
static void cs_init_binary(str)
struct string *str;
--- 1021,1149 ----


struct map_info map_invariant = { &cs_iso646, "INVARIANT", 0,
! map_init_invariant, NULL, NULL, NULL };

/* ----------------------------------------------------------------------- */

+ /* Used by generate_bindata and cs_find_ascii */
+ static struct map_info **asciimaps = NULL;
+ static int asciimap_count = 0;
+
+ /* Used by generate_bindata and cs_find_bytemap */
+ static struct map_info **bytemaps = NULL;
+ static int bytemap_count = 0;
+
+
+
+
+ struct bindata_mapped_data *generate_bindata()
+ {
+ struct bindata_mapped_data *r;
+
+ int c = asciimap_count + bytemap_count;
+ int i;
+
+ r = malloc_bindata(c);
+
+ for (i = 0; i < asciimap_count; i++) {
+ if (is_on_mapdir(asciimaps[i]->map_name)) {
+
+ /* MAP do not have necessary b.ascii structure
+ if bindata is on use, because we want regenerate it
+ we need parse textual map
+ */
+
+ if (!asciimaps[i]->b.ascii) {
+ char *fn = NULL;
+ FILE * F = open_mapname(asciimaps[i]->map_name,&fn);
+ if (F) {
+
+ add_text_to_asciimap(asciimaps[i]->map_name,
+ asciimaps[i],F,fn);
+
+ fclose(F);
+ }
+
+ if (fn)
+ free(fn);
+ }
+
+ if (asciimaps[i]->b.ascii) {
+ uint16 vector[256];
+
+ int x;
+ for (x = 0; x < 128; x++)
+ vector[x] = x;
+ for (x = 128; x < 256; x++)
+ vector[x] = asciimaps[i]->b.ascii->map_ascii_upper[x-128];
+
+ DPRINT(Debug,4,(&Debug,
+ "... Adding ascii/upper map %s\n",
+ asciimaps[i]->map_name));
+
+ if (!add_bindata_map(r,vector,
+ asciimaps[i]->b.ascii->map_ascii_rev,
+ asciimaps[i]->map_name)) {
+ DPRINT(Debug,4,(&Debug,
+ "Ascii/upper map %s can't be added to binary table\n",
+ asciimaps[i]->map_name));


+ }
+ }
+ }
+ }
+
+

+ for (i = 0; i < bytemap_count; i++) {
+
+ if (is_on_mapdir(bytemaps[i]->map_name)) {
+
+ /* MAP do not have necessary b.bytemap structure
+ if bindata is on use, because we want regenerate it
+ we need parse textual map
+ */
+
+ if (!bytemaps[i]->b.bytemap) {
+ char *fn = NULL;
+ FILE * F = open_mapname(bytemaps[i]->map_name,&fn);
+ if (F) {
+
+ add_text_to_bytemap(bytemaps[i]->map_name,
+ bytemaps[i],F,fn);
+
+ fclose(F);
+ }
+
+ if (fn)
+ free(fn);
+ }
+
+ if (bytemaps[i]->b.bytemap) {
+
+ DPRINT(Debug,4,(&Debug,
+ "... Adding single byte map %s\n",
+ bytemaps[i]->map_name));
+
+
+ if (!add_bindata_map(r,
+ bytemaps[i]->b.bytemap->map,
+ bytemaps[i]->b.bytemap->map_bytemap_rev,
+ bytemaps[i]->map_name)) {
+ DPRINT(Debug,4,(&Debug,
+ "Single byte map %s can't be added to binary table\n",
+ bytemaps[i]->map_name));


+ }
+ }
+ }
+ }
+

+ trim_bindata(r);


+
+ return r;
+ }
+
+

+ /* ======================================================================== */
+
static void cs_init_binary P_((struct string *str));
static void cs_init_binary(str)
struct string *str;
***************
*** 892,917 ****
}
}

- uint16 cs_unicode_bytemap_helper_1(ch,map,found)
- unsigned int ch;
- struct map_info *map;
- int *found;
- {
- uint16 val;
-
- if (&cs_onebyte != map->map_type || ch > 255)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_unicode_bytemap_helper_1",
- "Bad maptype or value",0);
-
- val = map->b.bytemap.map[ch];
- if (val != MAPPING_NONE) {
- *found = 1;
- return val;
- }
-
- return 0x003F; /* '?' */
- }
-
static uint16 cs_unicode_bytemap_helper P_((unsigned int ch,
charset_t set, int *found));

--- 1307,1312 ----
***************
*** 976,1008 ****
return cs_unicode_bytemap_helper(ch,st->charset,found);
}

- uint16 cs_unicode_ascii_helper_1(ch,map,found)
- unsigned int ch;
- struct map_info *map;
- int *found;
- {
- uint16 val;
-
- if (ch <= 127) {
- *found = 1;
- return ch;
- }
-
- if (!map->map_initialized)
- map->map_init_it(map);
-
- if (&cs_ascii != map->map_type || ch > 255)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_unicode_ascii_helper_1",
- "Bad maptype or value",0);
-
- val = map->b.ascii.map_ascii_upper[ch-128];
- if (val != MAPPING_NONE) {
- *found = 1;
- return val;
- }
- return 0x003F; /* '?' */
- }
-
static uint16 cs_unicode_ascii_helper P_((unsigned int ch,
charset_t set, int *found));
static uint16 cs_unicode_ascii_helper(ch,set, found)
--- 1371,1376 ----
***************
*** 1923,1932 ****

for (i = 0; i < str->p->len; i++) {
unsigned char ch = str->p->a.bytes[i];
- uint16 val = str->string_type->map_info->b.bytemap.map[ch];

! /* Note that also MAPPING_NONE > 127 */
! if (val > 127)
return 0;
}
return 1;
--- 2291,2303 ----

for (i = 0; i < str->p->len; i++) {
unsigned char ch = str->p->a.bytes[i];

! int found;
! uint16 val = val =
! cs_unicode_bytemap_helper_1(ch,str->string_type->map_info,
! &found);
!
! if (!found || val > 127)
return 0;
}
return 1;
***************
*** 2301,2312 ****
else if (str->p->a.bytes[i] > 127 &&
str->string_type->map_info) {
unsigned char ch = str->p->a.bytes[i];
! uint16 val;
! if (!str->string_type->map_info->map_initialized)
! str->string_type->map_info->map_init_it(str->string_type->map_info);
! val = str->string_type->map_info->b.ascii.map_ascii_upper[ch-128];

! if (val == MAPPING_NONE ||
unicode_ch(val,UOP_noctrl) == 0)
str->p->a.bytes[i] = 32;
}
--- 2672,2681 ----
else if (str->p->a.bytes[i] > 127 &&
str->string_type->map_info) {
unsigned char ch = str->p->a.bytes[i];
! int found;
! uint16 val = cs_unicode_ascii_helper_1(ch,str->string_type->map_info,&found);

! if (!found ||
unicode_ch(val,UOP_noctrl) == 0)
str->p->a.bytes[i] = 32;
}
***************
*** 2336,2344 ****

if (str->string_type->map_info) {
unsigned char ch = str->p->a.bytes[i];
! uint16 val = str->string_type->map_info->b.bytemap.map[ch];

! if (val == MAPPING_NONE ||
unicode_ch(val,UOP_noctrl) == 0)
str->p->a.bytes[i] = rep;
}
--- 2705,2714 ----

if (str->string_type->map_info) {
unsigned char ch = str->p->a.bytes[i];
! int found;
! uint16 val = cs_unicode_bytemap_helper_1(ch,str->string_type->map_info,&found);

! if (!found ||
unicode_ch(val,UOP_noctrl) == 0)
str->p->a.bytes[i] = rep;
}
***************
*** 2372,2380 ****
static struct map_info * cs_find_bytemap(map_name)
CONST char * map_name;
{
- static struct map_info **bytemaps = NULL;
- static int bytemap_count = 0;
-
int i;
struct map_info *ret;

--- 2742,2747 ----
***************
*** 2396,2403 ****
static struct map_info * cs_find_ascii(map_name)
CONST char * map_name;
{
- static struct map_info **asciimaps = NULL;
- static int asciimap_count = 0;
struct map_info *ret;


--- 2763,2768 ----
***************
*** 2491,2497 ****
for (i = 0; i < dyn_map_count; i++) {
int j;
for (j = 0; j < 12; j++)
! if (vector[j] != dyn_maps[i]->b.iso646[j])
break;
if (12 == j)
ret = dyn_maps[i];
--- 2856,2862 ----
for (i = 0; i < dyn_map_count; i++) {
int j;
for (j = 0; j < 12; j++)
! if (vector[j] != dyn_maps[i]->b.iso646->iso646[j])
break;
if (12 == j)
ret = dyn_maps[i];
***************
*** 2502,2512 ****
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_iso646;
ret -> map_name = safe_strdup(map_name);
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

for (i = 0; i < 12; i++)
! ret->b.iso646[i] = vector[i];

dyn_maps = safe_realloc(dyn_maps,
(dyn_map_count + 1) *
--- 2867,2878 ----
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_iso646;
ret -> map_name = safe_strdup(map_name);
+ ret -> b.iso646 = safe_malloc(sizeof (* (ret -> b.iso646)));
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

for (i = 0; i < 12; i++)
! ret->b.iso646->iso646[i] = vector[i];

dyn_maps = safe_realloc(dyn_maps,
(dyn_map_count + 1) *
***************
*** 2736,2743 ****
}

static int cs_iso2022_info_set_unknown P_((struct charcode_info *new_vals,
! struct setlist *new_setlist,
! int setcount));
static int cs_iso2022_info_set_unknown(new_vals, new_setlist,setcount)
struct charcode_info *new_vals;
struct setlist *new_setlist;
--- 3102,3109 ----
}

static int cs_iso2022_info_set_unknown P_((struct charcode_info *new_vals,
! struct setlist *new_setlist,
! int setcount));
static int cs_iso2022_info_set_unknown(new_vals, new_setlist,setcount)
struct charcode_info *new_vals;
struct setlist *new_setlist;
Index: elm2.4.ME+.109-cvs/lib/cs_iso2022.c
*** elm2.4.ME+.108/lib/cs_iso2022.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.109-cvs/lib/cs_iso2022.c 2003-11-09 18:13:37.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.32 2003/05/26 15:19:04 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.33 2003/11/09 16:13:37 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 73,85 ****
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_iso2022;
ret -> map_name = safe_strdup(map_name);
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

for (i = 0;
! i < sizeof (ret->b.setlist) / sizeof (ret->b.setlist[0]);
i++) {
! ret->b.setlist[i] = i < count ? setlist[i] : -1;
}

return ret;
--- 73,87 ----
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_iso2022;
ret -> map_name = safe_strdup(map_name);
+ ret -> b.setlist = safe_malloc(sizeof (* (ret -> b.setlist)));
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

for (i = 0;
! i < sizeof (ret->b.setlist->setlist) /
! sizeof (ret->b.setlist->setlist[0]);
i++) {
! ret->b.setlist->setlist[i] = i < count ? setlist[i] : -1;
}

return ret;
***************
*** 119,131 ****
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_euc;
ret -> map_name = safe_strdup(map_name);
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

for (i = 0;
! i < sizeof (ret->b.setlist) / sizeof (ret->b.setlist[0]);
i++) {
! ret->b.setlist[i] = i < count ? setlist[i] : -1;
}

return ret;
--- 121,135 ----
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_euc;
ret -> map_name = safe_strdup(map_name);
+ ret -> b.setlist = safe_malloc(sizeof (* (ret -> b.setlist)));
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

for (i = 0;
! i < sizeof (ret->b.setlist->setlist) /
! sizeof (ret->b.setlist->setlist[0]);
i++) {
! ret->b.setlist->setlist[i] = i < count ? setlist[i] : -1;
}

return ret;
***************
*** 147,153 ****
for (count = 0; p[count]; count++) {
int i;
if (count >=
! sizeof (map->b.setlist) / sizeof (map->b.setlist[0]))
panic("STRING PANIC",__FILE__,__LINE__,"find_with_list",
"Too many maps",0);

--- 151,158 ----
for (count = 0; p[count]; count++) {
int i;
if (count >=
! sizeof (map->b.setlist->setlist) /
! sizeof (map->b.setlist->setlist[0]))
panic("STRING PANIC",__FILE__,__LINE__,"find_with_list",
"Too many maps",0);

***************
*** 161,175 ****
if (!iso2022_map_list[i].map)
panic("STRING PANIC",__FILE__,__LINE__,"find_with_list",
"No map for set",0);
! map->b.setlist[count] = i;

! DPRINT(Debug,61,(&Debug," %d",map->b.setlist[count]));
}

DPRINT(Debug,61,(&Debug,"\n"));

! while (count < sizeof (map->b.setlist) / sizeof (map->b.setlist[0]))
! map->b.setlist[count++] = -1;
}

/* ASCII -------------------------------------------------------------- */
--- 166,181 ----
if (!iso2022_map_list[i].map)
panic("STRING PANIC",__FILE__,__LINE__,"find_with_list",
"No map for set",0);
! map->b.setlist->setlist[count] = i;

! DPRINT(Debug,61,(&Debug," %d",map->b.setlist->setlist[count]));
}

DPRINT(Debug,61,(&Debug,"\n"));

! while (count < sizeof (map->b.setlist->setlist) /
! sizeof (map->b.setlist->setlist[0]))
! map->b.setlist->setlist[count++] = -1;
}

/* ASCII -------------------------------------------------------------- */
***************
*** 180,185 ****
--- 186,193 ----
{
struct iso2022_setid *XX[2] = { NULL, NULL };

+ map -> b.setlist = safe_malloc(sizeof (* (map -> b.setlist)));
+
XX[0] = ASCII_BANK;

find_with_list(XX,map);
***************
*** 209,214 ****
--- 217,224 ----
struct iso2022_setid *XX[3] = { NULL, NULL,
NULL };

+ map -> b.setlist = safe_malloc(sizeof (* (map -> b.setlist)));
+
XX[0] = ASCII_BANK;
XX[1] = LATIN1_BANK;

***************
*** 445,455 ****
iso2022_info->sets[X1->parts[i].set_index]) {

X1->parts[i].iso2022_map_index =
! give_iso2022_index(map->b.setlist,
! sizeof (map->b.setlist) /
! sizeof (map->b.setlist[0]),
iso2022_info->sets[X1->parts[i].
! set_index]);
} else
panic("ISO2022 PANIC",__FILE__,__LINE__,
"fill_iso2022_map_index",
--- 455,465 ----
iso2022_info->sets[X1->parts[i].set_index]) {

X1->parts[i].iso2022_map_index =
! give_iso2022_index(map->b.setlist->setlist,
! sizeof (map->b.setlist->setlist) /
! sizeof (map->b.setlist->setlist[0]),
iso2022_info->sets[X1->parts[i].
! set_index]);
} else
panic("ISO2022 PANIC",__FILE__,__LINE__,
"fill_iso2022_map_index",
***************
*** 1351,1359 ****
if (!map->map_initialized)
map->map_init_it(map);

! for (s = 0; s < sizeof (map->b.setlist) / sizeof (map->b.setlist[0]);
s++) {
! int iso2022_map_index = map->b.setlist[s];

if (-1 != iso2022_map_index &&
map_unicode_to_ISO2022_word_1(unicode,type,iso2022_map_index,
--- 1361,1370 ----
if (!map->map_initialized)
map->map_init_it(map);

! for (s = 0; s < sizeof (map->b.setlist->setlist) /
! sizeof (map->b.setlist->setlist[0]);
s++) {
! int iso2022_map_index = map->b.setlist->setlist[s];

if (-1 != iso2022_map_index &&
map_unicode_to_ISO2022_word_1(unicode,type,iso2022_map_index,
***************
*** 4105,4114 ****
st->charset->map_info->map_init_it(st->charset->map_info);

iso2022_map_index =
! give_iso2022_index(st->charset->map_info->b.setlist,
! sizeof (st->charset->map_info->b.setlist) /
sizeof (st->charset->map_info->
! b.setlist[0]),
st->charset->iso2022_info->
sets[X->banks[X->bank].iso2022_info_index]);

--- 4116,4126 ----
st->charset->map_info->map_init_it(st->charset->map_info);

iso2022_map_index =
! give_iso2022_index(st->charset->map_info->b.setlist->setlist,
! sizeof (st->charset->map_info->b.setlist->
! setlist) /
sizeof (st->charset->map_info->
! b.setlist->setlist[0]),
st->charset->iso2022_info->
sets[X->banks[X->bank].iso2022_info_index]);

Index: elm2.4.ME+.109-cvs/lib/cs_utf.c
*** elm2.4.ME+.108/lib/cs_utf.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.109-cvs/lib/cs_utf.c 2003-11-09 18:13:37.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_utf.c,v 1.23 2002/06/28 18:33:11 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: cs_utf.c,v 1.24 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 73,83 ****
if (!map->map_initialized)
map->map_init_it(map);

! for (i = 0; i < map->b.utfmap.elem_count; i++) {
! if (ch >= map->b.utfmap.elems[i].start &&
! ch <= map->b.utfmap.elems[i].end) {
! return ( ch - map->b.utfmap.elems[i].start ) +
! map->b.utfmap.elems[i].unicodeval;
}
}
}
--- 73,83 ----
if (!map->map_initialized)
map->map_init_it(map);

! for (i = 0; i < map->b.utfmap->elem_count; i++) {
! if (ch >= map->b.utfmap->elems[i].start &&
! ch <= map->b.utfmap->elems[i].end) {
! return ( ch - map->b.utfmap->elems[i].start ) +
! map->b.utfmap->elems[i].unicodeval;
}
}
}
***************
*** 102,115 ****
if (!map->map_initialized)
map->map_init_it(map);

! for (i = 0; i < map->b.utfmap.elem_count; i++) {
! int n = map->b.utfmap.elems[i].end -
! map->b.utfmap.elems[i].start;
! if (val >= map->b.utfmap.elems[i].unicodeval &&
! val <= map->b.utfmap.elems[i].unicodeval+n) {
*found = 1;
! return ( val - map->b.utfmap.elems[i].unicodeval ) +
! map->b.utfmap.elems[i].start;
}
}
}
--- 102,115 ----
if (!map->map_initialized)
map->map_init_it(map);

! for (i = 0; i < map->b.utfmap->elem_count; i++) {
! int n = map->b.utfmap->elems[i].end -
! map->b.utfmap->elems[i].start;
! if (val >= map->b.utfmap->elems[i].unicodeval &&
! val <= map->b.utfmap->elems[i].unicodeval+n) {
*found = 1;
! return ( val - map->b.utfmap->elems[i].unicodeval ) +
! map->b.utfmap->elems[i].start;
}
}
}
***************
*** 121,128 ****
static void map_init_utfX(map)
struct map_info *map;
{
! map->b.utfmap.elem_count = sizeof (utfXelems) / sizeof (utfXelems[0]);
! map->b.utfmap.elems = utfXelems;
map->map_initialized = 1;

DPRINT(Debug,5,(&Debug,
--- 121,130 ----
static void map_init_utfX(map)
struct map_info *map;
{
! map->b.utfmap = safe_malloc(sizeof (* (map -> b.utfmap)));
! map->b.utfmap->elem_count =
! sizeof (utfXelems) / sizeof (utfXelems[0]);
! map->b.utfmap->elems = utfXelems;
map->map_initialized = 1;

DPRINT(Debug,5,(&Debug,
***************
*** 169,175 ****
}
}

! F = open_mapname(name,&fn,NULL);
if (!F) {
if (fn)
free(fn);
--- 171,177 ----
}
}

! F = open_mapname(name,&fn);
if (!F) {
if (fn)
free(fn);
***************
*** 258,267 ****
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_utf8;
ret -> map_name = safe_strdup(map_name);
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;
! ret -> b.utfmap.elem_count = elemcount;
! ret -> b.utfmap.elems = elems;
}

return ret;
--- 260,270 ----
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_utf8;
ret -> map_name = safe_strdup(map_name);
+ ret -> b.utfmap = safe_malloc(sizeof (* (ret -> b.utfmap)));
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;
! ret -> b.utfmap->elem_count = elemcount;
! ret -> b.utfmap->elems = elems;
}

return ret;
***************
*** 279,288 ****
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_utf7;
ret -> map_name = safe_strdup(map_name);
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;
! ret -> b.utfmap.elem_count = elemcount;
! ret -> b.utfmap.elems = elems;
}

return ret;
--- 282,292 ----
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_utf7;
ret -> map_name = safe_strdup(map_name);
+ ret -> b.utfmap = safe_malloc(sizeof (* (ret -> b.utfmap)));
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;
! ret -> b.utfmap->elem_count = elemcount;
! ret -> b.utfmap->elems = elems;
}

return ret;
***************
*** 301,310 ****
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_imap;
ret -> map_name = safe_strdup(map_name);
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;
! ret -> b.utfmap.elem_count = elemcount;
! ret -> b.utfmap.elems = elems;
}

return ret;
--- 305,315 ----
ret = safe_malloc(sizeof (struct map_info));
ret -> map_type = &cs_imap;
ret -> map_name = safe_strdup(map_name);
+ ret -> b.utfmap = safe_malloc(sizeof (* (ret -> b.utfmap)));
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;
! ret -> b.utfmap->elem_count = elemcount;
! ret -> b.utfmap->elems = elems;
}

return ret;
Index: elm2.4.ME+.109-cvs/lib/iso2022_map.c
*** elm2.4.ME+.108/lib/iso2022_map.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.109-cvs/lib/iso2022_map.c 2003-11-09 18:13:37.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iso2022_map.c,v 1.6 2002/07/28 08:55:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: iso2022_map.c,v 1.7 2003/11/09 16:13:37 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 35,87 ****

}

! /* NOT yet used */
! static struct map_list {


! char * name;
!

! } * map_list = NULL;
! static int map_list_count = 0;
!
! static int add_to_index P_((const char *name));
! static int add_to_index(name)
CONST char *name;
{
! int i;
! int ret = -1;
!
! for (i = 0; i < map_list_count; i++)
! if (0 == strcmp(name,map_list[i].name)) {
! ret = i;
! goto ok;
! }
!
! map_list = safe_realloc(map_list,
! (map_list_count+1) * sizeof (map_list[0]));
!
! map_list[map_list_count].name = safe_strdup(name);
!
! ret = map_list_count++;
!
! ok:
!
! DPRINT(Debug,8,(&Debug,
! "Map %s general index=%d\n",name,ret));
!
! return ret;
}

! FILE * open_mapname(name,fn,index)
CONST char *name;
char **fn;
- int *index;
{
int err = 0;
int map_dir = 0;
- int TMP_INDEX = -1;

if ('\0' == *name)
return NULL;
! if (NULL == strpbrk(name,"/$\\;{}()")) {
if (0 != access(map_txtdir,ACCESS_EXISTS)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet,MeNoTxtMapDir,
--- 35,56 ----

}

! int is_on_mapdir(name)
CONST char *name;
{
! return NULL == strpbrk(name,"/$\\;{}()");
}

! FILE * open_mapname(name,fn)
CONST char *name;
char **fn;
{
int err = 0;
int map_dir = 0;

if ('\0' == *name)
return NULL;
! if (is_on_mapdir(name)) {
if (0 != access(map_txtdir,ACCESS_EXISTS)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet,MeNoTxtMapDir,
***************
*** 108,119 ****
if (ENOENT == err && map_dir) {
FILE *F = copy_cb(name,*fn);
if (F) {
-
- if (index) {
- TMP_INDEX = add_to_index(name);
- *index = TMP_INDEX;
- }
-
return F;
}
}
--- 77,82 ----
***************
*** 133,143 ****
return NULL;
}

- if (index) {
- if (map_dir)
- TMP_INDEX = add_to_index(name);
- *index = TMP_INDEX;
- }
return F;
}
return NULL;
--- 96,101 ----
***************
*** 202,208 ****
#define MAX_ERROR 5

void read_map_format_a(name,map_info,iso2022_map_info,
! F,index_number,pass_caller,
field_count, vector,
fn
)
--- 160,166 ----
#define MAX_ERROR 5

void read_map_format_a(name,map_info,iso2022_map_info,
! F,pass_caller,
field_count, vector,
fn
)
***************
*** 210,216 ****
struct map_info *map_info;
struct iso2022_mapinfo *iso2022_map_info;
FILE *F;
- int index_number;
set_map_callmap * pass_caller;
int field_count;
enum field_type *vector;
--- 168,173 ----
***************
*** 303,310 ****


DPRINT(Debug,9,(&Debug,
! "map %d: %s: line %d -- %d fields:\n",
! index_number,name, lineno,count+1));
for (i = 0; i <= count && i < field_count; i++) {
DPRINT(Debug,9,(&Debug," ... field %d: %s\n",
i,col[i].N));
--- 260,267 ----


DPRINT(Debug,9,(&Debug,
! "%s: line %d -- %d fields:\n",
! name, lineno,count+1));
for (i = 0; i <= count && i < field_count; i++) {
DPRINT(Debug,9,(&Debug," ... field %d: %s\n",
i,col[i].N));
***************
*** 332,339 ****

if (count <= i) {
DPRINT(Debug,12,(&Debug,
! "map %d: %s: line %s... no field %d\n",
! index_number,name, buffer, i));
}

if (col[i].N == NULL ||
--- 289,296 ----

if (count <= i) {
DPRINT(Debug,12,(&Debug,
! "%s: line %s... no field %d\n",
! name, buffer, i));
}

if (col[i].N == NULL ||
***************
*** 341,348 ****
'#' == col[i].N[0]) {

DPRINT(Debug,9,(&Debug,
! "map %d: %s: line %s... no mapping\n",
! index_number,name, buffer));

goto no_mapping;
}
--- 298,305 ----
'#' == col[i].N[0]) {

DPRINT(Debug,9,(&Debug,
! "%s: line %s... no mapping\n",
! name, buffer));

goto no_mapping;
}
***************
*** 437,444 ****
ok ++;
} else {
DPRINT(Debug,12,(&Debug,
! "map %d: %s: line %s... no intresting values l1=%ld l2=%ld\n",
! index_number,name, buffer,l1,l2));
}
}

--- 394,401 ----
ok ++;
} else {
DPRINT(Debug,12,(&Debug,
! "%s: line %s... no intresting values l1=%ld l2=%ld\n",
! name, buffer,l1,l2));
}
}

***************
*** 450,457 ****
ok_iso2022++;
} else {
DPRINT(Debug,12,(&Debug,
! "map %d: %s: line %s... no intresting values l1=%ld l2=%ld\n",
! index_number,name, buffer,l1,l2));
}
} else if (96 == iso2022_map_info->vlen &&
( iso2022_94 == iso2022_map_info->type ||
--- 407,414 ----
ok_iso2022++;
} else {
DPRINT(Debug,12,(&Debug,
! "%s: line %s... no intresting values l1=%ld l2=%ld\n",
! name, buffer,l1,l2));
}
} else if (96 == iso2022_map_info->vlen &&
( iso2022_94 == iso2022_map_info->type ||
***************
*** 469,476 ****
ok_iso2022++;
} else {
DPRINT(Debug,12,(&Debug,
! "map %d: %s: line %s... no intresting values l1=%ld l2=%ld\n",
! index_number,name, buffer,l1,l2));
}
} else if (96*96 == iso2022_map_info->vlen &&
( iso2022_94x94 == iso2022_map_info->type ||
--- 426,433 ----
ok_iso2022++;
} else {
DPRINT(Debug,12,(&Debug,
! "%s: line %s... no intresting values l1=%ld l2=%ld\n",
! name, buffer,l1,l2));
}
} else if (96*96 == iso2022_map_info->vlen &&
( iso2022_94x94 == iso2022_map_info->type ||
***************
*** 483,490 ****
ok_iso2022++;
} else {
DPRINT(Debug,12,(&Debug,
! "map %d: %s: line %s... no intresting values lmb=%ld l2=%ld\n",
! index_number,name, buffer,lmb,l2));
}
} else {
panic("ISO2022 PANIC",__FILE__,__LINE__,"read_map_format_a",
--- 440,447 ----
ok_iso2022++;
} else {
DPRINT(Debug,12,(&Debug,
! "%s: line %s... no intresting values lmb=%ld l2=%ld\n",
! name, buffer,lmb,l2));
}
} else {
panic("ISO2022 PANIC",__FILE__,__LINE__,"read_map_format_a",
***************
*** 500,507 ****
col = NULL;

DPRINT(Debug,8,(&Debug,
! "map %d: %s: %d / %d items read\n",
! index_number,name,
ok,ok_iso2022));
}

--- 457,464 ----
col = NULL;

DPRINT(Debug,8,(&Debug,
! "%s: %d / %d items read\n",
! name,
ok,ok_iso2022));
}

***************
*** 596,602 ****
{
struct iso2022_mapinfo * ret = NULL;
char *fn = NULL;
- int Index = -1;
FILE * F;

if ( (code & PF_RANGE) &&
--- 553,558 ----
***************
*** 608,614 ****
}


! F = open_mapname(filename,&fn,&Index);

if (F) {
int i;
--- 564,570 ----
}


! F = open_mapname(filename,&fn);

if (F) {
int i;
***************
*** 642,653 ****
};

if (ret->vlen > 256)
! read_map_format_a(filename,NULL,ret,F,Index,
NULL_set_map_callmap,
4,vector_MB3,fn);

else
! read_map_format_a(filename,NULL,ret,F,Index,
NULL_set_map_callmap,
4,vector_BYTE3,fn);

--- 598,609 ----
};

if (ret->vlen > 256)
! read_map_format_a(filename,NULL,ret,F,
NULL_set_map_callmap,
4,vector_MB3,fn);

else
! read_map_format_a(filename,NULL,ret,F,
NULL_set_map_callmap,
4,vector_BYTE3,fn);

***************
*** 659,665 ****
val_byte, val_unicode, val_comment
};

! read_map_format_a(filename,NULL,ret,F,Index,
NULL_set_map_callmap,
3,vector_BYTE2,fn);

--- 615,621 ----
val_byte, val_unicode, val_comment
};

! read_map_format_a(filename,NULL,ret,F,
NULL_set_map_callmap,
3,vector_BYTE2,fn);

***************
*** 676,687 ****
};

if (ret->vlen > 256)
! read_map_format_a(filename,NULL,ret,F,Index,
NULL_set_map_callmap,
3,vector_MB2,fn);

else
! read_map_format_a(filename,NULL,ret,F,Index,
NULL_set_map_callmap,
3,vector_BYTE2,fn);
}
--- 632,643 ----
};

if (ret->vlen > 256)
! read_map_format_a(filename,NULL,ret,F,
NULL_set_map_callmap,
3,vector_MB2,fn);

else
! read_map_format_a(filename,NULL,ret,F,
NULL_set_map_callmap,
3,vector_BYTE2,fn);
}
Index: elm2.4.ME+.109-cvs/lib/MAGIC
*** elm2.4.ME+.108/lib/MAGIC 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/lib/MAGIC 2003-11-09 18:13:36.000000000 +0200
***************
*** 16,21 ****
--- 16,22 ----
#define SORTDATATYPE_magic 0xFC03
#define RF_magic 0xFA00
#define UNIDATA_magic 0xFB00
+ #define BINDATA_magic 0xFB01
#define HEADER_magic 0xFC00
#define MAIL_HDR_magic 0xFC01
#define EXP_ADDR_magic 0xFC02
Index: elm2.4.ME+.109-cvs/lib/Makefile.SH
*** elm2.4.ME+.108/lib/Makefile.SH 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/lib/Makefile.SH 2003-11-09 18:13:37.000000000 +0200


***************
*** 46,52 ****
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.86 2003/10/01 17:34:34 hurtta Exp $
#
# Makefile for the ELM mail program.
#
--- 46,52 ----
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.87 2003/11/09 16:13:37 hurtta Exp $


#
# Makefile for the ELM mail program.
#
***************

*** 140,145 ****
--- 140,147 ----
# Lists
LIB_SRC = add_site.c \
atonum.c \
+ bindata.c \
+ mmaputil.c \
mk_aliases.c \
aliasdb.c \
mk_lockname.c \
***************
*** 236,241 ****
--- 238,245 ----

LIB_OBJ = add_site.o \
atonum.o \
+ bindata.o \
+ mmaputil.o \
mk_aliases.o \
aliasdb.o \
mk_lockname.o \
***************
*** 388,393 ****
--- 392,400 ----
# --- Dependencies of C object files
add_site.o: $(INCLDIR)/headers.h
atonum.o: $(INCLDIR)/headers.h
+ bindata.o: $(INCLDIR)/headers.h $(INCLDIR)/mmaputil.h \
+ $(INCLDIR)/cs_imp.h $(INCLDIR)/s_me.h $(INCLDIR)/bindata.h
+ mmaputil.o: $(INCLDIR)/headers.h $(INCLDIR)/mmaputil.h
dynarray.o: $(INCLDIR)/headers.h
mk_aliases.o: $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_newalias.h
aliasdb.o: $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
***************
*** 398,406 ****
charset.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/shared_imp.h
precompiled_sets.o: $(INCLDIR)/cs_imp.h $(INCLDIR)/elmlib.h $(INCLDIR)/defs.h
-
charset_input.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_binary.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_fallback.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_utf.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_iso2022.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
--- 405,413 ----
charset.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/shared_imp.h
precompiled_sets.o: $(INCLDIR)/cs_imp.h $(INCLDIR)/elmlib.h $(INCLDIR)/defs.h
charset_input.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_binary.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
! $(INCLDIR)/bindata.h
cs_fallback.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_utf.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_iso2022.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
***************
*** 457,464 ****
rc_handle.o: $(INCLDIR)/headers.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/s_elm.h $(INCLDIR)/rc_imp.h $(INCLDIR)/shared_imp.h
read_rc.o: $(INCLDIR)/headers.h $(INCLDIR)/save_opts.h \
! $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h $(INCLDIR)/rc_imp.h $(INCLDIR)/unidata.h
! realfrom.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h
remote_mbx.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h $(INCLDIR)/ss_imp.h
qstrings.o: $(INCLDIR)/headers.h
--- 464,472 ----
rc_handle.o: $(INCLDIR)/headers.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/s_elm.h $(INCLDIR)/rc_imp.h $(INCLDIR)/shared_imp.h
read_rc.o: $(INCLDIR)/headers.h $(INCLDIR)/save_opts.h \
! $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h $(INCLDIR)/rc_imp.h \
! $(INCLDIR)/unidata.h
! realfrom.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h
remote_mbx.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h $(INCLDIR)/ss_imp.h
qstrings.o: $(INCLDIR)/headers.h
***************
*** 490,496 ****
strtokq.o: $(INCLDIR)/headers.h
syscall.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h
terminal.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
! unicode.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/unidata.h
unidata.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/unidata.h
write_hdr.o: $(INCLDIR)/headers.h
--- 498,504 ----
strtokq.o: $(INCLDIR)/headers.h
syscall.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h
terminal.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
! unicode.o: $(INCLDIR)/headers.h $(INCLDIR)/mmaputil.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/unidata.h
unidata.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/unidata.h
write_hdr.o: $(INCLDIR)/headers.h
Index: elm2.4.ME+.109-cvs/lib/mbox.c
*** elm2.4.ME+.108/lib/mbox.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/lib/mbox.c 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.48 2003/08/04 14:58:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.49 2003/11/11 16:18:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************

***************
*** 2052,2057 ****
--- 2052,2058 ----
else if (hdr->pgp & PGP_SIGNED_MESSAGE) mybuffer[1] = 'S';
else if (hdr->pgp & PGP_PUBLIC_KEY) mybuffer[1] = 'K';
#endif /* USE_PGP */
+ else if (hdr->override_charset) mybuffer[1] = 'o';
}

DPRINT(Debug,11,(&Debug, "show_message_status=%s\n", mybuffer));
Index: elm2.4.ME+.109-cvs/lib/mmaputil.c
*** /tmp/5164-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-11-15 18:08:47.000000000 +0200
--- elm2.4.ME+.109-cvs/lib/mmaputil.c 2003-11-09 18:13:37.000000000 +0200
***************
*** 0 ****
--- 1,128 ----
+ static char rcsid[] = "@(#)$Id: mmaputil.c,v 1.2 2003/11/09 16:13:37 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
+ *****************************************************************************/
+

+ #include "headers.h"
+ #include "mmaputil.h"


+ #include <errno.h>
+ #ifndef ANSI_C
+ extern int errno;
+ #endif
+

+ DEBUG_VAR(Debug,__FILE__,"charset");
+
+ uint16 SWAP (b)
+ int b;
+ {
+ union {
+ uint16 a;
+ unsigned char c[2];
+ } d;
+ unsigned char tmp;
+ d.a = b;
+
+ if (sizeof d.a != 2) {
+ panic("MMAP PANIC",__FILE__,__LINE__,"SWAP",
+ "sizeof uint16 !=2 -- 'Configure' error!",0);
+ }
+ tmp = d.c[0]; d.c[0] = d.c[1]; d.c[1] = tmp;
+ return d.a;
+ }
+
+
+ uint16 pages(len,pagesize)
+ size_t len;
+ int pagesize;
+ {
+ uint16 result = len / pagesize;
+
+ if (len % pagesize != 0)
+ result++;
+ return result;
+ }
+
+ int write_range(fd,offset,length,ptr)
+ int fd;
+ off_t offset;
+ size_t length;
+ unsigned char *ptr;
+ {
+ int status = 1;
+
+ if (-1 == lseek(fd,offset,SEEK_SET)) {


+ int err = errno;

+ status = 0;
+
+ DPRINT(Debug,5,(&Debug,"unidata: lseek failed: errno=%d (%s)\n", \
+ err,error_description(err)));
+

+ goto fail;
+ }
+

+ while (length > 0) {
+ int n = write(fd,ptr,length);
+
+ if (-1 == n) {


+ int err = errno;

+ status = 0;
+
+ DPRINT(Debug,5,(&Debug,"unidata: write failed: errno=%d (%s)\n", \
+ err,error_description(err)));
+
+ goto fail;
+ }
+ length -= n;
+ ptr += n;
+ }
+
+ fail:
+ return status;
+ }
+
+
+ int read_range(fd,offset,length,ptr)
+ int fd;
+ off_t offset;
+ size_t length;
+ unsigned char *ptr;
+ {
+ int status = 1;
+ if (-1 == lseek(fd,offset,SEEK_SET)) {
+ status = 0;


+ goto fail;
+ }
+

+ while (length > 0) {
+ int n = read(fd,ptr,length);
+
+ if (-1 == n) {
+ status = 0;
+ goto fail;
+ }
+ if (0 == n) {
+ errno = EINVAL; /* Simulate error */
+ status = 0;


+ goto fail;
+ }
+

+ length -= n;
+ ptr += n;
+ }
+
+ fail:
+ return status;
+ }
+
+

+ /* KESKEN */
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.109-cvs/lib/read_rc.c
*** elm2.4.ME+.108/lib/read_rc.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/lib/read_rc.c 2003-11-10 17:15:04.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.118 2003/10/11 08:42:11 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.118 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.121 2003/11/10 15:15:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.121 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************

*** 93,98 ****
--- 93,102 ----
char unidata_path[SLEN] = {0}; /* init_defaults */
char raw_unidata_path[SLEN] = "unidata.bin"; /* init_defaults */

+ char bindata_path_global[SLEN] = {0}; /* Used before user elm.rc is read */
+ char bindata_path[SLEN] = {0}; /* init_defaults */
+ char raw_bindata_path[SLEN] = "bindata.bin"; /* init_defaults */
+


char user_rc_file[SLEN] = ELMRCFILE; /* user_init fixes */
***************
*** 306,312 ****
char printout[SLEN] = {0}; /* how to print messages */
char raw_printout[SLEN] = DEFAULT_PRINTOUT;
/* unexpanded how to print messages */
! int prompt_after_pager = 1; /* flag: prompt after pager exits */
int quote_forward = 0; /* flag: fwd'd msgs quoted like replies */
int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/
--- 310,317 ----
char printout[SLEN] = {0}; /* how to print messages */
char raw_printout[SLEN] = DEFAULT_PRINTOUT;
/* unexpanded how to print messages */
! int prompt_after_pager = 1; /* flag: prompt after pager exits */
! int prompt_after_metamail = 1; /* flag: prompt after metamail exits */
int quote_forward = 0; /* flag: fwd'd msgs quoted like replies */
int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/
***************
*** 407,412 ****
--- 412,454 ----
}
}

+ static void expand_map_bin P_((char *descr, char *dest, char *src,
+ unsigned destlen));
+ static void expand_map_bin(descr, dest, src, destlen)
+ char *descr, *dest, *src;
+ unsigned destlen;
+ {
+ if (strcmp(src,"none") == 0 || src[0] == '\0') {
+
+ strfcpy(dest,"none",destlen);
+
+ } else if (NULL == strpbrk(src,"/$\\;{}()")) {
+ if (0 != access(map_bindir,ACCESS_EXISTS)) {


+ int err = errno;

+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmNoBinMapDirX,
+ "%s: no map-bin-dir exist: %s: %s"),
+ descr,
+ map_bindir,error_description(err));
+
+ /* No error counter incrementging because
+ map-bin-dir can be modified only on system
+ elm.rc
+ */
+ }
+ elm_sfprintf(dest,destlen,
+ FRM("%s/%s"),
+ map_bindir,src);
+
+ } else
+ do_expand_meta(descr, dest, src, destlen);
+
+
+ DPRINT(Debug,10,(&Debug, "%s expanded: %s => %s (destlen %d)\n",
+ descr,src,dest,destlen));
+
+
+ }
+
/* sets locale and elm_msg_cat */
static int locale_init_called = 0;


static int locale_error = 0;

***************
*** 1139,1148 ****
do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
sizeof(map_txtdir));

! /* Also map-bin-dir may be referenced on future ... */
do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
sizeof(map_bindir));



if ((cp = getenv("MAILCAPS")) == NULL) {
--- 1181,1193 ----
do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
sizeof(map_txtdir));

! /* Also map-bin-dir used by expand_map_bin() ... */
do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
sizeof(map_bindir));

+ /* Also bindata ... notice temorary variable */
+ expand_map_bin("bindata", bindata_path_global, raw_bindata_path,
+ sizeof(bindata_path));


if ((cp = getenv("MAILCAPS")) == NULL) {
***************
*** 1302,1307 ****
--- 1347,1354 ----

}

+
+
int read_rc_file(flag)
int flag;
{
***************
*** 1324,1329 ****
--- 1371,1389 ----
fclose(file);
}

+
+ /* load_locale_map may refer to map-text-dir ... */
+ do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
+ sizeof(map_txtdir));
+
+ /* Also map-bin-dir used by expand_map_bin() ... */
+ do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
+ sizeof(map_bindir));
+
+ /* Also bindata ... */
+ expand_map_bin("bindata", bindata_path, raw_bindata_path,
+ sizeof(bindata_path));
+
parse_iso2022_map(user_iso2022_sets,&errors, ml_user);
user_locale_map = load_locale_map(user_mime_charsets,&errors);
user_terminal_map = load_terminal_map(user_terminal_info,&errors);
***************
*** 1478,1509 ****

do_expand_meta("sent_mail", sent_mail, raw_sentmail,
sizeof(sent_mail));

- if (strcmp(raw_unidata_path,"none") == 0 ||
- raw_unidata_path[0] == '\0') {
-
- strfcpy(raw_unidata_path,"none",sizeof raw_unidata_path);
- strfcpy(unidata_path,"none",sizeof unidata_path);
-
- } else if (NULL == strpbrk(raw_unidata_path,"/$\\;{}()")) {
- if (0 != access(map_bindir,ACCESS_EXISTS)) {


- int err = errno;

- lib_error(CATGETS(elm_msg_cat, ElmSet,ElmNoBinMapDir,
- "Unidata: no map-bin-dir exist: %s: %s"),
- map_bindir,error_description(err));
-
- /* No error counter incrementging because
- map-bin-dir can be modified only on system
- elm.rc
- */
- }
- elm_sfprintf(unidata_path,sizeof unidata_path,
- FRM("%s/%s"),
- map_bindir,raw_unidata_path);
-
- } else
- do_expand_meta("unidata", unidata_path, raw_unidata_path,
- sizeof(unidata_path));

map_system_charset(display_locale,display_codeset);

--- 1538,1551 ----

do_expand_meta("sent_mail", sent_mail, raw_sentmail,
sizeof(sent_mail));
+
+
+ expand_map_bin("unidata", unidata_path, raw_unidata_path,
+ sizeof(unidata_path));
+
+ expand_map_bin("bindata", bindata_path, raw_bindata_path,
+ sizeof(bindata_path));


map_system_charset(display_locale,display_codeset);

***************
*** 1717,1722 ****
--- 1759,1783 ----

}

+ if (0 != strcmp(bindata_path,"none") &&
+ 0 != strcmp(bindata_path_global,bindata_path)) {
+
+ if (0 == (flag & READ_FLAG_BINDATA_INIT)
+ &&
+ !default_bindata()) {
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmBinaryMapData,
+ "No binary map data available: bindata: %s"),
+ raw_bindata_path);
+
+ errors++;
+
+ strfcpy(raw_bindata_path,"none",sizeof raw_bindata_path);
+ strfcpy(bindata_path,"none",sizeof bindata_path);
+
+ }
+ }
+
if (strcmp(raw_metamail_path,"none") == 0 ||
raw_metamail_path[0] == '\0') {
strfcpy(raw_metamail_path,"none", sizeof raw_metamail_path);
Index: elm2.4.ME+.109-cvs/lib/unicode.c
*** elm2.4.ME+.108/lib/unicode.c 2002-01-26 13:15:59.000000000 +0200
--- elm2.4.ME+.109-cvs/lib/unicode.c 2003-11-09 18:13:37.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: unicode.c,v 1.14 2002/01/23 17:09:35 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: unicode.c,v 1.15 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 27,33 ****
unsigned int ch;
enum unicode_op op;
{
! struct mapped_data * XX = default_unidata();

if (XX) {
static int flip = 0;
--- 27,33 ----
unsigned int ch;
enum unicode_op op;
{
! struct unidata_mapped_data * XX = default_unidata();

if (XX) {
static int flip = 0;
***************
*** 176,182 ****
uint16 *words;
int *len;
{
! struct mapped_data * XX = default_unidata();

if (XX) {
int have_comp = 0;
--- 176,182 ----
uint16 *words;
int *len;
{
! struct unidata_mapped_data * XX = default_unidata();

if (XX) {
int have_comp = 0;
***************
*** 258,266 ****

/* ---------------------------------------------------------------------- */

! struct mapped_data * default_unidata()
{
! static struct mapped_data * res = NULL;

if (0 != strcmp(unidata_path,"none") && !res) {
static int tried = 0;
--- 258,266 ----

/* ---------------------------------------------------------------------- */

! struct unidata_mapped_data * default_unidata()
{
! static struct unidata_mapped_data * res = NULL;

if (0 != strcmp(unidata_path,"none") && !res) {
static int tried = 0;
Index: elm2.4.ME+.109-cvs/lib/unidata.c
*** elm2.4.ME+.108/lib/unidata.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.109-cvs/lib/unidata.c 2003-11-09 18:13:37.000000000 +0200
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.24 2002/11/10 11:25:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

#include "headers.h"
#include "s_me.h"
#include "unidata.h"
#include <errno.h>
--- 1,13 ----
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.25 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

#include "headers.h"
+ #include "mmaputil.h"
#include "s_me.h"
#include "unidata.h"
#include <errno.h>
***************
*** 92,125 ****

#define UNIDATA_magic 0xFB00

- uint16 SWAP (b)
- int b;
- {
- union {
- uint16 a;
- unsigned char c[2];
- } d;
- unsigned char tmp;
- d.a = b;
-
- if (sizeof d.a != 2) {
- panic("UNIDATA PANIC",__FILE__,__LINE__,"SWAP",
- "sizeof uint16 !=2 -- 'Configure' error!",0);
- }
- tmp = d.c[0]; d.c[0] = d.c[1]; d.c[1] = tmp;
- return d.a;
- }
-
- uint16 pages(len,pagesize)
- size_t len;
- int pagesize;
- {
- uint16 result = len / pagesize;
-
- if (len % pagesize != 0)
- result++;
- return result;
- }

enum unidata_format { unidata_bad = 0, unidata_format_1 = UNIDATA_magic };

--- 93,98 ----
***************
*** 299,375 ****

#define READ_VALUE(x,byte_swapped) (byte_swapped ? SWAP(x) : x)

- int write_range(fd,offset,length,ptr)
- int fd;
- off_t offset;
- size_t length;
- unsigned char *ptr;
- {
- int status = 1;
-
- if (-1 == lseek(fd,offset,SEEK_SET)) {


- int err = errno;

- status = 0;
-
- DPRINT(Debug,5,(&Debug,"unidata: lseek failed: errno=%d (%s)\n", \
- err,error_description(err)));
-
- goto fail;
- }
-
- while (length > 0) {
- int n = write(fd,ptr,length);
-
- if (-1 == n) {


- int err = errno;

- status = 0;
-
- DPRINT(Debug,5,(&Debug,"unidata: write failed: errno=%d (%s)\n", \
- err,error_description(err)));
-
- goto fail;
- }
- length -= n;
- ptr += n;
- }
-
- fail:
- return status;
- }
-
- int read_range(fd,offset,length,ptr)
- int fd;
- off_t offset;
- size_t length;
- unsigned char *ptr;
- {
- int status = 1;
- if (-1 == lseek(fd,offset,SEEK_SET)) {
- status = 0;
- goto fail;
- }
-
- while (length > 0) {
- int n = read(fd,ptr,length);
-
- if (-1 == n) {
- status = 0;
- goto fail;
- }
- if (0 == n) {
- errno = EINVAL; /* Simulate error */
- status = 0;
- goto fail;
- }
-
- length -= n;
- ptr += n;
- }
-
- fail:
- return status;
- }
-
static void dump_header P_((struct unidata_format_1 *v,
int byte_swapped,
CONST char *filename));
--- 272,277 ----
***************
*** 533,544 ****
}

static int calculate_sizes P_((struct unidata_format_1 *v,
- int byte_swapped,
CONST char *filename));

! static int calculate_sizes (v,byte_swapped,filename)
struct unidata_format_1 *v;
- int byte_swapped;
CONST char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
--- 435,444 ----
}

static int calculate_sizes P_((struct unidata_format_1 *v,
CONST char *filename));

! static int calculate_sizes (v,filename)
struct unidata_format_1 *v;
CONST char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
***************
*** 555,561 ****
lib_error(CATGETS(elm_msg_cat, MeSet, MeCorruptedMapfile,
"Mapfile %.30s is corrupted"),
filename);
! DPRINT(Debug,1,(&Debug,"calculate_sized failed #1 -- sizeof check\n"));
return 0;
}

--- 455,461 ----
lib_error(CATGETS(elm_msg_cat, MeSet, MeCorruptedMapfile,
"Mapfile %.30s is corrupted"),
filename);
! DPRINT(Debug,1,(&Debug,"calculate_sizes failed #1 -- sizeof check\n"));
return 0;
}

***************
*** 677,683 ****
pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);

dump_header(v,byte_swapped,filename);
! if (!calculate_sizes(v,byte_swapped,filename)) {
status = 0;
goto fail_1;
}
--- 577,583 ----
pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);

dump_header(v,byte_swapped,filename);
! if (!calculate_sizes(v,filename)) {
status = 0;
goto fail_1;
}
***************
*** 831,837 ****
}

dump_header(v,byte_swapped,filename);
! if (!calculate_sizes(v,byte_swapped,filename)) {
status = 0;
goto fail_2;
}
--- 731,737 ----
}

dump_header(v,byte_swapped,filename);
! if (!calculate_sizes(v,filename)) {
status = 0;
goto fail_2;
}
***************
*** 1063,1069 ****
}
}

! struct mapped_data {
enum unidata_format format;
union {
struct unidata_format_1 f1;
--- 963,969 ----
}
}

! struct unidata_mapped_data {
enum unidata_format format;
union {
struct unidata_format_1 f1;
***************
*** 1071,1077 ****
};

void free_unidata(v)
! struct mapped_data * v;
{
switch(v->format) {
case unidata_format_1: free_unidata_1(&(v->v.f1));
--- 971,977 ----
};

void free_unidata(v)
! struct unidata_mapped_data * v;
{
switch(v->format) {
case unidata_format_1: free_unidata_1(&(v->v.f1));
***************
*** 1082,1088 ****
}

int write_unidata(v,filename)
! struct mapped_data *v;
CONST char *filename;
{
char *tmpname;
--- 982,988 ----
}

int write_unidata(v,filename)
! struct unidata_mapped_data *v;
CONST char *filename;
{
char *tmpname;
***************
*** 1176,1185 ****


int get_unidata(ptr,filename)
! struct mapped_data **ptr;
CONST char *filename;
{
! struct mapped_data * res = *ptr;
int status = 0;

int fd, err;
--- 1076,1085 ----


int get_unidata(ptr,filename)
! struct unidata_mapped_data **ptr;
CONST char *filename;
{
! struct unidata_mapped_data * res = *ptr;
int status = 0;

int fd, err;
***************
*** 1244,1250 ****
free_unidata(res);
res = NULL;

! res = safe_malloc(sizeof (struct mapped_data));
res->format = unidata_bad;


--- 1144,1150 ----
free_unidata(res);
res = NULL;

! res = safe_malloc(sizeof (struct unidata_mapped_data));
res->format = unidata_bad;


***************
*** 1621,1627 ****
}

int write_unidata_text(v,f)
! struct mapped_data *v;
FILE *f;
{
int status = 0;
--- 1521,1527 ----
}

int write_unidata_text(v,f)
! struct unidata_mapped_data *v;
FILE *f;
{
int status = 0;
***************
*** 2057,2063 ****
return 0;
if (0 != (p1->flags & FLAGS_have_decimal) && p1->decimal != p2->decimal)
return 0;
! if (0 != (p1->flags & FLAGS_have_decomp) && p1->decimal != p2->decomp)
return 0;
if (0 != (p1->flags & FLAGS_have_upper) && p1->upper != p2->upper)
return 0;
--- 1957,1963 ----
return 0;
if (0 != (p1->flags & FLAGS_have_decimal) && p1->decimal != p2->decimal)
return 0;
! if (0 != (p1->flags & FLAGS_have_decomp) && p1->decomp != p2->decomp)
return 0;
if (0 != (p1->flags & FLAGS_have_upper) && p1->upper != p2->upper)
return 0;
***************
*** 2220,2231 ****
}

int read_unidata_text(ptr,filename,logfile, silent_gaps)
! struct mapped_data **ptr;
CONST char *filename;
FILE *logfile;
int silent_gaps;
{
! struct mapped_data * res = *ptr;
int status = 0;
FILE *f = fopen(filename,"r");
int last_processed = -1;
--- 2120,2131 ----
}

int read_unidata_text(ptr,filename,logfile, silent_gaps)
! struct unidata_mapped_data **ptr;
CONST char *filename;
FILE *logfile;
int silent_gaps;
{
! struct unidata_mapped_data * res = *ptr;
int status = 0;
FILE *f = fopen(filename,"r");
int last_processed = -1;
***************
*** 2245,2251 ****
free_unidata(res);
res = NULL;

! res = safe_malloc(sizeof (struct mapped_data));
res->format = unidata_format_1;

/* malloc maximally needed area */
--- 2145,2151 ----
free_unidata(res);
res = NULL;

! res = safe_malloc(sizeof (struct unidata_mapped_data));
res->format = unidata_format_1;

/* malloc maximally needed area */
***************
*** 2492,2504 ****
unsigned int unicode,
struct character_information *info,
uint16 unicode_out[],
! int size));
! static int unicode_lookup_character_1(v,unicode,info,unicode_out,size)
struct unidata_format_1 *v;
unsigned int unicode;
struct character_information *info;
uint16 unicode_out[];
! int size; /* size : on bytes (sizeof) */
{
int status = -1;

--- 2392,2404 ----
unsigned int unicode,
struct character_information *info,
uint16 unicode_out[],
! int buffer_len));
! static int unicode_lookup_character_1(v,unicode,info,unicode_out,buffer_len)
struct unidata_format_1 *v;
unsigned int unicode;
struct character_information *info;
uint16 unicode_out[];
! int buffer_len;
{
int status = -1;

***************
*** 2510,2519 ****
info -> title = 0;
info -> decomp_len = 0;

! if (size > 0) { /* Pre-init buffer */
int i;
unicode_out[0] = unicode;
! for (i = 1; i < size; i++)
unicode_out[i] = 0;
}

--- 2410,2419 ----
info -> title = 0;
info -> decomp_len = 0;

! if (buffer_len > 0) { /* Pre-init buffer */
int i;
unicode_out[0] = unicode;
! for (i = 1; i < buffer_len; i++)
unicode_out[i] = 0;
}

***************
*** 2561,2572 ****
uint8 len_byte = D->len_byte;
if (storage + len_byte <= v->decomp_storage_count) {

! if (size > 0) {


int i;

for (i = 0;

i < len_byte &&
! i < size/sizeof unicode_out[i];
i++)
unicode_out[i] =
READ_VALUE(v->decomp_storage[storage+i],
--- 2461,2472 ----
uint8 len_byte = D->len_byte;
if (storage + len_byte <= v->decomp_storage_count) {

! if (buffer_len > 0) {


int i;

for (i = 0;

i < len_byte &&
! i < buffer_len;
i++)
unicode_out[i] =
READ_VALUE(v->decomp_storage[storage+i],
***************
*** 2613,2638 ****
}


! /* Note: size == 0 if not unicode decompression wanted
! size : on bytes (sizeof)

Returns 0 = failure (not valid character)
1 = succeed
-1 = database bad
*/
! int unicode_lookup_character(v,unicode,info, unicode_out, size)
! struct mapped_data *v;
unsigned int unicode;
struct character_information *info;
uint16 unicode_out[];
! int size;
{
int status = -1;

switch(v->format) {
case unidata_format_1:
status = unicode_lookup_character_1(&(v->v.f1),unicode,info,
! unicode_out, size);
break;
}

--- 2513,2538 ----
}


! /* Note: buffer_len == 0 if not unicode decompression wanted
! buffer_len : on bytes (sizeof)

Returns 0 = failure (not valid character)
1 = succeed
-1 = database bad
*/
! int unicode_lookup_character(v,unicode,info, unicode_out, buffer_len)
! struct unidata_mapped_data *v;
unsigned int unicode;
struct character_information *info;
uint16 unicode_out[];
! int buffer_len;
{
int status = -1;

switch(v->format) {
case unidata_format_1:
status = unicode_lookup_character_1(&(v->v.f1),unicode,info,
! unicode_out, buffer_len);
break;
}

***************
*** 2645,2651 ****
= -1 incomplete input
*/
int unicode_compress_input(v,unicode_res,unicode_inp,len,comp_type)
! struct mapped_data *v;
uint16 *unicode_res;
uint16 unicode_inp[];
int len;
--- 2545,2551 ----
= -1 incomplete input
*/
int unicode_compress_input(v,unicode_res,unicode_inp,len,comp_type)
! struct unidata_mapped_data *v;
uint16 *unicode_res;
uint16 unicode_inp[];
int len;
Index: elm2.4.ME+.109-cvs/Makefile-1.SH
*** elm2.4.ME+.108/Makefile-1.SH 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109-cvs/Makefile-1.SH 2003-11-09 18:13:35.000000000 +0200


***************
*** 27,33 ****
echo "Extracting Makefile-1 (with variable substitutions)"

cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.9 2003/08/26 17:07:29 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 27,33 ----
echo "Extracting Makefile-1 (with variable substitutions)"

cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.10 2003/11/09 16:13:35 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 56,72 ****
$(REG) rm $(LOCALETARG) $(LIB)/elm.map.bin/unidata.bin



install_s: $(LIB) $(ETC) $(STAGE) $(ETC)/elm.rc $(LOCALETARG) \
! $(LIB)/elm.map.bin/unidata.bin libreg

$(ETC)/elm.rc: $(LIB)/elmrc-write doc/elmrc-info
$(REG) {$(LIB)/elmrc-write} -G -I -C {doc/elmrc-info}

$(REG) $(CHMOD) u=rw,go=r {$@}

! $(LIB)/elm.map.bin/unidata.bin: $(LIB) $(LIB)/elm.map.bin charset/UNIDATA/UNIDATA2.TXT $(LIB)/elmunidata
$(REG) {$(LIB)/elmunidata} -I -s {charset/UNIDATA/UNIDATA2.TXT}
$(REG) $(CHMOD) u=rw,go=r {$@}
$(REG) true {charset/UNIDATA/README.TXT}

$(ETC)/elm.mimecharsets: $(BIN)/elm.mimecharsets $(LIB)/elmcharset ConfTool/killsets $(LIB)/elm.map.txt
$(REG) {$(LIB)/elmcharset} -G -I {ConfTool/killsets} -w {$@} \
-S {charset/MAPPINGS/ISO8859} -S {charset/MAPPINGS} \
--- 56,82 ----
$(REG) rm $(LOCALETARG) $(LIB)/elm.map.bin/unidata.bin



install_s: $(LIB) $(ETC) $(STAGE) $(ETC)/elm.rc $(LOCALETARG) \

! $(LIB)/elm.map.bin/unidata.bin $(LIB)/elm.map.bin/bindata.bin \
! libreg



$(ETC)/elm.rc: $(LIB)/elmrc-write doc/elmrc-info
$(REG) {$(LIB)/elmrc-write} -G -I -C {doc/elmrc-info}

$(REG) $(CHMOD) u=rw,go=r {$@}

! $(LIB)/elm.map.bin/unidata.bin: $(LIB) $(LIB)/elm.map.bin \
! charset/UNIDATA/UNIDATA2.TXT $(LIB)/elmunidata
$(REG) {$(LIB)/elmunidata} -I -s {charset/UNIDATA/UNIDATA2.TXT}
$(REG) $(CHMOD) u=rw,go=r {$@}
$(REG) true {charset/UNIDATA/README.TXT}

+ $(LIB)/elm.map.bin/bindata.bin: $(LIB) $(LIB)/elm.map.bin $(LIB)/elmbindata \
+ $(ETC)/elm.mimecharsets
+ $(REG) {$(LIB)/elmbindata} -G -I \
+ -S {charset/MAPPINGS/ISO8859} -S {charset/MAPPINGS} \
+ -S {charset/MAPPINGS/MICSFT}
+ $(REG) $(CHMOD) u=rw,go=r {$@}
+
+
$(ETC)/elm.mimecharsets: $(BIN)/elm.mimecharsets $(LIB)/elmcharset ConfTool/killsets $(LIB)/elm.map.txt
$(REG) {$(LIB)/elmcharset} -G -I {ConfTool/killsets} -w {$@} \
-S {charset/MAPPINGS/ISO8859} -S {charset/MAPPINGS} \
Index: elm2.4.ME+.109-cvs/MANIFEST
*** elm2.4.ME+.108/MANIFEST 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/MANIFEST 2003-11-09 18:13:35.000000000 +0200
***************
*** 387,389 ****
--- 387,397 ----
src/screen/termcharset.c
src/screen/cur_process.c
src/screen/curses.c
+ lib/bindata.c
+ lib/mmaputil.c
+ hdrs/mmaputil.h
+ hdrs/bindata.h
+ utils/elmbindata.c
+ utils/charmapcopy.c
+ utils/charmapcopy.h
+ doc/elmbindata.1
Index: elm2.4.ME+.109-cvs/melib/mime_decode.c
*** elm2.4.ME+.108/melib/mime_decode.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/melib/mime_decode.c 2003-11-15 17:51:21.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.56 2003/08/04 14:58:57 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.60 2003/11/15 15:51:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.60 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 438,445 ****

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector signed_selector)
! static int signed_selector(p)
mime_t *p;
{
int flags = 0;
mime_t *z;
--- 438,446 ----

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector signed_selector)
! static int signed_selector(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
int flags = 0;
mime_t *z;
***************
*** 450,456 ****
mime_parser_subparts(p->parser_data) > 0 &&
( z = mime_parser_index(p->parser_data,0)) &&

! 0 <= ( subflag = mime_classify_media(z) )

) {

--- 451,457 ----
mime_parser_subparts(p->parser_data) > 0 &&
( z = mime_parser_index(p->parser_data,0)) &&

! 0 <= ( subflag = mime_classify_media(z,hdr) )

) {

***************
*** 639,646 ****

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector encrypted_selector)
! static int encrypted_selector(p)
mime_t *p;
{
int flags = 0;

--- 640,648 ----

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector encrypted_selector)
! static int encrypted_selector(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
int flags = 0;

***************
*** 792,806 ****

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector alternative_selector)
! static int alternative_selector(p)
mime_t *p;
{
int flags = 0;
mime_t * z = NULL;

if (p->parser_data &&
mime_parser_subparts(p->parser_data) > 0 &&
! 0 <= ( flags = mime_classify_best_alternative(p,&z))) {


if (MIME_selector_magic != p->handler_data->magic)
--- 794,809 ----

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector alternative_selector)
! static int alternative_selector(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
int flags = 0;
mime_t * z = NULL;

if (p->parser_data &&
mime_parser_subparts(p->parser_data) > 0 &&
! 0 <= ( flags = mime_classify_best_alternative(p,&z,hdr))) {


if (MIME_selector_magic != p->handler_data->magic)
***************
*** 816,822 ****
if (!pagealternative) {
DPRINT(Debug,11,(&Debug,
"alternative_selector: pagealternative is not set, we must able to handle all parts ...\n"));
! flags = mime_classify_subparts(p);
}

DPRINT(Debug,11,(&Debug,
--- 819,825 ----
if (!pagealternative) {
DPRINT(Debug,11,(&Debug,
"alternative_selector: pagealternative is not set, we must able to handle all parts ...\n"));
! flags = mime_classify_subparts(p,hdr);
}

DPRINT(Debug,11,(&Debug,
***************
*** 1008,1022 ****

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector multipart_selector)
! static int multipart_selector(p)
mime_t *p;
{
int flags = 0;
int Flags = get_type_flags(p->TYPE);

int subflag = -1;

! if ((0 <= ( subflag = mime_classify_subparts(p))) &&
((Flags & MIME_MIXED) ||
(Flags & MIME_DIGEST)) ) {

--- 1011,1026 ----

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector multipart_selector)
! static int multipart_selector(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
int flags = 0;
int Flags = get_type_flags(p->TYPE);

int subflag = -1;

! if ((0 <= ( subflag = mime_classify_subparts(p,hdr))) &&
((Flags & MIME_MIXED) ||
(Flags & MIME_DIGEST)) ) {

***************
*** 1304,1317 ****

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector rfc822_selector)
! static int rfc822_selector(p)
mime_t *p;
{
int flags = 0;
int subflag = -1;


! if (0 <= ( subflag = mime_classify_subparts(p))) {
DPRINT(Debug,11,(&Debug,
"rfc822_selector(%p) -- type: %p=%s/%s\n",
p,
--- 1308,1324 ----

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector rfc822_selector)
! static int rfc822_selector(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
int flags = 0;
int subflag = -1;


! if (0 <= ( subflag = mime_classify_subparts(p,
! hdr /* Correct? */
! ))) {
DPRINT(Debug,11,(&Debug,
"rfc822_selector(%p) -- type: %p=%s/%s\n",
p,
***************
*** 1564,1573 ****
return 1;
}

! int set_filter (ptr, state, default_content_charset)
mime_t *ptr;
out_state_t *state;
charset_t default_content_charset;
{
int code;
charset_t tmp;
--- 1571,1581 ----
return 1;
}

! int set_filter (ptr, state, default_content_charset,override_charset)
mime_t *ptr;
out_state_t *state;
charset_t default_content_charset;
+ charset_t override_charset; /* IF set, ignore charset= -paramater */
{
int code;
charset_t tmp;
***************
*** 1582,1660 ****

state -> filter = NULL; /* So that messages can be printed .. */

- if (0 == (code = mime_get_charset (&tmp, ptr->type_opts,
- state->display_charset,
- default_content_charset
- ))) {

! /* Don't show this part (or copy to reply buffer) ... */
!
state_printf(state,
CATGETS(elm_msg_cat, MeSet,
! MeDecodeCharsetSkipping,
! "[ Charset %.15s unsupported, skipping... ]\n"),
! tmp->MIME_name ? tmp->MIME_name : "<none>");
!
! if (state->displaying)
! state_printf(state,
! CATGETS(elm_msg_cat, MeSet, MeDecodeUseVtoView,
! "[ Use 'v' to view or save this part. ]\n"));
!
! state -> filter = tmp;

- DPRINT(Debug,40,(&Debug,
- "set_filter=0 filter=%p '%s' (type=%p)\n",
- state -> filter,
- state -> filter->MIME_name ?
- state -> filter->MIME_name : "<none>",
- state -> filter->charset_type));
-
- return 0;
} else {
! if (code < 0) {

! DPRINT(Debug,40,(&Debug,
! " code=%d charset_convert_ok=%d\n",
! code,charset_convert_ok));

! if (code == -3) { /* Converted without lossage */
! if (!charset_convert_ok)
state_printf(state,
CATGETS(elm_msg_cat, MeSet,
! MeDecodeCharsetConvertNoLoss,
! "[ Charset %.15s converted... ]\n"),
tmp->MIME_name ? tmp->MIME_name :
"<none>");
-
- } else {
- state_printf(state,
- CATGETS(elm_msg_cat, MeSet,
- MeDecodeCharsetConvert,
- "[ Charset %.15s unsupported, converting... ]\n"),
- tmp->MIME_name ? tmp->MIME_name :
- "<none>");
-
- if (state->displaying) {
- /* state_nlputs or state_printf is needed for EOLN_is_CRLF
- conversions */

! state_printf(state,
! CATGETS(elm_msg_cat, MeSet, MeDecodeUseAlsoV,
! "[ You can also use 'v' to view or save this part. ]\n"));
! state_nlputs("\n",state);
}
}
}
- state -> filter = tmp;
-
- DPRINT(Debug,40,(&Debug,
- "set_filter=1 filter=%p '%s' (type=%p)\n",
- state -> filter,
- state -> filter->MIME_name ?
- state -> filter->MIME_name : "<none>",
- state -> filter->charset_type));
- return 1;
}
}

/* Prototype */
--- 1590,1692 ----

state -> filter = NULL; /* So that messages can be printed .. */


! code = mime_get_charset (&tmp, ptr->type_opts,
! state->display_charset,
! default_content_charset
! );
!
! if (override_charset && override_charset != tmp) {
!
state_printf(state,
CATGETS(elm_msg_cat, MeSet,
! MeDecodeCharsetOverride,
! "[ Charset %.15s ignored, treated as %.15s ]\n"),
! tmp->MIME_name ? tmp->MIME_name : "<none>",
! override_charset->MIME_name ?
! override_charset->MIME_name : "<none>");
!
! state_nlputs("\n",state);
!
! state -> filter = override_charset;

} else {
! if (0 == code) {
!
! /* Don't show this part (or copy to reply buffer) ... */
!
! state_printf(state,
! CATGETS(elm_msg_cat, MeSet,
! MeDecodeCharsetSkipping,
! "[ Charset %.15s unsupported, skipping... ]\n"),
! tmp->MIME_name ? tmp->MIME_name : "<none>");
!
! if (state->displaying) {
! state_printf(state,
! CATGETS(elm_msg_cat, MeSet, MeDecodeUseVtoView,
! "[ Use 'v' to view or save this part. ]\n"));
! state_printf(state,
! CATGETS(elm_msg_cat, MeSet, MeDecodeUseOtoOverride,
! "[ You can also use 'O' to override charset information. ]\n"));

! }

! state -> filter = tmp;
!
! DPRINT(Debug,40,(&Debug,
! "set_filter=0 filter=%p '%s' (type=%p)\n",
! state -> filter,
! state -> filter->MIME_name ?
! state -> filter->MIME_name : "<none>",
! state -> filter->charset_type));
!
! return 0;
! } else {
! if (code < 0) {
!
! DPRINT(Debug,40,(&Debug,
! " code=%d charset_convert_ok=%d\n",
! code,charset_convert_ok));
!
! if (code == -3) { /* Converted without lossage */
! if (!charset_convert_ok)
! state_printf(state,
! CATGETS(elm_msg_cat, MeSet,
! MeDecodeCharsetConvertNoLoss,
! "[ Charset %.15s converted... ]\n"),
! tmp->MIME_name ? tmp->MIME_name :
! "<none>");
!
! } else {
state_printf(state,
CATGETS(elm_msg_cat, MeSet,
! MeDecodeCharsetConvert,
! "[ Charset %.15s unsupported, converting... ]\n"),
tmp->MIME_name ? tmp->MIME_name :
"<none>");

! if (state->displaying) {
! /* state_nlputs or state_printf is needed for EOLN_is_CRLF
! conversions */
!
! state_printf(state,
! CATGETS(elm_msg_cat, MeSet, MeDecodeUseAlsoV,
! "[ You can also use 'v' to view or save this part. ]\n"));
! state_nlputs("\n",state);
! }
}
}
+ state -> filter = tmp;
}
}
+
+ DPRINT(Debug,40,(&Debug,
+ "set_filter=1 filter=%p '%s' (type=%p)\n",
+ state -> filter,
+ state -> filter->MIME_name ?
+ state -> filter->MIME_name : "<none>",
+ state -> filter->charset_type));
+ return 1;
}

/* Prototype */
***************
*** 1663,1670 ****

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector text_selector)
! static int text_selector(p)
mime_t *p;
{
int flags = NOTPLAIN_need_metamail;

--- 1695,1703 ----

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector text_selector)
! static int text_selector(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
int flags = NOTPLAIN_need_metamail;

***************
*** 1675,1680 ****
--- 1708,1725 ----
charset_t buf1;
charset_t disp_vector[2];

+ /* If charset is overrided, do not use metamail ... */
+ if (hdr && hdr->override_charset) {
+ DPRINT(Debug,11,(&Debug,
+ "text_selector(%p) -- override charset %s\n",
+ hdr->override_charset->MIME_name ?
+ hdr->override_charset->MIME_name :


+ "<no MIME name>"));

+ flags = 0;
+ goto done;
+ }
+
+
disp_vector[0] = display_charset;
disp_vector[1] = NULL;

***************
*** 1759,1765 ****
in_state_ftell(state_in)));
}

! if (set_filter(ptr,state_out,default_mimetext_charset)) {
if (!run_decoder(ptr,state_in, state_out)) {
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeEncodingSkipping,
--- 1804,1811 ----
in_state_ftell(state_in)));
}

! if (set_filter(ptr,state_out,default_mimetext_charset,
! mss ? mss->override_charset : NULL)) {
if (!run_decoder(ptr,state_in, state_out)) {
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeEncodingSkipping,
***************
*** 2030,2036 ****

if (NULL != (tmpfp =
arrange_decoded(ptr,state_in,state_out,&newstate2,NULL))) {
! if (set_filter(ptr,state_out,NULL)) {
int len, crypted = 0;
int count = 0;
getkey(OFF);
--- 2076,2083 ----

if (NULL != (tmpfp =
arrange_decoded(ptr,state_in,state_out,&newstate2,NULL))) {
! if (set_filter(ptr,state_out,NULL,
! mss ? mss->override_charset : NULL)) {
int len, crypted = 0;
int count = 0;
getkey(OFF);
***************
*** 2086,2093 ****

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector text_unsupported_selector)
! static int text_unsupported_selector(p)
mime_t *p;
{
int flags = NOTPLAIN_is_fallback;

--- 2133,2141 ----

/* Returns -1 on failure otherwise same mask than mime_classify_media() */
S_(mime_run_selector text_unsupported_selector)
! static int text_unsupported_selector(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
int flags = NOTPLAIN_is_fallback;

Index: elm2.4.ME+.109-cvs/melib/mime_parse.c
*** elm2.4.ME+.108/melib/mime_parse.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/melib/mime_parse.c 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.41 2003/08/04 14:58:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.42 2003/11/11 16:18:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 602,608 ****
}


! x = mime_classify_media(ptr);

if (x) {
ptr->mime_flags = x; /* TODO? -- should this check only NOTPLAIN_need_metamail ??*/
--- 602,609 ----
}


! x = mime_classify_media(ptr,
! NULL /* ???? */);

if (x) {
ptr->mime_flags = x; /* TODO? -- should this check only NOTPLAIN_need_metamail ??*/
***************
*** 769,775 ****
/* mime_classify_media sets hdr->mime_rec.mime_flags !!! */

int old = hdr->mime_rec.mime_flags;
! int tmp = mime_classify_media(&(hdr->mime_rec));

if (tmp >= 0) {
if (tmp != old) {
--- 770,776 ----
/* mime_classify_media sets hdr->mime_rec.mime_flags !!! */

int old = hdr->mime_rec.mime_flags;
! int tmp = mime_classify_media(&(hdr->mime_rec),hdr);

if (tmp >= 0) {
if (tmp != old) {
Index: elm2.4.ME+.109-cvs/melib/mime_selector.c
*** elm2.4.ME+.108/melib/mime_selector.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/melib/mime_selector.c 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_selector.c,v 1.4 2003/08/04 14:58:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_selector.c,v 1.5 2003/11/11 16:18:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 70,77 ****
}
#endif

! int mime_classify_media(p)
mime_t *p;
{
int Flags;
struct media_type_handle * H = NULL;
--- 70,78 ----
}
#endif

! int mime_classify_media(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
int Flags;
struct media_type_handle * H = NULL;
***************
*** 159,165 ****
H,
is_default));

! r = H->p.pager->selector(p);

if (r >= 0) {

--- 160,166 ----
H,
is_default));

! r = H->p.pager->selector(p,hdr);

if (r >= 0) {

***************
*** 280,287 ****
NOTPLAIN_canuse_mailcap 0x04
*/

! int mime_classify_subparts(ptr)
mime_t *ptr;
{
int i;
int count;
--- 281,289 ----
NOTPLAIN_canuse_mailcap 0x04
*/

! int mime_classify_subparts(ptr,hdr)
mime_t *ptr;
+ struct header_rec * hdr;
{
int i;
int count;
***************
*** 304,310 ****
"Bad magic number (subpart)");

if (att->disposition == DISP_INLINE) {
! int f = mime_classify_media(att);

if (f < 0) {
DPRINT(Debug,9,(&Debug,
--- 306,312 ----
"Bad magic number (subpart)");

if (att->disposition == DISP_INLINE) {
! int f = mime_classify_media(att, hdr);

if (f < 0) {
DPRINT(Debug,9,(&Debug,
***************
*** 379,387 ****
return r;
}

! int mime_classify_best_alternative(ptr, ret)
mime_t *ptr;
mime_t **ret;
{
mime_t * r = NULL;

--- 381,390 ----
return r;
}

! int mime_classify_best_alternative(ptr, ret,hdr)
mime_t *ptr;
mime_t **ret;
+ struct header_rec * hdr;
{
mime_t * r = NULL;

***************
*** 420,426 ****
because it does not make sense inside on multipart/alternative
*/

! f = mime_classify_media(att);
if (f < 0) {
DPRINT(Debug,11,(&Debug,
"mime_classify_best_alternative -- Failed: %p=%s/%s (f=%d)\n",
--- 423,429 ----
because it does not make sense inside on multipart/alternative
*/

! f = mime_classify_media(att,hdr);
if (f < 0) {
DPRINT(Debug,11,(&Debug,
"mime_classify_best_alternative -- Failed: %p=%s/%s (f=%d)\n",
Index: elm2.4.ME+.109-cvs/melib/partial.c
*** elm2.4.ME+.108/melib/partial.c 2003-08-11 11:21:18.000000000 +0300
--- elm2.4.ME+.109-cvs/melib/partial.c 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.5 2003/08/10 06:23:12 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.6 2003/11/11 16:18:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 92,99 ****
CT_decoder partial_decode;
#endif

! int partial_selector(p)
mime_t *p;
{
char id[100];
char number[100];
--- 92,100 ----
CT_decoder partial_decode;
#endif

! int partial_selector(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
char id[100];
char number[100];
Index: elm2.4.ME+.109-cvs/melib/pgp_decode.c
*** elm2.4.ME+.108/melib/pgp_decode.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/melib/pgp_decode.c 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.33 2003/08/04 14:58:57 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.36 2003/11/11 16:18:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 461,468 ****
#if ANSI_C
mime_run_selector pgp_selector;
#endif
! int pgp_selector(p)
mime_t *p;
{
int flags = 0;

--- 461,469 ----
#if ANSI_C
mime_run_selector pgp_selector;
#endif
! int pgp_selector(p,hdr)
mime_t *p;
+ struct header_rec * hdr;
{
int flags = 0;

***************
*** 653,659 ****
CATGETS(elm_msg_cat, MeSet, MePgpBefore,
"[ There is text before PGP section. ]\n"));

! if (set_filter(m,s_out,NULL)) { /* Character set filtering */
do {
state_add_prefix(s_out);

--- 654,662 ----
CATGETS(elm_msg_cat, MeSet, MePgpBefore,
"[ There is text before PGP section. ]\n"));

! if (set_filter(m,s_out,NULL,
! mss ? mss->override_charset : NULL)
! ) { /* Character set filtering */
do {
state_add_prefix(s_out);



***************
*** 816,826 ****
if (was_binary)
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpInternalSkipping,
! "[Internal error while calling pgp, skipping...]\n"));
else {
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpInternalRawdata,
! "[Internal error while calling pgp, raw data follows]\n"));

fail:

--- 819,829 ----


if (was_binary)
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpInternalSkipping,
! "[ Internal error while calling pgp, skipping... ]\n"));
else {
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpInternalRawdata,
! "[ Internal error while calling pgp, raw data follows ]\n"));

fail:

***************
*** 842,848 ****

state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpRawEnd,

! "[End of raw data]\n"));
}
return;
}
--- 845,851 ----



state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MePgpRawEnd,
! "[ End of raw data. ]\n"));
}
return;
}

Index: elm2.4.ME+.109-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.108/nls/C/C/C/s_elm.m 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/nls/C/C/C/s_elm.m 2003-11-10 22:37:46.000000000 +0200
***************
*** 2077,2084 ****
2041 "default-nomime-charset %s is unsupported"
$ #FailedReopenFolder
2042 "Failed to reopen %S folder"
! $ #NoBinMapDir
! 2043 "Unidata: no map-bin-dir exist: %s: %s"
$ #NoUnicodeData
2044 "No Unicode data available: unidata: %s"
$ #UnidataSetting
--- 2077,2084 ----
2041 "default-nomime-charset %s is unsupported"
$ #FailedReopenFolder
2042 "Failed to reopen %S folder"
! $ #NoBinMapDirX
! 2043 "%sq: no map-bin-dir exist: %s: %s"
$ #NoUnicodeData
2044 "No Unicode data available: unidata: %s"
$ #UnidataSetting
***************
*** 2273,2276 ****


2137 "Editing of %s header is not supported."

$ #HdrGarbage


2138 "Garbage on header file"

!
--- 2273,2297 ----


2137 "Editing of %s header is not supported."

$ #HdrGarbage


2138 "Garbage on header file"

! $ #BinaryMapData
! 2140 "No binary map data available: bindata: %s"
! $ #OverrideCharset
! 2141 "Override charset"
! $ #NoMailToOverride
! 2142 "No mail to override!"
! $quote
! $ #OverrideTagged
! 2143 Override charset of %d tagged messages. Use "none" to cancel override.
! $ #OverrideTaggedOne
! 2144 Override charset of tagged message. Use "none" to cancel override.
! $ #OverrideCurrentOver
! 2145 Override charset of current message. Use "none" to cancel override.
! $ #OverrideCurrent
! 2146 Override charset of current message.
! $quote "
! $ #OverrideCSprompt
! 2147 "Override charset: "
! $ #UnknowCharset
! 2148 "Charset %s is unknown."
! $ #CharsetBadOverride
! 2149 "Can't use charset %s for override."
Index: elm2.4.ME+.109-cvs/nls/C/C/C/s_me.m
*** elm2.4.ME+.108/nls/C/C/C/s_me.m 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/nls/C/C/C/s_me.m 2003-11-10 22:37:46.000000000 +0200
***************


*** 120,126 ****
$ #PgpBefore
63 [ There is text before PGP section. ]\n
$ #PgpRawEnd
! 64 [End of raw data]\n
$ #FailedSeekEnvelope
65 Failed to seek beginning of mail envelope (%ld)
$ #FailedSeekHeaders
--- 120,126 ----
$ #PgpBefore
63 [ There is text before PGP section. ]\n
$ #PgpRawEnd
! 64 [ End of raw data. ]\n
$ #FailedSeekEnvelope
65 Failed to seek beginning of mail envelope (%ld)
$ #FailedSeekHeaders

***************
*** 655,657 ****
--- 655,665 ----
346 Fragmented message have several different sender addresses
$ #AssembleCommand
347 [ Command 'A' assembles fragmented messages. ]\n
+ $ #CreateDir
+ 348 Directory %s created
+ $ #CantCreateDir
+ 349 Can't create directory %s
+ $ #DecodeCharsetOverride
+ 350 [ Charset %.15s ignored, treated as %.15s ]\n
+ $ #DecodeUseOtoOverride
+ 351 [ You can also use 'O' to override charset information. ]
Index: elm2.4.ME+.109-cvs/shared_libs/iconv/iconv.c
*** elm2.4.ME+.108/shared_libs/iconv/iconv.c 2002-12-15 12:00:25.000000000 +0200
--- elm2.4.ME+.109-cvs/shared_libs/iconv/iconv.c 2003-11-09 18:13:37.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iconv.c,v 1.9 2002/11/10 11:25:31 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: iconv.c,v 1.10 2003/11/09 16:13:37 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 954,960 ****
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

! ret -> b.dummy = 0;

genmaps = safe_realloc(genmaps,
(genmap_count + 1) *
--- 954,962 ----
ret -> map_initialized = 1;
ret -> map_init_it = map_init_bad;

! ret -> b.dummy = NULL;
! ret -> c.dummy = NULL;
! ret -> d.dummy = NULL;

genmaps = safe_realloc(genmaps,
(genmap_count + 1) *
Index: elm2.4.ME+.109-cvs/src/attach_menu.c
*** elm2.4.ME+.108/src/attach_menu.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/src/attach_menu.c 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.53 2003/08/04 14:58:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.53 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.54 2003/11/11 16:18:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 695,701 ****
mime_parser_parse() need not to be called
... however classification is not copied!!
*/
! mime_classify_media(&(tmp.mime_rec));

is_need_meta = need_meta(&tmp);

--- 695,701 ----
mime_parser_parse() need not to be called
... however classification is not copied!!
*/
! mime_classify_media(&(tmp.mime_rec),&tmp);

is_need_meta = need_meta(&tmp);

Index: elm2.4.ME+.109-cvs/src/elm.c


*** elm2.4.ME+.108/src/elm.c 2003-10-12 12:48:03.000000000 +0300

--- elm2.4.ME+.109-cvs/src/elm.c 2003-11-10 22:37:46.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elm.c,v 1.57 2003/09/14 16:35:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.59 2003/11/10 20:37:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.59 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 579,584 ****
--- 579,601 ----
}
break;

+ case 'O' : {
+ int current = get_current(mailbox);
+
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
+ ElmOverrideCharset,
+ "Override charset"));
+ FlushBuffer();
+
+ if (current < 1)
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmNoMailToOverride,
+ "No mail to override!"));
+ else
+ OverrideCharset(mailbox);
+
+ }
+ break;
case 'P' : {


int current = get_current(mailbox);

***************

*** 775,780 ****
--- 792,798 ----



ViewDigest(mailbox);

+ current = get_current(mailbox);
(void)get_page(current, mailbox);
(*redraw)++;

***************
*** 1151,1156 ****

--- 1169,1175 ----



ViewPartial(current_mailbox);

+ current = get_current(current_mailbox);
(void)get_page(current, current_mailbox);
redraw++;

***************
*** 1683,1690 ****
* commands to a function. */

int i;
! int current = ifmain(get_current((mailbox)),
! alias_current);

#define SET_CURRENT(x) { if (inalias) alias_current = (x); \
else set_current((mailbox),(x)); }

--- 1702,1710 ----


* commands to a function. */

int i;
! #define GET_CURRENT ifmain(get_current((mailbox)), alias_current)
!
! int current = GET_CURRENT;

#define SET_CURRENT(x) { if (inalias) alias_current = (x); \
else set_current((mailbox),(x)); }
***************
*** 1717,1725 ****

}

! if (x)
nucurr = get_page(current, (mailbox));
! else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmPatternNotFound,
"pattern not found!"));

--- 1737,1746 ----



}

! if (x) {
! current = GET_CURRENT;
nucurr = get_page(current, (mailbox));
! } else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmPatternNotFound,
"pattern not found!"));
***************
*** 1948,1955 ****
items);
clear_error();
if (limit((mailbox)) != 0) {
! get_page(current, (mailbox));
! (*redraw)++;
} else {
(*nufoot)++;
}

--- 1969,1977 ----


items);
clear_error();
if (limit((mailbox)) != 0) {
! current = GET_CURRENT;
! get_page(current, (mailbox));
! (*redraw)++;
} else {
(*nufoot)++;
}

Index: elm2.4.ME+.109-cvs/src/messages/digest.c
*** elm2.4.ME+.108/src/messages/digest.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/src/messages/digest.c 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.6 2003/08/04 20:15:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: digest.c,v 1.7 2003/11/11 16:18:04 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 504,510 ****
read_mailcaps();

if (h->mime_rec.parser_data) {
! int tmp = mime_classify_media(&(h->mime_rec));
if (tmp >= 0)
h->mime_parsed = 1;
}
--- 504,510 ----
read_mailcaps();

if (h->mime_rec.parser_data) {
! int tmp = mime_classify_media(&(h->mime_rec),h);
if (tmp >= 0)
h->mime_parsed = 1;
}
***************
*** 623,629 ****
mime_t_copy(& h->mime_rec, part);

if (h->mime_rec.parser_data) {
! int tmp = mime_classify_media(&(h->mime_rec));
if (tmp >= 0)
h->mime_parsed = 1;
}
--- 623,629 ----
mime_t_copy(& h->mime_rec, part);

if (h->mime_rec.parser_data) {
! int tmp = mime_classify_media(&(h->mime_rec),h);
if (tmp >= 0)
h->mime_parsed = 1;
}
Index: elm2.4.ME+.109-cvs/src/messages/header_alloc.c
*** elm2.4.ME+.108/src/messages/header_alloc.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109-cvs/src/messages/header_alloc.c 2003-11-10 22:37:46.000000000 +0200
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.5 2003/08/04 14:58:58 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************

--- 1,8 ----
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.6 2003/11/10 20:37:46 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************

***************
*** 63,68 ****
--- 63,70 ----
h->have_from = 0;
h->body_parsed = 0;
h->mime_parsed = 0;
+ h->header_charset = NULL;
+ h->override_charset = NULL;
free_partial_vector(h);
}

***************
*** 108,113 ****
--- 110,117 ----
h->have_from = 0;
h->body_parsed = 0;
h->mime_parsed = 0;
+ h->header_charset = NULL;
+ h->override_charset = NULL;
h->partial_vector = NULL;
h->partial_len = 0;
}
Index: elm2.4.ME+.109-cvs/src/messages/partial.c
*** elm2.4.ME+.108/src/messages/partial.c 2003-08-16 09:58:21.000000000 +0300
--- elm2.4.ME+.109-cvs/src/messages/partial.c 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.11 2003/08/16 06:51:56 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.12 2003/11/11 16:18:04 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 1175,1181 ****

if (mime_parser_parse(&(vec[i].hdr->mime_rec),
vec[i].hdr->header_charset,vec[i].F)) {
! int tmp = mime_classify_media(&(vec[i].hdr->mime_rec));

if (tmp >= 0) {
vec[i].hdr->mime_parsed = 1;
--- 1175,1183 ----

if (mime_parser_parse(&(vec[i].hdr->mime_rec),
vec[i].hdr->header_charset,vec[i].F)) {
! int tmp = mime_classify_media(&(vec[i].hdr->mime_rec),
! vec[i].hdr
! );

if (tmp >= 0) {
vec[i].hdr->mime_parsed = 1;
Index: elm2.4.ME+.109-cvs/src/pattern.c
*** elm2.4.ME+.108/src/pattern.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109-cvs/src/pattern.c 2003-11-15 12:20:01.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pattern.c,v 1.25 2003/09/03 09:16:30 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pattern.c,v 1.27 2003/11/15 10:20:01 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 275,288 ****

int i;

! struct string * pattern = NULL;
! struct string * alt_pattern = NULL;

int ret = 0 ;


int anywhere = FALSE;
int matched;

struct string * buffer = NULL;

struct string *buffer1 = NULL;
int val;

buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
--- 275,295 ----

int i;

! /* Elm 2.4 remebers old entered patterns, so we need to keep
! that static. This leaks these malloced areas on end of program */
!
! static struct string * pattern = NULL;
! static struct string * alt_pattern = NULL;

int ret = 0 ;


int anywhere = FALSE;
int matched;

struct string * buffer = NULL;

***************
*** 697,708 ****
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmSearchingFolderPattern,
"Searching folder for pattern..."));

!
!
! /* TODO: Match should be done agaist situation where
! MIME encoding is *undone*
! */
!
mc = get_message_count(mailbox);
while (message_number < mc) {

--- 709,715 ----
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmSearchingFolderPattern,
"Searching folder for pattern..."));

!
mc = get_message_count(mailbox);
while (message_number < mc) {

Index: elm2.4.ME+.109-cvs/src/showmsg.c
*** elm2.4.ME+.108/src/showmsg.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/src/showmsg.c 2003-11-11 18:18:04.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.28 2003/10/11 08:42:11 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.31 2003/11/11 16:18:04 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 28,33 ****
--- 28,174 ----
VOLATILE int pipe_abort = FALSE; /* not used anymore, but won't compile without it */


+
+ void OverrideCharset(mailbox)
+ struct MailboxView *mailbox;
+ {
+ int oldstat = 0, tagged = 0;
+ int current = get_current(mailbox);
+ struct header_rec * chdr = give_header(mailbox,current-1);
+
+ char override_charset[40];
+ int code;
+ charset_t res = NULL;
+ int mc,i;
+
+ if (chdr)
+ oldstat = chdr->status; /* remember */
+
+ mc = get_message_count(mailbox);
+ for (i=0; i < mc; i++) {
+ struct header_rec * hdr = give_header(mailbox,i);
+ if (hdr && ison(hdr->status, TAGGED)) {
+ tagged++;
+ }
+ }
+
+ if (!tagged && chdr && chdr->override_charset &&
+ chdr->override_charset->MIME_name)
+ strfcpy(override_charset,chdr->override_charset->MIME_name,
+ sizeof override_charset);
+ else if (display_charset->MIME_name)
+ strfcpy(override_charset,display_charset->MIME_name,
+ sizeof override_charset);
+ else
+ strfcpy(override_charset,"none", sizeof override_charset);
+
+ redraw:
+ if (tagged > 1)
+ print_format_center(elm_LINES-2,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmOverrideTagged,
+ "Override charset of %d tagged messages. Use \"none\" to cancel override."),
+ tagged);
+ else if (1 == tagged)
+ print_format_center(elm_LINES-2,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmOverrideTaggedOne,
+ "Override charset of tagged message. Use \"none\" to cancel override."));
+ else if (chdr && chdr->override_charset)
+ print_format_center(elm_LINES-2,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmOverrideCurrentOver,
+ "Override charset of current message. Use \"none\" to cancel override."));
+ else
+ print_format_center(elm_LINES-2,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmOverrideCurrent,
+ "Override charset of current message."));
+
+ PutLineX(elm_LINES-1,0,CATGETS(elm_msg_cat, ElmSet, ElmOverrideCSprompt,
+ "Override charset: "));
+
+ code = optionally_enter(override_charset,-1,-1,OE_REDRAW_MARK,
+ sizeof override_charset);
+
+ switch(code) {
+ case REDRAW_MARK:
+ goto redraw;
+ case -1: /* Interrupt */
+ return;
+ case 1: /* EOF */
+ return;
+ case 0:
+ /* OK */
+ break;
+ default:
+ DPRINT(Debug,9,(&Debug, "optionally enter returned %d (unexpected)n",
+ code));
+ return;
+ }
+
+ if (! override_charset[0])
+ return;
+
+ if (0 == strcmp(override_charset,"none"))
+ res = NULL;
+ else {
+ int j;
+
+ res = MIME_name_to_charset(override_charset,0);
+
+ if (!res) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnknowCharset,
+ "Charset %s is unknown."),
+ override_charset);
+

+ goto redraw;
+ }
+

+ j = charset_properties(res);
+
+ if (! (j & CS_printable) ||
+ ! (j & CS_mapping)) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCharsetBadOverride,
+ "Can't use charset %s for override."),
+ override_charset);


+ goto redraw;
+ }
+
+
+ }

+
+
+ if (tagged == 0) {
+
+ tagged = 1;
+ if (chdr)
+ setit(chdr->status, TAGGED);
+ }
+
+ mc = get_message_count(mailbox);
+ for (i=0; i < mc; i++) { /* get each tagged msg */
+ struct header_rec * hdr = give_header(mailbox,i);
+ if (hdr && ison(hdr->status, TAGGED)) {
+ hdr->override_charset = res;
+
+ /* If charset is overrided, it effects classification */
+ if (hdr->mime_parsed)
+ mime_classify_media(&(hdr->mime_rec),hdr);
+
+ clearit(hdr->status, TAGGED);
+ show_new_status(i,mailbox); /* update screen, if needed */


+
+
+ }
+ }
+

+ if (chdr)
+ chdr->status = oldstat; /* BACK! */
+
+ }
+
+
/* Returns 0 on quit */

struct prompt_list {
***************
*** 532,546 ****
ClearScreen();
printf ("Executing metamail...\n");
system_call(Cmd, SY_ENAB_SIGINT|SY_ENV_METAMAIL, NULL);
- Raw(ON | NO_TITE); /* Raw on but don't switch screen */
(void) unlink (fname);
! PutLineX(elm_LINES,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyIndex,
! "Press any key to return to index."));
! (void) ReadCh(0);
! printf("\r\n");
! Raw(OFF | NO_TITE); /* Raw off so raw on takes effect */
Raw(ON); /* Finally raw on and switch screen */
return(0);
} else {
--- 673,691 ----
ClearScreen();
printf ("Executing metamail...\n");
system_call(Cmd, SY_ENAB_SIGINT|SY_ENV_METAMAIL, NULL);
(void) unlink (fname);
!
! if (prompt_after_metamail) {
! Raw(ON | NO_TITE); /* Raw on but don't switch screen */
! PutLineX(elm_LINES,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyIndex,
! "Press any key to return to index."));
! (void) ReadCh(0);
! printf("\r\n");
! Raw(OFF | NO_TITE); /* Raw off so raw on takes effect */
! }
!
Raw(ON); /* Finally raw on and switch screen */
return(0);
} else {
Index: elm2.4.ME+.109-cvs/utils/charmapcopy.c
*** /tmp/5164-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-11-15 18:08:47.000000000 +0200
--- elm2.4.ME+.109-cvs/utils/charmapcopy.c 2003-11-15 17:50:22.000000000 +0200
***************
*** 0 ****
--- 1,100 ----
+ static char rcsid[] = "@(#)$Id: charmapcopy.c,v 1.3 2003/11/15 15:50:22 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
+ *

+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
+ *****************************************************************************/
+

+ #include "defs.h"
+ #include "elmlib.h"
+ #include "s_elm.h"
+ #include "s_me.h"
+ #include "reghelper.h"
+ #include "charmapcopy.h"
+
+ char ** copydirs = NULL;
+ int copydir_count = 0;
+
+ #include <errno.h>
+ extern int errno;
+
+ FILE *charmap_copy(name,pathname)
+ const char *name;
+ const char *pathname;
+ {
+ int i;
+ FILE *F = NULL;
+ FILE *res = NULL;
+ int fd,c;
+
+
+ for (i = 0; i < copydir_count; i++) {
+ char * n = elm_message(FRM("%s/%s"),copydirs[i],name);
+
+ F = fopen(n,"r");
+
+ if (F) {
+ lib_transient(CATGETS(elm_msg_cat, MeSet,MeCopyingMapfile,
+ "Copying mapfile %s: %s => %s"),
+ name,n,pathname);
+ log_config((char *)pathname);
+ }
+ free(n);
+ if (F)
+ break;
+ }
+ if (!F) {
+ lib_transient(FRM("*** Copying mapfile %s => %s -- file %s not found?"),
+ name,pathname,name);
+ return NULL;
+ }
+
+ fd = open(pathname, O_RDWR | O_CREAT | O_EXCL, 0444);
+ if (fd < 0) {
+ int errcode;
+
+ error1:
+ errcode = errno;
+

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),

+ pathname, error_description(errcode));
+
+ fclose(F);
+ return NULL;
+ }
+
+
+ res = fdopen(fd,"w+");
+ if (!res)
+ goto error1;
+
+ while (EOF != (c = getc(F))) {
+ if (putc(c,res) == EOF) {


+ int err = errno;

+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorTryingToWrite,
+ "Error %s encountered trying to write to %s."),
+ error_description(err),pathname);
+ fclose(F);
+ fclose(res);
+ return NULL;


+ }
+ }
+
+
+

+ if (ferror(res)) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReading,
+ "Error reading from %.50s"),
+ name);
+ fclose(F);
+ fclose(res);
+ return NULL;
+ }
+
+ fclose(F);
+
+ rewind(res);
+ return res;
+ }
Index: elm2.4.ME+.109-cvs/utils/charmapcopy.h
*** /tmp/5164-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-11-15 18:08:47.000000000 +0200
--- elm2.4.ME+.109-cvs/utils/charmapcopy.h 2003-11-09 18:13:38.000000000 +0200
***************
*** 0 ****
--- 1,14 ----
+ /* $Id: charmapcopy.h,v 1.2 2003/11/09 16:13:38 hurtta Exp $ */
+
+

+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
+ *****************************************************************************/
+
+

+ extern FILE *charmap_copy P_((const char *name, const char *pathname));
+ extern char ** copydirs;
+ extern int copydir_count;
+
Index: elm2.4.ME+.109-cvs/utils/elmbindata.c
*** /tmp/5164-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2003-11-15 18:08:47.000000000 +0200
--- elm2.4.ME+.109-cvs/utils/elmbindata.c 2003-11-15 17:51:21.000000000 +0200
***************
*** 0 ****
--- 1,188 ----
+ static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.3 2003/11/15 15:51:21 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
+ *

+ * Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
+ *****************************************************************************/
+

+ #include "elmutil.h"
+ #include "s_me.h"
+ #include "s_elm.h"

+ #include "cs_imp.h"
+
+ #include "bindata.h"


+
+ #include "reghelper.h"
+
+ DEBUG_VAR(Debug,__FILE__,"util");
+

+ int register_fd = -1;

+ char * program_name = "elmbindata";
+
+ #include "charmapcopy.h"


+
+ extern char *optarg;
+ extern int optind;
+
+

+ int main(argc, argv)
+ int argc;
+ char *argv[];
+ {

+ struct bindata_mapped_data * bindata = NULL;
+ char * target_file = NULL;
+ char * text_target_dir = NULL;
+
+ char **filelist = NULL;
+ int err = 0;
+
+ int c;


+ int global = 0;
+

+ #if DEBUG
+ init_debugfile("ELMBINDATA");


+ #endif
+ locale_init();
+
+ REGHELPER_INIT(argv[0]);
+

+ user_init();
+ init_defaults();
+

+ while ((c = getopt(argc, argv, "Gw:d:b:BIT:S:")) != EOF) {


+ switch(c) {
+ case 'G':
+ global++;
+ break;

+ case 'w':
+ target_file = optarg;
+ break;
+ case 'I':
+ target_file = bindata_path;
+ break;
+ case 'S':
+ copydirs = safe_realloc(copydirs,(copydir_count+1) * sizeof (*copydirs));
+ copydirs[copydir_count++] = optarg;
+ break;


+ case 'd' :
+ #if DEBUG
+ set_debugging(optarg);
+ #else
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,

+ "Warning: system created without debugging enabled - request ignored\n"));
+ #endif
+ break;
+ case 'B':
+ bindata = default_bindata();
+ if (!bindata) {


+ err = 1;
+ goto fail;
+ }

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileLoaded,
+ "%s loaded"),
+ raw_bindata_path);
+ break;
+ case 'b':
+ if (!get_bindata(&bindata,optarg)) {


+ err = 1;
+ goto fail;
+ }

+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileLoaded,
+ "%s loaded"),
+ optarg);
+ break;
+ case 'T':
+ text_target_dir = optarg;
+ if (0 == mkdir(text_target_dir,0700)) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeCreateDir,
+ "Directory %s created"),
+ text_target_dir);
+
+ if (register_fd != -1)
+ log_it("M",text_target_dir,"-","-",0700);
+
+ } else if (EEXIST != errno) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeCantCreateDir,
+ "Can't create directory %s"),
+ text_target_dir);


+ err = 1;
+ goto fail;
+ }
+

+ break;
+ case '?':
+ exit(1);
+ }
+ }
+
+

+ elm_sfprintf(version_buff, sizeof version_buff,
+ FRM("%s PL%s"), VERSION, PATCHLEVEL);
+
+
+ #ifdef DEBUG
+ {
+ int d = panic_dprint("\n\
+ ======================================================\n\

+ Debug output of the ELMBINDATA program (version %s).\n",


+ version_buff);
+
+ if (d >= 50) {
+ #if 0
+ panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");
+
+ lower_prompt("WARNING: Debug file may include passwords -- edit it!");
+ error_sleep(5+sleepmsg);

+ #endif
+ }
+ }
+ #endif
+
+ if (copydir_count)
+ set_charmap_copy_callback(charmap_copy);
+
+ if (!global)
+ read_rc_file(READ_FLAG_BINDATA_INIT);
+ else
+ post_init_check(READ_FLAG_BINDATA_INIT);
+
+ if (!bindata)
+ bindata = generate_bindata();
+
+ if (target_file && bindata) {
+ if (!write_bindata(bindata,target_file))
+ exit(1);
+ log_config(target_file);
+ }
+
+ if (text_target_dir && bindata) {
+ int i;
+ if (!write_bindata_text(bindata,text_target_dir, &filelist))
+ exit(1);
+
+ if (!filelist)
+ exit(1);
+
+ for (i = 0; filelist[i]; i++) {
+ log_config(filelist[i]);
+ free(filelist[i]);
+ }
+ free(filelist);


+ }
+
+ fail:
+

+ if (err)
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeProgFailed,
+ "%s failed; exit code=%d"),
+ argv[0],err);

+ return err;


+ }
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.109-cvs/utils/elmcharset.c
*** elm2.4.ME+.108/utils/elmcharset.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.109-cvs/utils/elmcharset.c 2003-11-09 18:13:38.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.26 2003/03/17 16:04:00 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.27 2003/11/09 16:13:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 21,110 ****
char * program_name = "elmcharset";
int register_fd = -1;

!
! static char ** copydirs = NULL;
! static int copydir_count = 0;
!
! static FILE *charmap_copy P_((const char *name, const char *pathname));
! static FILE *charmap_copy(name,pathname)
! const char *name;
! const char *pathname;
! {
! int i;
! FILE *F = NULL;
! FILE *res = NULL;
! int fd,c;
!
!
! for (i = 0; i < copydir_count; i++) {
! char * n = elm_message(FRM("%s/%s"),copydirs[i],name);
!
! F = fopen(n,"r");
!
! if (F) {
! lib_transient(CATGETS(elm_msg_cat, MeSet,MeCopyingMapfile,
! "Copying mapfile %s: %s => %s"),
! name,n,pathname);
! log_config((char *)pathname);
! }
! free(n);
! if (F)
! break;
! }
! if (!F) {
! lib_transient(FRM("*** Copying mapfile %s => %s -- file %s not found?"),
! name,pathname,name);


! return NULL;
! }
!

! fd = open(pathname, O_RDWR | O_CREAT | O_EXCL, 0444);
! if (fd < 0) {
! int errcode;
!
! error1:
! errcode = errno;
!
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! pathname, error_description(errcode));
!
! fclose(F);


! return NULL;
! }
!

!
! res = fdopen(fd,"w+");
! if (!res)
! goto error1;
!
! while (EOF != (c = getc(F))) {
! if (putc(c,res) == EOF) {


! int err = errno;

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorTryingToWrite,
! "Error %s encountered trying to write to %s."),
! error_description(err),pathname);
! fclose(F);
! fclose(res);


! return NULL;
! }
! }

!
!
!
! if (ferror(res)) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReading,
! "Error reading from %.50s"),
! name);
! fclose(F);
! fclose(res);


! return NULL;
! }
!

! fclose(F);
!
! rewind(res);
! return res;
! }

int main(argc, argv)
int argc;
--- 21,27 ----
char * program_name = "elmcharset";
int register_fd = -1;

! #include "charmapcopy.h"

int main(argc, argv)
int argc;
***************
*** 257,262 ****
--- 174,182 ----

if (!global)
read_rc_file(0);
+ else
+ post_init_check(0);
+

if (optind < argc) {
int errcount = 0;
Index: elm2.4.ME+.109-cvs/utils/elmlibregister.c
*** elm2.4.ME+.108/utils/elmlibregister.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.109-cvs/utils/elmlibregister.c 2003-11-09 18:13:38.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.2 2003/05/25 11:19:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.3 2003/11/09 16:13:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************

***************
*** 143,148 ****
--- 143,150 ----

if (!global)
read_rc_file(0);
+ else
+ post_init_check(0);


if (optind < argc) {
Index: elm2.4.ME+.109-cvs/utils/elmrc-write.c
*** elm2.4.ME+.108/utils/elmrc-write.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.109-cvs/utils/elmrc-write.c 2003-11-09 18:13:38.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.10 2003/03/17 16:04:00 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.11 2003/11/09 16:13:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************

***************
*** 141,146 ****
--- 141,148 ----

if (!global)
read_rc_file(0);
+ else
+ post_init_check(0);

if (optind < argc) {
FILE * F;
Index: elm2.4.ME+.109-cvs/utils/elmregister.c
*** elm2.4.ME+.108/utils/elmregister.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.109-cvs/utils/elmregister.c 2003-10-21 22:05:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.9 2003/05/26 15:19:04 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.13 2003/10/21 19:05:44 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

! fprintf(stderr,


"%s: Directory %s created\n",

program_name,Z);
} else if (errno != EEXIST) {
--- 1058,1064 ----
make_package_dir(Z,installer_root);

if (0 == mkdir(Z,0755)) {
! fprintf(stdout,

"%s: Directory %s created\n",

program_name,Z);
} else if (errno != EEXIST) {
***************
*** 1080,1086 ****

}

! fprintf(stderr,"%s: Creating %s\n",program_name,LI.filename);

LI.file = fdopen(t,"r+");
if (! LI.file) {
--- 1082,1088 ----

}

! fprintf(stdout,"%s: Creating %s\n",program_name,LI.filename);

LI.file = fdopen(t,"r+");
if (! LI.file) {
***************
*** 1370,1376 ****
}


! fprintf(stderr,"%s: File %s installed\n",program_name,target);

fclose(S);
free(tempname);
--- 1372,1378 ----
}


! fprintf(stdout,"%s: File %s installed\n",program_name,target);

fclose(S);
free(tempname);
***************

*** 1418,1430 ****
exit(1); /* FAILURE */
}


! fprintf(stderr,
"%s: Copying directory %s -> %s:\n",

program_name,src,trg);

if (0 == mkdir(trg,0755)) {

! fprintf(stderr,


"%s: Directory %s created\n",

program_name,trg);
} else if (errno != EEXIST) {
--- 1420,1432 ----
exit(1); /* FAILURE */
}

! fprintf(stdout,
"%s: Copying directory %s -> %s:\n",

program_name,src,trg);

if (0 == mkdir(trg,0755)) {

! fprintf(stdout,


"%s: Directory %s created\n",

! fprintf(stderr,


"%s: (%s) Keeping link %s from old version (was %s)\n",
program_name,source->filename,ptr->arg_ptrs[1],

ptr->arg_ptrs[0]
--- 2856,2862 ----

if (!on_current(source,ptr->arg_ptrs[1])) {
if ('M' != ptr->command_letter)
! fprintf(stdout,

"%s: (%s) Keeping link %s from old version (was %s)\n",
program_name,source->filename,ptr->arg_ptrs[1],

ptr->arg_ptrs[0]
***************
*** 2873,2879 ****

if (!on_current(source,ptr->arg_ptrs[0])) {
if ('M' != ptr->command_letter)
! fprintf(stderr,
"%s: (%s) Keeping file %s is from old version\n",
program_name,source->filename,ptr->arg_ptrs[0]);
continue;
--- 2876,2882 ----

if (!on_current(source,ptr->arg_ptrs[0])) {
if ('M' != ptr->command_letter)
! fprintf(stdout,

"%s: (%s) Keeping file %s is from old version\n",
program_name,source->filename,ptr->arg_ptrs[0]);
continue;
***************

! fprintf(stderr," %s",
translated[j]);


! fprintf(stderr,"\n");
! fflush(stderr);

pipefd = create_pipe(i,translated,0,&pid,"/");

--- 3323,3340 ----
}
translated[i] = NULL;

! fprintf(stdout,
"%s: Executing",program_name);
for (j = 0; j < i; j++)
! fprintf(stdout," %s",
ptr->arg_ptrs[j]);
! fprintf(stdout,
"\n%s: As",program_name);
for (j = 0; j < i; j++)

! fprintf(stdout," %s",
translated[j]);

+ }
+ }
+

+ if (ptr->group_ptr && 0 != strcmp(ptr->group_ptr,"-")) {
+ g = getgrnam(ptr->group_ptr);
+
+ if (!g)
+ fprintf(stderr,
+ "%s: [replay_list] '%c' Group %s not found\n",
+ program_name,ptr->command_letter,
+ ptr->group_ptr);
+ else
+ group = g->gr_gid;

+
+ }
+

+ if (ptr->mode_ptr && 0 != strcmp(ptr->mode_ptr,"-") &&
+ 0 != strcmp(ptr->mode_ptr,"0")) {
+ char * x;
+ mode = strtol(ptr->mode_ptr,&x,8);
+
+ if (*x || 0 == mode)

+ mode = -1;
+ }
+

+ if (stat(X,&X1) < 0) {
+ fprintf(stderr,
+ "%s: (note) %s : %s not accessible\n",
+ program_name,
+ ptr->arg_ptrs[0],X);
+
+ Exit_status = 1; /* FAILURE */
+
+ goto failure1;

+ }
+
+

+ if (
+ #ifdef S_ISDIR
+ S_ISDIR(X1.st_mode)
+ #else
+ S_IFDIR == (X1.st_mode & S_IFMT)

+ #endif
+ ) {
+

+ if (ptr->command_letter != 'M') {
+ fprintf(stderr,
+ "%s: (note) %s : %s is directory when should not\n",
+ program_name,
+ ptr->arg_ptrs[0],X);
+
+ Exit_status = 1; /* FAILURE */
+
+ goto failure1;
+ }

+
+ } else {


+ if (ptr->command_letter == 'M') {
+ fprintf(stderr,
+ "%s: (note) %s : %s is not a directory\n",
+ program_name,
+ ptr->arg_ptrs[0],X);
+
+ Exit_status = 1; /* FAILURE */
+ goto failure1;

+ }
+ }
+

+ if (user != (uid_t)-1 || group != (gid_t)-1) {
+ if (X1.st_uid != user || X1.st_gid != group) {
+ if (-1 == chown(X,user,group)) {
+ fprintf(stderr,"%s: Failed to set owner/group of %s\n",
+ program_name,X);
+ Exit_status = 1; /* FAILURE */
+ goto failure1;
+ }
+ } else {
+ fprintf(stdout,"%s: Fixed owner/group of %s\n",
+ program_name,X);
+ }
+
+ /* Recheck mode */
+ if (stat(X,&X1) < 0) {
+ fprintf(stderr,
+ "%s: (note) %s : %s not accessible\n",
+ program_name,
+ ptr->arg_ptrs[0],X);
+
+ Exit_status = 1; /* FAILURE */
+
+ goto failure1;

+ }
+ }
+

+ if (mode > 0) {
+
+ if ((X1.st_mode & 0777) != mode) {
+ if (-1 == chmod(X,mode)) {
+ fprintf(stderr,"%s: Failed to set mode of %s\n",
+ program_name,X);
+ Exit_status = 1; /* FAILURE */
+ } else {
+ fprintf(stdout,"%s: Mode of %s fixed\n",
+ program_name,X);

+ }
+ }
+
+ }
+

+ failure1:
+ free(X); X = 0;
+ break;
+ default:


+ break;
+ }
+ }
+

return Exit_status;
}

***************
*** 3490,3503 ****
int i;
int t;

! fprintf (stderr,
"%s: Copying ELM files from %s to / \n",
program_name,installer_root);

LI_target.filename = filelist;

if (0 == mkdir(ETCHOME,0755)) {

! fprintf(stderr,


"%s: Directory %s created\n",

program_name,ETCHOME);
} else if (errno != EEXIST) {
--- 3655,3668 ----
int i;
int t;

! fprintf (stdout,
"%s: Copying ELM files from %s to / \n",
program_name,installer_root);

LI_target.filename = filelist;

if (0 == mkdir(ETCHOME,0755)) {
! fprintf(stdout,

"%s: Directory %s created\n",

program_name,ETCHOME);
} else if (errno != EEXIST) {
***************
*** 3568,3574 ****
last = & LI_source.entries[LI_source.entries_count-1];
}

! /* EXECUTE commands */
r = replay_list(&LI_source.entries[LI_source.entries_count-1],
&LI_source,target,last);

--- 3733,3739 ----
last = & LI_source.entries[LI_source.entries_count-1];
}

! /* EXECUTE commands and fix permissions */
r = replay_list(&LI_source.entries[LI_source.entries_count-1],
&LI_source,target,last);

***************
*** 3766,3771 ****
--- 3931,3940 ----

program_name = argv[0];

+ #if defined(ANSI_C) || defined(SETLINEBUF)
+ setlinebuf(stdout);
+ #endif
+
#if 0
if (register_pipe)
fprintf(stderr,"%s: $ELM_INSTALLER=%s\n",program_name,register_pipe);

Index: elm2.4.ME+.109-cvs/utils/elmstringconvert.c
*** elm2.4.ME+.108/utils/elmstringconvert.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.109-cvs/utils/elmstringconvert.c 2003-11-09 18:13:38.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.5 2003/03/17 16:04:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.6 2003/11/09 16:13:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 261,266 ****
--- 261,268 ----

if (!global)
read_rc_file(0);
+ else
+ post_init_check(0);

if (!source_charset)
source_charset = system_charset;
Index: elm2.4.ME+.109-cvs/utils/elmterminal.c
*** elm2.4.ME+.108/utils/elmterminal.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.109-cvs/utils/elmterminal.c 2003-11-09 18:13:38.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.10 2003/03/17 16:04:00 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.11 2003/11/09 16:13:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 96,101 ****
--- 96,103 ----

if (!global)
read_rc_file(0);
+ else
+ post_init_check(0);

if (optind < argc) {
int errcount = 0;
Index: elm2.4.ME+.109-cvs/utils/elmunidata.c
*** elm2.4.ME+.108/utils/elmunidata.c 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.109-cvs/utils/elmunidata.c 2003-11-09 18:13:38.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.15 2003/03/17 16:04:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.16 2003/11/09 16:13:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 15,21 ****
#include "reghelper.h"

int register_fd = -1;
! char * program_name = "elmrc-write";

extern char *optarg;
extern int optind;
--- 15,21 ----
#include "reghelper.h"

int register_fd = -1;
! char * program_name = "elmunidata";

extern char *optarg;
extern int optind;
***************
*** 24,104 ****
int argc;
char *argv[];
{
! struct mapped_data * unidata = NULL;
! char * target_file = NULL;
! FILE * text_target_file = NULL;
! FILE * logfile = NULL;
! int err = 0;
! int silent_gaps = 0;
!
! int c;

#if DEBUG
! init_debugfile("ELMUNIDATA");
#endif
! locale_init();
!
! REGHELPER_INIT(argv[0]);
!
! user_init();
! init_defaults();
! read_rc_file(READ_FLAG_UNIDATA_INIT);
!
! while ((c = getopt(argc, argv, "w:l:sd:b:BIT:")) != EOF) {
! switch(c) {
! case 'w':
! target_file = optarg;
! break;
! case 'I':
! target_file = unidata_path;
! break;
! case 'l':
! logfile = fopen(optarg,"w");
break;
case 's':
silent_gaps = 1;
break;
! case 'd' :
#if DEBUG
! set_debugging(optarg);
#else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,
! "Warning: system created without debugging enabled - request ignored\n"));
#endif
! break;
! case 'B':
! unidata = default_unidata();
! if (!unidata) {
! err = 1;
! goto fail;
}
- lib_error(CATGETS(elm_msg_cat, MeSet, MeFileLoaded,
- "%s loaded"),
- raw_unidata_path);
- break;
- case 'b':
- if (!get_unidata(&unidata,optarg)) {
- err = 1;
- goto fail;
- }
- lib_error(CATGETS(elm_msg_cat, MeSet, MeFileLoaded,
- "%s loaded"),
- optarg);
- break;
- case 'T':
- text_target_file = fopen(optarg,"w");
- if (text_target_file)
- log_config(optarg);
- break;
- case '?':
- exit(1);
}
- }


elm_sfprintf(version_buff, sizeof version_buff,


FRM("%s PL%s"), VERSION, PATCHLEVEL);

!
#ifdef DEBUG
{

int d = panic_dprint("\n\

--- 24,104 ----
int argc;
char *argv[];
{
! struct unidata_mapped_data * unidata = NULL;
! char * target_file = NULL;
! FILE * text_target_file = NULL;
! FILE * logfile = NULL;
! int err = 0;
! int silent_gaps = 0;
!
! int c;

#if DEBUG
! init_debugfile("ELMUNIDATA");
#endif
! locale_init();
!
! REGHELPER_INIT(argv[0]);
!
! user_init();
! init_defaults();
! read_rc_file(READ_FLAG_UNIDATA_INIT);
!
! while ((c = getopt(argc, argv, "w:l:sd:b:BIT:")) != EOF) {
! switch(c) {
! case 'w':
! target_file = optarg;
! break;
! case 'I':
! target_file = unidata_path;
! break;
! case 'l':
! logfile = fopen(optarg,"w");
break;
case 's':
silent_gaps = 1;
break;
! case 'd' :
#if DEBUG
! set_debugging(optarg);
#else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,
! "Warning: system created without debugging enabled - request ignored\n"));
#endif
! break;
! case 'B':
! unidata = default_unidata();
! if (!unidata) {
! err = 1;
! goto fail;
! }
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileLoaded,
! "%s loaded"),
! raw_unidata_path);
! break;
! case 'b':
! if (!get_unidata(&unidata,optarg)) {
! err = 1;
! goto fail;
! }
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileLoaded,
! "%s loaded"),
! optarg);
! break;
! case 'T':
! text_target_file = fopen(optarg,"w");
! if (text_target_file)
! log_config(optarg);
! break;
! case '?':
! exit(1);
}
}


elm_sfprintf(version_buff, sizeof version_buff,


FRM("%s PL%s"), VERSION, PATCHLEVEL);

!
#ifdef DEBUG
{

int d = panic_dprint("\n\

***************
*** 118,171 ****
#endif


! if (optind < argc) {
! if (!read_unidata_text(&unidata,argv[optind],logfile,
! silent_gaps)) {
!
! err = 1;
! goto fail;
! }
! if (logfile) {
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeFileParsed,
! "%s parsed"),
argv[optind]);
! putc('\n',logfile);
! }
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileParsed,
! "%s parsed"),
! argv[optind]);
! }
!
! if (target_file && unidata) {
! if (!write_unidata(unidata,target_file))
! exit(1);
! log_config(target_file);
! }
!
! if (text_target_file && unidata) {
! if (!write_unidata_text(unidata,text_target_file))
! exit(1);
! }
!
! if (text_target_file)
! fclose(text_target_file);
!
fail:
!
! if (logfile) {
! if (err) {
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeProgFailed,
! "%s failed; exit code=%d"),
argv[0],err);
! putc('\n',logfile);
! }
! fclose(logfile);
! }
! if (err)
! lib_error(CATGETS(elm_msg_cat, MeSet, MeProgFailed,
! "%s failed; exit code=%d"),
! argv[0],err);
! return err;
}

/*
--- 118,171 ----
#endif


! if (optind < argc) {
! if (!read_unidata_text(&unidata,argv[optind],logfile,
! silent_gaps)) {
!
! err = 1;
! goto fail;
! }
! if (logfile) {
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeFileParsed,
! "%s parsed"),
! argv[optind]);
! putc('\n',logfile);
! }
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileParsed,
! "%s parsed"),
argv[optind]);
! }
!
! if (target_file && unidata) {
! if (!write_unidata(unidata,target_file))
! exit(1);
! log_config(target_file);
! }
!
! if (text_target_file && unidata) {
! if (!write_unidata_text(unidata,text_target_file))
! exit(1);
! }
!
! if (text_target_file)
! fclose(text_target_file);
!
fail:
!
! if (logfile) {
! if (err) {
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeProgFailed,
! "%s failed; exit code=%d"),
! argv[0],err);
! putc('\n',logfile);
! }
! fclose(logfile);
! }
! if (err)
! lib_error(CATGETS(elm_msg_cat, MeSet, MeProgFailed,
! "%s failed; exit code=%d"),
argv[0],err);
! return err;
}

/*
Index: elm2.4.ME+.109-cvs/utils/Makefile.SH
*** elm2.4.ME+.108/utils/Makefile.SH 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109-cvs/utils/Makefile.SH 2003-11-15 17:50:22.000000000 +0200


***************
*** 16,22 ****
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.32 2003/10/01 17:34:36 hurtta Exp $
#
# Makefile for the Elm system utilities
#
--- 16,22 ----
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.34 2003/11/15 15:50:22 hurtta Exp $


#
# Makefile for the Elm system utilities
#
***************

*** 94,99 ****
--- 94,100 ----
$(BIN)/elmrc-write-shared \
$(BIN)/elmterminal-shared \
$(BIN)/elmunidata-shared \
+ $(BIN)/elmbindata-shared \
$(BIN)/elmstringconvert-shared \
$(REGSHARED)

***************
*** 138,143 ****
--- 139,145 ----
$(LIB)/elmrc-write \
$(LIB)/elmterminal \
$(LIB)/elmunidata \
+ $(LIB)/elmbindata \
$(LIB)/elmregister \
$(LIB)/elmuninstall \
$(REGNOSHARED)
***************
*** 160,165 ****
--- 162,168 ----
$(BIN)/elmrc-write \
$(BIN)/elmterminal \
$(BIN)/elmunidata \
+ $(BIN)/elmbindata \
$(BIN)/elmstringconvert \
$(BIN)/elmregister \
$(REGSHAREDBIN) \
***************
*** 188,193 ****
--- 191,197 ----
elmrc-write.o \
elmterminal.o \
elmunidata.o \
+ elmbindata.o \
elmstringconvert.o \
elmregister.o \
$(REGSHAREDOBJ)
***************
*** 210,222 ****
READMSG_SRC = readmsg.c
READMSG_OBJ = readmsg.o
ELMCHARSET_SRC = elmcharset.c
! ELMCHARSET_OBJ = elmcharset.o reghelper.o
ELMRCWRITE_SRC = elmrc-write.c
ELMRCWRITE_OBJ = elmrc-write.o reghelper.o
ELMTERMINAL_SRC = elmterminal.c
ELMTERMINAL_OBJ = elmterminal.o reghelper.o
ELMUNIDATA_SRC = elmunidata.c


ELMUNIDATA_OBJ = elmunidata.o reghelper.o
ELMSCONV_SRC = elmstringconvert.c
ELMSCONV_OBJ = elmstringconvert.o

ELMLIBREG_OBJ = elmlibregister.o reghelper.o
--- 214,228 ----
READMSG_SRC = readmsg.c
READMSG_OBJ = readmsg.o
ELMCHARSET_SRC = elmcharset.c
! ELMCHARSET_OBJ = elmcharset.o reghelper.o charmapcopy.o
ELMRCWRITE_SRC = elmrc-write.c
ELMRCWRITE_OBJ = elmrc-write.o reghelper.o
ELMTERMINAL_SRC = elmterminal.c
ELMTERMINAL_OBJ = elmterminal.o reghelper.o
ELMUNIDATA_SRC = elmunidata.c
ELMUNIDATA_OBJ = elmunidata.o reghelper.o
+ ELMBINDATA_SRC = elmbindata.c
+ ELMBINDATA_OBJ = elmbindata.o reghelper.o charmapcopy.o


ELMSCONV_SRC = elmstringconvert.c
ELMSCONV_OBJ = elmstringconvert.o

ELMLIBREG_OBJ = elmlibregister.o reghelper.o
***************
*** 255,261 ****
prlong.o: $(INCLDIR)/elmutil.h $(INCLDIR)/defs.h
readmsg.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_readmsg.h
elmcharset.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h
elmrc-write.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
$(INCLDIR)/reghelper.h
--- 261,267 ----
prlong.o: $(INCLDIR)/elmutil.h $(INCLDIR)/defs.h
readmsg.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_readmsg.h
elmcharset.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h charmapcopy.h
elmrc-write.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
$(INCLDIR)/reghelper.h
***************
*** 263,271 ****
$(INCLDIR)/reghelper.h
elmunidata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/unidata.h $(INCLDIR)/reghelper.h


elmstringconvert.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h

! reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h
elmlibregister.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
$(INCLDIR)/reghelper.h
--- 269,283 ----
$(INCLDIR)/reghelper.h
elmunidata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/unidata.h $(INCLDIR)/reghelper.h
+ elmbindata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
+ $(INCLDIR)/bindata.h $(INCLDIR)/reghelper.h $(INCLDIR)/cs_imp.h \
+ charmapcopy.o


elmstringconvert.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h

! reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
! $(INCLDIR)/reghelper.h
! charmapcopy.o: charmapcopy.h $(INCLDIR)/s_elm.h $(INCLDIR)/elmlib.h \
! $(INCLDIR)/defs.h $(INCLDIR)/s_me.h $(INCLDIR)/reghelper.h
elmlibregister.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
$(INCLDIR)/reghelper.h
***************
*** 337,342 ****
--- 349,357 ----
$(BIN)/elmunidata: $(ELMUNIDATA_OBJ) ../lib/libutil.a
$(CC) $(LFLAGS) -o $@ $(ELMUNIDATA_OBJ) ../lib/libutil.a $(LIB2)

+ $(BIN)/elmbindata: $(ELMBINDATA_OBJ) ../lib/libutil.a
+ $(CC) $(LFLAGS) -o $@ $(ELMBINDATA_OBJ) ../lib/libutil.a $(LIB2)
+
$(BIN)/elmstringconvert: $(ELMSCONV_OBJ) ../lib/libutil.a
$(CC) $(LFLAGS) -o $@ $(ELMSCONV_OBJ) ../lib/libutil.a $(LIB2)

***************
*** 464,469 ****
--- 479,487 ----
$(BIN)/elmunidata-shared: $(ELMUNIDATA_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMUNIDATA_OBJ) ../shlib/libelmme-base.so $(LIB2)

+ $(BIN)/elmbindata-shared: $(ELMBINDATA_OBJ) ../shlib/libelmme-base.so
+ $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMBINDATA_OBJ) ../shlib/libelmme-base.so $(LIB2)
+
$(BIN)/elmstringconvert-shared: $(ELMSCONV_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMSCONV_OBJ) ../shlib/libelmme-base.so $(LIB2)

***************
*** 510,515 ****
--- 528,536 ----


$(LIB)/elmunidata: $(BIN)/elmunidata-shared
$(REG) copy -m 555 $? $@

+ $(LIB)/elmbindata: $(BIN)/elmbindata-shared


+ $(REG) copy -m 555 $? $@
+

$(LIB)/elmlibregister: $(BIN)/elmlibregister-shared


$(REG) copy -m 555 $? $@

***************
*** 565,570 ****
--- 586,594 ----
$(LIB)/elmunidata: $(BIN)/elmunidata


$(REG) copy -m 555 $? $@

+ $(LIB)/elmbindata: $(BIN)/elmbindata


+ $(REG) copy -m 555 $? $@
+
!NO!SUBS!

fi
Index: elm2.4.ME+.109-cvs/utils/reghelper.c
*** elm2.4.ME+.108/utils/reghelper.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.109-cvs/utils/reghelper.c 2003-11-09 20:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reghelper.c,v 1.3 2003/05/26 15:19:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: reghelper.c,v 1.4 2003/11/09 18:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 96,101 ****
--- 96,105 ----
void log_config(file)
char *file;
{
+ /* Skip '/' on front ... */
+ while ('/' == file[0])
+ file++;
+
if (register_fd != -1)
log_it("C",file,"-","-",0);
}

Kari E. Hurtta

unread,
Nov 29, 2003, 5:40:06 AM11/29/03
to
Archive-name: elm2.4ME+/PL109S

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

files elm-2.4ME+PL109S.patch.gz
and elm-2.4ME+109S.tar.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL109S.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+109S.tar.gz >
via WWW.

Page <URL: http://personal.inet.fi/atk/elmme/ > is not up

of date.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL109S.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Notice: ME+ series is not official Elm.
This patch is agaist Elm 2.4ME+ PL109 (25) --------------------------------
Index: elm2.4.ME+.109S-cvs/hdrs/patchlevel.h
Prereq: 1099000000
*** elm2.4.ME+.109/hdrs/patchlevel.h 2003-11-15 18:19:06.000000000 +0200
--- elm2.4.ME+.109S-cvs/hdrs/patchlevel.h 2003-11-29 11:07:44.000000000 +0200
***************
*** 1,8 ****


! #define PATCHLEVEL "109 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.109
*/
! #define LAST_REPORT_TIME 1099000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

#define VERS_DATE "Nov, 2003" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "109S (25)"
/* Used by Configure:
SHAREDTAG: .1.0.109
*/
! #define LAST_REPORT_TIME 1100000000


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

#define VERS_DATE "Nov, 2003" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.109S-cvs/README.ME+
*** elm2.4.ME+.109/README.ME+ 2003-11-15 18:19:06.000000000 +0200
--- elm2.4.ME+.109S-cvs/README.ME+ 2003-11-29 11:07:43.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.670 2003/11/15 15:25:17 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.670.4.1 2003/11/29 09:07:43 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,63 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL109S (25) compared with Elm2.4ME+ PL109 (25)
+ ------------------------------------------------------------------
+
+ Fix potential security problem on systems where Elm ME+
+ is setgid mail and system do not support Posix saved IDs.
+ Check output of 'elm -vvv' if your system have problems:
+
+ Have Posix saved IDs: Yes (egid 12)
+
+ If this is 'No' and egid is other than your gid, there is
+ possibility that Elm ME+ can read or write some files
+ which are readable or writable by group mail, when it should
+ not access them. Note that these fixes can not be complete.
+ There is race condition at least. Closing that race condition
+ requires that Elm ME+ drop privileges temporary. For that
+ Elm ME+ uses Posix saved IDs.
+
+ - SECURITY: Add can_open() test to load_locale_map()
+ - SECURITY: Add can_open() test to copy1()
+ - SECURITY: Add can_open() test to parse_iso2022_map()
+ - SECURITY: Add can_open() test to do_newalias()
+ - SECURITY: Add can_open() test to dbz_fresh()
+ - SECURITY: Add can_open() test to dbz_again()
+ - SECURITY: Add can_open() test to dbz_open()
+ - SECURITY: Add can_open() test to latebase()
+ - SECURITY: Add can_open() test to read_rc_file()
+ - SECURITY: Add can_open() test to parse_service_entries()
+ - SECURITY: Add can_open() test to load_terminal_map()
+ - SECURITY: Add can_open() test to read_mailcaps()
+ - SECURITY: Add can_open() test to add_to_alias_text()
+ - SECURITY: Add can_open() test to delete_from_alias_text()
+ - SECURITY: Add can_open() test to mime_guess_content_type()
+ - SECURITY: Add can_open() test to edit_the_message()
+ - SECURITY: Add can_open() test to read_editor()
+ - SECURITY: Add can_open() test to append()
+ - SECURITY: Add can_open() test to check_form_file()
+ - SECURITY: Add can_open() test to format_form()
+ - SECURITY: Add can_open() test to edit_headers_on_editor()
+ - SECURITY: Add can_open() test to mail()
+ - SECURITY: Add can_open() test to save_options()
+
+ - Add can_open() test to load_folder_state_file()
+ - Add can_open() test to read_unidata_text()
+ - Add can_open() test to display_file()


+
Changes of Elm2.4ME+ PL109 (25) compared with Elm2.4ME+ PL108 (25)

------------------------------------------------------------------

Index: elm2.4.ME+.109S-cvs/lib/charset.c
*** elm2.4.ME+.109/lib/charset.c 2003-11-15 18:19:06.000000000 +0200
--- elm2.4.ME+.109S-cvs/lib/charset.c 2003-11-26 19:16:54.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: charset.c,v 1.72 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.72 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: charset.c,v 1.73 2003/11/26 17:16:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.73 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 1388,1398 ****
{
struct locale_map_item *result;
int result_len = 0;
! FILE * f = fopen(filename,"r");
int max_result = 0;
int c,l1;
char buf[LONG_STRING];

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
--- 1388,1407 ----
{
struct locale_map_item *result;
int result_len = 0;
! FILE * f;
int max_result = 0;
int c,l1;
char buf[LONG_STRING];
+ int err = can_open(filename,"r");

+ if(err) {
+ DPRINT(Debug,2,(&Debug,
+ "load_locale_map: %s: %s (can_open)\n",
+ filename,error_description(err)));


+ return NULL;
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
Index: elm2.4.ME+.109S-cvs/lib/file_util.c
*** elm2.4.ME+.109/lib/file_util.c 2002-01-26 13:14:46.000000000 +0200
--- elm2.4.ME+.109S-cvs/lib/file_util.c 2003-11-26 19:16:54.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.6 2001/06/06 18:08:58 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.7 2003/11/26 17:16:54 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 274,279 ****
--- 274,294 ----
DPRINT(Debug,1,(&Debug,
"Copy: to='%s'\n", to));

+ if (!isspool) {
+ int err = can_open(to, "w");
+
+ if (err) {
+ DPRINT(Debug,1,(&Debug,
+ "Error: could not open %s for writing (copy -- can_open)\n",
+ to));
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenFile,
+ "Could not open file %s."),
+ to);
+ return(1);
+ }
+ }
+
if ((to_file = fopen(to, "w")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Error: could not open %s for writing (copy)\n",
Index: elm2.4.ME+.109S-cvs/lib/iso2022.c
*** elm2.4.ME+.109/lib/iso2022.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109S-cvs/lib/iso2022.c 2003-11-26 19:16:54.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.26 2003/08/24 17:04:22 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.27 2003/11/26 17:16:54 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 482,491 ****
int max_count = 0;
int new_max;
int count = 0;
! FILE * f = fopen(filename,"r");
char buf[LONG_STRING];
int c, l1;

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
--- 482,500 ----
int max_count = 0;
int new_max;
int count = 0;
! FILE * f;
char buf[LONG_STRING];
int c, l1;
+ int err = can_open(filename,"r");

+ if (err) {
+ DPRINT(Debug,2,(&Debug,
+ "parse_iso2022_map=0: %s: %s (can_open)\n",
+ filename,error_description(err)));


+ return 0;
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
Index: elm2.4.ME+.109S-cvs/lib/ldstate.c
*** elm2.4.ME+.109/lib/ldstate.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109S-cvs/lib/ldstate.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.7 2003/07/24 16:29:52 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.8 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 114,119 ****
--- 114,120 ----
char buf[SLEN], *state_fname;
int status, i, Len,j;
FILE *fp;
+ int err;

/* clear out the folder status record */
clear_ldstate(fst);
***************
*** 121,126 ****
--- 122,135 ----
/* see if we can find a state file */
if ((state_fname = getenv(FOLDER_STATE_ENV)) == NULL)
return 0;
+
+ /* This test should not needed,
+ setgid Elm ME+ do not call this function
+ */
+ err = can_open(state_fname, "r");
+ if (err)
+ return 0;
+
if ((fp = fopen(state_fname, "r")) == NULL)
return 0;

Index: elm2.4.ME+.109S-cvs/lib/localmbx.c
*** elm2.4.ME+.109/lib/localmbx.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109S-cvs/lib/localmbx.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.60 2003/07/24 16:29:52 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.60 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.61 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************

*** 4242,4247 ****
--- 4242,4248 ----
KEEP_STATE keep_state_ptr;
{
int status = 0,err;
+
keep_state_ptr -> a.file.temp_keep_file =
elm_message(FRM("%s%s%d"),temp_dir, temp_file, getpid());

Index: elm2.4.ME+.109S-cvs/lib/mk_aliases.c
*** elm2.4.ME+.109/lib/mk_aliases.c 2002-01-26 13:14:46.000000000 +0200
--- elm2.4.ME+.109S-cvs/lib/mk_aliases.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 1.8 2001/03/13 19:46:12 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 1.9 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 39,45 ****
int buff_loaded; /* for file input overlap... */
int err_flag; /* if errors, don't save! */
int al_count; /* how many aliases so far? */
- char msg_buff[SLEN]; /* buffer for error messages */
DBZ *aliases_hash; /* current alias file */
char *buffer; /* alias line buffer */
long buffer_size; /* size of alias buffer */
--- 39,44 ----
***************
*** 566,572 ****
char *inputname, *dataname;
int fromelm, textwarn;
{
! FILE *in, *data;

/*
* try and allocate a big buffer (larger than a 64k segment...
--- 565,573 ----
char *inputname, *dataname;
int fromelm, textwarn;
{
! FILE *in, *data;
!
! int err;

/*
* try and allocate a big buffer (larger than a 64k segment...
***************
*** 587,603 ****
dbz_incore(TRUE);
}

if ((in = fopen(inputname,"r")) == NULL) {
! if ( textwarn )
! {
! lib_error(CATGETS(elm_msg_cat,
! NewaliasSet, NewaliasNoOpenIn,
! "Couldn't open %s for input!"),
! inputname);
! }
! else {
! *msg_buff = '\0';
! }
free(buffer);
return(-1);
}
--- 588,614 ----
dbz_incore(TRUE);
}

+ err = can_open(inputname,"r");
+ if (err) {
+ if ( textwarn ) {
+ lib_error(CATGETS(elm_msg_cat,
+ NewaliasSet, NewaliasNoOpenIn,
+ "Couldn't open %s for input!"),
+ inputname);
+ }
+
+ free(buffer);
+ return(-1);
+ }
+
if ((in = fopen(inputname,"r")) == NULL) {
! if ( textwarn ) {
! lib_error(CATGETS(elm_msg_cat,
! NewaliasSet, NewaliasNoOpenIn,
! "Couldn't open %s for input!"),
! inputname);
! }
!
free(buffer);
return(-1);
}
***************
*** 611,616 ****
--- 622,636 ----
return(-1);
}

+ err = can_open(dataname, "w");
+ if (err) {
+ lib_error(CATGETS(elm_msg_cat,
+ NewaliasSet, NewaliasNoOpenOut,
+ "Couldn't open %s for output!"), dataname);
+ free(buffer);
+ return(-1);
+ }
+
if ((data = fopen(dataname, "w")) == NULL) {
lib_error(CATGETS(elm_msg_cat,
NewaliasSet, NewaliasNoOpenOut,
***************
*** 700,702 ****
--- 720,729 ----





+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

+
Index: elm2.4.ME+.109S-cvs/lib/ndbz.c
*** elm2.4.ME+.109/lib/ndbz.c 2002-01-26 13:14:45.000000000 +0200
--- elm2.4.ME+.109S-cvs/lib/ndbz.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.4 2001/06/06 18:09:01 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.5 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 246,255 ****
int fs; /* field-separator character in base file */
of_t tagmask; /* 0 default, 1 no tags */
{
! register char *fn;
struct dbzconfig c;
! register of_t m;
! register FILE *f;

if (size != 0 && size < 2) {
DPRINT(Debug,5,(&Debug,
--- 246,256 ----
int fs; /* field-separator character in base file */
of_t tagmask; /* 0 default, 1 no tags */
{
! char *fn;
struct dbzconfig c;
! of_t m;
! FILE *f;
! int err;

if (size != 0 && size < 2) {
DPRINT(Debug,5,(&Debug,
***************
*** 289,294 ****
--- 290,305 ----
fn = enstring(name, dir);
if (fn == NULL)
return (DBZ *)NULL;
+
+ err = can_open(fn, "w");
+ if (err) {
+ free((malloc_t)fn);
+
+ DPRINT(Debug,5,(&Debug,
+ "dbz_fresh: unable to write config (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "w");
free((malloc_t)fn);
if (f == NULL) {
***************
*** 310,315 ****
--- 321,335 ----
fn = enstring(name, pag);
if (fn == NULL)
return (DBZ *)NULL;
+
+ err = can_open(fn, "w");
+ if (err) {
+ free((malloc_t)fn);
+ DPRINT(Debug,5,(&Debug,
+ "dbz_fresh: unable to create/truncate .pag file (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "w");
free((malloc_t)fn);
if (f == NULL) {
***************
*** 394,411 ****
char *name; /* base name; .dir and .pag must exist */
char *oldname; /* base name; all must exist */
{
! register char *fn;
struct dbzconfig c;
! register int i;
! register long top;
! register FILE *f;
! register int newtable;
! register of_t newsize;

/* pick up the old configuration */
fn = enstring(oldname, dir);
if (fn == NULL)
return (DBZ *)NULL;
f = fopen(fn, "r");
free((malloc_t)fn);
if (f == NULL) {
--- 414,442 ----
char *name; /* base name; .dir and .pag must exist */
char *oldname; /* base name; all must exist */
{
! char *fn;
struct dbzconfig c;
! int i;
! long top;
! FILE *f;
! int newtable;
! of_t newsize;
! int err;

/* pick up the old configuration */
fn = enstring(oldname, dir);
if (fn == NULL)
return (DBZ *)NULL;
+
+ err = can_open(fn, "r");
+ if (err) {
+ free((malloc_t)fn);
+
+ DPRINT(Debug,5,(&Debug,
+ "dbz_again: cannot open old .dir file (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "r");
free((malloc_t)fn);
if (f == NULL) {
***************
*** 446,451 ****
--- 477,491 ----
fn = enstring(name, dir);
if (fn == NULL)
return (DBZ *)NULL;
+
+ err = can_open(fn, "w");
+ if (err) {
+ free((malloc_t)fn);
+ DPRINT(Debug,5,(&Debug,
+ "dbz_again: unable to write new .dir (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "w");
free((malloc_t)fn);
if (f == NULL) {
***************
*** 465,470 ****
--- 505,519 ----
fn = enstring(name, pag);
if (fn == NULL)
return (DBZ *)NULL;
+
+ err = can_open(fn, "w");
+ if (err) {
+ free((malloc_t)fn);
+ DPRINT(Debug,5,(&Debug,
+ "dbz_again: unable to create/truncate .pag file (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "w");
free((malloc_t)fn);
if (f == NULL) {
***************
*** 489,499 ****
char *name;
int mode, flags;
{
! register int i;
! register size_t s;
! register DBZ *db;
! register char *dirfname;
! register char *pagfname;

if ((db = (DBZ *) calloc(sizeof(DBZ), 1)) == NULL) {
DPRINT(Debug,5,(&Debug,
--- 538,549 ----
char *name;
int mode, flags;
{
! int i;
! size_t s;
! DBZ *db;
! char *dirfname;
! char *pagfname;
! int err;

if ((db = (DBZ *) calloc(sizeof(DBZ), 1)) == NULL) {
DPRINT(Debug,5,(&Debug,
***************
*** 507,512 ****
--- 557,577 ----
return (DBZ *)NULL;
}

+ if (mode == O_RDONLY)
+ err = can_open(dirfname, "r");
+ else
+ err = can_open(dirfname, "r+");
+ if (err) {
+ free((malloc_t)dirfname);
+
+ DPRINT(Debug,5,(&Debug,
+ "dbz_open: can't open .dir file (can_open)\n"));
+ free((malloc_t)db);
+
+ errno = err;
+ return (DBZ *)NULL;
+ }
+
if (mode == O_RDONLY) {
db->dbz_dirf = fopen(dirfname, "r");
db->dbz_dirronly = 1;
***************
*** 528,533 ****
--- 593,614 ----
free((malloc_t)db);
return (DBZ *)NULL;
}
+
+ if (mode == O_RDONLY)
+ err = can_open(pagfname, "rb");
+ else
+ err = can_open(pagfname, "r+b");
+ if (err) {
+ DPRINT(Debug,5,(&Debug,
+ "dbz_open: .pag open failed (can_open)\n"));
+ (void) fclose(db->dbz_dirf);
+ free((malloc_t)pagfname);
+ free((malloc_t)db);
+
+ errno = err;
+ return (DBZ *)NULL;
+ }
+
if (mode == O_RDONLY) {
db->dbz_pagf = fopen(pagfname, "rb");
db->dbz_pagronly = 1;
***************
*** 558,568 ****
--- 639,659 ----
db->dbz_pagpos = -1;
/* don't free pagfname, need it below */

+ err = can_open(name, "r");
+ if (err) {
+ DPRINT(Debug,5,(&Debug,
+ "dbz_open: basefile open failed (can_open)\n"));
+

+ goto fail1;
+ }
+

/* open the base file */
db->dbz_basef = fopen(name, "r");
if (db->dbz_basef == NULL) {
DPRINT(Debug,5,(&Debug,
"dbz_open: basefile open failed\n"));
+
+ fail1:
db->dbz_basefname = enstring(name, "");
if (db->dbz_basefname == NULL) {
(void) fclose(db->dbz_pagf);
***************
*** 843,855 ****
latebase(db)
register DBZ *db;
{
! register FILE *it;

if (db->dbz_basefname == NULL) {
DPRINT(Debug,5,(&Debug,
"latebase: name foulup\n"));
return (FILE *)NULL;
}
it = fopen(db->dbz_basefname, "r");
if (it == NULL) {
DPRINT(Debug,5,(&Debug,
--- 934,955 ----
latebase(db)
register DBZ *db;
{
! FILE *it;
! int err;

if (db->dbz_basefname == NULL) {
DPRINT(Debug,5,(&Debug,
"latebase: name foulup\n"));
return (FILE *)NULL;
}
+
+ err = can_open(db->dbz_basefname, "r");
+ if (err) {
+ DPRINT(Debug,5,(&Debug,
+ "latebase: still can't open base (can_open)\n"));
+ return (FILE *)NULL;
+ }
+
it = fopen(db->dbz_basefname, "r");
if (it == NULL) {
DPRINT(Debug,5,(&Debug,
Index: elm2.4.ME+.109S-cvs/lib/read_rc.c
*** elm2.4.ME+.109/lib/read_rc.c 2003-11-15 18:19:06.000000000 +0200
--- elm2.4.ME+.109S-cvs/lib/read_rc.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.121 2003/11/10 15:15:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.121 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.122 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.122 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************

*** 1355,1377 ****
/** this routine does all the actual work of reading in the
.rc file... **/

! FILE *file;
!
errors = 0;

/* Look for the elmrc file */
! if ((file = fopen(user_rc_file, "r")) == NULL) {
DPRINT(Debug,2,(&Debug,
! "Warning:User has no \"%s\" file\n\n",
user_rc_file));
! }

! if (file != NULL) {
! do_rc(file, LOCAL_RC, ELMRCFILE);
! fclose(file);
}

-

/* load_locale_map may refer to map-text-dir ... */

do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
sizeof(map_txtdir));

--- 1355,1388 ----
/** this routine does all the actual work of reading in the
.rc file... **/

! int err;
!
errors = 0;

+
/* Look for the elmrc file */
! err = can_open(user_rc_file, "r");
! if (err) {
DPRINT(Debug,2,(&Debug,
! "Warning:User has no \"%s\" file (can_open)\n\n",
user_rc_file));
!
! } else {
! FILE *file = NULL;

! if ((file = fopen(user_rc_file, "r")) == NULL) {
! DPRINT(Debug,2,(&Debug,
! "Warning:Open \"%s\" failed\n\n",
! user_rc_file));
!
! }
!
! if (file != NULL) {
! do_rc(file, LOCAL_RC, ELMRCFILE);
! fclose(file);
! }


}

/* load_locale_map may refer to map-text-dir ... */

do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
sizeof(map_txtdir));

Index: elm2.4.ME+.109S-cvs/lib/service_list.c
*** elm2.4.ME+.109/lib/service_list.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.109S-cvs/lib/service_list.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.23 2003/05/17 16:13:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: service_list.c,v 1.24 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 928,937 ****
/* hostname service options */
int max_count = 0;
int count = 0;
! FILE * f = fopen(filename,"r");
char buf[LONG_STRING];
int c, l1;

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
--- 928,949 ----
/* hostname service options */
int max_count = 0;
int count = 0;
! FILE * f;
char buf[LONG_STRING];
int c, l1;

+ if (!system) {
+ int err = can_open(filename,"r");
+
+ if (err) {
+ DPRINT(Debug,2,(&Debug,
+ "parse_service_entries=0: %s: %s (can_open)\n",
+ filename,error_description(err)));


+ return 0;
+ }
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
Index: elm2.4.ME+.109S-cvs/lib/terminal.c
*** elm2.4.ME+.109/lib/terminal.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109S-cvs/lib/terminal.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.37 2003/08/19 14:34:12 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.38 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 411,421 ****
{
struct terminal_map_item *result;
int result_len = 0;
! FILE * f = fopen(filename,"r");
int max_result = 0;
int c;
char buf[LONG_STRING];

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s\n",
--- 411,429 ----
{
struct terminal_map_item *result;
int result_len = 0;
! FILE * f;
int max_result = 0;
int c;
char buf[LONG_STRING];
+ int err = can_open(filename,"r");

+ if (err) {
+ DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s (can_open)\n",
+ filename,error_description(err)));


+ return NULL;
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s\n",
Index: elm2.4.ME+.109S-cvs/lib/unidata.c
*** elm2.4.ME+.109/lib/unidata.c 2003-11-15 18:19:06.000000000 +0200
--- elm2.4.ME+.109S-cvs/lib/unidata.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: unidata.c,v 1.25 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.26 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 2127,2137 ****
{


struct unidata_mapped_data * res = *ptr;
int status = 0;

! FILE *f = fopen(filename,"r");
int last_processed = -1;
int line_number = 1;
int unassigned_cell = -1;
char composition_buffer[160];

if (!f) {
int err = errno;
--- 2127,2153 ----
{


struct unidata_mapped_data * res = *ptr;
int status = 0;

! FILE *f;
int last_processed = -1;
int line_number = 1;
int unassigned_cell = -1;
char composition_buffer[160];
+
+
+ /* This should not have readed by setgid Elm ME+
+ so this test is not necessary */
+ int err = can_open(filename,"r");
+
+ if (err) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeUnidataCantOpen,
+ "Can't open UNIDATA2.TXT: %.50s: %.25s"),
+ filename,error_description(err));


+ return 0;
+ }
+
+
+

+ f = fopen(filename,"r");

if (!f) {
int err = errno;
Index: elm2.4.ME+.109S-cvs/melib/mailcap.c
*** elm2.4.ME+.109/melib/mailcap.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109S-cvs/melib/mailcap.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.10 2003/10/11 11:35:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.11 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 466,476 ****


int unsupported = 0;
media_type_t T = NULL;

enum mime_major_type T_major = MIME_TYPE_UNKNOWN;

!
zero_mailcap_entry(&Entry);
arg_zero(&keyword);
arg_zero(&string);

F = fopen(mailcaps[mailcap_idx],"r");
if (!F) {
int err = errno;
--- 466,486 ----


int unsupported = 0;
media_type_t T = NULL;

enum mime_major_type T_major = MIME_TYPE_UNKNOWN;

!
! int err;
!
zero_mailcap_entry(&Entry);
arg_zero(&keyword);
arg_zero(&string);

+ err = can_open(mailcaps[mailcap_idx],"r");
+ if (err) {
+ DPRINT(Debug,2,(&Debug,
+ "Failed to open mailcap %s: (errno=%d) %s (can_open)\n",
+ mailcaps[mailcap_idx],err,error_description(err)));
+ continue;
+ }
+
F = fopen(mailcaps[mailcap_idx],"r");
if (!F) {
int err = errno;
Index: elm2.4.ME+.109S-cvs/src/alias.c
*** elm2.4.ME+.109/src/alias.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109S-cvs/src/alias.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.25 2003/08/31 10:53:57 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.26 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 721,726 ****
--- 721,742 ----
strfcpy(fname,user_text_file,sizeof fname);

save_file_stats(fname);
+
+ err = can_open(fname, "a");
+ if (err) {
+ DPRINT(Debug,2,
+ (&Debug,
+ "Failure attempting to add alias to file %s within %s (can_open)",
+ fname, "add_to_alias_text"));
+ DPRINT(Debug,2,
+ (&Debug, "** %s **\n", error_description(err)));
+ lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenAdd,
+ "Couldn't open %s to add new alias!"),
+ fname);
+ return(1);
+ }
+
+
if ((file = fopen(fname, "a")) == NULL) {
err = errno;
DPRINT(Debug,2,
***************
*** 801,832 ****

save_file_stats(fname);

if ((file = fopen(fname, "r")) == NULL) {
! err = errno;
! DPRINT(Debug,2,
! (&Debug,
! "Failure attempting to delete alias from file %s within %s",
! fname, "delete_from_alias_text"));
! DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
! lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenDelete,
! "Couldn't open %s to delete alias!"),
! fname);
! return(1);
}

if ((tmp_file = fopen(tmpfname, "w")) == NULL) {
! err = errno;
! DPRINT(Debug,2,
! (&Debug,
! "Failure attempting to open temp file %s within %s",
! tmpfname, "delete_from_alias_text"));
! DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
! lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenTemp,
! "Couldn't open temp file %s to delete alias!"),
! tmpfname);
! return(1);
}

while (mail_gets(line_in_file, sizeof(line_in_file), file) != 0)
--- 817,883 ----

save_file_stats(fname);

+ err = can_open(fname, "r");
+ if (err) {
+ DPRINT(Debug,2,
+ (&Debug,
+ "Failure attempting to delete alias from file %s within %s (can_open)",
+ fname, "delete_from_alias_text"));
+ DPRINT(Debug,2,
+ (&Debug, "** %s **\n", error_description(err)));
+ lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenDelete,
+ "Couldn't open %s to delete alias!"),
+ fname);
+ return(1);
+
+ }
+
if ((file = fopen(fname, "r")) == NULL) {
! err = errno;
! DPRINT(Debug,2,
! (&Debug,
! "Failure attempting to delete alias from file %s within %s",
! fname, "delete_from_alias_text"));
! DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
! lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenDelete,
! "Couldn't open %s to delete alias!"),
! fname);
! return(1);
! }
!
!
! err = can_open(tmpfname, "w");
! if (err) {
! err = errno;
! DPRINT(Debug,2,
! (&Debug,
! "Failure attempting to open temp file %s within %s (can_open)",
! tmpfname, "delete_from_alias_text"));
! DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
! lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenTemp,
! "Couldn't open temp file %s to delete alias!"),
! tmpfname);
!
! fclose(file);
! return(1);
}

if ((tmp_file = fopen(tmpfname, "w")) == NULL) {
! err = errno;
! DPRINT(Debug,2,
! (&Debug,
! "Failure attempting to open temp file %s within %s",
! tmpfname, "delete_from_alias_text"));
! DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
! lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenTemp,
! "Couldn't open temp file %s to delete alias!"),
! tmpfname);
!
! fclose(file);
! return(1);
}

while (mail_gets(line_in_file, sizeof(line_in_file), file) != 0)
Index: elm2.4.ME+.109S-cvs/src/attach_menu.c
*** elm2.4.ME+.109/src/attach_menu.c 2003-11-15 18:19:06.000000000 +0200
--- elm2.4.ME+.109S-cvs/src/attach_menu.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.54 2003/11/11 16:18:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.55 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 1574,1579 ****
--- 1574,1584 ----
p,i));
if (i == 0) {

+
+ int err = can_open(user_mime_types, "r");
+ if (err)
+ continue;
+
/* First try the user's mime.types file */

fp = fopen (user_mime_types, "r");
Index: elm2.4.ME+.109S-cvs/src/editmsg.c
*** elm2.4.ME+.109/src/editmsg.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109S-cvs/src/editmsg.c 2003-11-29 11:31:22.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.35 2003/10/11 13:04:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.36.2.3 2003/11/29 09:31:22 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.2.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 588,600 ****
char linebuf[1024];

FILE *tmpfp = safeopen_rdwr(filename2);
! FILE *f= fopen(filename,"r");

if (!f || !tmpfp) {
! if (!tmpfp)
! free(tmpfp);
! if (!f)
! free(f);
return_value = 1;
goto fail;
}
--- 588,612 ----
char linebuf[1024];

FILE *tmpfp = safeopen_rdwr(filename2);
! FILE *f;
!
! int err = can_open(filename,"r");
!
! if (err) {
! if (tmpfp)
! fclose(tmpfp);
!
! return_value = 1;


! goto fail;
! }
!

! f = fopen(filename,"r");

if (!f || !tmpfp) {
! if (tmpfp)
! fclose(tmpfp);
! if (f)
! fclose(f);
return_value = 1;
goto fail;
}
***************
*** 651,663 ****


if (filename2 != filename) {
char linebuf[1024];

! FILE *tmpfp = fopen(filename,"w");
! FILE *f= fopen(filename2,"r");

if (!f || !tmpfp) {
! if (!tmpfp)
free(tmpfp);
! if (!f)
free(f);
return_value = 1;
goto fail;
--- 663,685 ----


if (filename2 != filename) {
char linebuf[1024];

! FILE *tmpfp;
! FILE *f;
! int err = can_open(filename,"w");
! int err2 = can_open(filename2,"r");
!
! if (err || err2) {
! return_value = 1;


! goto fail;
! }
!

! tmpfp = fopen(filename,"w");
! f= fopen(filename2,"r");

if (!f || !tmpfp) {
! if (tmpfp)
free(tmpfp);
! if (f)
free(f);
return_value = 1;
goto fail;
***************
*** 1207,1218 ****
--- 1229,1249 ----
{
char buffer[LONG_STRING];
int i,len;
+ int err = can_open(I->builtin->filename, "r");

+ if (err) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFile,
+ "Can't open %s!"),
+ I->builtin->filename, error_description(err));


+ return 0;
+ }
+

if (I->builtin->edit_fd) {
fclose(I->builtin->edit_fd);
I->builtin->edit_fd = NULL;
}

+
if ((I->builtin->edit_fd = fopen(I->builtin->filename,
"r")) == NULL) {
int err = errno;
Index: elm2.4.ME+.109S-cvs/src/elm.c
*** elm2.4.ME+.109/src/elm.c 2003-11-15 18:19:06.000000000 +0200
--- elm2.4.ME+.109S-cvs/src/elm.c 2003-11-23 20:12:43.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elm.c,v 1.59 2003/11/10 20:37:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.59 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.60 2003/11/23 18:12:43 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.60 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
***************
*** 993,998 ****
--- 993,999 ----
}
send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
(batch_only ? NO : allow_forms), current_mailbox);
+
leave(0, &current_mailbox);
} else if (check_only) {
do_check_only(to_whom);
Index: elm2.4.ME+.109S-cvs/src/file_util.c
*** elm2.4.ME+.109/src/file_util.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109S-cvs/src/file_util.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.19 2003/07/29 18:46:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.20 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 65,70 ****
--- 65,80 ----
char buffer[VERY_LONG_STRING];
int len;

+ int err = can_open(filename, "r");
+

+ if (err) {
+ DPRINT(Debug,1,(&Debug,

+ "Error: could not open %s for reading (append) -- can_open\n",
+ filename));
+ return(1);
+
+ }
+
if ((my_fd = fopen(filename, "r")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Error: could not open %s for reading (append)\n", filename));
Index: elm2.4.ME+.109S-cvs/src/forms.c
*** elm2.4.ME+.109/src/forms.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109S-cvs/src/forms.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forms.c,v 1.17 2003/07/29 18:46:19 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forms.c,v 1.18 2003/11/26 17:16:55 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 63,74 ****

FILE *form;
char buffer[SLEN];
! register int field_count = 0;

if ((form = fopen(filename, "r")) == NULL) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! error_description(errno), filename);
return -1;
}

--- 63,84 ----

FILE *form;
char buffer[SLEN];
! int field_count = 0;
!
! int err = can_open(filename, "r");
! if (err) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
! "Error %s trying to open %s to check fields!"),
! error_description(err), filename);
! return -1;
! }
!

if ((form = fopen(filename, "r")) == NULL) {


+ int err = errno;

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! error_description(err), filename);
return -1;
}

***************
*** 99,104 ****
--- 109,122 ----

/** first off, let's open the files... **/



+ err = can_open(filename, "r");
+ if (err) {

+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmCantReadMessageToValidate,
+ "Can't read the message to validate the form!"));
+ return -1;
+ }
+
if ((form = fopen(filename, "r")) == NULL) {
err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantReadMessageToValidate,
Index: elm2.4.ME+.109S-cvs/src/hdrconfg.c
*** elm2.4.ME+.109/src/hdrconfg.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109S-cvs/src/hdrconfg.c 2003-11-26 19:16:56.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.33 2003/10/11 13:25:27 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.34 2003/11/26 17:16:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 554,559 ****
--- 554,560 ----
char buffer1[32*1024];
int stat;
int c;
+ int err;

if (in_string(editor, "%s"))
buffer = elm_message(FRM(editor),
***************
*** 576,582 ****
not with edit_charset (system_charset)
*/

-
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditComment,


"# Headers are automatically converted from %s charset and not need encoded\n"),

--- 577,582 ----
***************
*** 594,600 ****

}

-
add_addr_header(F,edit_charset,encoding_supported,


"From", & headers->from);

add_addr_header(F,edit_charset,encoding_supported,
--- 594,599 ----
***************
*** 634,639 ****
--- 633,645 ----
}
Raw(ON);



+ err = can_open(filename,"r");
+ if (err) {

+ lib_error(FRM("%s: %s"),filename,err);
+

+ goto fail1;
+ }
+

F = fopen(filename,"r");

if (!F) {


/* In than point opening should have succeed */

Index: elm2.4.ME+.109S-cvs/src/help.c
*** elm2.4.ME+.109/src/help.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109S-cvs/src/help.c 2003-11-26 19:16:56.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.13 2003/07/29 18:46:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.14 2003/11/26 17:16:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 381,391 ****
static int display_file(file)
char *file;
{
! /*** Display file to screen ***/
!
! FILE *fileptr;
! int lines=0;
! char buffer[SLEN];

if ((fileptr = fopen(file,"r")) == NULL) {
DPRINT(Debug,1,
--- 381,403 ----
static int display_file(file)
char *file;
{
! /*** Display file to screen ***/
!
! FILE *fileptr;
! int lines=0;
! char buffer[SLEN];
!
! /* This routine is used to print helpfiles, which
! are not user writable directory, sho that is not actually
! problem */
! int err = can_open(file,"r");
!
! if (err) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmHelpCouldntOpenFile,
! "Couldn't open file %s."),
! file);
! return(FALSE);
! }

if ((fileptr = fopen(file,"r")) == NULL) {
DPRINT(Debug,1,
Index: elm2.4.ME+.109S-cvs/src/mailmsg2.c
*** elm2.4.ME+.109/src/mailmsg2.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109S-cvs/src/mailmsg2.c 2003-11-26 19:16:56.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.70 2003/10/05 16:07:28 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.70 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.71 2003/11/26 17:16:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 248,253 ****
--- 248,266 ----
/** if there is an included file, copy it into the temp file **/
if (*included_file) {
FILE *input;
+
+ int err = can_open(included_file,"r");
+ if (err) {
+ DPRINT(Debug,1,(&Debug,
+ "Can't open included file %s (cam_open). Failed with error %s (mail)\n",
+ included_file, error_description(errno)));
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenFile,
+ "Could not open file %s."),
+ included_file);
+
+ return(need_redraw);
+ }
+
if ((input = fopen(included_file,"r")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Can't open included file %s. Failed with error %s (mail)\n",
***************
*** 483,488 ****
--- 496,502 ----

do { /* So we can return here if check_for_multipart() fails
* - K E H <hurtt...@ozone.FMI.FI> */
+
code = 0;
reask_verify = 0;

***************
*** 513,518 ****
--- 527,544 ----
me_retcode = 1;
}

+ err = can_open(cur_editfile,"r+");


+ if (err) {
+ DPRINT(Debug,1,(&Debug,

+ "Attempt to open file %s for reading failed with error %s (mail) -- can_open\n",
+ cur_editfile, error_description(err)));
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenReply,
+ "Could not open reply file (%s)."),
+ error_description(err));
+
+ return need_redraw;
+ }
+
if ((reply = fopen(cur_editfile,"r+")) == NULL) {
err = errno;
DPRINT(Debug,1,(&Debug,
Index: elm2.4.ME+.109S-cvs/src/save_opts.c
*** elm2.4.ME+.109/src/save_opts.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109S-cvs/src/save_opts.c 2003-11-26 19:16:56.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.23 2003/07/29 18:46:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.24 2003/11/26 17:16:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 65,71 ****

FILE *newelmrc;
char oldfname[SLEN], newfname[SLEN];
!
strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
FRM("%s/%s"),
--- 65,72 ----

FILE *newelmrc;
char oldfname[SLEN], newfname[SLEN];
! int err;
!
strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
FRM("%s/%s"),
***************
*** 92,97 ****
--- 93,106 ----

/** next, open the new .elm/elmrc file... **/

+ err = can_open(newfname, "w");
+ if (err) {
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
+ "Can't save configuration! Can't write to %s [%s]."),
+ newfname, error_description(errno));
+ return;
+ }
+
if ((newelmrc = fopen(newfname, "w")) == NULL) {
lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
"Can't save configuration! Can't write to %s [%s]."),

Kari E. Hurtta

unread,
Nov 30, 2003, 4:50:18 AM11/30/03
to
Archive-name: elm2.4ME+/PL109a

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

file elm-2.4ME+PL109a.patch.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL109a.patch.gz >
via WWW.

Page <URL: http://personal.inet.fi/atk/elmme/ > is not up of date.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL109a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

SUMMARY: This patch address panic when imap server disconnects
during password prompt, fixes initialization of
internal-mailcaps and mailcaps elmrc options and
fixes some cases where error message was not visible
because of exiting of Elm ME+. Also security fixes of
Elm2.4ME+ PL109S (25) are included to this patch.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL109 (25) --------------------------------
Index: elm2.4.ME+.109a-cvs/hdrs/patchlevel.h


Prereq: 1099000000
*** elm2.4.ME+.109/hdrs/patchlevel.h 2003-11-15 18:19:06.000000000 +0200

--- elm2.4.ME+.109a-cvs/hdrs/patchlevel.h 2003-11-29 20:54:15.000000000 +0200
***************
*** 1,8 ****


! #define PATCHLEVEL "109 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.109
*/
! #define LAST_REPORT_TIME 1099000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

#define VERS_DATE "Nov, 2003" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "109a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.109
*/
! #define LAST_REPORT_TIME 1100000200


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

#define VERS_DATE "Nov, 2003" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.109a-cvs/README.ME+


*** elm2.4.ME+.109/README.ME+ 2003-11-15 18:19:06.000000000 +0200

--- elm2.4.ME+.109a-cvs/README.ME+ 2003-11-30 10:08:18.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.670 2003/11/15 15:25:17 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.670.6.4 2003/11/30 08:08:18 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,139 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+

+ Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)
+ -------------------------------------------------------------------


+
+ [ This is out of branch patch. ]
+

+ Undo Elm2.4ME+ PL109S (25) patch before applying this patch.
+
+ SUMMARY: This patch address panic when imap server disconnects
+ during password prompt, fixes initialization of
+ internal-mailcaps and mailcaps elmrc options and
+ fixes some cases where error message was not visible
+ because of exiting of Elm ME+. Also security fixes of
+ Elm2.4ME+ PL109S (25) are included to this patch (it
+ is agaist Elm2.4ME+ PL109 (25))
+
+
+ - Changed some Raw(OFF) to Raw_OFF() on leaving routines
+ of src/utils.c
+
+ - Try fix
+ MBX PANIC in imap.c:2578:end_imap_command


+ when IMAP / TLS connection is closed by server.
+

+ - Initialization of internal-mailcaps and
+ metamail-mailcaps did not worked correctly.
+ Moved initialization before reading of global
+ elm.rc.
+ Problem noted by: Xavi Serrano <xser...@ac.upc.es>
+
+ - On def_prompt_handler() final newline should be
+ printed to terminal as prompt is printed (instead
+ of stderr.)
+
+ Fix potential security problems on systems where Elm ME+

+
+ Changes of Elm2.4ME+ PL109S (25) compared with Elm2.4ME+ PL109 (25)
+ ------------------------------------------------------------------
+

+
Changes of Elm2.4ME+ PL109 (25) compared with Elm2.4ME+ PL108 (25)

------------------------------------------------------------------

Index: elm2.4.ME+.109a-cvs/lib/charset.c


*** elm2.4.ME+.109/lib/charset.c 2003-11-15 18:19:06.000000000 +0200

--- elm2.4.ME+.109a-cvs/lib/charset.c 2003-11-26 19:16:54.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: charset.c,v 1.72 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.72 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: charset.c,v 1.73 2003/11/26 17:16:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.73 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 1388,1398 ****
{
struct locale_map_item *result;
int result_len = 0;
! FILE * f = fopen(filename,"r");
int max_result = 0;
int c,l1;
char buf[LONG_STRING];

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
--- 1388,1407 ----
{
struct locale_map_item *result;
int result_len = 0;
! FILE * f;
int max_result = 0;
int c,l1;
char buf[LONG_STRING];
+ int err = can_open(filename,"r");

+ if(err) {
+ DPRINT(Debug,2,(&Debug,
+ "load_locale_map: %s: %s (can_open)\n",
+ filename,error_description(err)));

+ return NULL;
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,

Index: elm2.4.ME+.109a-cvs/lib/file_util.c
*** elm2.4.ME+.109/lib/file_util.c 2002-01-26 13:14:46.000000000 +0200
--- elm2.4.ME+.109a-cvs/lib/file_util.c 2003-11-26 19:16:54.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.6 2001/06/06 18:08:58 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.7 2003/11/26 17:16:54 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 274,279 ****
--- 274,294 ----
DPRINT(Debug,1,(&Debug,
"Copy: to='%s'\n", to));

+ if (!isspool) {
+ int err = can_open(to, "w");

+
+ if (err) {


+ DPRINT(Debug,1,(&Debug,
+ "Error: could not open %s for writing (copy -- can_open)\n",
+ to));
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenFile,
+ "Could not open file %s."),
+ to);
+ return(1);
+ }
+ }
+
if ((to_file = fopen(to, "w")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Error: could not open %s for writing (copy)\n",

Index: elm2.4.ME+.109a-cvs/lib/imap.c
*** elm2.4.ME+.109/lib/imap.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109a-cvs/lib/imap.c 2003-11-29 17:55:38.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: imap.c,v 1.100 2003/07/24 16:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.100 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: imap.c,v 1.101 2003/11/29 15:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.101 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 2273,2282 ****
--- 2273,2284 ----
"No imap connection",0);

if (Ma->current_NOOP_tag &&
+ Ma->imap_state != IMAP_closing &&
Ma->imap_state != IMAP_error) {
DPRINT(Debug,3,(&Debug,
"imap_idle_wait_1: Waiting for idle NOOP complete...\n"));
while(Ma->current_NOOP_tag &&
+ Ma->imap_state != IMAP_closing &&
Ma->imap_state != IMAP_error &&
con->C.stream) {
WaitStreamFor(con->C.stream,SS_read_act);
***************
*** 2574,2579 ****
--- 2576,2593 ----
con->C.username ? con->C.username : "<NULL>",
con->C.host ? con->C.host : "<NULL>"));

+ if (IMAP_error == con->a.imap_con->imap_state) {
+ DPRINT(Debug,12,(&Debug,
+ "end_imap_command: On error state\n"));
+ return;
+ }
+
+ if (IMAP_closing == con->a.imap_con->imap_state) {
+ DPRINT(Debug,12,(&Debug,
+ "end_imap_command: Is closing\n"));
+ return;
+ }
+
if (con->a.imap_con->imap_state != IMAP_command)
panic("MBX PANIC",__FILE__,__LINE__,
"end_imap_command","wrong state",0);
Index: elm2.4.ME+.109a-cvs/lib/iso2022.c
*** elm2.4.ME+.109/lib/iso2022.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109a-cvs/lib/iso2022.c 2003-11-26 19:16:54.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.26 2003/08/24 17:04:22 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.27 2003/11/26 17:16:54 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 482,491 ****
int max_count = 0;
int new_max;
int count = 0;
! FILE * f = fopen(filename,"r");
char buf[LONG_STRING];
int c, l1;

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
--- 482,500 ----
int max_count = 0;
int new_max;
int count = 0;
! FILE * f;
char buf[LONG_STRING];
int c, l1;

+ int err = can_open(filename,"r");

+ if (err) {


+ DPRINT(Debug,2,(&Debug,
+ "parse_iso2022_map=0: %s: %s (can_open)\n",
+ filename,error_description(err)));

+ return 0;
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,

Index: elm2.4.ME+.109a-cvs/lib/ldstate.c
*** elm2.4.ME+.109/lib/ldstate.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109a-cvs/lib/ldstate.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.7 2003/07/24 16:29:52 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.8 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 114,119 ****
--- 114,120 ----
char buf[SLEN], *state_fname;
int status, i, Len,j;
FILE *fp;
+ int err;

/* clear out the folder status record */
clear_ldstate(fst);
***************
*** 121,126 ****
--- 122,135 ----
/* see if we can find a state file */
if ((state_fname = getenv(FOLDER_STATE_ENV)) == NULL)

return 0;
+

+ /* This test should not needed,
+ setgid Elm ME+ do not call this function
+ */

+ err = can_open(state_fname, "r");
+ if (err)


+ return 0;
+
if ((fp = fopen(state_fname, "r")) == NULL)
return 0;

Index: elm2.4.ME+.109a-cvs/lib/localmbx.c
*** elm2.4.ME+.109/lib/localmbx.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109a-cvs/lib/localmbx.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.60 2003/07/24 16:29:52 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.60 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.61 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************

*** 4242,4247 ****
--- 4242,4248 ----
KEEP_STATE keep_state_ptr;
{
int status = 0,err;
+
keep_state_ptr -> a.file.temp_keep_file =
elm_message(FRM("%s%s%d"),temp_dir, temp_file, getpid());

Index: elm2.4.ME+.109a-cvs/lib/mk_aliases.c
*** elm2.4.ME+.109/lib/mk_aliases.c 2002-01-26 13:14:46.000000000 +0200
--- elm2.4.ME+.109a-cvs/lib/mk_aliases.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 1.8 2001/03/13 19:46:12 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 1.9 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

+ err = can_open(inputname,"r");
+ if (err) {


+ if ( textwarn ) {
+ lib_error(CATGETS(elm_msg_cat,
+ NewaliasSet, NewaliasNoOpenIn,
+ "Couldn't open %s for input!"),
+ inputname);
+ }
+
+ free(buffer);

+ return(-1);
+ }
+

if ((in = fopen(inputname,"r")) == NULL) {
! if ( textwarn ) {
! lib_error(CATGETS(elm_msg_cat,
! NewaliasSet, NewaliasNoOpenIn,
! "Couldn't open %s for input!"),
! inputname);
! }
!
free(buffer);
return(-1);
}
***************
*** 611,616 ****
--- 622,636 ----
return(-1);
}

+ err = can_open(dataname, "w");
+ if (err) {


+ lib_error(CATGETS(elm_msg_cat,
+ NewaliasSet, NewaliasNoOpenOut,
+ "Couldn't open %s for output!"), dataname);
+ free(buffer);

+ return(-1);
+ }
+

if ((data = fopen(dataname, "w")) == NULL) {
lib_error(CATGETS(elm_msg_cat,
NewaliasSet, NewaliasNoOpenOut,
***************
*** 700,702 ****
--- 720,729 ----



+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

+
Index: elm2.4.ME+.109a-cvs/lib/ndbz.c
*** elm2.4.ME+.109/lib/ndbz.c 2002-01-26 13:14:45.000000000 +0200
--- elm2.4.ME+.109a-cvs/lib/ndbz.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.4 2001/06/06 18:09:01 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.5 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

+ err = can_open(fn, "w");
+ if (err) {


+ free((malloc_t)fn);
+
+ DPRINT(Debug,5,(&Debug,
+ "dbz_fresh: unable to write config (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "w");
free((malloc_t)fn);
if (f == NULL) {
***************
*** 310,315 ****
--- 321,335 ----
fn = enstring(name, pag);
if (fn == NULL)
return (DBZ *)NULL;
+

+ err = can_open(fn, "w");
+ if (err) {

+ err = can_open(fn, "r");
+ if (err) {


+ free((malloc_t)fn);
+
+ DPRINT(Debug,5,(&Debug,
+ "dbz_again: cannot open old .dir file (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "r");
free((malloc_t)fn);
if (f == NULL) {
***************
*** 446,451 ****
--- 477,491 ----
fn = enstring(name, dir);
if (fn == NULL)
return (DBZ *)NULL;
+

+ err = can_open(fn, "w");
+ if (err) {


+ free((malloc_t)fn);
+ DPRINT(Debug,5,(&Debug,
+ "dbz_again: unable to write new .dir (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "w");
free((malloc_t)fn);
if (f == NULL) {

***************
*** 465,470 ****


--- 505,519 ----
fn = enstring(name, pag);
if (fn == NULL)
return (DBZ *)NULL;
+

+ err = can_open(fn, "w");
+ if (err) {

+ err = can_open(dirfname, "r+");
+ if (err) {


+ free((malloc_t)dirfname);
+
+ DPRINT(Debug,5,(&Debug,
+ "dbz_open: can't open .dir file (can_open)\n"));
+ free((malloc_t)db);
+
+ errno = err;
+ return (DBZ *)NULL;
+ }
+
if (mode == O_RDONLY) {
db->dbz_dirf = fopen(dirfname, "r");
db->dbz_dirronly = 1;
***************
*** 528,533 ****
--- 593,614 ----
free((malloc_t)db);
return (DBZ *)NULL;
}
+
+ if (mode == O_RDONLY)
+ err = can_open(pagfname, "rb");
+ else

+ err = can_open(pagfname, "r+b");
+ if (err) {


+ DPRINT(Debug,5,(&Debug,
+ "dbz_open: .pag open failed (can_open)\n"));
+ (void) fclose(db->dbz_dirf);
+ free((malloc_t)pagfname);
+ free((malloc_t)db);
+
+ errno = err;
+ return (DBZ *)NULL;
+ }
+
if (mode == O_RDONLY) {
db->dbz_pagf = fopen(pagfname, "rb");
db->dbz_pagronly = 1;
***************
*** 558,568 ****
--- 639,659 ----
db->dbz_pagpos = -1;
/* don't free pagfname, need it below */

+ err = can_open(name, "r");
+ if (err) {


+ DPRINT(Debug,5,(&Debug,
+ "dbz_open: basefile open failed (can_open)\n"));
+

+ goto fail1;
+ }
+

/* open the base file */
db->dbz_basef = fopen(name, "r");
if (db->dbz_basef == NULL) {
DPRINT(Debug,5,(&Debug,

"dbz_open: basefile open failed\n"));
+

+ err = can_open(db->dbz_basefname, "r");
+ if (err) {


+ DPRINT(Debug,5,(&Debug,
+ "latebase: still can't open base (can_open)\n"));
+ return (FILE *)NULL;
+ }
+
it = fopen(db->dbz_basefname, "r");
if (it == NULL) {
DPRINT(Debug,5,(&Debug,

Index: elm2.4.ME+.109a-cvs/lib/output.c
*** elm2.4.ME+.109/lib/output.c 2002-06-06 18:55:57.000000000 +0300
--- elm2.4.ME+.109a-cvs/lib/output.c 2003-11-23 19:10:30.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: output.c,v 1.29 2002/06/01 12:58:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: output.c,v 1.30 2003/11/23 17:10:30 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 70,76 ****
if (x && (y = strchr(x,'\n')))
*y = '\0';
if (ret > 0 && l && str[l-1] != '\n')
! ret += fprintf(stderr,"\n");
}
fclose(f);
if (!x)
--- 70,76 ----
if (x && (y = strchr(x,'\n')))
*y = '\0';
if (ret > 0 && l && str[l-1] != '\n')
! ret += fprintf(f,"\n");
}
fclose(f);
if (!x)
Index: elm2.4.ME+.109a-cvs/lib/read_rc.c


*** elm2.4.ME+.109/lib/read_rc.c 2003-11-15 18:19:06.000000000 +0200

--- elm2.4.ME+.109a-cvs/lib/read_rc.c 2003-11-29 20:43:15.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.121 2003/11/10 15:15:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.121 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.123 2003/11/29 18:43:15 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.123 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************

*** 1101,1106 ****
--- 1101,1167 ----
do_expand_env("editor", editor, raw_editor, sizeof(editor));
}

+
+ if ((cp = getenv("MAILCAPS")) == NULL) {
+ /* RFC 1524:
+
+ For UNIX, a path search of mailcap files is specified. The default
+ path search is specified as including at least the following:
+
+ $HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
+
+ */
+ char *X[] = { "/etc/mailcap", "/usr/etc/mailcap",
+ "/usr/local/etc/mailcap", NULL };
+ char *G = elm_message(FRM("%s/.mailcap"),home);
+ char **X1;
+
+ /* Fake recursive call -- expand_dt_path ignores non-existiant
+ entries.
+ */
+ DPRINT(Debug,9,(&Debug,
+ "Adding default entry to metamail-mailcaps: %s\n",
+ G));
+ expand_dt_path(&metamail_mailcaps,"metamail-mailcaps",
+ G,2);
+ for (X1 = X; *X1; X1++) {
+ DPRINT(Debug,9,(&Debug,
+ "Adding default entry to metamail-mailcap: %s\n",
+ *X1));
+ expand_dt_path(&metamail_mailcaps,"metamail-mailcaps",
+ *X1,2);
+ }
+
+
+ DPRINT(Debug,9,(&Debug,
+ "Adding default entry to internal-mailcaps: %s\n",
+ G));
+ expand_dt_path(&internal_mailcaps,"internal-mailcaps",
+ G,2);
+ for (X1 = X; *X1; X1++) {
+ DPRINT(Debug,9,(&Debug,
+ "Adding default entry to internal-mailcap: %s\n",
+ *X1));
+ expand_dt_path(&internal_mailcaps,"internal-mailcaps",
+ *X1,2);
+ }
+
+ free(G);
+ } else {
+ DPRINT(Debug,9,(&Debug,
+ "Adding unexpanded entry to metamail-mailcaps: $MAILCAPS\n"
+ ));
+
+ metamail_mailcaps.unexpanded = safe_strdup("$MAILCAPS");
+
+
+ DPRINT(Debug,9,(&Debug,
+ "Adding unexpanded entry to internal-mailcaps: $MAILCAPS\n"
+ ));
+
+ internal_mailcaps.unexpanded = safe_strdup("$MAILCAPS");
+ }
+
elm_sfprintf(raw_folders, sizeof raw_folders, FRM("~/%s"),
default_folders);
do_expand_env("folders", folders, raw_folders, sizeof(folders));
***************
*** 1189,1255 ****


expand_map_bin("bindata", bindata_path_global, raw_bindata_path,

sizeof(bindata_path));

-
- if ((cp = getenv("MAILCAPS")) == NULL) {
- /* RFC 1524:
-
- For UNIX, a path search of mailcap files is specified. The default
- path search is specified as including at least the following:
-
- $HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
-
- */
- char *X[] = { "/etc/mailcap", "/usr/etc/mailcap",
- "/usr/local/etc/mailcap", NULL };
- char *G = elm_message(FRM("%s/.mailcap"),home);
- char **X1;
-
- /* Fake recursive call -- expand_dt_path ignores non-existiant
- entries.
- */
- DPRINT(Debug,9,(&Debug,
- "Adding default entry to metamail-mailcaps: %s\n",
- G));
- expand_dt_path(&metamail_mailcaps,"metamail-mailcaps",
- G,2);
- for (X1 = X; *X1; X1++) {
- DPRINT(Debug,9,(&Debug,
- "Adding default entry to metamail-mailcap: %s\n",
- *X1));
- expand_dt_path(&metamail_mailcaps,"metamail-mailcaps",
- *X1,2);
- }
-
-
- DPRINT(Debug,9,(&Debug,
- "Adding default entry to internal-mailcaps: %s\n",
- G));
- expand_dt_path(&internal_mailcaps,"internal-mailcaps",
- G,2);
- for (X1 = X; *X1; X1++) {
- DPRINT(Debug,9,(&Debug,
- "Adding default entry to internal-mailcap: %s\n",
- *X1));
- expand_dt_path(&internal_mailcaps,"internal-mailcaps",
- *X1,2);
- }
-
- free(G);
- } else {
- DPRINT(Debug,9,(&Debug,
- "Adding unexpanded entry to metamail-mailcaps: $MAILCAPS\n"
- ));
-
- metamail_mailcaps.unexpanded = safe_strdup("$MAILCAPS");
-
-
- DPRINT(Debug,9,(&Debug,
- "Adding unexpanded entry to internal-mailcaps: $MAILCAPS\n"
- ));
-
- internal_mailcaps.unexpanded = safe_strdup("$MAILCAPS");
- }
-
parse_iso2022_map(system_iso2022_sets,&errors,ml_system);
system_locale_map = load_locale_map(system_mime_charsets,&errors);
system_terminal_map = load_terminal_map(system_terminal_info,&errors);
--- 1250,1255 ----


***************
*** 1355,1377 ****
/** this routine does all the actual work of reading in the
.rc file... **/

! FILE *file;
!
errors = 0;

/* Look for the elmrc file */
! if ((file = fopen(user_rc_file, "r")) == NULL) {
DPRINT(Debug,2,(&Debug,
! "Warning:User has no \"%s\" file\n\n",
user_rc_file));
! }

! if (file != NULL) {
! do_rc(file, LOCAL_RC, ELMRCFILE);
! fclose(file);
}

-

/* load_locale_map may refer to map-text-dir ... */

do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
sizeof(map_txtdir));

--- 1355,1388 ----
/** this routine does all the actual work of reading in the
.rc file... **/

! int err;
!
errors = 0;

+
/* Look for the elmrc file */
! err = can_open(user_rc_file, "r");
! if (err) {
DPRINT(Debug,2,(&Debug,
! "Warning:User has no \"%s\" file (can_open)\n\n",
user_rc_file));
!
! } else {
! FILE *file = NULL;

! if ((file = fopen(user_rc_file, "r")) == NULL) {
! DPRINT(Debug,2,(&Debug,
! "Warning:Open \"%s\" failed\n\n",
! user_rc_file));

!
! }
!

! if (file != NULL) {
! do_rc(file, LOCAL_RC, ELMRCFILE);
! fclose(file);
! }
}

/* load_locale_map may refer to map-text-dir ... */

do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
sizeof(map_txtdir));

Index: elm2.4.ME+.109a-cvs/lib/service_list.c
*** elm2.4.ME+.109/lib/service_list.c 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.109a-cvs/lib/service_list.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.23 2003/05/17 16:13:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: service_list.c,v 1.24 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 928,937 ****
/* hostname service options */

int max_count = 0;
int count = 0;


! FILE * f = fopen(filename,"r");
char buf[LONG_STRING];
int c, l1;

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
--- 928,949 ----
/* hostname service options */

int max_count = 0;
int count = 0;


! FILE * f;
char buf[LONG_STRING];
int c, l1;

+ if (!system) {

+ int err = can_open(filename,"r");
+

+ if (err) {
+ DPRINT(Debug,2,(&Debug,
+ "parse_service_entries=0: %s: %s (can_open)\n",
+ filename,error_description(err)));

+ return 0;
+ }
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,

Index: elm2.4.ME+.109a-cvs/lib/terminal.c
*** elm2.4.ME+.109/lib/terminal.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109a-cvs/lib/terminal.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.37 2003/08/19 14:34:12 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.38 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 411,421 ****
{
struct terminal_map_item *result;
int result_len = 0;
! FILE * f = fopen(filename,"r");
int max_result = 0;
int c;
char buf[LONG_STRING];

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s\n",
--- 411,429 ----
{
struct terminal_map_item *result;
int result_len = 0;
! FILE * f;
int max_result = 0;
int c;
char buf[LONG_STRING];

+ int err = can_open(filename,"r");

+ if (err) {


+ DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s (can_open)\n",
+ filename,error_description(err)));

+ return NULL;
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s\n",

Index: elm2.4.ME+.109a-cvs/lib/unidata.c


*** elm2.4.ME+.109/lib/unidata.c 2003-11-15 18:19:06.000000000 +0200

--- elm2.4.ME+.109a-cvs/lib/unidata.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: unidata.c,v 1.25 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.26 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 2127,2137 ****
{


struct unidata_mapped_data * res = *ptr;
int status = 0;

! FILE *f = fopen(filename,"r");
int last_processed = -1;


int line_number = 1;
int unassigned_cell = -1;
char composition_buffer[160];

if (!f) {
int err = errno;
--- 2127,2153 ----
{

struct unidata_mapped_data * res = *ptr;
int status = 0;

! FILE *f;
int last_processed = -1;
int line_number = 1;
int unassigned_cell = -1;
char composition_buffer[160];

+
+

+ /* This should not have readed by setgid Elm ME+
+ so this test is not necessary */

+ int err = can_open(filename,"r");
+
+ if (err) {


+ lib_error(CATGETS(elm_msg_cat, MeSet, MeUnidataCantOpen,
+ "Can't open UNIDATA2.TXT: %.50s: %.25s"),
+ filename,error_description(err));

+ return 0;
+ }
+
+
+

+ f = fopen(filename,"r");

if (!f) {
int err = errno;

Index: elm2.4.ME+.109a-cvs/melib/mailcap.c
*** elm2.4.ME+.109/melib/mailcap.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109a-cvs/melib/mailcap.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.10 2003/10/11 11:35:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.11 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 466,476 ****


int unsupported = 0;
media_type_t T = NULL;

enum mime_major_type T_major = MIME_TYPE_UNKNOWN;

!
zero_mailcap_entry(&Entry);
arg_zero(&keyword);
arg_zero(&string);

F = fopen(mailcaps[mailcap_idx],"r");
if (!F) {
int err = errno;
--- 466,486 ----

int unsupported = 0;
media_type_t T = NULL;

enum mime_major_type T_major = MIME_TYPE_UNKNOWN;

!
! int err;
!
zero_mailcap_entry(&Entry);
arg_zero(&keyword);
arg_zero(&string);

+ err = can_open(mailcaps[mailcap_idx],"r");
+ if (err) {


+ DPRINT(Debug,2,(&Debug,
+ "Failed to open mailcap %s: (errno=%d) %s (can_open)\n",
+ mailcaps[mailcap_idx],err,error_description(err)));
+ continue;
+ }
+
F = fopen(mailcaps[mailcap_idx],"r");
if (!F) {
int err = errno;

Index: elm2.4.ME+.109a-cvs/src/alias.c
*** elm2.4.ME+.109/src/alias.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109a-cvs/src/alias.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.25 2003/08/31 10:53:57 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.26 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 721,726 ****
--- 721,742 ----
strfcpy(fname,user_text_file,sizeof fname);

save_file_stats(fname);
+

+ err = can_open(fname, "a");
+ if (err) {

+ err = can_open(fname, "r");
+ if (err) {

Index: elm2.4.ME+.109a-cvs/src/attach_menu.c


*** elm2.4.ME+.109/src/attach_menu.c 2003-11-15 18:19:06.000000000 +0200

--- elm2.4.ME+.109a-cvs/src/attach_menu.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.54 2003/11/11 16:18:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.55 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 1574,1579 ****
--- 1574,1584 ----
p,i));
if (i == 0) {

+
+ int err = can_open(user_mime_types, "r");
+ if (err)


+ continue;
+
/* First try the user's mime.types file */

fp = fopen (user_mime_types, "r");

Index: elm2.4.ME+.109a-cvs/src/editmsg.c
*** elm2.4.ME+.109/src/editmsg.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109a-cvs/src/editmsg.c 2003-11-29 14:51:36.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.35 2003/10/11 13:04:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.37 2003/11/29 12:51:36 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 588,600 ****
char linebuf[1024];

FILE *tmpfp = safeopen_rdwr(filename2);
! FILE *f= fopen(filename,"r");

if (!f || !tmpfp) {
! if (!tmpfp)
! free(tmpfp);
! if (!f)
! free(f);
return_value = 1;
goto fail;
}
--- 588,612 ----
char linebuf[1024];

FILE *tmpfp = safeopen_rdwr(filename2);
! FILE *f;
!

! int err = can_open(filename,"r");
!
! if (err) {


! if (tmpfp)
! fclose(tmpfp);
!

! return_value = 1;


! goto fail;
! }
!

! f = fopen(filename,"r");

if (!f || !tmpfp) {
! if (tmpfp)
! fclose(tmpfp);
! if (f)
! fclose(f);
return_value = 1;
goto fail;
}
***************
*** 651,663 ****

if (filename2 != filename) {
char linebuf[1024];

! FILE *tmpfp = fopen(filename,"w");
! FILE *f= fopen(filename2,"r");

if (!f || !tmpfp) {
! if (!tmpfp)
free(tmpfp);
! if (!f)
free(f);
return_value = 1;
goto fail;
--- 663,685 ----

if (filename2 != filename) {
char linebuf[1024];

! FILE *tmpfp;
! FILE *f;
! int err = can_open(filename,"w");

! int err2 = can_open(filename2,"r");
!
! if (err || err2) {
! return_value = 1;


! goto fail;
! }
!

! tmpfp = fopen(filename,"w");
! f= fopen(filename2,"r");

if (!f || !tmpfp) {
! if (tmpfp)
free(tmpfp);
! if (f)
free(f);
return_value = 1;
goto fail;
***************
*** 1207,1218 ****
--- 1229,1249 ----
{
char buffer[LONG_STRING];
int i,len;

+ int err = can_open(I->builtin->filename, "r");

+ if (err) {


+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFile,
+ "Can't open %s!"),

+ I->builtin->filename, error_description(err));


+ return 0;
+ }
+

if (I->builtin->edit_fd) {
fclose(I->builtin->edit_fd);
I->builtin->edit_fd = NULL;
}

+
if ((I->builtin->edit_fd = fopen(I->builtin->filename,
"r")) == NULL) {
int err = errno;

Index: elm2.4.ME+.109a-cvs/src/elm.c


*** elm2.4.ME+.109/src/elm.c 2003-11-15 18:19:06.000000000 +0200

--- elm2.4.ME+.109a-cvs/src/elm.c 2003-11-23 20:12:43.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elm.c,v 1.59 2003/11/10 20:37:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.59 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.60 2003/11/23 18:12:43 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.60 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
***************
*** 993,998 ****
--- 993,999 ----
}
send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
(batch_only ? NO : allow_forms), current_mailbox);
+
leave(0, &current_mailbox);
} else if (check_only) {
do_check_only(to_whom);

Index: elm2.4.ME+.109a-cvs/src/file_util.c
*** elm2.4.ME+.109/src/file_util.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109a-cvs/src/file_util.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.19 2003/07/29 18:46:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.20 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 65,70 ****
--- 65,80 ----
char buffer[VERY_LONG_STRING];
int len;

+ int err = can_open(filename, "r");
+

+ if (err) {
+ DPRINT(Debug,1,(&Debug,

+ "Error: could not open %s for reading (append) -- can_open\n",
+ filename));


+ return(1);
+
+ }
+
if ((my_fd = fopen(filename, "r")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Error: could not open %s for reading (append)\n", filename));

Index: elm2.4.ME+.109a-cvs/src/forms.c
*** elm2.4.ME+.109/src/forms.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109a-cvs/src/forms.c 2003-11-26 19:16:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forms.c,v 1.17 2003/07/29 18:46:19 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forms.c,v 1.18 2003/11/26 17:16:55 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 63,74 ****

FILE *form;
char buffer[SLEN];
! register int field_count = 0;

if ((form = fopen(filename, "r")) == NULL) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! error_description(errno), filename);
return -1;
}

--- 63,84 ----

FILE *form;
char buffer[SLEN];

! int field_count = 0;
!
! int err = can_open(filename, "r");
! if (err) {


! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
! "Error %s trying to open %s to check fields!"),
! error_description(err), filename);
! return -1;
! }
!

if ((form = fopen(filename, "r")) == NULL) {

+ int err = errno;

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! error_description(err), filename);
return -1;
}

***************
*** 99,104 ****
--- 109,122 ----

/** first off, let's open the files... **/

+ err = can_open(filename, "r");
+ if (err) {

+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmCantReadMessageToValidate,
+ "Can't read the message to validate the form!"));
+ return -1;
+ }
+
if ((form = fopen(filename, "r")) == NULL) {
err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantReadMessageToValidate,

Index: elm2.4.ME+.109a-cvs/src/hdrconfg.c
*** elm2.4.ME+.109/src/hdrconfg.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109a-cvs/src/hdrconfg.c 2003-11-26 19:16:56.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.33 2003/10/11 13:25:27 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.34 2003/11/26 17:16:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 554,559 ****
--- 554,560 ----
char buffer1[32*1024];
int stat;
int c;
+ int err;

if (in_string(editor, "%s"))
buffer = elm_message(FRM(editor),
***************
*** 576,582 ****
not with edit_charset (system_charset)
*/

-
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditComment,

"# Headers are automatically converted from %s charset and not need encoded\n"),

--- 577,582 ----
***************
*** 594,600 ****

}

-
add_addr_header(F,edit_charset,encoding_supported,

"From", & headers->from);

add_addr_header(F,edit_charset,encoding_supported,
--- 594,599 ----
***************
*** 634,639 ****
--- 633,645 ----
}
Raw(ON);

+ err = can_open(filename,"r");
+ if (err) {

+ lib_error(FRM("%s: %s"),filename,err);
+

+ goto fail1;
+ }
+

F = fopen(filename,"r");

if (!F) {


/* In than point opening should have succeed */

Index: elm2.4.ME+.109a-cvs/src/help.c
*** elm2.4.ME+.109/src/help.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109a-cvs/src/help.c 2003-11-26 19:16:56.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.13 2003/07/29 18:46:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.14 2003/11/26 17:16:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 381,391 ****
static int display_file(file)
char *file;
{
! /*** Display file to screen ***/
!
! FILE *fileptr;
! int lines=0;
! char buffer[SLEN];

if ((fileptr = fopen(file,"r")) == NULL) {
DPRINT(Debug,1,
--- 381,403 ----
static int display_file(file)
char *file;
{
! /*** Display file to screen ***/
!
! FILE *fileptr;
! int lines=0;
! char buffer[SLEN];
!
! /* This routine is used to print helpfiles, which
! are not user writable directory, sho that is not actually

! problem */
! int err = can_open(file,"r");
!

! if (err) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmHelpCouldntOpenFile,
! "Couldn't open file %s."),
! file);
! return(FALSE);
! }

if ((fileptr = fopen(file,"r")) == NULL) {
DPRINT(Debug,1,

Index: elm2.4.ME+.109a-cvs/src/mailmsg2.c
*** elm2.4.ME+.109/src/mailmsg2.c 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.109a-cvs/src/mailmsg2.c 2003-11-26 19:16:56.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.70 2003/10/05 16:07:28 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.70 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.71 2003/11/26 17:16:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 248,253 ****
--- 248,266 ----
/** if there is an included file, copy it into the temp file **/
if (*included_file) {
FILE *input;

+
+ int err = can_open(included_file,"r");
+ if (err) {

+ err = can_open(cur_editfile,"r+");


+ if (err) {
+ DPRINT(Debug,1,(&Debug,

+ "Attempt to open file %s for reading failed with error %s (mail) -- can_open\n",
+ cur_editfile, error_description(err)));
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenReply,
+ "Could not open reply file (%s)."),
+ error_description(err));
+
+ return need_redraw;
+ }
+
if ((reply = fopen(cur_editfile,"r+")) == NULL) {
err = errno;
DPRINT(Debug,1,(&Debug,

Index: elm2.4.ME+.109a-cvs/src/save_opts.c
*** elm2.4.ME+.109/src/save_opts.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109a-cvs/src/save_opts.c 2003-11-26 19:16:56.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.23 2003/07/29 18:46:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.24 2003/11/26 17:16:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 65,71 ****

FILE *newelmrc;
char oldfname[SLEN], newfname[SLEN];
!
strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
FRM("%s/%s"),
--- 65,72 ----

FILE *newelmrc;
char oldfname[SLEN], newfname[SLEN];
! int err;
!
strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
FRM("%s/%s"),
***************
*** 92,97 ****
--- 93,106 ----

/** next, open the new .elm/elmrc file... **/

+ err = can_open(newfname, "w");
+ if (err) {


+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
+ "Can't save configuration! Can't write to %s [%s]."),
+ newfname, error_description(errno));

+ return;
+ }
+

if ((newelmrc = fopen(newfname, "w")) == NULL) {
lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
"Can't save configuration! Can't write to %s [%s]."),

Index: elm2.4.ME+.109a-cvs/src/utils.c
*** elm2.4.ME+.109/src/utils.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.109a-cvs/src/utils.c 2003-11-23 20:12:43.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: utils.c,v 1.25 2003/07/29 18:46:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: utils.c,v 1.26 2003/11/23 18:12:43 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 88,98 ****

if (interrupt) {
ClearScreen();
} else {
MoveCursor(elm_LINES,0);
NewLine();
}
! Raw(OFF);
}

/* Tjis routine is called by panic() */
--- 88,101 ----

if (interrupt) {
ClearScreen();
+ Raw(OFF);
} else {
MoveCursor(elm_LINES,0);
NewLine();
+
+ Raw_OFF(0);
}
!
}

/* Tjis routine is called by panic() */
***************
*** 219,227 ****
close_cached_connections();

if(do_cursor) {
! MoveCursor(elm_LINES,0);
! NewLine();
! Raw(OFF);
}

exit(1);
--- 222,228 ----
close_cached_connections();

if(do_cursor) {
! Raw_OFF(1);
}

exit(1);
***************
*** 253,262 ****
SIGDPRINT(Debug,2,
(&Debug,
"\nLeaving mailer from signal handler (leave)\n"));
! else
SIGDPRINT(Debug,2, (&Debug,
"\nLeaving mailer normally (leave)\n"));
!

/* Set terminal title to "Elm: exiting" ... can be called from
signal handler
--- 254,263 ----
SIGDPRINT(Debug,2,
(&Debug,
"\nLeaving mailer from signal handler (leave)\n"));
! else {
SIGDPRINT(Debug,2, (&Debug,
"\nLeaving mailer normally (leave)\n"));
! }

/* Set terminal title to "Elm: exiting" ... can be called from
signal handler
***************
*** 331,339 ****
unlink(cur_editfile);

if (do_cursor) {
! MoveCursor(elm_LINES,0);
! NewLine();
! Raw(OFF);
}

if (*mailbox) {
--- 332,338 ----
unlink(cur_editfile);

if (do_cursor) {
! Raw_OFF(1);
}

if (*mailbox) {
***************
*** 404,412 ****
close_cached_connections();

if (do_cursor) {
! MoveCursor(elm_LINES,0);
! NewLine();
! Raw(OFF);
}

exit(0);
--- 403,409 ----
close_cached_connections();

if (do_cursor) {
! Raw_OFF(1);
}

exit(0);

Kari E. Hurtta

unread,
Dec 14, 2003, 6:55:14 AM12/14/03
to
Archive-name: elm2.4ME+/PL109b

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

file elm-2.4ME+PL109b.patch.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL109b.patch.gz >
via WWW.

Page <URL: http://personal.inet.fi/atk/elmme/ > is not up of date.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL109b.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

SUMMARY: This patch fixes segmentation violation on
l)imit command and problem where user alias
file was not opened, if system alias file existed.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL109a (25) --------------------------------
Index: elm2.4.ME+.109b-cvs/hdrs/patchlevel.h
Prereq: 1100000200
*** elm2.4.ME+.109a/hdrs/patchlevel.h 2003-12-14 12:39:21.000000000 +0200
--- elm2.4.ME+.109b-cvs/hdrs/patchlevel.h 2003-12-14 12:00:11.000000000 +0200
***************
*** 1,9 ****


! #define PATCHLEVEL "109a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.109
*/
! #define LAST_REPORT_TIME 1100000200
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

! #define VERS_DATE "Nov, 2003" /* for elm -v option */
#define WHAT_STRING \


! "@(#) Version 2.4(ME+), USENET supported version, released Nov, 2003"

--- 1,9 ----
! #define PATCHLEVEL "109b (25)"


/* Used by Configure:
SHAREDTAG: .1.0.109
*/

! #define LAST_REPORT_TIME 1100000400


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

! #define VERS_DATE "Dec, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Dec, 2003"
Index: elm2.4.ME+.109b-cvs/README.ME+
*** elm2.4.ME+.109a/README.ME+ 2003-12-14 12:39:21.000000000 +0200
--- elm2.4.ME+.109b-cvs/README.ME+ 2003-12-14 12:00:11.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.670.6.4 2003/11/30 08:08:18 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.670.6.7 2003/12/14 10:00:11 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 14,19 ****
--- 14,35 ----


Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.


+ Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)


+ -------------------------------------------------------------------
+
+ [ This is out of branch patch. ]
+

+ SUMMARY: This patch fixes segmentation violation on
+ l)imit command and problem where user alias
+ was not opened, if system alais file existed.
+
+ - Fix segmentation violation on l)mit command
+ "header subject" (ie. without ':').
+
+ - User alias file was not opened, if system alias file
+ existed. Fixed short circuit evalution.


+
+
Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

-------------------------------------------------------------------

***************
*** 23,30 ****



SUMMARY: This patch address panic when imap server disconnects
during password prompt, fixes initialization of

! internal-mailcaps and mailcaps elmrc options and
! fixes some cases where error message was not visible

because of exiting of Elm ME+. Also security fixes of

Elm2.4ME+ PL109S (25) are included to this patch (it


is agaist Elm2.4ME+ PL109 (25))

--- 39,46 ----



SUMMARY: This patch address panic when imap server disconnects
during password prompt, fixes initialization of

! internal-mailcaps and metamail-mailcaps elmrc options
! and fixes some cases where error message was not visible

because of exiting of Elm ME+. Also security fixes of

Elm2.4ME+ PL109S (25) are included to this patch (it


is agaist Elm2.4ME+ PL109 (25))

Index: elm2.4.ME+.109b-cvs/src/alias.c
*** elm2.4.ME+.109a/src/alias.c 2003-12-14 12:39:21.000000000 +0200
--- elm2.4.ME+.109b-cvs/src/alias.c 2003-12-14 12:00:11.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: alias.c,v 1.26 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.26.6.1 2003/12/14 10:00:11 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26.6.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 95,100 ****
--- 95,103 ----
*
* Also, parse the data files into memory if needed
*/
+
+ int A,B;
+
if (first_time) {
a_group_name = catgets(elm_msg_cat, AliasesSet, AliasesGroup,
" Group");
***************
*** 141,147 ****
first_time = FALSE;
}

! if(open_system_aliases() || open_user_aliases()) {
DPRINT(Debug,4,
(&Debug,
"Reading alias data files...\n"));
--- 144,159 ----
first_time = FALSE;
}

! /* Do not use
!
! open_system_aliases() || open_user_aliases()
!
! we want open both files!
! */
!
! A = open_system_aliases();
! B = open_user_aliases();
! if (A || B) {
DPRINT(Debug,4,
(&Debug,
"Reading alias data files...\n"));
Index: elm2.4.ME+.109b-cvs/src/limit.c
*** elm2.4.ME+.109a/src/limit.c 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.109b-cvs/src/limit.c 2003-12-06 17:05:38.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: limit.c,v 1.20 2003/09/03 09:16:29 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: limit.c,v 1.20.18.1 2003/12/06 15:05:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20.18.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 426,432 ****
walk;
walk = walk->next_this_header) {

! if (in_string(shift_lower(walk->body),value))
match++;
}
delete_headers(&all_headers);
--- 426,435 ----
walk;
walk = walk->next_this_header) {

!
! if (!value)
! /* perhaps: match++ */ ;
! else if (in_string(shift_lower(walk->body),value))
match++;
}
delete_headers(&all_headers);

Kari E. Hurtta

unread,
Dec 17, 2003, 1:51:11 PM12/17/03
to
Archive-name: elm2.4ME+/PL110

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

files elm-2.4ME+PL110.patch.gz
and elm-2.4ME+110.tar.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL110.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+110.tar.gz >
via WWW.

Page <URL: http://personal.inet.fi/atk/elmme/ > is not up

of date.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL110.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Undo Elm2.4ME+ PL109a (25) and Elm2.4ME+ PL109b (25) patches before
applying this patch.

Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL109 (25) --------------------------------

To apply this patch, use
patch -p1 < this_file


on top level directory of Elm 2.4ME+ distribution

(ie. where file README.ME+ exists.)


Index: elm2.4.ME+.110-cvs/hdrs/patchlevel.h
Prereq: 1099000000
*** elm2.4.ME+.109/hdrs/patchlevel.h Sat Nov 15 18:19:06 2003
--- elm2.4.ME+.110-cvs/hdrs/patchlevel.h Wed Dec 17 18:37:19 2003
***************
*** 1,9 ****


! #define PATCHLEVEL "109 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.109
*/
! #define LAST_REPORT_TIME 1099000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"
! #define VERS_DATE "Nov, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Nov, 2003"
--- 1,9 ----

! #define PATCHLEVEL "110 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.110
*/
! #define LAST_REPORT_TIME 1103000000


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

! #define VERS_DATE "Dec, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Dec, 2003"
Index: elm2.4.ME+.110-cvs/README.ME+
*** elm2.4.ME+.109/README.ME+ Sat Nov 15 18:19:06 2003
--- elm2.4.ME+.110-cvs/README.ME+ Wed Dec 17 16:32:02 2003
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.670 2003/11/15 15:25:17 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.685 2003/12/17 14:32:02 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 12,17 ****
--- 12,260 ----



Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.
+

+ Changes of Elm2.4ME+ PL110 (25) compared with Elm2.4ME+ PL109 (25)
+ ------------------------------------------------------------------
+
+ Undo Elm2.4ME+ PL109S (25) patch before applying this patch.
+ Undo Elm2.4ME+ PL109a (25) and Elm2.4ME+ PL109b (25) patches
+ before applying this patch.
+
+ SUMMARY: This release collects patches PL109a and PL109b.
+ Security fixes introduced in PL109S are included.
+ Bogus charset initialization error caused by
+ missing global elm.mimecharsets file is fixed.
+ Some enchancements to l)imit command are
+ introduced. This release also fixes extra
+ "[Keeping all messages.]" messages introduced
+ on PL109a fix. File MIME.txt compares Elm ME+
+ to MIME conformace criteria.
+
+ - This file states "But anyway, Elm will never be MIME
+ Conformant." Added file MIME.txt which enumerates RFC
+ 2049 requirements and look which reuirements are not
+ followed and on what conditions.
+
+ - Change some Raw(OFF) to Raw_OFF() on leaving routines
+ of src/utils.c
+ > Also clear "[Keeping all messages.]" messages
+ after leaving folder so that these are not
+ printed because of Raw_OFF();


+
+ - Try fix
+ MBX PANIC in imap.c:2578:end_imap_command

+ when IMAP / TLS connection is closed by server.
+

+ - Initialization of internal-mailcaps and
+ metamail-mailcaps did not worked correctly.
+ Moved initialization before reading of global
+ elm.rc.
+ Problem noted by: Xavi Serrano <xser...@ac.upc.es>
+
+ - On def_prompt_handler() final newline should be
+ printed to terminal as prompt is printed (instead
+ of stderr.)

+
+ - Fix segmentation violation on l)mit command

+ "header subject" (ie. without ':'). This is now
+ interpreted to be all mails which have given header
+ name.
+
+ - l)imit command "aabbc: yyy" work now as
+ "header aabbc: yyy"


+
+ - User alias file was not opened, if system alias file
+ existed.

+ - Avoid error message like following
+ Elm: Unable to map en_US locale (LC_CTYPE) to MIME charset.
+ Codeset name ISO-8859-15 was unknown. Treating ISO-8859-15 as MIME name.
+ Check /usr/local/test/lib/elm.mimecharsets or .../.elm/mime.charsets
+ Problem with locale (system character set)! Elm ME+ will behave erratically.
+ on case where elm.mimecharsets is not installed. Codeset
+ match was not used if either file elm.mimecharsets or
+ mime.charsets existed.
+
+ New files:
+ MIME.txt
+

+ Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)
+ -------------------------------------------------------------------

+
+ [ This is out of branch patch. ]
+

+ SUMMARY: This patch fixes segmentation violation on
+ l)imit command and problem where user alias

+ was not opened, if system alias file existed.


+
+ - Fix segmentation violation on l)mit command
+ "header subject" (ie. without ':').
+
+ - User alias file was not opened, if system alias file
+ existed. Fixed short circuit evalution.
+

+

+ Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

+ -------------------------------------------------------------------


+
+ [ This is out of branch patch. ]
+

+ Undo Elm2.4ME+ PL109S (25) patch before applying this patch.
+
+ SUMMARY: This patch address panic when imap server disconnects
+ during password prompt, fixes initialization of
+ internal-mailcaps and metamail-mailcaps elmrc options
+ and fixes some cases where error message was not visible

+ because of exiting of Elm ME+. Also security fixes of
+ Elm2.4ME+ PL109S (25) are included to this patch (it
+ is agaist Elm2.4ME+ PL109 (25))
+
+
+ - Changed some Raw(OFF) to Raw_OFF() on leaving routines
+ of src/utils.c
+
+ - Try fix
+ MBX PANIC in imap.c:2578:end_imap_command

+ when IMAP / TLS connection is closed by server.
+

+
+ Changes of Elm2.4ME+ PL109S (25) compared with Elm2.4ME+ PL109 (25)
+ ------------------------------------------------------------------
+

+ - SECURITY: Add can_open() test to mail()
+ - SECURITY: Add can_open() test to save_options()
+
+ - Add can_open() test to load_folder_state_file()
+ - Add can_open() test to read_unidata_text()
+ - Add can_open() test to display_file()

Changes of Elm2.4ME+ PL109 (25) compared with Elm2.4ME+ PL108 (25)

------------------------------------------------------------------
Index: elm2.4.ME+.110-cvs/lib/charset.c
*** elm2.4.ME+.109/lib/charset.c Sat Nov 15 18:19:06 2003
--- elm2.4.ME+.110-cvs/lib/charset.c Wed Nov 26 19:16:54 2003
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: charset.c,v 1.72 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.72 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: charset.c,v 1.73 2003/11/26 17:16:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.73 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 1388,1398 ****
{
struct locale_map_item *result;
int result_len = 0;
! FILE * f = fopen(filename,"r");
int max_result = 0;
int c,l1;
char buf[LONG_STRING];

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
--- 1388,1407 ----
{
struct locale_map_item *result;
int result_len = 0;
! FILE * f;
int max_result = 0;
int c,l1;
char buf[LONG_STRING];
+ int err = can_open(filename,"r");

+ if(err) {
+ DPRINT(Debug,2,(&Debug,
+ "load_locale_map: %s: %s (can_open)\n",
+ filename,error_description(err)));

+ return NULL;
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,

Index: elm2.4.ME+.110-cvs/lib/file_util.c
*** elm2.4.ME+.109/lib/file_util.c Sat Jan 26 13:14:46 2002
--- elm2.4.ME+.110-cvs/lib/file_util.c Wed Nov 26 19:16:54 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.6 2001/06/06 18:08:58 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.7 2003/11/26 17:16:54 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 274,279 ****
--- 274,294 ----
DPRINT(Debug,1,(&Debug,
"Copy: to='%s'\n", to));

+ if (!isspool) {
+ int err = can_open(to, "w");

+
+ if (err) {


+ DPRINT(Debug,1,(&Debug,
+ "Error: could not open %s for writing (copy -- can_open)\n",
+ to));
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenFile,
+ "Could not open file %s."),
+ to);
+ return(1);
+ }
+ }
+
if ((to_file = fopen(to, "w")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Error: could not open %s for writing (copy)\n",

Index: elm2.4.ME+.110-cvs/lib/imap.c
*** elm2.4.ME+.109/lib/imap.c Tue Aug 5 10:27:06 2003
--- elm2.4.ME+.110-cvs/lib/imap.c Sat Nov 29 17:55:38 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: imap.c,v 1.100 2003/07/24 16:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.100 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: imap.c,v 1.101 2003/11/29 15:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.101 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 2273,2282 ****
--- 2273,2284 ----
"No imap connection",0);

if (Ma->current_NOOP_tag &&
+ Ma->imap_state != IMAP_closing &&
Ma->imap_state != IMAP_error) {
DPRINT(Debug,3,(&Debug,
"imap_idle_wait_1: Waiting for idle NOOP complete...\n"));
while(Ma->current_NOOP_tag &&
+ Ma->imap_state != IMAP_closing &&
Ma->imap_state != IMAP_error &&
con->C.stream) {
WaitStreamFor(con->C.stream,SS_read_act);
***************

*** 2573,2578 ****
--- 2575,2592 ----
con,


con->C.username ? con->C.username : "<NULL>",
con->C.host ? con->C.host : "<NULL>"));
+
+ if (IMAP_error == con->a.imap_con->imap_state) {
+ DPRINT(Debug,12,(&Debug,
+ "end_imap_command: On error state\n"));

+ return;
+ }
+

+ if (IMAP_closing == con->a.imap_con->imap_state) {
+ DPRINT(Debug,12,(&Debug,

+ "end_imap_command: Is closing\n"));
+ return;
+ }


if (con->a.imap_con->imap_state != IMAP_command)
panic("MBX PANIC",__FILE__,__LINE__,

Index: elm2.4.ME+.110-cvs/lib/iso2022.c
*** elm2.4.ME+.109/lib/iso2022.c Fri Sep 5 23:33:17 2003
--- elm2.4.ME+.110-cvs/lib/iso2022.c Wed Nov 26 19:16:54 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.26 2003/08/24 17:04:22 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.27 2003/11/26 17:16:54 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 482,491 ****
int max_count = 0;
int new_max;
int count = 0;
! FILE * f = fopen(filename,"r");
char buf[LONG_STRING];
int c, l1;

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
--- 482,500 ----
int max_count = 0;
int new_max;
int count = 0;
! FILE * f;
char buf[LONG_STRING];
int c, l1;

+ int err = can_open(filename,"r");

+ if (err) {


+ DPRINT(Debug,2,(&Debug,
+ "parse_iso2022_map=0: %s: %s (can_open)\n",
+ filename,error_description(err)));

+ return 0;
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,

Index: elm2.4.ME+.110-cvs/lib/ldstate.c
*** elm2.4.ME+.109/lib/ldstate.c Tue Aug 5 10:27:06 2003
--- elm2.4.ME+.110-cvs/lib/ldstate.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.7 2003/07/24 16:29:52 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.8 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 114,119 ****
--- 114,120 ----
char buf[SLEN], *state_fname;
int status, i, Len,j;
FILE *fp;
+ int err;

/* clear out the folder status record */
clear_ldstate(fst);
***************
*** 121,126 ****
--- 122,135 ----
/* see if we can find a state file */
if ((state_fname = getenv(FOLDER_STATE_ENV)) == NULL)

return 0;
+

+ /* This test should not needed,
+ setgid Elm ME+ do not call this function
+ */

+ err = can_open(state_fname, "r");
+ if (err)


+ return 0;
+
if ((fp = fopen(state_fname, "r")) == NULL)
return 0;

Index: elm2.4.ME+.110-cvs/lib/localmbx.c
*** elm2.4.ME+.109/lib/localmbx.c Tue Aug 5 10:27:06 2003
--- elm2.4.ME+.110-cvs/lib/localmbx.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.60 2003/07/24 16:29:52 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.60 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.61 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************

*** 4242,4247 ****
--- 4242,4248 ----
KEEP_STATE keep_state_ptr;
{
int status = 0,err;
+
keep_state_ptr -> a.file.temp_keep_file =
elm_message(FRM("%s%s%d"),temp_dir, temp_file, getpid());

Index: elm2.4.ME+.110-cvs/lib/mk_aliases.c
*** elm2.4.ME+.109/lib/mk_aliases.c Sat Jan 26 13:14:46 2002
--- elm2.4.ME+.110-cvs/lib/mk_aliases.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 1.8 2001/03/13 19:46:12 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 1.9 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

+ err = can_open(inputname,"r");
+ if (err) {


+ if ( textwarn ) {
+ lib_error(CATGETS(elm_msg_cat,
+ NewaliasSet, NewaliasNoOpenIn,
+ "Couldn't open %s for input!"),
+ inputname);
+ }
+
+ free(buffer);

+ return(-1);
+ }
+

if ((in = fopen(inputname,"r")) == NULL) {
! if ( textwarn ) {
! lib_error(CATGETS(elm_msg_cat,
! NewaliasSet, NewaliasNoOpenIn,
! "Couldn't open %s for input!"),
! inputname);
! }
!
free(buffer);
return(-1);
}
***************
*** 611,616 ****
--- 622,636 ----
return(-1);
}

+ err = can_open(dataname, "w");
+ if (err) {


+ lib_error(CATGETS(elm_msg_cat,
+ NewaliasSet, NewaliasNoOpenOut,
+ "Couldn't open %s for output!"), dataname);
+ free(buffer);

+ return(-1);
+ }
+

if ((data = fopen(dataname, "w")) == NULL) {
lib_error(CATGETS(elm_msg_cat,
NewaliasSet, NewaliasNoOpenOut,
***************

*** 699,702 ****
--- 719,729 ----





+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ */

Index: elm2.4.ME+.110-cvs/lib/ndbz.c
*** elm2.4.ME+.109/lib/ndbz.c Sat Jan 26 13:14:45 2002
--- elm2.4.ME+.110-cvs/lib/ndbz.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.4 2001/06/06 18:09:01 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.5 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

+ err = can_open(fn, "w");
+ if (err) {


+ free((malloc_t)fn);
+
+ DPRINT(Debug,5,(&Debug,
+ "dbz_fresh: unable to write config (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "w");
free((malloc_t)fn);
if (f == NULL) {
***************
*** 310,315 ****
--- 321,335 ----
fn = enstring(name, pag);
if (fn == NULL)
return (DBZ *)NULL;
+

+ err = can_open(fn, "w");
+ if (err) {

+ err = can_open(fn, "r");
+ if (err) {


+ free((malloc_t)fn);
+
+ DPRINT(Debug,5,(&Debug,
+ "dbz_again: cannot open old .dir file (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "r");
free((malloc_t)fn);
if (f == NULL) {
***************
*** 446,451 ****
--- 477,491 ----
fn = enstring(name, dir);
if (fn == NULL)
return (DBZ *)NULL;
+

+ err = can_open(fn, "w");
+ if (err) {


+ free((malloc_t)fn);
+ DPRINT(Debug,5,(&Debug,
+ "dbz_again: unable to write new .dir (can_open)\n"));
+ return (DBZ *)NULL;
+ }
+
f = fopen(fn, "w");
free((malloc_t)fn);
if (f == NULL) {

***************
*** 465,470 ****


--- 505,519 ----
fn = enstring(name, pag);
if (fn == NULL)
return (DBZ *)NULL;
+

+ err = can_open(fn, "w");
+ if (err) {

+ err = can_open(dirfname, "r+");
+ if (err) {


+ free((malloc_t)dirfname);
+
+ DPRINT(Debug,5,(&Debug,
+ "dbz_open: can't open .dir file (can_open)\n"));
+ free((malloc_t)db);
+
+ errno = err;
+ return (DBZ *)NULL;
+ }
+
if (mode == O_RDONLY) {
db->dbz_dirf = fopen(dirfname, "r");
db->dbz_dirronly = 1;
***************
*** 528,533 ****
--- 593,614 ----
free((malloc_t)db);
return (DBZ *)NULL;
}
+
+ if (mode == O_RDONLY)
+ err = can_open(pagfname, "rb");
+ else

+ err = can_open(pagfname, "r+b");
+ if (err) {


+ DPRINT(Debug,5,(&Debug,
+ "dbz_open: .pag open failed (can_open)\n"));
+ (void) fclose(db->dbz_dirf);
+ free((malloc_t)pagfname);
+ free((malloc_t)db);
+
+ errno = err;
+ return (DBZ *)NULL;
+ }
+
if (mode == O_RDONLY) {
db->dbz_pagf = fopen(pagfname, "rb");
db->dbz_pagronly = 1;
***************
*** 558,568 ****
--- 639,659 ----
db->dbz_pagpos = -1;
/* don't free pagfname, need it below */

+ err = can_open(name, "r");
+ if (err) {


+ DPRINT(Debug,5,(&Debug,
+ "dbz_open: basefile open failed (can_open)\n"));
+

+ goto fail1;
+ }
+

/* open the base file */
db->dbz_basef = fopen(name, "r");
if (db->dbz_basef == NULL) {
DPRINT(Debug,5,(&Debug,

"dbz_open: basefile open failed\n"));
+

+ err = can_open(db->dbz_basefname, "r");
+ if (err) {


+ DPRINT(Debug,5,(&Debug,
+ "latebase: still can't open base (can_open)\n"));
+ return (FILE *)NULL;
+ }
+
it = fopen(db->dbz_basefname, "r");
if (it == NULL) {
DPRINT(Debug,5,(&Debug,

Index: elm2.4.ME+.110-cvs/lib/output.c
*** elm2.4.ME+.109/lib/output.c Thu Jun 6 18:55:57 2002
--- elm2.4.ME+.110-cvs/lib/output.c Sun Nov 23 19:10:30 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: output.c,v 1.29 2002/06/01 12:58:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: output.c,v 1.30 2003/11/23 17:10:30 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 70,76 ****
if (x && (y = strchr(x,'\n')))
*y = '\0';
if (ret > 0 && l && str[l-1] != '\n')
! ret += fprintf(stderr,"\n");
}
fclose(f);
if (!x)
--- 70,76 ----
if (x && (y = strchr(x,'\n')))
*y = '\0';
if (ret > 0 && l && str[l-1] != '\n')
! ret += fprintf(f,"\n");
}
fclose(f);
if (!x)

Index: elm2.4.ME+.110-cvs/lib/read_rc.c
*** elm2.4.ME+.109/lib/read_rc.c Sat Nov 15 18:19:06 2003
--- elm2.4.ME+.110-cvs/lib/read_rc.c Tue Dec 16 21:35:43 2003
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.121 2003/11/10 15:15:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.121 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.124 2003/12/16 19:35:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.124 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
***************

*** 670,676 ****
} else {
int val;
char buffer[STRING];
!
if (0 == strcmp(lc_ctype,"C"))
system_charset = MIME_name_to_charset("US-ASCII",
CHARSET_create);
--- 670,687 ----
} else {
int val;
char buffer[STRING];
!
! if (d_matches[match_codeset]) {
! system_charset = d_matches[match_codeset];
! DPRINT(Debug,3,(&Debug,
! "map_display_charset: using match codeset: \"%s\" (codeset \"%s\") as %s\n",
! lc_ctype,codeset,
! system_charset->MIME_name ?
! system_charset->MIME_name :
! "<no MIME name>"));
! return;
! }
!
if (0 == strcmp(lc_ctype,"C"))
system_charset = MIME_name_to_charset("US-ASCII",
CHARSET_create);
***************
*** 1101,1106 ****
--- 1112,1178 ----

expand_map_bin("bindata", bindata_path_global, raw_bindata_path,

--- 1261,1266 ----
***************
*** 1355,1376 ****


/** this routine does all the actual work of reading in the
.rc file... **/

! FILE *file;
!
errors = 0;

/* Look for the elmrc file */
! if ((file = fopen(user_rc_file, "r")) == NULL) {
DPRINT(Debug,2,(&Debug,
! "Warning:User has no \"%s\" file\n\n",
user_rc_file));
! }

! if (file != NULL) {
! do_rc(file, LOCAL_RC, ELMRCFILE);
! fclose(file);
}
-

/* load_locale_map may refer to map-text-dir ... */

do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,

--- 1366,1398 ----


/** this routine does all the actual work of reading in the
.rc file... **/

! int err;
!
errors = 0;

+
/* Look for the elmrc file */
! err = can_open(user_rc_file, "r");
! if (err) {
DPRINT(Debug,2,(&Debug,
! "Warning:User has no \"%s\" file (can_open)\n\n",
user_rc_file));
!
! } else {
! FILE *file = NULL;

! if ((file = fopen(user_rc_file, "r")) == NULL) {
! DPRINT(Debug,2,(&Debug,
! "Warning:Open \"%s\" failed\n\n",
! user_rc_file));

!
! }
!

! if (file != NULL) {
! do_rc(file, LOCAL_RC, ELMRCFILE);
! fclose(file);
! }
}

/* load_locale_map may refer to map-text-dir ... */

do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,

Index: elm2.4.ME+.110-cvs/lib/service_list.c
*** elm2.4.ME+.109/lib/service_list.c Wed May 28 21:49:27 2003
--- elm2.4.ME+.110-cvs/lib/service_list.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.23 2003/05/17 16:13:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: service_list.c,v 1.24 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 928,937 ****
/* hostname service options */

int max_count = 0;
int count = 0;


! FILE * f = fopen(filename,"r");
char buf[LONG_STRING];
int c, l1;

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,
--- 928,949 ----
/* hostname service options */

int max_count = 0;
int count = 0;


! FILE * f;
char buf[LONG_STRING];
int c, l1;

+ if (!system) {

+ int err = can_open(filename,"r");
+

+ if (err) {
+ DPRINT(Debug,2,(&Debug,
+ "parse_service_entries=0: %s: %s (can_open)\n",
+ filename,error_description(err)));

+ return 0;
+ }
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,

Index: elm2.4.ME+.110-cvs/lib/terminal.c
*** elm2.4.ME+.109/lib/terminal.c Fri Sep 5 23:33:17 2003
--- elm2.4.ME+.110-cvs/lib/terminal.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.37 2003/08/19 14:34:12 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.38 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 411,421 ****
{
struct terminal_map_item *result;
int result_len = 0;
! FILE * f = fopen(filename,"r");
int max_result = 0;
int c;
char buf[LONG_STRING];

if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s\n",
--- 411,429 ----
{
struct terminal_map_item *result;
int result_len = 0;
! FILE * f;
int max_result = 0;
int c;
char buf[LONG_STRING];

+ int err = can_open(filename,"r");

+ if (err) {


+ DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s (can_open)\n",
+ filename,error_description(err)));

+ return NULL;
+ }
+

+ f = fopen(filename,"r");
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s\n",

Index: elm2.4.ME+.110-cvs/lib/unidata.c
*** elm2.4.ME+.109/lib/unidata.c Sat Nov 15 18:19:06 2003
--- elm2.4.ME+.110-cvs/lib/unidata.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: unidata.c,v 1.25 2003/11/09 16:13:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.26 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 2127,2137 ****
{


struct unidata_mapped_data * res = *ptr;
int status = 0;

! FILE *f = fopen(filename,"r");
int last_processed = -1;


int line_number = 1;
int unassigned_cell = -1;
char composition_buffer[160];

if (!f) {
int err = errno;
--- 2127,2153 ----
{

struct unidata_mapped_data * res = *ptr;
int status = 0;

! FILE *f;
int last_processed = -1;
int line_number = 1;
int unassigned_cell = -1;
char composition_buffer[160];

+
+

+ /* This should not have readed by setgid Elm ME+
+ so this test is not necessary */

+ int err = can_open(filename,"r");
+
+ if (err) {


+ lib_error(CATGETS(elm_msg_cat, MeSet, MeUnidataCantOpen,
+ "Can't open UNIDATA2.TXT: %.50s: %.25s"),
+ filename,error_description(err));

+ return 0;
+ }
+
+
+

+ f = fopen(filename,"r");

if (!f) {
int err = errno;

Index: elm2.4.ME+.110-cvs/MANIFEST
*** elm2.4.ME+.109/MANIFEST Sat Nov 15 18:19:06 2003
--- elm2.4.ME+.110-cvs/MANIFEST Sun Nov 23 18:27:36 2003
***************
*** 395,397 ****
--- 395,398 ----
utils/charmapcopy.c
utils/charmapcopy.h
doc/elmbindata.1
+ MIME.txt
Index: elm2.4.ME+.110-cvs/melib/mailcap.c
*** elm2.4.ME+.109/melib/mailcap.c Sun Oct 12 12:48:03 2003
--- elm2.4.ME+.110-cvs/melib/mailcap.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.10 2003/10/11 11:35:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.11 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************

*** 466,475 ****


int unsupported = 0;
media_type_t T = NULL;

enum mime_major_type T_major = MIME_TYPE_UNKNOWN;

!
zero_mailcap_entry(&Entry);
arg_zero(&keyword);
arg_zero(&string);

F = fopen(mailcaps[mailcap_idx],"r");
if (!F) {

--- 466,485 ----


int unsupported = 0;
media_type_t T = NULL;

enum mime_major_type T_major = MIME_TYPE_UNKNOWN;

!
! int err;
!
zero_mailcap_entry(&Entry);
arg_zero(&keyword);
arg_zero(&string);
+

+ err = can_open(mailcaps[mailcap_idx],"r");
+ if (err) {
+ DPRINT(Debug,2,(&Debug,
+ "Failed to open mailcap %s: (errno=%d) %s (can_open)\n",
+ mailcaps[mailcap_idx],err,error_description(err)));
+ continue;


+ }

F = fopen(mailcaps[mailcap_idx],"r");
if (!F) {

Index: elm2.4.ME+.110-cvs/MIME.txt
*** /tmp/5525-very-long-file-name-NULL-comes-in-here Wed Dec 17 20:04:44 2003
--- elm2.4.ME+.110-cvs/MIME.txt Sat Dec 6 15:41:15 2003
***************
*** 0 ****
--- 1,469 ----
+
+ MIME Conformance ?
+ ==================
+
+ README.ME+ states:
+
+ > But anyway, Elm will never be MIME Conformant
+
+ But lets look what RFC 2049 (Multipurpose Internet Mail Extensions
+ (MIME) Part Five: Conformance Criteria and Examples) says. Text
+ from RFC 2049 is quoted with ###.
+
+ ELM ME+ refers to Elm 2.4ME+ PL109 (25).
+
+ ### A mail user agent that is MIME-conformant MUST:
+
+ ### (1) Always generate a "MIME-Version: 1.0" header field in
+ ### any message it creates.
+
+ ELM ME+ do not add MIME-Version: 1.0
+ on following situation:
+
+ 1) If Elm ME+ is mailing of form
+
+ Content-Type: mailform
+
+ That is not MIME message, but some obsolete format
+ (it is uncluear can be that format invoked)
+
+ ### (2) Recognize the Content-Transfer-Encoding header field
+ ### and decode all received data encoded by either quoted-
+ ### printable or base64 implementations. The identity
+ ### transformations 7bit, 8bit, and binary must also be
+ ### recognized.
+
+ ELM ME+ do not recognize these content-transfer-encodings
+ if message have not MIME-Version header and elmrc option
+ "require-mime-version-for-body-encoding" have value ON
+ (default ON).
+
+ ### Any non-7bit data that is sent without encoding must be
+ ### properly labelled with a content-transfer-encoding of
+ ### 8bit or binary, as appropriate. If the underlying
+ ### transport does not support 8bit or binary (as SMTP
+ ### [RFC-821] does not), the sender is required to both
+ ### encode and label data using an appropriate Content-
+ ### Transfer-Encoding such as quoted-printable or base64.
+
+ ELM ME+ do not encode non-7bit text data,
+ on following situation:
+
+ 1) If elmrc option "noencoding" have value "pass-8bit"
+ or "pass-binary".
+
+ Default value is "pass-7bit".
+
+ Also ELM ME+ do not encode, if to it is told that underlying
+ transport supports 8bit or binary.
+
+ ### (3) Must treat any unrecognized Content-Transfer-Encoding
+ ### as if it had a Content-Type of "application/octet-
+ ### stream", regardless of whether or not the actual
+ ### Content-Type is recognized.
+
+ ELM ME+ provides way to save part on message encoded form if
+ content-transfer-encoding is unrecognized.
+
+ ELM ME+ provides way to save application/octet-stream on
+ decoded form if content-transfer-encoding is recognized and
+ supported.
+
+ However if metamail is available and elmrc option "metamail"
+ is not value "none", mail with unknown content-transfer-encoding
+ is passed to metamail. So behauviour depends of metamail.
+
+ ### (4) Recognize and interpret the Content-Type header field,
+ ### and avoid showing users raw data with a Content-Type
+ ### field other than text.
+
+ ELM ME+ do not recognize these content-type header
+ if message have not MIME-Version header and elmrc option
+ "require-mime-version-for-body-encoding" have value ON
+ (default ON).
+
+
+ If metamail is available and elmrc option "metamail"
+ is not value "none", mail with unknown content-type
+ is passed to metamail. So behauviour depends of metamail.
+
+ 1) Metamail may display raw data
+
+ If metamail is not used, Elm ME+ provides way to save
+ part with unknown content-type on (content-transfer-encoding)
+ decoded form. Raw data is not shown if external programs
+ are not used for iterpretation of data.
+
+ Elm ME+ provides limited internal mailcap parser. If mailcap
+ specifies program for content-type and Elm ME+ is able to
+ support line on mailcap, Elm ME+ provides possibility to pass
+ data on (content-transfer-encoding) decoded form to that
+ external program. So on that case it depends on external program.
+
+ ### Implementations must be able
+ ### to send at least text/plain messages, with the
+ ### character set specified with the charset parameter if
+ ### it is not US-ASCII.
+
+ Elm ME+ provides is able to send text/plain messages and
+ provides charset -paramater if it is not US-ASCII.
+
+ ### (5) Ignore any content type parameters whose names they do
+ ### not recognize.
+
+ Elm ME+ ignores unknown content type paramaters.
+
+ If metamail is called, behauviour depends of metamail.
+
+ ### (6) Explicitly handle the following media type values, to
+ ### at least the following extents:
+
+ ### Text:
+
+ ### -- Recognize and display "text" mail with the
+ ### character set "US-ASCII."
+
+ Elm ME+ displays text/plain mail with the character set
+ "US-ASCII." (at least if underlining system supports US-ASCII
+ -- on other hand ELM ME+ do not support environments
+ where that is not true -- systems with some ISO 646 set other
+ than US-ASCII are perhaps exception.)
+
+ It is possible define or redefine charset names of configuration
+ file. With sufficient broken redefination of charset US-ASCII,
+ it is possible that Elm ME+ is do not have able to display
+ text/plain mail with the character set "US-ASCII."
+
+ If system supports some other ISO 646 set than US-ASCII, Elm ME+
+ is not able to print all US-ASCII characters.
+
+ User have possibility with 'O' (Override charset) command
+ change charset of charset. That may change behauviour. In that
+ case also charset paramater of mail is ignored.
+
+ ### -- Recognize other character sets at least to the
+ ### extent of being able to inform the user about what
+ ### character set the message uses.
+
+ Elm ME+ prints character set's name or value of charset
+ parameter if it is unknown or unsupported.
+
+ ### -- Recognize the "ISO-8859-*" character sets to the
+ ### extent of being able to display those characters that
+ ### are common to ISO-8859-* and US-ASCII, namely all
+ ### characters represented by octet values 1-127.
+
+ ELME ME+ should be able to work environment, where display and
+ system supports only some ISO 646 sets. On these systems
+ all US-ASCII characters are not printable.
+
+ If ELM ME+ do no able to display US-ASCII, it probably
+ also do not have able to display ascii parts of these
+ charsets.
+
+ If elmrc page-known-charsets is OFF (default ON) and metamail is
+ available and elmrc option "metamail" is not value "none", mail
+ with other than system or display charset is passed to metamail.
+ So behauviour depends of metamail on that case.
+
+ 1) Metamail usually pages text directly to terminal without
+ taking account of charset.
+
+ If metamail is not used:
+
+ Assuming that underlining system supports US-ASCII, ELM ME+
+ usually regognize "ISO-8859-*" character sets and display
+ ascii part of them.
+
+ There is defination for existing "ISO-8859-*" character sets
+ so that these treated as superset of US-ASCII. It is possible
+ define or redefine charset names of configuration file. With
+ sufficient broken defination or redefination of some ISO-8859-*
+ set that this is not true.
+
+ If "ISO-8859-*" character sets is not defined and elmrc
+ option "auto-iso-8859" is ON (default ON), given charset is
+ automatically defined to be superset of OS-ASCII.
+
+ If charset is not defined or is defined to unknown, metamail is
+ available and elmrc option "metamail" is not value "none", mail
+ is passed to metamail. So behauviour depends of metamail on that
+ case.
+
+ User have possibility with 'O' (Override charset) command
+ change charset of mail. That may change behauviour. In that
+ case also charset paramater of mail is ignored.
+
+ ### -- For unrecognized subtypes in a known character
+ ### set, show or offer to show the user the "raw" version
+ ### of the data after conversion of the content from
+ ### canonical form to local form.
+
+ Elm ME+ provides limited internal mailcap parser. If mailcap
+ specifies program for content-type and Elm ME+ is able to
+ support line on mailcap, Elm ME+ provides possibility to pass
+ data to external program. But that case perhaps is not
+ unrecognized subtype (if wildcars is not used on mailcap.)
+
+ If metamail is available and elmrc option "metamail" is not value
+ "none", mail with unrecognized subtypes of text is passed to
+ metamail. So behauviour depends of metamail on that
+ case.
+
+ Otherwise Elm ME+ handles unrecognized subtypes of text
+ as "text/plain".
+
+ ### -- Treat material in an unknown character set as if
+ ### it were "application/octet-stream".
+
+ If metamail is available and elmrc option "metamail" is not value
+ "none", mail with unknown charset is passed to metamail. So behauviour
+ depends of metamail on that case.
+
+ 1) Metamail usually pages text directly to terminal without
+ taking account of charset.
+
+ If metamail is not used:
+
+ ELM ME+ provides way to save text on decoded form. Text is not
+ displayed.
+
+ User have possibility with 'O' (Override charset) command
+ change charset of mail. That may change behauviour. In that
+ case also charset paramater of mail is ignored.
+
+ ### Image, audio, and video:
+
+ ### -- At a minumum provide facilities to treat any
+ ### unrecognized subtypes as if they were
+ ### "application/octet-stream".
+
+ ELM ME+ provides way to save both unrecognized subtypes
+ of Image, audio, and video and application/octet-stream on
+ decoded form if content-transfer-encoding is recognized and
+ supported.
+
+ ### Application:
+
+ ### -- Offer the ability to remove either of the quoted-
+ ### printable or base64 encodings defined in this
+ ### document if they were used and put the resulting
+ ### information in a user file.
+
+ Elm ME+ provides way to save subtypes on decoded form if
+ content-transfer-encoding is recognized and supported.
+
+ ### Multipart:
+
+ ### -- Recognize the mixed subtype. Display all relevant
+ ### information on the message level and the body part
+ ### header level and then display or offer to display
+ ### each of the body parts individually.
+
+ Elm ME+ recognizes multipart/mixed. Handling of message depends
+ are all subparts supported or not.
+
+ If subparts are unrecognized and elmrc option "pagemultipart"
+ is OFF (default OFF), metamail is available and elmrc option
+ "metamail" is not value "none", mail on that case is passed to
+ metamail. So behauviour depends of metamail on that case.
+
+ On some conditions subparts is passed to external program using
+ ELM ME+'s internal mailcap parser.
+
+
+ ### -- Recognize the "alternative" subtype, and avoid
+ ### showing the user redundant parts of
+ ### multipart/alternative mail.
+
+ Elm ME+ recognizes multipart/alternative. Handling of message
+ depends are all or some subparts supported or not. Elm ME+
+ may either itself show multipart/alternative message or pass
+ it to metamail (and perhaps on some conditions to external
+ program via using it's internal mailcap parser.)
+
+ When Elm ME+ handles itself multipart/alternative, it shows
+ only one subpart from it.
+
+ Also if metamail is called, it shows only one subpart from
+ multipart/alternative.
+
+ ### -- Recognize the "multipart/digest" subtype,
+ ### specifically using "message/rfc822" rather than
+ ### "text/plain" as the default media type for body parts
+ ### inside "multipart/digest" entities.
+
+ Elm ME+ recognizes multipart/mixed. Handling of message depends
+ are all subparts supported or not.
+
+ Elm ME+ treats "message/rfc822" as default media type for
+ subtypes instead of "text/plain". Othervise "multipart/digest"
+ is basically handled same way than "multipart/mixed".
+
+ ### -- Treat any unrecognized subtypes as if they were
+ ### "mixed".
+
+ If elmrc option "pagemultipart" is OFF (default OFF), metamail
+ is available and elmrc option "metamail" is not value "none",
+ mail on that case is passed to metamail.
+
+ On some conditions mail is passed to external program via using
+ it's internal mailcap parser.
+
+ Otherwise mail is treated as "multipart/mixed."
+
+ ### Message:
+
+ ### -- Recognize and display at least the RFC822 message
+ ### encapsulation (message/rfc822) in such a way as to
+ ### preserve any recursive structure, that is, displaying
+ ### or offering to display the encapsulated data in
+ ### accordance with its media type.
+
+ Elm ME+ recognizes message/rfc822. Handling of message depends
+ are all subparts of recurssive structure supported or not.
+
+ ### -- Treat any unrecognized subtypes as if they were
+ ### "application/octet-stream".
+
+ Elm ME+ recognizes multipart/mixed. Handling of message depends
+ are all subparts supported or not.
+
+ If subparts are unrecognized and elmrc option "pagemultipart"
+ is OFF (default OFF), metamail is available and elmrc option
+ "metamail" is not value "none", mail on that case is passed to
+ metamail. So behauviour depends of metamail on that case.
+
+ On some conditions subparts is passed to external program using
+ ELM ME+'s internal mailcap parser.
+
+ ### (7) Upon encountering any unrecognized Content-Type field,
+ ### an implementation must treat it as if it had a media
+ ### type of "application/octet-stream" with no parameter
+ ### sub-arguments. How such data are handled is up to an
+ ### implementation, but likely options for handling such
+ ### unrecognized data include offering the user to write it
+ ### into a file (decoded from its mail transport format) or
+ ### offering the user to name a program to which the
+ ### decoded data should be passed as input.
+
+ ELM ME+ provides way to save unrecognized subtypes on decoded form
+ if content-transfer-encoding is recognized and supported.
+
+ If content-type is unrecognized and elmrc option "pagemultipart"
+ is OFF (default OFF), metamail is available and elmrc option
+ "metamail" is not value "none", mail on that case is passed to
+ metamail. So behauviour depends of metamail on that case.
+
+ On some conditions part is passed to external program using
+ ELM ME+'s internal mailcap parser.
+
+ Elm ME+ do not offer the user to name a program to which the
+ decoded data should be passed as input. Except via mailcap
+ mechanism.
+
+ ### (8) Conformant user agents are required, if they provide
+ ### non-standard support for non-MIME messages employing
+ ### character sets other than US-ASCII, to do so on
+ ### received messages only. Conforming user agents must not
+ ### send non-MIME messages containing anything other than
+ ### US-ASCII text.
+
+ ### In particular, the use of non-US-ASCII text in mail
+ ### messages without a MIME-Version field is strongly
+ ### discouraged as it impedes interoperability when sending
+ ### messages between regions with different localization
+ ### conventions. Conforming user agents MUST include proper
+ ### MIME labelling when sending anything other than plain
+ ### text in the US-ASCII character set.
+
+ 1) If Elm ME+ is mailing of form
+
+ Content-Type: mailform
+
+ it may include other than US-ASCII text and it is
+ non-MIME message (it is uncluear can be that format
+ invoked.)
+
+ ### In addition, non-MIME user agents should be upgraded if
+ ### at all possible to include appropriate MIME header
+ ### information in the messages they send even if nothing
+ ### else in MIME is supported. This upgrade will have
+ ### little, if any, effect on non-MIME recipients and will
+ ### aid MIME in correctly displaying such messages. It
+ ### also provides a smooth transition path to eventual
+ ### adoption of other MIME capabilities.
+
+ (Seems irrelevant.)
+
+ ### (9) Conforming user agents must ensure that any string of
+ ### non-white-space printable US-ASCII characters within a
+ ### "*text" or "*ctext" that begins with "=?" and ends with
+ ### "?=" be a valid encoded-word. ("begins" means: At the
+ ### start of the field-body or immediately following
+ ### linear-white-space; "ends" means: At the end of the
+ ### field-body or immediately preceding linear-white-
+ ### space.) In addition, any "word" within a "phrase" that
+ ### begins with "=?" and ends with "?=" must be a valid
+ ### encoded-word.
+
+ 1) This is not done if Elm ME+ is mailing of form
+
+ Content-Type: mailform
+
+ (it is uncluear can be that format invoked.)
+
+ 2) This is not done, if elmrc option "nohdrencoding"
+ have value ON (default OFF.)
+
+ Otherwise it is believed, that this is ensured.
+
+ ### (10) Conforming user agents must be able to distinguish
+ ### encoded-words from "text", "ctext", or "word"s,
+ ### according to the rules in section 4, anytime they
+ ### appear in appropriate places in message headers. It
+ ### must support both the "B" and "Q" encodings for any
+ ### character set which it supports.
+
+ 1) This is not done if X-ELM-OSV: -header includes paramater
+ no-hdr-encoding=1. That paramater and header is added by
+ Elm ME+ on mailing, if elmrc option "nohdrencoding"
+ have value ON (default OFF.)
+
+ ( Actually header reads as
+ X-ELM-OSV: (Our standard violations)
+ )
+
+ 2) That is not done if message have not MIME-Version header
+ and elmrc option "require-mime-version-for-hdr-encoding"
+ have value ON (default OFF.)
+
+ Otherwise it is believed that this is done. However that
+ requires quite complete parser for mail headers so that
+ "*text" and "*ctext" are regognized correctly and that
+ decoding is not tried on other places.
+
+ ### The program must be
+ ### able to display the unencoded text if the character set
+ ### is "US-ASCII".
+
+ It is possible define or redefine charset names of configuration
+ file. With sufficient broken redefination of charset US-ASCII,
+ this is not done.
+
+ Otherwise this is done.
+
+ ### For the ISO-8859-* character sets, the
+ ### mail reading program must at least be able to display
+ ### the characters which are also in the US-ASCII set.
+
+ There is defination for existing "ISO-8859-*" character sets
+ so that these treated as superset of US-ASCII. It is possible
+ define or redefine charset names of configuration file. With
+ sufficient broken defination or redefination of some ISO-8859-*
+ set that this is not true.
+
+ If "ISO-8859-*" character sets is not defined and elmrc
+ option "auto-iso-8859" is ON (default ON), given charset is
+ automatically defined to be superset of OS-ASCII.
+
Index: elm2.4.ME+.110-cvs/src/alias.c
*** elm2.4.ME+.109/src/alias.c Fri Sep 5 23:33:17 2003
--- elm2.4.ME+.110-cvs/src/alias.c Sun Dec 14 11:55:42 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.25 2003/08/31 10:53:57 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.27 2003/12/14 09:55:42 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 95,100 ****
--- 95,103 ----
*

* Also, parse the data files into memory if needed
*/
+

***************
*** 721,726 ****
--- 733,754 ----
strfcpy(fname,user_text_file,sizeof fname);

save_file_stats(fname);
+
+ err = can_open(fname, "a");
+ if (err) {

--- 829,895 ----

save_file_stats(fname);

+ err = can_open(fname, "r");
+ if (err) {

Index: elm2.4.ME+.110-cvs/src/attach_menu.c
*** elm2.4.ME+.109/src/attach_menu.c Sat Nov 15 18:19:06 2003
--- elm2.4.ME+.110-cvs/src/attach_menu.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.54 2003/11/11 16:18:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.55 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 1574,1579 ****
--- 1574,1584 ----
p,i));
if (i == 0) {

+
+ int err = can_open(user_mime_types, "r");
+ if (err)


+ continue;
+
/* First try the user's mime.types file */

fp = fopen (user_mime_types, "r");

Index: elm2.4.ME+.110-cvs/src/editmsg.c
*** elm2.4.ME+.109/src/editmsg.c Sun Oct 12 12:48:03 2003
--- elm2.4.ME+.110-cvs/src/editmsg.c Sat Nov 29 14:51:36 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.35 2003/10/11 13:04:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.37 2003/11/29 12:51:36 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 588,600 ****
char linebuf[1024];

FILE *tmpfp = safeopen_rdwr(filename2);
! FILE *f= fopen(filename,"r");

if (!f || !tmpfp) {
! if (!tmpfp)
! free(tmpfp);
! if (!f)
! free(f);
return_value = 1;
goto fail;
}
--- 588,612 ----
char linebuf[1024];

FILE *tmpfp = safeopen_rdwr(filename2);
! FILE *f;
!

! int err = can_open(filename,"r");
!
! if (err) {


! if (tmpfp)
! fclose(tmpfp);
!

! return_value = 1;


! goto fail;
! }
!

! f = fopen(filename,"r");

if (!f || !tmpfp) {
! if (tmpfp)
! fclose(tmpfp);
! if (f)
! fclose(f);
return_value = 1;
goto fail;
}
***************
*** 651,663 ****

if (filename2 != filename) {
char linebuf[1024];

! FILE *tmpfp = fopen(filename,"w");
! FILE *f= fopen(filename2,"r");

if (!f || !tmpfp) {
! if (!tmpfp)
free(tmpfp);
! if (!f)
free(f);
return_value = 1;
goto fail;
--- 663,685 ----

if (filename2 != filename) {
char linebuf[1024];

! FILE *tmpfp;
! FILE *f;
! int err = can_open(filename,"w");

! int err2 = can_open(filename2,"r");
!
! if (err || err2) {
! return_value = 1;


! goto fail;
! }
!

! tmpfp = fopen(filename,"w");
! f= fopen(filename2,"r");

if (!f || !tmpfp) {
! if (tmpfp)
free(tmpfp);
! if (f)
free(f);
return_value = 1;
goto fail;
***************
*** 1207,1218 ****
--- 1229,1249 ----
{
char buffer[LONG_STRING];
int i,len;

+ int err = can_open(I->builtin->filename, "r");

+ if (err) {


+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFile,
+ "Can't open %s!"),

+ I->builtin->filename, error_description(err));


+ return 0;
+ }
+

if (I->builtin->edit_fd) {
fclose(I->builtin->edit_fd);
I->builtin->edit_fd = NULL;
}

+
if ((I->builtin->edit_fd = fopen(I->builtin->filename,
"r")) == NULL) {
int err = errno;

Index: elm2.4.ME+.110-cvs/src/elm.c
*** elm2.4.ME+.109/src/elm.c Sat Nov 15 18:19:06 2003
--- elm2.4.ME+.110-cvs/src/elm.c Sun Nov 23 20:12:43 2003
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elm.c,v 1.59 2003/11/10 20:37:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.59 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.60 2003/11/23 18:12:43 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.60 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
***************
*** 993,998 ****
--- 993,999 ----
}
send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
(batch_only ? NO : allow_forms), current_mailbox);
+
leave(0, &current_mailbox);
} else if (check_only) {
do_check_only(to_whom);

Index: elm2.4.ME+.110-cvs/src/file_util.c
*** elm2.4.ME+.109/src/file_util.c Tue Aug 5 10:27:06 2003
--- elm2.4.ME+.110-cvs/src/file_util.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.19 2003/07/29 18:46:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.20 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 65,70 ****
--- 65,80 ----
char buffer[VERY_LONG_STRING];
int len;

+ int err = can_open(filename, "r");
+

+ if (err) {
+ DPRINT(Debug,1,(&Debug,

+ "Error: could not open %s for reading (append) -- can_open\n",
+ filename));


+ return(1);
+
+ }
+
if ((my_fd = fopen(filename, "r")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Error: could not open %s for reading (append)\n", filename));

Index: elm2.4.ME+.110-cvs/src/forms.c
*** elm2.4.ME+.109/src/forms.c Tue Aug 5 10:27:06 2003
--- elm2.4.ME+.110-cvs/src/forms.c Wed Nov 26 19:16:55 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forms.c,v 1.17 2003/07/29 18:46:19 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forms.c,v 1.18 2003/11/26 17:16:55 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 63,74 ****

FILE *form;
char buffer[SLEN];
! register int field_count = 0;

if ((form = fopen(filename, "r")) == NULL) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! error_description(errno), filename);
return -1;
}

--- 63,84 ----

FILE *form;
char buffer[SLEN];

! int field_count = 0;
!
! int err = can_open(filename, "r");
! if (err) {


! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
! "Error %s trying to open %s to check fields!"),
! error_description(err), filename);
! return -1;
! }
!

if ((form = fopen(filename, "r")) == NULL) {

+ int err = errno;

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! error_description(err), filename);
return -1;
}

***************

*** 98,103 ****
--- 108,121 ----
DPRINT(Debug,4, (&Debug, "Formatting form file '%s'\n", filename));



/** first off, let's open the files... **/

+
+ err = can_open(filename, "r");
+ if (err) {

+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmCantReadMessageToValidate,
+ "Can't read the message to validate the form!"));
+ return -1;
+ }

if ((form = fopen(filename, "r")) == NULL) {
err = errno;

Index: elm2.4.ME+.110-cvs/src/hdrconfg.c
*** elm2.4.ME+.109/src/hdrconfg.c Sun Oct 12 12:48:03 2003
--- elm2.4.ME+.110-cvs/src/hdrconfg.c Wed Nov 26 19:16:56 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.33 2003/10/11 13:25:27 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.34 2003/11/26 17:16:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 554,559 ****
--- 554,560 ----
char buffer1[32*1024];
int stat;
int c;
+ int err;

if (in_string(editor, "%s"))
buffer = elm_message(FRM(editor),
***************
*** 576,582 ****
not with edit_charset (system_charset)
*/

-
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditComment,

"# Headers are automatically converted from %s charset and not need encoded\n"),

--- 577,582 ----
***************
*** 594,600 ****

}

-
add_addr_header(F,edit_charset,encoding_supported,

"From", & headers->from);

add_addr_header(F,edit_charset,encoding_supported,
--- 594,599 ----
***************
*** 633,638 ****
--- 632,644 ----
goto fail2;
}
Raw(ON);


+
+ err = can_open(filename,"r");
+ if (err) {

+ lib_error(FRM("%s: %s"),filename,err);
+
+ goto fail1;
+ }

F = fopen(filename,"r");

if (!F) {
Index: elm2.4.ME+.110-cvs/src/help.c
*** elm2.4.ME+.109/src/help.c Tue Aug 5 10:27:06 2003
--- elm2.4.ME+.110-cvs/src/help.c Wed Nov 26 19:16:56 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.13 2003/07/29 18:46:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.14 2003/11/26 17:16:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 381,391 ****
static int display_file(file)
char *file;
{
! /*** Display file to screen ***/
!
! FILE *fileptr;
! int lines=0;
! char buffer[SLEN];

if ((fileptr = fopen(file,"r")) == NULL) {
DPRINT(Debug,1,
--- 381,403 ----
static int display_file(file)
char *file;
{
! /*** Display file to screen ***/
!
! FILE *fileptr;
! int lines=0;
! char buffer[SLEN];
!
! /* This routine is used to print helpfiles, which
! are not user writable directory, sho that is not actually

! problem */
! int err = can_open(file,"r");
!

! if (err) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmHelpCouldntOpenFile,
! "Couldn't open file %s."),
! file);
! return(FALSE);
! }

if ((fileptr = fopen(file,"r")) == NULL) {
DPRINT(Debug,1,

Index: elm2.4.ME+.110-cvs/src/leavembox.c
*** elm2.4.ME+.109/src/leavembox.c Sat Aug 16 09:58:21 2003
--- elm2.4.ME+.110-cvs/src/leavembox.c Fri Dec 12 22:19:39 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.38 2003/08/15 12:06:07 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.39 2003/12/12 20:19:39 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************

***************
*** 1151,1156 ****
--- 1151,1160 ----
goto cleanup;
}
return_value = 1;
+
+
+ /* Clear action message */
+ lib_error(FRM(""));

cleanup:
if (recv_writeptr) /* If not done ealrier ... */
Index: elm2.4.ME+.110-cvs/src/limit.c
*** elm2.4.ME+.109/src/limit.c Fri Sep 5 23:33:17 2003
--- elm2.4.ME+.110-cvs/src/limit.c Sun Dec 14 16:05:12 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: limit.c,v 1.20 2003/09/03 09:16:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: limit.c,v 1.23 2003/12/14 14:05:12 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 267,274 ****
limit_by_string_subject(temp,get_selected(mailbox)||(complx&&iter!=0),
mailbox);
free_string(&temp);
! }
! else {
if ((p = index(c, ' ')) != NULL)
*p = '\0';
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 267,282 ----
limit_by_string_subject(temp,get_selected(mailbox)||(complx&&iter!=0),
mailbox);
free_string(&temp);
! } else if ((p = index(c, ':')) != NULL &&
! isspace(p[1])) {
!
! *p = '\0';
!
! limit_by_header(c, buf2,
! get_selected(mailbox)||(complx&&iter!=0),
! mailbox);
!
! } else {
if ((p = index(c, ' ')) != NULL)
*p = '\0';
lib_error(CATGETS(elm_msg_cat, ElmSet,

***************
*** 426,432 ****
walk;
walk = walk->next_this_header) {

! if (in_string(shift_lower(walk->body),value))
match++;
}
delete_headers(&all_headers);

--- 434,442 ----


walk;
walk = walk->next_this_header) {

! if (!value)
! match++;


! else if (in_string(shift_lower(walk->body),value))
match++;
}
delete_headers(&all_headers);

Index: elm2.4.ME+.110-cvs/src/mailmsg2.c
*** elm2.4.ME+.109/src/mailmsg2.c Sun Oct 12 12:48:03 2003
--- elm2.4.ME+.110-cvs/src/mailmsg2.c Wed Nov 26 19:16:56 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.70 2003/10/05 16:07:28 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.70 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.71 2003/11/26 17:16:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 248,253 ****
--- 248,266 ----
/** if there is an included file, copy it into the temp file **/
if (*included_file) {
FILE *input;

+
+ int err = can_open(included_file,"r");
+ if (err) {


+ DPRINT(Debug,1,(&Debug,
+ "Can't open included file %s (cam_open). Failed with error %s (mail)\n",
+ included_file, error_description(errno)));
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenFile,
+ "Could not open file %s."),
+ included_file);
+
+ return(need_redraw);
+ }
+
if ((input = fopen(included_file,"r")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Can't open included file %s. Failed with error %s (mail)\n",
***************
*** 483,488 ****
--- 496,502 ----

do { /* So we can return here if check_for_multipart() fails
* - K E H <hurtt...@ozone.FMI.FI> */
+
code = 0;
reask_verify = 0;

***************

*** 511,516 ****
--- 525,542 ----
/* so we can mark the reply flag */
if (0 == code)
me_retcode = 1;
+ }
+
+ err = can_open(cur_editfile,"r+");


+ if (err) {
+ DPRINT(Debug,1,(&Debug,

+ "Attempt to open file %s for reading failed with error %s (mail) -- can_open\n",
+ cur_editfile, error_description(err)));
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenReply,
+ "Could not open reply file (%s)."),
+ error_description(err));
+
+ return need_redraw;
}

if ((reply = fopen(cur_editfile,"r+")) == NULL) {

Index: elm2.4.ME+.110-cvs/src/messages/header_alloc.c
*** elm2.4.ME+.109/src/messages/header_alloc.c Sat Nov 15 18:19:06 2003
--- elm2.4.ME+.110-cvs/src/messages/header_alloc.c Sat Dec 13 12:14:11 2003
***************
*** 1,8 ****


! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.6 2003/11/10 20:37:46 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************
--- 1,8 ----

! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.7 2003/12/13 10:14:11 hurtta Exp $";


/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************

***************
*** 19,24 ****
--- 19,66 ----

#include "me.h"

DEBUG_VAR(Debug,__FILE__,"messages");
+
+
+ void realloc_headers(storage,current_count)
+ struct current_storage *storage;
+ int current_count;
+ {
+
+ /* Code (indirectly) copied from src/newmbox.c
+ function read_headers()
+ */
+
+ if (current_count >= storage->max_headers) {
+ struct header_rec **new_headers;
+ int new_max;
+
+ new_max = storage->max_headers + KLICK;
+ if (storage->max_headers == 0) {
+ new_headers = (struct header_rec **)
+ safe_malloc(new_max * sizeof(struct header_rec *));
+ } else {
+ new_headers = (struct header_rec **)
+ safe_realloc((char *) storage->headers,
+ new_max * sizeof(struct header_rec *));
+ }
+ storage->headers = new_headers;
+ while (storage->max_headers < new_max)
+ storage->headers[storage->max_headers++] = NULL;
+ }
+ }
+
+ void alloc_header(storage,current_count)
+ struct current_storage *storage;
+ int current_count;
+ {
+ if (storage->headers[current_count] == NULL) {
+ struct header_rec *h = safe_malloc(sizeof(*h));
+
+ header_zero(h);
+ storage->headers[current_count] = h;
+ }
+ }
+

static time_t now = 0;

Index: elm2.4.ME+.110-cvs/src/messages/messages.c
*** elm2.4.ME+.109/src/messages/messages.c Sat Aug 16 09:58:21 2003
--- elm2.4.ME+.110-cvs/src/messages/messages.c Sat Dec 13 12:15:08 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: messages.c,v 1.8 2003/08/14 14:14:23 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: messages.c,v 1.9 2003/12/13 10:15:08 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

***************
*** 11,53 ****
DEBUG_VAR(Debug,__FILE__,"messages");

struct MailboxView * current_mailbox = NULL;
-
- void realloc_headers(storage,current_count)
- struct current_storage *storage;
- int current_count;
- {
- if (current_count >= storage->max_headers) {
- struct header_rec **new_headers;
- int new_max;
-
- new_max = storage->max_headers + KLICK;
- if (storage->max_headers == 0) {
- new_headers = (struct header_rec **)
- safe_malloc(new_max * sizeof(struct header_rec *));
- } else {
- new_headers = (struct header_rec **)
- safe_realloc((char *) storage->headers,
- new_max * sizeof(struct header_rec *));
- }
- storage->headers = new_headers;
- while (storage->max_headers < new_max)
- storage->headers[storage->max_headers++] = NULL;
- }
- }
-
- void alloc_header(storage,current_count)
- struct current_storage *storage;
- int current_count;
- {
- if (storage->headers[current_count] == NULL) {
- struct header_rec *h = safe_malloc(sizeof(*h));
-
- header_zero(h);
- storage->headers[current_count] = h;
- }
- }
-
-

#define MAILBOXVIEW_magic 0xFC00

--- 11,16 ----
Index: elm2.4.ME+.110-cvs/src/save_opts.c
*** elm2.4.ME+.109/src/save_opts.c Tue Aug 5 10:27:06 2003
--- elm2.4.ME+.110-cvs/src/save_opts.c Wed Nov 26 19:16:56 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.23 2003/07/29 18:46:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.24 2003/11/26 17:16:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 65,71 ****

FILE *newelmrc;
char oldfname[SLEN], newfname[SLEN];
!
strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
FRM("%s/%s"),
--- 65,72 ----

FILE *newelmrc;
char oldfname[SLEN], newfname[SLEN];
! int err;
!
strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
FRM("%s/%s"),
***************
*** 92,97 ****
--- 93,106 ----

/** next, open the new .elm/elmrc file... **/

+ err = can_open(newfname, "w");
+ if (err) {


+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
+ "Can't save configuration! Can't write to %s [%s]."),
+ newfname, error_description(errno));

+ return;
+ }
+

if ((newelmrc = fopen(newfname, "w")) == NULL) {
lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
"Can't save configuration! Can't write to %s [%s]."),

Index: elm2.4.ME+.110-cvs/src/utils.c
*** elm2.4.ME+.109/src/utils.c Tue Aug 5 10:27:06 2003
--- elm2.4.ME+.110-cvs/src/utils.c Sun Nov 23 20:12:43 2003
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: utils.c,v 1.25 2003/07/29 18:46:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: utils.c,v 1.26 2003/11/23 18:12:43 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

/* Set terminal title to "Elm: exiting" ... can be called from
signal handler


--- 254,263 ----
SIGDPRINT(Debug,2,
(&Debug,
"\nLeaving mailer from signal handler (leave)\n"));
! else {
SIGDPRINT(Debug,2, (&Debug,
"\nLeaving mailer normally (leave)\n"));
! }

/* Set terminal title to "Elm: exiting" ... can be called from
signal handler

Kari E. Hurtta

unread,
Jan 2, 2004, 11:16:10 AM1/2/04
to
Archive-name: elm2.4ME+/PL110a

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

file elm-2.4ME+PL110a.patch.gz

via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL110a.patch.gz >
via WWW.


For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL110a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Notice: ME+ series is not official Elm.
This patch is agaist Elm 2.4ME+ PL110 (25) --------------------------------
Index: elm2.4.ME+.110a-cvs/hdrs/patchlevel.h
Prereq: 1103000000
*** elm2.4.ME+.110/hdrs/patchlevel.h 2003-12-17 20:22:19.000000000 +0200
--- elm2.4.ME+.110a-cvs/hdrs/patchlevel.h 2004-01-02 15:41:09.000000000 +0200
***************
*** 1,9 ****


! #define PATCHLEVEL "110 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.110
*/
! #define LAST_REPORT_TIME 1103000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"
! #define VERS_DATE "Dec, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Dec, 2003"

--- 1,9 ----
! #define PATCHLEVEL "110a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.110
*/
! #define LAST_REPORT_TIME 1104500000


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

! #define VERS_DATE "Jan, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jan, 2004"
Index: elm2.4.ME+.110a-cvs/README.ME+
*** elm2.4.ME+.110/README.ME+ 2003-12-17 20:22:19.000000000 +0200
--- elm2.4.ME+.110a-cvs/README.ME+ 2004-01-02 13:33:08.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.685 2003/12/17 14:32:02 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.695 2004/01/02 11:33:08 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,18 ****
--- 13,51 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL110a (25) compared with Elm2.4ME+ PL110 (25)
+ ------------------------------------------------------------------
+

+ [ This is out of branch patch. ]
+

+ SUMMARY: This patch fixes case, where output of pgp/gpg was
+ not shown sometimes (on non-MIME messages),
+ case where O)verride charset was ignored when
+ displaying attachment (via MIME structure Menu
+ -menu), and case where To: address was not shown
+ on message list when showto elmrc option was set.
+
+
+ - Fix incorrect test on copy_pgp() -- length test should be
+ applied to original data -- not a output of pgp (or gpg).
+
+ - Add similar handling of interrupted read to copy_pgp()
+ than is on pgp_decode()
+
+ - Handle raw mode of terminal and status pg pgp/gpg on
+ copy_pgp() wame way than on pgp_decode()
+
+ - Make O)verride charset also be effective, when viewing
+ attachment via MIME structure Menu -menu.
+
+ - Elm was not displaying To: -address on some situations
+ when showto was set, but acted instead as recipient was
+ sender (or as mail was directed to user.)
+ Possibly reported by: Sivasankar Chander <si...@dias.ath.cx>
+
+ ( Perhaps showto should ignore case where sender is
+ recipient? )


+
Changes of Elm2.4ME+ PL110 (25) compared with Elm2.4ME+ PL109 (25)

------------------------------------------------------------------

***************
*** 20,139 ****


Undo Elm2.4ME+ PL109a (25) and Elm2.4ME+ PL109b (25) patches
before applying this patch.

! SUMMARY: This release collects patches PL109a and PL109b.


Security fixes introduced in PL109S are included.

! Bogus charset initialization error caused by
! missing global elm.mimecharsets file is fixed.
! Some enchancements to l)imit command are
! introduced. This release also fixes extra

"[Keeping all messages.]" messages introduced

on PL109a fix. File MIME.txt compares Elm ME+

to MIME conformace criteria.

! - This file states "But anyway, Elm will never be MIME

Conformant." Added file MIME.txt which enumerates RFC

2049 requirements and look which reuirements are not

followed and on what conditions.

- Change some Raw(OFF) to Raw_OFF() on leaving routines

! of src/utils.c
! > Also clear "[Keeping all messages.]" messages
! after leaving folder so that these are not
! printed because of Raw_OFF();

! - Try fix
! MBX PANIC in imap.c:2578:end_imap_command


when IMAP / TLS connection is closed by server.

! - Initialization of internal-mailcaps and

metamail-mailcaps did not worked correctly.

! Moved initialization before reading of global
! elm.rc.


Problem noted by: Xavi Serrano <xser...@ac.upc.es>

! - On def_prompt_handler() final newline should be
! printed to terminal as prompt is printed (instead
! of stderr.)
!
! - Fix segmentation violation on l)mit command
! "header subject" (ie. without ':'). This is now
! interpreted to be all mails which have given header
! name.

! - l)imit command "aabbc: yyy" work now as
! "header aabbc: yyy"

! - User alias file was not opened, if system alias file
existed.

! Fix potential security problems on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()
!
! - Avoid error message like following
! Elm: Unable to map en_US locale (LC_CTYPE) to MIME charset.
! Codeset name ISO-8859-15 was unknown. Treating ISO-8859-15 as MIME name.
! Check /usr/local/test/lib/elm.mimecharsets or .../.elm/mime.charsets
! Problem with locale (system character set)! Elm ME+ will behave erratically.


on case where elm.mimecharsets is not installed. Codeset

! match was not used if either file elm.mimecharsets or
! mime.charsets existed.
!
New files:
! MIME.txt



Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)

-------------------------------------------------------------------



[ This is out of branch patch. ]

! SUMMARY: This patch fixes segmentation violation on
! l)imit command and problem where user alias
! was not opened, if system alias file existed.

! - Fix segmentation violation on l)mit command
! "header subject" (ie. without ':').

! - User alias file was not opened, if system alias file
! existed. Fixed short circuit evalution.




Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

--- 53,172 ----


Undo Elm2.4ME+ PL109a (25) and Elm2.4ME+ PL109b (25) patches
before applying this patch.

! SUMMARY: This release collects patches PL109a and PL109b.


Security fixes introduced in PL109S are included.

! Bogus charset initialization error caused by
! missing global elm.mimecharsets file is fixed.
! Some enchancements to l)imit command are
! introduced. This release also fixes extra

"[Keeping all messages.]" messages introduced

on PL109a fix. File MIME.txt compares Elm ME+

to MIME conformace criteria.

! - This file states "But anyway, Elm will never be MIME

Conformant." Added file MIME.txt which enumerates RFC

2049 requirements and look which reuirements are not

followed and on what conditions.

- Change some Raw(OFF) to Raw_OFF() on leaving routines

! of src/utils.c
! > Also clear "[Keeping all messages.]" messages
! after leaving folder so that these are not
! printed because of Raw_OFF();

! - Try fix
! MBX PANIC in imap.c:2578:end_imap_command


when IMAP / TLS connection is closed by server.

! - Initialization of internal-mailcaps and

metamail-mailcaps did not worked correctly.

! Moved initialization before reading of global
! elm.rc.


Problem noted by: Xavi Serrano <xser...@ac.upc.es>

! - On def_prompt_handler() final newline should be
! printed to terminal as prompt is printed (instead
! of stderr.)
!
! - Fix segmentation violation on l)mit command
! "header subject" (ie. without ':'). This is now
! interpreted to be all mails which have given header
! name.

! - l)imit command "aabbc: yyy" work now as
! "header aabbc: yyy"

! - User alias file was not opened, if system alias file
existed.

! Fix potential security problems on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()
!
! - Avoid error message like following
! Elm: Unable to map en_US locale (LC_CTYPE) to MIME charset.
! Codeset name ISO-8859-15 was unknown. Treating ISO-8859-15 as MIME name.
! Check /usr/local/test/lib/elm.mimecharsets or .../.elm/mime.charsets
! Problem with locale (system character set)! Elm ME+ will behave erratically.


on case where elm.mimecharsets is not installed. Codeset

! match was not used if either file elm.mimecharsets or
! mime.charsets existed.
!
New files:
! MIME.txt



Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)

-------------------------------------------------------------------



[ This is out of branch patch. ]

! SUMMARY: This patch fixes segmentation violation on
! l)imit command and problem where user alias
! was not opened, if system alias file existed.

! - Fix segmentation violation on l)mit command
! "header subject" (ie. without ':').

! - User alias file was not opened, if system alias file
! existed. Fixed short circuit evalution.




Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

***************
*** 143,260 ****



Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

! SUMMARY: This patch address panic when imap server disconnects
! during password prompt, fixes initialization of
! internal-mailcaps and metamail-mailcaps elmrc options
! and fixes some cases where error message was not visible
! because of exiting of Elm ME+. Also security fixes of

Elm2.4ME+ PL109S (25) are included to this patch (it

! is agaist Elm2.4ME+ PL109 (25))
!


- Changed some Raw(OFF) to Raw_OFF() on leaving routines

! of src/utils.c

! - Try fix
! MBX PANIC in imap.c:2578:end_imap_command


when IMAP / TLS connection is closed by server.

! - Initialization of internal-mailcaps and

metamail-mailcaps did not worked correctly.

! Moved initialization before reading of global
! elm.rc.


Problem noted by: Xavi Serrano <xser...@ac.upc.es>

! - On def_prompt_handler() final newline should be
! printed to terminal as prompt is printed (instead
! of stderr.)
!
! Fix potential security problems on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()



Changes of Elm2.4ME+ PL109S (25) compared with Elm2.4ME+ PL109 (25)

------------------------------------------------------------------

! Fix potential security problem on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()



Changes of Elm2.4ME+ PL109 (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

--- 176,293 ----



Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

! SUMMARY: This patch address panic when imap server disconnects
! during password prompt, fixes initialization of
! internal-mailcaps and metamail-mailcaps elmrc options
! and fixes some cases where error message was not visible
! because of exiting of Elm ME+. Also security fixes of

Elm2.4ME+ PL109S (25) are included to this patch (it

! is agaist Elm2.4ME+ PL109 (25))
!


- Changed some Raw(OFF) to Raw_OFF() on leaving routines

! of src/utils.c

! - Try fix
! MBX PANIC in imap.c:2578:end_imap_command


when IMAP / TLS connection is closed by server.

! - Initialization of internal-mailcaps and

metamail-mailcaps did not worked correctly.

! Moved initialization before reading of global
! elm.rc.


Problem noted by: Xavi Serrano <xser...@ac.upc.es>

! - On def_prompt_handler() final newline should be
! printed to terminal as prompt is printed (instead
! of stderr.)
!
! Fix potential security problems on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()



Changes of Elm2.4ME+ PL109S (25) compared with Elm2.4ME+ PL109 (25)

------------------------------------------------------------------

! Fix potential security problem on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()



Changes of Elm2.4ME+ PL109 (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

***************
*** 9425,9431 ****
internal-mailcap-trusted-programs MIME
internal-mailcap-prompt-trusted MIME
iso646-charsets MIME
! keeppassfor PGP
local-fast-lookup -
local-fs-charset -
lock-in-copy -
--- 9458,9464 ----
internal-mailcap-trusted-programs MIME
internal-mailcap-prompt-trusted MIME
iso646-charsets MIME
! keeppassfor PGP (new on Elm 2.4 PL24ME)
local-fast-lookup -
local-fs-charset -
lock-in-copy -
***************
*** 9437,9449 ****
metamail-mailcaps MIME
menu-display-host -
mimebodykeywords MIME
! mimeforward MIME
! noencoding MIME
nohdrencoding MIME
noheaderfwd -
pagealternative MIME
page-known-charsets MIME
! pagemultipart MIME
pagesigned MIME
pgp2 PGP
pgp5 PGP
--- 9470,9482 ----
metamail-mailcaps MIME
menu-display-host -
mimebodykeywords MIME
! mimeforward MIME (new on Elm 2.4 PL24ME)
! noencoding MIME (new on Elm 2.4 PL24ME)
nohdrencoding MIME
noheaderfwd -
pagealternative MIME
page-known-charsets MIME
! pagemultipart MIME (new on Elm 2.4 PL24ME)
pagesigned MIME
pgp2 PGP
pgp5 PGP
***************
*** 9458,9468 ****
require-mime-version-for-hdr-encoding MIME
show-header-errors (MIME)
showpgppreamble PGP
sort-thread-max-time -
text-charset MIME
unidata MIME / SYSTEM
use-library -
! usepgppass PGP
utf7-encode-optional MIME

Obsolete elmrc variables
--- 9491,9502 ----
require-mime-version-for-hdr-encoding MIME
show-header-errors (MIME)
showpgppreamble PGP
+ showto - (new on Elm 2.4 PL24ME)
sort-thread-max-time -
text-charset MIME
unidata MIME / SYSTEM
use-library -
! usepgppass PGP (new on Elm 2.4 PL24ME)
utf7-encode-optional MIME

Obsolete elmrc variables
Index: elm2.4.ME+.110a-cvs/doc/elm.1
*** elm2.4.ME+.110/doc/elm.1 2003-08-11 11:21:18.000000000 +0300
--- elm2.4.ME+.110a-cvs/doc/elm.1 2003-12-31 15:50:16.000000000 +0200
***************
*** 258,264 ****


.SH BUG REPORTS TO
Kari Hurtta hurtt...@ozone.fmi.fi
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2003 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
--- 258,264 ----


.SH BUG REPORTS TO
Kari Hurtta hurtt...@ozone.fmi.fi
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
Index: elm2.4.ME+.110a-cvs/lib/dispaddr.c
*** elm2.4.ME+.110/lib/dispaddr.c 2002-06-06 18:55:56.000000000 +0300
--- elm2.4.ME+.110a-cvs/lib/dispaddr.c 2004-01-02 12:37:01.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.14 2002/06/01 12:58:17 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.15 2004/01/02 10:37:01 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 75,88 ****
break;

for (ptr = h->to; ptr && ptr->addr && ptr->fullname; ptr++)
! if (okay_address_l(ptr, h->from))
okay_to = 0;
!

for (ptr = h->cc; ptr && ptr->addr && ptr->fullname; ptr++)
! if (!okay_address_l(ptr, h->from))
okay_cc = 0;
!

DPRINT(Debug,6,(&Debug,
"DisplayAddress: okay_to=%d, okay_cc=%d, I have sender=%s (%s)\n",
--- 75,95 ----
break;

for (ptr = h->to; ptr && ptr->addr && ptr->fullname; ptr++)
! if (!okay_address_l(ptr, h->from)) {
! DPRINT(Debug,6,(&Debug,
! "DisplayAddress: Sender is recipient (To): %s\n",
! ptr->addr));
!
okay_to = 0;
! }

for (ptr = h->cc; ptr && ptr->addr && ptr->fullname; ptr++)
! if (!okay_address_l(ptr, h->from)) {
! DPRINT(Debug,6,(&Debug,
! "DisplayAddress: Sender is recipient (Cc): %s\n",
! ptr->addr));
okay_cc = 0;
! }

DPRINT(Debug,6,(&Debug,
"DisplayAddress: okay_to=%d, okay_cc=%d, I have sender=%s (%s)\n",
***************
*** 134,140 ****
remove_control(*f);

DPRINT(Debug,6,(&Debug,
! "DisplayAddress=%d, *f=%S\n",using_to,*f));
return(using_to);
}

--- 141,148 ----
remove_control(*f);

DPRINT(Debug,6,(&Debug,
! "DisplayAddress=%d, *f=%S, showto=%d\n",
! using_to,*f,showto));
return(using_to);
}

Index: elm2.4.ME+.110a-cvs/src/args.c
*** elm2.4.ME+.110/src/args.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.110a-cvs/src/args.c 2003-12-31 15:50:16.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: args.c,v 1.56 2003/07/29 18:46:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.57 2003/12/31 13:50:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 295,301 ****
printf("\n\tBased on Elm 2.4 PL24 - PL25\n\n");

if (i < 3) {
! printf("\t(C) Copyright 1996-2003 Kari Hurtta\n");
printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");
printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}
--- 295,301 ----
printf("\n\tBased on Elm 2.4 PL24 - PL25\n\n");

if (i < 3) {
! printf("\t(C) Copyright 1996-2004 Kari Hurtta\n");
printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");
printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}
Index: elm2.4.ME+.110a-cvs/src/attach_menu.c
*** elm2.4.ME+.110/src/attach_menu.c 2003-12-17 20:22:20.000000000 +0200
--- elm2.4.ME+.110a-cvs/src/attach_menu.c 2004-01-02 10:29:05.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.55 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.56 2004/01/02 08:29:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 616,621 ****
--- 616,623 ----
*/

tmp.header_charset = display_charset;
+ if (hdr)
+ tmp.override_charset = hdr->override_charset;

#ifdef USE_PGP
tmp.pgp = 0;
Index: elm2.4.ME+.110a-cvs/src/fileio.c
*** elm2.4.ME+.110/src/fileio.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.110a-cvs/src/fileio.c 2004-01-01 20:56:55.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.52 2003/08/04 14:58:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fileio.c,v 1.54 2004/01/01 18:56:55 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

******************************************************************************
***************
*** 52,59 ****
enum pgp_version v = pgp2;
enum pgp_version version;
int armor_header = 0;

! int raw = RawState ();

DPRINT(PgpDebug,5,(&PgpDebug,
"copy_pgp called: Need read %d bytes\n",
--- 52,60 ----
enum pgp_version v = pgp2;
enum pgp_version version;
int armor_header = 0;
+ int ret = 1;

! int raw = sr_call_RawState ();

DPRINT(PgpDebug,5,(&PgpDebug,
"copy_pgp called: Need read %d bytes\n",
***************
*** 255,260 ****
--- 256,270 ----
DPRINT(PgpDebug,5,(&PgpDebug,
"copy_pgp: Passed %d bytes to PGP.\n",
body_bytes));
+
+
+ if (body_bytes != current_header->content_length) {
+ DPRINT(PgpDebug,1,(&PgpDebug,
+ "copy_pgp: ERROR: read bytes %d != content-length %d\n",
+ body_bytes,current_header->content_length));
+ ret = 0;
+ }
+
body_bytes = 0;

if (current_header->pgp & PGP_MESSAGE)
***************
*** 269,275 ****
else
state_printf(dest_file,CATGETS(elm_msg_cat, MeSet, MePgpStart,
"-- Start of PGP section.\n"));
!
while (0 < (buf_len = mail_gets(buffer, VERY_LONG_STRING, fpin))) {
body_bytes += buf_len;

--- 279,286 ----
else
state_printf(dest_file,CATGETS(elm_msg_cat, MeSet, MePgpStart,
"-- Start of PGP section.\n"));
!
! retry:
while (0 < (buf_len = mail_gets(buffer, VERY_LONG_STRING, fpin))) {
body_bytes += buf_len;

***************
*** 288,301 ****
goto fail;
}
}
fclose(fpin); fpin = NULL;

if (0 == code)
code = wait_end(&RS,&stat);

! PressAnyKeyToContinue();
if (raw)
! Raw (ON);

if (current_header->pgp & PGP_MESSAGE)
state_printf(dest_file,
--- 299,331 ----
goto fail;
}
}
+
+
+ if (ferror(fpin) && EINTR == errno) {
+ clearerr(fpin);
+ DPRINT(PgpDebug,5,(&PgpDebug,
+ "Reading of result interrupted (EINTR) -- retrying\n"));
+
+ if (0 == code) {
+ code = run_already_done(&RS,&stat);
+ if (0 != code) {
+ DPRINT(PgpDebug,5,(&PgpDebug,
+ "now pgp/gpg is completing\n"));
+ }
+ }
+
+ goto retry;
+ }
+
fclose(fpin); fpin = NULL;

if (0 == code)
code = wait_end(&RS,&stat);

! call_print_status_cooked(&RS,code < 0 ? -code : 0,stat);
!
if (raw)
! sr_call_Raw (ON);

if (current_header->pgp & PGP_MESSAGE)
state_printf(dest_file,
***************
*** 323,338 ****
", PGP failed!") : ".");

DPRINT(PgpDebug,5,(&PgpDebug,
! "copy_pgp: Read %d bytes from PGP.\n",
! body_bytes));

! if (body_bytes != current_header->content_length) {
! DPRINT(PgpDebug,1,(&PgpDebug,
! "copy_pgp: ERROR: read bytes %d != content-length %d\n",
! body_bytes,current_header->content_length));
! return 0;
! }
! return 1;

fail:
if (fpout)
--- 353,363 ----
", PGP failed!") : ".");

DPRINT(PgpDebug,5,(&PgpDebug,
! "copy_pgp=%d: Read %d bytes from PGP.\n",
! ret,body_bytes));

!
! return ret;

fail:
if (fpout)

Kari E. Hurtta

unread,
Jan 2, 2004, 11:19:07 AM1/2/04
to
Archive-name: elm2.4ME+/PL110a.FIXED

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

file elm-2.4ME+PL110a.patch.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL110a.patch.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL110a.patch.gz >
via WWW.


For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL110a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Notice: ME+ series is not official Elm.


This patch is agaist Elm 2.4ME+ PL110 (25) --------------------------------
Index: elm2.4.ME+.110a-cvs/hdrs/patchlevel.h
Prereq: 1103000000
*** elm2.4.ME+.110/hdrs/patchlevel.h 2003-12-17 20:22:19.000000000 +0200
--- elm2.4.ME+.110a-cvs/hdrs/patchlevel.h 2004-01-02 15:41:09.000000000 +0200

***************
*** 1,9 ****


! #define PATCHLEVEL "110 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.110
*/
! #define LAST_REPORT_TIME 1103000000
#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"
! #define VERS_DATE "Dec, 2003" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Dec, 2003"

--- 1,9 ----
! #define PATCHLEVEL "110a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.110
*/
! #define LAST_REPORT_TIME 1104500000


#define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@ozone.FMI.FI>"

! #define VERS_DATE "Jan, 2004" /* for elm -v option */
#define WHAT_STRING \


! "@(#) Version 2.4(ME+), USENET supported version, released Jan, 2004"
Index: elm2.4.ME+.110a-cvs/README.ME+
*** elm2.4.ME+.110/README.ME+ 2003-12-17 20:22:19.000000000 +0200
--- elm2.4.ME+.110a-cvs/README.ME+ 2004-01-02 13:33:08.000000000 +0200

***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.685 2003/12/17 14:32:02 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.695 2004/01/02 11:33:08 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,18 ****
--- 13,51 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL110a (25) compared with Elm2.4ME+ PL110 (25)
+ ------------------------------------------------------------------
+

+ [ This is out of branch patch. ]
+

+ SUMMARY: This patch fixes case, where output of pgp/gpg was
+ not shown sometimes (on non-MIME messages),
+ case where O)verride charset was ignored when
+ displaying attachment (via MIME structure Menu
+ -menu), and case where To: address was not shown
+ on message list when showto elmrc option was set.

+
+

+ - Fix incorrect test on copy_pgp() -- length test should be
+ applied to original data -- not a output of pgp (or gpg).
+
+ - Add similar handling of interrupted read to copy_pgp()
+ than is on pgp_decode()
+
+ - Handle raw mode of terminal and status pg pgp/gpg on
+ copy_pgp() wame way than on pgp_decode()
+
+ - Make O)verride charset also be effective, when viewing
+ attachment via MIME structure Menu -menu.
+
+ - Elm was not displaying To: -address on some situations
+ when showto was set, but acted instead as recipient was
+ sender (or as mail was directed to user.)
+ Possibly reported by: Sivasankar Chander <si...@dias.ath.cx>
+
+ ( Perhaps showto should ignore case where sender is
+ recipient? )

+
Changes of Elm2.4ME+ PL110 (25) compared with Elm2.4ME+ PL109 (25)

------------------------------------------------------------------

***************
*** 20,139 ****

Undo Elm2.4ME+ PL109a (25) and Elm2.4ME+ PL109b (25) patches
before applying this patch.

! SUMMARY: This release collects patches PL109a and PL109b.


Security fixes introduced in PL109S are included.

! Bogus charset initialization error caused by
! missing global elm.mimecharsets file is fixed.
! Some enchancements to l)imit command are
! introduced. This release also fixes extra

"[Keeping all messages.]" messages introduced

on PL109a fix. File MIME.txt compares Elm ME+

to MIME conformace criteria.

! - This file states "But anyway, Elm will never be MIME

Conformant." Added file MIME.txt which enumerates RFC

2049 requirements and look which reuirements are not

followed and on what conditions.

- Change some Raw(OFF) to Raw_OFF() on leaving routines

! of src/utils.c
! > Also clear "[Keeping all messages.]" messages
! after leaving folder so that these are not
! printed because of Raw_OFF();

! - Try fix

! MBX PANIC in imap.c:2578:end_imap_command


when IMAP / TLS connection is closed by server.

! - Initialization of internal-mailcaps and

metamail-mailcaps did not worked correctly.

! Moved initialization before reading of global
! elm.rc.


Problem noted by: Xavi Serrano <xser...@ac.upc.es>

! Problem with locale (system character set)! Elm ME+ will behave erratically.


on case where elm.mimecharsets is not installed. Codeset

! match was not used if either file elm.mimecharsets or
! mime.charsets existed.
!
New files:
! MIME.txt

Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)

-------------------------------------------------------------------



[ This is out of branch patch. ]

! SUMMARY: This patch fixes segmentation violation on
! l)imit command and problem where user alias
! was not opened, if system alias file existed.

! - Fix segmentation violation on l)mit command
! "header subject" (ie. without ':').

! - User alias file was not opened, if system alias file
! existed. Fixed short circuit evalution.




Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

--- 53,172 ----


Undo Elm2.4ME+ PL109a (25) and Elm2.4ME+ PL109b (25) patches
before applying this patch.

! SUMMARY: This release collects patches PL109a and PL109b.


Security fixes introduced in PL109S are included.

! Bogus charset initialization error caused by
! missing global elm.mimecharsets file is fixed.
! Some enchancements to l)imit command are
! introduced. This release also fixes extra

"[Keeping all messages.]" messages introduced

on PL109a fix. File MIME.txt compares Elm ME+

to MIME conformace criteria.

! - This file states "But anyway, Elm will never be MIME

Conformant." Added file MIME.txt which enumerates RFC

2049 requirements and look which reuirements are not

followed and on what conditions.

- Change some Raw(OFF) to Raw_OFF() on leaving routines

! of src/utils.c
! > Also clear "[Keeping all messages.]" messages
! after leaving folder so that these are not
! printed because of Raw_OFF();

! - Try fix

! MBX PANIC in imap.c:2578:end_imap_command


when IMAP / TLS connection is closed by server.

! - Initialization of internal-mailcaps and

metamail-mailcaps did not worked correctly.

! Moved initialization before reading of global
! elm.rc.


Problem noted by: Xavi Serrano <xser...@ac.upc.es>

! Problem with locale (system character set)! Elm ME+ will behave erratically.


on case where elm.mimecharsets is not installed. Codeset

! match was not used if either file elm.mimecharsets or
! mime.charsets existed.
!
New files:
! MIME.txt

Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)

-------------------------------------------------------------------



[ This is out of branch patch. ]

! SUMMARY: This patch fixes segmentation violation on
! l)imit command and problem where user alias
! was not opened, if system alias file existed.

! - Fix segmentation violation on l)mit command
! "header subject" (ie. without ':').

! - User alias file was not opened, if system alias file
! existed. Fixed short circuit evalution.




Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

***************
*** 143,260 ****



Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

! SUMMARY: This patch address panic when imap server disconnects
! during password prompt, fixes initialization of
! internal-mailcaps and metamail-mailcaps elmrc options
! and fixes some cases where error message was not visible
! because of exiting of Elm ME+. Also security fixes of

Elm2.4ME+ PL109S (25) are included to this patch (it

! is agaist Elm2.4ME+ PL109 (25))
!


- Changed some Raw(OFF) to Raw_OFF() on leaving routines

! of src/utils.c

! - Try fix

! MBX PANIC in imap.c:2578:end_imap_command


when IMAP / TLS connection is closed by server.

! - Initialization of internal-mailcaps and

metamail-mailcaps did not worked correctly.

! Moved initialization before reading of global
! elm.rc.


Problem noted by: Xavi Serrano <xser...@ac.upc.es>

! - On def_prompt_handler() final newline should be
! printed to terminal as prompt is printed (instead
! of stderr.)
!

! Fix potential security problems on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()



Changes of Elm2.4ME+ PL109S (25) compared with Elm2.4ME+ PL109 (25)

------------------------------------------------------------------

! Fix potential security problem on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()



Changes of Elm2.4ME+ PL109 (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

--- 176,293 ----



Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

! SUMMARY: This patch address panic when imap server disconnects
! during password prompt, fixes initialization of
! internal-mailcaps and metamail-mailcaps elmrc options
! and fixes some cases where error message was not visible
! because of exiting of Elm ME+. Also security fixes of

Elm2.4ME+ PL109S (25) are included to this patch (it

! is agaist Elm2.4ME+ PL109 (25))
!


- Changed some Raw(OFF) to Raw_OFF() on leaving routines

! of src/utils.c

! - Try fix

! MBX PANIC in imap.c:2578:end_imap_command


when IMAP / TLS connection is closed by server.

! - Initialization of internal-mailcaps and

metamail-mailcaps did not worked correctly.

! Moved initialization before reading of global
! elm.rc.


Problem noted by: Xavi Serrano <xser...@ac.upc.es>

! - On def_prompt_handler() final newline should be
! printed to terminal as prompt is printed (instead
! of stderr.)
!

! Fix potential security problems on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()



Changes of Elm2.4ME+ PL109S (25) compared with Elm2.4ME+ PL109 (25)

------------------------------------------------------------------

! Fix potential security problem on systems where Elm ME+
! is setgid mail and system do not support Posix saved IDs.
! Check output of 'elm -vvv' if your system have problems:
!
! Have Posix saved IDs: Yes (egid 12)
!
! If this is 'No' and egid is other than your gid, there is
! possibility that Elm ME+ can read or write some files
! which are readable or writable by group mail, when it should
! not access them. Note that these fixes can not be complete.
! There is race condition at least. Closing that race condition
! requires that Elm ME+ drop privileges temporary. For that
! Elm ME+ uses Posix saved IDs.
!
! - SECURITY: Add can_open() test to load_locale_map()
! - SECURITY: Add can_open() test to copy1()
! - SECURITY: Add can_open() test to parse_iso2022_map()
! - SECURITY: Add can_open() test to do_newalias()
! - SECURITY: Add can_open() test to dbz_fresh()
! - SECURITY: Add can_open() test to dbz_again()
! - SECURITY: Add can_open() test to dbz_open()
! - SECURITY: Add can_open() test to latebase()
! - SECURITY: Add can_open() test to read_rc_file()
! - SECURITY: Add can_open() test to parse_service_entries()
! - SECURITY: Add can_open() test to load_terminal_map()
! - SECURITY: Add can_open() test to read_mailcaps()
! - SECURITY: Add can_open() test to add_to_alias_text()
! - SECURITY: Add can_open() test to delete_from_alias_text()
! - SECURITY: Add can_open() test to mime_guess_content_type()
! - SECURITY: Add can_open() test to edit_the_message()
! - SECURITY: Add can_open() test to read_editor()
! - SECURITY: Add can_open() test to append()
! - SECURITY: Add can_open() test to check_form_file()
! - SECURITY: Add can_open() test to format_form()
! - SECURITY: Add can_open() test to edit_headers_on_editor()
! - SECURITY: Add can_open() test to mail()
! - SECURITY: Add can_open() test to save_options()
!
! - Add can_open() test to load_folder_state_file()
! - Add can_open() test to read_unidata_text()
! - Add can_open() test to display_file()



Changes of Elm2.4ME+ PL109 (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

*** 258,264 ****


.SH BUG REPORTS TO
Kari Hurtta hurtt...@ozone.fmi.fi
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2003 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

--- 258,264 ----


.SH BUG REPORTS TO
Kari Hurtta hurtt...@ozone.fmi.fi
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
Index: elm2.4.ME+.110a-cvs/lib/dispaddr.c
*** elm2.4.ME+.110/lib/dispaddr.c 2002-06-06 18:55:56.000000000 +0300
--- elm2.4.ME+.110a-cvs/lib/dispaddr.c 2004-01-02 12:37:01.000000000 +0200

***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.14 2002/06/01 12:58:17 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.15 2004/01/02 10:37:01 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

"DisplayAddress: okay_to=%d, okay_cc=%d, I have sender=%s (%s)\n",
***************


*** 134,140 ****
remove_control(*f);

DPRINT(Debug,6,(&Debug,
! "DisplayAddress=%d, *f=%S\n",using_to,*f));
return(using_to);
}

--- 141,148 ----
remove_control(*f);

DPRINT(Debug,6,(&Debug,
! "DisplayAddress=%d, *f=%S, showto=%d\n",
! using_to,*f,showto));
return(using_to);
}

Index: elm2.4.ME+.110a-cvs/src/args.c
*** elm2.4.ME+.110/src/args.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.110a-cvs/src/args.c 2003-12-31 15:50:16.000000000 +0200

***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: args.c,v 1.56 2003/07/29 18:46:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.57 2003/12/31 13:50:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
***************

*** 295,301 ****
printf("\n\tBased on Elm 2.4 PL24 - PL25\n\n");

if (i < 3) {
! printf("\t(C) Copyright 1996-2003 Kari Hurtta\n");
printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");
printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}
--- 295,301 ----
printf("\n\tBased on Elm 2.4 PL24 - PL25\n\n");

if (i < 3) {
! printf("\t(C) Copyright 1996-2004 Kari Hurtta\n");
printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");
printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}
Index: elm2.4.ME+.110a-cvs/src/attach_menu.c
*** elm2.4.ME+.110/src/attach_menu.c 2003-12-17 20:22:20.000000000 +0200
--- elm2.4.ME+.110a-cvs/src/attach_menu.c 2004-01-02 10:29:05.000000000 +0200

***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.55 2003/11/26 17:16:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.56 2004/01/02 08:29:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
*
***************

*** 616,621 ****
--- 616,623 ----
*/

tmp.header_charset = display_charset;
+ if (hdr)
+ tmp.override_charset = hdr->override_charset;

#ifdef USE_PGP
tmp.pgp = 0;
Index: elm2.4.ME+.110a-cvs/src/fileio.c
*** elm2.4.ME+.110/src/fileio.c 2003-08-05 10:27:06.000000000 +0300
--- elm2.4.ME+.110a-cvs/src/fileio.c 2004-01-01 20:56:55.000000000 +0200

***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.52 2003/08/04 14:58:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>
******************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fileio.c,v 1.54 2004/01/01 18:56:55 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@ozone.FMI.FI>

+ ret = 0;
+ }
+

body_bytes = 0;

if (current_header->pgp & PGP_MESSAGE)
***************
*** 269,275 ****
else
state_printf(dest_file,CATGETS(elm_msg_cat, MeSet, MePgpStart,

"-- Start of PGP section.\n"));
!

while (0 < (buf_len = mail_gets(buffer, VERY_LONG_STRING, fpin))) {
body_bytes += buf_len;

--- 279,286 ----
else
state_printf(dest_file,CATGETS(elm_msg_cat, MeSet, MePgpStart,

"-- Start of PGP section.\n"));
!

! retry:
while (0 < (buf_len = mail_gets(buffer, VERY_LONG_STRING, fpin))) {
body_bytes += buf_len;

***************
*** 288,301 ****
goto fail;
}
}
fclose(fpin); fpin = NULL;

if (0 == code)
code = wait_end(&RS,&stat);

! PressAnyKeyToContinue();
if (raw)
! Raw (ON);

if (current_header->pgp & PGP_MESSAGE)
state_printf(dest_file,
--- 299,331 ----

goto fail;
}
}
+
+

+ if (ferror(fpin) && EINTR == errno) {
+ clearerr(fpin);
+ DPRINT(PgpDebug,5,(&PgpDebug,

+ "Reading of result interrupted (EINTR) -- retrying\n"));
+

+ if (0 == code) {
+ code = run_already_done(&RS,&stat);
+ if (0 != code) {
+ DPRINT(PgpDebug,5,(&PgpDebug,

+ "now pgp/gpg is completing\n"));
+ }
+ }
+

Kari E. Hurtta

unread,
Feb 7, 2004, 12:28:04 PM2/7/04
to
Archive-name: elm2.4ME+/PL111a

Elm 2.4ME+ PL111a (25) patch

Is available on ftp.ozone.FMI.FI
via anonymous ftp
directory KEH/

file elm-2.4ME+PL111a.patch.gz
for a moment (*).

Probably will be available on ftp.funet.fi
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/
file elm-2.4ME+PL111a.patch.gz

Is available with
<URL: http://elmme-mailer.org/elm-2.4ME+PL111a.patch.gz >
via WWW (**).

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL111a.patch.gz >
via WWW.

(*) NOTE:
Seems that anonymous ftp (and ftp.ozone.fmi.fi) will be removed.
Then ftp://ftp.ozone.fmi.fi/KEH/ is not available.

Page http://www.ozone.fmi.fi/KEH/ probably remain.

Also ozone.fmi.fi will retire.

(**) http://elmme-mailer.org/ goes to http://www.ozone.FMI.FI/KEH/.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL111a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Undo Elm2.4ME+ PL110a (25) patch before applying this patch.

SUMMARY: This patch fixes crash caused by 'U' command
on aliases menu.

Bug reporting E-mail address is changed.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL11a (25) --------------------------------
Index: elm2.4.ME+.111a-cvs/hdrs/patchlevel.h
Prereq: 1106000000
*** elm2.4.ME+.111/hdrs/patchlevel.h 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/hdrs/patchlevel.h 2004-02-07 15:56:23.000000000 +0200
***************
*** 1,9 ****
! #define PATCHLEVEL "111 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.111
*/
! #define LAST_REPORT_TIME 1106000000
! #define BUG_REPORT_ADDR "Kari Hurtta <hurtt...@posti.FMI.FI>"
! #define VERS_DATE "Jan, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jan, 2004"
--- 1,9 ----
! #define PATCHLEVEL "111a (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.111a
*/
! #define LAST_REPORT_TIME 1107000000
! #define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "Feb, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Feb, 2004"
Index: elm2.4.ME+.111a-cvs/README.ME+
*** elm2.4.ME+.111/README.ME+ 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/README.ME+ 2004-02-07 17:56:06.000000000 +0200
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.699 2004/01/24 11:05:54 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.703 2004/02/07 15:56:06 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 14,19 ****
--- 14,35 ----

Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.


+ Changes of Elm2.4ME+ PL111a (25) compared with Elm2.4ME+ PL111 (25)
+ ------------------------------------------------------------------
+

+ [ This is out of branch patch. ]
+

+ SUMMARY: This patch fixes crash caused by 'U' command
+ on aliases menu.
+
+ - Fix for src/Makefile
+
+ - Fix crash if 'U' is pressed on aliases menu:
+ SIGNAL PANIC in signals.c:102:segv_signal
+
+ - Changed bug reporting address to e...@elmme-mailer.org
+ (that is directed to hurtt...@posti.FMI.FI)
+
Changes of Elm2.4ME+ PL111 (25) compared with Elm2.4ME+ PL110 (25)
------------------------------------------------------------------

Index: elm2.4.ME+.111a-cvs/doc/answer.1
*** elm2.4.ME+.111/doc/answer.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/answer.1 2004-02-07 15:56:22.000000000 +0200
***************
*** 104,110 ****
.br
/tmp/snd.$$ edit buffer for outgoing mail
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2002 by Kari Hurtta
.br
--- 104,110 ----
.br
/tmp/snd.$$ edit buffer for outgoing mail
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2002 by Kari Hurtta
.br
Index: elm2.4.ME+.111a-cvs/doc/chkalias.1
*** elm2.4.ME+.111/doc/chkalias.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/chkalias.1 2004-02-07 15:56:22.000000000 +0200
***************
*** 35,41 ****
the system administrator to keep in mind when creating the
system alias file.
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

--- 35,41 ----
the system administrator to keep in mind when creating the
system alias file.
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

Index: elm2.4.ME+.111a-cvs/doc/elm.1
*** elm2.4.ME+.111/doc/elm.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/elm.1 2004-02-07 15:56:22.000000000 +0200
***************
*** 256,262 ****
.br
$HOME/ELM:debug.info Debug output if turned on
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br

--- 256,262 ----
.br
$HOME/ELM:debug.info Debug output if turned on
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br

Index: elm2.4.ME+.111a-cvs/doc/elmalias.1
*** elm2.4.ME+.111/doc/elmalias.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/elmalias.1 2004-02-07 15:56:22.000000000 +0200
***************
*** 402,408 ****
the system administrator to keep in mind when creating the
system alias file.
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br
--- 402,408 ----
the system administrator to keep in mind when creating the
system alias file.
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br
Index: elm2.4.ME+.111a-cvs/doc/elmbindata.1
*** elm2.4.ME+.111/doc/elmbindata.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/elmbindata.1 2004-02-07 15:56:22.000000000 +0200
***************
*** 87,92 ****


#LIB#/elm.map.bin/bindata.bin Default location for system bindata file

.br
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 2003 by Kari Hurtta

--- 87,92 ----


#LIB#/elm.map.bin/bindata.bin Default location for system bindata file

.br
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 2003 by Kari Hurtta

Index: elm2.4.ME+.111a-cvs/doc/elmcharset.1
*** elm2.4.ME+.111/doc/elmcharset.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/elmcharset.1 2004-02-07 15:56:22.000000000 +0200
***************
*** 73,78 ****
$HOME/.elm/mime.charsets individual charsets file
.br
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1999-2003 by Kari Hurtta

--- 73,78 ----
$HOME/.elm/mime.charsets individual charsets file
.br
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1999-2003 by Kari Hurtta

Index: elm2.4.ME+.111a-cvs/doc/elmlibregister.1
*** elm2.4.ME+.111/doc/elmlibregister.1 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.111a-cvs/doc/elmlibregister.1 2004-02-07 15:56:22.000000000 +0200
***************
*** 58,63 ****
$HOME/.elm/elmrc individual RC file
.br
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@ozone.fmi.fi
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 2003 by Kari Hurtta

--- 58,63 ----
$HOME/.elm/elmrc individual RC file
.br
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 2003 by Kari Hurtta

Index: elm2.4.ME+.111a-cvs/doc/elmrc-write.1
*** elm2.4.ME+.111/doc/elmrc-write.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/elmrc-write.1 2004-02-07 15:56:22.000000000 +0200
***************
*** 54,60 ****
$HOME/.elm/elmrc individual RC file
.br
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 2001,2002 by Kari Hurtta

--- 54,60 ----
$HOME/.elm/elmrc individual RC file
.br
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 2001,2002 by Kari Hurtta

Index: elm2.4.ME+.111a-cvs/doc/elmregister.1
*** elm2.4.ME+.111/doc/elmregister.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/elmregister.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 103,108 ****
.SH FILES
#ETC#/elm.filelist List of installed files
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 2003 by Kari Hurtta

--- 103,108 ----
.SH FILES
#ETC#/elm.filelist List of installed files
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 2003 by Kari Hurtta

Index: elm2.4.ME+.111a-cvs/doc/elmstringconvert.1
*** elm2.4.ME+.111/doc/elmstringconvert.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/elmstringconvert.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 75,80 ****
$HOME/.elm/mime.charsets individual charsets file
.br
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 2002,2003 by Kari Hurtta
--- 75,80 ----
$HOME/.elm/mime.charsets individual charsets file
.br
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 2002,2003 by Kari Hurtta
Index: elm2.4.ME+.111a-cvs/doc/elmterminal.1
*** elm2.4.ME+.111/doc/elmterminal.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/elmterminal.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 54,59 ****
$HOME/.elm/terminal.info individual terminal info file
.br
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 2000-2002 by Kari Hurtta
--- 54,59 ----
$HOME/.elm/terminal.info individual terminal info file
.br
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 2000-2002 by Kari Hurtta
Index: elm2.4.ME+.111a-cvs/doc/elmunidata.1
*** elm2.4.ME+.111/doc/elmunidata.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/elmunidata.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 67,72 ****
#LIB#/elm.map.bin/unidata.bin Default location for system unidata file
.br
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 2001,2002 by Kari Hurtta
--- 67,72 ----
#LIB#/elm.map.bin/unidata.bin Default location for system unidata file
.br
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 2001,2002 by Kari Hurtta
Index: elm2.4.ME+.111a-cvs/doc/fastmail.1
*** elm2.4.ME+.111/doc/fastmail.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/fastmail.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 130,136 ****
.SH SEE\ ALSO
sendmail(1), rmail(1), elm(1L)
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2002 by Kari Hurtta
.br
--- 130,136 ----
.SH SEE\ ALSO
sendmail(1), rmail(1), elm(1L)
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2002 by Kari Hurtta
.br
Index: elm2.4.ME+.111a-cvs/doc/frm.1
*** elm2.4.ME+.111/doc/frm.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/frm.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 143,149 ****
.br
$HOME/mime.charsets locale to MIME charsets mapping information
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2002 by Kari Hurtta
.br
--- 143,149 ----
.br
$HOME/mime.charsets locale to MIME charsets mapping information
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2002 by Kari Hurtta
.br
Index: elm2.4.ME+.111a-cvs/doc/listalias.1
*** elm2.4.ME+.111/doc/listalias.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/listalias.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 43,49 ****
Since the program uses a pipe to egrep, how expressions are evaluated is
a function of \fIthat\fR program, not this one!
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

--- 43,49 ----
Since the program uses a pipe to egrep, how expressions are evaluated is
a function of \fIthat\fR program, not this one!
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

Index: elm2.4.ME+.111a-cvs/doc/messages.1
*** elm2.4.ME+.111/doc/messages.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/messages.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 30,36 ****
.SH BUGS
Don't be foolish...
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

--- 30,36 ----
.SH BUGS
Don't be foolish...
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

Index: elm2.4.ME+.111a-cvs/doc/newalias.1
*** elm2.4.ME+.111/doc/newalias.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/newalias.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 95,101 ****
.I elm
system.
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br
--- 95,101 ----
.I elm
system.
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br
Index: elm2.4.ME+.111a-cvs/doc/newmail.1
*** elm2.4.ME+.111/doc/newmail.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/newmail.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 153,159 ****
.SH SEE ALSO
notify in sh(1) or csh(1)
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br
--- 153,159 ----
.SH SEE ALSO
notify in sh(1) or csh(1)
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br
Index: elm2.4.ME+.111a-cvs/doc/printmail.1
*** elm2.4.ME+.111/doc/printmail.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/printmail.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 37,43 ****
.SH SEE ALSO
readmsg(1L)
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

--- 37,43 ----
.SH SEE ALSO
readmsg(1L)
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS


\fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

Index: elm2.4.ME+.111a-cvs/doc/prlong.1
*** elm2.4.ME+.111/doc/prlong.1 2003-04-24 18:52:20.000000000 +0300
--- elm2.4.ME+.111a-cvs/doc/prlong.1 2004-02-07 15:56:23.000000000 +0200


***************
*** 32,34 ****
--- 32,36 ----

seperator is a single space. The default output leader is an empty
string for the first output line, and a single tab for all subsequent
lines.


+ .SH BUG REPORTS TO

+ Kari Hurtta e...@elmme-mailer.org
Index: elm2.4.ME+.111a-cvs/doc/readmsg.1
*** elm2.4.ME+.111/doc/readmsg.1 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/doc/readmsg.1 2004-02-07 15:56:23.000000000 +0200
***************
*** 197,203 ****
.I elm
with the current folder, and in mailbox order for all other cases.
.SH BUG REPORTS TO
! Kari Hurtta hurtt...@posti.fmi.fi
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br
--- 197,203 ----
.I elm
with the current folder, and in mailbox order for all other cases.
.SH BUG REPORTS TO
! Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br
Index: elm2.4.ME+.111a-cvs/lib/mmaputil.c
*** elm2.4.ME+.111/lib/mmaputil.c 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/lib/mmaputil.c 2004-01-31 14:29:24.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mmaputil.c,v 1.3 2004/01/24 11:05:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mmaputil.c,v 1.4 2004/01/31 12:29:24 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************
*** 117,125 ****
return status;
}

-
- /* KESKEN */
-

/*
* Local Variables:
* mode:c

--- 117,122 ----
Index: elm2.4.ME+.111a-cvs/src/elm.c
*** elm2.4.ME+.111/src/elm.c 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/src/elm.c 2004-02-07 15:56:23.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.63 2004/01/24 11:06:03 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.63 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elm.c,v 1.64 2004/02/07 13:56:23 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 739,744 ****
--- 739,757 ----
}
break;

+ case 'U' : {
+ if (get_message_count(mailbox) < 1) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmNoItemToMarkUnread,
+ "No %s to mark as unread!"),
+ items);
+
+ }
+ else
+ unread_msg(TRUE, (mailbox));
+ }
+ break;
+
case 'v' : {
struct header_rec *hdr;
FILE *F;
***************
*** 2026,2044 ****
meta_match(TAGGED, mailbox, aview);
break;

- case 'U' : if (ifmain(get_message_count(mailbox),
- get_alias_count(aview))
- < 1) {
- lib_error(CATGETS(elm_msg_cat, ElmSet,
- ElmNoItemToMarkUnread,
- "No %s to mark as unread!"),
- items);
-
- }
- else
- unread_msg(TRUE, (mailbox));
- break;
-
case 'u' : if (ifmain(get_message_count(mailbox),
get_alias_count(aview))
< 1) {
--- 2039,2044 ----
Index: elm2.4.ME+.111a-cvs/src/Makefile.SH
*** elm2.4.ME+.111/src/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111a-cvs/src/Makefile.SH 2004-01-31 21:42:55.000000000 +0200
***************
*** 31,37 ****

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.48 2004/01/05 15:05:32 hurtta Exp $


#
# Makefile for the ELM mail program.
#

--- 31,37 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.49 2004/01/31 19:42:55 hurtta Exp $


#
# Makefile for the ELM mail program.
#
***************

*** 251,257 ****
screen/libscreen.a:


cd screen; $(MAKE) $(MJ) $(MFLAGS) all

! screen/libaliases.a:
cd aliases; $(MAKE) $(MJ) $(MFLAGS) all


--- 251,257 ----
screen/libscreen.a:


cd screen; $(MAKE) $(MJ) $(MFLAGS) all

! aliases/libaliases.a:
cd aliases; $(MAKE) $(MJ) $(MFLAGS) all


Kari Hurtta

unread,
Feb 22, 2004, 2:43:23 PM2/22/04
to
Archive-name: elm2.4ME+/PL111b

Elm 2.4ME+ PL111b (25) patch

Is available on ozone.FMI.FI


via anonymous ftp
directory KEH/

file elm-2.4ME+PL111b.patch.gz
for a moment (*). Name ftp.ozone.fmi.fi
will point to service which no have anonymous ftp
before ozone.fmi.fi retires.

Probably will be available on ftp.funet.fi
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL111b.patch.gz

Is available with
<URL: http://elmme-mailer.org/elm-2.4ME+PL111b.patch.gz >
via WWW (**).

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL111b.patch.gz >
via WWW.

(*) NOTE:
Seems that anonymous ftp (and ftp.ozone.fmi.fi) will be removed.
Then ftp://ftp.ozone.fmi.fi/KEH/ is not available.

Page http://www.ozone.fmi.fi/KEH/ probably remain.

Also ozone.fmi.fi will retire.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL111b.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Notice: ME+ series is not official Elm.
This patch is agaist Elm 2.4ME+ PL111b (25) --------------------------------
Index: elm2.4.ME+.111b-cvs/hdrs/patchlevel.h
Prereq: 1107000000
*** elm2.4.ME+.111a/hdrs/patchlevel.h 2004-02-19 22:06:03.000000000 +0200
--- elm2.4.ME+.111b-cvs/hdrs/patchlevel.h 2004-02-19 21:38:34.000000000 +0200
***************
*** 1,8 ****


! #define PATCHLEVEL "111a (25)"
/* Used by Configure:

SHAREDTAG: .1.0.111a
*/
! #define LAST_REPORT_TIME 1107000000

#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Feb, 2004" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "111b (25)"
/* Used by Configure:
SHAREDTAG: .1.0.111a
*/
! #define LAST_REPORT_TIME 1108000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Feb, 2004" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.111b-cvs/README.ME+
*** elm2.4.ME+.111a/README.ME+ 2004-02-19 22:06:03.000000000 +0200
--- elm2.4.ME+.111b-cvs/README.ME+ 2004-02-19 21:38:34.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.703 2004/02/07 15:56:06 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.704 2004/02/19 19:38:34 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 14,21 ****


Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.


Changes of Elm2.4ME+ PL111a (25) compared with Elm2.4ME+ PL111 (25)

! ------------------------------------------------------------------



[ This is out of branch patch. ]

--- 14,30 ----


Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.


+ Changes of Elm2.4ME+ PL111b (25) compared with Elm2.4ME+ PL111a (25)
+ --------------------------------------------------------------------


+
+ [ This is out of branch patch. ]
+
+

+ - Fix crash on parse failure on command
+ "View digest as mailbox".


+
Changes of Elm2.4ME+ PL111a (25) compared with Elm2.4ME+ PL111 (25)

! -------------------------------------------------------------------



[ This is out of branch patch. ]

Index: elm2.4.ME+.111b-cvs/melib/mime_parse.c
*** elm2.4.ME+.111a/melib/mime_parse.c 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111b-cvs/melib/mime_parse.c 2004-02-19 21:38:34.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.43 2004/01/24 11:06:01 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.44 2004/02/19 19:38:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 210,215 ****
--- 210,221 ----

mt->TYPE = give_media_type(c,subtype,1);

+ if (! mt->TYPE) {
+ DPRINT(Debug,1,(&Debug,
+ "mime_get_content(): str=\"%s\" FAILED!\n", str));
+ return;
+ }
+
DPRINT(Debug,9,(&Debug,
"mime_get_content(): %p -- type=\"%s\", subtype=\"%s\", opts=\"%s\"\n",
mt->TYPE,
Index: elm2.4.ME+.111b-cvs/melib/mime_selector.c
*** elm2.4.ME+.111a/melib/mime_selector.c 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111b-cvs/melib/mime_selector.c 2004-02-19 21:38:34.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_selector.c,v 1.6 2004/01/24 11:06:01 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_selector.c,v 1.7 2004/02/19 19:38:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 85,90 ****
--- 85,98 ----
panic("MIME PANIC",__FILE__,__LINE__,"mime_classify_media",
"Bad magic number",0);

+ if (! p->TYPE) {
+ DPRINT(Debug,1,(&Debug,
+ "mime_classify_media(%p) NOT PARSED\n",
+ p));
+ submask = NOTPLAIN_need_metamail;
+ goto bad_encoding;
+ }
+
melib_register_decoders();

DPRINT(Debug,11,(&Debug,
Index: elm2.4.ME+.111b-cvs/melib/mpar_multipart.c
*** elm2.4.ME+.111a/melib/mpar_multipart.c 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.111b-cvs/melib/mpar_multipart.c 2004-02-19 21:38:34.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mpar_multipart.c,v 1.7 2004/01/24 11:06:01 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mpar_multipart.c,v 1.8 2004/02/19 19:38:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 208,213 ****
--- 208,221 ----

delete_headers(&headers);

+
+ if (!D->p.multipart->parts[i].TYPE) {
+ DPRINT(Debug,1,(&Debug,
+ "mpar_multipart_parse -- parse failure\n"));
+ ret = 0;
+ break;
+ }
+
DPRINT(Debug,9,(&Debug,
"mpar_multipart_parse: (reading) [%d] content-type=%s/%s; flags=%d\n",
i,
***************
*** 257,262 ****
--- 265,277 ----
if (D->p.multipart->parts[i].magic != MIME_magic)
mime_panic(__FILE__,__LINE__,"multipart_parse",
"Bad magic number (array elem)");
+
+ if (!D->p.multipart->parts[i].TYPE) {
+ DPRINT(Debug,9,(&Debug,
+ "mpar_multipart_parse: (parsing) [%d] FAILED\n",
+ i));
+ continue;
+ }

DPRINT(Debug,9,(&Debug,
"mpar_multipart_parse: (parsing) [%d] content-type=%s/%s; flags=%d\n",

Kari E. Hurtta

unread,
Mar 26, 2004, 1:39:40 PM3/26/04
to
Archive-name: elm2.4ME+/PL113a

Is available on ozone.FMI.FI (1)


via anonymous ftp
directory KEH/

files elm-2.4ME+PL113a.patch.gz
for a moment (2).

Probably will be available on ftp.funet.fi
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL113a.patch.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL113a.patch.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL113a.patch.gz >
via WWW.

(1) Was ftp.ozone.fmi.fi but name ftp.ozone.fmi.fi
will probably point to service which no have anonymous ftp
before ozone.fmi.fi retires. So use ozone.fmi.fi
for a moment instead of ftp.ozone.fmi.fi.

(2) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL113a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

SUMMARY: This patch fixes (again) compilation
problem on AIX and fixes null pointer
dereference problem on "elm -c xxx" command.


Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL113 (25) --------------------------------
Index: elm2.4.ME+.113a-cvs/hdrs/patchlevel.h
Prereq: 1110000000
*** elm2.4.ME+.113/hdrs/patchlevel.h 2004-03-16 21:17:43.000000000 +0200
--- elm2.4.ME+.113a-cvs/hdrs/patchlevel.h 2004-03-25 20:45:42.000000000 +0200
***************
*** 1,8 ****
! #define PATCHLEVEL "113 (25)"
/* Used by Configure:
SHAREDTAG: .1.0.113
*/
! #define LAST_REPORT_TIME 1110000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Mar, 2004" /* for elm -v option */
#define WHAT_STRING \
--- 1,8 ----
! #define PATCHLEVEL "113a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.113
*/
! #define LAST_REPORT_TIME 1111000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Mar, 2004" /* for elm -v option */
#define WHAT_STRING \
Index: elm2.4.ME+.113a-cvs/README.ME+
*** elm2.4.ME+.113/README.ME+ 2004-03-16 21:17:43.000000000 +0200
--- elm2.4.ME+.113a-cvs/README.ME+ 2004-03-26 17:06:30.000000000 +0200
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.715 2004/03/16 18:49:49 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.715.4.2 2004/03/26 15:06:30 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,27 ****


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

Changes of Elm2.4ME+ PL113 (25) compared with Elm2.4ME+ PL112 (25)
------------------------------------------------------------------

! SUMMARY: This release changes base64 decode algorithm,
! adds decoder from X-uuencoded content-transfer-encoding
! and adds handling of resizing to many screen.

! - Reimplemented base64_decode() from routine
! of kehlist (first occured on kehlist 1.1.2 9 Jun 1999
Author: Kari E. Hurtta <Kari....@Fmi.FI>)

[ Well, basically same decoding routine is on
--- 13,58 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+

+ Changes of Elm2.4ME+ PL113a (25) compared with Elm2.4ME+ PL113 (25)


+ -------------------------------------------------------------------
+
+ [ This is out of branch patch. ]
+

+ - "I tried to compile elm2.4.ME+.113 on AIX 5.1 (maintenance
+ level 05) or on AIX 5.2 (maintenance level 02)
+ with gcc version 3.3.2 and got stuck with:
+
+ gmake[1]: Entering directory `noam/elm2.4.ME+.113/src/screen'
+ gcc -I../../hdrs -fpcc-struct-return -fPIC -O -c
+ -o curses.o curses.c
+ curses.c:282: error: parse error before '->' token"
+ Problem reported by: oam G. Nudelman <no...@mail.biu.ac.il>
+ > Fix again compilation problem fixed on PL106 but
+ re-introduced on PL108.
+
+ - "When running 'elm -c alias_name' with Elm 2.4ME+ PL113 on AIX, I get:
+
+ ALIAS VIEW PANIC in aliases.c:340:update_aview
+ >>>bad aliasview magic"
+ Reported by: Noam G. Nudelman <no...@mail.biu.ac.il>
+ - On linux "elm -c xxx" crashes with:


+ SIGNAL PANIC in signals.c:102:segv_signal
+ >>>
+

+ Segment Violation signal!
+ > Moved initialization of aliasview to earlier.
+
+
Changes of Elm2.4ME+ PL113 (25) compared with Elm2.4ME+ PL112 (25)
------------------------------------------------------------------

! SUMMARY: This release changes base64 decode algorithm,
! adds decoder from X-uuencoded content-transfer-encoding
! and adds handling of resizing to many screen.

! - Reimplemented base64_decode() from routine
! of kehlist (first occured on kehlist 1.1.2 9 Jun 1999
Author: Kari E. Hurtta <Kari....@Fmi.FI>)

[ Well, basically same decoding routine is on
Index: elm2.4.ME+.113a-cvs/src/init.c
*** elm2.4.ME+.113/src/init.c 2004-03-16 21:17:43.000000000 +0200
--- elm2.4.ME+.113a-cvs/src/init.c 2004-03-25 20:45:42.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: init.c,v 1.47 2004/03/15 18:09:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: init.c,v 1.47.4.1 2004/03/25 18:45:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47.4.1 $ $State: Exp $
*


* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 332,337 ****
--- 332,340 ----
exit(1);
}
}
+
+ *main_aliases = new_aliasview();
+ add_files_to_aview(*main_aliases);

if (check_only) {
DPRINT(Debug,5,
***************
*** 588,596 ****

post_process_charset_options();

- *main_aliases = new_aliasview();
- add_files_to_aview(*main_aliases);
-
if (! mail_only) {
int LINES, COLUMNS;

--- 591,596 ----
Index: elm2.4.ME+.113a-cvs/src/screen/curses.c
*** elm2.4.ME+.113/src/screen/curses.c 2004-03-16 21:17:43.000000000 +0200
--- elm2.4.ME+.113a-cvs/src/screen/curses.c 2004-03-25 20:45:42.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curses.c,v 1.5 2004/03/14 17:05:59 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: curses.c,v 1.5.4.1 2004/03/25 18:45:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.4.1 $ $State: Exp $
*


* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 23,31 ****
#endif /* I_CURSES */
#ifdef I_TERM


#include <term.h> /* Defination for tgetent.h and so on ... */

#undef lines /* ... But undefine lines macro */

#undef columns /* ... But undefine columns macro */

- #endif /* I_TERM */

#ifdef TERMIOS
# include <termios.h>
--- 23,32 ----
#endif /* I_CURSES */
#ifdef I_TERM


#include <term.h> /* Defination for tgetent.h and so on ... */

+ #endif /* I_TERM */
+

#undef lines /* ... But undefine lines macro */

#undef columns /* ... But undefine columns macro */

#ifdef TERMIOS
# include <termios.h>

Kari E. Hurtta

unread,
Apr 14, 2004, 3:13:06 AM4/14/04
to
Archive-name: elm2.4ME+/PL115

Is available on ozone.FMI.FI (1)

via anonymous ftp
directory KEH/

files elm-2.4ME+PL115.patch.gz
and elm-2.4ME+115.tar.gz
for a moment (2).

Is available on ftp.funet.fi


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

files elm-2.4ME+PL115.patch.gz
and elm-2.4ME+115.tar.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL115.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+115.tar.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL115.patch.gz >
and <URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+115.tar.gz >
via WWW.

(1) Was ftp.ozone.fmi.fi but name ftp.ozone.fmi.fi
will probably point to service which no have anonymous ftp
before ozone.fmi.fi retires. So use ozone.fmi.fi
for a moment instead of ftp.ozone.fmi.fi.

(2) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi.

Also ozone.fmi.fi will retire.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL115.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Undo Elm2.4ME+ PL113a (25) patch before applying this patch.

SUMMARY: This release changes temporary folder
location on some situations, fixes crash
on c)hange command on alias menu, adds
elmrc options "local-sessionlock-dir" and
"local-sessionlock-use-home", and changes
SIGWINCH handling when waiting for editor.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL114 (25) --------------------------------

For apply patch use command

patch -p1 < this-file


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Index: elm2.4.ME+.115-cvs/hdrs/patchlevel.h
Prereq: 1112000000
*** elm2.4.ME+.114/hdrs/patchlevel.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/hdrs/patchlevel.h 2004-04-12 22:00:04.000000000 +0300
***************
*** 1,8 ****
! #define PATCHLEVEL "114 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.114
*/
! #define LAST_REPORT_TIME 1112000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Apr, 2004" /* for elm -v option */
#define WHAT_STRING \
--- 1,8 ----
! #define PATCHLEVEL "115 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.115
*/
! #define LAST_REPORT_TIME 1113000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Apr, 2004" /* for elm -v option */
#define WHAT_STRING \
Index: elm2.4.ME+.115-cvs/README.ME+
*** elm2.4.ME+.114/README.ME+ 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/README.ME+ 2004-04-12 22:27:31.000000000 +0300
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.726 2004/03/30 16:33:06 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.733 2004/04/12 19:27:31 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,22 ****


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

Changes of Elm2.4ME+ PL114 (25) compared with Elm2.4ME+ PL113 (25)
------------------------------------------------------------------

! Undo Elm2.4ME+ PL114a (25) patch before applying this patch.

SUMMARY: This release collects PL113a patch, adds
hack for hidding certain management mail
--- 13,92 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL115 (25) compared with Elm2.4ME+ PL114 (25)
+ ------------------------------------------------------------------
+
+ SuMMARY: This release changes temporary folder
+ location on some situations, fixs crash
+ on c)hange command on alias menu, adds
+ elmrc options "local-sessionlock-dir" and
+ "local-sessionlock-use-home", and changes
+ SIGWICH handling when waiting of editor.
+
+ - If opened local mailbox is on somewhere other
+ location than on spool directory, use "tmpdir" setting
+ from elm.rc for location of temporary file
+ "mbox.{mailbox}-{username}" instead default_temp.
+
+ NOTE: "tmpdir" was already used for temporary file
+ "mbox.{username}@{popserver}" when reading
+ pop mailbox and for temporary file
+ "mbox.{username}@{imapserver}:{folder}" when
+ reading imap folder of mailbox.
+
+ - If opened local mailbox is on spool directory, use
+ (new) "local-sessionlock-dir" setting from elm.rc for
+ location of temporary file "mbox.{mailbox}" instead
+ default_temp.
+
+ - Added new elmrc option "local-sessionlock-dir".
+
+ - "There are two behaviors that I need changed. One
+ is the location of the temporary mbox-USERNAME file.
+ Because our homedirs are nfs mounted to whatever machine
+ we sit down at, having the temporary mbox-USERNAME file
+ located in /tmp (or anywhere else local to the machine
+ we are currently using) is not adequate protection from
+ launching two invocations of elm on two different
+ workstations and having both try and update the same
+ inbox. This usually results in an error message about
+ the mailbox being corrupted when we return
+ to our primary workstation.
+
+ To solve this it works better for us if the mbox-USERNAME
+ file resides in our homedirs. I found no way to set this
+ using the Configure script (can't use $HOME), so I did it
+ by modifying imap.c, localmbx.c, and remote_mbx.c. Also,
+ we prefer that these files be dot files (.mbox-USERNAME) so
+ I also modified sysdefs.SH."
+ Problem noted by: J.C. Webber III <j...@pico.apple.com>
+ > Added new elmrc option "local-sessionlock-use-home".
+ Possible values are "never", "spool", "always" and
+ "non-spool". If this is set to "always", local mailbox
+ opened use home for temporary file. Temporary file
+ is renamed to ".mbox.{mailbox}-{username}" or
+ ".mbox.{mailbox}". If this is set to "spool",
+ temporary file for local mailboxes opened from spool
+ directory are put to home directory. If this is set
+ to "non-spool", temporary file for local mailboxes
+ opened from non-spool directory are put to home directory.
+ Value "never" do not relocate temporary file.
+
+ - Fix crash when changing alias...
+
+ - set SIGWINCH to SIG_DFL only on child (on system_call())
+ so that Elm will call menu_context_resize() when it is
+ waiting child to complete ...
+

+
+ New elmrc options:

+ local-sessionlock-dir
+ local-sessionlock-use-home
+
Changes of Elm2.4ME+ PL114 (25) compared with Elm2.4ME+ PL113 (25)
------------------------------------------------------------------

! Undo Elm2.4ME+ PL113a (25) patch before applying this patch.

SUMMARY: This release collects PL113a patch, adds
hack for hidding certain management mail
***************
*** 3844,3850 ****
with map definition of charset)

NOTE: elmrc options compactcharsets or iso646-charsets
! should newer be set explicit. If you need to redefine
some charset, give definition on file .elm/mime.charsets.

- Quoted username if it contains some special characters.
--- 3914,3920 ----
with map definition of charset)

NOTE: elmrc options compactcharsets or iso646-charsets
! should never be set explicit. If you need to redefine
some charset, give definition on file .elm/mime.charsets.

- Quoted username if it contains some special characters.
***************
*** 9820,9830 ****
--- 9890,9903 ----


keeppassfor PGP (new on Elm 2.4 PL24ME)
local-fast-lookup -
local-fs-charset -

+ local-sessionlock-dir -
+ local-sessionlock-use-home -
lock-in-copy -
lock-folder -
mailer -
map-bin-dir MIME / SYSTEM
map-text-dir MIME / SYSTEM
+ message-hide-hack -
metamail MIME
metamail-mailcaps MIME
menu-display-host -
***************
*** 9855,9860 ****
--- 9928,9935 ----


text-charset MIME
unidata MIME / SYSTEM
use-library -

+ use-base-library -
+ use-connect-library -


usepgppass PGP (new on Elm 2.4 PL24ME)
utf7-encode-optional MIME

Index: elm2.4.ME+.115-cvs/doc/elmrc-info
*** elm2.4.ME+.114/doc/elmrc-info 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/doc/elmrc-info 2004-04-04 19:42:27.000000000 +0300
***************
*** 1,4 ****
! #@(#)$Id: elmrc-info,v 1.59 2004/03/28 13:37:38 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.61 2004/04/04 16:42:27 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************

*** 90,95 ****
--- 90,97 ----

tmpdir
# where to place temporary files, default directory is "/tmp"
+ #
+ # See also: local-sessionlock-dir

receivedmail
# where to save received messages to, default file is "=received"
***************
*** 460,465 ****
--- 462,489 ----
# See also: allow-charset-switching, local-fast-lookup, displaycharset,
# text-charset, page-known-charsets

+ local-sessionlock-dir
+ # If opened local mailbox is on spool directory, this setting tells
+ # to where put temporary file mbox.{mailbox}. ( If opened local
+ # mailbox is not on spool directory, location of temporary file
+ # mbox.{mailbox}-{username} is given on tmpdir variable )
+ #
+ # See also: tmpdir, local-sessionlock-use-home
+
+ local-sessionlock-use-home
+ # This variable controls to where put temporary file when local
+ # mailbox is opened.
+ #
+ # Possible values are:
+ # never Temporray file is put according of
+ # local-sessionlock-dir and tempdir
+ # spool Temporary file for mailbox on spool
+ # is put to home directory
+ # always Temporary file for mailbox is put
+ # to home directory
+ # non-spool Temporary file for mailbox on not in spool
+ # is put to home directory
+
dsn-success
# If TRUE, success Delivery-Status-Notifications are asked by default.

Index: elm2.4.ME+.115-cvs/hdrs/elmlib.h
*** elm2.4.ME+.114/hdrs/elmlib.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/hdrs/elmlib.h 2004-04-04 09:17:17.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmlib.h,v 1.206 2004/03/28 13:37:38 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.206 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----
! /* $Id: elmlib.h,v 1.207 2004/04/04 06:17:17 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 811,816 ****
--- 811,821 ----

extern int local_fast_lookup; /* flag: directory listing not needed
for lookup */
+ extern char local_sessionlock_dir[SLEN];
+ extern int local_sessionlock_use_home; /* 0 == newer,
+ 1 == spool
+ 2 == always
+ 3 == non-spool */
extern char raw_local_fs_charset[SLEN]; /* filesystem charset */
extern charset_t local_fs_charset; /* filesystem charset */
extern char local_signature[SLEN];/* local msg signature file */
Index: elm2.4.ME+.115-cvs/hdrs/mbx_imp.h
*** elm2.4.ME+.114/hdrs/mbx_imp.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/hdrs/mbx_imp.h 2004-04-04 09:17:17.000000000 +0300
***************
*** 1,7 ****
! /* $Id: mbx_imp.h,v 1.65 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.65 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----
! /* $Id: mbx_imp.h,v 1.66 2004/04/04 06:17:17 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************
*** 224,229 ****
--- 224,233 ----
extern void zero_remote_account P_((struct remote_account *ra));
extern void free_remote_account P_((struct remote_account *ra));

+ extern void set_remote_tempmbox P_((struct folder_info *fh,
+ struct remote_account *X,
+ char *imap_folder));
+
struct imap_token {
enum token_type { imap_atom, imap_number,
imap_continue, imap_notag,
Index: elm2.4.ME+.115-cvs/hdrs/save_opts.h
*** elm2.4.ME+.114/hdrs/save_opts.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/hdrs/save_opts.h 2004-04-04 19:42:27.000000000 +0300
***************
*** 1,7 ****
! /* @(#)$Id: save_opts.h,v 1.80 2004/03/28 13:37:38 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.80 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----
! /* @(#)$Id: save_opts.h,v 1.82 2004/04/04 16:42:27 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.82 $ $State: Exp $
*


* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 122,127 ****
--- 122,128 ----
#define ZZZ_DT_MLT(A) DT_MLT,0, { weed: A }, null_option_func
#define ZZZ_DT_SYN(A) DT_SYN,0, { str: A }, null_option_func
#define ZZZ_DT_NUM(A) DT_NUM,0, { num: A }, null_option_func
+ #define ZZZ_DT_NUM_(x,A) DT_NUM,x, { num: A }, null_option_func
#define ZZZ_DT_LONG(A) DT_NUM,0, { l_num: A },null_option_func
#ifdef USE_PGP
#define ZZZ_DT_PGPVER(A) DT_PGPVER,0, { pgpver: A },null_option_func
***************
*** 163,168 ****
--- 164,170 ----
#define ZZZ_DT_MLT(A) DT_MLT,0,(char *)A, null_option_func
#define ZZZ_DT_SYN(A) DT_SYN,0,A, null_option_func
#define ZZZ_DT_NUM(A) DT_NUM,0,(char *)A, null_option_func
+ #define ZZZ_DT_NUM_(x,A) DT_NUM,x,(char *)A, null_option_func
#define ZZZ_DT_LONG(A) DT_NUM,0,(char *)A, null_option_func
#ifdef USE_PGP
#define ZZZ_DT_PGPVER(A) DT_PGPVER,0,(char *)A,null_option_func
***************
*** 234,239 ****
--- 236,245 ----
static char * hide_hacks[] = { "none", "FOLDER INTERNAL DATA", NULL };
static enumerate_list HIDE_HACK = { 2, &(hide_hacks[0]) };

+ static char * LSL_list[] = { "never", "spool", "always", "non-spool", NULL };
+ static enumerate_list local_sessionlock_list = { 4, &(LSL_list[0]) };
+
+
ZZZ_SAVE_TYPE save_info_data[] = {
{"add-in-reply-to-phrase", -1L,ZZZ_DT_BOL(&add_irt_phrase), 0, NULL},
{"add-sender", -1L,ZZZ_DT_BOL_(FL_SYS,&add_sender_header),
***************
*** 356,361 ****
--- 362,372 ----
{"local-fast-lookup", -1L,ZZZ_DT_BOL(&local_fast_lookup), 0, NULL},
{"local-fs-charset", -1L,ZZZ_DT_STR(raw_local_fs_charset),
sizeof raw_local_fs_charset, NULL},
+ {"local-sessionlock-dir", -1L, ZZZ_DT_STR_(FL_SYS,local_sessionlock_dir),
+ sizeof local_sessionlock_dir, NULL},
+ {"local-sessionlock-use-home", -1L, ZZZ_DT_NUM_(FL_SYS,
+ &local_sessionlock_use_home),
+ 0, &local_sessionlock_list },
{"localsignature", -1L,ZZZ_DT_STR(raw_local_signature),
sizeof raw_local_signature, NULL},
#ifdef SYSCALL_LOCKING
Index: elm2.4.ME+.115-cvs/hdrs/sysdefs.SH
*** elm2.4.ME+.114/hdrs/sysdefs.SH 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/hdrs/sysdefs.SH 2004-04-04 09:17:17.000000000 +0300
***************
*** 22,30 ****

echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'
! /* $Id: sysdefs.SH,v 1.22 2004/03/27 18:31:37 hurtta Exp $ */
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $
*


* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 22,30 ----

echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'
! /* $Id: sysdefs.SH,v 1.23 2004/04/04 06:17:17 hurtta Exp $ */


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 66,77 ****

#define HOSTDOMFILE "$etc/domain"

- /** where to put the output of the elm -d command... (in home dir) **/
-
#define default_temp "$tmpdir/"
#define temp_file "snd."
#define temp_form_file "form."
! #define temp_mbox "mbox."
#define temp_print "print."
#define temp_edit "elm-edit"
/* #define temp_uuname "uuname." */
--- 66,75 ----

#define HOSTDOMFILE "$etc/domain"

#define default_temp "$tmpdir/"
#define temp_file "snd."
#define temp_form_file "form."
! /* #define temp_mbox "mbox." */
#define temp_print "print."
#define temp_edit "elm-edit"
/* #define temp_uuname "uuname." */
Index: elm2.4.ME+.115-cvs/lib/imap.c
*** elm2.4.ME+.114/lib/imap.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/lib/imap.c 2004-04-04 09:17:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: imap.c,v 1.103 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.103 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: imap.c,v 1.104 2004/04/04 06:17:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.104 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 4227,4238 ****
Y = str;
else
Y++;
! elm_sfprintf(res-> cur_tempfolder,
! sizeof res -> cur_tempfolder,
! FRM("%s%s%s@%s:%s"),
! temp_dir,temp_mbox,
! dir->a.imap_browser.Ch->C.username,
! dir->a.imap_browser.Ch->C.host,Y);

if (dir->a.imap_browser.Ch->state == CON_logged) {

--- 4227,4238 ----
Y = str;
else
Y++;
!
! /* IMAP temporary mailboxs are always put to
! temp_dir */
! set_remote_tempmbox(res,
! & (dir->a.imap_browser.Ch->C),
! Y);

if (dir->a.imap_browser.Ch->state == CON_logged) {

Index: elm2.4.ME+.115-cvs/lib/localmbx.c
*** elm2.4.ME+.114/lib/localmbx.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/lib/localmbx.c 2004-04-04 09:17:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.63 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.63 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.64 2004/04/04 06:17:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************
*** 2101,2112 ****
int tempfn_size;
{
/** create in tempfn the name of the temp file corresponding to
! mailfile mbox.
**/

char *cp,*ptr;
struct stat buf; /* stat command */
int in_spool = 0;

if (stat(mbox,&buf) < 0) {
DPRINT(Debug,8,(&Debug,
--- 2101,2117 ----
int tempfn_size;
{
/** create in tempfn the name of the temp file corresponding to
! mailfile mbox. Used to session lock also.
**/

char *cp,*ptr;
struct stat buf; /* stat command */
int in_spool = 0;
+ char *Y = NULL, *Y1 = "";
+
+ char * prefix = "mbox.";
+
+ int L;

if (stat(mbox,&buf) < 0) {
DPRINT(Debug,8,(&Debug,
***************
*** 2117,2135 ****
in_spool = in_directory(&buf,mbox,mailhome);

DPRINT(Debug,11,(&Debug,
! "mk_temp_mail_fn: in_spool=%d, mbox=%s\n",
! in_spool,mbox));
!
! if (strlen(default_temp) + strlen(temp_mbox) > tempfn_size-1) {
DPRINT(Debug,1,(&Debug,
"mk_temp_mail_fn: Too long path!\n"));
strfcpy(tempfn,"TEMP_MBOX", tempfn_size);
return;
}

elm_sfprintf(tempfn, tempfn_size,
! FRM("%s%s"), default_temp, temp_mbox);
!
if((cp = rindex(mbox, '/')) != NULL) {
cp++;
if (strcmp(cp, "mbox") == 0 || strcmp(cp, "mailbox") == 0 ||
--- 2122,2180 ----
in_spool = in_directory(&buf,mbox,mailhome);

DPRINT(Debug,11,(&Debug,
! "mk_temp_mail_fn: in_spool=%d, mbox=%s, local_sessionlock_use_home=%d\n",
! in_spool,mbox,local_sessionlock_use_home));
!
! /* We need not use default_temp or local_sessionlock_dir
! if file is not on spool area
! */
!
!
! switch (local_sessionlock_use_home) {
! case 0: /* newer */
! default:
! Y = in_spool ? local_sessionlock_dir : temp_dir;
! break;
! case 1: /* spool */
! Y = in_spool ? home : temp_dir;
! prefix = in_spool ? ".mbox." : "mbox.";
! break;
! case 2: /* always */
! Y = home;
! prefix = ".mbox.";
! break;
! case 3: /* non-spool */
! Y = in_spool ? local_sessionlock_dir : home;
! prefix = in_spool ? "mbox." : ".mbox.";
! break;
! }
!
! L = strlen(Y);
!
! DPRINT(Debug,11,(&Debug,
! " => temp dir=%s prefix=%s\n",Y,prefix));
!
! if (strlen(Y) + strlen(prefix) > tempfn_size-2) {
DPRINT(Debug,1,(&Debug,
"mk_temp_mail_fn: Too long path!\n"));
strfcpy(tempfn,"TEMP_MBOX", tempfn_size);
return;
}
+
+ if (L < 1) {
+ DPRINT(Debug,1,(&Debug,
+ "mk_temp_mail_fn: Dir empty!!\n"));
+ strfcpy(tempfn,"TEMP_MBOX", tempfn_size);
+ return;
+ }
+
+ if (Y[L-1] != '/')
+ Y1 = "/";

elm_sfprintf(tempfn, tempfn_size,
! FRM("%s%s%s"), Y, Y1, prefix);
!
!
if((cp = rindex(mbox, '/')) != NULL) {
cp++;
if (strcmp(cp, "mbox") == 0 || strcmp(cp, "mailbox") == 0 ||
Index: elm2.4.ME+.115-cvs/lib/read_rc.c
*** elm2.4.ME+.114/lib/read_rc.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/lib/read_rc.c 2004-04-04 09:17:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.132 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.132 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133 2004/04/04 06:17:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 235,240 ****
--- 235,246 ----

int local_fast_lookup = 0; /* flag: directory listing not needed
for lookup */
+ char local_sessionlock_dir[SLEN] = default_temp;
+ int local_sessionlock_use_home; /* 0 == newer,
+ 1 == spool
+ 2 == always
+ 3 == non-spool
+ */
char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */
charset_t local_fs_charset = NULL; /* filesystem charset */

***************
*** 2018,2028 ****
}
}

- #if 0
- if (x == 0) {
- } else
- prev_type = x;
- #endif

}
}
--- 2024,2029 ----
Index: elm2.4.ME+.115-cvs/lib/remote_mbx.c
*** elm2.4.ME+.114/lib/remote_mbx.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115-cvs/lib/remote_mbx.c 2004-04-04 09:17:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.48 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.49 2004/04/04 06:17:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 626,631 ****
--- 626,665 ----
return ret;
}

+ void set_remote_tempmbox P_((struct folder_info *fh,
+ struct remote_account *X,
+ char *imap_folder));
+ void set_remote_tempmbox(fh,X,imap_folder)
+ struct folder_info *fh;
+ struct remote_account *X;
+ char *imap_folder;
+ {
+ char * prefix = "mbox.";
+
+ /* In here we can use temp_dir instead of default_temp because
+ * that file does not act as session lock ...
+ */
+
+ if (imap_folder)
+
+ elm_sfprintf(fh-> cur_tempfolder,
+ sizeof fh -> cur_tempfolder,
+ FRM("%s%s%s@%s:%s"),
+ temp_dir,prefix,
+ X->username,
+ X->host,imap_folder);
+ else
+ elm_sfprintf(fh-> cur_tempfolder,
+ sizeof fh -> cur_tempfolder,
+ FRM("%s%s%s@%s"),
+ temp_dir,prefix,
+ X->username,X->host);
+
+ DPRINT(Debug,12,(&Debug,
+ "set_remote_tempmbox: cur_tempfolder=%s\n",
+ fh-> cur_tempfolder));
+ }
+
/* May free X (if succeed) or copy */
int make_remote_mbox(fh,X,se,rest,rewrite)
struct folder_info *fh;
***************
*** 759,765 ****
lib_error(CATGETS(elm_msg_cat, MeSet,MeUnknownRemoteMailboxType,
"Remote mailbox type of %S unknown"),
fh->cur_folder_disp);
! status = 0;
}
}

--- 793,799 ----
lib_error(CATGETS(elm_msg_cat, MeSet,MeUnknownRemoteMailboxType,
"Remote mailbox type of %S unknown"),
fh->cur_folder_disp);
! status = NULL;
}
}

***************
*** 771,788 ****
char *Y = strrchr(imap_only,'/');
if (!Y)
Y = imap_only;
! elm_sfprintf(fh-> cur_tempfolder,
! sizeof fh -> cur_tempfolder,
! FRM("%s%s%s@%s:%s"),
! temp_dir,temp_mbox,
! status->username,
! status->host,Y+1);
} else
! elm_sfprintf(fh-> cur_tempfolder,
! sizeof fh -> cur_tempfolder,
! FRM("%s%s%s@%s"),
! temp_dir,temp_mbox,
! status->username,status->host);
}

fail:
--- 805,816 ----
char *Y = strrchr(imap_only,'/');
if (!Y)
Y = imap_only;
!
! set_remote_tempmbox(fh,status,Y+1);
!
} else
! set_remote_tempmbox(fh,status,NULL);
!
}

fail:
Index: elm2.4.ME+.115-cvs/src/alias.c
*** elm2.4.ME+.114/src/alias.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115-cvs/src/alias.c 2004-04-07 20:42:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.34 2004/03/27 18:31:44 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias.c,v 1.35 2004/04/07 17:42:58 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 472,484 ****
lib_error(CATGETS(elm_msg_cat, AliasesSet,
AliasesNoAddressSpec,
"No address specified!"));
- free(buffer);
return(0);
}
} while (check_address(address1) == -1);

clear_error(); /* Just in case */
- free(buffer);
}

if (!is_group && strchr(address1,',') != NULL)
--- 472,482 ----
Index: elm2.4.ME+.115-cvs/src/syscall.c
*** elm2.4.ME+.114/src/syscall.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115-cvs/src/syscall.c 2004-04-12 21:40:52.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.32 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33 2004/04/12 18:40:52 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 176,182 ****
VOLATILE int iteration;
/* figure out what shell we are using here */
S__ status;
! register SIGHAND_TYPE (*istat)(), (*qstat)(), (*wstat)();
#ifdef SIGTSTP
register SIGHAND_TYPE (*oldstop)(), (*oldstart)();
#endif
--- 176,182 ----
VOLATILE int iteration;
/* figure out what shell we are using here */
S__ status;
! register SIGHAND_TYPE (*istat)(), (*qstat)();
#ifdef SIGTSTP
register SIGHAND_TYPE (*oldstop)(), (*oldstart)();
#endif
***************
*** 219,227 ****

istat = signal(SIGINT, SIG_IGN);
qstat = signal(SIGQUIT, SIG_IGN);
! #ifdef SIGWINCH
! wstat = signal(SIGWINCH, SIG_DFL);
! #endif
#ifdef SIGTSTP
oldstop = signal(SIGTSTP, SIG_DFL);
oldstart = signal(SIGCONT, SIG_DFL);
--- 219,229 ----

istat = signal(SIGINT, SIG_IGN);
qstat = signal(SIGQUIT, SIG_IGN);
!
! /* set SIGWINCH to SIG_DFL only on chlid
! so that Elm will call menu_context_resize()
! when it is waiting child to complete ...
! */
#ifdef SIGTSTP
oldstop = signal(SIGTSTP, SIG_DFL);
oldstart = signal(SIGCONT, SIG_DFL);
***************
*** 275,280 ****
--- 277,291 ----
_exit(127);
}

+ #ifdef SIGWINCH
+ /* set SIGWINCH to SIG_DFL only on chlid
+ so that Elm will call menu_context_resize()
+ when it is waiting child to complete ...
+ */
+
+ signal(SIGWINCH, SIG_DFL);
+ #endif
+
set_child_signals(options);

set_child_env(options);
***************
*** 313,321 ****

(void) signal(SIGINT, istat);
(void) signal(SIGQUIT, qstat);
- #ifdef SIGWINCH
- (void) signal(SIGWINCH, wstat);
- #endif
#ifdef SIGTSTP
(void) signal(SIGTSTP, oldstop);
(void) signal(SIGCONT, oldstart);
--- 324,329 ----

Kari E. Hurtta

unread,
Apr 26, 2004, 12:17:20 PM4/26/04
to
Archive-name: elm2.4ME+/PL115a

Elm 2.4ME+ PL115a (25) -patch

Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

file elm-2.4ME+PL115a.patch.gz
for a moment (2).

Is available on ftp.funet.fi
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL115.patch.gz

via WWW.

via WWW.

(1) Was ftp.ozone.fmi.fi but name ftp.ozone.fmi.fi
will probably point to service which no have anonymous ftp
before ozone.fmi.fi retires. So use ozone.fmi.fi
for a moment instead of ftp.ozone.fmi.fi.

(2) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi.

Also ozone.fmi.fi will retire.

For apply patch use command
patch -p1 < {path...}/elm-2.4ME+PL115.patch
on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

SUMMARY: This patch fixes handling of unexpected return
value of nl_langinfo(CODESET) on AIX, fixes
value check of "internal-mailcaps" and
"metamail-mailcaps" elmrc variables and
fixes some prompts on situation where leaving
of folder fails.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL115 (25) --------------------------------

For apply patch use command
patch -p1 < this-file
on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)


Index: elm2.4.ME+.115a-cvs/hdrs/patchlevel.h
Prereq: 1113000000
*** elm2.4.ME+.115/hdrs/patchlevel.h 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.115a-cvs/hdrs/patchlevel.h 2004-04-23 19:44:32.000000000 +0300
***************
*** 1,8 ****


! #define PATCHLEVEL "115 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.115
*/
! #define LAST_REPORT_TIME 1113000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
#define VERS_DATE "Apr, 2004" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "115a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.115
*/
! #define LAST_REPORT_TIME 1114000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
#define VERS_DATE "Apr, 2004" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.115a-cvs/README.ME+
*** elm2.4.ME+.115/README.ME+ 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.115a-cvs/README.ME+ 2004-04-24 15:30:01.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.733 2004/04/12 19:27:31 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.746 2004/04/24 12:30:01 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,30 ****


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

Changes of Elm2.4ME+ PL115 (25) compared with Elm2.4ME+ PL114 (25)

------------------------------------------------------------------

! SuMMARY: This release changes temporary folder
! location on some situations, fixs crash


on c)hange command on alias menu, adds
elmrc options "local-sessionlock-dir" and
"local-sessionlock-use-home", and changes

! SIGWICH handling when waiting of editor.

! - If opened local mailbox is on somewhere other
! location than on spool directory, use "tmpdir" setting


from elm.rc for location of temporary file

"mbox.{mailbox}-{username}" instead default_temp.

--- 13,75 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL115a (25) compared with Elm2.4ME+ PL115 (25)
+ -------------------------------------------------------------------
+
+ [ This patch is branch from the main line. ]
+
+ SUMMARY: This patch fixes handling of unexpected return
+ value of nl_langinfo(CODESET) on AIX, fixes
+ value check of "internal-mailcaps" and
+ "metamail-mailcaps" elmrc variables and
+ fixes some prompts on situation where leaving
+ of folder fails.
+
+ - " When installing ELM (on AIX 5L), I get the following message:
+

+ | Elm: Unable to map en_US locale (LC_CTYPE) to MIME charset.

+ | Codeset name ISO8859-1 was unknown. Treating ISO8859-1 as MIME name.
+ | Check /usr/local/lib/elm/elm.mimecharsets or
+ | noam/.elm/mime.charsets
+ | WARNING: Locale en_US (charset ISO8859-1) is unsupported, will cause problems!


+ | Problem with locale (system character set)! Elm ME+ will

+ | behave erratically."
+ Problem noted by: Noam G. Nudelman <no...@mail.biu.ac.il>
+
+ - dt_PATH_print_value() was not printing always empty values
+ correctly.
+
+ - fix test on expand_dt_path(). Specially non-file
+ values on "internal-mailcaps" and "metamail-mailcaps" was
+ not giving error message.
+
+ - Prompt "Failed to leave folder: Try to change again ?
+ [P]anic" did not worked. Added new routine prompt_letter()
+
+ - Changed prompt "Failed to leave folder: Try to quit again ?"
+
+ - Changed prompt ""received" folder not available, continue? (y/n) n"
+ - Also changed default answer to be yes on that prompt
+ (that is usefull only when received folder is remote,
+ but that error may occur also is somebody is set
+ receivedmail = /invalid
+ )
+
+ - Fix some possible compilation problems with traditional
+ C compilers (as opposed to ANSI C ompilers)


+
Changes of Elm2.4ME+ PL115 (25) compared with Elm2.4ME+ PL114 (25)

------------------------------------------------------------------

! SUMMARY: This release changes temporary folder
! location on some situations, fixes crash


on c)hange command on alias menu, adds
elmrc options "local-sessionlock-dir" and
"local-sessionlock-use-home", and changes

! SIGWINCH handling when waiting for editor.

! - If opened local mailbox is on somewhere else
! than on spool directory, use "tmpdir" setting


from elm.rc for location of temporary file

"mbox.{mailbox}-{username}" instead default_temp.

***************
*** 78,84 ****


so that Elm will call menu_context_resize() when it is

waiting child to complete ...

-
New elmrc options:
local-sessionlock-dir
local-sessionlock-use-home
--- 123,128 ----
***************
*** 169,175 ****
Changes of Elm2.4ME+ PL113a (25) compared with Elm2.4ME+ PL113 (25)
-------------------------------------------------------------------

! [ This is out of branch patch. ]



- "I tried to compile elm2.4.ME+.113 on AIX 5.1 (maintenance

level 05) or on AIX 5.2 (maintenance level 02)

--- 213,219 ----
Changes of Elm2.4ME+ PL113a (25) compared with Elm2.4ME+ PL113 (25)
-------------------------------------------------------------------

! [ This patch is branch from the main line. ]



- "I tried to compile elm2.4.ME+.113 on AIX 5.1 (maintenance

level 05) or on AIX 5.2 (maintenance level 02)

***************
*** 338,344 ****


Changes of Elm2.4ME+ PL111b (25) compared with Elm2.4ME+ PL111a (25)

--------------------------------------------------------------------

! [ This is out of branch patch. ]



- Fix crash on parse failure on command

"View digest as mailbox".

--- 382,388 ----


Changes of Elm2.4ME+ PL111b (25) compared with Elm2.4ME+ PL111a (25)

--------------------------------------------------------------------

! [ This patch is branch from the main line. ]



- Fix crash on parse failure on command

"View digest as mailbox".

***************
*** 346,352 ****


Changes of Elm2.4ME+ PL111a (25) compared with Elm2.4ME+ PL111 (25)

-------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch fixes crash caused by 'U' command
on aliases menu.

--- 390,396 ----


Changes of Elm2.4ME+ PL111a (25) compared with Elm2.4ME+ PL111 (25)

-------------------------------------------------------------------

! [ This patch is branch from the main line. ]



SUMMARY: This patch fixes crash caused by 'U' command
on aliases menu.

***************
*** 429,435 ****
Changes of Elm2.4ME+ PL110a (25) compared with Elm2.4ME+ PL110 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes case, where output of pgp/gpg was
not shown sometimes (on non-MIME messages),
--- 473,479 ----
Changes of Elm2.4ME+ PL110a (25) compared with Elm2.4ME+ PL110 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes case, where output of pgp/gpg was
not shown sometimes (on non-MIME messages),
***************
*** 569,575 ****


Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)

-------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch fixes segmentation violation on

l)imit command and problem where user alias

--- 613,619 ----


Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)

-------------------------------------------------------------------

! [ This patch is branch from the main line. ]



SUMMARY: This patch fixes segmentation violation on

l)imit command and problem where user alias

***************
*** 585,591 ****


Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

-------------------------------------------------------------------

! [ This is out of branch patch. ]

Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

--- 629,635 ----


Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

***************
*** 814,820 ****
Changes of Elm2.4ME+ PL108a (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch makes some fixes for elmregister,

and elm's search command ('/').

--- 858,864 ----
Changes of Elm2.4ME+ PL108a (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]



SUMMARY: This patch makes some fixes for elmregister,

and elm's search command ('/').

***************
*** 929,935 ****


Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch corrects page when returning
from o)ptions screen and fixes some other

--- 973,979 ----


Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]



SUMMARY: This patch corrects page when returning
from o)ptions screen and fixes some other

***************
*** 1242,1248 ****


Changes of Elm2.4ME+ PL102a (25) compared with Elm2.4ME+ PL102 (25)

------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch fixes temp file leak

when forwarding with mimeforward = YES and

--- 1286,1292 ----


Changes of Elm2.4ME+ PL102a (25) compared with Elm2.4ME+ PL102 (25)

------------------------------------------------------------------

! [ This patch is branch from the main line. ]



SUMMARY: This patch fixes temp file leak

when forwarding with mimeforward = YES and

***************
*** 1571,1577 ****


Changes of Elm2.4ME+ PL101c (25) compared with Elm2.4ME+ PL101b (25)

--------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes segmentation fault, when


when viewing attachment with unxepected

--- 1615,1621 ----


Changes of Elm2.4ME+ PL101c (25) compared with Elm2.4ME+ PL101b (25)

--------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes segmentation fault, when


when viewing attachment with unxepected

***************
*** 1784,1790 ****


Changes of Elm2.4ME+ PL101b (25) compared with Elm2.4ME+ PL101a (25)

--------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch makes possible to set

incoming-mailbox = $USER@imap-sever on
--- 1828,1834 ----


Changes of Elm2.4ME+ PL101b (25) compared with Elm2.4ME+ PL101a (25)

--------------------------------------------------------------------

! [ This patch is branch from the main line. ]



SUMMARY: This patch makes possible to set

incoming-mailbox = $USER@imap-sever on
***************
*** 1832,1838 ****


Changes of Elm2.4ME+ PL101a (25) compared with Elm2.4ME+ PL101 (25)

-------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch fixes crash on internal mailcap parser

and on header editing screen.

--- 1876,1882 ----


Changes of Elm2.4ME+ PL101a (25) compared with Elm2.4ME+ PL101 (25)

-------------------------------------------------------------------

! [ This patch is branch from the main line. ]



SUMMARY: This patch fixes crash on internal mailcap parser

and on header editing screen.

***************
*** 2014,2020 ****
Changes of Elm2.4ME+ PL100a (25) compared with Elm2.4ME+ PL100 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Configure did not generated mapping for iso_8859_1
locale (on SunOS).
--- 2058,2064 ----
Changes of Elm2.4ME+ PL100a (25) compared with Elm2.4ME+ PL100 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Configure did not generated mapping for iso_8859_1
locale (on SunOS).
***************
*** 2341,2347 ****
Changes of Elm2.4ME+ PL99f (25) compared with Elm2.4ME+ PL99e (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix panic on header editing screen on In-Reply-To:
STRING PANIC in cs_binary.c:1043:cs_give_unicode_from_ascii
--- 2385,2391 ----
Changes of Elm2.4ME+ PL99f (25) compared with Elm2.4ME+ PL99e (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix panic on header editing screen on In-Reply-To:
STRING PANIC in cs_binary.c:1043:cs_give_unicode_from_ascii
***************
*** 2366,2372 ****
Changes of Elm2.4ME+ PL99e (25) compared with Elm2.4ME+ PL99d (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Trying send pgp2 (signed or encrypted) message
was causing crash.
--- 2410,2416 ----
Changes of Elm2.4ME+ PL99e (25) compared with Elm2.4ME+ PL99d (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Trying send pgp2 (signed or encrypted) message
was causing crash.
***************
*** 2394,2400 ****
Changes of Elm2.4ME+ PL99d (25) compared with Elm2.4ME+ PL99c (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- "I'm working on updating the Debian elm-me+ package; a
number of patches have accumulated over the years, and
--- 2438,2444 ----
Changes of Elm2.4ME+ PL99d (25) compared with Elm2.4ME+ PL99c (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "I'm working on updating the Debian elm-me+ package; a
number of patches have accumulated over the years, and
***************
*** 2475,2481 ****
Changes of Elm2.4ME+ PL99c (25) compared with Elm2.4ME+ PL99b (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Handling of multipart/signed and
multipart/encrypted was broken Elm2.4ME+ PL98 (25)
--- 2519,2525 ----
Changes of Elm2.4ME+ PL99c (25) compared with Elm2.4ME+ PL99b (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Handling of multipart/signed and
multipart/encrypted was broken Elm2.4ME+ PL98 (25)
***************
*** 2484,2490 ****
Changes of Elm2.4ME+ PL99b (25) compared with Elm2.4ME+ PL99a (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix panic with ISO-2022-JP text with message
STRING PANIC in cs_iso2022.c:1757:add_char_stream
--- 2528,2534 ----
Changes of Elm2.4ME+ PL99b (25) compared with Elm2.4ME+ PL99a (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix panic with ISO-2022-JP text with message
STRING PANIC in cs_iso2022.c:1757:add_char_stream
***************
*** 2495,2501 ****
Changes of Elm2.4ME+ PL99a (25) compared with Elm2.4ME+ PL99 (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- There should not be Return-Path header visible
on Pre-Send screen on Beginner user level.
--- 2539,2545 ----
Changes of Elm2.4ME+ PL99a (25) compared with Elm2.4ME+ PL99 (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- There should not be Return-Path header visible
on Pre-Send screen on Beginner user level.
***************
*** 2744,2750 ****
Changes of Elm2.4ME+ PL98c (25) compared with Elm2.4ME+ PL98b (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- copy_message_2() lost header name when folding happeded
immediately after header name (that specially was visible
--- 2788,2794 ----
Changes of Elm2.4ME+ PL98c (25) compared with Elm2.4ME+ PL98b (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- copy_message_2() lost header name when folding happeded
immediately after header name (that specially was visible
***************
*** 2767,2773 ****
Changes of Elm2.4ME+ PL98b (25) compared with Elm2.4ME+ PL98a (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Our non-standard headers was ignored:
* X-ELM-OSV: hdr-charset=xxxx was ignored
--- 2811,2817 ----
Changes of Elm2.4ME+ PL98b (25) compared with Elm2.4ME+ PL98a (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Our non-standard headers was ignored:
* X-ELM-OSV: hdr-charset=xxxx was ignored
***************
*** 2776,2782 ****
Changes of Elm2.4ME+ PL98a (25) compared with Elm2.4ME+ PL98 (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- "since a number of releases frm doesn't detect status
new correctly for me (Linux 2.4.18, elm2.4.ME+.98)."
--- 2820,2826 ----
Changes of Elm2.4ME+ PL98a (25) compared with Elm2.4ME+ PL98 (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "since a number of releases frm doesn't detect status
new correctly for me (Linux 2.4.18, elm2.4.ME+.98)."
***************
*** 2969,2975 ****
Changes of Elm2.4ME+ PL97d (25) compared with Elm2.4ME+ PL97c (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]


- If there libintl.so (from GNU gettext) installed
--- 3013,3019 ----
Changes of Elm2.4ME+ PL97d (25) compared with Elm2.4ME+ PL97c (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]


- If there libintl.so (from GNU gettext) installed
***************
*** 3002,3008 ****
Changes of Elm2.4ME+ PL97c (25) compared with Elm2.4ME+ PL97b (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Wrong answer to question "Any additional libraries"
causes failure on "Trying locate terminfo routines"
--- 3046,3052 ----
Changes of Elm2.4ME+ PL97c (25) compared with Elm2.4ME+ PL97b (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Wrong answer to question "Any additional libraries"
causes failure on "Trying locate terminfo routines"
***************
*** 3052,3058 ****
Changes of Elm2.4ME+ PL97b (25) compared with Elm2.4ME+ PL97a (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- binary flag was incorrectly set true (result on change
on Elm2.4ME+ PL97 (25)). That caused that EOLN mail headers
--- 3096,3102 ----
Changes of Elm2.4ME+ PL97b (25) compared with Elm2.4ME+ PL97a (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- binary flag was incorrectly set true (result on change
on Elm2.4ME+ PL97 (25)). That caused that EOLN mail headers
***************
*** 3065,3071 ****


Changes of Elm2.4ME+ PL97a (25) compared with Elm2.4ME+ PL97 (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]



- Fix state_printf panic "Embedded newlines are not supported"
on case when there is on ~/.elm/elmheaders

--- 3109,3115 ----


Changes of Elm2.4ME+ PL97a (25) compared with Elm2.4ME+ PL97 (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]



- Fix state_printf panic "Embedded newlines are not supported"
on case when there is on ~/.elm/elmheaders

***************
*** 3195,3201 ****
Changes of Elm2.4ME+ PL96b (25) compared with Elm2.4ME+ PL96a (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Test whatever make sets $(MAKE)

--- 3239,3245 ----
Changes of Elm2.4ME+ PL96b (25) compared with Elm2.4ME+ PL96a (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Test whatever make sets $(MAKE)

***************
*** 3225,3231 ****
Changes of Elm2.4ME+ PL96a (25) compared with Elm2.4ME+ PL96 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- Metamail can not cope with CRLF
Problem noted by: Konstantinos Konstantinides <k...@corp.cirrus.com>
--- 3269,3275 ----
Changes of Elm2.4ME+ PL96a (25) compared with Elm2.4ME+ PL96 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Metamail can not cope with CRLF
Problem noted by: Konstantinos Konstantinides <k...@corp.cirrus.com>
***************
*** 3424,3430 ****


Changes of Elm2.4ME+ PL95c (25) compared with Elm2.4ME+ PL95b (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]



- Do not use commands "mail" or "mailx" as mailer.
- Allow specify "none" as mailer on configuration time

--- 3468,3474 ----


Changes of Elm2.4ME+ PL95c (25) compared with Elm2.4ME+ PL95b (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]



- Do not use commands "mail" or "mailx" as mailer.
- Allow specify "none" as mailer on configuration time

***************
*** 3440,3446 ****
Changes of Elm2.4ME+ PL95b (25) compared with Elm2.4ME+ PL95a (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- "Using PL95 with the two patches you send me, I encountered the
following problem when searching for a string in a mail message:
--- 3484,3490 ----
Changes of Elm2.4ME+ PL95b (25) compared with Elm2.4ME+ PL95a (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Using PL95 with the two patches you send me, I encountered the
following problem when searching for a string in a mail message:
***************
*** 3458,3464 ****
Changes of Elm2.4ME+ PL95a (25) compared with Elm2.4ME+ PL95 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- "Following please find the error when trying to
compile elm2.4.ME+.95 on AIX 4.3.3 (maintenance level 09):
--- 3502,3508 ----
Changes of Elm2.4ME+ PL95a (25) compared with Elm2.4ME+ PL95 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Following please find the error when trying to
compile elm2.4.ME+.95 on AIX 4.3.3 (maintenance level 09):
***************
*** 3766,3772 ****
Changes of Elm2.4ME+ PL94a (25) compared with Elm2.4ME+ PL94 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- When sending mail, saving copy of mail to folder
failed when
--- 3810,3816 ----
Changes of Elm2.4ME+ PL94a (25) compared with Elm2.4ME+ PL94 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- When sending mail, saving copy of mail to folder
failed when
***************
*** 3970,3976 ****
Changes of Elm2.4ME+ PL92a (25) compared with Elm2.4ME+ PL92 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- "Until I did this I could not get it to build correctly on
solaris 8 (even if I didn't want to use the sharedlibs --
--- 4014,4020 ----
Changes of Elm2.4ME+ PL92a (25) compared with Elm2.4ME+ PL92 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Until I did this I could not get it to build correctly on
solaris 8 (even if I didn't want to use the sharedlibs --
***************
*** 4206,4212 ****
Changes of Elm2.4ME+ PL90a (25) compared with Elm2.4ME+ PL90
------------------------------------------------------------

! [ This is out of branch patch. ]

- "Running Elm 2.4ME+86, if I displayed the first 80% of
a message using the built-in text browser, pressing
--- 4250,4256 ----
Changes of Elm2.4ME+ PL90a (25) compared with Elm2.4ME+ PL90
------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Running Elm 2.4ME+86, if I displayed the first 80% of
a message using the built-in text browser, pressing
***************
*** 4346,4352 ****
Changes of Elm2.4ME+ PL88a (25) compared with Elm2.4ME+ PL88 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- In newmail.c and from.c utilities header_charset
was not set.
--- 4390,4396 ----
Changes of Elm2.4ME+ PL88a (25) compared with Elm2.4ME+ PL88 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- In newmail.c and from.c utilities header_charset
was not set.
***************
*** 4614,4620 ****

Changes of Elm2.4ME+ PL84a (25) compared with Elm2.4ME+ PL84 (25)
-----------------------------------------------------------------
! [ This is out of branch patch. ]

- 'struct string * ret' was incorrectly static on
browser_descend_imap(). That caused Elm to crash,
--- 4658,4664 ----

Changes of Elm2.4ME+ PL84a (25) compared with Elm2.4ME+ PL84 (25)
-----------------------------------------------------------------
! [ This patch is branch from the main line. ]

- 'struct string * ret' was incorrectly static on
browser_descend_imap(). That caused Elm to crash,
***************
*** 5357,5363 ****

Changes of Elm2.4ME+ PL76a (25) compared with Elm2.4ME+ PL76 (25)
-----------------------------------------------------------------
! [ This is out of branch patch. ]

- On PL73 [encode] was producing (by mistake)
text/X-ELM-encode instead of application/X-ELM-encode as
--- 5401,5407 ----

Changes of Elm2.4ME+ PL76a (25) compared with Elm2.4ME+ PL76 (25)
-----------------------------------------------------------------
! [ This patch is branch from the main line. ]

- On PL73 [encode] was producing (by mistake)
text/X-ELM-encode instead of application/X-ELM-encode as
***************
*** 6716,6722 ****
Changes of Elm2.4ME+ PL53Y (25) compared with Elm2.4ME+ PL53 (25)
---------------------------------------------------------------

! [ This is out of branch patch. ]

- Test that year >= 0 instead of year > 0 on
cvt_yearstr_to_yearnum(). That affects if
--- 6760,6766 ----
Changes of Elm2.4ME+ PL53Y (25) compared with Elm2.4ME+ PL53 (25)
---------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Test that year >= 0 instead of year > 0 on
cvt_yearstr_to_yearnum(). That affects if
***************
*** 6868,6874 ****
Changes of Elm2.4ME+ PL50s (25) compared with Elm2.4ME+ PL50 (25)
--------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix incorrect bound checking on putc_so_string()
(state.c)
--- 6912,6918 ----
Changes of Elm2.4ME+ PL50s (25) compared with Elm2.4ME+ PL50 (25)
--------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix incorrect bound checking on putc_so_string()
(state.c)
***************
*** 7509,7515 ****
Changes of Elm2.4ME+ PL31H (25) compared with Elm2.4ME+ PL31 (25)
---------------------------------------------------------------

! [ This is out of branch patch. ]

- Incorrect Content-length: -header was causing corruption
of folders.
--- 7553,7559 ----
Changes of Elm2.4ME+ PL31H (25) compared with Elm2.4ME+ PL31 (25)
---------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Incorrect Content-length: -header was causing corruption
of folders.
Index: elm2.4.ME+.115a-cvs/hdrs/mbx_imp.h
*** elm2.4.ME+.115/hdrs/mbx_imp.h 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.115a-cvs/hdrs/mbx_imp.h 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****


! /* $Id: mbx_imp.h,v 1.66 2004/04/04 06:17:17 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: mbx_imp.h,v 1.67 2004/04/24 12:30:02 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 749,758 ****
#define STFLAG_is_submission 0x0400
#define STFLAG_is_smtp 0x0800

! extern const struct service_type * IMAP_SERVICE;
! extern const struct service_type * POP_SERVICE;
! extern const struct service_type * SUBMISSION_SERVICE;
! extern const struct service_type * SMTP_SERVICE;

extern struct service_entry {
int flags;
--- 749,758 ----
#define STFLAG_is_submission 0x0400
#define STFLAG_is_smtp 0x0800

! extern CONST struct service_type * IMAP_SERVICE;
! extern CONST struct service_type * POP_SERVICE;
! extern CONST struct service_type * SUBMISSION_SERVICE;
! extern CONST struct service_type * SMTP_SERVICE;

extern struct service_entry {
int flags;
Index: elm2.4.ME+.115a-cvs/hdrs/me.h
*** elm2.4.ME+.115/hdrs/me.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115a-cvs/hdrs/me.h 2004-04-24 10:35:47.000000000 +0300
***************
*** 1,7 ****
! /* $Id: me.h,v 1.87 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.88 2004/04/24 07:35:47 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.88 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 119,124 ****
--- 119,135 ----
int *redraw,
struct menu_context *page));

+ #define PROMPT_center 1
+ #define PROMTP_yesno 2
+ #define PROMPT_redraw_mark 4
+ #define PROMTP_ctrlL 8
+
+ extern int prompt_letter P_((int line, char *letters, int def,
+ int flags,
+ struct menu_context *page,
+ const char * format, const char *msg, ...));
+
+
#define OE_APPEND_CURRENT (1<<0)
#define OE_PASSWD (1<<1)
#define OE_REDRAW_MARK (1<<2)
Index: elm2.4.ME+.115a-cvs/hdrs/s_elm.h
*** elm2.4.ME+.115/hdrs/s_elm.h 2004-03-16 21:17:43.000000000 +0200
--- elm2.4.ME+.115a-cvs/hdrs/s_elm.h 2004-04-24 10:53:35.000000000 +0300
***************
*** 1097,1099 ****
--- 1097,1100 ----
#define ElmCharsetBadOverride 0x865
#define ElmObsoleteInElmrc 0x866
#define ElmPgpRcvSure 0x867
+ #define ElmFailedLeaveChange 0x868
Index: elm2.4.ME+.115a-cvs/lib/bindata.c
*** elm2.4.ME+.115/lib/bindata.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/bindata.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: bindata.c,v 1.4 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: bindata.c,v 1.5 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 744,750 ****
struct bindata_format_1 *v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! const char *filename;
{
int status = 0,i;
struct csets_1 *y;
--- 744,750 ----
struct bindata_format_1 *v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! CONST char *filename;
{
int status = 0,i;
struct csets_1 *y;
***************
*** 793,799 ****
struct bindata_mapped_data * v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! const char *filename;
{
int r = 0;

--- 793,799 ----
struct bindata_mapped_data * v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! CONST char *filename;
{
int r = 0;

***************
*** 988,994 ****


/* bzero is defined on hdrs/defs.h

*/

! bzero(ret, sizeof (*ret));

ret->format = bindata_format_1;
ret->v.f1.header = v;
--- 988,994 ----


/* bzero is defined on hdrs/defs.h

*/

! bzero((void *)ret, sizeof (*ret));

ret->format = bindata_format_1;
ret->v.f1.header = v;
***************
*** 999,1005 ****

struct bindata_map * give_mapping(v,mapname)
struct bindata_mapped_data *v;
! const char *mapname;
{


struct bindata_map *ret = NULL;

--- 999,1005 ----

struct bindata_map * give_mapping(v,mapname)
struct bindata_mapped_data *v;
! CONST char *mapname;
{


struct bindata_map *ret = NULL;

Index: elm2.4.ME+.115a-cvs/lib/cs_iso2022.c
*** elm2.4.ME+.115/lib/cs_iso2022.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/cs_iso2022.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.35 2004/03/27 18:31:38 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.36 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1078,1084 ****
S_(cs_add_intdata_to_string cs_add_intdata_to_iso2022_gen)
static void cs_add_intdata_to_iso2022_gen(str,data)
struct string *str;
! const struct string *data;
{
int i;
struct mb_data * X1 = str->p->a.data;
--- 1078,1084 ----
S_(cs_add_intdata_to_string cs_add_intdata_to_iso2022_gen)
static void cs_add_intdata_to_iso2022_gen(str,data)
struct string *str;
! CONST struct string *data;
{
int i;
struct mb_data * X1 = str->p->a.data;
***************
*** 1229,1235 ****

S_(cs_give_unicode_from_string cs_give_unicode_from_iso2022_gen)
static uint16 cs_give_unicode_from_iso2022_gen(str,pos,found)
! const struct string *str;
int pos;
int *found;
{
--- 1229,1235 ----

S_(cs_give_unicode_from_string cs_give_unicode_from_iso2022_gen)
static uint16 cs_give_unicode_from_iso2022_gen(str,pos,found)
! CONST struct string *str;
int pos;
int *found;
{
***************
*** 1421,1427 ****
static void cs_add_unicodedata_to_iso2022_gen(str,len,data)
struct string *str;
int len;
! const uint16 *data;
{
int i;

--- 1421,1427 ----
static void cs_add_unicodedata_to_iso2022_gen(str,len,data)
struct string *str;
int len;
! CONST uint16 *data;
{
int i;

***************
*** 3436,3442 ****
S_(cs_clip_from_string cs_clip_from_iso2022_gen)
static void cs_clip_from_iso2022_gen(ret,str,pos,len)
struct string *ret;
! const struct string *str;
int *pos;

int len;
{
--- 3436,3442 ----

S_(cs_clip_from_string cs_clip_from_iso2022_gen)
static void cs_clip_from_iso2022_gen(ret,str,pos,len)
struct string *ret;
! CONST struct string *str;
int *pos;
int len;
{
***************
*** 3544,3550 ****
static int cs_add_streambytes_to_iso2022_gen(str,count,data)
struct string *str;
int count;
! const unsigned char *data;
{
int i = 0;
struct state_iso2022 * X ;
--- 3544,3550 ----
static int cs_add_streambytes_to_iso2022_gen(str,count,data)
struct string *str;
int count;
! CONST unsigned char *data;
{
int i = 0;
struct state_iso2022 * X ;
Index: elm2.4.ME+.115a-cvs/lib/headers.c
*** elm2.4.ME+.115/lib/headers.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/headers.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: headers.c,v 1.29 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: headers.c,v 1.30 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 400,406 ****
static int no_add_to_mail_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
--- 400,406 ----
static int no_add_to_mail_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;
Index: elm2.4.ME+.115a-cvs/lib/localmbx.c
*** elm2.4.ME+.115/lib/localmbx.c 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/localmbx.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.64 2004/04/04 06:17:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.65 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.65 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 1607,1613 ****
can_remove = buf.st_mtime < now - 10 * 60;
DPRINT(Debug,1,(&Debug,
" (modified %1.1f minutes ago)\n",
! (now - buf.st_mtime) / 60.0));
}
if (stat2_code == 0) {
DPRINT(Debug,1,(&Debug,
--- 1607,1613 ----
can_remove = buf.st_mtime < now - 10 * 60;
DPRINT(Debug,1,(&Debug,
" (modified %1.1f minutes ago)\n",
! (double)(now - buf.st_mtime) / 60.0));
}
if (stat2_code == 0) {
DPRINT(Debug,1,(&Debug,
***************
*** 1617,1623 ****
can_remove = 0;
DPRINT(Debug,1,(&Debug,
" (read %1.1f minutes ago)\n",
! (now - buf2.st_atime) / 60.0));
}
DPRINT(Debug,2,(&Debug,
"mbx_dotlock_file: can remove = %d \n",
--- 1617,1623 ----
can_remove = 0;
DPRINT(Debug,1,(&Debug,
" (read %1.1f minutes ago)\n",
! (double)(now - buf2.st_atime) / 60.0));
}
DPRINT(Debug,2,(&Debug,
"mbx_dotlock_file: can remove = %d \n",
Index: elm2.4.ME+.115a-cvs/lib/mbox.c
*** elm2.4.ME+.115/lib/mbox.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/mbox.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mbox.c,v 1.52 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 144,150 ****
*ptr));

/* bzero is defined hdrs/defs.h */
! bzero(*ptr,sizeof (struct read_folder_state));

(*ptr) -> magic = RF_magic;
(*ptr) -> fbytes = 0;
--- 144,150 ----
*ptr));

/* bzero is defined hdrs/defs.h */
! bzero((void *)*ptr,sizeof (struct read_folder_state));

(*ptr) -> magic = RF_magic;
(*ptr) -> fbytes = 0;
***************
*** 166,172 ****
*ptr));

/* bzero is defined hdrs/defs.h */
! bzero(*ptr,sizeof (struct read_folder_state));

free(*ptr);
*ptr = NULL;
--- 166,172 ----
*ptr));

/* bzero is defined hdrs/defs.h */
! bzero((void *)*ptr,sizeof (struct read_folder_state));

free(*ptr);
*ptr = NULL;
***************
*** 839,845 ****
new_folder = safe_malloc(sizeof (struct folder_info));

/* defined in hdrs/defs.h */
! bzero(new_folder,sizeof (struct folder_info));

new_folder -> p = NULL;
new_folder -> cur_folder_sys = NULL;
--- 839,845 ----
new_folder = safe_malloc(sizeof (struct folder_info));

/* defined in hdrs/defs.h */
! bzero((void *)new_folder,sizeof (struct folder_info));

new_folder -> p = NULL;
new_folder -> cur_folder_sys = NULL;
Index: elm2.4.ME+.115a-cvs/lib/mediatype.c
*** elm2.4.ME+.115/lib/mediatype.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/mediatype.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.12 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.13 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 184,190 ****
}

enum mime_major_type give_major_type(major,create)


! const char * major;

int create;
{
int i;
--- 184,190 ----
}

enum mime_major_type give_major_type(major,create)
! CONST char * major;
int create;
{
int i;
***************
*** 228,235 ****


}

media_type_t give_media_type(major,minor,create)
! const char * major;

! const char * minor;
int create;
{

--- 228,235 ----
}

media_type_t give_media_type(major,minor,create)
! CONST char * major;
! CONST char * minor;
int create;
{

***************
*** 243,249 ****

media_type_t give_media_type2(major_type_code,minor,create)
enum mime_major_type major_type_code;
! const char * minor;
int create;
{
struct media_type * p;
--- 243,249 ----

media_type_t give_media_type2(major_type_code,minor,create)
enum mime_major_type major_type_code;
! CONST char * minor;
int create;
{
struct media_type * p;
Index: elm2.4.ME+.115a-cvs/lib/outheaders.c
*** elm2.4.ME+.115/lib/outheaders.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/outheaders.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.15 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 38,44 ****
struct mailing_headers *hdrs;
{
/* bzero is defined hdrs/defs.h */
! bzero(hdrs,sizeof (*hdrs));

hdrs->magic = MAIL_HDR_magic;

--- 38,44 ----
struct mailing_headers *hdrs;
{
/* bzero is defined hdrs/defs.h */
! bzero((void *)hdrs,sizeof (*hdrs));

hdrs->magic = MAIL_HDR_magic;

***************
*** 114,120 ****

/* Make sure that dangling pointters are catched */
/* bzero is defined hdrs/defs.h */
! bzero(hdrs,sizeof (*hdrs));

}

--- 114,120 ----

/* Make sure that dangling pointters are catched */
/* bzero is defined hdrs/defs.h */
! bzero((void *)hdrs,sizeof (*hdrs));

}

***************
*** 166,172 ****
struct expanded_address *x;
{
/* bzero is defined hdrs/defs.h */
! bzero(x,sizeof (*x));
x->magic = EXP_ADDR_magic;

x->addrs = NULL;
--- 166,172 ----
struct expanded_address *x;
{
/* bzero is defined hdrs/defs.h */
! bzero((void *)x,sizeof (*x));
x->magic = EXP_ADDR_magic;

x->addrs = NULL;
***************
*** 589,595 ****
int add_subject_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
--- 589,595 ----
int add_subject_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;
***************
*** 612,618 ****
int add_user_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
--- 612,618 ----
int add_user_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;
Index: elm2.4.ME+.115a-cvs/lib/rc_handle.c
*** elm2.4.ME+.115/lib/rc_handle.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/rc_handle.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.22 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

***************
*** 16,22 ****
--- 16,24 ----
#include "headers.h"
#include "rc_imp.h"
#include "save_opts.h"
+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif
#include "s_elm.h"

DEBUG_VAR(Debug,__FILE__,"config");
***************
*** 1374,1380 ****

}

! if (is_dir &&
#ifdef S_ISREG
!S_ISREG(S.st_mode)
#else
--- 1376,1382 ----

}

! if (is_file &&
#ifdef S_ISREG
!S_ISREG(S.st_mode)
#else
***************
*** 1586,1596 ****

if (comment)
fprintf(F, "### ");

for (i = 0; i < r->val.path->nlen; i++) {
! if (0 == i)
! fprintf(F, "%s = ",r->name);
! else {
if (len + strlen(r->val.path->list[i]) > 70) {
fprintf(F, "\n");
if (comment)
--- 1588,1598 ----

if (comment)
fprintf(F, "### ");
+
+ fprintf(F, "%s = ",r->name);

for (i = 0; i < r->val.path->nlen; i++) {
! if (i > 0) {
if (len + strlen(r->val.path->list[i]) > 70) {
fprintf(F, "\n");
if (comment)
Index: elm2.4.ME+.115a-cvs/lib/read_rc.c
*** elm2.4.ME+.115/lib/read_rc.c 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/read_rc.c 2004-04-18 21:03:04.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133 2004/04/04 06:17:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.134 2004/04/18 18:03:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.134 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 692,698 ****
return;


}

! if (0 == strcmp(lc_ctype,"C"))
system_charset = MIME_name_to_charset("US-ASCII",
CHARSET_create);

else if (0 == istrcmp(lc_ctype,"ASCII") ||
--- 692,736 ----
return;
}

! /* 1) ------ guess based on codeset ------------------------ */
!
! if (codeset[0] &&
! 0 == strincmp(codeset,"ISO-8859-",9) &&
! 0 < (val = atoi(codeset+9))) {
! elm_sfprintf(buffer, sizeof buffer,
! FRM("ISO-8859-%d"),
! val);
! system_charset = MIME_name_to_charset(buffer,
! CHARSET_create);
! } else if (codeset[0] &&
! 0 == strincmp(codeset,"ISO_8859-",9) &&
! 0 < (val = atoi(codeset+9))) {
! elm_sfprintf(buffer, sizeof buffer,
! FRM("ISO-8859-%d"),
! val);
! system_charset = MIME_name_to_charset(buffer,
! CHARSET_create);
! } else if (codeset[0] &&
! 0 == strincmp(codeset,"ISO8859-",8) &&
! 0 < (val = atoi(codeset+8))) {
! elm_sfprintf(buffer, sizeof buffer,
! FRM("ISO-8859-%d"),
! val);
! system_charset = MIME_name_to_charset(buffer,
! CHARSET_create);
! } else if (codeset[0] &&
! 0 == strincmp(codeset,"ISO8859",7) &&
! isascii(codeset[7]) && isdigit(codeset[7]) &&
! '\0' == codeset[8]) {
! elm_sfprintf(buffer, sizeof buffer,
! FRM("ISO-8859-%c"),
! codeset[7]);
! system_charset = MIME_name_to_charset(buffer,
! CHARSET_create);
!
! /* 2) ------ guess based on lc_ctype ------------------------ */
!
! } else if (0 == strcmp(lc_ctype,"C"))


system_charset = MIME_name_to_charset("US-ASCII",
CHARSET_create);

else if (0 == istrcmp(lc_ctype,"ASCII") ||
***************
*** 717,722 ****
--- 755,763 ----
FRM("ISO-8859-%d"),
val);
system_charset = MIME_name_to_charset(buffer,CHARSET_create);
+
+ /* 3) ------ guess based on charset part of locale ------------------------ */
+
} else if (charset && (0 == istrcmp(charset,"ASCII") ||
0 == istrcmp(charset,"US-ASCII")))


system_charset = MIME_name_to_charset("US-ASCII",

Index: elm2.4.ME+.115a-cvs/lib/remote_mbx.c
*** elm2.4.ME+.115/lib/remote_mbx.c 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/remote_mbx.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.49 2004/04/04 06:17:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.50 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 9,15 ****
--- 9,17 ----
#include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"
+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif
#include "s_me.h"
#include "s_elm.h"

***************
*** 179,185 ****
struct remote_account *ra;
{
/* bzero is defined hdrs/defs.h */
! bzero (ra, sizeof (struct remote_account));

ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = 0;
--- 181,187 ----
struct remote_account *ra;
{
/* bzero is defined hdrs/defs.h */
! bzero ((void *)ra, sizeof (struct remote_account));

ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = 0;
Index: elm2.4.ME+.115a-cvs/lib/savefolder.c
*** elm2.4.ME+.115/lib/savefolder.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/savefolder.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.76 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 1357,1363 ****
int real_prepare_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! const char *filename;
{
int ret = 0;
int err = 0;
--- 1357,1363 ----
int real_prepare_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! CONST char *filename;
{
int ret = 0;
int err = 0;
***************
*** 1471,1477 ****
int real_end_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! const char *filename;
{
int ret = 0;

--- 1471,1477 ----
int real_end_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! CONST char *filename;
{
int ret = 0;

***************
*** 1505,1511 ****
int real_sync_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! const char *filename;
{
int ret = 0;

--- 1505,1511 ----
int real_sync_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! CONST char *filename;
{
int ret = 0;

***************
*** 2216,2222 ****
dir->selection = safe_malloc(sizeof (struct name_vector));

/* bzero is defined hdrs/defs.h */
! bzero(dir->selection,sizeof (struct name_vector));
dir->selection->sys_name = sys_name;
dir->selection->disp_name = disp_name;
dir->selection->flags = flags;
--- 2216,2222 ----
dir->selection = safe_malloc(sizeof (struct name_vector));

/* bzero is defined hdrs/defs.h */
! bzero((void *)dir->selection,sizeof (struct name_vector));
dir->selection->sys_name = sys_name;
dir->selection->disp_name = disp_name;
dir->selection->flags = flags;
***************
*** 2350,2356 ****
struct folder_browser * dir;

dir = safe_malloc(sizeof (struct folder_browser));
! bzero(dir,sizeof (struct folder_browser)); /* defined hdrs/defs.h */

dir->sys_dir = NULL;
dir->dirname = NULL;
--- 2350,2356 ----
struct folder_browser * dir;

dir = safe_malloc(sizeof (struct folder_browser));
! bzero((void *)dir,sizeof (struct folder_browser)); /* defined hdrs/defs.h */

dir->sys_dir = NULL;
dir->dirname = NULL;
***************
*** 2401,2407 ****
dir->type->browser_free_it(dir);

/* Assurance for clean start */
! bzero(&(dir->a), sizeof (dir->a));

dir->type = new_type;
dir->type->browser_zero_it(dir);
--- 2401,2407 ----
dir->type->browser_free_it(dir);

/* Assurance for clean start */
! bzero((void *)&(dir->a), sizeof (dir->a));

dir->type = new_type;
dir->type->browser_zero_it(dir);
***************
*** 3756,3762 ****
(*ptr) = safe_malloc(sizeof (struct browser_write_state));

/* bzero is defined hdrs/defs.h */
! bzero(*ptr,sizeof (struct browser_write_state));

(*ptr)->magic = WS_magic;
}
--- 3756,3762 ----
(*ptr) = safe_malloc(sizeof (struct browser_write_state));

/* bzero is defined hdrs/defs.h */
! bzero((void *)*ptr,sizeof (struct browser_write_state));

(*ptr)->magic = WS_magic;
}
***************
*** 3767,3773 ****
{
if (*ptr) {
/* bzero is defined hdrs/defs.h */
! bzero(*ptr,sizeof (struct browser_write_state));

free(*ptr);
*ptr = NULL;
--- 3767,3773 ----
{
if (*ptr) {
/* bzero is defined hdrs/defs.h */
! bzero((void *)*ptr,sizeof (struct browser_write_state));

free(*ptr);
*ptr = NULL;
Index: elm2.4.ME+.115a-cvs/lib/service_list.c
*** elm2.4.ME+.115/lib/service_list.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/service_list.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.26 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: service_list.c,v 1.27 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 9,15 ****
--- 9,17 ----
#include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"
+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif
#include "s_me.h"
#include "s_elm.h"

***************
*** 66,75 ****
};


! const struct service_type * IMAP_SERVICE = & SERVICE_TYPES[1];
! const struct service_type * POP_SERVICE = & SERVICE_TYPES[2];
! const struct service_type * SUBMISSION_SERVICE = & SERVICE_TYPES[3];
! const struct service_type * SMTP_SERVICE = & SERVICE_TYPES[4];


static void zero_service_entry P_((struct service_entry *entry,
--- 68,77 ----
};


! CONST struct service_type * IMAP_SERVICE = & SERVICE_TYPES[1];
! CONST struct service_type * POP_SERVICE = & SERVICE_TYPES[2];
! CONST struct service_type * SUBMISSION_SERVICE = & SERVICE_TYPES[3];
! CONST struct service_type * SMTP_SERVICE = & SERVICE_TYPES[4];


static void zero_service_entry P_((struct service_entry *entry,
***************
*** 171,183 ****
static int add_option_type_to_entry(entry,Y,prefix)
struct service_entry *entry;
struct SE_option_type * Y;
! const char * prefix;
{
entry->option_list =
safe_realloc(entry->option_list,
(entry->option_count+1) *
sizeof (entry->option_list[0]));
! bzero( &(entry->option_list[entry->option_count]),
sizeof (entry->option_list[0]));

entry->option_list[entry->option_count].type = Y;
--- 173,185 ----
static int add_option_type_to_entry(entry,Y,prefix)
struct service_entry *entry;
struct SE_option_type * Y;
! CONST char * prefix;
{
entry->option_list =
safe_realloc(entry->option_list,
(entry->option_count+1) *
sizeof (entry->option_list[0]));
! bzero((void *) &(entry->option_list[entry->option_count]),
sizeof (entry->option_list[0]));

entry->option_list[entry->option_count].type = Y;
Index: elm2.4.ME+.115a-cvs/lib/shared_all.c
*** elm2.4.ME+.115/lib/shared_all.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/shared_all.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.2 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.3 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 78,85 ****

if (reg_code1(i,k)) {
i->regs[reg_idx].valid = 0; /* remove form use-library */
! mark_changed(shared_lib_lists[j]);
! mark_changed(&use_shared_all);

shared_lib_lists[j]->libraries_loaded = 0;

--- 78,85 ----

if (reg_code1(i,k)) {
i->regs[reg_idx].valid = 0; /* remove form use-library */
! mark_changed((void *)shared_lib_lists[j]);
! mark_changed((void *)&use_shared_all);

shared_lib_lists[j]->libraries_loaded = 0;

***************
*** 196,202 ****

if (reg_code1(I,m)) {
found++;
! mark_changed(shared_lib_lists[k]);

shared_lib_lists[k]->libraries_loaded = 0;
} else {
--- 196,202 ----

if (reg_code1(I,m)) {
found++;
! mark_changed((void *)shared_lib_lists[k]);

shared_lib_lists[k]->libraries_loaded = 0;
} else {
Index: elm2.4.ME+.115a-cvs/lib/shared.c
*** elm2.4.ME+.115/lib/shared.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/shared.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared.c,v 1.54 2004/03/28 18:08:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: shared.c,v 1.55 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 91,97 ****

static wants_rand_bits_f no_wants_rand_bits;
static void no_wants_rand_bits (buf,size,entropy_bits)
! const char *buf;
int size;
int entropy_bits;
{
--- 91,97 ----

static wants_rand_bits_f no_wants_rand_bits;
static void no_wants_rand_bits (buf,size,entropy_bits)
! CONST char *buf;
int size;
int entropy_bits;
{
***************
*** 113,119 ****

library_list[i] = safe_malloc(sizeof (* library_list[i]) );

! bzero(library_list[i], sizeof (* library_list[i]));

library_list[i]->valid = 0;
library_list[i]->tag = safe_strdup(tag);
--- 113,119 ----

library_list[i] = safe_malloc(sizeof (* library_list[i]) );

! bzero((void *)library_list[i], sizeof (* library_list[i]));

library_list[i]->valid = 0;
library_list[i]->tag = safe_strdup(tag);
***************
*** 808,814 ****
}

struct SE_option_type * get_option_type(prefix)
! const char *prefix;
{
int i;
int idx1 = locate_and_load_library(prefix);
--- 808,814 ----
}

struct SE_option_type * get_option_type(prefix)
! CONST char *prefix;
{
int i;
int idx1 = locate_and_load_library(prefix);
Index: elm2.4.ME+.115a-cvs/lib/shared_connect.c
*** elm2.4.ME+.115/lib/shared_connect.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/shared_connect.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.2 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.3 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 449,456 ****

void probe_pop_capa_lib(pop_capa_libs,pop_capa_libcount,capa,capa_args)
struct POP_capa_libs * *pop_capa_libs;
int * pop_capa_libcount;
! const char *capa;
! const char *capa_args;
{
int i;

--- 449,456 ----
void probe_pop_capa_lib(pop_capa_libs,pop_capa_libcount,capa,capa_args)
struct POP_capa_libs * *pop_capa_libs;
int * pop_capa_libcount;
! CONST char *capa;
! CONST char *capa_args;
{
int i;

***************
*** 622,628 ****
void probe_imap_capa_lib(imap_capa_libs,imap_capa_libcount,capa)
struct IMAP_capa_libs * *imap_capa_libs;
int * imap_capa_libcount;
! const char *capa;
{
int i;

--- 622,628 ----
void probe_imap_capa_lib(imap_capa_libs,imap_capa_libcount,capa)
struct IMAP_capa_libs * *imap_capa_libs;
int * imap_capa_libcount;
! CONST char *capa;
{
int i;

Index: elm2.4.ME+.115a-cvs/lib/streamsched.c
*** elm2.4.ME+.115/lib/streamsched.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/streamsched.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.33 2004/03/27 18:31:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.34 2004/04/24 12:30:02 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 10,16 ****
--- 10,18 ----

#include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"
+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif

DEBUG_VAR(Debug,__FILE__,"net");

Index: elm2.4.ME+.115a-cvs/lib/string.c
*** elm2.4.ME+.115/lib/string.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/lib/string.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: string.c,v 1.38 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: string.c,v 1.39 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 838,844 ****

/* result is malloced */
void bytestream_from_string(str,res,reslen)
! const struct string *str;
char **res;
int *reslen;
{
--- 838,844 ----

/* result is malloced */
void bytestream_from_string(str,res,reslen)
! CONST struct string *str;
char **res;
int *reslen;
{
Index: elm2.4.ME+.115a-cvs/melib/mimewalk.c
*** elm2.4.ME+.115/melib/mimewalk.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/melib/mimewalk.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mimewalk.c,v 1.5 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mimewalk.c,v 1.6 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 24,30 ****
ret = safe_malloc(sizeof(*ret));

/* bzero is defined hdrs/defs.h */
! bzero(ret,sizeof (*ret));

ret->magic = WALKHANDLER_magic;
ret->handler_type = t;
--- 24,30 ----
ret = safe_malloc(sizeof(*ret));

/* bzero is defined hdrs/defs.h */
! bzero((void *)ret,sizeof (*ret));

ret->magic = WALKHANDLER_magic;
ret->handler_type = t;
Index: elm2.4.ME+.115a-cvs/melib/pgp_decode.c
*** elm2.4.ME+.115/melib/pgp_decode.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/melib/pgp_decode.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.38 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.39 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 290,296 ****
array[1] = pgp_child_out[0];
array[2] = -1;

! rs->ext_init_data = &array;
rs->ext_init = close_them;

env[0] = NULL;
--- 290,296 ----
array[1] = pgp_child_out[0];
array[2] = -1;

! rs->ext_init_data = array;
rs->ext_init = close_them;

env[0] = NULL;
Index: elm2.4.ME+.115a-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.115/nls/C/C/C/s_elm.m 2004-03-16 21:17:43.000000000 +0200
--- elm2.4.ME+.115a-cvs/nls/C/C/C/s_elm.m 2004-04-24 11:20:52.000000000 +0300
***************
*** 1915,1922 ****
1042 Skip recipients
$ #BadValueInElmrc
1043 Value of "%s" in line %d in "%s" file is bad
$ #FailedLeaveFolderQuit
! 1045 Failed to leave folder: Try to quit again ([P]anic) ? %c%c
$ #NoItemToMarkUnread
1047 No %S to mark as unread!
$quote "
--- 1915,1924 ----
1042 Skip recipients
$ #BadValueInElmrc
1043 Value of "%s" in line %d in "%s" file is bad
+ $quote "
$ #FailedLeaveFolderQuit
! 1045 "Failed to leave folder: Try to quit again ? ([P]anic/%c/%c) "
! $quote
$ #NoItemToMarkUnread
1047 No %S to mark as unread!
$quote "
***************
*** 2055,2061 ****
2031 save copy
$quote '
$ #NoReceived
! 2032 '"received" folder not available, continue? (%c/%c) '
$quote "
$ #FileSpecify1
2033 "\n\r\n\rYou must specify a file to "
--- 2057,2063 ----
2031 save copy
$quote '
$ #NoReceived
! 2032 '"received" folder not available, continue leaving folder? ([P]anic/%c/%c) '
$quote "
$ #FileSpecify1
2033 "\n\r\n\rYou must specify a file to "
***************
*** 2301,2303 ****
--- 2303,2307 ----
$quote "
$ #PgpRcvSure
2151 "The recv'd message was PGP encoded, are you sure? "
+ $ #FailedLeaveChange
+ 2152 "Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "
Index: elm2.4.ME+.115a-cvs/src/browser.c
*** elm2.4.ME+.115/src/browser.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/browser.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: browser.c,v 1.29 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: browser.c,v 1.30 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1281,1287 ****
struct string **buffer;
int * redraw;
enum word_sel w;
! string * prev_fold;
struct AliasView *aview;
CONST char *format;
CONST char *msg;
--- 1281,1287 ----
struct string **buffer;
int * redraw;
enum word_sel w;
! struct string * prev_fold;
struct AliasView *aview;
CONST char *format;
CONST char *msg;
Index: elm2.4.ME+.115a-cvs/src/in_utils.c
*** elm2.4.ME+.115/src/in_utils.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/in_utils.c 2004-04-24 10:35:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35 2004/03/27 18:31:45 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.36 2004/04/24 07:35:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 46,51 ****
--- 46,187 ----
#define erase_a_char() { Writechar(BACKSPACE); Writechar(' '); \
Writechar(BACKSPACE); FlushBuffer(); }

+ int prompt_letter(
+ #if ANSI_C
+ int line, char *letters, int def,
+ int flags,
+ struct menu_context *page,
+ const char * format, const char *msg, ...
+ #else
+ line, letters, def, flags, page, format, msg, va_alist
+ #endif
+ )
+ #if !ANSI_C
+ int line;
+ char *letters;
+ int def;
+ int flags;
+ struct menu_context *page;
+ CONST char * format;

+ CONST char *msg;
+ va_dcl
+ #endif
+ {

+ struct string *question = NULL;
+
+ int ch;
+ int center = flags & PROMPT_center;
+ int yesno = flags & PROMTP_yesno;
+ int mark = flags & PROMPT_redraw_mark;
+ int ctrlL = flags & PROMTP_ctrlL;
+ int cols = 0;
+
+
+ va_list vl;


+
+ Va_start(vl, msg); /* defined in defs.h */

+ question = elm_smessage(0,format,msg,vl);
+ va_end(vl);
+
+ do {
+ int LINES, COLUMNS;
+ int l;
+ char *x;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+
+ /* FIXME: Not correct */
+ l = string_len(question);
+ cols = COLUMNS - ( l + 5 ); /* 5 for "Yes." + 1 */
+ if (cols < 0) {
+ cols = 0;
+ }
+
+
+ MoveCursor(line, (center || (cols < 2)) ? 0 : cols-2);
+ CleartoEOLN();
+
+ PutLineX(line, center ? cols/2 : cols,
+ FRM("%S%c%c"), question, def, BACKSPACE);
+ FlushBuffer();
+
+ ch = menu_ReadCh(page, REDRAW_MARK);
+ if (ch == REDRAW_MARK) {
+ if (mark)
+ break;
+ continue;
+ }
+
+ if (PROMTP_ctrlL && ch == ('L'&31)) {
+ break;
+ }
+
+ if (ch == EOF)
+ break;
+
+ /* Look first letters without lowercasing */
+ for (x = letters; *x; x++) {
+
+ if (ch == *x) {
+ Writechar(ch);
+ goto out;
+ }
+ }
+
+ if(ch == '\n' || ch == '\r')
+ ch = def;
+ else {
+ #ifdef ASCII_CTYPE
+ if (isascii(ch))
+ #endif
+ ch = tolower(ch);
+ }
+
+ for (x = letters; *x; x++) {
+
+ if (ch == *x) {
+ Writechar(ch);
+ goto out;
+ }
+ }
+
+ if(ch == *def_ans_yes && yesno) {
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
+ break;
+ } else if (ch == *def_ans_no && yesno) {
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
+ break;
+ }
+
+ Writechar('?');
+ FlushBuffer();
+ #if POLL_METHOD
+ wait_for_timeout(1);
+ #else
+ sleep(1);
+ #endif
+
+ } while (EOF != ch);
+
+
+ out:
+ FlushBuffer();
+
+ if (EOF != ch && REDRAW_MARK != ch && ('L'&31) != ch) {
+ if (sleepmsg > 0) {
+ #if POLL_METHOD
+ wait_for_timeout((sleepmsg + 1) / 2);
+ #else
+ sleep((sleepmsg + 1) / 2);
+ #endif
+ }
+ MoveCursor(line, (center || (cols < 2)) ? 0 : cols-2);
+ CleartoEOLN();
+ }
+

+ return ch;
+ }
+

int want_to(question, dflt, where, clear_and_center, page)
char *question;
int dflt;
***************
*** 60,66 ****
**/
int ch, cols;
int LINES, COLUMNS;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

--- 196,202 ----
**/
int ch, cols;
int LINES, COLUMNS;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 88,114 ****
ch = tolower(ch);

while (!( ch == *def_ans_yes || ch == *def_ans_no || ch == '\n' || ch == '\r')) {
! ch = menu_ReadCh(page,REDRAW_MARK);
! if (ch == REDRAW_MARK)
! goto redraw;
! if (ch == EOF) {
! leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
! }
#ifdef ASCII_CTYPE
! if (isascii(ch))
#endif
! ch = tolower(ch);
}
if(ch == '\n' || ch == '\r')
ch = dflt;

if(ch == *def_ans_yes)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
else if (ch == *def_ans_no)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
else {
DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
! return(ch); /* Don't write anything, just return */
}
FlushBuffer();
if (sleepmsg > 0) {
--- 224,250 ----
ch = tolower(ch);

while (!( ch == *def_ans_yes || ch == *def_ans_no || ch == '\n' || ch == '\r')) {
! ch = menu_ReadCh(page,REDRAW_MARK);
! if (ch == REDRAW_MARK)
! goto redraw;
! if (ch == EOF) {
! leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
! }
#ifdef ASCII_CTYPE
! if (isascii(ch))
#endif
! ch = tolower(ch);
}
if(ch == '\n' || ch == '\r')
ch = dflt;

if(ch == *def_ans_yes)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
else if (ch == *def_ans_no)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
else {
DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
! return(ch); /* Don't write anything, just return */
}
FlushBuffer();
if (sleepmsg > 0) {
***************
*** 858,868 ****
int optionally_enter2 (
#if ANSI_C
struct menu_context *page,
! struct string **buffer,
! int x, int y, int flags,
! const char * format, const char *msg, ...
#else
! page, buffer, x, y, flags, format, msg, va_alist
#endif
)
#if !ANSI_C
--- 994,1004 ----
int optionally_enter2 (
#if ANSI_C
struct menu_context *page,
! struct string **buffer,
! int x, int y, int flags,
! const char * format, const char *msg, ...
#else
! page, buffer, x, y, flags, format, msg, va_alist
#endif
)
#if !ANSI_C
Index: elm2.4.ME+.115a-cvs/src/leavembox.c
*** elm2.4.ME+.115/src/leavembox.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/leavembox.c 2004-04-24 11:20:52.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.45 2004/04/24 08:20:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 734,748 ****

if (need_handle) {
if (!can_store) {
! char answer = '\0';

! char * buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmNoReceived,
! "\"received\" folder not available, continue? (%c/%c) "),
*def_ans_yes, *def_ans_no);

! answer = want_to(buffer, *def_ans_no, LINES-4, 0,
! page);

if (answer != *def_ans_yes) {
return_value = -2; /* failure */
--- 734,762 ----

if (need_handle) {
if (!can_store) {
! int answer = '\0';

! again1:
! menu_get_sizes(page, &LINES, &COLUMNS);
!
! /* NOTICE: prompt_letter may return EOF */
! answer = prompt_letter(LINES-4,"P",*def_ans_yes,
! PROMPT_center|PROMTP_yesno|
! PROMPT_redraw_mark|PROMTP_ctrlL,
! page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmNoReceived,
! "\"received\" folder not available, continue leaving folder? ([P]anic/%c/%c) "),
*def_ans_yes, *def_ans_no);

!
! if (answer == ('L'&31) || answer == REDRAW_MARK) {
! menu_ClearScreen(page);
! goto again1;
! }
!
! if (answer == 'P' || answer == EOF)
! emergency_exit(0);

if (answer != *def_ans_yes) {
return_value = -2; /* failure */
Index: elm2.4.ME+.115a-cvs/src/messages/digest.c
*** elm2.4.ME+.115/src/messages/digest.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/messages/digest.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.9 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: digest.c,v 1.10 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 39,45 ****
mbx->u.digest = safe_malloc(sizeof (* (mbx->u.digest)));

/* bzero is defined hdrs/defs.h */
! bzero(mbx->u.digest, sizeof (* (mbx->u.digest)));

mbx->u.digest->the_digest = NULL;
mbx->u.digest->digest_count = 0;
--- 39,45 ----
mbx->u.digest = safe_malloc(sizeof (* (mbx->u.digest)));

/* bzero is defined hdrs/defs.h */
! bzero((void *)mbx->u.digest, sizeof (* (mbx->u.digest)));

mbx->u.digest->the_digest = NULL;
mbx->u.digest->digest_count = 0;
Index: elm2.4.ME+.115a-cvs/src/messages/messages.c
*** elm2.4.ME+.115/src/messages/messages.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/messages/messages.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: messages.c,v 1.12 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: messages.c,v 1.13 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 23,29 ****
ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero(ret,sizeof (*ret));

ret->magic = MAILBOXVIEW_magic;
ret->mailbox_type = t;
--- 23,29 ----
ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero((void *)ret,sizeof (*ret));

ret->magic = MAILBOXVIEW_magic;
ret->mailbox_type = t;
Index: elm2.4.ME+.115a-cvs/src/messages/partial.c
*** elm2.4.ME+.115/src/messages/partial.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/messages/partial.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.14 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.15 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 27,33 ****
mbx->u.partial = safe_malloc(sizeof (* (mbx->u.partial)));

/* bzero is defined hdrs/defs.h */
! bzero(mbx->u.partial, sizeof (* (mbx->u.partial)));

mbx->u.partial->parent_mailbox = NULL;

--- 27,33 ----
mbx->u.partial = safe_malloc(sizeof (* (mbx->u.partial)));

/* bzero is defined hdrs/defs.h */
! bzero((void *)mbx->u.partial, sizeof (* (mbx->u.partial)));

mbx->u.partial->parent_mailbox = NULL;

Index: elm2.4.ME+.115a-cvs/src/messages/storage.c
*** elm2.4.ME+.115/src/messages/storage.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/messages/storage.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: storage.c,v 1.6 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: storage.c,v 1.7 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 30,36 ****
mbx->u.storage = safe_malloc(sizeof (* (mbx->u.storage)));

/* bzero is defined hdrs/defs.h */
! bzero(mbx->u.storage, sizeof (* (mbx->u.storage)));

mbx->u.storage->the_mailbox = NULL;
mbx->u.storage->mailbox_count = 0;
--- 30,36 ----
mbx->u.storage = safe_malloc(sizeof (* (mbx->u.storage)));

/* bzero is defined hdrs/defs.h */
! bzero((void *)mbx->u.storage, sizeof (* (mbx->u.storage)));

mbx->u.storage->the_mailbox = NULL;
mbx->u.storage->mailbox_count = 0;
Index: elm2.4.ME+.115a-cvs/src/out_utils.c
*** elm2.4.ME+.115/src/out_utils.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/out_utils.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.23 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.25 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 203,217 ****
char buffer[200];
int oldstate = RawState();
int LINES, COLUMNS;
- struct menu_context *cpage;

! cpage = Raw(ON);
!
! menu_get_sizes(default_context,&LINES, &COLUMNS);

buffer[0] = '\0';

redraw:
PutLine0(LINES-3, 0,str);
CleartoEOS();
show_last_error();
--- 203,216 ----
char buffer[200];
int oldstate = RawState();
int LINES, COLUMNS;

! struct menu_context *cpage = Raw(ON);

buffer[0] = '\0';

redraw:
+ menu_get_sizes(cpage,&LINES, &COLUMNS);
+
PutLine0(LINES-3, 0,str);
CleartoEOS();
show_last_error();
***************
*** 300,306 ****
#endif
)
#if !ANSI_C
- int lineY;
CONST char *format;
CONST char *line;
va_dcl
--- 299,304 ----
Index: elm2.4.ME+.115a-cvs/src/quit.c
*** elm2.4.ME+.115/src/quit.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/quit.c 2004-04-24 11:20:52.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: quit.c,v 1.36 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: quit.c,v 1.39 2004/04/24 08:20:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 43,50 ****
int status;
int LINES, COLUMNS;

- menu_get_sizes(page, &LINES, &COLUMNS);
-
status = leave_mbox(FALSE, TRUE, prompt, NULL, *mailbox,
header_page, page);
if ( status == -1)
--- 43,48 ----
***************
*** 65,98 ****
return;

again1:
! PutLineX(LINES-1,2,
! CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveFolderQuit,
! "Failed to leave folder: Try to quit again ? %c%c"),
! *def_ans_no,BACKSPACE);
! CleartoEOLN();
!
! do {
! ans = menu_ReadCh(page,REDRAW_MARK);
! if (ans == REDRAW_MARK)
! goto again1;
! if (ans == ('L'&31)) {
! menu_ClearScreen(page);
! goto again1;
! }
! ans = tolower(ans);
!
! if (ans == *def_ans_no || '\r' == ans || '\n' == ans) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
! return;
! }
! if (ans == *def_ans_yes) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
! "Yes."));
! clear_error();
! goto requit;
! }
! } while(1);
}
}
leave(0, mailbox,aview);
--- 63,96 ----
return;

again1:
! menu_get_sizes(page, &LINES, &COLUMNS);
!
! /* NOTICE: prompt_letter may return EOF */
! ans = prompt_letter(LINES-1,"P",*def_ans_no,
! PROMPT_center|PROMTP_yesno|
! PROMPT_redraw_mark|PROMTP_ctrlL,
! page,
! CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveFolderQuit,
! "Failed to leave folder: Try to quit again ? ([P]anic/%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
! if (ans == ('L'&31) || ans == REDRAW_MARK) {
! menu_ClearScreen(page);
! goto again1;
! }
!
! if (ans == *def_ans_no)
! return;
!
! if (ans == *def_ans_yes) {
! clear_error();
! goto requit;
! }
!
! if (ans == 'P' || ans == EOF)
! emergency_exit(0);
!
! return;
}
}
leave(0, mailbox,aview);
***************
*** 294,303 ****
sleep_message();

again1:
! /* TODO -- CATGETS */
! ans = want_to("Failed to leave folder: Try to change again ? [P]anic",
! *def_ans_no,LINES-1,1,page);
! if (ans == ('L'&31)) {
redraw = 1;
menu_ClearScreen(page);
goto again1;
--- 292,310 ----
sleep_message();

again1:
! menu_get_sizes(page, &LINES, &COLUMNS);
!
! /* NOTICE: prompt_letter may return EOF */
! ans = prompt_letter(LINES-1,"P",*def_ans_no,
! PROMPT_center|PROMTP_yesno|
! PROMPT_redraw_mark|PROMTP_ctrlL,
! page,
! CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveChange,
! "Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
!
! if (ans == ('L'&31) || ans == REDRAW_MARK) {
redraw = 1;
menu_ClearScreen(page);
goto again1;
***************
*** 312,318 ****
clear_error();
goto rechange;
}
! if (ans == 'P')
emergency_exit(0);

if (new_folder) {
--- 319,325 ----
clear_error();
goto rechange;
}
! if (ans == 'P' || ans == EOF)
emergency_exit(0);

if (new_folder) {
Index: elm2.4.ME+.115a-cvs/src/screen/context.c
*** elm2.4.ME+.115/src/screen/context.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.115a-cvs/src/screen/context.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: context.c,v 1.3 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: context.c,v 1.4 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 41,47 ****
struct menu_context *ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero(ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;

--- 41,47 ----
struct menu_context *ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero((void *)ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;

Kari E. Hurtta

unread,
May 17, 2004, 11:33:35 AM5/17/04
to
Archive-name: elmME+2.5/PLalpha0.0

Is available on ftp.funet.fi
via anonymous ftp

directory pub/unix/mail/elm/elm-ME+2.5/
files elm-ME+2.5.PLalpha0.patch.gz
and elm-ME+2.5.alpha0.tar.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha0.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.alpha0.tar.gz >
via WWW.

Before applying patch catenate parts 1 - 5 first.
That part (part 0) do not include patch. Patch
is on parts 1 - 5.

This patch is agaist Elm 2.4ME+ PL115 (25)


Changes on Elm ME+ 2.5 PLx compared with Elm2.4ME+ PL115 (25)
-------------------------------------------------------------

Note: You must create directory

2.4
before applying this patch!

SUMMARY: Elm ME+ 2.5 is based on Elm 2.4ME+ and incorporates
some code from Elm 2.5. This release incorporates
some header file changes and new elmrc options.
New elmrc options are incomingfolders, allow-setuid,
askstore, askkeep, askdelete, replycopy, askreplycopy,
showreply, confirmtagsave, editflush, fwdattribution,
printhdrs, savebyalias, showmlists and tochars.

- Moved Overview to 2.4/Overview
- Moved ANNOUNCE.ME to 2.4/ANNOUNCE.ME
- Moved ChangeLog.ME to 2.4/ChangeLog.ME
- Moved Patchlist to 2.4/Patchlist
- Moved Changes to 2.4/Changes
- Moved Instruct to 2.4/Instruct
- Moved NOTICE to 2.4/NOTICE (copyright file)
- Moved README to 2.4/README

- Copied Elm 2.5 PL7 NOTICE to NOTICE (copyright file)

- Change from Elm 2.5:
Added hdrs/elm_defs.h
Added hdrs/elm_globals.h
Removed hdrs/headers.h
Removed hdrs/defs.h
Removed hdrs/elm.h
NOTE however that there is:
hdrs/elmlib.h
hdrs/defs_major.h
hdrs/me.h
src/def_elm.h
so result is quite different.

- Change from Elm 2.5:
added incomingfolders to the elmrc [A1]
added allow-setuid to the global elm.rc [A2]
added askstore,askkeep,askdelete to elmrc [A3]
autocopy expanded into replycopy and askreplycopy (in
elmrc) [A4]
added showreply to elmrc [A5] (!)
added confirmtagsave to elmrc [A6] [A13]
added editflush to elmrc [A7]
added fwdattribution to elmrc [A8]
added printhdrs to elmrc [A11] (!!)
added savebyalias to elmrc
added showmlists to elmrc (!3)
added tochars to elmrc (!4)

(!) Elm 2.4ME+ is displaying 'r', that makes posible to
set it off.

(!!) Note that this option is only used with
p)rint comand which is normally disabled.
This is not used with P)rint text command.

(!3) mlists config file is not supported. Instead
this option just show List-Id header from mail.

(!4) This is five character instead of four as on
Elm 2.5.

- Change from Elm 2.5:
attribution and fwdattribution may include [A9] [A12]
\t for tabulator
\n for newline
%F form sender (From header)
%D for send date
%I for message-id
%S for subject
%)F for sender's name
%>F for sender's address
%% for %
Added -w option to readmsg [A10]
Folder name may now include ... [A14] (!) (!2)
%h For 3 letter month
%y For 2 digit year
%Y For 4 digit year
%m For 2 digit month
%j For 3 digit day number of year
%d For 2 digit day number of month
%% For %
Also environment variable names may occur
also on other places than begining path name
components. (!2)
Environment variables may use ${variable} syntax. (!2)

(!) But these do not work if % is first charater!
On that case % refers to folder directory (ie.
same than '=' and '+'.)

(!2) This same expansion is used on many elmrc variables,
so somewhere this may cause surprises. However
%s should work on variables as earlier. Also $$
is expanded. Other $ -syntaxes may cause error,
because they are now tried to expand instead that
thay are passed to shell. For example on 'printout'
-command.

- Change from Elm 2.5:
Added command 'M' to message menu


- Changes from Elm2.4ME+ PL115a (25)

- Reimplemeted elmrc "alternatives" as type PATH and
removed special elmrc type for alternatives.
(from Elm 2.4ME+ PL116)

- Reimplemeted elmrc "weedout" as type PATH and
removed special elmrc type for weedout.
If first element on list is "*clear-weed-list*",
then builtin weedout list is not used.
(from Elm 2.4ME+ PL116)

- Added RFC 2919 List-ID -header to array on
lib/headers.c
- Fix missing space between pharse and < >
on result of hdr_decode_from_phrase() on
lib/headers.c

- RFC 2919 List-ID is now parsed and information
shown when showmlists is set on elmrc

New files:
hdrs/elm_defs.h
hdrs/elm_globals.h
NOTICE

Removed files:
hdrs/headers.h
hdrs/defs.h
hdrs/elm.h

Renamed files:
Overview => 2.4/Overview
ANNOUNCE.ME => 2.4/ANNOUNCE.ME
ChangeLog.ME => 2.4/ChangeLog.ME
Patchlist => 2.4/Patchlist
Changes => 2.4/Changes
Instruct => 2.4/Instruct
NOTICE => 2.4/NOTICE
README => 2.4/README

New elmrc options:
incomingfolders
allow-setuid
askstore
askkeep
askdelete
replycopy
askreplycopy
showreply
confirmtagsave
editflush
fwdattribution
printhdrs
savebyalias
showmlists
tochars

Correspond quotes from Elm 2.5 PL7 Changes file:

[A1] added incomingfolders to the elmrc. This is a list of
folders that will automatically be opened with "magic
mode" on. (inspired by a patch from Cristophe Kalt
<ka...@ensta.fr>)

[A2] New "allow_setuid" setting. This must be enabled in the
global elmrc in order for Elm to operate setuid. This
prevents naive setuid installation without being too
heavy handed.

[A3] askstore can be used to separately prompt to move read
messages to =received when you leave your mailbox.
I see its main use for people who don't want to use
=received but still like confirmation of deletion. (from
Keith Neufeld <neu...@pvi.org> )

[A4] autocopy expanded into replycopy and askreplycopy (in
elmrc). replycopy determines whether the default should
be yes or no, and askreplycopy determines whether it
should happen automatically. (from Keith Neufeld
<neu...@pvi.org> )

[A5] Added the "replied" code. You must set showreply=ON in
your elmrc for this to work.

[A6] Added a change from Keith Neufeld <neu...@pvi.org> to
make the confirm for saving tagged messages a user
configurable option (confirmtagsave in elmrc).

[A7] Flush the edit buffer after an edit and now make it a
user config thing (editflush in elmrc).

[A8] add a "fwdattribution" elmrc variable that enhances the
handling of forwarded messages. If undefined (the
default), the current behaviour is preserved (standard
attribution and prefix added on edited messages). If
this variable is defined, the prefix is never added, and
instead of the standard attribution the inclusion is
bracketed like:

[A9] Added some extra attribution code (inspired by a patch from
ser...@ghost.sm.dsi.unimi.it (Piero Serini)). The attribution string
may now contain:

%F who the message is from (this is the same as %s)
%D date the message was created (the from message)
%I message ID
%S message subject

[A10] "readmsg" now accepts "-w" to specify header weeding.
The default works like: readmsg -w 'Subject: From:
To: Cc: Apparently- Date:' The list entries are
left-anchored "patmatch" patterns.

[A11] Added "printhdrs" elmrc option that allows header
weeding to be specified when printing. The value
of this option becomes the "-w" arg to "readmsg".

[A12] Add %)F and %>F to attribution, for from name and
from address (from Paul Close <p...@lunch.engr.sgi.com>)

[A13] Added Wayne Davison's patch to confirm on saving
tagged messages.

[A14] Added patch to allow embedded date in folder names
(from Mike Kenney <mi...@wavelet.apl.washington.edu>).
This allows:

%h month name ( 3 letter abbreviation )
%y last 2 digits of year
%m month number
%d day of the month
%j day of the year

This patch also allows environment vars to be enclosed
in {}.

/ Kari Hurtta

Kari E. Hurtta

unread,
May 17, 2004, 11:34:08 AM5/17/04
to
Archive-name: elmME+2.5/PLalpha0.1

Is available on ftp.funet.fi
via anonymous ftp

directory pub/unix/mail/elm/elm-ME+2.5/
files elm-ME+2.5.PLalpha0.patch.gz
and elm-ME+2.5.alpha0.tar.gz

Is available with

Before applying patch catenate part 1 - 5 first.

This patch is agaist Elm 2.4ME+ PL115 (25) --------- [ part 1/5 ] ---------

NOTICE: Create 2.4 directory before applying this patch!

For applying thich patch use (on directory where Configure is)

mkdir 2.4
patch -p1 < {this-file}

Then check that removed files do not exists or are empty

ls -la `cat OBSOLETE `

If that lists non-empty files, patch failed.

Then remove emty files with command

rm `cat OBSOLETE `

Index: elmME+.2.5.alpha0-cvs/hdrs/patchlevel.h


Prereq: 1113000000
*** elm2.4.ME+.115/hdrs/patchlevel.h 2004-04-13 14:26:13.000000000 +0300

--- elmME+.2.5.alpha0-cvs/hdrs/patchlevel.h 2004-05-16 11:11:16.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "115 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.115
*/
! #define LAST_REPORT_TIME 1113000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Apr, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Apr, 2004"

/*
* Local Variables:
--- 1,12 ----
! #define PATCHLEVEL "alpha0"
/* Used by Configure:
! SHAREDTAG: .1.1.0
*/
! #define LAST_REPORT_TIME 1116000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "May, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version ME+ 2.5, USENET supported version"

/*
* Local Variables:
Index: elmME+.2.5.alpha0-cvs/2.4/README
*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
--- elmME+.2.5.alpha0-cvs/2.4/README 2004-04-17 12:03:44.000000000 +0300
***************
*** 0 ****
--- 1,279 ----
+ This README is for the 2.4 version.
+ Look file README.ME+ for the 2.4ME+ version.
+
+ ------------------------------------------------------------------
+ This is the 2.4 (USENET) version of the Elm Mail System
+
+ See the NOTICE and Instruct files for further details.
+
+ It is IMPERATIVE that all users rerun newalias after installing
+ Elm 2.4 when upgrading from a previous version. Elm's behavior
+ with aliases could be unpredictable if this step is not performed.
+
+ Where to find more info on Elm:
+ Much discussion on Elm including interim bug fixes, work arounds
+ and future plans occurs in the Usenet news group comp.mail.elm. Also
+ a monthly status report on Elm is posted there. This status report
+ lists the archive sites that have the patches to Elm as well as the
+ latest version.
+
+ Patches to Elm are posted to comp.mail.elm and comp.sources.bugs as
+ soon as they are released. They are posted to comp.sources.unix shortly
+ thereafter, to allow time for feedback of problems in the patches.
+ Patches should be available from the archive sites, or from the
+ archive server. Mail archive...@DSI.COM for details on how to
+ use the archive server program. Ask it for help.
+
+ In addition, ftp.uu.net maintains a mirror of the Elm release files
+ in /networking/mail/elm. Patches are available in that directory
+ shortly after release. Other sites also keep mirrors of the Elm
+ distribution. There are sites in Europe, Australia, Taiwan and the UK
+ in addition to several in the US. Send the message
+
+ send elm elm.ftp
+
+ to archive...@dsi.com for a current list of ftp mirror sites.
+
+
+ Limitations/Problems you might encounter in compiling and installing Elm:
+
+ From comp.mail.elm, d...@ssec.wisc.edu (DaviD W. Sanderson) writes:
+ >... whoever wrote the default termcap
+ >and/or terminfo descriptions for xterm included in the ti/te strings
+ >the special escape sequences to make xterm switch between the normal
+ >and alternate screen buffers. These sequences are:
+ >
+ > \E[?47h - use alternate screen buffer
+ > \E[?47l - use normal screen buffer
+ >...
+ >The elm code is just fine as it is. If you change it so that it
+ >doesn't ever send ti/te, you'll just break elm for somebody else. Fix
+ >your termcap/terminfo definition instead.
+
+ On some Unix 5.3.2 systems, if only a runtime version of the
+ O/S has been installed, not all the include files exist for compiling
+ curses.c. The ptem.h include file contains the window sizing structure
+ on this version. Either comment out the window sizing code, or install
+ the remaining include files from the development system.
+
+ If you run a nonstandard configuration of Mail, such as Xenix
+ running smail, Configure can get confused as to where to place items.
+ Be sure and check the config.sh file for the correct placement before
+ continuing. If changes are necessary, rerun Configure and fix the
+ file before exiting.
+
+ On SCO Xenix, if you are all mail is from user anonymous,
+ this is because the mail delivery agent should be
+ /usr/lib/mail/execmail instead of /usr/bin/rmail or /bin/rmail.
+
+ On Next's NeXTStep 3.0, use the compile flags
+ -bsd -fwritable-strings, specify the include file directory
+ as /usr/include/bsd, and change, at the 'edit the config.sh'
+ file prompt, the value of d_memcpy to undef and sigtype to int.
+ (From: Jess Anderson)
+
+ From: Manuel Alberto Ricart <alb...@parsec.mixcom.com>,
+ for Next's version 1.0 it is necessary to answer -bsd for the
+ Any additional cc flags? question and -lsys_s for the
+ Any additional libraries? question within Configure.
+ At "If you need to edit config.sh, do it as a shell escape here:"
+ Change d_voidsig from 'define' to 'undef'
+ Change passcat from 'cat /etc/passwd' to 'nidump passwd /'
+ if you're not using YP/NIS, and don't have more than two levels
+ of NetInfo hierarchy. (Consult a NeXTpert otherwise!)
+
+ on Next's 2.0/2.1 systems: same as above, except
+ For "Any additional libraries?" just hit RETURN
+ For "What is the full name of your C library?" specify /lib/libsys_s.a
+ Also for additional linker ld flags, recommend -object.
+ This will make the binaries as small as possible. Otherwise
+ if the smallest binary will be 16K or more.
+
+ On IBM RISC 6000 AIX, 3.2 or newer, to compile Elm during
+ Configure, -U__STR__ is no longer needed. Elm should now compile with
+ no changes.
+
+ On IBM RISC 6000 AIX, prior to 3.2, you might get string
+ function errors on the compile. The solution is to do the following:
+ > Look at /usr/lpp/bos/bsdsport. It tells you
+ > to add following lines to /etc/xlc.cfg
+ >
+ > * BSD 4.3 c compiler stanza
+ > bsdcc: use = DEFLT
+ > crt = /lib/crt0.o
+ > mcrt = /lib/mcrt0.o
+ > gcrt = /lib/gcrt0.o
+ > libraries = -lbsd, -lc
+ > proflibs = -L/lib/profiled,-L/usr/lib/profiled
+ > options = -H512,-T512, -qlanglvl=extended, -qnoro, -D_BSD, -D_NONSTD_TYPES, -D_NO_PROTO, -D_BSD_INCLUDES, -bnodelcsect, -U__STR__, -U__MATH__
+ >
+ > And then link bsdcc to xlc and use bsdcc instead of cc.
+ >
+ > --
+ > Mika Koistinen ------- Opinions are my own-- ----- WARNING:
+ > Myll{rintie 57 F 62 | Internet: mmko...@luotsi.uku.fi | Effect has no code
+ > 70780 KUOPIO | Bitnet: mmkoisti@FINKUO | in function main
+ > FINLAND | tel 358-71-162805 |
+ >
+
+ Also on IBM RS/6000 AIX (Possibly only prior to 3.2)
+ > If you want elm to make use of the NLS options documented for
+ > sendmail (using sendmail.nl) you have to use the UNDOCUMENTED -x flag
+ > on sendmail. See article in comp.unix.aix
+ >
+ > Since Configure doesn't ask for additional sendmail flags you
+ > have to add -x in the smflags entry in hdrs/sysdefs.SH (hdrs/sysdefs.h)
+ >
+ > I guess that this should go into the FAQ entry on IBM AIX.
+ >
+ > --
+ > Bjorn Brox, CORENA A/S, P.O. Box 448, 3601 Kongsberg, NORWAY
+ > E-mail : br...@dms.corena.no , Phone : +47 3 73 66 11 , Fax : +47 3 73 52 62
+
+ From: gor...@mcil.comm.mot.com (Gordon Berkley)
+ On HP/Apollo Domain OS:
+ Apollo TAR is screwey in creating directories.
+ Need to create directories before un-taring
+ DIRS="utils test src nls nls/C nls/C/C nls/C/C/C nls/gencat \
+ lib hdrs filter doc"
+ for dir in $DIRS
+ do
+ mkdir $dir
+ done
+
+
+ On some systems, especially those based on the AT&T Port to
+ 286's the -O flag of the compiler produces improper code causing
+ segmentation violations. If this happens, recompile the code without
+ the -O flag. This has been seen with Microport SysV/AT type systems.
+
+ The Configuration script has been known to exercise an old bug
+ on HP-UX's version of /bin/sh. This shows up as part of the variable
+ setting section showing up on your screen, and configure aborting on errors.
+ If this happens, try using ksh instead of sh as in:
+ ksh Configure
+ this will usually solve the problem.
+
+ The Configuration script has been known to exceed the default
+ stack size in Unix 286 sh's. If Configure does not run correctly on
+ this type of machine increase the stack size and rerun it. On
+ Microport SysV/AT machines, Configure might run correctly under ksh.
+ Obtain ksh from Microport (available to current version owners without
+ additional charge) and rerun Configure using it. Xenix 286 users may
+ have the same problem, but they can work around it by changing the
+ stack size within the shell as reported a Xenix 286 Elm user:
+ > I had the same problems as everyone else is reporting on Microports *nix under
+ > SCO XENIX 2.2.1.
+ >
+ > The solution is simple, up the stack size for /bin/sh. I used
+ >
+ > # mv /bin/sh /bin/sh.old
+ > # cp /bin/sh.old /bin/sh
+ > # fixhdr -F 8000 /bin/sh
+ >
+ > This may seem a bit over the top, but I put it back after!
+ >
+ > # mv /bin/sh /bin/sh.rm
+ > # mv /bin/sh.old /bin/sh
+ >
+ > Then wait till nobody is using /bin/sh.rm then
+ >
+ > # rm /bin/sh.rm
+ >
+ > That way you preserve your old shell, ( i.e. you don't break it ), but you
+ > get to use Configure without bus errors etc.
+ >
+ > I hope that of use
+ >
+ > Keith
+ > --
+ > UUCP ..!uunet!mcvax!ukc!slxsys!g4lzv!keith | Keith Brazington
+ > Smart mail ke...@g4lzv.co.uk | 5b Northgate Rochester Kent UK
+ > Ampanet [44.131.8.1] and [44.131.8.3] | +44 634 811594 Voice
+ > Packet G4LZV @ GB7UWS -- G4LZV USENET BB --| +44 634 401210 Data v22,v22bis
+ You might have to try values from 7000 to 8800.
+
+ Also on Microport SysV/AT Machines, the C compiler produces
+ improper code for one of the arithmetic calls. To fix this problem it
+ is necessary to reduce the complexity of the statement, as reported by
+ one of our testers here is the symptom and his patch. Being this is a
+ compiler bug on only one system, we make the information available, but
+ not incorporate it in the main release. Note, this may effect other
+ areas of Elm, and in the future, Microport may even fix this problem.
+ > I finally tracked down the bug that was causing the lengthy delays when
+ > the first message was displayed. The Microport 80286 C compiler was
+ > generating bad code for the computation of padding in showmsg.c. The
+ > compiler generated scratch variables in the expression were being
+ > located at weird offsets in the stack segment. This caused the program
+ > to stall while the kernel attempted to grow the stack segment to a size
+ > that was large enough to contain the scratch variables. This explains
+ > why it only happened the first time a message was displayed. Here is a
+ > patch that fixes the problem:
+ >
+ > *** showmsg.c.dist Fri Mar 17 21:08:37 1989
+ > --- showmsg.c Sat Mar 18 06:14:04 1989
+ > ***************
+ > *** 280,289
+ > atoi(current_header->year), current_header->time);
+ >
+ > /* truncate or pad title2 portion on the right
+ > ! * so that line fits exactly */
+ > ! padding =
+ > ! COLUMNS -
+ > ! (strlen(title1) + (buf_len=strlen(title2)) + strlen(title3));
+ >
+ > sprintf(titlebuf, "%s%-*.*s%s\n", title1, buf_len+padding,
+ > buf_len+padding, title2, title3);
+ >
+ > --- 280,292 -----
+ > atoi(current_header->year), current_header->time);
+ >
+ > /* truncate or pad title2 portion on the right
+ > ! * so that line fits exactly, expression has been
+ > ! * simplified to avoid bug in Microport 80286
+ > ! * C compiler */
+ > ! padding = COLUMNS;
+ > ! padding -= strlen(title1);
+ > ! padding -= (buf_len = strlen(title2));
+ > ! padding -= strlen(title3);
+ >
+ > sprintf(titlebuf, "%s%-*.*s%s\n", title1, buf_len+padding,
+ > buf_len+padding, title2, title3);
+ >
+ > --
+ > John A. Limpert
+ > UUCP: jo...@n3dmc.UUCP, jo...@n3dmc.UU.NET, uunet!n3dmc!johnl
+
+
+ Some versions of GNUmake are slightly incompatible with
+ standard make. If you plan on using GNUmake instead of standard make,
+ you might need to change instances of:
+ -$(MAKEFLAGS)
+ to:
+ $(MAKEFLAGS)
+ in all Makefiles that contain that construct.
+ [ NOTE: Changed on Elm 2.4ME+ PL100 ]
+
+ On some systems (at least MIPS RiscOs 4.52, and CDC EP/IX 1.4.x) there
+ is an stdlib.h with ANSI Constructs, but the normally supplied Compiler
+ did not handle ANSI-C. If you use the bundled compiler (cc2.11 or cc2.20),
+ you should edit config.h after configuring, and remove the define for
+ I_STDLIB. With gcc or the separate ANSI C Compiler there should be no problem.
+
+ On many systems with the Microsoft UNIX C Compilers, compiling with
+ optimization breaks the code. One symptom is that aliases do not
+ work. On those machines do not compile any of Elm with optimizations.
+ To accomplish that, set all occurrences of "OPTIMIZE" in the makefiles
+ to "-Od" - then it works. From: mrb...@btoy1.UUCP (Thomas Bullinger)
+
+ SCO uses the Microsoft C compiler in its products. For releases of the
+ SCO Development system prior to 3.2v4.2 or ODT 3.0, it is probably wise
+ to disable optimization. Elm 2.4 has however been tested with -Oe
+ optimization under SCO Unix 3.2v4.2 and ODT 3.0 development systems.
+ This level of optimization can safely be specified in Configure when
+ you are asked for compiler flags. From: lar...@sco.com (Larry Philps)
+
+ Syd Weinstein
+ Elm Coordinator
+ e...@DSI.COM
+ (dsinc!elm)
Index: elmME+.2.5.alpha0-cvs/README
*** elm2.4.ME+.115/README 2002-12-15 12:00:25.000000000 +0200
--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************
*** 1,279 ****
- This README is for the 2.4 version.
- Look file README.ME+ for the 2.4ME+ version.
-
- ------------------------------------------------------------------
- This is the 2.4 (USENET) version of the Elm Mail System
-
- See the NOTICE and Instruct files for further details.
-
- It is IMPERATIVE that all users rerun newalias after installing
- Elm 2.4 when upgrading from a previous version. Elm's behavior
- with aliases could be unpredictable if this step is not performed.
-
- Where to find more info on Elm:
- Much discussion on Elm including interim bug fixes, work arounds
- and future plans occurs in the Usenet news group comp.mail.elm. Also
- a monthly status report on Elm is posted there. This status report
- lists the archive sites that have the patches to Elm as well as the
- latest version.
-
- Patches to Elm are posted to comp.mail.elm and comp.sources.bugs as
- soon as they are released. They are posted to comp.sources.unix shortly
- thereafter, to allow time for feedback of problems in the patches.
- Patches should be available from the archive sites, or from the
- archive server. Mail archive...@DSI.COM for details on how to
- use the archive server program. Ask it for help.
-
- In addition, ftp.uu.net maintains a mirror of the Elm release files
- in /networking/mail/elm. Patches are available in that directory
- shortly after release. Other sites also keep mirrors of the Elm
- distribution. There are sites in Europe, Australia, Taiwan and the UK
- in addition to several in the US. Send the message
-
- send elm elm.ftp
-
- to archive...@dsi.com for a current list of ftp mirror sites.
-
-
- Limitations/Problems you might encounter in compiling and installing Elm:
-
- From comp.mail.elm, d...@ssec.wisc.edu (DaviD W. Sanderson) writes:
- >... whoever wrote the default termcap
- >and/or terminfo descriptions for xterm included in the ti/te strings
- >the special escape sequences to make xterm switch between the normal
- >and alternate screen buffers. These sequences are:
- >
- > \E[?47h - use alternate screen buffer
- > \E[?47l - use normal screen buffer
- >...
- >The elm code is just fine as it is. If you change it so that it
- >doesn't ever send ti/te, you'll just break elm for somebody else. Fix
- >your termcap/terminfo definition instead.
-
- On some Unix 5.3.2 systems, if only a runtime version of the
- O/S has been installed, not all the include files exist for compiling
- curses.c. The ptem.h include file contains the window sizing structure
- on this version. Either comment out the window sizing code, or install
- the remaining include files from the development system.
-
- If you run a nonstandard configuration of Mail, such as Xenix
- running smail, Configure can get confused as to where to place items.
- Be sure and check the config.sh file for the correct placement before
- continuing. If changes are necessary, rerun Configure and fix the
- file before exiting.
-
- On SCO Xenix, if you are all mail is from user anonymous,
- this is because the mail delivery agent should be
- /usr/lib/mail/execmail instead of /usr/bin/rmail or /bin/rmail.
-
- On Next's NeXTStep 3.0, use the compile flags
- -bsd -fwritable-strings, specify the include file directory
- as /usr/include/bsd, and change, at the 'edit the config.sh'
- file prompt, the value of d_memcpy to undef and sigtype to int.
- (From: Jess Anderson)
-
- From: Manuel Alberto Ricart <alb...@parsec.mixcom.com>,
- for Next's version 1.0 it is necessary to answer -bsd for the
- Any additional cc flags? question and -lsys_s for the
- Any additional libraries? question within Configure.
- At "If you need to edit config.sh, do it as a shell escape here:"
- Change d_voidsig from 'define' to 'undef'
- Change passcat from 'cat /etc/passwd' to 'nidump passwd /'
- if you're not using YP/NIS, and don't have more than two levels
- of NetInfo hierarchy. (Consult a NeXTpert otherwise!)
-
- on Next's 2.0/2.1 systems: same as above, except
- For "Any additional libraries?" just hit RETURN
- For "What is the full name of your C library?" specify /lib/libsys_s.a
- Also for additional linker ld flags, recommend -object.
- This will make the binaries as small as possible. Otherwise
- if the smallest binary will be 16K or more.
-
- On IBM RISC 6000 AIX, 3.2 or newer, to compile Elm during
- Configure, -U__STR__ is no longer needed. Elm should now compile with
- no changes.
-
- On IBM RISC 6000 AIX, prior to 3.2, you might get string
- function errors on the compile. The solution is to do the following:
- > Look at /usr/lpp/bos/bsdsport. It tells you
- > to add following lines to /etc/xlc.cfg
- >
- > * BSD 4.3 c compiler stanza
- > bsdcc: use = DEFLT
- > crt = /lib/crt0.o
- > mcrt = /lib/mcrt0.o
- > gcrt = /lib/gcrt0.o
- > libraries = -lbsd, -lc
- > proflibs = -L/lib/profiled,-L/usr/lib/profiled
- > options = -H512,-T512, -qlanglvl=extended, -qnoro, -D_BSD, -D_NONSTD_TYPES, -D_NO_PROTO, -D_BSD_INCLUDES, -bnodelcsect, -U__STR__, -U__MATH__
- >
- > And then link bsdcc to xlc and use bsdcc instead of cc.
- >
- > --
- > Mika Koistinen ------- Opinions are my own-- ----- WARNING:
- > Myll{rintie 57 F 62 | Internet: mmko...@luotsi.uku.fi | Effect has no code
- > 70780 KUOPIO | Bitnet: mmkoisti@FINKUO | in function main
- > FINLAND | tel 358-71-162805 |
- >
-
- Also on IBM RS/6000 AIX (Possibly only prior to 3.2)
- > If you want elm to make use of the NLS options documented for
- > sendmail (using sendmail.nl) you have to use the UNDOCUMENTED -x flag
- > on sendmail. See article in comp.unix.aix
- >
- > Since Configure doesn't ask for additional sendmail flags you
- > have to add -x in the smflags entry in hdrs/sysdefs.SH (hdrs/sysdefs.h)
- >
- > I guess that this should go into the FAQ entry on IBM AIX.
- >
- > --
- > Bjorn Brox, CORENA A/S, P.O. Box 448, 3601 Kongsberg, NORWAY
- > E-mail : br...@dms.corena.no , Phone : +47 3 73 66 11 , Fax : +47 3 73 52 62
-
- From: gor...@mcil.comm.mot.com (Gordon Berkley)
- On HP/Apollo Domain OS:
- Apollo TAR is screwey in creating directories.
- Need to create directories before un-taring
- DIRS="utils test src nls nls/C nls/C/C nls/C/C/C nls/gencat \
- lib hdrs filter doc"
- for dir in $DIRS
- do
- mkdir $dir
- done
-
-
- On some systems, especially those based on the AT&T Port to
- 286's the -O flag of the compiler produces improper code causing
- segmentation violations. If this happens, recompile the code without
- the -O flag. This has been seen with Microport SysV/AT type systems.
-
- The Configuration script has been known to exercise an old bug
- on HP-UX's version of /bin/sh. This shows up as part of the variable
- setting section showing up on your screen, and configure aborting on errors.
- If this happens, try using ksh instead of sh as in:
- ksh Configure
- this will usually solve the problem.
-
- The Configuration script has been known to exceed the default
- stack size in Unix 286 sh's. If Configure does not run correctly on
- this type of machine increase the stack size and rerun it. On
- Microport SysV/AT machines, Configure might run correctly under ksh.
- Obtain ksh from Microport (available to current version owners without
- additional charge) and rerun Configure using it. Xenix 286 users may
- have the same problem, but they can work around it by changing the
- stack size within the shell as reported a Xenix 286 Elm user:
- > I had the same problems as everyone else is reporting on Microports *nix under
- > SCO XENIX 2.2.1.
- >
- > The solution is simple, up the stack size for /bin/sh. I used
- >
- > # mv /bin/sh /bin/sh.old
- > # cp /bin/sh.old /bin/sh
- > # fixhdr -F 8000 /bin/sh
- >
- > This may seem a bit over the top, but I put it back after!
- >
- > # mv /bin/sh /bin/sh.rm
- > # mv /bin/sh.old /bin/sh
- >
- > Then wait till nobody is using /bin/sh.rm then
- >
- > # rm /bin/sh.rm
- >
- > That way you preserve your old shell, ( i.e. you don't break it ), but you
- > get to use Configure without bus errors etc.
- >
- > I hope that of use
- >
- > Keith
- > --
- > UUCP ..!uunet!mcvax!ukc!slxsys!g4lzv!keith | Keith Brazington
- > Smart mail ke...@g4lzv.co.uk | 5b Northgate Rochester Kent UK
- > Ampanet [44.131.8.1] and [44.131.8.3] | +44 634 811594 Voice
- > Packet G4LZV @ GB7UWS -- G4LZV USENET BB --| +44 634 401210 Data v22,v22bis
- You might have to try values from 7000 to 8800.
-
- Also on Microport SysV/AT Machines, the C compiler produces
- improper code for one of the arithmetic calls. To fix this problem it
- is necessary to reduce the complexity of the statement, as reported by
- one of our testers here is the symptom and his patch. Being this is a
- compiler bug on only one system, we make the information available, but
- not incorporate it in the main release. Note, this may effect other
- areas of Elm, and in the future, Microport may even fix this problem.
- > I finally tracked down the bug that was causing the lengthy delays when
- > the first message was displayed. The Microport 80286 C compiler was
- > generating bad code for the computation of padding in showmsg.c. The
- > compiler generated scratch variables in the expression were being
- > located at weird offsets in the stack segment. This caused the program
- > to stall while the kernel attempted to grow the stack segment to a size
- > that was large enough to contain the scratch variables. This explains
- > why it only happened the first time a message was displayed. Here is a
- > patch that fixes the problem:
- >
- > *** showmsg.c.dist Fri Mar 17 21:08:37 1989
- > --- showmsg.c Sat Mar 18 06:14:04 1989
- > ***************
- > *** 280,289
- > atoi(current_header->year), current_header->time);
- >
- > /* truncate or pad title2 portion on the right
- > ! * so that line fits exactly */
- > ! padding =
- > ! COLUMNS -
- > ! (strlen(title1) + (buf_len=strlen(title2)) + strlen(title3));
- >
- > sprintf(titlebuf, "%s%-*.*s%s\n", title1, buf_len+padding,
- > buf_len+padding, title2, title3);
- >
- > --- 280,292 -----
- > atoi(current_header->year), current_header->time);
- >
- > /* truncate or pad title2 portion on the right
- > ! * so that line fits exactly, expression has been
- > ! * simplified to avoid bug in Microport 80286
- > ! * C compiler */
- > ! padding = COLUMNS;
- > ! padding -= strlen(title1);
- > ! padding -= (buf_len = strlen(title2));
- > ! padding -= strlen(title3);
- >
- > sprintf(titlebuf, "%s%-*.*s%s\n", title1, buf_len+padding,
- > buf_len+padding, title2, title3);
- >
- > --
- > John A. Limpert
- > UUCP: jo...@n3dmc.UUCP, jo...@n3dmc.UU.NET, uunet!n3dmc!johnl
-
-
- Some versions of GNUmake are slightly incompatible with
- standard make. If you plan on using GNUmake instead of standard make,
- you might need to change instances of:
- -$(MAKEFLAGS)
- to:
- $(MAKEFLAGS)
- in all Makefiles that contain that construct.
- [ NOTE: Changed on Elm 2.4ME+ PL100 ]
-
- On some systems (at least MIPS RiscOs 4.52, and CDC EP/IX 1.4.x) there
- is an stdlib.h with ANSI Constructs, but the normally supplied Compiler
- did not handle ANSI-C. If you use the bundled compiler (cc2.11 or cc2.20),
- you should edit config.h after configuring, and remove the define for
- I_STDLIB. With gcc or the separate ANSI C Compiler there should be no problem.
-
- On many systems with the Microsoft UNIX C Compilers, compiling with
- optimization breaks the code. One symptom is that aliases do not
- work. On those machines do not compile any of Elm with optimizations.
- To accomplish that, set all occurrences of "OPTIMIZE" in the makefiles
- to "-Od" - then it works. From: mrb...@btoy1.UUCP (Thomas Bullinger)
-
- SCO uses the Microsoft C compiler in its products. For releases of the
- SCO Development system prior to 3.2v4.2 or ODT 3.0, it is probably wise
- to disable optimization. Elm 2.4 has however been tested with -Oe
- optimization under SCO Unix 3.2v4.2 and ODT 3.0 development systems.
- This level of optimization can safely be specified in Configure when
- you are asked for compiler flags. From: lar...@sco.com (Larry Philps)
-
- Syd Weinstein
- Elm Coordinator
- e...@DSI.COM
- (dsinc!elm)
--- 0 ----
Index: elmME+.2.5.alpha0-cvs/README.ME+


*** elm2.4.ME+.115/README.ME+ 2004-04-13 14:26:13.000000000 +0300

--- elmME+.2.5.alpha0-cvs/README.ME+ 2004-05-16 16:18:29.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.733 2004/04/12 19:27:31 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.736.4.28 2004/05/16 13:18:29 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,30 ****


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

Changes of Elm2.4ME+ PL115 (25) compared with Elm2.4ME+ PL114 (25)

------------------------------------------------------------------

! SuMMARY: This release changes temporary folder
! location on some situations, fixs crash


on c)hange command on alias menu, adds
elmrc options "local-sessionlock-dir" and
"local-sessionlock-use-home", and changes

! SIGWICH handling when waiting of editor.

! - If opened local mailbox is on somewhere other
! location than on spool directory, use "tmpdir" setting


from elm.rc for location of temporary file

"mbox.{mailbox}-{username}" instead default_temp.

--- 13,330 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Version ElmME+ 2.5.x is based on version Elm2.4ME+ PLx (25)
+ and incorporates code from of Elm 2.5.
+
+ ===================================================================
+ * Changelog of ElmME+ 2.5
+
+ Changes on Elm ME+ 2.5 PLx compared with Elm2.4ME+ PL115 (25)
+ -------------------------------------------------------------
+
+ Note: You must create directory
+ 2.4


+ before applying this patch!
+

+ SUMMARY: Elm ME+ 2.5 is based on Elm 2.4ME+ and incorporates
+ some code from Elm 2.5. This release incorporates
+ some header file changes and new elmrc options.
+ New elmrc options are incomingfolders, allow-setuid,
+ askstore, askkeep, askdelete, replycopy, askreplycopy,
+ showreply, confirmtagsave, editflush, fwdattribution,
+ printhdrs, savebyalias, showmlists and tochars.
+
+ - Moved Overview to 2.4/Overview
+ - Moved ANNOUNCE.ME to 2.4/ANNOUNCE.ME
+ - Moved ChangeLog.ME to 2.4/ChangeLog.ME
+ - Moved Patchlist to 2.4/Patchlist
+ - Moved Changes to 2.4/Changes
+ - Moved Instruct to 2.4/Instruct
+ - Moved NOTICE to 2.4/NOTICE (copyright file)
+ - Moved README to 2.4/README
+
+ - Copied Elm 2.5 PL7 NOTICE to NOTICE (copyright file)
+
+ - Change from Elm 2.5:
+ Added hdrs/elm_defs.h
+ Added hdrs/elm_globals.h
+ Removed hdrs/headers.h
+ Removed hdrs/defs.h
+ Removed hdrs/elm.h
+ NOTE however that there is:
+ hdrs/elmlib.h
+ hdrs/defs_major.h
+ hdrs/me.h
+ src/def_elm.h
+ so result is quite different.
+
+ - Change from Elm 2.5:
+ added incomingfolders to the elmrc [A1]
+ added allow-setuid to the global elm.rc [A2]
+ added askstore,askkeep,askdelete to elmrc [A3]
+ autocopy expanded into replycopy and askreplycopy (in
+ elmrc) [A4]
+ added showreply to elmrc [A5] (!)
+ added confirmtagsave to elmrc [A6] [A13]
+ added editflush to elmrc [A7]
+ added fwdattribution to elmrc [A8]
+ added printhdrs to elmrc [A11] (!!)
+ added savebyalias to elmrc
+ added showmlists to elmrc (!3)
+ added tochars to elmrc (!4)
+
+ (!) Elm 2.4ME+ is displaying 'r', that makes posible to
+ set it off.
+
+ (!!) Note that this option is only used with
+ p)rint comand which is normally disabled.
+ This is not used with P)rint text command.
+
+ (!3) mlists config file is not supported. Instead
+ this option just show List-Id header from mail.
+
+ (!4) This is five character instead of four as on
+ Elm 2.5.
+
+ - Change from Elm 2.5:
+ attribution and fwdattribution may include [A9] [A12]
+ \t for tabulator
+ \n for newline
+ %F form sender (From header)
+ %D for send date
+ %I for message-id
+ %S for subject
+ %)F for sender's name
+ %>F for sender's address
+ %% for %
+ Added -w option to readmsg [A10]
+ Folder name may now include ... [A14] (!) (!2)
+ %h For 3 letter month
+ %y For 2 digit year
+ %Y For 4 digit year
+ %m For 2 digit month
+ %j For 3 digit day number of year
+ %d For 2 digit day number of month
+ %% For %
+ Also environment variable names may occur
+ also on other places than begining path name
+ components. (!2)
+ Environment variables may use ${variable} syntax. (!2)
+
+ (!) But these do not work if % is first charater!
+ On that case % refers to folder directory (ie.
+ same than '=' and '+'.)
+
+ (!2) This same expansion is used on many elmrc variables,
+ so somewhere this may cause surprises. However
+ %s should work on variables as earlier. Also $$
+ is expanded. Other $ -syntaxes may cause error,
+ because they are now tried to expand instead that
+ thay are passed to shell. For example on 'printout'
+ -command.
+
+ - Change from Elm 2.5:
+ Added command 'M' to message menu
+
+
+ - Changes from Elm2.4ME+ PL115a (25)
+
+ - Reimplemeted elmrc "alternatives" as type PATH and
+ removed special elmrc type for alternatives.
+ (from Elm 2.4ME+ PL116)
+
+ - Reimplemeted elmrc "weedout" as type PATH and
+ removed special elmrc type for weedout.
+ If first element on list is "*clear-weed-list*",
+ then builtin weedout list is not used.
+ (from Elm 2.4ME+ PL116)
+
+ - Added RFC 2919 List-ID -header to array on
+ lib/headers.c
+ - Fix missing space between pharse and < >
+ on result of hdr_decode_from_phrase() on
+ lib/headers.c
+
+ - RFC 2919 List-ID is now parsed and information
+ shown when showmlists is set on elmrc
+
+ New files:
+ hdrs/elm_defs.h
+ hdrs/elm_globals.h
+ NOTICE
+
+ Removed files:
+ hdrs/headers.h
+ hdrs/defs.h
+ hdrs/elm.h
+
+ Renamed files:
+ Overview => 2.4/Overview
+ ANNOUNCE.ME => 2.4/ANNOUNCE.ME
+ ChangeLog.ME => 2.4/ChangeLog.ME
+ Patchlist => 2.4/Patchlist
+ Changes => 2.4/Changes
+ Instruct => 2.4/Instruct
+ NOTICE => 2.4/NOTICE
+ README => 2.4/README


+
+ New elmrc options:

+ incomingfolders
+ allow-setuid
+ askstore
+ askkeep
+ askdelete
+ replycopy
+ askreplycopy
+ showreply
+ confirmtagsave
+ editflush
+ fwdattribution
+ printhdrs
+ savebyalias
+ showmlists
+ tochars
+
+ Correspond quotes from Elm 2.5 PL7 Changes file:
+
+ [A1] added incomingfolders to the elmrc. This is a list of
+ folders that will automatically be opened with "magic
+ mode" on. (inspired by a patch from Cristophe Kalt
+ <ka...@ensta.fr>)
+
+ [A2] New "allow_setuid" setting. This must be enabled in the
+ global elmrc in order for Elm to operate setuid. This
+ prevents naive setuid installation without being too
+ heavy handed.
+
+ [A3] askstore can be used to separately prompt to move read
+ messages to =received when you leave your mailbox.
+ I see its main use for people who don't want to use
+ =received but still like confirmation of deletion. (from
+ Keith Neufeld <neu...@pvi.org> )
+
+ [A4] autocopy expanded into replycopy and askreplycopy (in
+ elmrc). replycopy determines whether the default should
+ be yes or no, and askreplycopy determines whether it
+ should happen automatically. (from Keith Neufeld
+ <neu...@pvi.org> )
+
+ [A5] Added the "replied" code. You must set showreply=ON in
+ your elmrc for this to work.
+
+ [A6] Added a change from Keith Neufeld <neu...@pvi.org> to
+ make the confirm for saving tagged messages a user
+ configurable option (confirmtagsave in elmrc).
+
+ [A7] Flush the edit buffer after an edit and now make it a
+ user config thing (editflush in elmrc).
+
+ [A8] add a "fwdattribution" elmrc variable that enhances the
+ handling of forwarded messages. If undefined (the
+ default), the current behaviour is preserved (standard
+ attribution and prefix added on edited messages). If
+ this variable is defined, the prefix is never added, and
+ instead of the standard attribution the inclusion is
+ bracketed like:
+
+ [A9] Added some extra attribution code (inspired by a patch from
+ ser...@ghost.sm.dsi.unimi.it (Piero Serini)). The attribution string
+ may now contain:
+
+ %F who the message is from (this is the same as %s)
+ %D date the message was created (the from message)
+ %I message ID
+ %S message subject
+
+ [A10] "readmsg" now accepts "-w" to specify header weeding.
+ The default works like: readmsg -w 'Subject: From:
+ To: Cc: Apparently- Date:' The list entries are
+ left-anchored "patmatch" patterns.
+
+ [A11] Added "printhdrs" elmrc option that allows header
+ weeding to be specified when printing. The value
+ of this option becomes the "-w" arg to "readmsg".
+
+ [A12] Add %)F and %>F to attribution, for from name and
+ from address (from Paul Close <p...@lunch.engr.sgi.com>)
+
+ [A13] Added Wayne Davison's patch to confirm on saving
+ tagged messages.
+
+ [A14] Added patch to allow embedded date in folder names
+ (from Mike Kenney <mi...@wavelet.apl.washington.edu>).
+ This allows:
+
+ %h month name ( 3 letter abbreviation )
+ %y last 2 digits of year
+ %m month number
+ %d day of the month
+ %j day of the year
+
+ This patch also allows environment vars to be enclosed
+ in {}.
+
+
+ ===================================================================
+ * Changelog of Elm 2.4ME+
+

+
Changes of Elm2.4ME+ PL115 (25) compared with Elm2.4ME+ PL114 (25)

------------------------------------------------------------------

! SUMMARY: This release changes temporary folder
! location on some situations, fixes crash


on c)hange command on alias menu, adds
elmrc options "local-sessionlock-dir" and
"local-sessionlock-use-home", and changes

! SIGWINCH handling when waiting for editor.

! - If opened local mailbox is on somewhere else
! than on spool directory, use "tmpdir" setting


from elm.rc for location of temporary file

"mbox.{mailbox}-{username}" instead default_temp.

***************
*** 78,84 ****


so that Elm will call menu_context_resize() when it is

waiting child to complete ...

-
New elmrc options:
local-sessionlock-dir
local-sessionlock-use-home

--- 378,383 ----


***************
*** 169,175 ****
Changes of Elm2.4ME+ PL113a (25) compared with Elm2.4ME+ PL113 (25)
-------------------------------------------------------------------

! [ This is out of branch patch. ]

- "I tried to compile elm2.4.ME+.113 on AIX 5.1 (maintenance
level 05) or on AIX 5.2 (maintenance level 02)

--- 468,474 ----


Changes of Elm2.4ME+ PL113a (25) compared with Elm2.4ME+ PL113 (25)
-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "I tried to compile elm2.4.ME+.113 on AIX 5.1 (maintenance
level 05) or on AIX 5.2 (maintenance level 02)
***************
*** 338,344 ****
Changes of Elm2.4ME+ PL111b (25) compared with Elm2.4ME+ PL111a (25)
--------------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix crash on parse failure on command
"View digest as mailbox".

--- 637,643 ----


Changes of Elm2.4ME+ PL111b (25) compared with Elm2.4ME+ PL111a (25)
--------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix crash on parse failure on command
"View digest as mailbox".
***************
*** 346,352 ****
Changes of Elm2.4ME+ PL111a (25) compared with Elm2.4ME+ PL111 (25)
-------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes crash caused by 'U' command
on aliases menu.

--- 645,651 ----


Changes of Elm2.4ME+ PL111a (25) compared with Elm2.4ME+ PL111 (25)
-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes crash caused by 'U' command
on aliases menu.
***************
*** 429,435 ****
Changes of Elm2.4ME+ PL110a (25) compared with Elm2.4ME+ PL110 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes case, where output of pgp/gpg was
not shown sometimes (on non-MIME messages),

--- 728,734 ----


Changes of Elm2.4ME+ PL110a (25) compared with Elm2.4ME+ PL110 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes case, where output of pgp/gpg was
not shown sometimes (on non-MIME messages),
***************
*** 569,575 ****
Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)
-------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes segmentation violation on
l)imit command and problem where user alias

--- 868,874 ----


Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)
-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes segmentation violation on
l)imit command and problem where user alias
***************
*** 585,591 ****
Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)
-------------------------------------------------------------------

! [ This is out of branch patch. ]

Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

--- 884,890 ----


Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)
-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

***************
*** 814,820 ****
Changes of Elm2.4ME+ PL108a (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch makes some fixes for elmregister,
and elm's search command ('/').

--- 1113,1119 ----


Changes of Elm2.4ME+ PL108a (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch makes some fixes for elmregister,
and elm's search command ('/').
***************
*** 929,935 ****
Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch corrects page when returning
from o)ptions screen and fixes some other

--- 1228,1234 ----


Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch corrects page when returning
from o)ptions screen and fixes some other
***************
*** 1242,1248 ****
Changes of Elm2.4ME+ PL102a (25) compared with Elm2.4ME+ PL102 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes temp file leak
when forwarding with mimeforward = YES and

--- 1541,1547 ----


Changes of Elm2.4ME+ PL102a (25) compared with Elm2.4ME+ PL102 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes temp file leak
when forwarding with mimeforward = YES and
***************
*** 1571,1577 ****
Changes of Elm2.4ME+ PL101c (25) compared with Elm2.4ME+ PL101b (25)
--------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes segmentation fault, when
when viewing attachment with unxepected

--- 1870,1876 ----


Changes of Elm2.4ME+ PL101c (25) compared with Elm2.4ME+ PL101b (25)
--------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes segmentation fault, when
when viewing attachment with unxepected
***************
*** 1784,1790 ****
Changes of Elm2.4ME+ PL101b (25) compared with Elm2.4ME+ PL101a (25)
--------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch makes possible to set
incoming-mailbox = $USER@imap-sever on

--- 2083,2089 ----


Changes of Elm2.4ME+ PL101b (25) compared with Elm2.4ME+ PL101a (25)
--------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch makes possible to set
incoming-mailbox = $USER@imap-sever on
***************
*** 1832,1838 ****
Changes of Elm2.4ME+ PL101a (25) compared with Elm2.4ME+ PL101 (25)
-------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes crash on internal mailcap parser
and on header editing screen.

--- 2131,2137 ----


Changes of Elm2.4ME+ PL101a (25) compared with Elm2.4ME+ PL101 (25)
-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes crash on internal mailcap parser
and on header editing screen.
***************
*** 2014,2020 ****
Changes of Elm2.4ME+ PL100a (25) compared with Elm2.4ME+ PL100 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Configure did not generated mapping for iso_8859_1
locale (on SunOS).

--- 2313,2319 ----


Changes of Elm2.4ME+ PL100a (25) compared with Elm2.4ME+ PL100 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Configure did not generated mapping for iso_8859_1
locale (on SunOS).
***************
*** 2341,2347 ****
Changes of Elm2.4ME+ PL99f (25) compared with Elm2.4ME+ PL99e (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix panic on header editing screen on In-Reply-To:
STRING PANIC in cs_binary.c:1043:cs_give_unicode_from_ascii

--- 2640,2646 ----


Changes of Elm2.4ME+ PL99f (25) compared with Elm2.4ME+ PL99e (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix panic on header editing screen on In-Reply-To:
STRING PANIC in cs_binary.c:1043:cs_give_unicode_from_ascii
***************
*** 2366,2372 ****
Changes of Elm2.4ME+ PL99e (25) compared with Elm2.4ME+ PL99d (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Trying send pgp2 (signed or encrypted) message
was causing crash.

--- 2665,2671 ----


Changes of Elm2.4ME+ PL99e (25) compared with Elm2.4ME+ PL99d (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Trying send pgp2 (signed or encrypted) message
was causing crash.
***************
*** 2394,2400 ****
Changes of Elm2.4ME+ PL99d (25) compared with Elm2.4ME+ PL99c (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- "I'm working on updating the Debian elm-me+ package; a
number of patches have accumulated over the years, and

--- 2693,2699 ----


Changes of Elm2.4ME+ PL99d (25) compared with Elm2.4ME+ PL99c (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "I'm working on updating the Debian elm-me+ package; a
number of patches have accumulated over the years, and
***************
*** 2475,2481 ****
Changes of Elm2.4ME+ PL99c (25) compared with Elm2.4ME+ PL99b (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Handling of multipart/signed and
multipart/encrypted was broken Elm2.4ME+ PL98 (25)

--- 2774,2780 ----


Changes of Elm2.4ME+ PL99c (25) compared with Elm2.4ME+ PL99b (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Handling of multipart/signed and
multipart/encrypted was broken Elm2.4ME+ PL98 (25)
***************
*** 2484,2490 ****
Changes of Elm2.4ME+ PL99b (25) compared with Elm2.4ME+ PL99a (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix panic with ISO-2022-JP text with message
STRING PANIC in cs_iso2022.c:1757:add_char_stream

--- 2783,2789 ----


Changes of Elm2.4ME+ PL99b (25) compared with Elm2.4ME+ PL99a (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix panic with ISO-2022-JP text with message
STRING PANIC in cs_iso2022.c:1757:add_char_stream
***************
*** 2495,2501 ****
Changes of Elm2.4ME+ PL99a (25) compared with Elm2.4ME+ PL99 (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- There should not be Return-Path header visible
on Pre-Send screen on Beginner user level.

--- 2794,2800 ----


Changes of Elm2.4ME+ PL99a (25) compared with Elm2.4ME+ PL99 (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- There should not be Return-Path header visible
on Pre-Send screen on Beginner user level.
***************
*** 2744,2750 ****
Changes of Elm2.4ME+ PL98c (25) compared with Elm2.4ME+ PL98b (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- copy_message_2() lost header name when folding happeded
immediately after header name (that specially was visible

--- 3043,3049 ----


Changes of Elm2.4ME+ PL98c (25) compared with Elm2.4ME+ PL98b (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- copy_message_2() lost header name when folding happeded
immediately after header name (that specially was visible
***************
*** 2767,2773 ****
Changes of Elm2.4ME+ PL98b (25) compared with Elm2.4ME+ PL98a (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Our non-standard headers was ignored:
* X-ELM-OSV: hdr-charset=xxxx was ignored

--- 3066,3072 ----


Changes of Elm2.4ME+ PL98b (25) compared with Elm2.4ME+ PL98a (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Our non-standard headers was ignored:
* X-ELM-OSV: hdr-charset=xxxx was ignored
***************
*** 2776,2782 ****
Changes of Elm2.4ME+ PL98a (25) compared with Elm2.4ME+ PL98 (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- "since a number of releases frm doesn't detect status
new correctly for me (Linux 2.4.18, elm2.4.ME+.98)."

--- 3075,3081 ----


Changes of Elm2.4ME+ PL98a (25) compared with Elm2.4ME+ PL98 (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "since a number of releases frm doesn't detect status
new correctly for me (Linux 2.4.18, elm2.4.ME+.98)."
***************
*** 2969,2975 ****
Changes of Elm2.4ME+ PL97d (25) compared with Elm2.4ME+ PL97c (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]


- If there libintl.so (from GNU gettext) installed

--- 3268,3274 ----


Changes of Elm2.4ME+ PL97d (25) compared with Elm2.4ME+ PL97c (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]


- If there libintl.so (from GNU gettext) installed
***************
*** 3002,3008 ****
Changes of Elm2.4ME+ PL97c (25) compared with Elm2.4ME+ PL97b (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Wrong answer to question "Any additional libraries"
causes failure on "Trying locate terminfo routines"

--- 3301,3307 ----


Changes of Elm2.4ME+ PL97c (25) compared with Elm2.4ME+ PL97b (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Wrong answer to question "Any additional libraries"
causes failure on "Trying locate terminfo routines"
***************
*** 3052,3058 ****
Changes of Elm2.4ME+ PL97b (25) compared with Elm2.4ME+ PL97a (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- binary flag was incorrectly set true (result on change
on Elm2.4ME+ PL97 (25)). That caused that EOLN mail headers

--- 3351,3357 ----


Changes of Elm2.4ME+ PL97b (25) compared with Elm2.4ME+ PL97a (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- binary flag was incorrectly set true (result on change
on Elm2.4ME+ PL97 (25)). That caused that EOLN mail headers
***************
*** 3065,3071 ****
Changes of Elm2.4ME+ PL97a (25) compared with Elm2.4ME+ PL97 (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix state_printf panic "Embedded newlines are not supported"
on case when there is on ~/.elm/elmheaders

--- 3364,3370 ----


Changes of Elm2.4ME+ PL97a (25) compared with Elm2.4ME+ PL97 (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix state_printf panic "Embedded newlines are not supported"
on case when there is on ~/.elm/elmheaders
***************
*** 3195,3201 ****
Changes of Elm2.4ME+ PL96b (25) compared with Elm2.4ME+ PL96a (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Test whatever make sets $(MAKE)

--- 3494,3500 ----


Changes of Elm2.4ME+ PL96b (25) compared with Elm2.4ME+ PL96a (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Test whatever make sets $(MAKE)

***************
*** 3225,3231 ****
Changes of Elm2.4ME+ PL96a (25) compared with Elm2.4ME+ PL96 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- Metamail can not cope with CRLF
Problem noted by: Konstantinos Konstantinides <k...@corp.cirrus.com>

--- 3524,3530 ----


Changes of Elm2.4ME+ PL96a (25) compared with Elm2.4ME+ PL96 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Metamail can not cope with CRLF
Problem noted by: Konstantinos Konstantinides <k...@corp.cirrus.com>
***************
*** 3424,3430 ****
Changes of Elm2.4ME+ PL95c (25) compared with Elm2.4ME+ PL95b (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Do not use commands "mail" or "mailx" as mailer.
- Allow specify "none" as mailer on configuration time

--- 3723,3729 ----


Changes of Elm2.4ME+ PL95c (25) compared with Elm2.4ME+ PL95b (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Do not use commands "mail" or "mailx" as mailer.
- Allow specify "none" as mailer on configuration time
***************
*** 3440,3446 ****
Changes of Elm2.4ME+ PL95b (25) compared with Elm2.4ME+ PL95a (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- "Using PL95 with the two patches you send me, I encountered the
following problem when searching for a string in a mail message:

--- 3739,3745 ----


Changes of Elm2.4ME+ PL95b (25) compared with Elm2.4ME+ PL95a (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Using PL95 with the two patches you send me, I encountered the
following problem when searching for a string in a mail message:
***************
*** 3458,3464 ****
Changes of Elm2.4ME+ PL95a (25) compared with Elm2.4ME+ PL95 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- "Following please find the error when trying to
compile elm2.4.ME+.95 on AIX 4.3.3 (maintenance level 09):

--- 3757,3763 ----


Changes of Elm2.4ME+ PL95a (25) compared with Elm2.4ME+ PL95 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Following please find the error when trying to
compile elm2.4.ME+.95 on AIX 4.3.3 (maintenance level 09):
***************
*** 3766,3772 ****
Changes of Elm2.4ME+ PL94a (25) compared with Elm2.4ME+ PL94 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- When sending mail, saving copy of mail to folder
failed when

--- 4065,4071 ----


Changes of Elm2.4ME+ PL94a (25) compared with Elm2.4ME+ PL94 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- When sending mail, saving copy of mail to folder
failed when
***************
*** 3970,3976 ****
Changes of Elm2.4ME+ PL92a (25) compared with Elm2.4ME+ PL92 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- "Until I did this I could not get it to build correctly on
solaris 8 (even if I didn't want to use the sharedlibs --

--- 4269,4275 ----


Changes of Elm2.4ME+ PL92a (25) compared with Elm2.4ME+ PL92 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Until I did this I could not get it to build correctly on
solaris 8 (even if I didn't want to use the sharedlibs --
***************
*** 4206,4212 ****
Changes of Elm2.4ME+ PL90a (25) compared with Elm2.4ME+ PL90
------------------------------------------------------------

! [ This is out of branch patch. ]

- "Running Elm 2.4ME+86, if I displayed the first 80% of
a message using the built-in text browser, pressing

--- 4505,4511 ----


Changes of Elm2.4ME+ PL90a (25) compared with Elm2.4ME+ PL90
------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Running Elm 2.4ME+86, if I displayed the first 80% of
a message using the built-in text browser, pressing
***************
*** 4346,4352 ****
Changes of Elm2.4ME+ PL88a (25) compared with Elm2.4ME+ PL88 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- In newmail.c and from.c utilities header_charset
was not set.

--- 4645,4651 ----


Changes of Elm2.4ME+ PL88a (25) compared with Elm2.4ME+ PL88 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- In newmail.c and from.c utilities header_charset
was not set.
***************
*** 4614,4620 ****

Changes of Elm2.4ME+ PL84a (25) compared with Elm2.4ME+ PL84 (25)
-----------------------------------------------------------------
! [ This is out of branch patch. ]

- 'struct string * ret' was incorrectly static on
browser_descend_imap(). That caused Elm to crash,

--- 4913,4919 ----



Changes of Elm2.4ME+ PL84a (25) compared with Elm2.4ME+ PL84 (25)
-----------------------------------------------------------------
! [ This patch is branch from the main line. ]

- 'struct string * ret' was incorrectly static on
browser_descend_imap(). That caused Elm to crash,
***************
*** 5357,5363 ****

Changes of Elm2.4ME+ PL76a (25) compared with Elm2.4ME+ PL76 (25)
-----------------------------------------------------------------
! [ This is out of branch patch. ]

- On PL73 [encode] was producing (by mistake)
text/X-ELM-encode instead of application/X-ELM-encode as

--- 5656,5662 ----



Changes of Elm2.4ME+ PL76a (25) compared with Elm2.4ME+ PL76 (25)
-----------------------------------------------------------------
! [ This patch is branch from the main line. ]

- On PL73 [encode] was producing (by mistake)
text/X-ELM-encode instead of application/X-ELM-encode as
***************
*** 6716,6722 ****
Changes of Elm2.4ME+ PL53Y (25) compared with Elm2.4ME+ PL53 (25)
---------------------------------------------------------------

! [ This is out of branch patch. ]

- Test that year >= 0 instead of year > 0 on
cvt_yearstr_to_yearnum(). That affects if

--- 7015,7021 ----


Changes of Elm2.4ME+ PL53Y (25) compared with Elm2.4ME+ PL53 (25)
---------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Test that year >= 0 instead of year > 0 on
cvt_yearstr_to_yearnum(). That affects if
***************
*** 6868,6874 ****
Changes of Elm2.4ME+ PL50s (25) compared with Elm2.4ME+ PL50 (25)
--------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix incorrect bound checking on putc_so_string()
(state.c)

--- 7167,7173 ----


Changes of Elm2.4ME+ PL50s (25) compared with Elm2.4ME+ PL50 (25)
--------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix incorrect bound checking on putc_so_string()
(state.c)
***************
*** 7509,7515 ****
Changes of Elm2.4ME+ PL31H (25) compared with Elm2.4ME+ PL31 (25)
---------------------------------------------------------------

! [ This is out of branch patch. ]

- Incorrect Content-length: -header was causing corruption
of folders.

--- 7808,7814 ----


Changes of Elm2.4ME+ PL31H (25) compared with Elm2.4ME+ PL31 (25)
---------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Incorrect Content-length: -header was causing corruption
of folders.

***************
*** 8752,8757 ****
--- 9051,9058 ----
New elmrc options:
metamail

+ =======================================================================
+
Changes of Elm2.4 PL24 ME8b+ compared with version Elm2.4 PL24 ME8b
-----------------------------------------------------------------

Index: elmME+.2.5.alpha0-cvs/2.4/ANNOUNCE.ME
*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
--- elmME+.2.5.alpha0-cvs/2.4/ANNOUNCE.ME 2004-04-17 12:03:43.000000000 +0300
***************
*** 0 ****
--- 1,287 ----
+
+ This ANNOUNCE.ME is for ME patches of the 2.4 version.
+
+ Look file README.ME+ for the 2.4ME+ version.
+
+ --------------------------------------------------------------------
+
+ ELM 2.4 PL24 ME8
+
+ This is an announcement for Patchlevel ME8 for Elm 2.4pl24.
+
+ The most current version of this document is available via the web:
+ http://www.cs.hmc.edu/~me/elm/announce.html. You can also visit the "ME" home
+ page at http://www.cs.hmc.edu/~me/elm/me.html.
+ NOTE THAT THIS ADDRESS HAS CHANGED FROM THE PREVIOUS ANNOUNCEMENT!
+
+ What's new:
+
+ * Anonymous remailer support (plus chaining, PGP encryption & MIME support)
+ * mime.types file when guessing the content-type of an attachment.
+ * Forwarded messages can be attached as MESSAGE/RFC822 data
+ * Supports extraction of PGP public keys directly
+ * Support for application/pgp type inside multipart/mixed and message/rfc822
+ messages
+
+ Changes from ME7a:
+
+ * Replying to MULTIPART messages now works correctly.
+ * MESSAGE/RFC822 is now properly supported.
+ * BINARY encoding is better supported.
+ * Fixed bugs with BASE64 and QUOTED-PRINTABLE encodings.
+ * Enhanced attachment menu
+ * Improved interface for PGP encrypting messages
+
+ Where to get it:
+
+ * ftp://cs.hmc.edu/pub/me/elm-2.4pl24me8.tar.Z
+ * ftp://cs.hmc.edu/pub/me/elm-2.4pl24me8.tar.gz
+ * ftp://cs.hmc.edu/pub/me/elm-2.4pl24me8.diffs.Z
+ * ftp://cs.hmc.edu/pub/me/elm-2.4pl24me7a-8.diffs.Z
+
+ -OR-
+
+ * ftp://uiarchive.cso.uiuc.edu/pub/packages/mail/elm/me/elm-2.4pl24me8.tar.Z
+ * ftp://uiarchive.cso.uiuc.edu/pub/packages/mail/elm/me/elm-2.4pl24me8.tar.gz
+ * ftp://uiarchive.cso.uiuc.edu/pub/packages/mail/elm/me/elm-2.4pl24me8.diffs.Z
+ * ftp://uiarchive.cso.uiuc.edu/pub/packages/mail/elm/me/elm-2.4pl24me7a-8.diffs.Z
+
+ -------------------------------------------------------------------------------
+
+ STATUS
+
+ These patches are not an official release of Elm, and are not supported by the
+ Elm Development Group. Features included in this patch may or may not be
+ included in the next official release of Elm. I can say for certain that the
+ PGP portion will not. I am hoping that my MIME patches will be included in the
+ 2.5 release, but that is still an open question. Should the 2.5 release appear
+ without these patches, I plan on "porting" them and using 2.5 as the base.
+ -------------------------------------------------------------------------------
+ And now on to the interesting stuff...
+
+ PGP SUPPORT
+
+ [This work was inspired by pgpelm which was started by Mic the Missing and
+ furthur developed by Ken Cox (ke...@viewlogic.com). This version is a complete
+ rewrite of that system but looks very similar.]
+
+ Features include: mark on folder menu showing PGP encrypted messages and public
+ key blocks, encryption/signing of outgoing messages, decrypting/signature
+ check, mailing public key blocks, and extracting public key blocks from
+ messages. Special feature allows you to have ELM keep track of your PGP
+ passphrase so you only need to enter it a minimal number of times.
+
+ I have written a primer for using PGP with this version of ELM which can be
+ found at http://www.cs.hmc.edu/~me/elm/pgp.html. It contains everything you
+ need to know about how to use PGP with ELM.
+
+ MIME SUPPORT
+
+ With this version of Elm, the need for metamail is much less since it can now
+ handle the MIME encodings and multipart/* messages internally. The only case in
+ which metamail is called is when there is a content-type which Elm does not
+ understand (eg. image/*, audio/*). In most cases you will probably only receive
+ this as attachments anyway, so you might still not require metamail.
+
+ * Incoming Attachments
+
+ Access to individual portions of a MIME mulitpart message can be accessed
+ via the "Attachments" menu (type 'v' in the index menu). This brings up a
+ menu listing the attachments for the current message. You then have the
+ option of viewing or saving the attachment.
+
+ * Outgoing Attachments
+
+ In addition to using the "[include ..." construct when editing your
+ message, there is now an "Attachments" menu accesible from the "Send" menu
+ (it is abbreviated to "a)tt" because of space problems). Simply type "a"
+ to get into the Attachments menu. You may then add/delete/edit/modify
+ attachments. When possible, Elm will attempt to guess the correct
+ Content-Type (based on file extension, see the "mime.types" section below)
+ and Content-Transfer-Encoding.
+
+ * Automatic encoding for outgoing messages.
+
+ If Elm finds 8bit or control characters in text files to be attached, it
+ will automatically encode them QUOTED-PRINTABLE if Elm has been compiled
+ without the 8BITMIME option (meaning that your MTA isn't 8bit clean). This
+ behavior can be overriden with the "noencoding" elmrc option (see below)
+ in cases where your sendmail is 8bit clean, but doesn't support the
+ -B8BITMIME option.
+
+ * mime.types file
+
+ Elm now mime.types file which maps filename extensions to Content-Type
+ field when sending attachments via the new attachment menu. The format of
+ these files is as follows:
+
+ <extension> <content-type>
+
+ A hash character ('#') may be used as a comment, but it must be in the
+ first column of a line.
+
+ Here is an example of mime.types file:
+
+ # This is a commented line
+ html text/html
+ tgz application/octet-stream; type=tar; conversions="x-gzip"
+
+ Note that the content-type field is not limited to just the type/subtype
+ part; in can also include suplementary information.
+
+ Elm first looks to see if the user has a ~/.elm/mime.types file. If there
+ is no match, Elm will then try to read the system types file (typically
+ /usr/local/lib/elm.mimetypes). Failing that, Elm has a few builtin types
+ that it understands.
+
+ You might want to pick up a copy of my mime.types file as a starting point
+ for either your personal or system file at
+ http://www.cs.hmc.edu/~me/elm/mime.types.
+
+ REMAILER SUPPORT
+
+ This version of Elm has the ability to prepare messages for use with anonymous
+ remailers (if you don't know what that is, read alt.privacy.anon-server for
+ more information).
+
+ Elm gets its information about anonymous servers by either fingering
+ "remail...@kiwi.cs.berkeley.edu" or by reading ~/.elm/remailers (if this
+ file exists, it overrides the "finger" so you can still use this feature even
+ if you are not directly net connected.)
+
+ To send an anonymous message, first compose your message as you normally would,
+ entering the name of the person who should ultimately receive the message as
+ the To: address. Then, at the "send" menu, you can type "r" to get into the
+ "remailer" menu.
+
+ There are several options in this menu: remail, chain, path and encrypt.
+ The "remail" option indicates whether or not the current message will be
+ remailed.
+
+ "chain" indicates how many servers this message should be sent through (the
+ higher chain is, the more secure, but the tradeoff is how long until the
+ receiver gets the message).
+
+ "path" is where you can specify which servers you would like this message to go
+ through (this overrides "chain"). You can specify a semi-colon (";") separated
+ list of server "nicknames" here.
+
+ "encrypt" means that Elm should encrypt your messages with the PGP public key
+ of server you are remailing through (note that if chain > 1 or there is more
+ that one server in "path", Elm will do the "right" thing and call PGP multiple
+ times for each hop).
+
+ Once the desired options are set, you can quit the menu and send the message.
+ What you see next will vary... If you are a PGP user and set encrypt=TRUE in
+ the remailer menu, you will see the call(s) to pgp flash across your screen.
+ Otherwise you will most likely just see the "Mail sent." message.
+
+ If you have MIME defined, it should be possible for you to include attachments
+ in your anonymous mail in the normal manner. Most servers these days support
+ the "hash" option which Elm makes use of to pass the proper MIME headers.
+
+ NEW ELMRC OPTIONS
+
+ * usepgppass = [ ON | OFF ]
+ Default: usepgppass = OFF
+ o OFF: Elm does not keep your passphrase in memory. You must enter it
+ each time you want to decrypt a pgp mail.
+ o ON: Elm keep your passphrase in memory for "keeppassfor" seconds.
+ * keeppassfor = <number>
+ Default: keeppassfor = 0
+ o keeppassfor>=0: Elm will keep your passphrase in memory for seconds
+ after entering the passphrase.
+ o keeppassfor<0: Elm will keep your passphrase in memory without
+ clearing it from memory.
+ * noencoding = <level>
+ Default: noencoding = 0
+
+ This control makes it possible to send raw 8bit or binary data when the
+ MTA doesn't support 8BITMIME and the -B8BITMIME option or BINARYMIME and
+ the -BBINARYMIME option.
+
+ Possible values:
+ o 0 : Always convert 8BIT and BINARY data to QUOTED-PRINTABLE if the
+ MTA doesn't support the -B8BITMIME and -BBINARYMIME options.
+ o 1 : Allow 8bit without -B8BITMIME, but binary data is encoded
+ o 2+: Allow binary without -BBINARYMIME and and 8bit without
+ -B8BITMIME
+ It is STRONGLY recommended that it be left set to 0 unless you know what
+ you are doing!!
+ * showto = [ ON | OFF ]
+ Default: showto = OFF
+ o ON: Elm should show you who the message is addressed to rather than
+ who it is from if the message is not addressed to you.
+ o OFF: normal behavior
+ * pagemultipart = [ ON | OFF ]
+ Default: pagemultipart = ON
+ o ON: Use the internal MIME support to display MULTIPART messages
+ rather than calling metamail
+ o OFF: display MULTIPART messages with metamail
+ * mimeforward = [ ON | OFF ]
+ Default: mimeforward = OFF
+ o ON: When forwarding a message, Elm will attach as a MIME body part of
+ type MESSAGE/RFC822.
+ o OFF: Elm will include the forwarded message in your message, just
+ like it always has.
+
+ BUILTIN++ PAGER
+
+ This pager looks a lot like more, but has some of the movement features of
+ less, most notably, paging backwards through your messages. Press '?' inside of
+ the pager for a list of valid keystroke commands.
+
+ TAGS
+
+ Use the keyword "tagged" in the "Delete messages with pattern" (invoked by ^D
+ in the index menu) to delete all tagged messages.
+
+ You can now use the keyword "all" to tag all visible messages.
+
+ LIMIT FUNCTIONALITY
+
+ * Simple compound statements can be made using '|' (OR) and '&' (AND).
+ * The "Cc:" field is now availible for search.
+ * New keyword "tagged" for narrowing to only the currently tagged messages.
+
+ MISCELLANEOUS
+
+ '*' may be used as a wildcard in the "alternatives" list in the elmrc file. For
+ instance, "me@*.hmc.edu" would me to match the user "me" in all hosts from the
+ "hmc.edu" domain.
+
+ Elm will keep track of the messages which you have replied to with an 'r' mark
+ in the index menu.
+
+ Forwarded messages are encapsulated instead of quoted like replies:
+
+ ----- Forwarded message from Joe User -----
+ [...]
+ ----- End of forwarded message from Joe User -----
+
+ You can effect an automatic Bcc: line by setting the address(es) in the "BCC"
+ environment variable. Note that this is non-standard, but provided as a means
+ of accomplishing the task.
+
+ BUGS
+
+ A list of known bugs can be found at
+ http://www.cs.hmc.edu/~elkins/elm/bugs.html.
+
+ AUTHOR
+
+ Michael Elkins <elk...@aero.org>
+ Home Page: http://www.cs.hmc.edu/~me/index.html
+
+ If you are interested in knowing what my future plans are, you can browse my
+ "TO DO" list at http://www.cs.hmc.edu/~me/elm/todo.html
+
+ THANKS
+
+ Kari Hurrta <Kari....@fmi.fi> has contributed a great deal to the MIME
+ support (and fixed lots of my stupid bugs ;-)
+
+ I would also like to thank everyone who took the time to report bugs or suggest
+ improvements!
+ -------------------------------------------------------------------------------
+ Last updated Sept 21, 1995.
Index: elmME+.2.5.alpha0-cvs/2.4/ChangeLog.ME
*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
--- elmME+.2.5.alpha0-cvs/2.4/ChangeLog.ME 2004-04-17 12:03:43.000000000 +0300
***************
*** 0 ****
--- 1,812 ----
+
+ This ChangeLog.ME is for ME patches of the 2.4 version.
+
+ Look file README.ME+ for changes of the 2.4ME+ version.
+
+ -------------------------------------------------------------------------
+
+ -----------------
+ Changes from ME8a
+ -----------------
+ When checking to see if the subject line should be centered when displaying
+ a mail message, the weedlist check should be for "subject:", not "subject".
+ This case is more general.
+
+ control-F in the main menu now causes Elm to forget your passphrase. Useful
+ for when you screw up so you don't have to exit Elm before using PGP
+ again.
+
+ Added a "metoo" argument in pgp_encrypt to decide whether or not the
+ +encrypttoself=on flag should be passed to pgp. This was needed so that
+ the value of auto_cc can be overidden when remailing.
+
+ Added support for decoding of RFC1522 style encoded headers. This should
+ work in the index menu, the pager, and when replying (the "attribution").
+
+ metapager will now recover if pgp fails by displaying the message "as is"
+ in the case where the message is only signed.
+
+ Simplified "pager" check in metapager since there are two pagers now.
+
+ Fixed problem in copy_message where the rfc822 newline at the end of the
+ headers was missing.
+
+ Fixed bug in menu2.c:generic_menu (used by the remailer) which caused
+ Elm to segfault when not compiled with gcc.
+ From: Andrey A. Chernov <ac...@astral.msk.su>
+
+ Fixed problem where trailing MMDF separator was still being printed.
+
+ The default filename for the Content-Disposition header was not getting
+ set if the included file did not have an extension.
+
+ text/plain => application/pgp conversion is now NOT done for public key
+ blocks.
+
+ Configure now figures out where "finger" is instead of hardcoding a path
+ in remailer.c
+
+ Hopefully fixed definition for sleep() in defs.h.
+
+ Fixed bug where elm would segfault when typing ^E when there are no messages
+ in the mailbox.
+
+ Fixed bug where a leading space could be inserted before the real name when
+ looking up a PGP public key from the return address.
+
+ Fixed some of the movement commands in builtin++ so that they work now.
+
+ Convert application/x-pgp-* => application/pgp to decode messages generated
+ by pgpelm.
+
+ Fixed problem where if the signature was added after editing the message,
+ it would be written over the message right after the content length. Fixed
+ by seeking to the end of the file after writing the content length field.
+
+ ----------------
+ Changes from ME8
+ ----------------
+ Fixed bug in conversion of text/plain => application/pgp in newmbox.c which
+ was causing Elm to segfault. (Thanks to Kari....@fmi.fi)
+
+ Fixed bug where builtin++ segfaults when viewing zero length messages.
+
+ -----------------------
+ Changes from ME8alpha19
+ -----------------------
+ Fixed bug where external pager did not work with non-MIME messages when
+ USE_PGP is defined.
+
+ Cleaned up mime_pgp_decode so that it does not need to look at the
+ header_rec for the current message any longer.
+
+ Do text/plain => application/pgp conversion in newmbox.c if PGP type data
+ is discovered in the message. This supports those who are sending PGP
+ messages but are not compliant with what Elm expects.
+
+ Added the control-E (extract public key) command to showmsg_c.c.
+
+ Security fix from Olaf Kirch <ok...@monad.swb.de> which forces Elm to write
+ the temp spool mailbox in the user's home directory instead of /tmp. This
+ prevents exploitation of symlinks to create a .rhosts in the user's
+ directory.
+
+ Fixed bug in show_status where flags from the previous message were not
+ being properly cleared with USE_PGP was defined and MIME was not.
+
+ -----------------------
+ Changes from ME8alpha18
+ -----------------------
+ added application_decode for support of APPLICATION/* types. Calls
+ null_decode if the subtype is unknown.
+
+ rfc822_decode now matches the headers against the weedlist when printing
+ out. You can view all the headers for a message by pressing 'h' while
+ viewing a message just as you normally would.
+
+ added mime_pgp_decode for inline decoding of application/pgp parts.
+ application/pgp at the top level is still handled by metapager since some
+ people will be configured without MIME. I might eventually require that
+ to use PGP, you must also define MIME, but not yet!
+
+ Status header was printed in the wrong place with BINARY encoding.
+ From: Kari....@fmi.fi
+
+ Added the DONT_ADD_FROM and NEEDS_LONE_PERIOD_ESCAPE checks to write_encoded,
+ and other MIME text parts.
+ From: Kari....@fmi.fi
+
+ Added a "type_opts" field in mime_send_t.
+
+ mime_write_header now just writes the MIME headers. The code to add the
+ boundary for multipart messages and the charset for text/plain was moved into
+ mailmsg2.c.
+
+ Changed pgp code to set MIME fields to use add_parameter and type_opts instead
+ of directly writing to subtype.
+
+ Made some changes in the Content-Type for PGP messages to be more compliant
+ with the unofficial standard.
+
+ -----------------------
+ Changes from ME8alpha17
+ -----------------------
+ MIME header code in write_header_info() was moved to
+ mime_write_header in mime_encode.c. This was done to greatly simplify the
+ code, and to make it possible for me to send MIME messages with the
+ remailer code. This will also make it possible for me to have PGP
+ encrypted MIME messages in the future.
+
+ Content-Length headers are generated regardless of whether or not MIME
+ is defined.
+
+ Lots of changes to the remailer code to make it work with MIME.
+
+ -----------------------
+ Changes from ME8alpha16
+ -----------------------
+ Removed Content-Length header from attachments included by the "[include ...]"
+ statement.
+
+ Made the existing global variables that set the toplevel Content-Length header
+ a part of mime_send_t. This has the side effect that if MIME is not
+ defined, no Content-Length header will be added on outgoing messages.
+
+ Commented out the code which reads the content-length header from attachments
+ in mime_parse.c. It should now ignore that header and figure out the length
+ in multipart_parse().
+
+ -----------------------
+ Changes from ME8alpha15
+ -----------------------
+ New option "mimeforward" controls whether or not forwarded messages are
+ sent as MESSAGE/RFC822 MIME messages, or are sent in the old non-MIME
+ way.
+
+ - Fixes for my mistakes in alpha15.
+ - text_unsupported_decode() added for printing warning message about
+ unsupported text subtypes.
+ From: Kari....@fmi.fi
+
+ Changed disposition handing such that a message saying that the user should
+ type 'v' to view an attachment which is declared something other than
+ "inline".
+
+ -----------------------
+ Changes from ME8alpha14
+ -----------------------
+ Make sure that arguments to fseek(), etc., are type long.
+ From: Kari....@fmi.fi
+
+ Added some general access commands for attachments in the attach_menu.c
+ routines.
+ From: Kari....@fmi.fi
+
+ The disposition is now displayed in the little mini-header. This looks nicer
+ than the previous message about "[Content-Disposition: attachment, skipping]".
+
+ select_CT_decoder now returns text_decode for all TEXT types. My reasoning
+ here is that since the MIME spec says that all unknown subtypes of TEXT
+ should be treated as TEXT/PLAIN so long as the charset is understood, then
+ all TEXT can be treated in this manner.
+
+ Made sure that the pgp field of header_rec gets set to zero when initializing
+ in attach_viewer and also in newmbox.c.
+
+ Removed lots of unused variables.
+
+ Added some parentheses in places to make "gcc -Wparentheses" happy.
+
+ -----------------------
+ Changes from ME8alpha13
+ -----------------------
+ Forgot to initialize usepass=FALSE in pgp_decrypt_init. This caused elm
+ to hang when trying to decode a signed message while pgp was waiting for
+ the passphrase...
+
+ The attachment menu should now work properly for viewing message/rfc822
+ messages with the builtin pager.
+
+ When attaching a message/rfc822 with the "forward" command, you should
+ now be able to perform all the actions in attach_menu() as for a "normal"
+ attachment.
+
+ -----------------------
+ Changes from ME8alpha12
+ -----------------------
+ Tried to fix MIME_NOTPLAIN code again. This time MESSAGE/RFC822 will not
+ have it set, which MULTIPART will if pagemultipart=OFF.
+
+ Fixed attach_menu so that Elm does not segfault when you try to do an
+ operation on an attachment when there are no attachments defined.
+
+ Removed the MIME_NOTPLAIN flag and made it a one-bit flag in mime_t instead.
+ Removed PGP flags from defs.h and use a 3-bit field in header_rec instead.
+ These two now ensure that the "status" field of header_rec is always less
+ than 65536 so that 16bit integer machines will not have troubles.
+
+ Elm now pays attention to what the MIME-Version header says and passes any
+ messages with an unknown MIME-Version header value to metamail, or displays
+ an error if $NOMETAMAIL is set.
+ From: Kari....@fmi.fi
+
+ -----------------------
+ Changes from ME8alpha11
+ -----------------------
+ pgp_call() now uses the expanded_* address lists so that aliases are
+ expanded before trying to look up the ids with PGP.
+
+ Fixed calls in mailmsg2.c with wrong number of arguments (botched job
+ including Kari Hurtta's patch).
+ From: Kari....@fmi.fi
+
+ Reordered the preMIME code in newmbox.c to make it a little more efficient.
+
+ Fixed bug in write_header_info() where a spurious newline was being printed
+ after the Content-Type header for TEXT. This was causing the remaining
+ fields not to be a part of the message header.
+
+ Removed check for old-style RFCXXX Mime-Version header. I don't believe
+ anybody uses that anymore since RFC1341 has been out so long.
+
+ pgp_status needed to be reset when the user aborts sending a message,
+ otherwise you can't encrypt another message until you successfully send
+ another message.
+
+ MIME_NOTPLAIN is not set for multipart messages if "pagemultipart" is TRUE.
+
+ Cleaned up code for deciding if metamail mail should be called to display
+ a message in showmsg.c. Created a need routine, need_meta(), for this
+ purpose.
+
+ -----------------------
+ Changes from ME8alpha10
+ -----------------------
+ Fixes to remove some global MIME variables used for composing.
+ From: Kari....@fmi.fi
+
+ Added a redraw command to the attachment menu.
+
+ Fixed the code in newmbox.c where MIME_NOTPLAIN was not set for non-TEXT
+ content-types. Also, check for "plain" should be "text" for old-style
+ pre-MIME content-type headers.
+
+ Added a print command to the attachment menu.
+
+ Made the remailer support a Configure option.
+
+ ----------------------
+ Changes from ME8alpha9
+ ----------------------
+ Use Elm's error routines in the attachment menu.
+ Protected iscntrl() more calling isascii() before it in builtin++.
+ From: Kari Hurtta <Kari....@fmi.fi>
+
+ Added bit of code lost from old showmsg.c which centers the subject line
+ after the title line in the case where "subject" is in the weedlist.
+
+ Viewing attachments with metamail while in send mode now works. It required
+ different arguments to be passed to metamail.
+
+ -----------------------
+ Changes from ME8alpha8a
+ -----------------------
+ mime_t_clear() now sets the defaults of TEXT/PLAIN, ENCODING_7BIT, DISP_INLINE,
+ when called.
+
+ More fixes from Kari Hurtta <kari....@fmi.fi>
+
+ Removed padding bitfield from struct mimeinfo since it isn't needed.
+
+ Added +clearsig=ON when adding a PGP signature to a message.
+
+ Added prototypes for the functions defined in pgp.c.
+
+ Elm will now allow you to edit the list of usernames to encrypt to when
+ using PGP. This fixes the problem where sometimes the return address
+ doesn't match the address on the key. However, it still requires that
+ the user know this.
+
+ Implemented Kari Hurtta's suggestion of using a "state" variable for the
+ MIME output when decoding messages. This will make it easier to add new
+ extensions for output. The state information is defined in hdrs/state.h
+
+ The user interface for the attachment menu now is more consistent with
+ the mailbox menu. (Kari....@fmi.fi)
+
+ User is now asked for confirmation upon deleting an attachment from the
+ attachment menu if "ask=ON" in the elmrc.
+
+ Fixed replying to messages with PGP signatures. They were getting sucked
+ into the new MIME code and getting skipped as an unknown type.
+
+ Added new procedure to allow for extraction of PGP public keys directly
+ instead of relying on metamail.
+
+ If Elm can't find a PGP key that it is looking for, it now tells the user
+ which key instead of just that there was an error.
+
+ The user is now allowed to re-edit the filename in attach_modify() if the
+ file was not found. This also allows a user to change the file associated
+ with an attachment.
+
+ Fixed very old bug of MMDF separators being printed when displaying a
+ message.
+
+ ----------------------
+ Changes from ME8alpha8
+ ----------------------
+ Fixed problem where you couldn't edit the default filename in attach_save().
+
+ ----------------------
+ Changes from ME8alpha7
+ ----------------------
+ Use safe_malloc() and safe_realloc() instead. (Kari Hurtta)
+
+ Fixed bug where no EOLN token was printed after the Content-Type header
+ when type_opts was NULL in attach_generate_message().
+
+ Reorganized struct mimeinfo so that bitfields are next to each other and
+ added padding to make them 1 byte long total.
+
+ -----------------------
+ Changes from ME8alpha6+
+ -----------------------
+ Reduced memory usage in "struct mimeinfo" by using bitfields or pointers
+ instead of predefined strings when possible. Also removed the "comments"
+ fields.
+
+ New routine lib/strmcpy.c for doing malloc/realloc and strcpy in one shot.
+ Helps out with the above objective.
+
+ The attachment menu now defaults to disposition "inline" when sending
+ mail.
+
+ Reorganized the screen in the attachment "configuration" menu.
+
+ Removed code for adding "name=" field to APPLICATION/OCTET-STREAM types.
+ Uses Kari's code for Content-Disposition "filename" instead. attach_menu()
+ still supports both for getting default filename when saving an
+ attachment.
+
+ Removed MIME_MULTIPART flag. Use MIME_TYPE_MULTIPART with "type" instead.
+
+ Removed "encoding" field from "header_rec". Use "encoding" in "mimeinfo"
+ instead (this was already mostly true, but there were a few cases left
+ over from the early support for encoding...)
+
+ ----------------------
+ Changes from ME8alpha6
+ ----------------------
+ Incorporated changes from Kari Hurtta <Kari....@FMI.FI>.
+ Big changes are the use of Content-Disposition and routines to better parse
+ rfc822 headers. Also fixed multi-line MIME header problem in newmbox.c
+
+ ----------------------
+ Changes from ME8alpha5
+ ----------------------
+ Fixed places where "/tmp" was hardcoded for temporary files instead of using
+ "temp_dir" in the ME extensions.
+
+ Fixed more isspace() problems with "signed char".
+
+ Made some formatting improvements in multipart_decode().
+
+ Fixed bug where multi-line Content-Type headers were not properly parsed in
+ newmbox.c.
+
+ Added builtin++2.c which contains a tempfile based pager which may become
+ part of the "official" distribution. For right now it is "experimental".
+
+ ----------------------
+ Changes from ME8alpha4
+ ----------------------
+ Fixed attach_modify() to use ->type and ->subtype like the rest of the
+ attachment routines.
+
+ Viewing an attachment while sending didn't work because it read from
+ mailfile... Now it can view external files as well.
+
+ Fixed problem with signed char and iscntrl() in AddLineToCache().
+ This fixes the problem with umlaut characters in some sets.
+ From: g...@netapp.com.
+
+ Modified mime_generate_boundary() to use mime_count as a counter so that
+ subsequent calls will generate different values.
+
+ Elm will now read ~/.elm/mime.types and $libdir/elm.mimetypes (system
+ mime.types file), if they exist, to map filename extensions to
+ Content-Type values when sending attachments. The format of this file
+ is:
+ <suffix> <content-type>
+ There must be no line breaks in the Content-Type field.
+ Example:
+ tar application/octet-stream; type=tar
+ for .tar files.
+ NOTE: data which is declared "application/octet-stream" will automatically
+ get the option "name=<default_filename>" added to it, so there is no
+ need to put it in the definition.
+
+ Modified attach_info() so that it uses BASE64 encoding for "application"
+ types that have 8bit or control chars in them.
+ Also, "image" automatically defaults to BASE64 without reading the file.
+
+ attach_save() now uses the "name=<default_filename>" field of "application"
+ types as the default filename.
+
+ Added '+' as a synonym for NEXT_PAGE in builtin++ per popular request.
+
+ attach_generate_msg() no longer puts Content-Length headers on parts that
+ it generates.
+
+ ----------------------
+ Changes from ME8alpha3
+ ----------------------
+ Added support for multi-line Content-Type: headers in read_headers() and
+ mime_read_headers().
+
+ me.h now contains prototypes for functions defined by this set of patches.
+
+ Fixed some problems with using PGP and remailers.
+
+ Fixed parsing of options in the Content-Type header so that semicolons
+ inside quotes are protected.
+
+ If MIME is defined, forwarded messages will be an attachment of type
+ MESSAGE/RFC822.
+
+ Fixed problem with viewing MULTIPART or MESSAGE/RFC822 attachments from
+ the attachment menu.
+
+ Replaced MIME_BOUNDARY with a function (mime_generate_boundary()) that
+ sets the global variable "mime_boundary" to generate unique multipart
+ boundaries. This is important now that Elm will be sending out
+ MESSAGE/RFC822 data which Elm might have originally generated...
+
+ ----------------------
+ Changes from ME8alpha2
+ ----------------------
+ Added a second line for menu items in verify_transmission() since adding
+ the "r)emailer" option didn't fit on the first line.
+
+ Modified the PGP code a little for more flexibility. You can now specify
+ a string of "ids" to encrypt with in pgp_call().
+
+ ---------------------
+ Changes from ME8alpha
+ ---------------------
+ The menus from attach.c and attach_send.c were combined into a single
+ menu in attach_menu.c which servers both purposes. The difference is
+ whether or not the user is allowed to modify the given attachments.
+
+ The rest of attach_send.c was renamed as mime_encode.c.
+
+ -----------------
+ Changes from ME7a
+ -----------------
+
+ Added a check in quoted_printable_decode() to make sure that the index
+ into outbuf[] does not run off the end and cause problems.
+
+ attach_edit() didn't return TRUE after editing in one spot, which causes
+ problems on some platforms, namely Solaris.
+ From: Martin Walter <ma...@ruf.uni-freiburg.de>
+
+ base64_decode() was broken because it would fread() a data chunk, and
+ wasn't always a multiple of 4 bytes, causing the decoding to break.
+
+ Changed char => unsigned char in most places in *_encode() to fix problems
+ with ISO characters >127.
+
+ Added message about PGP support for the 'elm -v' command in args.c.
+
+ Support for anonymous remailers. [ALPHA]
+
+ Major rewrite of the MIME handling code. MULTIPART and MESSAGE/RFC822
+ messages are parsed the first time they are accessed (eg. viewed/replied)
+ and then are ready to use without parsing after that. See mime_parse.c
+ and mime_decode.c for details.
+
+ From: Kari Hurtta <Kari....@fmi.fi>
+ Put a loop around verify_transmission() so that Elm will no longer just
+ be lame when an error occurs in [include ...] statements. (Way cool! -Ed)
+
+ Don't allow user read or writes files as attachmentds which he don't heve
+ access. Notice that elm is (usually) setgid mail.
+
+ Consider if MTA supports 8BITMIME also when encoding attachments.
+
+ Now mail is encoded with quoted-printable if it includes control characters.
+ 8BITMIME doesn't help in this case.
+
+ Attachments are checked for 8bit characters, then content-transfer-encoding
+ 7bit is not allowed.
+
+ If any of subpart (also attachments) have content-tarnsfer-encoding 8bit
+ or binary it propagates to content-transfer-encoding of top multipart -type.
+
+ Now taken note of MIME's canonical encoding model:
+ - End of line in text -subtypes when they have encoded with BASE64
+ must be encoded as CR LF.
+ - Also CR and LF must be encoded in quoted-printable-encoding if
+ type have binary data (ie. not line oriented).
+ - Done mapping CR LF -> LF when decoding text -subtypes.
+
+ These content-transfer-encoding checks for attachments are also done
+ for [include ...] keywords when sending.
+
+ Now [include ...] also don't need metamail's help (they use same routines
+ than attachments menu).
+
+ Added configuration file option 'noencoding' (see elmrc-info for details
+ on what this does).
+
+ ----------------
+ Changes from ME7
+ ----------------
+
+ Forgot to kill the newline from the PGP output before putting it in to the
+ builtin++ pager. This resulted in messages being displayed double-spaced.
+ Ick!
+
+ ----------------
+ Changes from ME6
+ ----------------
+
+ attach_send.c needs <sys/stat.h> on some machines.
+
+ Fixed initialization of arrays in attach_send.c because CC isn't quite
+ ANSI compliant. You can only initialize static arrays.
+ From: Guy Harris <g...@netapp.com>
+
+ Added support for sendmail 8.7 which has support for 8BIT content
+ encoding. Uses the -B8BITMIME option.
+ From: Kari Hurtta <hur...@dionysos.fmi.fi>
+
+ Fixed problem where QUOTED-PRINTABLE messages were not decoded when
+ replying if USE_PGP was not defined.
+ From: Kari Hurtta <hur...@dionysos.fmi.fi>
+
+ [keyword ...] constructs are no longer broken when using MIME and the
+ message is to be encoded QUOTED-PRINTABLE.
+ From: Kari Hurtta <hur...@dionysos.fmi.fi>
+
+ Made the QUOTED-PRINTABLE encoding routine more compliant with the
+ standard.
+ From: Kari Hurtta <hur...@dionysos.fmi.fi>
+
+ Added patch to mark messages NEW in all folders (not just the SPOOL)
+ if there is no status: line.
+ NOTE: This will probably go away when 2.5 is released. Instead, they
+ will use some sort of "magic" flag to accomplish the same thing.
+
+ Added check to make sure that we don't run off the end of outbuf[] in
+ base64_decode() in mime.c.
+ From: Kurt....@rus.uni-stuttgart.de
+
+ Fixed type casting problem with BSD 4.4 derivatives in mime.c.
+ From: Andrey A. Chernov <ac...@astral.msk.su>
+
+ KOI8-R added as a valid compat charset.
+ From: Andrey A. Chernov <ac...@astral.msk.su>
+
+ builtin++ now wraps the line at the number of columns on the screen, not
+ one character before. NewLine() apparently "does the right thing" and
+ doesn't print an extra line if the last character is in the last column.
+ From: Kari Hurtta <Kari....@fmi.fi>
+
+ The arrow keys now do what they did before instead of controlling the
+ bultin++ pager.
+
+ builtin++ always clears the screen before displaying the next (or
+ previous) page.
+
+ The length of a line in the cache for builtin++ is increased to 150
+ chars because the old value of 128 didn't work with hpterms with a
+ width of 134 chars.
+
+ Fixed problem where Elm would SIGBUS if you tried to use the
+ attachments menu in an empty folder.
+ From: Kari Hurtta <Kari....@fmi.fi>
+
+ buf[STRING] was too short in AttachmentMenu() and caused certain Elm to
+ bomb out on certain messages which had header lines which were too
+ long.
+
+ AddLineToCache() can now handle multiline input. This meant that
+ calls to it from metapager had to remove the trailing newlines.
+
+ Changed the MIME mini-header format in metapager().
+
+ attach_edit() looks more like header_edit() now. Makes the interface
+ more consistent.
+
+ lib/getrealname.c needed <ctype.h> on older BSD systems.
+
+ Fixed nasty bug where the blank line in between the headers and the body
+ of a NEW message would get deleted when resync'ing in the spool folder.
+
+ Fixed infinite loop in Configure when run with the -d option.
+
+ ----------------
+ Changes from ME5
+ ----------------
+
+ Added the DoAll() call so that the keyword "all" can be used when tagging
+ or deleting.
+
+ Decoupled PGP and MIME support such that you don't need MIME to use PGP.
+
+ Added lots of error checking code in metapager.c.
+ From: g...@netapp.com (Guy Harris).
+
+ Fixed bug in quoted_printable_decode() where I did not convert read
+ characters to base16.
+
+ Added hex() function to protect index_hex from bad values.
+
+ metapager() prompts for a command if necessary after running the external
+ pager, just as Elm used to do.
+
+ Fixed the From: line in write_header_info() where I broke it before.
+
+ Fixed bug where the MIME multipart boundary would be written after the
+ MMDF separator when copy=ON and the message was being copied to the user's
+ desired folder.
+
+ Added an "Attachments" menu in verify_transmission() for including
+ attachments. This works in addition to the current method of using
+ "[include ..."
+
+ Elm now directly supports writing of BASE64 and QUOTED-PRINTABLE
+ encodings.
+
+ Changed the return value of match_address() to be zero, since it
+ returns an int, and NULL is not always an int.
+ From: Michael Shields <shi...@tembel.org>
+
+ AttachViewer() now uses notplain() to determine whether or not
+ metamail is needed to view the message.
+ From: Guy Harris <g...@netapp.com>
+
+ needs_mmdecode() now takes the integer version of the encoding rather
+ than a string. This avoids parsing the string twice.
+ From: Guy Harris <g...@netapp.com>
+
+ Elm now checks outgoing messages to see if there are any non-printable
+ characters, and if so encodes the message QUOTED-PRINTABLE.
+
+ Cleaned up PGP code by moving more code to pgp.c so that other files
+ require less modification (ie. the diffs will be simpler).
+
+ Fixed showmsg.c so that it passes anything that doesn't require metamail
+ to the metapager. This fixed the problem where messages with no
+ Mime-Version header but had a Content-Type header wouldn't get displayed.
+ From: Guy Harris <g...@netapp.com>
+
+ Fixed bug in dispaddr.c so that if a message is from the user, it will
+ always use the TO address to display.
+
+ Moved get_real_name() to its own file in lib so it can be used by
+ dispaddr.c.
+
+ Modified get_real_name() so that if it sees an address like
+ "<elk...@aero.org>" it will return "elk...@aero.org" instead of a zero
+ length string.
+
+ ----------------
+ Changes from ME4
+ ----------------
+
+ Introduced the "metapager". It replaces most of the code in showmsg.c.
+ It also takes care of all the MIME and PGP functions the bultin++ pager
+ used to perform, so that the user doesn't have to use builtin++ in those
+ cases.
+
+ PGP decrypting function was rewritten using pipes so no temp files are
+ required!
+
+ The attachment handling code was modified to handle multiline content-type
+ headers generate by such mailers as zmailer. It also looks through each
+ modifier in the line intead of just assuming that the boundary field will
+ be the first.
+ From: g...@netapp.com (Guy Harris)
+
+ The "command" status line in the builtin++ pager now floats around instead
+ of always being on the bottom. This was done to facilitate the ^L in
+ the pager so it didn't look stupid.
+
+ Moved the MIME QUOTED-PRINTABLE and BASE64 decoding code to mime.c so it
+ can be shared.
+
+ Fixed copy_message() so that it will automatically decode MIME B64 and QP
+ encodings. This means that replies to these types of messages do what the
+ user will expect.
+
+ ----------------
+ Changes from ME3
+ ----------------
+
+ Fixed problems in builtin++.c and pgp.c where I used the return value
+ from sprintf() as a char* when in SYSV systems it returns an int.
+ This caused Elm to seg fault while decrypting messages.
+
+ Configure now asks about PGP support and automatically sets up
+ config.h. Thanks to Ken Cox (ke...@viewlogic.com) for additional help.
+
+ PGP messages are now automatically decrypted when replying if
+ usepgppass = ON.
+
+ Back to using the application/pgp format content-type. Use
+ format=keys-only for send a public key block.
+
+ PGPCall() now uses the pgp option +encrypttoself=on instead of tacking
+ the username on the end of the TO list.
+
+ Fixed problem where any messages after sending a PGP public key had
+ the key text included before the included message text.
+
+ Use rename() if availible instead of copying the file in PGPCall().
+ Otherwise use link(), unlink(). This should be a little more
+ efficient.
+
+ pgp is now called with the -w (wipe) option when encrypting.
+
+ builtin++ can now handle text which is QUOTED-PRINTABLE or BASE64
+ encoded.
+
+ Fixed bug where the last line of messages was not being printed.
+
+ Elm will no longer seg fault if you hit return without entering your
+ PGP passphrase.
+
+ Discovered the +batchmode option for pgp. This makes dealing with
+ incorrect passphrases much easier!
+
+ Fixed bug in builtin++ where the last line of pgp messages would be
+ printed more than once while at the end of the message under certain
+ circumstances.
+
+ Changed notplain() in mime.c to support message/* content-type.
+
+ Cleaned up the multipart handling by removing the boundary string from
+ header_rec to conserve memory. This is now handled by builtin++ and
+ AttachMenu().
+
+ builtin++ can now handle multipart/digest correctly.
+
+ SaveAttach() no longer needs to call metamail to decode QUOTED-PRINTABLE
+ or BASE64 encodings.
+
+ -----------------
+ Changes from ME2a
+ -----------------
+
+ Elm will now keep track of your PGP passphrase for your RSA secret key.
+ To use this feature, add the line "usepgppass = ON" to your .elmrc.
+ There is also a timeout feature which will cause Elm to "forget" your
+ passphrase after so many seconds if you don't use it. The default is
+ 300 seconds, but this can be changes by setting the variable
+ "keeppassfor" in your .elmrc.
+
+ The builtin++ pager was completely rewritten (again) so that it can now
+ handle normal messages, MIME multipart messages, automatic decryption
+ and automatic signature checking for PGP messages. It also seems to be
+ lacking some of the memory allocation bugs that the previous pager had.
+
+ Fixed a bug in DynamicArray() which causes DestroyDynamicArray() to
+ seg fault if exactly max+n elements were allocated. (w...@recco.de)
+
+ ----------------
+ Changes from ME2
+ ----------------
+
+ It is now possible to delete all "tagged" messages by entering "tagged"
+ as the pattern to match after typing <control>-d (^D).
+
+ fixed a bug in the limit command where you could not "un"limit the
+ display of headers. Thanks to g...@netapp.com (Guy Harris) for
+ pointing it out!
+
+ fixed a bug in is_multipart() where the "boundary" token match was
+ case-sensitive.
Index: elmME+.2.5.alpha0-cvs/2.4/Changes
*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
--- elmME+.2.5.alpha0-cvs/2.4/Changes 2004-04-17 12:03:44.000000000 +0300
***************
*** 0 ****
--- 1,101 ----
+
+ This Changes is for the 2.4 version.
+
+ Look file README.ME+ for changes of the 2.4ME+ version.
+
+ --------------------------------------------------------------------------
+ This file describes major changes made to the Elm source distribution
+ between Releases 2.3 and 2.4. Please remember that Elm is a volunteer
+ project, we did what we had time for, and perhaps, what interested us.
+ If you have a suggestion, or a fix, submit it, and better yet,
+ volunteer to implement it.
+
+ Syd Weinstein Sat Oct 3 16:55:49 EDT 1992
+
+ Drop all routing options and let the smart Mail Transport Agent route mail.
+
+ Completely new alias subsystem.
+
+ Support for NLS, LOCALE and message catalogs.
+
+ Quoted string support to allow for X.400 type addresses.
+
+ Support for MIME via metamail
+
+ Support for Content-Length and Content-type
+
+ Enhanced Configure Script
+
+ Added -f flag to filter for alternate rules file
+
+ Add sender to filter
+
+ implements a -q flag to filter to quiet any logging of filtering actions.
+
+ More intelligent make install target include better support for man pages
+
+ User definable Options Screen
+
+ System Wide Elmrc File (Allows binary distribution of Elm)
+
+ implement a ucb mail like metoo option in elm.
+
+ Split the common routines to a lib directory
+
+ Allow using ~ for home directory in filter rules file
+
+ Changed save_message to fork/setgid in order to save
+ message with user's group id instead of mail group id.
+
+ Change filter command to not look at $MAIL as it may be
+ run from sendmail on some systems and $MAIL is set from the
+ environment of the sender of the mail. Result was delivery
+ of mail to the mailbox of the author of the mail instead of
+ the intended user.
+
+ new locking method - allow both fcntl and flock in Filter and Elm
+
+ Detect when there are too many filter rules and exit gracefully.
+
+ Reimplemented readmsg utility. Obsoleted "readmsg_file" and
+ introduced "temp_state" file and "ELMSTATE" environment parameter.
+ This allows readmsg to understand the current 'sorted' order of the
+ Elm display, when run while Elm is running.
+
+ Change date parsing, now uses Numeric TZ and sorting is now TZ aware.
+
+ Add resize support, only at the top level, and no minimum size enforcement.
+
+ add an option, -i, to use the mentioned file as an inclusion, i.e. the
+ edit session starts out with that file as its text. Allows Elm to be
+ used as a mailer from news readers.
+
+ Change in method of reading/writing files to allow for nulls in the
+ file and better catching of errors on writes such as file system full.
+
+ Add ti/te framing for Sun console
+
+ add change to folder based on alias (where messages to that folder would
+ be stored)
+
+ allow the user to save to the 'most-recently-used-folder'
+
+ Disable stop processing while writing back spool to avoid
+ stop causing a corrupted/long locked spool file
+
+ Changes to allow clearing the weed-out list yet not totally
+ invalidating all the existing elmrc files.
+
+ Add - to allow fastmail to read from stdin
+
+ Make frm's exit status more meaningful, add much new functionality,
+ including the ability to recognize when a message is old, new, or
+ unread, and when mail is really "To" somebody else.
+
+ Change newmail to not keep files open to prevent systems with read
+ locks from appending to the file. Add print_prefix to force printing
+ the prefix if specified and only one folder being monitored.
+
+ And many bug fixes.
+
+ ************************************************************************
Index: elmME+.2.5.alpha0-cvs/2.4/Instruct
*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
--- elmME+.2.5.alpha0-cvs/2.4/Instruct 2004-04-17 12:03:44.000000000 +0300
***************
*** 0 ****
--- 1,128 ----
+ Instructions
+ ------------
+
+ Last Update: $Date: 2004/04/17 09:03:44 $
+
+
+ This file contains instructions on how to create and install
+ the entire ELM mail system. It should be read BEFORE any attempts
+ are made at actually creating and/or installing any of the software
+ contained herein!
+
+ There is actually really one step needed - unpack all the shar
+ files and then;
+
+ $ cd <where-ever you're keeping the Elm sources>
+
+ $ sh Configure
+
+ Answer the questions of that program, then let it create the
+ localized Makefiles and system definition files for you. When it's
+ done you can double check the configuration (or customize it further)
+ by reading the Configuration Guide and then rerunning Configure.
+ There are lots of neat features that are unique to this mailer - it's
+ worth a quick perusal at least!
+
+ Once you're happy with the localized files, you then need to
+ create the documentation (so there's a bit of a catch-22 that you need
+ to format the Configuration guide before you are happy with the
+ localization but can't do that until you're happy with the
+ localization...oh well).
+
+ $
+
+ $ make documentation
+
+ When that's done, or even if it fails (don't worry too much about
+ it), do the following:
+
+ $ make all > MAKELOG 2>&1 &
+ $ tail -f MAKELOG
+
+ (if you're in "csh", substitute: "make all >& MAKELOG &")
+
+ This will take a fair while, so it's recommended that you go and eat
+ lunch or play a game for a while!! (alternatively, spend lots of money
+ on a really FAST machine and blink your eyes a few times...)
+
+ Assuming there are no errors during compilation (we'll have to assume
+ that for the moment) you should now be able to list the directory "bin"
+ and find the following files:
+
+ answer elmalias frm newalias prlong
+ checkalias fastmail listalias newmail readmsg
+ elm filter messages printmail
+
+ next, you can install all the software on your system by;
+
+ $ make install
+
+ Note: On some systems the mailer runs as setgid mail to have the
+ ability to WRITE to the mail directory (for lock files). If this is
+ true, you will have to be root to install Elm (or some other user that
+ can have the makefile set the setgid bit on the required executables).
+ If you have a different scheme at your site, feel free to set it up to
+ use that instead.
+
+ Finally, we're just about done! The final checks can be made
+ by the following commands:
+
+ $ elm -z
+
+ should say "no mail" if nothing's in your incoming mailbox or should
+ start up the Elm program if there is, and
+
+ $ elm -f test/test.mail
+
+ should read in EIGHT messages from various people. While here, try to
+ A)lias, A)lias current message for each of the eight messages to
+ confirm that the reply/address system is working okay. Now Q)uit
+ without having marked anything for deletion...answer the questions
+ accordingly.
+
+ If you get this far you're in wonderful shape! In fact, you're done!
+
+ Congratulations! You've just installed one of the best electronic mail
+ systems available today on your machine (if I say so myself!)
+
+ IF UPGRADING FROM AN EARLIER VERSION OF ELM, even 2.4 beta, it will
+ be necessary for all users alias files, as well as the systems alias
+ file, be upgraded to the new format. Also some error checking of
+ alias files has been added. All users should run the newalias command.
+
+ HANDY HINTS: If you want to create a print of the entire set of
+ sources, including this file, use the command:
+
+ $ make listing
+
+ Also, if you have a number of machines on a network, you can rlogin
+ to the remote machine and then do a remote install (after checking
+ to ensure that the networking copy method in the Makefile under the
+ target "remote-install" is correct) by typing:
+
+ $ make -f <remote Makefile> REMOTE=<remote file system> rmt-install
+
+ (for example, if we had installed the system on machine "machx" and
+ wanted to install it on "machy", with the Makefile in /src/Elm on
+ "machx", we could type from "machy";
+ $ make -f machx:/src/Elm/Makefile REMOTE=machx: rmt-install
+ to have it install the system on machine y!)
+
+ That's it!
+ ----------
+
+ This document and the entire mail system is
+
+ (C) Copyright 1988-1992 by the Usenet Community Trust
+ (C) Copyright 1986,1987 by Dave Taylor
+
+ Elm is now in the public trust. Bug reports, comments, suggestions,
+ etc. should be sent to:
+
+ Elm group's address: e...@DSI.COM
+ dsinc!elm
+
+ Mail address: Syd Weinstein
+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320
Index: elmME+.2.5.alpha0-cvs/2.4/NOTICE
*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
--- elmME+.2.5.alpha0-cvs/2.4/NOTICE 2004-04-17 12:03:44.000000000 +0300
***************
*** 0 ****
--- 1,74 ----
+
+ The Elm(tm) Mail System General Public License
+
+
+ (C) Copyright 1988-1992, USENET Community Trust
+ (C) Copyright 1986,1987, by Dave Taylor
+
+
+ COPYING POLICIES
+
+ Permission is hereby granted for copying and distribution of copies of
+ the Elm source files, and that of any part thereof, subject to the following
+ license conditions:
+
+ 1. You may, without additional permission from the authors, distribute
+ Elm or components of Elm, with or without additions developed by
+ you or by others at no charge. You may also distribute Elm along
+ with any other product for sale, provided that the cost of the
+ bundled package is the same regardless of whether Elm is included,
+ and provided that those interested only in Elm must be notified
+ that it is a product freely available from the Elm Development Group.
+
+ 2. You may, without additional permission from the authors, distribute
+ copies of the Elm Documentation, with or without additions developed by
+ you or by others at no charge or at a charge that covers the cost of
+ reproducing the copies, provided that the Elm copyright notice is
+ retained.
+
+ 3. Furthermore, if you distribute Elm software or parts of Elm, with
+ or without additions developed by you or others, then you must
+ either make available the source to all portions of the Elm system
+ (exclusive of any additions made by you or by others) upon request,
+ or instead you may notify anyone requesting source that it is
+ freely available from the Elm Development Group.
+
+ 4. In addition, you may not omit any of the copyright notices
+ on either the source files, the executable file, or the
+ documentation, and
+
+ 5. Also, you may not omit transmission of this License agreement with
+ whatever portions of Elm that are distributed.
+
+ 6. Lastly, any users of this software must be notified that it is
+ without warrantee or guarantee of any nature, express or implied,
+ nor is there any fitness for use represented.
+
+ Software is a malleable thing - especially UNIX - and the authors can in no
+ way guarantee that using this program will not cause grievous damage to your
+ system. Of course this isn't anticipated, but if it does happen, the authors
+ cannot be held liable for any damages either directly or indirectly caused
+ by this event.
+
+ Modification of the system is encouraged, providing that the portions of
+ the system that are from the original still carry the appropriate copyright
+ notices and that the changed sections are clearly delimited as such. The
+ authors requests copies of any changes made to ensure that the various versions
+ stay reasonably in sync with each other. Please send all revisions to
+ e...@DSI.COM.
+
+ NOTE that it is not permitted to copy, sublicense, distribute or transfer any
+ of the Elm software except as expressly indicated herein. Any attempts to
+ do otherwise will be considered a violation of this license and your rights
+ to the Elm software will be voided.
+
+
+ Comments on the system and/or this licensing agreement is encouraged. Send
+ electronic mail to "tay...@intuitive.com". This license was written with
+ help from Scott McGregor. Thanks Scott!
+
+ ----
+ Elm is a trademark of Dave Taylor.
+
+ NOTE: Elm is now in the public trust. Comments, suggestions, bug reports and the
+ like should be sent to Syd Weinstein; e...@DSI.COM (dsinc!elm)
Index: elmME+.2.5.alpha0-cvs/2.4/Overview
*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
--- elmME+.2.5.alpha0-cvs/2.4/Overview 2004-04-17 12:03:44.000000000 +0300
***************
*** 0 ****
--- 1,124 ----
+ An Overview of the Elm Mail System
+ ----------------------------------
+
+ Introduction
+
+ This file discusses the functionality of the Elm mail system
+ and explains some of the motivation behind the various features.
+
+ 1. What is Elm?
+
+ Currently on UNIX, there seems to be a preponderance of line-oriented
+ software. This is most unfortunate as most of the software on UNIX tends to
+ be pretty darn hard to use! I believe that there is more than a slight
+ correlation between the two, and, since I was myself having problems using
+ "mailx" with high-volume mail, I created a new mail system.
+
+ In the lingo of the mail guru, Elm is a "User Agent" system,
+ it's designed to run with "sendmail" or "/bin/rmail" or any
+ other UNIX Mail Transport Agent (according to what's on your system)
+ and is a full replacement of programs like "/bin/mail" and "mailx".
+ The system is more than just a single program, however, and includes
+ programs like "frm" to list a 'table of contents' of your mail, and
+ "printmail" to quickly paginate mail files (to allow 'clean'
+ printouts).
+
+ 2. What's New about Elm?
+
+ The most significant difference between Elm and earlier mail
+ systems is that Elm is screen-oriented. Upon further use, however,
+ users will find that Elm is also quite a bit easier to use, and quite a
+ bit more "intelligent" about sending mail and so on. For example, say
+ you're on "usenet" and receive a message from someone on the Internet.
+ The sender also "cc'd" another person on Internet. With Elm you can
+ simply G)roup reply and it will build the correct return addresses.
+
+ There are lots of subtleties like that in the program, most of
+ which you'll probably find when you need them.
+
+ 3. What systems does it work on?
+
+ The Elm development group uses almost every UNIX system out
+ there between all of its volunteers. Elm runs on USL System V, BSD,
+ SunOS, Apollo, UTS, Pyramid and Xenix and should run on almost any UNIX
+ systems without any modifications (if there turn out to be
+ modifications, please notify the Elm Development Group as soon as
+ possible).
+
+ 4. Does it obey existing mail standards?
+
+ Yes! That's another of the basic reasons the program was
+ originally written! To ensure that the date field, the "From:" line
+ and so on were all added in the correct format. The program is 100%
+ correct according to the RFC-822 electronic mail header protocol
+ guide.
+
+ 5. What were the main motivating factors for Dave to write Elm?
+
+ The first two I've already mentioned, but here's a (somewhat
+ partial) list;
+
+ - To have a mail system that exploited the CRT instead of
+ assuming I'm on a teletype.
+
+ - To have a mailer that was 100% correct when dealing with
+ network mail (i.e. RFC-822).
+
+ - To create a system that needed no documentation for the
+ casual user, but was still powerful enough and sophisticated
+ enough for a mail expert.
+
+ - To write a "significant" piece of software as a learning
+ experience (I admit it!)
+
+ - To find out how reasonable it is to try to modify a program
+ to meet the expectations of the users, rather than vice-versa.
+
+ - To basically correct some of the dumb things that the current
+ mailers do, like letting you send mail to addresses that it
+ could trivially figure out are going to result in 'dead.letter'
+
+ - To tie in intimately with the pathalias program output, and
+ allow users to specify machine!user or user@machine and have
+ the COMPUTER do the work of figuring out addresses...
+ (Note: As of 2.4, this has been removed from Elm, as routing
+ mail transports are now readily available for all UNIX systems).
+
+ 6. Is it reliable?
+
+ The mailer, in various incarnations, has logged literally
+ thousands upon thousands of hours without any problems that aren't
+ now corrected. As new problems arise they're dealt with in as
+ rapid a manner as possible...
+
+ 7. Disclaimers
+
+ The author of this program will deny all liability for any
+ damages, either real or imagined, due to the execution of this program
+ or anything related to either the software or the system. Furthermore,
+ the entire system and all source within, including the presentation
+ screens and commands, are legally copyrighted by the author, and while
+ they can be used, and abused, for public domain systems, it will be in
+ violation of the law if used in systems or programs sold for profit.
+
+ By installing the mailer or even extracting it from the network,
+ you are agreeing to the above disclaimer.
+
+ 8. Finally
+
+ I think it's a good program, and I can cite at least 75 people
+ who would (begrudgingly, I'm sure) agree. You should most certainly
+ install the program and try it!!
+
+
+ -- Dave Taylor
+ tay...@intuitive.com
+ -- Syd Weinstein, Coordinator
+ Elm Development Group
+ e...@dsi.com
+
+ Original: March 13th, 1986
+ Modified: October 3th, 1992
+ Syd Weinstein, Coordinator
+ Elm Development Group
+ e...@dsi.com
Index: elmME+.2.5.alpha0-cvs/2.4/Patchlist
*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
--- elmME+.2.5.alpha0-cvs/2.4/Patchlist 2004-04-17 12:03:44.000000000 +0300
***************
*** 0 ****
--- 1,1612 ----
+
+ This Patchset is for the 2.4 version.
+
+ Look file ChangeLog.ME for changes of ME version.
+ Look file README.ME+ for changes of the 2.4ME+ version.
+
+ =========================================================
+ Patch Set - Patches 24: Tue Sep 20 14:01:13 EDT 1994
+ Elm 2.4PL23 -> Elm 2.4PL24
+
+ Remove autoreply/arepdaem, its a security hole
+ From: Syd
+
+ Fix where buffer was not getting null terminated during its
+ construction, so the strcat failed (due to garbage data existing in the
+ array at malloc() time).
+ From: l...@yallara.cs.rmit.oz.au (Luke Mewburn)
+
+ Fix ANSI prototype stripping macro
+ From: "Tom Moore" <tmo...@fievel.DaytonOH.NCR.COM>
+
+ fixed ReadCh() to recover from EINTR and EAGAIN instead
+ of just returning an unexpected EOF.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Replaced the get_tz_mins() routine in lib/get_tz.c with a portable
+ version that requires no configuration. Rewrote the test case in
+ lib/get_tz.c, and also wrote in support to simplify configuration
+ tests. Dropped TZMINS_USE_XXXX configuration parameter. Simplified
+ timezone determination in Configure. The new get_tz_mins() introduces
+ two side effects. First it steps on the static data returned by
+ localtime(). Second, it uses a routine in lib/date_util.c, which
+ requires debug initializations. Rewrote get_arpa_date() to work around
+ the first issue. Rather than doing the same for lib/strftime.c, just
+ removed the timezone stuff with a conditional compile. Elm does not
+ use it. Added debugging initializations to util/fastmail.c.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ I made the following changes to elm 2.4pl23 module pmalloc.c after testing on
+ a DEC Alpha running OSF1 v1.3. The difficulty is that the Alpha hardware
+ requires certain alignment for some operations which was not supplied by
+ pmalloc (8 byte for addresses instead of 4 byte). I made a simple minded
+ change to pmalloc.c to force alignment of the allocated data block to be
+ adequate on DEC Alpha OSF1.
+ From: j...@lime.rsmas.miami.edu (Jim Brown)
+
+ detect whether atol() is a macro
+ From: Mitch DSouza <m.ds...@mrc-applied-psychology.cambridge.ac.uk>
+
+ Recognize the "#$HDR" magic cookie as the header to place in the
+ user's elmrc file rather than hardwiring a minimally helpful
+ string into the binary.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Fix Elm looping if an EOF is received.
+ From: Gregory Neil Shapiro <gsha...@WPI.EDU>
+
+ There is a bug in the alias-system of elm-2.4.23 that did not appear in
+ elm-2.4.21. When searching for a string in the alias-table with the '//'
+ command, elm sometimes gets a segmentation fault. With help of a debugger,
+ I found that the function shift_lower gets a NULL argument. A fix is
+ appended, but maybe the problem lies elsewhere.
+ From: Sjaak Schilperoort <J.W.Schi...@research.ptt.nl>
+
+ The latest Linux shared library (4.5.8) "catches" a double fclose()
+ by generating a SIGSEGV. :-/
+ From: fin!ch...@dg-rtp.dg.com (Chip Salzenberg)
+
+ Fix a line of debug output that is too long
+ From: "C.R. Ritson" <C.R.R...@newcastle.ac.uk>
+
+ Here are some more of fixes to correctly call fflush() and unlock() in sequence.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ I had to put in some changes to builtin+ to allow it to display
+ 8-bit letters as they should when the message has been sent
+ through a real 8-bit channel like ESMTP with 8bit MIME Content-
+ Transfer-Encoding.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Tune the Ultrix fix for ispell
+ From: Bill Gianopoulos <w...@sccux1.msd.ray.com>
+
+ Solaris 2.3 can return EACCES or EEXIST for lockfile already existing.
+ From: xc...@uxa.ecn.bgu.edu (Chad Adams)
+
+ Below are the changes required to compile/link elm 2.4 pl23 under
+ QNX 4.2 with the Watcom 9.5 compiler (very picky).
+ From: "Brian Campbell" <brianc@quantum>
+
+ In utils/from.c there was a conditionalized declaration of
+ getpwuid() which was triggered by the environment being non-
+ POSIX instead of non-STDC.
+ From: Jukka Antero Ukkonen <ukk...@csc.fi>
+
+ There was a typo in src/curses.c. An include read out like
+ "# include <vararg.h>" though the file name should have been
+ varargs.h.
+ From: Jukka Antero Ukkonen <ukk...@csc.fi>
+
+ Just a minor fix to an impossible character comparison.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ I found a few months old patch I have not sent you before (I guess).
+ It avoids unknowingly confusing some too rigidly and simple mindedly
+ coded mailers with weird settings like
+
+ charset=us-ascii and textencoding=8bit
+
+ This patch will force 7bit encoding with charset=us-ascii.
+ E.g. older versions of pine will dump core on 8bit & us-ascii.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ I had to add a region of conditional compilation around "defs.h"
+ to make Configure work correctly with the TZNAME_USE_xxxx stuff.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ The "copy_message" function in src/fileio.c incorrectly computes the
+ size of the message. The "bytes_seen" variable currently counts all
+ bytes in the message ***including the message header*** when it should
+ only be counting the bytes in the actual body of the message.
+ From: Thomas Dwyer III <tom...@mtu.edu>
+
+ Extra } in edit_mailbox removed.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Add an fflush to detect over quota on file saves.
+ From: Larry Schwimmer <ros...@cyclone.Stanford.EDU>
+
+ Block sigwinch when in the external pager.
+ From: j...@yog-sothoth.dcrt.nih.gov (James W. Adams)
+
+ Work around null from names by looking to see whether the second or
+ third field is a valid month and using that to determine if there
+ is an address.
+ From: al...@samwise.dccs.upenn.edu (Alex Garthwaite)
+
+ Fix up Solaris and SVR4 timeout signal handling
+ From: Syd
+
+ Add extern declaration of strerror to avoid compiler warning.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Moved #defines for SETJMP & LONGJMP from src/editmsg.c to hdrs/defs.h and
+ used them instead of (set|long)jmp directly. This makes the usage consistent
+ and Solaris 2.3 behaves correctly w.r.t stop/continue.
+ From: Jan....@sa.erisoft.se (Jan Djarv)


+
+
+
+
+

+
+ =========================================================
+ Patch Set - Patches 23a through 23d: Sun Sep 19 19:48:31 EDT 1993
+ Elm 2.4PL22 -> Elm 2.4PL23
+
+ Write options to elmrc even if their values are empty strings.
+ Rationalize code that reads and writes weedouts and alternates.
+ From: chip%f...@myrddin.sybus.com
+
+ Correct problem in fetch_alias() with alias record fixup that caused
+ core dump on machines with pointers larger than int. This problem
+ was reported on comp.mail.elm by Richard Eckman and Jim Brown. Simplify
+ get_one_alias() by having it use fetch_alias().
+
+ break_down_tolist() tried to blindly split address lists at "," which
+ caused bogus results with addreses that had a comma inside a comment
+ or quoted text, such as "user@domain (Last, First)". This patch steps
+ through the address in quanta of RFC-822 tokens when searching for a
+ delimiting comma. It also adds "rfc822_toklen()" to the library to
+ get that length.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ This fixes a bug in the MIME code. Include_Part() uses expand_env()
+ to expand the include file name, but since expand_env() is destructive
+ [it uses strtok()] the file name gets corrupted, and the "Content-Name"
+ header can contain a bogus value. The easy fix would be a one-line
+ hack to Include_Part to use a temporary buffer. This patch does not
+ implement the easy fix. *Every* place expand_env() is used, its side
+ effects cause problems. I think the right fix is to make expand_env()
+ non-destructive (i.e. have it duplicate the input to a temporary buffer
+ and work from there). The attached patch modifies expand_env() in
+ that manner, and eliminates all of the `copy to a temporary buffer'
+ calls that precede it throughout elm.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ I have been repetedly crashing elm 2.4.22 until I discovered that a
+ test for failing to open the system elmrc file is mising. This could
+ usefully be added in read_rc.c. Version info and patch follows:
+ From: "C.R. Ritson" <C.R.R...@newcastle.ac.uk>
+
+ Greatly simplified "lib/striparens.c" to use new rfc822_toklen() routine.
+ This cut more than 50% out of the object size. Also added _TEST case.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ When resyncing aliases from elm, and there was aliases to delete,
+ the alias.pag file could be corrupted since file_offset wasn't set to zero.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ A long-standing bug of handling replies to VMS systems.
+ Original "From: " -line is of format:
+ From: "NAME \"Real Name\"" <USERNAME@vms-system>
+ (PMDF mailer)
+ Anyway, parse_arpa_who() strips quotes too cleanly
+ resulting data:
+ NAME \"Real Name\
+ which, when put into parenthesis, becomes:
+ (NAME \"Real Name\)
+ which in its turn lacks closing `)'
+ Patch of lib/parsarpwho.c fixes that.
+ strtokq() started one position too late to search for next double-quote (") char.
+ Another one-off (chops off trailing comment character, quote or not..) in src/reply.c
+ From: Matti Aarnio <m...@utu.fi>
+
+ Three changes to expand_env() in src/read_rc.c: make it non-destructive,
+ have it return an error code instead of bailing out, and add a buffer
+ size argument to avoid overwritting the destination. The first is to
+ avoid all of the gymnastics Elm needed to go through (and occasionally
+ forgot to go through) to protect the value handed to expand_env().
+ The second is because expand_env() was originally written to support
+ "elmrc" and bailing out was a reasonable thing to do there -- but not
+ in the other places where it has since been used. The third is just
+ a matter of practicing safe source code.
+
+ This patch changes all invocations to expand_env() to eliminate making
+ temporary copies (now that the routine is non-destructive) and to pass
+ in a destination length. Since expand_env() no longer bails out on
+ error, a do_expand_env() routine was added to src/read_rc.c handle
+ this. Moreover, the error message now gives some indication of what
+ the problem is rather than just saying "can't expand".
+
+ Gratitous change to src/editmsg.c renaming filename variables to
+ clarify the purpose.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ [ Patch description ]
+ Update the example elmrc and move a couple out of order variable
+ descriptions.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Handle reply-to in batch mode.
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ In fastmail, if environment variable $REPLYTO is set, use it as
+ default Reply-To. Also, eliminate unnecessary strlen() calls.
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ Support aliases both on 64 bit and 32 bit machines at the same time.
+ From: Dan Mosedale <mose...@genome.stanford.edu>
+
+ Spaces in weedout strings wasn't preserved ("From " became "From").
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Added text about how the weedout list works w.r.t From: and From_
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ default_weedlist() can't use pmalloc, because weedout() calls free when
+ it encounters *clear-weed-list*.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ The NLS messages for elm -h output didn't have the -i or -t options.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ The message CannotInitErrorExpanding was called CantExpandEnvVar in s_elm.m.
+ Change it for consistency.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Since it was not intended that varargs.h and stdarg.h were
+ included simultaneously there may be colliding definitions
+ on some systems if you use a standard C compiler. If both
+ of these headers are included the compiler has no way to
+ know which definitions to use.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ "*clear-weed-list*" in elmrc was wiped out when one saved the options in elm.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ When STDC is used on Convex the feof() function is defined as
+ a true library routine in the header files and moreover the
+ library routine also leaks royally. It returns always 1!!
+ So we have to use a macro. Convex naturally does not provide
+ you with one though if you are using a STDC compiler. So we
+ have to include one.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Removed bogus string lockfile.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ The last character of a form field gets zapped if more characters than
+ the field expects are entered.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Patch for Elm 2.4 PL22 to correct handling of SIGWINCH signals on
+ DecStations with Ultrix 4.2.
+ The problem was that elm running in an xterm exits silently when the
+ window is resize. This was caused by incorrect signal handling for BSD.
+ From: vo...@isa.de
+
+ Implement new timezone handling. New file lib/get_tz.c with new timezone
+ routines. Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
+ definitions. Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
+ definitions. Updated Configure. Modified lib/getarpdate.c and
+ lib/strftime.c to use new timezone routines.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Add proper casts to free() calls to suppress warnings.
+ Properly cast return types.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Added -d option to elmalias.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Elm tries to replace the system toupper() and tolower() on current
+ BSD systems, which is unnecessary. Even worse, the replacements
+ collide during linking with routines in isctype.o. This patch adds
+ a Configure test to determine whether replacements are really needed
+ (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ there. Inclusion of <ctype.h> was removed from *all* the individual
+ files, and the toupper() and tolower() routines in lib/opt_utils.c
+ were dropped.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Fix signal type for 386bsd
+ From: Scott Mace <sm...@freefall.cdrom.com>
+
+ When an environment variable was given as the tmpdir definition the src
+ and dest overlapped in expand_env. This made elm produce a garbage
+ expansion because expand_env cannot cope with overlapping src and
+ dest. I added a new variable raw_temp_dir to keep src and dest not to
+ overlap.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ I compiled elm 2.4.22 with Purify 2 and fixed some memory leaks and
+ some reads of unitialized memory.
+ From: vo...@isa.de
+
+ A change to answer:s mail command to be like those of elm and filter.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Elm was failing to write an empty "alternatives" list to elmrc.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Usage message for elmalias changed.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Correct typo and use hard spaces within quotes in *clear-weed-list* note.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ fix where checkalias doesn't fully expand multi-database aliases
+ From: Steve Wolf <wo...@atl.hp.com>
+
+ The macro ctrl(c) did not work correctly for a DEL character
+ neither did it make the backward mapping from a control char
+ to the letter that is normally used with an up-arrow prefix
+ to represent the control character.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Don't declare _exit() if <unistd.h> already did it.
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ The ANSI version of varargs is "stdarg", not "stdargs".
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ Added some documentation for textencoding variable.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ more purify found errors
+ From: vo...@isa.de
+
+ Add missing parens
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Fix problem where deleting to previous line caused duplication due to the
+ file being opened for append (in append mode, all writes are to the end of
+ file regardless of the file pointer).
+ From: p...@lunch.asd.sgi.com (Paul Close)
+
+ have Writechar() backspace over the left edge of the screen to the end
+ of the previous line if the current line is not the first line on the
+ screen.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Call to expand_env for pager should be call to do_expand_env.
+ temp_dir not initialized.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Try splitting chown into two calls to set group on systems where
+ chown of owner is restricted.
+ From: Syd
+
+ strtokq was called with the wrong number of parameters.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Add ability for elmalias to determine HOME if missing from the environment.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Changed a few buffers from LONG_STRING (512) to VERY_LONG_STRING
+ to avoid long header lines overflowing the allocated space. At
+ least 1024 bytes should be allowed in any header line/field.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Here's some more patch stuff for undersize buffers for header lines.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Fix a code portability problem with Convex.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ I found a few places more where the code was missing a call
+ to fflush() before it called unlock() and fclose()/exit()
+ right after unlocking the mail drop.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Erroneous Content-Length:s that ended up beyond the end of the folder
+ wasn't checked for, so the rest of the folder became one big message.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ expand() didn't read the global rc file if the user elmrc didn't exist or
+ didn't have an entry for maildir.
+ From: Jan....@sa.erisoft.se (Jan Djarv)
+
+ Conform textencoding addition to style standard.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Although it doesnt solve the limit/resync problem of new
+ messages, allow them to be accessed anyway.
+ From: aus...@solan.unit.no
+
+
+
+ =========================================================
+ Patch Set - Patches 22 through 22: Sun Jun 6 14:09:37 EDT 1993
+ Elm 2.4PL21 -> Elm 2.4PL22
+
+
+ If I have two aliases of the same name the duplicate is caught *but
+ still written to the data file*!!!
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ test firstname == lastname and if true zero out firstname before
+ writing to the aliases.text file. Let me check out the source. Now if
+ you try to change a SYSTEM alias it lets you know and asks to verify
+ that you are going to superceed that alias.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ fix @aliasname sort problem
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Move first name to lastname if lastname blank.
+ this is the only real way for now. I think that the dbz stuff, sorting,
+ and other things all hope to see a lastname.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ In some cases, with certain editors, the user can create an
+ aliases.text file in which the last line is terminated with an EOF but
+ doesn't have a '\n'. Currently, elm with complain that the line is
+ too long.
+ From: "William F. Pemberton" <wf...@holmes.acc.virginia.edu>
+
+ The test in delete did not take into account for mixed case.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Fix builtin editor so you can run "readmsg" with "~<".
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Have real_from() ignore bogus timezones in From_ lines
+ rather than bailing out with an error.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ According to the SVID (version 3) the function crypt is
+
+ char * crypt( const char *, const char * )
+
+ However, it is declared as
+
+ unsigned char crypt();
+
+ on line 179 of src/encode.c. The "unsigned" keyword causes the compile
+ to fail on SVID3 compliant systems. Upon inspection, it appeared that
+ the declaration was not even required if CRYPT was not defined, so
+ changed it to be conditionally compiled.
+ From: Larry Philps <lar...@sco.COM>
+
+ len_next_part() was botching quote-delimited strings.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ guide fixes:
+ Update for quotes
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Added safe_malloc(), safe_realloc(), and safe_strdup(). They
+ will be used in the new elmalias utility.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Initialize safe_malloc() failure trap just to play it safe. Although
+ Elm doesn't currently use these routines, do this just in case somebody
+ someday adds a call to a library routine that does use them.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Added fetch_alias() and next_addr_in_list() routines for use in
+ new elmalias utility.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Modified to use new safe_malloc() routines.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Added new utilities "elmalias" and "prlong". Modified "checkalias"
+ and "listalias" to use them.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Added elmalias.1 man page. Updated Users.guide to mention elmalias.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Added references to elmalias(1L).
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Fix year handling bug in date(1) time formats.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ I have now added a parameter which controls whether want_to clears the
+ line and centers the question or behaves like it did before. I also
+ added a 0 at the end of the parameter list to all the other calls to
+ want_to where a centered question on a clean line is not desirable.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ The builtin editor couldn't back up to a line that had a character
+ at the wrapcolumn position.
+ Added tab handling to the builtin editor.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ None of i, q, x, >, and ^L are recognized by the single character help
+ on the options screen. <return> causes the options screen to scroll
+ because all non-printing characters are echoed by the error message.
+ Options and alias help files didn't list all commands.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ If a To: or Cc: line is split in a comment, that is between ( and ),
+ get_and_expand_everyone won't parse that correctly.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Check for EINTR if getchar() returns EOF. Happens after a resume from an
+ interactive stop.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ The setting of relop to the default (EQ) was in the wrong place,
+ causing the wrong relation to be inserted in the rule.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Removed a malloc of a struct condition_rec that is never used.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ The USR2 signal lost messages on some OS:es and did an unnecessary resync
+ on others.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ The primary editor didn't change at once when you entered a new value in
+ the option screen.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ The wrong NLS message was used in the option screen for the "A(l)ias Sorting".
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ The "window is too small..." message gets printed on the wrong screen. The
+ message also needs \r\n at the end.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Added check if headers_per_page is zero in get_page().
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ want_to() wrote "No." when user pressed return even if the default answer
+ wasn't == *def_ans_no.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ The onoff macro assumes a boolean option only has values 1 or 0.
+ This is not true for forms option (may be 2 == MAYBE).
+
+ This is known bug EB51 BTW. I'm looking at the list now and there are some
+ bugs that I think are simple, and I'll try to fix some of them.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Fix to don't use address from reply-to field if it is empty.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ This can not happen according to RFC822. It requires at least one address if the
+ reply-to is present, so this bug (EB48) isn't really a bug. But one can
+ always try to be nice :-).
+
+ nameof() didn't check that the character after the common string was /, thus
+ (if Mail is the folderdir) Maildir/x was made to be =dir/x.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Added function enforce_newline to enforce newline (what else :-) at
+ end of message.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ These patches makes 'T' (since it was free) do a Tag and Move command in the
+ index and alias page, and in the builtin pager.
+ In the alias help in src/alias.c, there is a tolower done on the character
+ one wants help for. This is clearly wrong.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ On AIX, __STDC__ is not defined but it does use unistd.h, etc. In
+ hdrs/def.h, ANS_C already gets defined if __STDC__ or _AIX. But this
+ variable then needs to be used in src/init.c and hdrs/filter.h in place
+ of the current test for __STDC__.
+ From: rst...@elegant.com (Robert Story)
+
+ the posix macros to interpret the result of the stat-call.
+ From: vo...@isa.de (Gerald Vogt)
+
+ In GetPrompt(), when timeout = 0 make sure we check the return of
+ ReadCh() for EINTR on non-POSIX (BSDish) systems.
+ From: t...@osf.org
+
+ I noticed when I was sorting a mailbox by subject, that 2 messages with
+ the following subjects
+
+ Subject: Re: Reading news
+ Subject: Reading news
+
+ they were sorted as shown above even though the "Re:" message was
+ "Sent" after the original. It turns out that the routine skip_re has a
+ bug. If the actual subject (the part after the "Re: ") starts with the
+ characters "re" skip_re will erroneously not strip the "Re:" part at
+ all. The following patch fixes that behaviour.
+ From: Larry Philps <lar...@sco.COM>
+
+ Give up and add an Ultrix specific patch. There is a bug in Ispell under
+ ultrix. The problem is that when ispell returns, the terminal is no
+ longer in raw mode. (Ispell isn't restoring the terminal parameters)
+ From: Scott Ames <sc...@cwis.unomaha.edu>
+
+ For many embedded X.400 addresses in the format
+ "/.../.../.../.../"@admd.country NLEN was simply too short and part of
+ the address never made it to the reply address. In my opinion 512 bytes
+ should be enough. So make it LONG_STRING.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ I found a small screen corruption problem with elm. If you select 'c' for
+ change mailbox and then back out by just typing <Return> at the prompt for the
+ new mailbox, the prompt 'Command: ' seems to be reprinted on the wrong line
+ leaving the previous prompt and the 'Change Mailbox' string in place.
+
+ Further investiagtion tracked the problem to the softkey programming. When a
+ newline (LF) character is sent to the terminal in the sofkey's "send" string,
+ the terminal still performs a linefeed just as if the linefeed were sent at any
+ other time. The particlar set of softkeys for change mode has four such
+ newlines and this is enought to cause the screen to scroll up one line. This
+ in turn causes the prompt to appear on the wrong line.
+
+ I have fixed this by replacing the newlines with carriage returns instead. I
+ checked and this still performs the desired action without actually scrolling
+ the screen.
+ From: Steve Fosdick <ste...@aom.bt.co.uk>
+
+ Lets try it again. In the file newmbox.c you check whether a mail is
+ metamail. You also check whether a mail has a sun-attachment but elm doesn't
+ recognize whether it has other attachment from for example the NeXT.
+ From: r...@IS.TWI.TUDelft.NL (Rob Kooper)
+
+ For convex, #if-defed memcpy, memset and sleep.
+ From: r...@oso.chalmers.se (Rafal Maszkowski)
+
+ SunOS 4.1.3 uses the BSD convention for signal handling in system
+ calls like read. The system call resumes when the signal handler
+ returns unless the SA_INTERRUPT flag is set. Thus to make elm resize
+ it's window after a SIGWINCH this flag must be set.
+ From: vo...@isa.de (Gerald Vogt)
+
+ readmsg treated a line with From_ preceeded by whitespace as a valid
+ message delimiter.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ frm treated a line with From_ preceeded by whitespace as a valid
+ message delimiter.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ newmail treated a line with From_ preceeded by whitespace as a valid
+ message delimiter.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ The message OptionExitHelp in s_elm.m is called OptionReturnHelp in header and
+ source files. Change it to keep consistency.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ There was a mismatch between OptionPrintHelp and the message in src/options.c
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ It's very non-portable, and fairly dangerous, to ass_u_me that you
+ know what's inside a FILE. So don't #define clearerr().
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ Use strerror() with ANSI compilers.
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ I'm using Elm 2.4.21 under Linux. Linux has no Bourne shell. Each
+ user installs her favorite shell as /bin/sh. I use Bash 1.12.
+
+ Elm invokes the mail transport (MTA) like so:
+
+ ( ( MTA destination; rm -f tempfile ) & ) < tempfile &
+
+ This form of command doesn't work with my Bash, in which any command
+ which is backgrounded ("&") gets its stdin attached to /dev/null.
+
+ The below patch arranges for Elm to call the MTA thusly:
+
+ ( MTA destination <tempfile; rm -f tempfile ) &
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ Use pointer arithmetic for aliases on crays
+ From: Quentin Van Abbe <rxx...@argolis.osf.rmit.OZ.AU>
+
+ NLS message ElmOptionBorderMenu should be ElmOptionBorderHelp in one place.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Try and get getarpdate to work on AIX
+ From: "William F. Pemberton" <wf...@holmes.acc.virginia.edu>
+
+ If there are local user names (account names) in the alias, they don't
+ get fully expanded with a GCOS field like they do when you type an
+ account name on the To line.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Jan's removal of tolower in alias.c breaks help for 'I'. This fixes
+ that and makes the help messages for characters that have printable
+ synonyms on the alias and options screens consistent with the help files.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Fix problem where "<space>From" was recognized as a valid "From_" line.
+ From: decwrl!decvax!gatech!WLK.COM!chip (Chip Rosenthal)
+
+ created a new elmrc variable named "readmsginc". This specifies an
+ increment by which the message count is updated. If this variable is
+ set to, say, 25, then the message count will only be updated every 25
+ messages, displaying 0, 25, 50, 75, and so forth. The default value
+ of 1 will cause Elm to behave exactly as it currently does in PL21.
+ From: Eric Peterson <epet...@encore.com>
+
+ On the DEC Alpha, OSF/1 the following change made things happy.
+ From: da...@opus.csd.uwm.edu (Dave Rasmussen)
+
+ Prevent overwriting appended message.
+ From: Jason Molenda <mol...@sequent.com>
+
+ Add sleepmsg to elmrc to control sleep timing for transient messages
+ From: Syd
+
+ When compiled on a POSIX host PL22 failed checking whether the file is
+ readable and a regular file or not. There was one `!' missing in the
+ `if (S_ISREG(mode))' test which should read `if (! S_ISREG(mode))'.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Fix wrong message being displayed and then overwritten
+ for long aliases.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ The recent feature addition for the "readmsginc" variable did not modify
+ the output statement that is used when MMDF is defined. The following
+ patch makes the variable work on MMDF systems.
+ From: Larry Philps <lar...@sco.COM>
+
+ A MIME body-part must end with a newline even when there was no newline
+ at the end of the actual body or the body is null. Otherwise the next
+ mime boundary may not be recognized. The same goes with the closing
+ boundary too.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Moved the new numeric variables to the Numeric Variables section and
+ applied the quoting/highlight policy to them.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ When frm checked for file access on a POSIX system there
+ was a test `&& S_ISREG(mode)' instead of `&& ! S_ISREG(mode)'
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ A couple of calls to want_to() had typos. Here is the patch.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ document new tidy feature
+ From: da...@devteq.co.uk (Dave Thomas)
+
+ This is a trivial patch to 'from.c' to tidy up the output is
+ the cases where the 'from' part is longer that 20 characters.
+ It adds the new '-t' (for tidy) option:
+ From: da...@devteq.co.uk (Dave Thomas)
+
+ fix elmalias bug
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Fix bug where text following "<" within double-quote delimited comment
+ is taken as an address.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ fix want-to patch collision
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ It looks like there was some earlier patch that re-introduced
+ some lock problems from the past time of 2.4beta.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ While looking into the feasibility of adding `limit sender' as requested
+ on Usenet, I noticed that the limit code was replicated for each of
+ the supported conditions. The following patch simplifies limit_selection()
+ by sharing the common code between all conditions.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ In the Makefile listalias was given only a+x permission
+ though it should have been a+rx.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Total rewrite of verify_transmission(). The existing code was a monsterous
+ mess and rife with bugs (couldn't forget zero-length messages in send-only
+ mode, prompts were being setup wrong, perms on Canceled.mail not done right,
+ etc. etc. etc.) Previously, the work had been split among two places,
+ the main code in mail() and the menu in verify_transmission(), and Elm kept
+ bouncing back and forth between the two. Now, all work is performed in
+ verify_transmission() and it simply returns a send-it/forget-it status.
+ Modified "Canceled.mail" handling so that the files it creates are in
+ an mbox format (i.e. now includes headers as well as message body).
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ With this patch build_address() should treat local mailing
+ lists and other aliases known by the transport agent as valid
+ addresses.
+ I also conditionalized printing the "Expands to: " message
+ in check_only mode to be done only when there is an expanded
+ address to print. Build_address will inform anyway about an
+ alias that does not exist.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Move the actual file saving code out of "save_copy()" into a seperate
+ routine called "append_copy_to_file()" to make it globally available.
+ In particular the "Canceled.mail" handling is going to be rewritten
+ to use it.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Dave Thomas forgot to update the NLS message file when he added the tidy
+ option to frm. While I was at it, I did a little cleanup to keep things
+ alphabetized.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ check for missing replyfile
+ From: r...@lorien.gatech.edu (Roy Mongiovi)
+
+ Elm either failed to expand a group alias or crashed in strlen
+ (called from do_expand_group()).
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Cosmetic addition to previous verify_transmission() changes. The
+ merged code highlighted the fact that i)spell displayed a message
+ and then immediately cleared the screen (erasing that message) before
+ invoking ispell. This patch drops the clear screen.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Make it use the message catalog already defined
+ From: Super Y.S.T. <tab...@matsumoto.dcl.co.jp>


+
+
+
+
+

+
+ =========================================================
+ Patch Set - Patches 21 through 21: Mon Feb 8 13:41:36 EST 1993
+ Elm 2.4PL20 -> Elm 2.4PL21
+
+ Do not assume that "char c" can represent EOF.
+ From: ch...@tct.com (Chip Salzenberg)
+
+ exitprog.c makes a reference to a null character pointer, savecopy.c
+ tries to reference an uninitialized variable, and the previous patch to
+ src/lock.c to get rid of an uninitialized variable compiler message
+ needed to be put in filter/lock.c as well.
+ From: w...@grouper.mkt.csd.harris.com (W. David Higgins)
+
+ Just a small bugfix for the '#' (Debug Message) screen. The columns of the
+ various flags don't all line up properly:
+ From: Gary Bartlett <ga...@abekrd.co.uk>
+
+ Significant changes to provide consistent Date and From_ header
+ cracking. Overhauled date utilities and moved into library. Moved
+ real_from() into library. Modified frm, newmail, and readmsg utilities
+ to use library version of real_from(). Moved get_word() from Elm
+ source into library. Added new library routines atonum() and strfcpy().
+ Fixed trailing backslash bug in len_next().
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ add c)hange alias command to alias helpfile
+ if a deleted alias is changed, undelete it. Also added the 'N'
+ flag to changed aliases to help remind the user. Documented it.
+ Note: if they mark the alias for deletion AFTER making the change it
+ WILL be deleted. (and marked accordingly)
+ modified alias mode title string to indicate when a resync was
+ needed.
+ allow editing alias file when none exist.
+ Now aliases are check for illegal characters (and WS) and
+ addresses are check for illegal WS when they are being entered. If
+ anything illegal is found and message is printed and they keep entering
+ the item until they get it right.
+ I fixed a couple of places where int should be long to match
+ the declared type of alias_rec.length
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ fix which file name is used on confirm messages
+ From: vo...@isa.de (Gerald Vogt)
+
+ There is a mismatch between the number of args and the format string in
+ src/pattern.c.
+ In nls/C/C/C/s_filter.m there is a , after OutOfMemory.
+ This is my fault, and although it doesn't seem to affect things, there is no
+ need for it.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Elm switches screens prematurely when calling metamail. It switches
+ before writing the "Press any key..." message, thus losing metamail output.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ read_headers() in src/newmbox.c assumes that Mime-Version preceeds
+ Content-Type in the headers. I removed that assumption.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ On a resync, the temp file was being reopened in *append*
+ mode, thus the fseek that tried to back up the file pointer had no
+ effect.
+ From: Larry Philps <lar...@sco.COM>
+
+ alter the message on aborts to report the temp file name to the user
+ From: The Postmaster <sys...@central1.lancaster.ac.uk>
+
+ During 'make uninstall', an error occurs with the make for doc/,
+ due to a wrongly-extended "if" statement in the Makefile.
+ From: Allan Kugel <hico2!hico3!al...@tsdiag.ocpt.ccur.com>
+
+ Nits and typos in the NLS messages and corresponding default messages.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Fix one of the aliases.dir to be aliases.pag.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Some systems don't have SIGBUS, make it optional.
+ From: Syd
+
+ When SY_ENV_SHELL is set for syscall() it ends up touching SHELL in
+ the parent's environment if vfork is used, so change to fork.
+ From: ta...@uunet.uu.net (David C Lawrence)
+
+ Adds a new integer parameter builtinlines.
+ if (builtinlines < 0) and (the length of the message < LINES on
+ screen + builtinlines) use internal.
+ if (builtinlines > 0) and (length of message < builtinlines)
+ use internal pager.
+ if (builtinlines = 0) or none of the above conditions hold, use the
+ external pager if defined.
+ From: "John P. Rouillard" <rou...@ra.cs.umb.edu>
+
+ I implemented a change to filter's default verbose message format
+ including %x %X style date and time along with username
+ From: ma...@drd.com (Mark Lawrence)
+
+ Filter turns spaces in quoted strings into _ and then back again. This destroys
+ any _ that where there in the first place. This patch removes that.
+ Also fixed a minor bug where 'filter -r' wrote out the wrong thing if the
+ relation in a rule was '~'.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ The following minor patch for leavembox.c is useful for BSD systems
+ which implement correct (per SVID & POSIX) struct utimbuf. Where the
+ source previously tested just '#ifdef BSD' it now tests '#if
+ defined(BSD) && !defined(UTIMBUF)'. This suppresses a compile-time
+ warning on ConvexOS due to the prototype of utime.
+ From: rwr...@dhostwo.convex.com (Randy Wright)
+
+ Correct MMDF syntax problems and newmail botches.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ When elm exits because a spool mailbox is used, it should do a Raw(OFF) so
+ that the error message get's printed on the right screen.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ It seams that SCO Unix nedds 1 pair of () extra to get
+ the new newmail.c code to work.
+ From: Jan S{ll <jan%uni...@Mail.SWIP.net>
+
+ fixed the behaviour of the tool nfrm or frm -snew to be inconsistent
+ with elm itself. In from.c it never recognized the file in the MAIL
+ environment variable to be a SPOOL file as you say in the source.
+ From: Erick Otto <eo...@hvlpa.ns-nl.att.com>
+
+ There is a small bug in this routine in Chip's PL21 patch. The code
+ calls atonum to convert the 4 digit timezone field. However this field
+ is actually of the form HHMM, not a decimal number, so for example
+ -0500 was being converted to -500 rather than the correct -300.
+ From: Larry Philps <lar...@sco.COM>
+
+ Corrections to PL21 Alpha docs and consistent punctuation use in help files.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ When newmail stats/reads the mailbox it updates the access times. This
+ causes problems for users that run both newmail and xbiff since xbiff
+ just looks at the access times of the mailbox. Added code to newmail
+ that borrows some code from src/leavembox.c for updating mailbox access
+ times.
+ From: a...@redwood.cray.com (Chris Jackman)
+
+ More utime portability problems with convex
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Adresses with double quoted strings that contains comma was parsed
+ wrongly by break_down_tolist() and figure_out_addressee().
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Fix where we remove the extra hostbangs and on which fields we do
+ it to include bcc and cc as well as to, and to do it in the file
+ copies as well as the command line.
+ From: Syd via code change request from d...@neptune.att.com
+ A Raw(OFF) was missing so when in mail only mode and one
+ does f)orget, the "Message saved" ends up on wrong screen.
+ Also added \r\n to end of messages to make output look nicer.
+
+ When composing mail in the builtin editor, it wrapped on /.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ xrealloc name conflicts with some os having a routine called xrealloc,
+ renamed it elm_xrealloc.
+ From: Syd
+
+ added the RFC822 fields Comments, In-Reply-To and References.
+ to fastmail.
+ From: Greg Smith <sm...@heliotrope.bucknell.edu>
+
+ Fix src/alias.c for which seek is being used, FILE * requires fseek
+ From: Syd via prompt from mfv...@netcom.com (Michael Vargo)
+
+ Add cast to silence compiler warning.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Make alias names consistently handled as lower case.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Fix to copy_file to ignore unescaped from if content_length not yet reached.
+ Fixes to NLS messages match number of newlines between default messages
+ and NLS messages. Also an extra ) was removed.
+ From: Jan Djarv <Jan....@sa.erisoft.se>


+
+
+
+
+

+
+
+
+ =========================================================
+ Patch Set - Patches 18 through 20: Thu Dec 24 18:53:52 EST 1992
+ Elm 2.4PL17 -> Elm 2.4PL20
+
+ Fix unintended change where forwarding without editing started adding
+ prefix chars
+ From: Syd
+
+ Here are the doc changes for my additions to the alias system and
+ the new switches to listalias.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Add a c)hange alias, -u and -t options to listalias to list only user
+ and only system aliases respectively.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Fix formatting and typograpical problems
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Always pass three parameters to header_cmp().
+ From: ch...@tct.com (Chip Salzenberg)
+
+ Fixed where when doing ! or | and ti/te is enabled, one doesn't see the
+ "Press any key to return to ELM:" message. because the screens are
+ switched before the message is printed.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Quote from the filter of phrase to prevent RFC-822 parsing problems
+ From: Syd via request from Ian Stewartson <iste...@dlvax2.datlog.co.uk>
+
+ EDITOROPTS and DEFEDITOR appear to be unused but here is
+ a patch to make use of $editoropts.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Fix confirm prompts to follow Elm style in confirm append/create
+ From: Syd
+
+ Fix messages and nls messages to match. Plus use want_to
+ where appropriate.
+ From: Syd, via prompting from Jan Djarv <Jan....@sa.erisoft.se>
+
+ Add Ignore of CONT signals on exit for Ultrix
+ From: Syd via prompt from Bob Mason
+
+ Add lstat call for proper detection of symlink in leavembox.c
+ From: Syd via prompt from Bryan Curnutt
+
+ Make copy_sans_escape expand tabs to prevent subject displays from getting messed up
+ From: Syd via request from p...@Cayman.COM (Paul Fox)
+
+
+
+
+ =========================================================
+ Patch Set - Patches 13 through 17: Fri Dec 11 20:52:23 EST 1992
+ Elm 2.4PL13 -> Elm 2.4PL17
+
+ Attempt to fix where Elm was issuing the final error message on the
+ cursor screen instead of the regular screen on terminals where the
+ ti/te code swaps the screen.
+ From: Syd
+
+ Internal fix to use correct errno on some error messages.
+ From: Syd
+
+ Add decode option to copy_message
+ From: bjo...@stud.cs.uit.no (Bjoern Stabell)
+
+ Fix Configure for ls that return 0 status even if file
+ is not found, re packing man pages.
+ From: a...@redwood.cray.com (Chris Jackman)
+
+ Fix Configure not getting mailgrp correct on symlinks.
+ From: a...@redwood.cray.com (Chris Jackman)
+
+ Add missing -n flag to doc makefile.
+ From: g...@dogmatix.inmos.co.uk
+
+ Always init fcntlerr and flockerr in src/lock.c to avoid compiler
+ warnings.
+ From: Syd via prompt from w...@grouper.mkt.csd.harris.com (W. David Higgins)
+
+ Traditional C used 'unsigned preserving' rules when an integral data
+ value is widened to integer and ANSI C changed the rules to 'value
+ preserving'. This is one of the few things that the ANSI X3J11 committee
+ did that might break existing programs. Casting to (int)
+ From: Bo.Asbjorn.Muldbak <b...@jutland.ColumbiaSC.NCR.COM>
+
+ When ELM is reporting "appending to <foldername>" I never get to see
+ but a flash of light, before the message line has been replaced by a
+ dummy "Messages saved" string. And if you happen to have mistyped the
+ foldername or the leading '=', you never see the foldername.
+
+ This fix will change file.c to show either
+
+ Message <what> to <foldername>
+
+ or
+ <#> messages <what> to <foldername>
+ From: Bo.Asbjorn.Muldbak <b...@jutland.ColumbiaSC.NCR.COM>
+
+ This implements the use of SIGUSR1 and SIGUSR2 as discussed on the
+ mailing list recently, and adds them to the documentation.
+ From: s...@lokkur.dexter.mi.us (Steve Simmons)
+
+ Attempt to patch posix_signal for SunOS problem.
+ From: A lot of the Elm group
+
+ Change canceled mail message to indicate full path name as
+ AFS users don't have home and elm's home the same.
+ From: Syd
+
+ Fix doc/Makefile.SH to have an else clause on all if's so that
+ if's that return an error code on a not taken if and a null else
+ clause don't exit the makefile
+ From: Syd via requests from many
+
+ General changes for apollo portability
+ From: gor...@mcil.comm.mot.com (Gordon Berkley)
+
+ Fix typos in edit.c
+ From: Bo.Asbjorn.Muldbak <b...@jutland.ColumbiaSC.NCR.COM>
+
+ If sigset() and sigrelse() are available, release signal before
+ using longjmp() to leave signal handler.
+ From: ch...@tct.com (Chip Salzenberg)
+
+ Anytime elm wants to re-run newalias, selected is set to 0.
+ (removing any limit in effect)
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Allow for use from restricted shell by putting SHELL=/bin/sh in the
+ environment of spawned mail transport program.
+ From: ch...@tct.com (Chip Salzenberg)
+
+ fix Obvious typos.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ List_folder knew only about '=' but nothing about the rest
+ of [+=%] as one would have expected.
+ From: Jukka Antero Ukkonen <ukk...@venus.csc.fi>
+
+ Fix where the user creates a first new alias, then deletes it, the
+ alias stays on screen, but the file really will be empty if it was the
+ last alias, so the retry to delete gives 'cannot open ...file' messages
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Make Elm complain about spaces that are not after commas in
+ alias and address lists
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Make verb and pronoun agree.
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ in do_get_alias(). abuf[] was under dimensioned.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Remove the old packed manual page before trying to pack the new one.
+ From: Tom Moore <tmo...@fievel.DaytonOH.NCR.COM>
+
+ Fix double inclusion of sys/types.h
+ From: Tom Moore <tmo...@wnas.DaytonOH.NCR.COM>
+
+ Fix building editor wrap problem
+ From: Syd via prompting from vo...@isa.de (Gerald Vogt)
+
+
+
+
+ =========================================================
+ Patch Set - Patches 12 and 13: Sat Nov 21 21:03:26 EST 1992
+ Elm 2.4PL11 -> Elm 2.4PL13
+
+ Handle the case where a system does
+ > #define jmp_buf sigjmp_buf
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Fix segmentation violation on restricted alias page jump.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Fix bug where alias records were not sorting by both last and
+ first names.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Fix when expanding the macro '%S', the subject line is scanned for a
+ 'Re:', and if nothing is found, a '"Re: ' is added. But when a 'Re:'
+ *is* found, then nothing is added, not even the '"'.
+ From: Sigmund Austigard <aus...@solan.unit.no>
+
+ I was playing with the metamail stuff and Sun's Openwindows Mailtool
+ and discovered that I was able to 'display' messages generated with
+ Mailtool in elm using metamail. This marks the Sun Attachments as
+ needing metamail.
+ From: Lutz Brunke <bru...@dkrz-hamburg.dbp.de>
+
+ Change the way Configure and doc/Makefile.SH deal with installing
+ man pages.
+ From: Tom Moore <tmo...@wnas.DaytonOH.NCR.COM>
+
+ Add support for a "config.changes" file to override Configure decisions.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Allow SCO MMDF to use the mmdf library for mailer via execmail.
+ From: Larry Philps <lar...@sco.com>
+
+ Add on initial display or display where the entire screen is being
+ drawn, we should not output the trailing blanks that clear the old
+ value.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ This mod fixes overlapping prototypes for strchr and index on
+ Convex.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ According to the MIME BNF, quoted strings are allowed in the value portion
+ of a parameter.
+ From: c...@alias.com (C. Harald Koch)
+
+ The fastmail utility appears to work incorrectly when multiple addresses are
+ supplied. Spaces were inserted between addresses rather than commas.
+ From: lit...@carina.hks.com (Jim Littlefield)
+
+
+
+ =========================================================
+ Patch Set - Patch 11: Tues Nov 17 1992
+ Elm 2.4PL10 -> Elm 2.4PL11
+
+ Quickie fix to handle a botched edit of a test line in Configure
+
+
+
+
+ =========================================================
+ Patch Set - Patches 9 and 10 : Sat Nov 14 21:34:44 EST 1992
+ Elm 2.4PL8 -> Elm 2.4PL10
+
+ I think that the code in 'newmbox.c' which handles bad 'Content-length'
+ entries is incomplete. The file-ptr for the mail file is
+ backed up, but the file-ptr of the temp file WAS LEFT UNMODIFIED !
+ From langesw.ssw.de!root Wed Nov 11 14:28:57 1992
+
+ When elm copies the temp mailbox back to the mail spool to resync or
+ quit, it changes to the mailgroup before attempting to diddle in the
+ mail spool, but when it copies the temp mailbox back to the mail spool
+ after editing, it forgets to change to mailgroup. This patch appears
+ to work, but I haven't exhaustively checked for some path that leaves
+ the gid set
+ wrong. From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ There's an error in two messages in s_aliases.m which causes elm2.4
+ to core dump when resyncronize aliases. (%s/%s) should be (%c/%c).
+
+ This bug doesn't show up unless you use message catalogs, since the default
+ message in a_quit.c is correct.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Fix how nls emulation lib gencat links prev pointers
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ The alias message_count isn't set to zero if the last alias has
+ been deleted from the alias table. As no aliases are reread from
+ the aliases database the message_count is left as it was before.
+
+ Fixed that the function do_newalias() sometimes returns without freeing
+ the buffer allocated before. The patch adds these free calls.
+
+ When you erroneously type a number in your folder elm asks you for
+ a new current message number. But now if you erase this one number
+ and leave the string empty elm will set the new current message to
+ the second message on our sun4! The patch adds a check for an empty
+ string and returns the current number if no number was entered.
+ From: vo...@isa.de (Gerald Vogt)
+
+ The situation is that the .elm/aliases file is missing, but
+ .elm/aliases.dir and .elm/aliases.pag exist (isn't serendipity
+ wonderful?). The ndbz functions tolerate this and just put a NULL
+ pointer in the db structure for the data file FILE pointer. However,
+ get_one_alias() in listalias and elm doesn't account for the db_open()
+ succeeding but the dbz_basef field being NULL, so it passes the NULL
+ pointer to fread(). Detect null and return 0
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Clear the screen before displaying MIME:
+ From: mar...@rhi.hi.is (Marius Olafsson)
+
+ Add regexp processing to filter.
+ Add execc operator
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+
+
+
+ =========================================================
+ Patch Set - Patches 7 and 8 : Sat Nov 7 15:54:44 EST 1992
+ Elm 2.4PL6 -> Elm 2.4PL8
+
+ Add some tolerance for incorrect Content-Length header (fixes bug where
+ Elm would combine two messages if content-length header was incorrect.
+ Still has problem if incorrect content-length exactly matches multiple
+ messages)
+ From: Syd
+
+ Change Makefile in doc to use -f as some shells don't have -x in test
+ From: Syd
+
+ The first is that when doing a summary, macros are expanded when printing the
+ rule. IMHO they should be printed as with the -r option (i.e. %t is
+ printed as "<time>" and so on).
+
+ The second one is that the summary printed "applied n time" regardless of
+ the value of n, not "applied n times" when n > 1.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ There is no need to write out the MIME-Version header in subparts
+ From: Klaus Steinberger <Klaus.St...@Physik.Uni-Muenchen.DE>
+
+ fix null dereferences from patch 5
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Fix where elm duplicates the entry's from the global elm.rc.
+ It will however still copy the global weedout headers to your local
+ elmrc if they where not already in it.
+ From: ja...@fwi.uva.nl (Jan Wortelboer)
+
+ another typo (2.4.6 Ref.guide)
+ From: David.W...@gagme.chi.il.us (David W. Tamkin)
+
+ comments should be allowed anywhere in the alias file.
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Symbol change for AIX370
+ From: u...@watson.ibm.com
+
+ Fix redefinition complaint by SCO 3.2v2.0.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ Enhanced printing support. Added "-I" to readmsg to
+ suppress spurious diagnostic messages.
+ From: ch...@chinacat.unicom.com (Chip Rosenthal)
+
+ These small typos stopped me from making forms, so here is a patch.
+ From: andrew.m...@rd.eng.bbc.co.uk (Andrew McParland)
+
+ Add a hack to not use ti/te on list folders and do print
+ From: Syd
+
+ New header parsing routine header_cmp to allow for linear
+ white space around the : in headers
+ From: Syd
+
+
+
+ =========================================================
+ Patch Set - Patch 6 : Mon Nov 2 15:52:00 EST 1992
+ Elm 2.4PL5 -> Elm 2.4PL6
+
+ Things I found in doc/Ref.guide looking over patches 4 & 5:
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ More changes to folder creation confirmation
+ From: Larry Philps <lar...@sco.COM>
+
+ fix a bug in the forms reply caused by the Cc: buffer not being
+ cleared. If one has sent mail just prior to replying to the form and
+ specified a Cc: address, the form reply is also sent to those Cc:
+ address(es).
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ Add missing MAKE variable in doc/Makefile.SH
+ From: Syd
+
+ it invokes metamail (the pseudo is because "text" isn't a legal Content-Type).
+ in src/mime.c notplain() tries to check for text but fails because it should
+ look for "text\n" not "text".
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ Use copy_message in mime shows to get encode processing
+ From: bjo...@stud.cs.uit.no (Bjoern Stabell)
+
+ Corrections to Unix date parsing and time zone storage
+ From: eo...@hvlpa.att.com
+
+ Prevent index underflow when wildchar is in first three chars of string
+ From: Syd via note from g...@dogmatix.inmos.co.uk
+
+
+ =========================================================
+ Patch Set - Patches 4 and 5 : Sat Oct 24 22:48:00 EDT 1992
+ Elm 2.4PL3 -> Elm 2.4PL5
+
+ Fixes SysV style forwarding
+ From: Baruch Cochavy <bcoc...@ilux39.intel.com>
+
+ fix newmail attempting to close a file descriptor even if the corresponding
+ open failed.
+ From: "Peter A. Bigot" <p...@cs.arizona.edu>
+
+ In our global elm.rc I keep the four options as below
+
+ confirmappend = OFF Don't confirm every append to any file.
+ confirmcreate = ON Confirm creation of every new file.
+ confirmfiles = ON Confirm append to non folder files though.
+ confirmfolders = ON In case someone does not want to be asked
+ every time when creating a new file try
+ to confirm creation of folders though.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ changes found by using codecenter on Elm 2.4.3
+ From: Graham Hudspith <g...@inmos.co.uk>
+
+ There is now an additional elmrc option "displaycharset", which
+ sets the charset supported on your terminal. This is to prevent
+ elm from calling out to metamail too often.
+ Plus a slight documentation update for MIME composition (added examples)
+ From: Klaus Steinberger <Klaus.St...@Physik.Uni-Muenchen.DE>
+
+ More typos
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ I think all these are typos
+ From: dwo...@pffft.sps.mot.com (Dave Wolfe)
+
+ remove the 25 (MAXRULES) limitation.
+ Basically it mallocs rules in hunks of RULESINC (25) as it goes along.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ fixed a bug were elm didn't call metamail on messages with a characterset,
+ which could be displayed by elm itself, but message is encoded with QP
+ or BASE64
+ From: Klaus Steinberger <Klaus.St...@Physik.Uni-Muenchen.DE>
+
+ Here are the patches to support POSIX sigaction().
+ From: t...@osf.org
+
+
+ =========================================================
+ Patch Set - Patch 3: Mon Oct 19 13:10:28 EDT 1992
+ Elm 2.4PL2 -> Elm 2.4PL3
+
+ Fix spelling of name
+ From: Larry Philps <lar...@sco.COM>
+
+ corrected typos
+ From: David.W...@gagme.chi.il.us (David W. Tamkin)
+
+ Here's another; now the copyright notices on the man pages don't seem
+ to have an ego problem. The various guides are just fine.
+ From: Steve Simmons <s...@wotan.iti.org>
+
+ setting the debug level to 5 or higher caused a core dump due to a possible
+ dereference of a NULL pointer
+ From: "Peter A. Bigot" <p...@cs.arizona.edu>
+
+ rewrite the Configure prompt for metamail
+ From: Steve Simmons <s...@iti.org>
+
+ Correct reversed usage of $d_utimbuf.
+ From: ch...@tct.com (Chip Salzenberg)
+
+ Fix warnings from my ANSI C compiler because the declaration of
+ edit_interrupt did not match the prototype for the second argument of
+ a call to signal.
+ From: Larry Philps <lar...@sco.COM>
+
+ TEXT_SORT was supported, but UNRECOGNIZED
+ From: l...@dmicvx.dmi.min.dk (Lennart Sorth)
+
+ Force text arithmetic into unsigned for those systems
+ with signed chars
+ From: Marius Olafsson <mar...@rhi.hi.is>
+
+ Change lock file name to add user name on filter locking of mail spool
+ From: Peter Brouwer <p...@idca.tds.philips.nl>
+
+ Fix messages to work with 4.3bsd /bin/sh
+ From: w8...@TACOM-EMH1.Army.Mil (Keith Petersen - MACA WSMR)
+
+ Add flags to read_rc to support command line overrides of the option.
+ From: Jan Djarv <Jan....@sa.erisoft.se>
+
+ adds the function bytemap() and the macros MAPIN and MAPOUT from the file
+ lib/ndbz.c in the file src/alias.c.
+ This fixes the byte order independence in aliases.
+
+ prevent elm from exiting when resyncing the empty incoming mailbox.
+ From: vo...@isa.de (Gerald Vogt)
+
+ patch to make elm use (or in my case, not use) termcap/terminfo ti/te.
+ From: Graham Hudspith <g...@inmos.co.uk>
+
+ =========================================================
+ Patch Set - Patches 1 and 2: Sat Oct 10 22:14:59 EDT 1992
+ Elm 2.4PL0 -> Elm 2.4PL2
+
+ Switch to wrapper for flock and fcntl locking.
+ Change order to fcntl first, other order blocked.
+ From: Jukka Ukkonen <ukk...@csc.fi>
+
+ Fix some compiler warnings that I receive compiling Elm on my SVR4
+ machine.
+ From: Tom Moore <tmo...@fievel.DaytonOH.NCR.COM>
+
+ Add AIX to src/curses.c for define of window size in different include
+ file.
+ From: Syd via note from Tom Kovar
+
+ get_return() assumes that message_count reflects the number of
+ messages in the current folder, but the message_count it's seeing
+ from the alias subsystem is actually the *alias* count.
+ toggle the main state before and after calling get_return().
+ From: cl...@sfn.ORG (R. Cliff Young)
+
+ Add missing setlocale and getopen to newalias and listalias.
+ From: Syd
+
+ Touchups on config guide
+ From: David Barr <ba...@pop.psu.edu>
+
+ Fix segv in wildcards if SHELL= has no / character in path
+ From: Syd
+
+ 1. If firstname && lastname is null then copy aliasname into the
+ personal name field (inside the ()'s) when creating an alias
+ from the menu using the 'n' command.
+
+ 2. Now if for some reason and alias has a null personal name field
+ (the person hand edited aliases.text) the blank () is not printed
+ as part of the address. This actually cured another problem, where
+ the To: field on the screen (when you hit 'm' on the alias menu)
+ used to be blank, now the address shows up....
+ From: "Robert L. Howard" <robert...@matd.gatech.edu>
+
+ Updated AIX 3.2 section of README file
+ From: Syd
+
+ fixed a bug in the .lp macro in doc/tmac.n. The lp macros is always
+ called with a unit specified for the second argument, however, the
+ macro added a "n" unit specifier to that argument. The following patch
+ fixes this problem.
+
+ The various .guide books use the troff .tl macro liberally, but often the
+ extra ' characters needed at the end of the lines to explicitly specify
+ the trailing nulls fields were left off. The following patch fixes the
+ erroneous lines.
+ From: Larry Philps <lar...@sco.COM>
+
+ While installing elm2.4 on a Sun4 running SunOS4.1.2, the Configure script
+ doesn't recognize F_SETLK because it searches in /usr/include/sys/fcntl.h
+ which includes /usr/include/sys/fcntlcom.h (where F_SETLK is).
+ From: d...@ulysse.enst.fr (Philippe Dax)
+
+ change dbm name to dbz to avoid conflicts with partial call
+ ins from shared libraries, and from mixing code with yp code.
+ From: Syd via prompt from Jess Anderson
+
Index: elmME+.2.5.alpha0-cvs/ANNOUNCE.ME
*** elm2.4.ME+.115/ANNOUNCE.ME 2002-01-26 13:14:44.000000000 +0200
--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************
*** 1,287 ****
-
- This ANNOUNCE.ME is for ME patches of the 2.4 version.
-
- Look file README.ME+ for the 2.4ME+ version.
-
- --------------------------------------------------------------------
-
- ELM 2.4 PL24 ME8
-
- This is an announcement for Patchlevel ME8 for Elm 2.4pl24.
-
- The most current version of this document is available via the web:
- http://www.cs.hmc.edu/~me/elm/announce.html. You can also visit the "ME" home
- page at http://www.cs.hmc.edu/~me/elm/me.html.
- NOTE THAT THIS ADDRESS HAS CHANGED FROM THE PREVIOUS ANNOUNCEMENT!
-
- What's new:
-
- * Anonymous remailer support (plus chaining, PGP encryption & MIME support)
- * mime.types file when guessing the content-type of an attachment.
- * Forwarded messages can be attached as MESSAGE/RFC822 data
- * Supports extraction of PGP public keys directly
- * Support for application/pgp type inside multipart/mixed and message/rfc822
- messages
-
- Changes from ME7a:
-
- * Replying to MULTIPART messages now works correctly.
- * MESSAGE/RFC822 is now properly supported.
- * BINARY encoding is better supported.
- * Fixed bugs with BASE64 and QUOTED-PRINTABLE encodings.
- * Enhanced attachment menu
- * Improved interface for PGP encrypting messages
-
- Where to get it:
-
- * ftp://cs.hmc.edu/pub/me/elm-2.4pl24me8.tar.Z
- * ftp://cs.hmc.edu/pub/me/elm-2.4pl24me8.tar.gz
- * ftp://cs.hmc.edu/pub/me/elm-2.4pl24me8.diffs.Z
- * ftp://cs.hmc.edu/pub/me/elm-2.4pl24me7a-8.diffs.Z
-
- -OR-
-
- * ftp://uiarchive.cso.uiuc.edu/pub/packages/mail/elm/me/elm-2.4pl24me8.tar.Z
- * ftp://uiarchive.cso.uiuc.edu/pub/packages/mail/elm/me/elm-2.4pl24me8.tar.gz
- * ftp://uiarchive.cso.uiuc.edu/pub/packages/mail/elm/me/elm-2.4pl24me8.diffs.Z
- * ftp://uiarchive.cso.uiuc.edu/pub/packages/mail/elm/me/elm-2.4pl24me7a-8.diffs.Z
-
- -------------------------------------------------------------------------------
-
- STATUS
-
- These patches are not an official release of Elm, and are not supported by the
- Elm Development Group. Features included in this patch may or may not be
- included in the next official release of Elm. I can say for certain that the
- PGP portion will not. I am hoping that my MIME patches will be included in the
- 2.5 release, but that is still an open question. Should the 2.5 release appear
- without these patches, I plan on "porting" them and using 2.5 as the base.
- -------------------------------------------------------------------------------
- And now on to the interesting stuff...
-
- PGP SUPPORT
-
- [This work was inspired by pgpelm which was started by Mic the Missing and
- furthur developed by Ken Cox (ke...@viewlogic.com). This version is a complete
- rewrite of that system but looks very similar.]
-
- Features include: mark on folder menu showing PGP encrypted messages and public
- key blocks, encryption/signing of outgoing messages, decrypting/signature
- check, mailing public key blocks, and extracting public key blocks from
- messages. Special feature allows you to have ELM keep track of your PGP
- passphrase so you only need to enter it a minimal number of times.
-
- I have written a primer for using PGP with this version of ELM which can be
- found at http://www.cs.hmc.edu/~me/elm/pgp.html. It contains everything you
- need to know about how to use PGP with ELM.
-
- MIME SUPPORT
-
- With this version of Elm, the need for metamail is much less since it can now
- handle the MIME encodings and multipart/* messages internally. The only case in
- which metamail is called is when there is a content-type which Elm does not
- understand (eg. image/*, audio/*). In most cases you will probably only receive
- this as attachments anyway, so you might still not require metamail.
-
- * Incoming Attachments
-
- Access to individual portions of a MIME mulitpart message can be accessed
- via the "Attachments" menu (type 'v' in the index menu). This brings up a
- menu listing the attachments for the current message. You then have the
- option of viewing or saving the attachment.
-
- * Outgoing Attachments
-
- In addition to using the "[include ..." construct when editing your
- message, there is now an "Attachments" menu accesible from the "Send" menu
- (it is abbreviated to "a)tt" because of space problems). Simply type "a"
- to get into the Attachments menu. You may then add/delete/edit/modify
- attachments. When possible, Elm will attempt to guess the correct
- Content-Type (based on file extension, see the "mime.types" section below)
- and Content-Transfer-Encoding.
-
- * Automatic encoding for outgoing messages.
-
- If Elm finds 8bit or control characters in text files to be attached, it
- will automatically encode them QUOTED-PRINTABLE if Elm has been compiled
- without the 8BITMIME option (meaning that your MTA isn't 8bit clean). This
- behavior can be overriden with the "noencoding" elmrc option (see below)
- in cases where your sendmail is 8bit clean, but doesn't support the
- -B8BITMIME option.
-
- * mime.types file
-
- Elm now mime.types file which maps filename extensions to Content-Type
- field when sending attachments via the new attachment menu. The format of
- these files is as follows:
-
- <extension> <content-type>
-
- A hash character ('#') may be used as a comment, but it must be in the
- first column of a line.
-
- Here is an example of mime.types file:
-
- # This is a commented line
- html text/html
- tgz application/octet-stream; type=tar; conversions="x-gzip"
-
- Note that the content-type field is not limited to just the type/subtype
- part; in can also include suplementary information.
-
- Elm first looks to see if the user has a ~/.elm/mime.types file. If there
- is no match, Elm will then try to read the system types file (typically
- /usr/local/lib/elm.mimetypes). Failing that, Elm has a few builtin types
- that it understands.
-
- You might want to pick up a copy of my mime.types file as a starting point
- for either your personal or system file at
- http://www.cs.hmc.edu/~me/elm/mime.types.
-
- REMAILER SUPPORT
-

Kari E. Hurtta

unread,
May 17, 2004, 11:34:34 AM5/17/04
to
Archive-name: elmME+2.5/PLalpha0.2

Is available on ftp.funet.fi
via anonymous ftp

directory pub/unix/mail/elm/elm-ME+2.5/
files elm-ME+2.5.PLalpha0.patch.gz
and elm-ME+2.5.alpha0.tar.gz

Is available with

Before applying patch catenate part 1 - 5 first.

This patch is agaist Elm 2.4ME+ PL115 (25) --------- [ part 2/5 ] ---------
- This version of Elm has the ability to prepare messages for use with anonymous
- remailers (if you don't know what that is, read alt.privacy.anon-server for
- more information).
-
- Elm gets its information about anonymous servers by either fingering
- "remail...@kiwi.cs.berkeley.edu" or by reading ~/.elm/remailers (if this
- file exists, it overrides the "finger" so you can still use this feature even
- if you are not directly net connected.)
-
- To send an anonymous message, first compose your message as you normally would,
- entering the name of the person who should ultimately receive the message as
- the To: address. Then, at the "send" menu, you can type "r" to get into the
- "remailer" menu.
-
- There are several options in this menu: remail, chain, path and encrypt.
- The "remail" option indicates whether or not the current message will be
- remailed.
-
- "chain" indicates how many servers this message should be sent through (the
- higher chain is, the more secure, but the tradeoff is how long until the
- receiver gets the message).
-
- "path" is where you can specify which servers you would like this message to go
- through (this overrides "chain"). You can specify a semi-colon (";") separated
- list of server "nicknames" here.
-
- "encrypt" means that Elm should encrypt your messages with the PGP public key
- of server you are remailing through (note that if chain > 1 or there is more
- that one server in "path", Elm will do the "right" thing and call PGP multiple
- times for each hop).
-
- Once the desired options are set, you can quit the menu and send the message.
- What you see next will vary... If you are a PGP user and set encrypt=TRUE in
- the remailer menu, you will see the call(s) to pgp flash across your screen.
- Otherwise you will most likely just see the "Mail sent." message.
-
- If you have MIME defined, it should be possible for you to include attachments
- in your anonymous mail in the normal manner. Most servers these days support
- the "hash" option which Elm makes use of to pass the proper MIME headers.
-
- NEW ELMRC OPTIONS
-
- * usepgppass = [ ON | OFF ]
- Default: usepgppass = OFF
- o OFF: Elm does not keep your passphrase in memory. You must enter it
- each time you want to decrypt a pgp mail.
- o ON: Elm keep your passphrase in memory for "keeppassfor" seconds.
- * keeppassfor = <number>
- Default: keeppassfor = 0
- o keeppassfor>=0: Elm will keep your passphrase in memory for seconds
- after entering the passphrase.
- o keeppassfor<0: Elm will keep your passphrase in memory without
- clearing it from memory.
- * noencoding = <level>
- Default: noencoding = 0
-
- This control makes it possible to send raw 8bit or binary data when the
- MTA doesn't support 8BITMIME and the -B8BITMIME option or BINARYMIME and
- the -BBINARYMIME option.
-
- Possible values:
- o 0 : Always convert 8BIT and BINARY data to QUOTED-PRINTABLE if the
- MTA doesn't support the -B8BITMIME and -BBINARYMIME options.
- o 1 : Allow 8bit without -B8BITMIME, but binary data is encoded
- o 2+: Allow binary without -BBINARYMIME and and 8bit without
- -B8BITMIME
- It is STRONGLY recommended that it be left set to 0 unless you know what
- you are doing!!
- * showto = [ ON | OFF ]
- Default: showto = OFF
- o ON: Elm should show you who the message is addressed to rather than
- who it is from if the message is not addressed to you.
- o OFF: normal behavior
- * pagemultipart = [ ON | OFF ]
- Default: pagemultipart = ON
- o ON: Use the internal MIME support to display MULTIPART messages
- rather than calling metamail
- o OFF: display MULTIPART messages with metamail
- * mimeforward = [ ON | OFF ]
- Default: mimeforward = OFF
- o ON: When forwarding a message, Elm will attach as a MIME body part of
- type MESSAGE/RFC822.
- o OFF: Elm will include the forwarded message in your message, just
- like it always has.
-
- BUILTIN++ PAGER
-
- This pager looks a lot like more, but has some of the movement features of
- less, most notably, paging backwards through your messages. Press '?' inside of
- the pager for a list of valid keystroke commands.
-
- TAGS
-
- Use the keyword "tagged" in the "Delete messages with pattern" (invoked by ^D
- in the index menu) to delete all tagged messages.
-
- You can now use the keyword "all" to tag all visible messages.
-
- LIMIT FUNCTIONALITY
-
- * Simple compound statements can be made using '|' (OR) and '&' (AND).
- * The "Cc:" field is now availible for search.
- * New keyword "tagged" for narrowing to only the currently tagged messages.
-
- MISCELLANEOUS
-
- '*' may be used as a wildcard in the "alternatives" list in the elmrc file. For
- instance, "me@*.hmc.edu" would me to match the user "me" in all hosts from the
- "hmc.edu" domain.
-
- Elm will keep track of the messages which you have replied to with an 'r' mark
- in the index menu.
-
- Forwarded messages are encapsulated instead of quoted like replies:
-
- ----- Forwarded message from Joe User -----
- [...]
- ----- End of forwarded message from Joe User -----
-
- You can effect an automatic Bcc: line by setting the address(es) in the "BCC"
- environment variable. Note that this is non-standard, but provided as a means
- of accomplishing the task.
-
- BUGS
-
- A list of known bugs can be found at
- http://www.cs.hmc.edu/~elkins/elm/bugs.html.
-
- AUTHOR
-
- Michael Elkins <elk...@aero.org>
- Home Page: http://www.cs.hmc.edu/~me/index.html
-
- If you are interested in knowing what my future plans are, you can browse my
- "TO DO" list at http://www.cs.hmc.edu/~me/elm/todo.html
-
- THANKS
-
- Kari Hurrta <Kari....@fmi.fi> has contributed a great deal to the MIME
- support (and fixed lots of my stupid bugs ;-)
-
- I would also like to thank everyone who took the time to report bugs or suggest
- improvements!
- -------------------------------------------------------------------------------
- Last updated Sept 21, 1995.
--- 0 ----
Index: elmME+.2.5.alpha0-cvs/ChangeLog.ME
*** elm2.4.ME+.115/ChangeLog.ME 2002-01-26 13:14:44.000000000 +0200


--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************

*** 1,812 ****
-
- This ChangeLog.ME is for ME patches of the 2.4 version.
-
- Look file README.ME+ for changes of the 2.4ME+ version.
-
- -------------------------------------------------------------------------
-
- -----------------
- Changes from ME8a
- -----------------
- When checking to see if the subject line should be centered when displaying
- a mail message, the weedlist check should be for "subject:", not "subject".
- This case is more general.
-
- control-F in the main menu now causes Elm to forget your passphrase. Useful
- for when you screw up so you don't have to exit Elm before using PGP
- again.
-
- Added a "metoo" argument in pgp_encrypt to decide whether or not the
- +encrypttoself=on flag should be passed to pgp. This was needed so that
- the value of auto_cc can be overidden when remailing.
-
- Added support for decoding of RFC1522 style encoded headers. This should
- work in the index menu, the pager, and when replying (the "attribution").
-
- metapager will now recover if pgp fails by displaying the message "as is"
- in the case where the message is only signed.
-
- Simplified "pager" check in metapager since there are two pagers now.
-
- Fixed problem in copy_message where the rfc822 newline at the end of the
- headers was missing.
-
- Fixed bug in menu2.c:generic_menu (used by the remailer) which caused
- Elm to segfault when not compiled with gcc.
- From: Andrey A. Chernov <ac...@astral.msk.su>
-
- Fixed problem where trailing MMDF separator was still being printed.
-
- The default filename for the Content-Disposition header was not getting
- set if the included file did not have an extension.
-
- text/plain => application/pgp conversion is now NOT done for public key
- blocks.
-
- Configure now figures out where "finger" is instead of hardcoding a path
- in remailer.c
-
- Hopefully fixed definition for sleep() in defs.h.
-
- Fixed bug where elm would segfault when typing ^E when there are no messages
- in the mailbox.
-
- Fixed bug where a leading space could be inserted before the real name when
- looking up a PGP public key from the return address.
-
- Fixed some of the movement commands in builtin++ so that they work now.
-
- Convert application/x-pgp-* => application/pgp to decode messages generated
- by pgpelm.
-
- Fixed problem where if the signature was added after editing the message,
- it would be written over the message right after the content length. Fixed
- by seeking to the end of the file after writing the content length field.
-
- ----------------
- Changes from ME8
- ----------------
- Fixed bug in conversion of text/plain => application/pgp in newmbox.c which
- was causing Elm to segfault. (Thanks to Kari....@fmi.fi)
-
- Fixed bug where builtin++ segfaults when viewing zero length messages.
-
- -----------------------
- Changes from ME8alpha19
- -----------------------
- Fixed bug where external pager did not work with non-MIME messages when
- USE_PGP is defined.
-
- Cleaned up mime_pgp_decode so that it does not need to look at the
- header_rec for the current message any longer.
-
- Do text/plain => application/pgp conversion in newmbox.c if PGP type data
- is discovered in the message. This supports those who are sending PGP
- messages but are not compliant with what Elm expects.
-
- Added the control-E (extract public key) command to showmsg_c.c.
-
- Security fix from Olaf Kirch <ok...@monad.swb.de> which forces Elm to write
- the temp spool mailbox in the user's home directory instead of /tmp. This
- prevents exploitation of symlinks to create a .rhosts in the user's
- directory.
-
- Fixed bug in show_status where flags from the previous message were not
- being properly cleared with USE_PGP was defined and MIME was not.
-
- -----------------------
- Changes from ME8alpha18
- -----------------------
- added application_decode for support of APPLICATION/* types. Calls
- null_decode if the subtype is unknown.
-
- rfc822_decode now matches the headers against the weedlist when printing
- out. You can view all the headers for a message by pressing 'h' while
- viewing a message just as you normally would.
-
- added mime_pgp_decode for inline decoding of application/pgp parts.
- application/pgp at the top level is still handled by metapager since some
- people will be configured without MIME. I might eventually require that
- to use PGP, you must also define MIME, but not yet!
-
- Status header was printed in the wrong place with BINARY encoding.
- From: Kari....@fmi.fi
-
- Added the DONT_ADD_FROM and NEEDS_LONE_PERIOD_ESCAPE checks to write_encoded,
- and other MIME text parts.
- From: Kari....@fmi.fi
-
- Added a "type_opts" field in mime_send_t.
-
- mime_write_header now just writes the MIME headers. The code to add the
- boundary for multipart messages and the charset for text/plain was moved into
- mailmsg2.c.
-
- Changed pgp code to set MIME fields to use add_parameter and type_opts instead
- of directly writing to subtype.
-
- Made some changes in the Content-Type for PGP messages to be more compliant
- with the unofficial standard.
-
- -----------------------
- Changes from ME8alpha17
- -----------------------
- MIME header code in write_header_info() was moved to
- mime_write_header in mime_encode.c. This was done to greatly simplify the
- code, and to make it possible for me to send MIME messages with the
- remailer code. This will also make it possible for me to have PGP
- encrypted MIME messages in the future.
-
- Content-Length headers are generated regardless of whether or not MIME
- is defined.
-
- Lots of changes to the remailer code to make it work with MIME.
-
- -----------------------
- Changes from ME8alpha16
- -----------------------
- Removed Content-Length header from attachments included by the "[include ...]"
- statement.
-
- Made the existing global variables that set the toplevel Content-Length header
- a part of mime_send_t. This has the side effect that if MIME is not
- defined, no Content-Length header will be added on outgoing messages.
-
- Commented out the code which reads the content-length header from attachments
- in mime_parse.c. It should now ignore that header and figure out the length
- in multipart_parse().
-
- -----------------------
- Changes from ME8alpha15
- -----------------------
- New option "mimeforward" controls whether or not forwarded messages are
- sent as MESSAGE/RFC822 MIME messages, or are sent in the old non-MIME
- way.
-
- - Fixes for my mistakes in alpha15.
- - text_unsupported_decode() added for printing warning message about
- unsupported text subtypes.
- From: Kari....@fmi.fi
-
- Changed disposition handing such that a message saying that the user should
- type 'v' to view an attachment which is declared something other than
- "inline".
-
- -----------------------
- Changes from ME8alpha14
- -----------------------
- Make sure that arguments to fseek(), etc., are type long.
- From: Kari....@fmi.fi
-
- Added some general access commands for attachments in the attach_menu.c
- routines.
- From: Kari....@fmi.fi
-
- The disposition is now displayed in the little mini-header. This looks nicer
- than the previous message about "[Content-Disposition: attachment, skipping]".
-
- select_CT_decoder now returns text_decode for all TEXT types. My reasoning
- here is that since the MIME spec says that all unknown subtypes of TEXT
- should be treated as TEXT/PLAIN so long as the charset is understood, then
- all TEXT can be treated in this manner.
-
- Made sure that the pgp field of header_rec gets set to zero when initializing
- in attach_viewer and also in newmbox.c.
-
- Removed lots of unused variables.
-
- Added some parentheses in places to make "gcc -Wparentheses" happy.
-
- -----------------------
- Changes from ME8alpha13
- -----------------------
- Forgot to initialize usepass=FALSE in pgp_decrypt_init. This caused elm
- to hang when trying to decode a signed message while pgp was waiting for
- the passphrase...
-
- The attachment menu should now work properly for viewing message/rfc822
- messages with the builtin pager.
-
- When attaching a message/rfc822 with the "forward" command, you should
- now be able to perform all the actions in attach_menu() as for a "normal"
- attachment.
-
- -----------------------
- Changes from ME8alpha12
- -----------------------
- Tried to fix MIME_NOTPLAIN code again. This time MESSAGE/RFC822 will not
- have it set, which MULTIPART will if pagemultipart=OFF.
-
- Fixed attach_menu so that Elm does not segfault when you try to do an
- operation on an attachment when there are no attachments defined.
-
- Removed the MIME_NOTPLAIN flag and made it a one-bit flag in mime_t instead.
- Removed PGP flags from defs.h and use a 3-bit field in header_rec instead.
- These two now ensure that the "status" field of header_rec is always less
- than 65536 so that 16bit integer machines will not have troubles.
-
- Elm now pays attention to what the MIME-Version header says and passes any
- messages with an unknown MIME-Version header value to metamail, or displays
- an error if $NOMETAMAIL is set.
- From: Kari....@fmi.fi
-
- -----------------------
- Changes from ME8alpha11
- -----------------------
- pgp_call() now uses the expanded_* address lists so that aliases are
- expanded before trying to look up the ids with PGP.
-
- Fixed calls in mailmsg2.c with wrong number of arguments (botched job
- including Kari Hurtta's patch).
- From: Kari....@fmi.fi
-
- Reordered the preMIME code in newmbox.c to make it a little more efficient.
-
- Fixed bug in write_header_info() where a spurious newline was being printed
- after the Content-Type header for TEXT. This was causing the remaining
- fields not to be a part of the message header.
-
- Removed check for old-style RFCXXX Mime-Version header. I don't believe
- anybody uses that anymore since RFC1341 has been out so long.
-
- pgp_status needed to be reset when the user aborts sending a message,
- otherwise you can't encrypt another message until you successfully send
- another message.
-
- MIME_NOTPLAIN is not set for multipart messages if "pagemultipart" is TRUE.
-
- Cleaned up code for deciding if metamail mail should be called to display
- a message in showmsg.c. Created a need routine, need_meta(), for this
- purpose.
-
- -----------------------
- Changes from ME8alpha10
- -----------------------
- Fixes to remove some global MIME variables used for composing.
- From: Kari....@fmi.fi
-
- Added a redraw command to the attachment menu.
-
- Fixed the code in newmbox.c where MIME_NOTPLAIN was not set for non-TEXT
- content-types. Also, check for "plain" should be "text" for old-style
- pre-MIME content-type headers.
-
- Added a print command to the attachment menu.
-
- Made the remailer support a Configure option.
-
- ----------------------
- Changes from ME8alpha9
- ----------------------
- Use Elm's error routines in the attachment menu.
- Protected iscntrl() more calling isascii() before it in builtin++.
- From: Kari Hurtta <Kari....@fmi.fi>
-
- Added bit of code lost from old showmsg.c which centers the subject line
- after the title line in the case where "subject" is in the weedlist.
-
- Viewing attachments with metamail while in send mode now works. It required
- different arguments to be passed to metamail.
-
- -----------------------
- Changes from ME8alpha8a
- -----------------------
- mime_t_clear() now sets the defaults of TEXT/PLAIN, ENCODING_7BIT, DISP_INLINE,
- when called.
-
- More fixes from Kari Hurtta <kari....@fmi.fi>
-
- Removed padding bitfield from struct mimeinfo since it isn't needed.
-
- Added +clearsig=ON when adding a PGP signature to a message.
-
- Added prototypes for the functions defined in pgp.c.
-
- Elm will now allow you to edit the list of usernames to encrypt to when
- using PGP. This fixes the problem where sometimes the return address
- doesn't match the address on the key. However, it still requires that
- the user know this.
-
- Implemented Kari Hurtta's suggestion of using a "state" variable for the
- MIME output when decoding messages. This will make it easier to add new
- extensions for output. The state information is defined in hdrs/state.h
-
- The user interface for the attachment menu now is more consistent with
- the mailbox menu. (Kari....@fmi.fi)
-
- User is now asked for confirmation upon deleting an attachment from the
- attachment menu if "ask=ON" in the elmrc.
-
- Fixed replying to messages with PGP signatures. They were getting sucked
- into the new MIME code and getting skipped as an unknown type.
-
- Added new procedure to allow for extraction of PGP public keys directly
- instead of relying on metamail.
-
- If Elm can't find a PGP key that it is looking for, it now tells the user
- which key instead of just that there was an error.
-
- The user is now allowed to re-edit the filename in attach_modify() if the
- file was not found. This also allows a user to change the file associated
- with an attachment.
-
- Fixed very old bug of MMDF separators being printed when displaying a
- message.
-
- ----------------------
- Changes from ME8alpha8
- ----------------------
- Fixed problem where you couldn't edit the default filename in attach_save().
-
- ----------------------
- Changes from ME8alpha7
- ----------------------
- Use safe_malloc() and safe_realloc() instead. (Kari Hurtta)
-
- Fixed bug where no EOLN token was printed after the Content-Type header
- when type_opts was NULL in attach_generate_message().
-
- Reorganized struct mimeinfo so that bitfields are next to each other and
- added padding to make them 1 byte long total.
-
- -----------------------
- Changes from ME8alpha6+
- -----------------------
- Reduced memory usage in "struct mimeinfo" by using bitfields or pointers
- instead of predefined strings when possible. Also removed the "comments"
- fields.
-
- New routine lib/strmcpy.c for doing malloc/realloc and strcpy in one shot.
- Helps out with the above objective.
-
- The attachment menu now defaults to disposition "inline" when sending
- mail.
-
- Reorganized the screen in the attachment "configuration" menu.
-
- Removed code for adding "name=" field to APPLICATION/OCTET-STREAM types.
- Uses Kari's code for Content-Disposition "filename" instead. attach_menu()
- still supports both for getting default filename when saving an
- attachment.
-
- Removed MIME_MULTIPART flag. Use MIME_TYPE_MULTIPART with "type" instead.
-
- Removed "encoding" field from "header_rec". Use "encoding" in "mimeinfo"
- instead (this was already mostly true, but there were a few cases left
- over from the early support for encoding...)
-
- ----------------------
- Changes from ME8alpha6
- ----------------------
- Incorporated changes from Kari Hurtta <Kari....@FMI.FI>.
- Big changes are the use of Content-Disposition and routines to better parse
- rfc822 headers. Also fixed multi-line MIME header problem in newmbox.c
-
- ----------------------
- Changes from ME8alpha5
- ----------------------
- Fixed places where "/tmp" was hardcoded for temporary files instead of using
- "temp_dir" in the ME extensions.
-
- Fixed more isspace() problems with "signed char".
-
- Made some formatting improvements in multipart_decode().
-
- Fixed bug where multi-line Content-Type headers were not properly parsed in
- newmbox.c.
-
- Added builtin++2.c which contains a tempfile based pager which may become
- part of the "official" distribution. For right now it is "experimental".
-
- ----------------------
- Changes from ME8alpha4
- ----------------------
- Fixed attach_modify() to use ->type and ->subtype like the rest of the
- attachment routines.
-
- Viewing an attachment while sending didn't work because it read from
- mailfile... Now it can view external files as well.
-
- Fixed problem with signed char and iscntrl() in AddLineToCache().
- This fixes the problem with umlaut characters in some sets.
- From: g...@netapp.com.
-
- Modified mime_generate_boundary() to use mime_count as a counter so that
- subsequent calls will generate different values.
-
- Elm will now read ~/.elm/mime.types and $libdir/elm.mimetypes (system
- mime.types file), if they exist, to map filename extensions to
- Content-Type values when sending attachments. The format of this file
- is:
- <suffix> <content-type>
- There must be no line breaks in the Content-Type field.
- Example:
- tar application/octet-stream; type=tar
- for .tar files.
- NOTE: data which is declared "application/octet-stream" will automatically
- get the option "name=<default_filename>" added to it, so there is no
- need to put it in the definition.
-
- Modified attach_info() so that it uses BASE64 encoding for "application"
- types that have 8bit or control chars in them.
- Also, "image" automatically defaults to BASE64 without reading the file.
-
- attach_save() now uses the "name=<default_filename>" field of "application"
- types as the default filename.
-
- Added '+' as a synonym for NEXT_PAGE in builtin++ per popular request.
-
- attach_generate_msg() no longer puts Content-Length headers on parts that
- it generates.
-
- ----------------------
- Changes from ME8alpha3
- ----------------------
- Added support for multi-line Content-Type: headers in read_headers() and
- mime_read_headers().
-
- me.h now contains prototypes for functions defined by this set of patches.
-
- Fixed some problems with using PGP and remailers.
-
- Fixed parsing of options in the Content-Type header so that semicolons
- inside quotes are protected.
-
- If MIME is defined, forwarded messages will be an attachment of type
- MESSAGE/RFC822.
-
- Fixed problem with viewing MULTIPART or MESSAGE/RFC822 attachments from
- the attachment menu.
-
- Replaced MIME_BOUNDARY with a function (mime_generate_boundary()) that
- sets the global variable "mime_boundary" to generate unique multipart
- boundaries. This is important now that Elm will be sending out
- MESSAGE/RFC822 data which Elm might have originally generated...
-
- ----------------------
- Changes from ME8alpha2
- ----------------------
- Added a second line for menu items in verify_transmission() since adding
- the "r)emailer" option didn't fit on the first line.
-
- Modified the PGP code a little for more flexibility. You can now specify
- a string of "ids" to encrypt with in pgp_call().
-
- ---------------------
- Changes from ME8alpha
- ---------------------
- The menus from attach.c and attach_send.c were combined into a single
- menu in attach_menu.c which servers both purposes. The difference is
- whether or not the user is allowed to modify the given attachments.
-
- The rest of attach_send.c was renamed as mime_encode.c.
-
- -----------------
- Changes from ME7a
- -----------------
-
- Added a check in quoted_printable_decode() to make sure that the index
- into outbuf[] does not run off the end and cause problems.
-
- attach_edit() didn't return TRUE after editing in one spot, which causes
- problems on some platforms, namely Solaris.
- From: Martin Walter <ma...@ruf.uni-freiburg.de>
-
- base64_decode() was broken because it would fread() a data chunk, and
- wasn't always a multiple of 4 bytes, causing the decoding to break.
-
- Changed char => unsigned char in most places in *_encode() to fix problems
- with ISO characters >127.
-
- Added message about PGP support for the 'elm -v' command in args.c.
-
- Support for anonymous remailers. [ALPHA]
-
- Major rewrite of the MIME handling code. MULTIPART and MESSAGE/RFC822
- messages are parsed the first time they are accessed (eg. viewed/replied)
- and then are ready to use without parsing after that. See mime_parse.c
- and mime_decode.c for details.
-
- From: Kari Hurtta <Kari....@fmi.fi>
- Put a loop around verify_transmission() so that Elm will no longer just
- be lame when an error occurs in [include ...] statements. (Way cool! -Ed)
-
- Don't allow user read or writes files as attachmentds which he don't heve
- access. Notice that elm is (usually) setgid mail.
-
- Consider if MTA supports 8BITMIME also when encoding attachments.
-
- Now mail is encoded with quoted-printable if it includes control characters.
- 8BITMIME doesn't help in this case.
-
- Attachments are checked for 8bit characters, then content-transfer-encoding
- 7bit is not allowed.
-
- If any of subpart (also attachments) have content-tarnsfer-encoding 8bit
- or binary it propagates to content-transfer-encoding of top multipart -type.
-
- Now taken note of MIME's canonical encoding model:
- - End of line in text -subtypes when they have encoded with BASE64
- must be encoded as CR LF.
- - Also CR and LF must be encoded in quoted-printable-encoding if
- type have binary data (ie. not line oriented).
- - Done mapping CR LF -> LF when decoding text -subtypes.
-
- These content-transfer-encoding checks for attachments are also done
- for [include ...] keywords when sending.
-
- Now [include ...] also don't need metamail's help (they use same routines
- than attachments menu).
-
- Added configuration file option 'noencoding' (see elmrc-info for details
- on what this does).
-
- ----------------
- Changes from ME7
- ----------------
-
- Forgot to kill the newline from the PGP output before putting it in to the
- builtin++ pager. This resulted in messages being displayed double-spaced.
- Ick!
-
- ----------------
- Changes from ME6
- ----------------
-
- attach_send.c needs <sys/stat.h> on some machines.
-
- Fixed initialization of arrays in attach_send.c because CC isn't quite
- ANSI compliant. You can only initialize static arrays.
- From: Guy Harris <g...@netapp.com>
-
- Added support for sendmail 8.7 which has support for 8BIT content
- encoding. Uses the -B8BITMIME option.
- From: Kari Hurtta <hur...@dionysos.fmi.fi>
-
- Fixed problem where QUOTED-PRINTABLE messages were not decoded when
- replying if USE_PGP was not defined.
- From: Kari Hurtta <hur...@dionysos.fmi.fi>
-
- [keyword ...] constructs are no longer broken when using MIME and the
- message is to be encoded QUOTED-PRINTABLE.
- From: Kari Hurtta <hur...@dionysos.fmi.fi>
-
- Made the QUOTED-PRINTABLE encoding routine more compliant with the
- standard.
- From: Kari Hurtta <hur...@dionysos.fmi.fi>
-
- Added patch to mark messages NEW in all folders (not just the SPOOL)
- if there is no status: line.
- NOTE: This will probably go away when 2.5 is released. Instead, they
- will use some sort of "magic" flag to accomplish the same thing.
-
- Added check to make sure that we don't run off the end of outbuf[] in
- base64_decode() in mime.c.
- From: Kurt....@rus.uni-stuttgart.de
-
- Fixed type casting problem with BSD 4.4 derivatives in mime.c.
- From: Andrey A. Chernov <ac...@astral.msk.su>
-
- KOI8-R added as a valid compat charset.
- From: Andrey A. Chernov <ac...@astral.msk.su>
-
- builtin++ now wraps the line at the number of columns on the screen, not
- one character before. NewLine() apparently "does the right thing" and
- doesn't print an extra line if the last character is in the last column.
- From: Kari Hurtta <Kari....@fmi.fi>
-
- The arrow keys now do what they did before instead of controlling the
- bultin++ pager.
-
- builtin++ always clears the screen before displaying the next (or
- previous) page.
-
- The length of a line in the cache for builtin++ is increased to 150
- chars because the old value of 128 didn't work with hpterms with a
- width of 134 chars.
-
- Fixed problem where Elm would SIGBUS if you tried to use the
- attachments menu in an empty folder.
- From: Kari Hurtta <Kari....@fmi.fi>
-
- buf[STRING] was too short in AttachmentMenu() and caused certain Elm to
- bomb out on certain messages which had header lines which were too
- long.
-
- AddLineToCache() can now handle multiline input. This meant that
- calls to it from metapager had to remove the trailing newlines.
-
- Changed the MIME mini-header format in metapager().
-
- attach_edit() looks more like header_edit() now. Makes the interface
- more consistent.
-
- lib/getrealname.c needed <ctype.h> on older BSD systems.
-
- Fixed nasty bug where the blank line in between the headers and the body
- of a NEW message would get deleted when resync'ing in the spool folder.
-
- Fixed infinite loop in Configure when run with the -d option.
-
- ----------------
- Changes from ME5
- ----------------
-
- Added the DoAll() call so that the keyword "all" can be used when tagging
- or deleting.
-
- Decoupled PGP and MIME support such that you don't need MIME to use PGP.
-
- Added lots of error checking code in metapager.c.
- From: g...@netapp.com (Guy Harris).
-
- Fixed bug in quoted_printable_decode() where I did not convert read
- characters to base16.
-
- Added hex() function to protect index_hex from bad values.
-
- metapager() prompts for a command if necessary after running the external
- pager, just as Elm used to do.
-
- Fixed the From: line in write_header_info() where I broke it before.
-
- Fixed bug where the MIME multipart boundary would be written after the
- MMDF separator when copy=ON and the message was being copied to the user's
- desired folder.
-
- Added an "Attachments" menu in verify_transmission() for including
- attachments. This works in addition to the current method of using
- "[include ..."
-
- Elm now directly supports writing of BASE64 and QUOTED-PRINTABLE
- encodings.
-
- Changed the return value of match_address() to be zero, since it
- returns an int, and NULL is not always an int.
- From: Michael Shields <shi...@tembel.org>
-
- AttachViewer() now uses notplain() to determine whether or not
- metamail is needed to view the message.
- From: Guy Harris <g...@netapp.com>
-
- needs_mmdecode() now takes the integer version of the encoding rather
- than a string. This avoids parsing the string twice.
- From: Guy Harris <g...@netapp.com>
-
- Elm now checks outgoing messages to see if there are any non-printable
- characters, and if so encodes the message QUOTED-PRINTABLE.
-
- Cleaned up PGP code by moving more code to pgp.c so that other files
- require less modification (ie. the diffs will be simpler).
-
- Fixed showmsg.c so that it passes anything that doesn't require metamail
- to the metapager. This fixed the problem where messages with no
- Mime-Version header but had a Content-Type header wouldn't get displayed.
- From: Guy Harris <g...@netapp.com>
-
- Fixed bug in dispaddr.c so that if a message is from the user, it will
- always use the TO address to display.
-
- Moved get_real_name() to its own file in lib so it can be used by
- dispaddr.c.
-
- Modified get_real_name() so that if it sees an address like
- "<elk...@aero.org>" it will return "elk...@aero.org" instead of a zero
- length string.
-
- ----------------
- Changes from ME4
- ----------------
-
- Introduced the "metapager". It replaces most of the code in showmsg.c.
- It also takes care of all the MIME and PGP functions the bultin++ pager
- used to perform, so that the user doesn't have to use builtin++ in those
- cases.
-
- PGP decrypting function was rewritten using pipes so no temp files are
- required!
-
- The attachment handling code was modified to handle multiline content-type
- headers generate by such mailers as zmailer. It also looks through each
- modifier in the line intead of just assuming that the boundary field will
- be the first.
- From: g...@netapp.com (Guy Harris)
-
- The "command" status line in the builtin++ pager now floats around instead
- of always being on the bottom. This was done to facilitate the ^L in
- the pager so it didn't look stupid.
-
- Moved the MIME QUOTED-PRINTABLE and BASE64 decoding code to mime.c so it
- can be shared.
-
- Fixed copy_message() so that it will automatically decode MIME B64 and QP
- encodings. This means that replies to these types of messages do what the
- user will expect.
-
- ----------------
- Changes from ME3
- ----------------
-
- Fixed problems in builtin++.c and pgp.c where I used the return value
- from sprintf() as a char* when in SYSV systems it returns an int.
- This caused Elm to seg fault while decrypting messages.
-
- Configure now asks about PGP support and automatically sets up
- config.h. Thanks to Ken Cox (ke...@viewlogic.com) for additional help.
-
- PGP messages are now automatically decrypted when replying if
- usepgppass = ON.
-
- Back to using the application/pgp format content-type. Use
- format=keys-only for send a public key block.
-
- PGPCall() now uses the pgp option +encrypttoself=on instead of tacking
- the username on the end of the TO list.
-
- Fixed problem where any messages after sending a PGP public key had
- the key text included before the included message text.
-
- Use rename() if availible instead of copying the file in PGPCall().
- Otherwise use link(), unlink(). This should be a little more
- efficient.
-
- pgp is now called with the -w (wipe) option when encrypting.
-
- builtin++ can now handle text which is QUOTED-PRINTABLE or BASE64
- encoded.
-
- Fixed bug where the last line of messages was not being printed.
-
- Elm will no longer seg fault if you hit return without entering your
- PGP passphrase.
-
- Discovered the +batchmode option for pgp. This makes dealing with
- incorrect passphrases much easier!
-
- Fixed bug in builtin++ where the last line of pgp messages would be
- printed more than once while at the end of the message under certain
- circumstances.
-
- Changed notplain() in mime.c to support message/* content-type.
-
- Cleaned up the multipart handling by removing the boundary string from
- header_rec to conserve memory. This is now handled by builtin++ and
- AttachMenu().
-
- builtin++ can now handle multipart/digest correctly.
-
- SaveAttach() no longer needs to call metamail to decode QUOTED-PRINTABLE
- or BASE64 encodings.
-
- -----------------
- Changes from ME2a
- -----------------
-
- Elm will now keep track of your PGP passphrase for your RSA secret key.
- To use this feature, add the line "usepgppass = ON" to your .elmrc.
- There is also a timeout feature which will cause Elm to "forget" your
- passphrase after so many seconds if you don't use it. The default is
- 300 seconds, but this can be changes by setting the variable
- "keeppassfor" in your .elmrc.
-
- The builtin++ pager was completely rewritten (again) so that it can now
- handle normal messages, MIME multipart messages, automatic decryption
- and automatic signature checking for PGP messages. It also seems to be
- lacking some of the memory allocation bugs that the previous pager had.
-
- Fixed a bug in DynamicArray() which causes DestroyDynamicArray() to
- seg fault if exactly max+n elements were allocated. (w...@recco.de)
-
- ----------------
- Changes from ME2
- ----------------
-
- It is now possible to delete all "tagged" messages by entering "tagged"
- as the pattern to match after typing <control>-d (^D).
-
- fixed a bug in the limit command where you could not "un"limit the
- display of headers. Thanks to g...@netapp.com (Guy Harris) for
- pointing it out!
-
- fixed a bug in is_multipart() where the "boundary" token match was
- case-sensitive.
--- 0 ----
Index: elmME+.2.5.alpha0-cvs/Changes
*** elm2.4.ME+.115/Changes 2002-01-26 13:14:44.000000000 +0200


--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************

*** 1,101 ****
-
- This Changes is for the 2.4 version.
-
- Look file README.ME+ for changes of the 2.4ME+ version.
-
- --------------------------------------------------------------------------
- This file describes major changes made to the Elm source distribution
- between Releases 2.3 and 2.4. Please remember that Elm is a volunteer
- project, we did what we had time for, and perhaps, what interested us.
- If you have a suggestion, or a fix, submit it, and better yet,
- volunteer to implement it.
-
- Syd Weinstein Sat Oct 3 16:55:49 EDT 1992
-
- Drop all routing options and let the smart Mail Transport Agent route mail.
-
- Completely new alias subsystem.
-
- Support for NLS, LOCALE and message catalogs.
-
- Quoted string support to allow for X.400 type addresses.
-
- Support for MIME via metamail
-
- Support for Content-Length and Content-type
-
- Enhanced Configure Script
-
- Added -f flag to filter for alternate rules file
-
- Add sender to filter
-
- implements a -q flag to filter to quiet any logging of filtering actions.
-
- More intelligent make install target include better support for man pages
-
- User definable Options Screen
-
- System Wide Elmrc File (Allows binary distribution of Elm)
-
- implement a ucb mail like metoo option in elm.
-
- Split the common routines to a lib directory
-
- Allow using ~ for home directory in filter rules file
-
- Changed save_message to fork/setgid in order to save
- message with user's group id instead of mail group id.
-
- Change filter command to not look at $MAIL as it may be
- run from sendmail on some systems and $MAIL is set from the
- environment of the sender of the mail. Result was delivery
- of mail to the mailbox of the author of the mail instead of
- the intended user.
-
- new locking method - allow both fcntl and flock in Filter and Elm
-
- Detect when there are too many filter rules and exit gracefully.
-
- Reimplemented readmsg utility. Obsoleted "readmsg_file" and
- introduced "temp_state" file and "ELMSTATE" environment parameter.
- This allows readmsg to understand the current 'sorted' order of the
- Elm display, when run while Elm is running.
-
- Change date parsing, now uses Numeric TZ and sorting is now TZ aware.
-
- Add resize support, only at the top level, and no minimum size enforcement.
-
- add an option, -i, to use the mentioned file as an inclusion, i.e. the
- edit session starts out with that file as its text. Allows Elm to be
- used as a mailer from news readers.
-
- Change in method of reading/writing files to allow for nulls in the
- file and better catching of errors on writes such as file system full.
-
- Add ti/te framing for Sun console
-
- add change to folder based on alias (where messages to that folder would
- be stored)
-
- allow the user to save to the 'most-recently-used-folder'
-
- Disable stop processing while writing back spool to avoid
- stop causing a corrupted/long locked spool file
-
- Changes to allow clearing the weed-out list yet not totally
- invalidating all the existing elmrc files.
-
- Add - to allow fastmail to read from stdin
-
- Make frm's exit status more meaningful, add much new functionality,
- including the ability to recognize when a message is old, new, or
- unread, and when mail is really "To" somebody else.
-
- Change newmail to not keep files open to prevent systems with read
- locks from appending to the file. Add print_prefix to force printing
- the prefix if specified and only one folder being monitored.
-
- And many bug fixes.
-
- ************************************************************************
--- 0 ----
Index: elmME+.2.5.alpha0-cvs/Configure
*** elm2.4.ME+.115/Configure 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/Configure 2004-05-16 15:26:42.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150 2004/03/27 18:31:35 hurtta Exp $
#


: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150.8.6 2004/05/16 12:26:42 hurtta Exp $
#

: sanity checks
***************
*** 552,558 ****
locale_dir=''
CONFIG=''
: set package name
! package=elm2.4me+

echo " "
echo "Beginning of configuration questions for $package kit."
--- 552,558 ----
locale_dir=''
CONFIG=''
: set package name
! package=elmme+2.5

echo " "
echo "Beginning of configuration questions for $package kit."
***************
*** 777,782 ****
--- 777,783 ----
echo $n "$rp $c"
. myread

+ save_package="$package"
if test "$config" != "" ; then
echo "Fetching default answers from your old $config file..."
. ../$config
***************
*** 800,805 ****
--- 801,819 ----
esac
fi

+ if test "$save_package" != "$package" ; then
+
+ echo
+ echo "WARNING! Saved configuration is for $package and not for $save_package"
+ echo
+ sleep 5
+
+ # FIX paths
+ stage_dir="`echo \"$stage_dir\" | sed \"s/$package/$save_package/\"`"
+
+ package="$save_package"
+ fi
+
cat <<EOH

If you want Configure to search programs from some unusual directory first,
***************
*** 6351,6357 ****

cp ../lib/get_tz.c try.c 2>/dev/null \
|| $echo "Oh no! I cannot find the \"lib/get_tz.c\" file."
! cat >headers.h <<EOF
#$i_time I_TIME
#$i_systime I_SYSTIME
#include <stdio.h>
--- 6365,6371 ----

cp ../lib/get_tz.c try.c 2>/dev/null \
|| $echo "Oh no! I cannot find the \"lib/get_tz.c\" file."
! cat >elm_defs.h <<EOF
#$i_time I_TIME
#$i_systime I_SYSTIME
#include <stdio.h>
***************
*** 6798,6803 ****
--- 6812,6824 ----
done

: config.sh is needed by ConfTool/GenCharmap
+ : Also config.h and hdrs/sysdefs.h
+
+ (
+ . config.sh
+ ( . config.h.SH )
+ ( cd hdrs ; . sysdefs.SH )
+ )

$cat <<EOF

Index: elmME+.2.5.alpha0-cvs/ConfTool/Makefile
*** elm2.4.ME+.115/ConfTool/Makefile 2002-01-26 13:14:44.000000000 +0200
--- elmME+.2.5.alpha0-cvs/ConfTool/Makefile 2004-04-18 19:55:35.000000000 +0300
***************
*** 4,12 ****
validcharset: validcharset.o precompiled_sets.o istrcmp.o
$(CC) $(CFLAGS) -o $@ validcharset.o precompiled_sets.o istrcmp.o

! validcharset.o: ../hdrs/defs.h ../hdrs/elmlib.h ../hdrs/cs_imp.h

! precompiled_sets.o: ../hdrs/defs.h ../hdrs/elmlib.h ../hdrs/cs_imp.h

istrcmp.o: ../hdrs/headers.h

--- 4,12 ----
validcharset: validcharset.o precompiled_sets.o istrcmp.o
$(CC) $(CFLAGS) -o $@ validcharset.o precompiled_sets.o istrcmp.o

! validcharset.o: ../hdrs/elm_defs.h ../hdrs/elmlib.h ../hdrs/cs_imp.h

! precompiled_sets.o: ../hdrs/elm_defs.h ../hdrs/elmlib.h ../hdrs/cs_imp.h

istrcmp.o: ../hdrs/headers.h

Index: elmME+.2.5.alpha0-cvs/ConfTool/validcharset.c
*** elm2.4.ME+.115/ConfTool/validcharset.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/ConfTool/validcharset.c 2004-04-18 19:55:35.000000000 +0300
***************
*** 1,7 ****

#include <stdio.h>
! #include "defs.h"
! #include "elmlib.h"
#include "cs_imp.h"

struct charset_type cs_ascii;
--- 1,6 ----

#include <stdio.h>
! #include "elm_defs.h"
#include "cs_imp.h"

struct charset_type cs_ascii;
Index: elmME+.2.5.alpha0-cvs/doc/answer.1
*** elm2.4.ME+.115/doc/answer.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/answer.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ANSWER 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
answer - phone message transcription system
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ANSWER 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
answer - phone message transcription system
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/chkalias.1
*** elm2.4.ME+.115/doc/chkalias.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/chkalias.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH CHECKALIAS 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
checkalias - check to see if an alias is defined.
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH CHECKALIAS 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
checkalias - check to see if an alias is defined.
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/elm.1
*** elm2.4.ME+.115/doc/elm.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elm.1 2004-05-16 16:50:00.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELM 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
elm - an interactive mail system
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELM 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
elm - an interactive mail system
.SH SYNOPSIS
***************
*** 260,265 ****
--- 260,267 ----


.SH COPYRIGHTS
\fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br

+ Based on Elm 2.5, \fB\*(ct\fRCopyright 1988-1995 by The USENET Community Trust
+ .br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
Derived from Elm 2.0, \fB\*(ct\fR Copyright 1986, 1987 by Dave Taylor
Index: elmME+.2.5.alpha0-cvs/doc/elmalias.1
*** elm2.4.ME+.115/doc/elmalias.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elmalias.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELMALIAS 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
elmalias - expand and display Elm address aliases
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELMALIAS 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
elmalias - expand and display Elm address aliases
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/elmbindata.1
*** elm2.4.ME+.115/doc/elmbindata.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elmbindata.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELMBINDATA 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
elmbindata -
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELMBINDATA 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
elmbindata -
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/elmcharset.1
*** elm2.4.ME+.115/doc/elmcharset.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elmcharset.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELMCHARSET 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
elmcharset -
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELMCHARSET 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
elmcharset -
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/elm-help.0
*** elm2.4.ME+.115/doc/elm-help.0 2003-11-15 18:19:06.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elm-help.0 2004-05-16 08:54:27.000000000 +0300
***************
*** 1,5 ****

! Command Elm 2.4ME+ Action

<RETURN>,<SPACE> Display current message
| Pipe current message or tagged messages to
--- 1,5 ----

! Command Elm ME+ 2.5 Action

<RETURN>,<SPACE> Display current message
| Pipe current message or tagged messages to
***************
*** 37,42 ****
--- 37,43 ----
k, <UP> Advance to previous undeleted message
l Limit messages by specified criteria
^L Redraw screen
+ M Toggle the display of mailing list info
m Mail a message
n Next message, displaying current,
then increment
Index: elmME+.2.5.alpha0-cvs/doc/elmlibregister.1
*** elm2.4.ME+.115/doc/elmlibregister.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elmlibregister.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELMLIBREGISTER 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME


elmlibregister - Registry of elm libraries to use-library line on elm.rc

.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELMLIBREGISTER 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME


elmlibregister - Registry of elm libraries to use-library line on elm.rc

.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/elmrc-info
*** elm2.4.ME+.115/doc/elmrc-info 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/doc/elmrc-info 2004-05-15 23:11:35.000000000 +0300
***************
*** 1,5 ****


! #@(#)$Id: elmrc-info,v 1.61 2004/04/04 16:42:27 hurtta Exp $

! # Elm Version 2.4ME+


#
#$HDR - magic line to mark comments to put at top of user's elmrc file.

#
--- 1,5 ----
! #@(#)$Id: elmrc-info,v 1.61.2.12 2004/05/15 20:11:35 hurtta Exp $
! # Elm Version ME+ 2.5


#
#$HDR - magic line to mark comments to put at top of user's elmrc file.

#
***************
*** 114,124 ****
escape
# the character to use in the builtin editor for entering commands

extra-mailbox-dir
! # Folders on that directory is considered to be mailboxes
# (ie. it is prepared that to they is arrived new mail when
# they are open). This directory must be different than
# folders or maildir directory (ie. ~/Mail).

send-mime-plain-text
# When set, Text/Plain with charset US-ASCII is sent with MIME headers.
--- 114,135 ----
escape
# the character to use in the builtin editor for entering commands

+ editflush
+ # Flush the input buffer after returning from an external editor?
+
extra-mailbox-dir
! # Folders on that directory is considered to be spool mailboxes
# (ie. it is prepared that to they is arrived new mail when
# they are open). This directory must be different than
# folders or maildir directory (ie. ~/Mail).
+ #
+ # See also: incomingfolders
+
+ incomingfolders
+ # List of folders which are incoming folders. Incoming folders are
+ # handled like your spool mailbox.
+ #
+ # See also: extra-mailbox-dir

send-mime-plain-text
# When set, Text/Plain with charset US-ASCII is sent with MIME headers.
***************
*** 138,157 ****
# What is maximum time in days between mails so that
# they can considered to be same thread (when subject is same)

aliassortby
# how to sort the alias list, "Name" by default

print
# how to print a message ('%s' is the filename)

attribution
! # attribution string for replies ('%s' is the author of original message)

prefix
# prefix sequence for indenting included message text in outgoing messages...

weedout
# what headers I DON'T want to see, ever.

bounceback
# threshold for bouncing copies of remote uucp messages...
--- 149,200 ----
# What is maximum time in days between mails so that
# they can considered to be same thread (when subject is same)

+ showmlists
+ # Should mailing list info be displayed for messages at startup?
+ # The "M" command toggles this on and off.
+
+ tochars
+ # When "showmlists" is off, a single-character mark is displayed
+ # to indicate who the message is to. This five-character string
+ # defines the values to use for the mark. The five characters are:
+ # - Mark for mail to you and nobody else.
+ # - Mark for mail to you and other recipients.
+ # - Mark for mail to multiple recipients, and you are on the CC list.
+ # - Mark for mail not addressed directly to you (e.g. mailing lists)
+ # - Mark for mail which have List-Id header (ie. mailing list identification)
+ # An underscore "_" in this list will display as a blank.
+ # the default value is _TC*L
+ #
+
+
+
aliassortby
# how to sort the alias list, "Name" by default

print
# how to print a message ('%s' is the filename)

+ printhdrs
+ # List of headers to select and weed when printing messages.
+ #
+ # NOTE: This is used with p)rint -command (disabled)
+ # and not with P)rint text command
+
attribution
! # Attribution string for replies. "%F" is the author of original message.
!
! fwdattribution
! # Attribution for forwarded messages. "%F" is original author.
! # Something like: "--- %[begin|end] forwarded message from %F ---"

prefix
# prefix sequence for indenting included message text in outgoing messages...

weedout
# what headers I DON'T want to see, ever.
+ #
+ # If first element on list is "*clear-weed-list*" then builtin
+ # weedout list is not used.

bounceback
# threshold for bouncing copies of remote uucp messages...
***************
*** 163,168 ****
--- 206,218 ----
autocopy
# automatically copy message being replied to into buffer?

+ askreplycopy
+ # When replying to a message, ask "Copy message?" into editing buffer?
+ # If OFF, then the "replycopy" action is taken without asking.
+
+ replycopy
+ # Should the default for the "Copy message?" question be "yes"?
+
copy
# save a copy of all outbound messages?

***************
*** 251,256 ****
--- 301,309 ----
titles
# display message title when displaying pages of message?

+ savebyalias
+ # Save messages, incoming and outbound, by alias of sender/recipient?
+
savename
# save messages, incoming and outbound, by login name of sender/recipient?

***************
*** 274,279 ****
--- 327,335 ----
pointnew
# start up by pointing to the first new message received, if possible?

+ showreply
+ # Should messages to which you've replied be shown with an "r" mark?
+
set-window-title
# Enables automatic updating of window's tile and incon name when
# folder is changed. File ~/.elm/terminal.info or global elm.terminalinfo
***************
*** 376,381 ****
--- 432,452 ----
# auto-answered(OFF) with the default answers when we resync or
# change folders?

+ askdelete
+ # Should the "Delete messages?" question be asked when you exit, resync,
+ # or change folders? If OFF, then the "alwaysdelete" action is taken
+ # without asking.
+
+ askkeep
+ # Should the "Keep unread messages in incoming mailbox?" question be
+ # asked when you exit, resync, or change folders? If OFF, then the
+ # "alwayskeep" action is taken without asking.
+
+ askstore
+ # Should the "Move read messages to received folder?" question be asked
+ # when you exit, resync, or change folders? If OFF, then the "alwaysstore"
+ # action is taken without asking.
+
askcc
# would you like to be asked for Carbon-Copies information each msg?

***************
*** 537,542 ****
--- 608,617 ----
# This is used only for folders in the user's mail directory and
# does not affect ordinary files.

+ confirmtagsave
+ # Should Elm ask for confirmation before saving tagged messages to a
+ # folder when the cursor is on an untagged message?
+
convert-comment-to-fullname
# Elm 2.4ME+ PL55 parses addresses like:
# fullname <address>
***************
*** 860,862 ****
--- 935,940 ----
# (for example $MAILCAPS). Value of variables is splitted only from ':'
# (quotes and spaces are not treated specially.)
# See also: internal-mailcaps
+
+ allow-setuid
+ # If set, running Elm as setuid is not prevented.
Index: elmME+.2.5.alpha0-cvs/doc/elmrc-write.1
*** elm2.4.ME+.115/doc/elmrc-write.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elmrc-write.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELMRC-WRITE 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
elmrc-write -
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELMRC-WRITE 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
elmrc-write -
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/elmregister.1
*** elm2.4.ME+.115/doc/elmregister.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elmregister.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELMREGISTER 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
elmregister - Elm 2.4ME+ installation and uninstallation engine
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELMREGISTER 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
elmregister - Elm 2.4ME+ installation and uninstallation engine
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/elmstringconvert.1
*** elm2.4.ME+.115/doc/elmstringconvert.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elmstringconvert.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELMSTRINGCONVERT 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
elmstringconvert - Convert strings (lines) from one charset to another
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELMSTRINGCONVERT 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
elmstringconvert - Convert strings (lines) from one charset to another
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/elmterminal.1
*** elm2.4.ME+.115/doc/elmterminal.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elmterminal.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELMTERMINAL 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
elmterminal -
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELMTERMINAL 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
elmterminal -
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/elmunidata.1
*** elm2.4.ME+.115/doc/elmunidata.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/elmunidata.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH ELMUNIDATA 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
elmunidata -
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH ELMUNIDATA 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
elmunidata -
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/fastmail.1
*** elm2.4.ME+.115/doc/fastmail.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/fastmail.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH FASTMAIL 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
fastmail - quick batch mail interface to a single address
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH FASTMAIL 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
fastmail - quick batch mail interface to a single address
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/frm.1
*** elm2.4.ME+.115/doc/frm.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/frm.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH FRM 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
frm,nfrm \- list from and subject of selected messages in mailbox or folder
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH FRM 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
frm,nfrm \- list from and subject of selected messages in mailbox or folder
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/listalias.1
*** elm2.4.ME+.115/doc/listalias.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/listalias.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH LISTALIAS 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
listalias - list user and system aliases
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH LISTALIAS 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
listalias - list user and system aliases
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/messages.1
*** elm2.4.ME+.115/doc/messages.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/messages.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH MESSAGES 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
messages - quick count of messages in mailbox or folder
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH MESSAGES 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
messages - quick count of messages in mailbox or folder
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/newalias.1
*** elm2.4.ME+.115/doc/newalias.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/newalias.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH NEWALIAS 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
newalias - install new elm aliases for user and/or system
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH NEWALIAS 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
newalias - install new elm aliases for user and/or system
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/newmail.1
*** elm2.4.ME+.115/doc/newmail.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/newmail.1 2004-05-16 17:10:19.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH NEWMAIL 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
newmail,wnewmail - programs to asynchronously notify of new mail
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH NEWMAIL 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
newmail,wnewmail - programs to asynchronously notify of new mail
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/printmail.1
*** elm2.4.ME+.115/doc/printmail.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/printmail.1 2004-05-16 17:10:20.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH PRINTMAIL 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
printmail - format mail in a readable fashion for printing
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH PRINTMAIL 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
printmail - format mail in a readable fashion for printing
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/prlong.1
*** elm2.4.ME+.115/doc/prlong.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/prlong.1 2004-05-16 17:10:20.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH PRLONG 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
prlong - Format large amounts of output, folding across multiple lines.
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH PRLONG 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
prlong - Format large amounts of output, folding across multiple lines.
.SH SYNOPSIS
Index: elmME+.2.5.alpha0-cvs/doc/readmsg.1
*** elm2.4.ME+.115/doc/readmsg.1 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/doc/readmsg.1 2004-05-16 17:10:20.000000000 +0300
***************
*** 4,10 ****
.if t \{\
. ds ct \\(co
.\}
! .TH READMSG 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
readmsg - extract messages from a mail folder
.SH SYNOPSIS
--- 4,10 ----
.if t \{\
. ds ct \\(co
.\}
! .TH READMSG 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME
readmsg - extract messages from a mail folder
.SH SYNOPSIS
***************
*** 76,81 ****
--- 76,86 ----
.I folder
can be a filename or a specification such as ``=sentmail''.
.P
+ The
+ .B \-w
+ flag tailors the list of mail headers that are weeded and displayed.
+ Header weeding is discussed below.
+ .P
The \fB-h\fR flag instructs the program to include the entire header
of the matched message or messages when displaying their
text. (default is to display the From: Date: and Subject: lines
***************
*** 127,132 ****
--- 132,174 ----
the
.I elm
message index screen.
+ .P
+ Normally,
+ .I readmsg
+ selects and displays certain headers from the message. By default,
+ the list of selected headers includes:
+ .P
+ .RS
+ .nf
+ \(bu The ``Subject:'' header.
+ \(bu The ``From:'' header.
+ \(bu The ``To:'' header.
+ \(bu The ``Cc:'' header.
+ \(bu The ``Date:'' header.
+ \(bu Any header starting with ``Apparently-''.
+ .fi
+ .RE
+ .P
+ The header weeding may be changed with the
+ .B \-w
+ option. The argument to this option is a list of header names,
+ separated by whitespace or commas.
+ .I readmsg
+ compares each header to the ones in this list, and if a match is found
+ the header is displayed. The list entries can contain partial header
+ names. For instance, an entry of ``From'' would match both the
+ ``From\s-1<SPACE>\s0'' line at the top of the message, as well as any
+ ``From:'' header. Matching is case insensitive. An underscore (``_'')
+ may be used to represent a space, so specifying ``From_'' will select
+ the ``From\s-1<SPACE>\s0'' line but not the ``From:'' header. A list
+ entry may be preceded by an exclamation point to suppress the header.
+ Thus, a specification of ``!From_\0From'' means about the same thing
+ as ``From:''. When no header weeding options are specified, the
+ default action corresponds to:
+ .P
+ .ft CW
+ readmsg -w "Subject: From: To: Cc: Apparently- Date:"
+ .ft 1
.SH "EXAMPLES"
First off, to use this from within \fBvi\fR to include the text of the
current message, you could use the command:
***************
*** 199,205 ****
.SH BUG REPORTS TO


Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
--- 241,249 ----
.SH BUG REPORTS TO


Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
! .br
! Based on Elm 2.5, \fB\*(ct\fRCopyright 1988-1995 by The USENET Community Trust
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
Index: elmME+.2.5.alpha0-cvs/hdrs/defs.h
*** elm2.4.ME+.115/hdrs/defs.h 2004-03-30 19:38:43.000000000 +0300


--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************

*** 1,731 ****
- /* $Id: defs.h,v 1.45 2004/03/27 18:31:35 hurtta Exp $ */
-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $
- *
- * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
- * (was hurtt...@ozone.FMI.FI)


- ******************************************************************************
- * The Elm Mail System
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor

- *****************************************************************************/
-
- /** define file for ELM mail system. **/
-
- #include "defs_major.h"
-
- #ifdef USE_FCNTL_LOCKING
- # define SYSCALL_LOCKING
- #else
- # ifdef USE_FLOCK_LOCKING
- # define SYSCALL_LOCKING


- # endif
- #endif
-
-

- /*
- #undef const
- #undef volatile
- */
-
- #define KLICK 25
-
- #define SHORT 10 /* super short strings! */
- #define NLEN 48 /* name length for aliases */
- #define WLEN 20
- #define STRING 128 /* reasonable string length for most.. */
- #define LONG_STRING 512 /* even longer string for group expansion */
- #define VERY_LONG_STRING 2560 /* huge string for group alias expansion */
- #define MAX_LINE_LEN 5120 /* even bigger string for "filter" prog.. */
-
- #define BREAK '\0' /* default interrupt */
- #define BACKSPACE '\b' /* backspace character */
- #define TAB '\t' /* tab character */
- #define RETURN '\r' /* carriage return char */
- #define LINE_FEED '\n' /* line feed character */
- #define FORMFEED '\f' /* form feed (^L) char */
- #define COMMA ',' /* comma character */
- #define SPACE ' ' /* space character */
- #define DOT '.' /* period/dot character */
- #define BANG '!' /* exclaimation mark! */
- #define AT_SIGN '@' /* at-sign character */
- #define PERCENT '%' /* percent sign char. */
- #define COLON ':' /* the colon .. */
- #define BACKQUOTE '`' /* backquote character */
- #define TILDE_ESCAPE '~' /* escape character~ */
- #define ESCAPE '\033' /* the escape */
-
-
- #define NO_OP_COMMAND '\0' /* no-op for timeouts */
-
- #define READCH_MASK 0x0FFF /* Mask flags off */
- #define READCH_CURSOR 0x1000 /* Return cursor keys */
- #define READCH_NOCURSOR 0x2000 /* Disable cursor keys */
- #define READCH_term_char 0x4000 /* Return term chars */
- #define READCH_resize 0x8000 /* Check resize .... */
-
- #define REDRAW_MARK 257 /* Artificial "char" for redrawing */
- #define UP_MARK 258 /* Artificial UP key */
- #define LEFT_MARK 259 /* Artificial LEFT key */
- #define RIGHT_MARK 260 /* Artificial RIGHT key */
- #define DOWN_MARK 261 /* Artificial DOWN key */
- #define PAGEUP_MARK 262 /* Artificial PAGE UP key */
- #define PAGEDOWN_MARK 263 /* Artificial PAGE DOWN key */
- #define HELP_MARK 264 /* Artificial HELP key */
- #define HOME_MARK 265 /* Artificial HOME key */
- #define FIND_MARK 266 /* Artificial FIND key */
- #define SPACE_MARK 267 /* used by builtinplus */
- #define RESIZE_MARK 268 /* Used ny menu_context */
-
- #define TERMCH_backspace 300 /* term_char: backspace */
- #define TERMCH_kill_line 301
- #define TERMCH_word_erase 302
- #define TERMCH_interrupt_char 303
- #define TERMCH_reprint_char 304
- #define TERMCH_eof_char 305
-
- #define STANDARD_INPUT 0 /* file number of stdin */
-
- #ifndef TRUE
- #define TRUE 1
- #define FALSE 0
- #endif
-
- #define NO 0
- #define YES 1
- #define NO_TITE 2 /* ti/te or in flag */
- #define NO_CHARSET 4 /* charset switch flag */
- #define RAW_FROM_SIGNAL 8 /* From signal handler */
-
- #define MAYBE 2 /* a definite define, eh? */
- #define FORM 3 /* <nevermind> */
- #define PREFORMATTED 4 /* forwarded form... */
-
- #define SAME_PAGE 1 /* redraw current only */
- #define NEW_PAGE 2 /* redraw message list */
- #define ILLEGAL_PAGE 0 /* error in page list, punt */
-
- #define PAD 0 /* for printing name of */
- #define FULL 1 /* the sort we're using */
-
- #define OUTGOING 0 /* defines for lock file */
- #define INCOMING 1 /* creation..see lock() */
-
- /* options to the copy_message() procedure */
- #define CM_REMOVE_HEADER (1<<0) /* skip header of message */
- #define CM_UPDATE_STATUS (1<<2) /* Update Status: Header */
- #define CM_REMAIL (1<<4) /* Add Sender: and Orig-To: headers */
- #define CM_DECODE (1<<5) /* Decode MIME, PGP and elm */
- #define CM_FILT_HDR (1<<6) /* Filter headers (for forwarding) */
- #define CM_DISPLAYING (1<<7) /* Pass to MIME code */
- #define CM_REMOVE_ENVELOPE (1<<8) /* Remove envelope */
- #define CM_CRLF (1<<9) /* Use CRLF */
- #define CM_LF (1<<10) /* Force CRLF -> LF */
-
- /* Options for mail() procedure */
- #define MAIL_COPY_MSG (1<<0)
- #define MAIL_EDIT_MSG (1<<1)
- #define MAIL_ISFORM (1<<2)
- #define MAIL_REPLYING (1<<3)
- #define MAIL_FORWARDING (1<<4)
- #define MAIL_HAVE_ATTACHMENTS (1<<5) /* Flag for verify transmission */
- #define MAIL_HAVE_PGP_ENCODED (1<<6) /* Falg for verify transmission */
-
- /* xxx_ACCESS moved to down after including of unistd.h */
-
- #define BIG_NUM 999999 /* big number! */
- #define BIGGER_NUM 9999999 /* bigger number! */
-
- #define START_ENCODE "[encode]"
- #define END_ENCODE "[clear]"
-
- #define DONT_SAVE "[no save]"
- #define DONT_SAVE2 "[nosave]"
-
-
- /* They are used to support Grab_the_file in save() */
- #define FLOCKING_OK 0
- #define FLOCKING_RETRY 1
- #define FLOCKING_FAIL -1
-
- #define FOLDER_STATUS_READ 0
- #define FOLDER_STATUS_OLD 1
- #define FOLDER_STATUS_NEW 2
-
- #define alias_file ".aliases"
- #define group_file ".groups"
- #define system_file ".systems"
-
- #define default_folders "Mail"
- #define default_recvdmail "=received"
- #define default_sentmail "=sent"
-
- /* environment variable with name of folder state dump file */
- #define FOLDER_STATE_ENV "ELMSTATE"
-
- /** some defines for the 'userlevel' variable... **/
-
- #define RANK_AMATEUR 0
- #define AMATEUR 1
- #define OKAY_AT_IT 2
- #define GOOD_AT_IT 3
- #define EXPERT 4
- #define SUPER_AT_IT 5
-
- /** some defines for the "status" field of the header and alias record **/
-
- #define ACTION 1 /* bit masks, of course */
- #define CONFIDENTIAL 2
- #define DELETED 4
- #define EXPIRED 8
- #define FORM_LETTER 16
- #define NEW 32
- #define PRIVATE_MAIL 64
- #define TAGGED 128
- #define URGENT 256
- #define VISIBLE 512
- #define UNREAD 1024
- #define REPLIED 2048
- #define MIME_MESSAGE 4096 /* indicates existence of MIME Header */
- #define PRE_MIME_CONTENT 8192
- #define MIME_UNSUPPORTED 16384
- #define NOHDRENCODING 32768
- /* Don't add values bigger than 2^15 == 32768 */
-
- #ifdef USE_PGP
- #define PGP_MESSAGE 1
- #define PGP_SIGNED_MESSAGE 2
- #define PGP_PUBLIC_KEY 4
- #endif
-
- /** some defines for the "type" field of the alias record **/
-
- #define SYSTEM 1 /* bit masks, of course */
- #define USER 2
- #define PERSON 4
- #define GROUP 8
- #define DUPLICATE 16 /* system aliases only */
-
- /** some defines to aid in the limiting of alias displays **/
-
- #define BY_NAME 64
- #define BY_ALIAS 128
-
- #define UNDELETE 0 /* purely for ^U function... */
-
- /** values for headers exit_disposition field */
- #define UNSET 0
- #define KEEP 1
- #define STORE 2
- #define DELETE 3
- #define HIDE 4
-
- /** some months... **/
-
- #define JANUARY 0 /* months of the year */
- #define FEBRUARY 1
- #define MARCH 2
- #define APRIL 3
- #define MAY 4
- #define JUNE 5
- #define JULY 6
- #define AUGUST 7
- #define SEPTEMBER 8
- #define OCTOBER 9
- #define NOVEMBER 10
- #define DECEMBER 11
-
- #define equal(s,w) (strcmp(s,w) == 0)
- #define min(a,b) (a) < (b) ? (a) : (b)
- /*
- * Control character mapping like "c - 'A' + 1" does not work
- * correctly for a DEL. Neither does it allow mapping from
- * a control character to the letter that is normally used with
- * an up-arrow prefix to represent the control char.
- * The correct mapping should be done like this...
- */
- #define ctrl(c) (((c) + '@') & 0x7f)
-
- #define plural(n) n == 1 ? "" : "s"
- #define lastch(s) s[strlen(s)-1]
-
- #ifdef MEMCPY
-
- # ifdef I_MEMORY
- # include <memory.h>
- # else /* I_MEMORY */
- # ifndef ANSI_C /* ANSI puts these in string.h */
- #if defined(__convexc__)
- extern void *memcpy(), *memset();
- #else
- extern char *memcpy(), *memset();
- #endif
- extern int memcmp();
- # endif /* ANSI_C */
- # endif /* I_MEMORY */
-
- #define bcopy(s1,s2,l) memcpy(s2,s1,l)
- #define bcmp(s1,s2,l) memcmp(s1,s2,l)
- #define bzero(s,l) memset(s,0,l)
- #endif /* MEMCPY */
-
- #ifdef I_TIME
- # include <time.h>
- #endif
- #ifdef I_SYSTIME
- # include <sys/time.h>
- #endif
-
- #ifndef _POSIX_SOURCE
- extern struct tm *localtime();
- extern time_t time();
- #endif
-
-
- #if defined(SELECT) || defined(I_SYS_SELECT)
- #define POLL_METHOD 1
- #if defined(I_SYS_SELECT)
- #include <sys/select.h>
- #endif
- #else
- #if defined(POLL)
- #include <poll.h>
- #define POLL_METHOD 2
- #else
- #undef POLL_METHOD
- #endif
- #endif
-
-
- #ifdef I_SOCKET
- #include <sys/socket.h>
- #endif
- #ifdef I_NETDB
- #include <netdb.h>
- #if defined(SOCK_STREAM) && defined (POLL_METHOD)
- #define REMOTE_MBX
- #endif
- #endif
-
- /* find tab stops preceding or following a given column position 'a', where
- * the column position starts counting from 1, NOT 0!
- * The external integer "tabspacing" must be declared to use this. */
-
- /*
- #define prev_tab(a) (((((a-1)/tabspacing))*tabspacing)+1)
- #define next_tab(a) (((((a-1)/tabspacing)+1)*tabspacing)+1)
- */
-
- #define no_ret(s) { register int xyz; /* varname is for lint */ \
- for (xyz=strlen(s)-1; xyz >= 0 && \
- (s[xyz] == '\r' || s[xyz] == '\n'); ) \
- s[xyz--] = '\0'; \
- }
-
- #define first_word(s,w) (strncmp(s,w, strlen(w)) == 0)
- #define first_word_nc(s,w) (strincmp(s,w, strlen(w)) == 0)
- #define ClearLine(n) MoveCursor(n,0); CleartoEOLN()
- #define whitespace(c) (c == ' ' || c == '\t')
- #define ok_rc_char(c) (isalnum(c) || c == '-' || c == '_')
- #define ok_alias_char(c) (isalnum(c) || c == '-' || c == '_' || c == '.')
- #define onoff(n) (n == 0 ? "OFF" : "ON")
-
- /** The next function is so certain commands can be processed from the showmsg
- routine without rewriting the main menu in between... **/
-
- #define special(c) (c == 'j' || c == 'k')
-
- /** and a couple for dealing with status flags... **/
-
- #define ison(n,mask) (n & mask)
- #define isoff(n,mask) (!ison(n, mask))
-
- #define setit(n,mask) n |= mask
- #define clearit(n, mask) n &= ~mask
-
- /** a few for the usage of function keys... **/
-
- #define f_key1 1
- #define f_key2 2
- #define f_key3 3
- #define f_key4 4
- #define f_key5 5
- #define f_key6 6
- #define f_key7 7
- #define f_key8 8
-
- #define MAIN 0
- #define ALIAS 1
- #define YESNO 2
- #define CHANGE 3
- #define READ 4
-
- #define MAIN_HELP 0
- #define OPTIONS_HELP 1
- #define ALIAS_HELP 2
- #define PAGER_HELP 3
-
-
- /** some possible sort styles... **/
-
- #define REVERSE - /* for reverse sorting */
- #define SENT_DATE 1 /* the date message was sent */
- #define RECEIVED_DATE 2 /* the date message was received */
- #define SENDER 3 /* the name/address of sender */
- #define SIZE 4 /* the # of lines of the message */
- #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 THREAD 8 /* thread order (date sent/subject */
-
- /** some possible sort styles...for aliases **/
-
- #define ALIAS_SORT 1 /* the name of the alias */
- #define NAME_SORT 2 /* the actual name for the alias */
- #define TEXT_SORT 3 /* the order of aliases.text */
- #define LAST_ALIAS_SORT TEXT_SORT
-
- /* some stuff for our own malloc call - pmalloc */
-
- #define PMALLOC_THRESHOLD 256 /* if greater, then just use malloc */
- #define PMALLOC_BUFFER_SIZE 2048 /* internal [memory] buffer size... */
-
- /* Flags for classify_header in parse_util.c */
-
- #define HDR_TEXT 1
- #define HDR_STRUCTURED 2
- #define HDR_PHRASE 4
- #define HDR_COMMENT 8 /* inside of comment -- for rfc1522_encode_text */
-
- /** the following macro is as suggested by Larry McVoy. Thanks! **/
-
- #if 0
- # ifdef DEBUG
- # define dprint(n,x) do { \
- if (debug >= n && debugfile) { \
- fprintf x ; \
- fflush(debugfile); \
- } \
- } while(0)
- # else
- # define dprint(n,x)


- # endif
- #endif
-

- /* Values for dsn flag */
- #define DSN_FULL 1
- #define DSN_HDRS 2
- #define DSN_SUCCESS 4
- #define DSN_FAILURE 8
- #define DSN_DELAY 16
- #define DSN_NEVER 32
-
- /* some random structs... */
-
- #define NOTPLAIN_need_metamail 0x01
- #define NOTPLAIN_need_mailcap 0x02
- #define NOTPLAIN_canuse_mailcap 0x04
- #define NOTPLAIN_is_fallback 0x08
-
- #define MIME_magic 0xFD00
- typedef struct mimeinfo {
- unsigned short magic; /* MIME_magic */
- unsigned int disposition : 2; /* DISP_INLINE or DISP_ATTACH or
- DISP_AUTOATTACH
- */
-
- unsigned int mime_flags : 4; /* NOTPLAIN_need_metamail 0x01
- NOTPLAIN_need_mailcap 0x02
- NOTPLAIN_canuse_mailcap 0x04
- NOTPLAIN_is_fallback 0x08
- */
-
- unsigned int unlink : 1; /* used to mark that the file should be
- * unlinked after sending the attachment
- */
-
- struct media_type * TYPE;
- char *type_opts;
- char *disposition_opts;
- struct string *description;
-
- int encoding; /* Notice: ENCODING_ILLEGAL == -1, ENCODING_* in mime.h */
- long length;
- long begin_offset; /* the beginning of the attachment (includes headers) */
- long offset; /* where the real data starts */
-
- struct mime_parser_data * parser_data;
-
- struct mime_selected_handler * handler_data;
-
- /* These next fields are only used when sending multipart messages. */
- char * pathname;
- struct string * dispname;
-
- } mime_t;
-
- struct header_rec {
- int lines; /** # of lines in the message **/
- int status; /** Urgent, Deleted, Expired? **/
- int index_number_X; /** relative loc in file... **/
- int encrypted; /** whether msg has encryption **/
- int exit_disposition; /** whether to keep, store, delete **/
- int status_chgd; /** whether became read or old, etc. **/
- long content_length; /** content_length in bytes from message header **/
- long offset; /** offset in bytes of message **/
- time_t received_time; /** when elm received here **/
- char env_from[STRING]; /* sender from "From " */
- struct addr_item *from; /** who sent the message? **/
- struct addr_item *to; /** who it was sent to **/
- struct addr_item *cc;
- char messageid[STRING]; /** the Message-ID: value **/
- char time_zone[12]; /** incl. tz **/
- time_t time_sent; /** gmt when sent for sorting **/
- time_t thread_time; /** time sent of the "thread" (for sorting) **/
- char time_menu[SHORT]; /** just the month..day for menu **/
- time_t tz_offset; /** offset to gmt of time sent **/
- struct string *subject; /** The subject of the mail **/
- char mailx_status[WLEN];/** mailx status flags (RO...) **/
- mime_t mime_rec; /** MIME information for this message **/
-
- /* == charset_t, but it is not yet declared ... */
- struct charcode_info * header_charset; /* charset for headers ... */
- struct charcode_info * override_charset; /* For O)verride command */
-
- struct mbx_hdr_info * mbx_info;
-
- struct partial_vector * partial_vector;
- int partial_len;
-
- #ifdef USE_PGP
- unsigned int pgp : 3;
- #endif
- unsigned int binary :1; /* Binary message -- headers are terminated
- * with \r\n
- */
- unsigned int have_from :1; /* Body have unescaped "From " */
- unsigned int body_parsed :1; /* Whatever body of message is read */
- unsigned int mime_parsed :1; /* Whatever mime structure is parsed */
- };
-
- #if ANSI_C
- # include <stdarg.h>
- # define Va_start(a,b) va_start(a,b)
- #else
- # include <varargs.h>
- # define Va_start(a,b) va_start(a)
- #endif
-
- /* inttypes.h includes stdarg.h, so it conflicts with varargs.h
- *
- * varargs.h does not work in 64 bit IRIXes...
- */
-
- /* inttypes.h can't be used if it conflicts with sys/types.h
- *
- * unfortunately sys/types.h does not define uint16_t (in IRIX 5.3),
- * but including of inttypes.h causes compilation error!
- */
-
- #if defined(I_INTTYPES) && ANSI_C && !defined(NO_INTTYPES)
-
- #include <inttypes.h>
-
- /* For support 64 bit IRIXes also */
- #define int32 int32_t
- #define uint16 uint16_t
- #define uint8 uint8_t
-
- #else /* I_INTTYPES */
-
- #ifdef __alpha
-
- #define int32 int
- #define uint16 unsigned short /* is this correct? */
- #define uint8 unsigned char /* is this correct? */
- #else
-
- #define int32 long
- #define uint16 unsigned short
- #define uint8 unsigned char
- #endif
-
- #endif /* I_INTTYPES */
-
- struct alias_disk_rec {
- int32 status; /* DELETED, TAGGED, VISIBLE, ... */
- int32 alias; /* alias name */
- int32 last_name; /* actual personal (last) name */
- int32 name; /* actual personal name (first last) */
- int32 comment; /* comment, doesn't show in headers */
- int32 address; /* non expanded address */
- int32 type; /* mask-- sys/user, person/group */
- int32 length; /* length of alias data on file */
- };
-
- struct alias_rec {
- int status; /* DELETED, TAGGED, VISIBLE, ... */
- char *alias; /* alias name */
- char *last_name; /* actual personal (last) name */
- char *name; /* actual personal name (first last) */
- char *comment; /* comment, doesn't show in headers */
- char *address; /* non expanded address */
- int type; /* mask-- sys/user, person/group */
- long length; /* length of alias data on file */
- };
-
- struct addr_rec {
- char address[NLEN]; /* machine!user you get mail as */
- struct addr_rec *next; /* linked list pointer to next */
- };
-
-
- #ifdef SHORTNAMES /* map long names to shorter ones */
- # include <shortname.h>
- #endif
-
- /** Let's make sure that we're not going to have any annoying problems with
- int pointer sizes versus char pointer sizes by guaranteeing that every-
- thing vital is predefined... (Thanks go to Detlev Droege for this one)
- **/
-
- #ifdef __convex__
- /*
- * Nice work Convex people! Thanks a million!
- * When STDC is used feof() is defined as a true library routine
- * in the header files and moreover the library routine also leaks
- * royally. (It returns always 1!!) Consequently this macro is
- * unavoidable.)
- */
- # ifndef feof
- # define feof(p) ((p)->_flag&_IOEOF)


- # endif
- #endif
-

- /* Defined in unistd.h ... */
- #ifdef F_OK
- #define EXECUTE_ACCESS X_OK
- #define WRITE_ACCESS W_OK
- #define READ_ACCESS R_OK
- #define ACCESS_EXISTS F_OK
- #define EDIT_ACCESS (W_OK|R_OK)
- #else
- #define EXECUTE_ACCESS 1 /* These five are */
- #define WRITE_ACCESS 2 /* for the calls */
- #define READ_ACCESS 4 /* to access() */
- #define ACCESS_EXISTS 0 /* <etc> */
- #define EDIT_ACCESS 6 /* (this is r+w access) */
- #endif
-
- #ifdef I_LOCALE
- #include <locale.h>
- #endif
-
- #ifdef I_NL_TYPES
- #include <nl_types.h>
- #else
- #include "elm_nl_types.h"
- #endif
-
- #ifdef POSIX_SIGNALS
- #define signal posix_signal
- #ifdef ANSI_C
- extern SIGHAND_TYPE (*posix_signal(int, SIGHAND_TYPE (*)(int)))(int);
- #else /* ANSI_C */
- extern SIGHAND_TYPE (*posix_signal())();
- #endif /* ANSI_C */
- #else /* POSIX_SIGNALS */
- #ifdef SIGSET
- #define signal sigset
- #ifdef _AIX
- extern SIGHAND_TYPE (*sigset(int sig, SIGHAND_TYPE (*func)(int)))(int);
- #endif
- #endif /* SIGSET */
- #endif /* POSIX_SIGNALS */
-
- #if defined(POSIX_SIGNALS) && !defined(__386BSD__)
- # define JMP_BUF sigjmp_buf
- # define SETJMP(env) sigsetjmp((env), 1)
- # define LONGJMP(env,val) siglongjmp((env), (val))
- #else
- # define JMP_BUF jmp_buf
- # define SETJMP(env) setjmp(env)
- # define LONGJMP(env,val) longjmp((env), (val))
- #endif
-
- #if defined(POSIX_SIGNALS) && defined(HASWAITPID)
- #define BACKGROUD_PROCESSES /* Only with POSIX signals */


- #endif
-
- /*

- * Some of the old BSD ctype conversion macros corrupted characters.
- * We will substitute our own versions if required.
- */
- #include <ctype.h>
- #ifdef BROKE_CTYPE
- # undef toupper
- # define toupper(c) (islower(c) ? ((c) - 'a' + 'A') : (c))
- # undef tolower
- # define tolower(c) (isupper(c) ? ((c) - 'A' + 'a') : (c))


- #endif
-
- /*

- * if the seek constants arent set in an include file
- * lets define them ourselves
- */
- #ifndef SEEK_SET
- #define SEEK_SET 0 /* Set file pointer to "offset" */
- #define SEEK_CUR 1 /* Set file pointer to current plus "offset" */
- #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
- #endif
-
-
- /*
- * The "safe_malloc_fail_handler" vector points to a routine that is invoked
- * if one of the safe_malloc() routines fails. At startup, this will point
- * to the default handler that prints a diagnostic message and aborts. The
- * vector may be changed to install a different error handler.
- */
-
- char *ctime();
- char *error_description();
- char *expand_system();
- char *format_long();
- char *get_alias_address();
- char *get_arpa_date();
- char *get_ctime_date();
- char *get_date();
- char *get_token();
- char *getlogin();
- char *level_name();
- char *shift_lower();
- char *strip_commas();
- char *strip_parens();
- char *qstrpbrk();
- char *strfcpy();
- char *strtok();
- char *tail_of_string();
- char *tgetstr();
- char *pmalloc();
- char *header_cmp();
- char *safe_strdup();
-
- FILE *safeopen();
- FILE *safeopen_rdwr();
- FILE *open_end_update();
-
- malloc_t safe_malloc();
- malloc_t safe_realloc();
-
- long times();
- long ulimit();


-
- /*
- * Local Variables:
- * mode:c
- * c-basic-offset:4

- * buffer-file-coding-system: iso-8859-1


- * End:
- */

--- 0 ----
Index: elmME+.2.5.alpha0-cvs/hdrs/defs_major.h
*** elm2.4.ME+.115/hdrs/defs_major.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/defs_major.h 2004-04-18 19:55:35.000000000 +0300
***************
*** 1,7 ****
! /* $Id: defs_major.h,v 1.5 2004/03/27 18:31:35 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: defs_major.h,v 1.5.8.2 2004/04/18 16:55:35 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 24,30 ****
#include "../config.h"
#include "sysdefs.h" /* system/configurable defines */

! # define VERSION "2.4ME+" /* Version number... */

#if defined(__STDC__) || defined(_AIX)
# define ANSI_C 1
--- 24,30 ----
#include "../config.h"
#include "sysdefs.h" /* system/configurable defines */

! # define VERSION "ME+ 2.5" /* Version number... */

#if defined(__STDC__) || defined(_AIX)
# define ANSI_C 1
***************
*** 40,45 ****
--- 40,46 ----
#define P_(x) ()
#endif

+ /* FIXME: Change MALLOCVOID to ANSI_C */
#ifdef MALLOCVOID
typedef void * malloc_t;
#else
***************
*** 73,81 ****
--- 74,84 ----
#include <sys/wait.h>
#endif

+ /* FIXME: Change I_UNISTD to ANSI_C */
#ifdef I_UNISTD
#include <unistd.h>
#else
+ char *getlogin();
unsigned sleep();
char *index(), *rindex(); /* names will be traslated by define in config.h */
char *strcpy(), *strcat(), *strncpy(); /* more in string.h in ANSI */
Index: elmME+.2.5.alpha0-cvs/hdrs/elm_defs.h


*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300

--- elmME+.2.5.alpha0-cvs/hdrs/elm_defs.h 2004-05-15 23:11:35.000000000 +0300
***************
*** 0 ****
--- 1,620 ----
+ /* $Id: elm_defs.h,v 1.1.2.4 2004/05/15 20:11:35 hurtta Exp $ */
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.1.2.4 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ ******************************************************************************
+ * Based on Elm 2.4 hdrs/defs.h. That code was following copyright:
+ *
+ * The Elm Mail System

+ *
+ * Copyright (c) 1988-1992 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Based on Elm 2.5 hdrs/elm_defs.h. That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1998 USENET Community Trust


+ * Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************/
+

+ /** define file for ELM mail system. **/
+
+ #include "defs_major.h"


+
+ #include <errno.h>
+

+ #ifndef TRUE
+ #define TRUE 1
+ #define FALSE 0
+ #endif
+
+ #define KLICK 32 /* increment for alias and mssg lists */
+
+ #define SHORT 10 /* super short strings! */
+ /* FIXME: remove!! */
+
+ #define TLEN 10 /* super short (tiny) strings */
+ /* FIXME: not used yet */
+
+ #define WLEN 20 /* small words */
+ #define NLEN 48 /* name length for aliases */
+ #define STRING 128 /* reasonable string length for most.. */
+ #define LONG_STRING 512 /* even longer string for group expansion */
+ #define VERY_LONG_STRING 2560 /* huge string for group alias expansion */
+ #define MAX_LINE_LEN 5120 /* even bigger string for "filter" prog.. */
+
+ #define TILDE_ESCAPE '~' /* escape character~ */
+
+ #define alias_file ".aliases"
+ #define group_file ".groups"
+ #define system_file ".systems"
+
+ #define default_folders "Mail"
+ #define default_recvdmail "=received"
+ #define default_sentmail "=sent"
+ #define DEFAULT_TO_CHARS " TC*L"
+
+ #if 0 /* XXX not used yet */
+ #define streq(p, q) (strcmp((p), (q)) == 0)
+
+ /* use these ONLY where "d" is a constant string value */
+ #define strbegConst(s, d) (strncmp((s), (d), sizeof(d)-1) == 0)
+ #define stribegConst(s, d) (strincmp((s), (d), sizeof(d)-1) == 0)
+ #endif
+
+ #if 0 /* XXX not used yet */
+ /*
+ * The macros implement speeded up constant string comparisons.
+ * They are useful alternatives when a string is subject to
+ * multiple comparisons. The comparison target (the "d" value)
+ * *must* be a constant string, and the first character of this
+ * string *must* be upper case (or non-alphabetic).
+ *
+ * To use them, "FAST_COMP_DECLARE" must appear in variable declarations
+ * at the top of the procedure. Then "fast_comp_load" must be invoked
+ * to preload the first character of the string.
+ */
+ #define FAST_COMP_DECLARE int FAST_COMP_ch
+ #define fast_comp_load(c) FAST_COMP_ch = toupper(c)
+ #define fast_strbegConst(s, d) strbegConst(s, d)
+ #define fast_stribegConst(s, d) (FAST_COMP_ch == (d)[0] \
+ && strincmp((s), (d), sizeof(d)-1) == 0)
+ #define fast_header_cmp(s, d, result) (FAST_COMP_ch == (d)[0] \
+ && header_ncmp((s), (d), sizeof(d)-1, (result), sizeof(result)-1))
+ #endif
+
+ /*****************************************************************************
+ *
+ * System portability definitions, header inclusions, and brokeness unbotching.
+ *
+ ****************************************************************************/
+
+
+ #if 0 /* XXXX not implemented yet */
+ #ifdef HAS_SETEGID
+ #define SETGID(s) setegid(s)
+ #else
+ #define SETGID(s) setgid(s)
+ #endif
+ #endif
+
+ /* inttypes.h includes stdarg.h, so it conflicts with varargs.h
+ *
+ * varargs.h does not work in 64 bit IRIXes...
+ */
+
+ #if ANSI_C
+ # include <stdarg.h>
+ # define Va_start(a,b) va_start(a,b)
+ #else
+ # include <varargs.h>
+ # define Va_start(a,b) va_start(a)
+ #endif
+
+ /* inttypes.h can't be used if it conflicts with sys/types.h
+ *
+ * unfortunately sys/types.h does not define uint16_t (in IRIX 5.3),
+ * but including of inttypes.h causes compilation error!
+ */
+
+ #if defined(I_INTTYPES) && ANSI_C && !defined(NO_INTTYPES)
+
+ #include <inttypes.h>
+
+ /* For support 64 bit IRIXes also */
+ #define int32 int32_t
+ #define uint16 uint16_t
+ #define uint8 uint8_t
+
+ #else /* I_INTTYPES */
+
+ #ifdef __alpha
+
+ #define int32 int
+ #define uint16 unsigned short /* is this correct? */
+ #define uint8 unsigned char /* is this correct? */
+ #else
+
+ #define int32 long
+ #define uint16 unsigned short
+ #define uint8 unsigned char
+ #endif
+
+ #endif /* I_INTTYPES */
+
+ #ifdef CRAY
+ /* avoid conflict with typedef'd word */
+ #define word wrd
+ #endif /* CRAY */
+
+
+ #ifdef __convex__
+ /*
+ * Nice work Convex people! Thanks a million!
+ * When STDC is used feof() is defined as a true library routine
+ * in the header files and moreover the library routine also leaks
+ * royally. (It returns always 1!!) Consequently this macro is
+ * unavoidable.)
+ */
+ # ifndef feof
+ # define feof(p) ((p)->_flag&_IOEOF)


+ # endif
+ #endif
+

+ #if 0 /* XXX not used yet */
+ /*
+ * Ultrix's fflush returns EOF and sets error flag if the stream is read-only.
+ */
+ #if defined(ULTRIX_FFLUSH_BUG) && defined(ANSI_C)
+ # define fflush(fp) \
+ ((((fp)->_flag & (_IOREAD | _IORW)) == _IOREAD) ? 0 : fflush(fp))
+ #endif
+ #endif
+
+ #ifdef SHORTNAMES /* map long names to shorter ones */
+ # include <shortname.h>
+ #endif
+
+ #ifdef MEMCPY
+
+ # ifdef I_MEMORY
+ # include <memory.h>
+ # else /* I_MEMORY */
+ # ifndef ANSI_C /* ANSI puts these in string.h */
+ #if defined(__convexc__)
+ extern void *memcpy(), *memset();
+ #else
+ extern char *memcpy(), *memset();
+ #endif
+ extern int memcmp();
+ # endif /* ANSI_C */
+ # endif /* I_MEMORY */
+
+ #define bcopy(s1,s2,l) memcpy(s2,s1,l)
+ #define bcmp(s1,s2,l) memcmp(s1,s2,l)
+ #define bzero(s,l) memset(s,0,l)
+ #endif /* MEMCPY */
+
+ /*
+ * Some of the old BSD ctype conversion macros corrupted characters.
+ * We will substitute our own versions if required.
+ */
+ #include <ctype.h>
+ #ifdef BROKE_CTYPE
+ # undef toupper
+ # define toupper(c) (islower(c) ? ((c) - 'a' + 'A') : (c))
+ # undef tolower
+ # define tolower(c) (isupper(c) ? ((c) - 'A' + 'a') : (c))
+ #endif
+
+ /* things normally found in <unistd.h> */
+
+ #ifndef F_OK
+ # define F_OK 0
+ # define X_OK 1
+ # define W_OK 2
+ # define R_OK 4
+ #endif
+ #ifndef SEEK_SET
+ #define SEEK_SET 0 /* Set file pointer to "offset" */
+ #define SEEK_CUR 1 /* Set file pointer to current plus "offset" */
+ #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+ #endif
+ #ifndef STDIN_FILENO
+ # define STDIN_FILENO 0
+ # define STDOUT_FILENO 1
+ # define STDERR_FILENO 2
+ #endif
+
+ /* Elm likes to use these happy names instead */
+ #define ACCESS_EXISTS F_OK
+ #define EXECUTE_ACCESS X_OK
+ #define WRITE_ACCESS W_OK
+ #define READ_ACCESS R_OK
+ #define EDIT_ACCESS (R_OK|W_OK)
+
+ #if defined(POSIX_SIGNALS) && defined(HASWAITPID)
+ #define BACKGROUD_PROCESSES /* Only with POSIX signals */
+ #endif
+
+ /* <ulimit.h> is XPG3 ... but not POSIX nor ANSI */
+ extern long ulimit P_((int, ...));
+
+ #ifdef POSIX_SIGNALS
+ # define signal posix_signal
+ extern SIGHAND_TYPE
+ (*posix_signal P_((int, SIGHAND_TYPE (*)(int)))) P_((int));
+ #else
+ # ifdef SIGSET
+ # define signal sigset
+ # ifdef _AIX
+ extern SIGHAND_TYPE (*sigset(int sig, SIGHAND_TYPE (*func)(int)))(int);
+ # endif


+ # endif
+ #endif
+

+ #include <setjmp.h>
+
+ #if defined(POSIX_SIGNALS) && !defined(__386BSD__)
+ # define JMP_BUF sigjmp_buf
+ # define SETJMP(env) sigsetjmp((env), 1)
+ # define LONGJMP(env,val) siglongjmp((env), (val))
+ #else
+ # define JMP_BUF jmp_buf
+ # define SETJMP(env) setjmp(env)
+ # define LONGJMP(env,val) longjmp((env), (val))
+ #endif
+
+ #ifdef I_LOCALE
+ #include <locale.h>
+ #endif
+
+ #ifdef I_NL_TYPES
+ #include <nl_types.h>
+ #else
+ #include "elm_nl_types.h"
+ #endif
+
+ /* FOO - I wonder if we should be including <time.h> in this header */
+ char *ctime P_((const time_t *));
+
+
+ /*****************************************************************************
+ *
+ * data structures
+ *
+ ****************************************************************************/
+
+ /** "status" values for the header and alias record **/
+
+ #define ACTION (1<<0)
+ #define CONFIDENTIAL (1<<1)
+ #define DELETED (1<<2)
+ #define EXPIRED (1<<3)
+ #define FORM_LETTER (1<<4)
+ #define NEW (1<<5)
+ #define PRIVATE_MAIL (1<<6)
+ #define TAGGED (1<<7)
+ #define URGENT (1<<8)
+ #define VISIBLE (1<<9)
+ #define UNREAD (1<<10)
+ #define REPLIED_TO (1<<11)
+ #define MIME_MESSAGE (1<<12) /* indicates existence of MIME Header */
+ #define PRE_MIME_CONTENT (1<<13)
+ #define MIME_UNSUPPORTED (1<<14)
+ #define NOHDRENCODING (1<<15)
+ /* Don't add values bigger than 2^15 == 32768 */
+
+ #ifdef USE_PGP
+ #define PGP_MESSAGE (1<<0)
+ #define PGP_SIGNED_MESSAGE (1<<1)
+ #define PGP_PUBLIC_KEY (1<<2)
+ #endif
+
+ /** "exit_disposition" values */
+
+ #define UNSET 0
+ #define KEEP 1
+ #define STORE 2
+ #define DELETE 3
+ #define HIDE 4
+
+ /* Values for dsn flag */
+ #define DSN_FULL 1
+ #define DSN_HDRS 2
+ #define DSN_SUCCESS 4
+ #define DSN_FAILURE 8
+ #define DSN_DELAY 16
+ #define DSN_NEVER 32
+
+ /* message sorting selections */
+
+ #define REVERSE - /* for reverse sorting */
+ #define SENT_DATE 1 /* the date message was sent */
+ #define RECEIVED_DATE 2 /* the date message was received */
+ #define SENDER 3 /* the name/address of sender */
+ #define SIZE 4 /* the # of lines of the message */
+ #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 THREAD 8 /* thread order (date sent/subject */
+
+ /* alias sorting selections */
+
+ #define ALIAS_SORT 1 /* the name of the alias */
+ #define NAME_SORT 2 /* the actual name for the alias */
+ #define TEXT_SORT 3 /* the order of aliases.text */
+ #define LAST_ALIAS_SORT TEXT_SORT
+
+ /* Content-Disposition */
+ #define DISP_INLINE 0
+ #define DISP_ATTACH 1
+ #define DISP_AUTOATTACH 2
+
+ #define NO 0
+ #define YES 1
+ #define MAYBE 2 /* a definite define, eh? */
+
+ #define NO_TITE 2 /* ti/te or in flag */
+ #define NO_CHARSET 4 /* charset switch flag */
+ #define RAW_FROM_SIGNAL 8 /* From signal handler */
+
+ /* some random structs... */
+
+ #define NOTPLAIN_need_metamail 0x01
+ #define NOTPLAIN_need_mailcap 0x02
+ #define NOTPLAIN_canuse_mailcap 0x04
+ #define NOTPLAIN_is_fallback 0x08
+
+ /** and a couple for dealing with status flags... **/
+
+ #define ison(n, mask) (((n) & (mask)) != 0)
+ #define isoff(n, mask) (((n) & (mask)) == 0)
+ #define setit(n, mask) (n) |= (mask)
+ #define clearit(n, mask) (n) &= ~(mask)
+
+ #define MIME_magic 0xFD00
+ typedef struct mimeinfo {
+ unsigned short magic; /* MIME_magic */
+ unsigned int disposition : 2; /* DISP_INLINE or DISP_ATTACH or
+ DISP_AUTOATTACH
+ */
+
+ unsigned int mime_flags : 4; /* NOTPLAIN_need_metamail 0x01
+ NOTPLAIN_need_mailcap 0x02
+ NOTPLAIN_canuse_mailcap 0x04
+ NOTPLAIN_is_fallback 0x08
+ */
+
+ unsigned int unlink : 1; /* used to mark that the file should be
+ * unlinked after sending the attachment
+ */
+
+ struct media_type * TYPE;
+ char *type_opts;
+ char *disposition_opts;
+ struct string *description;
+
+ int encoding; /* Notice: ENCODING_ILLEGAL == -1, ENCODING_* in mime.h */
+ long length;
+ long begin_offset; /* the beginning of the attachment (includes headers) */
+ long offset; /* where the real data starts */
+
+ struct mime_parser_data * parser_data;
+
+ struct mime_selected_handler * handler_data;
+
+ /* These next fields are only used when sending multipart messages. */
+ char * pathname;
+ struct string * dispname;
+
+ } mime_t;
+
+ struct header_rec {
+ int lines; /** # of lines in the message **/
+ int status; /** Urgent, Deleted, Expired? **/
+ int index_number_X; /** relative loc in file... **/
+ int encrypted; /** whether msg has encryption **/
+ int exit_disposition; /** whether to keep, store, delete **/
+ int status_chgd; /** whether became read or old, etc. **/
+ long content_length; /** content_length in bytes from message header **/
+ long offset; /** offset in bytes of message **/
+ time_t received_time; /** when elm received here **/
+ char env_from[STRING]; /* sender from "From " */
+
+ struct addr_item *from; /** who sent the message? **/
+ struct addr_item *to; /** who it was sent to **/
+ struct addr_item *cc;
+ char messageid[STRING]; /** the Message-ID: value **/
+ char time_zone[12]; /** incl. tz **/
+ time_t time_sent; /** gmt when sent for sorting **/
+ time_t thread_time; /** time sent of the "thread" (for sorting) **/
+ char time_menu[SHORT]; /** just the month..day for menu **/
+ time_t tz_offset; /** offset to gmt of time sent **/
+ struct string *subject; /** The subject of the mail **/
+
+ struct string *list_phrase; /* phrase from List-ID */
+ char *list_id; /* id from LIST-ID */
+
+ char mailx_status[WLEN];/** mailx status flags (RO...) **/
+ mime_t mime_rec; /** MIME information for this message **/
+
+
+ /* == charset_t, but it is not yet declared ... */
+ struct charcode_info * header_charset; /* charset for headers ... */
+ struct charcode_info * override_charset; /* For O)verride command */
+
+ struct mbx_hdr_info * mbx_info;
+
+ struct partial_vector * partial_vector;
+ int partial_len;
+
+ #ifdef USE_PGP
+ unsigned int pgp : 3;
+ #endif
+ unsigned int binary :1; /* Binary message -- headers are terminated
+ * with \r\n
+ */
+ unsigned int have_from :1; /* Body have unescaped "From " */
+ unsigned int body_parsed :1; /* Whatever body of message is read */
+ unsigned int mime_parsed :1; /* Whatever mime structure is parsed */
+ };
+
+ /** some defines for the "type" field of the alias record **/
+
+ #define SYSTEM 1 /* bit masks, of course */
+ #define USER 2
+ #define PERSON 4
+ #define GROUP 8
+ #define DUPLICATE 16 /* system aliases only */
+
+ struct alias_disk_rec {
+ int32 status; /* DELETED, TAGGED, VISIBLE, ... */
+ int32 alias; /* alias name */
+ int32 last_name; /* actual personal (last) name */
+ int32 name; /* actual personal name (first last) */
+ int32 comment; /* comment, doesn't show in headers */
+ int32 address; /* non expanded address */
+ int32 type; /* mask-- sys/user, person/group */
+ int32 length; /* length of alias data on file */
+ };
+
+ struct alias_rec {
+ int status; /* DELETED, TAGGED, VISIBLE, ... */
+ char *alias; /* alias name */
+ char *last_name; /* actual personal (last) name */
+ char *name; /* actual personal name (first last) */
+ char *comment; /* comment, doesn't show in headers */
+ char *address; /* non expanded address */
+ int type; /* mask-- sys/user, person/group */
+ long length; /* length of alias data on file */
+ };
+
+ /*****************************************************************************
+ *
+ * Data common to many programs in the Elm package.
+ *
+ ****************************************************************************/
+
+ #ifdef INTERN
+ # define INIT(X) =X
+ # define EXTERN
+
+ static char ident[] = WHAT_STRING;
+ static char copyright[] = "\
+ @(#) (C) Copyright 1986,1987, Dave Taylor\n\
+ @(#) (C) Copyright 1988-1995, The Usenet Community Trust\
+ @(#) (C) Copyright 1996-2004, Kari Hurtta\n";
+
+ #else
+ # define INIT(X)
+ # define EXTERN extern
+ #endif
+
+
+ /* some stuff for our own malloc call - pmalloc */
+
+ #define PMALLOC_THRESHOLD 256 /* if greater, then just use malloc */
+ #define PMALLOC_BUFFER_SIZE 2048 /* internal [memory] buffer size... */
+
+ #define ok_alias_char(c) (isalnum(c) || c == '-' || c == '_' || c == '.')
+ #define ok_rc_char(c) (isalnum(c) || c == '-' || c == '_')
+ #define whitespace(c) (c == ' ' || c == '\t')
+ #define first_word(s,w) (strncmp(s,w, strlen(w)) == 0)
+ #define first_word_nc(s,w) (strincmp(s,w, strlen(w)) == 0)
+
+ #define no_ret(s) { register int xyz; /* varname is for lint */ \
+ for (xyz=strlen(s)-1; xyz >= 0 && \
+ (s[xyz] == '\r' || s[xyz] == '\n'); ) \
+ s[xyz--] = '\0'; \
+ }
+
+ #define equal(s,w) (strcmp(s,w) == 0)
+
+ /* environment variable with name of folder state dump file */
+ #define FOLDER_STATE_ENV "ELMSTATE"
+
+ #define FOLDER_STATUS_READ 0
+ #define FOLDER_STATUS_OLD 1
+ #define FOLDER_STATUS_NEW 2
+
+ /* They are used to support Grab_the_file in save() */
+ #define FLOCKING_OK 0
+ #define FLOCKING_RETRY 1
+ #define FLOCKING_FAIL -1
+
+ #define OUTGOING 0 /* defines for lock file */
+ #define INCOMING 1 /* creation..see lock() */
+
+ #define FORMFEED '\f' /* form feed (^L) char */
+
+ #define NONULL(x) (x ? x : "")
+
+ /* ----------------------------------------------------------------- */
+
+ #ifdef USE_FCNTL_LOCKING
+ # define SYSCALL_LOCKING
+ #else
+ # ifdef USE_FLOCK_LOCKING
+ # define SYSCALL_LOCKING
+ # endif
+ #endif
+
+
+ #ifdef I_TIME
+ # include <time.h>
+ #endif
+ #ifdef I_SYSTIME
+ # include <sys/time.h>
+ #endif
+
+ #ifndef _POSIX_SOURCE
+ extern struct tm *localtime();
+ extern time_t time();
+ #endif
+
+
+ #if defined(SELECT) || defined(I_SYS_SELECT)
+ #define POLL_METHOD 1
+ #if defined(I_SYS_SELECT)
+ #include <sys/select.h>
+ #endif
+ #else
+ #if defined(POLL)
+ #include <poll.h>
+ #define POLL_METHOD 2
+ #else
+ #undef POLL_METHOD
+ #endif
+ #endif
+
+ #ifdef I_SOCKET
+ #include <sys/socket.h>
+ #endif
+ #ifdef I_NETDB
+ #include <netdb.h>
+ #if defined(SOCK_STREAM) && defined (POLL_METHOD)
+ #define REMOTE_MBX
+ #endif
+ #endif
+
+
+ /*****************************************************************************
+ *
+ * declarations for routines in lib/libutil.a
+ *
+ ****************************************************************************/
+
+ #include "elmlib.h"
+

+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4

+ * buffer-file-coding-system: iso-8859-1


+ * End:
+ */

Index: elmME+.2.5.alpha0-cvs/hdrs/elm_globals.h


*** /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300

--- elmME+.2.5.alpha0-cvs/hdrs/elm_globals.h 2004-05-13 19:26:18.000000000 +0300
***************
*** 0 ****
--- 1,289 ----
+ /* $Id: elm_globals.h,v 1.1.2.2 2004/05/13 16:26:18 hurtta Exp $ */
+
+ /*****************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.1.2.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ ******************************************************************************
+ * Based on Elm 2.4 hdrs/defs.h and hdrs/headers.h.
+ * That code was following copyright:
+ *
+ * The Elm Mail System

+ *
+ * Copyright (c) 1988-1992 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Based on Elm 2.5 hdrs/elm_globals.h. That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust


+ * Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************/

+
+ /*
+ * All source files in the Elm package should include this right
+ * after "elm_defs.h". This header should not be used by the
+ * library or utility files.
+ */
+
+ #define BACKSPACE '\b' /* backspace character */
+ #define TAB '\t' /* tab character */
+ #define RETURN '\r' /* carriage return char */
+ #define LINE_FEED '\n' /* line feed character */
+ #define ESCAPE '\033' /* the escape */
+
+ #define COMMA ',' /* comma character */
+ /* XXX remove */
+
+ #define SPACE ' ' /* space character */
+ /* XXX remove */
+
+ #define COLON ':' /* the colon .. */
+ /* XXX remove */
+
+ #define NO_OP_COMMAND '\0' /* no-op for timeouts */
+ /* XXX ? ? ? ? */
+
+ #define STANDARD_INPUT 0 /* file number of stdin */
+ /* XXX remove */
+
+ #define FORM 3 /* <nevermind> */
+ #define PREFORMATTED 4 /* forwarded form... */
+
+ #define SAME_PAGE 1 /* redraw current only */
+ #define NEW_PAGE 2 /* redraw message list */
+ #define ILLEGAL_PAGE 0 /* error in page list, punt */
+
+ #define PAD 0 /* for printing name of */
+ /* XXX remove */
+ #define FULL 1 /* the sort we're using */
+ /* XXX remove */
+
+
+ /* special cookies that may appear in the user's message text */
+
+ #define DONT_SAVE "[no save]"
+ #define DONT_SAVE2 "[nosave]"
+
+ /* options to the copy_message() procedure */
+ #define CM_REMOVE_HEADER (1<<0) /* skip header of message */
+ #define CM_UPDATE_STATUS (1<<2) /* Update Status: Header */
+ #define CM_REMAIL (1<<4) /* Add Sender: and Orig-To: headers */
+ #define CM_DECODE (1<<5) /* Decode MIME, PGP and elm */
+ #define CM_FILT_HDR (1<<6) /* Filter headers (for forwarding) */
+ #define CM_DISPLAYING (1<<7) /* Pass to MIME code */
+ #define CM_REMOVE_ENVELOPE (1<<8) /* Remove envelope */
+ #define CM_CRLF (1<<9) /* Use CRLF */
+ #define CM_LF (1<<10) /* Force CRLF -> LF */
+ #define CM_FORWARDING (1<<11) /* text is a message that we are */
+ /* forwarding */
+ #define CM_ATTRIBUTION (1<<12) /* add attribution strings that */
+ /* format this as an included mssg */
+
+
+ #if 0 /* NOT USED -- */
+ #define CM_REMOTE (1<<1) /* append remote from hostname to */
+ /* first line */
+ #define CM_MMDF_HEAD (1<<3) /* strip mmdf message seperator */
+
+ #define CM_FORWARDING (1<<XX) /* text is a message that we are */
+ /* forwarding */
+ #define CM_ATTRIBUTION (1<<XX) /* add attribution strings that */
+ /* format this as an included mssg */
+
+ #endif
+
+ #if 0 /* XXX not used yet */
+ /* options to the leave() procedure */
+ #define LEAVE_NORMAL 000 /* normal program termination */
+ #define LEAVE_ERROR 001 /* exit due to program error */
+ #define LEAVE_KEEP_EDITTMP 010 /* ...preserve composition file */
+ #define LEAVE_KEEP_TEMPFOLDER 020 /* ...preserve temp folder */
+ #define LEAVE_KEEP_LOCK 040 /* ...preserve folder locks */
+ #define LEAVE_EMERGENCY 071 /* emergency exit */
+ #define LEAVE_EXIT_STATUS(mode) ((mode) & 07)


+
+ #endif
+
+

+ #define UNDELETE 0 /* purely for ^U function... */
+ /* XXX remove */
+
+ #if 0 /* XXX not used yet */
+ /* options to the meta_match() procedure */
+ #define MATCH_TAG 0 /* tag matching entries */
+ #define MATCH_DELETE 1 /* delete matching entries */
+ #define MATCH_UNDELETE 2 /* undelete matching entries */
+ #endif
+
+ /****************************************************************************/
+
+ /* map character (e.g. 'A') to its control equivalent (e.g. '^A') */
+ #define ctrl(c) (((c) + '@') & 0x7f)
+
+ #if 0 /* XXX -- not used */
+ /* calculate next tabstop from position (col) */
+ /* leftmost col is zero, assumes 8-position tabstops */
+ #define tabstop(col) (((col) & ~07) + 010)
+ #endif
+
+ /* FIXME: .... remove these ... */
+ #define MAIN_HELP 0
+ #define OPTIONS_HELP 1
+ #define ALIAS_HELP 2
+ #define PAGER_HELP 3
+
+ #if 0 /* softkeys not used */
+ #define MAIN 0
+ #define ALIAS 1
+ #define YESNO 2
+ #define CHANGE 3
+ #define READ 4
+ #endif
+
+
+ #define onoff(n) (n == 0 ? "OFF" : "ON")
+
+ #define ClearLine(n) MoveCursor(n,0); CleartoEOLN()
+ #define plural(n) n == 1 ? "" : "s"
+
+ /** some months... **/
+
+ #define JANUARY 0 /* months of the year */
+ #define FEBRUARY 1
+ #define MARCH 2
+ #define APRIL 3
+ #define MAY 4
+ #define JUNE 5
+ #define JULY 6
+ #define AUGUST 7
+ #define SEPTEMBER 8
+ #define OCTOBER 9
+ #define NOVEMBER 10
+ #define DECEMBER 11
+
+
+ /** some defines for the 'userlevel' variable... **/
+
+ #define RANK_AMATEUR 0
+ #define AMATEUR 1
+ #define OKAY_AT_IT 2
+ #define GOOD_AT_IT 3
+ #define EXPERT 4
+ #define SUPER_AT_IT 5
+
+ /* Options for mail() procedure */
+ #define MAIL_COPY_MSG (1<<0)
+ #define MAIL_EDIT_MSG (1<<1)
+ #define MAIL_ISFORM (1<<2)
+ #define MAIL_REPLYING (1<<3)
+ #define MAIL_FORWARDING (1<<4)
+ #define MAIL_HAVE_ATTACHMENTS (1<<5) /* Flag for verify transmission */
+ #define MAIL_HAVE_PGP_ENCODED (1<<6) /* Falg for verify transmission */
+
+
+ #if 0 /* XXXX not used */
+
+ /*
+ * "opmode" global - current operation mode settings.
+ */
+
+ #define OPMODE_READ 010 /* running in folder read mode */
+ #define OPMODE_READ_NONEMPTY 011 /* ...only read if non-empty */
+ #define OPMODE_SEND 020 /* running in send-only mode */
+ #define OPMODE_SEND_BATCH 021 /* ...performing batch send */
+
+ #define OPMODE_IS_READMODE(op) (((op) & OPMODE_READ) != 0)
+ #define OPMODE_IS_SENDMODE(op) (((op) & OPMODE_SEND) != 0)
+ #define OPMODE_IS_INTERACTIVE(op) ((op) != OPMODE_SEND_BATCH)
+ /*
+ * "opmode" global - current operation mode settings.
+ */
+
+ #define OPMODE_READ 010 /* running in folder read mode */
+ #define OPMODE_READ_NONEMPTY 011 /* ...only read if non-empty */
+ #define OPMODE_SEND 020 /* running in send-only mode */
+ #define OPMODE_SEND_BATCH 021 /* ...performing batch send */
+
+ #define OPMODE_IS_READMODE(op) (((op) & OPMODE_READ) != 0)
+ #define OPMODE_IS_SENDMODE(op) (((op) & OPMODE_SEND) != 0)
+ #define OPMODE_IS_INTERACTIVE(op) ((op) != OPMODE_SEND_BATCH)


+
+
+ #endif
+
+

+
+ /******** global variables accessable by all pieces of the program *******/
+
+ EXTERN int check_size; /* don't start mailer if no mail */
+ EXTERN int inalias; /* TRUE if in the alias menu */
+ EXTERN int last_current INIT(-1); /* previous current message */
+ EXTERN int last_header_page INIT(-1); /* last header page */
+ EXTERN int headers_per_page; /* number of headers/page */
+ EXTERN int original_umask; /* original umask, for restore before subshell */
+ EXTERN int sendmail_verbose; /* Allow extended debugging on sendmail */
+ EXTERN int nucurr; /* change list or just the current pointer **/
+ EXTERN char cur_editfile[SLEN]; /* editor buffer */
+
+ EXTERN char batch_subject[SLEN]; /* subject buffer for batchmail */
+ EXTERN char included_file[SLEN]; /* name of file to place in edit buf */
+
+ EXTERN char version_buff[NLEN]; /* version buffer */
+
+ EXTERN char *def_ans_yes; /* default yes answer - single char, lc*/
+ EXTERN char *def_ans_no; /* default no answer - single char, lc */
+ EXTERN char *nls_deleted; /* [deleted] */
+ EXTERN char *nls_form; /* Form */
+ EXTERN char *nls_message; /* Message */
+ EXTERN char *nls_to; /* To */
+ EXTERN char *nls_from; /* From */
+ EXTERN char *nls_page; /* Page */
+ EXTERN char *change_word; /* change */
+ EXTERN char *save_word; /* save */
+ EXTERN char *copy_word; /* copy */
+ EXTERN char *cap_save_word; /* Save */
+ EXTERN char *cap_copy_word; /* Copy */
+ EXTERN char *saved_word; /* saved */
+ EXTERN char *copied_word; /* copied */
+
+ EXTERN int write_elmrc; /* flag: write elmrc in starting */
+
+ EXTERN int mail_only; /* flag: send mail then leave? */
+ EXTERN int check_only; /* flag: check aliases and leave? */
+ EXTERN int batch_only; /* flag: send without prompting? */
+
+ EXTERN long size_of_pathfd; /** size of pathfile, 0 if none **/
+
+ EXTERN FILE *pathfd; /* path alias file */
+ EXTERN FILE *domainfd; /* domains file */
+
+ EXTERN int system_data INIT(-1); /* fileno of system data file */
+ EXTERN int user_data INIT(-1); /* fileno of user data file */
+
+ EXTERN JMP_BUF GetPromptBuf; /* setjmp buffer */
+ EXTERN int InGetPrompt; /* set if in GetPrompt() in read() */
+
+ #ifdef USE_PGP
+ EXTERN int pgp_status;
+ EXTERN int pgp_keeppassfor; /* how long to keep it before expiring */
+ #endif
+
+ EXTERN int me_retcode;
+
+ EXTERN short mime_count; /* A counter used so that each call to
+ * mime_generate_boundary() returns a unique value.
+ */


+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4

+ * buffer-file-coding-system: iso-8859-1


+ * End:
+ */

+
+
+
+
Index: elmME+.2.5.alpha0-cvs/hdrs/elm.h
*** elm2.4.ME+.115/hdrs/elm.h 2004-03-30 19:38:43.000000000 +0300


--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************

*** 1,129 ****
- /* $Id: elm.h,v 1.22 2004/03/27 18:31:35 hurtta Exp $ */
-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $
- *
- * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
- * (was hurtt...@ozone.FMI.FI)


- ******************************************************************************
- * The Elm Mail System
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor

- *****************************************************************************/
-
- /** Main header file for ELM mail system. **/
-
-
- #include <stdio.h>
- #include <fcntl.h>
- #include <errno.h>
- #include <signal.h>
-
- #include "defs.h"
- #include <setjmp.h>
- /*
- #include "melib.h"
- */
-
- #include "elmlib.h"
-
- /******** static character string containing the version number *******/
-
- static char ident[] = { WHAT_STRING };
-
- /******** and another string for the copyright notice ********/
-
- static char copyright[] = {
- "@(#) (C) Copyright 1986,1987, Dave Taylor\n\
- @(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
- @(#) (C) Copyright 1996-2004, Kari Hurtta\n" };
-
- /******** global variables accessable by all pieces of the program *******/
-
-
- int check_size = 0; /* don't start mailer if no mail */
-
-
- int inalias = 0; /* TRUE if in the alias menu */
- int last_current = -1; /* previous current message */
- int last_header_page = -1; /* last header page */
- int headers_per_page = 0; /* number of headers/page */
- int original_umask = 0; /* original umask, for restore before subshell */
- int sendmail_verbose = 0; /* Extended mail debugging */
-
- int nucurr = 0; /* change list or just the current pointer... */
- char cur_editfile[SLEN] = {0}; /* editor buffer */
-
- char batch_subject[SLEN] = {0}; /* subject buffer for batchmail */
- char included_file[SLEN] = {0}; /* prepared file to include in the edit buf */
-
- char version_buff[NLEN] = {0}; /* version buffer */
-
- char *def_ans_yes; /* default yes answer - single char, lc */
- char *def_ans_no; /* default no answer - single char, lc */
- char *nls_deleted; /* [deleted] */
- char *nls_form; /* Form */
- char *nls_message; /* Message */
- char *nls_to; /* To */
- char *nls_from; /* From */
- char *nls_page; /* Page */
- char *change_word; /* change */
- char *save_word; /* save */
- char *copy_word; /* copy */
- char *cap_save_word; /* Save */
- char *cap_copy_word; /* Copy */
- char *saved_word; /* saved */
- char *copied_word; /* copied */
-
- char backspace, /* the current backspace char */
-
- kill_line, /* the current kill-line char */
- word_erase, /* the current word-erase char */
- interrupt_char, /* the current interrupt char */
- reprint_char, /* the current reprint-line char */
- eof_char; /* the current end-of-file char */
-
- int has_highlighting = FALSE; /* highlighting available? */
-
-
- int write_elmrc = 0; /* flag: write elmrc in starting */
-
-
-
-
-
-
- int mail_only = 0; /* flag: send mail then leave? */
- int check_only = 0; /* flag: check aliases then leave? */
- int batch_only = 0; /* flag: send without prompting? */
-
- long size_of_pathfd; /** size of pathfile, 0 if none **/
-
- FILE *pathfd; /* path alias file */
- FILE *domainfd; /* domain file */
-
- int system_data = -1; /* fileno of system data file */
- int user_data = -1; /* fileno of user data file */
-
- JMP_BUF GetPromptBuf; /* setjmp buffer */
- int InGetPrompt; /* set if in GetPrompt() in read() */
-
- #ifdef USE_PGP
-
- int pgp_status=0; /* var to keep track of pgp internals */
-
- #endif
- int me_retcode;
-
- short mime_count = 0; /* A counter used so that each call to
- * mime_generate_boundary() returns a unique value.


- */
-
- /*

- * Local Variables:
- * mode:c
- * c-basic-offset:4

- * buffer-file-coding-system: iso-8859-1


- * End:
- */

--- 0 ----
Index: elmME+.2.5.alpha0-cvs/hdrs/elmlib.h
*** elm2.4.ME+.115/hdrs/elmlib.h 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/elmlib.h 2004-05-15 23:11:36.000000000 +0300
***************
*** 1,7 ****


! /* $Id: elmlib.h,v 1.207 2004/04/04 06:17:17 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.207.4.14 2004/05/15 20:11:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207.4.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 725,736 ****
From: -header
*/
extern char alternative_editor[SLEN];/* the 'other' editor */
! extern struct addr_rec *alternative_addresses; /* how else do we get mail? */
extern int always_del; /* flag: always delete marked msgs? */
extern int always_keep; /* flag: always keep unread msgs? */
extern int always_store; /* flag: always store read mail? */
extern int arrow_cursor; /* flag: use "->" regardless? */
- extern int question_me; /* flag: ask questions as we leave? */
extern int prompt_for_cc; /* flag: prompt user for 'cc' value? */
#ifdef USE_PGP
extern int pgp_askpgpsig; /* Should pgp ask userid to sign messages with? */
--- 725,741 ----
From: -header
*/
extern char alternative_editor[SLEN];/* the 'other' editor */
! extern PATH alternative_addresses; /* how else do we get mail? */
extern int always_del; /* flag: always delete marked msgs? */
extern int always_keep; /* flag: always keep unread msgs? */
extern int always_store; /* flag: always store read mail? */
+
+ extern int ask_delete; /* confirm delete on resync? */
+ extern int ask_keep; /* ask to keep unread msgs? */
+ extern int ask_reply_copy; /* ask to copy mssg into reply? */
+ extern int ask_store; /* ask to store read mail? */
+
extern int arrow_cursor; /* flag: use "->" regardless? */
extern int prompt_for_cc; /* flag: prompt user for 'cc' value? */
#ifdef USE_PGP
extern int pgp_askpgpsig; /* Should pgp ask userid to sign messages with? */
***************
*** 742,753 ****
PGP_NUM };
extern enum pgp_version send_pgp_version; /* preferred pgp version*/
#endif
! extern char attribution[SLEN]; /* attribution string for replies */
extern int auto_attachment; /* 0 = none,
1 = application,
2 = non-text
*/
! extern int auto_copy; /* flag: auto copy source into reply? */
extern int auto_iso_8859; /* flag: Should ISO-8859-X charsets defined
on demand ? */
#ifdef BACKGROUD_PROCESSES
--- 747,759 ----
PGP_NUM };
extern enum pgp_version send_pgp_version; /* preferred pgp version*/
#endif
! extern char attribution[SLEN]; /* attribution string for replies */
! extern char fwdattribution[SLEN]; /* attribution string for forwarded mssgs */
extern int auto_attachment; /* 0 = none,
1 = application,
2 = non-text
*/
! extern int reply_copy; /* flag: copy message into reply */
extern int auto_iso_8859; /* flag: Should ISO-8859-X charsets defined
on demand ? */
#ifdef BACKGROUD_PROCESSES
***************
*** 757,762 ****
--- 763,769 ----
#endif
extern int allow_charset_switching; /* flag: allow changing charset of terminal
if terminal supports it */
+ extern int allow_setuid;
/* extern int bounceback; */ /* flag: bounce copy off remote? */
extern int browser_wildcards; /* flag: do wildcard match? */
extern int builtin_lines; /* int use builtin pager? */
***************
*** 776,781 ****
--- 783,790 ----
extern int confirm_create; /* flag: confirm create new folder? */
extern int confirm_files; /* flag: confirm files for append? */
extern int confirm_folders; /* flag: confirm folders for create? */
+ extern int confirm_tag_save; /* flag: confirm saving of tagged messages */
+ extern int edit_flush; /* flag: flush input after extern edit? */
extern int convert_comment; /* flag: convert comment to fullname ? */
extern int convert_utf_header; /* flag: convert utf-8 mime encoded words to utf-7 when sending? */
extern int auto_copy_sent; /* flag: automatically copy sent mail? */
***************
*** 806,812 ****
extern int menu_display_host; /* flag: Display host on mailbox menu* */
extern int keep_empty_files; /* flag: keep empty files?? */
#ifdef USE_PGP
! extern int pgp_keeppass; /* should Elm keep the passphrase? */
#endif



extern int local_fast_lookup; /* flag: directory listing not needed

--- 815,821 ----
extern int menu_display_host; /* flag: Display host on mailbox menu* */
extern int keep_empty_files; /* flag: keep empty files?? */
#ifdef USE_PGP
! extern int pgp_keeppassfor; /* should Elm keep the passphrase? */
#endif



extern int local_fast_lookup; /* flag: directory listing not needed

***************
*** 837,842 ****
--- 846,852 ----


extern PATH metamail_mailcaps; /* mailcaps for metamail */
extern PATH internal_mailcaps; /* mailcaps for internal handler */

extern PATH internal_mailcap_t_programs; /* Execute program without asking */

+ extern PATH incomingfolders; /* treate as mailbox */


extern int internal_mailcap_t_prompt; /* ... really? */

extern int metoo; /* flag: copy me on mail to alias? */
extern int mimeforward;
***************
*** 869,874 ****
--- 879,885 ----
extern char prefixchars[SLEN]; /* prefix char(s) for msgs */


extern char printout[SLEN]; /* how to print messages */
extern char raw_printout[SLEN]; /* unexpanded how to print messages */

+ extern char printhdrs[SLEN]; /* headers to select and weed on printing */


extern int prompt_after_pager; /* flag: prompt after pager exits */

extern int prompt_after_metamail; /* flag: prompt after metamail exits */

extern int quote_forward; /* flag: fwd'd msgs quoted like replies */
***************
*** 882,887 ****
--- 893,899 ----
extern int req_mime_hdrencoding;
extern int resolve_mode; /* flag: resolve before moving mode? */
extern int save_by_name; /* flag: save mail by login name? */
+ extern int save_by_alias; /* save mail by alias of login name? */
extern char sent_mail[SLEN]; /* name of file to save copies to */
extern int set_window_title; /* flag: set (xterm?) window title and
icon name */
***************
*** 892,897 ****
--- 904,911 ----
extern int pgp_noarmor; /* Should Elm display text before PGP armor */
#endif
extern int showto;
+ extern int show_mlists; /* show mailing list info? */
+ extern int show_reply; /* flag: show 'r' for replied mail */
extern int show_header_errors; /* flag: should some header reported? */
extern int sig_dashes; /* flag: put dashes above signature? */
extern int sleepmsg; /* time to sleep for messages being overwritten on screen */
***************
*** 900,905 ****
--- 914,920 ----
extern long elm_timeout; /* seconds for main level timeout */
extern int sort_thread_max_time; /* Number of days which can considered
be same thread */
+ extern char to_chars[SLEN]; /* chars to indicate who mail is to */
extern char temp_dir[SLEN]; /* name of temp directory */
extern char raw_temp_dir[SLEN]; /* unexpanded name of temp directory */
#ifdef USE_PGP
***************
*** 912,919 ****
extern char v_editor[SLEN]; /* "~v" editor... */
extern int elm_filter; /* flag: weed out header lines? */
extern int send_mime_plain; /* Send text/plain US-ASCII as MIME? */
! extern char *weedlist[MAX_IN_WEEDLIST];
! extern int weedcount; /* how many headers to check? */
#ifdef REMOTE_MBX
extern char raw_imap_charset[SLEN]; /* IMAP foldername charset */
extern int imap_fast_lookup; /* flag: skip directory listing */
--- 927,934 ----
extern char v_editor[SLEN]; /* "~v" editor... */
extern int elm_filter; /* flag: weed out header lines? */
extern int send_mime_plain; /* Send text/plain US-ASCII as MIME? */
! extern PATH weedlist;
!
#ifdef REMOTE_MBX
extern char raw_imap_charset[SLEN]; /* IMAP foldername charset */
extern int imap_fast_lookup; /* flag: skip directory listing */
***************
*** 1255,1261 ****
extern void unfold_header P_((char *buffer, int *len,
struct header_rec *current_header));

-
extern char *show_message_status P_((struct header_rec *hdr));

extern int copy_body_folder P_((struct folder_info *folder,
--- 1270,1275 ----
***************
*** 1378,1383 ****
--- 1392,1402 ----

/* lib/hdrdecode.c */

+ #define HDR_TEXT 1
+ #define HDR_STRUCTURED 2
+ #define HDR_PHRASE 4
+ #define HDR_COMMENT 8 /* inside of comment -- for rfc1522_encode_text */
+
extern char * blstrpbrk P_((char *string, CONST char *set));
extern struct string * hdr_to_string P_((int class,CONST char *buffer,
charset_t defcharset, int demime));
***************
*** 2030,2035 ****
--- 2049,2059 ----
#define ENCODING_EXPERIMENTAL 6
#define ENCODING_UUENCODED 7

+ #define HAVE_8BIT 1
+ #define HAVE_CTRL 4
+ #define HAVE_BINARY 8
+
+
struct id_phrase {
char * id;
struct string * text;
***************
*** 2248,2253 ****
--- 2272,2282 ----

extern void free_string_tokenized P_((struct string_token **ptr));

+ /* pmalloc.c */
+
+ extern char *pmalloc P_((int size));
+
+

/*
* Local Variables:
* mode:c

Index: elmME+.2.5.alpha0-cvs/hdrs/elmutil.h
*** elm2.4.ME+.115/hdrs/elmutil.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/elmutil.h 2004-04-18 19:55:36.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmutil.h,v 1.13 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: elmutil.h,v 1.13.8.1 2004/04/18 16:55:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 14,40 ****

/** Main header file for ELM utilities. **/

-
- #include <stdio.h>
- #include <fcntl.h>
- #include <errno.h>
- #include <signal.h>
-
- #include "defs.h"
-
#include "patchlevel.h"
! #include "elmlib.h"
!
! /******** static character string containing the version number *******/
!
! static char ident[] = { WHAT_STRING };

- /******** and another string for the copyright notice ********/

- static char copyright[] = {
- "@(#) (C) Copyright 1986,1987, Dave Taylor\n@(#)\n\
- @(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
- @(#) (C) Copyright 1996-2003, Kari Hurtta\n" };



/******** global variables accessable by all pieces of the program *******/

--- 14,24 ----

/** Main header file for ELM utilities. **/

#include "patchlevel.h"
! #define INTERN
! #include "elm_defs.h"





/******** global variables accessable by all pieces of the program *******/

Index: elmME+.2.5.alpha0-cvs/hdrs/headers.h
*** elm2.4.ME+.115/hdrs/headers.h 2004-03-30 19:38:43.000000000 +0300


--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************

*** 1,172 ****
- /* $Id: headers.h,v 1.24 2004/03/27 18:31:36 hurtta Exp $ */
-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
- *
- * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
- * (was hurtt...@ozone.FMI.FI)


- ******************************************************************************
- * The Elm Mail System
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor

- *****************************************************************************/
-
- /** This is the header file for ELM mail system. **/
-
- #include "defs.h"
- #include <setjmp.h>
-
- #include "elmlib.h"
-
- #include "mime.h"
-
- /******** global variables accessable by all pieces of the program *******/
-
-
- extern int check_size; /* don't start mailer if no mail */
-
-
- extern int inalias; /* TRUE if in the alias menu */
- extern int last_current; /* previous current message */
- extern int last_header_page; /* last header page */
- extern int headers_per_page; /* number of headers/page */
- extern int original_umask; /* original umask, for restore before subshell */
- extern int sendmail_verbose; /* Allow extended debugging on sendmail */
- extern int nucurr; /** change list or just the current pointer **/
-
-
-
- extern char cur_editfile[SLEN]; /* editor buffer */
- extern char defaultfile[SLEN]; /* name of default folder */
-
-
-
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- extern char batch_subject[SLEN];/* subject buffer for batchmail */
- extern char included_file[SLEN];/* name of file to place in edit buf */
-
-
-
-
- extern char version_buff[NLEN]; /* version buffer */
-
-
-
-
- extern char *def_ans_yes; /* default yes answer - single char, lc */
- extern char *def_ans_no; /* default no answer - single char, lc */
- extern char *nls_deleted; /* [deleted] */
- extern char *nls_form; /* Form */
- extern char *nls_message; /* Message */
- extern char *nls_to; /* To */
- extern char *nls_from; /* From */
- extern char *nls_page; /* Page */
- extern char *change_word; /* change */
- extern char *save_word; /* save */
- extern char *copy_word; /* copy */
- extern char *cap_save_word; /* Save */
- extern char *cap_copy_word; /* Copy */
- extern char *saved_word; /* saved */
- extern char *copied_word; /* copied */
-
- extern char backspace, /* the current backspace char */
-
- kill_line, /* the current kill_line char */
- word_erase, /* the current word-erase char */
- interrupt_char, /* the current interrupt char */
- reprint_char, /* the current reprint-line char */
- eof_char; /* the current end-of-file char */
-
- extern int has_highlighting; /* highlighting available? */
-
-
-
-

-
-
-
-
-
-

- extern int write_elmrc; /* flag: write elmrc in starting */
-
-
-
-

-
-
-
-
-
-

-
- extern int mail_only; /* flag: send mail then leave? */
- extern int check_only; /* flag: check aliases and leave? */
- extern int batch_only; /* flag: send without prompting? */
-
-
- extern long size_of_pathfd; /** size of pathfile, 0 if none **/
-
-
- extern FILE *pathfd; /* path alias file */
- extern FILE *domainfd; /* domains file */
-
-
-
-
-
- extern int system_data; /* fileno of system data file */
- extern int user_data; /* fileno of user data file */
-
-
-
-
-
-
-
-
- #ifdef USE_PGP
-
- extern int pgp_status;
-
- extern int pgp_keeppassfor; /* how long to keep it before expiring */
-
-
-
- #endif
-
- extern int me_retcode;
- extern char *mime_types[];


-
- /*
- * Local Variables:
- * mode:c
- * c-basic-offset:4

- * buffer-file-coding-system: iso-8859-1


- * End:
- */

--- 0 ----
Index: elmME+.2.5.alpha0-cvs/hdrs/mbx_imp.h
*** elm2.4.ME+.115/hdrs/mbx_imp.h 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/mbx_imp.h 2004-04-25 17:52:37.000000000 +0300
***************
*** 1,7 ****


! /* $Id: mbx_imp.h,v 1.66 2004/04/04 06:17:17 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: mbx_imp.h,v 1.66.4.1 2004/04/25 14:52:37 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66.4.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 749,758 ****
#define STFLAG_is_submission 0x0400
#define STFLAG_is_smtp 0x0800

! extern const struct service_type * IMAP_SERVICE;
! extern const struct service_type * POP_SERVICE;
! extern const struct service_type * SUBMISSION_SERVICE;
! extern const struct service_type * SMTP_SERVICE;

extern struct service_entry {
int flags;
--- 749,758 ----
#define STFLAG_is_submission 0x0400
#define STFLAG_is_smtp 0x0800

! extern CONST struct service_type * IMAP_SERVICE;
! extern CONST struct service_type * POP_SERVICE;
! extern CONST struct service_type * SUBMISSION_SERVICE;
! extern CONST struct service_type * SMTP_SERVICE;

extern struct service_entry {
int flags;

Index: elmME+.2.5.alpha0-cvs/hdrs/me.h
*** elm2.4.ME+.115/hdrs/me.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/me.h 2004-05-16 12:54:13.000000000 +0300
***************
*** 1,7 ****
! /* $Id: me.h,v 1.87 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.87.8.8 2004/05/16 09:54:13 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 119,124 ****
--- 119,135 ----
int *redraw,
struct menu_context *page));

+ #define PROMPT_center 1

+ #define PROMPT_yesno 2


+ #define PROMPT_redraw_mark 4
+ #define PROMTP_ctrlL 8
+
+ extern int prompt_letter P_((int line, char *letters, int def,
+ int flags,
+ struct menu_context *page,
+ const char * format, const char *msg, ...));
+
+
#define OE_APPEND_CURRENT (1<<0)
#define OE_PASSWD (1<<1)
#define OE_REDRAW_MARK (1<<2)

***************
*** 264,269 ****
--- 275,284 ----
extern void install_aliases P_((struct AliasView *aview,
int *header_page));

+ extern char *address_to_alias P_((char *address,
+ struct AliasView *aview));
+
+
/* a_edit.c */

int edit_aliases_text P_((struct AliasView *aview, int *header_page,
***************
*** 367,373 ****

/* strings.c */

-
extern char **argv_from_to P_((char *to));
extern void split_word P_((
char *buffer, char *first, char *rest));
--- 382,387 ----
***************
*** 377,382 ****
--- 391,399 ----

extern char *argv_zero P_((const char *string));

+ extern char *get_token P_((char *source, char *keys,
+ int depth));
+

/* string2.c */

***************
*** 507,512 ****
--- 524,530 ----
struct run_state; /* Needed for prototype */
#endif

+ extern struct string * gen_From_buffer P_((const struct header_rec * current_header));

extern int mail P_((struct header_rec *current_header,
int options, int form,
***************
*** 592,598 ****
mime_send_t *mime_info,
FILE * conv_file,
struct MailboxView *mailbox,
! struct menu_context *page));

extern int append_copy_to_file P_((struct mailing_headers * headers,
struct folder_browser *cf,
--- 610,617 ----
mime_send_t *mime_info,
FILE * conv_file,
struct MailboxView *mailbox,
! struct menu_context *page,
! struct AliasView *aview));

extern int append_copy_to_file P_((struct mailing_headers * headers,
struct folder_browser *cf,
***************
*** 737,742 ****
--- 756,764 ----
extern int options P_((struct MailboxView *mailbox,
struct AliasView *aview));

+ extern char * level_name P_((int n));
+
+
/* hdrconfig.c */

extern void show_presend_headers P_((struct mailing_headers *headers,
***************
*** 1112,1120 ****
--- 1134,1178 ----
extern int InitScreen P_((struct menu_context **page));

extern void ScreenSize P_((int *lines, int *columns));

+ extern int has_highlighting; /* highlighting available? */
+
/* -1 == no changes */
extern void set_root_menu(int lines, int columns);

+ #define READCH_MASK 0x0FFF /* Mask flags off */
+ #define READCH_CURSOR 0x1000 /* Return cursor keys */
+ #define READCH_NOCURSOR 0x2000 /* Disable cursor keys */
+ #define READCH_term_char 0x4000 /* Return term chars */
+ #define READCH_resize 0x8000 /* Check resize .... */
+
+ #define REDRAW_MARK 257 /* Artificial "char" for redrawing */
+ #define UP_MARK 258 /* Artificial UP key */
+ #define LEFT_MARK 259 /* Artificial LEFT key */
+ #define RIGHT_MARK 260 /* Artificial RIGHT key */
+ #define DOWN_MARK 261 /* Artificial DOWN key */
+ #define PAGEUP_MARK 262 /* Artificial PAGE UP key */
+ #define PAGEDOWN_MARK 263 /* Artificial PAGE DOWN key */
+ #define HELP_MARK 264 /* Artificial HELP key */
+ #define HOME_MARK 265 /* Artificial HOME key */
+ #define FIND_MARK 266 /* Artificial FIND key */
+ #define SPACE_MARK 267 /* used by builtinplus */
+ #define RESIZE_MARK 268 /* Used ny menu_context */
+
+ #define TERMCH_backspace 300 /* term_char: backspace */
+ #define TERMCH_kill_line 301
+ #define TERMCH_word_erase 302
+ #define TERMCH_interrupt_char 303
+ #define TERMCH_reprint_char 304
+ #define TERMCH_eof_char 305
+
+ extern char backspace, /* the current backspace char */
+
+ kill_line, /* the current kill_line char */
+ word_erase, /* the current word-erase char */
+ interrupt_char, /* the current interrupt char */
+ reprint_char, /* the current reprint-line char */
+ eof_char; /* the current end-of-file char */
+
/* ------------------------------------------------------- */
extern struct menu_context * default_context;

***************
*** 1147,1152 ****
--- 1205,1211 ----
extern struct menu_context * Raw P_((int state));


extern struct charset_state * ReadCh2 P_((int flags));

extern int ReadCh P_((int flags));

+ extern void FlushInput P_((void));


extern void GetXYLocation P_((int *x,int *y));

extern int ClearScreen P_((void));


extern int MoveCursor P_((int row, int col));

***************
*** 1249,1254 ****
--- 1308,1318 ----

/* menu_common/ */

+ /** some defines to aid in the limiting of alias displays **/
+
+ #define BY_NAME 64
+ #define BY_ALIAS 128
+
struct menu_common {
unsigned short magic;
struct mcommon_type * mtype;
***************
*** 1271,1277 ****

/* bit field:
ACTION, CONFIDENTIAL, DELETED, EXPIRED, FORM_LETTER, NEW,
! PRIVATE_MAIL, TAGGED, URGENT, VISIBLE, UNREAD, REPLIED,
MIME_MESSAGE, PRE_MIME_CONTENT, MIME_UNSUPPORTED, NOHDRENCODING
*/
extern int mcommon_setf_status P_((struct menu_common *m, int idx, int stat));
--- 1335,1341 ----

/* bit field:
ACTION, CONFIDENTIAL, DELETED, EXPIRED, FORM_LETTER, NEW,
! PRIVATE_MAIL, TAGGED, URGENT, VISIBLE, UNREAD, REPLIED_TO,
MIME_MESSAGE, PRE_MIME_CONTENT, MIME_UNSUPPORTED, NOHDRENCODING
*/
extern int mcommon_setf_status P_((struct menu_common *m, int idx, int stat));
Index: elmME+.2.5.alpha0-cvs/hdrs/melib.h
*** elm2.4.ME+.115/hdrs/melib.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/melib.h 2004-04-18 19:55:36.000000000 +0300
***************
*** 1,7 ****
! /* $Id: melib.h,v 1.43 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: melib.h,v 1.43.8.1 2004/04/18 16:55:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 345,350 ****
--- 345,360 ----
struct header_rec *mss));


extern int partial_selector P_((mime_t *p, struct header_rec * hdr));

+ /* --- --- */
+
+ #define DISPOSITION(x) (x == DISP_INLINE ? "inline" : "attachment")
+ #define ENCODING(x) (x >= 0 ? mime_encode_names[x] : "<ILLEGAL>")
+ extern char *mime_encode_names[]; /* defined in mime.c */
+
+ /* special cookies that may appear in the user's message text */
+ #define START_ENCODE "[encode]"
+ #define END_ENCODE "[clear]"
+
/* --------------- */

/* mime_decode.c uses this ... */
Index: elmME+.2.5.alpha0-cvs/hdrs/mime.h
*** elm2.4.ME+.115/hdrs/mime.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/mime.h 2004-04-18 19:55:36.000000000 +0300
***************
*** 1,5 ****
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,5 ----
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 13,35 ****
#define MIME_HEADER "MIME-Version: 1.0"
#define MIME_INCLUDE "[include"

- /* These are for figuring out what the encoding on outgoing messages should
- * be.
- */
- #define HAVE_8BIT 1
- #define HAVE_CTRL 4
- #define HAVE_BINARY 8
-
- /* Content-Disposition */
- #define DISP_INLINE 0
- #define DISP_ATTACH 1
- #define DISP_AUTOATTACH 2
-
- #define DISPOSITION(x) (x == DISP_INLINE ? "inline" : "attachment")
- #define NONULL(x) (x ? x : "")
- #define ENCODING(x) (x >= 0 ? mime_encode_names[x] : "<ILLEGAL>")
- extern char *mime_encode_names[]; /* defined in mime.c */
-
struct mime_send_part {
/* Information for text parts */
int encoding_part ;
--- 13,18 ----
Index: elmME+.2.5.alpha0-cvs/hdrs/rc_imp.h
*** elm2.4.ME+.115/hdrs/rc_imp.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/rc_imp.h 2004-05-01 23:07:50.000000000 +0300
***************
*** 1,7 ****
! /* $Id: rc_imp.h,v 1.10 2004/03/28 13:37:38 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: rc_imp.h,v 1.10.8.2 2004/05/01 20:07:50 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 36,42 ****
rc_get_value * get_value;

} rc_DT_SYN, rc_DT_STR, rc_DT_NUM, rc_DT_BOL,
! rc_DT_CHR, rc_DT_WEE, rc_DT_ALT, rc_DT_SRT,
rc_DT_MLT, rc_DT_ASR, rc_DT_PRM, rc_DT_FUNC,
rc_DT_LONG, rc_DT_PATH, rc_DT_OBS;

--- 36,42 ----
rc_get_value * get_value;

} rc_DT_SYN, rc_DT_STR, rc_DT_NUM, rc_DT_BOL,
! rc_DT_CHR, rc_DT_SRT,
rc_DT_MLT, rc_DT_ASR, rc_DT_PRM, rc_DT_FUNC,
rc_DT_LONG, rc_DT_PATH, rc_DT_OBS;

***************
*** 54,60 ****
#define DT_NUM &rc_DT_NUM /* number */
#define DT_BOL &rc_DT_BOL /* ON/OFF (boolean) */
#define DT_WEE &rc_DT_WEE /* weed list */
- #define DT_ALT &rc_DT_ALT /* alternate addresses list */
#define DT_SRT &rc_DT_SRT /* sort-by code */
#define DT_MLT &rc_DT_MLT /* multiple destinations for data */
#define DT_ASR &rc_DT_ASR /* sort-by code */
--- 54,59 ----
***************
*** 73,80 ****
extern int is_it_on P_((char *word));
extern void weedout P_((char *string));
extern char * mode_to_str P_((int mode));
- extern void alternatives P_((char *));
-

extern int expand_dt_path P_((struct dt_path_info *ptr, char *fieldname,
char *val, int recursive));
--- 72,77 ----
Index: elmME+.2.5.alpha0-cvs/hdrs/save_opts.h
*** elm2.4.ME+.115/hdrs/save_opts.h 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/save_opts.h 2004-05-15 23:11:36.000000000 +0300
***************
*** 1,15 ****


! /* @(#)$Id: save_opts.h,v 1.82 2004/04/04 16:42:27 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.82 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************


* The Elm Mail System

*


* Copyright (c) 1988-1992 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor

*****************************************************************************/

/*
--- 1,25 ----
! /* @(#)$Id: save_opts.h,v 1.82.2.14 2004/05/15 20:11:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.82.2.14 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 hdrs/save_opts.h. That code was following copyright:
+ *


* The Elm Mail System

*


* Copyright (c) 1988-1992 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from hdrs/save_opts.h.
+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust


+ * Copyright (c) 1986,1987 Dave Taylor

*****************************************************************************/

/*
***************
*** 48,54 ****
#define PATH_sep_comma 64
#define PATH_sep_colon 128
#define PATH_quote_single 256
!

struct dt_path_info {
int flags;
--- 58,64 ----
#define PATH_sep_comma 64
#define PATH_sep_colon 128
#define PATH_quote_single 256
! #define PATH_convert_underline 512

struct dt_path_info {
int flags;
***************
*** 84,93 ****
long *l_num;
int *bol;
char *chr;
- char **weed;
- struct addr_rec **alts;
int *sort;
struct dt_path_info *path;
#ifdef USE_PGP
enum pgp_version *pgpver;
#endif
--- 94,102 ----
long *l_num;
int *bol;
char *chr;
int *sort;
struct dt_path_info *path;
+ char **mlt;
#ifdef USE_PGP
enum pgp_version *pgpver;
#endif
***************
*** 116,125 ****
#define ZZZ_DT_SRT(A) DT_SRT,0, { sort: A }, null_option_func
#define ZZZ_DT_STR(A) DT_STR,0, { str: A }, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x, { str: A }, null_option_func
- #define ZZZ_DT_ALT(A) DT_ALT,0, { alts: A }, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL,0, { bol: A }, null_option_func
#define ZZZ_DT_BOL_(x,A) DT_BOL,x, { bol: A }, null_option_func
! #define ZZZ_DT_MLT(A) DT_MLT,0, { weed: A }, null_option_func


#define ZZZ_DT_SYN(A) DT_SYN,0, { str: A }, null_option_func
#define ZZZ_DT_NUM(A) DT_NUM,0, { num: A }, null_option_func

#define ZZZ_DT_NUM_(x,A) DT_NUM,x, { num: A }, null_option_func

--- 125,133 ----
#define ZZZ_DT_SRT(A) DT_SRT,0, { sort: A }, null_option_func
#define ZZZ_DT_STR(A) DT_STR,0, { str: A }, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x, { str: A }, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL,0, { bol: A }, null_option_func
#define ZZZ_DT_BOL_(x,A) DT_BOL,x, { bol: A }, null_option_func
! #define ZZZ_DT_MLT(A) DT_MLT,0, { mlt: A }, null_option_func


#define ZZZ_DT_SYN(A) DT_SYN,0, { str: A }, null_option_func
#define ZZZ_DT_NUM(A) DT_NUM,0, { num: A }, null_option_func

#define ZZZ_DT_NUM_(x,A) DT_NUM,x, { num: A }, null_option_func

***************
*** 131,137 ****
#define ZZZ_DT_FUNC_(x,A) DT_FUNC,x, { str: NULL }, A
#define ZZZ_DT_CHR(A) &rc_DT_CHR,0, { chr: A }, null_option_func
#define ZZZ_DT_PRM(A) DT_PRM,0, { num: A }, null_option_func
- #define ZZZ_DT_WEE(A) DT_WEE,0, { weed: A }, null_option_func
#define ZZZ_DT_PATH(A) &rc_DT_PATH,0, { path: A }, null_option_func
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, { str: NULL }, null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, { shared: A }, null_option_func
--- 139,144 ----
***************
*** 158,164 ****
#define ZZZ_DT_SRT(A) DT_SRT, 0,(char *)A, null_option_func
#define ZZZ_DT_STR(A) DT_STR, 0,A, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x,A, null_option_func
- #define ZZZ_DT_ALT(A) DT_ALT, 0,(char *)A, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL, 0,(char *)A, null_option_func
#define ZZZ_DT_BOL_(x,A) DT_BOL,x,(char *)A, null_option_func


#define ZZZ_DT_MLT(A) DT_MLT,0,(char *)A, null_option_func

--- 165,170 ----
***************
*** 173,179 ****
#define ZZZ_DT_FUNC_(x,A) DT_FUNC,x,NULL, A
#define ZZZ_DT_CHR(A) &rc_DT_CHR,0,(char *)A, null_option_func
#define ZZZ_DT_PRM(A) DT_PRM,0,(char *)A, null_option_func
- #define ZZZ_DT_WEE(A) DT_WEE,0,(char *)A, null_option_func
#define ZZZ_DT_PATH(A) &rc_DT_PATH,0, (char *)A, null_option_func
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, NULL , null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, (char *)A, null_option_func
--- 179,184 ----
***************
*** 195,201 ****
of the old parameter names was dropped.
*/


static char *SIGS[]= {"remotesignature","localsignature",NULL};

! static char *ALWAYS[]= {"alwayskeep", "!alwaysstore",NULL};



static char *MAILCAPS[] = { "internal-mailcaps", "metamail-mailcaps", NULL};

static char *PROMPTAFTER[] = { "prompt-after-metamail",
--- 200,209 ----
of the old parameter names was dropped.
*/


static char *SIGS[]= {"remotesignature","localsignature",NULL};

! static char *ALWAYSLEAVE[]= {"alwayskeep", "!alwaysstore",NULL};
!
! static char *ASK[] ={"askdelete","askkeep","askstore", NULL};
! static char *AUTOCOPY[] ={"!askreplycopy","replycopy",NULL};



static char *MAILCAPS[] = { "internal-mailcaps", "metamail-mailcaps", NULL};

static char *PROMPTAFTER[] = { "prompt-after-metamail",
***************
*** 247,265 ****
{"aliassortby", -1L,ZZZ_DT_ASR(&alias_sortby), 0, NULL},
{"allow-charset-switching", -1L,ZZZ_DT_BOL(&allow_charset_switching), 0,
NULL},
{"alteditor", -1L,ZZZ_DT_STR(alternative_editor),
sizeof alternative_editor, NULL},
! {"alternatives", -1L,ZZZ_DT_ALT(&alternative_addresses), 0, NULL},
{"alwaysdelete", -1L,ZZZ_DT_BOL(&always_del), 0, NULL},
{"alwayskeep", -1L,ZZZ_DT_BOL(&always_keep), 0, NULL},
! {"alwaysleave", -1L,ZZZ_DT_MLT(ALWAYS), 0, NULL},
{"alwaysstore", -1L,ZZZ_DT_BOL(&always_store), 0, NULL},
{"arrow", -1L,ZZZ_DT_BOL_(FL_OR,&arrow_cursor), 0, NULL},
! {"ask", -1L,ZZZ_DT_BOL(&question_me), 0, NULL},
{"askcc", -1L,ZZZ_DT_BOL(&prompt_for_cc), 0, NULL},
#ifdef USE_PGP
{"askpgpsig", -1L,ZZZ_DT_BOL(&pgp_askpgpsig), 0, NULL},
#endif
{"attachment-dir", -1L,ZZZ_DT_STR(raw_attachment_dir),
sizeof raw_attachment_dir, NULL},
{"attribution", -1L,ZZZ_DT_STR(attribution),
--- 255,279 ----
{"aliassortby", -1L,ZZZ_DT_ASR(&alias_sortby), 0, NULL},
{"allow-charset-switching", -1L,ZZZ_DT_BOL(&allow_charset_switching), 0,
NULL},
+ {"allow-setuid", -1L,ZZZ_DT_BOL_(FL_SYS,&allow_setuid), 0, NULL },
+
{"alteditor", -1L,ZZZ_DT_STR(alternative_editor),
sizeof alternative_editor, NULL},
! {"alternatives", -1L,ZZZ_DT_PATH(&alternative_addresses), 0, NULL},
{"alwaysdelete", -1L,ZZZ_DT_BOL(&always_del), 0, NULL},
{"alwayskeep", -1L,ZZZ_DT_BOL(&always_keep), 0, NULL},
! {"alwaysleave", -1L,ZZZ_DT_MLT(ALWAYSLEAVE), 0, NULL},
{"alwaysstore", -1L,ZZZ_DT_BOL(&always_store), 0, NULL},
{"arrow", -1L,ZZZ_DT_BOL_(FL_OR,&arrow_cursor), 0, NULL},
! {"ask", -1L,ZZZ_DT_MLT(ASK), 0, NULL},
{"askcc", -1L,ZZZ_DT_BOL(&prompt_for_cc), 0, NULL},
+ {"askdelete", -1L,ZZZ_DT_BOL(&ask_delete), 0, NULL },
+ {"askkeep", -1L,ZZZ_DT_BOL(&ask_keep), 0, NULL },
#ifdef USE_PGP
{"askpgpsig", -1L,ZZZ_DT_BOL(&pgp_askpgpsig), 0, NULL},
#endif
+ {"askreplycopy", -1L,ZZZ_DT_BOL(&ask_reply_copy), 0, NULL },
+ {"askstore", -1L,ZZZ_DT_BOL(&ask_store), 0, NULL },
{"attachment-dir", -1L,ZZZ_DT_STR(raw_attachment_dir),
sizeof raw_attachment_dir, NULL},
{"attribution", -1L,ZZZ_DT_STR(attribution),
***************
*** 268,274 ****
sizeof auto_attachment, &AUTO_ATTACH_VALUE},
{"auto-cc", -1L,ZZZ_DT_SYN("copy"), 0, NULL},
{"auto-iso-8859", -1L,ZZZ_DT_BOL(&auto_iso_8859), 0, NULL},
! {"autocopy", -1L,ZZZ_DT_BOL(&auto_copy), 0, NULL},


#ifdef BACKGROUD_PROCESSES
{ "background-wait-time",-1L,ZZZ_DT_NUM(&background_wait_time), 0, NULL },
#endif

--- 282,288 ----
sizeof auto_attachment, &AUTO_ATTACH_VALUE},
{"auto-cc", -1L,ZZZ_DT_SYN("copy"), 0, NULL},
{"auto-iso-8859", -1L,ZZZ_DT_BOL(&auto_iso_8859), 0, NULL},
! {"autocopy", -1L,ZZZ_DT_MLT(AUTOCOPY), 0, NULL},


#ifdef BACKGROUD_PROCESSES
{ "background-wait-time",-1L,ZZZ_DT_NUM(&background_wait_time), 0, NULL },
#endif

***************
*** 292,297 ****
--- 306,312 ----
{"confirmcreate", -1L,ZZZ_DT_BOL(&confirm_create), 0, NULL},
{"confirmfiles", -1L,ZZZ_DT_BOL(&confirm_files), 0, NULL},
{"confirmfolders", -1L,ZZZ_DT_BOL(&confirm_folders), 0, NULL},
+ {"confirmtagsave", -1L,ZZZ_DT_BOL(&confirm_tag_save), 0, NULL},
{"convert-comment-to-fullname",-1L,ZZZ_DT_BOL(&convert_comment), 0, NULL},
{"convert-utf-header",-1L,ZZZ_DT_BOL(&convert_utf_header), 0, NULL},
{"copy", -1L,ZZZ_DT_BOL(&auto_copy_sent), 0, NULL},
***************
*** 306,311 ****
--- 321,327 ----
sizeof raw_display_charset, NULL},
{"dsn-success", -1L,ZZZ_DT_BOL(&DSN_success), 0, NULL },
{"easyeditor", -1L,ZZZ_DT_STR(e_editor), sizeof e_editor, NULL},
+ {"editflush", -1L,ZZZ_DT_BOL(&edit_flush), 0, NULL },
{"editor", -1L,ZZZ_DT_STR(raw_editor), sizeof raw_editor, NULL},
{"env-from-source", -1L,ZZZ_DT_NUM(&env_from_source),
sizeof env_from_source, &ENV_FROM_SOURCE},
***************
*** 319,324 ****
--- 335,341 ----
{"fragment-handling", -1L,ZZZ_DT_NUM(&fragment_handling), 0, &FRAGMENTH },
{"fullname", -1L,ZZZ_DT_STR(full_username),
sizeof full_username, NULL},
+ {"fwdattribution", -1L,ZZZ_DT_STR(fwdattribution), sizeof fwdattribution, NULL },
#ifdef USE_PGP
{"gpg", -1L,ZZZ_DT_STR(raw_gpg_path),
sizeof raw_gpg_path, NULL},
***************
*** 340,352 ****
{"imap-fast-lookup", -1L,ZZZ_DT_BOL(&imap_fast_lookup), 0, NULL},
{"imap-max-download-size", -1L, ZZZ_DT_NUM(&imap_max_dl_size), 0, NULL},
{"imap-naming-convention",-1L,ZZZ_DT_BOL(&IMAP_name_convention), 0, NULL},
! {"imap-show-error", -1L,ZZZ_DT_BOL(&IMAP_show_error), 0, NULL},
! {"imap-show-greeting", -1L,ZZZ_DT_BOL(&IMAP_show_greeting), 0, NULL},
! {"imap-show-warning", -1L,ZZZ_DT_BOL(&IMAP_show_warning), 0, NULL},
{"imap-use-examine", -1L,ZZZ_DT_BOL(&IMAP_use_examine), 0, NULL},


#endif
{"incoming-mailbox", -1L,ZZZ_DT_STR(raw_defaultfile),
sizeof raw_defaultfile, NULL },

{"internal-mailcap-prompt-trusted", -1L,
ZZZ_DT_BOL(&internal_mailcap_t_prompt), 0, NULL },
{"internal-mailcap-trusted-programs",
--- 357,370 ----
{"imap-fast-lookup", -1L,ZZZ_DT_BOL(&imap_fast_lookup), 0, NULL},
{"imap-max-download-size", -1L, ZZZ_DT_NUM(&imap_max_dl_size), 0, NULL},
{"imap-naming-convention",-1L,ZZZ_DT_BOL(&IMAP_name_convention), 0, NULL},
! {"imap-show-error", -1L,ZZZ_DT_BOL(&IMAP_show_error), 0, NULL},
! {"imap-show-greeting", -1L,ZZZ_DT_BOL(&IMAP_show_greeting), 0, NULL},
! {"imap-show-warning", -1L,ZZZ_DT_BOL(&IMAP_show_warning), 0, NULL},
{"imap-use-examine", -1L,ZZZ_DT_BOL(&IMAP_use_examine), 0, NULL},


#endif
{"incoming-mailbox", -1L,ZZZ_DT_STR(raw_defaultfile),
sizeof raw_defaultfile, NULL },

+ {"incomingfolders", -1L,ZZZ_DT_PATH(&incomingfolders), 0, NULL},
{"internal-mailcap-prompt-trusted", -1L,
ZZZ_DT_BOL(&internal_mailcap_t_prompt), 0, NULL },
{"internal-mailcap-trusted-programs",
***************
*** 432,437 ****
--- 450,457 ----
{"prefix", -1L,ZZZ_DT_STR_(FL_NOSPC,prefixchars),


sizeof prefixchars, NULL},
{"print", -1L,ZZZ_DT_STR(raw_printout), sizeof raw_printout, NULL},

+ {"printhdrs", -1L,ZZZ_DT_STR(printhdrs),
+ sizeof printhdrs, NULL },


{"printmail", -1L,ZZZ_DT_SYN("print"), 0, NULL},

{"prompt-after-metamail",-1L,ZZZ_DT_BOL(&prompt_after_metamail), 0, NULL},

{"prompt-after-pager", -1L,ZZZ_DT_BOL(&prompt_after_pager), 0, NULL},

***************
*** 444,454 ****
--- 464,476 ----
sizeof raw_recvdmail, NULL},
{"remotesignature", -1L,ZZZ_DT_STR(raw_remote_signature),
sizeof raw_remote_signature, NULL},
+ {"replycopy", -1L,ZZZ_DT_BOL(&reply_copy), 0, NULL},
{"require-mime-version-for-body-encoding",
-1L,ZZZ_DT_BOL(&req_mime_bodyencoding), 0, NULL},
{"require-mime-version-for-hdr-encoding",
-1L,ZZZ_DT_BOL(&req_mime_hdrencoding), 0, NULL},
{"resolve", -1L,ZZZ_DT_BOL(&resolve_mode), 0, NULL},
+ {"savebyalias", -1L,ZZZ_DT_BOL(&save_by_alias), 0, NULL },
{"savebyname", -1L,ZZZ_DT_SYN("savename"), 0, NULL},
{"savemail", -1L,ZZZ_DT_SYN("sentmail"), 0, NULL},
{"savename", -1L,ZZZ_DT_BOL(&save_by_name), 0, NULL},
***************
*** 461,469 ****
--- 483,493 ----
sizeof set_window_title, NULL },
{"shell", -1L,ZZZ_DT_STR(raw_shell), sizeof raw_shell, NULL},
{"show-header-errors", -1L,ZZZ_DT_BOL(&show_header_errors), 0, NULL},
+ {"showmlists", -1L,ZZZ_DT_BOL(&show_mlists), 0, NULL },
#ifdef USE_PGP

Kari E. Hurtta

unread,
May 17, 2004, 11:35:02 AM5/17/04
to
Archive-name: elmME+2.5/PLalpha0.3

Is available on ftp.funet.fi
via anonymous ftp

directory pub/unix/mail/elm/elm-ME+2.5/
files elm-ME+2.5.PLalpha0.patch.gz
and elm-ME+2.5.alpha0.tar.gz

Is available with

Before applying patch catenate part 1 - 5 first.

This patch is agaist Elm 2.4ME+ PL115 (25) --------- [ part 3/5 ] ---------
{"showpgppreamble", -1L,ZZZ_DT_BOL(&pgp_noarmor), 0, NULL},
#endif
+ {"showreply", -1L,ZZZ_DT_BOL(&show_reply), 0, NULL},
{"showto", -1L,ZZZ_DT_BOL(&showto), 0, NULL},
{"sigdashes", -1L,ZZZ_DT_BOL(&sig_dashes), 0, NULL},
{"signature", -1L,ZZZ_DT_MLT(SIGS), 0, NULL},
***************
*** 480,485 ****
--- 504,511 ----
{"titles", -1L,ZZZ_DT_BOL(&title_messages), 0, NULL},
{"tmpdir", -1L,ZZZ_DT_STR(raw_temp_dir),
sizeof raw_temp_dir, NULL},
+ {"tochars", -1L,ZZZ_DT_STR_(FL_NOSPC,to_chars),
+ sizeof to_chars, NULL},
{"unidata", -1L,ZZZ_DT_STR(raw_unidata_path),
sizeof raw_unidata_path, NULL },
#ifdef USE_DLOPEN
***************
*** 496,502 ****
{"utf7-encode-optional", -1L,ZZZ_DT_BOL(&utf7_encode_optional), 0, NULL},
{"visualeditor", -1L,ZZZ_DT_STR(v_editor), sizeof v_editor, NULL},
{"weed", -1L,ZZZ_DT_BOL(&elm_filter), 0, NULL},
! {"weedout", -1L,ZZZ_DT_WEE(weedlist), 0, NULL},
};
int NUMBER_OF_SAVEABLE_OPTIONS=(sizeof(save_info_data)/sizeof(ZZZ_SAVE_TYPE));
save_info_recs *save_info = (save_info_recs *) save_info_data;
--- 522,528 ----
{"utf7-encode-optional", -1L,ZZZ_DT_BOL(&utf7_encode_optional), 0, NULL},
{"visualeditor", -1L,ZZZ_DT_STR(v_editor), sizeof v_editor, NULL},
{"weed", -1L,ZZZ_DT_BOL(&elm_filter), 0, NULL},
! {"weedout", -1L,ZZZ_DT_PATH(&weedlist), 0, NULL},
};
int NUMBER_OF_SAVEABLE_OPTIONS=(sizeof(save_info_data)/sizeof(ZZZ_SAVE_TYPE));
save_info_recs *save_info = (save_info_recs *) save_info_data;
Index: elmME+.2.5.alpha0-cvs/hdrs/s_elm.h


*** elm2.4.ME+.115/hdrs/s_elm.h 2004-03-16 21:17:43.000000000 +0200

--- elmME+.2.5.alpha0-cvs/hdrs/s_elm.h 2004-05-16 08:52:18.000000000 +0300
***************
*** 476,484 ****
#define ElmBadLineElmrc 0x230
#define ElmBatchNoticeFoldersDir 0x231
#define ElmNoticeFoldersDir 0x232
- #define ElmTooManyWeedHeaders 0x233
- #define ElmTooManyWeedPmalloc 0x234
- #define ElmNoMemDefaultWeed 0x235
#define ElmCannotInitErrorExpanding 0x236
#define ElmCouldntMakeTempFileName 0x237
#define ElmCouldntOpenForWriting 0x238
--- 476,481 ----
***************
*** 1097,1099 ****
--- 1094,1103 ----


#define ElmCharsetBadOverride 0x865
#define ElmObsoleteInElmrc 0x866
#define ElmPgpRcvSure 0x867
+ #define ElmFailedLeaveChange 0x868

+ #define ElmInstalledSetuid 0x869
+ #define ElmCopyMessageIntoReplyYN 0x86a
+ #define ElmSavecmdSaveMarked 0x86b
+ #define ElmMlistOff 0x86c
+ #define ElmMlistOn 0x86d
+ #define ElmHelpToggleMailingList 0x86e
Index: elmME+.2.5.alpha0-cvs/hdrs/sysdefs.SH
*** elm2.4.ME+.115/hdrs/sysdefs.SH 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/hdrs/sysdefs.SH 2004-04-18 19:55:36.000000000 +0300


***************
*** 22,30 ****

echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'

! /* $Id: sysdefs.SH,v 1.23 2004/04/04 06:17:17 hurtta Exp $ */
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 22,30 ----

echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'

! /* $Id: sysdefs.SH,v 1.23.4.1 2004/04/18 16:55:36 hurtta Exp $ */
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.4.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 123,132 ****

#define MSG_SEPARATOR "\001\001\001\001\n" /* mmdf message seperator */

- #ifdef CRAY
- /* avoid conflict with typedef'd word */
- #define word wrd
- #endif /* CRAY */

#ifndef STRSTR
char *strstr();
--- 123,128 ----
Index: elmME+.2.5.alpha0-cvs/Instruct
*** elm2.4.ME+.115/Instruct 2002-01-26 13:14:44.000000000 +0200


--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************

*** 1,128 ****
- Instructions
- ------------
-
- Last Update: $Date: 1998/10/15 15:36:38 $
-
-
- This file contains instructions on how to create and install
- the entire ELM mail system. It should be read BEFORE any attempts
- are made at actually creating and/or installing any of the software
- contained herein!
-
- There is actually really one step needed - unpack all the shar
- files and then;
-
- $ cd <where-ever you're keeping the Elm sources>
-
- $ sh Configure
-
- Answer the questions of that program, then let it create the
- localized Makefiles and system definition files for you. When it's
- done you can double check the configuration (or customize it further)
- by reading the Configuration Guide and then rerunning Configure.
- There are lots of neat features that are unique to this mailer - it's
- worth a quick perusal at least!
-
- Once you're happy with the localized files, you then need to
- create the documentation (so there's a bit of a catch-22 that you need
- to format the Configuration guide before you are happy with the
- localization but can't do that until you're happy with the
- localization...oh well).
-
- $
-
- $ make documentation
-
- When that's done, or even if it fails (don't worry too much about
- it), do the following:
-
- $ make all > MAKELOG 2>&1 &
- $ tail -f MAKELOG
-
- (if you're in "csh", substitute: "make all >& MAKELOG &")
-
- This will take a fair while, so it's recommended that you go and eat
- lunch or play a game for a while!! (alternatively, spend lots of money
- on a really FAST machine and blink your eyes a few times...)
-
- Assuming there are no errors during compilation (we'll have to assume
- that for the moment) you should now be able to list the directory "bin"
- and find the following files:
-
- answer elmalias frm newalias prlong
- checkalias fastmail listalias newmail readmsg
- elm filter messages printmail
-
- next, you can install all the software on your system by;
-
- $ make install
-
- Note: On some systems the mailer runs as setgid mail to have the
- ability to WRITE to the mail directory (for lock files). If this is
- true, you will have to be root to install Elm (or some other user that
- can have the makefile set the setgid bit on the required executables).
- If you have a different scheme at your site, feel free to set it up to
- use that instead.
-
- Finally, we're just about done! The final checks can be made
- by the following commands:
-
- $ elm -z
-
- should say "no mail" if nothing's in your incoming mailbox or should
- start up the Elm program if there is, and
-
- $ elm -f test/test.mail
-
- should read in EIGHT messages from various people. While here, try to
- A)lias, A)lias current message for each of the eight messages to
- confirm that the reply/address system is working okay. Now Q)uit
- without having marked anything for deletion...answer the questions
- accordingly.
-
- If you get this far you're in wonderful shape! In fact, you're done!
-
- Congratulations! You've just installed one of the best electronic mail
- systems available today on your machine (if I say so myself!)
-
- IF UPGRADING FROM AN EARLIER VERSION OF ELM, even 2.4 beta, it will
- be necessary for all users alias files, as well as the systems alias
- file, be upgraded to the new format. Also some error checking of
- alias files has been added. All users should run the newalias command.
-
- HANDY HINTS: If you want to create a print of the entire set of
- sources, including this file, use the command:
-
- $ make listing
-
- Also, if you have a number of machines on a network, you can rlogin
- to the remote machine and then do a remote install (after checking
- to ensure that the networking copy method in the Makefile under the
- target "remote-install" is correct) by typing:
-
- $ make -f <remote Makefile> REMOTE=<remote file system> rmt-install
-
- (for example, if we had installed the system on machine "machx" and
- wanted to install it on "machy", with the Makefile in /src/Elm on
- "machx", we could type from "machy";
- $ make -f machx:/src/Elm/Makefile REMOTE=machx: rmt-install
- to have it install the system on machine y!)
-
- That's it!
- ----------
-
- This document and the entire mail system is
-
- (C) Copyright 1988-1992 by the Usenet Community Trust
- (C) Copyright 1986,1987 by Dave Taylor
-
- Elm is now in the public trust. Bug reports, comments, suggestions,
- etc. should be sent to:
-
- Elm group's address: e...@DSI.COM
- dsinc!elm
-
- Mail address: Syd Weinstein
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
--- 0 ----
Index: elmME+.2.5.alpha0-cvs/lib/add_site.c
*** elm2.4.ME+.115/lib/add_site.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/add_site.c 2004-04-18 19:55:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: add_site.c,v 1.5 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: add_site.c,v 1.5.8.1 2004/04/18 16:55:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 12,18 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"

int add_site(buffer, site, lastsite, size)
char *buffer, *site, *lastsite;
--- 12,18 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"

int add_site(buffer, site, lastsite, size)
char *buffer, *site, *lastsite;
Index: elmME+.2.5.alpha0-cvs/lib/aliasdb.c
*** elm2.4.ME+.115/lib/aliasdb.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/aliasdb.c 2004-04-18 19:55:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: aliasdb.c,v 1.8 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: aliasdb.c,v 1.8.8.1 2004/04/18 16:55:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,27 ****

**/

! #include "headers.h"
#include "ndbz.h"

#ifdef BSD_TYPE
--- 21,27 ----

**/

! #include "elm_defs.h"
#include "ndbz.h"

#ifdef BSD_TYPE
Index: elmME+.2.5.alpha0-cvs/lib/atonum.c
*** elm2.4.ME+.115/lib/atonum.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/atonum.c 2004-04-18 19:55:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: atonum.c,v 1.6 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: atonum.c,v 1.6.8.1 2004/04/18 16:55:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 11,17 ****
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include "headers.h"

/*
* This is similar to atoi(), but it complains if the string
--- 11,18 ----
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include "elm_defs.h"
!

/*
* This is similar to atoi(), but it complains if the string
Index: elmME+.2.5.alpha0-cvs/lib/bindata.c
*** elm2.4.ME+.115/lib/bindata.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/bindata.c 2004-04-25 17:52:37.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: bindata.c,v 1.4 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

! #include "headers.h"
#include "mmaputil.h"
#include "cs_imp.h"
#include "s_me.h"
--- 1,13 ----
! static char rcsid[] = "@(#)$Id: bindata.c,v 1.4.8.2 2004/04/25 14:52:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/

! #include "elm_defs.h"
!
#include "mmaputil.h"
#include "cs_imp.h"
#include "s_me.h"


***************
*** 744,750 ****
struct bindata_format_1 *v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! const char *filename;
{
int status = 0,i;
struct csets_1 *y;

--- 745,751 ----


struct bindata_format_1 *v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! CONST char *filename;
{
int status = 0,i;
struct csets_1 *y;
***************
*** 793,799 ****
struct bindata_mapped_data * v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! const char *filename;
{
int r = 0;

--- 794,800 ----


struct bindata_mapped_data * v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! CONST char *filename;
{
int r = 0;

***************
*** 988,994 ****
/* bzero is defined on hdrs/defs.h
*/

! bzero(ret, sizeof (*ret));

ret->format = bindata_format_1;
ret->v.f1.header = v;

--- 989,995 ----


/* bzero is defined on hdrs/defs.h
*/

! bzero((void *)ret, sizeof (*ret));

ret->format = bindata_format_1;
ret->v.f1.header = v;
***************
*** 999,1005 ****

struct bindata_map * give_mapping(v,mapname)
struct bindata_mapped_data *v;
! const char *mapname;
{
struct bindata_map *ret = NULL;

--- 1000,1006 ----



struct bindata_map * give_mapping(v,mapname)
struct bindata_mapped_data *v;
! CONST char *mapname;
{
struct bindata_map *ret = NULL;

Index: elmME+.2.5.alpha0-cvs/lib/can_access.c
*** elm2.4.ME+.115/lib/can_access.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/can_access.c 2004-04-18 19:55:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: can_access.c,v 1.10 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: can_access.c,v 1.10.8.1 2004/04/18 16:55:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 23,29 ****
* - K E H <hur...@ozone.FMI.FI>
*/

! #include "headers.h"
#include <errno.h>
#ifndef ANSI_C
extern int errno; /* system error number */
--- 23,29 ----
* - K E H <hur...@ozone.FMI.FI>
*/

! #include "elm_defs.h"
#include <errno.h>
#ifndef ANSI_C
extern int errno; /* system error number */
Index: elmME+.2.5.alpha0-cvs/lib/can_open.c
*** elm2.4.ME+.115/lib/can_open.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/can_open.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: can_open.c,v 1.12 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@poasti.FMI.FI>


* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: can_open.c,v 1.12.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@poasti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 16,22 ****

**/

! #include "headers.h"
#include <errno.h>
#ifndef ANSI_C
extern int errno; /* system error number */
--- 16,22 ----

**/

! #include "elm_defs.h"
#include <errno.h>
#ifndef ANSI_C
extern int errno; /* system error number */
Index: elmME+.2.5.alpha0-cvs/lib/charset.c
*** elm2.4.ME+.115/lib/charset.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/charset.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: charset.c,v 1.76 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: charset.c,v 1.76.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
***************
*** 10,16 ****
* written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"
#ifdef USE_DLOPEN
--- 10,16 ----
* written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"
#ifdef USE_DLOPEN
Index: elmME+.2.5.alpha0-cvs/lib/charset_input.c
*** elm2.4.ME+.115/lib/charset_input.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/charset_input.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: charset_input.c,v 1.6 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: charset_input.c,v 1.6.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"

Index: elmME+.2.5.alpha0-cvs/lib/chloc.c
*** elm2.4.ME+.115/lib/chloc.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/chloc.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: chloc.c,v 1.5 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: chloc.c,v 1.5.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 16,22 ****

**/

! #include "headers.h"

/* Is this really needed? This does same than strchr or index, except
* that return type is different.
--- 16,22 ----

**/

! #include "elm_defs.h"

/* Is this really needed? This does same than strchr or index, except
* that return type is different.
Index: elmME+.2.5.alpha0-cvs/lib/cs_binary.c
*** elm2.4.ME+.115/lib/cs_binary.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/cs_binary.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_binary.c,v 1.42 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cs_binary.c,v 1.42.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 25,31 ****
*
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"
#include "bindata.h"
--- 25,31 ----
*
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"
#include "bindata.h"
Index: elmME+.2.5.alpha0-cvs/lib/cs_fallback.c
*** elm2.4.ME+.115/lib/cs_fallback.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/cs_fallback.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: cs_fallback.c,v 1.6 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: cs_fallback.c,v 1.6.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"

Index: elmME+.2.5.alpha0-cvs/lib/cs_iso2022.c
*** elm2.4.ME+.115/lib/cs_iso2022.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/cs_iso2022.c 2004-04-25 17:52:37.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.35 2004/03/27 18:31:38 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"
#include "cs_terminal.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.35.8.2 2004/04/25 14:52:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"
#include "cs_terminal.h"

Index: elmME+.2.5.alpha0-cvs/lib/cs_utf.c
*** elm2.4.ME+.115/lib/cs_utf.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/cs_utf.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: cs_utf.c,v 1.27 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: cs_utf.c,v 1.27.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"

Index: elmME+.2.5.alpha0-cvs/lib/date_util.c
*** elm2.4.ME+.115/lib/date_util.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/date_util.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: date_util.c,v 1.7 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: date_util.c,v 1.7.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 11,17 ****
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"misc");

--- 11,17 ----
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"misc");

Index: elmME+.2.5.alpha0-cvs/lib/debug.c
*** elm2.4.ME+.115/lib/debug.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/debug.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: debug.c,v 1.21 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_elm.h"

#include "patchlevel.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: debug.c,v 1.21.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_elm.h"

#include "patchlevel.h"
Index: elmME+.2.5.alpha0-cvs/lib/dispaddr.c
*** elm2.4.ME+.115/lib/dispaddr.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/dispaddr.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.17 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.17.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 9,15 ****
* Initially written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"addr");

--- 9,15 ----
* Initially written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"addr");

Index: elmME+.2.5.alpha0-cvs/lib/dynarray.c
*** elm2.4.ME+.115/lib/dynarray.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/dynarray.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "$Id: dynarray.c,v 1.5 2004/03/27 18:31:38 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
*
*
* Initially written by: Michael Elkins <elk...@aero.org>, 1995/06/01
--- 1,7 ----
! static char rcsid[] = "$Id: dynarray.c,v 1.5.8.1 2004/04/18 16:55:37 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $
*
*
* Initially written by: Michael Elkins <elk...@aero.org>, 1995/06/01
***************
*** 9,15 ****

/** routines for handling of dynamic arrays **/

! #include "headers.h"

void ** DynamicArray (p, record_size, max, n)
void **p;
--- 9,15 ----

/** routines for handling of dynamic arrays **/

! #include "elm_defs.h"

void ** DynamicArray (p, record_size, max, n)
void **p;
Index: elmME+.2.5.alpha0-cvs/lib/errno.c
*** elm2.4.ME+.115/lib/errno.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/errno.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: errno.c,v 1.6 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: errno.c,v 1.6.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,28 ****

**/

! #include "headers.h"
! #include "me.h"

#ifndef STRERROR
#ifdef ERRLST
--- 21,27 ----

**/

! #include "elm_defs.h"

#ifndef STRERROR
#ifdef ERRLST
Index: elmME+.2.5.alpha0-cvs/lib/expand.c
*** elm2.4.ME+.115/lib/expand.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/expand.c 2004-05-16 10:42:23.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: expand.c,v 1.18 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This is a library routine for the various utilities that allows
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: expand.c,v 1.18.8.5 2004/05/16 07:42:23 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 lib/expand.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/read.rc:

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This is a library routine for the various utilities that allows
***************
*** 19,26 ****

**/

! #include <stdio.h>
! #include "headers.h"
#include "s_elmrc.h"

DEBUG_VAR(Debug,__FILE__,"config");
--- 29,35 ----

**/

! #include "elm_defs.h"
#include "s_elmrc.h"

DEBUG_VAR(Debug,__FILE__,"config");
***************
*** 46,51 ****
--- 55,69 ----
return 1;
}

+ static char *monthnames[12] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ };
+
+ static char *daynames[7] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+ };
+
/* Returns 0 if no expansion done
1 if expansion done
-1 on failure
***************
*** 57,65 ****
{
CONST char *src0 = src;
char *dest0 = dest;
- int check_for_env = TRUE;
int ret = 0; /* assume success */

if (destlen < 1) {
DPRINT(Debug,1,(&Debug,
"expand_path()=-1, src=%s, destlen=%d\n",
--- 75,95 ----
{
CONST char *src0 = src;
char *dest0 = dest;
int ret = 0; /* assume success */

+ time_t now;
+ struct tm *tm;
+
+
+ time(&now);
+ tm = localtime(&now);
+ if (!tm) {
+ DPRINT(Debug,1,(&Debug,
+ "expand_path()=-1, localtime failed\n"));
+ return -1;
+
+ }
+
if (destlen < 1) {
DPRINT(Debug,1,(&Debug,
"expand_path()=-1, src=%s, destlen=%d\n",
***************
*** 75,84 ****

while (destlen > 0 && *src != '\0') {

! /*
! * Check for "$NAME" at the start of every path component.
! */
! if (check_for_env && *src == '$') {
/*
* Get the environment parameter name into "envname_buf"
* and advance "src" to the next path component.
--- 105,117 ----

while (destlen > 0 && *src != '\0') {

! switch(*src) {
!
! /*
! ** Environment variable expansion
! */
! case '$': {
!
/*
* Get the environment parameter name into "envname_buf"
* and advance "src" to the next path component.
***************
*** 88,96 ****


int len, p;
char envname_buf[SLEN];

! if ((len = strcspn(src, "/@")) == 0)
! len = strlen(src);
! src += len;
strnfcpy(envname_buf, envname_front, len,
sizeof(envname_buf),NULL);

--- 121,146 ----


int len, p;
char envname_buf[SLEN];

! if ('{' == *src) {
! envname_front = ++src;
! if ((len = strcspn(src, "}")) == 0) {
! DPRINT(Debug,5,(&Debug,"Bad variable\n"));
!
! strnfcpy(dest, "${", 2, destlen,&p);
! dest += p;
! destlen -= p;
!
! continue;
! }
!
! src += len +1;
! } else {
!
! if ((len = strcspn(src, "/@%")) == 0)
! len = strlen(src);
! src += len;
! }
!
strnfcpy(envname_buf, envname_front, len,
sizeof(envname_buf),NULL);

***************
*** 99,105 ****
* parameter is undefined then copy over unchanged and set
* a fail return status.
*/
! if ((expval = getenv(envname_buf)) == NULL) {
*dest++ = '$';
--destlen;
expval = envname_buf;
--- 149,164 ----
* parameter is undefined then copy over unchanged and set
* a fail return status.
*/
!
! if (1 == len && '$' == envname_buf[0]) {
! static char buffer1[20];
!
! /* Handle $$ as pid */
! elm_sfprintf(buffer1,sizeof buffer1,
! FRM("%d"), getpid());
!
! expval = buffer1;
! } else if ((expval = getenv(envname_buf)) == NULL) {
*dest++ = '$';
--destlen;
expval = envname_buf;
***************
*** 115,130 ****
strnfcpy(dest, expval, len, destlen,&p);
dest += p;
destlen -= p;
! check_for_env = FALSE;

if (0 == ret)
ret = 1;
! } else {

- check_for_env = (*src == '/');
*dest++ = *src++;
--destlen;
!
}
}

--- 174,264 ----
strnfcpy(dest, expval, len, destlen,&p);
dest += p;
destlen -= p;
!

if (0 == ret)
ret = 1;
!
! }
! break;
!
! case '%': {
! src++;
!
! /*
! ** Handle date expansion
! */
! switch(*src) {
! int p;
!
! case 'h': /* Month name */
!
! strnfcpy(dest, monthnames[tm->tm_mon], 3, destlen,&p);
! dest += p;
! destlen -= p;
!
! break;
! case 'a': /* Day of the week */
!
! strnfcpy(dest, daynames[tm->tm_wday], 3, destlen,&p);
! dest += p;
! destlen -= p;
!
! break;
! case 'y': /* Last 2 digits of the year */
! p = elm_sfprintf(dest,destlen,FRM("%02d"),
! tm->tm_year % 100);
! dest += p;
! destlen -= p;
! break;
! case 'Y': /* Last 4 digits of the year */
! p = elm_sfprintf(dest,destlen,FRM("%04d"),
! tm->tm_year+1900);
! dest += p;
! destlen -= p;
! break;
! case 'm': /* Month number (1-12) */
! p = elm_sfprintf(dest,destlen,FRM("%02d"),
! tm->tm_mon+1);
! dest += p;
! destlen -= p;
! break;
! case 'd': /* Day of the month */
! p = elm_sfprintf(dest,destlen,FRM("%02d"),
! tm->tm_mday);
! dest += p;
! destlen -= p;
! break;
! case 'j': /* Julian day */
! p = elm_sfprintf(dest,destlen,FRM("%03d"),
! tm->tm_yday+1);
! dest += p;
! destlen -= p;
! break;
! case '%':
! if (destlen > 0)
! *dest++ = '%';
! else
! ret = -1;
! break;
! default:
! if (destlen > 1) {
! destlen -= 2;
! *dest++ = '%';
! *dest++ = *src;
! }
! else
! ret = -1;
! break;
! }
! src++;
! }
! break;
! default:

*dest++ = *src++;
--destlen;
! break;
}
}

***************
*** 235,246 ****
}

/*
! * expand_env() - Perform environment expansion on a pathname. Also
! * replaces "~" at the front of the path with the user's home directory.
! * Environment expansion occurs at the path component boundaries, e.g.
! * "/foo/$BAR/baz" is subject to expansion but "/foo/zzz$BAR/baz" is not.
! * Returns 0 if expansion successful, -1 if an error occurs (result too
! * long, cannot get home directory, or environment expansion failed).
*/
int expand_env(dest, src, destlen)
char *dest; /* pointer to space to hold the result */
--- 369,415 ----
}

/*
! ** Copy a string from the source buffer (src) to the destination buffer
! ** (dst) performing various expansions along the way:
! **
! ** Source string --> Destination string
! ** ------------- ------------------
! **
! ** $VAR value of $VAR from
! ** the environment
! **
! ** ${VAR} same as above.
! **
! ** ~/ user's home directory
! **
! ** %h current month name
! ** (3 letter abbreviation)
! **
! ** %y current year (modulo 100)
! **
! ** %Y current year
! **
! ** %m current month number (01-12)
! **
! ** %j day of the year (001-366)
! **
! ** %d day of the month (01-31)
! **
! ** %% % character
! **
! ** Returns: 0 if successful, -1 if error occurs
! **
! ** Example:
! **
! ** JUNK = bar in the current environment:
! ** Current date = 1/1/95
! **
! ** ~/$JUNK/mail.%h%y --> /usr/whoever/bar/mail.Jan95
! **
! ** if you want to embed "$JUNK" within a string, use '{}':
! **
! ** ~/${JUNK}xx/mail.%h%y --> /usr/whoever/barxx/mail.Jan95
! **
*/
int expand_env(dest, src, destlen)
char *dest; /* pointer to space to hold the result */
Index: elmME+.2.5.alpha0-cvs/lib/expires.c
*** elm2.4.ME+.115/lib/expires.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/expires.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,4 ****
! static char rcsid[] = "@(#)$Id: expires.c,v 1.3 2004/03/27 18:31:38 hurtta Exp $";

/*****************************************************************************
* This code is reimpleted. Original code was following copyright:
--- 1,4 ----
! static char rcsid[] = "@(#)$Id: expires.c,v 1.3.8.1 2004/04/18 16:55:37 hurtta Exp $";

/*****************************************************************************
* This code is reimpleted. Original code was following copyright:
***************
*** 13,20 ****
current message if it is true...
**/

! #include "headers.h"
! #include "me.h"

DEBUG_VAR(Debug,__FILE__,"misc");

--- 13,19 ----
current message if it is true...
**/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"misc");

Index: elmME+.2.5.alpha0-cvs/lib/file_util.c
*** elm2.4.ME+.115/lib/file_util.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/file_util.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.9 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.9.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 14,20 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "s_elm.h"
#include <errno.h>
--- 14,20 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "s_elm.h"
#include <errno.h>
Index: elmME+.2.5.alpha0-cvs/lib/forwarded.c
*** elm2.4.ME+.115/lib/forwarded.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/forwarded.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forwarded.c,v 1.6 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forwarded.c,v 1.6.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 15,21 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"mbox");

--- 15,21 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"mbox");

Index: elmME+.2.5.alpha0-cvs/lib/gcos_name.c
*** elm2.4.ME+.115/lib/gcos_name.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/gcos_name.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: gcos_name.c,v 1.9 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: gcos_name.c,v 1.9.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 12,18 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"

char * gcos_name(gcos_field, logname)
CONST char *logname, *gcos_field;
--- 12,18 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"

char * gcos_name(gcos_field, logname)
CONST char *logname, *gcos_field;
Index: elmME+.2.5.alpha0-cvs/lib/getaddr.c
*** elm2.4.ME+.115/lib/getaddr.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/getaddr.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,14 ****
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.22 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

* Content partially moved from melib/parse_util.c
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"addr");

--- 1,14 ----
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.22.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

* Content partially moved from melib/parse_util.c
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"addr");

Index: elmME+.2.5.alpha0-cvs/lib/getaddrfrm.c
*** elm2.4.ME+.115/lib/getaddrfrm.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/getaddrfrm.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getaddrfrm.c,v 1.8 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
*
* Reimplemented by: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: getaddrfrm.c,v 1.8.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $
*
* Reimplemented by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 14,20 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"addr");

--- 14,20 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"addr");

Index: elmME+.2.5.alpha0-cvs/lib/getarpdate.c
*** elm2.4.ME+.115/lib/getarpdate.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/getarpdate.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getarpdate.c,v 1.8 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: getarpdate.c,v 1.8.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 12,18 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"

CONST char *arpa_dayname[8] = { "Sun", "Mon", "Tue", "Wed", "Thu",
"Fri", "Sat", "" };
--- 12,18 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"

CONST char *arpa_dayname[8] = { "Sun", "Mon", "Tue", "Wed", "Thu",
"Fri", "Sat", "" };
Index: elmME+.2.5.alpha0-cvs/lib/getfullnam.c
*** elm2.4.ME+.115/lib/getfullnam.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/getfullnam.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getfullnam.c,v 1.6 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: getfullnam.c,v 1.6.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 16,22 ****

**/

! #include "headers.h"
#ifdef PWDINSYS
# include <sys/pwd.h>
#else
--- 16,22 ----

**/

! #include "elm_defs.h"
#ifdef PWDINSYS
# include <sys/pwd.h>
#else
Index: elmME+.2.5.alpha0-cvs/lib/get_tz.c
*** elm2.4.ME+.115/lib/get_tz.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/get_tz.c 2004-04-18 19:55:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: get_tz.c,v 1.11 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: get_tz.c,v 1.11.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 11,17 ****
* Copyright (c) 1992, 1993 USENET Community Trust
*****************************************************************************/

! #include "headers.h"

#ifdef _CONFIGURE
/*
--- 11,17 ----
* Copyright (c) 1992, 1993 USENET Community Trust
*****************************************************************************/

! #include "elm_defs.h"

#ifdef _CONFIGURE
/*
Index: elmME+.2.5.alpha0-cvs/lib/getword.c
*** elm2.4.ME+.115/lib/getword.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/getword.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getword.c,v 1.5 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: getword.c,v 1.5.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 11,18 ****
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include <stdio.h>
! #include "headers.h"

int get_word(buffer, start, word, wordlen)
CONST char *buffer;
--- 11,17 ----
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include "elm_defs.h"

int get_word(buffer, start, word, wordlen)
CONST char *buffer;
Index: elmME+.2.5.alpha0-cvs/lib/hdrdecode.c
*** elm2.4.ME+.115/lib/hdrdecode.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/hdrdecode.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrdecode.c,v 1.13 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrdecode.c,v 1.13.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 9,15 ****
* written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"mime");
--- 9,15 ----
* written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"mime");
Index: elmME+.2.5.alpha0-cvs/lib/hdrencode.c
*** elm2.4.ME+.115/lib/hdrencode.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/hdrencode.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrencode.c,v 1.11 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrencode.c,v 1.11.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 9,15 ****
* written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"mime");
--- 9,15 ----
* written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"mime");
Index: elmME+.2.5.alpha0-cvs/lib/header_cmp.c
*** elm2.4.ME+.115/lib/header_cmp.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/header_cmp.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: header_cmp.c,v 1.4 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: header_cmp.c,v 1.4.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,27 ****

**/

! #include "headers.h"

char * header_cmp(header, prefix, suffix)
char *header, *prefix, *suffix;
--- 21,27 ----

**/

! #include "elm_defs.h"

char * header_cmp(header, prefix, suffix)
char *header, *prefix, *suffix;
Index: elmME+.2.5.alpha0-cvs/lib/headers.c
*** elm2.4.ME+.115/lib/headers.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/headers.c 2004-05-15 23:11:36.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: headers.c,v 1.29 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "hdr_imp.h"
#include "s_me.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: headers.c,v 1.29.8.3 2004/05/15 20:11:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "hdr_imp.h"
#include "s_me.h"

***************
*** 158,163 ****
--- 158,167 ----
} else if ('<' == tokens[i][0]) {
int j;

+ /* Add missing space wetween phrase and < > */
+ if (i > 0)
+ add_ascii_to_string(result,us_str(" "));
+
R = new_string(defcharset);
add_ascii_to_string(R,us_str(tokens[i]));



***************
*** 400,406 ****
static int no_add_to_mail_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;

--- 404,410 ----


static int no_add_to_mail_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;

***************
*** 448,453 ****
--- 452,460 ----
{ "Content-Disposition", hdr_decode_from_comment, no_add_to_mail_hdr },
/* From RFC 1864 */
{ "Content-MD5", hdr_decode_from_raw, no_add_to_mail_hdr },
+
+ /* From RFC 2919 */
+ { "List-Id", hdr_decode_from_phrase, no_add_to_mail_hdr },

/* mailbox format */
{ "Content-Length", hdr_decode_from_raw, no_add_to_mail_hdr },
Index: elmME+.2.5.alpha0-cvs/lib/id_phrase.c
*** elm2.4.ME+.115/lib/id_phrase.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/id_phrase.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: id_phrase.c,v 1.5 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"header");

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: id_phrase.c,v 1.5.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"header");

Index: elmME+.2.5.alpha0-cvs/lib/imap.c
*** elm2.4.ME+.115/lib/imap.c 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/imap.c 2004-05-01 10:41:05.000000000 +0300
***************
*** 1,12 ****


! static char rcsid[] = "@(#)$Id: imap.c,v 1.104 2004/04/04 06:17:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.104 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"
#include "s_me.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: imap.c,v 1.104.4.2 2004/05/01 07:41:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.104.4.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "ss_imp.h"
#include "mbx_imp.h"
#include "s_me.h"
***************
*** 178,184 ****
long mask_imap;
} IMAP_flags[] = {
{ "\\Seen", 0, IMAP_Seen },
! { "\\Answered", REPLIED, IMAP_Answered },
{ "\\Flagged", TAGGED, IMAP_Flagged },
{ "\\Deleted", DELETED, IMAP_Deleted },
{ "\\Draft", 0, IMAP_Draft },
--- 178,184 ----
long mask_imap;
} IMAP_flags[] = {
{ "\\Seen", 0, IMAP_Seen },
! { "\\Answered", REPLIED_TO, IMAP_Answered },
{ "\\Flagged", TAGGED, IMAP_Flagged },
{ "\\Deleted", DELETED, IMAP_Deleted },
{ "\\Draft", 0, IMAP_Draft },
Index: elmME+.2.5.alpha0-cvs/lib/in_string.c
*** elm2.4.ME+.115/lib/in_string.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/in_string.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_string.c,v 1.4 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: in_string.c,v 1.4.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 16,22 ****

**/

! #include "headers.h"

/* Is that needed? This is almost same as strstr (except return type).
* - K E H <hur...@ozone.FMI.FI>
--- 16,22 ----

**/

! #include "elm_defs.h"

/* Is that needed? This is almost same as strstr (except return type).
* - K E H <hur...@ozone.FMI.FI>
Index: elmME+.2.5.alpha0-cvs/lib/iso2022.c
*** elm2.4.ME+.115/lib/iso2022.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/iso2022.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.29 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.29.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"

Index: elmME+.2.5.alpha0-cvs/lib/iso2022_map.c
*** elm2.4.ME+.115/lib/iso2022_map.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/iso2022_map.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: iso2022_map.c,v 1.9 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: iso2022_map.c,v 1.9.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"

Index: elmME+.2.5.alpha0-cvs/lib/istrcmp.c
*** elm2.4.ME+.115/lib/istrcmp.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/istrcmp.c 2004-04-18 19:55:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: istrcmp.c,v 1.7 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: istrcmp.c,v 1.7.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 16,23 ****

**/

! #include "headers.h"
! #include "me.h"

/* This is same than strcasecmp. - K E H <hur...@ozone.FMI.FI> */
int istrcmp(s1,s2)
--- 16,22 ----

**/

! #include "elm_defs.h"

/* This is same than strcasecmp. - K E H <hur...@ozone.FMI.FI> */
int istrcmp(s1,s2)
Index: elmME+.2.5.alpha0-cvs/lib/ldstate.c
*** elm2.4.ME+.115/lib/ldstate.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/ldstate.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.11 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.11.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 11,17 ****
* Copyright (c) 1992 USENET Community Trust
*****************************************************************************/

! #include "headers.h"

/*
* Retrieve Elm folder state.
--- 11,17 ----
* Copyright (c) 1992 USENET Community Trust
*****************************************************************************/

! #include "elm_defs.h"

/*
* Retrieve Elm folder state.
Index: elmME+.2.5.alpha0-cvs/lib/len_next.c
*** elm2.4.ME+.115/lib/len_next.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/len_next.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: len_next.c,v 1.6 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: len_next.c,v 1.6.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 29,35 ****

**/

! #include "headers.h"

int len_next_part(str)
CONST char *str;
--- 29,35 ----

**/

! #include "elm_defs.h"

int len_next_part(str)
CONST char *str;
Index: elmME+.2.5.alpha0-cvs/lib/localmbx.c
*** elm2.4.ME+.115/lib/localmbx.c 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/localmbx.c 2004-05-01 10:41:05.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.64 2004/04/04 06:17:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.64.4.3 2004/05/01 07:41:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64.4.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 15,21 ****
*****************************************************************************/


! #include "headers.h"
#include "mbx_imp.h"
#include "s_me.h"
#include "s_elm.h"
--- 15,21 ----
*****************************************************************************/


! #include "elm_defs.h"
#include "mbx_imp.h"


#include "s_me.h"
#include "s_elm.h"
***************

" (read %1.1f minutes ago)\n",
! (double)(now - buf2.st_atime) / 60.0));


}
DPRINT(Debug,2,(&Debug,
"mbx_dotlock_file: can remove = %d \n",

***************
*** 4898,4904 ****
putc('O',keep_state_ptr->a.file.keep_file);
count ++;
}
! if (ison(entry->status, REPLIED)) {
putc('r',keep_state_ptr->a.file.keep_file);
count ++;
}
--- 4898,4904 ----
putc('O',keep_state_ptr->a.file.keep_file);
count ++;
}
! if (ison(entry->status, REPLIED_TO)) {
putc('r',keep_state_ptr->a.file.keep_file);
count ++;
}
Index: elmME+.2.5.alpha0-cvs/lib/mailer.c
*** elm2.4.ME+.115/lib/mailer.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/mailer.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: mailer.c,v 1.46 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_elm.h"

#include "mailer_imp.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: mailer.c,v 1.46.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_elm.h"

#include "mailer_imp.h"
Index: elmME+.2.5.alpha0-cvs/lib/mail_gets.c
*** elm2.4.ME+.115/lib/mail_gets.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/mail_gets.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.8 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.8.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 17,23 ****

**/

! #include "headers.h"

int mail_gets(buffer, size, mailfile)
char *buffer;
--- 17,23 ----

**/

! #include "elm_defs.h"

int mail_gets(buffer, size, mailfile)
char *buffer;
Index: elmME+.2.5.alpha0-cvs/lib/Makefile.SH
*** elm2.4.ME+.115/lib/Makefile.SH 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/Makefile.SH 2004-04-18 19:55:36.000000000 +0300
***************


*** 46,52 ****
echo "Extracting lib/Makefile (with variable substitutions)"

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.89 2004/03/28 13:37:39 hurtta Exp $


#
# Makefile for the ELM mail program.
#

--- 46,52 ----
echo "Extracting lib/Makefile (with variable substitutions)"

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.89.8.1 2004/04/18 16:55:36 hurtta Exp $


#
# Makefile for the ELM mail program.
#
***************

*** 370,387 ****

# Dependencies and rules
# Dependencies of header files upon other header files they include
! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h \
! $(INCLDIR)/headers.h $(INCLDIR)/shared_imp.h

! $(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h


$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elm.h: $(INCLDIR)/defs.h $(INCLDIR)/melib.h

! $(CHMOD) u+w $@
! $(TOUCH) $@
!

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/elmlib.h $(INCLDIR)/me.h
$(CHMOD) u+w $@
$(TOUCH) $@

--- 370,384 ----

# Dependencies and rules
# Dependencies of header files upon other header files they include
! .PRECIOUS: $(INCLDIR)/elm_defs.h $(INCLDIR)/shared_imp.h \
! $(INCLDIR)/defs_major.h

! $(INCLDIR)/elm_defs.h: $(INCLDIR)/defs_major.h $(INCLDIR)/elm_nl_types.h \
! $(INCLDIR)/elmlib.h


$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/defs_major.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h


$(CHMOD) u+w $@
$(TOUCH) $@

***************

*** 393,519 ****
# Simple files ...
putenv.o: $(INCLDIR)/defs_major.h
strstr.o: $(INCLDIR)/defs_major.h



# --- Dependencies of C object files

! add_site.o: $(INCLDIR)/headers.h
! atonum.o: $(INCLDIR)/headers.h
! bindata.o: $(INCLDIR)/headers.h $(INCLDIR)/mmaputil.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/s_me.h $(INCLDIR)/bindata.h
! mmaputil.o: $(INCLDIR)/headers.h $(INCLDIR)/mmaputil.h
! dynarray.o: $(INCLDIR)/headers.h
! mk_aliases.o: $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_newalias.h
! aliasdb.o: $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
! mk_lockname.o: $(INCLDIR)/headers.h
! can_access.o: $(INCLDIR)/headers.h
! can_open.o: $(INCLDIR)/headers.h
! chloc.o: $(INCLDIR)/headers.h
! charset.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/shared_imp.h
! precompiled_sets.o: $(INCLDIR)/cs_imp.h $(INCLDIR)/elmlib.h $(INCLDIR)/defs.h
! charset_input.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_binary.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/bindata.h
! cs_fallback.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_utf.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_iso2022.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
! date_util.o: $(INCLDIR)/headers.h
! debug.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/patchlevel.h
! dispaddr.o: $(INCLDIR)/headers.h
! errno.o: $(INCLDIR)/headers.h
! expand.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elmrc.h
! expires.o: $(INCLDIR)/headers.h
! forwarded.o: $(INCLDIR)/headers.h
! file_util.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h
! gcos_name.o: $(INCLDIR)/headers.h
! get_tz.o: $(INCLDIR)/headers.h
! getaddr.o: $(INCLDIR)/headers.h
! getaddrfrm.o: $(INCLDIR)/headers.h
! getarpdate.o: $(INCLDIR)/headers.h
! getfullnam.o: $(INCLDIR)/headers.h
! getword.o: $(INCLDIR)/headers.h
! hdrdecode.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h
! hdrencode.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h
! header_cmp.o: $(INCLDIR)/headers.h
! headers.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/hdr_imp.h
! in_string.o: $(INCLDIR)/headers.h
! iso2022.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! iso2022_map.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! imap.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h
! istrcmp.o: $(INCLDIR)/headers.h
! ldstate.o: $(INCLDIR)/headers.h
! len_next.o: $(INCLDIR)/headers.h
! localmbx.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h
! mail_gets.o: $(INCLDIR)/headers.h
! mailer.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/mailer_imp.h $(INCLDIR)/shared_imp.h
! mediatype.o: $(INCLDIR)/headers.h
! mbox.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h
! mgets.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h
! move_left.o: $(INCLDIR)/headers.h
! msgcat.o: $(INCLDIR)/msgcat.h $(INCLDIR)/headers.h
! ndbz.o: $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
! okay_addr.o: $(INCLDIR)/headers.h
! opt_utils.o: $(INCLDIR)/headers.h $(INCLDIR)/s_error.h
! outheaders.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/hdr_imp.h
! id_phrase.o: $(INCLDIR)/headers.h
! output.o: $(INCLDIR)/headers.h
! panic.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h
! parsarpdat.o: $(INCLDIR)/headers.h
! pmalloc.o: $(INCLDIR)/defs.h $(INCLDIR)/s_elm.h
! pop.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h
! posixsig.o: $(INCLDIR)/headers.h
! rc_handle.o: $(INCLDIR)/headers.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/s_elm.h $(INCLDIR)/rc_imp.h $(INCLDIR)/shared_imp.h
! read_rc.o: $(INCLDIR)/headers.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h $(INCLDIR)/rc_imp.h \
$(INCLDIR)/unidata.h $(INCLDIR)/cs_imp.h
! realfrom.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h
! remote_mbx.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h $(INCLDIR)/ss_imp.h
! qstrings.o: $(INCLDIR)/headers.h
! reverse.o: $(INCLDIR)/headers.h
! rfc822tlen.o: $(INCLDIR)/headers.h
! stringtok.o: $(INCLDIR)/headers.h
! safemalloc.o: $(INCLDIR)/headers.h
! savefolder.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/mbx_imp.h
! shared.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/shared_imp.h $(INCLDIR)/mbx_imp.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/cs_imp.h $(INCLDIR)/ss_imp.h \
$(INCLDIR)/mailer_imp.h
! shared_connect.o: $(INCLDIR)/headers.h \
$(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h $(INCLDIR)/mailer_imp.h
! shared_base.o: $(INCLDIR)/headers.h \
$(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
! shared_all.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h \
$(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
! sb_file.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
! sb_mem.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
! schedule.o: $(INCLDIR)/headers.h
! service_list.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h $(INCLDIR)/ss_imp.h
! shiftlower.o: $(INCLDIR)/headers.h
! state.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h
! streamsched.o: $(INCLDIR)/headers.h $(INCLDIR)/ss_imp.h $(INCLDIR)/mbx_imp.h \
$(INCLDIR)/shared_imp.h
! strfcpy.o: $(INCLDIR)/headers.h
! string.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/shared_imp.h
! stringbuffer.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
! strmcpy.o: $(INCLDIR)/headers.h
! strincmp.o: $(INCLDIR)/headers.h
! striparens.o: $(INCLDIR)/headers.h
! strtokq.o: $(INCLDIR)/headers.h
! syscall.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h
! terminal.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h


! unicode.o: $(INCLDIR)/headers.h $(INCLDIR)/mmaputil.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/unidata.h

! unidata.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/unidata.h
! write_hdr.o: $(INCLDIR)/headers.h
!NO!SUBS!



if $test "$d_shared" = "$define" ; then

--- 390,517 ----
# Simple files ...
putenv.o: $(INCLDIR)/defs_major.h
strstr.o: $(INCLDIR)/defs_major.h
+ safeopen.o: $(INCLDIR)/defs_major.h



# --- Dependencies of C object files

! add_site.o: $(INCLDIR)/elm_defs.h
! atonum.o: $(INCLDIR)/elm_defs.h
! bindata.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/mmaputil.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/s_me.h $(INCLDIR)/bindata.h
! mmaputil.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/mmaputil.h
! dynarray.o: $(INCLDIR)/elm_defs.h
! mk_aliases.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_newalias.h
! aliasdb.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/ndbz.h
! mk_lockname.o: $(INCLDIR)/elm_defs.h
! can_access.o: $(INCLDIR)/elm_defs.h
! can_open.o: $(INCLDIR)/elm_defs.h
! chloc.o: $(INCLDIR)/elm_defs.h
! charset.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/shared_imp.h
! precompiled_sets.o: $(INCLDIR)/cs_imp.h $(INCLDIR)/elmlib.h $(INCLDIR)/elm_defs.h
! charset_input.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_binary.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/bindata.h
! cs_fallback.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_utf.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_iso2022.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
! date_util.o: $(INCLDIR)/elm_defs.h
! debug.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/patchlevel.h
! dispaddr.o: $(INCLDIR)/elm_defs.h
! errno.o: $(INCLDIR)/elm_defs.h
! expand.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elmrc.h
! expires.o: $(INCLDIR)/elm_defs.h
! forwarded.o: $(INCLDIR)/elm_defs.h
! file_util.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h
! gcos_name.o: $(INCLDIR)/elm_defs.h
! get_tz.o: $(INCLDIR)/elm_defs.h
! getaddr.o: $(INCLDIR)/elm_defs.h
! getaddrfrm.o: $(INCLDIR)/elm_defs.h
! getarpdate.o: $(INCLDIR)/elm_defs.h
! getfullnam.o: $(INCLDIR)/elm_defs.h
! getword.o: $(INCLDIR)/elm_defs.h
! hdrdecode.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
! hdrencode.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
! header_cmp.o: $(INCLDIR)/elm_defs.h
! headers.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/hdr_imp.h
! in_string.o: $(INCLDIR)/elm_defs.h
! iso2022.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! iso2022_map.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! imap.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h
! istrcmp.o: $(INCLDIR)/elm_defs.h
! ldstate.o: $(INCLDIR)/elm_defs.h
! len_next.o: $(INCLDIR)/elm_defs.h
! localmbx.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h
! mail_gets.o: $(INCLDIR)/elm_defs.h
! mailer.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/mailer_imp.h $(INCLDIR)/shared_imp.h
! mediatype.o: $(INCLDIR)/elm_defs.h
! mbox.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h
! move_left.o: $(INCLDIR)/elm_defs.h
! msgcat.o: $(INCLDIR)/msgcat.h $(INCLDIR)/elm_defs.h
! ndbz.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/ndbz.h
! okay_addr.o: $(INCLDIR)/elm_defs.h
! opt_utils.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_error.h
! outheaders.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/hdr_imp.h
! id_phrase.o: $(INCLDIR)/elm_defs.h
! output.o: $(INCLDIR)/elm_defs.h
! panic.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
! parsarpdat.o: $(INCLDIR)/elm_defs.h
! pmalloc.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h
! pop.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h
! posixsig.o: $(INCLDIR)/elm_defs.h
! rc_handle.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/s_elm.h $(INCLDIR)/rc_imp.h $(INCLDIR)/shared_imp.h
! read_rc.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h $(INCLDIR)/rc_imp.h \
$(INCLDIR)/unidata.h $(INCLDIR)/cs_imp.h
! realfrom.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h
! remote_mbx.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h $(INCLDIR)/ss_imp.h
! qstrings.o: $(INCLDIR)/elm_defs.h
! reverse.o: $(INCLDIR)/elm_defs.h
! rfc822tlen.o: $(INCLDIR)/elm_defs.h
! stringtok.o: $(INCLDIR)/elm_defs.h
! safemalloc.o: $(INCLDIR)/elm_defs.h
! savefolder.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/mbx_imp.h
! shared.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/shared_imp.h $(INCLDIR)/mbx_imp.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/cs_imp.h $(INCLDIR)/ss_imp.h \
$(INCLDIR)/mailer_imp.h
! shared_connect.o: $(INCLDIR)/elm_defs.h \
$(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h $(INCLDIR)/mailer_imp.h
! shared_base.o: $(INCLDIR)/elm_defs.h \
$(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
! shared_all.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
$(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
! sb_file.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
! sb_mem.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
! schedule.o: $(INCLDIR)/elm_defs.h
! service_list.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h $(INCLDIR)/ss_imp.h
! shiftlower.o: $(INCLDIR)/elm_defs.h
! state.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
! streamsched.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/ss_imp.h $(INCLDIR)/mbx_imp.h \
$(INCLDIR)/shared_imp.h
! strfcpy.o: $(INCLDIR)/elm_defs.h
! strftime.o: $(INCLDIR)/elm_defs.h
! string.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/shared_imp.h
! stringbuffer.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
! strmcpy.o: $(INCLDIR)/elm_defs.h
! strincmp.o: $(INCLDIR)/elm_defs.h
! striparens.o: $(INCLDIR)/elm_defs.h
! strtokq.o: $(INCLDIR)/elm_defs.h
! syscall.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h
! terminal.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
! unicode.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/unidata.h
! unidata.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/unidata.h
! write_hdr.o: $(INCLDIR)/elm_defs.h
!NO!SUBS!



if $test "$d_shared" = "$define" ; then

Index: elmME+.2.5.alpha0-cvs/lib/mbox.c
*** elm2.4.ME+.115/lib/mbox.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/mbox.c 2004-05-01 10:41:05.000000000 +0300
***************
*** 1,21 ****
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Based on code ../src/newmbox.c and ../src/lock.c.,
! * show_message_status() is based on show_status() on ../src/screen.c.


* That code was following copyright:

*
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor

*****************************************************************************/

! #include "headers.h"
#include "mbx_imp.h"
#ifdef USE_DLOPEN
#include "shared_imp.h"
--- 1,29 ----
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51.8.4 2004/05/01 07:41:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Based on Elm 2.4 code src/newmbox.c and src/lock.c,
! * show_message_status() is based on show_status() on src/screen.c.


* That code was following copyright:

*
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/screen.c (show_message_status()):


+ * That code was following copyright:
+ *

+ * The Elm Mail System - $Revision: 1.51.8.4 $ $State: Exp $
+ *


+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"
#include "mbx_imp.h"
#ifdef USE_DLOPEN
#include "shared_imp.h"


***************
*** 144,150 ****
*ptr));

/* bzero is defined hdrs/defs.h */
! bzero(*ptr,sizeof (struct read_folder_state));

(*ptr) -> magic = RF_magic;
(*ptr) -> fbytes = 0;

--- 152,158 ----


*ptr));

/* bzero is defined hdrs/defs.h */
! bzero((void *)*ptr,sizeof (struct read_folder_state));

(*ptr) -> magic = RF_magic;
(*ptr) -> fbytes = 0;
***************
*** 166,172 ****
*ptr));

/* bzero is defined hdrs/defs.h */
! bzero(*ptr,sizeof (struct read_folder_state));

free(*ptr);
*ptr = NULL;

--- 174,180 ----


*ptr));

/* bzero is defined hdrs/defs.h */
! bzero((void *)*ptr,sizeof (struct read_folder_state));

free(*ptr);
*ptr = NULL;
***************

*** 605,610 ****
--- 613,619 ----
**/

struct stat bufX, *buf = NULL; /* stat command */
+ char ** inf = NULL;

if (in_mail)
*in_mail = in_none;
***************
*** 661,666 ****
--- 670,691 ----
}
}

+ inf = give_dt_path_as_elems(&incomingfolders,"incomingfolders");
+ if (inf) {
+ int i;
+
+ for (i = 0; inf[i]; i++) {
+ if (strcmp(filename,inf[i]) == 0) {
+
+ DPRINT(Debug,8,(&Debug,
+ "get_folder_type=SPOOL (on incomingfolders list)\n"));
+ return(SPOOL);


+
+ }
+ }
+ }
+
+

/* if file name == default mailbox, its a spool file also
* even if its not in the spool directory. (SVR4)
*/


***************
*** 839,845 ****
new_folder = safe_malloc(sizeof (struct folder_info));

/* defined in hdrs/defs.h */
! bzero(new_folder,sizeof (struct folder_info));

new_folder -> p = NULL;
new_folder -> cur_folder_sys = NULL;

--- 864,870 ----


new_folder = safe_malloc(sizeof (struct folder_info));

/* defined in hdrs/defs.h */
! bzero((void *)new_folder,sizeof (struct folder_info));

new_folder -> p = NULL;
new_folder -> cur_folder_sys = NULL;

***************
*** 2013,2019 ****
else if (hdr->status & EXPIRED) mybuffer[0] = 'E';
else if (hdr->status & NEW) mybuffer[0] = 'N';
else if (hdr->status & UNREAD) mybuffer[0] = 'O';
! else if (hdr->status & REPLIED) mybuffer[0] = 'r';
}

/** and the second... **/
--- 2038,2045 ----
else if (hdr->status & EXPIRED) mybuffer[0] = 'E';
else if (hdr->status & NEW) mybuffer[0] = 'N';
else if (hdr->status & UNREAD) mybuffer[0] = 'O';
! else if ((show_reply) &&
! (hdr->status & REPLIED_TO)) mybuffer[0] = 'r';
}

/** and the second... **/
Index: elmME+.2.5.alpha0-cvs/lib/mediatype.c
*** elm2.4.ME+.115/lib/mediatype.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/mediatype.c 2004-04-25 17:52:38.000000000 +0300
***************
*** 1,13 ****
! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.12 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/


! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"config");

--- 1,13 ----
! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.12.8.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/


! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"config");

***************

Index: elmME+.2.5.alpha0-cvs/lib/mk_aliases.c
*** elm2.4.ME+.115/lib/mk_aliases.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/mk_aliases.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 1.11 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 1.11.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,33 ****

**/

! #include "headers.h"
#include "s_newalias.h"
#include "ndbz.h"

--- 27,33 ----

**/

! #include "elm_defs.h"
#include "s_newalias.h"
#include "ndbz.h"

Index: elmME+.2.5.alpha0-cvs/lib/mk_lockname.c
*** elm2.4.ME+.115/lib/mk_lockname.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/mk_lockname.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mk_lockname.c,v 1.5 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mk_lockname.c,v 1.5.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 12,21 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include <stdio.h>
! #include <fcntl.h>
! #include <errno.h>
! #include "headers.h"

static char lock_name[SLEN];

--- 12,18 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"

static char lock_name[SLEN];

Index: elmME+.2.5.alpha0-cvs/lib/mmaputil.c
*** elm2.4.ME+.115/lib/mmaputil.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/mmaputil.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: mmaputil.c,v 1.5 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "mmaputil.h"
#include <errno.h>
#ifndef ANSI_C
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: mmaputil.c,v 1.5.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "mmaputil.h"
#include <errno.h>
#ifndef ANSI_C
Index: elmME+.2.5.alpha0-cvs/lib/move_left.c
*** elm2.4.ME+.115/lib/move_left.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/move_left.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: move_left.c,v 1.4 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: move_left.c,v 1.4.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 16,22 ****

**/

! #include "headers.h"


void move_left(string, chars)
--- 16,22 ----

**/

! #include "elm_defs.h"


void move_left(string, chars)
Index: elmME+.2.5.alpha0-cvs/lib/msgcat.c
*** elm2.4.ME+.115/lib/msgcat.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/msgcat.c 2004-04-18 19:55:39.000000000 +0300


***************
*** 1,5 ****
!

! static char rcsid[] = "@(#)$Id: msgcat.c,v 1.4 2004/03/27 18:31:39 hurtta Exp $";

/* -*- c++ -*- */

--- 1,4 ----
! static char rcsid[] = "@(#)$Id: msgcat.c,v 1.4.8.1 2004/04/18 16:55:39 hurtta Exp $";

/* -*- c++ -*- */

***************
*** 50,56 ****
* to add an error handling routine.
*/

! #include "headers.h"

/*
#include "nl_types.h"
--- 49,55 ----
* to add an error handling routine.
*/

! #include "elm_defs.h"

/*
#include "nl_types.h"
Index: elmME+.2.5.alpha0-cvs/lib/ndbz.c
*** elm2.4.ME+.115/lib/ndbz.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/ndbz.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.7 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.7.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 44,50 ****

*/

! #include "headers.h"
#include <errno.h>
#ifndef ANSI_C
extern int errno;
--- 44,50 ----

*/

! #include "elm_defs.h"
#include <errno.h>
#ifndef ANSI_C
extern int errno;
Index: elmME+.2.5.alpha0-cvs/lib/okay_addr.c
*** elm2.4.ME+.115/lib/okay_addr.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/okay_addr.c 2004-05-01 23:07:50.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: okay_addr.c,v 1.17 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*
* Reimplemented by: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: okay_addr.c,v 1.17.8.3 2004/05/01 20:07:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.3 $ $State: Exp $
*
* Reimplemented by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 18,24 ****

**/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"addr");

--- 18,24 ----

**/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"addr");

***************
*** 93,99 ****
int addr_is_user(addr)
char *addr;
{
! struct addr_rec *alternatives;
char our_address[SLEN];
char deqbuffer[SLEN];

--- 93,99 ----
int addr_is_user(addr)
char *addr;
{
! char **alternatives;
char our_address[SLEN];
char deqbuffer[SLEN];

***************
*** 181,231 ****
}
}

! alternatives = alternative_addresses;
! while (alternatives != NULL) {
! char * host_part2 = qstrpbrk(alternatives->address,"@");
! if (host_part2) {
! char * buffer2 =
! safe_malloc(host_part2 - alternatives->address +1);
! strncpy(buffer2,alternatives->address,
! host_part2 - alternatives->address);
! buffer2[host_part2 - alternatives->address] = '\0';

! DPRINT(Debug,27,(&Debug,
! "addr_is_user: %s: user part=%s, host part=%s\n",
! alternatives->address,buffer2,host_part2+1));

! if ((0 == strcmp(buffer,buffer2) ||
! 0 == strcmp(buffer1,buffer2)
! ) &&
! 0 == istrcmp(host_part2+1,host_part+1)) {
! DPRINT(Debug,25,(&Debug,
! "addr_is_user(\"%s\")=TRUE: matches alternative\n",
! addr));
! free(buffer2);
! free(buffer);
! free(buffer1); buffer1 = NULL;

! return(TRUE);
}
- free(buffer2);
}
- alternatives = alternatives->next;
}
free(buffer);
free(buffer1); buffer1 = NULL;
!
}
!
! alternatives = alternative_addresses;
! while (alternatives != NULL) {
! if (0 == strcmp(addr,alternatives->address)) {
! DPRINT(Debug,25,(&Debug,
! "addr_is_user(\"%s\")=TRUE: matches alternative address\n",
! addr));
! return(TRUE);
}
- alternatives = alternatives->next;
}
DPRINT(Debug,25,(&Debug,
"addr_is_user(\"%s\")=FALSE\n",addr));
--- 181,243 ----
}
}

! alternatives = give_dt_path_as_elems(&alternative_addresses,
! "alternatives");
! if (alternatives) {


!
! int i;
!

! for (i = 0; alternatives[i]; i++) {
! char * host_part2 = qstrpbrk(alternatives[i],"@");
!
! if (host_part2) {
! int LEN = host_part2 - alternatives[i];
! char * buffer2 = safe_malloc(LEN+1);
!
! strncpy(buffer2,alternatives[i], LEN);
! buffer2[LEN] = '\0';

! DPRINT(Debug,27,(&Debug,
! "addr_is_user: %s: user part=%s, host part=%s\n",
! alternatives[i],buffer2,host_part2+1));

! if ((0 == strcmp(buffer,buffer2) ||
! 0 == strcmp(buffer1,buffer2)
! ) &&
! 0 == istrcmp(host_part2+1,host_part+1)) {
! DPRINT(Debug,25,(&Debug,
! "addr_is_user(\"%s\")=TRUE: matches alternative\n",
! addr));
! free(buffer2);
! free(buffer);
! free(buffer1); buffer1 = NULL;

! return(TRUE);
! }
! free(buffer2);
}
}
}
free(buffer);
free(buffer1); buffer1 = NULL;
!
}
!
! alternatives = give_dt_path_as_elems(&alternative_addresses,
! "alternatives");
! if (alternatives) {


!
! int i;
!

! for (i = 0; alternatives[i]; i++) {
!
! if (0 == strcmp(addr,alternatives[i])) {
! DPRINT(Debug,25,(&Debug,
! "addr_is_user(\"%s\")=TRUE: matches alternative address\n",
! addr));
! return(TRUE);
! }
}
}
DPRINT(Debug,25,(&Debug,
"addr_is_user(\"%s\")=FALSE\n",addr));
Index: elmME+.2.5.alpha0-cvs/lib/opt_utils.c
*** elm2.4.ME+.115/lib/opt_utils.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/opt_utils.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: opt_utils.c,v 1.8 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: opt_utils.c,v 1.8.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 18,24 ****

**/

! #include "headers.h"
#include "s_error.h"

#ifdef PWDINSYS
--- 18,24 ----

**/

! #include "elm_defs.h"
#include "s_error.h"

#ifdef PWDINSYS
Index: elmME+.2.5.alpha0-cvs/lib/outheaders.c
*** elm2.4.ME+.115/lib/outheaders.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/outheaders.c 2004-04-25 17:52:38.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "hdr_imp.h"
#include "s_me.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14.8.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "hdr_imp.h"
#include "s_me.h"

Index: elmME+.2.5.alpha0-cvs/lib/output.c
*** elm2.4.ME+.115/lib/output.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/output.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: output.c,v 1.32 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"ui");

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: output.c,v 1.32.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"ui");

Index: elmME+.2.5.alpha0-cvs/lib/panic.c
*** elm2.4.ME+.115/lib/panic.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/panic.c 2004-04-18 19:55:39.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: panic.c,v 1.12 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"

static void def_panic_prepare P_((CONST int interrupt,
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: panic.c,v 1.12.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"

static void def_panic_prepare P_((CONST int interrupt,
Index: elmME+.2.5.alpha0-cvs/lib/parsarpdat.c
*** elm2.4.ME+.115/lib/parsarpdat.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/parsarpdat.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: parsarpdat.c,v 1.9 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: parsarpdat.c,v 1.9.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 12,18 ****
*****************************************************************************/


! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"header");

--- 12,18 ----
*****************************************************************************/


! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"header");

Index: elmME+.2.5.alpha0-cvs/lib/pmalloc.c
*** elm2.4.ME+.115/lib/pmalloc.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/pmalloc.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pmalloc.c,v 1.8 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pmalloc.c,v 1.8.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,27 ****
**/

#include <stdio.h>
! #include "headers.h"
#include "s_elm.h"

DEBUG_VAR(Debug,__FILE__,"mem");
--- 21,27 ----
**/



#include <stdio.h>
! #include "elm_defs.h"

#include "s_elm.h"

DEBUG_VAR(Debug,__FILE__,"mem");
Index: elmME+.2.5.alpha0-cvs/lib/pop.c
*** elm2.4.ME+.115/lib/pop.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/pop.c 2004-05-01 10:41:05.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: pop.c,v 1.46 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"
#include "s_me.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: pop.c,v 1.46.8.2 2004/05/01 07:41:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "ss_imp.h"
#include "mbx_imp.h"
#include "s_me.h"
***************
*** 127,133 ****
} else {
putc('O',F);
}
! if (ison(root->status, REPLIED)) {
putc('r',F);
}
fprintf(F," %s\n",root->uidl);
--- 127,133 ----
} else {
putc('O',F);
}
! if (ison(root->status, REPLIED_TO)) {
putc('r',F);
}
fprintf(F," %s\n",root->uidl);
***************
*** 225,231 ****
status |= NEW;
break;
case 'r':
! status |= REPLIED;
break;
}
}
--- 225,231 ----
status |= NEW;
break;
case 'r':
! status |= REPLIED_TO;
break;
}
}
Index: elmME+.2.5.alpha0-cvs/lib/posixsig.c
*** elm2.4.ME+.115/lib/posixsig.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/posixsig.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: posixsig.c,v 1.10 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: posixsig.c,v 1.10.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 16,22 ****

**/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"signal");

--- 16,22 ----

**/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"signal");

Index: elmME+.2.5.alpha0-cvs/lib/precompiled_sets.c
*** elm2.4.ME+.115/lib/precompiled_sets.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/precompiled_sets.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,13 ****
! static char rcsid[] = "@(#)$Id: precompiled_sets.c,v 1.23 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "defs.h"
! #include "elmlib.h"
#include "cs_imp.h"

#define INVARIANT &precompiled_sets[0]
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: precompiled_sets.c,v 1.23.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "cs_imp.h"

#define INVARIANT &precompiled_sets[0]
Index: elmME+.2.5.alpha0-cvs/lib/qstrings.c
*** elm2.4.ME+.115/lib/qstrings.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/qstrings.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: qstrings.c,v 1.6 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: qstrings.c,v 1.6.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 17,23 ****

**/

! #include "headers.h"

char *qstrpbrk(source, keys)
char *source, *keys;
--- 17,23 ----

**/

! #include "elm_defs.h"

char *qstrpbrk(source, keys)
char *source, *keys;
Index: elmME+.2.5.alpha0-cvs/lib/rc_handle.c
*** elm2.4.ME+.115/lib/rc_handle.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/rc_handle.c 2004-05-01 23:07:50.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17.8.6 2004/05/01 20:07:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

***************
*** 13,22 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"
#include "rc_imp.h"
#include "save_opts.h"
#include "shared_imp.h"


#include "s_elm.h"

DEBUG_VAR(Debug,__FILE__,"config");

--- 13,24 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"


#include "rc_imp.h"
#include "save_opts.h"
+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif
#include "s_elm.h"

DEBUG_VAR(Debug,__FILE__,"config");
***************

*** 31,38 ****
&rc_DT_NUM == T ||
&rc_DT_BOL == T ||
&rc_DT_CHR == T ||
- &rc_DT_WEE == T ||
- &rc_DT_ALT == T ||
&rc_DT_SRT == T ||
&rc_DT_MLT == T ||
&rc_DT_ASR == T ||
--- 33,38 ----
***************
*** 422,597 ****
struct rc_type rc_DT_CHR = { dt_CHR_parse_line, BAD_parse_cline,
dt_CHR_print_value, dt_CHR_get_value };

- #ifdef ANSI_C
- static rc_parse_line dt_WEE_parse_line;
- #endif
- static int dt_WEE_parse_line(r,lcl,value,lineno,filename, e_val, negate)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;
- char *filename;
- int e_val;
- int negate;
- {
- if (negate) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadNegate,
- "!%s is not supported in line %d in \"%s\" file"),
- r->name,lineno,filename);


- return 0;
- }
-

- weedout(value);


- return 1;
- }
-

- #ifdef ANSI_C
- static rc_parse_cline dt_WEE_parse_cline;
- #endif
- static int dt_WEE_parse_cline(r,lcl,value,lineno,filename)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;
- char *filename;
- {
- weedout(value);
- return 1;


- }
-
- #if ANSI_C

- static rc_print_value dt_WEE_print_value;
- #endif
- static void dt_WEE_print_value(F,r,comment)
- FILE *F;
- struct rc_save_info_rec *r;
- int comment;
- {
- int len, i;
-
- if (comment)
- fprintf(F, "### ");
- fprintf(F, "%s =", r->name);
- len = strlen(r->name) + 6;
-
- i = 0;
- while (i < weedcount
- && istrcmp(weedlist[i], "*end-of-defaults*"))
- i++;
- while (i < weedcount
- && !istrcmp(weedlist[i], "*end-of-defaults*"))
- i++;
- if (i == 1) {
- /* end-of-defaults in the first position means
- ** that there are no defaults, i.e.
- ** a clear-weed-list has been done.
- */
- fprintf(F, " \"*clear-weed-list*\"");
- len += 20;
- }
-
- while (i <= weedcount) {
- char *w;
-
- w = (i < weedcount) ? weedlist[i]
- : "*end-of-user-headers*";
- if (strlen(w) + len > 72) {
- if (!comment)
- fprintf(F, "\n\t");
- else
- fprintf(F, "\n###\t");
- len = 8;
- }
- else {
- fprintf(F, " ");
- ++len;
- }
- fprintf(F, "\"%s\"", w);
- len += strlen(w) + 3;
- i++;
- }
- fprintf(F, "\n");
- }
-
- struct rc_type rc_DT_WEE = { dt_WEE_parse_line, dt_WEE_parse_cline,
- dt_WEE_print_value, NO_get_value };
-
- #ifdef ANSI_C
- static rc_parse_line dt_ALT_parse_line;
- #endif
- static int dt_ALT_parse_line(r,lcl,value,lineno,filename, e_val, negate)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;
- char *filename;
- int e_val;
- int negate;
- {
- if (negate) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadNegate,
- "!%s is not supported in line %d in \"%s\" file"),
- r->name,lineno,filename);


- return 0;
- }
-

- alternatives(value);


- return 1;
- }
-

- #ifdef ANSI_C
- static rc_parse_cline dt_ALT_parse_cline;
- #endif
- static int dt_ALT_parse_cline(r,lcl,value,lineno,filename)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;
- char *filename;
- {
- alternatives(value);
- return 1;


- }
-
- #if ANSI_C

- static rc_print_value dt_ALT_print_value;
- #endif
- static void dt_ALT_print_value(F,r,comment)
- FILE *F;
- struct rc_save_info_rec *r;
- int comment;
- {
- struct addr_rec *alts = *(r ->val.alts);
- int len=0;
-
- if (comment)
- fprintf(F, "### ");
- fprintf(F, "%s =", r->name);
- len = strlen(r->name) + 6;
- for ( ;alts; alts = alts->next) {
- if (strlen(alts->address) + len > 72) {
- if (!comment)
- fprintf(F, "\n\t");
- else
- fprintf(F, "\n###\t");
- len = 8;
- }
- else {
- fprintf(F, " ");
- ++len;
- }
- fprintf(F, "%s", alts->address);
- len += strlen(alts->address);
- }
- fprintf(F,"\n");
-
-
- }
-
- struct rc_type rc_DT_ALT = { dt_ALT_parse_line, dt_ALT_parse_cline,
- dt_ALT_print_value, NO_get_value };
-
-
static struct {
char *kw;
int sv;
--- 422,427 ----
***************
*** 720,726 ****
return 0;
}

! for (s = r->val.weed; *s; ++s) {
if (!do_set(lcl, *s, value, filename))
ok = 0;
}
--- 550,556 ----
return 0;
}

! for (s = r->val.mlt; *s; ++s) {
if (!do_set(lcl, *s, value, filename))
ok = 0;
}
***************
*** 1117,1122 ****
--- 947,954 ----
int is_sep_colon = ptr->flags & PATH_sep_colon;
int is_sep_space = 0 == recursive;
int is_quote_single = (ptr->flags & PATH_quote_single) && 0 == recursive;
+ int convert_underline = (ptr->flags & PATH_convert_underline)
+ && 0 == recursive;

char *p;
char * start_val = NULL;
***************
*** 1234,1239 ****
--- 1066,1079 ----
memcpy(value,start_val,Len);
value[Len] = '\0';

+ if (convert_underline) {
+ int i;
+
+ for (i = 0; i < Len; i++)
+ if ('_' == value[i])
+ value[i] = ' ';
+ }
+
start_val = NULL;
goto expand_value;
}
***************
*** 1263,1269 ****
int Len = p - start_val;

/* Split on quote */
! q = '"';

DPRINT(Debug,11,(&Debug,
"expand_dt_path (clip len=%d)=%.*s\n",
--- 1103,1109 ----
int Len = p - start_val;

/* Split on quote */
! q = '\'';

DPRINT(Debug,11,(&Debug,
"expand_dt_path (clip len=%d)=%.*s\n",
***************
*** 1285,1292 ****
expand_value:
if (is_expand) {
char buffer[1024];

! int v = expand_path(buffer,value,sizeof buffer);

if (v < 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 1125,1152 ----
expand_value:
if (is_expand) {
char buffer[1024];
+ int v;

! if (is_file || is_dir) {
!
! /* HACK -- we can't use expand_meta() because
! it do not return 1 when value is changed
! */
! if ('=' == value[0]) {
!
! char * t = safe_strdup(folders);
! int l = strlen(t);
!
! if (l > 0 && t[l-1] != '/' && value[1] != '/')
! t = strmcat(t,"/");
!
! t = strmcat(t,value+1);
! free(value);
! value = t;
! }
! }
!
! v = expand_path(buffer,value,sizeof buffer);

if (v < 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 1313,1322 ****
value = strmcpy(value,buffer);
}
}
!
if (is_file || is_dir) {
struct stat S;
if ('/' != value[0]) {
if (0 == recursive) {

DPRINT(Debug,9,(&Debug,
--- 1173,1184 ----
value = strmcpy(value,buffer);
}
}
!
if (is_file || is_dir) {
struct stat S;
+
if ('/' != value[0]) {
+
if (0 == recursive) {

DPRINT(Debug,9,(&Debug,

***************
*** 1374,1380 ****

}

! if (is_dir &&
#ifdef S_ISREG
!S_ISREG(S.st_mode)
#else

--- 1236,1242 ----



}

! if (is_file &&
#ifdef S_ISREG
!S_ISREG(S.st_mode)
#else
***************

*** 1452,1457 ****
--- 1314,1320 ----
{
char *res,*p;
int sep;
+ int quote;

int i,L = 1;
if (!ptr->list && ptr->unexpanded)
***************
*** 1466,1483 ****
else if (ptr->flags & PATH_sep_colon) sep = ':';
else sep = ' ';

res = safe_malloc(L);

for (i = 0, p = res; i < ptr->nlen;i++) {
int l = strlen(ptr->list[i]);

! if (p+l+1 >= res+L)
panic("RC PANIC",__FILE__,__LINE__,"give_dt_path_as_str",
"Overflow",0);
if (i > 0)
*p++ = sep;
memcpy(p,ptr->list[i],l);
p += l;
}
*p = '\0';

--- 1329,1361 ----
else if (ptr->flags & PATH_sep_colon) sep = ':';
else sep = ' ';

+ if (ptr->flags & PATH_quote) quote = '"';
+ else if (ptr->flags & PATH_quote_single) quote = '\'';
+ else quote = 0;
+
+ if (quote)
+ L += ptr->nlen * 2;
+
res = safe_malloc(L);

for (i = 0, p = res; i < ptr->nlen;i++) {
int l = strlen(ptr->list[i]);

! if (p+l+1 + (quote ? 2 : 0) >= res+L)
panic("RC PANIC",__FILE__,__LINE__,"give_dt_path_as_str",
"Overflow",0);
if (i > 0)
*p++ = sep;
+
+ if (quote)
+ *p++ = quote;
+
memcpy(p,ptr->list[i],l);
p += l;
+
+ if (quote)
+ *p++ = quote;
+
}
*p = '\0';



***************
*** 1586,1596 ****

if (comment)
fprintf(F, "### ");

for (i = 0; i < r->val.path->nlen; i++) {
! if (0 == i)
! fprintf(F, "%s = ",r->name);
! else {
if (len + strlen(r->val.path->list[i]) > 70) {
fprintf(F, "\n");
if (comment)

--- 1464,1474 ----



if (comment)
fprintf(F, "### ");
+
+ fprintf(F, "%s = ",r->name);

for (i = 0; i < r->val.path->nlen; i++) {
! if (i > 0) {
if (len + strlen(r->val.path->list[i]) > 70) {
fprintf(F, "\n");
if (comment)

***************
*** 1603,1609 ****
}
if (r->val.path->flags & PATH_quote)
elm_fprintf(F,FRM("Q"),r->val.path->list[i]);
! else
fputs(r->val.path->list[i],F);
len += strlen(r->val.path->list[i]) + 1;
}
--- 1481,1491 ----
}
if (r->val.path->flags & PATH_quote)
elm_fprintf(F,FRM("Q"),r->val.path->list[i]);
! else if (r->val.path->flags & PATH_quote_single) {
! fputc('\'',F);
! fputs(r->val.path->list[i],F);
! fputc('\'',F);
! } else
fputs(r->val.path->list[i],F);
len += strlen(r->val.path->list[i]) + 1;
}
Index: elmME+.2.5.alpha0-cvs/lib/read_rc.c
*** elm2.4.ME+.115/lib/read_rc.c 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/read_rc.c 2004-05-15 23:11:36.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133 2004/04/04 06:17:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133.4.15 2004/05/15 20:11:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133.4.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 14,20 ****
*****************************************************************************/

#define SAVE_OPTS
! #include "headers.h"
#include "rc_imp.h"
#include "save_opts.h"
#include "s_elm.h"
--- 14,20 ----
*****************************************************************************/

#define SAVE_OPTS
! #include "elm_defs.h"
#include "rc_imp.h"
#include "save_opts.h"
#include "s_elm.h"
***************
*** 48,55 ****
# endif

#define ASSIGNMENT 0
- #define WEEDOUT 1
- #define ALTERNATIVES 2

#define SYSTEM_RC 0
#define LOCAL_RC 1
--- 48,53 ----
***************
*** 88,102 ****
char system_mail_services[SLEN] = SYSTEM_MAIL_SERVICES;
char hostdomfile[SLEN] = HOSTDOMFILE;
char system_mime_charsets[SLEN] = SYSTEM_MIME_CHARSETS;
! char map_txtdir[SLEN] = {0}; /* init_defaults */
char raw_map_txtdir[SLEN] = "{lib}/elm.map.txt";
! char map_bindir[SLEN] = {0}; /* init_defaults */
char raw_map_bindir[SLEN] = "{lib}/elm.map.bin";
! char unidata_path[SLEN] = {0}; /* init_defaults */


char raw_unidata_path[SLEN] = "unidata.bin"; /* init_defaults */

! char bindata_path_global[SLEN] = {0}; /* Used before user elm.rc is read */
! char bindata_path[SLEN] = {0}; /* init_defaults */


char raw_bindata_path[SLEN] = "bindata.bin"; /* init_defaults */


--- 86,100 ----
char system_mail_services[SLEN] = SYSTEM_MAIL_SERVICES;
char hostdomfile[SLEN] = HOSTDOMFILE;
char system_mime_charsets[SLEN] = SYSTEM_MIME_CHARSETS;
! char map_txtdir[SLEN]; /* init_defaults */
char raw_map_txtdir[SLEN] = "{lib}/elm.map.txt";
! char map_bindir[SLEN]; /* init_defaults */
char raw_map_bindir[SLEN] = "{lib}/elm.map.bin";
! char unidata_path[SLEN]; /* init_defaults */


char raw_unidata_path[SLEN] = "unidata.bin"; /* init_defaults */

! char bindata_path_global[SLEN]; /* Used before user elm.rc is read */
! char bindata_path[SLEN]; /* init_defaults */


char raw_bindata_path[SLEN] = "bindata.bin"; /* init_defaults */


***************
*** 111,199 ****
char user_terminal_info[SLEN] = USER_TERMINAL_INFO; /* user_init fixes */
char user_mail_services[SLEN] = USER_MAIL_SERVICES; /* user_init fixes */

! char defaultfile[SLEN] = {0}; /* name of default folder */
char raw_defaultfile[SLEN] = "$MAIL"; /* init_defaults fixes */
! char calendar_file[SLEN] = {0}; /* name of file for clndr */
! char raw_calendar_file[SLEN] = {0}; /* unexpanded name of file for clndr */
! int clear_pages = 0; /* flag: act like "page" (more -c)? */


int title_messages = 1; /* flag: title message display? */

! nl_catd elm_msg_cat = 0; /* message catalog */

/* WARNING: Elm's version uses 0 as failure

System uses (nl_catd) -1 as failure !

*/


! char username[SLEN] = {0}; /* return address name! */

! char home[SLEN] = {0}; /* home directory of user */
int userid = -1; /* uid for current user */
int groupid = -1; /* groupid for current user */

int mailgroupid; /* groupid for current user */
! int have_saved_ids = 0; /* sysconf _SC_SAVED_IDS */

/* ------------- Variables in elmrc ------------------------------- */

! int add_irt_phrase = 0; /* In-reply-to: Add phare to in-reply-to ?
True = Do not follow RFC 2822
*/
int add_sender_header = 1; /* If set add Sender: header if user specifies
From: -header
*/
! int allow_charset_switching=0; /* flag: allow changing charset of */
/* terminal if terminal supports */
int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */
! struct addr_rec *alternative_addresses; /* how else do we get mail? */
! int always_del = 0; /* flag: always delete marked msgs? */
int always_keep = 1; /* flag: always keep unread msgs? */
! int always_store = 0; /* flag: always store read msgs? */
! int arrow_cursor = 0; /* flag: use "->" cursor regardless?*/
! int question_me = 1; /* flag: ask questions as we leave? */
int prompt_for_cc = 1; /* flag: ask user for "cc:" value? */
#ifdef USE_PGP
! int pgp_askpgpsig=0; /* Should pgp ask userid to sign messages with? */
! int pgp_sign_type=0; /* 0 = application/pgp
1 = text/plain
2 = text/x-pgp
*/
enum pgp_version send_pgp_version = pgp_none; /* preferred pgp version*/
#endif
! char attribution[SLEN] = {0}; /* attribution string for replies */
int auto_attachment = 1; /* 0 = none,


1 = application,
2 = non-text
*/

! int auto_copy = 0; /* flag: automatically copy source? */
int auto_iso_8859 = 1; /* flag: Should ISO-8859-X charsets defined


on demand ? */
#ifdef BACKGROUD_PROCESSES

int background_wait_time = 2; /* If > 0 background mailer after */
/* this number of seconds */
#endif
! /* int bounceback = 0; */ /* flag: bounce copy off remote? */
int browser_wildcards = 1; /* flag: do wildcard match? */
int builtin_lines= -3; /* int: if < 0 use builtin if message*/
/* shorter than LINES+builtin_lines */
/* else use pager. If > 0 use builtin*/
/* if message has fewer than # of lines*/
! int charset_convert_ok = 0; /* flag: no warning about conversion? */
char raw_text_charset[SLEN] = "DISPLAY"; /* name of character set */
! charset_t text_charset = NULL; /* pointer of character set */
char raw_default_mimetext_charset[SLEN] = "US-ASCII";
/* name of character set */
! charset_t default_mimetext_charset = NULL; /* pointer to character set */
char raw_default_nomime_charset[SLEN] = "SYSTEM"; /* name of character set */
! charset_t default_nomime_charset = NULL; /* pointer to character set */
int def_folder_status = FOLDER_STATUS_OLD; /* 0 = Read
1 = Old
2 = New
*/
! char config_options[SLEN] = {0};/* which options are in o)ptions */
! int confirm_append = 0; /* flag: confirm append to folder? */
! int confirm_create = 0; /* flag: confirm create new folder? */
! int confirm_files = 0; /* flag: confirm files for append? */
! int confirm_folders = 0; /* flag: confirm folders for create?*/
int convert_comment = 1; /* flag: convert comment to fullname ? */
int convert_utf_header = 1; /* flag: convert utf-8 mime encoded words to utf-7 when sending? */

--- 109,211 ----
char user_terminal_info[SLEN] = USER_TERMINAL_INFO; /* user_init fixes */
char user_mail_services[SLEN] = USER_MAIL_SERVICES; /* user_init fixes */

! char defaultfile[SLEN]; /* name of default folder */
char raw_defaultfile[SLEN] = "$MAIL"; /* init_defaults fixes */
! char calendar_file[SLEN]; /* name of file for clndr */
! char raw_calendar_file[SLEN]; /* unexpanded name of file for clndr */
! int clear_pages; /* flag: act like "page" (more -c)? */


int title_messages = 1; /* flag: title message display? */

! nl_catd elm_msg_cat; /* message catalog */


/* WARNING: Elm's version uses 0 as failure

System uses (nl_catd) -1 as failure !

*/


! char username[SLEN]; /* return address name! */
! char home[SLEN]; /* home directory of user */
int userid = -1; /* uid for current user */
int groupid = -1; /* groupid for current user */

int mailgroupid; /* groupid for current user */
! int have_saved_ids; /* sysconf _SC_SAVED_IDS */

/* ------------- Variables in elmrc ------------------------------- */

! int add_irt_phrase; /* In-reply-to: Add phare to in-reply-to ?
True = Do not follow RFC 2822
*/
int add_sender_header = 1; /* If set add Sender: header if user specifies
From: -header
*/
! int allow_charset_switching; /* flag: allow changing charset of */
/* terminal if terminal supports */
+ int allow_setuid;
int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */
! PATH alternative_addresses = { /* how else do we get mail? */
! PATH_sep_comma|PATH_quote|PATH_quote_single,
! NULL, 0,NULL
! };
!
! int always_del; /* flag: always delete marked msgs? */
int always_keep = 1; /* flag: always keep unread msgs? */
! int always_store; /* flag: always store read msgs? */
!
! int ask_delete = 1; /* confirm delete on resync? */
! int ask_keep = 1; /* ask to keep unread msgs? */
! int ask_reply_copy = 1; /* ask to copy mssg into reply? */
! int ask_store = 1; /* ask to store read mail? */
!
! int arrow_cursor; /* flag: use "->" cursor regardless?*/
!
int prompt_for_cc = 1; /* flag: ask user for "cc:" value? */
#ifdef USE_PGP
! int pgp_askpgpsig; /* Should pgp ask userid to sign messages with? */
! int pgp_sign_type; /* 0 = application/pgp
1 = text/plain
2 = text/x-pgp
*/
enum pgp_version send_pgp_version = pgp_none; /* preferred pgp version*/
#endif
! char attribution[SLEN]; /* attribution string for replies */
! char fwdattribution[SLEN]; /* attribution string for forwarded mssgs */
int auto_attachment = 1; /* 0 = none,


1 = application,
2 = non-text
*/

! int reply_copy = 1; /* flag: copy message into reply */
int auto_iso_8859 = 1; /* flag: Should ISO-8859-X charsets defined


on demand ? */
#ifdef BACKGROUD_PROCESSES

int background_wait_time = 2; /* If > 0 background mailer after */
/* this number of seconds */
#endif
! /* int bounceback; */ /* flag: bounce copy off remote? */
int browser_wildcards = 1; /* flag: do wildcard match? */
int builtin_lines= -3; /* int: if < 0 use builtin if message*/
/* shorter than LINES+builtin_lines */
/* else use pager. If > 0 use builtin*/
/* if message has fewer than # of lines*/
! int charset_convert_ok; /* flag: no warning about conversion? */
char raw_text_charset[SLEN] = "DISPLAY"; /* name of character set */
! charset_t text_charset; /* pointer of character set */
char raw_default_mimetext_charset[SLEN] = "US-ASCII";
/* name of character set */
! charset_t default_mimetext_charset; /* pointer to character set */
char raw_default_nomime_charset[SLEN] = "SYSTEM"; /* name of character set */
! charset_t default_nomime_charset; /* pointer to character set */
int def_folder_status = FOLDER_STATUS_OLD; /* 0 = Read
1 = Old
2 = New
*/
! char config_options[SLEN];/* which options are in o)ptions */
! int confirm_append; /* flag: confirm append to folder? */
! int confirm_create; /* flag: confirm create new folder? */
! int confirm_files; /* flag: confirm files for append? */
! int confirm_folders; /* flag: confirm folders for create?*/
! int confirm_tag_save = 1; /* flag: confirm saving of tagged messages */
! int edit_flush = 1; /* flag: flush input after extern edit? */
int convert_comment = 1; /* flag: convert comment to fullname ? */
int convert_utf_header = 1; /* flag: convert utf-8 mime encoded words to utf-7 when sending? */

***************
*** 201,239 ****
char display_locale[SLEN] = "NONE"; /* LC_CTYPE locale (character set) */
char display_codeset[SLEN] = ""; /* nl_langinfo(CODESET) for current locale (character set) */

! charset_t wanted_display_charset = NULL;
char raw_display_charset[SLEN] = "SYSTEM";
/* the wanted display charset set */
! int DSN_success = 0; /* flag: Ask successfull DSNes */
! char e_editor[SLEN] = {0}; /* "~e" editor... */
! char editor[SLEN] = {0}; /* editor for outgoing mail*/
! int env_from_source = 0; /* 0 == forward-from,
1 == from,
2 == return-path
*/
! char raw_editor[SLEN] = {0}; /* unexpanded editor for outgoing mail*/
char escape_char = TILDE_ESCAPE;/* '~' or something else.. */
! int force_name = 0; /* flag: save by name forced? */
int fragment_handling = 1; /* 0 == none,
1 == manual,
2 == auto */
int allow_forms = NO; /* flag: are AT&T Mail forms okay? */
! char full_username[SLEN] = {0}; /* Full username - gecos */
! int phrase_display_mode = 0; /* 0 == plain, 1 = quoted */
! char hostdomain[SLEN] = {0}; /* name of domain we're in */
! char hostfullname[SLEN] = {0}; /* name of FQDN we're in */
! char hostname[SLEN] = {0}; /* name of machine we're on */
#ifdef DISP_HOST
int menu_display_host = TRUE; /* flag: Display host on mailbox menu* */
#else
int menu_display_host = FALSE; /* flag: Display host on mailbox menu? */
#endif
! int keep_empty_files = 0; /* flag: leave empty folder files? */
#ifdef USE_PGP
int pgp_keeppassfor = 300; /* 5 minutes */
#endif

! int local_fast_lookup = 0; /* flag: directory listing not needed
for lookup */


char local_sessionlock_dir[SLEN] = default_temp;

int local_sessionlock_use_home; /* 0 == newer,

--- 213,251 ----
char display_locale[SLEN] = "NONE"; /* LC_CTYPE locale (character set) */
char display_codeset[SLEN] = ""; /* nl_langinfo(CODESET) for current locale (character set) */

! charset_t wanted_display_charset;
char raw_display_charset[SLEN] = "SYSTEM";
/* the wanted display charset set */
! int DSN_success; /* flag: Ask successfull DSNes */
! char e_editor[SLEN]; /* "~e" editor... */
! char editor[SLEN]; /* editor for outgoing mail*/
! int env_from_source; /* 0 == forward-from,
1 == from,
2 == return-path
*/
! char raw_editor[SLEN]; /* unexpanded editor for outgoing mail*/
char escape_char = TILDE_ESCAPE;/* '~' or something else.. */
! int force_name; /* flag: save by name forced? */
int fragment_handling = 1; /* 0 == none,
1 == manual,
2 == auto */
int allow_forms = NO; /* flag: are AT&T Mail forms okay? */
! char full_username[SLEN]; /* Full username - gecos */
! int phrase_display_mode; /* 0 == plain, 1 = quoted */
! char hostdomain[SLEN]; /* name of domain we're in */
! char hostfullname[SLEN]; /* name of FQDN we're in */
! char hostname[SLEN]; /* name of machine we're on */
#ifdef DISP_HOST
int menu_display_host = TRUE; /* flag: Display host on mailbox menu* */
#else
int menu_display_host = FALSE; /* flag: Display host on mailbox menu? */
#endif
! int keep_empty_files; /* flag: leave empty folder files? */
#ifdef USE_PGP
int pgp_keeppassfor = 300; /* 5 minutes */
#endif

! int local_fast_lookup; /* flag: directory listing not needed
for lookup */


char local_sessionlock_dir[SLEN] = default_temp;

int local_sessionlock_use_home; /* 0 == newer,

***************
*** 242,269 ****
3 == non-spool

*/
char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */

! charset_t local_fs_charset = NULL; /* filesystem charset */

! char local_signature[SLEN] = {0}; /* local msg signature file */
! char raw_local_signature[SLEN] = {0}; /* unexpanded local msg */
/* signature file */
#ifdef SYSCALL_LOCKING
int lockfolders = 1; /* Lock folder when open */
int lock_in_copy = 1; /* Lock folder when copied to it */
#else
! int lockfolders = 0; /* Lock folder when open */
! int lock_in_copy = 0; /* Lock folder when copied to it */
#endif
! char folders[SLEN] = {0}; /* folder home directory */
! char raw_folders[SLEN] = {0}; /* unexpanded folder home directory */
! char extra_mailbox_dir[SLEN] = {0};
! char raw_extra_mailbox_dir[SLEN] = {0};
! char raw_attachment_dir[SLEN] = {0};
! char attachment_dir[SLEN] = {0}; /* {doc} -prefix */

int mail_permissions = 0600; /* int: permissions for mailbox files */
int mini_menu = 1; /* flag: menu specified? */
! int message_hide_hack = 0; /* 0 == none */
/* 1 = FOLDER INTERNAL DATA */
char raw_metamail_path[SLEN] = METAMAIL_PATH;
char metamail_path[SLEN] = "metamail"; /* Metamail path or "none" */
--- 254,281 ----
3 == non-spool

*/
char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */

! charset_t local_fs_charset; /* filesystem charset */

! char local_signature[SLEN]; /* local msg signature file */
! char raw_local_signature[SLEN]; /* unexpanded local msg */
/* signature file */
#ifdef SYSCALL_LOCKING
int lockfolders = 1; /* Lock folder when open */
int lock_in_copy = 1; /* Lock folder when copied to it */
#else
! int lockfolders; /* Lock folder when open */
! int lock_in_copy; /* Lock folder when copied to it */
#endif
! char folders[SLEN]; /* folder home directory */
! char raw_folders[SLEN]; /* unexpanded folder home directory */
! char extra_mailbox_dir[SLEN];
! char raw_extra_mailbox_dir[SLEN];
! char raw_attachment_dir[SLEN];
! char attachment_dir[SLEN]; /* {doc} -prefix */

int mail_permissions = 0600; /* int: permissions for mailbox files */
int mini_menu = 1; /* flag: menu specified? */
! int message_hide_hack; /* 0 == none */
/* 1 = FOLDER INTERNAL DATA */
char raw_metamail_path[SLEN] = METAMAIL_PATH;
char metamail_path[SLEN] = "metamail"; /* Metamail path or "none" */
***************
*** 282,310 ****
0,
NULL, 0, NULL
};
! int internal_mailcap_t_prompt = 0;


! int metoo = 0; /* flag: copy me on mail to alias? */


int mime_body_keywords = TRUE; /* flag: parse body looking for encode */
/* keywords */

int mimeforward = FALSE; /* flag: Forward as Message/rfc822 */
! int move_when_paged = 0; /* flag: move when '+' or '-' used? */
int names_only = 1; /* flag: display user names only? */
! int allow_no_encoding = 0; /* 1: Allow 8bit without -B8BITMIME */
/* 2: Allow binary without -BBINARYMIME and */
/* and 8bit without -B8BITMIME */
! int allow_no_hdrencoding = 0; /* TRUE, if header encoding is */
/* not required */
int noheader = 1; /* flag: copy + header to file? */
! int noheaderfwd = 0; /* flag: copy + header to file(fwd)? */
int pagealternative=1; /* Page if alternative have one know*/
/* subtype ? */
int page_known_charsets=1; /* Page if charset is not unknown? */
! int pagemultipart=0; /* Page unknown mime subparts? */
! int pagesigned=0; /* Page unknown signed protocols? */
! char pager[SLEN] = {0}; /* what pager to use */
! char raw_pager[SLEN] = {0}; /* unexpanded what pager to use */
#ifdef USE_PGP
char pgp2_path[SLEN] = "none"; /* Pgp path or "none" if no pgp */
char raw_pgp2_path[SLEN] = PGP2_PATH;
--- 294,326 ----
0,
NULL, 0, NULL
};
! int internal_mailcap_t_prompt;

+ PATH incomingfolders = { /* treate as mailbox */
+ PATH_file|PATH_expand|PATH_sep_comma,


+ NULL, 0, NULL
+ };

! int metoo; /* flag: copy me on mail to alias? */


int mime_body_keywords = TRUE; /* flag: parse body looking for encode */
/* keywords */

int mimeforward = FALSE; /* flag: Forward as Message/rfc822 */
! int move_when_paged; /* flag: move when '+' or '-' used? */
int names_only = 1; /* flag: display user names only? */
! int allow_no_encoding; /* 1: Allow 8bit without -B8BITMIME */
/* 2: Allow binary without -BBINARYMIME and */
/* and 8bit without -B8BITMIME */
! int allow_no_hdrencoding; /* TRUE, if header encoding is */
/* not required */
int noheader = 1; /* flag: copy + header to file? */
! int noheaderfwd; /* flag: copy + header to file(fwd)? */
int pagealternative=1; /* Page if alternative have one know*/
/* subtype ? */
int page_known_charsets=1; /* Page if charset is not unknown? */
! int pagemultipart; /* Page unknown mime subparts? */
! int pagesigned; /* Page unknown signed protocols? */
! char pager[SLEN]; /* what pager to use */
! char raw_pager[SLEN]; /* unexpanded what pager to use */
#ifdef USE_PGP
char pgp2_path[SLEN] = "none"; /* Pgp path or "none" if no pgp */
char raw_pgp2_path[SLEN] = PGP2_PATH;
***************
*** 314,351 ****
char raw_gpg_path[SLEN] = GPG_PATH;
#endif
int point_to_new = 1; /* flag: start pointing at new msg? */
! char allowed_precedences[SLEN] = {0}; /* list of precedences user */
/* may specify */
char prefixchars[SLEN] = "> "; /* prefix char(s) for msgs */
! char printout[SLEN] = {0}; /* how to print messages */


char raw_printout[SLEN] = DEFAULT_PRINTOUT;

/* unexpanded how to print messages */

int prompt_after_pager = 1; /* flag: prompt after pager exits */
int prompt_after_metamail = 1; /* flag: prompt after metamail exits */
! int quote_forward = 0; /* flag: fwd'd msgs quoted like replies */


int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/

/* new mbox */
! char recvd_mail[SLEN] = {0}; /* folder for storing received mail */
! char raw_recvdmail[SLEN] = {0}; /* unexpanded recvd_mail name */
! char remote_signature[SLEN] = {0}; /* remote msg signature file */
! char raw_remote_signature[SLEN] = {0}; /* unexpanded remote msg */
/* signature file */
int req_mime_bodyencoding = 1; /* */
! int req_mime_hdrencoding = 0; /* */
int resolve_mode = 1; /* flag: delete saved mail? */
int save_by_name = 1; /* flag: save mail by login name? */
! char sent_mail[SLEN] = {0}; /* name of file to save copies to */
int send_mime_plain = 1; /* flag: send plain text as MIME? */
! char raw_sentmail[SLEN] = {0}; /* unexpanded name of file to save to*/
! char shell[SLEN] = {0}; /* current system shell */
! char raw_shell[SLEN] = {0}; /* unexpanded current system shell */
! int set_window_title = 0; /* flag: set (xterm?) window title and
icon name */
#ifdef USE_PGP
int pgp_noarmor=1; /* Should Elm display text before PGP armor */
#endif
! int showto = 0; /* */
int show_header_errors = 1; /* flag: should some header reported? */
int sig_dashes = 1; /* flag: include dashes above sigs? */
int sleepmsg = 2; /* time to sleep for messages being */
--- 330,371 ----
char raw_gpg_path[SLEN] = GPG_PATH;
#endif
int point_to_new = 1; /* flag: start pointing at new msg? */
! char allowed_precedences[SLEN]; /* list of precedences user */
/* may specify */
char prefixchars[SLEN] = "> "; /* prefix char(s) for msgs */
! char printout[SLEN]; /* how to print messages */


char raw_printout[SLEN] = DEFAULT_PRINTOUT;

/* unexpanded how to print messages */

+ char printhdrs[SLEN];
int prompt_after_pager = 1; /* flag: prompt after pager exits */
int prompt_after_metamail = 1; /* flag: prompt after metamail exits */
! int quote_forward; /* flag: fwd'd msgs quoted like replies */


int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/

/* new mbox */
! char recvd_mail[SLEN]; /* folder for storing received mail */
! char raw_recvdmail[SLEN]; /* unexpanded recvd_mail name */
! char remote_signature[SLEN]; /* remote msg signature file */
! char raw_remote_signature[SLEN]; /* unexpanded remote msg */
/* signature file */
int req_mime_bodyencoding = 1; /* */
! int req_mime_hdrencoding; /* */
int resolve_mode = 1; /* flag: delete saved mail? */
int save_by_name = 1; /* flag: save mail by login name? */
! int save_by_alias = 1; /* save mail by alias of login name? */
! char sent_mail[SLEN]; /* name of file to save copies to */
int send_mime_plain = 1; /* flag: send plain text as MIME? */
! char raw_sentmail[SLEN]; /* unexpanded name of file to save to*/
! char shell[SLEN]; /* current system shell */
! char raw_shell[SLEN]; /* unexpanded current system shell */
! int set_window_title; /* flag: set (xterm?) window title and
icon name */
#ifdef USE_PGP
int pgp_noarmor=1; /* Should Elm display text before PGP armor */
#endif
! int showto; /* */
! int show_reply = 1; /* flag: show 'r' for replied mail */
! int show_mlists; /* show mailing list info? */
int show_header_errors = 1; /* flag: should some header reported? */
int sig_dashes = 1; /* flag: include dashes above sigs? */
int sleepmsg = 2; /* time to sleep for messages being */
***************
*** 355,378 ****
long elm_timeout = 600L; /* timeout (secs) on main prompt */
int sort_thread_max_time = 30; /* Number of days which can considered
be same thread */
! char temp_dir[SLEN] = {0}; /* name of temp directory */
! char raw_temp_dir[SLEN] = {0}; /* unexpanded name of temp directory*/
#ifdef USE_PGP
! int pgp_keeppass=0; /* should Elm keep the passphrase in*/
/* memory? */
#endif
! int user_level = 0; /* flag: how good is the user? */
int use_tite = 1; /* flag: use termcap/terminfo ti/te?*/
int utf7_encode_optional = 1; /* flag: Should utf7 optional direct
characters to be encoded? */
! char v_editor[SLEN] = {0}; /* "~v" editor... */
int elm_filter = 1; /* flag: weed out header lines? */
! char *weedlist[MAX_IN_WEEDLIST] = {0}; /* */
! int weedcount; /* */

#ifdef REMOTE_MBX
char raw_imap_charset[SLEN] = "SYSTEM"; /* IMAP foldername charset */
! int imap_fast_lookup = 0; /* flag: skip some directory listing */
int imap_max_dl_size = 4*1024; /* Maximum size of message to be
* downloaded
*/
--- 375,402 ----
long elm_timeout = 600L; /* timeout (secs) on main prompt */
int sort_thread_max_time = 30; /* Number of days which can considered
be same thread */
! char to_chars[SLEN] = DEFAULT_TO_CHARS; /* chars to indicate who mail is to */
! char temp_dir[SLEN]; /* name of temp directory */
! char raw_temp_dir[SLEN]; /* unexpanded name of temp directory*/
#ifdef USE_PGP
! int pgp_keeppass; /* should Elm keep the passphrase in*/
/* memory? */
#endif
! int user_level; /* flag: how good is the user? */
int use_tite = 1; /* flag: use termcap/terminfo ti/te?*/
int utf7_encode_optional = 1; /* flag: Should utf7 optional direct
characters to be encoded? */
! char v_editor[SLEN]; /* "~v" editor... */
int elm_filter = 1; /* flag: weed out header lines? */
! PATH weedlist = {
! PATH_sep_comma|PATH_quote|PATH_convert_underline,
! NULL, 0,NULL
! };
!

#ifdef REMOTE_MBX
char raw_imap_charset[SLEN] = "SYSTEM"; /* IMAP foldername charset */
! int imap_fast_lookup; /* flag: skip some directory listing */
int imap_max_dl_size = 4*1024; /* Maximum size of message to be
* downloaded
*/


***************
*** 692,698 ****
return;
}

! if (0 == strcmp(lc_ctype,"C"))
system_charset = MIME_name_to_charset("US-ASCII",
CHARSET_create);
else if (0 == istrcmp(lc_ctype,"ASCII") ||

--- 716,760 ----

--- 779,787 ----


FRM("ISO-8859-%d"),
val);
system_charset = MIME_name_to_charset(buffer,CHARSET_create);
+
+ /* 3) ------ guess based on charset part of locale ------------------------ */
+
} else if (charset && (0 == istrcmp(charset,"ASCII") ||
0 == istrcmp(charset,"US-ASCII")))
system_charset = MIME_name_to_charset("US-ASCII",

***************
*** 888,895 ****
#endif
#endif

- static void default_weedlist P_((void));
-
static int figure_domain P_((void));
static int figure_domain()
{
--- 953,958 ----
***************
*** 1013,1019 ****
*/


- default_weedlist();
errors = 0;

/*
--- 1076,1081 ----
***************
*** 1081,1087 ****
strfcpy(raw_defaultfile, "$MAIL", sizeof raw_defaultfile);
strfcpy(defaultfile, cp, sizeof defaultfile);
}
- alternative_addresses = NULL; /* none yet! */

raw_local_signature[0] = raw_remote_signature[0] =
local_signature[0] = remote_signature[0] =
--- 1143,1148 ----
***************
*** 2141,2286 ****
return eval_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
lcl,word1,word2,filename);
}
-
- void weedout(string)
- char *string;
- {
- /** This routine is called with a list of headers to weed out. **/

! char *strptr, *header, *p;
! int Len;
! int finished;
!
! finished = FALSE;
! strptr = string;
! while (!finished && (header = strtokq(strptr, "\t ,", TRUE)) != NULL) {
! strptr = NULL;
!

Kari E. Hurtta

unread,
May 17, 2004, 11:35:26 AM5/17/04
to
Archive-name: elmME+2.5/PLalpha0.4

Is available on ftp.funet.fi
via anonymous ftp

directory pub/unix/mail/elm/elm-ME+2.5/
files elm-ME+2.5.PLalpha0.patch.gz
and elm-ME+2.5.alpha0.tar.gz

Is available with

Before applying patch catenate part 1 - 5 first.

This patch is agaist Elm 2.4ME+ PL115 (25) --------- [ part 4/5 ] ---------
! if (!*header)
! continue;
!
! for (p = header; *p; ++p) {
! if (*p == '_')
! *p = ' ';
! }

! if (! istrcmp(header, "*end-of-user-headers*"))
! break;

! if (! istrcmp(header, "*end-of-defaults*"))
! finished = TRUE;

! if (! istrcmp(header, "*clear-weed-list*")) {
! while (weedcount)
! free(weedlist[--weedcount]);
! header = "*end-of-defaults*";
! }
!
! if (matches_weedlist(header))
! continue;
!
! if (weedcount > MAX_IN_WEEDLIST) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTooManyWeedHeaders,
! "Too many weed headers! Leaving..."));
! exit(1);
! }
! Len = strlen(header) + 1;
! if ((p = malloc(Len)) == NULL) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTooManyWeedPmalloc,
! "Too many weed headers! Out of memory! Leaving..."));
! exit(1);
! }
! strfcpy(p, header, Len);
! weedlist[weedcount++] = p;
! }
! }

! void alternatives(string)
! char *string;
! {
! /** This routine is called with a list of alternative addresses
! that you may receive mail from (forwarded) **/

! char *strptr, *address;
! struct addr_rec *current_record, *previous_record;

! previous_record = alternative_addresses; /* start 'er up! */
! /* move to the END of the alternative addresses list */

! if (previous_record != NULL)
! while (previous_record->next != NULL)
! previous_record = previous_record->next;
!
! strptr = (char *) string;
!
! while ((address = strtok(strptr, "\t ,\"'")) != NULL) {
! if (previous_record == NULL) {
! previous_record = (struct addr_rec *) pmalloc(sizeof
! *alternative_addresses);
!
! strfcpy(previous_record->address, address,
! sizeof previous_record->address);
! previous_record->next = NULL;
! alternative_addresses = previous_record;
! }
! else {
! current_record = (struct addr_rec *) pmalloc(sizeof
! *alternative_addresses);
!
! strfcpy(current_record->address, address,
! sizeof current_record->address);
! current_record->next = NULL;
! previous_record->next = current_record;
! previous_record = current_record;
! }
! strptr = (char *) NULL;
}
- }

! static void default_weedlist()
! {
! /** Install the default headers to weed out! Many gracious
! thanks to John Lebovitz for this dynamic method of
! allocation!
! **/
!
! static char *default_list[] = { ">From", "In-Reply-To:",
! "References:", "Newsgroups:", "Received:",
! "Apparently-To:", "Message-Id:", "Content-Type:",
! "Content-Length", "MIME-Version",
! "Content-Transfer-Encoding",
! "From", "X-Mailer:", "Status:",
! "X-ELM-",
! "X-UIDL", /* Generated by some POP deamons */
! "Return-Path",
! "*end-of-defaults*", NULL
! };
!
! for (weedcount = 0; default_list[weedcount] != (char *) 0;weedcount++){
! int Len = strlen(default_list[weedcount]) + 1;
! if ((weedlist[weedcount] =
! malloc(Len)) == NULL) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMemDefaultWeed,
! "Not enough memory for default weedlist. Leaving."));
! (*safe_malloc_fail_handler)("default_weedlist", Len);
! return;
! }
! strfcpy(weedlist[weedcount], default_list[weedcount], Len);
}
- }
-
- int matches_weedlist(buffer)
- char *buffer;
- {
- /** returns true iff the first 'n' characters of 'buffer'
- match an entry of the weedlist **/
-
- register int i;
-
- for (i=0;i < weedcount; i++)
- if (strincmp(buffer, weedlist[i], strlen(weedlist[i])) == 0)
- return(1);
-
return(0);
}

--- 2202,2256 ----
return eval_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
lcl,word1,word2,filename);
}

! static CONST char WEED_NO_DEFAULT[] = "*clear-weed-list*";
!

! int matches_weedlist(buffer)
! char *buffer;
! {
! /** returns true iff the first 'n' characters of 'buffer'
! match an entry of the weedlist **/
!
! int i;

! static char *default_list[] =
! { ">From", "In-Reply-To:",
! "References:", "Newsgroups:", "Received:",
! "Apparently-To:", "Message-Id:", "Content-Type:",
! "Content-Length", "MIME-Version",
! "Content-Transfer-Encoding",
! "From", "X-Mailer:", "Status:",
! "X-ELM-",
! "X-UIDL", /* Generated by some POP deamons */
! "Return-Path",
! "*end-of-defaults*", NULL
! };

! char **list = give_dt_path_as_elems(&weedlist,"weedout");

! /* If fist elem is "*clear-weed-list*" then default list is not
! used
! */

! if (!list || !list[0] ||
! 0 != strcmp(list[0],WEED_NO_DEFAULT)) {
!

! for (i = 0; default_list[i]; i++) {
! if (strincmp(buffer, default_list[i], strlen(default_list[i])) == 0)
! return(1);

! }
!
}

! if (list) {
! for (i=0;list[i]; i++) {
! if (strincmp(buffer, list[i], strlen(list[i])) == 0)
! return(1);
! }
}
return(0);
}

Index: elmME+.2.5.alpha0-cvs/lib/realfrom.c
*** elm2.4.ME+.115/lib/realfrom.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/realfrom.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.12 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.12.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 11,17 ****
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"addr");



--- 11,17 ----
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"addr");

Index: elmME+.2.5.alpha0-cvs/lib/remote_mbx.c
*** elm2.4.ME+.115/lib/remote_mbx.c 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/remote_mbx.c 2004-04-25 17:52:38.000000000 +0300
***************
*** 1,15 ****


! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.49 2004/04/04 06:17:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"

#include "shared_imp.h"
#include "s_me.h"
#include "s_elm.h"

--- 1,17 ----
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.49.4.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.4.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "ss_imp.h"
#include "mbx_imp.h"

+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif

#include "s_me.h"
#include "s_elm.h"

***************

*** 179,185 ****
struct remote_account *ra;
{

/* bzero is defined hdrs/defs.h */

! bzero (ra, sizeof (struct remote_account));

ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = 0;
--- 181,187 ----
struct remote_account *ra;
{

/* bzero is defined hdrs/defs.h */

! bzero ((void *)ra, sizeof (struct remote_account));

ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = 0;

Index: elmME+.2.5.alpha0-cvs/lib/reverse.c
*** elm2.4.ME+.115/lib/reverse.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/reverse.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reverse.c,v 1.4 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: reverse.c,v 1.4.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 12,18 ****
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"

void reverse(string)
char *string;


--- 12,18 ----
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"

void reverse(string)
char *string;
Index: elmME+.2.5.alpha0-cvs/lib/rfc822tlen.c
*** elm2.4.ME+.115/lib/rfc822tlen.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/rfc822tlen.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rfc822tlen.c,v 1.6 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: rfc822tlen.c,v 1.6.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 11,17 ****
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include <headers.h>

/*

* rfc822_toklen(str) - Returns length of RFC-822 token that starts at "str".


--- 11,17 ----
* Copyright (c) 1993 USENET Community Trust
*****************************************************************************/

! #include "elm_defs.h"

/*
* rfc822_toklen(str) - Returns length of RFC-822 token that starts at "str".
Index: elmME+.2.5.alpha0-cvs/lib/safemalloc.c
*** elm2.4.ME+.115/lib/safemalloc.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/safemalloc.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: safemalloc.c,v 1.13 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: safemalloc.c,v 1.13.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 11,17 ****
* Copyright (c) 1992 USENET Community Trust
*****************************************************************************/

! #include "headers.h"

/*

* These routines perform dynamic memory allocation with error checking.


--- 11,17 ----
* Copyright (c) 1992 USENET Community Trust
*****************************************************************************/

! #include "elm_defs.h"

/*

* These routines perform dynamic memory allocation with error checking.
Index: elmME+.2.5.alpha0-cvs/lib/safeopen.c
*** elm2.4.ME+.115/lib/safeopen.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/safeopen.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "$Id: safeopen.c,v 1.4 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "$Id: safeopen.c,v 1.4.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 9,20 ****
* Initially written by: Zoltan Hidvegi <hz...@cs.elte.hu>


*****************************************************************************/

! #include <stdio.h>
! #include <fcntl.h>

! #include <unistd.h>
!

! #include "headers.h"
! #include "me.h"

FILE *safeopen(name)
char *name;
--- 9,15 ----
* Initially written by: Zoltan Hidvegi <hz...@cs.elte.hu>
*****************************************************************************/

! #include "defs_major.h"

FILE *safeopen(name)
char *name;
Index: elmME+.2.5.alpha0-cvs/lib/savefolder.c
*** elm2.4.ME+.115/lib/savefolder.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/savefolder.c 2004-04-25 17:52:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75.8.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 16,22 ****


*
*****************************************************************************/

! #include "headers.h"

#include "mbx_imp.h"
#include "s_me.h"

--- 16,22 ----


*
*****************************************************************************/

! #include "elm_defs.h"

#include "mbx_imp.h"
#include "s_me.h"

***************

*** 1357,1363 ****
int real_prepare_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;

! const char *filename;
{


int ret = 0;
int err = 0;
--- 1357,1363 ----
int real_prepare_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;

! CONST char *filename;
{


int ret = 0;
int err = 0;
***************
*** 1471,1477 ****
int real_end_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;

! const char *filename;
{


int ret = 0;

--- 1471,1477 ----
int real_end_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;

! CONST char *filename;
{


int ret = 0;

***************
*** 1505,1511 ****
int real_sync_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;

! const char *filename;
{


int ret = 0;

--- 1505,1511 ----
int real_sync_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;

! CONST char *filename;
{


int ret = 0;

***************
*** 2216,2222 ****
dir->selection = safe_malloc(sizeof (struct name_vector));

/* bzero is defined hdrs/defs.h */

! bzero(dir->selection,sizeof (struct name_vector));
dir->selection->sys_name = sys_name;
dir->selection->disp_name = disp_name;
dir->selection->flags = flags;
--- 2216,2222 ----
dir->selection = safe_malloc(sizeof (struct name_vector));

/* bzero is defined hdrs/defs.h */

/* bzero is defined hdrs/defs.h */

! bzero(*ptr,sizeof (struct browser_write_state));

(*ptr)->magic = WS_magic;
}
--- 3756,3762 ----
(*ptr) = safe_malloc(sizeof (struct browser_write_state));

/* bzero is defined hdrs/defs.h */

! bzero((void *)*ptr,sizeof (struct browser_write_state));

(*ptr)->magic = WS_magic;
}
***************
*** 3767,3773 ****
{
if (*ptr) {

/* bzero is defined hdrs/defs.h */

! bzero(*ptr,sizeof (struct browser_write_state));

free(*ptr);
*ptr = NULL;
--- 3767,3773 ----
{
if (*ptr) {


/* bzero is defined hdrs/defs.h */

! bzero((void *)*ptr,sizeof (struct browser_write_state));

free(*ptr);
*ptr = NULL;

Index: elmME+.2.5.alpha0-cvs/lib/sb_file.c
*** elm2.4.ME+.115/lib/sb_file.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/sb_file.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: sb_file.c,v 1.10 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"

#include "sb_imp.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: sb_file.c,v 1.10.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"

#include "sb_imp.h"

Index: elmME+.2.5.alpha0-cvs/lib/sb_mem.c
*** elm2.4.ME+.115/lib/sb_mem.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/sb_mem.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: sb_mem.c,v 1.5 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"

#include "sb_imp.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: sb_mem.c,v 1.5.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"

#include "sb_imp.h"

Index: elmME+.2.5.alpha0-cvs/lib/schedule.c
*** elm2.4.ME+.115/lib/schedule.c 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/schedule.c 2004-04-18 19:55:40.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: schedule.c,v 1.18 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"net");

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: schedule.c,v 1.18.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"net");

Index: elmME+.2.5.alpha0-cvs/lib/service_list.c
*** elm2.4.ME+.115/lib/service_list.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/service_list.c 2004-04-25 17:52:38.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.26 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"

#include "shared_imp.h"
#include "s_me.h"
#include "s_elm.h"

--- 1,17 ----
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.26.8.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "ss_imp.h"
#include "mbx_imp.h"

+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif

#include "s_me.h"
#include "s_elm.h"

***************

Index: elmME+.2.5.alpha0-cvs/lib/shared_all.c
*** elm2.4.ME+.115/lib/shared_all.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/shared_all.c 2004-04-25 17:52:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.2 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.2.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 11,17 ****
* that file does not need to be guarded with #ifdef
*/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"dl");

--- 11,17 ----
* that file does not need to be guarded with #ifdef
*/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"dl");

Index: elmME+.2.5.alpha0-cvs/lib/shared_base.c
*** elm2.4.ME+.115/lib/shared_base.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/shared_base.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_base.c,v 1.2 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_base.c,v 1.2.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 11,17 ****
* that file does not need to be guarded with #ifdef
*/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"dl");

--- 11,17 ----
* that file does not need to be guarded with #ifdef
*/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"dl");

Index: elmME+.2.5.alpha0-cvs/lib/shared.c
*** elm2.4.ME+.115/lib/shared.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/shared.c 2004-04-25 17:52:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared.c,v 1.54 2004/03/28 18:08:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: shared.c,v 1.54.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 11,17 ****
* that file does not need to be guarded with #ifdef
*/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"dl");

--- 11,17 ----
* that file does not need to be guarded with #ifdef
*/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"dl");

Index: elmME+.2.5.alpha0-cvs/lib/shared_connect.c
*** elm2.4.ME+.115/lib/shared_connect.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/shared_connect.c 2004-04-25 17:52:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.2 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.2.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 11,17 ****
* that file does not need to be guarded with #ifdef
*/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"dl");

--- 11,17 ----
* that file does not need to be guarded with #ifdef
*/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"dl");

Index: elmME+.2.5.alpha0-cvs/lib/shiftlower.c
*** elm2.4.ME+.115/lib/shiftlower.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/shiftlower.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shiftlower.c,v 1.7 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: shiftlower.c,v 1.7.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 12,18 ****
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"mem");



--- 12,18 ----
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"mem");

Index: elmME+.2.5.alpha0-cvs/lib/state.c
*** elm2.4.ME+.115/lib/state.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/state.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: state.c,v 1.10 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: state.c,v 1.10.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 9,15 ****
* Initially written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"misc");
DEBUG_VAR(DebugIO,__FILE__,"stateio");


--- 9,15 ----
* Initially written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"misc");
DEBUG_VAR(DebugIO,__FILE__,"stateio");
Index: elmME+.2.5.alpha0-cvs/lib/streamsched.c
*** elm2.4.ME+.115/lib/streamsched.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/streamsched.c 2004-04-25 17:52:39.000000000 +0300
***************
*** 1,16 ****
! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.33 2004/03/27 18:31:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

!

! #include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"

#include "shared_imp.h"

DEBUG_VAR(Debug,__FILE__,"net");

--- 1,17 ----
! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.33.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "ss_imp.h"
#include "mbx_imp.h"

+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif

DEBUG_VAR(Debug,__FILE__,"net");

Index: elmME+.2.5.alpha0-cvs/lib/strfcpy.c
*** elm2.4.ME+.115/lib/strfcpy.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/strfcpy.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strfcpy.c,v 1.9 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strfcpy.c,v 1.9.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 22,28 ****
* if strlen(src)<len. We don't bother.
*/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"mem");

--- 22,28 ----
* if strlen(src)<len. We don't bother.
*/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"mem");

Index: elmME+.2.5.alpha0-cvs/lib/strftime.c
*** elm2.4.ME+.115/lib/strftime.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/strftime.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strftime.c,v 1.7 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strftime.c,v 1.7.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 52,58 ****
* February 1994
*/

! #include "headers.h"

#ifndef BSD_TYPE
extern void tzset P_((void));
--- 52,58 ----
* February 1994
*/

! #include "elm_defs.h"

#ifndef BSD_TYPE
extern void tzset P_((void));
Index: elmME+.2.5.alpha0-cvs/lib/strincmp.c
*** elm2.4.ME+.115/lib/strincmp.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/strincmp.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strincmp.c,v 1.8 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strincmp.c,v 1.8.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 15,21 ****
/** compare strings ignoring case - length limited
**/

! #include "headers.h"

/* Is this needed? This is same than strncasecmp

* - K E H <hur...@ozone.FMI.FI>

--- 15,21 ----
/** compare strings ignoring case - length limited
**/

! #include "elm_defs.h"

/* Is this needed? This is same than strncasecmp

* - K E H <hur...@ozone.FMI.FI>

Index: elmME+.2.5.alpha0-cvs/lib/stringbuffer.c
*** elm2.4.ME+.115/lib/stringbuffer.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/stringbuffer.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: stringbuffer.c,v 1.9 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"

#include "sb_imp.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: stringbuffer.c,v 1.9.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"

#include "sb_imp.h"

Index: elmME+.2.5.alpha0-cvs/lib/string.c
*** elm2.4.ME+.115/lib/string.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/string.c 2004-04-25 17:52:39.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: string.c,v 1.38 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"
#ifdef USE_DLOPEN

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: string.c,v 1.38.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"
#ifdef USE_DLOPEN

***************
*** 838,844 ****

/* result is malloced */
void bytestream_from_string(str,res,reslen)

! const struct string *str;

char **res;
int *reslen;
{
--- 838,844 ----

/* result is malloced */
void bytestream_from_string(str,res,reslen)

! CONST struct string *str;

char **res;
int *reslen;
{
Index: elmME+.2.5.alpha0-cvs/lib/stringtok.c
*** elm2.4.ME+.115/lib/stringtok.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/stringtok.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: stringtok.c,v 1.4 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"

/*
string_tokenize()
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: stringtok.c,v 1.4.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"

/*
string_tokenize()
Index: elmME+.2.5.alpha0-cvs/lib/striparens.c
*** elm2.4.ME+.115/lib/striparens.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/striparens.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: striparens.c,v 1.6 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: striparens.c,v 1.6.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 22,28 ****
* that will be overwritten on the next call to either routine.
*/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"addr");

--- 22,28 ----
* that will be overwritten on the next call to either routine.
*/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"addr");

Index: elmME+.2.5.alpha0-cvs/lib/strmcpy.c
*** elm2.4.ME+.115/lib/strmcpy.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/strmcpy.c 2004-04-18 19:55:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strmcpy.c,v 1.5 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strmcpy.c,v 1.5.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 9,15 ****
* Initially written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "headers.h"

char * strmcpy (dest, src)
char *dest;


--- 9,15 ----
* Initially written by: Michael Elkins <elk...@aero.org>, 1995
*****************************************************************************/

! #include "elm_defs.h"

char * strmcpy (dest, src)
char *dest;
Index: elmME+.2.5.alpha0-cvs/lib/strtokq.c
*** elm2.4.ME+.115/lib/strtokq.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/strtokq.c 2004-04-18 19:55:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strtokq.c,v 1.5 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strtokq.c,v 1.5.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 17,23 ****
* if flag is non-null. Quotes and backslahes can be escaped with backslash.
*/

! #include "headers.h"

/* Why there is ' -- it is not quote character in mail.


* - K E H <hur...@ozone.FMI.FI>

--- 17,23 ----
* if flag is non-null. Quotes and backslahes can be escaped with backslash.
*/

! #include "elm_defs.h"

/* Why there is ' -- it is not quote character in mail.


* - K E H <hur...@ozone.FMI.FI>

Index: elmME+.2.5.alpha0-cvs/lib/syscall.c
*** elm2.4.ME+.115/lib/syscall.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/syscall.c 2004-04-18 19:55:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.12 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.12.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 15,21 ****
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"

#include "s_elm.h"

DEBUG_VAR(Debug,__FILE__,"mailer");


--- 15,21 ----
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elm_defs.h"

#include "s_elm.h"

DEBUG_VAR(Debug,__FILE__,"mailer");
Index: elmME+.2.5.alpha0-cvs/lib/terminal.c
*** elm2.4.ME+.115/lib/terminal.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/terminal.c 2004-04-18 19:55:42.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.40 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"
#include "cs_terminal.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.40.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"
#include "cs_terminal.h"

Index: elmME+.2.5.alpha0-cvs/lib/unicode.c
*** elm2.4.ME+.115/lib/unicode.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/unicode.c 2004-04-18 19:55:42.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: unicode.c,v 1.18 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "s_me.h"
#include "cs_imp.h"

#include "unidata.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: unicode.c,v 1.18.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_me.h"
#include "cs_imp.h"

#include "unidata.h"
Index: elmME+.2.5.alpha0-cvs/lib/unidata.c
*** elm2.4.ME+.115/lib/unidata.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/unidata.c 2004-04-18 19:55:42.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.28 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"
#include "mmaputil.h"

#include "s_me.h"
#include "unidata.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.28.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "mmaputil.h"

#include "s_me.h"
#include "unidata.h"
Index: elmME+.2.5.alpha0-cvs/lib/write_hdr.c
*** elm2.4.ME+.115/lib/write_hdr.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/lib/write_hdr.c 2004-04-18 19:55:42.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: write_hdr.c,v 1.4 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "headers.h"

DEBUG_VAR(Debug,__FILE__,"header");

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: write_hdr.c,v 1.4.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"

DEBUG_VAR(Debug,__FILE__,"header");

Index: elmME+.2.5.alpha0-cvs/MANIFEST
*** elm2.4.ME+.115/MANIFEST 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/MANIFEST 2004-04-18 19:55:34.000000000 +0300
***************
*** 1,17 ****
README.ME+
! ANNOUNCE.ME
! ChangeLog.ME
! Changes
Configure
! Instruct
MANIFEST
ConfTool/Substitute
ConfTool/CharMap
Makefile.SH
NOTICE
! Overview
! Patchlist
! README
config.h.SH
doc/Alias.guide
doc/Config.guid
--- 1,18 ----
README.ME+
! 2.4/ANNOUNCE.ME
! 2.4/ChangeLog.ME
! 2.4/Changes
Configure
! 2.4/Instruct
MANIFEST
ConfTool/Substitute
ConfTool/CharMap
Makefile.SH
+ 2.4/NOTICE
NOTICE
! 2.4/Overview
! 2.4/Patchlist
! 2.4/README
config.h.SH
doc/Alias.guide
doc/Config.guid
***************
*** 41,50 ****
doc/printmail.1
doc/readmsg.1
doc/tmac.n
- hdrs/defs.h
- hdrs/elm.h
hdrs/elmutil.h
- hdrs/headers.h
hdrs/me.h
hdrs/menu.h
hdrs/menu2.h
--- 42,48 ----
***************
*** 419,421 ****
--- 417,421 ----
lib/shared_base.c
lib/shared_connect.c
lib/shared_all.c
+ hdrs/elm_defs.h
+ hdrs/elm_globals.h
Index: elmME+.2.5.alpha0-cvs/melib/def_melib.h
*** elm2.4.ME+.115/melib/def_melib.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/melib/def_melib.h 2004-04-18 19:55:42.000000000 +0300
***************
*** 1,6 ****
! /* $Id: def_melib.h,v 1.3 2004/03/27 18:31:42 hurtta Exp $ */

! #include "headers.h"
#include "melib.h"


--- 1,6 ----
! /* $Id: def_melib.h,v 1.3.8.1 2004/04/18 16:55:42 hurtta Exp $ */

! #include "elm_defs.h"
#include "melib.h"


Index: elmME+.2.5.alpha0-cvs/melib/Makefile.SH
*** elm2.4.ME+.115/melib/Makefile.SH 2003-10-12 12:48:03.000000000 +0300
--- elmME+.2.5.alpha0-cvs/melib/Makefile.SH 2004-04-18 19:55:42.000000000 +0300
***************
*** 16,22 ****
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17 2003/10/01 17:34:34 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
--- 16,22 ----
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17.44.1 2004/04/18 16:55:42 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
***************
*** 95,116 ****



# Dependencies and rules
# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h $(INCLDIR)/headers.h def_melib.h



! $(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elm.h: $(INCLDIR)/defs.h $(INCLDIR)/melib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h \
! $(INCLDIR)/me.h $(INCLDIR)/elmlib.h


$(CHMOD) u+w $@
$(TOUCH) $@

! def_melib.h: $(INCLDIR)/headers.h $(INCLDIR)/melib.h


$(CHMOD) u+w $@
$(TOUCH) $@

--- 95,117 ----



# Dependencies and rules
# Dependencies of header files upon other header files they include

! .PRECIOUS: def_melib.h $(INCLDIR)/elm_defs.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/defs_major.h



! $(INCLDIR)/elm_defs.h: $(INCLDIR)/defs_major.h $(INCLDIR)/elm_nl_types.h \
! $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/defs_major.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/shared_imp.h: ../shared_libs/include/shared.h


$(CHMOD) u+w $@
$(TOUCH) $@

! def_melib.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/melib.h


$(CHMOD) u+w $@
$(TOUCH) $@

***************

*** 118,124 ****
# Dependencies of C object files
pgp_decode.o: def_melib.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
parse_util.o: def_melib.h $(INCLDIR)/s_me.h
! mailcap.o: def_melib.h $(INCLDIR)/melib.h
mime_parse.o: def_melib.h $(INCLDIR)/s_me.h
mime_decode.o: def_melib.h $(INCLDIR)/s_me.h
mime_selector.o: def_melib.h $(INCLDIR)/s_me.h
--- 119,125 ----
# Dependencies of C object files
pgp_decode.o: def_melib.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
parse_util.o: def_melib.h $(INCLDIR)/s_me.h
! mailcap.o: def_melib.h
mime_parse.o: def_melib.h $(INCLDIR)/s_me.h
mime_decode.o: def_melib.h $(INCLDIR)/s_me.h
mime_selector.o: def_melib.h $(INCLDIR)/s_me.h
Index: elmME+.2.5.alpha0-cvs/melib/mimewalk.c
*** elm2.4.ME+.115/melib/mimewalk.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/melib/mimewalk.c 2004-04-25 17:52:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mimewalk.c,v 1.5 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mimewalk.c,v 1.5.8.1 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 24,30 ****
ret = safe_malloc(sizeof(*ret));

/* bzero is defined hdrs/defs.h */

! bzero(ret,sizeof (*ret));

ret->magic = WALKHANDLER_magic;
ret->handler_type = t;
--- 24,30 ----
ret = safe_malloc(sizeof(*ret));

/* bzero is defined hdrs/defs.h */

! bzero((void *)ret,sizeof (*ret));

ret->magic = WALKHANDLER_magic;
ret->handler_type = t;

Index: elmME+.2.5.alpha0-cvs/melib/pgp_decode.c
*** elm2.4.ME+.115/melib/pgp_decode.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/melib/pgp_decode.c 2004-04-25 17:52:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.38 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.38.8.1 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 290,296 ****
array[1] = pgp_child_out[0];
array[2] = -1;

! rs->ext_init_data = &array;
rs->ext_init = close_them;

env[0] = NULL;
--- 290,296 ----
array[1] = pgp_child_out[0];
array[2] = -1;

! rs->ext_init_data = array;
rs->ext_init = close_them;

env[0] = NULL;

Index: elmME+.2.5.alpha0-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.115/nls/C/C/C/s_elm.m 2004-03-16 21:17:43.000000000 +0200
--- elmME+.2.5.alpha0-cvs/nls/C/C/C/s_elm.m 2004-05-16 08:52:18.000000000 +0300
***************
*** 1013,1024 ****
562 \n\rNotice:\n\r\
ELM requires the use of a folders directory to store your mail folders in.\n\r\
Shall I create the directory %s for you (%c/%c/q)? %c%c
- $ #TooManyWeedHeaders
- 563 Too many weed headers! Leaving...
- $ #TooManyWeedPmalloc
- 564 Too many weed headers! Out of memory! Leaving...
- $ #NoMemDefaultWeed
- 565 Not enough memory for default weedlist. Leaving.
$ #CannotInitErrorExpanding
566 Cannot initialize "%s" - error expanding "%s".
$ #CouldntMakeTempFileName
--- 1013,1018 ----


***************
*** 1915,1922 ****
1042 Skip recipients
$ #BadValueInElmrc
1043 Value of "%s" in line %d in "%s" file is bad
$ #FailedLeaveFolderQuit
! 1045 Failed to leave folder: Try to quit again ([P]anic) ? %c%c
$ #NoItemToMarkUnread
1047 No %S to mark as unread!
$quote "

--- 1909,1918 ----


1042 Skip recipients
$ #BadValueInElmrc
1043 Value of "%s" in line %d in "%s" file is bad
+ $quote "
$ #FailedLeaveFolderQuit
! 1045 "Failed to leave folder: Try to quit again ? ([P]anic/%c/%c) "
! $quote
$ #NoItemToMarkUnread
1047 No %S to mark as unread!
$quote "
***************

*** 1954,1962 ****
$ #HelpTextPrint
1063 P = Print the text of current message or the tagged messages.
$ #Forwarded1
! 1964 ----- Forwarded message from %S -----\n\n
$ #Forwarded2
! 1965 ----- Forwarded message (env-from %s) -----\n\n
$ #Forwarded3
1966 ----- End of forwarded message from %S -----\n
$ #Forwarded4
--- 1950,1958 ----
$ #HelpTextPrint
1063 P = Print the text of current message or the tagged messages.
$ #Forwarded1
! 1964 ----- Forwarded message from %S -----\n
$ #Forwarded2
! 1965 ----- Forwarded message (env-from %s) -----\n
$ #Forwarded3
1966 ----- End of forwarded message from %S -----\n
$ #Forwarded4


***************
*** 2055,2061 ****
2031 save copy
$quote '
$ #NoReceived
! 2032 '"received" folder not available, continue? (%c/%c) '
$quote "
$ #FileSpecify1
2033 "\n\r\n\rYou must specify a file to "

--- 2051,2057 ----


2031 save copy
$quote '
$ #NoReceived
! 2032 '"received" folder not available, continue leaving folder? ([P]anic/%c/%c) '
$quote "
$ #FileSpecify1
2033 "\n\r\n\rYou must specify a file to "
***************
*** 2301,2303 ****

--- 2297,2319 ----


$quote "
$ #PgpRcvSure
2151 "The recv'd message was PGP encoded, are you sure? "
+ $ #FailedLeaveChange

+ 2152 "Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "
+ $quote
+ $ #InstalledSetuid
+ 2153 \n\
+ This version of Elm has been installed setuid=%d. This is dangerous!\n\
+ Elm is NOT designed to run in this mode, and to do so can introduce\n\
+ grave security hazards. See the description of "allow_setuid" in the\n\
+ Elm Reference Guide for further information.\n\n
+ $quote "
+ $ #CopyMessageIntoReplyYN
+ 2154 "Copy message into reply? (%c/%c) "
+ $ #SavecmdSaveMarked
+ 2155 "Save marked messages? (%c/%c) "
+ $ #MlistOff
+ 2156 "[Mlists Off]"
+ $ #MlistOn
+ 2157 "[Mlists On]"
+ $ #HelpToggleMailingList
+ 2158 "M = Toggle display of mailing list information."
Index: elmME+.2.5.alpha0-cvs/nls/C/C/C/s_readmsg.m
*** elm2.4.ME+.115/nls/C/C/C/s_readmsg.m 2002-01-26 13:14:46.000000000 +0200
--- elmME+.2.5.alpha0-cvs/nls/C/C/C/s_readmsg.m 2004-05-14 20:24:35.000000000 +0300
***************
*** 1,6 ****
$set 19 #Readmsg
$ #Usage
! 1 Usage: %s [-anhp] [-f Folder] {MessageNum ... | pattern | *}\n
$ #StateFileCorrupt
2 %s: Elm folder state file appears to be corrupt!\n
$ #CannotExpandFolderName
--- 1,6 ----
$set 19 #Readmsg
$ #Usage
! 1 Usage: %s [-anhp] [-f Folder] [-w weedlist] {MessageNum ... | pattern | *}\n
$ #StateFileCorrupt
2 %s: Elm folder state file appears to be corrupt!\n
$ #CannotExpandFolderName
Index: elmME+.2.5.alpha0-cvs/nls/gencat/gencat.c
*** elm2.4.ME+.115/nls/gencat/gencat.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/nls/gencat/gencat.c 2004-04-22 22:50:17.000000000 +0300
***************
*** 50,56 ****
#include <sys/file.h>
#include <sys/stat.h>
#include "gencat.h"
! #include "headers.h"

/*
* The spec says the syntax is "gencat catfile msgfile...".
--- 50,56 ----
#include <sys/file.h>
#include <sys/stat.h>
#include "gencat.h"
! #include "elm_defs.h"

/*
* The spec says the syntax is "gencat catfile msgfile...".
Index: elmME+.2.5.alpha0-cvs/NOTICE
*** elm2.4.ME+.115/NOTICE 2002-01-26 13:14:44.000000000 +0200
--- elmME+.2.5.alpha0-cvs/NOTICE 2004-04-17 12:03:42.000000000 +0300
***************
*** 2,8 ****


The Elm(tm) Mail System General Public License


! (C) Copyright 1988-1992, USENET Community Trust


(C) Copyright 1986,1987, by Dave Taylor


--- 2,8 ----


The Elm(tm) Mail System General Public License


! (C) Copyright 1988-1996, USENET Community Trust


(C) Copyright 1986,1987, by Dave Taylor


***************
*** 55,68 ****


notices and that the changed sections are clearly delimited as such. The

authors requests copies of any changes made to ensure that the various versions

stay reasonably in sync with each other. Please send all revisions to

! e...@DSI.COM.



NOTE that it is not permitted to copy, sublicense, distribute or transfer any

of the Elm software except as expressly indicated herein. Any attempts to

do otherwise will be considered a violation of this license and your rights

to the Elm software will be voided.

-

Comments on the system and/or this licensing agreement is encouraged. Send

electronic mail to "tay...@intuitive.com". This license was written with

help from Scott McGregor. Thanks Scott!

--- 55,67 ----


notices and that the changed sections are clearly delimited as such. The

authors requests copies of any changes made to ensure that the various versions

stay reasonably in sync with each other. Please send all revisions to

! fl...@virginia.edu.



NOTE that it is not permitted to copy, sublicense, distribute or transfer any

of the Elm software except as expressly indicated herein. Any attempts to

do otherwise will be considered a violation of this license and your rights

to the Elm software will be voided.

Comments on the system and/or this licensing agreement is encouraged. Send

electronic mail to "tay...@intuitive.com". This license was written with

help from Scott McGregor. Thanks Scott!

***************
*** 71,74 ****


Elm is a trademark of Dave Taylor.

NOTE: Elm is now in the public trust. Comments, suggestions, bug reports and the

! like should be sent to Syd Weinstein; e...@DSI.COM (dsinc!elm)
--- 70,73 ----


Elm is a trademark of Dave Taylor.

NOTE: Elm is now in the public trust. Comments, suggestions, bug reports and the

! like should be sent to Bill Pemberton; fl...@virginia.edu
Index: elmME+.2.5.alpha0-cvs/OBSOLETE
*** elm2.4.ME+.115/OBSOLETE 2004-01-24 13:51:43.000000000 +0200
--- elmME+.2.5.alpha0-cvs/OBSOLETE 2004-05-16 16:19:52.000000000 +0300
***************
*** 35,37 ****
--- 35,47 ----
src/curses.c
hdrs/elm_curses.h
src/find_alias.c


+ hdrs/headers.h
+ hdrs/defs.h
+ hdrs/elm.h

+ Overview
+ ANNOUNCE.ME
+ ChangeLog.ME
+ Patchlist
+ Changes
+ Instruct
+ README
Index: elmME+.2.5.alpha0-cvs/Overview
*** elm2.4.ME+.115/Overview 2002-01-26 13:14:44.000000000 +0200


--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************

*** 1,124 ****
- An Overview of the Elm Mail System
- ----------------------------------
-
- Introduction
-
- This file discusses the functionality of the Elm mail system
- and explains some of the motivation behind the various features.
-
- 1. What is Elm?
-
- Currently on UNIX, there seems to be a preponderance of line-oriented
- software. This is most unfortunate as most of the software on UNIX tends to
- be pretty darn hard to use! I believe that there is more than a slight
- correlation between the two, and, since I was myself having problems using
- "mailx" with high-volume mail, I created a new mail system.
-
- In the lingo of the mail guru, Elm is a "User Agent" system,
- it's designed to run with "sendmail" or "/bin/rmail" or any
- other UNIX Mail Transport Agent (according to what's on your system)
- and is a full replacement of programs like "/bin/mail" and "mailx".
- The system is more than just a single program, however, and includes
- programs like "frm" to list a 'table of contents' of your mail, and
- "printmail" to quickly paginate mail files (to allow 'clean'
- printouts).
-
- 2. What's New about Elm?
-
- The most significant difference between Elm and earlier mail
- systems is that Elm is screen-oriented. Upon further use, however,
- users will find that Elm is also quite a bit easier to use, and quite a
- bit more "intelligent" about sending mail and so on. For example, say
- you're on "usenet" and receive a message from someone on the Internet.
- The sender also "cc'd" another person on Internet. With Elm you can
- simply G)roup reply and it will build the correct return addresses.
-
- There are lots of subtleties like that in the program, most of
- which you'll probably find when you need them.
-
- 3. What systems does it work on?
-
- The Elm development group uses almost every UNIX system out
- there between all of its volunteers. Elm runs on USL System V, BSD,
- SunOS, Apollo, UTS, Pyramid and Xenix and should run on almost any UNIX
- systems without any modifications (if there turn out to be
- modifications, please notify the Elm Development Group as soon as
- possible).
-
- 4. Does it obey existing mail standards?
-
- Yes! That's another of the basic reasons the program was
- originally written! To ensure that the date field, the "From:" line
- and so on were all added in the correct format. The program is 100%
- correct according to the RFC-822 electronic mail header protocol
- guide.
-
- 5. What were the main motivating factors for Dave to write Elm?
-
- The first two I've already mentioned, but here's a (somewhat
- partial) list;
-
- - To have a mail system that exploited the CRT instead of
- assuming I'm on a teletype.
-
- - To have a mailer that was 100% correct when dealing with
- network mail (i.e. RFC-822).
-
- - To create a system that needed no documentation for the
- casual user, but was still powerful enough and sophisticated
- enough for a mail expert.
-
- - To write a "significant" piece of software as a learning
- experience (I admit it!)
-
- - To find out how reasonable it is to try to modify a program
- to meet the expectations of the users, rather than vice-versa.
-
- - To basically correct some of the dumb things that the current
- mailers do, like letting you send mail to addresses that it
- could trivially figure out are going to result in 'dead.letter'
-
- - To tie in intimately with the pathalias program output, and
- allow users to specify machine!user or user@machine and have
- the COMPUTER do the work of figuring out addresses...
- (Note: As of 2.4, this has been removed from Elm, as routing
- mail transports are now readily available for all UNIX systems).
-
- 6. Is it reliable?
-
- The mailer, in various incarnations, has logged literally
- thousands upon thousands of hours without any problems that aren't
- now corrected. As new problems arise they're dealt with in as
- rapid a manner as possible...
-
- 7. Disclaimers
-
- The author of this program will deny all liability for any
- damages, either real or imagined, due to the execution of this program
- or anything related to either the software or the system. Furthermore,
- the entire system and all source within, including the presentation
- screens and commands, are legally copyrighted by the author, and while
- they can be used, and abused, for public domain systems, it will be in
- violation of the law if used in systems or programs sold for profit.
-
- By installing the mailer or even extracting it from the network,
- you are agreeing to the above disclaimer.
-
- 8. Finally
-
- I think it's a good program, and I can cite at least 75 people
- who would (begrudgingly, I'm sure) agree. You should most certainly
- install the program and try it!!
-
-
- -- Dave Taylor
- tay...@intuitive.com
- -- Syd Weinstein, Coordinator
- Elm Development Group
- e...@dsi.com
-
- Original: March 13th, 1986
- Modified: October 3th, 1992
- Syd Weinstein, Coordinator
- Elm Development Group
- e...@dsi.com
--- 0 ----
Index: elmME+.2.5.alpha0-cvs/Patchlist
*** elm2.4.ME+.115/Patchlist 2002-01-26 13:14:44.000000000 +0200


--- /tmp/28792-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-05-16 17:21:51.000000000 +0300
***************

*** 1,1612 ****
-
- This Patchset is for the 2.4 version.
-
- Look file ChangeLog.ME for changes of ME version.


- Look file README.ME+ for changes of the 2.4ME+ version.
-

- =========================================================
- Patch Set - Patches 24: Tue Sep 20 14:01:13 EDT 1994
- Elm 2.4PL23 -> Elm 2.4PL24
-
- Remove autoreply/arepdaem, its a security hole
- From: Syd
-
- Fix where buffer was not getting null terminated during its
- construction, so the strcat failed (due to garbage data existing in the
- array at malloc() time).
- From: l...@yallara.cs.rmit.oz.au (Luke Mewburn)
-
- Fix ANSI prototype stripping macro
- From: "Tom Moore" <tmo...@fievel.DaytonOH.NCR.COM>
-
- fixed ReadCh() to recover from EINTR and EAGAIN instead
- of just returning an unexpected EOF.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Replaced the get_tz_mins() routine in lib/get_tz.c with a portable
- version that requires no configuration. Rewrote the test case in
- lib/get_tz.c, and also wrote in support to simplify configuration
- tests. Dropped TZMINS_USE_XXXX configuration parameter. Simplified
- timezone determination in Configure. The new get_tz_mins() introduces
- two side effects. First it steps on the static data returned by
- localtime(). Second, it uses a routine in lib/date_util.c, which
- requires debug initializations. Rewrote get_arpa_date() to work around
- the first issue. Rather than doing the same for lib/strftime.c, just
- removed the timezone stuff with a conditional compile. Elm does not
- use it. Added debugging initializations to util/fastmail.c.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- I made the following changes to elm 2.4pl23 module pmalloc.c after testing on
- a DEC Alpha running OSF1 v1.3. The difficulty is that the Alpha hardware
- requires certain alignment for some operations which was not supplied by
- pmalloc (8 byte for addresses instead of 4 byte). I made a simple minded
- change to pmalloc.c to force alignment of the allocated data block to be
- adequate on DEC Alpha OSF1.
- From: j...@lime.rsmas.miami.edu (Jim Brown)
-
- detect whether atol() is a macro
- From: Mitch DSouza <m.ds...@mrc-applied-psychology.cambridge.ac.uk>
-
- Recognize the "#$HDR" magic cookie as the header to place in the
- user's elmrc file rather than hardwiring a minimally helpful
- string into the binary.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Fix Elm looping if an EOF is received.
- From: Gregory Neil Shapiro <gsha...@WPI.EDU>
-
- There is a bug in the alias-system of elm-2.4.23 that did not appear in
- elm-2.4.21. When searching for a string in the alias-table with the '//'
- command, elm sometimes gets a segmentation fault. With help of a debugger,
- I found that the function shift_lower gets a NULL argument. A fix is
- appended, but maybe the problem lies elsewhere.
- From: Sjaak Schilperoort <J.W.Schi...@research.ptt.nl>
-
- The latest Linux shared library (4.5.8) "catches" a double fclose()
- by generating a SIGSEGV. :-/
- From: fin!ch...@dg-rtp.dg.com (Chip Salzenberg)
-
- Fix a line of debug output that is too long
- From: "C.R. Ritson" <C.R.R...@newcastle.ac.uk>
-
- Here are some more of fixes to correctly call fflush() and unlock() in sequence.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- I had to put in some changes to builtin+ to allow it to display
- 8-bit letters as they should when the message has been sent
- through a real 8-bit channel like ESMTP with 8bit MIME Content-
- Transfer-Encoding.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Tune the Ultrix fix for ispell
- From: Bill Gianopoulos <w...@sccux1.msd.ray.com>
-
- Solaris 2.3 can return EACCES or EEXIST for lockfile already existing.
- From: xc...@uxa.ecn.bgu.edu (Chad Adams)
-
- Below are the changes required to compile/link elm 2.4 pl23 under
- QNX 4.2 with the Watcom 9.5 compiler (very picky).
- From: "Brian Campbell" <brianc@quantum>
-
- In utils/from.c there was a conditionalized declaration of
- getpwuid() which was triggered by the environment being non-
- POSIX instead of non-STDC.
- From: Jukka Antero Ukkonen <ukk...@csc.fi>
-
- There was a typo in src/curses.c. An include read out like
- "# include <vararg.h>" though the file name should have been
- varargs.h.
- From: Jukka Antero Ukkonen <ukk...@csc.fi>
-
- Just a minor fix to an impossible character comparison.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- I found a few months old patch I have not sent you before (I guess).
- It avoids unknowingly confusing some too rigidly and simple mindedly
- coded mailers with weird settings like
-
- charset=us-ascii and textencoding=8bit
-
- This patch will force 7bit encoding with charset=us-ascii.
- E.g. older versions of pine will dump core on 8bit & us-ascii.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- I had to add a region of conditional compilation around "defs.h"
- to make Configure work correctly with the TZNAME_USE_xxxx stuff.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- The "copy_message" function in src/fileio.c incorrectly computes the
- size of the message. The "bytes_seen" variable currently counts all
- bytes in the message ***including the message header*** when it should
- only be counting the bytes in the actual body of the message.
- From: Thomas Dwyer III <tom...@mtu.edu>
-
- Extra } in edit_mailbox removed.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Add an fflush to detect over quota on file saves.
- From: Larry Schwimmer <ros...@cyclone.Stanford.EDU>
-
- Block sigwinch when in the external pager.
- From: j...@yog-sothoth.dcrt.nih.gov (James W. Adams)
-
- Work around null from names by looking to see whether the second or
- third field is a valid month and using that to determine if there
- is an address.
- From: al...@samwise.dccs.upenn.edu (Alex Garthwaite)
-
- Fix up Solaris and SVR4 timeout signal handling
- From: Syd
-
- Add extern declaration of strerror to avoid compiler warning.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Moved #defines for SETJMP & LONGJMP from src/editmsg.c to hdrs/defs.h and
- used them instead of (set|long)jmp directly. This makes the usage consistent
- and Solaris 2.3 behaves correctly w.r.t stop/continue.
- From: Jan....@sa.erisoft.se (Jan Djarv)


-
-
-
-
-

-
- =========================================================
- Patch Set - Patches 23a through 23d: Sun Sep 19 19:48:31 EDT 1993
- Elm 2.4PL22 -> Elm 2.4PL23
-
- Write options to elmrc even if their values are empty strings.
- Rationalize code that reads and writes weedouts and alternates.
- From: chip%f...@myrddin.sybus.com
-
- Correct problem in fetch_alias() with alias record fixup that caused
- core dump on machines with pointers larger than int. This problem
- was reported on comp.mail.elm by Richard Eckman and Jim Brown. Simplify
- get_one_alias() by having it use fetch_alias().
-
- break_down_tolist() tried to blindly split address lists at "," which
- caused bogus results with addreses that had a comma inside a comment
- or quoted text, such as "user@domain (Last, First)". This patch steps
- through the address in quanta of RFC-822 tokens when searching for a
- delimiting comma. It also adds "rfc822_toklen()" to the library to
- get that length.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- This fixes a bug in the MIME code. Include_Part() uses expand_env()
- to expand the include file name, but since expand_env() is destructive
- [it uses strtok()] the file name gets corrupted, and the "Content-Name"
- header can contain a bogus value. The easy fix would be a one-line
- hack to Include_Part to use a temporary buffer. This patch does not
- implement the easy fix. *Every* place expand_env() is used, its side
- effects cause problems. I think the right fix is to make expand_env()
- non-destructive (i.e. have it duplicate the input to a temporary buffer
- and work from there). The attached patch modifies expand_env() in
- that manner, and eliminates all of the `copy to a temporary buffer'
- calls that precede it throughout elm.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- I have been repetedly crashing elm 2.4.22 until I discovered that a
- test for failing to open the system elmrc file is mising. This could
- usefully be added in read_rc.c. Version info and patch follows:
- From: "C.R. Ritson" <C.R.R...@newcastle.ac.uk>
-
- Greatly simplified "lib/striparens.c" to use new rfc822_toklen() routine.
- This cut more than 50% out of the object size. Also added _TEST case.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- When resyncing aliases from elm, and there was aliases to delete,
- the alias.pag file could be corrupted since file_offset wasn't set to zero.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- A long-standing bug of handling replies to VMS systems.
- Original "From: " -line is of format:
- From: "NAME \"Real Name\"" <USERNAME@vms-system>
- (PMDF mailer)
- Anyway, parse_arpa_who() strips quotes too cleanly
- resulting data:
- NAME \"Real Name\
- which, when put into parenthesis, becomes:
- (NAME \"Real Name\)
- which in its turn lacks closing `)'
- Patch of lib/parsarpwho.c fixes that.
- strtokq() started one position too late to search for next double-quote (") char.
- Another one-off (chops off trailing comment character, quote or not..) in src/reply.c
- From: Matti Aarnio <m...@utu.fi>
-
- Three changes to expand_env() in src/read_rc.c: make it non-destructive,
- have it return an error code instead of bailing out, and add a buffer
- size argument to avoid overwritting the destination. The first is to
- avoid all of the gymnastics Elm needed to go through (and occasionally
- forgot to go through) to protect the value handed to expand_env().
- The second is because expand_env() was originally written to support
- "elmrc" and bailing out was a reasonable thing to do there -- but not
- in the other places where it has since been used. The third is just
- a matter of practicing safe source code.
-
- This patch changes all invocations to expand_env() to eliminate making
- temporary copies (now that the routine is non-destructive) and to pass
- in a destination length. Since expand_env() no longer bails out on
- error, a do_expand_env() routine was added to src/read_rc.c handle
- this. Moreover, the error message now gives some indication of what
- the problem is rather than just saying "can't expand".
-
- Gratitous change to src/editmsg.c renaming filename variables to
- clarify the purpose.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- [ Patch description ]
- Update the example elmrc and move a couple out of order variable
- descriptions.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Handle reply-to in batch mode.
- From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
-
- In fastmail, if environment variable $REPLYTO is set, use it as
- default Reply-To. Also, eliminate unnecessary strlen() calls.
- From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
-
- Support aliases both on 64 bit and 32 bit machines at the same time.
- From: Dan Mosedale <mose...@genome.stanford.edu>
-
- Spaces in weedout strings wasn't preserved ("From " became "From").
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Added text about how the weedout list works w.r.t From: and From_
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- default_weedlist() can't use pmalloc, because weedout() calls free when
- it encounters *clear-weed-list*.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- The NLS messages for elm -h output didn't have the -i or -t options.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- The message CannotInitErrorExpanding was called CantExpandEnvVar in s_elm.m.
- Change it for consistency.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Since it was not intended that varargs.h and stdarg.h were
- included simultaneously there may be colliding definitions
- on some systems if you use a standard C compiler. If both
- of these headers are included the compiler has no way to
- know which definitions to use.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- "*clear-weed-list*" in elmrc was wiped out when one saved the options in elm.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- When STDC is used on Convex the feof() function is defined as
- a true library routine in the header files and moreover the
- library routine also leaks royally. It returns always 1!!
- So we have to use a macro. Convex naturally does not provide
- you with one though if you are using a STDC compiler. So we
- have to include one.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Removed bogus string lockfile.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- The last character of a form field gets zapped if more characters than
- the field expects are entered.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Patch for Elm 2.4 PL22 to correct handling of SIGWINCH signals on
- DecStations with Ultrix 4.2.
- The problem was that elm running in an xterm exits silently when the
- window is resize. This was caused by incorrect signal handling for BSD.
- From: vo...@isa.de
-
- Implement new timezone handling. New file lib/get_tz.c with new timezone
- routines. Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
- definitions. Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
- definitions. Updated Configure. Modified lib/getarpdate.c and
- lib/strftime.c to use new timezone routines.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Add proper casts to free() calls to suppress warnings.
- Properly cast return types.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Added -d option to elmalias.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Elm tries to replace the system toupper() and tolower() on current
- BSD systems, which is unnecessary. Even worse, the replacements
- collide during linking with routines in isctype.o. This patch adds
- a Configure test to determine whether replacements are really needed
- (BROKE_CTYPE definition). The <ctype.h> header file is now included
- globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
- there. Inclusion of <ctype.h> was removed from *all* the individual
- files, and the toupper() and tolower() routines in lib/opt_utils.c
- were dropped.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Fix signal type for 386bsd
- From: Scott Mace <sm...@freefall.cdrom.com>
-
- When an environment variable was given as the tmpdir definition the src
- and dest overlapped in expand_env. This made elm produce a garbage
- expansion because expand_env cannot cope with overlapping src and
- dest. I added a new variable raw_temp_dir to keep src and dest not to
- overlap.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- I compiled elm 2.4.22 with Purify 2 and fixed some memory leaks and
- some reads of unitialized memory.
- From: vo...@isa.de
-
- A change to answer:s mail command to be like those of elm and filter.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Elm was failing to write an empty "alternatives" list to elmrc.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Usage message for elmalias changed.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Correct typo and use hard spaces within quotes in *clear-weed-list* note.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- fix where checkalias doesn't fully expand multi-database aliases
- From: Steve Wolf <wo...@atl.hp.com>
-
- The macro ctrl(c) did not work correctly for a DEL character
- neither did it make the backward mapping from a control char
- to the letter that is normally used with an up-arrow prefix
- to represent the control character.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Don't declare _exit() if <unistd.h> already did it.
- From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
-
- Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
- From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
-
- The ANSI version of varargs is "stdarg", not "stdargs".
- From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
-
- Added some documentation for textencoding variable.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- more purify found errors
- From: vo...@isa.de
-
- Add missing parens
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Fix problem where deleting to previous line caused duplication due to the
- file being opened for append (in append mode, all writes are to the end of
- file regardless of the file pointer).
- From: p...@lunch.asd.sgi.com (Paul Close)
-
- have Writechar() backspace over the left edge of the screen to the end
- of the previous line if the current line is not the first line on the
- screen.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Call to expand_env for pager should be call to do_expand_env.
- temp_dir not initialized.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Try splitting chown into two calls to set group on systems where
- chown of owner is restricted.
- From: Syd
-
- strtokq was called with the wrong number of parameters.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Add ability for elmalias to determine HOME if missing from the environment.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Changed a few buffers from LONG_STRING (512) to VERY_LONG_STRING
- to avoid long header lines overflowing the allocated space. At
- least 1024 bytes should be allowed in any header line/field.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Here's some more patch stuff for undersize buffers for header lines.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Fix a code portability problem with Convex.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- I found a few places more where the code was missing a call
- to fflush() before it called unlock() and fclose()/exit()
- right after unlocking the mail drop.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Erroneous Content-Length:s that ended up beyond the end of the folder
- wasn't checked for, so the rest of the folder became one big message.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- expand() didn't read the global rc file if the user elmrc didn't exist or
- didn't have an entry for maildir.
- From: Jan....@sa.erisoft.se (Jan Djarv)
-
- Conform textencoding addition to style standard.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Although it doesnt solve the limit/resync problem of new
- messages, allow them to be accessed anyway.
- From: aus...@solan.unit.no
-
-
-
- =========================================================
- Patch Set - Patches 22 through 22: Sun Jun 6 14:09:37 EDT 1993
- Elm 2.4PL21 -> Elm 2.4PL22
-
-
- If I have two aliases of the same name the duplicate is caught *but
- still written to the data file*!!!
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- test firstname == lastname and if true zero out firstname before
- writing to the aliases.text file. Let me check out the source. Now if
- you try to change a SYSTEM alias it lets you know and asks to verify
- that you are going to superceed that alias.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- fix @aliasname sort problem
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Move first name to lastname if lastname blank.
- this is the only real way for now. I think that the dbz stuff, sorting,
- and other things all hope to see a lastname.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- In some cases, with certain editors, the user can create an
- aliases.text file in which the last line is terminated with an EOF but
- doesn't have a '\n'. Currently, elm with complain that the line is
- too long.
- From: "William F. Pemberton" <wf...@holmes.acc.virginia.edu>
-
- The test in delete did not take into account for mixed case.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Fix builtin editor so you can run "readmsg" with "~<".
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Have real_from() ignore bogus timezones in From_ lines
- rather than bailing out with an error.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- According to the SVID (version 3) the function crypt is
-
- char * crypt( const char *, const char * )
-
- However, it is declared as
-
- unsigned char crypt();
-
- on line 179 of src/encode.c. The "unsigned" keyword causes the compile
- to fail on SVID3 compliant systems. Upon inspection, it appeared that
- the declaration was not even required if CRYPT was not defined, so
- changed it to be conditionally compiled.
- From: Larry Philps <lar...@sco.COM>
-
- len_next_part() was botching quote-delimited strings.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- guide fixes:
- Update for quotes
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Added safe_malloc(), safe_realloc(), and safe_strdup(). They
- will be used in the new elmalias utility.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Initialize safe_malloc() failure trap just to play it safe. Although
- Elm doesn't currently use these routines, do this just in case somebody
- someday adds a call to a library routine that does use them.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Added fetch_alias() and next_addr_in_list() routines for use in
- new elmalias utility.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Modified to use new safe_malloc() routines.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Added new utilities "elmalias" and "prlong". Modified "checkalias"
- and "listalias" to use them.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Added elmalias.1 man page. Updated Users.guide to mention elmalias.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Added references to elmalias(1L).
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Fix year handling bug in date(1) time formats.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- I have now added a parameter which controls whether want_to clears the
- line and centers the question or behaves like it did before. I also
- added a 0 at the end of the parameter list to all the other calls to
- want_to where a centered question on a clean line is not desirable.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- The builtin editor couldn't back up to a line that had a character
- at the wrapcolumn position.
- Added tab handling to the builtin editor.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- None of i, q, x, >, and ^L are recognized by the single character help
- on the options screen. <return> causes the options screen to scroll
- because all non-printing characters are echoed by the error message.
- Options and alias help files didn't list all commands.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- If a To: or Cc: line is split in a comment, that is between ( and ),
- get_and_expand_everyone won't parse that correctly.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Check for EINTR if getchar() returns EOF. Happens after a resume from an
- interactive stop.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- The setting of relop to the default (EQ) was in the wrong place,
- causing the wrong relation to be inserted in the rule.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Removed a malloc of a struct condition_rec that is never used.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- The USR2 signal lost messages on some OS:es and did an unnecessary resync
- on others.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- The primary editor didn't change at once when you entered a new value in
- the option screen.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- The wrong NLS message was used in the option screen for the "A(l)ias Sorting".
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- The "window is too small..." message gets printed on the wrong screen. The
- message also needs \r\n at the end.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Added check if headers_per_page is zero in get_page().
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- want_to() wrote "No." when user pressed return even if the default answer
- wasn't == *def_ans_no.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- The onoff macro assumes a boolean option only has values 1 or 0.
- This is not true for forms option (may be 2 == MAYBE).
-
- This is known bug EB51 BTW. I'm looking at the list now and there are some
- bugs that I think are simple, and I'll try to fix some of them.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Fix to don't use address from reply-to field if it is empty.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- This can not happen according to RFC822. It requires at least one address if the
- reply-to is present, so this bug (EB48) isn't really a bug. But one can
- always try to be nice :-).
-
- nameof() didn't check that the character after the common string was /, thus
- (if Mail is the folderdir) Maildir/x was made to be =dir/x.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Added function enforce_newline to enforce newline (what else :-) at
- end of message.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- These patches makes 'T' (since it was free) do a Tag and Move command in the
- index and alias page, and in the builtin pager.
- In the alias help in src/alias.c, there is a tolower done on the character
- one wants help for. This is clearly wrong.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- On AIX, __STDC__ is not defined but it does use unistd.h, etc. In
- hdrs/def.h, ANS_C already gets defined if __STDC__ or _AIX. But this
- variable then needs to be used in src/init.c and hdrs/filter.h in place
- of the current test for __STDC__.
- From: rst...@elegant.com (Robert Story)
-
- the posix macros to interpret the result of the stat-call.
- From: vo...@isa.de (Gerald Vogt)
-
- In GetPrompt(), when timeout = 0 make sure we check the return of
- ReadCh() for EINTR on non-POSIX (BSDish) systems.
- From: t...@osf.org
-
- I noticed when I was sorting a mailbox by subject, that 2 messages with
- the following subjects
-
- Subject: Re: Reading news
- Subject: Reading news
-
- they were sorted as shown above even though the "Re:" message was
- "Sent" after the original. It turns out that the routine skip_re has a
- bug. If the actual subject (the part after the "Re: ") starts with the
- characters "re" skip_re will erroneously not strip the "Re:" part at
- all. The following patch fixes that behaviour.
- From: Larry Philps <lar...@sco.COM>
-
- Give up and add an Ultrix specific patch. There is a bug in Ispell under
- ultrix. The problem is that when ispell returns, the terminal is no
- longer in raw mode. (Ispell isn't restoring the terminal parameters)
- From: Scott Ames <sc...@cwis.unomaha.edu>
-
- For many embedded X.400 addresses in the format
- "/.../.../.../.../"@admd.country NLEN was simply too short and part of
- the address never made it to the reply address. In my opinion 512 bytes
- should be enough. So make it LONG_STRING.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- I found a small screen corruption problem with elm. If you select 'c' for
- change mailbox and then back out by just typing <Return> at the prompt for the
- new mailbox, the prompt 'Command: ' seems to be reprinted on the wrong line
- leaving the previous prompt and the 'Change Mailbox' string in place.
-
- Further investiagtion tracked the problem to the softkey programming. When a
- newline (LF) character is sent to the terminal in the sofkey's "send" string,
- the terminal still performs a linefeed just as if the linefeed were sent at any
- other time. The particlar set of softkeys for change mode has four such
- newlines and this is enought to cause the screen to scroll up one line. This
- in turn causes the prompt to appear on the wrong line.
-
- I have fixed this by replacing the newlines with carriage returns instead. I
- checked and this still performs the desired action without actually scrolling
- the screen.
- From: Steve Fosdick <ste...@aom.bt.co.uk>
-
- Lets try it again. In the file newmbox.c you check whether a mail is
- metamail. You also check whether a mail has a sun-attachment but elm doesn't
- recognize whether it has other attachment from for example the NeXT.
- From: r...@IS.TWI.TUDelft.NL (Rob Kooper)
-
- For convex, #if-defed memcpy, memset and sleep.
- From: r...@oso.chalmers.se (Rafal Maszkowski)
-
- SunOS 4.1.3 uses the BSD convention for signal handling in system
- calls like read. The system call resumes when the signal handler
- returns unless the SA_INTERRUPT flag is set. Thus to make elm resize
- it's window after a SIGWINCH this flag must be set.
- From: vo...@isa.de (Gerald Vogt)
-
- readmsg treated a line with From_ preceeded by whitespace as a valid
- message delimiter.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- frm treated a line with From_ preceeded by whitespace as a valid
- message delimiter.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- newmail treated a line with From_ preceeded by whitespace as a valid
- message delimiter.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- The message OptionExitHelp in s_elm.m is called OptionReturnHelp in header and
- source files. Change it to keep consistency.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- There was a mismatch between OptionPrintHelp and the message in src/options.c
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- It's very non-portable, and fairly dangerous, to ass_u_me that you
- know what's inside a FILE. So don't #define clearerr().
- From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
-
- Use strerror() with ANSI compilers.
- From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
-
- I'm using Elm 2.4.21 under Linux. Linux has no Bourne shell. Each
- user installs her favorite shell as /bin/sh. I use Bash 1.12.
-
- Elm invokes the mail transport (MTA) like so:
-
- ( ( MTA destination; rm -f tempfile ) & ) < tempfile &
-
- This form of command doesn't work with my Bash, in which any command
- which is backgrounded ("&") gets its stdin attached to /dev/null.
-
- The below patch arranges for Elm to call the MTA thusly:
-
- ( MTA destination <tempfile; rm -f tempfile ) &
- From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
-
- Use pointer arithmetic for aliases on crays
- From: Quentin Van Abbe <rxx...@argolis.osf.rmit.OZ.AU>
-
- NLS message ElmOptionBorderMenu should be ElmOptionBorderHelp in one place.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Try and get getarpdate to work on AIX
- From: "William F. Pemberton" <wf...@holmes.acc.virginia.edu>
-
- If there are local user names (account names) in the alias, they don't
- get fully expanded with a GCOS field like they do when you type an
- account name on the To line.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Jan's removal of tolower in alias.c breaks help for 'I'. This fixes
- that and makes the help messages for characters that have printable
- synonyms on the alias and options screens consistent with the help files.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Fix problem where "<space>From" was recognized as a valid "From_" line.
- From: decwrl!decvax!gatech!WLK.COM!chip (Chip Rosenthal)
-
- created a new elmrc variable named "readmsginc". This specifies an
- increment by which the message count is updated. If this variable is
- set to, say, 25, then the message count will only be updated every 25
- messages, displaying 0, 25, 50, 75, and so forth. The default value
- of 1 will cause Elm to behave exactly as it currently does in PL21.
- From: Eric Peterson <epet...@encore.com>
-
- On the DEC Alpha, OSF/1 the following change made things happy.
- From: da...@opus.csd.uwm.edu (Dave Rasmussen)
-
- Prevent overwriting appended message.
- From: Jason Molenda <mol...@sequent.com>
-
- Add sleepmsg to elmrc to control sleep timing for transient messages
- From: Syd
-
- When compiled on a POSIX host PL22 failed checking whether the file is
- readable and a regular file or not. There was one `!' missing in the
- `if (S_ISREG(mode))' test which should read `if (! S_ISREG(mode))'.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Fix wrong message being displayed and then overwritten
- for long aliases.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- The recent feature addition for the "readmsginc" variable did not modify
- the output statement that is used when MMDF is defined. The following
- patch makes the variable work on MMDF systems.
- From: Larry Philps <lar...@sco.COM>
-
- A MIME body-part must end with a newline even when there was no newline
- at the end of the actual body or the body is null. Otherwise the next
- mime boundary may not be recognized. The same goes with the closing
- boundary too.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Moved the new numeric variables to the Numeric Variables section and
- applied the quoting/highlight policy to them.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- When frm checked for file access on a POSIX system there
- was a test `&& S_ISREG(mode)' instead of `&& ! S_ISREG(mode)'
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- A couple of calls to want_to() had typos. Here is the patch.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- document new tidy feature
- From: da...@devteq.co.uk (Dave Thomas)
-
- This is a trivial patch to 'from.c' to tidy up the output is
- the cases where the 'from' part is longer that 20 characters.
- It adds the new '-t' (for tidy) option:
- From: da...@devteq.co.uk (Dave Thomas)
-
- fix elmalias bug
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Fix bug where text following "<" within double-quote delimited comment
- is taken as an address.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- fix want-to patch collision
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- It looks like there was some earlier patch that re-introduced
- some lock problems from the past time of 2.4beta.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- While looking into the feasibility of adding `limit sender' as requested
- on Usenet, I noticed that the limit code was replicated for each of
- the supported conditions. The following patch simplifies limit_selection()
- by sharing the common code between all conditions.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- In the Makefile listalias was given only a+x permission
- though it should have been a+rx.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Total rewrite of verify_transmission(). The existing code was a monsterous
- mess and rife with bugs (couldn't forget zero-length messages in send-only
- mode, prompts were being setup wrong, perms on Canceled.mail not done right,
- etc. etc. etc.) Previously, the work had been split among two places,
- the main code in mail() and the menu in verify_transmission(), and Elm kept
- bouncing back and forth between the two. Now, all work is performed in
- verify_transmission() and it simply returns a send-it/forget-it status.
- Modified "Canceled.mail" handling so that the files it creates are in
- an mbox format (i.e. now includes headers as well as message body).
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- With this patch build_address() should treat local mailing
- lists and other aliases known by the transport agent as valid
- addresses.
- I also conditionalized printing the "Expands to: " message
- in check_only mode to be done only when there is an expanded
- address to print. Build_address will inform anyway about an
- alias that does not exist.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Move the actual file saving code out of "save_copy()" into a seperate
- routine called "append_copy_to_file()" to make it globally available.
- In particular the "Canceled.mail" handling is going to be rewritten
- to use it.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Dave Thomas forgot to update the NLS message file when he added the tidy
- option to frm. While I was at it, I did a little cleanup to keep things
- alphabetized.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- check for missing replyfile
- From: r...@lorien.gatech.edu (Roy Mongiovi)
-
- Elm either failed to expand a group alias or crashed in strlen
- (called from do_expand_group()).
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Cosmetic addition to previous verify_transmission() changes. The
- merged code highlighted the fact that i)spell displayed a message
- and then immediately cleared the screen (erasing that message) before
- invoking ispell. This patch drops the clear screen.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Make it use the message catalog already defined
- From: Super Y.S.T. <tab...@matsumoto.dcl.co.jp>


-
-
-
-
-

-
- =========================================================
- Patch Set - Patches 21 through 21: Mon Feb 8 13:41:36 EST 1993
- Elm 2.4PL20 -> Elm 2.4PL21
-
- Do not assume that "char c" can represent EOF.
- From: ch...@tct.com (Chip Salzenberg)
-
- exitprog.c makes a reference to a null character pointer, savecopy.c
- tries to reference an uninitialized variable, and the previous patch to
- src/lock.c to get rid of an uninitialized variable compiler message
- needed to be put in filter/lock.c as well.
- From: w...@grouper.mkt.csd.harris.com (W. David Higgins)
-
- Just a small bugfix for the '#' (Debug Message) screen. The columns of the
- various flags don't all line up properly:
- From: Gary Bartlett <ga...@abekrd.co.uk>
-
- Significant changes to provide consistent Date and From_ header
- cracking. Overhauled date utilities and moved into library. Moved
- real_from() into library. Modified frm, newmail, and readmsg utilities
- to use library version of real_from(). Moved get_word() from Elm
- source into library. Added new library routines atonum() and strfcpy().
- Fixed trailing backslash bug in len_next().
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- add c)hange alias command to alias helpfile
- if a deleted alias is changed, undelete it. Also added the 'N'
- flag to changed aliases to help remind the user. Documented it.
- Note: if they mark the alias for deletion AFTER making the change it
- WILL be deleted. (and marked accordingly)
- modified alias mode title string to indicate when a resync was
- needed.
- allow editing alias file when none exist.
- Now aliases are check for illegal characters (and WS) and
- addresses are check for illegal WS when they are being entered. If
- anything illegal is found and message is printed and they keep entering
- the item until they get it right.
- I fixed a couple of places where int should be long to match
- the declared type of alias_rec.length
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- fix which file name is used on confirm messages
- From: vo...@isa.de (Gerald Vogt)
-
- There is a mismatch between the number of args and the format string in
- src/pattern.c.
- In nls/C/C/C/s_filter.m there is a , after OutOfMemory.
- This is my fault, and although it doesn't seem to affect things, there is no
- need for it.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Elm switches screens prematurely when calling metamail. It switches
- before writing the "Press any key..." message, thus losing metamail output.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- read_headers() in src/newmbox.c assumes that Mime-Version preceeds
- Content-Type in the headers. I removed that assumption.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- On a resync, the temp file was being reopened in *append*
- mode, thus the fseek that tried to back up the file pointer had no
- effect.
- From: Larry Philps <lar...@sco.COM>
-
- alter the message on aborts to report the temp file name to the user
- From: The Postmaster <sys...@central1.lancaster.ac.uk>
-
- During 'make uninstall', an error occurs with the make for doc/,
- due to a wrongly-extended "if" statement in the Makefile.
- From: Allan Kugel <hico2!hico3!al...@tsdiag.ocpt.ccur.com>
-
- Nits and typos in the NLS messages and corresponding default messages.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Fix one of the aliases.dir to be aliases.pag.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Some systems don't have SIGBUS, make it optional.
- From: Syd
-
- When SY_ENV_SHELL is set for syscall() it ends up touching SHELL in
- the parent's environment if vfork is used, so change to fork.
- From: ta...@uunet.uu.net (David C Lawrence)
-
- Adds a new integer parameter builtinlines.
- if (builtinlines < 0) and (the length of the message < LINES on
- screen + builtinlines) use internal.
- if (builtinlines > 0) and (length of message < builtinlines)
- use internal pager.
- if (builtinlines = 0) or none of the above conditions hold, use the
- external pager if defined.
- From: "John P. Rouillard" <rou...@ra.cs.umb.edu>
-
- I implemented a change to filter's default verbose message format
- including %x %X style date and time along with username
- From: ma...@drd.com (Mark Lawrence)
-
- Filter turns spaces in quoted strings into _ and then back again. This destroys
- any _ that where there in the first place. This patch removes that.
- Also fixed a minor bug where 'filter -r' wrote out the wrong thing if the
- relation in a rule was '~'.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- The following minor patch for leavembox.c is useful for BSD systems
- which implement correct (per SVID & POSIX) struct utimbuf. Where the
- source previously tested just '#ifdef BSD' it now tests '#if
- defined(BSD) && !defined(UTIMBUF)'. This suppresses a compile-time
- warning on ConvexOS due to the prototype of utime.
- From: rwr...@dhostwo.convex.com (Randy Wright)
-
- Correct MMDF syntax problems and newmail botches.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- When elm exits because a spool mailbox is used, it should do a Raw(OFF) so
- that the error message get's printed on the right screen.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- It seams that SCO Unix nedds 1 pair of () extra to get
- the new newmail.c code to work.
- From: Jan S{ll <jan%uni...@Mail.SWIP.net>
-
- fixed the behaviour of the tool nfrm or frm -snew to be inconsistent
- with elm itself. In from.c it never recognized the file in the MAIL
- environment variable to be a SPOOL file as you say in the source.
- From: Erick Otto <eo...@hvlpa.ns-nl.att.com>
-
- There is a small bug in this routine in Chip's PL21 patch. The code
- calls atonum to convert the 4 digit timezone field. However this field
- is actually of the form HHMM, not a decimal number, so for example
- -0500 was being converted to -500 rather than the correct -300.
- From: Larry Philps <lar...@sco.COM>
-
- Corrections to PL21 Alpha docs and consistent punctuation use in help files.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- When newmail stats/reads the mailbox it updates the access times. This
- causes problems for users that run both newmail and xbiff since xbiff
- just looks at the access times of the mailbox. Added code to newmail
- that borrows some code from src/leavembox.c for updating mailbox access
- times.
- From: a...@redwood.cray.com (Chris Jackman)
-
- More utime portability problems with convex
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Adresses with double quoted strings that contains comma was parsed
- wrongly by break_down_tolist() and figure_out_addressee().
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Fix where we remove the extra hostbangs and on which fields we do
- it to include bcc and cc as well as to, and to do it in the file
- copies as well as the command line.
- From: Syd via code change request from d...@neptune.att.com
- A Raw(OFF) was missing so when in mail only mode and one
- does f)orget, the "Message saved" ends up on wrong screen.
- Also added \r\n to end of messages to make output look nicer.
-
- When composing mail in the builtin editor, it wrapped on /.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- xrealloc name conflicts with some os having a routine called xrealloc,
- renamed it elm_xrealloc.
- From: Syd
-
- added the RFC822 fields Comments, In-Reply-To and References.
- to fastmail.
- From: Greg Smith <sm...@heliotrope.bucknell.edu>
-
- Fix src/alias.c for which seek is being used, FILE * requires fseek
- From: Syd via prompt from mfv...@netcom.com (Michael Vargo)
-
- Add cast to silence compiler warning.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Make alias names consistently handled as lower case.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Fix to copy_file to ignore unescaped from if content_length not yet reached.
- Fixes to NLS messages match number of newlines between default messages
- and NLS messages. Also an extra ) was removed.
- From: Jan Djarv <Jan....@sa.erisoft.se>


-
-
-
-
-

-
-
-
- =========================================================
- Patch Set - Patches 18 through 20: Thu Dec 24 18:53:52 EST 1992
- Elm 2.4PL17 -> Elm 2.4PL20
-
- Fix unintended change where forwarding without editing started adding
- prefix chars
- From: Syd
-
- Here are the doc changes for my additions to the alias system and
- the new switches to listalias.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Add a c)hange alias, -u and -t options to listalias to list only user
- and only system aliases respectively.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Fix formatting and typograpical problems
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Always pass three parameters to header_cmp().
- From: ch...@tct.com (Chip Salzenberg)
-
- Fixed where when doing ! or | and ti/te is enabled, one doesn't see the
- "Press any key to return to ELM:" message. because the screens are
- switched before the message is printed.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Quote from the filter of phrase to prevent RFC-822 parsing problems
- From: Syd via request from Ian Stewartson <iste...@dlvax2.datlog.co.uk>
-
- EDITOROPTS and DEFEDITOR appear to be unused but here is
- a patch to make use of $editoropts.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Fix confirm prompts to follow Elm style in confirm append/create
- From: Syd
-
- Fix messages and nls messages to match. Plus use want_to
- where appropriate.
- From: Syd, via prompting from Jan Djarv <Jan....@sa.erisoft.se>
-
- Add Ignore of CONT signals on exit for Ultrix
- From: Syd via prompt from Bob Mason
-
- Add lstat call for proper detection of symlink in leavembox.c
- From: Syd via prompt from Bryan Curnutt
-
- Make copy_sans_escape expand tabs to prevent subject displays from getting messed up
- From: Syd via request from p...@Cayman.COM (Paul Fox)
-
-
-
-
- =========================================================
- Patch Set - Patches 13 through 17: Fri Dec 11 20:52:23 EST 1992
- Elm 2.4PL13 -> Elm 2.4PL17
-
- Attempt to fix where Elm was issuing the final error message on the
- cursor screen instead of the regular screen on terminals where the
- ti/te code swaps the screen.
- From: Syd
-
- Internal fix to use correct errno on some error messages.
- From: Syd
-
- Add decode option to copy_message
- From: bjo...@stud.cs.uit.no (Bjoern Stabell)
-
- Fix Configure for ls that return 0 status even if file
- is not found, re packing man pages.
- From: a...@redwood.cray.com (Chris Jackman)
-
- Fix Configure not getting mailgrp correct on symlinks.
- From: a...@redwood.cray.com (Chris Jackman)
-
- Add missing -n flag to doc makefile.
- From: g...@dogmatix.inmos.co.uk
-
- Always init fcntlerr and flockerr in src/lock.c to avoid compiler
- warnings.
- From: Syd via prompt from w...@grouper.mkt.csd.harris.com (W. David Higgins)
-
- Traditional C used 'unsigned preserving' rules when an integral data
- value is widened to integer and ANSI C changed the rules to 'value
- preserving'. This is one of the few things that the ANSI X3J11 committee
- did that might break existing programs. Casting to (int)
- From: Bo.Asbjorn.Muldbak <b...@jutland.ColumbiaSC.NCR.COM>
-
- When ELM is reporting "appending to <foldername>" I never get to see
- but a flash of light, before the message line has been replaced by a
- dummy "Messages saved" string. And if you happen to have mistyped the
- foldername or the leading '=', you never see the foldername.
-
- This fix will change file.c to show either
-
- Message <what> to <foldername>
-
- or
- <#> messages <what> to <foldername>
- From: Bo.Asbjorn.Muldbak <b...@jutland.ColumbiaSC.NCR.COM>
-
- This implements the use of SIGUSR1 and SIGUSR2 as discussed on the
- mailing list recently, and adds them to the documentation.
- From: s...@lokkur.dexter.mi.us (Steve Simmons)
-
- Attempt to patch posix_signal for SunOS problem.
- From: A lot of the Elm group
-
- Change canceled mail message to indicate full path name as
- AFS users don't have home and elm's home the same.
- From: Syd
-
- Fix doc/Makefile.SH to have an else clause on all if's so that
- if's that return an error code on a not taken if and a null else
- clause don't exit the makefile
- From: Syd via requests from many
-
- General changes for apollo portability


- From: gor...@mcil.comm.mot.com (Gordon Berkley)
-

- Fix typos in edit.c
- From: Bo.Asbjorn.Muldbak <b...@jutland.ColumbiaSC.NCR.COM>
-
- If sigset() and sigrelse() are available, release signal before
- using longjmp() to leave signal handler.
- From: ch...@tct.com (Chip Salzenberg)
-
- Anytime elm wants to re-run newalias, selected is set to 0.
- (removing any limit in effect)
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Allow for use from restricted shell by putting SHELL=/bin/sh in the
- environment of spawned mail transport program.
- From: ch...@tct.com (Chip Salzenberg)
-
- fix Obvious typos.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- List_folder knew only about '=' but nothing about the rest
- of [+=%] as one would have expected.
- From: Jukka Antero Ukkonen <ukk...@venus.csc.fi>
-
- Fix where the user creates a first new alias, then deletes it, the
- alias stays on screen, but the file really will be empty if it was the
- last alias, so the retry to delete gives 'cannot open ...file' messages
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Make Elm complain about spaces that are not after commas in
- alias and address lists
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Make verb and pronoun agree.
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- in do_get_alias(). abuf[] was under dimensioned.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Remove the old packed manual page before trying to pack the new one.
- From: Tom Moore <tmo...@fievel.DaytonOH.NCR.COM>
-
- Fix double inclusion of sys/types.h
- From: Tom Moore <tmo...@wnas.DaytonOH.NCR.COM>
-
- Fix building editor wrap problem
- From: Syd via prompting from vo...@isa.de (Gerald Vogt)
-
-
-
-
- =========================================================
- Patch Set - Patches 12 and 13: Sat Nov 21 21:03:26 EST 1992
- Elm 2.4PL11 -> Elm 2.4PL13
-
- Handle the case where a system does
- > #define jmp_buf sigjmp_buf
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Fix segmentation violation on restricted alias page jump.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Fix bug where alias records were not sorting by both last and
- first names.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Fix when expanding the macro '%S', the subject line is scanned for a
- 'Re:', and if nothing is found, a '"Re: ' is added. But when a 'Re:'
- *is* found, then nothing is added, not even the '"'.
- From: Sigmund Austigard <aus...@solan.unit.no>
-
- I was playing with the metamail stuff and Sun's Openwindows Mailtool
- and discovered that I was able to 'display' messages generated with
- Mailtool in elm using metamail. This marks the Sun Attachments as
- needing metamail.
- From: Lutz Brunke <bru...@dkrz-hamburg.dbp.de>
-
- Change the way Configure and doc/Makefile.SH deal with installing
- man pages.
- From: Tom Moore <tmo...@wnas.DaytonOH.NCR.COM>
-
- Add support for a "config.changes" file to override Configure decisions.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Allow SCO MMDF to use the mmdf library for mailer via execmail.
- From: Larry Philps <lar...@sco.com>
-
- Add on initial display or display where the entire screen is being
- drawn, we should not output the trailing blanks that clear the old
- value.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- This mod fixes overlapping prototypes for strchr and index on
- Convex.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- According to the MIME BNF, quoted strings are allowed in the value portion
- of a parameter.
- From: c...@alias.com (C. Harald Koch)
-
- The fastmail utility appears to work incorrectly when multiple addresses are
- supplied. Spaces were inserted between addresses rather than commas.
- From: lit...@carina.hks.com (Jim Littlefield)
-
-
-
- =========================================================
- Patch Set - Patch 11: Tues Nov 17 1992
- Elm 2.4PL10 -> Elm 2.4PL11
-
- Quickie fix to handle a botched edit of a test line in Configure
-
-
-
-
- =========================================================
- Patch Set - Patches 9 and 10 : Sat Nov 14 21:34:44 EST 1992
- Elm 2.4PL8 -> Elm 2.4PL10
-
- I think that the code in 'newmbox.c' which handles bad 'Content-length'
- entries is incomplete. The file-ptr for the mail file is
- backed up, but the file-ptr of the temp file WAS LEFT UNMODIFIED !
- From langesw.ssw.de!root Wed Nov 11 14:28:57 1992
-
- When elm copies the temp mailbox back to the mail spool to resync or
- quit, it changes to the mailgroup before attempting to diddle in the
- mail spool, but when it copies the temp mailbox back to the mail spool
- after editing, it forgets to change to mailgroup. This patch appears
- to work, but I haven't exhaustively checked for some path that leaves
- the gid set
- wrong. From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- There's an error in two messages in s_aliases.m which causes elm2.4
- to core dump when resyncronize aliases. (%s/%s) should be (%c/%c).
-
- This bug doesn't show up unless you use message catalogs, since the default
- message in a_quit.c is correct.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Fix how nls emulation lib gencat links prev pointers
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- The alias message_count isn't set to zero if the last alias has
- been deleted from the alias table. As no aliases are reread from
- the aliases database the message_count is left as it was before.
-
- Fixed that the function do_newalias() sometimes returns without freeing
- the buffer allocated before. The patch adds these free calls.
-
- When you erroneously type a number in your folder elm asks you for
- a new current message number. But now if you erase this one number
- and leave the string empty elm will set the new current message to
- the second message on our sun4! The patch adds a check for an empty
- string and returns the current number if no number was entered.
- From: vo...@isa.de (Gerald Vogt)
-
- The situation is that the .elm/aliases file is missing, but
- .elm/aliases.dir and .elm/aliases.pag exist (isn't serendipity
- wonderful?). The ndbz functions tolerate this and just put a NULL
- pointer in the db structure for the data file FILE pointer. However,
- get_one_alias() in listalias and elm doesn't account for the db_open()
- succeeding but the dbz_basef field being NULL, so it passes the NULL
- pointer to fread(). Detect null and return 0
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Clear the screen before displaying MIME:
- From: mar...@rhi.hi.is (Marius Olafsson)
-
- Add regexp processing to filter.
- Add execc operator
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
-
-
-
- =========================================================
- Patch Set - Patches 7 and 8 : Sat Nov 7 15:54:44 EST 1992
- Elm 2.4PL6 -> Elm 2.4PL8
-
- Add some tolerance for incorrect Content-Length header (fixes bug where
- Elm would combine two messages if content-length header was incorrect.
- Still has problem if incorrect content-length exactly matches multiple
- messages)
- From: Syd
-
- Change Makefile in doc to use -f as some shells don't have -x in test
- From: Syd
-
- The first is that when doing a summary, macros are expanded when printing the
- rule. IMHO they should be printed as with the -r option (i.e. %t is
- printed as "<time>" and so on).
-
- The second one is that the summary printed "applied n time" regardless of
- the value of n, not "applied n times" when n > 1.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- There is no need to write out the MIME-Version header in subparts
- From: Klaus Steinberger <Klaus.St...@Physik.Uni-Muenchen.DE>
-
- fix null dereferences from patch 5
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Fix where elm duplicates the entry's from the global elm.rc.
- It will however still copy the global weedout headers to your local
- elmrc if they where not already in it.
- From: ja...@fwi.uva.nl (Jan Wortelboer)
-
- another typo (2.4.6 Ref.guide)
- From: David.W...@gagme.chi.il.us (David W. Tamkin)
-
- comments should be allowed anywhere in the alias file.
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Symbol change for AIX370
- From: u...@watson.ibm.com
-
- Fix redefinition complaint by SCO 3.2v2.0.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- Enhanced printing support. Added "-I" to readmsg to
- suppress spurious diagnostic messages.
- From: ch...@chinacat.unicom.com (Chip Rosenthal)
-
- These small typos stopped me from making forms, so here is a patch.
- From: andrew.m...@rd.eng.bbc.co.uk (Andrew McParland)
-
- Add a hack to not use ti/te on list folders and do print
- From: Syd
-
- New header parsing routine header_cmp to allow for linear
- white space around the : in headers
- From: Syd
-
-
-
- =========================================================
- Patch Set - Patch 6 : Mon Nov 2 15:52:00 EST 1992
- Elm 2.4PL5 -> Elm 2.4PL6
-
- Things I found in doc/Ref.guide looking over patches 4 & 5:
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- More changes to folder creation confirmation
- From: Larry Philps <lar...@sco.COM>
-
- fix a bug in the forms reply caused by the Cc: buffer not being
- cleared. If one has sent mail just prior to replying to the form and
- specified a Cc: address, the form reply is also sent to those Cc:
- address(es).
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- Add missing MAKE variable in doc/Makefile.SH
- From: Syd
-
- it invokes metamail (the pseudo is because "text" isn't a legal Content-Type).
- in src/mime.c notplain() tries to check for text but fails because it should
- look for "text\n" not "text".
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- Use copy_message in mime shows to get encode processing
- From: bjo...@stud.cs.uit.no (Bjoern Stabell)
-
- Corrections to Unix date parsing and time zone storage
- From: eo...@hvlpa.att.com
-
- Prevent index underflow when wildchar is in first three chars of string
- From: Syd via note from g...@dogmatix.inmos.co.uk
-
-
- =========================================================
- Patch Set - Patches 4 and 5 : Sat Oct 24 22:48:00 EDT 1992
- Elm 2.4PL3 -> Elm 2.4PL5
-
- Fixes SysV style forwarding
- From: Baruch Cochavy <bcoc...@ilux39.intel.com>
-
- fix newmail attempting to close a file descriptor even if the corresponding
- open failed.
- From: "Peter A. Bigot" <p...@cs.arizona.edu>
-
- In our global elm.rc I keep the four options as below
-
- confirmappend = OFF Don't confirm every append to any file.
- confirmcreate = ON Confirm creation of every new file.
- confirmfiles = ON Confirm append to non folder files though.
- confirmfolders = ON In case someone does not want to be asked
- every time when creating a new file try
- to confirm creation of folders though.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- changes found by using codecenter on Elm 2.4.3
- From: Graham Hudspith <g...@inmos.co.uk>
-
- There is now an additional elmrc option "displaycharset", which
- sets the charset supported on your terminal. This is to prevent
- elm from calling out to metamail too often.
- Plus a slight documentation update for MIME composition (added examples)
- From: Klaus Steinberger <Klaus.St...@Physik.Uni-Muenchen.DE>
-
- More typos
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- I think all these are typos
- From: dwo...@pffft.sps.mot.com (Dave Wolfe)
-
- remove the 25 (MAXRULES) limitation.
- Basically it mallocs rules in hunks of RULESINC (25) as it goes along.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- fixed a bug were elm didn't call metamail on messages with a characterset,
- which could be displayed by elm itself, but message is encoded with QP
- or BASE64
- From: Klaus Steinberger <Klaus.St...@Physik.Uni-Muenchen.DE>
-
- Here are the patches to support POSIX sigaction().
- From: t...@osf.org
-
-
- =========================================================
- Patch Set - Patch 3: Mon Oct 19 13:10:28 EDT 1992
- Elm 2.4PL2 -> Elm 2.4PL3
-
- Fix spelling of name
- From: Larry Philps <lar...@sco.COM>
-
- corrected typos
- From: David.W...@gagme.chi.il.us (David W. Tamkin)
-
- Here's another; now the copyright notices on the man pages don't seem
- to have an ego problem. The various guides are just fine.
- From: Steve Simmons <s...@wotan.iti.org>
-
- setting the debug level to 5 or higher caused a core dump due to a possible
- dereference of a NULL pointer
- From: "Peter A. Bigot" <p...@cs.arizona.edu>
-
- rewrite the Configure prompt for metamail
- From: Steve Simmons <s...@iti.org>
-
- Correct reversed usage of $d_utimbuf.
- From: ch...@tct.com (Chip Salzenberg)
-
- Fix warnings from my ANSI C compiler because the declaration of
- edit_interrupt did not match the prototype for the second argument of
- a call to signal.
- From: Larry Philps <lar...@sco.COM>
-
- TEXT_SORT was supported, but UNRECOGNIZED
- From: l...@dmicvx.dmi.min.dk (Lennart Sorth)
-
- Force text arithmetic into unsigned for those systems
- with signed chars
- From: Marius Olafsson <mar...@rhi.hi.is>
-
- Change lock file name to add user name on filter locking of mail spool
- From: Peter Brouwer <p...@idca.tds.philips.nl>
-
- Fix messages to work with 4.3bsd /bin/sh
- From: w8...@TACOM-EMH1.Army.Mil (Keith Petersen - MACA WSMR)
-
- Add flags to read_rc to support command line overrides of the option.
- From: Jan Djarv <Jan....@sa.erisoft.se>
-
- adds the function bytemap() and the macros MAPIN and MAPOUT from the file
- lib/ndbz.c in the file src/alias.c.
- This fixes the byte order independence in aliases.
-
- prevent elm from exiting when resyncing the empty incoming mailbox.
- From: vo...@isa.de (Gerald Vogt)
-
- patch to make elm use (or in my case, not use) termcap/terminfo ti/te.
- From: Graham Hudspith <g...@inmos.co.uk>
-
- =========================================================
- Patch Set - Patches 1 and 2: Sat Oct 10 22:14:59 EDT 1992
- Elm 2.4PL0 -> Elm 2.4PL2
-
- Switch to wrapper for flock and fcntl locking.
- Change order to fcntl first, other order blocked.
- From: Jukka Ukkonen <ukk...@csc.fi>
-
- Fix some compiler warnings that I receive compiling Elm on my SVR4
- machine.
- From: Tom Moore <tmo...@fievel.DaytonOH.NCR.COM>
-
- Add AIX to src/curses.c for define of window size in different include
- file.
- From: Syd via note from Tom Kovar
-
- get_return() assumes that message_count reflects the number of
- messages in the current folder, but the message_count it's seeing
- from the alias subsystem is actually the *alias* count.
- toggle the main state before and after calling get_return().
- From: cl...@sfn.ORG (R. Cliff Young)
-
- Add missing setlocale and getopen to newalias and listalias.
- From: Syd
-
- Touchups on config guide
- From: David Barr <ba...@pop.psu.edu>
-
- Fix segv in wildcards if SHELL= has no / character in path
- From: Syd
-
- 1. If firstname && lastname is null then copy aliasname into the
- personal name field (inside the ()'s) when creating an alias
- from the menu using the 'n' command.
-
- 2. Now if for some reason and alias has a null personal name field
- (the person hand edited aliases.text) the blank () is not printed
- as part of the address. This actually cured another problem, where
- the To: field on the screen (when you hit 'm' on the alias menu)
- used to be blank, now the address shows up....
- From: "Robert L. Howard" <robert...@matd.gatech.edu>
-
- Updated AIX 3.2 section of README file
- From: Syd
-
- fixed a bug in the .lp macro in doc/tmac.n. The lp macros is always
- called with a unit specified for the second argument, however, the
- macro added a "n" unit specifier to that argument. The following patch
- fixes this problem.
-
- The various .guide books use the troff .tl macro liberally, but often the
- extra ' characters needed at the end of the lines to explicitly specify
- the trailing nulls fields were left off. The following patch fixes the
- erroneous lines.
- From: Larry Philps <lar...@sco.COM>
-
- While installing elm2.4 on a Sun4 running SunOS4.1.2, the Configure script
- doesn't recognize F_SETLK because it searches in /usr/include/sys/fcntl.h
- which includes /usr/include/sys/fcntlcom.h (where F_SETLK is).
- From: d...@ulysse.enst.fr (Philippe Dax)
-
- change dbm name to dbz to avoid conflicts with partial call
- ins from shared libraries, and from mixing code with yp code.
- From: Syd via prompt from Jess Anderson
-
--- 0 ----
Index: elmME+.2.5.alpha0-cvs/shared_libs/iconv/Makefile.SH
*** elm2.4.ME+.115/shared_libs/iconv/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elmME+.2.5.alpha0-cvs/shared_libs/iconv/Makefile.SH 2004-04-18 19:55:42.000000000 +0300
***************
*** 17,23 ****
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.8 2004/01/24 11:06:02 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.8.22.1 2004/04/18 16:55:42 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 92,106 ****
clean:
rm -f $(OBJS) ../../shlib/libelmme-iconv.so libiconv.a

! .PRECIOUS: $(INCLDIR)/elmshared.h ../../hdrs/defs.h

! $(INCLDIR)/elmshared.h: ../../hdrs/defs.h ../../hdrs/patchlevel.h ../../hdrs/elmlib.h $(INCLDIR)/shared.h


$(CHMOD) u+w $@
$(TOUCH) $@

! ../../hdrs/defs.h: ../../config.h ../../hdrs/sysdefs.h


! $(CHMOD) u+w $@
! $(TOUCH) $@

Makefile: Makefile.SH ../../config.sh config.res


@echo "You must run 'sh Configure -S' or 'sh Configure'"

--- 92,111 ----
clean:
rm -f $(OBJS) ../../shlib/libelmme-iconv.so libiconv.a

! .PRECIOUS: $(INCLDIR)/elmshared.h ../../hdrs/elm_defs.h ../../hdrs/defs_major.h

! $(INCLDIR)/elmshared.h: ../../hdrs/elm_defs.h ../../hdrs/patchlevel.h $(INCLDIR)/shared.h


$(CHMOD) u+w $@
$(TOUCH) $@

! ../../hdrs/elm_defs.h: ../../hdrs/defs_major.h ../../hdrs/elm_nl_types.h ../../hdrs/elmlib.h


! $(CHMOD) u+w $@
! $(TOUCH) $@
!

! ../../hdrs/defs_major.h: ../../config.h ../../hdrs/sysdefs.h


! $(CHMOD) u+w $@
! $(TOUCH) $@
!

Makefile: Makefile.SH ../../config.sh config.res


@echo "You must run 'sh Configure -S' or 'sh Configure'"

Index: elmME+.2.5.alpha0-cvs/shared_libs/include/elmshared.h
*** elm2.4.ME+.115/shared_libs/include/elmshared.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/shared_libs/include/elmshared.h 2004-04-18 19:55:42.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmshared.h,v 1.5 2004/03/27 18:31:43 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmshared.h,v 1.5.8.1 2004/04/18 16:55:42 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 9,24 ****

/** Main header file for ELM ME+ shared libraries. **/



- #include <stdio.h>
- #include <fcntl.h>
- #include <errno.h>
- #include <signal.h>
-

- #include <sys/stat.h>
-
- #include "../../hdrs/defs.h"
#include "../../hdrs/patchlevel.h"
! #include "../../hdrs/elmlib.h"

#include "shared.h"

--- 9,16 ----

/** Main header file for ELM ME+ shared libraries. **/

#include "../../hdrs/patchlevel.h"
! #include "../../hdrs/elm_defs.h"

#include "shared.h"

Index: elmME+.2.5.alpha0-cvs/shared_libs/smtp/Makefile.SH
*** elm2.4.ME+.115/shared_libs/smtp/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elmME+.2.5.alpha0-cvs/shared_libs/smtp/Makefile.SH 2004-04-18 19:55:42.000000000 +0300
***************
*** 17,23 ****
echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.12 2004/01/24 11:06:02 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.12.22.1 2004/04/18 16:55:42 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 62,76 ****
clean:
rm -f $(OBJS) ../../shlib/libelmme-smtp.so libsmtp.a

! .PRECIOUS: $(INCLDIR)/elmshared.h ../../hdrs/defs.h

! $(INCLDIR)/elmshared.h: ../../hdrs/defs.h ../../hdrs/patchlevel.h ../../hdrs/elmlib.h $(INCLDIR)/shared.h


$(CHMOD) u+w $@
$(TOUCH) $@

! ../../hdrs/defs.h: ../../config.h ../../hdrs/sysdefs.h


! $(CHMOD) u+w $@
! $(TOUCH) $@

Makefile: Makefile.SH ../../config.sh config.res


@echo "You must run 'sh Configure -S' or 'sh Configure'"

--- 62,80 ----
clean:
rm -f $(OBJS) ../../shlib/libelmme-smtp.so libsmtp.a

! .PRECIOUS: $(INCLDIR)/elmshared.h ../../hdrs/elm_defs.h ../../hdrs/defs_major.h

! $(INCLDIR)/elmshared.h: ../../hdrs/elm_defs.h ../../hdrs/patchlevel.h $(INCLDIR)/shared.h


$(CHMOD) u+w $@
$(TOUCH) $@

! ../../hdrs/elm_defs.h: ../../hdrs/defs_major.h ../../hdrs/elm_nl_types.h ../../hdrs/elmlib.h


! $(CHMOD) u+w $@
! $(TOUCH) $@
!

! ../../hdrs/defs_major.h: ../../config.h ../../hdrs/sysdefs.h


! $(CHMOD) u+w $@
! $(TOUCH) $@

Makefile: Makefile.SH ../../config.sh config.res


@echo "You must run 'sh Configure -S' or 'sh Configure'"

Index: elmME+.2.5.alpha0-cvs/shared_libs/tls/Makefile.SH
*** elm2.4.ME+.115/shared_libs/tls/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elmME+.2.5.alpha0-cvs/shared_libs/tls/Makefile.SH 2004-04-18 19:55:42.000000000 +0300
***************
*** 17,23 ****
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.16 2004/01/24 11:06:02 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.16.22.1 2004/04/18 16:55:42 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 82,96 ****
clean:
rm -f $(OBJS) ../../shlib/libelmme-tls.so libtls.a

! .PRECIOUS: $(INCLDIR)/elmshared.h ../../hdrs/defs.h

! $(INCLDIR)/elmshared.h: ../../hdrs/defs.h ../../hdrs/patchlevel.h ../../hdrs/elmlib.h $(INCLDIR)/shared.h


$(CHMOD) u+w $@
$(TOUCH) $@

! ../../hdrs/defs.h: ../../config.h ../../hdrs/sysdefs.h


! $(CHMOD) u+w $@
! $(TOUCH) $@

Makefile: Makefile.SH ../../config.sh config.res


@echo "You must run 'sh Configure -S' or 'sh Configure'"

--- 82,101 ----
clean:
rm -f $(OBJS) ../../shlib/libelmme-tls.so libtls.a

! .PRECIOUS: $(INCLDIR)/elmshared.h ../../hdrs/elm_defs.h ../../hdrs/defs_major.h

! $(INCLDIR)/elmshared.h: ../../hdrs/elm_defs.h ../../hdrs/patchlevel.h $(INCLDIR)/shared.h


$(CHMOD) u+w $@
$(TOUCH) $@

! ../../hdrs/elm_defs.h: ../../hdrs/defs_major.h ../../hdrs/elm_nl_types.h ../../hdrs/elmlib.h


! $(CHMOD) u+w $@
! $(TOUCH) $@
!

! ../../hdrs/defs_major.h: ../../config.h ../../hdrs/sysdefs.h


! $(CHMOD) u+w $@
! $(TOUCH) $@
!

Makefile: Makefile.SH ../../config.sh config.res


@echo "You must run 'sh Configure -S' or 'sh Configure'"

Index: elmME+.2.5.alpha0-cvs/src/alias.c
*** elm2.4.ME+.115/src/alias.c 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/alias.c 2004-05-15 13:52:16.000000000 +0300
***************
*** 1,15 ****


! static char rcsid[] = "@(#)$Id: alias.c,v 1.35 2004/04/07 17:42:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This file contains alias stuff
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: alias.c,v 1.35.2.1 2004/05/15 10:52:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.2.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/alias.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/alias.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This file contains alias stuff
***************
*** 2065,2070 ****
--- 2075,2104 ----

}

+
+ /* Check whether an address is aliased; if so return the alias, otherwise
+ * return NULL. */
+ char *address_to_alias(address, aview)
+ char *address;
+ struct AliasView *aview;
+ {
+ int i;
+ int ac;
+
+ open_alias_files(aview, NULL);
+
+ ac = get_alias_count(aview);
+ for (i = 0; i < ac; i++) {
+ struct alias_rec * a = give_alias(aview,i);
+ if (a) {
+ if (istrcmp(address, a->address) == 0)
+ return a->alias;
+ }
+ }
+ return NULL;
+ }


+
+
/*
* Local Variables:
* mode:c

Index: elmME+.2.5.alpha0-cvs/src/aliases/def_aliases.h
*** elm2.4.ME+.115/src/aliases/def_aliases.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/aliases/def_aliases.h 2004-04-18 19:55:43.000000000 +0300
***************
*** 1,8 ****
! /* $Id: def_aliases.h,v 1.4 2004/03/27 18:31:47 hurtta Exp $ */

! #include "headers.h"
#include "me.h"
-
#include "ndbz.h"

struct current_astorage {
--- 1,8 ----
! /* $Id: def_aliases.h,v 1.4.8.1 2004/04/18 16:55:43 hurtta Exp $ */

! #include "elm_defs.h"
! #include "mime.h"
#include "me.h"
#include "ndbz.h"

struct current_astorage {
Index: elmME+.2.5.alpha0-cvs/src/aliases/Makefile.SH
*** elm2.4.ME+.115/src/aliases/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elmME+.2.5.alpha0-cvs/src/aliases/Makefile.SH 2004-04-18 19:55:43.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/aliases/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.4 2004/01/06 09:13:39 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
--- 17,23 ----

echo "Extracting src/aliases/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.4.24.1 2004/04/18 16:55:43 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
***************
*** 62,78 ****
$(RANLIB) $@



# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/headers.h def_aliases.h



! $(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h


$(CHMOD) u+w $@
$(TOUCH) $@

! def_aliases.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h $(INCLDIR)/ndbz.h


$(CHMOD) u+w $@
$(TOUCH) $@

--- 62,85 ----
$(RANLIB) $@



# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/elm_defs.h $(INCLDIR)/defs_major.h def_aliases.h \
! $(INCLDIR)/me.h



! $(INCLDIR)/elm_defs.h: $(INCLDIR)/defs_major.h $(INCLDIR)/elm_nl_types.h \
! $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/defs_major.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! def_aliases.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/me.h \
! $(INCLDIR)/mime.h $(INCLDIR)/ndbz.h


! $(CHMOD) u+w $@
! $(TOUCH) $@
!

! $(INCLDIR)/me.h: $(INCLDIR)/melib.h


$(CHMOD) u+w $@
$(TOUCH) $@

Index: elmME+.2.5.alpha0-cvs/src/a_quit.c
*** elm2.4.ME+.115/src/a_quit.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/a_quit.c 2004-04-25 19:59:27.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_quit.c,v 1.17 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: a_quit.c,v 1.17.8.1 2004/04/25 16:59:27 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 67,73 ****
if (ac == 0)
return(newaliases); /* nothing changed */

! ask_questions = ((!prompt) ? FALSE : question_me);

/* YES or NO on softkeys */
/*
--- 67,73 ----
if (ac == 0)
return(newaliases); /* nothing changed */

! ask_questions = ((!prompt) ? FALSE : ask_delete);

/* YES or NO on softkeys */
/*
Index: elmME+.2.5.alpha0-cvs/src/args.c
*** elm2.4.ME+.115/src/args.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/args.c 2004-04-17 12:03:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: args.c,v 1.61 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.61.8.1 2004/04/17 09:03:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 292,302 ****
printf( "\t and bug reports for that reason will be rejected.\n\n");
}
#endif
! if (i == 1)
! printf("\n\tBased on Elm 2.4 PL24 - PL25\n\n");

if (i < 3) {


printf("\t(C) Copyright 1996-2004 Kari Hurtta\n");
printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");
printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}

--- 292,305 ----
printf( "\t and bug reports for that reason will be rejected.\n\n");
}
#endif
! if (i == 1) {
! printf("\n\tBased on Elm 2.4 PL24 - PL25\n");
! printf("\tIncorporates some code from Elm 2.5 PL7\n\n");
! }

if (i < 3) {


printf("\t(C) Copyright 1996-2004 Kari Hurtta\n");

+ printf("\tBased on Elm 2.5, (C) Copyright 1988-1999 USENET Community Trust\n");


printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");
printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}

Index: elmME+.2.5.alpha0-cvs/src/a_screen.c
*** elm2.4.ME+.115/src/a_screen.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/a_screen.c 2004-05-01 10:41:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_screen.c,v 1.15 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: a_screen.c,v 1.15.8.1 2004/05/01 07:41:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 51,57 ****
else if (entry->status & EXPIRED) mybuffer[0] = 'E';
else if (entry->status & NEW) mybuffer[0] = 'N';
else if (entry->status & UNREAD) mybuffer[0] = 'O';
! else if (entry->status & REPLIED) mybuffer[0] = 'r';
else mybuffer[0] = ' ';



/** and the second... **/

--- 51,57 ----
else if (entry->status & EXPIRED) mybuffer[0] = 'E';
else if (entry->status & NEW) mybuffer[0] = 'N';
else if (entry->status & UNREAD) mybuffer[0] = 'O';
! else if (entry->status & REPLIED_TO) mybuffer[0] = 'r';
else mybuffer[0] = ' ';



/** and the second... **/

Index: elmME+.2.5.alpha0-cvs/src/attach_menu.c
*** elm2.4.ME+.115/src/attach_menu.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/attach_menu.c 2004-04-25 19:59:27.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.62 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.62.8.1 2004/04/25 16:59:27 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 2428,2434 ****
"There are no attachments!"));
break;
}
! if (question_me) {
for(;;) {
PutLine0(LINES-3, 0, "Are you sure? (y/n): y");
MoveCursor(LINES-3, 21);
--- 2428,2434 ----
"There are no attachments!"));
break;
}
! if (ask_delete) {
for(;;) {
PutLine0(LINES-3, 0, "Are you sure? (y/n): y");
MoveCursor(LINES-3, 21);
Index: elmME+.2.5.alpha0-cvs/src/browser.c
*** elm2.4.ME+.115/src/browser.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/browser.c 2004-04-25 17:52:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: browser.c,v 1.29 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: browser.c,v 1.29.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1281,1287 ****
struct string **buffer;
int * redraw;
enum word_sel w;
! string * prev_fold;
struct AliasView *aview;
CONST char *format;
CONST char *msg;
--- 1281,1287 ----
struct string **buffer;
int * redraw;
enum word_sel w;
! struct string * prev_fold;
struct AliasView *aview;
CONST char *format;
CONST char *msg;

Index: elmME+.2.5.alpha0-cvs/src/builtin++.c
*** elm2.4.ME+.115/src/builtin++.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/builtin++.c 2004-04-30 19:50:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.23 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.23.8.1 2004/04/30 16:50:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 446,452 ****
{
int code;

- /* KESKEN */
code = optionally_enter2 (page,
&search_pattern,
LINES-1, 0,
--- 446,451 ----
Index: elmME+.2.5.alpha0-cvs/src/def_elm.h
*** elm2.4.ME+.115/src/def_elm.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/def_elm.h 2004-04-18 19:55:42.000000000 +0300
***************
*** 1,16 ****
! /* $Id: def_elm.h,v 1.3 2004/03/27 18:31:44 hurtta Exp $ */

! /* Author: Kari Hurtta */

/* Included on all src files on src (ie. on main elm)
- ... execpt elm.c (which includes elm.h)
*/

! #include "headers.h"
#include "me.h"

- extern JMP_BUF GetPromptBuf; /* setjmp buffer */
- extern int InGetPrompt; /* set if in GetPrompt() in read() */

/*
* Local Variables:
--- 1,19 ----
! /* $Id: def_elm.h,v 1.3.8.1 2004/04/18 16:55:42 hurtta Exp $ */

! /******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.1 $ $State: Exp $
! *
! * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
! *****************************************************************************/

/* Included on all src files on src (ie. on main elm)
*/

! #include "elm_defs.h"
! #include "mime.h"
#include "me.h"
+ #include "elm_globals.h"


/*
* Local Variables:
Index: elmME+.2.5.alpha0-cvs/src/editmsg.c
*** elm2.4.ME+.115/src/editmsg.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/editmsg.c 2004-05-04 21:39:33.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.42 2004/03/27 18:31:44 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

*****************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This contains routines to do with starting up and using an editor (or two)
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.42.8.2 2004/05/04 18:39:33 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

*****************************************************************************
+ * Based on Elm 2.4 src/editmsg.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/editmsg.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This contains routines to do with starting up and using an editor (or two)
***************
*** 688,693 ****
--- 698,710 ----
}
Raw(ON);

+ /* Flush input buffer. This is especially important under X,
+ * where accidental keystrokes in the elm window could make
+ * things messy.
+ */
+ if (edit_flush)
+ FlushInput();
+
enforce_newline(filename2);

if (filename2 != filename) {
***************
*** 1939,1945 ****
static struct string **gb_editmsg(I,em, base_page)
struct enter_info *I;
enum enter_mode em;
! struct menu_context *base_page; /* KESKEN */
{
switch(em) {
case em_redraw_initial:
--- 1956,1962 ----
static struct string **gb_editmsg(I,em, base_page)
struct enter_info *I;
enum enter_mode em;
! struct menu_context *base_page;
{
switch(em) {
case em_redraw_initial:
Index: elmME+.2.5.alpha0-cvs/src/elm.c
*** elm2.4.ME+.115/src/elm.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/elm.c 2004-05-15 23:11:36.000000000 +0300
***************
*** 1,32 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.69 2004/03/27 18:31:44 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

*****************************************************************************
* The Elm Mail System
*

* This file and all associated files and documentation:


* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/* Main program of the ELM mail system!
*/

#include "patchlevel.h"
! #include "elm.h"
#include "s_elm.h"

#ifdef BSD_TYPE
# include <sys/timeb.h>
#endif

- #include "mime.h"
- #include "me.h"
-
DEBUG_VAR(Debug,__FILE__,"ELM");


--- 1,42 ----
! static char rcsid[] = "@(#)$Id: elm.c,v 1.69.8.3 2004/05/15 20:11:36 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

*****************************************************************************
+ * Based on Elm 2.4 src/elm.c. That code was following copyright:


+ *
* The Elm Mail System
*

* This file and all associated files and documentation:


* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/elm.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *

+ * This file and all associated files and documentation:


+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/* Main program of the ELM mail system!
*/

#include "patchlevel.h"
!
! #define INTERN
! #include "def_elm.h"
#include "s_elm.h"

#ifdef BSD_TYPE
# include <sys/timeb.h>
#endif

DEBUG_VAR(Debug,__FILE__,"ELM");


***************
*** 398,403 ****
--- 408,432 ----
*redraw = pgp_mail_public_key(mailbox, aview, page);
break;
#endif
+
+
+ case 'M' :
+ if (show_mlists) {
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
+ ElmMlistOff,
+ "[Mlists Off]"));
+
+ show_mlists = 0;
+ } else {
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
+ ElmMlistOn,
+ "[Mlists On]"));
+
+ show_mlists = 1;
+ }
+ (*redraw) = 1; /* force redraw */
+
+ break;

case 'm' : Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmMail,
***************
*** 1605,1611 ****
(current_header->status & URGENT) != 0,
(current_header->status & VISIBLE) != 0,
(current_header->status & UNREAD) != 0,
! (current_header->status & REPLIED) != 0,
(current_header->status & MIME_MESSAGE) != 0,
(current_header->status & PRE_MIME_CONTENT) != 0,
(current_header->status & MIME_UNSUPPORTED) != 0,
--- 1634,1640 ----
(current_header->status & URGENT) != 0,
(current_header->status & VISIBLE) != 0,
(current_header->status & UNREAD) != 0,
! (current_header->status & REPLIED_TO) != 0,
(current_header->status & MIME_MESSAGE) != 0,
(current_header->status & PRE_MIME_CONTENT) != 0,
(current_header->status & MIME_UNSUPPORTED) != 0,
Index: elmME+.2.5.alpha0-cvs/src/file.c
*** elm2.4.ME+.115/src/file.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/file.c 2004-05-15 13:52:16.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: file.c,v 1.36 2004/03/27 18:31:45 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

*****************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** File I/O routines, mostly the save to file command...
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: file.c,v 1.36.8.2 2004/05/15 10:52:16 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

*****************************************************************************
+ * Based on Elm 2.4 src/file.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/save.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** File I/O routines, mostly the save to file command...
***************
*** 67,75 ****
If text_only is text, message is decoded.
**/

! int tagged = 0, i, oldstat = 0, appending = 0,
is_ordinary_file, scount = 0;
int mesgnum = 0; /* message whose address is used for save-by-name fn */
char
answer;

--- 77,86 ----
If text_only is text, message is decoded.
**/

! int num_tagged = 0, i, oldstat = 0, appending = 0,
is_ordinary_file, scount = 0;
int mesgnum = 0; /* message whose address is used for save-by-name fn */
+ int current_is_tagged = 0; /* is current message tagged? */
char
answer;

***************
*** 85,109 ****

XXX = new_browser(selection_folder);

! if (chdr)

oldstat = chdr->status; /* remember */

*redraw = FALSE;

mc = get_message_count(mailbox);


for (i=0; i < mc; i++) {

struct header_rec * hdr = give_header(mailbox,i);

if (hdr && ison(hdr->status, TAGGED)) {

! if(!tagged)
mesgnum = i; /* first tagged msg - use this one for
* save-by-name folder name */
! tagged++;
}
}

! if (tagged == 0) {
mesgnum = current-1; /* use this one for save-by-name folder name */

- tagged = 1;
if (chdr)
setit(chdr->status, TAGGED);
/* 2 == text_only -- Not envelope information */
--- 96,153 ----

XXX = new_browser(selection_folder);

! if (chdr) {


oldstat = chdr->status; /* remember */

+ current_is_tagged = ison(chdr->status, TAGGED);
+ }
*redraw = FALSE;

mc = get_message_count(mailbox);


for (i=0; i < mc; i++) {

struct header_rec * hdr = give_header(mailbox,i);

if (hdr && ison(hdr->status, TAGGED)) {

! if(!num_tagged)
mesgnum = i; /* first tagged msg - use this one for
* save-by-name folder name */
! num_tagged++;
! }
! }
!
! /* confirm save of tagged message if selection is elsewhere */
! if (num_tagged > 0 && !current_is_tagged && confirm_tag_save) {
!
! /* XXXXX prompt? */
!
! int ret;
! int LINES, COLUMNS;
!
!
! again:


! menu_get_sizes(page, &LINES, &COLUMNS);
!

! ret = prompt_letter(LINES-4,"",*def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark,page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmSavecmdSaveMarked,
! "Save marked messages? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
! if (REDRAW_MARK == ret) {
! *redraw = 1;
! goto again;
! }
!
! if (EOF == ret)
! return 0;
!
! if (ret != *def_ans_yes) {
! num_tagged = 0;
}
}

! if (num_tagged == 0) {
mesgnum = current-1; /* use this one for save-by-name folder name */

if (chdr)
setit(chdr->status, TAGGED);
/* 2 == text_only -- Not envelope information */
***************
*** 112,119 ****
}

DPRINT(Debug,4, (&Debug,
! "%d message%s tagged for saving (save)\n", tagged,
! plural(tagged)));

while (1) {
int code;
--- 156,163 ----
}

DPRINT(Debug,4, (&Debug,
! "%d message%s tagged for saving (save)\n", num_tagged,
! plural(num_tagged)));

while (1) {
int code;
***************
*** 125,144 ****
menu_get_sizes(page, &LINES, &COLUMNS);


! if (!buffer && save_by_name &&
mhdr && mhdr->from && mhdr->from[0].addr) {
char buffer1[1000];
!
/** build default filename to save to **/

! get_return_name(mhdr->from[0].addr,
! buffer1, TRUE, sizeof buffer1);
buffer = format_string(FRM("=%s"), buffer1);
}

/* 2 == text_only -- Not envelope information */
if (text_only > 0) {
! if (tagged == 1)
gen_browser(page,
XXX,&buffer,redraw,
delete ? word_save : word_copy,
--- 169,196 ----
menu_get_sizes(page, &LINES, &COLUMNS);


! if (!buffer && ( save_by_name || save_by_alias ) &&
mhdr && mhdr->from && mhdr->from[0].addr) {
char buffer1[1000];
! char * return_alias = NULL;
!
/** build default filename to save to **/

! if (save_by_alias &&
! (return_alias = address_to_alias(mhdr->from[0].addr,
! aview)) != NULL)
! strfcpy(buffer1, return_alias, sizeof buffer);
!
! else
! get_return_name(mhdr->from[0].addr,
! buffer1, TRUE, sizeof buffer1);
!
buffer = format_string(FRM("=%s"), buffer1);
}

/* 2 == text_only -- Not envelope information */
if (text_only > 0) {
! if (num_tagged == 1)
gen_browser(page,
XXX,&buffer,redraw,
delete ? word_save : word_copy,
***************
*** 157,163 ****
"%s text messages to: "),
(delete ? cap_save_word : cap_copy_word));
} else {
! if (tagged == 1)
gen_browser(page,
XXX,&buffer,redraw,
delete ? word_save : word_copy,
--- 209,215 ----
"%s text messages to: "),
(delete ? cap_save_word : cap_copy_word));
} else {
! if (num_tagged == 1)
gen_browser(page,
XXX,&buffer,redraw,
delete ? word_save : word_copy,
***************
*** 308,318 ****
mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */


struct header_rec * hdr = give_header(mailbox,i);

! if (hdr && ison(hdr->status, TAGGED)) {


if (!save_message(i, XXX, buffer, write_ptr,
! (tagged > 1), appending++,
silently, delete, text_only, redraw,
mailbox, aview, header_page))
fail++;
--- 360,371 ----
mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */


struct header_rec * hdr = give_header(mailbox,i);

! if (0 == num_tagged && mesgnum == i ||
! num_tagged > 0 && hdr && ison(hdr->status, TAGGED)) {


if (!save_message(i, XXX, buffer, write_ptr,
! (num_tagged > 1), appending++,
silently, delete, text_only, redraw,
mailbox, aview, header_page))
fail++;
***************
*** 328,340 ****
delete ? save_word:copy_word, buffer);
} else {
if (text_only) {
! if (tagged == 1 && !appending)
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmTextMessageSaved,
"Text of message %s to %S."),
delete ? saved_word: copied_word,
buffer);
! else if (tagged > 1)
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmTextMessagesSaved,
"Text of %d messages %s to %S."),
--- 381,393 ----
delete ? save_word:copy_word, buffer);

Kari E. Hurtta

unread,
May 17, 2004, 11:36:04 AM5/17/04
to
Archive-name: elmME+2.5/PLalpha0.5

Is available on ftp.funet.fi
via anonymous ftp

directory pub/unix/mail/elm/elm-ME+2.5/
files elm-ME+2.5.PLalpha0.patch.gz
and elm-ME+2.5.alpha0.tar.gz

Is available with

Before applying patch catenate part 1 - 5 first.

This patch is agaist Elm 2.4ME+ PL115 (25) --------- [ part 5/5 ] ---------
} else {
if (text_only) {
! if (num_tagged <= 1 && !appending)


lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmTextMessageSaved,
"Text of message %s to %S."),
delete ? saved_word: copied_word,
buffer);

! else if (num_tagged > 1)


lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmTextMessagesSaved,
"Text of %d messages %s to %S."),

***************
*** 342,353 ****


delete ? saved_word: copied_word,
buffer);

} else {


! if (tagged == 1 && !appending)

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMessageSaved,
"Message %s to %S."),

delete ? saved_word: copied_word,
buffer);
! else if (tagged > 1)

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMessagesSaved,


"%d messages %s to %S."),

scount,
--- 395,406 ----


delete ? saved_word: copied_word,
buffer);

} else {
! if (num_tagged <= 1 && !appending)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMessageSaved,
"Message %s to %S."),

delete ? saved_word: copied_word,
buffer);

! else if (num_tagged > 1)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMessagesSaved,


"%d messages %s to %S."),

scount,
Index: elmME+.2.5.alpha0-cvs/src/fileio.c
*** elm2.4.ME+.115/src/fileio.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/fileio.c 2004-05-16 16:46:02.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.56 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** File I/O routines, including deletion from the folder!
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.56.8.5 2004/05/16 13:46:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/fileio.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/fileio.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** File I/O routines, including deletion from the folder!
***************
*** 24,29 ****
--- 34,61 ----
DEBUG_VAR(PgpDebug,__FILE__,"pgp");
DEBUG_VAR(MimeDebug,__FILE__,"mime");

+
+ static unsigned char *s2us P_((char *str));
+ static unsigned char *s2us(str)

+ char *str;
+ {
+ return (unsigned char *)str;
+ }
+

+ static CONST unsigned char *cs2cus P_((const char *str));
+ static CONST unsigned char *cs2cus(str)
+ CONST char *str;
+ {
+ return (CONST unsigned char *)str;
+ }
+
+ static CONST unsigned char * csUs P_((const char *str));
+ static CONST unsigned char * csUs(str)
+ CONST char *str;
+ {
+ return (CONST unsigned char *)str;
+ }
+

#include <errno.h>
#ifndef ANSI_C
extern int errno;

***************
*** 984,989 ****
--- 1016,1262 ----
return ret;
}

+
+ static void makeAttString P_((const char *attribution /* attribution string to expand */,
+ int sel_field /* field to select in "%[...]" list */,
+ const struct header_rec *messageHeader /* current message header info */,
+ out_state_t *dest_file,
+ header_list_ptr all_headers));
+
+ static void makeAttString(attribution, sel_field, messageHeader, dest_file, all_headers)
+ CONST char *attribution; /* attribution string to expand */
+ int sel_field; /* field to select in "%[...]" list */
+ CONST struct header_rec *messageHeader; /* current message header info */
+ out_state_t *dest_file;
+ header_list_ptr all_headers;
+ {
+ const char *aptr = attribution; /* cursor into the attribution spec */
+
+ int in_selection; /* currently doing %[...] list? */
+ int curr_field; /* field number of current %[...] list */
+ char fromfield[STRING]; /* room for parsed from address */
+
+ /* Convert attribution to struct strincg so that multi-byte strings work */
+
+ struct string * attr = new_string2(system_charset,cs2cus(attribution));
+ int len = string_len(attr);
+ int pos;
+
+ in_selection = FALSE;
+
+ /*
+ * Process the attribution string.
+ */
+ for ( pos = 0; pos < len; ) {
+
+ uint16 unicode = give_unicode_from_string(attr,pos);
+
+ struct string * expval = NULL;
+
+ /*
+ * Handle the character if it is not a %-expansion.
+ */
+ switch (unicode) {
+
+ case 0x007C /* '|' */: /* next choice of "%[sel0|sel1|...]" list */
+ if (in_selection) {
+ ++curr_field;
+ pos++; /* skip '|' */
+ } else {
+ expval = clip_from_string(attr,&pos,1);
+ }
+ break;
+
+ case 0x005D /* ']' */: /* end of "%[sel0|sel1|...]" list */
+ if (in_selection) {
+ in_selection = FALSE;
+ pos++;
+ } else {
+ expval = clip_from_string(attr,&pos,1);
+ }
+ break;
+
+ case 0x005C /* '\\' */: /* backslash-quoting */
+ pos++;
+ if (pos < len) {
+ unicode = give_unicode_from_string(attr,pos);
+
+ switch (unicode) {
+ case 0x0074 /* 't' */:
+ expval = new_string(system_charset);
+ add_ascii_to_string(expval,s2us("\t"));
+ break;
+ case 0x006E /* 'n' */:
+ expval = new_string(system_charset);
+ add_ascii_to_string(expval,s2us("\n"));
+ break;
+ default:
+ expval = clip_from_string(attr,&pos,1);
+ break;
+ }
+ } else {
+ pos--;
+ expval = clip_from_string(attr,&pos,1);
+ }
+ break;
+
+
+ case 0x0025 /* '%' */: /* special %-expansion */
+
+ pos++;
+ if (pos < len) {
+ unicode = give_unicode_from_string(attr,pos);
+
+
+ switch (unicode) {
+ header_list_ptr X;
+ char *c;
+ int l;
+
+ case 0x0073 /* 's' */: /* backward compatibility with 2.4 */
+ case 0x0046 /* 'F' */: /* expand from */
+
+ X = locate_header_by_name(all_headers,"From");
+
+ if (X)
+ expval = give_decoded_header(X,
+ !(messageHeader->status & NOHDRENCODING),
+ messageHeader->header_charset);
+ if (!expval) /* XXX KESKEN */
+ expval = format_string(FRM("(env-from %s)"),
+ messageHeader->env_from);
+
+ pos++;
+ break;
+
+ case 0x0044 /* 'D' */: /* expand date */
+ c = ctime(&messageHeader->time_sent);
+ l = strlen(c)-1;
+ c[l-1] = '\0';
+
+ expval = new_string(system_charset);
+ add_ascii_to_string(expval,s2us(c));
+
+ pos++;
+ break;
+
+ case 0x0049 /* 'I' */: /* expand message ID */
+
+ expval = new_string(system_charset);
+ if (messageHeader->messageid)
+ add_ascii_to_string(expval,
+ cs2cus(messageHeader->messageid));
+
+ pos++;
+ break;
+
+ case 0x0053 /* 'S' */: /* expand subject */
+ expval = dup_string(messageHeader->subject);
+ pos++;
+ break;
+
+ case 0x005B /* '[' */: /* %[sel0|sel1|...] */
+ in_selection = TRUE;
+ curr_field = 0;
+ expval = NULL;
+ pos++;
+ break;
+
+ case 0x0029 /* ')' */: /* special case for %)F - from name */
+ /*FALLTHROUGH*/
+ case 0x003E /* '>' */: /* special case for %>F - from address */
+
+ pos++;
+ if (pos < len) {
+ if (give_unicode_from_string(attr,pos) != 0x0046 /* 'F' */) {
+ pos -= 2;
+ expval = clip_from_string(attr,&pos,3);
+
+ } else {
+
+ switch (unicode) {
+
+ case 0x0029 /* ')' */: /* from name */
+
+ expval = gen_From_buffer(messageHeader);
+
+ break;
+
+ case 0x003E /* '>' */: /* from addr */
+
+ if (messageHeader->from) {
+ struct addr_item *p;
+
+ for (p = messageHeader->from; p->addr && p->fullname; p++) {
+ if (expval)
+ add_ascii_to_string(expval,s2us(", "));
+ else
+ expval = new_string(display_charset);
+ add_ascii_to_string(expval,csUs(p->addr));
+ }
+ }
+
+ expval = gen_From_buffer(messageHeader);
+

+ break;
+ }
+
+

+ if (!expval) /* XXX KESKEN */
+ expval = format_string(FRM("(env-from %s)"),
+ messageHeader->env_from);
+
+ pos++;
+
+ }
+
+ } else {
+ pos -= 2;
+ expval = clip_from_string(attr,&pos,3);
+ }
+ break;
+
+ case 0x0025 /* '%' */: /* add a % and skip on past... */
+
+ expval = clip_from_string(attr,&pos,1);
+ break;
+
+
+ default:
+ pos--;
+ expval = clip_from_string(attr,&pos,2);
+ break;
+
+ }
+ } else {
+ pos--;
+ expval = clip_from_string(attr,&pos,1);
+ }
+ break;
+
+ default: /* just a regular char */
+ expval = clip_from_string(attr,&pos,1);
+ }
+
+ /*
+ * print the expansion value
+ */
+ if (expval != NULL && (!in_selection || curr_field == sel_field)) {
+
+ state_printf(dest_file,FRM("%S"),expval);
+ }
+
+ if (expval)
+ free_string(&expval);
+
+ }
+
+ state_nlputs("\n", dest_file);
+
+ free_string(&attr);
+ }
+
+
int copy_message_2(infile,current_header,prefix,dest_file,cm_options,
env_flags)
FILE *infile;
***************
*** 1011,1022 ****
**/

int first_line = TRUE;
! int remove_header = cm_options & CM_REMOVE_HEADER;
! int remove_envelope = cm_options & CM_REMOVE_ENVELOPE;
! int update_status = cm_options & CM_UPDATE_STATUS;
! int remail = cm_options & CM_REMAIL;
! int decode = cm_options & CM_DECODE;
! int filter_headers = cm_options & CM_FILT_HDR;
int bytes_seen = 0;
int content_length_seen = FALSE;
int return_path_seen = FALSE;
--- 1284,1299 ----
**/

int first_line = TRUE;
! int remove_header = cm_options & CM_REMOVE_HEADER;
! int remove_envelope = cm_options & CM_REMOVE_ENVELOPE;
! int update_status = cm_options & CM_UPDATE_STATUS;
! int remail = cm_options & CM_REMAIL;
! int decode = cm_options & CM_DECODE;
! int filter_headers = cm_options & CM_FILT_HDR;
!
! int make_attribution = cm_options & CM_ATTRIBUTION;
! int forwarding = cm_options & CM_FORWARDING;
!
int bytes_seen = 0;
int content_length_seen = FALSE;
int return_path_seen = FALSE;
***************
*** 1125,1130 ****
--- 1402,1408 ----
}


+
/* now while not EOF & still in message... copy it! */

DPRINT(Debug,5,(&Debug,
***************
*** 1200,1205 ****
--- 1478,1513 ----
"copy_message: [%ld] end of headers. Read ~ %d bytes.\n",
R2, bytes_seen));

+ /* emit the opening attribution string */
+ if (make_attribution) {
+
+ if (forwarding) {
+ if (fwdattribution[0] != '\0') {
+
+ makeAttString(fwdattribution, 0, current_header, dest_file, all_headers);
+ } else {
+
+ struct string * From_buffer = gen_From_buffer(current_header);
+
+ if (From_buffer) {
+ state_printf(dest_file,
+ CATGETS(elm_msg_cat, ElmSet, ElmForwarded1,
+ "----- Forwarded message from %S -----\n"),
+ From_buffer);
+ free_string(& From_buffer);
+ } else
+ state_printf(dest_file,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmForwarded2,
+ "----- Forwarded message (env-from %s) -----\n"),
+ current_header->env_from);
+ state_putc('\n',dest_file);
+ }
+ } else if (attribution[0]) {
+ makeAttString(attribution, 0, current_header, dest_file, all_headers);
+ }
+ }
+

if (!remove_header) {

***************
*** 1375,1381 ****
goto fail;
}
}
! if (ison(current_header->status, REPLIED)) {
if (state_printf (dest_file, FRM("r")) == EOF) {
DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
goto fail;
--- 1683,1689 ----
goto fail;
}
}
! if (ison(current_header->status, REPLIED_TO)) {
if (state_printf (dest_file, FRM("r")) == EOF) {
DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
goto fail;
***************
*** 1438,1443 ****
--- 1746,1775 ----
goto fail;
}

+ /* emit the closing attribution */
+
+ if (make_attribution && forwarding) {
+ if (fwdattribution[0]) {
+ makeAttString(fwdattribution, 1, current_header, dest_file, all_headers);
+ } else {
+ struct string * From_buffer = gen_From_buffer(current_header);
+ if (From_buffer) {
+ state_printf(dest_file,
+ CATGETS(elm_msg_cat, ElmSet, ElmForwarded3,
+ "----- End of forwarded message from %S -----\n"),
+ From_buffer);
+
+ free_string(&From_buffer);
+ } else {
+ state_printf(dest_file,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmForwarded4,
+ "----- End of forwarded message (env-from %s) -----\n"),
+ current_header->env_from);
+ }
+ }
+ }
+
DPRINT(Debug,5,(&Debug,
"copy_message: [%ld] Body read.\n",
ftell(infile)));
Index: elmME+.2.5.alpha0-cvs/src/help.c
*** elm2.4.ME+.115/src/help.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/help.c 2004-05-16 10:27:22.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.18 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/*** help routine for ELM program
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: help.c,v 1.18.8.2 2004/05/16 07:27:22 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/help.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/help.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/*** help routine for ELM program
***************
*** 237,242 ****
--- 247,256 ----
"l = Limit displayed messages based on the specified criteria.");
break;

+ case 'M': s = catgets(elm_msg_cat, ElmSet, ElmHelpToggleMailingList,
+ "M = Toggle display of mailing list information.");
+ break;
+
case 'm': s = catgets(elm_msg_cat, ElmSet, ElmHelpSendMail,
"m = Create and send mail to the specified person or persons.");
break;
Index: elmME+.2.5.alpha0-cvs/src/init.c
*** elm2.4.ME+.115/src/init.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/init.c 2004-05-01 10:41:07.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: init.c,v 1.49 2004/03/27 18:31:45 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/***** Initialize - read in all the defaults etc etc
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: init.c,v 1.49.8.3 2004/05/01 07:41:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 hdrs/init.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from hdrs/init.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/***** Initialize - read in all the defaults etc etc
***************
*** 333,338 ****
--- 343,368 ----
}
}

+ /*
+ * Locking problems are common when Elm is misconfigured/misinstalled.
+ * Sometimes, rather than fixing the problem, people will set
+ * Elm setuid=root. This is *extremely* dangerous. Make sure
+ * this isn't happening. This test needed to be deferred until
+ * after the system rcfile was read in.
+ */
+ if (getuid() != geteuid() && !allow_setuid) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmInstalledSetuid,
+ "\n\


+ This version of Elm has been installed setuid=%d. This is dangerous!\n\
+ Elm is NOT designed to run in this mode, and to do so can introduce\n\
+ grave security hazards. See the description of \"allow_setuid\" in the\n\

+ Elm Reference Guide for further information.\n\n"),
+ geteuid());
+
+ error_wait();/* Be sure that we do not exit before error is shown */ exit(1);
+ }


+
+
*main_aliases = new_aliasview();

add_files_to_aview(*main_aliases);

Index: elmME+.2.5.alpha0-cvs/src/in_utils.c
*** elm2.4.ME+.115/src/in_utils.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/in_utils.c 2004-05-02 14:05:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35 2004/03/27 18:31:45 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35.8.2 2004/05/02 11:05:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 46,51 ****
--- 46,194 ----


#define erase_a_char() { Writechar(BACKSPACE); Writechar(' '); \
Writechar(BACKSPACE); FlushBuffer(); }

+ int prompt_letter(
+ #if ANSI_C

+ int line, char *letters, int def,


+ int flags,
+ struct menu_context *page,

+ const char * format, const char *msg, ...
+ #else
+ line, letters, def, flags, page, format, msg, va_alist
+ #endif
+ )
+ #if !ANSI_C
+ int line;
+ char *letters;
+ int def;
+ int flags;
+ struct menu_context *page;
+ CONST char * format;
+ CONST char *msg;
+ va_dcl

+ #endif
+ {


+ struct string *question = NULL;
+
+ int ch;
+ int center = flags & PROMPT_center;

+ int yesno = flags & PROMPT_yesno;


+ int mark = flags & PROMPT_redraw_mark;
+ int ctrlL = flags & PROMTP_ctrlL;

+ int cols = 0;
+
+
+ va_list vl;
+
+ DPRINT(Debug,6, (&Debug,
+ "prompt_letter: center=%d yesno=%d mark=%d ctrlL=%d\n",
+ center,yesno,mark,ctrlL));


+
+ Va_start(vl, msg); /* defined in defs.h */
+ question = elm_smessage(0,format,msg,vl);
+ va_end(vl);
+
+ do {
+ int LINES, COLUMNS;
+ int l;
+ char *x;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+
+ /* FIXME: Not correct */
+ l = string_len(question);
+ cols = COLUMNS - ( l + 5 ); /* 5 for "Yes." + 1 */
+ if (cols < 0) {

+ cols = 0;
+ }
+
+ DPRINT(Debug,6, (&Debug,"prompt_letter: pos line=%d column=%d\n",
+ line, (center || (cols < 2)) ? 0 : cols-2));

+ sleep((sleepmsg + 1) / 2);
+ #endif
+ }


+ MoveCursor(line, (center || (cols < 2)) ? 0 : cols-2);
+ CleartoEOLN();
+ }
+

+ return ch;
+ }
+

int want_to(question, dflt, where, clear_and_center, page)
char *question;
int dflt;
***************
*** 60,66 ****
**/
int ch, cols;
int LINES, COLUMNS;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

--- 203,209 ----


**/
int ch, cols;
int LINES, COLUMNS;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

***************

*** 69,75 ****
cols = 0;
}

! DPRINT(Debug,3, (&Debug,"want_to: pos line=%d column=%d\n",
where, (clear_and_center || (cols < 2)) ? 0 : cols-2));

MoveCursor(where, (clear_and_center || (cols < 2)) ? 0 : cols-2);
--- 212,218 ----
cols = 0;
}

! DPRINT(Debug,6, (&Debug,"want_to: pos line=%d column=%d\n",
where, (clear_and_center || (cols < 2)) ? 0 : cols-2));

MoveCursor(where, (clear_and_center || (cols < 2)) ? 0 : cols-2);

--- 231,257 ----

struct menu_context *page,


! struct string **buffer,
! int x, int y, int flags,
! const char * format, const char *msg, ...
#else
! page, buffer, x, y, flags, format, msg, va_alist
#endif
)
#if !ANSI_C

--- 1001,1011 ----


int optionally_enter2 (
#if ANSI_C

struct menu_context *page,


! struct string **buffer,
! int x, int y, int flags,

! const char * format, const char *msg, ...
#else
! page, buffer, x, y, flags, format, msg, va_alist
#endif
)
#if !ANSI_C

Index: elmME+.2.5.alpha0-cvs/src/leavembox.c
*** elm2.4.ME+.115/src/leavembox.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/leavembox.c 2004-05-02 14:05:48.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** leave current folder, updating etc. as needed...
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.4 2004/05/02 11:05:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/leavembox.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/leavembox.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** leave current folder, updating etc. as needed...
***************
*** 353,370 ****
across the resync.

If "quitting" and "prompt" is false, then no prompting is done.
! Otherwise prompting is dependent upon the variable
! question_me, as set by an elmrc option. This behavior makes
! the 'q' command prompt just like 'c' and '$', while
! retaining the 'Q' command for a quick exit that never
! prompts.
**/

int to_delete = 0, to_store = 0, to_keep = 0, to_ignore = 0,
to_hide = 0;
int marked_deleted=0;
int i,
! last_sortby, ask_questions, asked_storage_q,
num_chgd_status;

int return_value = -1;
--- 363,381 ----
across the resync.

If "quitting" and "prompt" is false, then no prompting is done.
! Otherwise prompting is dependent upon the variables
! ask_delete, ask_keep, and ask_store, as set by elmrc
! elmrc options. This behavior makes the 'q' command prompt
! just like 'c' and '$', while retaining the 'Q' command for a
! quick exit that never prompts.
**/

int to_delete = 0, to_store = 0, to_keep = 0, to_ignore = 0,
to_hide = 0;
int marked_deleted=0;
int i,
! last_sortby, l_ask_delete, l_ask_keep, l_ask_store,
! asked_storage_q,
num_chgd_status;

int return_value = -1;
***************
*** 591,597 ****

/* =================================================================== */

! ask_questions = ((quitting && !prompt) ? FALSE : question_me);



/* YES or NO on softkeys */
/*

--- 602,610 ----

/* =================================================================== */

! l_ask_delete = ((quitting && !prompt) ? FALSE : ask_delete);
! l_ask_keep = ((quitting && !prompt) ? FALSE : ask_keep);
! l_ask_store = ((quitting && !prompt) ? FALSE : ask_store);



/* YES or NO on softkeys */
/*

***************
*** 640,646 ****
char answer = (always_del ?
*def_ans_yes : *def_ans_no); /* default answer */

! if(ask_questions) {


char * buffer = NULL;

if (marked_deleted == 1)
--- 653,659 ----
char answer = (always_del ?
*def_ans_yes : *def_ans_no); /* default answer */

! if(l_ask_delete) {


char * buffer = NULL;

if (marked_deleted == 1)


***************
*** 734,748 ****

if (need_handle) {
if (!can_store) {
! char answer = '\0';

! char * buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmNoReceived,
! "\"received\" folder not available, continue? (%c/%c) "),
*def_ans_yes, *def_ans_no);

! answer = want_to(buffer, *def_ans_no, LINES-4, 0,
! page);

if (answer != *def_ans_yes) {
return_value = -2; /* failure */

--- 747,775 ----



if (need_handle) {
if (!can_store) {
! int answer = '\0';

! again1:

! menu_get_sizes(page, &LINES, &COLUMNS);
!

! /* NOTICE: prompt_letter may return EOF */
! answer = prompt_letter(LINES-4,"P",*def_ans_yes,

! PROMPT_center|PROMPT_yesno|


! PROMPT_redraw_mark|PROMTP_ctrlL,
! page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmNoReceived,

! "\"received\" folder not available, continue leaving folder? ([P]anic/%c/%c) "),
*def_ans_yes, *def_ans_no);

!

! if (answer == ('L'&31) || answer == REDRAW_MARK) {
! menu_ClearScreen(page);
! goto again1;
! }
!
! if (answer == 'P' || answer == EOF)
! emergency_exit(0);

if (answer != *def_ans_yes) {
return_value = -2; /* failure */

***************
*** 808,814 ****
answer = (always_store ?
*def_ans_yes : *def_ans_no); /* default answer */

! if(ask_questions) {


char * buffer = NULL;

if (marked_read == 1)
--- 835,841 ----
answer = (always_store ?
*def_ans_yes : *def_ans_no); /* default answer */

! if(l_ask_store) {


char * buffer = NULL;

if (marked_read == 1)
***************
*** 931,937 ****
if(marked_unread) {
answer = (always_keep ?
*def_ans_yes : *def_ans_no); /* default answer */
! if(ask_questions) {


char * buffer = NULL;

if (marked_unread == 1)
--- 958,964 ----
if(marked_unread) {
answer = (always_keep ?
*def_ans_yes : *def_ans_no); /* default answer */
! if(l_ask_keep) {


char * buffer = NULL;

if (marked_unread == 1)
Index: elmME+.2.5.alpha0-cvs/src/mailmsg1.c
*** elm2.4.ME+.115/src/mailmsg1.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/mailmsg1.c 2004-05-04 21:39:33.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.36 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
! * The Elm Mail System

*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** Interface to allow mail to be sent to users. Part of ELM **/
--- 1,26 ----
! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.36.8.4 2004/05/04 18:39:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
! * Based on Elm 2.4 src/mailmsg1.c. That code was following copyright:
! *
! * The Elm Mail System


*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ ****************************************************************************

+ * Incorparated Elm 2.5 code from src/sndmsg.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * This file and all associated files and documentation:
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** Interface to allow mail to be sent to users. Part of ELM **/
***************
*** 643,648 ****
--- 654,661 ----
return(1); /* everything looks okay! */
}

+
+
static int copy_the_msg(headers,is_a_response, options, page)
struct mailing_headers *headers;
int *is_a_response;
***************
*** 650,686 ****
struct menu_context *page;
{
int forwarding = 0 != (options & MAIL_FORWARDING);
!
int LINES, COLUMNS;

! /** Returns True iff the user wants to copy the message being
! replied to into the edit buffer before invoking the editor!
! Sets "is_a_response" to true if message is a response...
**/
!
! char msg[SLEN];
! int answer = FALSE;
!
menu_get_sizes(page,&LINES, &COLUMNS);
!
! if (forwarding)
! answer = TRUE;
! else if (headers->to.addrs_len > 0 && !mail_only) {
! /* predefined 'to' line! */
! if (auto_copy)
! answer = TRUE;
! else {
! elm_sfprintf(msg, sizeof msg,
! CATGETS(elm_msg_cat, ElmSet, ElmCopyMessageYN,
! "Copy message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! answer = (want_to(msg, *def_ans_no, LINES-4, 0,
! page) == *def_ans_yes);
}
! *is_a_response = TRUE;
! }
!
! return(answer);
}

int a_sendmsg(edit_message, form_letter, mailbox, aview, header_page,
--- 663,725 ----
struct menu_context *page;
{
int forwarding = 0 != (options & MAIL_FORWARDING);
!
int LINES, COLUMNS;

! /** Returns True iff the user wants to copy the message being
! replied to into the edit buffer before invoking the editor!
! Sets "is_a_response" to true if message is a response...
**/
!
! char msg[SLEN];
! int answer = FALSE;
!
!
! again:
menu_get_sizes(page,&LINES, &COLUMNS);
!
! if (forwarding)
! answer = TRUE;
! else if (headers->to.addrs_len > 0 && !mail_only) {
! /* predefined 'to' line! */
!
! if (!ask_reply_copy)
! answer = reply_copy;
! else {


!
! int ret;
!

! if (user_level < 2)
! ret = prompt_letter(LINES-4,"",
! reply_copy ? *def_ans_yes : *def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark,


! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCopyMessageIntoReplyYN,
! "Copy message into reply? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! else
! ret = prompt_letter(LINES-4,"",
! reply_copy ? *def_ans_yes : *def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark,


! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCopyMessageYN,
! "Copy message? (%c/%c) "),

! *def_ans_yes, *def_ans_no);
!
! if (REDRAW_MARK == ret)

! goto again;


!
! if (EOF == ret)
! return 0;
!

! answer = ret == *def_ans_yes;
! }
! *is_a_response = TRUE;
}
!
! return(answer);
}

int a_sendmsg(edit_message, form_letter, mailbox, aview, header_page,
Index: elmME+.2.5.alpha0-cvs/src/mailmsg2.c
*** elm2.4.ME+.115/src/mailmsg2.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/mailmsg2.c 2004-05-15 14:52:25.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** Interface to allow mail to be sent to users. Part of ELM **/
--- 1,26 ----
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.8.6 2004/05/15 11:52:25 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/mailmsg2.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/sndmsg.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * This file and all associated files and documentation:
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** Interface to allow mail to be sent to users. Part of ELM **/
***************
*** 103,108 ****
--- 114,146 ----
}


+ struct string * gen_From_buffer(current_header)
+ CONST struct header_rec * current_header;
+ {
+ struct string * From_buffer = NULL;
+
+ struct addr_item *p;
+
+ if (current_header->from) {
+ for (p = current_header->from; p->addr && p->fullname; p++) {
+ if (From_buffer)
+ add_ascii_to_string(From_buffer,s2us(", "));
+ else
+ From_buffer = new_string(display_charset);
+ if (string_len(p->fullname)) {
+ struct string * temp = cat_strings(From_buffer,
+ p->fullname,1);
+ free_string(&From_buffer);
+ From_buffer = temp;
+ } else {
+ add_ascii_to_string(From_buffer,csUs(p->addr));
+ }
+ }
+ }
+
+ return From_buffer;
+ }
+
int mail(current_header,options,form, headers,mailer_info,
infile,mailbox,aview)
struct header_rec * current_header;
***************
*** 116,121 ****
--- 154,160 ----
int copy_msg = 0 != current_header && 0 != (options & MAIL_COPY_MSG);
int edit_message = 0 != (options & MAIL_EDIT_MSG);
int forwarding = 0 != current_header && 0 != (options & MAIL_FORWARDING);
+ int replying = 0 != (options & MAIL_REPLYING);

struct Attachments attachments = NULL_Attachments;

***************
*** 198,205 ****
DPRINT(Debug,4, (&Debug," (with%s editing)\n",
edit_message? "" : "out"));

! /* this will get set to 1 on a successful reply */
! me_retcode = 0;

gotten_key = 0; /* ignore previously gotten encryption key */

--- 237,243 ----
DPRINT(Debug,4, (&Debug," (with%s editing)\n",
edit_message? "" : "out"));

!

gotten_key = 0; /* ignore previously gotten encryption key */

***************
*** 315,373 ****
cur_editcharset = system_charset; /* FIXME: Is correct? */

} else if (copy_msg && ! retransmit) { /* if retransmit we have it! */
! struct string * From_buffer = NULL;
! struct addr_item *p;
!
! if (current_header->from) {
! for (p = current_header->from; p->addr && p->fullname; p++) {
! if (From_buffer)
! add_ascii_to_string(From_buffer,s2us(", "));
! else
! From_buffer = new_string(display_charset);
! if (string_len(p->fullname)) {
! struct string * temp = cat_strings(From_buffer,
! p->fullname,1);
! free_string(&From_buffer);
! From_buffer = temp;
! } else {
! add_ascii_to_string(From_buffer,csUs(p->addr));
! }
! }
! }

if (!cur_editcharset)
cur_editcharset = display_charset;

if (!forwarding || (forwarding && !mimeforward)) {
! if (forwarding && !quote_forward) {
! if (From_buffer) {
! elm_fprintf(reply,
! CATGETS(elm_msg_cat, ElmSet, ElmForwarded1,
! "----- Forwarded message from %S -----\n\n"),
! From_buffer);
! } else
! elm_fprintf (reply,
! CATGETS(elm_msg_cat, ElmSet,
! ElmForwarded2,
! "----- Forwarded message (env-from %s) -----\n\n"),
! current_header->env_from);
!
! } else if (attribution[0] && current_header) {
! if (From_buffer) {
! char * str = us2s(stream_from_string(From_buffer,1,NULL));
! fprintf(reply, attribution, str);
! free(str);
! } else
! fprintf(reply, attribution, current_header->env_from);
! fputc('\n', reply);
! }
if (edit_message && infile) {
int NOHDR = forwarding ? noheaderfwd : noheader;
int NOQUOTE = forwarding && !quote_forward;
copy_message_f(infile,current_header,
! NOQUOTE ? "" : prefixchars, reply,
! ( NOHDR ? CM_REMOVE_HEADER : 0 )
! | CM_REMOVE_ENVELOPE | CM_DECODE
/* I think it is good idea to use CM_FILT_HDR
* even when we don't have forwarding ... -KEH
*/
--- 353,376 ----
cur_editcharset = system_charset; /* FIXME: Is correct? */

} else if (copy_msg && ! retransmit) { /* if retransmit we have it! */
! struct string * From_buffer = gen_From_buffer(current_header);

if (!cur_editcharset)
cur_editcharset = display_charset;

if (!forwarding || (forwarding && !mimeforward)) {
!
if (edit_message && infile) {
int NOHDR = forwarding ? noheaderfwd : noheader;
int NOQUOTE = forwarding && !quote_forward;
+ int FORW = forwarding;
+
copy_message_f(infile,current_header,
! NOQUOTE ? "" : prefixchars, reply,
! ( NOHDR ? CM_REMOVE_HEADER : 0 ) |
! CM_REMOVE_ENVELOPE | CM_DECODE |
! ( FORW ? CM_FORWARDING : 0 ) |
! CM_ATTRIBUTION
/* I think it is good idea to use CM_FILT_HDR
* even when we don't have forwarding ... -KEH
*/
***************
*** 375,399 ****
already_has_text = TRUE; /* we just added it, right? */
} else if (infile) {
int NOHDR = forwarding ? noheaderfwd : noheader;
copy_message_f(infile,current_header,
"", reply,
! ( NOHDR ? CM_REMOVE_HEADER : 0 )
! | CM_REMOVE_ENVELOPE
! /* I added CM_DECODE to here -KEH */
! | CM_DECODE, cur_editcharset);
}
if (forwarding && !quote_forward) {
- if (From_buffer)
- elm_fprintf (reply,
- CATGETS(elm_msg_cat, ElmSet, ElmForwarded3,
- "----- End of forwarded message from %S -----\n"),
- From_buffer);
- else
- elm_fprintf (reply,
- CATGETS(elm_msg_cat, ElmSet,
- ElmForwarded4,
- "----- End of forwarded message (env-from %s) -----\n"),
- current_header->env_from);
}
} else {
FILE *tmpfp;
--- 378,395 ----
already_has_text = TRUE; /* we just added it, right? */
} else if (infile) {
int NOHDR = forwarding ? noheaderfwd : noheader;
+ int FORW = forwarding;
+
copy_message_f(infile,current_header,
"", reply,
! ( NOHDR ? CM_REMOVE_HEADER : 0 ) |
! CM_REMOVE_ENVELOPE |
! ( FORW ? CM_FORWARDING : 0 ) |
! CM_ATTRIBUTION
! /* I added CM_DECODE to here -KEH */
! | CM_DECODE, cur_editcharset);
}
if (forwarding && !quote_forward) {
}
} else {
FILE *tmpfp;
***************
*** 485,491 ****
clear_copy_file(&COPY_FILE); /* signals to not save a copy */

if(auto_copy_sent) {
! if(save_by_name) {
if(force_name) {
/* signals save by 'to' logname */
COPY_FILE.copy_file = format_string(FRM("="));
--- 481,487 ----
clear_copy_file(&COPY_FILE); /* signals to not save a copy */

if(auto_copy_sent) {
! if(save_by_name || save_by_alias) {
if(force_name) {
/* signals save by 'to' logname */
COPY_FILE.copy_file = format_string(FRM("="));
***************
*** 542,550 ****

goto fail_label;
}
! /* so we can mark the reply flag */
! if (0 == code)
! me_retcode = 1;


}

err = can_open(cur_editfile,"r+");

--- 538,544 ----

goto fail_label;
}
!

}

err = can_open(cur_editfile,"r+");

***************
*** 746,752 ****
converted_buffer,

mailbox,
! page); /* Need access for all open
mailboxes/folders */

/** write all header information into whole_msg_file **/
--- 740,746 ----
converted_buffer,

mailbox,
! page,aview); /* Need access for all open
mailboxes/folders */

/** write all header information into whole_msg_file **/
***************
*** 810,815 ****
--- 804,824 ----
MIME_info.encoding_top, title,mailing_message);

/* NOTE: succees failure, backgrouded status currently ignored */
+
+ /* mark the "replied" status of the message */
+ if (replying && current_header &&
+ 0 != (current_header->status && REPLIED_TO)) {
+
+ DPRINT(Debug,4,(&Debug,
+ "Adding replied mark to current message\n"));
+
+ current_header->status |= REPLIED_TO;
+ current_header->status_chgd = TRUE;
+ } else {
+ DPRINT(Debug,8,(&Debug,"Not adding replied mark %s%s\n",
+ replying ? "" : " -- not replying ",
+ current_header ? "" : " -- no current_header"));
+ }
}

fclose(reply);
Index: elmME+.2.5.alpha0-cvs/src/Makefile.SH
*** elm2.4.ME+.115/src/Makefile.SH 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/src/Makefile.SH 2004-04-18 19:55:42.000000000 +0300
***************
*** 31,37 ****

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.50 2004/02/20 19:38:08 hurtta Exp $
#


# Makefile for the ELM mail program.
#

--- 31,37 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.50.20.1 2004/04/18 16:55:42 hurtta Exp $
#


# Makefile for the ELM mail program.
#

***************
*** 297,313 ****



# Dependencies and rules
# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h $(INCLDIR)/headers.h def_elm.h $(INCLDIR)/me.h



! $(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elm.h: $(INCLDIR)/defs.h $(INCLDIR)/me.h


! $(CHMOD) u+w $@
! $(TOUCH) $@
!

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

--- 297,311 ----



# Dependencies and rules
# Dependencies of header files upon other header files they include

! .PRECIOUS: def_elm.h $(INCLDIR)/me.h $(INCLDIR)/elm_defs.h \
! $(INCLDIR)/defs_major.h



! $(INCLDIR)/elm_defs.h: $(INCLDIR)/defs_major.h $(INCLDIR)/elm_nl_types.h \
! $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/defs_major.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

***************
*** 315,321 ****


$(CHMOD) u+w $@
$(TOUCH) $@

! def_elm.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h


$(CHMOD) u+w $@
$(TOUCH) $@

--- 313,320 ----


$(CHMOD) u+w $@
$(TOUCH) $@

! def_elm.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/mime.h \
! $(INCLDIR)/me.h $(INCLDIR)/elm_globals.h


$(CHMOD) u+w $@
$(TOUCH) $@

***************

*** 337,343 ****
digest.o: def_elm.h $(INCLDIR)/s_elm.h
edit.o: def_elm.h
editmsg.o: def_elm.h $(INCLDIR)/s_elm.h
! elm.o: $(INCLDIR)/elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/me.h $(INCLDIR)/patchlevel.h
encode.o: def_elm.h $(INCLDIR)/s_elm.h
exitprog.o: def_elm.h $(INCLDIR)/s_elm.h
file.o: def_elm.h $(INCLDIR)/s_elm.h
--- 336,342 ----
digest.o: def_elm.h $(INCLDIR)/s_elm.h
edit.o: def_elm.h
editmsg.o: def_elm.h $(INCLDIR)/s_elm.h
! elm.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/patchlevel.h
encode.o: def_elm.h $(INCLDIR)/s_elm.h
exitprog.o: def_elm.h $(INCLDIR)/s_elm.h
file.o: def_elm.h $(INCLDIR)/s_elm.h
Index: elmME+.2.5.alpha0-cvs/src/menu_common/def_mcommon.h
*** elm2.4.ME+.115/src/menu_common/def_mcommon.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/menu_common/def_mcommon.h 2004-04-18 19:55:43.000000000 +0300
***************
*** 1,6 ****
! /* $Id: def_mcommon.h,v 1.4 2004/03/27 18:31:47 hurtta Exp $ */



! #include "headers.h"
#include "me.h"

#define MENU_COMMON_magic 0xF700
--- 1,7 ----
! /* $Id: def_mcommon.h,v 1.4.8.1 2004/04/18 16:55:43 hurtta Exp $ */



! #include "elm_defs.h"
! #include "mime.h"
#include "me.h"

#define MENU_COMMON_magic 0xF700
Index: elmME+.2.5.alpha0-cvs/src/menu_common/Makefile.SH
*** elm2.4.ME+.115/src/menu_common/Makefile.SH 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha0-cvs/src/menu_common/Makefile.SH 2004-04-18 19:55:43.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/menu_common/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.2 2004/02/20 19:38:10 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----

echo "Extracting src/menu_common/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.2.20.1 2004/04/18 16:55:43 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************

*** 63,79 ****


$(RANLIB) $@

# Dependencies of header files upon other header files they include
! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/headers.h def_aliases.h

! $(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! def_mcommon.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h

$(CHMOD) u+w $@
$(TOUCH) $@

--- 63,86 ----


$(RANLIB) $@

# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/elm_defs.h $(INCLDIR)/defs_major.h def_mcommon.h \


! $(INCLDIR)/me.h

! $(INCLDIR)/elm_defs.h: $(INCLDIR)/defs_major.h $(INCLDIR)/elm_nl_types.h \
! $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/defs_major.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! def_mcommon.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/me.h \
! $(INCLDIR)/mime.h

! $(CHMOD) u+w $@
! $(TOUCH) $@
!
! $(INCLDIR)/me.h: $(INCLDIR)/melib.h
$(CHMOD) u+w $@
$(TOUCH) $@

Index: elmME+.2.5.alpha0-cvs/src/menu_common/message_screen.c
*** elm2.4.ME+.115/src/menu_common/message_screen.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/menu_common/message_screen.c 2004-05-15 23:11:36.000000000 +0300
***************
*** 1,11 ****
! static char rcsid[] = "@(#)$Id: message_screen.c,v 1.4 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
! * Inludes code from screen.c which have following copyright:


*
* The Elm Mail System
*

--- 1,11 ----
! static char rcsid[] = "@(#)$Id: message_screen.c,v 1.4.8.1 2004/05/15 20:11:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
! * Inludes Elm 2.4 code from src/screen.c which have following copyright:


*
* The Elm Mail System
*

***************
*** 121,132 ****
--- 121,283 ----


struct string * buffer = NULL;
struct string * buffer1 = NULL;

struct string * bufferwho = NULL;
+ struct string * list_buffer = NULL;
int X,len1,fill_len;
int was_len;
int LINES, COLUMNS;

+ enum list_mode {
+ lm_unknown,
+ lm_myself_to,
+ lm_myself_cc,
+ lm_list_id
+ } list_mode = lm_unknown;
+ int other_seen = 0; /* if other than sender or reader
+ seen on address headers
+ */
+
+ struct addr_item *p;
+
+ /* Check is reader also on recipient headers */
+ if (entry->list_id)
+ list_mode = lm_list_id;
+
+ for (p = entry->cc; p && p->addr && p->fullname; p++) {
+ if (!okay_address_l(p,NULL))
+ list_mode = lm_myself_cc;
+
+ if (okay_address_l(p,entry->from))
+ other_seen++;
+ }
+
+ for (p = entry->to; p && p->addr && p->fullname; p++) {
+ if (!okay_address_l(p,NULL))
+ list_mode = lm_myself_to;
+
+ if (okay_address_l(p,entry->from))
+ other_seen++;
+ }
+
+ if (show_mlists) {
+ CONST int MLIST_LEN = 12;
+
+ /* 1) Just to me or to sender only */
+
+ if (lm_myself_to == list_mode &&
+ 0 == other_seen)
+ list_buffer = format_string(FRM(" ------------/"));
+
+ /* 2) to me and others */
+
+ else if (lm_myself_to == list_mode)
+ list_buffer = format_string(FRM(" ======------/"));
+
+ /* 3) cc to me */
+
+ else if (lm_myself_cc == list_mode)
+ list_buffer = format_string(FRM(" ============/"));
+
+ /* 4) mailing list post */
+
+ else if (lm_list_id == list_mode) {
+
+ if (entry->list_phrase) {
+ int X = 0,len1;
+ struct string * N =
+ curses_printable_clip(entry->list_phrase,
+ &X,MLIST_LEN,&len1,MLIST_LEN);
+
+ int fill_len = MLIST_LEN - len1;
+
+ list_buffer = format_string(FRM(" %S%*s/"),
+ N,fill_len,"");
+
+ free_string(&N);
+
+ } else {
+ /* FIXME? DO not take account header charset */
+ list_buffer = format_string(FRM(" %*.*s/"),
+ -MLIST_LEN,MLIST_LEN,
+ entry->list_id);
+
+ }
+
+
+ /* 5) Show To: -header */
+
+ } else if (entry->to && entry->to->fullname) {
+
+ if (string_len(entry->to->fullname) > 0) {
+ int X = 0,len1;
+ struct string * N =
+ curses_printable_clip(entry->to->fullname,
+ &X,MLIST_LEN-1,&len1,MLIST_LEN-1);
+
+ int fill_len = MLIST_LEN - len1 -1;
+
+ list_buffer = format_string(FRM(" (%S%*s)"),
+ N,fill_len,"");
+
+ free_string(&N);
+ } else {
+ /* FIXME? DO not take account header charset */
+ list_buffer = format_string(FRM(" (%*.*s)"),
+ -MLIST_LEN+1,
+ MLIST_LEN-1,
+ entry->to->addr);
+ }
+
+ }
+
+ /* 6) No To: -header */
+ else
+ list_buffer = format_string(FRM(" *** /"));
+
+ } else {
+
+ /* 1) Just to me or to sender only */
+
+ if (lm_myself_to == list_mode &&
+ 0 == other_seen)
+ list_buffer = format_string(FRM(" %c"),
+ to_chars[0] ?
+ to_chars[0] :
+ DEFAULT_TO_CHARS[0]);
+
+ /* 2) to me and others */
+ else if (lm_myself_to == list_mode)
+ list_buffer = format_string(FRM(" %c"),
+ to_chars[1] ?
+ to_chars[1] :
+ DEFAULT_TO_CHARS[1]);
+
+ /* 3) cc to me */
+
+ else if (lm_myself_cc == list_mode)
+ list_buffer = format_string(FRM(" %c"),
+ to_chars[2] ?
+ to_chars[2] :
+ DEFAULT_TO_CHARS[2]);
+
+
+ /* 4) mailing list post */
+ else if (lm_list_id == list_mode)
+ list_buffer = format_string(FRM(" %c"),
+ to_chars[4] ?
+ to_chars[4] :
+ DEFAULT_TO_CHARS[4]);
+
+ /* 5) unknown */
+ else
+ list_buffer = format_string(FRM(" %c"),
+ to_chars[3] ?
+ to_chars[3] :
+ DEFAULT_TO_CHARS[3]);
+ }
+
menu_get_sizes(page, &LINES, &COLUMNS);

+
/* truncate 'from' to 18 characters -
* this includes the leading "To" if really_to is true.
*/
***************
*** 155,166 ****
fill_len = 0;

if (entry->lines < 0)
! buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s %.3s%S%*s (?) "),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
(entry->status & TAGGED? '+' : ' '),
message_number,
entry->time_menu,
(really_to ? "To " : ""),
/* give max and min width parameters for 'from' */
bufferwho,
--- 306,318 ----
fill_len = 0;

if (entry->lines < 0)
! buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s%S %.3s%S%*s (?) "),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
(entry->status & TAGGED? '+' : ' '),
message_number,
entry->time_menu,
+ list_buffer,
(really_to ? "To " : ""),
/* give max and min width parameters for 'from' */
bufferwho,
***************
*** 168,179 ****
fill_len,""
);
else
! buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s %.3s%S%*s (%d) %s"),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
(entry->status & TAGGED? '+' : ' '),
message_number,
entry->time_menu,
(really_to ? "To " : ""),
/* give max and min width parameters for 'from' */
bufferwho,
--- 320,332 ----
fill_len,""
);
else
! buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s%S %.3s%S%*s (%d) %s"),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
(entry->status & TAGGED? '+' : ' '),
message_number,
entry->time_menu,
+ list_buffer,
(really_to ? "To " : ""),
/* give max and min width parameters for 'from' */
bufferwho,
***************
*** 188,193 ****
--- 341,347 ----
);

free_string(&bufferwho);
+ free_string(&list_buffer);

X = 0;
/* clip_from_string updates X */
Index: elmME+.2.5.alpha0-cvs/src/messages/def_messages.h
*** elm2.4.ME+.115/src/messages/def_messages.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/messages/def_messages.h 2004-04-18 19:55:43.000000000 +0300
***************
*** 1,6 ****
! /* $Id: def_messages.h,v 1.6 2004/03/27 18:31:48 hurtta Exp $ */



! #include "headers.h"
#include "me.h"

#if ANSI_C
--- 1,7 ----
! /* $Id: def_messages.h,v 1.6.8.1 2004/04/18 16:55:43 hurtta Exp $ */



! #include "elm_defs.h"
! #include "mime.h"
#include "me.h"

#if ANSI_C
Index: elmME+.2.5.alpha0-cvs/src/messages/digest.c
*** elm2.4.ME+.115/src/messages/digest.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/messages/digest.c 2004-04-25 17:52:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.9 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: digest.c,v 1.9.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 39,45 ****
mbx->u.digest = safe_malloc(sizeof (* (mbx->u.digest)));

/* bzero is defined hdrs/defs.h */

! bzero(mbx->u.digest, sizeof (* (mbx->u.digest)));

mbx->u.digest->the_digest = NULL;
mbx->u.digest->digest_count = 0;
--- 39,45 ----
mbx->u.digest = safe_malloc(sizeof (* (mbx->u.digest)));

/* bzero is defined hdrs/defs.h */

! bzero((void *)mbx->u.digest, sizeof (* (mbx->u.digest)));

mbx->u.digest->the_digest = NULL;
mbx->u.digest->digest_count = 0;

Index: elmME+.2.5.alpha0-cvs/src/messages/header_alloc.c
*** elm2.4.ME+.115/src/messages/header_alloc.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/messages/header_alloc.c 2004-05-16 13:25:33.000000000 +0300
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.10 2004/03/27 18:31:48 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,8 ----
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.10.8.4 2004/05/16 10:25:33 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 15,22 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "headers.h"

! #include "me.h"

DEBUG_VAR(Debug,__FILE__,"messages");



--- 15,21 ----
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "def_messages.h"

DEBUG_VAR(Debug,__FILE__,"messages");

***************
*** 95,100 ****
--- 94,107 ----
if (h->subject)
free_string(&(h->subject));
h->subject = NULL;
+
+ if (h->list_phrase)
+ free_string(&(h->list_phrase));
+ h->list_phrase = NULL;
+ if (h->list_id)
+ free(h->list_id);
+ h->list_id = NULL;
+
h->mailx_status[0] = '\0';
mime_t_clear (&(h->mime_rec));
free_rec_mbx_info(h);
***************
*** 142,147 ****
--- 149,156 ----
h->time_menu[0] = '\0';
h->tz_offset = 0;
h->subject = NULL;
+ h->list_phrase = NULL;
+ h->list_id = NULL;
h->mailx_status[0] = '\0';
mime_t_zero (&(h->mime_rec));
h->mbx_info = NULL;
***************
*** 158,163 ****
--- 167,254 ----
h->partial_len = 0;
}

+ static void parse_list_id P_((struct header_rec *current_header,
+ header_list_ptr tmphdr));
+ static void parse_list_id(current_header,tmphdr)
+ struct header_rec *current_header;
+ header_list_ptr tmphdr;
+ {
+ char ** tokens = rfc822_tokenize(tmphdr->body);
+ int i;
+ char * phrase = NULL;
+ char * id = NULL;
+
+ /* 1) read phrase -- comments are not allowed */
+
+ for (i = 0; tokens[i]; i++) {
+
+ if ('\n' == tokens[i][0] &&
+ !tokens[i+1])
+ break;
+
+ if ('<' == tokens[i][0])
+ break;
+
+ if ('(' == tokens[i][0])
+ goto error;
+
+ if ('\n' == tokens[i][0])
+ phrase = strmcat(phrase," ");
+ else
+ phrase = strmcat(phrase,tokens[i]);
+ }
+
+ if ('<' != tokens[i][0])
+ goto error;
+
+ if (current_header->list_phrase ||
+ current_header->list_id)
+ goto error;
+
+ if (phrase)
+ current_header->list_phrase =
+ hdr_to_string(HDR_PHRASE,phrase,
+ current_header->header_charset,
+ !(current_header -> status &
+ NOHDRENCODING) &&
+ is_rfc1522(phrase));
+
+ /* 2) read id -- comments and whitespace is not allowed */
+
+ for (i++; tokens[i]; i++) {
+
+ if ('\n' == tokens[i][0] &&
+ !tokens[i+1])
+ break;
+
+ if ('>' == tokens[i][0])
+ break;
+
+ if ('(' == tokens[i][0])
+ goto error;
+ if (' ' == tokens[i][0])
+ goto error;
+ if ('\n' == tokens[i][0])
+ goto error;
+
+ id = strmcat(id,tokens[i]);
+ }
+
+ if ('>' != tokens[i][0])
+ goto error;
+
+ current_header->list_id = id;
+ id = NULL;
+
+ error:
+ if (phrase)
+ free(phrase);
+ if (id)
+ free(id);
+
+ free_rfc822tokenized(tokens);
+ }
+
void header_parse_helper(current_header,parsed_headers)
struct header_rec *current_header;
header_list_ptr parsed_headers;
***************
*** 242,248 ****
current_header->status |= UNREAD;
}
if (index(current_header->mailx_status, 'r') != NULL)
! current_header->status |= REPLIED;
}

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
--- 333,339 ----
current_header->status |= UNREAD;
}
if (index(current_header->mailx_status, 'r') != NULL)
! current_header->status |= REPLIED_TO;
}

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
***************
*** 270,275 ****
--- 361,371 ----
} else if (!current_header->subject)
current_header->subject = new_string(display_charset);

+
+ if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
+ "List-Id"))) {
+ parse_list_id(current_header,tmphdr);
+ }

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
"From"))) {
Index: elmME+.2.5.alpha0-cvs/src/messages/Makefile.SH
*** elm2.4.ME+.115/src/messages/Makefile.SH 2003-10-12 12:48:03.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/messages/Makefile.SH 2004-04-18 19:55:43.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.5 2003/10/01 17:34:34 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables

--- 17,23 ----
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.5.44.1 2004/04/18 16:55:43 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************

*** 63,79 ****


$(RANLIB) $@

# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/headers.h def_messages.h



! $(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! def_messages.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h


$(CHMOD) u+w $@
$(TOUCH) $@

--- 63,85 ----


$(RANLIB) $@

# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/elm_defs.h $(INCLDIR)/defs_major.h def_messages.h \


! $(INCLDIR)/me.h

! $(INCLDIR)/elm_defs.h: $(INCLDIR)/defs_major.h $(INCLDIR)/elm_nl_types.h \
! $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/defs_major.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! def_messages.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/me.h $(INCLDIR)/mime.h


! $(CHMOD) u+w $@
! $(TOUCH) $@
!
! $(INCLDIR)/me.h: $(INCLDIR)/melib.h
$(CHMOD) u+w $@
$(TOUCH) $@

Index: elmME+.2.5.alpha0-cvs/src/messages/messages.c
*** elm2.4.ME+.115/src/messages/messages.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/messages/messages.c 2004-04-25 17:52:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: messages.c,v 1.12 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: messages.c,v 1.12.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 23,29 ****
ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero(ret,sizeof (*ret));

ret->magic = MAILBOXVIEW_magic;
ret->mailbox_type = t;
--- 23,29 ----
ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero((void *)ret,sizeof (*ret));

ret->magic = MAILBOXVIEW_magic;
ret->mailbox_type = t;

Index: elmME+.2.5.alpha0-cvs/src/messages/partial.c
*** elm2.4.ME+.115/src/messages/partial.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/messages/partial.c 2004-04-25 17:52:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.14 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.14.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 27,33 ****
mbx->u.partial = safe_malloc(sizeof (* (mbx->u.partial)));

/* bzero is defined hdrs/defs.h */

! bzero(mbx->u.partial, sizeof (* (mbx->u.partial)));

mbx->u.partial->parent_mailbox = NULL;

--- 27,33 ----
mbx->u.partial = safe_malloc(sizeof (* (mbx->u.partial)));

/* bzero is defined hdrs/defs.h */

! bzero((void *)mbx->u.partial, sizeof (* (mbx->u.partial)));

mbx->u.partial->parent_mailbox = NULL;

Index: elmME+.2.5.alpha0-cvs/src/messages/storage.c
*** elm2.4.ME+.115/src/messages/storage.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/messages/storage.c 2004-04-25 17:52:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: storage.c,v 1.6 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: storage.c,v 1.6.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 30,36 ****
mbx->u.storage = safe_malloc(sizeof (* (mbx->u.storage)));

/* bzero is defined hdrs/defs.h */

! bzero(mbx->u.storage, sizeof (* (mbx->u.storage)));

mbx->u.storage->the_mailbox = NULL;
mbx->u.storage->mailbox_count = 0;
--- 30,36 ----
mbx->u.storage = safe_malloc(sizeof (* (mbx->u.storage)));

/* bzero is defined hdrs/defs.h */

! bzero((void *)mbx->u.storage, sizeof (* (mbx->u.storage)));

mbx->u.storage->the_mailbox = NULL;
mbx->u.storage->mailbox_count = 0;

Index: elmME+.2.5.alpha0-cvs/src/options.c
*** elm2.4.ME+.115/src/options.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/options.c 2004-04-18 19:55:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: options.c,v 1.24 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.24.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 95,102 ****

static void options_help P_((struct menu_context *page));

-
- char *level_name();
static char *on_name = NULL;
static char *off_name = NULL;
static int resort = 0;
--- 95,100 ----
***************
*** 404,412 ****
ClearLine(LINES-2); /* clear lower prompt message */
}

!
! char *
! level_name(n)
int n;
{
/** return the 'name' of the level... **/
--- 402,408 ----
ClearLine(LINES-2); /* clear lower prompt message */
}

! char * level_name(n)
int n;
{
/** return the 'name' of the level... **/
Index: elmME+.2.5.alpha0-cvs/src/out_utils.c
*** elm2.4.ME+.115/src/out_utils.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/out_utils.c 2004-04-25 17:52:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.23 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.23.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

CONST char *format;

CONST char *line;
va_dcl
--- 299,304 ----

Index: elmME+.2.5.alpha0-cvs/src/quit.c
*** elm2.4.ME+.115/src/quit.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/quit.c 2004-05-02 14:05:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: quit.c,v 1.36 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: quit.c,v 1.36.8.2 2004/05/02 11:05:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

! menu_get_sizes(page, &LINES, &COLUMNS);
!

! /* NOTICE: prompt_letter may return EOF */
! ans = prompt_letter(LINES-1,"P",*def_ans_no,

! PROMPT_center|PROMPT_yesno|


! PROMPT_redraw_mark|PROMTP_ctrlL,
! page,
! CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveFolderQuit,

! "Failed to leave folder: Try to quit again ? ([P]anic/%c/%c) "),
! *def_ans_yes, *def_ans_no);
!

! menu_get_sizes(page, &LINES, &COLUMNS);
!

! /* NOTICE: prompt_letter may return EOF */
! ans = prompt_letter(LINES-1,"P",*def_ans_no,

! PROMPT_center|PROMPT_yesno|


! PROMPT_redraw_mark|PROMTP_ctrlL,
! page,
! CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveChange,

! "Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "),


! *def_ans_yes, *def_ans_no);
!
!

! if (ans == ('L'&31) || ans == REDRAW_MARK) {
redraw = 1;
menu_ClearScreen(page);
goto again1;
***************
*** 312,318 ****
clear_error();
goto rechange;
}
! if (ans == 'P')
emergency_exit(0);

if (new_folder) {
--- 319,325 ----
clear_error();
goto rechange;
}
! if (ans == 'P' || ans == EOF)
emergency_exit(0);

if (new_folder) {

Index: elmME+.2.5.alpha0-cvs/src/read_rc.c
*** elm2.4.ME+.115/src/read_rc.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/read_rc.c 2004-05-01 23:07:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.24 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.24.8.2 2004/05/01 20:07:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 275,303 ****
extern char *sort_name(), *alias_sort_name();

if (DT_SYN == save_info[i].dt_type ||
! DT_MLT == save_info[i].dt_type ||
! /* not dumping addresses to debug file */
! DT_ALT == save_info[i].dt_type)
! continue;
!
! if (DT_WEE == save_info[i].dt_type) {
!
! DPRINT(Debug,1,(&Debug,
! "\nAnd we're skipping the following headers:\n\t"));
!
! for (len = 8, j = 0; j < weedcount; j++) {
! if (weedlist[j][0] == '*') continue; /* skip '*end-of-defaults*' */
! if (len + strlen(weedlist[j]) > 80) {
! DPRINT(Debug,1,(&Debug, " \n\t"));
! len = 8;
! }
! DPRINT(Debug,1,(&Debug, "%s ", weedlist[j]));
! len += strlen(weedlist[j]) + 3;
! }
! DPRINT(Debug,1,(&Debug, "\n\n"));
! continue;
! }
!

{ /* Not very effective */
FILE * X = debug_to_FILE(&Debug);
--- 275,282 ----
extern char *sort_name(), *alias_sort_name();

if (DT_SYN == save_info[i].dt_type ||
! DT_MLT == save_info[i].dt_type)
! continue;

{ /* Not very effective */
FILE * X = debug_to_FILE(&Debug);
Index: elmME+.2.5.alpha0-cvs/src/reply.c
*** elm2.4.ME+.115/src/reply.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/reply.c 2004-05-01 11:45:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reply.c,v 1.35 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: reply.c,v 1.35.8.2 2004/05/01 08:45:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 352,361 ****
MAIL_EDIT_MSG | MAIL_REPLYING,
NO, infile,mailbox, aview,
page);
- if (me_retcode) {
- current_header->status |= REPLIED;
- current_header->status_chgd = TRUE;
- }
}

if (rt)
--- 352,357 ----
***************
*** 410,419 ****
MAIL_EDIT_MSG | MAIL_REPLYING,
NO, infile,mailbox, aview,
page);
- if (me_retcode) {
- current_header->status |= REPLIED;
- current_header->status_chgd = TRUE;
- }
if (rt)
free_addr_items(rt);
if (cc)
--- 406,411 ----
Index: elmME+.2.5.alpha0-cvs/src/savecopy.c
*** elm2.4.ME+.115/src/savecopy.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/savecopy.c 2004-05-15 13:52:16.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** Save a copy of the specified message in a folder.
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44.8.1 2004/05/15 10:52:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/savecopy.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ ****************************************************************************

+ * Incorparated Elm 2.5 code from src/savecopy.c.


+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** Save a copy of the specified message in a folder.
***************
*** 58,64 ****
* the dirty work.
*/
int save_copy(headers, cf, form, mime_info, conv_file, mailbox,
! page)
struct mailing_headers * headers;
struct copy_file *cf;
int form;
--- 68,74 ----
* the dirty work.
*/
int save_copy(headers, cf, form, mime_info, conv_file, mailbox,
! page, aview)
struct mailing_headers * headers;
struct copy_file *cf;
int form;
***************
*** 66,71 ****
--- 76,82 ----
FILE * conv_file;
struct MailboxView *mailbox;
struct menu_context *page;
+ struct AliasView *aview;
{
int
is_ordinary_file;
***************
*** 104,113 ****
char buffer[LONG_STRING];
struct string *S1 = NULL;
int r;

! /* determine 'to' login */
! get_return_name(headers->to.addrs[0].addr,
! buffer, TRUE, sizeof buffer);

if (!buffer[0])
goto use_sent_mail;
--- 115,137 ----
char buffer[LONG_STRING];
struct string *S1 = NULL;
int r;
+ char *return_alias = NULL;

! if ((save_by_alias &&
! (return_alias =
! address_to_alias(headers->to.addrs[0].addr,
! aview))
! != NULL))
! strfcpy(buffer, return_alias, sizeof buffer);
! else
!
! /* XXX FIXME
! following uses different values
! on Elm 2.5 base on is save_by_name set or not
! */
! /* determine 'to' login */
! get_return_name(headers->to.addrs[0].addr,
! buffer, TRUE, sizeof buffer);

if (!buffer[0])
goto use_sent_mail;
Index: elmME+.2.5.alpha0-cvs/src/screen.c
*** elm2.4.ME+.115/src/screen.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/screen.c 2004-05-15 23:11:36.000000000 +0300
***************
*** 1,11 ****
! static char rcsid[] = "@(#)$Id: screen.c,v 1.35 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

! ******************************************************************************


* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust

--- 1,13 ----
! static char rcsid[] = "@(#)$Id: screen.c,v 1.35.8.1 2004/05/15 20:11:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

! *****************************************************************************
! * Based on Elm 2.4 src/screen.c. That code was following copyright:
! *


* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust

Index: elmME+.2.5.alpha0-cvs/src/screen/context.c
*** elm2.4.ME+.115/src/screen/context.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/screen/context.c 2004-04-25 17:52:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: context.c,v 1.3 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: context.c,v 1.3.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 41,47 ****
struct menu_context *ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero(ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;

--- 41,47 ----
struct menu_context *ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero((void *)ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;

Index: elmME+.2.5.alpha0-cvs/src/screen/curses.c
*** elm2.4.ME+.115/src/screen/curses.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/screen/curses.c 2004-04-18 19:55:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curses.c,v 1.7 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curses.c,v 1.7.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 13,21 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

-
#include "def_screen.h"

DEBUG_VAR(Debug,__FILE__,"screen");

#ifdef I_CURSES
--- 13,22 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

#include "def_screen.h"

+ char *tgetstr();
+
DEBUG_VAR(Debug,__FILE__,"screen");

#ifdef I_CURSES
***************
*** 43,50 ****

#include <errno.h>

-
-
/* Lose 'const' */


static char * cs2s P_((const char *str));

static char * cs2s(str)
--- 44,49 ----
***************
*** 92,100 ****



char *_transmit_on = NULL, *_transmit_off = NULL;

! char *_key_up = NULL, *_key_down = NULL, *_key_left = NULL, *_key_right = NULL,
! *_key_pageup = NULL, *_key_pagedown = NULL, *_key_home = NULL,
! *_key_help = NULL, *_key_find = NULL;



/* Some additional capacities not used in ../src/curses.c */

--- 91,103 ----



char *_transmit_on = NULL, *_transmit_off = NULL;

! char *_key_up, *_key_down, *_key_left, *_key_right,
! *_key_pageup, *_key_pagedown, *_key_home,
! *_key_help, *_key_find;
!
! int has_highlighting; /* highlighting available? */
!
!


/* Some additional capacities not used in ../src/curses.c */

Index: elmME+.2.5.alpha0-cvs/src/screen/curs_input.c
*** elm2.4.ME+.115/src/screen/curs_input.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/screen/curs_input.c 2004-05-04 21:39:33.000000000 +0300
***************
*** 1,25 ****
! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.6 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

*****************************************************************************
*
! * Some code copied from ../src/curses.c. It have following copyright:


*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

-
#include "def_screen.h"

DEBUG_VAR(Debug,__FILE__,"screen");

#include <errno.h>


#if POLL_METHOD


static unsigned char *read_buffer = NULL;

--- 1,42 ----
! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.6.8.2 2004/05/04 18:39:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

*****************************************************************************
*
! * Some code copied from Elm 2.4 src/curses.c. It have following copyright:


*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * cur_FlushInput() partially based on Elm 2.5 src/curses.c.
+ * It have following copyright:


+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

#include "def_screen.h"



+ #ifdef TERMIOS
+ # include <termios.h>

+ #endif
+
DEBUG_VAR(Debug,__FILE__,"screen");

#include <errno.h>

+ char backspace, /* the current backspace char */


+ kill_line, /* the current kill_line char */
+ word_erase, /* the current word-erase char */
+ interrupt_char, /* the current interrupt char */
+ reprint_char, /* the current reprint-line char */
+ eof_char; /* the current end-of-file char */

#if POLL_METHOD


static unsigned char *read_buffer = NULL;

***************
*** 113,118 ****
--- 130,147 ----
}
#endif

+ void cur_FlushInput() {
+
+ #if POLL_METHOD
+ clear_input_buffer();
+ #endif
+ #ifdef TERMIOS
+ SIGDPRINT(Debug,4,(&Debug,
+ "Clearing terminal input from fd %d\n",
+ terminal_fd));
+ tcflush(terminal_fd,TCIFLUSH);
+ #endif
+ }

int cur_ReadCh(flags,break_flag,mc)
int flags;
Index: elmME+.2.5.alpha0-cvs/src/screen/def_screen.h
*** elm2.4.ME+.115/src/screen/def_screen.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/screen/def_screen.h 2004-05-04 21:39:33.000000000 +0300
***************
*** 1,8 ****
! /* $Id: def_screen.h,v 1.4 2004/03/27 18:31:48 hurtta Exp $ */
!

! #include "headers.h"
! #include "me.h"


extern int InGetPrompt; /* set if in GetPrompt() in read() */

/* HACK */
--- 1,8 ----
! /* $Id: def_screen.h,v 1.4.8.2 2004/05/04 18:39:33 hurtta Exp $ */

+ #include "elm_defs.h"
+ #include "mime.h"
+ #include "me.h"


extern int InGetPrompt; /* set if in GetPrompt() in read() */

/* HACK */
***************
*** 75,80 ****
--- 75,82 ----
int break_flag,
struct menu_context *mc));

+ extern void cur_FlushInput P_((void));
+
extern int cursor_control;


extern int _intransmit; /* are we transmitting keys? */

extern char *_key_up, *_key_down, *_key_left, *_key_right,

Index: elmME+.2.5.alpha0-cvs/src/screen/Makefile.SH
*** elm2.4.ME+.115/src/screen/Makefile.SH 2004-03-16 21:17:43.000000000 +0200
--- elmME+.2.5.alpha0-cvs/src/screen/Makefile.SH 2004-04-18 19:55:43.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.3 2004/03/14 17:05:59 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----

echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.3.12.1 2004/04/18 16:55:43 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************

*** 63,69 ****


$(RANLIB) $@

# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/headers.h def_screen.h



$(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@

--- 63,69 ----


$(RANLIB) $@

# Dependencies of header files upon other header files they include

! .PRECIOUS: def_screen.h $(INCLDIR)/defs.h $(INCLDIR)/headers.h



$(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@

***************
*** 73,79 ****


$(CHMOD) u+w $@
$(TOUCH) $@

! def_screen.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h


$(CHMOD) u+w $@
$(TOUCH) $@

--- 73,83 ----


$(CHMOD) u+w $@
$(TOUCH) $@

! def_screen.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/me.h $(INCLDIR)/mime.h

! $(CHMOD) u+w $@
! $(TOUCH) $@
!
! $(INCLDIR)/me.h: $(INCLDIR)/melib.h
$(CHMOD) u+w $@
$(TOUCH) $@

Index: elmME+.2.5.alpha0-cvs/src/screen/screen.c
*** elm2.4.ME+.115/src/screen/screen.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/screen/screen.c 2004-05-04 21:39:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: screen.c,v 1.7 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: screen.c,v 1.7.8.1 2004/05/04 18:39:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
***************
*** 269,274 ****
--- 269,281 ----
return c;
}

+ void FlushInput() {
+
+ DPRINT(Debug,49, (&Debug, "FlushInput()\n"));
+
+ cur_FlushInput();
+ }
+
int menu_ReadCh(ptr,flags)
struct menu_context *ptr;
int flags;
Index: elmME+.2.5.alpha0-cvs/src/signals.c
*** elm2.4.ME+.115/src/signals.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/signals.c 2004-04-25 19:59:27.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: signals.c,v 1.24 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: signals.c,v 1.24.8.1 2004/04/25 16:59:27 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 220,228 ****
return;
}

! question_me = FALSE;
while (current_mailbox &&
! (result = leave_mbox(TRUE, FALSE, TRUE, NULL, current_mailbox,
&dummy, default_context))
== -1) {
int idx;
--- 220,228 ----
return;
}

! /* !! FIXME?? Differs from Elm 2.5 */
while (current_mailbox &&
! (result = leave_mbox(TRUE, FALSE, FALSE, NULL, current_mailbox,
&dummy, default_context))
== -1) {
int idx;
Index: elmME+.2.5.alpha0-cvs/src/strings.c
*** elm2.4.ME+.115/src/strings.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/strings.c 2004-04-18 19:55:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strings.c,v 1.15 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strings.c,v 1.15.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,34 ****

/** forward declarations **/

- char *get_token();
-
char **argv_from_to(to)
char *to;
{
--- 27,32 ----
Index: elmME+.2.5.alpha0-cvs/src/syscall.c
*** elm2.4.ME+.115/src/syscall.c 2004-04-13 14:26:13.000000000 +0300
--- elmME+.2.5.alpha0-cvs/src/syscall.c 2004-05-14 22:48:18.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33 2004/04/12 18:40:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33.2.1 2004/05/14 19:48:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.2.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 693,698 ****
--- 693,699 ----
int res = 0;
struct run_state RS;
CONST char * argv[4];
+ char XX[sizeof printhdrs +10];

int LINES, COLUMNS;

***************
*** 714,719 ****
--- 715,727 ----
if (!have_printout())
return 0;

+ XX[0] = '\0';
+
+ if (printhdrs[0] != '\0') {
+ elm_sfprintf(XX,sizeof XX,
+ FRM(" -w '%s'"), printhdrs);
+ }
+
/*
* Setup print command. Select old or new behavior based
* upon the presence of "%s" in the print command string.
***************
*** 727,739 ****
temp_dir, temp_print, getpid());

printbuffer = elm_message(FRM(printout), filename);
elm_sfprintf(buffer,sizeof buffer,
! FRM("%s -Ip > %s; %s"),
! readmsg, filename, printbuffer);
free(printbuffer);
} else {
elm_sfprintf(buffer,sizeof buffer,
! FRM("%s -Ip | %s"), readmsg, printout);
}

/*
--- 735,750 ----
temp_dir, temp_print, getpid());

printbuffer = elm_message(FRM(printout), filename);
+
+
+
elm_sfprintf(buffer,sizeof buffer,
! FRM("%s -Ip%s > %s; %s"),
! readmsg, XX,filename, printbuffer);
free(printbuffer);
} else {
elm_sfprintf(buffer,sizeof buffer,
! FRM("%s%s -Ip | %s"), readmsg, XX,printout);
}

/*
Index: elmME+.2.5.alpha0-cvs/utils/charmapcopy.c
*** elm2.4.ME+.115/utils/charmapcopy.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/utils/charmapcopy.c 2004-04-18 19:55:43.000000000 +0300
***************
*** 1,13 ****
! static char rcsid[] = "@(#)$Id: charmapcopy.c,v 1.5 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "defs.h"
! #include "elmlib.h"

#include "s_elm.h"
#include "s_me.h"
#include "reghelper.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: charmapcopy.c,v 1.5.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elm_defs.h"
#include "s_elm.h"

#include "s_me.h"
#include "reghelper.h"
Index: elmME+.2.5.alpha0-cvs/utils/from.c
*** elm2.4.ME+.115/utils/from.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/utils/from.c 2004-05-01 10:41:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: from.c,v 1.48 2004/03/27 18:31:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: from.c,v 1.48.8.1 2004/05/01 07:41:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 614,620 ****
DPRINT(Debug,4,(&Debug," -NEW +UNREAD"));
}
if (index(hdr.mailx_status, 'r') != NULL) {
! hdr.status |= REPLIED;
DPRINT(Debug,4,(&Debug," +REPLIED"));
}
DPRINT(Debug,4,(&Debug," "));
--- 614,620 ----
DPRINT(Debug,4,(&Debug," -NEW +UNREAD"));
}
if (index(hdr.mailx_status, 'r') != NULL) {
! hdr.status |= REPLIED_TO;
DPRINT(Debug,4,(&Debug," +REPLIED"));
}
DPRINT(Debug,4,(&Debug," "));
Index: elmME+.2.5.alpha0-cvs/utils/Makefile.SH
*** elm2.4.ME+.115/utils/Makefile.SH 2003-11-15 18:19:06.000000000 +0200
--- elmME+.2.5.alpha0-cvs/utils/Makefile.SH 2004-04-18 19:55:43.000000000 +0300
***************
*** 16,22 ****
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.34 2003/11/15 15:50:22 hurtta Exp $
#


# Makefile for the Elm system utilities
#

--- 16,22 ----
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.34.38.1 2004/04/18 16:55:43 hurtta Exp $
#


# Makefile for the Elm system utilities
#
***************

*** 249,286 ****

# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h \
! $(INCLDIR)/headers.h ../lib/libutil.a
!
! answer.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_answer.h $(INCLDIR)/sysdefs.h
! elmalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_elmalias.h
! fastmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_fastmail.h
! from.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_from.h $(INCLDIR)/s_elm.h
! newalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newalias.h
! newmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newmail.h
! prlong.o: $(INCLDIR)/elmutil.h $(INCLDIR)/defs.h
! readmsg.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_readmsg.h
! elmcharset.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h charmapcopy.h
! elmrc-write.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
! $(INCLDIR)/reghelper.h
! elmterminal.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/reghelper.h
! elmunidata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/unidata.h $(INCLDIR)/reghelper.h
! elmbindata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/bindata.h $(INCLDIR)/reghelper.h $(INCLDIR)/cs_imp.h \
! charmapcopy.o
! elmstringconvert.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
! elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h


! reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
! $(INCLDIR)/reghelper.h
! charmapcopy.o: charmapcopy.h $(INCLDIR)/s_elm.h $(INCLDIR)/elmlib.h \
! $(INCLDIR)/defs.h $(INCLDIR)/s_me.h $(INCLDIR)/reghelper.h

! elmlibregister.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
! $(INCLDIR)/reghelper.h



checkalias: checkalias.SH ; sh $?
listalias: listalias.SH ; sh $?

--- 249,255 ----

# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
! .PRECIOUS: $(INCLDIR)/elm_defs.h $(INCLDIR)/defs_major.h ../lib/libutil.a



checkalias: checkalias.SH ; sh $?
listalias: listalias.SH ; sh $?
***************

*** 384,410 ****
$(CHMOD) u+w,a+rx $@



# Dependencies of header files upon other header files they include

! $(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/elmutil.h: $(INCLDIR)/defs.h $(INCLDIR)/elmlib.h


$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h


$(CHMOD) u+w $@
$(TOUCH) $@

# Dependencies of C object files

! answer.o: $(INCLDIR)/ndbz.h $(INCLDIR)/elmutil.h $(INCLDIR)/s_answer.h
! elmalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_elmalias.h
! fastmail.o: $(INCLDIR)/patchlevel.h $(INCLDIR)/elmutil.h $(INCLDIR)/s_fastmail.h
! from.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_from.h
! newalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/sysdefs.h $(INCLDIR)/s_newalias.h
newmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newmail.h
readmsg.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_readmsg.h
! prlong.o: $(INCLDIR)/defs.h

# Dependencies and rules for installing programs from bin directory

--- 353,403 ----
$(CHMOD) u+w,a+rx $@



# Dependencies of header files upon other header files they include
!

! $(INCLDIR)/elm_defs.h: $(INCLDIR)/defs_major.h $(INCLDIR)/elm_nl_types.h \
! $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/defs_major.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
$(TOUCH) $@

!

! $(INCLDIR)/elmutil.h: $(INCLDIR)/elm_defs.h


$(CHMOD) u+w $@
$(TOUCH) $@

+

# Dependencies of C object files

! prlong.o: $(INCLDIR)/elmutil.h
! answer.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_answer.h $(INCLDIR)/sysdefs.h
! elmalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_elmalias.h
! fastmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_fastmail.h
! from.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_from.h $(INCLDIR)/s_elm.h
! newalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newalias.h
newmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newmail.h
readmsg.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_readmsg.h
! elmcharset.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h charmapcopy.h
! elmrc-write.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
! $(INCLDIR)/reghelper.h
! elmterminal.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/reghelper.h
! elmunidata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/unidata.h $(INCLDIR)/reghelper.h
! elmbindata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/bindata.h $(INCLDIR)/reghelper.h $(INCLDIR)/cs_imp.h \
! charmapcopy.o
! elmstringconvert.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
! elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h


! reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
! $(INCLDIR)/reghelper.h

! charmapcopy.o: charmapcopy.h $(INCLDIR)/s_elm.h $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/reghelper.h
! elmlibregister.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
! $(INCLDIR)/reghelper.h

# Dependencies and rules for installing programs from bin directory

Index: elmME+.2.5.alpha0-cvs/utils/newmail.c
*** elm2.4.ME+.115/utils/newmail.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/utils/newmail.c 2004-05-01 10:41:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35 2004/03/27 18:31:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35.8.1 2004/05/01 07:41:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 476,482 ****
entry->status |= UNREAD;
}
if (index(tmphdr->body, 'r') != NULL)
! entry->status |= REPLIED;
}

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
--- 476,482 ----
entry->status |= UNREAD;
}
if (index(tmphdr->body, 'r') != NULL)
! entry->status |= REPLIED_TO;
}

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
Index: elmME+.2.5.alpha0-cvs/utils/prlong.c
*** elm2.4.ME+.115/utils/prlong.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/utils/prlong.c 2004-04-18 19:55:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 47,59 ****
* ha...@grumpy.acme.com
*/

-
- #include <stdio.h>
- #ifndef GETOPT
# include "elmutil.h"
- #else
- # include "defs.h"
- #endif

#define MAXWID 78 /* default maximum line width */
#define ONE_LDR "" /* default leader for first line */
--- 47,53 ----
Index: elmME+.2.5.alpha0-cvs/utils/readmsg.c
*** elm2.4.ME+.115/utils/readmsg.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha0-cvs/utils/readmsg.c 2004-05-16 12:30:52.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.18 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This program extracts messages from a mail folder. It is particularly
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.18.8.2 2004/05/16 09:30:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 utils/readmsg.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from utils/readmsg.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This program extracts messages from a mail folder. It is particularly
***************
*** 94,103 ****
*/


/*
* local procedures
*/
! void weed_headers();
char *skip_word();

static int print_patmatch_mssg P_((FILE *fp,
--- 104,136 ----
*/


+
+ /*
+ * Header weeding information.
+ */
+
+ #define DFLT_WEED_LIST "Subject: From: To: Cc: Apparently- Date:"
+
+ struct weed_header_info {
+ char *hdrname; /* string to compare against header */
+ int hdrlen; /* characters in "hdrname" */
+ int hdrskip; /* skip (instead of accept) on match? */
+ struct weed_header_info *next;
+ };
+
+ /* head of linked list of weeded headers */
+ struct weed_header_info Weedlist;
+
+ /* is default to accept headers NOT in weed list? */
+ int weed_dflt_accept = FALSE;
+
+
/*
* local procedures
*/
! void weed_headers P_((char *buf));
! void setup_weed_info P_((const char *sel_weed_str));
!
char *skip_word();

static int print_patmatch_mssg P_((FILE *fp,
***************
*** 116,122 ****
void usage_error()
{
lib_error(CATGETS(elm_msg_cat, ReadmsgSet, ReadmsgUsage,
! "Usage: %s [-anhp] [-f Folder] {MessageNum ... | pattern | *}\n"),
prog);
exit(1);
}
--- 149,155 ----
void usage_error()
{
lib_error(CATGETS(elm_msg_cat, ReadmsgSet, ReadmsgUsage,
! "Usage: %s [-anhp] [-f Folder] [-w weedlist] {MessageNum ... | pattern | *}\n"),
prog);
exit(1);
}
***************
*** 204,209 ****
--- 237,243 ----
int exit_status; /* normally zero, set to one on error */
FILE *fp; /* file stream for opened folder */
long idx; /* seek offset within folder */
+ char *sel_weed_str; /* header weeding specification */
char buf[SLEN];
int i;

***************
*** 232,237 ****
--- 266,272 ----
prog = argv[0];
folder_name[0] = '\0'; /* no folder specified yet */
folder_size = -1; /* message index not loaded yet */
+ sel_weed_str = DFLT_WEED_LIST; /* default header weeding spec */
hdr_disp_level = WEED; /* only display interesting headers */
do_page_breaks = FALSE; /* suppress formfeed between mssgs */
do_all_matches = FALSE; /* only show 1st mssg which matches pat */
***************
*** 256,262 ****
fstate_valid = (fstate.storage != NULL);

/* crack the command line */
! while ((i = getopt(argc, argv, "anhf:pId:")) != EOF) {
switch (i) {
case 'a' :
do_all_matches = TRUE;
--- 291,297 ----
fstate_valid = (fstate.storage != NULL);

/* crack the command line */
! while ((i = getopt(argc, argv, "anhf:pId:w:")) != EOF) {
switch (i) {
case 'a' :
do_all_matches = TRUE;
***************
*** 274,279 ****
--- 309,317 ----
break;
case 'h' :
hdr_disp_level = ALL;
+ case 'w' :
+ hdr_disp_level = WEED;
+ sel_weed_str = optarg;
break;
case 'f' :
strfcpy(folder_name, optarg, sizeof folder_name);
***************
*** 382,387 ****
--- 420,430 ----
}
}

+ /* process the header weeding specification */
+ if (hdr_disp_level == WEED)
+ setup_weed_info(sel_weed_str);
+
+
/* if no selections on cmd line then show selected mssgs from state file */
if (argc == optind) {
if (!fstate_valid) {
***************
*** 673,680 ****
if (buf[0] == '\n' && buf[1] == '\0' ||
buf[0] == '\r' && buf[1] == '\n' && buf[2] == '\0') {
if (in_header) {
- if (hdr_disp_level == WEED)
- weed_headers((char *)NULL);
in_header = FALSE;
}
++newlines;
--- 716,721 ----
***************
*** 734,780 ****
void weed_headers(buf)
char *buf;
{
! static int got_from = FALSE; /* already printed From: */
! static int got_date = FALSE; /* already printed Date: */
! static int is_interesting = FALSE; /* print out curr hdr line */
! static char save_from[SLEN]; /* From_ hdr from current mssg */
! char *s;
!
! /* finish off headers on NULL value */
! if (buf == (char *) NULL) {
! if (!got_from) {
! fputs("From: ", stdout);
! for (s = skip_word(save_from) ; *s != '\0' && !isspace(*s) ; ++s)
! putchar(*s);
! putchar('\n');
! }
! if (!got_date)
! printf("Date: %s", skip_word(skip_word(save_from)));
! is_interesting = got_from = got_date = FALSE;
! save_from[0] = '\0';
! return;
! }
!
! if (Hdrmatch(buf, "From ")) {
! strfcpy(save_from, buf, sizeof save_from);
! is_interesting = FALSE;
! } else if (Hdrmatch(buf, "To:") || Hdrmatch(buf, "Subject:")
! || Hdrmatch(buf, "Cc:"))
! is_interesting = TRUE;
! else if (Hdrmatch(buf, "Date:"))
! got_date = is_interesting = TRUE;
! else if (Hdrmatch(buf, "From:"))
! got_from = is_interesting = TRUE;
! else if (!isspace(buf[0]))
! is_interesting = FALSE;
! /* else */
! /* this is a continuation header - preserve "is_interesting" value */

! if (is_interesting)
fputs(buf, stdout);
}



/*
* Convert a mailbox message number to a seek location.
--- 775,852 ----
void weed_headers(buf)
char *buf;
{
! struct weed_header_info *w;
! static int accept_header = FALSE;

! /* if this is a new header, see if we want to accept it */
! if (!isspace(buf[0])) {
! accept_header = weed_dflt_accept;
! for (w = Weedlist.next ; w != NULL ; w = w->next) {
! if (strincmp(buf, w->hdrname, w->hdrlen) == 0) {
! accept_header = !w->hdrskip;


! break;
! }
! }
! }

!
! /* output accepted headers */
! if (accept_header)
fputs(buf, stdout);
}

+ /*
+ * Initialize the header weeding info.
+ *
+ * The header weeding info is a linked list of (struct weed_header_info).
+ */
+ void setup_weed_info(sel_weed_str)
+ CONST char *sel_weed_str;
+ {
+ struct weed_header_info *w;
+ char *weed_str, *fld, *s;
+
+ /* make a copy we can scribble on safely */
+ weed_str = safe_strdup(sel_weed_str);
+
+ w = &Weedlist;
+ while ((fld = strtok(weed_str, " \t\n,")) != NULL) {
+ weed_str = NULL;
+
+ /* convert "_" to " " */
+ for (s = fld ; *s != '\0' ; ++s) {
+ if (*s == '_')
+ *s = ' ';
+ }
+
+ /* add weeding info to end of list */
+ w->next = (struct weed_header_info *)
+ safe_malloc(sizeof(struct weed_header_info));
+ w = w->next;
+ if (w->hdrskip = (*fld == '!'))
+ ++fld;
+ w->hdrname = fld;
+ w->hdrlen = strlen(fld);
+ w->next = NULL;
+
+ /*
+ * The default weed action is the opposite of the last list entry.
+ * That is, if the list ends in "foo" (an accept action) then the
+ * default is to reject things not in the weed list. If the list
+ * ends in "!foo" (a reject action) then the default is to accept
+ * things not in the weed list.
+ *
+ * If this doesn't make sense to you, consider the following
+ * two example commands...and what you'd like them to do:
+ *
+ * readmsg -w "From: Date: Subject:"
+ * readmsg -w "!From_ !Received: !Status:"
+ *
+ */
+ weed_dflt_accept = w->hdrskip;

+ }
+
+ }

/*
* Convert a mailbox message number to a seek location.

Kari E. Hurtta

unread,
May 21, 2004, 10:35:29 AM5/21/04
to
Archive-name: elm2.4ME+/PL116

Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

files elm-2.4ME+PL116.patch.gz
and elm-2.4ME+116.tar.gz
for a moment (2).

Is available on ftp.funet.fi
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

files elm-2.4ME+PL116.patch.gz
and elm-2.4ME+116.tar.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL116.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+116.tar.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL116.patch.gz >
and <URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+116.tar.gz >
via WWW.

(1) Was ftp.ozone.fmi.fi but name ftp.ozone.fmi.fi
will probably point to service which no have anonymous ftp
before ozone.fmi.fi retires. So use ozone.fmi.fi
for a moment instead of ftp.ozone.fmi.fi.

(2) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi.

Also ozone.fmi.fi will retire.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL116.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Undo Elm2.4ME+ PL115a (25) patch before applying this patch.

SUMMARY: This patch fixes handling of unexpected return

value of nl_langinfo(CODESET) on AIX, fixes

value check of "internal-mailcaps" and

"metamail-mailcaps" elmrc variables,


fixes some prompts on situation where leaving

of folder fails, reimplements "alternatives"
and "weedout" elmrc variables, changes
elm.filelist format (adds subcommand
"copydoc" to elmregister), adds -s option
to elmregister and adds RFC 2919 List-ID to
list of known headers.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL115 (25) --------------------------------

Unistall Elm2.4ME+ PL115a (25) patch before installing that patch.
For installing that patch run

patch -p1 < {this-file}

on directory where Configure is.

Index: elm2.4.ME+.116-cvs/hdrs/patchlevel.h
Prereq: 1113000000
*** elm2.4.ME+.115/hdrs/patchlevel.h 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.116-cvs/hdrs/patchlevel.h 2004-05-18 22:30:03.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "115 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.115
*/
! #define LAST_REPORT_TIME 1113000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Apr, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Apr, 2004"

/*
* Local Variables:
--- 1,12 ----
! #define PATCHLEVEL "116 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.116
*/
! #define LAST_REPORT_TIME 1116400000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "May, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released May, 2004"

/*
* Local Variables:
Index: elm2.4.ME+.116-cvs/README.ME+
*** elm2.4.ME+.115/README.ME+ 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.116-cvs/README.ME+ 2004-05-19 15:02:16.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.733 2004/04/12 19:27:31 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.760 2004/05/19 12:02:16 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,30 ****


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

Changes of Elm2.4ME+ PL115 (25) compared with Elm2.4ME+ PL114 (25)

------------------------------------------------------------------

! SuMMARY: This release changes temporary folder
! location on some situations, fixs crash


on c)hange command on alias menu, adds
elmrc options "local-sessionlock-dir" and
"local-sessionlock-use-home", and changes

! SIGWICH handling when waiting of editor.

! - If opened local mailbox is on somewhere other
! location than on spool directory, use "tmpdir" setting


from elm.rc for location of temporary file

"mbox.{mailbox}-{username}" instead default_temp.

--- 13,161 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL116 (25) compared with Elm2.4ME+ PL115 (25)
+ -------------------------------------------------------------------
+

+ SUMMARY: This patch fixes handling of unexpected return
+ value of nl_langinfo(CODESET) on AIX, fixes

+ value check of "internal-mailcaps" and
+ "metamail-mailcaps" elmrc variables,


+ fixes some prompts on situation where leaving

+ of folder fails, reimplements
+ "alternatives" and "weedout" elmrc variables,
+ changes elm.filelist format (adds subcommand
+ "copydoc" to elmregister), adds -s option
+ to elmregister and adds RFC 2919 List-ID to
+ list of known headers.
+
+ WARNING: There is small change on elm.filelist format, so
+ downgrading from Elm2.4ME+ PL116 (25) to
+ Elm 2.4ME+ PL115 (25) or to Elm ME+ 2.5 PLalpha0
+ will not work (you need unistall or remove
+ elm.filelist first.)


+
+ - " When installing ELM (on AIX 5L), I get the following message:
+

+ | Elm: Unable to map en_US locale (LC_CTYPE) to MIME charset.

+ | Codeset name ISO8859-1 was unknown. Treating ISO8859-1 as MIME name.
+ | Check /usr/local/lib/elm/elm.mimecharsets or
+ | noam/.elm/mime.charsets
+ | WARNING: Locale en_US (charset ISO8859-1) is unsupported, will cause problems!

+ | Problem with locale (system character set)! Elm ME+ will

+ | behave erratically."
+ Problem noted by: Noam G. Nudelman <no...@mail.biu.ac.il>
+
+ - dt_PATH_print_value() was not printing always empty values
+ correctly.
+
+ - fix test on expand_dt_path(). Specially non-file
+ values on "internal-mailcaps" and "metamail-mailcaps" was
+ not giving error message.
+
+ - Prompt "Failed to leave folder: Try to change again ?
+ [P]anic" did not worked. Added new routine prompt_letter()
+

+ - Changed prompt "Failed to leave folder: Try to quit again ?"
+

+ - Changed prompt ""received" folder not available, continue? (y/n) n"
+ - Also changed default answer to be yes on that prompt
+ (that is usefull only when received folder is remote,
+ but that error may occur also is somebody is set
+ receivedmail = /invalid

+ )
+

+ - Fix some possible compilation problems with traditional
+ C compilers (as opposed to ANSI C ompilers)
+

+ - Reimplemeted elmrc "alternatives" as type PATH and
+ removed special elmrc type for alternatives.
+

+ - Reimplemeted elmrc "weedout" as type PATH and
+ removed special elmrc type for weedout.

+ If first element on list is "*clear-weed-list*",
+ then builtin weedout list is not used.
+
+ - Fix typo PROMTP_yesno (to PROMPT_yesno) on
+ Elm2.4ME+ PL115a (25)
+
+ - Added command "elmregister copydoc" which
+ works like "elmregister copy", but marks
+ file to be document.
+
+ - Added option "-s {stage-subdir}" to command
+ "elmregister {command}".


+
+ - Added RFC 2919 List-ID -header to array on
+ lib/headers.c
+ - Fix missing space between pharse and < >
+ on result of hdr_decode_from_phrase() on
+ lib/headers.c
+

+ - If on header editing screen incoked editor
+ and address was on form '"a" <b> (c)",
+ and then edited it on header editing screen
+ address become as '"a" <b> (c('. Changed
+ on '(' to ')' on make_surface_addr() on
+ lib/outheaders.c
+
+
+ Changes of Elm2.4ME+ PL115a (25) compared with Elm2.4ME+ PL115 (25)
+ -------------------------------------------------------------------
+

+ [ This patch is branch from the main line. ]

+

+ SUMMARY: This patch fixes handling of unexpected return
+ value of nl_langinfo(CODESET) on AIX, fixes
+ value check of "internal-mailcaps" and
+ "metamail-mailcaps" elmrc variables and
+ fixes some prompts on situation where leaving
+ of folder fails.
+
+ - " When installing ELM (on AIX 5L), I get the following message:
+

+ | Elm: Unable to map en_US locale (LC_CTYPE) to MIME charset.

+ | Codeset name ISO8859-1 was unknown. Treating ISO8859-1 as MIME name.
+ | Check /usr/local/lib/elm/elm.mimecharsets or
+ | noam/.elm/mime.charsets
+ | WARNING: Locale en_US (charset ISO8859-1) is unsupported, will cause problems!

+ | Problem with locale (system character set)! Elm ME+ will

+ | behave erratically."
+ Problem noted by: Noam G. Nudelman <no...@mail.biu.ac.il>
+
+ - dt_PATH_print_value() was not printing always empty values
+ correctly.
+
+ - fix test on expand_dt_path(). Specially non-file
+ values on "internal-mailcaps" and "metamail-mailcaps" was
+ not giving error message.
+
+ - Prompt "Failed to leave folder: Try to change again ?
+ [P]anic" did not worked. Added new routine prompt_letter()
+

+ - Changed prompt "Failed to leave folder: Try to quit again ?"
+

+ - Changed prompt ""received" folder not available, continue? (y/n) n"
+ - Also changed default answer to be yes on that prompt
+ (that is usefull only when received folder is remote,
+ but that error may occur also is somebody is set
+ receivedmail = /invalid

+ )
+

+ - Fix some possible compilation problems with traditional
+ C compilers (as opposed to ANSI C ompilers)

+
Changes of Elm2.4ME+ PL115 (25) compared with Elm2.4ME+ PL114 (25)

------------------------------------------------------------------

! SUMMARY: This release changes temporary folder
! location on some situations, fixes crash


on c)hange command on alias menu, adds
elmrc options "local-sessionlock-dir" and
"local-sessionlock-use-home", and changes

! SIGWINCH handling when waiting for editor.

! - If opened local mailbox is on somewhere else
! than on spool directory, use "tmpdir" setting


from elm.rc for location of temporary file

"mbox.{mailbox}-{username}" instead default_temp.

***************
*** 78,84 ****


so that Elm will call menu_context_resize() when it is

waiting child to complete ...

-
New elmrc options:
local-sessionlock-dir
local-sessionlock-use-home

--- 209,214 ----


***************
*** 169,175 ****
Changes of Elm2.4ME+ PL113a (25) compared with Elm2.4ME+ PL113 (25)
-------------------------------------------------------------------

! [ This is out of branch patch. ]

- "I tried to compile elm2.4.ME+.113 on AIX 5.1 (maintenance
level 05) or on AIX 5.2 (maintenance level 02)

--- 299,305 ----


Changes of Elm2.4ME+ PL113a (25) compared with Elm2.4ME+ PL113 (25)
-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "I tried to compile elm2.4.ME+.113 on AIX 5.1 (maintenance
level 05) or on AIX 5.2 (maintenance level 02)
***************
*** 338,344 ****
Changes of Elm2.4ME+ PL111b (25) compared with Elm2.4ME+ PL111a (25)
--------------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix crash on parse failure on command
"View digest as mailbox".
--- 468,474 ----

Changes of Elm2.4ME+ PL111b (25) compared with Elm2.4ME+ PL111a (25)
--------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix crash on parse failure on command
"View digest as mailbox".
***************
*** 346,352 ****
Changes of Elm2.4ME+ PL111a (25) compared with Elm2.4ME+ PL111 (25)
-------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes crash caused by 'U' command
on aliases menu.

--- 476,482 ----


Changes of Elm2.4ME+ PL111a (25) compared with Elm2.4ME+ PL111 (25)
-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes crash caused by 'U' command
on aliases menu.
***************
*** 429,435 ****
Changes of Elm2.4ME+ PL110a (25) compared with Elm2.4ME+ PL110 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes case, where output of pgp/gpg was
not shown sometimes (on non-MIME messages),

--- 559,565 ----


Changes of Elm2.4ME+ PL110a (25) compared with Elm2.4ME+ PL110 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes case, where output of pgp/gpg was
not shown sometimes (on non-MIME messages),
***************
*** 569,575 ****

Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)

-------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch fixes segmentation violation on

l)imit command and problem where user alias

--- 699,705 ----


Changes of Elm2.4ME+ PL109b (25) compared with Elm2.4ME+ PL109a (25)

-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes segmentation violation on

l)imit command and problem where user alias

***************
*** 585,591 ****


Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

-------------------------------------------------------------------

! [ This is out of branch patch. ]

Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

--- 715,721 ----


Changes of Elm2.4ME+ PL109a (25) compared with Elm2.4ME+ PL109 (25)

-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

Undo Elm2.4ME+ PL109S (25) patch before applying this patch.

***************
*** 814,820 ****

Changes of Elm2.4ME+ PL108a (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch makes some fixes for elmregister,

and elm's search command ('/').

--- 944,950 ----
Changes of Elm2.4ME+ PL108a (25) compared with Elm2.4ME+ PL108 (25)
------------------------------------------------------------------


! [ This patch is branch from the main line. ]

SUMMARY: This patch makes some fixes for elmregister,

and elm's search command ('/').

***************
*** 929,935 ****


Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch corrects page when returning
from o)ptions screen and fixes some other

--- 1059,1065 ----


Changes of Elm2.4ME+ PL107a (25) compared with Elm2.4ME+ PL107 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch corrects page when returning
from o)ptions screen and fixes some other

***************
*** 1242,1248 ****
Changes of Elm2.4ME+ PL102a (25) compared with Elm2.4ME+ PL102 (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes temp file leak
when forwarding with mimeforward = YES and

--- 1372,1378 ----


Changes of Elm2.4ME+ PL102a (25) compared with Elm2.4ME+ PL102 (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes temp file leak
when forwarding with mimeforward = YES and
***************
*** 1571,1577 ****

Changes of Elm2.4ME+ PL101c (25) compared with Elm2.4ME+ PL101b (25)

--------------------------------------------------------------------

! [ This is out of branch patch. ]

SUMMARY: This patch fixes segmentation fault, when


when viewing attachment with unxepected

--- 1701,1707 ----


Changes of Elm2.4ME+ PL101c (25) compared with Elm2.4ME+ PL101b (25)

--------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes segmentation fault, when


when viewing attachment with unxepected

***************
*** 1784,1790 ****


Changes of Elm2.4ME+ PL101b (25) compared with Elm2.4ME+ PL101a (25)

--------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch makes possible to set

incoming-mailbox = $USER@imap-sever on
--- 1914,1920 ----


Changes of Elm2.4ME+ PL101b (25) compared with Elm2.4ME+ PL101a (25)

--------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch makes possible to set

incoming-mailbox = $USER@imap-sever on
***************
*** 1832,1838 ****

Changes of Elm2.4ME+ PL101a (25) compared with Elm2.4ME+ PL101 (25)

-------------------------------------------------------------------

! [ This is out of branch patch. ]



SUMMARY: This patch fixes crash on internal mailcap parser

and on header editing screen.

--- 1962,1968 ----


Changes of Elm2.4ME+ PL101a (25) compared with Elm2.4ME+ PL101 (25)

-------------------------------------------------------------------

! [ This patch is branch from the main line. ]

SUMMARY: This patch fixes crash on internal mailcap parser

and on header editing screen.

***************
*** 2014,2020 ****
Changes of Elm2.4ME+ PL100a (25) compared with Elm2.4ME+ PL100 (25)
------------------------------------------------------------------


! [ This is out of branch patch. ]

- Configure did not generated mapping for iso_8859_1
locale (on SunOS).

--- 2144,2150 ----
Changes of Elm2.4ME+ PL100a (25) compared with Elm2.4ME+ PL100 (25)
------------------------------------------------------------------


! [ This patch is branch from the main line. ]

- Configure did not generated mapping for iso_8859_1
locale (on SunOS).
***************
*** 2341,2347 ****
Changes of Elm2.4ME+ PL99f (25) compared with Elm2.4ME+ PL99e (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix panic on header editing screen on In-Reply-To:
STRING PANIC in cs_binary.c:1043:cs_give_unicode_from_ascii

--- 2471,2477 ----


Changes of Elm2.4ME+ PL99f (25) compared with Elm2.4ME+ PL99e (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix panic on header editing screen on In-Reply-To:
STRING PANIC in cs_binary.c:1043:cs_give_unicode_from_ascii
***************
*** 2366,2372 ****
Changes of Elm2.4ME+ PL99e (25) compared with Elm2.4ME+ PL99d (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Trying send pgp2 (signed or encrypted) message
was causing crash.

--- 2496,2502 ----


Changes of Elm2.4ME+ PL99e (25) compared with Elm2.4ME+ PL99d (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Trying send pgp2 (signed or encrypted) message
was causing crash.
***************
*** 2394,2400 ****
Changes of Elm2.4ME+ PL99d (25) compared with Elm2.4ME+ PL99c (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- "I'm working on updating the Debian elm-me+ package; a
number of patches have accumulated over the years, and

--- 2524,2530 ----


Changes of Elm2.4ME+ PL99d (25) compared with Elm2.4ME+ PL99c (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "I'm working on updating the Debian elm-me+ package; a
number of patches have accumulated over the years, and
***************
*** 2475,2481 ****
Changes of Elm2.4ME+ PL99c (25) compared with Elm2.4ME+ PL99b (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Handling of multipart/signed and
multipart/encrypted was broken Elm2.4ME+ PL98 (25)

--- 2605,2611 ----


Changes of Elm2.4ME+ PL99c (25) compared with Elm2.4ME+ PL99b (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Handling of multipart/signed and
multipart/encrypted was broken Elm2.4ME+ PL98 (25)
***************
*** 2484,2490 ****
Changes of Elm2.4ME+ PL99b (25) compared with Elm2.4ME+ PL99a (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix panic with ISO-2022-JP text with message
STRING PANIC in cs_iso2022.c:1757:add_char_stream

--- 2614,2620 ----


Changes of Elm2.4ME+ PL99b (25) compared with Elm2.4ME+ PL99a (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix panic with ISO-2022-JP text with message
STRING PANIC in cs_iso2022.c:1757:add_char_stream
***************
*** 2495,2501 ****
Changes of Elm2.4ME+ PL99a (25) compared with Elm2.4ME+ PL99 (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- There should not be Return-Path header visible
on Pre-Send screen on Beginner user level.

--- 2625,2631 ----


Changes of Elm2.4ME+ PL99a (25) compared with Elm2.4ME+ PL99 (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- There should not be Return-Path header visible
on Pre-Send screen on Beginner user level.
***************
*** 2744,2750 ****
Changes of Elm2.4ME+ PL98c (25) compared with Elm2.4ME+ PL98b (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- copy_message_2() lost header name when folding happeded
immediately after header name (that specially was visible

--- 2874,2880 ----


Changes of Elm2.4ME+ PL98c (25) compared with Elm2.4ME+ PL98b (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- copy_message_2() lost header name when folding happeded
immediately after header name (that specially was visible
***************
*** 2767,2773 ****
Changes of Elm2.4ME+ PL98b (25) compared with Elm2.4ME+ PL98a (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Our non-standard headers was ignored:
* X-ELM-OSV: hdr-charset=xxxx was ignored

--- 2897,2903 ----


Changes of Elm2.4ME+ PL98b (25) compared with Elm2.4ME+ PL98a (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Our non-standard headers was ignored:
* X-ELM-OSV: hdr-charset=xxxx was ignored
***************
*** 2776,2782 ****
Changes of Elm2.4ME+ PL98a (25) compared with Elm2.4ME+ PL98 (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- "since a number of releases frm doesn't detect status
new correctly for me (Linux 2.4.18, elm2.4.ME+.98)."

--- 2906,2912 ----


Changes of Elm2.4ME+ PL98a (25) compared with Elm2.4ME+ PL98 (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "since a number of releases frm doesn't detect status
new correctly for me (Linux 2.4.18, elm2.4.ME+.98)."
***************
*** 2969,2975 ****
Changes of Elm2.4ME+ PL97d (25) compared with Elm2.4ME+ PL97c (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]


- If there libintl.so (from GNU gettext) installed

--- 3099,3105 ----


Changes of Elm2.4ME+ PL97d (25) compared with Elm2.4ME+ PL97c (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]


- If there libintl.so (from GNU gettext) installed
***************
*** 3002,3008 ****
Changes of Elm2.4ME+ PL97c (25) compared with Elm2.4ME+ PL97b (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- Wrong answer to question "Any additional libraries"
causes failure on "Trying locate terminfo routines"

--- 3132,3138 ----


Changes of Elm2.4ME+ PL97c (25) compared with Elm2.4ME+ PL97b (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Wrong answer to question "Any additional libraries"
causes failure on "Trying locate terminfo routines"
***************
*** 3052,3058 ****
Changes of Elm2.4ME+ PL97b (25) compared with Elm2.4ME+ PL97a (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]

- binary flag was incorrectly set true (result on change
on Elm2.4ME+ PL97 (25)). That caused that EOLN mail headers

--- 3182,3188 ----


Changes of Elm2.4ME+ PL97b (25) compared with Elm2.4ME+ PL97a (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- binary flag was incorrectly set true (result on change
on Elm2.4ME+ PL97 (25)). That caused that EOLN mail headers
***************
*** 3065,3071 ****

Changes of Elm2.4ME+ PL97a (25) compared with Elm2.4ME+ PL97 (25)
----------------------------------------------------------------

! [ This is out of branch patch. ]



- Fix state_printf panic "Embedded newlines are not supported"
on case when there is on ~/.elm/elmheaders

--- 3195,3201 ----


Changes of Elm2.4ME+ PL97a (25) compared with Elm2.4ME+ PL97 (25)
----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix state_printf panic "Embedded newlines are not supported"
on case when there is on ~/.elm/elmheaders

***************
*** 3195,3201 ****
Changes of Elm2.4ME+ PL96b (25) compared with Elm2.4ME+ PL96a (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- Test whatever make sets $(MAKE)

--- 3325,3331 ----


Changes of Elm2.4ME+ PL96b (25) compared with Elm2.4ME+ PL96a (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Test whatever make sets $(MAKE)

***************
*** 3225,3231 ****
Changes of Elm2.4ME+ PL96a (25) compared with Elm2.4ME+ PL96 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- Metamail can not cope with CRLF
Problem noted by: Konstantinos Konstantinides <k...@corp.cirrus.com>

--- 3355,3361 ----


Changes of Elm2.4ME+ PL96a (25) compared with Elm2.4ME+ PL96 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Metamail can not cope with CRLF
Problem noted by: Konstantinos Konstantinides <k...@corp.cirrus.com>
***************
*** 3424,3430 ****

Changes of Elm2.4ME+ PL95c (25) compared with Elm2.4ME+ PL95b (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]



- Do not use commands "mail" or "mailx" as mailer.
- Allow specify "none" as mailer on configuration time

--- 3554,3560 ----


Changes of Elm2.4ME+ PL95c (25) compared with Elm2.4ME+ PL95b (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Do not use commands "mail" or "mailx" as mailer.
- Allow specify "none" as mailer on configuration time

***************
*** 3440,3446 ****
Changes of Elm2.4ME+ PL95b (25) compared with Elm2.4ME+ PL95a (25)
------------------------------------------------------------------

! [ This is out of branch patch. ]

- "Using PL95 with the two patches you send me, I encountered the

following problem when searching for a string in a mail message:
--- 3570,3576 ----


Changes of Elm2.4ME+ PL95b (25) compared with Elm2.4ME+ PL95a (25)
------------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Using PL95 with the two patches you send me, I encountered the
following problem when searching for a string in a mail message:
***************
*** 3458,3464 ****
Changes of Elm2.4ME+ PL95a (25) compared with Elm2.4ME+ PL95 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- "Following please find the error when trying to
compile elm2.4.ME+.95 on AIX 4.3.3 (maintenance level 09):

--- 3588,3594 ----


Changes of Elm2.4ME+ PL95a (25) compared with Elm2.4ME+ PL95 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Following please find the error when trying to
compile elm2.4.ME+.95 on AIX 4.3.3 (maintenance level 09):
***************
*** 3766,3772 ****
Changes of Elm2.4ME+ PL94a (25) compared with Elm2.4ME+ PL94 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- When sending mail, saving copy of mail to folder
failed when

--- 3896,3902 ----


Changes of Elm2.4ME+ PL94a (25) compared with Elm2.4ME+ PL94 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- When sending mail, saving copy of mail to folder
failed when
***************
*** 3970,3976 ****
Changes of Elm2.4ME+ PL92a (25) compared with Elm2.4ME+ PL92 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- "Until I did this I could not get it to build correctly on
solaris 8 (even if I didn't want to use the sharedlibs --

--- 4100,4106 ----


Changes of Elm2.4ME+ PL92a (25) compared with Elm2.4ME+ PL92 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Until I did this I could not get it to build correctly on
solaris 8 (even if I didn't want to use the sharedlibs --
***************
*** 4206,4212 ****
Changes of Elm2.4ME+ PL90a (25) compared with Elm2.4ME+ PL90
------------------------------------------------------------

! [ This is out of branch patch. ]

- "Running Elm 2.4ME+86, if I displayed the first 80% of
a message using the built-in text browser, pressing

--- 4336,4342 ----


Changes of Elm2.4ME+ PL90a (25) compared with Elm2.4ME+ PL90
------------------------------------------------------------

! [ This patch is branch from the main line. ]

- "Running Elm 2.4ME+86, if I displayed the first 80% of
a message using the built-in text browser, pressing
***************
*** 4346,4352 ****
Changes of Elm2.4ME+ PL88a (25) compared with Elm2.4ME+ PL88 (25)
-----------------------------------------------------------------

! [ This is out of branch patch. ]

- In newmail.c and from.c utilities header_charset
was not set.

--- 4476,4482 ----


Changes of Elm2.4ME+ PL88a (25) compared with Elm2.4ME+ PL88 (25)
-----------------------------------------------------------------

! [ This patch is branch from the main line. ]

- In newmail.c and from.c utilities header_charset
was not set.
***************
*** 4614,4620 ****

Changes of Elm2.4ME+ PL84a (25) compared with Elm2.4ME+ PL84 (25)
-----------------------------------------------------------------
! [ This is out of branch patch. ]

- 'struct string * ret' was incorrectly static on
browser_descend_imap(). That caused Elm to crash,

--- 4744,4750 ----



Changes of Elm2.4ME+ PL84a (25) compared with Elm2.4ME+ PL84 (25)
-----------------------------------------------------------------
! [ This patch is branch from the main line. ]

- 'struct string * ret' was incorrectly static on
browser_descend_imap(). That caused Elm to crash,
***************
*** 5357,5363 ****

Changes of Elm2.4ME+ PL76a (25) compared with Elm2.4ME+ PL76 (25)
-----------------------------------------------------------------
! [ This is out of branch patch. ]

- On PL73 [encode] was producing (by mistake)
text/X-ELM-encode instead of application/X-ELM-encode as

--- 5487,5493 ----



Changes of Elm2.4ME+ PL76a (25) compared with Elm2.4ME+ PL76 (25)
-----------------------------------------------------------------
! [ This patch is branch from the main line. ]

- On PL73 [encode] was producing (by mistake)
text/X-ELM-encode instead of application/X-ELM-encode as
***************
*** 6716,6722 ****
Changes of Elm2.4ME+ PL53Y (25) compared with Elm2.4ME+ PL53 (25)
---------------------------------------------------------------

! [ This is out of branch patch. ]

- Test that year >= 0 instead of year > 0 on
cvt_yearstr_to_yearnum(). That affects if

--- 6846,6852 ----


Changes of Elm2.4ME+ PL53Y (25) compared with Elm2.4ME+ PL53 (25)
---------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Test that year >= 0 instead of year > 0 on
cvt_yearstr_to_yearnum(). That affects if
***************
*** 6868,6874 ****
Changes of Elm2.4ME+ PL50s (25) compared with Elm2.4ME+ PL50 (25)
--------------------------------------------------------------

! [ This is out of branch patch. ]

- Fix incorrect bound checking on putc_so_string()
(state.c)

--- 6998,7004 ----


Changes of Elm2.4ME+ PL50s (25) compared with Elm2.4ME+ PL50 (25)
--------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Fix incorrect bound checking on putc_so_string()
(state.c)
***************
*** 7509,7515 ****
Changes of Elm2.4ME+ PL31H (25) compared with Elm2.4ME+ PL31 (25)
---------------------------------------------------------------

! [ This is out of branch patch. ]

- Incorrect Content-length: -header was causing corruption
of folders.

--- 7639,7645 ----


Changes of Elm2.4ME+ PL31H (25) compared with Elm2.4ME+ PL31 (25)
---------------------------------------------------------------

! [ This patch is branch from the main line. ]

- Incorrect Content-length: -header was causing corruption
of folders.

Index: elm2.4.ME+.116-cvs/doc/elmrc-info
*** elm2.4.ME+.115/doc/elmrc-info 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.116-cvs/doc/elmrc-info 2004-05-01 22:08:18.000000000 +0300
***************
*** 1,4 ****


! #@(#)$Id: elmrc-info,v 1.61 2004/04/04 16:42:27 hurtta Exp $
# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.62 2004/05/01 19:08:18 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************

*** 152,157 ****
--- 152,160 ----



weedout
# what headers I DON'T want to see, ever.
+ #
+ # If first element on list is "*clear-weed-list*" then builtin
+ # weedout list is not used.

bounceback
# threshold for bouncing copies of remote uucp messages...

Index: elm2.4.ME+.116-cvs/doc/elmregister.1
*** elm2.4.ME+.115/doc/elmregister.1 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.116-cvs/doc/elmregister.1 2004-05-02 15:38:13.000000000 +0300
***************
*** 26,31 ****
--- 26,33 ----
.br
.B #LIB#/elmregister copy
.br
+ .B #LIB#/elmregister copydoc
+ .br
.B #LIB#/elmregister
.I command

***************
*** 105,108 ****
.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 2003 by Kari Hurtta
--- 107,110 ----
.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 2003, 2004 by Kari Hurtta
Index: elm2.4.ME+.116-cvs/doc/Makefile.SH
*** elm2.4.ME+.115/doc/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.116-cvs/doc/Makefile.SH 2004-05-02 15:38:13.000000000 +0300


***************
*** 17,23 ****
cat >Makefile <<!GROK!THIS!
#!$make
#

! # $Id: Makefile.SH,v 1.30 2004/01/03 20:12:28 hurtta Exp $


#
# Makefile for the documentation of the ELM mail system
#
--- 17,23 ----
cat >Makefile <<!GROK!THIS!
#!$make
#

! # $Id: Makefile.SH,v 1.31 2004/05/02 12:38:13 hurtta Exp $


#
# Makefile for the documentation of the ELM mail system
#
***************

*** 303,339 ****

# Dependencies and rules for installing man pages and lib files
$(MAN)/answer$(MANEXT): answer.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/checkalias$(MANEXT): chkalias.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elm$(MANEXT): elm.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elmalias$(MANEXT): elmalias.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elmcharset$(MANEXT): elmcharset.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elmrc-write$(MANEXT): elmrc-write.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elmterminal$(MANEXT): elmterminal.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elmunidata$(MANEXT): elmunidata.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elmbindata$(MANEXT): elmbindata.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/fastmail$(MANEXT): fastmail.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/frm$(MANEXT): frm.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/nfrm$(MANEXT): $(MAN)/frm$(MANEXT)
$(REG) link $? $@
--- 303,339 ----

# Dependencies and rules for installing man pages and lib files
$(MAN)/answer$(MANEXT): answer.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/checkalias$(MANEXT): chkalias.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elm$(MANEXT): elm.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elmalias$(MANEXT): elmalias.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elmcharset$(MANEXT): elmcharset.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elmrc-write$(MANEXT): elmrc-write.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elmterminal$(MANEXT): elmterminal.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elmunidata$(MANEXT): elmunidata.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elmbindata$(MANEXT): elmbindata.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/fastmail$(MANEXT): fastmail.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/frm$(MANEXT): frm.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/nfrm$(MANEXT): $(MAN)/frm$(MANEXT)


$(REG) link $? $@
***************

*** 342,375 ****
$(REG) link $? $@

$(MAN)/listalias$(MANEXT): listalias.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/messages$(MANEXT): messages.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/newalias$(MANEXT): newalias.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/newmail$(MANEXT): newmail.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/printmail$(MANEXT): printmail.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/readmsg$(MANEXT): readmsg.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elmstringconvert$(MANEXT): elmstringconvert.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/prlong$(MANEXT): prlong.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elmregister$(MANEXT): elmregister.1.subs
! $(REG) copy -m 444 $? $@

$(MAN)/elmlibregister$(MANEXT): elmlibregister.1.subs
! $(REG) copy -m 444 $? $@


$(MAN)/wnewmail$(MANEXT): $(MAN)/newmail$(MANEXT)
--- 342,375 ----
$(REG) link $? $@

$(MAN)/listalias$(MANEXT): listalias.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/messages$(MANEXT): messages.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/newalias$(MANEXT): newalias.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/newmail$(MANEXT): newmail.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/printmail$(MANEXT): printmail.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/readmsg$(MANEXT): readmsg.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elmstringconvert$(MANEXT): elmstringconvert.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/prlong$(MANEXT): prlong.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elmregister$(MANEXT): elmregister.1.subs
! $(REG) copydoc -m 444 $? $@

$(MAN)/elmlibregister$(MANEXT): elmlibregister.1.subs
! $(REG) copydoc -m 444 $? $@


$(MAN)/wnewmail$(MANEXT): $(MAN)/newmail$(MANEXT)
***************
*** 392,446 ****

# Dependencies and rules for installing catman
$(CATMAN)/answer$(CATMANEXT)$(SUFFIX): catman/answer$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/checkalias$(CATMANEXT)$(SUFFIX): catman/checkalias$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/elm$(CATMANEXT)$(SUFFIX): catman/elm$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/elmalias$(CATMANEXT)$(SUFFIX): catman/elmalias$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/elmcharset$(CATMANEXT)$(SUFFIX): catman/elmcharset$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/elmrc-write$(CATMANEXT)$(SUFFIX): catman/elmrc-write$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/elmunidata$(CATMANEXT)$(SUFFIX): catman/elmunidata$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/elmbindata$(CATMANEXT)$(SUFFIX): catman/elmbindata$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/elmterminal$(CATMANEXT)$(SUFFIX): catman/elmterminal$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/fastmail$(CATMANEXT)$(SUFFIX): catman/fastmail$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/frm$(CATMANEXT)$(SUFFIX): catman/frm$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/listalias$(CATMANEXT)$(SUFFIX): catman/listalias$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/messages$(CATMANEXT)$(SUFFIX): catman/messages$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/newalias$(CATMANEXT)$(SUFFIX): catman/newalias$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/newmail$(CATMANEXT)$(SUFFIX): catman/newmail$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/printmail$(CATMANEXT)$(SUFFIX): catman/printmail$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/readmsg$(CATMANEXT)$(SUFFIX): catman/readmsg$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@
$(CHMOD) u=rw,go=r $@

$(CATMAN)/wnewmail$(CATMANEXT)$(SUFFIX): $(CATMAN)/newmail$(CATMANEXT)$(SUFFIX)
--- 392,446 ----

# Dependencies and rules for installing catman
$(CATMAN)/answer$(CATMANEXT)$(SUFFIX): catman/answer$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/checkalias$(CATMANEXT)$(SUFFIX): catman/checkalias$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elm$(CATMANEXT)$(SUFFIX): catman/elm$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmalias$(CATMANEXT)$(SUFFIX): catman/elmalias$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmcharset$(CATMANEXT)$(SUFFIX): catman/elmcharset$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmrc-write$(CATMANEXT)$(SUFFIX): catman/elmrc-write$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmunidata$(CATMANEXT)$(SUFFIX): catman/elmunidata$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmbindata$(CATMANEXT)$(SUFFIX): catman/elmbindata$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmterminal$(CATMANEXT)$(SUFFIX): catman/elmterminal$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/fastmail$(CATMANEXT)$(SUFFIX): catman/fastmail$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/frm$(CATMANEXT)$(SUFFIX): catman/frm$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/listalias$(CATMANEXT)$(SUFFIX): catman/listalias$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/messages$(CATMANEXT)$(SUFFIX): catman/messages$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/newalias$(CATMANEXT)$(SUFFIX): catman/newalias$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/newmail$(CATMANEXT)$(SUFFIX): catman/newmail$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/printmail$(CATMANEXT)$(SUFFIX): catman/printmail$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/readmsg$(CATMANEXT)$(SUFFIX): catman/readmsg$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@
$(CHMOD) u=rw,go=r $@

$(CATMAN)/wnewmail$(CATMANEXT)$(SUFFIX): $(CATMAN)/newmail$(CATMANEXT)$(SUFFIX)
***************
*** 453,468 ****
$(REG) link $? $@

$(CATMAN)/elmstringconvert$(CATMANEXT)$(SUFFIX): catman/elmstringconvert$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/prlong$(CATMANEXT)$(SUFFIX): catman/prlong$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/elmregister$(CATMANEXT)$(SUFFIX): catman/elmregister$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@

$(CATMAN)/elmlibregister$(CATMANEXT)$(SUFFIX): catman/elmlibregister$(CATMANEXT)$(SUFFIX)
! $(REG) copy -m 444 $? $@



# Dependencies and rules for making catman pages
catman/answer$(CATMANEXT)$(SUFFIX): answer.1.subs

--- 453,468 ----
$(REG) link $? $@

$(CATMAN)/elmstringconvert$(CATMANEXT)$(SUFFIX): catman/elmstringconvert$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/prlong$(CATMANEXT)$(SUFFIX): catman/prlong$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmregister$(CATMANEXT)$(SUFFIX): catman/elmregister$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmlibregister$(CATMANEXT)$(SUFFIX): catman/elmlibregister$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@



# Dependencies and rules for making catman pages
catman/answer$(CATMANEXT)$(SUFFIX): answer.1.subs

Index: elm2.4.ME+.116-cvs/hdrs/defs.h
*** elm2.4.ME+.115/hdrs/defs.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/hdrs/defs.h 2004-05-01 16:18:50.000000000 +0300
***************
*** 1,7 ****
! /* $Id: defs.h,v 1.45 2004/03/27 18:31:35 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: defs.h,v 1.46 2004/05/01 13:18:50 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 576,586 ****


long length; /* length of alias data on file */
};

- struct addr_rec {
- char address[NLEN]; /* machine!user you get mail as */
- struct addr_rec *next; /* linked list pointer to next */
- };
-

#ifdef SHORTNAMES /* map long names to shorter ones */

# include <shortname.h>
--- 576,581 ----
Index: elm2.4.ME+.116-cvs/hdrs/elmlib.h
*** elm2.4.ME+.115/hdrs/elmlib.h 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.116-cvs/hdrs/elmlib.h 2004-05-01 22:08:18.000000000 +0300
***************
*** 1,7 ****


! /* $Id: elmlib.h,v 1.207 2004/04/04 06:17:17 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.209 2004/05/01 19:08:18 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.209 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 725,731 ****


From: -header
*/
extern char alternative_editor[SLEN];/* the 'other' editor */

! extern struct addr_rec *alternative_addresses; /* how else do we get mail? */
extern int always_del; /* flag: always delete marked msgs? */
extern int always_keep; /* flag: always keep unread msgs? */
extern int always_store; /* flag: always store read mail? */
--- 725,731 ----


From: -header
*/
extern char alternative_editor[SLEN];/* the 'other' editor */

! extern PATH alternative_addresses; /* how else do we get mail? */
extern int always_del; /* flag: always delete marked msgs? */
extern int always_keep; /* flag: always keep unread msgs? */
extern int always_store; /* flag: always store read mail? */


***************
*** 912,919 ****
extern char v_editor[SLEN]; /* "~v" editor... */
extern int elm_filter; /* flag: weed out header lines? */
extern int send_mime_plain; /* Send text/plain US-ASCII as MIME? */
! extern char *weedlist[MAX_IN_WEEDLIST];
! extern int weedcount; /* how many headers to check? */
#ifdef REMOTE_MBX

extern char raw_imap_charset[SLEN]; /* IMAP foldername charset */
extern int imap_fast_lookup; /* flag: skip directory listing */
--- 912,919 ----


extern char v_editor[SLEN]; /* "~v" editor... */
extern int elm_filter; /* flag: weed out header lines? */
extern int send_mime_plain; /* Send text/plain US-ASCII as MIME? */
! extern PATH weedlist;
!
#ifdef REMOTE_MBX

extern char raw_imap_charset[SLEN]; /* IMAP foldername charset */
extern int imap_fast_lookup; /* flag: skip directory listing */
Index: elm2.4.ME+.116-cvs/hdrs/headers.h
*** elm2.4.ME+.115/hdrs/headers.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/hdrs/headers.h 2004-05-19 14:52:30.000000000 +0300
***************
*** 1,7 ****
! /* $Id: headers.h,v 1.24 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: headers.h,v 1.25 2004/05/19 11:52:30 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 35,83 ****


extern int sendmail_verbose; /* Allow extended debugging on sendmail */

extern int nucurr; /** change list or just the current pointer **/

-
-

extern char cur_editfile[SLEN]; /* editor buffer */

extern char defaultfile[SLEN]; /* name of default folder */

-
-
-
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
-

extern char batch_subject[SLEN];/* subject buffer for batchmail */

extern char included_file[SLEN];/* name of file to place in edit buf */

-
-
-

extern char version_buff[NLEN]; /* version buffer */

-
-
-

extern char *def_ans_yes; /* default yes answer - single char, lc */

extern char *def_ans_no; /* default no answer - single char, lc */

extern char *nls_deleted; /* [deleted] */

--- 35,48 ----
***************
*** 104,155 ****

extern int has_highlighting; /* highlighting available? */

-
-
-
-

-
-
-
-
-

extern int write_elmrc; /* flag: write elmrc in starting */

-
-
-
-

-
-
-
-
-
-

extern int mail_only; /* flag: send mail then leave? */

extern int check_only; /* flag: check aliases and leave? */

extern int batch_only; /* flag: send without prompting? */

-

extern long size_of_pathfd; /** size of pathfile, 0 if none **/




extern FILE *pathfd; /* path alias file */

extern FILE *domainfd; /* domains file */

-
-
-
-

extern int system_data; /* fileno of system data file */

extern int user_data; /* fileno of user data file */

-
-
-
-

-
-
-
#ifdef USE_PGP

extern int pgp_status;
--- 69,89 ----
Index: elm2.4.ME+.116-cvs/hdrs/mbx_imp.h
*** elm2.4.ME+.115/hdrs/mbx_imp.h 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.116-cvs/hdrs/mbx_imp.h 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****


! /* $Id: mbx_imp.h,v 1.66 2004/04/04 06:17:17 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: mbx_imp.h,v 1.67 2004/04/24 12:30:02 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 749,758 ****
#define STFLAG_is_submission 0x0400
#define STFLAG_is_smtp 0x0800

! extern const struct service_type * IMAP_SERVICE;
! extern const struct service_type * POP_SERVICE;
! extern const struct service_type * SUBMISSION_SERVICE;
! extern const struct service_type * SMTP_SERVICE;

extern struct service_entry {
int flags;
--- 749,758 ----
#define STFLAG_is_submission 0x0400
#define STFLAG_is_smtp 0x0800

! extern CONST struct service_type * IMAP_SERVICE;
! extern CONST struct service_type * POP_SERVICE;
! extern CONST struct service_type * SUBMISSION_SERVICE;
! extern CONST struct service_type * SMTP_SERVICE;

extern struct service_entry {
int flags;

Index: elm2.4.ME+.116-cvs/hdrs/me.h
*** elm2.4.ME+.115/hdrs/me.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/hdrs/me.h 2004-05-02 14:15:26.000000000 +0300
***************
*** 1,7 ****
! /* $Id: me.h,v 1.87 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.89 2004/05/02 11:15:26 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.89 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 119,124 ****
--- 119,135 ----
int *redraw,
struct menu_context *page));

+ #define PROMPT_center 1
+ #define PROMPT_yesno 2
+ #define PROMPT_redraw_mark 4
+ #define PROMTP_ctrlL 8
+

+ extern int prompt_letter P_((int line, char *letters, int def,


+ int flags,
+ struct menu_context *page,

+ const char * format, const char *msg, ...));
+
+

#define OE_APPEND_CURRENT (1<<0)
#define OE_PASSWD (1<<1)
#define OE_REDRAW_MARK (1<<2)

Index: elm2.4.ME+.116-cvs/hdrs/rc_imp.h
*** elm2.4.ME+.115/hdrs/rc_imp.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/hdrs/rc_imp.h 2004-05-01 22:08:18.000000000 +0300
***************
*** 1,7 ****
! /* $Id: rc_imp.h,v 1.10 2004/03/28 13:37:38 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: rc_imp.h,v 1.12 2004/05/01 19:08:18 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

Index: elm2.4.ME+.116-cvs/hdrs/save_opts.h
*** elm2.4.ME+.115/hdrs/save_opts.h 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.116-cvs/hdrs/save_opts.h 2004-05-01 22:08:19.000000000 +0300
***************
*** 1,7 ****


! /* @(#)$Id: save_opts.h,v 1.82 2004/04/04 16:42:27 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.82 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* @(#)$Id: save_opts.h,v 1.84 2004/05/01 19:08:19 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.84 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 48,54 ****
#define PATH_sep_comma 64
#define PATH_sep_colon 128
#define PATH_quote_single 256
!

struct dt_path_info {
int flags;

--- 48,54 ----


#define PATH_sep_comma 64
#define PATH_sep_colon 128
#define PATH_quote_single 256
! #define PATH_convert_underline 512

struct dt_path_info {
int flags;
***************
*** 84,93 ****
long *l_num;
int *bol;
char *chr;
- char **weed;
- struct addr_rec **alts;
int *sort;
struct dt_path_info *path;
#ifdef USE_PGP
enum pgp_version *pgpver;
#endif

--- 84,92 ----


long *l_num;
int *bol;
char *chr;
int *sort;
struct dt_path_info *path;
+ char **mlt;
#ifdef USE_PGP
enum pgp_version *pgpver;
#endif
***************
*** 116,125 ****
#define ZZZ_DT_SRT(A) DT_SRT,0, { sort: A }, null_option_func
#define ZZZ_DT_STR(A) DT_STR,0, { str: A }, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x, { str: A }, null_option_func
- #define ZZZ_DT_ALT(A) DT_ALT,0, { alts: A }, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL,0, { bol: A }, null_option_func
#define ZZZ_DT_BOL_(x,A) DT_BOL,x, { bol: A }, null_option_func

! #define ZZZ_DT_MLT(A) DT_MLT,0, { weed: A }, null_option_func


#define ZZZ_DT_SYN(A) DT_SYN,0, { str: A }, null_option_func
#define ZZZ_DT_NUM(A) DT_NUM,0, { num: A }, null_option_func

#define ZZZ_DT_NUM_(x,A) DT_NUM,x, { num: A }, null_option_func

--- 115,123 ----


#define ZZZ_DT_SRT(A) DT_SRT,0, { sort: A }, null_option_func
#define ZZZ_DT_STR(A) DT_STR,0, { str: A }, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x, { str: A }, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL,0, { bol: A }, null_option_func
#define ZZZ_DT_BOL_(x,A) DT_BOL,x, { bol: A }, null_option_func

! #define ZZZ_DT_MLT(A) DT_MLT,0, { mlt: A }, null_option_func


#define ZZZ_DT_SYN(A) DT_SYN,0, { str: A }, null_option_func
#define ZZZ_DT_NUM(A) DT_NUM,0, { num: A }, null_option_func

#define ZZZ_DT_NUM_(x,A) DT_NUM,x, { num: A }, null_option_func

***************
*** 131,137 ****
#define ZZZ_DT_FUNC_(x,A) DT_FUNC,x, { str: NULL }, A
#define ZZZ_DT_CHR(A) &rc_DT_CHR,0, { chr: A }, null_option_func
#define ZZZ_DT_PRM(A) DT_PRM,0, { num: A }, null_option_func
- #define ZZZ_DT_WEE(A) DT_WEE,0, { weed: A }, null_option_func
#define ZZZ_DT_PATH(A) &rc_DT_PATH,0, { path: A }, null_option_func
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, { str: NULL }, null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, { shared: A }, null_option_func

--- 129,134 ----


***************
*** 158,164 ****
#define ZZZ_DT_SRT(A) DT_SRT, 0,(char *)A, null_option_func
#define ZZZ_DT_STR(A) DT_STR, 0,A, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x,A, null_option_func
- #define ZZZ_DT_ALT(A) DT_ALT, 0,(char *)A, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL, 0,(char *)A, null_option_func
#define ZZZ_DT_BOL_(x,A) DT_BOL,x,(char *)A, null_option_func

#define ZZZ_DT_MLT(A) DT_MLT,0,(char *)A, null_option_func

--- 155,160 ----


***************
*** 173,179 ****
#define ZZZ_DT_FUNC_(x,A) DT_FUNC,x,NULL, A
#define ZZZ_DT_CHR(A) &rc_DT_CHR,0,(char *)A, null_option_func
#define ZZZ_DT_PRM(A) DT_PRM,0,(char *)A, null_option_func
- #define ZZZ_DT_WEE(A) DT_WEE,0,(char *)A, null_option_func
#define ZZZ_DT_PATH(A) &rc_DT_PATH,0, (char *)A, null_option_func
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, NULL , null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, (char *)A, null_option_func

--- 169,174 ----
***************
*** 249,255 ****


NULL},
{"alteditor", -1L,ZZZ_DT_STR(alternative_editor),
sizeof alternative_editor, NULL},
! {"alternatives", -1L,ZZZ_DT_ALT(&alternative_addresses), 0, NULL},
{"alwaysdelete", -1L,ZZZ_DT_BOL(&always_del), 0, NULL},
{"alwayskeep", -1L,ZZZ_DT_BOL(&always_keep), 0, NULL},

{"alwaysleave", -1L,ZZZ_DT_MLT(ALWAYS), 0, NULL},

--- 244,250 ----


NULL},
{"alteditor", -1L,ZZZ_DT_STR(alternative_editor),
sizeof alternative_editor, NULL},

! {"alternatives", -1L,ZZZ_DT_PATH(&alternative_addresses), 0, NULL},
{"alwaysdelete", -1L,ZZZ_DT_BOL(&always_del), 0, NULL},
{"alwayskeep", -1L,ZZZ_DT_BOL(&always_keep), 0, NULL},

{"alwaysleave", -1L,ZZZ_DT_MLT(ALWAYS), 0, NULL},
***************


*** 496,502 ****
{"utf7-encode-optional", -1L,ZZZ_DT_BOL(&utf7_encode_optional), 0, NULL},
{"visualeditor", -1L,ZZZ_DT_STR(v_editor), sizeof v_editor, NULL},
{"weed", -1L,ZZZ_DT_BOL(&elm_filter), 0, NULL},
! {"weedout", -1L,ZZZ_DT_WEE(weedlist), 0, NULL},
};
int NUMBER_OF_SAVEABLE_OPTIONS=(sizeof(save_info_data)/sizeof(ZZZ_SAVE_TYPE));
save_info_recs *save_info = (save_info_recs *) save_info_data;

--- 491,497 ----


{"utf7-encode-optional", -1L,ZZZ_DT_BOL(&utf7_encode_optional), 0, NULL},
{"visualeditor", -1L,ZZZ_DT_STR(v_editor), sizeof v_editor, NULL},
{"weed", -1L,ZZZ_DT_BOL(&elm_filter), 0, NULL},
! {"weedout", -1L,ZZZ_DT_PATH(&weedlist), 0, NULL},
};
int NUMBER_OF_SAVEABLE_OPTIONS=(sizeof(save_info_data)/sizeof(ZZZ_SAVE_TYPE));
save_info_recs *save_info = (save_info_recs *) save_info_data;

Index: elm2.4.ME+.116-cvs/hdrs/s_elm.h
*** elm2.4.ME+.115/hdrs/s_elm.h 2004-03-16 21:17:43.000000000 +0200
--- elm2.4.ME+.116-cvs/hdrs/s_elm.h 2004-05-01 22:08:19.000000000 +0300
***************


*** 476,484 ****
#define ElmBadLineElmrc 0x230
#define ElmBatchNoticeFoldersDir 0x231
#define ElmNoticeFoldersDir 0x232
- #define ElmTooManyWeedHeaders 0x233
- #define ElmTooManyWeedPmalloc 0x234
- #define ElmNoMemDefaultWeed 0x235
#define ElmCannotInitErrorExpanding 0x236
#define ElmCouldntMakeTempFileName 0x237
#define ElmCouldntOpenForWriting 0x238
--- 476,481 ----
***************
*** 1097,1099 ****

--- 1094,1097 ----


#define ElmCharsetBadOverride 0x865
#define ElmObsoleteInElmrc 0x866
#define ElmPgpRcvSure 0x867
+ #define ElmFailedLeaveChange 0x868

Index: elm2.4.ME+.116-cvs/lib/bindata.c
*** elm2.4.ME+.115/lib/bindata.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/bindata.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: bindata.c,v 1.4 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: bindata.c,v 1.5 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/


***************
*** 744,750 ****
struct bindata_format_1 *v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];

! const char *filename;
{


int status = 0,i;
struct csets_1 *y;

--- 744,750 ----


struct bindata_format_1 *v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];

! CONST char *filename;
{


int status = 0,i;
struct csets_1 *y;
***************
*** 793,799 ****
struct bindata_mapped_data * v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];

! const char *filename;
{
int r = 0;

--- 793,799 ----


struct bindata_mapped_data * v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];

! CONST char *filename;
{


int r = 0;

***************
*** 988,994 ****

/* bzero is defined on hdrs/defs.h

*/

! bzero(ret, sizeof (*ret));

ret->format = bindata_format_1;
ret->v.f1.header = v;

--- 988,994 ----


/* bzero is defined on hdrs/defs.h

*/

! bzero((void *)ret, sizeof (*ret));

ret->format = bindata_format_1;
ret->v.f1.header = v;
***************
*** 999,1005 ****

struct bindata_map * give_mapping(v,mapname)
struct bindata_mapped_data *v;
! const char *mapname;
{

struct bindata_map *ret = NULL;

--- 999,1005 ----

struct bindata_map * give_mapping(v,mapname)
struct bindata_mapped_data *v;
! CONST char *mapname;
{


struct bindata_map *ret = NULL;

Index: elm2.4.ME+.116-cvs/lib/cs_iso2022.c
*** elm2.4.ME+.115/lib/cs_iso2022.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/cs_iso2022.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.35 2004/03/27 18:31:38 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.36 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1078,1084 ****
S_(cs_add_intdata_to_string cs_add_intdata_to_iso2022_gen)
static void cs_add_intdata_to_iso2022_gen(str,data)
struct string *str;
! const struct string *data;
{
int i;
struct mb_data * X1 = str->p->a.data;
--- 1078,1084 ----
S_(cs_add_intdata_to_string cs_add_intdata_to_iso2022_gen)
static void cs_add_intdata_to_iso2022_gen(str,data)
struct string *str;
! CONST struct string *data;
{
int i;
struct mb_data * X1 = str->p->a.data;
***************
*** 1229,1235 ****

S_(cs_give_unicode_from_string cs_give_unicode_from_iso2022_gen)
static uint16 cs_give_unicode_from_iso2022_gen(str,pos,found)

! const struct string *str;

int pos;
int *found;
{
--- 1229,1235 ----

S_(cs_give_unicode_from_string cs_give_unicode_from_iso2022_gen)
static uint16 cs_give_unicode_from_iso2022_gen(str,pos,found)

! CONST struct string *str;

int pos;
int *found;
{
***************
*** 1421,1427 ****
static void cs_add_unicodedata_to_iso2022_gen(str,len,data)
struct string *str;
int len;
! const uint16 *data;
{
int i;

--- 1421,1427 ----
static void cs_add_unicodedata_to_iso2022_gen(str,len,data)
struct string *str;
int len;
! CONST uint16 *data;
{
int i;

***************
*** 3436,3442 ****
S_(cs_clip_from_string cs_clip_from_iso2022_gen)
static void cs_clip_from_iso2022_gen(ret,str,pos,len)
struct string *ret;

! const struct string *str;

int *pos;

int len;
{
--- 3436,3442 ----

S_(cs_clip_from_string cs_clip_from_iso2022_gen)
static void cs_clip_from_iso2022_gen(ret,str,pos,len)
struct string *ret;

! CONST struct string *str;

int *pos;
int len;
{
***************
*** 3544,3550 ****
static int cs_add_streambytes_to_iso2022_gen(str,count,data)
struct string *str;
int count;
! const unsigned char *data;
{
int i = 0;
struct state_iso2022 * X ;
--- 3544,3550 ----
static int cs_add_streambytes_to_iso2022_gen(str,count,data)
struct string *str;
int count;
! CONST unsigned char *data;
{
int i = 0;
struct state_iso2022 * X ;

Index: elm2.4.ME+.116-cvs/lib/headers.c
*** elm2.4.ME+.115/lib/headers.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/headers.c 2004-05-15 18:51:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: headers.c,v 1.29 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: headers.c,v 1.31 2004/05/15 15:51:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 158,163 ****
--- 158,167 ----
} else if ('<' == tokens[i][0]) {
int j;

+ /* Add mising space wetween phrase and < > */

Index: elm2.4.ME+.116-cvs/lib/localmbx.c
*** elm2.4.ME+.115/lib/localmbx.c 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/localmbx.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.64 2004/04/04 06:17:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.65 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.65 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

Index: elm2.4.ME+.116-cvs/lib/mbox.c
*** elm2.4.ME+.115/lib/mbox.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/mbox.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mbox.c,v 1.52 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 144,150 ****
*ptr));



/* bzero is defined hdrs/defs.h */

! bzero(*ptr,sizeof (struct read_folder_state));

(*ptr) -> magic = RF_magic;
(*ptr) -> fbytes = 0;

--- 144,150 ----
*ptr));



/* bzero is defined hdrs/defs.h */

! bzero((void *)*ptr,sizeof (struct read_folder_state));

(*ptr) -> magic = RF_magic;
(*ptr) -> fbytes = 0;
***************
*** 166,172 ****
*ptr));

/* bzero is defined hdrs/defs.h */

! bzero(*ptr,sizeof (struct read_folder_state));

free(*ptr);
*ptr = NULL;
--- 166,172 ----
*ptr));



/* bzero is defined hdrs/defs.h */

! bzero((void *)*ptr,sizeof (struct read_folder_state));

free(*ptr);
*ptr = NULL;
***************

*** 839,845 ****
new_folder = safe_malloc(sizeof (struct folder_info));

/* defined in hdrs/defs.h */
! bzero(new_folder,sizeof (struct folder_info));

new_folder -> p = NULL;
new_folder -> cur_folder_sys = NULL;

--- 839,845 ----


new_folder = safe_malloc(sizeof (struct folder_info));

/* defined in hdrs/defs.h */
! bzero((void *)new_folder,sizeof (struct folder_info));

new_folder -> p = NULL;
new_folder -> cur_folder_sys = NULL;

Index: elm2.4.ME+.116-cvs/lib/mediatype.c
*** elm2.4.ME+.115/lib/mediatype.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/mediatype.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.12 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.13 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 184,190 ****
}

enum mime_major_type give_major_type(major,create)

! const char * major;

int create;
{
int i;
--- 184,190 ----
}

enum mime_major_type give_major_type(major,create)

! CONST char * major;
int create;
{
int i;
***************
*** 228,235 ****


}

media_type_t give_media_type(major,minor,create)
! const char * major;

! const char * minor;
int create;
{

--- 228,235 ----
}

media_type_t give_media_type(major,minor,create)
! CONST char * major;

! CONST char * minor;
int create;
{


***************
*** 243,249 ****

media_type_t give_media_type2(major_type_code,minor,create)
enum mime_major_type major_type_code;
! const char * minor;
int create;
{
struct media_type * p;
--- 243,249 ----

media_type_t give_media_type2(major_type_code,minor,create)
enum mime_major_type major_type_code;

! CONST char * minor;
int create;
{
struct media_type * p;
Index: elm2.4.ME+.116-cvs/lib/okay_addr.c
*** elm2.4.ME+.115/lib/okay_addr.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/okay_addr.c 2004-05-01 22:08:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: okay_addr.c,v 1.17 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*
* Reimplemented by: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: okay_addr.c,v 1.19 2004/05/01 19:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*
* Reimplemented by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

free(buffer1); buffer1 = NULL;
!
}
!

! alternatives = alternative_addresses;
! while (alternatives != NULL) {
! if (0 == strcmp(addr,alternatives->address)) {
! DPRINT(Debug,25,(&Debug,
! "addr_is_user(\"%s\")=TRUE: matches alternative address\n",
! addr));
! return(TRUE);
}
- alternatives = alternatives->next;
}
DPRINT(Debug,25,(&Debug,
"addr_is_user(\"%s\")=FALSE\n",addr));
--- 181,243 ----
}
}

! alternatives = give_dt_path_as_elems(&alternative_addresses,
! "alternatives");
! if (alternatives) {

!
! int i;
!

free(buffer1); buffer1 = NULL;
!
}
!

! alternatives = give_dt_path_as_elems(&alternative_addresses,
! "alternatives");
! if (alternatives) {

!
! int i;
!

! for (i = 0; alternatives[i]; i++) {
!

! if (0 == strcmp(addr,alternatives[i])) {
! DPRINT(Debug,25,(&Debug,
! "addr_is_user(\"%s\")=TRUE: matches alternative address\n",
! addr));
! return(TRUE);
! }
}
}
DPRINT(Debug,25,(&Debug,
"addr_is_user(\"%s\")=FALSE\n",addr));

Index: elm2.4.ME+.116-cvs/lib/outheaders.c
*** elm2.4.ME+.115/lib/outheaders.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/outheaders.c 2004-05-19 15:07:01.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.18 2004/05/19 12:07:01 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 38,44 ****
struct mailing_headers *hdrs;
{

/* bzero is defined hdrs/defs.h */

! bzero(hdrs,sizeof (*hdrs));

hdrs->magic = MAIL_HDR_magic;

--- 38,44 ----
struct mailing_headers *hdrs;
{

/* bzero is defined hdrs/defs.h */

! bzero((void *)hdrs,sizeof (*hdrs));

hdrs->magic = MAIL_HDR_magic;

***************
*** 114,120 ****

/* Make sure that dangling pointters are catched */

/* bzero is defined hdrs/defs.h */

! bzero(hdrs,sizeof (*hdrs));

}

--- 114,120 ----

/* Make sure that dangling pointters are catched */

/* bzero is defined hdrs/defs.h */

! bzero((void *)hdrs,sizeof (*hdrs));

}

***************
*** 166,172 ****
struct expanded_address *x;
{

/* bzero is defined hdrs/defs.h */

! bzero(x,sizeof (*x));
x->magic = EXP_ADDR_magic;

x->addrs = NULL;
--- 166,172 ----
struct expanded_address *x;
{

/* bzero is defined hdrs/defs.h */

! bzero((void *)x,sizeof (*x));
x->magic = EXP_ADDR_magic;

x->addrs = NULL;
***************

*** 285,291 ****
add_unicode_to_string(result,1,&code);
}

! add_ascii_to_string(result,s2us(" ("));


}
--- 285,291 ----
add_unicode_to_string(result,1,&code);
}

! add_ascii_to_string(result,s2us(")"));

Index: elm2.4.ME+.116-cvs/lib/rc_handle.c
*** elm2.4.ME+.115/lib/rc_handle.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/rc_handle.c 2004-05-01 22:08:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.24 2004/05/01 19:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

****************************************************************************
***************
*** 16,22 ****
--- 16,24 ----

#include "headers.h"
#include "rc_imp.h"
#include "save_opts.h"

+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif

- "!%s is not supported in line %d in \"%s\" file"),
- r->name,lineno,filename);


- return 0;
- }
-

- weedout(value);


- return 1;
- }
-

- #ifdef ANSI_C
- static rc_parse_cline dt_WEE_parse_cline;
- #endif
- static int dt_WEE_parse_cline(r,lcl,value,lineno,filename)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;
- char *filename;
- {
- weedout(value);

- return 1;
- }
-

- #if ANSI_C
- static rc_print_value dt_WEE_print_value;
- #endif
- static void dt_WEE_print_value(F,r,comment)
- FILE *F;
- struct rc_save_info_rec *r;
- int comment;

- {

- fprintf(F, "\n");
- }
-

- struct rc_type rc_DT_WEE = { dt_WEE_parse_line, dt_WEE_parse_cline,
- dt_WEE_print_value, NO_get_value };
-
- #ifdef ANSI_C
- static rc_parse_line dt_ALT_parse_line;
- #endif
- static int dt_ALT_parse_line(r,lcl,value,lineno,filename, e_val, negate)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;
- char *filename;
- int e_val;
- int negate;
- {
- if (negate) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadNegate,

- "!%s is not supported in line %d in \"%s\" file"),
- r->name,lineno,filename);


- return 0;
- }
-

- alternatives(value);


- return 1;
- }
-

- #ifdef ANSI_C
- static rc_parse_cline dt_ALT_parse_cline;
- #endif
- static int dt_ALT_parse_cline(r,lcl,value,lineno,filename)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;
- char *filename;
- {
- alternatives(value);

- return 1;
- }
-

- fprintf(F,"\n");
-
-
- }
-

+ int i;
+

+ for (i = 0; i < Len; i++)
+ if ('_' == value[i])
+ value[i] = ' ';
+ }
+
start_val = NULL;
goto expand_value;
}
***************
*** 1263,1269 ****
int Len = p - start_val;

/* Split on quote */
! q = '"';

DPRINT(Debug,11,(&Debug,
"expand_dt_path (clip len=%d)=%.*s\n",
--- 1103,1109 ----
int Len = p - start_val;

/* Split on quote */
! q = '\'';

DPRINT(Debug,11,(&Debug,
"expand_dt_path (clip len=%d)=%.*s\n",
***************

*** 1374,1380 ****

}

! if (is_dir &&
#ifdef S_ISREG
!S_ISREG(S.st_mode)
#else

--- 1214,1220 ----



}

! if (is_file &&
#ifdef S_ISREG
!S_ISREG(S.st_mode)
#else
***************
*** 1452,1457 ****

--- 1292,1298 ----


{
char *res,*p;
int sep;
+ int quote;

int i,L = 1;
if (!ptr->list && ptr->unexpanded)
***************
*** 1466,1483 ****
else if (ptr->flags & PATH_sep_colon) sep = ':';
else sep = ' ';

res = safe_malloc(L);

for (i = 0, p = res; i < ptr->nlen;i++) {
int l = strlen(ptr->list[i]);

! if (p+l+1 >= res+L)
panic("RC PANIC",__FILE__,__LINE__,"give_dt_path_as_str",
"Overflow",0);
if (i > 0)
*p++ = sep;
memcpy(p,ptr->list[i],l);
p += l;
}
*p = '\0';

--- 1307,1339 ----


else if (ptr->flags & PATH_sep_colon) sep = ':';
else sep = ' ';

+ if (ptr->flags & PATH_quote) quote = '"';
+ else if (ptr->flags & PATH_quote_single) quote = '\'';

+ else quote = 0;
+

--- 1442,1452 ----



if (comment)
fprintf(F, "### ");
+
+ fprintf(F, "%s = ",r->name);

for (i = 0; i < r->val.path->nlen; i++) {
! if (i > 0) {
if (len + strlen(r->val.path->list[i]) > 70) {
fprintf(F, "\n");
if (comment)
***************
*** 1603,1609 ****
}
if (r->val.path->flags & PATH_quote)
elm_fprintf(F,FRM("Q"),r->val.path->list[i]);
! else
fputs(r->val.path->list[i],F);
len += strlen(r->val.path->list[i]) + 1;
}

--- 1459,1469 ----


}
if (r->val.path->flags & PATH_quote)
elm_fprintf(F,FRM("Q"),r->val.path->list[i]);
! else if (r->val.path->flags & PATH_quote_single) {
! fputc('\'',F);
! fputs(r->val.path->list[i],F);
! fputc('\'',F);
! } else
fputs(r->val.path->list[i],F);
len += strlen(r->val.path->list[i]) + 1;
}

Index: elm2.4.ME+.116-cvs/lib/read_rc.c
*** elm2.4.ME+.115/lib/read_rc.c 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/read_rc.c 2004-05-01 22:08:19.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133 2004/04/04 06:17:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.136 2004/05/01 19:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.136 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 48,55 ****
# endif

#define ASSIGNMENT 0
- #define WEEDOUT 1
- #define ALTERNATIVES 2

#define SYSTEM_RC 0
#define LOCAL_RC 1

--- 48,53 ----
***************
*** 144,150 ****


/* terminal if terminal supports */
int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */
! struct addr_rec *alternative_addresses; /* how else do we get mail? */

int always_del = 0; /* flag: always delete marked msgs? */
int always_keep = 1; /* flag: always keep unread msgs? */

int always_store = 0; /* flag: always store read msgs? */
--- 142,152 ----


/* terminal if terminal supports */
int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */

! PATH alternative_addresses = { /* how else do we get mail? */
! PATH_sep_comma|PATH_quote|PATH_quote_single,
! NULL, 0,NULL
! };
!

int always_del = 0; /* flag: always delete marked msgs? */
int always_keep = 1; /* flag: always keep unread msgs? */

int always_store = 0; /* flag: always store read msgs? */
***************
*** 367,374 ****


characters to be encoded? */

char v_editor[SLEN] = {0}; /* "~v" editor... */
int elm_filter = 1; /* flag: weed out header lines? */
! char *weedlist[MAX_IN_WEEDLIST] = {0}; /* */
! int weedcount; /* */

#ifdef REMOTE_MBX
char raw_imap_charset[SLEN] = "SYSTEM"; /* IMAP foldername charset */

--- 369,379 ----


characters to be encoded? */

char v_editor[SLEN] = {0}; /* "~v" editor... */
int elm_filter = 1; /* flag: weed out header lines? */

! PATH weedlist = {
! PATH_sep_comma|PATH_quote|PATH_convert_underline,
! NULL, 0,NULL
! };
!

#ifdef REMOTE_MBX
char raw_imap_charset[SLEN] = "SYSTEM"; /* IMAP foldername charset */

***************
*** 692,698 ****
return;
}

! if (0 == strcmp(lc_ctype,"C"))
system_charset = MIME_name_to_charset("US-ASCII",
CHARSET_create);

else if (0 == istrcmp(lc_ctype,"ASCII") ||

--- 697,741 ----


return;
}

! /* 1) ------ guess based on codeset ------------------------ */
!
! if (codeset[0] &&
! 0 == strincmp(codeset,"ISO-8859-",9) &&
! 0 < (val = atoi(codeset+9))) {

! elm_sfprintf(buffer, sizeof buffer,


! FRM("ISO-8859-%d"),
! val);
! system_charset = MIME_name_to_charset(buffer,
! CHARSET_create);
! } else if (codeset[0] &&
! 0 == strincmp(codeset,"ISO_8859-",9) &&
! 0 < (val = atoi(codeset+9))) {

! elm_sfprintf(buffer, sizeof buffer,


! FRM("ISO-8859-%d"),
! val);
! system_charset = MIME_name_to_charset(buffer,
! CHARSET_create);
! } else if (codeset[0] &&
! 0 == strincmp(codeset,"ISO8859-",8) &&
! 0 < (val = atoi(codeset+8))) {

! elm_sfprintf(buffer, sizeof buffer,


! FRM("ISO-8859-%d"),
! val);
! system_charset = MIME_name_to_charset(buffer,
! CHARSET_create);
! } else if (codeset[0] &&
! 0 == strincmp(codeset,"ISO8859",7) &&
! isascii(codeset[7]) && isdigit(codeset[7]) &&
! '\0' == codeset[8]) {

! elm_sfprintf(buffer, sizeof buffer,


! FRM("ISO-8859-%c"),
! codeset[7]);
! system_charset = MIME_name_to_charset(buffer,
! CHARSET_create);
!
! /* 2) ------ guess based on lc_ctype ------------------------ */
!

! } else if (0 == strcmp(lc_ctype,"C"))


system_charset = MIME_name_to_charset("US-ASCII",
CHARSET_create);

else if (0 == istrcmp(lc_ctype,"ASCII") ||
***************
*** 717,722 ****

--- 760,768 ----


FRM("ISO-8859-%d"),
val);
system_charset = MIME_name_to_charset(buffer,CHARSET_create);
+
+ /* 3) ------ guess based on charset part of locale ------------------------ */
+
} else if (charset && (0 == istrcmp(charset,"ASCII") ||
0 == istrcmp(charset,"US-ASCII")))

system_charset = MIME_name_to_charset("US-ASCII",

***************
*** 888,895 ****
#endif
#endif

- static void default_weedlist P_((void));
-
static int figure_domain P_((void));
static int figure_domain()
{

--- 934,939 ----


***************
*** 1013,1019 ****
*/


- default_weedlist();
errors = 0;

/*

--- 1057,1062 ----


***************
*** 1081,1087 ****
strfcpy(raw_defaultfile, "$MAIL", sizeof raw_defaultfile);
strfcpy(defaultfile, cp, sizeof defaultfile);
}
- alternative_addresses = NULL; /* none yet! */

raw_local_signature[0] = raw_remote_signature[0] =
local_signature[0] = remote_signature[0] =

--- 1124,1129 ----


***************
*** 2141,2286 ****
return eval_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
lcl,word1,word2,filename);
}
-
- void weedout(string)
- char *string;

- {


- /** This routine is called with a list of headers to weed out. **/

! char *strptr, *header, *p;
! int Len;
! int finished;
!
! finished = FALSE;
! strptr = string;
! while (!finished && (header = strtokq(strptr, "\t ,", TRUE)) != NULL) {
! strptr = NULL;
!

! if (!*header)
! continue;
!
! for (p = header; *p; ++p) {
! if (*p == '_')
! *p = ' ';
! }

! if (! istrcmp(header, "*end-of-user-headers*"))
! break;

! if (! istrcmp(header, "*end-of-defaults*"))
! finished = TRUE;

! if (! istrcmp(header, "*clear-weed-list*")) {
! while (weedcount)
! free(weedlist[--weedcount]);
! header = "*end-of-defaults*";
! }
!
! if (matches_weedlist(header))

! continue;
!

--- 2183,2237 ----


return eval_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
lcl,word1,word2,filename);
}

! static CONST char WEED_NO_DEFAULT[] = "*clear-weed-list*";
!

! int matches_weedlist(buffer)
! char *buffer;
! {
! /** returns true iff the first 'n' characters of 'buffer'
! match an entry of the weedlist **/

!
! int i;


! static char *default_list[] =
! { ">From", "In-Reply-To:",
! "References:", "Newsgroups:", "Received:",
! "Apparently-To:", "Message-Id:", "Content-Type:",
! "Content-Length", "MIME-Version",
! "Content-Transfer-Encoding",
! "From", "X-Mailer:", "Status:",
! "X-ELM-",
! "X-UIDL", /* Generated by some POP deamons */
! "Return-Path",
! "*end-of-defaults*", NULL
! };

! char **list = give_dt_path_as_elems(&weedlist,"weedout");

! /* If fist elem is "*clear-weed-list*" then default list is not
! used
! */

! if (!list || !list[0] ||
! 0 != strcmp(list[0],WEED_NO_DEFAULT)) {

!


! for (i = 0; default_list[i]; i++) {
! if (strincmp(buffer, default_list[i], strlen(default_list[i])) == 0)

! return(1);

! }
!
}


! if (list) {
! for (i=0;list[i]; i++) {
! if (strincmp(buffer, list[i], strlen(list[i])) == 0)
! return(1);
! }
}
return(0);
}

Index: elm2.4.ME+.116-cvs/lib/remote_mbx.c
*** elm2.4.ME+.115/lib/remote_mbx.c 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/remote_mbx.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.49 2004/04/04 06:17:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.50 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 9,15 ****
--- 9,17 ----

#include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"

+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif
#include "s_me.h"
#include "s_elm.h"

***************
*** 179,185 ****
struct remote_account *ra;
{

/* bzero is defined hdrs/defs.h */

! bzero (ra, sizeof (struct remote_account));

ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = 0;
--- 181,187 ----
struct remote_account *ra;
{

/* bzero is defined hdrs/defs.h */

! bzero ((void *)ra, sizeof (struct remote_account));

ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = 0;

Index: elm2.4.ME+.116-cvs/lib/savefolder.c
*** elm2.4.ME+.115/lib/savefolder.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/savefolder.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.76 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 1357,1363 ****
int real_prepare_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! const char *filename;
{

int ret = 0;


int err = 0;
--- 1357,1363 ----
int real_prepare_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! CONST char *filename;
{

int ret = 0;

/* bzero is defined hdrs/defs.h */

! bzero(dir->selection,sizeof (struct name_vector));
dir->selection->sys_name = sys_name;
dir->selection->disp_name = disp_name;
dir->selection->flags = flags;
--- 2216,2222 ----
dir->selection = safe_malloc(sizeof (struct name_vector));

/* bzero is defined hdrs/defs.h */

/* bzero is defined hdrs/defs.h */

! bzero(*ptr,sizeof (struct browser_write_state));

(*ptr)->magic = WS_magic;
}
--- 3756,3762 ----
(*ptr) = safe_malloc(sizeof (struct browser_write_state));

/* bzero is defined hdrs/defs.h */

! bzero((void *)*ptr,sizeof (struct browser_write_state));

(*ptr)->magic = WS_magic;
}
***************
*** 3767,3773 ****
{
if (*ptr) {

/* bzero is defined hdrs/defs.h */

! bzero(*ptr,sizeof (struct browser_write_state));

free(*ptr);
*ptr = NULL;
--- 3767,3773 ----
{
if (*ptr) {

/* bzero is defined hdrs/defs.h */

! bzero((void *)*ptr,sizeof (struct browser_write_state));

free(*ptr);
*ptr = NULL;

Index: elm2.4.ME+.116-cvs/lib/service_list.c
*** elm2.4.ME+.115/lib/service_list.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/service_list.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.26 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: service_list.c,v 1.27 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 9,15 ****
--- 9,17 ----

#include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"

Index: elm2.4.ME+.116-cvs/lib/shared_all.c
*** elm2.4.ME+.115/lib/shared_all.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/shared_all.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.2 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.3 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

Index: elm2.4.ME+.116-cvs/lib/shared.c
*** elm2.4.ME+.115/lib/shared.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/shared.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared.c,v 1.54 2004/03/28 18:08:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: shared.c,v 1.55 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

Index: elm2.4.ME+.116-cvs/lib/shared_connect.c
*** elm2.4.ME+.115/lib/shared_connect.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/shared_connect.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.2 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.3 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 449,456 ****

Index: elm2.4.ME+.116-cvs/lib/streamsched.c
*** elm2.4.ME+.115/lib/streamsched.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/streamsched.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.33 2004/03/27 18:31:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.34 2004/04/24 12:30:02 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 10,16 ****
--- 10,18 ----

#include "headers.h"
#include "ss_imp.h"
#include "mbx_imp.h"

+ #ifdef USE_DLOPEN
#include "shared_imp.h"
+ #endif

DEBUG_VAR(Debug,__FILE__,"net");

Index: elm2.4.ME+.116-cvs/lib/string.c
*** elm2.4.ME+.115/lib/string.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/lib/string.c 2004-04-24 15:30:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: string.c,v 1.38 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: string.c,v 1.39 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 838,844 ****

/* result is malloced */
void bytestream_from_string(str,res,reslen)
! const struct string *str;
char **res;
int *reslen;
{
--- 838,844 ----

/* result is malloced */
void bytestream_from_string(str,res,reslen)
! CONST struct string *str;
char **res;
int *reslen;
{

Index: elm2.4.ME+.116-cvs/Makefile-1.SH
*** elm2.4.ME+.115/Makefile-1.SH 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.116-cvs/Makefile-1.SH 2004-05-02 19:58:30.000000000 +0300


***************
*** 27,33 ****
echo "Extracting Makefile-1 (with variable substitutions)"
cat >Makefile-1 <<!GROK!THIS!
#!$make

! # $Id: Makefile-1.SH,v 1.11 2004/01/24 11:05:54 hurtta Exp $


#
#
# Makefile for the ELM (ME+) mail program.
--- 27,33 ----
echo "Extracting Makefile-1 (with variable substitutions)"
cat >Makefile-1 <<!GROK!THIS!
#!$make

! # $Id: Makefile-1.SH,v 1.12 2004/05/02 16:58:30 hurtta Exp $


#
#
# Makefile for the ELM (ME+) mail program.
***************

*** 60,90 ****
libreg

$(ETC)/elm.rc: $(LIB)/elmrc-write doc/elmrc-info
! $(REG) {$(LIB)/elmrc-write} -G -I -C {doc/elmrc-info}
$(REG) $(CHMOD) u=rw,go=r {$@}


$(LIB)/elm.map.bin/unidata.bin: $(LIB) $(LIB)/elm.map.bin \
charset/UNIDATA/UNIDATA2.TXT $(LIB)/elmunidata

! $(REG) {$(LIB)/elmunidata} -I -s {charset/UNIDATA/UNIDATA2.TXT}
$(REG) $(CHMOD) u=rw,go=r {$@}
! $(REG) true {charset/UNIDATA/README.TXT}

$(LIB)/elm.map.bin/bindata.bin: $(LIB) $(LIB)/elm.map.bin $(LIB)/elmbindata \
$(ETC)/elm.mimecharsets
! $(REG) {$(LIB)/elmbindata} -G -I \
-S {charset/MAPPINGS/ISO8859} -S {charset/MAPPINGS} \
-S {charset/MAPPINGS/MICSFT}
$(REG) $(CHMOD) u=rw,go=r {$@}




$(ETC)/elm.mimecharsets: $(BIN)/elm.mimecharsets $(LIB)/elmcharset ConfTool/killsets $(LIB)/elm.map.txt

! $(REG) {$(LIB)/elmcharset} -G -I {ConfTool/killsets} -w {$@} \
-S {charset/MAPPINGS/ISO8859} -S {charset/MAPPINGS} \
-S {charset/MAPPINGS/MICSFT} {$(BIN)/elm.mimecharsets}
$(REG) $(CHMOD) u=rw,go=r {$@}

$(ETC)/elm.terminalinfo: $(BIN)/elm.terminalinfo $(LIB)/elmterminal $(ETC)/elm.mimecharsets
! $(REG) {$(LIB)/elmterminal} -G -w {$@} {$(BIN)/elm.terminalinfo}
$(REG) $(CHMOD) u=rw,go=r {$@}

$(LIB):
--- 60,90 ----
libreg

$(ETC)/elm.rc: $(LIB)/elmrc-write doc/elmrc-info
! $(REG) -s doc {$(LIB)/elmrc-write} -G -I -C {doc/elmrc-info}
$(REG) $(CHMOD) u=rw,go=r {$@}


$(LIB)/elm.map.bin/unidata.bin: $(LIB) $(LIB)/elm.map.bin \
charset/UNIDATA/UNIDATA2.TXT $(LIB)/elmunidata

! $(REG) -s unidata {$(LIB)/elmunidata} -I -s {charset/UNIDATA/UNIDATA2.TXT}
$(REG) $(CHMOD) u=rw,go=r {$@}
! $(REG) -s unidata true {charset/UNIDATA/README.TXT}

$(LIB)/elm.map.bin/bindata.bin: $(LIB) $(LIB)/elm.map.bin $(LIB)/elmbindata \
$(ETC)/elm.mimecharsets
! $(REG) -s mappings {$(LIB)/elmbindata} -G -I \
-S {charset/MAPPINGS/ISO8859} -S {charset/MAPPINGS} \
-S {charset/MAPPINGS/MICSFT}
$(REG) $(CHMOD) u=rw,go=r {$@}




$(ETC)/elm.mimecharsets: $(BIN)/elm.mimecharsets $(LIB)/elmcharset ConfTool/killsets $(LIB)/elm.map.txt

! $(REG) -s mappings {$(LIB)/elmcharset} -G -I {ConfTool/killsets} -w {$@} \
-S {charset/MAPPINGS/ISO8859} -S {charset/MAPPINGS} \
-S {charset/MAPPINGS/MICSFT} {$(BIN)/elm.mimecharsets}
$(REG) $(CHMOD) u=rw,go=r {$@}

$(ETC)/elm.terminalinfo: $(BIN)/elm.terminalinfo $(LIB)/elmterminal $(ETC)/elm.mimecharsets
! $(REG) -s terminal {$(LIB)/elmterminal} -G -w {$@} {$(BIN)/elm.terminalinfo}
$(REG) $(CHMOD) u=rw,go=r {$@}

$(LIB):
Index: elm2.4.ME+.116-cvs/melib/mimewalk.c
*** elm2.4.ME+.115/melib/mimewalk.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/melib/mimewalk.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mimewalk.c,v 1.5 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mimewalk.c,v 1.6 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 24,30 ****
ret = safe_malloc(sizeof(*ret));

/* bzero is defined hdrs/defs.h */
! bzero(ret,sizeof (*ret));

ret->magic = WALKHANDLER_magic;
ret->handler_type = t;
--- 24,30 ----
ret = safe_malloc(sizeof(*ret));

/* bzero is defined hdrs/defs.h */
! bzero((void *)ret,sizeof (*ret));

ret->magic = WALKHANDLER_magic;
ret->handler_type = t;

Index: elm2.4.ME+.116-cvs/melib/pgp_decode.c
*** elm2.4.ME+.115/melib/pgp_decode.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/melib/pgp_decode.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.38 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.39 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 290,296 ****
array[1] = pgp_child_out[0];
array[2] = -1;

! rs->ext_init_data = &array;
rs->ext_init = close_them;

env[0] = NULL;
--- 290,296 ----
array[1] = pgp_child_out[0];
array[2] = -1;

! rs->ext_init_data = array;
rs->ext_init = close_them;

env[0] = NULL;

Index: elm2.4.ME+.116-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.115/nls/C/C/C/s_elm.m 2004-03-16 21:17:43.000000000 +0200
--- elm2.4.ME+.116-cvs/nls/C/C/C/s_elm.m 2004-05-01 22:08:19.000000000 +0300
***************

*** 2055,2061 ****
2031 save copy
$quote '
$ #NoReceived
! 2032 '"received" folder not available, continue? (%c/%c) '
$quote "
$ #FileSpecify1
2033 "\n\r\n\rYou must specify a file to "
--- 2051,2057 ----
2031 save copy
$quote '
$ #NoReceived
! 2032 '"received" folder not available, continue leaving folder? ([P]anic/%c/%c) '
$quote "
$ #FileSpecify1
2033 "\n\r\n\rYou must specify a file to "
***************
*** 2301,2303 ****

--- 2297,2301 ----


$quote "
$ #PgpRcvSure
2151 "The recv'd message was PGP encoded, are you sure? "
+ $ #FailedLeaveChange

+ 2152 "Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "
Index: elm2.4.ME+.116-cvs/src/browser.c
*** elm2.4.ME+.115/src/browser.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/browser.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: browser.c,v 1.29 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: browser.c,v 1.30 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1281,1287 ****
struct string **buffer;
int * redraw;
enum word_sel w;
! string * prev_fold;
struct AliasView *aview;

CONST char *format;

CONST char *msg;
--- 1281,1287 ----
struct string **buffer;
int * redraw;
enum word_sel w;
! struct string * prev_fold;
struct AliasView *aview;

CONST char *format;
CONST char *msg;
Index: elm2.4.ME+.116-cvs/src/in_utils.c
*** elm2.4.ME+.115/src/in_utils.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/in_utils.c 2004-05-02 14:15:26.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35 2004/03/27 18:31:45 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.37 2004/05/02 11:15:26 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 46,51 ****
--- 46,187 ----


#define erase_a_char() { Writechar(BACKSPACE); Writechar(' '); \
Writechar(BACKSPACE); FlushBuffer(); }

+ int prompt_letter(

+ #if ANSI_C


+ int line, char *letters, int def,
+ int flags,
+ struct menu_context *page,

+ const char * format, const char *msg, ...
+ #else


+ line, letters, def, flags, page, format, msg, va_alist

+ #endif
+ )


+ #if !ANSI_C
+ int line;
+ char *letters;
+ int def;
+ int flags;
+ struct menu_context *page;
+ CONST char * format;

+ CONST char *msg;
+ va_dcl
+ #endif
+ {

+ struct string *question = NULL;
+

+ int ch;
+ int center = flags & PROMPT_center;
+ int yesno = flags & PROMPT_yesno;
+ int mark = flags & PROMPT_redraw_mark;
+ int ctrlL = flags & PROMTP_ctrlL;

+ int cols = 0;
+
+
+ va_list vl;


+
+ Va_start(vl, msg); /* defined in defs.h */

+ question = elm_smessage(0,format,msg,vl);
+ va_end(vl);
+
+ do {
+ int LINES, COLUMNS;
+ int l;
+ char *x;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+
+ /* FIXME: Not correct */
+ l = string_len(question);
+ cols = COLUMNS - ( l + 5 ); /* 5 for "Yes." + 1 */
+ if (cols < 0) {

+ cols = 0;
+ }
+
+

+ MoveCursor(line, (center || (cols < 2)) ? 0 : cols-2);
+ CleartoEOLN();
+
+ PutLineX(line, center ? cols/2 : cols,
+ FRM("%S%c%c"), question, def, BACKSPACE);
+ FlushBuffer();
+
+ ch = menu_ReadCh(page, REDRAW_MARK);
+ if (ch == REDRAW_MARK) {
+ if (mark)
+ break;

+ continue;
+ }
+

+ if (PROMTP_ctrlL && ch == ('L'&31)) {

+ break;
+ }
+
+ if (ch == EOF)
+ break;
+

+ /* Look first letters without lowercasing */
+ for (x = letters; *x; x++) {
+
+ if (ch == *x) {
+ Writechar(ch);
+ goto out;
+ }
+ }
+
+ if(ch == '\n' || ch == '\r')
+ ch = def;
+ else {
+ #ifdef ASCII_CTYPE
+ if (isascii(ch))
+ #endif
+ ch = tolower(ch);

+ }
+

+ for (x = letters; *x; x++) {
+
+ if (ch == *x) {
+ Writechar(ch);
+ goto out;
+ }
+ }
+
+ if(ch == *def_ans_yes && yesno) {
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
+ break;
+ } else if (ch == *def_ans_no && yesno) {
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));

+ break;
+ }
+

+ Writechar('?');
+ FlushBuffer();
+ #if POLL_METHOD
+ wait_for_timeout(1);
+ #else
+ sleep(1);
+ #endif

+

+ } while (EOF != ch);
+
+
+ out:

+ FlushBuffer();
+

+ if (EOF != ch && REDRAW_MARK != ch && ('L'&31) != ch) {
+ if (sleepmsg > 0) {
+ #if POLL_METHOD
+ wait_for_timeout((sleepmsg + 1) / 2);
+ #else
+ sleep((sleepmsg + 1) / 2);
+ #endif
+ }
+ MoveCursor(line, (center || (cols < 2)) ? 0 : cols-2);
+ CleartoEOLN();
+ }
+

+ return ch;
+ }
+

int want_to(question, dflt, where, clear_and_center, page)
char *question;
int dflt;
***************
*** 60,66 ****
**/
int ch, cols;
int LINES, COLUMNS;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

--- 196,202 ----


**/
int ch, cols;
int LINES, COLUMNS;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

***************

*** 88,114 ****
ch = tolower(ch);

while (!( ch == *def_ans_yes || ch == *def_ans_no || ch == '\n' || ch == '\r')) {
! ch = menu_ReadCh(page,REDRAW_MARK);
! if (ch == REDRAW_MARK)
! goto redraw;
! if (ch == EOF) {
! leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
! }
#ifdef ASCII_CTYPE
! if (isascii(ch))
#endif
! ch = tolower(ch);
}
if(ch == '\n' || ch == '\r')
ch = dflt;

if(ch == *def_ans_yes)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
else if (ch == *def_ans_no)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
else {
DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
! return(ch); /* Don't write anything, just return */
}
FlushBuffer();
if (sleepmsg > 0) {

--- 224,250 ----

--- 994,1004 ----


int optionally_enter2 (
#if ANSI_C
struct menu_context *page,
! struct string **buffer,
! int x, int y, int flags,
! const char * format, const char *msg, ...
#else
! page, buffer, x, y, flags, format, msg, va_alist
#endif
)
#if !ANSI_C

Index: elm2.4.ME+.116-cvs/src/leavembox.c
*** elm2.4.ME+.115/src/leavembox.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/leavembox.c 2004-05-02 14:15:26.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.46 2004/05/02 11:15:26 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 734,748 ****

if (need_handle) {
if (!can_store) {
! char answer = '\0';

! char * buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmNoReceived,
! "\"received\" folder not available, continue? (%c/%c) "),
*def_ans_yes, *def_ans_no);

! answer = want_to(buffer, *def_ans_no, LINES-4, 0,
! page);

if (answer != *def_ans_yes) {
return_value = -2; /* failure */

--- 734,762 ----

Index: elm2.4.ME+.116-cvs/src/messages/digest.c
*** elm2.4.ME+.115/src/messages/digest.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/messages/digest.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.9 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: digest.c,v 1.10 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 39,45 ****
mbx->u.digest = safe_malloc(sizeof (* (mbx->u.digest)));

/* bzero is defined hdrs/defs.h */
! bzero(mbx->u.digest, sizeof (* (mbx->u.digest)));

mbx->u.digest->the_digest = NULL;
mbx->u.digest->digest_count = 0;
--- 39,45 ----
mbx->u.digest = safe_malloc(sizeof (* (mbx->u.digest)));

/* bzero is defined hdrs/defs.h */
! bzero((void *)mbx->u.digest, sizeof (* (mbx->u.digest)));

mbx->u.digest->the_digest = NULL;
mbx->u.digest->digest_count = 0;

Index: elm2.4.ME+.116-cvs/src/messages/messages.c
*** elm2.4.ME+.115/src/messages/messages.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/messages/messages.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: messages.c,v 1.12 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: messages.c,v 1.13 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 23,29 ****
ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero(ret,sizeof (*ret));

ret->magic = MAILBOXVIEW_magic;
ret->mailbox_type = t;
--- 23,29 ----
ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero((void *)ret,sizeof (*ret));

ret->magic = MAILBOXVIEW_magic;
ret->mailbox_type = t;

Index: elm2.4.ME+.116-cvs/src/messages/partial.c
*** elm2.4.ME+.115/src/messages/partial.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/messages/partial.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.14 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.15 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 27,33 ****
mbx->u.partial = safe_malloc(sizeof (* (mbx->u.partial)));

/* bzero is defined hdrs/defs.h */
! bzero(mbx->u.partial, sizeof (* (mbx->u.partial)));

mbx->u.partial->parent_mailbox = NULL;

--- 27,33 ----
mbx->u.partial = safe_malloc(sizeof (* (mbx->u.partial)));

/* bzero is defined hdrs/defs.h */
! bzero((void *)mbx->u.partial, sizeof (* (mbx->u.partial)));

mbx->u.partial->parent_mailbox = NULL;

Index: elm2.4.ME+.116-cvs/src/messages/storage.c
*** elm2.4.ME+.115/src/messages/storage.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/messages/storage.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: storage.c,v 1.6 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: storage.c,v 1.7 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 30,36 ****
mbx->u.storage = safe_malloc(sizeof (* (mbx->u.storage)));

/* bzero is defined hdrs/defs.h */
! bzero(mbx->u.storage, sizeof (* (mbx->u.storage)));

mbx->u.storage->the_mailbox = NULL;
mbx->u.storage->mailbox_count = 0;
--- 30,36 ----
mbx->u.storage = safe_malloc(sizeof (* (mbx->u.storage)));

/* bzero is defined hdrs/defs.h */
! bzero((void *)mbx->u.storage, sizeof (* (mbx->u.storage)));

mbx->u.storage->the_mailbox = NULL;
mbx->u.storage->mailbox_count = 0;

Index: elm2.4.ME+.116-cvs/src/out_utils.c
*** elm2.4.ME+.115/src/out_utils.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/out_utils.c 2004-04-24 19:33:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.23 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.25 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Index: elm2.4.ME+.116-cvs/src/quit.c
*** elm2.4.ME+.115/src/quit.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/quit.c 2004-05-02 14:15:26.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: quit.c,v 1.36 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: quit.c,v 1.40 2004/05/02 11:15:26 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

! "No."));
! return;
! }

! return;
!

Index: elm2.4.ME+.116-cvs/src/read_rc.c
*** elm2.4.ME+.115/src/read_rc.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/read_rc.c 2004-05-01 22:08:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.24 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.26 2004/05/01 19:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Index: elm2.4.ME+.116-cvs/src/screen/context.c
*** elm2.4.ME+.115/src/screen/context.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/src/screen/context.c 2004-04-24 15:30:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: context.c,v 1.3 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: context.c,v 1.4 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 41,47 ****
struct menu_context *ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero(ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;

--- 41,47 ----
struct menu_context *ret = safe_malloc(sizeof (*ret));

/* bzero is defined hdrs/defs.h */
! bzero((void *)ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;

Index: elm2.4.ME+.116-cvs/utils/elmregister.c
*** elm2.4.ME+.115/utils/elmregister.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116-cvs/utils/elmregister.c 2004-05-02 20:16:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.15 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.18 2004/05/02 17:16:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 22,27 ****
--- 22,29 ----
* -- copy file
*
* 'F' user group mode filename '\n'
+ * 'd' user group mode filename '\n' (document)
+ * 's' user group mode filename '\n' (stage file)
*
* -- create directory
*
***************
*** 322,327 ****
--- 324,330 ----

switch (c) {
case 'F':
+ case 'd':
user_ptr = ptr; add_bytes(F,buffer1,&ptr); /* user */
group_ptr = ptr; add_bytes(F,buffer1,&ptr); /* group */
mode_ptr = ptr; add_bytes(F,buffer1,&ptr); /* mode */
***************
*** 700,705 ****
--- 703,709 ----
case '{':
case 's':
case 'F':
+ case 'd':
case 'C':

if (ptr2->arg_ptrs && ptr2->arg_ptrs[0] &&
***************
*** 1021,1026 ****
--- 1025,1032 ----

}

+
+
read_pipe = create_pipe(argc,argv,x,&PID,installer_root);

fd = fdopen(read_pipe,"r");
***************
*** 1146,1153 ****

/* NOTE: LI leaked ... */

-
-
return 0;
}

--- 1152,1157 ----
***************
*** 1697,1706 ****

#endif /* DIROPS */

! static void make_argcopy P_((char *arg, int arg_len));
! static void make_argcopy(arg,arg_len)
char *arg;
int arg_len;
{
struct stat X;

--- 1701,1711 ----

#endif /* DIROPS */

! static void make_argcopy P_((char *arg, int arg_len, char * stage_subdir ));
! static void make_argcopy(arg,arg_len, stage_subdir)
char *arg;
int arg_len;
+ char * stage_subdir;
{
struct stat X;

***************
*** 1773,1778 ****
--- 1778,1786 ----
}

n = strlen(stage_dir) + arg_len;
+ if (stage_subdir) {
+ n += strlen(stage_subdir) + 1;
+ }
target_r = malloc(n);
if (!target_r) {
fprintf(stderr,"%s: malloc %d bytes failed\n",
***************
*** 1782,1787 ****
--- 1790,1833 ----
strcpy(target_r,stage_dir+1);
strcat(target_r,"/");

+ if (stage_subdir) {
+ char * Y;
+ int n1;
+
+ strcat(target_r,stage_subdir);
+
+ n1 = strlen(installer_root) + strlen(target_r) + 3;
+
+ Y = malloc(n1);
+ if (!Y) {
+ fprintf(stderr,"%s: malloc %d bytes failed\n",
+ program_name,n1);


+ exit(1); /* FAILURE */
+ }
+

+ strcpy(Y,installer_root);
+ strcat(Y,"/");
+ strcat(Y,target_r);
+
+
+
+ if (0 == mkdir(Y,0755)) {
+ fprintf(stdout,
+ "%s: Directory %s created\n",
+ program_name,Y);
+ } else if (errno != EEXIST) {
+ fprintf(stderr,
+ "%s: Failed to create %s directory\n",
+ program_name,Y);


+ exit(1);
+ }
+
+

+ free(Y);
+
+ strcat(target_r,"/");
+ }
+
y = strrchr(bufferz,'/');
if (y)
strcat(target_r,y+1);
***************
*** 2108,2113 ****
--- 2154,2160 ----
(cmd = argv[x]) &&
(
0 == strcmp("copy", argv[x]) ||
+ 0 == strcmp("copydoc", argv[x]) ||
0 == strcmp("mkdir", argv[x])
)) {
uid_t id_user = (uid_t)-1;
***************
*** 2340,2346 ****
return 1; /* FAILURE */
}

! log_it("F",target_r,s_user, s_group, f_mode);

free(source_r); free(source_f);
free(target_r); free(target_f);
--- 2387,2396 ----
return 1; /* FAILURE */
}

! if (0 == strcmp("copydoc",cmd))
! log_it("d",target_r,s_user, s_group, f_mode);
! else
! log_it("F",target_r,s_user, s_group, f_mode);

free(source_r); free(source_f);
free(target_r); free(target_f);
***************
*** 2353,2361 ****
--- 2403,2420 ----



char buffer[ MAX_PIPE_LOG];
char *ptr;

+ char * stage_subdir = NULL;

int L = 4;

+ if (x < argc -1 && 0 == strcmp("-s", argv[x])) {
+ int l;
+
+ stage_subdir = argv[x+1];
+ x += 2;
+ }
+
+
if (argc - x >= MAX_ARGS) {
fprintf(stderr,
"%s: %s too many arguments\n",
***************
*** 2367,2374 ****
int z;
if ('{' == argv[j][0] && (z = strlen(argv[j])) && '}' == argv[j][z-1]) {

!
! make_argcopy(argv[j],z);
}

L += strlen(argv[j]) +1;
--- 2426,2432 ----
int z;
if ('{' == argv[j][0] && (z = strlen(argv[j])) && '}' == argv[j][z-1]) {

! make_argcopy(argv[j],z, stage_subdir);
}

L += strlen(argv[j]) +1;
***************
*** 2705,2711 ****
break;

case 'F':
!

pick_one(ptr,&src,L,&id_user,&id_group,&mode,&is_dir);

--- 2763,2769 ----
break;

case 'F':
! case 'd':

pick_one(ptr,&src,L,&id_user,&id_group,&mode,&is_dir);

***************
*** 2792,2797 ****
--- 2850,2856 ----
case '{':
case 's':
case 'F':
+ case 'd':

case 'C':
case 'M':

***************

*** 2870,2875 ****
--- 2929,2935 ----
case 'M':
case '{':
case 'F':
+ case 'd':
case 'C':

if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
***************
*** 3077,3082 ****
--- 3137,3143 ----
break;

case 'F':
+ case 'd':
case 's': /* also handled by unstage_list() */

if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
***************
*** 3188,3193 ****
--- 3249,3255 ----
break;

case 'F':
+ case 'd':
case 'C':
case 'L': /* link */
case 'M':
***************
*** 3407,3412 ****
--- 3469,3475 ----

case 'M':
case 'F':
+ case 'd':
case 'C':

p = NULL;

Kari E. Hurtta

unread,
Jun 11, 2004, 1:37:24 PM6/11/04
to
Archive-name: elm2.4ME+/PL116

Is available on ozone.FMI.FI

via anonymous ftp
directory KEH/

file elm-2.4ME+PL116a.patch.gz
for a moment (1).

Is available on ftp.funet.fi
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

files elm-2.4ME+PL116a.patch.gz

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL116a.patch.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL116a.patch.gz >
via WWW.

(1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi

www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL116a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

SUMMARY: This patch fixes bug where alternatives and weedout list
are replaced with Q letters on elmrc and fixes bug where
gpg key of recipient is not found when sending mail.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL116 (25) --------------------------------
Index: elm2.4.ME+.116a-cvs/hdrs/patchlevel.h
Prereq: 1116400000
*** elm2.4.ME+.116/hdrs/patchlevel.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.116a-cvs/hdrs/patchlevel.h 2004-06-09 20:15:23.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "116 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.116
*/
! #define LAST_REPORT_TIME 1116400000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "May, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released May, 2004"

/*
* Local Variables:

--- 1,12 ----
! #define PATCHLEVEL "116a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.116
*/
! #define LAST_REPORT_TIME 1118000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Jun, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jun, 2004"

/*
* Local Variables:
Index: elm2.4.ME+.116a-cvs/README.ME+
*** elm2.4.ME+.116/README.ME+ 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.116a-cvs/README.ME+ 2004-06-09 22:56:19.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.760 2004/05/19 12:02:16 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.760.2.4 2004/06/09 19:56:19 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,18 ****
--- 13,41 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL116a (25) compared with Elm2.4ME+ PL116 (25)
+ -------------------------------------------------------------------
+
+ - Alternatives and weedout and list was replaced with Q letters
+ Problem noted by: Cyrille Lefevre <cyrille...@laposte.net>
+
+ - Reprint last error on "Mail Pre-Send Screen" after
+ clearing screen.
+
+ - Trying send encrypted messages with gpg was giving
+ error message
+ Couldn't find key matching 'xxx@yyy'
+ Problem noted by: Olivier COLIN <dodo.o...@wanadoo.fr>
+ (and probably others)
+ > Make GetPGPKey() retry reading of result on case of
+ interrupt.
+
+ - GetPGPKey() was not collect status of exted gpg and
+ was left lot of defunct processes. Converted code to
+ use start_run().
+
+ - Do not quote addresses on alternatives.


+
Changes of Elm2.4ME+ PL116 (25) compared with Elm2.4ME+ PL115 (25)

-------------------------------------------------------------------

***************
*** 98,104 ****


on '(' to ')' on make_surface_addr() on

lib/outheaders.c

-

Changes of Elm2.4ME+ PL115a (25) compared with Elm2.4ME+ PL115 (25)

-------------------------------------------------------------------

--- 121,126 ----
Index: elm2.4.ME+.116a-cvs/lib/rc_handle.c
*** elm2.4.ME+.116/lib/rc_handle.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.116a-cvs/lib/rc_handle.c 2004-06-09 23:08:54.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.24 2004/05/01 19:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.24.4.3 2004/06/09 20:08:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.4.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************
***************

*** 1446,1451 ****
--- 1446,1454 ----


fprintf(F, "%s = ",r->name);

for (i = 0; i < r->val.path->nlen; i++) {

+ /* NOTE: space is always valid separator even when
+ PATH_sep_comma or PATH_sep_colon is set */
+
if (i > 0) {


if (len + strlen(r->val.path->list[i]) > 70) {
fprintf(F, "\n");

***************
*** 1458,1464 ****



}
if (r->val.path->flags & PATH_quote)

! elm_fprintf(F,FRM("Q"),r->val.path->list[i]);


else if (r->val.path->flags & PATH_quote_single) {

fputc('\'',F);


fputs(r->val.path->list[i],F);

--- 1461,1467 ----



}
if (r->val.path->flags & PATH_quote)

! elm_fprintf(F,FRM("%Q"),r->val.path->list[i]);


else if (r->val.path->flags & PATH_quote_single) {

fputc('\'',F);


fputs(r->val.path->list[i],F);

Index: elm2.4.ME+.116a-cvs/lib/read_rc.c
*** elm2.4.ME+.116/lib/read_rc.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.116a-cvs/lib/read_rc.c 2004-06-09 22:56:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.136 2004/05/01 19:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.136 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.136.4.1 2004/06/09 19:56:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.136.4.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 143,149 ****


int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */

PATH alternative_addresses = { /* how else do we get mail? */
! PATH_sep_comma|PATH_quote|PATH_quote_single,

NULL, 0,NULL
};

--- 143,149 ----


int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */

PATH alternative_addresses = { /* how else do we get mail? */

! PATH_sep_comma,
NULL, 0,NULL
};

Index: elm2.4.ME+.116a-cvs/src/mailmsg2.c
*** elm2.4.ME+.116/src/mailmsg2.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116a-cvs/src/mailmsg2.c 2004-06-09 20:10:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.12.1 2004/06/09 17:10:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.12.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1182,1194 ****
if (do_redraw) {
do_redraw = 0;
*need_redraw_p = TRUE;
!
menu_ClearScreen(page);
print_format_center(0,
CATGETS(elm_msg_cat, ElmSet,
ElmMailScreenTitle,
"Mail Pre-Send Screen"));

show_presend_headers(headers,hdr_charset, page);

if (headers->env_from && user_level > 0) {
--- 1182,1196 ----
if (do_redraw) {
do_redraw = 0;
*need_redraw_p = TRUE;
!
menu_ClearScreen(page);
print_format_center(0,
CATGETS(elm_msg_cat, ElmSet,
ElmMailScreenTitle,
"Mail Pre-Send Screen"));

+ show_last_error();
+
show_presend_headers(headers,hdr_charset, page);

if (headers->env_from && user_level > 0) {
Index: elm2.4.ME+.116a-cvs/src/pgp.c
*** elm2.4.ME+.116/src/pgp.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.116a-cvs/src/pgp.c 2004-06-09 20:14:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38.14.1 2004/06/09 17:14:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.14.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 75,80 ****
--- 75,91 ----
/* not reached */
}

+
+
+ static void close_pipe P_((struct run_state *rs));
+ static void close_pipe(rs)
+ struct run_state *rs;
+ {
+ int *array = rs->ext_init_data;
+
+ close(array[0]);
+ }
+
static int GetPGPKey P_((char *name, char *target,
int targetsize, enum pgp_version v));

***************
*** 125,131 ****

for (;;) {
int fd[2];
!
if (pipe (fd) == -1) {
DPRINT(Debug,1,(&Debug,
"GetPGPKey()=-1: ERROR: pipe (errno %d)\n",
--- 136,151 ----

for (;;) {
int fd[2];
! int array[1];
! CONST char * argv[10];
! int code;
! int stat = -1;
!
! struct run_state RS;
!
! while (*c && isspace (*c)) c++; /* move past any leading space! */
! DPRINT(Debug,10,(&Debug, "GetPGPKey: c=%s\n",c));
!
if (pipe (fd) == -1) {
DPRINT(Debug,1,(&Debug,
"GetPGPKey()=-1: ERROR: pipe (errno %d)\n",
***************
*** 134,207 ****
return -1;
}

! while (*c && isspace (*c)) c++; /* move past any leading space! */

! DPRINT(Debug,10,(&Debug, "GetPGPKey: c=%s\n",c));

! if ((pid = fork()) == -1) {
! perror("fork");
! close(fd[0]);
! close(fd[1]);
! return -1;
! } else if (pid == 0) {
! int tmp = 0;

! if (-1 == setgid(groupid)) {


! int err = errno;

! fprintf(stderr,"GetPGPKey: setgid(%d) FAILED: %s\n",
! groupid,error_description(err));
! fflush(stderr);
! _exit(err);
! }
! if (-1 == setuid(userid)) {


! int err = errno;

! fprintf(stderr,"GetPGPKey: setuid(%d) FAILED: %s\n",
! userid,error_description(err));
! fflush(stderr);
! _exit(err);
! }

! close (fd[0]);
! close (1);
! dup (fd[1]);
! close (fd[1]);
!
! switch(v) {
! char *path;
! case pgp2:
!
! execl(pgp2_path,
! pgp2_path,"+verbose=0", "+language=en", "-kv", c,
! (char *)0);
! tmp = errno;
! perror(pgp2_path);
! break;
! case pgp5:
! path = elm_message(FRM("%s/pgpk"),pgp5_dir);
! execl(path,
! path, "+verbose=0","+language=en",
! "-l", c, (char *)0);
! tmp = errno;
! perror(path);
! break;
! case gpg:
! execl(gpg_path,
! gpg_path,"--list-public-keys",c,(char *)0);
! tmp = errno;
! perror(gpg_path);
! break;
! }
! _exit(tmp);
}

close (fd[1]);
p = fdopen (fd[0], "r");
if (p == NULL) {
DPRINT(Debug,1,(&Debug,
! "GetPGPKey()=-1: ERROR: fdopen (errno %d)\n", errno));
return -1;
}

while (fgets(buf, STRING, p) != NULL) {
DPRINT(Debug,10,(&Debug,
"GetPGPKey: %s\n",buf));
--- 154,228 ----
return -1;
}

! array[0] = fd[0];
! RS.save_errno = 0;
! RS.ext_init_data = array;
! RS.ext_init = close_pipe;
! RS.ext_env = NULL;
!
! switch(v) {
! static char path[1000];
! int n;

! case pgp2:
! n = 0;
!
! argv[n++] = pgp2_path;
! argv[n++] = "+verbose=0";
! argv[n++] = "+language=en";
! argv[n++] = "-kv";
! argv[n++] = c;
! argv[n] = NULL;
! break;

! case pgp5:
! n = 0;
! elm_sfprintf(path, sizeof path,FRM("%s/pgpk"),pgp5_dir);
! argv[n++] = path;
! argv[n++] = "+verbose=0";
! argv[n++] = "+language=en";
! argv[n++] = "-l";
! argv[n++] = c;
! argv[n] = NULL;
! break;

! case gpg:
! n = 0;

! argv[n++] = gpg_path;
! argv[n++] = "--list-public-keys";
! argv[n++] = c;
! argv[n++] = NULL;
! break;
}

+ code = start_run(&RS, SY_RUN_STATE_INIT, argv ,
+ -1,fd[1]);
+
close (fd[1]);
+
+ if (!code) {
+ DPRINT(Debug,1,(&Debug,
+ "GetPGPKey()=-1: running pgp/gpg failed\n"));
+ return -1;
+ }
+
+
p = fdopen (fd[0], "r");
if (p == NULL) {
+ int tmp;


+ int err = errno;

+
DPRINT(Debug,1,(&Debug,
! "GetPGPKey()=-1: ERROR: fdopen (errno %d)\n",
! err));
! kill(RS.pid,SIGTERM);
! wait_end(&RS,&tmp);
!
return -1;
}

+ retry:
while (fgets(buf, STRING, p) != NULL) {
DPRINT(Debug,10,(&Debug,
"GetPGPKey: %s\n",buf));
***************
*** 262,268 ****
--- 283,318 ----
}
}
}
+
+ if (ferror(p) && EINTR == errno) {
+ clearerr(p);
+ DPRINT(Debug,5,(&Debug,


+ "Reading of result interrupted (EINTR) -- retrying\n"));

+

+ if (0 == code) {
+ code = run_already_done(&RS,&stat);
+ if (0 != code) {

+ DPRINT(Debug,5,(&Debug,
+ "now pgp/gpg is completing\n"));
+ }
+ }
+
+ goto retry;
+ }
+
fclose(p);
+
+ if (0 == code)
+ code = wait_end(&RS,&stat);
+
+ if (code < 0) {
+ DPRINT(Debug,5,(&Debug,
+ "pgp/gpg dies on signal %d\n",
+ -code));
+ } else {
+ DPRINT(Debug,5,(&Debug,"pgp/gpgp exited with status %d\n",stat));
+ }
+
if (keys_len > 0 || i > 1)
break;
else {

Kari E. Hurtta

unread,
Jun 29, 2004, 1:29:59 PM6/29/04
to
Archive-name: elm2.4ME+/PL117

Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

files elm-2.4ME+PL117.patch.gz
and elm-2.4ME+117.tar.gz
for a moment (2).

Is available on ftp.funet.fi (or ftp.ipv6.funet.fi with IPv6)


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

files elm-2.4ME+PL117.patch.gz
and elm-2.4ME+117.tar.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL117.patch.gz >
and <URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+117.tar.gz >
via WWW.

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL117.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+117.tar.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL117.patch.gz >
and <URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+117.tar.gz >
via WWW.

(1) Was ftp.ozone.fmi.fi but name ftp.ozone.fmi.fi
will probably point to service which no have anonymous ftp
before ozone.fmi.fi retires. So use ozone.fmi.fi
for a moment instead of ftp.ozone.fmi.fi.

(2) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi.

Also ozone.fmi.fi will retire.

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL117.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

Undo Elm2.4ME+ PL116a (25) patch before applying this patch.

SUMMARY: This release collects patch Elm2.4ME+ PL116a,
implements reconnection to mailer=submission, adds
pgp-interactive and askmimeforward elmrc options
and prompts about mimeforward on f)orward command.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL116 (25) --------------------------------
Index: elm2.4.ME+.117-cvs/hdrs/patchlevel.h


Prereq: 1116400000
*** elm2.4.ME+.116/hdrs/patchlevel.h 2004-05-19 19:10:14.000000000 +0300

--- elm2.4.ME+.117-cvs/hdrs/patchlevel.h 2004-06-27 19:21:16.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "116 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.116
*/
! #define LAST_REPORT_TIME 1116400000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "May, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released May, 2004"

/*
* Local Variables:
--- 1,12 ----

! #define PATCHLEVEL "117 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.117
*/
! #define LAST_REPORT_TIME 1119000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Jun, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jun, 2004"

/*
* Local Variables:
Index: elm2.4.ME+.117-cvs/README.ME+


*** elm2.4.ME+.116/README.ME+ 2004-05-19 19:10:14.000000000 +0300

--- elm2.4.ME+.117-cvs/README.ME+ 2004-06-27 19:19:51.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.760 2004/05/19 12:02:16 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.776 2004/06/27 16:19:51 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,18 ****
--- 13,126 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL117 (25) compared with Elm2.4ME+ PL116 (25)
+ -------------------------------------------------------------------
+
+ SUMMARY: This release collects patch Elm2.4ME+ PL116a,
+ implements reconnection to mailer=submission, adds
+ pgp-interactive and askmimeforward elmrc options
+ and prompts about mimeforward on f)orward command.
+
+ - Fix debug output of dump_expanded_address()
+
+ - Implement reconnection for mailer=submission (however
+ reconnection is not implemented for mailer=sendmail-bs).
+ These mailer's open smtp (or submission) connection
+ to server before editor is started. That is done
+ for get capacity of mailer (for 8BITMIME). However
+ sometime that times out if editing tooks too long
+ and sending of mail fails.


+
+ - Trying send encrypted messages with gpg was giving
+ error message
+ Couldn't find key matching 'xxx@yyy'
+ Problem noted by: Olivier COLIN <dodo.o...@wanadoo.fr>
+ (and probably others)
+ > Make GetPGPKey() retry reading of result on case of
+ interrupt.
+
+ - GetPGPKey() was not collect status of exted gpg and
+ was left lot of defunct processes. Converted code to
+ use start_run().
+
+ - Reprint last error on "Mail Pre-Send Screen" after
+ clearing screen.
+

+ - Added pgp-interactive option to elmrc. Setting that
+ disables batch mode of pgp/gpg when encrypting/signing
+ mail.


+
+ - Alternatives and weedout and list was replaced with Q letters
+ Problem noted by: Cyrille Lefevre <cyrille...@laposte.net>
+

+ - Do not quote addresses on alternatives.

+
+ - Added elmrc variable type rc_DT_ESTR (aka kind
+ of expanded string).
+ - Reimplemented elmrc variable "pager" as rc_DT_ESTR
+ - Reimplemented elmrc variable "editor" as rc_DT_ESTR
+ - Reimplemented elmrc variable "calendar" as rc_DT_ESTR
+ - Reimplemented elmrc variable "localsignature" as rc_DT_ESTR
+ - Reimplemented elmrc variable "remotesignature" as rc_DT_ESTR
+ - Reimplemented elmrc variable "receivedmail" as rc_DT_ESTR
+ - Reimplemented elmrc variable "sentmail" as rc_DT_ESTR
+ - Reimplemented elmrc variable "incoming-mailbox" as rc_DT_ESTR
+ - Removed valid_rc_type()
+
+ - Add package test to Configure (as it is done Elm ME+ 2.5)
+ for case that wrong config.sh is used.
+
+ - Added malloc_gets() to lib/mail_gets.c
+
+ - Changed send_msg_l(), mail(), mail_form(),
+ mail_filled_in_form(), forward(), reply_to_everyone(),
+ and reply() to use index, mailbox instead of
+ current_header, infile, mailbox.
+
+ - Added give_next_open_mailbox() or src/messages.c and
+ made save_copy() to use it.
+
+ - Moved defination of struct mv_storage and
+ struct mv_digest out from src/messages/def_messages.h
+
+ - When mail is forwarded mail, user is prompted
+ Forward message as separate part?
+ default value of answer depends "mimeforward"
+ elmrc option. Setting elmrc option "askmimeforward"
+ to OFF disables that prompt.
+
+ - Added expanded_address_from_items() to
+ lib/outheaders.c
+
+ - Removed class_charset() from melib/mime_parse.c


+
+ New elmrc options:

+ pgp-interactive
+ askmimeforward
+
+ Changes of Elm2.4ME+ PL116a (25) compared with Elm2.4ME+ PL116 (25)
+ -------------------------------------------------------------------
+

+ - Alternatives and weedout and list was replaced with Q letters
+ Problem noted by: Cyrille Lefevre <cyrille...@laposte.net>
+
+ - Reprint last error on "Mail Pre-Send Screen" after
+ clearing screen.
+
+ - Trying send encrypted messages with gpg was giving
+ error message
+ Couldn't find key matching 'xxx@yyy'
+ Problem noted by: Olivier COLIN <dodo.o...@wanadoo.fr>
+ (and probably others)
+ > Make GetPGPKey() retry reading of result on case of
+ interrupt.
+
+ - GetPGPKey() was not collect status of exted gpg and
+ was left lot of defunct processes. Converted code to
+ use start_run().
+
+ - Do not quote addresses on alternatives.

+
Changes of Elm2.4ME+ PL116 (25) compared with Elm2.4ME+ PL115 (25)

-------------------------------------------------------------------

***************
*** 24,30 ****


of folder fails, reimplements
"alternatives" and "weedout" elmrc variables,
changes elm.filelist format (adds subcommand

! "copydoc" to elmregister), adds -s option


to elmregister and adds RFC 2919 List-ID to
list of known headers.

--- 132,138 ----


of folder fails, reimplements
"alternatives" and "weedout" elmrc variables,
changes elm.filelist format (adds subcommand

! "copydoc" to elmregister), adds -s option


to elmregister and adds RFC 2919 List-ID to
list of known headers.

***************
*** 91,103 ****


on result of hdr_decode_from_phrase() on

lib/headers.c

! - If on header editing screen incoked editor
! and address was on form '"a" <b> (c)",


and then edited it on header editing screen

! address become as '"a" <b> (c('. Changed
! on '(' to ')' on make_surface_addr() on
! lib/outheaders.c
!


Changes of Elm2.4ME+ PL115a (25) compared with Elm2.4ME+ PL115 (25)

-------------------------------------------------------------------
--- 199,210 ----


on result of hdr_decode_from_phrase() on

lib/headers.c

! - If on header editing screen incoked editor
! and address was on form '"a" <b> (c)",


and then edited it on header editing screen

! address become as '"a" <b> (c('. Changed
! on '(' to ')' on make_surface_addr() on
! lib/outheaders.c



Changes of Elm2.4ME+ PL115a (25) compared with Elm2.4ME+ PL115 (25)

-------------------------------------------------------------------
Index: elm2.4.ME+.117-cvs/Configure
*** elm2.4.ME+.116/Configure 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.117-cvs/Configure 2004-06-18 23:40:55.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150 2004/03/27 18:31:35 hurtta Exp $


#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.151 2004/06/18 20:40:55 hurtta Exp $
#

: sanity checks
***************


*** 777,782 ****
--- 777,783 ----
echo $n "$rp $c"
. myread

+ save_package="$package"
if test "$config" != "" ; then
echo "Fetching default answers from your old $config file..."
. ../$config
***************
*** 800,805 ****

--- 801,820 ----
esac
fi

+

+ if test "$save_package" != "$package" ; then
+
+ echo
+ echo "WARNING! Saved configuration is for $package and not for $save_package"
+ echo
+ sleep 5
+
+ # FIX paths
+ stage_dir="`echo \"$stage_dir\" | sed \"s/$package/$save_package/\"`"
+
+ package="$save_package"
+ fi
+
cat <<EOH

If you want Configure to search programs from some unusual directory first,

Index: elm2.4.ME+.117-cvs/doc/elmrc-info
*** elm2.4.ME+.116/doc/elmrc-info 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/doc/elmrc-info 2004-06-27 18:18:05.000000000 +0300
***************
*** 1,4 ****


! #@(#)$Id: elmrc-info,v 1.62 2004/05/01 19:08:18 hurtta Exp $
# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.64 2004/06/27 15:18:05 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************

*** 635,640 ****
--- 635,648 ----
# messages so that the receiver can correctly view the message!
# OFF: Elm will include the forwarded message in your editor instead
# of making it an separate mime body part.
+ #
+ # See also: askmimeforward
+
+ askmimeforward
+ # This option controls is forwarding as message/rfc822 prompted or not
+ # if set, option mnimeforward controls only default value for prompt
+ #
+ # See also: mimeforward

quoteforward
# Forwarded messages are quoted like replies, rather than included
***************
*** 675,680 ****
--- 683,691 ----
# none Don't call gpg
# /path Call gpg via that path, if it is executable

+ pgp-interactive
+ # Run pgp/gpg signing and encryption always on interactive mode
+
pgp-sign-type
# Specifies content-type for pgp signed messages.
# Possible values are: application/pgp, text/plain, text/x-pgp
Index: elm2.4.ME+.117-cvs/hdrs/defs.h
*** elm2.4.ME+.116/hdrs/defs.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/hdrs/defs.h 2004-06-20 21:03:06.000000000 +0300
***************
*** 1,7 ****


! /* $Id: defs.h,v 1.46 2004/05/01 13:18:50 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: defs.h,v 1.47 2004/06/20 18:03:06 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 132,137 ****
--- 132,138 ----
#define MAIL_FORWARDING (1<<4)


#define MAIL_HAVE_ATTACHMENTS (1<<5) /* Flag for verify transmission */

#define MAIL_HAVE_PGP_ENCODED (1<<6) /* Falg for verify transmission */

+ #define MAIL_MIME_ATTCH (1<<7) /* mimeforward */



/* xxx_ACCESS moved to down after including of unistd.h */

Index: elm2.4.ME+.117-cvs/hdrs/elmlib.h
*** elm2.4.ME+.116/hdrs/elmlib.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/hdrs/elmlib.h 2004-06-27 18:18:05.000000000 +0300
***************
*** 1,7 ****


! /* $Id: elmlib.h,v 1.209 2004/05/01 19:08:18 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.209 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.215 2004/06/27 15:18:05 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.215 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 242,247 ****
--- 242,258 ----

extern int mail_gets P_((char *,int,FILE *));

+ /* malloc_gets added by Kari Hurtta
+ Do not return \n
+ reallocs *buffer
+
+ return -1 if limit exceeded, buffer is still alloced
+ return -2 if error or if feof() is true before reading anything
+
+ limit == -1 no limit
+ */
+ extern int malloc_gets P_((char **buffer, int limit, FILE *mailfile));
+
/* move_left.c */

extern void move_left P_((char *,int));
***************
*** 648,653 ****
--- 659,673 ----
extern char * give_dt_path_as_str P_((struct dt_path_info *ptr,
char * fieldname));

+ typedef struct dt_estr_info ESTR;
+
+ extern char * give_dt_estr_as_str P_((struct dt_estr_info *ptr,
+ char * fieldname));
+
+ /* Set initial value */
+ extern void set_dt_estr P_((struct dt_estr_info *ptr,
+ CONST char *const_val,
+ char *def_env));

/* lib/read_rc.c */

***************
*** 700,712 ****
extern char user_iso2022_sets[SLEN]; /* .elm/iso2022.sets */
extern char user_terminal_info[SLEN]; /* .elm/terminal.info */
extern char user_mail_services[SLEN]; /* .elm/mail.services */
! extern char defaultfile[SLEN]; /* name of default folder */
! extern char raw_defaultfile[SLEN]; /* Name of default folder */
! extern char calendar_file[SLEN]; /* name of file for clndr */
! extern char raw_calendar_file[SLEN]; /* unexpanded name of file for clndr */

extern nl_catd elm_msg_cat; /* message catalog */
- extern int clear_pages; /* flag: clear screen w/ builtin pgr? */
extern int title_messages; /* flag: title message display? */
extern char home[SLEN]; /* home directory of user */
extern char username[SLEN]; /* return address name! */
--- 720,729 ----
extern char user_iso2022_sets[SLEN]; /* .elm/iso2022.sets */
extern char user_terminal_info[SLEN]; /* .elm/terminal.info */
extern char user_mail_services[SLEN]; /* .elm/mail.services */
! extern ESTR defaultfile_e; /* name of default folder */
! extern ESTR calendar_file_e; /* name of file for clndr */

extern nl_catd elm_msg_cat; /* message catalog */
extern int title_messages; /* flag: title message display? */
extern char home[SLEN]; /* home directory of user */
extern char username[SLEN]; /* return address name! */
***************
*** 734,739 ****
--- 751,758 ----
extern int prompt_for_cc; /* flag: prompt user for 'cc' value? */
#ifdef USE_PGP
extern int pgp_askpgpsig; /* Should pgp ask userid to sign messages with? */
+ extern int pgp_interactive; /* Should pgp/gpg encryption/signing to be
+ run always on interactive mode */
extern int pgp_sign_type; /* 0 = application/pgp


1 = text/plain
2 = text/x-pgp

***************
*** 786,797 ****
extern charset_t wanted_display_charset; /* name of character set */
extern int DSN_success; /* flag: Ask successfull DSNes */
extern char e_editor[SLEN]; /* "~e" editor... */
! extern char editor[SLEN]; /* default editor for mail */
extern int env_from_source; /* 0 == forward-from,


1 == from,
2 == return-path
*/

! extern char raw_editor[SLEN]; /* unexpanded default editor for mail */
extern char escape_char; /* '~' or something else... */
extern int force_name; /* flag: save by name forced? */
extern int fragment_handling; /* 0 == none,
--- 805,816 ----
extern charset_t wanted_display_charset; /* name of character set */
extern int DSN_success; /* flag: Ask successfull DSNes */
extern char e_editor[SLEN]; /* "~e" editor... */
! extern ESTR editor_e; /* editor for outgoing mail*/
extern int env_from_source; /* 0 == forward-from,


1 == from,
2 == return-path
*/
!

extern char escape_char; /* '~' or something else... */
extern int force_name; /* flag: save by name forced? */
extern int fragment_handling; /* 0 == none,
***************
*** 818,825 ****


3 == non-spool */
extern char raw_local_fs_charset[SLEN]; /* filesystem charset */
extern charset_t local_fs_charset; /* filesystem charset */

! extern char local_signature[SLEN];/* local msg signature file */
! extern char raw_local_signature[SLEN];/* unexpanded local msg signature file */
extern int lockfolders; /* Lock folder when open */
extern int lock_in_copy; /* Lock folder when copied to it */
extern char folders[SLEN]; /* folder home directory */
--- 837,843 ----


3 == non-spool */
extern char raw_local_fs_charset[SLEN]; /* filesystem charset */
extern charset_t local_fs_charset; /* filesystem charset */

! extern ESTR local_signature_e; /* local msg signature file */
extern int lockfolders; /* Lock folder when open */
extern int lock_in_copy; /* Lock folder when copied to it */
extern char folders[SLEN]; /* folder home directory */
***************
*** 840,845 ****
--- 858,864 ----


extern int internal_mailcap_t_prompt; /* ... really? */

extern int metoo; /* flag: copy me on mail to alias? */
extern int mimeforward;
+ extern int askmimeforward;


extern int mime_body_keywords; /* flag: if false the body is not parsed for keywords */

extern int move_when_paged; /* flag: move when '+' or '-' used? */
extern int names_only; /* flag: display names but no addrs? */
***************
*** 854,861 ****
extern int page_known_charsets;
extern int pagemultipart;
extern int pagesigned;
! extern char pager[SLEN]; /* what pager to use... */
! extern char raw_pager[SLEN]; /* unexpanded what pager to use... */
#ifdef USE_PGP
extern char pgp2_path[SLEN]; /* Pgp2 path or "none" if no pgp2 */
extern char raw_pgp2_path[SLEN];
--- 873,879 ----
extern int page_known_charsets;
extern int pagemultipart;
extern int pagesigned;
! extern ESTR pager_e; /* what pager to use... */
#ifdef USE_PGP
extern char pgp2_path[SLEN]; /* Pgp2 path or "none" if no pgp2 */
extern char raw_pgp2_path[SLEN];
***************
*** 874,891 ****


extern int quote_forward; /* flag: fwd'd msgs quoted like replies */
extern int readdatapercentinc; /* data percent increment during new mbox read */
extern int readmsginc; /* msg cnt increment during new mbox read */

! extern char recvd_mail[SLEN]; /* folder for storing received mail */
! extern char raw_recvdmail[SLEN];/* unexpanded recvd_mail name */
! extern char remote_signature[SLEN];/* remote msg signature file */
! extern char raw_remote_signature[SLEN];/* unexpanded remote msg signature file*/
extern int req_mime_bodyencoding;


extern int req_mime_hdrencoding;
extern int resolve_mode; /* flag: resolve before moving mode? */

extern int save_by_name; /* flag: save mail by login name? */
! extern char sent_mail[SLEN]; /* name of file to save copies to */
extern int set_window_title; /* flag: set (xterm?) window title and
icon name */
- extern char raw_sentmail[SLEN]; /* unexpanded name of file to save to */
extern char shell[SLEN]; /* default system shell */
extern char raw_shell[SLEN]; /* unexpanded default system shell */
#ifdef USE_PGP
--- 892,906 ----


extern int quote_forward; /* flag: fwd'd msgs quoted like replies */
extern int readdatapercentinc; /* data percent increment during new mbox read */
extern int readmsginc; /* msg cnt increment during new mbox read */

! extern ESTR recvd_mail_e; /* folder for storing received mail */
! extern ESTR remote_signature_e;/* remote msg signature file */
extern int req_mime_bodyencoding;


extern int req_mime_hdrencoding;
extern int resolve_mode; /* flag: resolve before moving mode? */

extern int save_by_name; /* flag: save mail by login name? */
! extern ESTR sent_mail_e; /* name of file to save copies to */
extern int set_window_title; /* flag: set (xterm?) window title and
icon name */
extern char shell[SLEN]; /* default system shell */
extern char raw_shell[SLEN]; /* unexpanded default system shell */
#ifdef USE_PGP
***************
*** 1961,1966 ****
--- 1976,1988 ----
extern int query_mailer_info P_((struct mailer_info *I,
enum MI_query query));

+ /* -1 if connection lost
+ 0 if OK
+ 1 if mailer reinitialized and query_mailer_info()
+ need to be called again
+ */
+ extern int mailer_restarted P_((struct mailer_info *I));
+
/* Should return 1 if verify succees and fields of result to be filled
-- caller should free fields of result
Returns 0 on failure
***************
*** 2079,2084 ****
--- 2101,2109 ----
extern void dump_expanded_address P_((int debuglevel, const char *text,
struct expanded_address expanded));

+ extern void expanded_address_from_items P_((struct expanded_address *result,
+ struct addr_item *TMP));
+

struct mailing_headers {
unsigned short magic; /* MAIL_HDR_magic */
Index: elm2.4.ME+.117-cvs/hdrs/mailer_imp.h
*** elm2.4.ME+.116/hdrs/mailer_imp.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.117-cvs/hdrs/mailer_imp.h 2004-05-23 15:31:00.000000000 +0300
***************
*** 1,7 ****
! /* $Id: mailer_imp.h,v 1.7 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! /* $Id: mailer_imp.h,v 1.8 2004/05/23 12:31:00 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 37,42 ****
--- 37,51 ----
struct mailer_info *I,
enum MI_query query));

+ /* Return
+ 1 == mailer restarted, reconnect succeed -- reask info
+ 0 == mailer not disconnected
+ -1 == mailer disconnected, reconnect failed
+ */
+ typedef int mailer_info_restart_hook P_((struct mailer_config *M,
+ struct mailer_info *I));
+
+
/* Return
-1 if caller should result with default data (return 1)
-2 if caller should just test passwd
***************
*** 88,93 ****
--- 97,103 ----
mailer_info_verify_addr * mi_verify_addr;
mailer_info_gen_def_ef * mi_def_env_from;
mailer_info_set_ef * mi_set_env_from;
+ mailer_info_restart_hook * mi_restart_hook;

int mailer_bits;
/* TODO: Add to this mailer specific data
Index: elm2.4.ME+.117-cvs/hdrs/me.h
*** elm2.4.ME+.116/hdrs/me.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/hdrs/me.h 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****


! /* $Id: me.h,v 1.89 2004/05/02 11:15:26 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.89 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.92 2004/06/18 20:40:56 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.92 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 356,363 ****
/* mime.c */

extern int have_metamail P_((void));
! extern void clear_mime_send_info P_((mime_send_t *mime_info,
! struct mailer_info *mailer_info));
extern void free_mime_send_info P_((mime_send_t *mime_info));
extern void add_paramater_1 P_((char **ptr, char *name,
char *value, int quoted));
--- 356,362 ----
/* mime.c */

extern int have_metamail P_((void));
! extern void clear_mime_send_info P_((mime_send_t *mime_info));
extern void free_mime_send_info P_((mime_send_t *mime_info));
extern void add_paramater_1 P_((char **ptr, char *name,
char *value, int quoted));
***************
*** 486,492 ****


extern int a_sendmsg P_((int edit_message, int form_letter,
! struct MailboxView *mailbox /* save_copy needs */,
struct AliasView *aview, int header_page,
struct menu_context *page));
extern int send_msg_argv P_((char *argv[],
--- 485,491 ----


extern int a_sendmsg P_((int edit_message, int form_letter,
! struct MailboxView *mailbox,
struct AliasView *aview, int header_page,
struct menu_context *page));
extern int send_msg_argv P_((char *argv[],
***************
*** 495,507 ****
struct AliasView *aview,
struct menu_context *page));

! extern int send_msg_l P_((struct header_rec * current_header,
struct addr_item *given_to,
struct addr_item *given_cc,
char *given_subject,
int options, int form_letter,
! FILE *infile,
! struct MailboxView *mailbox /* for save_copy */,
struct AliasView *aview,
struct menu_context *page
));
--- 494,505 ----
struct AliasView *aview,
struct menu_context *page));

! extern int send_msg_l P_((int index,
struct addr_item *given_to,
struct addr_item *given_cc,
char *given_subject,
int options, int form_letter,
! struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page
));
***************
*** 512,517 ****
--- 510,516 ----
struct AliasView *aview,
struct menu_context *page));

+
/* mailmsg2.c */

#if ANSI_C
***************
*** 519,535 ****
#endif


! extern int mail P_((struct header_rec *current_header,
int options, int form,

struct mailing_headers *headers,
struct mailer_info *mailer_info,

! FILE *infile,
! struct MailboxView *mailbox,
struct AliasView *aview));
! extern int mail_form P_((struct header_rec *current_header,
struct addr_item *address,
char *subj,
- FILE *infile,


struct MailboxView *mailbox,
struct AliasView *aview));

--- 518,532 ----
#endif


! extern int mail P_((int idx,
int options, int form,

struct mailing_headers *headers,
struct mailer_info *mailer_info,

! struct MailboxView *mailbox /* system_call() */,
struct AliasView *aview));
! extern int mail_form P_((int mail_index,
struct addr_item *address,
char *subj,


struct MailboxView *mailbox,
struct AliasView *aview));

***************
*** 538,547 ****

/* froms.c */

! extern int mail_filled_in_form P_((struct header_rec * current_header,
struct addr_item *address,
char *subject,
- FILE *infile,
struct MailboxView *
mailbox /* for save_copy */,
struct AliasView *aview));
--- 535,543 ----

/* froms.c */

! extern int mail_filled_in_form P_((int mail_index,
struct addr_item *address,
char *subject,
struct MailboxView *
mailbox /* for save_copy */,
struct AliasView *aview));
***************
*** 602,608 ****
int form,


mime_send_t *mime_info,
FILE * conv_file,

- struct MailboxView *mailbox,


struct menu_context *page));

extern int append_copy_to_file P_((struct mailing_headers * headers,

--- 598,603 ----
***************
*** 714,733 ****
extern void get_return_name P_((char *address, char *name,
int trans_to_lowercase,
int size));
! extern int forward P_((struct header_rec *hdr,
! FILE *infile,
struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));
! extern int reply_to_everyone P_((struct header_rec *hdr,
! FILE *infile,
! struct MailboxView *mailbox
! /* for save_copy */,
struct AliasView *aview,
struct menu_context *page));
! extern int reply P_((struct header_rec *hdr,
! FILE *infile,
! struct MailboxView *mailbox /* for save_copy */,
struct AliasView *aview,
struct menu_context *page));

--- 709,724 ----
extern void get_return_name P_((char *address, char *name,
int trans_to_lowercase,
int size));
! extern int forward P_((int index,
struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));
! extern int reply_to_everyone P_((int index,
! struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));
! extern int reply P_((int index,
! struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));

***************
*** 803,808 ****
--- 794,807 ----
struct menu_context *page
));

+ extern int no_editor_edit_the_message P_((char *filename,
+ struct mailing_headers * headers,
+ charset_t file_set,
+ struct mailer_info *mailer_info,
+ struct MailboxView *mailbox
+ /* needed for system_call() */,
+ struct AliasView *aview
+ ));

/* delete.c */

***************
*** 1004,1009 ****
--- 1003,1014 ----

extern struct MailboxView * current_mailbox;

+ /* Better handling of current mailbox:
+ idx == 0 first
+ */
+
+ extern struct MailboxView * give_next_open_mailbox P_((int *idx,
+ int signal));

/* Joins storage to new view */
extern struct MailboxView * malloc_mailbox_view P_((struct current_storage *
***************
*** 1093,1099 ****
struct counter_data *counter,
parse_mime_callback *parse_mime));

-
extern void write_mailbox_info P_((FILE *fp, struct MailboxView *mailbox));

/* caller must string_free() result -- calculated if not set */
--- 1098,1103 ----
***************
*** 1117,1123 ****



extern int have_partial P_((struct MailboxView *parent_mailbox));

-
/* screen/screen.c */



extern int InitScreen P_((struct menu_context **page));

--- 1121,1126 ----
Index: elm2.4.ME+.117-cvs/hdrs/rc_imp.h
*** elm2.4.ME+.116/hdrs/rc_imp.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/hdrs/rc_imp.h 2004-06-18 12:29:50.000000000 +0300
***************
*** 1,7 ****


! /* $Id: rc_imp.h,v 1.12 2004/05/01 19:08:18 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: rc_imp.h,v 1.13 2004/06/18 09:29:50 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 29,35 ****
--- 29,40 ----
/* Returns pointer to static buffer */
typedef char * rc_get_value P_((struct rc_save_info_rec *r));

+ #define RCTYPE_magic 0xF402
+
extern struct rc_type {
+ unsigned short magic; /* RCTYPE_magic */
+
+
rc_parse_line * parse_line; /* Parse line */
rc_parse_cline * parse_cline; /* Parse continuation line */
rc_print_value * print_value;
***************
*** 38,44 ****
} rc_DT_SYN, rc_DT_STR, rc_DT_NUM, rc_DT_BOL,


rc_DT_CHR, rc_DT_SRT,
rc_DT_MLT, rc_DT_ASR, rc_DT_PRM, rc_DT_FUNC,

! rc_DT_LONG, rc_DT_PATH, rc_DT_OBS;

extern int valid_rc_type P_((struct rc_type *T));

--- 43,49 ----
} rc_DT_SYN, rc_DT_STR, rc_DT_NUM, rc_DT_BOL,


rc_DT_CHR, rc_DT_SRT,
rc_DT_MLT, rc_DT_ASR, rc_DT_PRM, rc_DT_FUNC,

! rc_DT_LONG, rc_DT_PATH, rc_DT_OBS, rc_DT_ESTR;

extern int valid_rc_type P_((struct rc_type *T));

***************
*** 76,81 ****
--- 81,90 ----


extern int expand_dt_path P_((struct dt_path_info *ptr, char *fieldname,
char *val, int recursive));

+ extern int expand_dt_estr P_((struct dt_estr_info *ptr,
+ char *fieldname,
+ char *val));


+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.117-cvs/hdrs/save_opts.h
*** elm2.4.ME+.116/hdrs/save_opts.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/hdrs/save_opts.h 2004-06-27 18:18:05.000000000 +0300
***************
*** 1,7 ****


! /* @(#)$Id: save_opts.h,v 1.84 2004/05/01 19:08:19 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.84 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* @(#)$Id: save_opts.h,v 1.87 2004/06/27 15:18:05 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 57,62 ****
--- 57,70 ----
char ** list;
};

+ #define ESTR_meta 1
+
+ struct dt_estr_info {
+ int flags;
+ char * unexpanded;
+ char * expanded;
+ };
+
#ifdef USE_DLOPEN
struct dt_shared_info {
struct shared_loader *loader;
***************
*** 93,99 ****
#ifdef USE_DLOPEN
struct dt_shared_info *shared;
#endif
! void *dummy;
} val;
option_func *func_val;
int size_val;
--- 101,108 ----
#ifdef USE_DLOPEN
struct dt_shared_info *shared;
#endif
! struct dt_estr_info *estr;
! void *dummy;
} val;
option_func *func_val;
int size_val;
***************
*** 132,137 ****
--- 141,147 ----


#define ZZZ_DT_PATH(A) &rc_DT_PATH,0, { path: A }, null_option_func
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, { str: NULL }, null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, { shared: A }, null_option_func

+ #define ZZZ_DT_ESTR(A) &rc_DT_ESTR,0, { estr: A }, null_option_func
#else


***************
*** 172,177 ****
--- 182,188 ----


#define ZZZ_DT_PATH(A) &rc_DT_PATH,0, (char *)A, null_option_func
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, NULL , null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, (char *)A, null_option_func

+ #define ZZZ_DT_ESTR(A) &rc_DT_ESTR,0, (char *)A, null_option_func
#endif

/* shared.c */
***************
*** 252,257 ****
--- 263,269 ----


{"arrow", -1L,ZZZ_DT_BOL_(FL_OR,&arrow_cursor), 0, NULL},

{"ask", -1L,ZZZ_DT_BOL(&question_me), 0, NULL},
{"askcc", -1L,ZZZ_DT_BOL(&prompt_for_cc), 0, NULL},

+ {"askmimeforward", -1L,ZZZ_DT_BOL(&askmimeforward), 0, NULL},


#ifdef USE_PGP
{"askpgpsig", -1L,ZZZ_DT_BOL(&pgp_askpgpsig), 0, NULL},
#endif

***************
*** 275,282 ****

{"browser-wildcard-matching", -1L,ZZZ_DT_BOL(&browser_wildcards), 0, NULL},
{"builtinlines", -1L,ZZZ_DT_NUM(&builtin_lines), 0, NULL},
! {"calendar", -1L,ZZZ_DT_STR(raw_calendar_file),
! sizeof raw_calendar_file, NULL},
{"cc", -1L,ZZZ_DT_SYN("askcc"), 0, NULL},
{"charset", -1L,ZZZ_DT_SYN("text-charset"), 0, NULL},
{"charset-convert-ok", -1L,ZZZ_DT_BOL(&charset_convert_ok), 0, NULL},
--- 287,293 ----

{"browser-wildcard-matching", -1L,ZZZ_DT_BOL(&browser_wildcards), 0, NULL},
{"builtinlines", -1L,ZZZ_DT_NUM(&builtin_lines), 0, NULL},
! {"calendar", -1L,ZZZ_DT_ESTR(&calendar_file_e), 0, NULL},
{"cc", -1L,ZZZ_DT_SYN("askcc"), 0, NULL},
{"charset", -1L,ZZZ_DT_SYN("text-charset"), 0, NULL},
{"charset-convert-ok", -1L,ZZZ_DT_BOL(&charset_convert_ok), 0, NULL},
***************
*** 301,307 ****


sizeof raw_display_charset, NULL},
{"dsn-success", -1L,ZZZ_DT_BOL(&DSN_success), 0, NULL },
{"easyeditor", -1L,ZZZ_DT_STR(e_editor), sizeof e_editor, NULL},

! {"editor", -1L,ZZZ_DT_STR(raw_editor), sizeof raw_editor, NULL},


{"env-from-source", -1L,ZZZ_DT_NUM(&env_from_source),
sizeof env_from_source, &ENV_FROM_SOURCE},

{"escape", -1L,ZZZ_DT_CHR(&escape_char), 0, NULL},
--- 312,318 ----


sizeof raw_display_charset, NULL},
{"dsn-success", -1L,ZZZ_DT_BOL(&DSN_success), 0, NULL },
{"easyeditor", -1L,ZZZ_DT_STR(e_editor), sizeof e_editor, NULL},

! {"editor", -1L,ZZZ_DT_ESTR(&editor_e), 0, NULL},


{"env-from-source", -1L,ZZZ_DT_NUM(&env_from_source),
sizeof env_from_source, &ENV_FROM_SOURCE},

{"escape", -1L,ZZZ_DT_CHR(&escape_char), 0, NULL},
***************
*** 340,347 ****


{"imap-show-warning", -1L,ZZZ_DT_BOL(&IMAP_show_warning), 0, NULL},
{"imap-use-examine", -1L,ZZZ_DT_BOL(&IMAP_use_examine), 0, NULL},
#endif

! {"incoming-mailbox", -1L,ZZZ_DT_STR(raw_defaultfile),
! sizeof raw_defaultfile, NULL },


{"internal-mailcap-prompt-trusted", -1L,
ZZZ_DT_BOL(&internal_mailcap_t_prompt), 0, NULL },
{"internal-mailcap-trusted-programs",

--- 351,357 ----


{"imap-show-warning", -1L,ZZZ_DT_BOL(&IMAP_show_warning), 0, NULL},
{"imap-use-examine", -1L,ZZZ_DT_BOL(&IMAP_use_examine), 0, NULL},
#endif

! {"incoming-mailbox", -1L,ZZZ_DT_ESTR(&defaultfile_e), 0, NULL },


{"internal-mailcap-prompt-trusted", -1L,
ZZZ_DT_BOL(&internal_mailcap_t_prompt), 0, NULL },
{"internal-mailcap-trusted-programs",
***************

*** 362,369 ****
{"local-sessionlock-use-home", -1L, ZZZ_DT_NUM_(FL_SYS,
&local_sessionlock_use_home),
0, &local_sessionlock_list },
! {"localsignature", -1L,ZZZ_DT_STR(raw_local_signature),
! sizeof raw_local_signature, NULL},
#ifdef SYSCALL_LOCKING
{"lock-folders", -1L,ZZZ_DT_BOL(&lockfolders),0, NULL},
{"lock-in-copy", -1L,ZZZ_DT_BOL(&lock_in_copy),0, NULL},
--- 372,378 ----
{"local-sessionlock-use-home", -1L, ZZZ_DT_NUM_(FL_SYS,
&local_sessionlock_use_home),
0, &local_sessionlock_list },
! {"localsignature", -1L,ZZZ_DT_ESTR(&local_signature_e), 0, NULL},
#ifdef SYSCALL_LOCKING
{"lock-folders", -1L,ZZZ_DT_BOL(&lockfolders),0, NULL},
{"lock-in-copy", -1L,ZZZ_DT_BOL(&lock_in_copy),0, NULL},
***************
*** 403,412 ****
{"page-known-charsets", -1L,ZZZ_DT_BOL(&page_known_charsets), 0, NULL},
{"pagealternative", -1L,ZZZ_DT_BOL(&pagealternative), 0, NULL},
{"pagemultipart", -1L,ZZZ_DT_BOL(&pagemultipart), 0, NULL},
! {"pager", -1L,ZZZ_DT_STR(raw_pager), sizeof raw_pager, NULL},
{"pagesigned", -1L,ZZZ_DT_BOL(&pagesigned), 0, NULL},
#ifdef USE_PGP
{"pgp", -1L,ZZZ_DT_SYN("pgp2"), 0, NULL},
{"pgp-sign-type", -1L,ZZZ_DT_NUM(&pgp_sign_type),
sizeof pgp_sign_type, &PGP_SIGN_TYPE},
{"pgp-version", -1L,ZZZ_DT_PGPVER(&send_pgp_version),
--- 412,422 ----
{"page-known-charsets", -1L,ZZZ_DT_BOL(&page_known_charsets), 0, NULL},
{"pagealternative", -1L,ZZZ_DT_BOL(&pagealternative), 0, NULL},
{"pagemultipart", -1L,ZZZ_DT_BOL(&pagemultipart), 0, NULL},
! {"pager", -1L,ZZZ_DT_ESTR(&pager_e), 0, NULL},
{"pagesigned", -1L,ZZZ_DT_BOL(&pagesigned), 0, NULL},
#ifdef USE_PGP
{"pgp", -1L,ZZZ_DT_SYN("pgp2"), 0, NULL},
+ {"pgp-interactive", -1L,ZZZ_DT_BOL(&pgp_interactive), 0, NULL},
{"pgp-sign-type", -1L,ZZZ_DT_NUM(&pgp_sign_type),
sizeof pgp_sign_type, &PGP_SIGN_TYPE},
{"pgp-version", -1L,ZZZ_DT_PGPVER(&send_pgp_version),
***************
*** 435,444 ****


{"quoteforward", -1L,ZZZ_DT_BOL(&quote_forward), 0, NULL},
{"readdatapercentinc", -1L,ZZZ_DT_NUM(&readdatapercentinc), 0, NULL},

{"readmsginc", -1L,ZZZ_DT_NUM(&readmsginc), 0, NULL},
! {"receivedmail", -1L,ZZZ_DT_STR(raw_recvdmail),
! sizeof raw_recvdmail, NULL},
! {"remotesignature", -1L,ZZZ_DT_STR(raw_remote_signature),
! sizeof raw_remote_signature, NULL},


{"require-mime-version-for-body-encoding",
-1L,ZZZ_DT_BOL(&req_mime_bodyencoding), 0, NULL},
{"require-mime-version-for-hdr-encoding",

--- 445,452 ----


{"quoteforward", -1L,ZZZ_DT_BOL(&quote_forward), 0, NULL},
{"readdatapercentinc", -1L,ZZZ_DT_NUM(&readdatapercentinc), 0, NULL},

{"readmsginc", -1L,ZZZ_DT_NUM(&readmsginc), 0, NULL},
! {"receivedmail", -1L,ZZZ_DT_ESTR(&recvd_mail_e), 0, NULL},
! {"remotesignature", -1L,ZZZ_DT_ESTR(&remote_signature_e), 0, NULL},


{"require-mime-version-for-body-encoding",
-1L,ZZZ_DT_BOL(&req_mime_bodyencoding), 0, NULL},
{"require-mime-version-for-hdr-encoding",

***************
*** 450,457 ****
{"saveto", -1L,ZZZ_DT_SYN("sentmail"), 0, NULL},
{"send-mime-plain-text", -1L, ZZZ_DT_BOL(&send_mime_plain),
sizeof send_mime_plain, NULL },
! {"sentmail", -1L,ZZZ_DT_STR(raw_sentmail),
! sizeof raw_sentmail, NULL},
{"set-window-title", -1L, ZZZ_DT_BOL(&set_window_title),


sizeof set_window_title, NULL },
{"shell", -1L,ZZZ_DT_STR(raw_shell), sizeof raw_shell, NULL},

--- 458,464 ----
{"saveto", -1L,ZZZ_DT_SYN("sentmail"), 0, NULL},
{"send-mime-plain-text", -1L, ZZZ_DT_BOL(&send_mime_plain),
sizeof send_mime_plain, NULL },
! {"sentmail", -1L,ZZZ_DT_ESTR(&sent_mail_e), 0, NULL},
{"set-window-title", -1L, ZZZ_DT_BOL(&set_window_title),


sizeof set_window_title, NULL },
{"shell", -1L,ZZZ_DT_STR(raw_shell), sizeof raw_shell, NULL},

Index: elm2.4.ME+.117-cvs/hdrs/s_elm.h
*** elm2.4.ME+.116/hdrs/s_elm.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/hdrs/s_elm.h 2004-06-20 21:03:06.000000000 +0300
***************
*** 470,476 ****
#define ElmCouldNotOpenNewElmrc 0x22a
#define ElmBadSortKeyInElmrc 0x22b
#define ElmBadAliasSortInElmrc 0x22c
- #define ElmSignatureObsolete 0x22d
#define ElmBouncebackGTMaxhops 0x22e
#define ElmTimeoutLTTen 0x22f
#define ElmBadLineElmrc 0x230
--- 470,475 ----
***************
*** 1095,1097 ****
--- 1094,1100 ----


#define ElmObsoleteInElmrc 0x866
#define ElmPgpRcvSure 0x867

#define ElmFailedLeaveChange 0x868
+ #define ElmChangedAttachEnc 0x869
+ #define ElmNoDSN 0x86a
+ #define ElmMailerDisconnected 0x86b
+ #define ElmMimeFWMessageYN 0x86c
Index: elm2.4.ME+.117-cvs/hdrs/shared_imp.h
*** elm2.4.ME+.116/hdrs/shared_imp.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.117-cvs/hdrs/shared_imp.h 2004-06-18 12:29:50.000000000 +0300
***************
*** 1,7 ****
! /* $Id: shared_imp.h,v 1.16 2004/03/28 13:37:38 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: shared_imp.h,v 1.17 2004/06/18 09:29:50 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 32,43 ****
} * shared_SE_option_types;
extern int shared_SE_option_type_count;

- extern struct shared_RCT {
- struct rc_type * T;
- struct ImpInfo * imp_idx;
- } * shared_RC_types;
- extern int shared_RC_type_count;
-
extern struct shared_CST {
struct charset_type * T;
struct ImpInfo * imp_idx;
--- 32,37 ----
Index: elm2.4.ME+.117-cvs/hdrs/sysdefs.SH
*** elm2.4.ME+.116/hdrs/sysdefs.SH 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.117-cvs/hdrs/sysdefs.SH 2004-06-18 23:40:56.000000000 +0300


***************
*** 22,30 ****

echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'

! /* $Id: sysdefs.SH,v 1.23 2004/04/04 06:17:17 hurtta Exp $ */
/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 22,30 ----

echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'

! /* $Id: sysdefs.SH,v 1.24 2004/06/18 20:40:56 hurtta Exp $ */


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 69,78 ****


#define default_temp "$tmpdir/"
#define temp_file "snd."
#define temp_form_file "form."

- /* #define temp_mbox "mbox." */

#define temp_print "print."
#define temp_edit "elm-edit"

- /* #define temp_uuname "uuname." */
#define temp_state "est."

#define emacs_editor "$emacs"
--- 69,76 ----
Index: elm2.4.ME+.117-cvs/lib/MAGIC
*** elm2.4.ME+.116/lib/MAGIC 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.117-cvs/lib/MAGIC 2004-06-18 12:29:50.000000000 +0300
***************
*** 10,15 ****
--- 10,16 ----
#define DISPLAY_STATE_magic 0xF304
#define MAILCAP_magic 0xF400
#define MAILCAP_PARAM_magic 0xF401
+ #define RCTYPE_magic 0xF402
#define MAILBOXVIEW_magic 0xF500
#define LDSTATE_magic 0xF501
#define MAILBOXTYPE_magic 0xF502
Index: elm2.4.ME+.117-cvs/lib/mailer.c
*** elm2.4.ME+.116/lib/mailer.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.117-cvs/lib/mailer.c 2004-05-23 15:31:00.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailer.c,v 1.46 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailer.c,v 1.47 2004/05/23 12:31:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 138,143 ****
--- 138,157 ----
X->mail_from = strmcpy(X->mail_from,value);
}

+ /* Return
+ 1 == mailer restarted, reconnect succeed -- reask info
+ 0 == mailer not disconnected
+ -1 == mailer disconnected, reconnect failed
+ */
+ S_(mailer_info_restart_hook default_mailer_info_rs_hook)
+ static int default_mailer_info_rs_hook P_((struct mailer_config *M,
+ struct mailer_info *I));
+ static int default_mailer_info_rs_hook(M,I)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ {
+ return 0; /* Assume not restarted */
+ }

S_(mailer_info_set_ef sendmail_mailer_info_set_ef)
static void sendmail_mailer_info_set_ef();
***************
*** 460,465 ****
--- 474,480 ----
default_mailer_info_init, null_mailer_info_close,
default_mailer_info_query, default_mailer_info_verify_addr,
default_mailer_info_gen_def_ef, default_mailer_info_set_ef,
+ default_mailer_info_rs_hook,

MB_USE_DOMAIN
},
***************
*** 469,474 ****
--- 484,490 ----
default_mailer_info_init, null_mailer_info_close,
sendmail_mailer_info_query, sendmail_mailer_info_verify_addr,
default_mailer_info_gen_def_ef, sendmail_mailer_info_set_ef,
+ default_mailer_info_rs_hook,

MB_DONT_ADD_FROM
},
***************
*** 478,483 ****
--- 494,500 ----
default_mailer_info_init, null_mailer_info_close,
default_mailer_info_query, default_mailer_info_verify_addr,
default_mailer_info_gen_def_ef, default_mailer_info_set_ef,
+ default_mailer_info_rs_hook,

MB_USE_DOMAIN
},
***************
*** 487,492 ****
--- 504,510 ----
default_mailer_info_init, null_mailer_info_close,
default_mailer_info_query, default_mailer_info_verify_addr,
default_mailer_info_gen_def_ef, default_mailer_info_set_ef,
+ default_mailer_info_rs_hook,

MB_DONT_ADD_FROM
}
***************
*** 954,959 ****
--- 972,1001 ----
}


+ /* -1 if connection lost
+ 0 if OK
+ 1 if mailer reinitialized and query_mailer_info()
+ need to be called again
+ */
+ int mailer_restarted(I)
+ struct mailer_info *I;


+ {
+ int ret;
+

+ if (I->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_restarted",
+ "Bad magic number (mailer info)",0);
+
+ if (!valid_mailer(I->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_restarted",
+ "Bad mailer type",
+ 0);
+
+ ret = I->mailer_type->mi_restart_hook(I->mailer_type,I);


+
+ return ret;
+ }
+

static int default_mailer_init(M,C,I)
struct mailer_config *M;
struct mail_send_state *C;
Index: elm2.4.ME+.117-cvs/lib/mail_gets.c
*** elm2.4.ME+.116/lib/mail_gets.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.117-cvs/lib/mail_gets.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.8 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.9 2004/06/18 20:40:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 53,58 ****
--- 53,114 ----
return line_bytes;
}

+ /* malloc_gets added by Kari Hurtta
+ Do not return \n
+
+ return -1 if limit exceeded, buffer is still alloced
+ return -2 if error or if feof() is true before reading anything
+ */
+
+ int malloc_gets(buffer, limit, mailfile)
+ char **buffer;
+ int limit; /* -1 if no limit */
+ FILE *mailfile;
+ {
+ char * buf = *buffer;
+ int line_bytes = 0, ch;
+ int alloced = 0;
+
+ if (feof(mailfile))
+ return -2; /* Is called after EOF */
+
+ while (!feof(mailfile) && !ferror(mailfile) &&
+ (line_bytes < limit || limit < 0)) {
+
+ int ch = getc(mailfile); /* Macro, faster than fgetc() ! */
+
+ if (EOF == ch ||
+ '\n' == ch)
+ break;
+
+ if (line_bytes+1 > alloced) {
+ int n = alloced + 100;
+ if (n > limit && limit > line_bytes)
+ n = limit;
+
+ buf = safe_realloc(buf,n);
+ alloced = n;
+ }
+ buf[line_bytes++] = ch;
+ }
+
+ if (line_bytes > 0 ||
+ !feof(mailfile) && !ferror(mailfile)) {
+
+ buf = safe_realloc(buf,line_bytes+1);
+ buf[line_bytes] = '\0';
+ }
+
+ *buffer = buf;
+
+ if (line_bytes >= limit)
+ return -1;
+
+ if (ferror(mailfile))
+ return-2;
+
+ return line_bytes;
+ }

/*
* Local Variables:
Index: elm2.4.ME+.117-cvs/lib/mbox.c
*** elm2.4.ME+.116/lib/mbox.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/lib/mbox.c 2004-06-18 12:29:50.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mbox.c,v 1.52 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mbox.c,v 1.53 2004/06/18 09:29:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.53 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 664,674 ****


/* if file name == default mailbox, its a spool file also
* even if its not in the spool directory. (SVR4)
*/

! if (strcmp(filename, defaultfile) == 0) {
! DPRINT(Debug,8,(&Debug,
"get_folder_type=SPOOL\n"));
! return(SPOOL);
}

if (buf) {
if (buf->st_mode & 07000) {
--- 664,682 ----


/* if file name == default mailbox, its a spool file also
* even if its not in the spool directory. (SVR4)
*/

!
!
! {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val &&
! strcmp(filename, default_val) == 0) {
! DPRINT(Debug,8,(&Debug,
"get_folder_type=SPOOL\n"));
! return(SPOOL);
! }
}
+

if (buf) {
if (buf->st_mode & 07000) {
Index: elm2.4.ME+.117-cvs/lib/outheaders.c
*** elm2.4.ME+.116/lib/outheaders.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/lib/outheaders.c 2004-06-21 21:28:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.18 2004/05/19 12:07:01 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.20 2004/06/21 18:28:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 365,370 ****
--- 365,388 ----
free_string(&comment);
}

+ void expanded_address_from_items(result,TMP)
+ struct expanded_address *result;
+ struct addr_item *TMP;
+ {
+ int j;
+

+ for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {

+ int pos = add_expanded_addr_(result,


+ TMP[j].addr,
+ TMP[j].fullname,
+ TMP[j].comment);
+ struct string *s = make_surface_addr(TMP[j]);

+ add_textual_addr_(result,s,pos,1);


+ free_string(&s);
+ }
+ }
+

+
#ifdef ANSI_C
hdr_add_to_mailing_hdr add_from_hdr;
#endif
***************
*** 376,383 ****
charset_t defcharset;
int replace;
{
- int j;
-
struct addr_item * TMP;

TMP = break_down_address(value,demime,defcharset);
--- 394,399 ----
***************
*** 385,399 ****
if (replace)
free_expanded_address(&(headers->from));

! for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {
! int pos = add_expanded_addr_(&(headers->from),
! TMP[j].addr,
! TMP[j].fullname,
! TMP[j].comment);
! struct string *s = make_surface_addr(TMP[j]);
! add_textual_addr_(&(headers->from),s,pos,1);
! free_string(&s);
! }

free_addr_items(TMP);

--- 401,407 ----
if (replace)
free_expanded_address(&(headers->from));

! expanded_address_from_items(&(headers->from), TMP);

free_addr_items(TMP);

***************
*** 411,419 ****


int demime;
charset_t defcharset;
int replace;

! {
! int j;
!
struct addr_item * TMP;

TMP = break_down_address(value,demime,defcharset);
--- 419,425 ----


int demime;
charset_t defcharset;
int replace;

! {
struct addr_item * TMP;

TMP = break_down_address(value,demime,defcharset);
***************
*** 421,435 ****
if (replace)
free_expanded_address(&(headers->to));

! for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {
! int pos = add_expanded_addr_(&(headers->to),
! TMP[j].addr,
! TMP[j].fullname,
! TMP[j].comment);
! struct string *s = make_surface_addr(TMP[j]);
! add_textual_addr_(&(headers->to),s,pos,1);
! free_string(&s);
! }

free_addr_items(TMP);

--- 427,433 ----
if (replace)
free_expanded_address(&(headers->to));

! expanded_address_from_items(&(headers->to), TMP);

free_addr_items(TMP);

***************
*** 448,455 ****
charset_t defcharset;
int replace;
{
- int j;
-
struct addr_item * TMP;

TMP = break_down_address(value,demime,defcharset);
--- 446,451 ----
***************
*** 457,471 ****
if (replace)
free_expanded_address(&(headers->cc));

! for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {
! int pos = add_expanded_addr_(&(headers->cc),
! TMP[j].addr,
! TMP[j].fullname,
! TMP[j].comment);
! struct string *s = make_surface_addr(TMP[j]);
! add_textual_addr_(&(headers->cc),s,pos,1);
! free_string(&s);
! }

free_addr_items(TMP);

--- 453,459 ----
if (replace)
free_expanded_address(&(headers->cc));

! expanded_address_from_items(&(headers->cc), TMP);

free_addr_items(TMP);

***************
*** 493,507 ****
if (replace)
free_expanded_address(&(headers->bcc));

! for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {
! int pos = add_expanded_addr_(&(headers->bcc),
! TMP[j].addr,
! TMP[j].fullname,
! TMP[j].comment);
! struct string *s = make_surface_addr(TMP[j]);
! add_textual_addr_(&(headers->bcc),s,pos,1);
! free_string(&s);
! }

free_addr_items(TMP);

--- 481,487 ----
if (replace)
free_expanded_address(&(headers->bcc));

! expanded_address_from_items(&(headers->bcc), TMP);

free_addr_items(TMP);

***************
*** 530,544 ****
if (replace)
free_expanded_address(&(headers->reply_to));

! for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {
! int pos = add_expanded_addr_(&(headers->reply_to),
! TMP[j].addr,
! TMP[j].fullname,
! TMP[j].comment);
! struct string *s = make_surface_addr(TMP[j]);
! add_textual_addr_(&(headers->reply_to),s,pos,1);
! free_string(&s);
! }

free_addr_items(TMP);

--- 510,516 ----
if (replace)
free_expanded_address(&(headers->reply_to));

! expanded_address_from_items(&(headers->reply_to), TMP);

free_addr_items(TMP);

***************
*** 694,721 ****
l,"",ptr-expanded.surface, ptr->pos, LASTPOS+1));
}
for (j = 0; j < ptr->len; j++) {
! if (ptr->pos < 0 || ptr->pos >= expanded.addrs_len) {
DPRINT(Debug,debuglevel,
(&Debug,
"%*s %d [%d] ERROR, not range 0 - %d\n",
l,"",j,ptr->pos,
expanded.addrs_len-1));
} else {
! CONST struct addr_item *ptr1 = & (expanded.addrs[ptr->pos]);
if (!ptr1->addr || !ptr1->fullname || !ptr1->comment) {
DPRINT(Debug,debuglevel,
(&Debug,
"%*s %d [%d] ERROR! NULL element!\n",
! l,"",j,ptr->pos));
} else {
DPRINT(Debug,debuglevel,
(&Debug,
"%*s %d [%d] addr=%s \tfullname=%S\tcomment=%S\n",
! l,"",j,ptr->pos,
ptr1->addr,ptr1->fullname,
ptr1->comment));
}
! LASTPOS = ptr->pos;
}
}
}
--- 666,693 ----
l,"",ptr-expanded.surface, ptr->pos, LASTPOS+1));
}
for (j = 0; j < ptr->len; j++) {
! if (ptr->pos+j < 0 || ptr->pos+j >= expanded.addrs_len) {
DPRINT(Debug,debuglevel,
(&Debug,
"%*s %d [%d] ERROR, not range 0 - %d\n",
l,"",j,ptr->pos,
expanded.addrs_len-1));
} else {
! CONST struct addr_item *ptr1 = & (expanded.addrs[ptr->pos+j]);
if (!ptr1->addr || !ptr1->fullname || !ptr1->comment) {
DPRINT(Debug,debuglevel,
(&Debug,
"%*s %d [%d] ERROR! NULL element!\n",
! l,"",j,ptr->pos+j));
} else {
DPRINT(Debug,debuglevel,
(&Debug,
"%*s %d [%d] addr=%s \tfullname=%S\tcomment=%S\n",
! l,"",j,ptr->pos+j,
ptr1->addr,ptr1->fullname,
ptr1->comment));
}
! LASTPOS = ptr->pos+j;
}
}
}
Index: elm2.4.ME+.117-cvs/lib/rc_handle.c


*** elm2.4.ME+.116/lib/rc_handle.c 2004-05-19 19:10:14.000000000 +0300

--- elm2.4.ME+.117-cvs/lib/rc_handle.c 2004-06-18 12:29:50.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.24 2004/05/01 19:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.27 2004/06/18 09:29:50 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

***************
*** 23,69 ****

DEBUG_VAR(Debug,__FILE__,"config");

- int valid_rc_type(T)
- struct rc_type *T;
- {
- int i;
-
- if (&rc_DT_SYN == T ||
- &rc_DT_STR == T ||
- &rc_DT_NUM == T ||
- &rc_DT_BOL == T ||
- &rc_DT_CHR == T ||
- &rc_DT_SRT == T ||
- &rc_DT_MLT == T ||
- &rc_DT_ASR == T ||
- &rc_DT_PRM == T ||
- &rc_DT_FUNC == T ||
- &rc_DT_LONG == T ||
- #ifdef USE_PGP
- &rc_DT_PGPVER == T ||
- #endif
- #ifdef USE_DLOPEN
- &rc_DT_SHARED == T ||
- #endif
- &rc_DT_PATH == T ||
- &rc_DT_OBS == T
- ) {


- return 1;
- }
-

- #ifdef USE_DLOPEN
- for (i = 0; i < shared_RC_type_count; i++)
- if (shared_RC_types[i].T == T)
- return 1;
- #endif
-
- DPRINT(Debug,1,(&Debug,
- "valid_rc_type=0: type=%p (magic)\n",
- T));
-

- return 0;
- }
-

#ifdef ANSI_C
static rc_parse_line dt_SYN_parse_line;
#endif
--- 23,28 ----
***************
*** 127,133 ****
return "*bad*";
}

! struct rc_type rc_DT_SYN = { dt_SYN_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };

#ifdef ANSI_C
--- 86,93 ----
return "*bad*";
}

! struct rc_type rc_DT_SYN = { RCTYPE_magic,
! dt_SYN_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };

#ifdef ANSI_C
***************
*** 211,217 ****
}


! struct rc_type rc_DT_STR = { dt_STR_parse_line, BAD_parse_cline,
dt_STR_print_value, dt_STR_get_value };

#ifdef ANSI_C
--- 171,178 ----
}


! struct rc_type rc_DT_STR = { RCTYPE_magic,
! dt_STR_parse_line, BAD_parse_cline,
dt_STR_print_value, dt_STR_get_value };

#ifdef ANSI_C
***************
*** 298,304 ****
}


! struct rc_type rc_DT_NUM = { dt_NUM_parse_line, BAD_parse_cline,
dt_NUM_print_value, dt_NUM_get_value };

#ifdef ANSI_C
--- 259,266 ----
}


! struct rc_type rc_DT_NUM = { RCTYPE_magic,
! dt_NUM_parse_line, BAD_parse_cline,
dt_NUM_print_value, dt_NUM_get_value };

#ifdef ANSI_C
***************
*** 361,367 ****
return *r->val.bol ? "ON" : "OFF";
}

! struct rc_type rc_DT_BOL = { dt_BOL_parse_line, BAD_parse_cline,
dt_BOL_print_value, dt_BOL_get_value };

#ifdef ANSI_C
--- 323,330 ----
return *r->val.bol ? "ON" : "OFF";
}

! struct rc_type rc_DT_BOL = { RCTYPE_magic,
! dt_BOL_parse_line, BAD_parse_cline,
dt_BOL_print_value, dt_BOL_get_value };

#ifdef ANSI_C
***************
*** 419,425 ****
return buffer;
}

! struct rc_type rc_DT_CHR = { dt_CHR_parse_line, BAD_parse_cline,
dt_CHR_print_value, dt_CHR_get_value };

static struct {
--- 382,389 ----
return buffer;
}

! struct rc_type rc_DT_CHR = { RCTYPE_magic,
! dt_CHR_parse_line, BAD_parse_cline,
dt_CHR_print_value, dt_CHR_get_value };

static struct {
***************
*** 525,531 ****
dt_SRT_get_value(r));
}

! struct rc_type rc_DT_SRT = { dt_SRT_parse_line, BAD_parse_cline,
dt_SRT_print_value, dt_SRT_get_value };

#ifdef ANSI_C
--- 489,496 ----
dt_SRT_get_value(r));
}

! struct rc_type rc_DT_SRT = { RCTYPE_magic,
! dt_SRT_parse_line, BAD_parse_cline,
dt_SRT_print_value, dt_SRT_get_value };

#ifdef ANSI_C
***************
*** 558,564 ****
return ok;
}

! struct rc_type rc_DT_MLT = { dt_MLT_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };

static struct {
--- 523,530 ----
return ok;
}

! struct rc_type rc_DT_MLT = { RCTYPE_magic,
! dt_MLT_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };

static struct {
***************
*** 655,661 ****
fprintf(F, "%s = %s\n", r->name, dt_ASR_get_value(r));
}

! struct rc_type rc_DT_ASR = { dt_ASR_parse_line, BAD_parse_cline,
dt_ASR_print_value, dt_ASR_get_value };

#ifdef ANSI_C
--- 621,628 ----
fprintf(F, "%s = %s\n", r->name, dt_ASR_get_value(r));
}

! struct rc_type rc_DT_ASR = { RCTYPE_magic,
! dt_ASR_parse_line, BAD_parse_cline,
dt_ASR_print_value, dt_ASR_get_value };

#ifdef ANSI_C
***************
*** 733,739 ****
return mode_to_str(*(r->val.num));
}

! struct rc_type rc_DT_PRM = { dt_PRM_parse_line, BAD_parse_cline,
dt_PRM_print_value, dt_PRM_get_value };

#ifdef ANSI_C
--- 700,707 ----
return mode_to_str(*(r->val.num));
}

! struct rc_type rc_DT_PRM = { RCTYPE_magic,
! dt_PRM_parse_line, BAD_parse_cline,
dt_PRM_print_value, dt_PRM_get_value };

#ifdef ANSI_C
***************
*** 798,804 ****
}


! struct rc_type rc_DT_FUNC = { dt_FUNC_parse_line, BAD_parse_cline,
dt_FUNC_print_value, dt_FUNC_get_value };

#ifdef ANSI_C
--- 766,773 ----
}


! struct rc_type rc_DT_FUNC = { RCTYPE_magic,
! dt_FUNC_parse_line, BAD_parse_cline,
dt_FUNC_print_value, dt_FUNC_get_value };

#ifdef ANSI_C
***************
*** 859,865 ****
}


! struct rc_type rc_DT_LONG = { dt_LONG_parse_line, BAD_parse_cline,
dt_LONG_print_value, dt_LONG_get_value };

#ifdef USE_PGP
--- 828,835 ----
}


! struct rc_type rc_DT_LONG = { RCTYPE_magic,
! dt_LONG_parse_line, BAD_parse_cline,
dt_LONG_print_value, dt_LONG_get_value };

#ifdef USE_PGP
***************
*** 922,928 ****
return "*bad*";
}

! struct rc_type rc_DT_PGPVER = { dt_PGPVER_parse_line, BAD_parse_cline,
dt_PGPVER_print_value, dt_PGPVER_get_value };
#endif

--- 892,899 ----
return "*bad*";
}

! struct rc_type rc_DT_PGPVER = { RCTYPE_magic,
! dt_PGPVER_parse_line, BAD_parse_cline,
dt_PGPVER_print_value, dt_PGPVER_get_value };
#endif

***************
*** 1446,1451 ****
--- 1417,1425 ----


fprintf(F, "%s = ",r->name);

for (i = 0; i < r->val.path->nlen; i++) {

+ /* NOTE: space is always valid separator even when

+ PATH_sep_comma or PATH_sep_colon is set */
+
if (i > 0) {


if (len + strlen(r->val.path->list[i]) > 70) {
fprintf(F, "\n");

***************
*** 1458,1464 ****



}
if (r->val.path->flags & PATH_quote)

! elm_fprintf(F,FRM("Q"),r->val.path->list[i]);


else if (r->val.path->flags & PATH_quote_single) {

fputc('\'',F);


fputs(r->val.path->list[i],F);

--- 1432,1438 ----



}
if (r->val.path->flags & PATH_quote)

! elm_fprintf(F,FRM("%Q"),r->val.path->list[i]);


else if (r->val.path->flags & PATH_quote_single) {

fputc('\'',F);


fputs(r->val.path->list[i],F);

***************
*** 1471,1477 ****
}
}

! struct rc_type rc_DT_PATH = { dt_PATH_parse_line, dt_PATH_parse_cline,
dt_PATH_print_value, NO_get_value };


--- 1445,1452 ----
}
}

! struct rc_type rc_DT_PATH = { RCTYPE_magic,
! dt_PATH_parse_line, dt_PATH_parse_cline,
dt_PATH_print_value, NO_get_value };


***************
*** 1498,1508 ****
}


! struct rc_type rc_DT_OBS = { dt_OBS_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };





/*
* Local Variables:
* mode:c

--- 1473,1613 ----
}


! struct rc_type rc_DT_OBS = { RCTYPE_magic,
! dt_OBS_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };



+ /*
+ 0 == failure
+ 1 == succeed
+ */
+
+ int expand_dt_estr(ptr,fieldname,val)
+ struct dt_estr_info *ptr;
+ char *fieldname;
+ char *val;


+ {
+ char buffer[1024];

+
+ int x;
+

+ if (ptr->flags & ESTR_meta)
+ x = expand_meta(buffer, ptr->unexpanded, sizeof buffer);
+ else
+ x = expand_env(buffer, ptr->unexpanded, sizeof buffer);
+
+ if (x != 0) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmBadVariableInElmrc,
+ "Bad variable on key \"%s\" value \"%s\""),
+ fieldname,val);


+ return 0;
+ }
+

+ ptr->expanded = strmcpy(ptr->expanded,buffer);


+
+ return 1;
+ }
+

+ char * give_dt_estr_as_str(ptr,fieldname)
+ struct dt_estr_info *ptr;
+ char * fieldname;
+ {
+ if (!ptr->expanded && ptr->unexpanded)
+ expand_dt_estr(ptr,fieldname,ptr->unexpanded);
+
+ return ptr->expanded;
+ }
+
+ /* Set initial value */
+ extern void set_dt_estr(ptr, const_val, def_env)
+ struct dt_estr_info *ptr;
+ CONST char *const_val;
+ char *def_env;
+ {
+ char *cp;
+
+ if (def_env &&
+ (cp = getenv(def_env)) &&
+ cp[0]) {
+ char *x = elm_message(FRM("$%s"),def_env);
+
+ ptr->unexpanded = strmcpy(ptr->unexpanded,x);
+ ptr->expanded = strmcpy(ptr->expanded,cp);
+
+ free(x);
+ } else {
+ ptr->unexpanded = strmcpy(ptr->unexpanded,const_val);
+ ptr->expanded = strmcpy(ptr->expanded,const_val);
+ }
+ }
+
+
+ #ifdef ANSI_C
+ static rc_parse_line dt_ESTR_parse_line;
+ #endif
+ static int dt_ESTR_parse_line(r,lcl,value,lineno,filename, e_val, negate)
+ struct rc_save_info_rec *r;
+ int lcl;
+ char *value;
+ int lineno;
+ char *filename;
+ int e_val;
+ int negate;
+ {
+ if (negate) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadNegate,
+ "!%s is not supported in line %d in \"%s\" file"),
+ r->name,lineno,filename);


+ return 0;
+ }
+

+ r->val.estr->unexpanded = strmcpy(r->val.estr->unexpanded,value);
+
+ /* Free old value */
+ if (r->val.estr->expanded) {
+ free(r->val.estr->expanded);
+ r->val.estr->expanded = NULL;
+ }
+

+ return 1;
+ }
+

+ #if ANSI_C
+ static rc_get_value dt_ESTR_get_value;
+ #endif
+ static char * dt_ESTR_get_value(r)
+ struct rc_save_info_rec *r;
+ {
+ return r->val.estr->unexpanded;


+ }
+
+ #if ANSI_C

+ static rc_print_value dt_ESTR_print_value;
+ #endif
+ static void dt_ESTR_print_value(F,r,comment)
+ FILE *F;
+ struct rc_save_info_rec *r;
+ int comment;
+ {
+ if (r->val.estr->unexpanded) {
+ if (comment)
+ fprintf(F, "### ");
+ fprintf(F, "%s = %s\n", r->name, r->val.estr->unexpanded);
+ } else {
+ fprintf(F, "### %s (not set)\n", r->name);
+ }
+ }
+
+ struct rc_type rc_DT_ESTR = { RCTYPE_magic,
+ dt_ESTR_parse_line, BAD_parse_cline,
+ dt_ESTR_print_value, dt_ESTR_get_value };


+
+
+
+
/*

* Local Variables:
* mode:c

Index: elm2.4.ME+.117-cvs/lib/read_rc.c


*** elm2.4.ME+.116/lib/read_rc.c 2004-05-19 19:10:14.000000000 +0300

--- elm2.4.ME+.117-cvs/lib/read_rc.c 2004-06-27 18:18:05.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.136 2004/05/01 19:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.136 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.141 2004/06/27 15:18:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.141 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 109,118 ****


char user_terminal_info[SLEN] = USER_TERMINAL_INFO; /* user_init fixes */
char user_mail_services[SLEN] = USER_MAIL_SERVICES; /* user_init fixes */

! char defaultfile[SLEN] = {0}; /* name of default folder */
! char raw_defaultfile[SLEN] = "$MAIL"; /* init_defaults fixes */


! char calendar_file[SLEN] = {0}; /* name of file for clndr */
! char raw_calendar_file[SLEN] = {0}; /* unexpanded name of file for clndr */

int clear_pages = 0; /* flag: act like "page" (more -c)? */
int title_messages = 1; /* flag: title message display? */

--- 109,126 ----


char user_terminal_info[SLEN] = USER_TERMINAL_INFO; /* user_init fixes */
char user_mail_services[SLEN] = USER_MAIL_SERVICES; /* user_init fixes */

! ESTR defaultfile_e = { /* name of default folder */
! 0,
! NULL,
! NULL
! };
!
! ESTR calendar_file_e = { /* name of file for clndr */
! 0,
! NULL,
! NULL
! };
!

int clear_pages = 0; /* flag: act like "page" (more -c)? */
int title_messages = 1; /* flag: title message display? */

***************
*** 143,149 ****


int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */

PATH alternative_addresses = { /* how else do we get mail? */
! PATH_sep_comma|PATH_quote|PATH_quote_single,

NULL, 0,NULL
};

--- 151,157 ----


int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */

PATH alternative_addresses = { /* how else do we get mail? */

! PATH_sep_comma,
NULL, 0,NULL
};

***************
*** 159,164 ****
--- 167,174 ----


1 = text/plain
2 = text/x-pgp
*/

+ int pgp_interactive=0; /* Should pgp/gpg encryption/signing to be
+ run always on interactive mode */


enum pgp_version send_pgp_version = pgp_none; /* preferred pgp version*/
#endif

char attribution[SLEN] = {0}; /* attribution string for replies */

***************
*** 208,219 ****


/* the wanted display charset set */

int DSN_success = 0; /* flag: Ask successfull DSNes */

char e_editor[SLEN] = {0}; /* "~e" editor... */

! char editor[SLEN] = {0}; /* editor for outgoing mail*/


int env_from_source = 0; /* 0 == forward-from,
1 == from,
2 == return-path
*/
! char raw_editor[SLEN] = {0}; /* unexpanded editor for outgoing mail*/

char escape_char = TILDE_ESCAPE;/* '~' or something else.. */


int force_name = 0; /* flag: save by name forced? */
int fragment_handling = 1; /* 0 == none,

--- 218,235 ----


/* the wanted display charset set */

int DSN_success = 0; /* flag: Ask successfull DSNes */

char e_editor[SLEN] = {0}; /* "~e" editor... */
!

! ESTR editor_e = { /* editor for outgoing mail*/
! 0,
! NULL,
! NULL
! };


!
int env_from_source = 0; /* 0 == forward-from,
1 == from,
2 == return-path
*/
!

char escape_char = TILDE_ESCAPE;/* '~' or something else.. */


int force_name = 0; /* flag: save by name forced? */
int fragment_handling = 1; /* 0 == none,

***************
*** 246,253 ****


char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */
charset_t local_fs_charset = NULL; /* filesystem charset */

! char local_signature[SLEN] = {0}; /* local msg signature file */
! char raw_local_signature[SLEN] = {0}; /* unexpanded local msg */
/* signature file */
#ifdef SYSCALL_LOCKING
int lockfolders = 1; /* Lock folder when open */

--- 262,272 ----


char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */
charset_t local_fs_charset = NULL; /* filesystem charset */

! ESTR local_signature_e = { /* local msg signature file */
! 0,
! NULL,
! NULL
! };


/* signature file */
#ifdef SYSCALL_LOCKING

int lockfolders = 1; /* Lock folder when open */
***************
*** 291,296 ****
--- 310,316 ----


int mime_body_keywords = TRUE; /* flag: parse body looking for encode */
/* keywords */

int mimeforward = FALSE; /* flag: Forward as Message/rfc822 */

+ int askmimeforward = 1; /* flag: prompt about messaga/rfc822 forward */


int move_when_paged = 0; /* flag: move when '+' or '-' used? */
int names_only = 1; /* flag: display user names only? */

int allow_no_encoding = 0; /* 1: Allow 8bit without -B8BITMIME */

***************
*** 305,310 ****
--- 325,335 ----


int page_known_charsets=1; /* Page if charset is not unknown? */

int pagemultipart=0; /* Page unknown mime subparts? */


int pagesigned=0; /* Page unknown signed protocols? */

+ ESTR pager_e = { /* what pager to use */
+ 0,
+ NULL,
+ NULL
+ };


char pager[SLEN] = {0}; /* what pager to use */

char raw_pager[SLEN] = {0}; /* unexpanded what pager to use */
#ifdef USE_PGP

***************
*** 328,345 ****


int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/

/* new mbox */
! char recvd_mail[SLEN] = {0}; /* folder for storing received mail */
! char raw_recvdmail[SLEN] = {0}; /* unexpanded recvd_mail name */
! char remote_signature[SLEN] = {0}; /* remote msg signature file */
! char raw_remote_signature[SLEN] = {0}; /* unexpanded remote msg */

! /* signature file */


int req_mime_bodyencoding = 1; /* */

int req_mime_hdrencoding = 0; /* */
int resolve_mode = 1; /* flag: delete saved mail? */
int save_by_name = 1; /* flag: save mail by login name? */
! char sent_mail[SLEN] = {0}; /* name of file to save copies to */
int send_mime_plain = 1; /* flag: send plain text as MIME? */

- char raw_sentmail[SLEN] = {0}; /* unexpanded name of file to save to*/


char shell[SLEN] = {0}; /* current system shell */

char raw_shell[SLEN] = {0}; /* unexpanded current system shell */

int set_window_title = 0; /* flag: set (xterm?) window title and

--- 353,381 ----


int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/

/* new mbox */
! ESTR recvd_mail_e = { /* folder for storing received mail */
! ESTR_meta,
! NULL,
! NULL
! };
!
! ESTR remote_signature_e = { /* remote msg signature file */
! 0,
! NULL,
! NULL
! };


int req_mime_bodyencoding = 1; /* */

int req_mime_hdrencoding = 0; /* */
int resolve_mode = 1; /* flag: delete saved mail? */

int save_by_name = 1; /* flag: save mail by login name? */
!
! ESTR sent_mail_e = { /* name of file to save copies to */
! ESTR_meta,
! NULL,
! NULL
! };
!

int send_mime_plain = 1; /* flag: send plain text as MIME? */

char shell[SLEN] = {0}; /* current system shell */

char raw_shell[SLEN] = {0}; /* unexpanded current system shell */

int set_window_title = 0; /* flag: set (xterm?) window title and

***************
*** 1114,1136 ****
* First look for an environment variable MAIL, then
* use then mailhome if it is not found
*/
- if ((cp = getenv("MAIL")) == NULL) {
- elm_sfprintf(defaultfile, sizeof defaultfile,
- FRM("%s%s"), mailhome, username);
- elm_sfprintf(raw_defaultfile, sizeof raw_defaultfile,
- FRM("%s%s"), mailhome, username);
-
- } else {
- strfcpy(raw_defaultfile, "$MAIL", sizeof raw_defaultfile);
- strfcpy(defaultfile, cp, sizeof defaultfile);
- }

! raw_local_signature[0] = raw_remote_signature[0] =
! local_signature[0] = remote_signature[0] =
! raw_recvdmail[0] = raw_sentmail[0] =
! allowed_precedences[0] = '\0';
/* no defaults for those */
!
if (NULL != (cp = getenv("SHELL")) && '\0' != cp[0]) {
strfcpy(raw_shell, "$SHELL", sizeof raw_shell);
do_expand_env("shell", shell, raw_shell, sizeof(shell));
--- 1150,1165 ----
* First look for an environment variable MAIL, then
* use then mailhome if it is not found
*/

! {
! char *X = elm_message(FRM("%s%s"), mailhome, username);
! set_dt_estr(&defaultfile_e,X,"MAIL");
! free(X);
! }
!
! allowed_precedences[0] = '\0';
/* no defaults for those */
!
if (NULL != (cp = getenv("SHELL")) && '\0' != cp[0]) {
strfcpy(raw_shell, "$SHELL", sizeof raw_shell);
do_expand_env("shell", shell, raw_shell, sizeof(shell));
***************
*** 1140,1151 ****
}

#ifdef USE_BUILTIN_PAGER
! strfcpy(raw_pager,"builtin++", sizeof raw_pager);
! strfcpy(pager,"builtin++", sizeof pager);
#else
! strfcpy(raw_pager, ((cp = getenv("PAGER")) == NULL)? default_pager : cp,
! sizeof raw_pager);
! do_expand_env("pager", pager, raw_pager, sizeof(pager));
#endif

strfcpy(raw_temp_dir, (cp = getenv("TMPDIR")) ? cp : default_temp,
--- 1169,1177 ----
}

#ifdef USE_BUILTIN_PAGER
! set_dt_estr(&pager_e, "builtin++", NULL);
#else
! set_dt_estr(&pager_e,default_pager,"PAGER");
#endif

strfcpy(raw_temp_dir, (cp = getenv("TMPDIR")) ? cp : default_temp,
***************
*** 1156,1169 ****
temp_dir[strlen (temp_dir)-1] != '/')
strfcat(temp_dir, "/", sizeof temp_dir);

! if ((cp = getenv("EDITOR")) != NULL && '\0' != cp[0]) {
! strfcpy(raw_editor, "$EDITOR", sizeof raw_editor);
! strfcpy(editor, cp, sizeof editor);
! } else {
! strfcpy(raw_editor, default_editor, sizeof raw_editor);
! do_expand_env("editor", editor, raw_editor, sizeof(editor));
! }
!


if ((cp = getenv("MAILCAPS")) == NULL) {

/* RFC 1524:
--- 1182,1188 ----
temp_dir[strlen (temp_dir)-1] != '/')
strfcat(temp_dir, "/", sizeof temp_dir);

! set_dt_estr(&editor_e,default_editor,"EDITOR");



if ((cp = getenv("MAILCAPS")) == NULL) {

/* RFC 1524:
***************
*** 1235,1244 ****


do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
sizeof(map_bindir));

! elm_sfprintf(raw_calendar_file, sizeof raw_calendar_file,
! FRM("~/%s"), dflt_calendar_file);
! do_expand_env("calendar_file", calendar_file, raw_calendar_file,
! sizeof(calendar_file));

strfcpy(e_editor, emacs_editor, sizeof e_editor);
strfcpy(v_editor, default_editor, sizeof v_editor);
--- 1254,1261 ----


do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
sizeof(map_bindir));

! calendar_file_e.unexpanded =
! elm_message(FRM("~/%s"), dflt_calendar_file);

strfcpy(e_editor, emacs_editor, sizeof e_editor);
strfcpy(v_editor, default_editor, sizeof v_editor);
***************
*** 1247,1255 ****
FRM("%s/%s"), home, default_folders);
strfcpy(folders, raw_folders, sizeof folders);

- elm_sfprintf(raw_calendar_file, sizeof raw_calendar_file,
- FRM("%s/%s"), home, dflt_calendar_file);
- strfcpy(calendar_file, raw_calendar_file, sizeof calendar_file);

/* try system-wide rc file */
file = fopen(system_rc_file, "r");
--- 1264,1269 ----
***************
*** 1373,1379 ****
"Setting (wanted) display-charset to %s instead.\n",
wanted_display_charset->MIME_name ?
wanted_display_charset->MIME_name :


! "<no MIME name"));
}

if (!text_charset || !text_charset->MIME_name) {
text_charset = ASCII_SET;
--- 1387,1393 ----
"Setting (wanted) display-charset to %s instead.\n",
wanted_display_charset->MIME_name ?
wanted_display_charset->MIME_name :


! "<no MIME name>"));
}

if (!text_charset || !text_charset->MIME_name) {
text_charset = ASCII_SET;
***************
*** 1477,1488 ****
}

void post_init_check(int flag) {



do_expand_env("folders", folders, raw_folders, sizeof(folders));

do_expand_env("extra-mailbox-dir", extra_mailbox_dir,
raw_extra_mailbox_dir, sizeof(extra_mailbox_dir));
!
if (raw_extra_mailbox_dir[0] &&
0 == strcmp(extra_mailbox_dir,folders)) {
errors++;
--- 1491,1503 ----
}

void post_init_check(int flag) {
+ char *t;



do_expand_env("folders", folders, raw_folders, sizeof(folders));

do_expand_env("extra-mailbox-dir", extra_mailbox_dir,
raw_extra_mailbox_dir, sizeof(extra_mailbox_dir));
!
if (raw_extra_mailbox_dir[0] &&
0 == strcmp(extra_mailbox_dir,folders)) {
errors++;
***************
*** 1510,1529 ****
strfcpy(temp_dir,"/tmp/", sizeof temp_dir);
else if (temp_dir[strlen (temp_dir)-1] != '/')
strfcat(temp_dir, "/", sizeof temp_dir);
!
! do_expand_env("incoming-mailbox",
! defaultfile, raw_defaultfile,
! sizeof(defaultfile));
!
if (raw_shell[0] != '\0') {
/* shell is taken from /etc/passwd in initialize() */
do_expand_env("shell", shell, raw_shell, sizeof(shell));
}
! do_expand_env("editor", editor, raw_editor, sizeof(editor));
!
! do_expand_env("calendar_file", calendar_file, raw_calendar_file,
! sizeof(calendar_file));
!
if (strcmp(raw_printout,"none") == 0 ||
raw_printout[0] == '\0') {
strfcpy(raw_printout,"none", sizeof raw_printout);
--- 1525,1536 ----
strfcpy(temp_dir,"/tmp/", sizeof temp_dir);
else if (temp_dir[strlen (temp_dir)-1] != '/')
strfcat(temp_dir, "/", sizeof temp_dir);
!
if (raw_shell[0] != '\0') {
/* shell is taken from /etc/passwd in initialize() */
do_expand_env("shell", shell, raw_shell, sizeof(shell));
}
!
if (strcmp(raw_printout,"none") == 0 ||
raw_printout[0] == '\0') {
strfcpy(raw_printout,"none", sizeof raw_printout);
***************
*** 1531,1561 ****
} else {
do_expand_env("printout", printout, raw_printout, sizeof(printout));
}
!
! do_expand_env("pager", pager, raw_pager, sizeof(pager));
! if (equal(pager, "builtin+") || equal(pager, "internal+"))
! clear_pages++;
!
! do_expand_env("local_signature", local_signature,
! raw_local_signature, sizeof(local_signature));
! do_expand_env("remote_signature", remote_signature,
! raw_remote_signature, sizeof(remote_signature));
!
! if (equal(local_signature, remote_signature) &&
! (equal(shift_lower(local_signature), "on") ||
! equal(shift_lower(local_signature), "off"))) {
! errors++;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSignatureObsolete,
! "\"signature\" used in obsolete way in .elm/elmrc file. Ignored!\n\
! \t(Signature should specify the filename to use rather than on/off.)"));
!
! raw_local_signature[0] = raw_remote_signature[0] =
! local_signature[0] = remote_signature[0] = '\0';
! }
!
!
!
allow_forms = (allow_forms?MAYBE:NO);

if ((elm_timeout != 0) && (elm_timeout < 10)) {
--- 1538,1544 ----
} else {
do_expand_env("printout", printout, raw_printout, sizeof(printout));
}
!
allow_forms = (allow_forms?MAYBE:NO);

if ((elm_timeout != 0) && (elm_timeout < 10)) {
***************
*** 1601,1623 ****
* Then if they begin with a metacharacter, replace it with the
* folders directory name.
*/
! if(*raw_recvdmail == '\0') {
! strfcpy(raw_recvdmail, default_recvdmail,
! sizeof raw_recvdmail);
}

! do_expand_meta("recvd_mail", recvd_mail, raw_recvdmail,
! sizeof(recvd_mail));
!
! if(*raw_sentmail == '\0') {
! strfcpy(raw_sentmail, default_sentmail, sizeof raw_sentmail);
! strfcpy(sent_mail, default_sentmail, sizeof sent_mail);
}

- do_expand_meta("sent_mail", sent_mail, raw_sentmail,
- sizeof(sent_mail));
-
-

expand_map_bin("unidata", unidata_path, raw_unidata_path,

sizeof(unidata_path));

--- 1584,1597 ----
* Then if they begin with a metacharacter, replace it with the
* folders directory name.
*/
! if(!recvd_mail_e.unexpanded) {
! recvd_mail_e.unexpanded = safe_strdup(default_recvdmail);
}

! if(!sent_mail_e.unexpanded) {
! sent_mail_e.unexpanded = safe_strdup(default_sentmail);


}

expand_map_bin("unidata", unidata_path, raw_unidata_path,

sizeof(unidata_path));

***************
*** 2001,2007 ****
} else if (!keyword[0]) {
if (prev_type != NULL) {

! if (!valid_rc_type(prev_type->dt_type))
panic("RC PANIC",__FILE__,__LINE__,"do_rc",
"Bad prev_type",0);

--- 1975,1981 ----
} else if (!keyword[0]) {
if (prev_type != NULL) {

! if (RCTYPE_magic != prev_type->dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"do_rc",
"Bad prev_type",0);

***************
*** 2159,2175 ****
} else
e_val = 0;

! if (!valid_rc_type(rc_options[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"do_set",


"Bad config item type",0);

if (!rc_options[x].dt_type->parse_line(& (rc_options[x]),
! lcl,
! word2,
! lineno,
! filename,
! e_val,
! negate))
errors++;

return & (rc_options[x]);
--- 2133,2149 ----
} else
e_val = 0;

! if (RCTYPE_magic != rc_options[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"do_set",


"Bad config item type",0);

if (!rc_options[x].dt_type->parse_line(& (rc_options[x]),
! lcl,
! word2,
! lineno,
! filename,
! e_val,
! negate))
errors++;

return & (rc_options[x]);
Index: elm2.4.ME+.117-cvs/lib/savefolder.c
*** elm2.4.ME+.116/lib/savefolder.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/lib/savefolder.c 2004-06-18 12:29:50.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.76 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.77 2004/06/18 09:29:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.77 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 328,364 ****
BROWSER_NOFOLDER);
}

! /* Incoming mailbox (may also be IMAP mailbox) */
! if (defaultfile[0]) {
! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,
! safe_strdup(defaultfile),
! new_string2(system_charset,s2us("!")),
! BROWSER_NODIR);
! }

! /* ">" -- usually =received folder */
! if (recvd_mail[0]) {
! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,
! safe_strdup(recvd_mail),
! new_string2(system_charset,s2us(">")),
! BROWSER_NODIR);
}

! /* "<" -- usually =sent folder */
! if (sent_mail[0]) {
! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,
! safe_strdup(sent_mail),
! new_string2(system_charset,s2us("<")),
! BROWSER_NODIR);
}
break;

--- 328,376 ----
BROWSER_NOFOLDER);
}

! {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");

! /* Incoming mailbox (may also be IMAP mailbox) */
! if (default_val) {
! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,
! safe_strdup(default_val),
! new_string2(system_charset,s2us("!")),
! BROWSER_NODIR);
! }
}

! {
! char * recvd_val = give_dt_estr_as_str(&recvd_mail_e,"receivedmail");
!
! /* ">" -- usually =received folder */
! if (recvd_val) {
! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,
! safe_strdup(recvd_val),
! new_string2(system_charset,s2us(">")),
! BROWSER_NODIR);
! }
! }
!
! {
! char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
!
! /* "<" -- usually =sent folder */
! if (sent_val) {
! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,
! safe_strdup(sent_val),
! new_string2(system_charset,s2us("<")),
! BROWSER_NODIR);
! }
}
break;

***************
*** 2793,2842 ****

*/

! case 0x0021: /* '!' incoming mailbox */
! ret = tail_expander(dir,buffer,1,defaultfile,
! relative_to_type);
! if (ret && dir->sel_type == selection_file) {
! if (*relative_to_type && 0 < string_len(*relative_to_type))
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile1,
! "Name %S (expands to %s, %S) is unsafe use as file"),
! *buffer, defaultfile, *relative_to_type);
! else
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile2,
! "Name %S (expands to %s) is unsafe use as file"),
! *buffer, defaultfile);
ret = 0;
}
break;
! case 0x003E: /* '>' received folder */
! ret = tail_expander(dir,buffer,1,recvd_mail,
! relative_to_type);
! if (ret && dir->sel_type == selection_file) {
! if (relative_to_type && 0 < string_len(*relative_to_type))
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile1,
! "Name %S (expands to %s, %S) is unsafe use as file"),
! *buffer, recvd_mail, *relative_to_type);
! else
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile2,
! "Name %S (expands to %s) is unsafe use as file"),
! *buffer, recvd_mail);
! ret = 0;
}
break;
! case 0x003C: /* '<' sent folder */
! ret = tail_expander(dir,buffer,1,sent_mail,
! relative_to_type);
! if (ret && dir->sel_type == selection_file) {
! if (*relative_to_type && 0 < string_len(*relative_to_type))
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile1,
! "Name %S (expands to %s, %S) is unsafe use as file"),
! *buffer, sent_mail, *relative_to_type);
! else
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile2,
! "Name %S (expands to %s) is unsafe use as file"),
! *buffer, sent_mail);
! ret = 0;
}
break;

default:
--- 2805,2882 ----

*/

! case 0x0021: {
! /* '!' incoming mailbox */
!
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (!default_val)
ret = 0;
+ else {
+ ret = tail_expander(dir,buffer,1,default_val,
+ relative_to_type);
+ if (ret && dir->sel_type == selection_file) {
+ if (*relative_to_type && 0 < string_len(*relative_to_type))
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile1,
+ "Name %S (expands to %s, %S) is unsafe use as file"),
+ *buffer, default_val, *relative_to_type);
+ else
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile2,
+ "Name %S (expands to %s) is unsafe use as file"),
+ *buffer, default_val);
+ ret = 0;
+ }
}
+ }
break;
! case 0x003E: {
! /* '>' received folder */
!
! char * recvd_val = give_dt_estr_as_str(&recvd_mail_e,"receivedmail");
!
! if (!recvd_val)
! ret = 0 ;
! else {
! ret = tail_expander(dir,buffer,1,recvd_val,
! relative_to_type);
! if (ret && dir->sel_type == selection_file) {
! if (*relative_to_type && 0 < string_len(*relative_to_type))
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile1,
! "Name %S (expands to %s, %S) is unsafe use as file"),
! *buffer, recvd_val, *relative_to_type);
! else
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile2,
! "Name %S (expands to %s) is unsafe use as file"),
! *buffer, recvd_val);
! ret = 0;
! }
}
+ }
break;
! case 0x003C: {
! /* '<' sent folder */
!
! char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
!
! if (!sent_val)
! ret = 0 ;
! else {
!
! ret = tail_expander(dir,buffer,1,sent_val,
! relative_to_type);
! if (ret && dir->sel_type == selection_file) {
! if (*relative_to_type && 0 < string_len(*relative_to_type))
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile1,
! "Name %S (expands to %s, %S) is unsafe use as file"),
! *buffer, sent_val, *relative_to_type);
! else
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile2,
! "Name %S (expands to %s) is unsafe use as file"),
! *buffer, sent_val);
! ret = 0;
! }
}
+ }
break;

default:
Index: elm2.4.ME+.117-cvs/lib/shared.c
*** elm2.4.ME+.116/lib/shared.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/lib/shared.c 2004-06-18 12:29:50.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: shared.c,v 1.55 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: shared.c,v 1.56 2004/06/18 09:29:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 47,55 ****
struct shared_SEOT * shared_SE_option_types = NULL;
int shared_SE_option_type_count = 0;

- struct shared_RCT * shared_RC_types = NULL;
- int shared_RC_type_count = 0;
-
struct shared_CST * shared_CS_types = NULL;
int shared_CS_type_count = 0;

--- 47,52 ----
***************
*** 214,227 ****
provides_shared_FT_f * f2;
} f2; /* not in use */

-
-
-
- union F7 {
- void * ptr;
- provides_shared_RCT_f * f7;
- } f7;
-
union F8 {
void * ptr;
provides_RC_options_f * f8;
--- 211,216 ----
***************
*** 243,249 ****
/* not in use */
f2.ptr = dlsym( I->handle, "provides_shared_FT");

- f7.ptr = dlsym( I->handle, "provides_shared_RCT");
f8.ptr = dlsym( I->handle, "provides_RC_options");
f9.ptr = dlsym( I->handle, "RC_post_init");
f10.ptr = dlsym( I->handle, "wants_rand_bits");
--- 232,237 ----
***************
*** 253,261 ****
DPRINT(Debug,7,(&Debug, " ... NO provides_shared_FT\n"));
}

- if (!f7.f7) {
- DPRINT(Debug,7,(&Debug, " ... NO provides_shared_RCT\n"));
- }
if (!f8.f8) {
DPRINT(Debug,7,(&Debug, " ... NO provides_RC_options\n"));
}
--- 241,246 ----
***************
*** 301,331 ****



- if (f7.f7) {
- int count,x;
- size_t s_res7;
- struct rc_type ** res7 = f7.f7(&count, &s_res7);
-
- if (s_res7 != sizeof (**res7)) {
- DPRINT(Debug,1,(&Debug,"... struct rc_type mismatch: %d should be %d\n",
- s_res7,sizeof (**res7)));
- } else {
- shared_RC_types =
- safe_realloc(shared_RC_types,
- sizeof (shared_RC_types[0]) *
- (shared_RC_type_count + count));
-
- DPRINT(Debug,7,(&Debug," ... provides_shared_RCT: (shared_RC_types) count %d\n",
- count));
-
-
- for (x = 0; x < count; x++) {
- shared_RC_types[shared_RC_type_count+x].T = res7[x];
- shared_RC_types[shared_RC_type_count+x].imp_idx = I;
- }
- shared_RC_type_count += count;
- }
- }

if (f8.f8) {
int count;
--- 286,291 ----
***************
*** 793,799 ****
return return_buffer;
}

! struct rc_type rc_DT_SHARED = { dt_SHARED_parse_line, dt_SHARED_parse_cline,
dt_SHARED_print_value, dt_SHARED_get_value };


--- 753,760 ----
return return_buffer;
}

! struct rc_type rc_DT_SHARED = { RCTYPE_magic,
! dt_SHARED_parse_line, dt_SHARED_parse_cline,
dt_SHARED_print_value, dt_SHARED_get_value };


***************
*** 1046,1052 ****
local_value =
library_list[i]->rc_options[x].flags & FL_LOCAL;

! if (!valid_rc_type(library_list[i]->rc_options[x].dt_type)) {
DPRINT(Debug,1,(&Debug,


"shlib/option %d -- \"%s\" BAD, flags=%0x (library=%s)\n",

x,library_list[i]->rc_options[x].name,
--- 1007,1013 ----
local_value =
library_list[i]->rc_options[x].flags & FL_LOCAL;

! if (RCTYPE_magic != library_list[i]->rc_options[x].dt_type->magic) {
DPRINT(Debug,1,(&Debug,


"shlib/option %d -- \"%s\" BAD, flags=%0x (library=%s)\n",

x,library_list[i]->rc_options[x].name,
Index: elm2.4.ME+.117-cvs/melib/mime_parse.c
*** elm2.4.ME+.116/melib/mime_parse.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/melib/mime_parse.c 2004-06-27 18:18:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.45 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.46 2004/06/27 15:18:05 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 239,284 ****
return 1;
}

- int class_charset(charset_value)
- char * charset_value;
- {
- /* Return > 0 (2) if charset is displayable with display_charset
- * Return < 0 (-2) if charset needs translating to display_charset
- */


- int ret = 0;

- charset_t charset_value_p = MIME_name_to_charset(charset_value,0);
-
- /* Check agaist display charset */
- if (0 == istrcmp(charset_value,"US-ASCII") &&
- charset_ok_p(display_charset))
- ret = 2;
- /* If display_charset can show us-ascii? */
- else if (display_charset->MIME_name &&
- 0 == istrcmp(charset_value,display_charset->MIME_name))
- ret = 2;
- /* if charset is subset of display */
- else if (charset_value_p && charset_superset_of(display_charset,
- charset_value_p))
- ret = 2;
- else if (charset_value_p &&
- (CS_printable & charset_properties(charset_value_p)))
- ret = -2; /* convert (filter?) to display charset */
- else
- ret = 0;
-
- DPRINT(Debug,9,(&Debug,
- "class_charset: charset_value=\"%s\"\n",
- charset_value));
- DPRINT(Debug,9,(&Debug,
- " : display_charset=\"%s\"\n",
- display_charset->MIME_name ?
- display_charset->MIME_name :


- "<no MIME name>"));

- DPRINT(Debug,9,(&Debug,
- "class_charset=%d\n",ret));
-
- return ret;
- }

int mime_get_charset (charset_value, opts, display_charset,
default_content_charset)
--- 239,244 ----
Index: elm2.4.ME+.117-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.116/nls/C/C/C/s_elm.m 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/nls/C/C/C/s_elm.m 2004-06-20 21:03:06.000000000 +0300
***************
*** 995,1003 ****
555 I can't understand sort key "%s" in line %d in "%s" file
$ #BadAliasSortInElmrc
556 I can't understand alias sort key "%s" in line %d in "%s" file
- $ #SignatureObsolete
- 557 "signature" used in obsolete way in .elm/elmrc file. Ignored!\n\
- \t(Signature should specify the filename to use rather than on/off.)
$ #BouncebackGTMaxhops
558 Warning: bounceback is set to greater than %d (max-hops). Ignored.\n\r
$ #TimeoutLTTen
--- 995,1000 ----
***************
*** 2299,2301 ****
--- 2296,2306 ----


2151 "The recv'd message was PGP encoded, are you sure? "

$ #FailedLeaveChange


2152 "Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "

+ $ #ChangedAttachEnc
+ 2153 "Changed encoding of %d attachments"
+ $ #NoDSN
+ 2154 "Mailer do not support DSN, disabling it"
+ $ #MailerDisconnected
+ 2155 "Mailer disconnected! Can't send message. Use f)orget !"
+ $ #MimeFWMessageYN
+ 2156 'Forward message as separate part? (%c/%c) '
Index: elm2.4.ME+.117-cvs/shared_libs/include/shared.h
*** elm2.4.ME+.116/shared_libs/include/shared.h 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/shared_libs/include/shared.h 2004-06-18 12:29:50.000000000 +0300
***************
*** 1,7 ****
! /* $Id: shared.h,v 1.25 2004/03/27 18:31:43 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: shared.h,v 1.26 2004/06/18 09:29:50 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

***************
*** 55,63 ****
typedef struct SE_option_type **
provides_shared_SEOT_f P_((int *count, size_t *s_size));

- typedef struct rc_type **
- provides_shared_RCT_f P_((int *count, size_t *s_size));
-
typedef struct rc_save_info_rec
* provides_RC_options_f P_((int *count, size_t *s_size));

--- 55,60 ----
Index: elm2.4.ME+.117-cvs/shared_libs/smtp/smtp.c
*** elm2.4.ME+.116/shared_libs/smtp/smtp.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/shared_libs/smtp/smtp.c 2004-05-23 15:31:00.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: smtp.c,v 1.42 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: smtp.c,v 1.43 2004/05/23 12:31:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1717,1723 ****
I->p.p1->response_code[0] = '\0';
I->p.p1->response_text = NULL;
I->p.p1->response_text_len = 0;
- I->p.p1->SMTP_flags = 0;

I->p.p1->incomplete_command = NULL;
I->p.p1->incomplete_command_len = 0;
--- 1717,1722 ----
***************
*** 1726,1731 ****
--- 1725,1733 ----
I->p.p1->ESMPT_keyword_len = -1; /* -1 == EHLO not issued yet */
I->p.p1->state = smtp_error;

+ I->p.p1->SMTP_flags = 0;
+
+
if (!connect_remote_account(&(I->p.p1->RA),&got,se,ports))
goto clean;

***************
*** 1748,1756 ****
DPRINT(Debug,8,(&Debug,
"submission_mailer_info_init: smtp service\n"));

default:
DPRINT(Debug,1,(&Debug,
! "submission_mailer_info_init: Unknown sercide!\n"));
}

I->p.p1->state = smtp_wait_reply;
--- 1750,1760 ----
DPRINT(Debug,8,(&Debug,
"submission_mailer_info_init: smtp service\n"));

+ break;
+
default:
DPRINT(Debug,1,(&Debug,
! "submission_mailer_info_init: Unknown service!\n"));
}

I->p.p1->state = smtp_wait_reply;
***************
*** 1781,1786 ****
--- 1785,1946 ----
return status;
}

+ static void mailer_close2 P_((struct mailer_info *I));
+ static void mailer_close2(I)
+ struct mailer_info *I;
+ {
+ free_Read_Buffer(& (I->p.p1->read_buffer));
+ free_Write_Buffer(& (I->p.p1->write_buffer));
+
+ free_response_text(I->p.p1);
+
+ if (I->p.p1->incomplete_command)
+ free(I->p.p1->incomplete_command);
+
+ I->p.p1->incomplete_command = NULL;
+ I->p.p1->incomplete_command_len = 0;
+
+ if (I->p.p1->ESMPT_keywords) {
+ int i;
+ for (i = 0; i < I->p.p1->ESMPT_keyword_len; i++) {
+ if (I->p.p1->ESMPT_keywords[i])
+ free(I->p.p1->ESMPT_keywords[i]);
+ I->p.p1->ESMPT_keywords[i] = NULL;
+ }
+ free(I->p.p1->ESMPT_keywords);
+ }
+ I->p.p1->ESMPT_keywords = NULL;
+ I->p.p1->ESMPT_keyword_len = -1; /* -1 == EHLO not issued yet */
+ }
+
+ /* Return
+ 1 == mailer restarted, reconnect succeed -- reask info
+ 0 == mailer not disconnected
+ -1 == mailer disconnected, reconnect failed
+ */
+ S_(mailer_info_restart_hook submission_mailer_info_rs_hook)
+ static int submission_mailer_info_rs_hook P_((struct mailer_config *M,
+ struct mailer_info *I));
+ static int submission_mailer_info_rs_hook(M,I)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ {
+ int is_ok = 1;


+ int status = 0;
+

+ char response_code[3];
+
+ PORTS ports[] = { PORT_submission, PORT_smtp, PORT_end };
+ int got; /* port number */
+
+ struct service_entry *se = NULL;
+
+ if (smtp_start_command(I->p.p1,"NOOP")) {
+
+ smtp_command_ready(I->p.p1,0);
+
+ is_ok = smtp_command_ok(I->p.p1,response_code);
+
+ smtp_command_reset(I->p.p1);
+ } else
+ is_ok = 0;
+
+ if (is_ok) {
+ DPRINT(Debug,12,(&Debug,
+ "submission_mailer_info_rs_hook=0 (OK, mailer not disconnected)\n"));
+
+ return 0; /* Mailer OK -- need not restart */
+ }
+
+ /* Send QUIT */
+ if (smtp_idle == I->p.p1->state) {
+ int status = smtp_start_command(I->p.p1,"QUIT");
+
+ if (status) {
+ smtp_command_ready(I->p.p1,0);
+
+ /* Wait for QUIT */
+ smtp_command_reset(I->p.p1);
+ }
+ }
+
+
+ status = -1;
+
+ /* Actually close connection */
+ free_remote_account(& (I->p.p1->RA));
+ mailer_close2(I);
+
+ se = give_service_entry(submission_server, STFLAG_smtp_like);
+ if (!se) {
+ status = -1;
+ goto clean;
+ }
+
+ /* Try reconnect */
+ I->p.p1->state = smtp_error;
+ I->p.p1->SMTP_flags = 0;
+
+
+ if (!connect_remote_account(&(I->p.p1->RA),&got,se,ports))
+ goto clean;
+
+ if (SUBMISSION_SERVICE == se->service)
+ goto is_submission;
+ else if (SMTP_SERVICE == se->service)
+ goto is_smtp;
+ else switch (got) {
+ case PORT_submission:
+ is_submission:
+
+ DPRINT(Debug,8,(&Debug,
+ "submission_mailer_info_rs_hook: Submission service\n"));
+ I->p.p1->SMTP_flags = SMTP_submission;
+ break;
+
+ case PORT_smtp:
+ is_smtp:
+
+ DPRINT(Debug,8,(&Debug,
+ "submission_mailer_info_rs_hook: smtp service\n"));
+
+ break;
+ default:
+ DPRINT(Debug,1,(&Debug,
+ "submission_mailer_info_rs_hook: Unknown sercide!\n"));
+ }
+
+ I->p.p1->state = smtp_wait_reply;
+
+ ConfigStream(I->p.p1->RA.stream,
+ smtp_read_action,ss_noaction_routine,smtp_timeout_action,
+ SMTP_TIMEOUT,I->p.p1);
+
+
+
+ if (!smtp_command_ok(I->p.p1,response_code)) {
+ DPRINT(Debug,12,(&Debug,
+ "submission_mailer_info_rs_hook: Failed to get greeting from server\n"));
+
+ /* Caller will call sendmailbs_mailer_info_close ... */
+ status = -1;
+ goto clean;
+ }
+ smtp_command_reset(I->p.p1);
+ status = 1; /* reconnect succeed */
+
+ clean:
+
+ if (se)
+ free_temporary_service_entry(&se);
+
+ DPRINT(Debug,12,(&Debug,
+ "submission_mailer_info_rs_hook=%d\n",status));


+ return status;
+
+ }
+
+

S_(mailer_info_close_hook submission_mailer_info_close)
static void submission_mailer_info_close(M,I)
struct mailer_config *M;
***************
*** 1803,1830 ****
}

free_remote_account(& (I->p.p1->RA));
! free_Read_Buffer(& (I->p.p1->read_buffer));
! free_Write_Buffer(& (I->p.p1->write_buffer));
!
! free_response_text(I->p.p1);
!
! if (I->p.p1->incomplete_command)
! free(I->p.p1->incomplete_command);
!
! I->p.p1->incomplete_command = NULL;
! I->p.p1->incomplete_command_len = 0;
!
! if (I->p.p1->ESMPT_keywords) {
! int i;
! for (i = 0; i < I->p.p1->ESMPT_keyword_len; i++) {
! if (I->p.p1->ESMPT_keywords[i])
! free(I->p.p1->ESMPT_keywords[i]);
! I->p.p1->ESMPT_keywords[i] = NULL;
! }
! free(I->p.p1->ESMPT_keywords);
! }
! I->p.p1->ESMPT_keywords = NULL;
! I->p.p1->ESMPT_keyword_len = -1; /* -1 == EHLO not issued yet */

/* bzero is defined on hdrs/defs.h */
bzero((void *)I->p.p1,sizeof (* (I->p.p1)));
--- 1963,1969 ----
}

free_remote_account(& (I->p.p1->RA));
! mailer_close2(I);



/* bzero is defined on hdrs/defs.h */

bzero((void *)I->p.p1,sizeof (* (I->p.p1)));
***************
*** 2004,2010 ****
I->p.p1->response_code[0] = '\0';
I->p.p1->response_text = NULL;
I->p.p1->response_text_len = 0;
- I->p.p1->SMTP_flags = SMTP_submission;

I->p.p1->incomplete_command = NULL;
I->p.p1->incomplete_command_len = 0;
--- 2143,2148 ----
***************
*** 2012,2017 ****
--- 2150,2157 ----
I->p.p1->ESMPT_keywords = NULL;
I->p.p1->ESMPT_keyword_len = -1; /* -1 == EHLO not issued yet */

+ I->p.p1->SMTP_flags = SMTP_submission;
+
if (!smtp_command_ok(I->p.p1,response_code)) {
DPRINT(Debug,12,(&Debug,
"sendmailbs_mailer_info_init: Failed to get greeting from sendmail -bs\n"));
***************
*** 2024,2029 ****
--- 2164,2211 ----
return 1;
}

+
+ /* Return
+ 1 == mailer restarted, reconnect succeed -- reask info
+ 0 == mailer not disconnected
+ -1 == mailer disconnected, reconnect failed
+ */
+ S_(mailer_info_restart_hook sendmailbs_mailer_info_rs_hook)
+ static int sendmailbs_mailer_info_rs_hook P_((struct mailer_config *M,
+ struct mailer_info *I));
+ static int sendmailbs_mailer_info_rs_hook(M,I)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ {
+ int is_ok = 0;
+
+ if (smtp_start_command(I->p.p1,"NOOP")) {
+ char response_code[3];
+
+ smtp_command_ready(I->p.p1,0);
+
+ is_ok = smtp_command_ok(I->p.p1,response_code);
+
+ smtp_command_reset(I->p.p1);
+ } else
+ is_ok = 0;
+
+ if (is_ok) {
+ DPRINT(Debug,12,(&Debug,
+ "sendmailbs_mailer_info_rs_hook=0 (OK, mailer not disconnected)\n"));
+
+ return 0; /* Mailer OK -- need not restart */
+ }
+
+ /* TODO -- implement reconnect */
+
+ DPRINT(Debug,4,(&Debug,
+ "sendmailbs_mailer_info_rs_hook=-1 (reconnect not implemented)\n"));
+
+ return -1; /* reconnect not implemented */
+ }
+
+
S_(mailer_info_close_hook sendmailbs_mailer_info_close)
static void sendmailbs_mailer_info_close(M,I)
struct mailer_config *M;
***************
*** 2111,2138 ****
}
}

! free_Read_Buffer(& (I->p.p1->read_buffer));
! free_Write_Buffer(& (I->p.p1->write_buffer));
!
! free_response_text(I->p.p1);
!
! if (I->p.p1->incomplete_command)
! free(I->p.p1->incomplete_command);
!
! I->p.p1->incomplete_command = NULL;
! I->p.p1->incomplete_command_len = 0;
!
! if (I->p.p1->ESMPT_keywords) {
! int i;
! for (i = 0; i < I->p.p1->ESMPT_keyword_len; i++) {
! if (I->p.p1->ESMPT_keywords[i])
! free(I->p.p1->ESMPT_keywords[i]);
! I->p.p1->ESMPT_keywords[i] = NULL;
! }
! free(I->p.p1->ESMPT_keywords);
! }
! I->p.p1->ESMPT_keywords = NULL;
! I->p.p1->ESMPT_keyword_len = -1; /* -1 == EHLO not issued yet */

/* bzero is defined on hdrs/defs.h */
bzero((void *)I->p.p1,sizeof (* (I->p.p1)));
--- 2293,2299 ----
}
}

! mailer_close2(I);



/* bzero is defined on hdrs/defs.h */

bzero((void *)I->p.p1,sizeof (* (I->p.p1)));
***************
*** 2215,2220 ****
--- 2376,2382 ----
submission_mailer_info_init, submission_mailer_info_close,
smtp_common_mailer_info_query, submission_mailer_info_verify_addr,
smtp_common_mailer_info_gen_def_ef, smtp_common_mailer_info_set_ef,
+ submission_mailer_info_rs_hook,

MB_USE_DOMAIN|MB_REQ_DEFAULT_SENDER
},
***************
*** 2226,2232 ****
sendmailbs_mailer_info_init, sendmailbs_mailer_info_close,
smtp_common_mailer_info_query, sendmailbs_mailer_info_verify_addr,
smtp_common_mailer_info_gen_def_ef, smtp_common_mailer_info_set_ef,
!
MB_USE_DOMAIN|MB_REQ_DEFAULT_SENDER
},
#endif
--- 2388,2395 ----
sendmailbs_mailer_info_init, sendmailbs_mailer_info_close,
smtp_common_mailer_info_query, sendmailbs_mailer_info_verify_addr,
smtp_common_mailer_info_gen_def_ef, smtp_common_mailer_info_set_ef,
! sendmailbs_mailer_info_rs_hook,
!
MB_USE_DOMAIN|MB_REQ_DEFAULT_SENDER
},
#endif
Index: elm2.4.ME+.117-cvs/src/alias.c
*** elm2.4.ME+.116/src/alias.c 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.117-cvs/src/alias.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.35 2004/04/07 17:42:58 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.36 2004/06/18 20:40:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 1137,1143 ****
FlushBuffer();

redraw += a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,
page);
}
else {
--- 1137,1143 ----
FlushBuffer();

redraw += a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,
page);
}
else {
Index: elm2.4.ME+.117-cvs/src/args.c
*** elm2.4.ME+.116/src/args.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/args.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: args.c,v 1.61 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.62 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 469,475 ****
printf("\tHostname: %s\n",hostname);
printf("\tHost's domain: %s\n",hostdomain);
printf("\tQualified hostname: %s\n",hostfullname);
! printf("\tMailbox: %s\n",defaultfile);

if(mailerfunc(&value,0,0,NULL))
printf("\tMailer: %s\n",value);
--- 469,480 ----
printf("\tHostname: %s\n",hostname);
printf("\tHost's domain: %s\n",hostdomain);
printf("\tQualified hostname: %s\n",hostfullname);
! {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! printf("\tMailbox: %s\n",
! default_val ? default_val : "<no value>");
! }

if(mailerfunc(&value,0,0,NULL))
printf("\tMailer: %s\n",value);
***************
*** 617,623 ****
printf("(%s)",raw_default_nomime_charset);
putchar('\n');

! printf("\tMailbox: %s\n",defaultfile);


}
--- 622,632 ----
printf("(%s)",raw_default_nomime_charset);
putchar('\n');

! {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
! printf("\tMailbox: %s\n",
! default_val ? default_val : "<no value>");
! }


}
Index: elm2.4.ME+.117-cvs/src/attach_menu.c
*** elm2.4.ME+.116/src/attach_menu.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/attach_menu.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.62 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.63 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.63 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 574,579 ****
--- 574,580 ----
int savetime;
struct stat sb;
char buf[STRING];
+ char *editor_val;

if (ptr->magic != MIME_magic)
mime_panic(__FILE__,__LINE__,"attach_edit",
***************
*** 588,600 ****
sleep_message();
return;
}
! if (strlen(ptr->pathname) + strlen(editor) > STRING-5)
return;
savetime = sb.st_mtime;

Raw(OFF);
elm_sfprintf (buf, sizeof buf,
! FRM("%s %s"), editor, ptr->pathname);
system_call (buf, 0, NULL);
Raw(ON);

--- 589,606 ----
sleep_message();
return;
}
!
! editor_val = give_dt_estr_as_str(&editor_e,"editor");
!
!
! if (!editor_val ||
! strlen(ptr->pathname) + strlen(editor_val) > STRING-5)
return;
savetime = sb.st_mtime;

Raw(OFF);
elm_sfprintf (buf, sizeof buf,
! FRM("%s %s"), editor_val, ptr->pathname);
system_call (buf, 0, NULL);
Raw(ON);

Index: elm2.4.ME+.117-cvs/src/browser.c
*** elm2.4.ME+.116/src/browser.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/src/browser.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: browser.c,v 1.30 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: browser.c,v 1.31 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 374,380 ****
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmListFoldersHelp1,
"Enter: <nothing> to not save a copy of the message,\n\
\r '<' to save in your \"sent\" folder ("));
! Write_to_screen(FRM("%s"), sent_mail);
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmListFoldersHelp2,
"),\n\
--- 374,386 ----
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmListFoldersHelp1,
"Enter: <nothing> to not save a copy of the message,\n\
\r '<' to save in your \"sent\" folder ("));
!
! {
! char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
!
! Write_to_screen(FRM("%s"), sent_val);
! }
!
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmListFoldersHelp2,
"),\n\
***************
*** 395,410 ****
" to. Several options\n\rare available:\n\r\
\n\r '!' will use your incoming mailbox ("));

! Write_to_screen(FRM("%s"),defaultfile);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg3,
")\n\r '>' will use your \"received\" folder ("));
! Write_to_screen(FRM("%s"),recvd_mail);
!
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg4,
")\n\r '<' will use your \"sent\" folder ("));
! Write_to_screen(FRM("%s"), sent_mail);
!
if (I->pvector[3]) {
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg5,
")\n\r '.' will use the previous folder ("));
--- 401,430 ----
" to. Several options\n\rare available:\n\r\
\n\r '!' will use your incoming mailbox ("));

! {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val)
! Write_to_screen(FRM("%s"),default_val);
! }

Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg3,
")\n\r '>' will use your \"received\" folder ("));
! {
! char * recvd_val = give_dt_estr_as_str(&recvd_mail_e,"receivedmail");
! if (recvd_val)
! Write_to_screen(FRM("%s"),recvd_val);
! }
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg4,
")\n\r '<' will use your \"sent\" folder ("));
!
! {
! char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
!
! if (sent_val)
! Write_to_screen(FRM("%s"), sent_val);
! }
!
if (I->pvector[3]) {
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg5,
")\n\r '.' will use the previous folder ("));
Index: elm2.4.ME+.117-cvs/src/calendar.c
*** elm2.4.ME+.116/src/calendar.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/calendar.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: calendar.c,v 1.13 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: calendar.c,v 1.14 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 49,83 ****
FILE *calendar;
int count;
int err;

/* First step is to open the calendar file for appending... **/

! if (can_open(calendar_file, "a") != 0) {
err = errno;
DPRINT(Debug,2,
(&Debug,
"Error: wrong permissions to append to calendar %s\n",
! calendar_file));
DPRINT(Debug,2,
(&Debug, "** - %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, ErrorSet, ErrorCalendarCanOpen,
"Not able to append to file %s!"),
! calendar_file);
return;
}

! save_file_stats(calendar_file);

! if ((calendar = fopen(calendar_file,"a")) == NULL) {
err = errno;
DPRINT(Debug,2,(&Debug,
"Error: couldn't append to calendar file %s (scan)\n",
! calendar_file));
DPRINT(Debug,2,(&Debug,
"** - %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, ErrorSet, ErrorCalendarAppend,
"Couldn't append to file %s!"),
! calendar_file);
return;
}

--- 49,89 ----
FILE *calendar;
int count;
int err;
+ char * cal_val = give_dt_estr_as_str(&calendar_file_e,"calendar");
+
+ if (!cal_val) {
+ sleep_message();
+ return;
+ }

/* First step is to open the calendar file for appending... **/

! if (can_open(cal_val, "a") != 0) {
err = errno;
DPRINT(Debug,2,
(&Debug,
"Error: wrong permissions to append to calendar %s\n",
! cal_val));
DPRINT(Debug,2,
(&Debug, "** - %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, ErrorSet, ErrorCalendarCanOpen,
"Not able to append to file %s!"),
! cal_val);
return;
}

! save_file_stats(cal_val);

! if ((calendar = fopen(cal_val,"a")) == NULL) {
err = errno;
DPRINT(Debug,2,(&Debug,
"Error: couldn't append to calendar file %s (scan)\n",
! cal_val));
DPRINT(Debug,2,(&Debug,
"** - %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, ErrorSet, ErrorCalendarAppend,
"Couldn't append to file %s!"),
! cal_val);
return;
}

***************
*** 85,91 ****

fclose(calendar);

! restore_file_stats(calendar_file);

if (count > 0) {
if (count > 1)
--- 91,97 ----

fclose(calendar);

! restore_file_stats(cal_val);

if (count > 0) {
if (count > 1)
Index: elm2.4.ME+.117-cvs/src/edit.c
*** elm2.4.ME+.116/src/edit.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/edit.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: edit.c,v 1.19 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: edit.c,v 1.20 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 97,142 ****

char buffer[SLEN];
int LINES, COLUMNS;
!
menu_get_sizes(page,&LINES, &COLUMNS);


PutLineX(LINES-2,0, CATGETS(elm_msg_cat, ElmSet, ElmInvokeEditor,
"Invoking editor..."));

! if (strcmp(editor, "builtin") == 0 || strcmp(editor, "none") == 0) {
! if (in_string(alternative_editor, "%s"))
elm_sfprintf(buffer, sizeof buffer,
FRM(alternative_editor), editfile);
! else
elm_sfprintf(buffer, sizeof buffer,
FRM("%s %s"), alternative_editor, editfile);
! } else {


! if (in_string(editor, "%s"))

elm_sfprintf(buffer, sizeof buffer,
! FRM(editor), editfile);
! else
elm_sfprintf(buffer, sizeof buffer,
! FRM("%s %s"), editor, editfile);
! }
!
! Raw(OFF);
!
! if (system_call(buffer, SY_ENAB_SIGHUP, NULL) == -1) {
! Raw(ON);
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmProblemsInvokingEditor,
! "Problems invoking editor %s!"),
! alternative_editor);
! sleep_message();
! return(0);
! }
!
Raw(ON);
!
! /* a location not near the next request, so an absolute is used */
! InvalidateLocation();
!
! return(1);
}

/*
--- 97,147 ----

char buffer[SLEN];
int LINES, COLUMNS;
! char * editor_val;
!
menu_get_sizes(page,&LINES, &COLUMNS);


+ editor_val = give_dt_estr_as_str(&editor_e,"editor");
+
+
PutLineX(LINES-2,0, CATGETS(elm_msg_cat, ElmSet, ElmInvokeEditor,
"Invoking editor..."));

! if (! editor_val ||
! strcmp(editor_val, "builtin") == 0 ||
! strcmp(editor_val, "none") == 0) {
! if (in_string(alternative_editor, "%s"))
elm_sfprintf(buffer, sizeof buffer,
FRM(alternative_editor), editfile);
! else
elm_sfprintf(buffer, sizeof buffer,
FRM("%s %s"), alternative_editor, editfile);
! } else {
! if (in_string(editor_val, "%s"))
elm_sfprintf(buffer, sizeof buffer,
! FRM(editor_val), editfile);
! else
elm_sfprintf(buffer, sizeof buffer,
! FRM("%s %s"), editor_val, editfile);
! }
!
! Raw(OFF);
!
! if (system_call(buffer, SY_ENAB_SIGHUP, NULL) == -1) {
Raw(ON);
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmProblemsInvokingEditor,
! "Problems invoking editor %s!"),
! alternative_editor);
! sleep_message();
! return(0);
! }
!
! Raw(ON);
!
! InvalidateLocation();
!
! return(1);
}

/*
Index: elm2.4.ME+.117-cvs/src/editmsg.c
*** elm2.4.ME+.116/src/editmsg.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/editmsg.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.42 2004/03/27 18:31:44 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.43 2004/06/18 09:29:51 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 36,50 ****
int interrupts_while_editing; /* keep track 'o dis stuff */
JMP_BUF edit_location; /* for getting back from interrupt */

- static int no_editor_edit_the_message P_((char *filename,
- struct mailing_headers * headers,
- charset_t file_set,
- struct mailer_info *mailer_info,
- struct MailboxView *mailbox
- /* needed for system_call() */,
- struct AliasView *aview
- ));
-
struct builtin_edit {
struct mailing_headers * headers;
FILE * edit_fd;
--- 36,41 ----
***************
*** 1962,1969 ****
}


! static int no_editor_edit_the_message(filename,headers,file_set,mailer_info,
! mailbox,aview)
char *filename;
struct mailing_headers * headers;
charset_t file_set;
--- 1953,1960 ----
}


! int no_editor_edit_the_message(filename,headers,file_set,mailer_info,
! mailbox,aview)
char *filename;
struct mailing_headers * headers;
charset_t file_set;
Index: elm2.4.ME+.117-cvs/src/elm.c
*** elm2.4.ME+.116/src/elm.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/elm.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.69 2004/03/27 18:31:44 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.70 2004/06/18 20:40:56 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.70 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 253,273 ****
ElmNoMailToForward,
"No mail to forward!"));

! else if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine)) {

! if (forward(hdr,F,mailbox, aview, page))
(*redraw)++;
else {
(*nufoot)++;
show_msg_status(current-1,&MENU, *header_page);
}
! } else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
!
! }
/* define_softkeys(MAIN); */
}
break;
--- 253,267 ----
ElmNoMailToForward,
"No mail to forward!"));

! else {

! if (forward(current-1,mailbox, aview, page))
(*redraw)++;
else {
(*nufoot)++;
show_msg_status(current-1,&MENU, *header_page);
}
! }
/* define_softkeys(MAIN); */
}
break;
***************
*** 288,294 ****
ElmNoMailToReply,
"No mail to reply to!"));
else if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
mime_parse_routine)) {

if (hdr->status & FORM_LETTER) {
--- 282,288 ----
ElmNoMailToReply,
"No mail to reply to!"));
else if (give_message_data(mailbox,current-1,
! &hdr,NULL,NULL,
mime_parse_routine)) {

if (hdr->status & FORM_LETTER) {
***************
*** 299,305 ****
} else {
/* define_softkeys(YESNO); */

! (*redraw) += reply_to_everyone(hdr,F,
mailbox,
aview,
page);
--- 293,299 ----
} else {
/* define_softkeys(YESNO); */

! (*redraw) += reply_to_everyone(current-1,
mailbox,
aview,
page);
***************
*** 403,411 ****
ElmMail,
"Mail"));
FlushBuffer();
! (*redraw) += send_msg_l(NULL,NULL, NULL, NULL,
! MAIL_EDIT_MSG,allow_forms,NULL,
! mailbox,aview,page);
break;

case ' ' :
--- 397,405 ----
ElmMail,
"Mail"));
FlushBuffer();
! (*redraw) += send_msg_l(-1, NULL, NULL, NULL,
! MAIL_EDIT_MSG,allow_forms,
! mailbox, aview,page);
break;

case ' ' :
***************
*** 668,686 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMailToReplyTo,
"No mail to reply to!"));
! else if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine)) {

! (*redraw) += reply(hdr,F,mailbox, aview, page);

if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
! } else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
!
/* softkeys_on(); */
}
break;
--- 662,674 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMailToReplyTo,
"No mail to reply to!"));
! else {

! (*redraw) += reply(current-1,mailbox, aview, page);

if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
! }
/* softkeys_on(); */
}
break;
Index: elm2.4.ME+.117-cvs/src/forms.c
*** elm2.4.ME+.116/src/forms.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/forms.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forms.c,v 1.23 2004/03/27 18:31:45 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forms.c,v 1.24 2004/06/18 20:40:56 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 188,199 ****
return(form_count);
}

! int mail_filled_in_form(current_header,address, subject, infile,
mailbox,aview)
! struct header_rec * current_header;
struct addr_item *address;
char *subject;
- FILE *infile;
struct MailboxView *mailbox;
struct AliasView *aview;
{
--- 188,198 ----
return(form_count);
}

! int mail_filled_in_form(mail_index,address, subject,
mailbox,aview)
! int mail_index;
struct addr_item *address;
char *subject;
struct MailboxView *mailbox;
struct AliasView *aview;
{
***************
*** 207,224 ****
char buffer[SLEN];
struct menu_context *page = NULL;
struct menu_context *cpage;

DPRINT(Debug,4,
(&Debug,
"replying to form with;\n\tsubject=%s\n",
subject));

!
/* now we can fly along and get to the message body... */

! max_lines = current_header->lines;
while (0 < (len_buf =
! mail_gets(buffer, SLEN, infile))) {
if (len_buf == 1) /* <return> only */
break;
else if (lines >= max_lines) {
--- 206,231 ----
char buffer[SLEN];
struct menu_context *page = NULL;
struct menu_context *cpage;
+ struct header_rec *hdr = NULL;
+ FILE * mail_file = NULL;
+

DPRINT(Debug,4,
(&Debug,
"replying to form with;\n\tsubject=%s\n",
subject));

!
! if (!give_message_data(mailbox,mail_index,
! &hdr,&mail_file,NULL,
! NO_mime_parse))
! return 0;
!
/* now we can fly along and get to the message body... */

! max_lines = hdr->lines;
while (0 < (len_buf =
! mail_gets(buffer, SLEN, mail_file))) {
if (len_buf == 1) /* <return> only */
break;
else if (lines >= max_lines) {
***************
*** 246,252 ****
line with a triple asterisk... */

while (0 < (len_buf =
! mail_gets(buffer, SLEN, infile))) {
if (strcmp(buffer, "***\n") == 0)
break; /* we GOT it! It's a miracle! */

--- 253,259 ----
line with a triple asterisk... */

while (0 < (len_buf =
! mail_gets(buffer, SLEN, mail_file))) {
if (strcmp(buffer, "***\n") == 0)
break; /* we GOT it! It's a miracle! */

***************
*** 298,304 ****
/* !!! FIXME this is quite bogus ... */

while (0 < (len_buf =
! mail_gets(buffer, SLEN, infile))) {
DPRINT(Debug,9,(&Debug,
"- read %s", buffer));
if (strcmp(buffer, "***\n") == 0) /* end of form! */
--- 305,311 ----
/* !!! FIXME this is quite bogus ... */

while (0 < (len_buf =
! mail_gets(buffer, SLEN, mail_file))) {
DPRINT(Debug,9,(&Debug,
"- read %s", buffer));
if (strcmp(buffer, "***\n") == 0) /* end of form! */
***************
*** 338,344 ****

/** let's just mail this off now... **/

! mail_form(current_header,address, subject, infile,
mailbox /* for save_copy */,
aview);

--- 345,351 ----

/** let's just mail this off now... **/

! mail_form(mail_index,address, subject,
mailbox /* for save_copy */,
aview);

Index: elm2.4.ME+.117-cvs/src/hdrconfg.c
*** elm2.4.ME+.116/src/hdrconfg.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/hdrconfg.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.39 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.40 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 756,765 ****


struct hdr_menu_item *h;
int precmd = 0;

!
int editor_available =
! strcmp(editor, "builtin") != 0 &&
! strcmp(editor, "none") != 0;


int LINES, COLUMNS;
--- 756,766 ----
struct hdr_menu_item *h;
int precmd = 0;

! char * editor_val = give_dt_estr_as_str(&editor_e,"editor");
int editor_available =
! editor_val &&
! strcmp(editor_val, "builtin") != 0 &&
! strcmp(editor_val, "none") != 0;


int LINES, COLUMNS;
***************
*** 901,912 ****
break;


case 'e':
! editor_available &= have_editor(editor);
!
! if (editor_available)
! edit_headers_on_editor(headers,editor,

! hdr_encoding_supported,
! page);

do_redraw = TRUE;
break;
--- 902,915 ----
break;

case 'e':
! if (editor_val) {
! editor_available &= have_editor(editor_val);
!
! if (editor_available)
! edit_headers_on_editor(headers,editor_val,
! hdr_encoding_supported,
! page);
! }

do_redraw = TRUE;
break;
Index: elm2.4.ME+.117-cvs/src/init.c
*** elm2.4.ME+.116/src/init.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/init.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: init.c,v 1.49 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: init.c,v 1.50 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 615,623 ****
}

/* Determine the mail file to read */
! if (!requestedmfiles || ! requestedmfiles[0])
! folder = enter_new_folder(defaultfile);
! else {
/* Assuming that file name given with -f is on
local-fs-charset and not system_charset
*/
--- 615,628 ----
}

/* Determine the mail file to read */
! if (!requestedmfiles || ! requestedmfiles[0]) {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val)
! folder = enter_new_folder(default_val);
! else
! folder = NULL;
! } else {
/* Assuming that file name given with -f is on
local-fs-charset and not system_charset
*/
***************
*** 711,737 ****
"hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
hostname, username, full_username);
debug_action_call(&Debug,
! "home = %-20s \teditor = %-20s \trecvd_mail = %-20s\n",
! home, editor, recvd_mail);

debug_action_call(&Debug,
"folders = %-20s \tprintout = %-20s\n",
folders, printout);

debug_action_call(&Debug,
! "sent_mail = %-20s \tprefix = %-20s \tshell = %-20s\n\n",
! sent_mail, prefixchars, shell);
!
! if (local_signature[0])
! debug_action_call(&Debug,
! "local_signature = \"%s\"\n",
! local_signature);
! if (remote_signature[0])
! debug_action_call(&Debug,
! "remote_signature = \"%s\"\n",
! remote_signature);
! if (local_signature[0] || remote_signature[0])
! debug_action_call(&Debug, "\n");
}
#endif
}
--- 716,731 ----
"hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
hostname, username, full_username);
debug_action_call(&Debug,
! "home = %-20s \n",
! home);

debug_action_call(&Debug,
"folders = %-20s \tprintout = %-20s\n",
folders, printout);

debug_action_call(&Debug,
! " \tprefix = %-20s \tshell = %-20s\n\n",
! prefixchars, shell);
}
#endif
}
Index: elm2.4.ME+.117-cvs/src/leavembox.c
*** elm2.4.ME+.116/src/leavembox.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/src/leavembox.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.46 2004/05/02 11:15:26 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.47 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 199,207 ****
/* Permissons check for and opening of =received done earlier */

DPRINT(Debug,10,(&Debug,
! "!! Copying from %s to %s\n",
! storage->current_folder->cur_folder_sys,
! recvd_mail));

DPRINT(Debug,2,(&Debug, "Storing message%s ", plural(to_store)));
for (i = 0; i < storage->message_count; i++) {
--- 199,206 ----
/* Permissons check for and opening of =received done earlier */

DPRINT(Debug,10,(&Debug,
! "!! Copying from %s to received folder\n",
! storage->current_folder->cur_folder_sys));

DPRINT(Debug,2,(&Debug, "Storing message%s ", plural(to_store)));
for (i = 0; i < storage->message_count; i++) {
Index: elm2.4.ME+.117-cvs/src/mailmsg1.c
*** elm2.4.ME+.116/src/mailmsg1.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/mailmsg1.c 2004-06-27 18:18:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.36 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.40 2004/06/27 15:18:05 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,38 ****
}


-
static int to_line, to_col;

! static int copy_the_msg P_((struct mailing_headers *headers,
! int *is_a_response, int options,
! struct menu_context *page));



static CONST unsigned char * csUs P_((const char *str));

static CONST unsigned char * csUs(str)

--- 27,39 ----
}


static int to_line, to_col;

! static enum copy_msg_mode { cm_no_copy = 0, cm_get_copy, cm_canceled_mail,
! cm_mimeforward
! } copy_the_msg P_((struct mailing_headers *headers,
! int options,
! struct menu_context *page));



static CONST unsigned char * csUs P_((const char *str));

static CONST unsigned char * csUs(str)

***************
*** 250,283 ****
struct menu_context *page));

static int send_msg_middle P_((
! struct header_rec * current_header,
struct expanded_address *given_to,
struct expanded_address *given_cc,
char *given_subject,
int options, int form_letter,
struct mailer_info *mailer_info,
- FILE *infile,
struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page
));

! static int send_msg_middle(current_header,
given_to, given_cc, given_subject, options,
! form_letter,mailer_info, infile,
mailbox,aview, page)
! struct header_rec * current_header;
struct expanded_address *given_to, *given_cc;
char *given_subject;
int options, form_letter;
struct mailer_info *mailer_info;
- FILE *infile;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{
int res;
! int copy_msg = FALSE, is_a_response = FALSE;
char *p;
struct mailing_headers headers;
int LINES, COLUMNS;
--- 251,282 ----
struct menu_context *page));

static int send_msg_middle P_((
! int index,
struct expanded_address *given_to,
struct expanded_address *given_cc,
char *given_subject,
int options, int form_letter,
struct mailer_info *mailer_info,
struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page
));

! static int send_msg_middle(index,
given_to, given_cc, given_subject, options,
! form_letter,mailer_info,
mailbox,aview, page)
! int index;
struct expanded_address *given_to, *given_cc;
char *given_subject;
int options, form_letter;
struct mailer_info *mailer_info;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{
int res;
! enum copy_msg_mode copy_msg = cm_no_copy;
char *p;
struct mailing_headers headers;
int LINES, COLUMNS;
***************
*** 317,328 ****
free_string(&X);
}

/* copy msg into edit buffer? */
copy_msg = copy_the_msg(&headers,
! &is_a_response, options, page);
! if (copy_msg) options |= MAIL_COPY_MSG;

! /* get the To: address and expand */
if (! get_to(&headers.to,mailer_info,aview, page))
return(0);

--- 316,338 ----
free_string(&X);
}

+
/* copy msg into edit buffer? */
copy_msg = copy_the_msg(&headers,
! options, page);
!
! switch (copy_msg) {
! case cm_get_copy:
! options |= MAIL_COPY_MSG;
! break;
! case cm_mimeforward:
! options |= MAIL_MIME_ATTCH;
! options |= MAIL_COPY_MSG;
! break;
! }

! /* get the To: address and expand --
! */
if (! get_to(&headers.to,mailer_info,aview, page))
return(0);

***************
*** 342,349 ****

if (batch_only) {
/** if we're batchmailing, let's send it and GET OUTTA HERE! **/
! res = mail(NULL, 0, form_letter,&headers,mailer_info,
! infile, mailbox /* for save_copy */, aview);
} else {
display_to(headers.to, page);

--- 352,359 ----

if (batch_only) {
/** if we're batchmailing, let's send it and GET OUTTA HERE! **/
! res = mail(-1, 0, form_letter,&headers,mailer_info,
! mailbox, aview);
} else {
display_to(headers.to, page);

***************
*** 367,374 ****

/** generate the In-Reply-To: header... **/

! if (is_a_response && 0 != (options & MAIL_REPLYING))
! generate_reply_to(current_header,&headers);

/* and mail that puppy outta here! */

--- 377,387 ----

/** generate the In-Reply-To: header... **/

! if ( 0 != (options & MAIL_REPLYING)) {
! struct header_rec *current_header = give_header(mailbox,index);
! if (current_header)
! generate_reply_to(current_header,&headers);
! }

/* and mail that puppy outta here! */

***************
*** 384,409 ****
dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

! res=mail(current_header,options, form_letter,&headers,
! mailer_info, infile,
! mailbox /* save_copy needs */, aview);
}

free_it:
free_mailing_headers(&headers);

return res;
}

! int send_msg_l(current_header,
given_to, given_cc, given_subject, options, form_letter,
! infile, mailbox, aview, page
)
! struct header_rec * current_header;
struct addr_item *given_to, *given_cc;
char *given_subject;
int options, form_letter;
- FILE *infile;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
--- 397,422 ----
dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

! res=mail(index,options, form_letter,&headers,
! mailer_info,
! mailbox, aview);
}

free_it:
+
free_mailing_headers(&headers);

return res;
}

! int send_msg_l(index,
given_to, given_cc, given_subject, options, form_letter,
! mailbox, aview, page
)
! int index;
struct addr_item *given_to, *given_cc;
char *given_subject;
int options, form_letter;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
***************
*** 421,431 ****
addr_to_expanded(&A,given_to,mailer_info,aview);
addr_to_expanded(&B,given_cc,mailer_info,aview);

! ret = send_msg_middle(current_header,&A,&B,
given_subject,options,form_letter,
! mailer_info, infile,
! mailbox /* save_copy needs */,
! aview, page);
free_expanded_address(&A);
free_expanded_address(&B);

--- 434,443 ----
addr_to_expanded(&A,given_to,mailer_info,aview);
addr_to_expanded(&B,given_cc,mailer_info,aview);

! ret = send_msg_middle(index,&A,&B,
given_subject,options,form_letter,
! mailer_info,
! mailbox, aview, page);
free_expanded_address(&A);
free_expanded_address(&B);

***************
*** 457,465 ****

argv_to_expanded(&A,argv,mailer_info,aview);

! ret = send_msg_middle(NULL,&A,&B,
given_subject,options,form,mailer_info,
! NULL,mailbox, aview, page);

free_expanded_address(&A);
free_expanded_address(&B);
--- 469,477 ----

argv_to_expanded(&A,argv,mailer_info,aview);

! ret = send_msg_middle(-1,&A,&B,
given_subject,options,form,mailer_info,
! mailbox, aview, page);

free_expanded_address(&A);
free_expanded_address(&B);
***************
*** 632,639 ****
if (build_address_l(cc,mailer_info, aview)) {
struct string * B = hdr_to_expval(*cc);
if (B) {
PutLineX(prompt_line, 11, FRM("%S"), B);
! if ((strcmp(editor, "builtin") != 0 && strcmp(editor, "none") != 0)
|| copy_message)
sleep_message();
free_string(&B);
--- 644,656 ----
if (build_address_l(cc,mailer_info, aview)) {
struct string * B = hdr_to_expval(*cc);
if (B) {
+ char * editor_val = give_dt_estr_as_str(&editor_e,"editor");
+
PutLineX(prompt_line, 11, FRM("%S"), B);
!
! if (!editor_val ||
! (strcmp(editor_val, "builtin") != 0 &&
! strcmp(editor_val, "none") != 0)
|| copy_message)
sleep_message();
free_string(&B);
***************
*** 643,683 ****


return(1); /* everything looks okay! */
}

! static int copy_the_msg(headers,is_a_response, options, page)
struct mailing_headers *headers;
- int *is_a_response;
int options;


struct menu_context *page;
{
int forwarding = 0 != (options & MAIL_FORWARDING);

int LINES, COLUMNS;

! /** Returns True iff the user wants to copy the message being
! replied to into the edit buffer before invoking the editor!
! Sets "is_a_response" to true if message is a response...
**/

char msg[SLEN];
! int answer = FALSE;

! menu_get_sizes(page,&LINES, &COLUMNS);

! if (forwarding)
! answer = TRUE;
! else if (headers->to.addrs_len > 0 && !mail_only) {
! /* predefined 'to' line! */
! if (auto_copy)
! answer = TRUE;
! else {
! elm_sfprintf(msg, sizeof msg,
! CATGETS(elm_msg_cat, ElmSet, ElmCopyMessageYN,

! "Copy message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! answer = (want_to(msg, *def_ans_no, LINES-4, 0,
! page) == *def_ans_yes);


! }
! *is_a_response = TRUE;
}

return(answer);
--- 660,717 ----


return(1); /* everything looks okay! */
}

! static enum copy_msg_mode copy_the_msg(headers, options, page)
struct mailing_headers *headers;
int options;


struct menu_context *page;
{
int forwarding = 0 != (options & MAIL_FORWARDING);

+ int replying = 0 != (options & MAIL_REPLYING);

int LINES, COLUMNS;

! /** Returns True iff the user wants to copy the message being
! replied to into the edit buffer before invoking the editor!

**/

char msg[SLEN];
! static enum copy_msg_mode answer = cm_no_copy;

! menu_get_sizes(page,&LINES, &COLUMNS);

! if (forwarding) {
! int X = mimeforward;
!
! if (askmimeforward) {
! int def = mimeforward ? *def_ans_yes : *def_ans_no;
! int X1;
!
! X1 = prompt_letter(LINES-4,"",def,
! PROMPT_yesno,page,
! CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,
! "Forward message as separate part? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! X = (X1 == *def_ans_yes);
! }
!
! answer = X ? cm_mimeforward : cm_get_copy;
!
! } else if (replying) {

! /* predefined 'to' line! */
! if (auto_copy)

! answer = cm_get_copy;
! else {
! int X,X1;
!
! X1 = prompt_letter(LINES-4,"",*def_ans_no,
! PROMPT_yesno,page,
! CATGETS(elm_msg_cat, ElmSet, ElmCopyMessageYN,
! "Copy message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! X = (X1 == *def_ans_yes);
!
! answer = X ? cm_get_copy : cm_no_copy;
! }
}

return(answer);
***************
*** 758,766 ****
dump_expanded_address(5,"bcc",headers.bcc);

main_state();
! ret = mail(NULL, edit_message ? MAIL_EDIT_MSG : 0, form_letter,
! &headers,mailer_info, NULL,
! mailbox /* save_copy needs */, aview);
main_state();

/*
--- 792,800 ----
dump_expanded_address(5,"bcc",headers.bcc);

main_state();
! ret = mail(-1, edit_message ? MAIL_EDIT_MSG : 0, form_letter,
! &headers,mailer_info,
! mailbox, aview);
main_state();

/*
Index: elm2.4.ME+.117-cvs/src/mailmsg2.c
*** elm2.4.ME+.116/src/mailmsg2.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/mailmsg2.c 2004-06-27 18:18:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.83 2004/06/27 15:18:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.83 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 76,82 ****
static int append_sig P_((FILE *file,struct mailing_headers *headers,
struct menu_context *page));

! static int recall_last_msg P_((char *filename, int copy_msg,
int *cancelled_msg, int *already_has_text,
struct menu_context *page));

--- 76,82 ----
static int append_sig P_((FILE *file,struct mailing_headers *headers,
struct menu_context *page));

! static int recall_last_msg P_((char *filename, int copy_msg,
int *cancelled_msg, int *already_has_text,
struct menu_context *page));

***************
*** 102,121 ****


return (CONST unsigned char *)str;
}


! int mail(current_header,options,form, headers,mailer_info,
! infile,mailbox,aview)
! struct header_rec * current_header;
int options,form;
struct mailing_headers * headers;
struct mailer_info *mailer_info;
! FILE *infile;
! struct MailboxView *mailbox; /* savecopy() needs list of folders */
struct AliasView *aview;
{
! int copy_msg = 0 != current_header && 0 != (options & MAIL_COPY_MSG);
! int edit_message = 0 != (options & MAIL_EDIT_MSG);
! int forwarding = 0 != current_header && 0 != (options & MAIL_FORWARDING);



struct Attachments attachments = NULL_Attachments;

--- 102,199 ----


return (CONST unsigned char *)str;
}

+ static void handle_mailer_options P_((struct mailer_info *mailer_info,
+ mime_send_t *mime_info,
+ int *dsn,
+ struct Attachments *attachments,
+ int *reask));
+
+ static void handle_mailer_options(mailer_info,mime_info,dsn, attachments,
+ reask)
+ struct mailer_info *mailer_info;
+ mime_send_t *mime_info;
+ int *dsn;
+ struct Attachments *attachments;
+ int *reask; /* on reask loop */
+ {
+ int i;
+ int changed = 0;
+
+ if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
+ DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));
+ if(DSN_success || !reask)
+ (*dsn) |= DSN_SUCCESS|DSN_FAILURE|DSN_DELAY;
+ } else if (*dsn) {
+ *dsn = 0;
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoDSN,
+ "Mailer do not support DSN, disabling it"));
+
+ if (reask)
+ *reask = 1;
+
+ }
+
+
+ mime_info->raw_level = mailer_7bit;
+
+ if (query_mailer_info(mailer_info,MI_HAVE_8BITMIME)) {
+ DPRINT(Debug,8,(&Debug,"mailer supports 8BITMIME\n"));
+ mime_info->raw_level = mailer_8bit;

! if (query_mailer_info(mailer_info,MI_HAVE_BINARYMIME)) {
! DPRINT(Debug,8,(&Debug,"mailer supports BINARYMIME\n"));
! mime_info->raw_level = mailer_binary;
! }
! }
!
! if (allow_no_encoding >= 2)
! /* Just send BINARY anyway */
! mime_info->raw_level = mailer_binary;
! else if (allow_no_encoding >= 1 &&
! mime_info->raw_level < mailer_8bit)
! /* Just send 8BIT anyway */
! mime_info->raw_level = mailer_8bit;
!
! for (i = 0; i < attachments->attachment_count; i++) {
! mime_t *part = & (attachments->attach_files[i]);
!
! if (ENCODING_BINARY == part->encoding &&
! mime_info->raw_level < mailer_binary) {
! part->encoding = ENCODING_BASE64;
! changed++;
! }
!
! if (ENCODING_8BIT == part->encoding &&
! mime_info->raw_level < mailer_8bit) {
! part->encoding = ENCODING_BASE64;
! changed++;
! }
! }
!
! if (changed) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmChangedAttachEnc,
! "Changed encoding of %d attachments"),
! changed);
!
! if (reask)
! *reask = 1;
! }
! }
!
! int mail(mail_index,options,form, headers,mailer_info,
! mailbox,aview)
! int mail_index;
int options,form;
struct mailing_headers * headers;
struct mailer_info *mailer_info;
! struct MailboxView *mailbox /* for mail_index */;
struct AliasView *aview;
{
! int copy_msg = 0 != (options & MAIL_COPY_MSG);
! int edit_message = 0 != (options & MAIL_EDIT_MSG);
! int forwarding = 0 != (options & MAIL_FORWARDING);
! int mime_attach = 0 != (options & MAIL_MIME_ATTCH);



struct Attachments attachments = NULL_Attachments;

***************

*** 136,142 ****
char fname[SLEN], very_long_buffer[VERY_LONG_STRING];

int ch, line_len;
! register int retransmit = FALSE;
int already_has_text = FALSE; /* we need an ADDRESS */
int signature_done = FALSE;
int need_redraw = 0;
--- 214,220 ----
char fname[SLEN], very_long_buffer[VERY_LONG_STRING];

int ch, line_len;
! int retransmit = FALSE;
int already_has_text = FALSE; /* we need an ADDRESS */
int signature_done = FALSE;
int need_redraw = 0;
***************
*** 173,199 ****

zero_copy_file(&COPY_FILE);

- if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
- DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));
- if(DSN_success)
- dsn |= DSN_SUCCESS|DSN_FAILURE|DSN_DELAY;
- }
-
- if (current_header && (options & MAIL_ISFORM))
- copy_msg = FORM;
-
- /* Initialize structure */
- clear_mime_send_info(&MIME_info,mailer_info);
-
- if (allow_no_encoding >= 2)
- /* Just send BINARY anyway */
- MIME_info.raw_level = mailer_binary;
- else if (allow_no_encoding >= 1 &&
- MIME_info.raw_level < mailer_8bit)
- /* Just send 8BIT anyway */
- MIME_info.raw_level = mailer_8bit;
-
-
dump_expanded_address(4,"Mailing to",headers->to);


DPRINT(Debug,4, (&Debug," (with%s editing)\n",
edit_message? "" : "out"));

--- 251,256 ----
***************
*** 226,233 ****
cur_editfile,
cancelled_msg ? "" : " not"
));
! retransmit = recall_last_msg(cur_editfile, copy_msg, &cancelled_msg,
! &already_has_text,
page);
if (retransmit)
cur_editcharset = display_charset; /* ???? FIXME */
--- 283,290 ----
cur_editfile,
cancelled_msg ? "" : " not"
));
! retransmit = recall_last_msg(cur_editfile, copy_msg, &cancelled_msg,
! &already_has_text,
page);
if (retransmit)
cur_editcharset = display_charset; /* ???? FIXME */
***************
*** 297,452 ****
fclose(input);
already_has_text = TRUE;
}

- if (copy_msg == FORM) {
- elm_sfprintf(fname, sizeof fname,
- FRM("%s%s%d"), temp_dir, temp_form_file, getpid());
- fclose(reply); /* we can't retransmit a form! */
- if (access(fname,ACCESS_EXISTS) != 0) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotFindForm,
- "Couldn't find forms file!"));

goto fail_label;
}
! DPRINT(Debug,4,(&Debug,
! "-- renaming existing file %s to file %s --\n",
! fname, cur_editfile));
! rename(fname, cur_editfile);
! cur_editcharset = system_charset; /* FIXME: Is correct? */

! } else if (copy_msg && ! retransmit) { /* if retransmit we have it! */


! struct string * From_buffer = NULL;
! struct addr_item *p;

! if (current_header->from) {
! for (p = current_header->from; p->addr && p->fullname; p++) {
! if (From_buffer)
! add_ascii_to_string(From_buffer,s2us(", "));
! else
! From_buffer = new_string(display_charset);
! if (string_len(p->fullname)) {
! struct string * temp = cat_strings(From_buffer,
! p->fullname,1);
! free_string(&From_buffer);
! From_buffer = temp;
! } else {
! add_ascii_to_string(From_buffer,csUs(p->addr));
! }
}

- }
-
- if (!cur_editcharset)
- cur_editcharset = display_charset;

! if (!forwarding || (forwarding && !mimeforward)) {


! if (forwarding && !quote_forward) {
! if (From_buffer) {
! elm_fprintf(reply,
! CATGETS(elm_msg_cat, ElmSet, ElmForwarded1,
! "----- Forwarded message from %S -----\n\n"),
! From_buffer);
! } else
! elm_fprintf (reply,
! CATGETS(elm_msg_cat, ElmSet,
! ElmForwarded2,
! "----- Forwarded message (env-from %s) -----\n\n"),
! current_header->env_from);
!
! } else if (attribution[0] && current_header) {
! if (From_buffer) {
! char * str = us2s(stream_from_string(From_buffer,1,NULL));
! fprintf(reply, attribution, str);
! free(str);
! } else
! fprintf(reply, attribution, current_header->env_from);
! fputc('\n', reply);
! }
! if (edit_message && infile) {

! int NOHDR = forwarding ? noheaderfwd : noheader;
! int NOQUOTE = forwarding && !quote_forward;
! copy_message_f(infile,current_header,


! NOQUOTE ? "" : prefixchars, reply,
! ( NOHDR ? CM_REMOVE_HEADER : 0 )
! | CM_REMOVE_ENVELOPE | CM_DECODE

! /* I think it is good idea to use CM_FILT_HDR
! * even when we don't have forwarding ... -KEH
! */
! | CM_FILT_HDR, cur_editcharset);
! already_has_text = TRUE; /* we just added it, right? */
! } else if (infile) {
! int NOHDR = forwarding ? noheaderfwd : noheader;
! copy_message_f(infile,current_header,
! "", reply,


! ( NOHDR ? CM_REMOVE_HEADER : 0 )
! | CM_REMOVE_ENVELOPE
! /* I added CM_DECODE to here -KEH */
! | CM_DECODE, cur_editcharset);

! }


! if (forwarding && !quote_forward) {
! if (From_buffer)

! elm_fprintf (reply,
! CATGETS(elm_msg_cat, ElmSet, ElmForwarded3,
! "----- End of forwarded message from %S -----\n"),


! From_buffer);
! else
! elm_fprintf (reply,
! CATGETS(elm_msg_cat, ElmSet,

! ElmForwarded4,
! "----- End of forwarded message (env-from %s) -----\n"),
! current_header->env_from);
}
- } else {
- FILE *tmpfp;

- /* Use MESSAGE/RFC822 to forward messages. */

! elm_sfprintf (very_long_buffer, sizeof very_long_buffer,
! FRM("%selmfwd.%d"),
! temp_dir, getpid ());
! if (! (tmpfp = safeopen_rdwr (very_long_buffer))) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailFileForward,
! "Failed to create file for forwarding"));
! } else if (infile) {
! mime_t attach;

! mime_t_zero(&attach);

! attach.pathname = safe_strdup(very_long_buffer);
!
! copy_message_f(infile,current_header,"",tmpfp,
! CM_REMOVE_ENVELOPE,NULL);

! attach.length = fsize(tmpfp);
! fclose (tmpfp);

! attach.unlink = 1; /* mark for later deletion */
! attach.TYPE = give_media_type2(MIME_TYPE_MESSAGE,"rfc822", 0);
! if (!attach.TYPE)
! mime_panic(__FILE__,__LINE__,"mail",
! "message/rfc822 is not known");
! if (From_buffer)
! attach.description =
! format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmForwardedMesg1,
! "Forwarded message from %S"),
! From_buffer);
! else
! attach.description =
! format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmForwardedMesg2,
! "Forwarded message from %s"),
! current_header->env_from);
!
! /* Pick up the encoding from the message. */
! attach.encoding = ENCODING_7BIT;
! (void) update_encoding (&(attach.encoding),
! current_header->mime_rec.encoding);
! add_Attachments(&attachments,&attach);
}
}
! if (From_buffer)
! free_string(&From_buffer);


! }

if (!cur_editcharset)
cur_editcharset = display_charset;

--- 354,547 ----
fclose(input);
already_has_text = TRUE;
}
+
+ /* Initialize structure -- XXX KESKEN */
+ clear_mime_send_info(&MIME_info);
+ handle_mailer_options(mailer_info,&MIME_info,&dsn,
+ &attachments, NULL);


+ if (mailbox && mail_index >= 0 &&
+ (copy_msg || forwarding)) {
+ struct header_rec * hdr = NULL;
+ FILE * mailbox_file = NULL;
+
+
+ if (!give_message_data(mailbox,mail_index,
+ &hdr,&mailbox_file,NULL,
+ mime_parse_routine)) {
+
+ DPRINT(Debug,4,(&Debug,
+ "Failed to retrieve original mail for replying/forwarding\n"));
+
+ fclose(reply); reply = NULL;
+
goto fail_label;
}
!
! if ((options & MAIL_ISFORM))
! copy_msg = FORM;

! if (copy_msg == FORM) {
! elm_sfprintf(fname, sizeof fname,
! FRM("%s%s%d"), temp_dir, temp_form_file, getpid());
!
! /* we can't retransmit a form! */
! fclose(reply); reply = NULL;

! if (access(fname,ACCESS_EXISTS) != 0) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotFindForm,
! "Couldn't find forms file!"));
!
! goto fail_label;
}

! DPRINT(Debug,4,(&Debug,
! "-- renaming existing file %s to file %s --\n",
! fname, cur_editfile));
! rename(fname, cur_editfile);
! cur_editcharset = system_charset; /* FIXME: Is correct? */
!
! } else if (! retransmit) { /* if retransmit we have it! */


! struct string * From_buffer = NULL;
! struct addr_item *p;
!

! if (hdr->from) {
! for (p = hdr->from; p->addr && p->fullname; p++) {


! if (From_buffer)
! add_ascii_to_string(From_buffer,s2us(", "));
! else
! From_buffer = new_string(display_charset);
! if (string_len(p->fullname)) {
! struct string * temp = cat_strings(From_buffer,
! p->fullname,1);
! free_string(&From_buffer);
! From_buffer = temp;
! } else {
! add_ascii_to_string(From_buffer,csUs(p->addr));
! }
! }
}


! if (!cur_editcharset)

! cur_editcharset = display_charset;

! if (!mime_attach) {


! if (forwarding && !quote_forward) {
! if (From_buffer) {
! elm_fprintf(reply,
! CATGETS(elm_msg_cat, ElmSet, ElmForwarded1,
! "----- Forwarded message from %S -----\n\n"),
! From_buffer);
! } else
! elm_fprintf (reply,
! CATGETS(elm_msg_cat, ElmSet,
! ElmForwarded2,
! "----- Forwarded message (env-from %s) -----\n\n"),

! hdr->env_from);
!
! } else if (attribution[0] && hdr) {


! if (From_buffer) {
! char * str = us2s(stream_from_string(From_buffer,1,NULL));
! fprintf(reply, attribution, str);
! free(str);
! } else

! fprintf(reply, attribution, hdr->env_from);


! fputc('\n', reply);
! }

! if (edit_message && mailbox_file) {
! int NOHDR = forwarding ? noheaderfwd : noheader;
! int NOQUOTE = forwarding && !quote_forward;
! copy_message_f(mailbox_file,hdr,


! NOQUOTE ? "" : prefixchars, reply,
! ( NOHDR ? CM_REMOVE_HEADER : 0 )
! | CM_REMOVE_ENVELOPE | CM_DECODE

! /* I think it is good idea to use CM_FILT_HDR
! * even when we don't have forwarding ... -KEH
! */
! | CM_FILT_HDR, cur_editcharset);
! already_has_text = TRUE; /* we just added it, right? */
! } else if (mailbox_file) {
! int NOHDR = forwarding ? noheaderfwd : noheader;
! copy_message_f(mailbox_file,hdr,
! "", reply,


! ( NOHDR ? CM_REMOVE_HEADER : 0 )
! | CM_REMOVE_ENVELOPE
! /* I added CM_DECODE to here -KEH */
! | CM_DECODE, cur_editcharset);

! }
!

! if (forwarding && !quote_forward) {
! if (From_buffer)

! elm_fprintf (reply,
! CATGETS(elm_msg_cat, ElmSet, ElmForwarded3,
! "----- End of forwarded message from %S -----\n"),


! From_buffer);
! else
! elm_fprintf (reply,
! CATGETS(elm_msg_cat, ElmSet,

! ElmForwarded4,
! "----- End of forwarded message (env-from %s) -----\n"),
! hdr->env_from);
! }
! } else {
! FILE *tmpfp;

! /* Use MESSAGE/RFC822 to forward messages. */
!
! elm_sfprintf (very_long_buffer, sizeof very_long_buffer,
! FRM("%selmfwd.%d"),
! temp_dir, getpid ());
! if (! (tmpfp = safeopen_rdwr (very_long_buffer))) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailFileForward,
! "Failed to create file for forwarding"));
! } else if (mailbox_file) {
! mime_t attach;
!
! mime_t_zero(&attach);
!
! attach.pathname = safe_strdup(very_long_buffer);

! copy_message_f(mailbox_file,hdr,"",tmpfp,
! CM_REMOVE_ENVELOPE,NULL);
!
! attach.length = fsize(tmpfp);
! fclose (tmpfp);

! attach.unlink = 1; /* mark for later deletion */
! attach.TYPE = give_media_type2(MIME_TYPE_MESSAGE,"rfc822", 0);
! if (!attach.TYPE)
! mime_panic(__FILE__,__LINE__,"mail",
! "message/rfc822 is not known");
!
! if (forwarding) {
! if (From_buffer)
! attach.description =
! format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmForwardedMesg1,
! "Forwarded message from %S"),
! From_buffer);
! else
! attach.description =
! format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmForwardedMesg2,
! "Forwarded message from %s"),
! hdr->env_from);
! }
!
! /* Pick up the encoding from the message. */
! attach.encoding = ENCODING_7BIT;
! (void) update_encoding (&(attach.encoding),
! hdr->mime_rec.encoding);
! add_Attachments(&attachments,&attach);
! }
}
+ if (From_buffer)
+ free_string(&From_buffer);


}
!
! }

if (!cur_editcharset)
cur_editcharset = display_charset;

***************
*** 467,482 ****
/* append signature now if we are going to use an external editor */
/* Don't worry about the remote/local determination too much */

! if (already_has_text ||
! (strcmp(editor,"builtin") != 0 && strcmp(editor,"none") != 0)) {
! signature_done = TRUE;
! if (!retransmit && copy_msg != FORM)
! already_has_text |= append_sig(reply, headers, page);
}

! if (! retransmit && copy_msg != FORM)
! if (reply != NULL)
! (void) fclose(reply); /* on replies, it won't be open! */

/** Edit the message **/

--- 562,584 ----
/* append signature now if we are going to use an external editor */
/* Don't worry about the remote/local determination too much */

! {
! char * editor_val = give_dt_estr_as_str(&editor_e,"editor");
!
! if (already_has_text ||
! (editor_val &&
! strcmp(editor_val,"builtin") != 0 &&
! strcmp(editor_val,"none") != 0)) {
! signature_done = TRUE;
! if (!retransmit && copy_msg != FORM)
! already_has_text |= append_sig(reply, headers, page);
! }
}

! if (reply != NULL) {
! (void) fclose(reply);
! reply = NULL;
! }

/** Edit the message **/

***************
*** 503,511 ****
if (attachments.attachment_count > 0)
options |= MAIL_HAVE_ATTACHMENTS;
#ifdef USE_PGP
! if (current_header &&
! current_header->pgp & PGP_MESSAGE)
! options |= MAIL_HAVE_PGP_ENCODED;
#endif

/* Now .mailheaders is read before mail is composed! */
--- 605,616 ----
if (attachments.attachment_count > 0)
options |= MAIL_HAVE_ATTACHMENTS;
#ifdef USE_PGP
! if (mailbox && mail_index >= 0) {
! struct header_rec *hdr = give_header(mailbox,mail_index);
! if (hdr &&
! hdr->pgp & PGP_MESSAGE)
! options |= MAIL_HAVE_PGP_ENCODED;
! }
#endif

/* Now .mailheaders is read before mail is composed! */
***************
*** 583,588 ****
--- 688,709 ----
signature_done = TRUE;
}

+ if (code >= 0) { /* If not canceled */
+ int r = mailer_restarted(mailer_info);
+
+ if (r > 0)
+ handle_mailer_options(mailer_info,&MIME_info,&dsn,
+ &attachments, &reask_verify);
+
+ if (r < 0) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailerDisconnected,
+ "Mailer disconnected! Can't send message. Use f)orget !"));
+
+
+ reask_verify = TRUE; /* Go to verify_transmission again. */
+ }
+ }
+
MIME_info.encoding_top = ENCODING_7BIT;/* Encoding for Multipart/ */

#if 0
***************
*** 745,751 ****
save_copy(headers,&COPY_FILE, form, &MIME_info,
converted_buffer,

- mailbox,


page); /* Need access for all open
mailboxes/folders */

--- 866,871 ----
***************
*** 887,897 ****
}
}

! int mail_form(current_header, address, subj, infile,mailbox, aview)
! struct header_rec *current_header;
struct addr_item *address;
char *subj;
- FILE *infile;
struct MailboxView *mailbox;
struct AliasView *aview;
{
--- 1007,1016 ----
}
}

! int mail_form(mail_index, address, subj, mailbox, aview)
! int mail_index;
struct addr_item *address;
char *subj;
struct MailboxView *mailbox;
struct AliasView *aview;
{
***************
*** 912,919 ****
addr_to_expanded(&A,address,mailer_info,aview);
copy_expanded_address(&headers.to, A);

! res = mail(current_header,MAIL_ISFORM,NO, &headers,mailer_info,
! infile, mailbox /* save_copy needs */,
aview);

free_expanded_address(&A);
--- 1031,1038 ----
addr_to_expanded(&A,address,mailer_info,aview);
copy_expanded_address(&headers.to, A);

! res = mail(mail_index,MAIL_ISFORM,NO, &headers,mailer_info,
! mailbox /* save_copy needs */,
aview);

free_expanded_address(&A);


***************
*** 1182,1194 ****
if (do_redraw) {
do_redraw = 0;
*need_redraw_p = TRUE;
!
menu_ClearScreen(page);
print_format_center(0,
CATGETS(elm_msg_cat, ElmSet,
ElmMailScreenTitle,
"Mail Pre-Send Screen"));

show_presend_headers(headers,hdr_charset, page);

if (headers->env_from && user_level > 0) {

--- 1301,1315 ----


if (do_redraw) {
do_redraw = 0;
*need_redraw_p = TRUE;
!
menu_ClearScreen(page);
print_format_center(0,
CATGETS(elm_msg_cat, ElmSet,
ElmMailScreenTitle,
"Mail Pre-Send Screen"));

+ show_last_error();
+
show_presend_headers(headers,hdr_charset, page);

if (headers->env_from && user_level > 0) {

***************
*** 1463,1477 ****
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
if (*form_p == YES)
*form_p = MAYBE;
*need_redraw_p = TRUE;
! do_redraw = 1;
! if (edit_the_message(filename, already_has_text,
! headers,editor,file_set,
! mailer_info, mailbox,
! aview, page) != 0)
! return -1;
}
break;

--- 1584,1608 ----
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
+
+ char * editor_val = give_dt_estr_as_str(&editor_e,"editor");
+
if (*form_p == YES)
*form_p = MAYBE;
*need_redraw_p = TRUE;
! if (editor_val) {
! do_redraw = 1;
! if (edit_the_message(filename, already_has_text,
! headers,editor_val,file_set,
! mailer_info, mailbox,
! aview, page) != 0)
! return -1;
! } else {
! sleep_message();
! if (no_editor_edit_the_message(filename,headers,file_set,
! mailer_info,mailbox,aview))
! return -1;
! }
}
break;

***************
*** 1949,1955 ****
information). You can't necessarily finger someone in the
same domain. */

! if (!batch_only && (local_signature[0] || remote_signature[0])) {

char filename2[SLEN];
char *sig = "";
--- 2080,2093 ----
information). You can't necessarily finger someone in the
same domain. */

! char * lsig = give_dt_estr_as_str(&local_signature_e, "localsignature");
! char * rsig = give_dt_estr_as_str(&remote_signature_e,"remotesignature");
!
!
! if (!lsig || !rsig)
! error_wait();
!
! if (!batch_only && (lsig || rsig)) {

char filename2[SLEN];
char *sig = "";
***************
*** 1959,1965 ****

struct addr_item *p;

! sig = local_signature;

/* check To: list */
for (p = headers->to.addrs ;
--- 2097,2103 ----

struct addr_item *p;

! sig = lsig;

/* check To: list */
for (p = headers->to.addrs ;
***************
*** 1978,1989 ****
ptr++;

if (istrcmp(ptr, hostfullname) != 0) {
! sig = remote_signature;
break;
}
}

! if (sig == local_signature) /* still local? */
/* check Cc: */
for (p = headers->cc.addrs ;
p < headers->cc.addrs + headers->cc.addrs_len;
--- 2116,2127 ----
ptr++;

if (istrcmp(ptr, hostfullname) != 0) {
! sig = rsig;
break;
}
}

! if (sig == lsig) /* still local? */
/* check Cc: */
for (p = headers->cc.addrs ;
p < headers->cc.addrs + headers->cc.addrs_len;
***************
*** 2001,2012 ****
ptr++;

if (istrcmp(ptr, hostfullname) != 0) {
! sig = remote_signature;
break;
}
}

! if (sig[0]) { /* if there is a signature file */
if (sig[0] != '/')
elm_sfprintf(filename2, sizeof filename2,
FRM("%s/%s"),
--- 2139,2150 ----
ptr++;

if (istrcmp(ptr, hostfullname) != 0) {
! sig = rsig;
break;
}
}

! if (sig && sig[0]) { /* if there is a signature file */
if (sig[0] != '/')
elm_sfprintf(filename2, sizeof filename2,
FRM("%s/%s"),
Index: elm2.4.ME+.117-cvs/src/Makefile.SH
*** elm2.4.ME+.116/src/Makefile.SH 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.117-cvs/src/Makefile.SH 2004-06-18 23:40:56.000000000 +0300
***************
*** 31,37 ****

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.50 2004/02/20 19:38:08 hurtta Exp $
#


# Makefile for the ELM mail program.
#

--- 31,37 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.51 2004/06/18 20:40:56 hurtta Exp $
#
# Makefile for the ELM mail program.
#
Index: elm2.4.ME+.117-cvs/src/messages/def_messages.h
*** elm2.4.ME+.116/src/messages/def_messages.h 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/messages/def_messages.h 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,4 ****
! /* $Id: def_messages.h,v 1.6 2004/03/27 18:31:48 hurtta Exp $ */

#include "headers.h"
#include "me.h"
--- 1,4 ----
! /* $Id: def_messages.h,v 1.7 2004/06/18 20:40:56 hurtta Exp $ */

#include "headers.h"
#include "me.h"
***************
*** 90,107 ****
struct mailbox_type * mailbox_type;

union {
! struct mv_storage {
! struct current_storage ** the_mailbox;
! int mailbox_count;
!
! } * storage;
!
! struct mv_digest {
! struct current_digest ** the_digest;
! int digest_count;
! } * digest;

struct mv_partial {
struct MailboxView * parent_mailbox;

struct composite_vector * composite;
--- 90,102 ----
struct mailbox_type * mailbox_type;

union {
! struct mv_storage * storage;
!
! struct mv_digest * digest;

struct mv_partial {
+ /* partial_to_mailbox_view() sets parent so mv_partial need to
+ be defined on here */
struct MailboxView * parent_mailbox;

struct composite_vector * composite;
Index: elm2.4.ME+.117-cvs/src/messages/digest.c
*** elm2.4.ME+.116/src/messages/digest.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/src/messages/digest.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: digest.c,v 1.10 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: digest.c,v 1.11 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 20,25 ****
--- 20,30 ----
};


+ struct mv_digest {
+ struct current_digest ** the_digest;
+ int digest_count;
+ };
+

#if ANSI_C
#define S_(x) static x;

#else
Index: elm2.4.ME+.117-cvs/src/messages/Makefile.SH
*** elm2.4.ME+.116/src/messages/Makefile.SH 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.117-cvs/src/messages/Makefile.SH 2004-06-18 23:40:56.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.5 2003/10/01 17:34:34 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----

echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.6 2004/06/18 20:40:56 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************

*** 43,49 ****
SHELL = /bin/sh

OBJ = messages.o header_alloc.o storage.o digest.o \
! partial.o

all: Makefile libmessages.a

--- 43,49 ----
SHELL = /bin/sh

OBJ = messages.o header_alloc.o storage.o digest.o \
! partial.o

all: Makefile libmessages.a

Index: elm2.4.ME+.117-cvs/src/messages/messages.c
*** elm2.4.ME+.116/src/messages/messages.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/src/messages/messages.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: messages.c,v 1.13 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: messages.c,v 1.14 2004/06/18 20:40:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

***************
*** 14,24 ****

#define MAILBOXVIEW_magic 0xF500

static struct MailboxView * malloc_view P_((struct mailbox_type *t));
static struct MailboxView * malloc_view(t)
struct mailbox_type *t;
{
! struct MailboxView *ret;

ret = safe_malloc(sizeof (*ret));

--- 14,64 ----

#define MAILBOXVIEW_magic 0xF500

+ static struct MailboxView ** mailbox_list = NULL;
+ static int mailbox_list_len = 0;
+
+ struct MailboxView * give_next_open_mailbox(idx, signal)
+ int *idx;
+ int signal;
+ {
+ int i = *idx;
+
+ struct MailboxView *ret = NULL;
+
+ do {
+ if (*idx >= mailbox_list_len || *idx < 0)


+ return NULL;
+
+

+ if (mailbox_list[*idx]) {
+
+
+ if (mailbox_list[*idx]->magic != MAILBOXVIEW_magic)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"malloc_view",
+ "Bad type magic number",signal);
+
+
+ ret = mailbox_list[*idx];
+
+ }
+
+ (*idx)++;
+
+ } while (!ret);
+
+
+ SIGDPRINT(Debug,7,(&Debug,
+ "give_next_open_mailbox[%d->%d] = %p\n",
+ i,*idx,ret));


+
+ return ret;
+ }
+

static struct MailboxView * malloc_view P_((struct mailbox_type *t));
static struct MailboxView * malloc_view(t)
struct mailbox_type *t;
{
! struct MailboxView *ret, **X;

ret = safe_malloc(sizeof (*ret));

***************
*** 42,47 ****
--- 82,92 ----

ret->mailbox_type->mt_init_it(ret);

+ X = safe_realloc(mailbox_list,(mailbox_list_len+1)* sizeof (*X));
+ X[mailbox_list_len] = ret;
+ mailbox_list = X;
+ mailbox_list_len++;
+
return ret;
}

***************
*** 141,149 ****
--- 186,197 ----
}


+
void free_mailbox(mailbox)
struct MailboxView **mailbox;
{
+ int i;
+
if ((*mailbox)->magic != MAILBOXVIEW_magic)
panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox",
"Bad magic number",0);
***************
*** 152,158 ****
--- 200,216 ----
panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox",
"Bad type magic number",0);

+ for ( i = 0; i < mailbox_list_len; i++) {
+ if (mailbox_list[i] == *mailbox) {
+ mailbox_list[i] = NULL;
+ goto okei;
+ }
+ }
+
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox",
+ "mailbox not found from list",0);

+ okei:
(*mailbox)->mailbox_type->mt_free_it(*mailbox);

if ((*mailbox)->mailbox_title)
***************
*** 167,172 ****
--- 225,236 ----
(*mailbox)->magic = 0; /* Invalidate */
free(*mailbox);
*mailbox = NULL;
+
+ for ( ; i < mailbox_list_len-1; i++) {
+ mailbox_list[i] = mailbox_list[i+1];
+ }
+ mailbox_list[i] = NULL;
+ mailbox_list_len--;
}

/* Return 1 if redraw required */
Index: elm2.4.ME+.117-cvs/src/messages/storage.c
*** elm2.4.ME+.116/src/messages/storage.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.117-cvs/src/messages/storage.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: storage.c,v 1.7 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: storage.c,v 1.8 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 17,22 ****
--- 17,28 ----
#define S_(x)
#endif

+ struct mv_storage {
+ struct current_storage ** the_mailbox;
+ int mailbox_count;
+
+ };
+
static void mt_make_storage_view P_((struct MailboxView *mailbox));


Index: elm2.4.ME+.117-cvs/src/metapager.c
*** elm2.4.ME+.116/src/metapager.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/metapager.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: metapager.c,v 1.38 2004/03/27 18:31:45 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: metapager.c,v 1.39 2004/06/18 09:29:51 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 86,97 ****
charset_t charset_vector[255];
int x1;
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

/* check to see if we want the internal pager */
! if (strincmp(pager, "builtin", 7) == 0 ||
! strincmp(pager, "internal", 8) == 0 ||
(builtin_lines < 0
? hdr->lines < LINES-1 + builtin_lines
: hdr->lines < builtin_lines)) {
--- 86,105 ----
charset_t charset_vector[255];
int x1;
int LINES, COLUMNS;
+ char * exp_pager;

menu_get_sizes(page,&LINES, &COLUMNS);

/* check to see if we want the internal pager */
!
! exp_pager = give_dt_estr_as_str(&pager_e,"pager");
! if (!exp_pager) {
! sleep_message();
! builtin++;
!
! } else if (strincmp(exp_pager, "builtin", 7) == 0 ||
! strincmp(exp_pager, "internal", 8) == 0 ||
!
(builtin_lines < 0
? hdr->lines < LINES-1 + builtin_lines
: hdr->lines < builtin_lines)) {
***************
*** 494,500 ****
/* now execute pager and exit */

/* system_call() will return user to user's normal permissions. */
! _exit(system_call(pager, SY_ENAB_SIGINT, NULL));
}

fclose (fpout);
--- 502,508 ----
/* now execute pager and exit */

/* system_call() will return user to user's normal permissions. */
! _exit(system_call(exp_pager, SY_ENAB_SIGINT, NULL));
}

fclose (fpout);
Index: elm2.4.ME+.117-cvs/src/mime.c
*** elm2.4.ME+.116/src/mime.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/mime.c 2004-05-23 15:31:00.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime.c,v 1.31 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime.c,v 1.32 2004/05/23 12:31:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 36,59 ****
return (char *)str;
}

! void clear_mime_send_info(mime_info,
! mailer_info)
mime_send_t *mime_info;
- struct mailer_info *mailer_info;
{
mime_info->raw_level = mailer_7bit;

-
- if (query_mailer_info(mailer_info,MI_HAVE_8BITMIME)) {
- DPRINT(Debug,8,(&Debug,"mailer supports 8BITMIME\n"));
- mime_info->raw_level = mailer_8bit;
-
- if (query_mailer_info(mailer_info,MI_HAVE_BINARYMIME)) {
- DPRINT(Debug,8,(&Debug,"mailer supports BINARYMIME\n"));
- mime_info->raw_level = mailer_binary;
- }
- }
-

mime_info->encoding_top = ENCODING_7BIT;
mime_info->type_opts_top = NULL;
mime_info->hdr_charset = text_charset;

--- 36,46 ----
return (char *)str;
}

! void clear_mime_send_info(mime_info)
mime_send_t *mime_info;
{
mime_info->raw_level = mailer_7bit;



mime_info->encoding_top = ENCODING_7BIT;
mime_info->type_opts_top = NULL;
mime_info->hdr_charset = text_charset;

Index: elm2.4.ME+.117-cvs/src/options.c
*** elm2.4.ME+.116/src/options.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/options.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: options.c,v 1.24 2004/03/27 18:31:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.25 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 102,131 ****
static int resort = 0;


- static int post_cal P_((int f));
- static int post_cal(f)
- int f;
- {
- (void) expand_env(calendar_file, raw_calendar_file, sizeof(calendar_file));
- return 0;
- }

- static int post_editor P_((int f));
- static int post_editor(f)
- int f;
- {
- (void) expand_env(editor, raw_editor, sizeof(editor));
- return 0;
- }

- static int post_pager P_((int f));
- static int post_pager(f)
- int f;
- {
- (void) expand_env(pager, raw_pager, sizeof(pager));
- clear_pages = (equal(pager, "builtin+") || equal(pager, "internal+"));
- return 0;
- }

static int post_folder P_((int f));
static int post_folder(f)
--- 102,109 ----
***************
*** 144,157 ****
return 0;
}

- static int post_sent P_((int f));
- static int post_sent(f)
- int f;
- {
- (void) expand_meta(sent_mail, raw_sentmail, sizeof(sent_mail));


-
- return 0;
- }

static int post_print P_((int f));
static int post_print(f)
--- 122,127 ----
***************
*** 162,175 ****
}

/* ? ? ? What this is ? */
! static int post_menu P_((int f, struct menu_context *page));
! static int post_menu(f, page)
int f;
- struct menu_context *page;
{
int LINES, COLUMNS;

! menu_get_sizes(page,&LINES, &COLUMNS);

headers_per_page = LINES - (mini_menu ? 14 : 9);
return 0;
--- 132,144 ----
}

/* ? ? ? What this is ? */
! static int post_menu P_((int f));
! static int post_menu(f)
int f;
{
int LINES, COLUMNS;

! menu_get_sizes(default_context,&LINES, &COLUMNS);

headers_per_page = LINES - (mini_menu ? 14 : 9);
return 0;
***************
*** 184,197 ****
"Left margin string (prefix) for reply and forward.", ElmOptionBorderHelp},

#ifdef ENABLE_CALENDAR
! {'c', "C)alendar file", ElmOptionCalendarMenu, "calendar", post_cal,
"This is the file where calendar entries from messages are saved.", ElmOptionCalendarHelp},
#endif

! {'d', "D)isplay mail using", ElmOptionDisplayMenu, "pager", post_pager,
"This is the program invoked to display individual messages (try 'builtin').", ElmOptionDisplayHelp},

! {'e', "E)ditor (primary)", ElmOptionEditorMenu, "editor", post_editor,
"This is the editor used for all outbound messages (may be 'builtin').", ElmOptionEditorHelp},

{'f', "F)older directory", ElmOptionFolderMenu, "maildir", post_folder,
--- 153,166 ----
"Left margin string (prefix) for reply and forward.", ElmOptionBorderHelp},

#ifdef ENABLE_CALENDAR
! {'c', "C)alendar file", ElmOptionCalendarMenu, "calendar", NULL,
"This is the file where calendar entries from messages are saved.", ElmOptionCalendarHelp},
#endif

! {'d', "D)isplay mail using", ElmOptionDisplayMenu, "pager", NULL,
"This is the program invoked to display individual messages (try 'builtin').", ElmOptionDisplayHelp},

! {'e', "E)ditor (primary)", ElmOptionEditorMenu, "editor", NULL,
"This is the editor used for all outbound messages (may be 'builtin').", ElmOptionEditorHelp},

{'f', "F)older directory", ElmOptionFolderMenu, "maildir", post_folder,
***************
*** 215,221 ****
{'n', "N)ames only", ElmOptionNameMenu, "names", NULL,
"Whether to display the names and addresses on mail, or names only.", ElmOptionNameHelp},

! {'o', "O)utbound mail saved", ElmOptionOutboundMenu, "sentmail", post_sent,
"This is where copies of outbound messages are saved automatically.", ElmOptionOutboundHelp},

{'p', "P)rint mail using", ElmOptionPrintMenu, "print", post_print,
--- 184,190 ----
{'n', "N)ames only", ElmOptionNameMenu, "names", NULL,
"Whether to display the names and addresses on mail, or names only.", ElmOptionNameHelp},

! {'o', "O)utbound mail saved", ElmOptionOutboundMenu, "sentmail", NULL,
"This is where copies of outbound messages are saved automatically.", ElmOptionOutboundHelp},

{'p', "P)rint mail using", ElmOptionPrintMenu, "print", post_print,
***************
*** 924,959 ****
if (q)
return(1);

! if (DT_STR == save_info[x].dt_type) {
! strfcpy(buffer, SAVE_INFO_STR(x),
! sizeof buffer);
! if (save_info[x].flags & FL_NOSPC) {
! register char *s;
! for (s = buffer; *s; ++s)
! if (*s==' ')
! *s='_';
! }
!
! optionally_enter(buffer, ypos, xpos,
! (append_current ? OE_APPEND_CURRENT : 0) |
! (passwd ? OE_PASSWD : 0),
! sizeof buffer,page);
!
! if (save_info[x].flags & FL_NOSPC) {
! register char *s;
! for (s=buffer; *s; ++s)
! if (*s=='_')
! *s=' ';
! }
!
! if (!equal(buffer, SAVE_INFO_STR(x))) {
!
! strfcpy(SAVE_INFO_STR(x), buffer,
! save_info[x].size_val);
! q++;
! }
!
! } else if (DT_SRT == save_info[x].dt_type) {
number = *SAVE_INFO_SRT(x);
if (change_sort(&number, ypos, xpos, mailbox, page) != 0) {
*SAVE_INFO_SRT(x) = number;
--- 893,899 ----
if (q)
return(1);

! if (DT_SRT == save_info[x].dt_type) {
number = *SAVE_INFO_SRT(x);
if (change_sort(&number, ypos, xpos, mailbox, page) != 0) {
*SAVE_INFO_SRT(x) = number;
***************
*** 988,993 ****
--- 928,960 ----
++q;
}

+ } else { /* Hopefully generic routine ... */
+ char * s;
+
+ if (RCTYPE_magic != save_info[x].dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"info_enter",


+ "Bad config item type",0);
+

+ s = save_info[x].dt_type->get_value(& save_info[x]);
+
+ if (s)
+ strfcpy(buffer,s, sizeof buffer);
+ else
+ buffer[0] = '\0';
+
+ optionally_enter(buffer, ypos, xpos,
+ (append_current ? OE_APPEND_CURRENT : 0) |
+ (passwd ? OE_PASSWD : 0),
+ sizeof buffer,page);
+
+ if (!s || !equal(buffer,s)) {
+
+ if (save_info[x].dt_type->parse_line(& save_info[x],
+ 1 /* local */ ,buffer,
+ 0,"<config editor>",
+ 0,0))
+ q++;
+ }
}

if (q)
Index: elm2.4.ME+.117-cvs/src/pgp.c
*** elm2.4.ME+.116/src/pgp.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/pgp.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp.c,v 1.42 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 75,80 ****
--- 75,91 ----

/* not reached */
}

+
+

+ static void close_pipe P_((struct run_state *rs));
+ static void close_pipe(rs)

+ struct run_state *rs;

! int err = errno;

! fprintf(stderr,"GetPGPKey: setgid(%d) FAILED: %s\n",
! groupid,error_description(err));
! fflush(stderr);
! _exit(err);
! }
! if (-1 == setuid(userid)) {

! int err = errno;

+ "GetPGPKey()=-1: running pgp/gpg failed\n"));
+ return -1;
+ }


+
+
p = fdopen (fd[0], "r");
if (p == NULL) {
+ int tmp;

+ int err = errno;

+
DPRINT(Debug,1,(&Debug,
! "GetPGPKey()=-1: ERROR: fdopen (errno %d)\n",
! err));
! kill(RS.pid,SIGTERM);
! wait_end(&RS,&tmp);
!
return -1;
}

+ retry:
while (fgets(buf, STRING, p) != NULL) {
DPRINT(Debug,10,(&Debug,
"GetPGPKey: %s\n",buf));
***************
*** 262,268 ****
--- 283,318 ----
}
}
}
+
+ if (ferror(p) && EINTR == errno) {
+ clearerr(p);
+ DPRINT(Debug,5,(&Debug,
+ "Reading of result interrupted (EINTR) -- retrying\n"));

+

+ if (0 == code) {
+ code = run_already_done(&RS,&stat);
+ if (0 != code) {
+ DPRINT(Debug,5,(&Debug,

+ "now pgp/gpg is completing\n"));
+ }
+ }
+

+ goto retry;
+ }
+
fclose(p);

+

+ if (0 == code)
+ code = wait_end(&RS,&stat);
+
+ if (code < 0) {
+ DPRINT(Debug,5,(&Debug,
+ "pgp/gpg dies on signal %d\n",
+ -code));
+ } else {
+ DPRINT(Debug,5,(&Debug,"pgp/gpgp exited with status %d\n",stat));
+ }
+
if (keys_len > 0 || i > 1)
break;
else {

***************
*** 557,564 ****
argv0[a++] = pgp2_path;
if (metoo)
argv0[a++] = "+encrypttoself=on";
! if (usepgppass || !(opts & PGP_SIGNED_MESSAGE))
argv0[a++] = "+batchmode";
if (opts & PGP_SIGNED_MESSAGE)
argv0[a++] = "+clearsig=on";
argv0[a++] = "+verbose=0";
--- 607,617 ----
argv0[a++] = pgp2_path;
if (metoo)
argv0[a++] = "+encrypttoself=on";
!
! if ((usepgppass || !(opts & PGP_SIGNED_MESSAGE)) &&
! !pgp_interactive)
argv0[a++] = "+batchmode";
+
if (opts & PGP_SIGNED_MESSAGE)
argv0[a++] = "+clearsig=on";
argv0[a++] = "+verbose=0";
***************
*** 595,602 ****
argv[a++] = path;
if (metoo)
argv[a++] = "+encrypttoself=on";
! if (usepgppass || !(opts & PGP_SIGNED_MESSAGE))
argv[a++] = "+batchmode";
if (opts & PGP_SIGNED_MESSAGE)
argv[a++] = "+clearsig=on";
argv[a++] = "+verbose=0";
--- 648,657 ----
argv[a++] = path;
if (metoo)
argv[a++] = "+encrypttoself=on";
! if ((usepgppass || !(opts & PGP_SIGNED_MESSAGE)) &&
! !pgp_interactive)
argv[a++] = "+batchmode";
+
if (opts & PGP_SIGNED_MESSAGE)
argv[a++] = "+clearsig=on";
argv[a++] = "+verbose=0";
***************
*** 639,646 ****
argv[a++] = buffer;
close_fd = fd[1];
}
! if (usepgppass || !(opts & PGP_SIGNED_MESSAGE))
argv[a++] ="--batch";
if (metoo) {
argv[a++] = "--encrypt-to";
if (pgp_askpgpsig && (opts & PGP_SIGNED_MESSAGE)) {
--- 694,703 ----
argv[a++] = buffer;
close_fd = fd[1];
}
! if ((usepgppass || !(opts & PGP_SIGNED_MESSAGE)) &&
! !pgp_interactive)
argv[a++] ="--batch";
+
if (metoo) {
argv[a++] = "--encrypt-to";
if (pgp_askpgpsig && (opts & PGP_SIGNED_MESSAGE)) {
***************
*** 973,979 ****
pgp_status = PGP_PUBLIC_KEY;

/* Now send the message off! */
! send_msg_l(NULL,NULL, NULL, subj, 0, 0, NULL, mailbox, aview,
page);

unlink (included_file); /* make sure to clean up. */
--- 1030,1036 ----
pgp_status = PGP_PUBLIC_KEY;

/* Now send the message off! */
! send_msg_l(-1,NULL, NULL, subj, 0, 0, mailbox, aview,
page);

unlink (included_file); /* make sure to clean up. */
Index: elm2.4.ME+.117-cvs/src/reply.c
*** elm2.4.ME+.116/src/reply.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/reply.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reply.c,v 1.35 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: reply.c,v 1.36 2004/06/18 20:40:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 307,316 ****
return result;
}

! int reply(current_header,infile,mailbox, aview, page)
! struct header_rec *current_header;
! FILE *infile;
! struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;
struct menu_context *page;
{
--- 307,315 ----
return result;
}

! int reply(index, mailbox, aview, page)
! int index;
! struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{
***************
*** 319,331 ****

char subject[SLEN];
int return_value, form_letter;
! struct addr_item * rt;
struct string * temp1 = NULL;
char * temp2 = NULL;
!
! if (! current_header)
return 0;

if (current_header->subject)
temp1 = convert_string(display_charset,current_header->subject,1);
else
--- 318,341 ----

char subject[SLEN];
int return_value, form_letter;
! struct addr_item * rt = NULL;
struct string * temp1 = NULL;
char * temp2 = NULL;


! FILE *F = NULL;

! struct header_rec *current_header = NULL;
!
!
! if (!give_message_data(mailbox,index,
! &current_header,&F,NULL,
! NO_mime_parse))
return 0;

+ if (! current_header || !F)
+ return 0;
+
+ rt = handle_reply_to(current_header,F);
+
+
if (current_header->subject)
temp1 = convert_string(display_charset,current_header->subject,1);
else
***************
*** 343,356 ****
"Re: your mail") ),
sizeof subject);

- rt = handle_reply_to(current_header,infile);
if (form_letter)
! return_value = mail_filled_in_form(current_header,rt, subject,
! infile,mailbox, aview);
else {
! return_value = send_msg_l(current_header,rt, NULL, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, infile,mailbox, aview,
page);
if (me_retcode) {
current_header->status |= REPLIED;
--- 353,365 ----
"Re: your mail") ),
sizeof subject);

if (form_letter)
! return_value = mail_filled_in_form(index,rt, subject,
! mailbox, aview);
else {
! return_value = send_msg_l(index,rt, NULL, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
page);
if (me_retcode) {
current_header->status |= REPLIED;
***************
*** 367,375 ****
return(return_value);
}

! int reply_to_everyone(current_header,infile,mailbox, aview, page)
! struct header_rec *current_header;
! FILE *infile;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;
struct menu_context *page;
--- 376,383 ----
return(return_value);
}

! int reply_to_everyone(index,mailbox, aview, page)
! int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;
struct menu_context *page;
***************
*** 387,399 ****
struct string * temp1 = NULL;
char * temp2 = NULL;

! if (!current_header)
return 0;

! rt = handle_reply_to(current_header, infile);
cc = get_and_expand_everyone(current_header,rt);

-
if (current_header->subject)
temp1 = convert_string(display_charset,current_header->subject,1);
else
--- 395,416 ----
struct string * temp1 = NULL;
char * temp2 = NULL;



!
! FILE *F = NULL;

! struct header_rec *current_header = NULL;
!
!
! if (!give_message_data(mailbox,index,
! &current_header,&F,NULL,
! NO_mime_parse))
return 0;

! if (! current_header || !F)
! return 0;
!
! rt = handle_reply_to(current_header,F);
cc = get_and_expand_everyone(current_header,rt);

if (current_header->subject)
temp1 = convert_string(display_charset,current_header->subject,1);
else
***************
*** 406,414 ****
"Re: your mail"),
sizeof subject);

! return_value = send_msg_l(current_header,rt, cc, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, infile,mailbox, aview,
page);
if (me_retcode) {
current_header->status |= REPLIED;
--- 423,431 ----
"Re: your mail"),
sizeof subject);

! return_value = send_msg_l(index,rt, cc, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
page);
if (me_retcode) {
current_header->status |= REPLIED;
***************
*** 425,433 ****
return(return_value);
}

! int forward(current_header,infile,mailbox,aview, page)
! struct header_rec *current_header;
! FILE *infile;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
--- 442,449 ----
return(return_value);
}

! int forward(index,mailbox,aview, page)
! int index;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
***************
*** 444,449 ****
--- 460,466 ----
char subject[SLEN];
int results, edit_msg = FALSE;
int LINES, COLUMNS;
+ struct header_rec *current_header = give_header(mailbox,index);

menu_get_sizes(page, &LINES, &COLUMNS);

***************
*** 486,498 ****
"(fwd)") != 0))
strfcat(subject, " (fwd)", sizeof subject);

! results = send_msg_l(current_header,
NULL, NULL, subject,
(edit_msg ? MAIL_EDIT_MSG : 0 ) |
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,
! infile,mailbox, aview,
page);

free_string(&temp1);
--- 503,515 ----
"(fwd)") != 0))
strfcat(subject, " (fwd)", sizeof subject);

! results = send_msg_l(index,
NULL, NULL, subject,
(edit_msg ? MAIL_EDIT_MSG : 0 ) |
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,
! mailbox, aview,
page);

free_string(&temp1);
***************
*** 500,506 ****

}
else
! results = send_msg_l(current_header,
NULL, NULL,
/* TODO: Fix this mess... */
catgets(elm_msg_cat, ElmSet, ElmForwardedMail,
--- 517,523 ----

}
else
! results = send_msg_l(index,
NULL, NULL,
/* TODO: Fix this mess... */
catgets(elm_msg_cat, ElmSet, ElmForwardedMail,
***************
*** 509,515 ****
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,
! infile, mailbox, aview,
page);
return(results);
}
--- 526,532 ----
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,
! mailbox, aview,
page);
return(results);
}
Index: elm2.4.ME+.117-cvs/src/savecopy.c
*** elm2.4.ME+.116/src/savecopy.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/savecopy.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.46 2004/06/18 20:40:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 57,70 ****
* the filenames right, and then invokes "append_copy_to_file()" to do


* the dirty work.
*/

! int save_copy(headers, cf, form, mime_info, conv_file, mailbox,


page)
struct mailing_headers * headers;
struct copy_file *cf;
int form;

mime_send_t *mime_info;
FILE * conv_file;
- struct MailboxView *mailbox;
struct menu_context *page;
{
int
--- 57,69 ----
* the filenames right, and then invokes "append_copy_to_file()" to do


* the dirty work.
*/

! int save_copy(headers, cf, form, mime_info, conv_file,

page)
struct mailing_headers * headers;
struct copy_file *cf;
int form;

mime_send_t *mime_info;
FILE * conv_file;
struct menu_context *page;
{
int
***************
*** 76,82 ****
int ra, rb;
int reopen_current = 0;
struct current_storage *storage = NULL;
!

if (!cf->copy_file)
return 0; /* Selected NONE */
--- 75,82 ----
int ra, rb;
int reopen_current = 0;
struct current_storage *storage = NULL;
! struct MailboxView *m;
! int idx;

if (!cf->copy_file)
return 0; /* Selected NONE */
***************
*** 135,146 ****


} else {
use_sent_mail:

lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotDetermineToName,
"Cannot determine `to' name to save by! Saving to \"sent\" folder %s instead."),
! sent_mail);

is_sent_mail++;
}
--- 135,151 ----


} else {
+
+ char * sent_val;
+
use_sent_mail:

+ sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotDetermineToName,
"Cannot determine `to' name to save by! Saving to \"sent\" folder %s instead."),
! sent_val ? sent_val : "<");

is_sent_mail++;
}
***************
*** 150,157 ****

if (is_sent_mail) {
int r;
use_sent_mail2:
! /* If we come here via gtoto label, increment is_sent_mail */

if (!is_sent_mail)
is_sent_mail++;
--- 155,163 ----

if (is_sent_mail) {
int r;
+
use_sent_mail2:
! /* If we come here via goto label, increment is_sent_mail */

if (!is_sent_mail)
is_sent_mail++;
***************
*** 166,173 ****
r = select_dir_item(cf->dir,&(cf->copy_file));

if (!r) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
! "Cannot save to %s!"), sent_mail);
sleep_message();
return 0;
}
--- 172,183 ----
r = select_dir_item(cf->dir,&(cf->copy_file));

if (!r) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
! "Cannot save to %s!"),
! sent_val ? sent_val : "<");
!
sleep_message();
return 0;
}
***************
*** 177,185 ****

if (!flags) { /* No selection so try it */
if (!select_dir_item(cf->dir,&(cf->copy_file))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,sent_mail);
sleep_message();
if (is_sent_mail)
panic("FILE PANIC",__FILE__,__LINE__,"save copy",
--- 187,200 ----

if (!flags) { /* No selection so try it */
if (!select_dir_item(cf->dir,&(cf->copy_file))) {
+
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,
! sent_val ? sent_val : "<");
!
sleep_message();
if (is_sent_mail)
panic("FILE PANIC",__FILE__,__LINE__,"save copy",
***************
*** 216,228 ****
free_string(&(cf->copy_file));
cf->copy_file = selection_name_dir(cf->dir);

! if (mailbox) {
int mbc,i;

! mbc = get_storage_count(mailbox);
is_current_folder = 0;
for (i = 0; i < mbc; i++) {
! storage = get_storage(mailbox,i);

if (storage &&
storage->current_folder)
--- 231,245 ----
free_string(&(cf->copy_file));
cf->copy_file = selection_name_dir(cf->dir);

!
! idx = 0;
! while (NULL != (m = give_next_open_mailbox(&idx,0))) {
int mbc,i;

! mbc = get_storage_count(m);
is_current_folder = 0;
for (i = 0; i < mbc; i++) {
! storage = get_storage(m,i);

if (storage &&
storage->current_folder)
***************
*** 231,236 ****
--- 248,256 ----
if (is_current_folder)
break; /* FOUND */
}
+
+ if (is_current_folder)
+ break; /* FOUND */
}

if (is_sent_mail) {
***************
*** 274,284 ****
free(msg_buffer);

if (answer != *def_ans_yes) {
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat,
ElmSet,
ElmSavingToInstead,
"Alright - saving to `%s' instead"),
! sent_mail);
if (sleepmsg > 0)
sleep(sleepmsg);
ClearLine (LINES-1-2);
--- 294,306 ----
free(msg_buffer);

if (answer != *def_ans_yes) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat,
ElmSet,
ElmSavingToInstead,
"Alright - saving to `%s' instead"),
! sent_val ? sent_val : "<" );
if (sleepmsg > 0)
sleep(sleepmsg);
ClearLine (LINES-1-2);
***************
*** 321,332 ****
free(msg_buffer);

if (answer != *def_ans_yes) {
PutLineX (LINES-1-2, 0,
CATGETS(elm_msg_cat,
ElmSet,
ElmSavingToInstead,
"Alright - saving to `%s' instead"),
! sent_mail);
if (sleepmsg > 0)
sleep(sleepmsg);
ClearLine (LINES-1-2);
--- 343,356 ----
free(msg_buffer);

if (answer != *def_ans_yes) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
PutLineX (LINES-1-2, 0,
CATGETS(elm_msg_cat,
ElmSet,
ElmSavingToInstead,
"Alright - saving to `%s' instead"),
! sent_val ? sent_val : "<");
if (sleepmsg > 0)
sleep(sleepmsg);
ClearLine (LINES-1-2);
***************
*** 336,345 ****
}
/* Create it now ... */
if (!create_selection_dir(cf->dir)) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,sent_mail);
sleep_message();
goto use_sent_mail2;
}
--- 360,372 ----
}
/* Create it now ... */
if (!create_selection_dir(cf->dir)) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,
! sent_val ? sent_val : "<");
sleep_message();
goto use_sent_mail2;
}
***************
*** 372,388 ****
}

if (!prepare_write_folder(cf->dir,&write_ptr)) {
if (!is_sent_mail) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,sent_mail);
sleep_message();
goto use_sent_mail2;
}
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
"Cannot save to %s!"),
! sent_mail);
sleep_message();
return 0;
}
--- 399,419 ----
}

if (!prepare_write_folder(cf->dir,&write_ptr)) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
if (!is_sent_mail) {
+
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,
! sent_val ? sent_val : "<");
sleep_message();
goto use_sent_mail2;
}
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
"Cannot save to %s!"),
! sent_val ? sent_val : "<");
sleep_message();
return 0;
}
***************
*** 404,420 ****
}

if (!rb || ra < 0) {
if (!is_sent_mail) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,sent_mail);
sleep_message();
goto use_sent_mail2;
}
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
"Cannot save to %s!"),
! sent_mail);
return 0;
}
return 1;
--- 435,454 ----
}

if (!rb || ra < 0) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
if (!is_sent_mail) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,
! sent_val ? sent_val : "<");
sleep_message();
goto use_sent_mail2;
}
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
"Cannot save to %s!"),
! sent_val ? sent_val : "<");
return 0;
}
return 1;
Index: elm2.4.ME+.117-cvs/src/save_opts.c
*** elm2.4.ME+.116/src/save_opts.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/save_opts.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.26 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.27 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 147,153 ****
int x = find_opt(s);
if (x >= 0) {

! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"str_opt_nam",


"Bad config item type",0);

--- 147,153 ----
int x = find_opt(s);
if (x >= 0) {

! if (RCTYPE_magic != save_info[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"str_opt_nam",


"Bad config item type",0);

***************
*** 214,220 ****


local_value = save_info[x].flags & FL_LOCAL;

add_comment(x, newelmrc);

! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"save_user_options",


"Bad config item type",0);

--- 214,220 ----


local_value = save_info[x].flags & FL_LOCAL;

add_comment(x, newelmrc);

! if (RCTYPE_magic != save_info[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"save_user_options",


"Bad config item type",0);

Index: elm2.4.ME+.117-cvs/src/showmsg.c
*** elm2.4.ME+.116/src/showmsg.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/showmsg.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.36 2004/03/27 18:31:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.37 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 665,673 ****
menu_get_sizes(page,&LINES, &COLUMNS);

DPRINT(Debug,4,(&Debug,
! "displaying %d lines from message #%d using %s\n",
current_header->lines,
! current, pager));


if(ison(current_header->status, NEW)) {
--- 665,673 ----
menu_get_sizes(page,&LINES, &COLUMNS);

DPRINT(Debug,4,(&Debug,
! "displaying %d lines from message #%d\n",
current_header->lines,
! current));


if(ison(current_header->status, NEW)) {
Index: elm2.4.ME+.117-cvs/src/showmsg_c.c
*** elm2.4.ME+.116/src/showmsg_c.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/src/showmsg_c.c 2004-06-18 23:40:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.35 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.36 2004/06/18 20:40:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 253,267 ****
"Forward message"), TRUE, &MENU,
page);

! if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine)) {
! if (forward(hdr,F,mailbox, aview, page))
! put_border(page);
! } else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
}
break;

--- 253,261 ----
"Forward message"), TRUE, &MENU,
page);

! if (forward(current-1,mailbox, aview, page))
! put_border(page);
!
}
break;

***************
*** 274,287 ****
"Group reply"), TRUE, &MENU,
page);

! if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine))
! (void) reply_to_everyone(hdr,F,mailbox, aview, page);
! else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
}
break;

--- 268,274 ----
"Group reply"), TRUE, &MENU,
page);

! (void) reply_to_everyone(current-1,mailbox, aview, page);
}
break;

***************
*** 471,489 ****
"Mail message"), TRUE, &MENU,
page);

! if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine)) {
! if (send_msg_l(hdr,
! NULL,NULL,NULL, MAIL_EDIT_MSG,
! allow_forms, F,
! mailbox, aview,
! page))
! put_border(page);
! } else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
}
break;

--- 458,469 ----
"Mail message"), TRUE, &MENU,
page);

! if (send_msg_l(current-1,
! NULL,NULL,NULL, MAIL_EDIT_MSG,
! allow_forms,
! mailbox, aview,
! page))
! put_border(page);
}
break;

***************
*** 539,553 ****
put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmReplyToMessage,
"Reply to message"), TRUE, &MENU,
page);
! if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine)) {
! if (reply(hdr,F,mailbox, aview, page))
! put_border(page);
! } else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
}
break;

--- 519,526 ----
put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmReplyToMessage,
"Reply to message"), TRUE, &MENU,
page);
! if (reply(current-1,mailbox, aview, page))
! put_border(page);
}
break;

Index: elm2.4.ME+.117-cvs/utils/elmlibregister.c
*** elm2.4.ME+.116/utils/elmlibregister.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/utils/elmlibregister.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.6 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.7 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 300,306 ****


local_value = save_info[x].flags & FL_CHANGED;

else


local_value = save_info[x].flags & FL_LOCAL;

! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

--- 300,306 ----


local_value = save_info[x].flags & FL_CHANGED;

else


local_value = save_info[x].flags & FL_LOCAL;

! if (RCTYPE_magic != save_info[x].dt_type->magic)


panic("RC PANIC",__FILE__,__LINE__,"main",

"Bad config item type",0);

***************
*** 345,351 ****


local_value = save_info[x].flags & FL_CHANGED;

else


local_value = save_info[x].flags & FL_LOCAL;

! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

--- 345,351 ----


local_value = save_info[x].flags & FL_CHANGED;

else


local_value = save_info[x].flags & FL_LOCAL;

! if (RCTYPE_magic != save_info[x].dt_type->magic)


panic("RC PANIC",__FILE__,__LINE__,"main",

"Bad config item type",0);

Index: elm2.4.ME+.117-cvs/utils/elmrc-write.c
*** elm2.4.ME+.116/utils/elmrc-write.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/utils/elmrc-write.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.13 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.14 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 320,326 ****


local_value = save_info[x].flags & FL_CHANGED;

else


local_value = save_info[x].flags & FL_LOCAL;

! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

--- 320,326 ----


local_value = save_info[x].flags & FL_CHANGED;

else


local_value = save_info[x].flags & FL_LOCAL;

! if (RCTYPE_magic != save_info[x].dt_type->magic)


panic("RC PANIC",__FILE__,__LINE__,"main",

"Bad config item type",0);

***************
*** 365,371 ****


local_value = save_info[x].flags & FL_CHANGED;

else


local_value = save_info[x].flags & FL_LOCAL;

! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

--- 365,371 ----


local_value = save_info[x].flags & FL_CHANGED;

else


local_value = save_info[x].flags & FL_LOCAL;

! if (RCTYPE_magic != save_info[x].dt_type->magic)


panic("RC PANIC",__FILE__,__LINE__,"main",

"Bad config item type",0);

Index: elm2.4.ME+.117-cvs/utils/from.c
*** elm2.4.ME+.116/utils/from.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/utils/from.c 2004-06-18 12:29:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: from.c,v 1.48 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: from.c,v 1.49 2004/06/18 09:29:51 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 237,243 ****
infile[0] = '\0';

if (no_files = (optind == argc)) { /* assignment intentional */
! strfcpy(infile, defaultfile, sizeof infile);
optind -= 1; /* ensure one pass through loop */
}

--- 237,247 ----
infile[0] = '\0';

if (no_files = (optind == argc)) { /* assignment intentional */
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (!default_val)
! exit(1);
! strfcpy(infile, default_val, sizeof infile);
optind -= 1; /* ensure one pass through loop */
}

Index: elm2.4.ME+.117-cvs/utils/newmail.c
*** elm2.4.ME+.116/utils/newmail.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/utils/newmail.c 2004-06-18 12:29:52.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmail.c,v 1.36 2004/06/18 09:29:52 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 715,727 ****
static void add_default_folder()
{
struct read_folder_state * read_state_ptr;
!
! folder_list[0].F = enter_new_folder(defaultfile);

if (!folder_list[0].F) {
DPRINT(Debug,1,(&Debug,
"failed to add folder %s\n",
! defaultfile));
return;
}

--- 715,731 ----
static void add_default_folder()
{
struct read_folder_state * read_state_ptr;
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (!default_val)
! return;
!
! folder_list[0].F = enter_new_folder(default_val);

if (!folder_list[0].F) {
DPRINT(Debug,1,(&Debug,
"failed to add folder %s\n",
! default_val));
return;
}

Index: elm2.4.ME+.117-cvs/utils/readmsg.c
*** elm2.4.ME+.116/utils/readmsg.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117-cvs/utils/readmsg.c 2004-06-18 12:29:52.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.18 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.19 2004/06/18 09:29:52 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 331,344 ****
sizeof folder_name);


! } else if (defaultfile[0] != '\0')
! strfcpy(folder_name, defaultfile, sizeof folder_name);
! else {
! lib_error(CATGETS(elm_msg_cat, ReadmsgSet,
! ReadmsgCannotGetIncomingName,
! "%s: Cannot figure out name of your incoming mail folder.\n"),
! prog);
! exit(1);
}
}

--- 331,348 ----
sizeof folder_name);


! } else {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val)
! strfcpy(folder_name, default_val, sizeof folder_name);
! else {
! lib_error(CATGETS(elm_msg_cat, ReadmsgSet,
! ReadmsgCannotGetIncomingName,
! "%s: Cannot figure out name of your incoming mail folder.\n"),
! prog);
! exit(1);
! }
}
}

Kari E. Hurtta

unread,
Jul 8, 2004, 5:43:27 AM7/8/04
to
Archive-name: elm2.4ME+/PL117a

[ resposted because of wrong/duplicate message-id ]

Is available on ozone.FMI.FI


via anonymous ftp
directory KEH/

file elm-2.4ME+PL117a.patch.gz
for a moment (1).

Will be available on ftp.funet.fi (or ftp.ipv6.funet.fi with IPv6)


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL117a.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL117a.patch.gz >
via WWW (2).

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL117a.patch.gz >
via WWW (1).

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL117a.patch.gz >
via WWW.

1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi

www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

2) Is submitted to pub/unix/incoming/ on ftp.funet.fi
( http://www.nic.funet.fi/pub/unix/incoming/elm-2.4ME+/ )

For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL117a.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)


SUMMARY: This patch fixes dsn-success handling bug introduced on
PL117.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL117 (25) --------------------------------
Index: elm2.4.ME+.117a-cvs/hdrs/patchlevel.h
Prereq: 1119000000
*** elm2.4.ME+.117/hdrs/patchlevel.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.117a-cvs/hdrs/patchlevel.h 2004-07-04 08:57:24.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "117 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.117
*/
! #define LAST_REPORT_TIME 1119000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "Jun, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jun, 2004"

/*
* Local Variables:

--- 1,12 ----
! #define PATCHLEVEL "117a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.117
*/
! #define LAST_REPORT_TIME 1120000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Jul, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jul, 2004"

/*
* Local Variables:
Index: elm2.4.ME+.117a-cvs/README.ME+
*** elm2.4.ME+.117/README.ME+ 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.117a-cvs/README.ME+ 2004-07-04 08:53:02.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.776 2004/06/27 16:19:51 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.779 2004/07/04 05:53:02 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,26 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm2.4ME+ PL117a (25) compared with Elm2.4ME+ PL117 (25)
+ -------------------------------------------------------------------
+

+ [ This patch is branch from the main line. ]
+

+ - Fix bug where Elm2.4ME+ PL117 was acting always as
+ dsn-success was set.


+
Changes of Elm2.4ME+ PL117 (25) compared with Elm2.4ME+ PL116 (25)

-------------------------------------------------------------------

***************
*** 101,106 ****
--- 109,116 ----


Changes of Elm2.4ME+ PL116a (25) compared with Elm2.4ME+ PL116 (25)

-------------------------------------------------------------------



+ [ This patch is branch from the main line. ]

+
- Alternatives and weedout and list was replaced with Q letters

Problem noted by: Cyrille Lefevre <cyrille...@laposte.net>

Index: elm2.4.ME+.117a-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.117/nls/C/C/C/s_elm.m 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.117a-cvs/nls/C/C/C/s_elm.m 2004-06-30 22:32:14.000000000 +0300
***************
*** 2303,2306 ****
$ #MailerDisconnected


2155 "Mailer disconnected! Can't send message. Use f)orget !"

$ #MimeFWMessageYN
! 2156 'Forward message as separate part? (%c/%c) '
--- 2303,2306 ----
$ #MailerDisconnected


2155 "Mailer disconnected! Can't send message. Use f)orget !"

$ #MimeFWMessageYN
! 2156 "Forward message as separate part? (%c/%c) "
Index: elm2.4.ME+.117a-cvs/src/mailmsg2.c
*** elm2.4.ME+.117/src/mailmsg2.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.117a-cvs/src/mailmsg2.c 2004-06-30 21:00:53.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.83 2004/06/27 15:18:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.83 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.84 2004/06/30 18:00:53 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.84 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 121,128 ****

if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {


DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));

! if(DSN_success || !reask)


(*dsn) |= DSN_SUCCESS|DSN_FAILURE|DSN_DELAY;

} else if (*dsn) {
*dsn = 0;

--- 121,130 ----

if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {


DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));

! if(DSN_success && !reask) {


(*dsn) |= DSN_SUCCESS|DSN_FAILURE|DSN_DELAY;

+ DPRINT(Debug,8,(&Debug," dsn-success is set .. enabling\n"));
+ }
} else if (*dsn) {
*dsn = 0;

Kari E. Hurtta

unread,
Jul 9, 2004, 6:14:51 AM7/9/04
to
Archive-name: elmME+2.5/PLalpha1.0

Will be available on ftp.funet.fi (2)


via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/

files elm-ME+2.5.PLalpha1.patch.gz
and elm-ME+2.5.alpha1.tar.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-ME+2.5/elm-ME+2.5.PLalpha1.patch.gz >
and <URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-ME+2.5/elm-ME+2.5.alpha1.tar.gz >


Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha1.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.alpha1.tar.gz >
via WWW (1).


1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi


www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

2) Is submitted to pub/unix/incoming/ on ftp.funet.fi
( http://www.nic.funet.fi/pub/unix/incoming/elm-ME+2.5/ )


Before applying patch catenate parts 1 - 4 first.


That part (part 0) do not include patch. Patch

is on part 1 - 4.

This patch is agaist Elm ME+ 2.5 PLalpha0


Changes on Elm ME+ 2.5 PLalpha1 compared with Elm2.4ME+ PLalpha0 (25)
---------------------------------------------------------------------

Note: You must create directory

2.4/doc
before applying this patch!

SUMMARY: This release collects changes of Elm2.4ME+ PL116,
PL116a, PL117 and allows elmination of aliases
from larger aliases. Also Elm 2.4 guide files are moved
from doc to 2.4/doc. New elmrc aoptions are
pgp-interactive and askmimeforward.

WARNING: There is small change on elm.filelist format, so

downgrading from Elm2.4ME+ PL116 (25) or
Elm ME+ 2.5 PLalpha1 to Elm 2.4ME+ PL115 (25) or
to Elm ME+ 2.5 PLalpha0 will not work (you need
unistall or remove elm.filelist first.)

* Changes from Elm2.4ME+ PL116

- Changed prompt ""received" folder not available, continue? (y/n) n"


- Also changed default answer to be yes on that prompt

(that is usefull only when received folder is remote,

but that error may occur also is somebody is set

receivedmail = /invalid
)

- Fix some possible compilation problems with traditional

C compilers (as opposed to ANSI C ompilers)

- Fix typo PROMTP_yesno (to PROMPT_yesno) on
Elm2.4ME+ PL115a (25)

- Added command "elmregister copydoc" which

works like "elmregister copy", but marks

file to be document.

- Added option "-s {stage-subdir}" to command

"elmregister {command}".

- If on header editing screen incoked editor

and address was on form '"a" <b> (c)",
and then edited it on header editing screen

address become as '"a" <b> (c('. Changed

on '(' to ')' on make_surface_addr() on

lib/outheaders.c

- Change from Elm 2.5:

allow elimination of aliases from larger aliases
(To: bigalias -subalias) [B1]
do not send message with zero recipients [B2]

- Fix debug output of dump_expanded_address()

- Changed message catalog name from elm2.4me+
to elmme+2.5

* Changes from Elm2.4ME+ PL116a (25)

- Alternatives and weedout and list was replaced with Q letters
Problem noted by: Cyrille Lefevre <cyrille...@laposte.net>

- Reprint last error on "Mail Pre-Send Screen" after
clearing screen.

- Trying send encrypted messages with gpg was giving

error message


Couldn't find key matching 'xxx@yyy'

Problem noted by: Olivier COLIN <dodo.o...@wanadoo.fr>

(and probably others)


> Make GetPGPKey() retry reading of result on case of

interrupt.

- GetPGPKey() was not collect status of exted gpg and

was left lot of defunct processes. Converted code to

use start_run().

- Do not quote addresses on alternatives.

* Changes from Elm2.4ME+ PL117 (25)

- Fix debug output of dump_expanded_address()

- Implement reconnection for mailer=submission (however


reconnection is not implemented for mailer=sendmail-bs).

These mailer's open smtp (or submission) connection

to server before editor is started. That is done

for get capacity of mailer (for 8BITMIME). However

sometime that times out if editing tooks too long
and sending of mail fails.

- Added pgp-interactive option to elmrc. Setting that

disables batch mode of pgp/gpg when encrypting/signing

mail.

- Added elmrc variable type rc_DT_ESTR (aka kind

of expanded string).


- Reimplemented elmrc variable "pager" as rc_DT_ESTR

- Reimplemented elmrc variable "editor" as rc_DT_ESTR

- Reimplemented elmrc variable "calendar" as rc_DT_ESTR

- Reimplemented elmrc variable "localsignature" as rc_DT_ESTR

- Reimplemented elmrc variable "remotesignature" as rc_DT_ESTR

- Reimplemented elmrc variable "receivedmail" as rc_DT_ESTR

- Reimplemented elmrc variable "sentmail" as rc_DT_ESTR

- Reimplemented elmrc variable "incoming-mailbox" as rc_DT_ESTR

- Removed valid_rc_type()

- Added malloc_gets() to lib/mail_gets.c

- Changed send_msg_l(), mail(), mail_form(),

mail_filled_in_form(), forward(), reply_to_everyone(),


and reply() to use index, mailbox instead of

current_header, infile, mailbox.

- Added give_next_open_mailbox() or src/messages.c and

made save_copy() to use it.

- Moved defination of struct mv_storage and

struct mv_digest out from src/messages/def_messages.h

- When mail is forwarded mail, user is prompted


Forward message as separate part?

default value of answer depends "mimeforward"

elmrc option. Setting elmrc option "askmimeforward"

to OFF disables that prompt.

- Added expanded_address_from_items() to
lib/outheaders.c

- Removed class_charset() from melib/mime_parse.c

- Fix bug of Elm2.4ME+ PL117 where Elm was acting always
as dsn-success was set.
(from Elm2.4ME+ PL117a (25))

- Moved doc/Alias.guide to 2.4/doc/Alias.guide
- Moved doc/Form.guide to 2.4/doc/Form.guide
- Moved doc/Ref.guide to 2.4/doc/Ref.guide
- Moved doc/Users.guide to 2.4/doc/Users.guide
- Moved doc/Config.guid to 2.4/doc/Config.guid
- Moved doc/Elm.cover to 2.4/doc/Elm.cover

- Fix bug where Elm ME+ 2.5 PLalpha0 was eating last
character on %D expansion (on attribution string).

New elmrc options:
pgp-interactive
askmimeforward

Correspond quotes from Elm 2.5 PL7 Changes file:

[B1] allow elimination of aliases from larger aliases
(To: bigalias -subalias). Based on incomplete patch
by Waldi Ravens <wa...@moacs.indiv.nl.net>.

[B2] Don't try to send a message if the user erased all the
recipients on the header screen. (from Bob Schwartz
<r...@elt.com> and Keith Neufeld <neu...@pvi.org>

/ Kari Hurtta

Kari E. Hurtta

unread,
Jul 9, 2004, 6:15:25 AM7/9/04
to
Archive-name: elmME+2.5/PLalpha1.1

Will be available on ftp.funet.fi


via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


Is available with

via WWW.


Before applying patch catenate parts 1 - 4 first.

This patch is agaist Elm ME+ 2.5 PLalpha0
===========================================================[Part 1/4] =========
NOTICE: Create 2.4/doc directory before applying this patch!

For applying thich patch use (on directory where Configure is)

mkdir 2.4/doc
patch -p1 < {this-file}

Then check that removed files do not exists or are empty

ls -la `cat OBSOLETE `

If that lists non-empty files, patch failed.

Then remove emty files with command

rm `cat OBSOLETE `

Index: elmME+.2.5.alpha1-cvs/hdrs/patchlevel.h
Prereq: 1116000000
*** elmME+.2.5.alpha0/hdrs/patchlevel.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/patchlevel.h 2004-07-04 11:24:09.000000000 +0300
***************
*** 1,10 ****


! #define PATCHLEVEL "alpha0"
/* Used by Configure:
! SHAREDTAG: .1.1.0
*/
! #define LAST_REPORT_TIME 1116000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "May, 2004" /* for elm -v option */
#define WHAT_STRING \

"@(#) Version ME+ 2.5, USENET supported version"

--- 1,10 ----
! #define PATCHLEVEL "alpha1"
/* Used by Configure:
! SHAREDTAG: .1.1.1
*/
! #define LAST_REPORT_TIME 1120400000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Jul, 2004" /* for elm -v option */
#define WHAT_STRING \


"@(#) Version ME+ 2.5, USENET supported version"

Index: elmME+.2.5.alpha1-cvs/README.ME+
*** elmME+.2.5.alpha0/README.ME+ 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/README.ME+ 2004-07-04 13:45:04.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.736.4.28 2004/05/16 13:18:29 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.736.4.41 2004/07/04 10:45:04 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 19,25 ****
===================================================================


* Changelog of ElmME+ 2.5

! Changes on Elm ME+ 2.5 PLx compared with Elm2.4ME+ PL115 (25)
-------------------------------------------------------------



Note: You must create directory

--- 19,185 ----
===================================================================


* Changelog of ElmME+ 2.5

! Changes on Elm ME+ 2.5 PLalpha1 compared with Elm2.4ME+ PLalpha0 (25)
! ---------------------------------------------------------------------
!
! Note: You must create directory
! 2.4/doc
! before applying this patch!
!
! SUMMARY: This release collects changes of Elm2.4ME+ PL116,
! PL116a, PL117 and allows elmination of aliases
! from larger aliases. Also Elm 2.4 guide files are moved
! from doc to 2.4/doc. New elmrc aoptions are
! pgp-interactive and askmimeforward.
!
! WARNING: There is small change on elm.filelist format, so
! downgrading from Elm2.4ME+ PL116 (25) or
! Elm ME+ 2.5 PLalpha1 to Elm 2.4ME+ PL115 (25) or
! to Elm ME+ 2.5 PLalpha0 will not work (you need
! unistall or remove elm.filelist first.)
!
! * Changes from Elm2.4ME+ PL116
!
! - Changed prompt ""received" folder not available, continue? (y/n) n"
! - Also changed default answer to be yes on that prompt
! (that is usefull only when received folder is remote,
! but that error may occur also is somebody is set
! receivedmail = /invalid
! )
!
! - Fix some possible compilation problems with traditional
! C compilers (as opposed to ANSI C ompilers)
!
! - Fix typo PROMTP_yesno (to PROMPT_yesno) on
! Elm2.4ME+ PL115a (25)
!
! - Added command "elmregister copydoc" which
! works like "elmregister copy", but marks
! file to be document.
!
! - Added option "-s {stage-subdir}" to command
! "elmregister {command}".
!
! - If on header editing screen incoked editor
! and address was on form '"a" <b> (c)",
! and then edited it on header editing screen
! address become as '"a" <b> (c('. Changed
! on '(' to ')' on make_surface_addr() on
! lib/outheaders.c
!
! - Change from Elm 2.5:
! allow elimination of aliases from larger aliases
! (To: bigalias -subalias) [B1]
! do not send message with zero recipients [B2]
!
! - Fix debug output of dump_expanded_address()
!
! - Changed message catalog name from elm2.4me+
! to elmme+2.5
!
! * Changes from Elm2.4ME+ PL116a (25)
!
! - Alternatives and weedout and list was replaced with Q letters
! Problem noted by: Cyrille Lefevre <cyrille...@laposte.net>
!
! - Reprint last error on "Mail Pre-Send Screen" after
! clearing screen.
!
! - Trying send encrypted messages with gpg was giving
! error message
! Couldn't find key matching 'xxx@yyy'
! Problem noted by: Olivier COLIN <dodo.o...@wanadoo.fr>
! (and probably others)
! > Make GetPGPKey() retry reading of result on case of
! interrupt.
!
! - GetPGPKey() was not collect status of exted gpg and
! was left lot of defunct processes. Converted code to
! use start_run().
!
! - Do not quote addresses on alternatives.
!
! * Changes from Elm2.4ME+ PL117 (25)
!
! - Fix debug output of dump_expanded_address()
!
! - Implement reconnection for mailer=submission (however
! reconnection is not implemented for mailer=sendmail-bs).
! These mailer's open smtp (or submission) connection
! to server before editor is started. That is done
! for get capacity of mailer (for 8BITMIME). However
! sometime that times out if editing tooks too long
! and sending of mail fails.
!
! - Added pgp-interactive option to elmrc. Setting that
! disables batch mode of pgp/gpg when encrypting/signing
! mail.
!
! - Added elmrc variable type rc_DT_ESTR (aka kind
! of expanded string).
! - Reimplemented elmrc variable "pager" as rc_DT_ESTR
! - Reimplemented elmrc variable "editor" as rc_DT_ESTR
! - Reimplemented elmrc variable "calendar" as rc_DT_ESTR
! - Reimplemented elmrc variable "localsignature" as rc_DT_ESTR
! - Reimplemented elmrc variable "remotesignature" as rc_DT_ESTR
! - Reimplemented elmrc variable "receivedmail" as rc_DT_ESTR
! - Reimplemented elmrc variable "sentmail" as rc_DT_ESTR
! - Reimplemented elmrc variable "incoming-mailbox" as rc_DT_ESTR
! - Removed valid_rc_type()
!
! - Added malloc_gets() to lib/mail_gets.c
!
! - Changed send_msg_l(), mail(), mail_form(),
! mail_filled_in_form(), forward(), reply_to_everyone(),
! and reply() to use index, mailbox instead of
! current_header, infile, mailbox.
!
! - Added give_next_open_mailbox() or src/messages.c and
! made save_copy() to use it.
!
! - Moved defination of struct mv_storage and
! struct mv_digest out from src/messages/def_messages.h
!
! - When mail is forwarded mail, user is prompted
! Forward message as separate part?
! default value of answer depends "mimeforward"
! elmrc option. Setting elmrc option "askmimeforward"
! to OFF disables that prompt.
!
! - Added expanded_address_from_items() to
! lib/outheaders.c
!
! - Removed class_charset() from melib/mime_parse.c
!
! - Fix bug of Elm2.4ME+ PL117 where Elm was acting always
! as dsn-success was set.
! (from Elm2.4ME+ PL117a (25))
!
! - Moved doc/Alias.guide to 2.4/doc/Alias.guide
! - Moved doc/Form.guide to 2.4/doc/Form.guide
! - Moved doc/Ref.guide to 2.4/doc/Ref.guide
! - Moved doc/Users.guide to 2.4/doc/Users.guide
! - Moved doc/Config.guid to 2.4/doc/Config.guid
! - Moved doc/Elm.cover to 2.4/doc/Elm.cover
!
! - Fix bug where Elm ME+ 2.5 PLalpha0 was eating last
! character on %D expansion (on attribution string).
!
! New elmrc options:
! pgp-interactive
! askmimeforward
!
! Correspond quotes from Elm 2.5 PL7 Changes file:
!
! [B1] allow elimination of aliases from larger aliases
! (To: bigalias -subalias). Based on incomplete patch
! by Waldi Ravens <wa...@moacs.indiv.nl.net>.
!
! [B2] Don't try to send a message if the user erased all the
! recipients on the header screen. (from Bob Schwartz
! <r...@elt.com> and Keith Neufeld <neu...@pvi.org>
!
! Changes on Elm ME+ 2.5 PLalpha0 compared with Elm2.4ME+ PL115 (25)
-------------------------------------------------------------



Note: You must create directory

***************
*** 67,73 ****


added showreply to elmrc [A5] (!)

added confirmtagsave to elmrc [A6] [A13]

added editflush to elmrc [A7]

! added fwdattribution to elmrc [A8]


added printhdrs to elmrc [A11] (!!)

added savebyalias to elmrc

added showmlists to elmrc (!3)

--- 227,233 ----


added showreply to elmrc [A5] (!)

added confirmtagsave to elmrc [A6] [A13]

added editflush to elmrc [A7]

! added fwdattribution to elmrc [A8] [A16]


added printhdrs to elmrc [A11] (!!)

added savebyalias to elmrc

added showmlists to elmrc (!3)

***************
*** 97,103 ****


%)F for sender's name

%>F for sender's address

%% for %
! Added -w option to readmsg [A10]


Folder name may now include ... [A14] (!) (!2)

%h For 3 letter month

%y For 2 digit year

--- 257,263 ----


%)F for sender's name

%>F for sender's address

%% for %
! Added -w option to readmsg [A10] [A15]


Folder name may now include ... [A14] (!) (!2)

%h For 3 letter month

%y For 2 digit year

***************
*** 126,132 ****


- Change from Elm 2.5:

Added command 'M' to message menu

-

- Changes from Elm2.4ME+ PL115a (25)

- Reimplemeted elmrc "alternatives" as type PATH and

--- 286,291 ----
***************
*** 264,273 ****
--- 423,637 ----


This patch also allows environment vars to be enclosed

in {}.

+ [A15] Fixed readmsg so that when weeding is done, the
+ default action is the opposite of the last action.
+ That is, with a weed list of "Foo: Bar:" the default
+ is reject all other headers. With a weed list of
+ "Foo: !Bar:" the default is accept all other
+ headers.
+
+ [A16] The "fwdattribution" setting now understands
+ "%[begin|end]" formatting. Stuff to the left of the
+ bar is printed in the opening attribution, stuff to
+ the right in the close. The %A escape is depreciated
+ and is slated for removal.

===================================================================


* Changelog of Elm 2.4ME+

+ Changes of Elm2.4ME+ PL117 (25) compared with Elm2.4ME+ PL116 (25)
+ -------------------------------------------------------------------
+

+ - Removed class_charset() from melib/mime_parse.c


+
+ New elmrc options:

+ pgp-interactive
+ askmimeforward
+
+ Changes of Elm2.4ME+ PL116a (25) compared with Elm2.4ME+ PL116 (25)
+ -------------------------------------------------------------------
+
+ - Alternatives and weedout and list was replaced with Q letters
+ Problem noted by: Cyrille Lefevre <cyrille...@laposte.net>


+
+ - Reprint last error on "Mail Pre-Send Screen" after
+ clearing screen.
+
+ - Trying send encrypted messages with gpg was giving
+ error message
+ Couldn't find key matching 'xxx@yyy'
+ Problem noted by: Olivier COLIN <dodo.o...@wanadoo.fr>
+ (and probably others)
+ > Make GetPGPKey() retry reading of result on case of
+ interrupt.
+
+ - GetPGPKey() was not collect status of exted gpg and
+ was left lot of defunct processes. Converted code to
+ use start_run().
+

+ - Do not quote addresses on alternatives.
+
+ Changes of Elm2.4ME+ PL116 (25) compared with Elm2.4ME+ PL115 (25)
+ -------------------------------------------------------------------
+

+ SUMMARY: This patch fixes handling of unexpected return
+ value of nl_langinfo(CODESET) on AIX, fixes
+ value check of "internal-mailcaps" and

+ "metamail-mailcaps" elmrc variables,


+ fixes some prompts on situation where leaving

+ of folder fails, reimplements
+ "alternatives" and "weedout" elmrc variables,
+ changes elm.filelist format (adds subcommand
+ "copydoc" to elmregister), adds -s option
+ to elmregister and adds RFC 2919 List-ID to
+ list of known headers.
+

+ WARNING: There is small change on elm.filelist format, so
+ downgrading from Elm2.4ME+ PL116 (25) to
+ Elm 2.4ME+ PL115 (25) or to Elm ME+ 2.5 PLalpha0
+ will not work (you need unistall or remove
+ elm.filelist first.)


+
+ - " When installing ELM (on AIX 5L), I get the following message:
+
+ | Elm: Unable to map en_US locale (LC_CTYPE) to MIME charset.
+ | Codeset name ISO8859-1 was unknown. Treating ISO8859-1 as MIME name.
+ | Check /usr/local/lib/elm/elm.mimecharsets or
+ | noam/.elm/mime.charsets
+ | WARNING: Locale en_US (charset ISO8859-1) is unsupported, will cause problems!
+ | Problem with locale (system character set)! Elm ME+ will
+ | behave erratically."
+ Problem noted by: Noam G. Nudelman <no...@mail.biu.ac.il>
+
+ - dt_PATH_print_value() was not printing always empty values
+ correctly.
+
+ - fix test on expand_dt_path(). Specially non-file
+ values on "internal-mailcaps" and "metamail-mailcaps" was
+ not giving error message.
+
+ - Prompt "Failed to leave folder: Try to change again ?
+ [P]anic" did not worked. Added new routine prompt_letter()
+

+ - Changed prompt "Failed to leave folder: Try to quit again ?"
+

+ - Changed prompt ""received" folder not available, continue? (y/n) n"
+ - Also changed default answer to be yes on that prompt
+ (that is usefull only when received folder is remote,
+ but that error may occur also is somebody is set
+ receivedmail = /invalid

+ )
+

+ - Fix some possible compilation problems with traditional
+ C compilers (as opposed to ANSI C ompilers)
+

+ - Reimplemeted elmrc "alternatives" as type PATH and
+ removed special elmrc type for alternatives.
+

+ - Reimplemeted elmrc "weedout" as type PATH and
+ removed special elmrc type for weedout.

+ If first element on list is "*clear-weed-list*",
+ then builtin weedout list is not used.
+
+ - Fix typo PROMTP_yesno (to PROMPT_yesno) on
+ Elm2.4ME+ PL115a (25)
+

+ - Added command "elmregister copydoc" which
+ works like "elmregister copy", but marks
+ file to be document.
+

+ - Added option "-s {stage-subdir}" to command
+ "elmregister {command}".


+
+ - Added RFC 2919 List-ID -header to array on
+ lib/headers.c
+ - Fix missing space between pharse and < >
+ on result of hdr_decode_from_phrase() on
+ lib/headers.c
+

+ - If on header editing screen incoked editor
+ and address was on form '"a" <b> (c)",
+ and then edited it on header editing screen
+ address become as '"a" <b> (c('. Changed
+ on '(' to ')' on make_surface_addr() on
+ lib/outheaders.c


+
Changes of Elm2.4ME+ PL115a (25) compared with Elm2.4ME+ PL115 (25)

-------------------------------------------------------------------

Index: elmME+.2.5.alpha1-cvs/2.4/doc/Alias.guide
*** /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/2.4/doc/Alias.guide 2004-07-03 20:46:54.000000000 +0300
***************
*** 0 ****
--- 1,354 ----
+ .\" @(#)$Id: Alias.guide,v 1.1.2.1 2004/07/03 17:46:54 hurtta Exp $
+ .\"
+ .\" A guide to the ELM alias system and so on.
+ .\" format with:
+ .\" tbl Alias.guide | troff tmac.n - > Alias.format'
+ .\"
+ .\" (C) Copyright 1986,1987 Dave Taylor
+ .\" (C) Copyright 1988-1992 Usenet Community Trust
+ .\" Elm is now in the public trust.
+ .\"
+ .\"
+ .\"
+ .tm Have we been run through "tbl" first?? I hope so!
+ .po 1i
+ .ds h0
+ .ds h1
+ .ds h2
+ .ds f0
+ .ds f1
+ .ds f2
+ .nr Hy 1
+ .nr Pt 1
+ .nr Pi 0
+ .lg 0
+ .nf
+ .na
+ .rs
+ .za
+ .sp |3.0i
+ .ce 99
+ .ps 20
+ .ss 18
+ .vs 12
+ \f3The Elm Alias System Users Guide\f1
+ .sp 4
+ .ps 12
+ .ss 14
+ .vs 14
+ \f2What aliases are and how to use them
+ in the \f3Elm\fP mail system\f1
+ .sp 3
+ The Elm Mail System
+ (Version 2.4)
+ .sp 2
+ Syd Weinstein, Elm Coordinator


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp |9.0i
+ \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
+ \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
+ .fi
+ .ad
+ .bp 1
+ .sv 5v
+ .ps 14
+ .ss 12
+ .vs 16
+ \f3The Elm Alias System Users Guide\f1
+ .ds h0 "Alias Users Guide
+ .ds h1
+ .ds h2 "Version 2.4
+ .ds f0 "October 1, 1992
+ .ds f1
+ .ds f2 "Page %
+ .sp
+ .ps 10
+ .ss 12
+ .vs 12
+ (The Elm Mail System, \*(h2)
+ .sp
+ \*(f0
+ .sp 2
+ Syd Weinstein


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp 2
+ Derived from
+ \*QThe Elm Mail System, Version 2.0\*U
+ by
+ Dave Taylor
+ Intuitive Systems
+ Mountain View, California
+ email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
+ .ce 0
+ .sp 3
+ This document is intended as a supplement to the \f2Elm Users Guide\f1
+ and is only of interest to those users desiring more knowledge
+ about how aliases work and how to create strange and exciting
+ aliases for their systems (okay, so maybe it's not \f2that\f1 exciting!)
+ .sp
+ This document is broken up into the following sections;
+ user aliases,
+ group aliases,
+ system aliases,
+ editing and installing new aliases,
+ general warnings and other chit-chat.
+ .sp
+ .hn 1 User Aliases
+
+ The simplest type of aliases in the Elm system are individual
+ user aliases. These are made up of three parts;
+
+ .nf
+ \f2aliasname list\f1 = \f2username\f1 = \f2address\f1
+ .fi
+
+ Where the \f2aliasname list\f1 is either a single aliasname\s-1\u1\d\s0
+ .fn
+ 1. Aliasnames can be any combination of letters, numbers, hyphens (\*q\-\*u),
+ periods (\*q.\*u), or underscores (\*q_\*u). Letter case is not significant,
+ that is, \*QFRED\*U, \*QFred\*U, and \*Qfred\*U are identical.
+ .ef
+ or a list of aliasnames separated by commas. Aliasnames are case insensitive and will be
+ converted to all lower case by the alias system.
+ .sp
+ \f2Username\f1 is used to indicate the full \*Qreal name\*U of the user. For
+ example, if you had an alias for \*Qtaylor\*U to get to me, the
+ \f2username\f1 field would contain \*QDave Taylor\*U or
+ perhaps \*QDave Taylor at HP\*U
+ or some other permutation. The
+ name can optionally be entered in the format of \*QTaylor; Dave\*U. When
+ this is done, the alias system can sort aliases on a last name basis
+ for presentation on the alias menu within Elm.
+ Elm uses this information to add the user's full name to the addresses of
+ outbound mail to get more readable addresses. No
+ matter which format a name is entered, Elm displays it
+ and puts it in mail headers the way you would expect (i.e., \*QDave Taylor\*U).
+ .sp
+ \f2Address\f1 is either the user's full electronic mail address or, if
+ your system uses a smart mailer, the minimum address needed to specify
+ the destination. For example, say my smart mailer
+ contained information on how to get to machine \*Qhp-sdd\*U and I wanted
+ to have an address for my friend Ken there \(em I could have his address
+ specified as simply \*Qken@hp-sdd\*U (or alternatively \*Qhp-sdd!ken\*U since
+ the two are functionally equivalent).
+ .sp
+ Let's get on to some examples, shall we?
+ .sp
+ Consider this excerpt from my own \f2.elm/aliases.text\f1 file;
+
+ .nf
+ .ft CW
+ .zf
+ .in .5i
+ .ta \w'frank,minjarez 'u \w'frank,minjarez = Frank Minjarez 'u
+ # Mail aliases for Dave Taylor
+ # Friends from UCSD
+ addie = Addie Silva = ad...@hp-sdd.SDD.HP.COM
+ frank,minjarez = Frank Minjarez = Minjare...@dockmaster.ddn.mil
+ pizzini = Ken Pizzini = hplabs!ucbvax!ucdavis!pai!ken
+ george = Burdell; George P., Famous GT Guy = gbur...@matd.gatech.edu
+ .ft 1
+
+ .in 0
+ .fi
+ Note that the alias for Frank Minjarez has two \f2aliasnames\f1 associated
+ with it, \f2frank\f1 and \f2minjarez\f1.
+ Also notice that the first and second aliases
+ use the Internet style naming convention of \f2user@machine\f1
+ whereas the third uses the \f2uucp\f1 notation of \f2machine!user\f1.
+ The fourth alias illustrates two features for the \f2username\f1
+ field. An individual's name can be entered in the form of
+ \f2lastname; firstname, comment\f1 which allows the alias system to be able
+ to sort alias names on a last name basis. Additionally, any
+ text after the comma is treated as a comment. It is stored in
+ the alias file and displayed on the alias menu but will not
+ appear in the comment field (between the parentheses) in the header
+ of a message. This allows you to enter useful notes about an
+ individual that you would not otherwise want to include in the
+ \f3To:\f1 header of a mail message.
+ .sp
+ For the most part, the notational format is transparent within the
+ alias file \(em the only time it \f2does\f1 make a difference
+ is if you have to specify more than the machine that the user is
+ receiving mail on (as in the third example above).
+ .sp
+ Suffice to say that if you must specify any sort of uucp route
+ that you should use the uucp notation as much as possible to ensure
+ that the system expands the correct machine name. Similarly, if
+ you're bouncing mail through different Internet sites (to
+ get to a foreign system, as in the example below) you should use the
+ notation that system expects, e.g.:
+
+ .ft CW
+ .zf
+ .ti .5i
+ listserv%byuadmi...@rugters.edu
+ .ft 1
+ .sp
+ .hn 1 Group Aliases
+
+ After the confusion of user aliases, group aliases are even more
+ fun! For the most part the notation is very similar:
+
+ .nf
+ .ti .5i
+ \f2aliasname list\f1 = \f2groupname\f1 = \f2address list\f1
+ .fi
+
+ Where \f2aliasname list\f1 and \f2groupname\f1 are exactly equivalent
+ to the corresponding fields in user aliases.
+ .sp
+ The interesting part is the \f2address list\f1 field; this
+ field is actually in the same notation as the aliasname list (i.e.,
+ a list of addresses separated by commas),
+ so it's really quite easy to create.
+ It's best to illustrate by example:
+
+ .ft CW
+ .zf
+ .nf
+ .in .5i
+ friends, mypals = The Gang of Six = joe, larry, mary, joanna,
+ \h'\w'friends, mypals = The Gang of Six = 'u'nancy, michael
+ .ft 1
+ .in 0
+ .fi
+
+ Notice that you can continue onto as many lines as you'd like so
+ long as each additional line starts with either a \f2<space>\f1 or a
+ \f2<tab>\f1 character.
+ .sp
+ At times it may be desirable to send a message to everyone in
+ the group except one or two people. This can be accomplished by
+ adding the individuals' actual IDs to the \f3To:\f1 list, preceded
+ by a minus sign (\*q\-\*u). For example, if you were having a surprise
+ party for \f2nancy\f1 from the above group and you wanted to discuss the
+ details with the others, you could mail the message to:
+
+ .ft CW
+ .zf
+ .nf
+ .in .5i
+ friends \-nancy
+ .ft 1
+ .in 0
+ .fi
+
+ Unlike in prior versions of Elm, group alias addresses need not
+ be \f2previously defined aliases\f1 or valid mail addresses on
+ the current machine. Any valid delivery address, local user, or
+ prior user or group alias may now be part of a group alias
+ \f2address list\f1.
+ .sp
+ .hn 1 System Aliases
+
+ System aliases are functionally equivalent to the individual Elm
+ alias lists each Elm user has (both user aliases and group aliases)
+ but are \f2read only\f1 for everyone but the Elm administrator. The
+ format of the file is identical to the users' files, and the only difference is
+ that this file is expected to be located in the directory that contains
+ the \f3system_hash_file\f1 and \f3system_data_file\f1 files (see the
+ \f2Elm Configuration Guide\f1 for more details on these variables).
+ .sp
+ Simply create the system alias file in the specified directory
+ as you would a normal alias file, and install it using the newalias
+ command with the -g option (see the following section for more details
+ on that). Voila!!
+ .sp
+ .hn 1 Editing and Installing New Aliases
+
+ To install new aliases, you need merely to create, or modify,
+ the file \f2$HOME/.elm/aliases.text\f1 until you're
+ satisfied with it and it meets the requirements discussed above.
+ You can then try to install it with the command:
+
+ .ti .5i
+ $ \f3newalias\f1
+
+ which either reports the number of aliases installed
+ or the errors encountered trying to parse and store the
+ given alias list.
+ .sp
+ Note that blank lines are no problem and that comments are not only
+ allowed but actually encouraged, and must have \*q#\*u as the first
+ character of each comment line.
+ .sp
+ .hn 1 Other Stuff not Covered Yet
+
+ Probably the biggest question you have in your mind right now
+ is \*QBut how the heck does this relate to my existing \f2Berkeley Mail\f1
+ aliases and the lower-level \f2sendmail\f1 alias system?\*U Well,
+ rest assured that if you \f2really\f1 want to have
+ your aliases down in the transport you can. No problem.
+ .sp
+ And for those ex-\f2Berkeley Mail\f1 fans, you can translate your
+ aliases into the format that Elm wants by running them
+ through the \f2awk\f1 script listed in the appendix.
+ .sp
+ Finally, if you have any problems or questions, try looking in
+ the \f2newalias\f1 manual entry.
+ .bp
+ .ce 99
+ \f3Appendix One
+ An \f2awk\fP Script for Translating Aliases
+ from a Berkeley Mail \f2.mailrc\fP File
+ to an Elm \f2.elm/aliases.text\fP File\f1
+ .ce 0
+ .sp
+ .nf
+
+ .ta .5i
+ .ft CW
+ .zf
+ BEGIN { print "# Elm .elm/aliases.text file, from a .mailrc file..."
+ print ""
+ }
+ next_line == 1 {
+ next_line = 0;
+ group = ""
+ for (i = 1; i <= NF; i++) {
+ if (i == NF && $i == "\\\\") sep = ""
+ else sep = ", "
+ if ($i == "\\\\") {
+ group = sprintf("%s,", group)
+ next_line = 1;
+ }
+ else if (length(group) > 0)
+ group = sprintf("%s%s%s", group, sep, $i);
+ else
+ group = $i;
+ }
+ print "\\t" group
+ }
+ $1 ~ /[Aa]lias | [Gg]roup/ {
+ if ( NF == 3)
+ print $2 " = user alias = " $3;


+ else {
+ group = ""

+ for (i = 3; i <= NF; i++) {
+ if (i == NF && $i == "\\\\") sep = ""
+ else sep = ", "
+ if ($i == "\\\\") {
+ group = sprintf("%s,", group)
+ next_line = 1;
+ }
+ else if (length(group) > 0)
+ group = sprintf("%s%s%s", group, sep, $i);
+ else
+ group = $i;
+ }
+ print $2 " = group alias = " group;
+ }
+ }
+
+ .ft 1
+ .fi
+ Note: this script is contained in the release as \f2utils/mailrc.awk\f1.
Index: elmME+.2.5.alpha1-cvs/2.4/doc/Config.guid
*** /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/2.4/doc/Config.guid 2004-07-03 20:46:54.000000000 +0300
***************
*** 0 ****
--- 1,390 ----
+ .\" @(#)$Id: Config.guid,v 1.1.2.1 2004/07/03 17:46:54 hurtta Exp $
+ .\"
+ .\" A guide to the ELM alias system and so on.
+ .\" format with:
+ .\" 'troff tmac.n Config.guid > Config.fmtd'
+ .\"
+ .\" (C) Copyright 1986,1987 Dave Taylor
+ .\" (C) Copyright 1988-1992 Usenet Community Trust
+ .\"
+ .\"
+ .\"
+ .\"
+ .tm Have we been run through "tbl" first?? I hope so!
+ .po 1i
+ .ds h0
+ .ds h1
+ .ds h2
+ .ds f0
+ .ds f1
+ .ds f2
+ .nr Hy 1
+ .nr Pt 1
+ .nr Pi 0
+ .lg 0
+ .nf
+ .na
+ .rs
+ .za
+ .sp |3.0i
+ .ce 99
+ .ps 20
+ \f3Elm Configuration Guide\f1
+ .sp 4
+ .ps 12
+ .ss 14
+ .vs 14
+ \f2How to install and customize the Elm mail system\f1
+ .sp 3
+ The Elm Mail System
+ (Version 2.4)
+ .sp 2
+ Syd Weinstein, Elm Coordinator


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp |9.0i
+ \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
+ \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
+ .ps 10
+ .ss 12
+ .vs 12
+ .fi
+ .ad
+ .bp 1
+ .fi
+ .ad
+ .bp 1
+ .sv 5v
+ .ps 14
+ \f3Elm Configuration Guide\f1
+ .ds h0 "Elm Configuration Guide
+ .ds h1
+ .ds h2 "Version 2.4
+ .ds f0 "October 1, 1992
+ .ds f1
+ .ds f2 "Page %
+ .sp
+ .ps 10
+ .ss 12
+ .vs 12
+ (The Elm Mail System, \*(h2)
+ .sp
+ \*(f0
+ .sp 2
+ .sp 2
+ Syd Weinstein


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp 2
+ Derived from
+ \*QThe Elm Mail System, Version 2.0\*U
+ by
+ Dave Taylor
+ Intuitive Systems
+ Mountain View, California
+ email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
+ .ce 0
+ .sp 3
+ This document is intended as a supplement to the \f2Elm Users Guide\f1
+ and \f2Elm Reference Guide\f1
+ and should be of interest mainly to people at a site installing,
+ maintaining, and/or modifying the source code to the Elm mail system.
+ .sp
+ It is \f2required\f1 that installation be done by using the
+ \f2Configure\f1 script supplied with the system. Please see the
+ file \f2Instruct\f1 for further information on running \f2Configure\f1.
+ .sp
+ The remainder of this document discusses the various questions
+ asked by the \f2Configure\f1 script and the
+ options available via direct editing of various files and
+ parameters. As indicated above, almost all of the sites that install
+ Elm should find the \f2Configure\f1 script more than
+ sufficient.
+ .hu Using \f2Configure\fP
+
+ \f2Configure\fP is a shell script that automatically determines the
+ type of system it is running on and tunes the parameters of Elm to fit
+ that system and its environment. Where the installer has a choice, it
+ asks questions of the installer. \f2Configure\fP provides its own
+ instructions when run, so they are not repeated here. However, when
+ the installer is presented with a choice, this next section explains
+ some of the options available. Not all the questions or options to
+ those questions are explained here.
+ .sp
+ .ne 6
+ \f3Use fcntl style locking?\f1
+ .br
+ \f3Use flock style locking?\f1
+ .br
+ \f3Use dotlock (.lock) style locking?\f1
+ .sp
+ Elm, like all Mail User Agents (MUAs), has times when it needs exclusive
+ access to the mail spool file. There are three methods of locking the
+ mail spool file: \f2.lock\f1 files, \f2fcntl\f1, and \f2flock\f1.
+ \&\f2.lock\f1 files is the original method,
+ and is used by MUAs and Mail Transport Agents (MTAs). Whenever
+ possible \f2.lock\f1 files should be enabled to assure backwards
+ compatibility with older MUAs and MTAs.
+ .sp
+ BSD systems introduced \f2flock\f1 style locking. It uses the
+ \f2flock(2)\f1 system call
+ to lock the file on the local node. System V later introduced
+ \f2fcntl\f1 style locking, which can also use a protocol for remote locking
+ across the network. Where both styles are available, it is advisable
+ to use both, unless you are sure that only one is in use at your site.
+ Under many System V Release 4 (SVR4) systems, they both use the same underlying
+ system call (\f2flock\f1 is translated into \f2fcntl\f1 style locking),
+ so for that version of
+ .ux ,
+ \f2flock\f1 is not needed and \f2fcntl\f1 style alone can be used.
+ .sp
+ .ne 4
+ \f3Enable calendar feature?\f1
+ .sp
+ Elm has a feature to take specially marked lines within mail messages
+ and add them to a file for use by the system calendar program. The
+ command to do this extraction needs to be enabled to work. There is
+ also a follow on question regarding the name of the calendar file:
+ .sp
+ .ti .5i
+ \f3Default calendar file?\f1
+ .sp
+ which is usually \f2calendar\f1 on most systems. This file resides in
+ the user's home directory, not their \f2.elm\f1 directory.
+ .sp
+ .ne 5
+ \f3Does your /etc/passwd file keep full names in Berkeley/V7 format (name
+ first thing after \*q:\*u in GCOS field)?\f1
+ .sp
+ Elm uses the full name from the password file if it is available.
+ There are two major ways this name is stored. Berkeley/V7 systems
+ place the name as the entire GCOS field string, that is it starts
+ directly after the \*q:\*u that delimits the fields. USG (UNIX Systems
+ Group, or AT&T) systems put the user's name after a department number
+ and separate it from that number by a hyphen (\*q\-\*u).
+ The end of the user's full
+ name in these systems is a \*q(\*u. Look at your \f2/etc/passwd\f1 file and if
+ either version applies, answer \f2yes\f1 to this question; if neither
+ applies, answer \f2no\f1. Elm can still get the user's name from the
+ \&\f2.fullname\f1 file in their home directory.
+ .sp
+ .ne 6
+ \f3Every now and then someone has a gethostname()/uname() that lies about
+ the hostname but can't be fixed for political or economic reasons.
+ Would you like to pretend gethostname()/uname() isn't there and maybe
+ compile in the hostname?\f1
+ .sp
+ Elm needs to know the correct name of the host on which it is executing
+ to be able to create the proper headers for the outbound mail. Some
+ systems use one name for uucp and another name for the system and
+ others just don't reply to the subroutines with the proper name. In
+ this case it will be necessary to compile in the name. In all other
+ cases this should not be needed. It is provided just in case there is
+ a problem with your system.
+ .sp
+ .ne 4
+ \f3Honors Content-Length: header?\f1
+ .sp
+ Starting with SVR4, many of the MTAs are
+ binary transparent. This allows for sending binary messages, such as
+ encoded voice or graphics. In doing so, they no longer can tolerate changes in
+ the message content by the mailers to aid in determining the start of
+ the next message. To solve this problem the \f3Content-Length:\f1 header was
+ added. Elm generates the \f3Content-Length:\f1 header, but to make full use
+ of it, Elm should also not escape such sequences as \*QFrom \*U at the
+ start of a line of the message. If your MTA (mailer)
+ does honor the \f3Content-Length:\f1 header for determining the start of the
+ next message, answer this question \f2yes\f1.
+ .sp
+ Along the same lines, but now obsolete and being phased out, is a
+ problem where an MTA thinks a message is terminated
+ by a single lone period on a line. \f2sendmail\f1 has an option to turn off
+ this behavior and this option is set by default in \f2Configure\f1. If your
+ mailer cannot turn off this option, add a line to \f2sysdefs.SH\f1 to define
+ the symbol \f3NEED_LONE_PERIOD_ESCAPE\f1. This symbol turns a line with
+ a lone period into a period and a blank to avoid this problem.
+ This symbol is ignored if the \*QHonors Content-Length: header?\*U question
+ is answered \f2yes\f1.
+ .sp
+ .ne 4
+ \f3Am I going to be running as a setgid program?\f1
+ .sp
+ On USG and many other type systems, access to the mailboxes and
+ the mailbox directory is via the group permissions. The MUAs,
+ such as Elm, need write access in this directory to be able
+ to move the mailbox around for internal editing and to create lock
+ files. If the permissions on your mailbox directory are \*Qdrwxrwxr-x\*U
+ (no write access for \*Qothers\*U),
+ then Elm needs to be a \f2setgid\f1 program.
+ .sp
+ .ne 4
+ \f3What is the default editor on your system?\f1
+ .sp
+ If no editor is specified in the user's \f2.elm/elmrc\f1 file, this is
+ which editor to use. The editor is used to compose outbound mail
+ messages.
+ .sp
+ .ne 4
+ \f3What pager do you prefer to use with Elm?\f1
+ .sp
+ This is the standard pager to use for reading messages. Besides the
+ usual system pagers, two Elm specific internal options exist: \f2builtin\f1
+ and \f2builtin+\f1. The \f2builtin\f1 pager is faster to execute but much less
+ flexible than the system provided pagers. The \f2builtin+\f1 pager just clears
+ the page before displaying the next page, otherwise the two versions
+ are identical.
+ .hu Other Configurable Parameters
+ The following parameters rarely need to be changed, but are provided if
+ you need them. \f2Configure\fP does not prompt for their values. To
+ change them, edit the \f2hdrs/sysdefs.h\f1 file directly after running
+ \f2Configure\f1.
+ .lp MAX_IN_WEEDLIST 1.0i
+ The maximum number of headers that can be specified in the weedout
+ list of the \f2.elm/elmrc\f1 file. A suggested alternative approach if this
+ number is too small is to specify initial substrings in the file
+ rather than increasing the number. For example, say you want to
+ weedout the headers \*QLatitude:\*U and \*QLatitudinal-Coords:\*U, you
+ could simply specify \*QLatitud\*U and match them both! Furthermore
+ you could also specify headers like \*QX\-\*U and remove all the user
+ defined headers!
+ .lp MAX_HOPS 1.0i
+ When using the \f3group reply\f1 command, this is the maximum number of
+ hops that a message can have taken. This is used to try to optimize the
+ return address (remove cyclic loops and so on) and regular use
+ should show that the default of 35 is plenty more than you'll
+ ever need!
+ .lp system_text_file 1.0i
+ This is the source text file for the system level aliases.
+ See either the \f2newalias\f1 man page or \f2The Elm
+ Alias System Users Guide\f1 for further details.
+ .lp system_hash_file 1.0i
+ This is the file that contains the hashed version of the system
+ aliases generated by \f2newalias\f1.
+ .lp system_data_file 1.0i
+ This is the other file the \f2newalias\f1 command installs in the system
+ alias area and contains the actual addresses for each of the aliases
+ contained in the hashed data file.
+ .lp DEBUGFILE 1.0i
+ The name of the file to put in the user's home directory if they choose to
+ use the \f3\-d\f1 (\f3debug\f1) option.
+ .lp OLDEBUG 1.0i
+ The name of the file to save the previous debug output as (this feature
+ was added to ensure that users wanting to mail bug reports wouldn't
+ automatically overwrite the debug log of the session in question).
+ .lp temp_lock_dir 1.0i
+ Directory for lock files for XENIX.
+ .lp temp_file 1.0i
+ Temporary file for sending outbound messages.
+ .lp temp_form_file 1.0i
+ A place to store temporary forms (for Forms Mode) while answering them.
+ .lp temp_mbox 1.0i
+ Place to keep a copy of the incoming mailbox to avoid collisions with newer
+ mail.
+ .lp temp_print 1.0i
+ File to use when creating a printout of a message.
+ .lp temp_edit 1.0i
+ File to use when editing the mailbox file on XENIX.
+ .lp temp_uuname 1.0i
+ Where to redirect output of the \f2uuname\f1 command.
+ .lp mailtime_file 1.0i
+ File to compare date to to determine if a given message is new
+ since the last time the mail was read or not.
+ .lp readmsg_file 1.0i
+ File to use when communicating with the \f2readmsg\f1 program (see
+ that program for more information).
+ .lp smflags 1.0i
+ Defines the options to hand to \f2sendmail\f1 if and when the program
+ chooses to use it.
+ .lp smflagsv 1.0i
+ Defines the options to hand to \f2sendmail\f1 in verbose voyeur mode.
+ .lp mailer 1.0i
+ If you don't have \f2sendmail\f1, this is the mailer that'll be used.
+ .lp helpfile 1.0i
+ The help file name prefix.
+ .lp ELMRC_INFO 1.0i
+ The file containing textual messages associated with each
+ Elm variable setting in the user's \f2.elm/elmrc\f1
+ file. This is used when the user chooses to save the
+ options from within the main program.
+ .lp elmrcfile 1.0i
+ The name of the automatic control file within the \f2.elm\f1
+ directory (by default \f2elmrc\f1).
+ .lp old_elmrcfile 1.0i
+ When a new \f2elmrc\f1 file is saved, the old one is also saved by
+ renaming it to whatever this identifier is set to.
+ .lp system_rc_file 1.0i
+ The name of the global \f2elmrc\f1 file (default is \f2$lib/elm.rc\f1). This
+ is where the system administrator puts global default values for any
+ parameters controlled by the \f2.elm/elmrc\f1 file.
+ .lp mailheaders 1.0i
+ The name of the optional file that users may have that is
+ included in the headers of each outbound message.
+ .lp dead_letter 1.0i
+ If the user decides not to send a message it is instead saved
+ to this filename in their home directory.
+ .lp unedited_mail 1.0i
+ In the strange case when the mailer suddenly finds all the directories
+ it uses shut off (like \f2/usr/mail\f1 and \f2/tmp\f1)
+ then it'll put the current
+ mailbox into this file in the user's home directory.
+ .lp newalias 1.0i
+ How to install new aliases (note that you MUST have the \f3\-g\f1 option!).
+ .lp readmsg 1.0i
+ What the \f2readmsg\f1 program is installed as.
+ .hu Runtime configuration \(em the global \f2$lib/elm.rc\fP file
+
+ No global default file is provided as part of the installation of
+ Elm. If you wish to override any default parameters for all
+ users, create a file as defined in the \f3system_rc_file\f1 above. An
+ easy way to create it is to copy a saved \f2.elm/elmrc\f1 and edit it
+ to remove all user-specific parameters. Of particular interest are
+ three additional parameters you may set: \f3hostdomain\f1, \f3hostfullname\f1,
+ and \f3hostname\f1. See \f3String Variables\f1 in section 2
+ of the \f2Elm Reference Guide\f1 for details on these variables.
+ .hu When \f2Configure\fP Fails
+
+ The \f2Configure\f1 script has run successfully tens of thousands of
+ times. But maybe your system is the one in ten thousand that will
+ confuse it. For example, \f2Configure\f1 assumes that if your system
+ has a feature it would like, then it should be used. If vendors never
+ made mistakes, then that might be a good assumption. In reality,
+ \f2Configure\f1 might want to use a feature you'd prefer it didn't.
+ .sp
+ When \f2Configure\f1 completes its examination of your system, it
+ gives you a final chance to make changes. When \f2Configure\f1 asks
+ .sp
+ .ti .5i
+ \f3If you need to edit config.sh, do it as a shell escape here:\f1
+ .sp
+ you may briefly jump out of \f2Configure\f1 to make changes. For
+ example, if \f2vi\f1 is your preferred editor, type \f3!vi config.sh\f1.
+ .sp
+ Unfortunately, \f2Configure\f1 makes the same mistakes every time it
+ runs. This means that if you ever apply updates or changes to the
+ Elm system and rerun \f2Configure\f1, you will have to manually make
+ the same configuration changes. Or more likely, you'll forget that
+ the changes are required.
+ .sp
+ The solution to this problem is to create a \f2config.over\f1 file
+ in the Elm base directory. This file may contain any valid \f2sh\f1
+ commands, and is loaded by \f2Configure\f1 immediately before the
+ \f2config.sh\f1 file is created.
+ For example, supposed that \f2Configure\f1 creates a \f2config.sh\f1
+ file with the definition
+ .sp
+ .ti .5i
+ \f3d_feature=define\f1
+ .sp
+ but instead you want it to say
+ .sp
+ .ti .5i
+ \f3d_feature=undef\f1
+ .sp
+ All you need to do is create a \f2config.over\f1 file and put that
+ final line in it.
Index: elmME+.2.5.alpha1-cvs/2.4/doc/Elm.cover
*** /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/2.4/doc/Elm.cover 2004-07-03 20:46:54.000000000 +0300
***************
*** 0 ****
--- 1,69 ----
+ .\" @(#)$Id: Elm.cover,v 1.1.2.1 2004/07/03 17:46:54 hurtta Exp $
+ .\"
+ .\" Cover sheet for the ELM mail system...
+ .\" format with
+ .\" troff tmac.n Elm.cover > Coversheet.fmtd'
+ .\"
+ .\" Elm is now in the public trust.
+ .\"
+ .\" (C) Copyright 1986,1987 Dave Taylor
+ .\" (C) Copyright 1988-1992 Usenet Community Trust
+ .\"
+ .\"
+ .po 1i
+ .ds h0
+ .ds h1
+ .ds h2
+ .ds f0
+ .ds f1
+ .ds f2
+ .nr Hy 1
+ .nr Pt 1
+ .nr Pi 8
+ .lg 0
+ .nf
+ .na
+ .rs
+ .za
+ .sv |2.0i
+ .ce 99
+ .ps 28
+ \fBThe \s30Elm\s28 Mail System\fR
+ .sp 2
+ .ps 18
+ .ss 16
+ .vs 20
+ \fIA Replacement Mailer for All Unix Systems\fR
+ .sp 3
+ \fBUSENET VERSION\fR
+ .sp
+ (2.4 Release System)
+ .ps 14
+ .vs 16
+ .sp
+ Syd Weinstein, Elm Coordinator


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp 5
+ .ps 10
+ .ss 10
+ .vs 12
+ Derived from
+ \*QThe Elm Mail System, Version 2.0\*U
+ by
+ Dave Taylor
+ Intuitive Systems
+ Mountain View, California
+ email: taylor\s11@\s10intuitive.com \ or \ limbo!taylor
+
+ \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
+ \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
+ .sp
+ .fi
+ NOTICE: You may, without additional permission from the authors, distribute

+ copies of the Elm Documentation, with or without additions developed by
+ you or by others at no charge or at a charge that covers the cost of

+ reproducing the copies, provided that the Elm copyright notice is retained.
Index: elmME+.2.5.alpha1-cvs/2.4/doc/Form.guide
*** /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/2.4/doc/Form.guide 2004-07-03 20:46:54.000000000 +0300
***************
*** 0 ****
--- 1,402 ----
+ .\" @(#)$Id: Form.guide,v 1.1.2.1 2004/07/03 17:46:54 hurtta Exp $
+ .\"
+ .\" A guide to using the Elm Forms mode
+ .\" format with:
+ .\" 'troff tmac.n - > Forms.format'
+ .\"
+ .\" Elm is now in the public trust.
+ .\"
+ .\" Copyright (c) 1988-1992 USENET Community Trust
+ .\" Copyright (c) 1986,1987 Dave Taylor
+ .\"
+ .\"
+ .\"
+ .po 1i
+ .ds h0
+ .ds h1
+ .ds h2
+ .ds f0
+ .ds f1
+ .ds f2
+ .nr Hy 1
+ .nr Pt 1
+ .nr Pi 0
+ .lg 0
+ .nf
+ .na
+ .rs
+ .\" Define the big box macro for troff
+ .de eb
+ .sp -1
+ .nf
+ .ie t \{\
+ \h'-.5n'\L'|\\nau-1'\l'\\n(.lu+1n\(ul'\L'-|\\nau+1'\l'|0u-.5n\(ul'
+ .\}
+ .el \{\
+ \h'-.5n'\l'\\n(.lu+1n'
+ .\}
+ .fi
+ ..
+ .sv |3.0i
+ .ce 99
+ .ps 20
+ .ss 18
+ .vs 12
+ \f3Elm Forms Mode Guide\f1
+ .sp 3
+ .ps 12
+ .ss 14
+ .vs 14
+ \f2What Forms Mode is, how to use it to create
+ custom forms, how to reply to forms, and how to
+ use it for AT&T Mail messages\f1
+ .sp 3
+ The Elm Mail System
+ (Version 2.4)
+ .sp 2
+ Syd Weinstein, Elm Coordinator


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp |9.0i
+ \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
+ \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
+ .fi
+ .ad
+ .bp 1
+ .sv 5v
+ .ps 14
+ .ss 12
+ .vs 16
+ .sp 2
+ \f3A Guide to Forms Mode in Elm\f1
+ .ds h0 "Forms Mode Guide
+ .ds h1
+ .ds h2 "Version 2.4
+ .ds f0 "October 1, 1992
+ .ds f1
+ .ds f2 "Page %
+ .sp
+ .ps 10
+ .ss 12
+ .vs 12
+ (The Elm Mail System, \*(h2)
+ .sp
+ \*(f0
+ .sp 2
+ Syd Weinstein


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp 2
+ Derived from
+ \*QThe Elm Mail System, Version 2.0\*U
+ by
+ Dave Taylor
+ Intuitive Systems
+ Mountain View, California
+ email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
+ .ce 0
+ .sp 3
+ While there are a lot of mail systems that allow the transmission
+ of text and primitive pictures, to send and reply to more complex
+ forms is simply not possible. Elm, however, took
+ the forms mode implemented as part of the AT&T Mail package and has
+ expanded on it to be a smoothly fit part of the overall mail system.
+ .sp
+ Forms mode gives you the ability to send \*Qtemplate\*U files to people
+ and receive the filled-in replies.\s-2\u1\d\s0
+ .fn
+ 1. Note that this feature assumes that the person on the other end is
+ also using the Elm mail system, that both yourself and the person on
+ the other end have their user levels set to something other than
+ \f2Beginner\f1 (\f30\f1) and the \f3forms\f1 variable set ON in
+ their \f2.elm/elmrc\f1 files.
+ .ef
+ Let's look at an example right off.
+ .sp
+ Say we were going to use computer mail as a way to file defects with
+ software. There is a certain amount of information we want to be able
+ to collect when each report is made, and if it is in a specific format
+ we can use programs to file the defects upon receipt.
+ .sp
+ The form we'll try to emulate starts out looking like:
+ .\" A manual page break has been done because the 'sd' macro doesn't like
+ .\" coming up right after the footer or just doesn't like going to a new
+ .\" page by itself. The bug has been reported.
+ .bp
+ .ft CW
+ .zf
+ .sd c
+ .mk a
+ .sp
+ .tl ''Defect Reporting Form''
+ .sp
+ .tl 'Program:\ \l'2.3i-\w'Program:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
+ .tl 'Operating\ System:\ \l'2.3i-\w'Operating\ System:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
+ .sp
+ .tl 'Defect\ Type:\ \l'2.3i-\w'Defect\ Type:\ 'u''''
+ .sp
+ .tl 'Date\ Found:\ \l'2.3i-\w'Date\ Found:\ 'u'''By\ Whom:\ \l'2.3i-\w'By\ Whom:\ 'u'\h'.2i''
+ .tl 'Date\ Reported:\ \l'2.3i-\w'Date\ Reported:\ 'u'''Phone:\ \l'2.3i-\w'Phone:\ 'u'\h'.2i''
+ .sp
+ .tl 'Description:\ \l'6.4i-\w'Description:\ 'u''''
+ .tl '\l'6.4i''''
+ .tl '\l'6.4i''''
+ .sp
+ .eb
+ .ed
+ .ft 1
+ .rs \" restore spacing from ed macro
+ .sp
+ This form can actually be created almost exactly as listed above in
+ the Elm mail system by using your standard editor and can then
+ be mailed about as needed.
+ .sp
+ Let's say that we want a bit more information, however, especially with
+ fields like \f2Defect Type\f1, we want to list all the recommended answers.
+ To create the actual form, we need merely to replace the underlines in
+ the above form with spaces. The multi-line comments can simply be
+ indicated by a \*q:\*u by itself on a line:
+
+ .ft CW
+ .zf
+ .sd c
+ .mk a
+ .sp
+ .tl ''Defect Reporting Form''
+ .sp
+ .tl 'Program:''Version:\h'1.7i-\w'Version:'u''
+ .tl 'Operating System:''Version:\h'1.7i-\w'Version:'u''
+ .sp
+ .tl '(Valid Defect Types are: user-error, doc-error, fatal, other)'''
+ .tl 'Defect Type:'''
+ .sp
+ .tl 'Date Found:''By\ Whom:\h'2.3i-\w'By\ Whom:'u''
+ .tl 'Date Reported:''Phone:\h'2.3i-\w'Phone:'u''
+ .sp
+ .tl 'Description'''
+ .tl ':'''
+ .sp
+ Thank you for filling in this form.
+ .sp 2
+ .eb
+ .ed
+ .ft 1
+ .rs \" restore spacing from ed macro
+ .sp
+ As you can see, it is quite simple to create forms!!
+ .sp
+ Now that you have an idea what we're talking about, let's actually officially
+ define the system.
+ .br
+ .ne 5
+ .hu Forms Mode Specification
+
+ [Note that this is all taken from the document \f2Standard for Exchanging
+ Forms on AT&T Mail\f1, Version 1.9 of 6/7/86, from AT&T.]
+ .sp
+ The forms mode is really quite simple. Simple enough that it is amazing
+ that it hadn't been implemented before AT&T Mail came along!!
+ .sp
+ In a nutshell, each field is delimited by a \*q:\*u followed by a number of
+ blank spaces or tabs that represent the valid size for that field. That
+ is, if we have a line in the form like:
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .tl ''Phone (area-code):\0\0\0\0\0Number:\0\0\0\0\0\0\0\0\0\0''
+ .ft 1
+ .fi
+ .sp
+ The area-code field is limited to three characters and the number to nine
+ (this is kind of hard to see with the proportionally spaced formatted copy,
+ alas).
+ The only exception to the rule is that a \*q:\*u by itself on a line represents
+ a field that is as large as the user entering the data desires.
+
+ The actual form that is transmitted, in AT&T Mail parlance, is a \*QSIMPLE\*U
+ forms handler message (as opposed to the \*QADVANCED\*U handler). This means
+ that it contains three sections:
+ .sp
+ .ne 8
+ .nf
+ .in .5i
+ .ft 2
+ The Message Header
+ .ft CW
+ .zf
+ [\&OPTIONS-SECTION]
+ ***
+ [\&FORMS-IMAGE]
+ ***
+ [\&RULES-SECTION]\f1
+ .in 0
+ .fi
+ .sp
+ Elm generates form messages with the \f2OPTIONS-SECTION\f1 filled out,
+ but ignores it when receiving mail. The filled out \f2OPTIONS-SECTION\f1 is:
+ .sp
+ .ft CW
+ .zf
+ .nf
+ .in .5i
+ WIDTH=80
+ TYPE=SIMPLE
+ OUTPUT=TEXT\f1
+ .in 0
+ .fi
+ .sp
+ The \f2FORMS-IMAGE\f1 section is that described above, i.e. prompting
+ text followed by a \*q:\*u, followed by spaces or tabs.
+ The \f2RULES-SECTION\f1 can
+ contain explicit rules about the possible values of each field, but
+ this is currently ignored by Elm, being a \*QSIMPLE\*U forms mode
+ mail system.
+ .sp
+ Forms also have the header \*QContent-Type: mailform\*U to indicate to the
+ mail system (either Elm or AT&T Mail) that a form is being sent.
+ .sp
+ Elm further indicates that a form has been received by having an
+ \*qF\*u as the status character in the header display section (instead of
+ \*qN\*u for new, etc).
+ .br
+ .ne 5
+ .hu Composing and Sending a Form
+
+ The first step to enable sending forms is to change the setting of
+ the variable \f3forms\f1 in your \f2.elm/elmrc\f1 file to ON:
+ .sp
+ .nf
+ .ti .5i
+ forms = ON
+ .fi
+ .sp
+ The next step is to send the message to someone using the \f3m\f1 (\f3mail\f1)
+ command, which drops you into an editor. Type in the form as
+ indicated above, with appropriate colons and comments, and end the entry
+ by leaving the editor.
+ .sp
+ The prompt is now:
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .tl ''Choose: E)dit msg, edit H)eaders, M)ake form, S)end or F)orget : @''
+ .ft 1
+ .fi
+ .sp
+ so we choose \f3m\f1 \(em \f3make form\f1. Elm then either
+ rewrites the prompt without the \*QM)ake form\*U option, indicating that
+ the form has been accepted, or indicates the problem and gives you
+ a chance to correct it.
+ .sp
+ Once it has been accepted, simply use the \f3s\f1 \(em \f3send message\f1 \(em
+ command and it's off!
+ .sp
+ Note that you cannot reply to a message with a form.
+ .br
+ .ne 6
+ .hu Replying to a Form
+
+ Let's reply to the form message we generated now. The header page of the
+ Elm mail system indicates that the message is a form by having
+ an \*qF\*u next to it. So we use \f3r\f1 to reply and the screen is immediately
+ cleared and we're prompted, field by field, for the data requested.
+ Each field has underscores in the input area to indicate the size field that
+ is expected.
+ .sp
+ After answering all the questions we'll have a screen that looks like:
+
+ .ft CW
+ .zf
+ .sd c
+ .mk a
+ .sp
+ .tl ''Defect Reporting Form''
+ .sp
+ Program: \f3The Elm Mail System\f1\l'3i-\w'\f3The Elm Mail System'u'
+ Version: \f31.5\f1\l'3i-\w'\f31.5'u'
+ Operating System: \f3HP-UX\f1\l'3i-\w'\f3HP-UX'u'
+ Version: \f35.141 C\f1\l'3i-\w'\f35.141 C'u'
+ .sp
+ (Valid Defect Types are: user-error, doc-error, fatal, other)
+ Defect Type: \f3fatal\f1\l'5i-\w'\f3fatal\f1'u'
+ .sp
+ Date Found: \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u'
+ By Whom: \f3Dave Taylor\f1\l'3i-\w'\f3Dave Taylor\f1'u'
+ Date Reported: \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u'
+ Phone: \f3(415) 857\-6887\f1\l'3i-\w'\f3(415) 857-6887\f1'u'
+ .sp
+ Description
+ (Enter as many lines as needed, ending with a \*q.\*u by itself on a line)
+ \f3When running it on a CPM system I cannot compile successfully.\f1
+ \f3.\f1
+ Thank you for filling in this form.
+ .tl ''Choose: E)dit form, edit H)eaders, S)end or F)orget : @''
+ .sp
+ .eb
+ .ed
+ .ft 1
+ .rs \" restore spacing from ed macro
+ .sp
+ Quite simple. Notice, however, that the order of prompting is
+ left-to-right on each line, so the fields, \f2By Whom:\f1 and
+ \f2Phone:\f1, although placed in what seems like a logical place on the
+ form, turn out to be confusing when filling in the received form since
+ it isn't clear what \f2Phone:\f1 is being asked for because of the
+ intervention of the \f2Date Reported:\f1 field.
+ .sp
+ The message that is actually sent out from this has the
+ fields in a more acceptable format:
+ .\" Force page break, as there seems to be a bug in the .sd macro
+ .bp
+ .\"
+ .ft CW
+ .zf
+ .mk a
+ .sp
+ WIDTH=80
+ TYPE=SIMPLE
+ OUTPUT=TEXT
+ ***
+ .tl ''Defect Reporting Form''
+ .sp
+ .tl ' Program: The Elm Mail System''Version: 1.5\h'1.5i-\w'Version: 1.5'u''
+ .tl ' Operating System: HP-UX''Version: 5.141 C\h'1.5i-\w'Version: 5.141 C'u''
+ .sp
+ .tl ' (Valid Defect Types are: user-error, doc-error, fatal, other)'''
+ .tl ' Defect Type: fatal'''
+ .sp
+ .tl ' Date Found: 10/9/86''By Whom: Dave Taylor\h'2.3i-\w'By Whom: Dave Taylor'u''
+ .tl ' Date Reported: 10/9/86''Phone: (415) 857-6887\h'2.3i-\w'Phone: (415) 857-6887'u''
+ .sp
+ .tl ' Description'''
+ .sp
+ When running it on a CPM system I cannot compile successfully.
+ .sp
+ .tl ' Thank you for filling in this form.'''
+ ***
+ .sp
+ .eb
+ .ft 1
+
+ .hu Comments on Forms Mode
+
+ As was said at the beginning, this way of sending about forms could
+ prove to be very helpful and useful in a variety of contexts. On the
+ other hand, until a more sophisticated forms language is used for the
+ forms, this should be sufficient to embody the power of the idea.
+ .sp
+ I welcome any comments and thoughts on this system and also welcome
+ possible enhancements.
+ .sp
+ I also gratefully thank Dale DeJager of AT&T Information Systems
+ for sending me more
+ information on AT&T Mail than I could possibly digest in any finite
+ amount of time.
Index: elmME+.2.5.alpha1-cvs/2.4/doc/Ref.guide
*** /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/2.4/doc/Ref.guide 2004-07-03 20:46:54.000000000 +0300
***************
*** 0 ****
--- 1,2359 ----
+ .\" @(#)$Id: Ref.guide,v 1.1.2.1 2004/07/03 17:46:54 hurtta Exp $
+ .\"
+ .\" Reference guide to the Elm mail system.
+ .\" format with
+ .\" troff tmac.n Ref.guide > Ref.format
+ .\"
+ .\" Elm is now in the public trust.
+ .\"
+ .\" (C) Copyright 1986,1987 Dave Taylor
+ .\" (C) Copyright 1988-1992 Usenet Community Trust
+ .\"
+ .\"
+ .\"
+ .po 1i
+ .ds h0
+ .ds h1
+ .ds h2
+ .ds f0
+ .ds f1
+ .ds f2
+ .nr Hy 1
+ .nr Pt 1
+ .nr Pi 0
+ .lg 0
+ .nf
+ .na
+ .rs
+ .za
+ .sv |3.0i
+ .ce 99
+ .ps 20
+ .ss 18
+ .vs 12
+ \f3The Elm Reference Guide\f1
+ .sp 4
+ .ps 12
+ .ss 14
+ .vs 14
+ \f2A comprehensive list of all commands,
+ options and such to the \f3Elm\fP mail system\f1
+ .sp 3
+ The Elm Mail System
+ (Version 2.4)
+ .sp 2
+ Syd Weinstein, Elm Coordinator


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp |9.0i
+ \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
+ \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
+ .fi
+ .ad
+ .bp 1
+ .sv 5v
+ .ce 99
+ .ps 14
+ .vs 16
+ \f3The Elm Reference Guide\f1
+ .ds h0 "Elm Reference Guide
+ .ds h1
+ .ds h2 "Version 2.4
+ .ds f0 "October 1, 1992
+ .ds f1
+ .ds f2 "Page %
+ .sp
+ .ps 10
+ .ss 12
+ .vs 12
+ (The Elm Mail System, \*(h2)
+ .sp
+ \*(f0
+ .sp 2
+ Syd Weinstein


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp 2
+ Derived from
+ \*QThe Elm Mail System, Version 2.0\*U
+ by
+ Dave Taylor
+ Intuitive Systems
+ Mountain View, California
+ email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
+ .ce 0
+ .sp 3
+ .hn 1 Introduction
+
+ There are many parts to a complex software system and \f3The Elm
+ Mail System\f1
+ is no different. This document describes fully all the options
+ available in the mailer, including the command line options,
+ the commands (in considerably more detail than
+ in \f2The Elm Users Guide\f1) and
+ the \f2.elm/elmrc\f1 file.
+
+ To be more explicit, this document covers:
+ a discussion of
+ the \f2.elm/elmrc\f1 file,
+ command line options of Elm,
+ outgoing mail processing,
+ responses of various commands,
+ mail archive folders,
+ the Alias system,
+ system aliases etc,
+ more on the Elm utilities,
+ and a section for expert mail users.
+
+ Without any further ado, then, let's get this show on the road!!
+ .sp
+ .ne 8 \" footnote for UNIX forces text to next page but leaves footnote & hdr
+ .hn 1 "The .elm/elmrc File"
+
+ Elm, like lots of other software on the
+ .ux
+ system, has the ability to automatically read
+ in a configuration file at each invocation. The file must be
+ called \f2elmrc\f1 and reside in the \f2.elm\f1 directory located
+ in your home directory. It can have any of the entries below, in any order.
+ If you are missing any entries, or if you don't have an \f2.elm/elmrc\f1
+ file, the default values (listed below for each option) or those values specified
+ by your systems administrator in a system wide \f2elm.rc\f1 file are used.
+ Note that those options below designated with \*q*\*u can be altered
+ using Elm via the options screen, while those designated with a
+ \*q+\*u can be placed
+ on the options screen using the \f3configoptions\f1 variable.
+ Also note that when you save a new \f2.elm/elmrc\f1 file via the \*q>\*u command
+ of the options
+ screen, it is (re)created including only those options that you
+ have changed via your original \f2.elm/elmrc\f1 file or via the options screen.
+
+ The format for each line of the \f2.elm/elmrc\f1 file is:
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .ti +.5i
+ variable = value\f1
+ .fi
+ .sp
+ .ne 8
+ .hu String Variables
+
+ .lp aliassortby* 1.0i
+ You can have your alias display sorted by any of the following ways:
+ .si 1.5i
+ .lp alias 10n
+ Sorts according to \f2aliasname\f1 for each address.
+ .lp name 10n
+ Sorts according to \f2username\f1 for each address.
+ .lp text 10n
+ Presents the aliases in the order found in the
+ \f2aliases.text\f1 file.
+ .ei
+ .in 1.0i \" ei doesn't restore margin
+ .sp
+ Each of these fields can also optionally be prepended with the
+ sequence \*Qreverse\-\*U to reverse the order of the sort. This doesn't
+ imply anything about the order of the message in the \f2aliases.text\f1
+ file itself and affects only their order on the display screen. The
+ default is \f2name\f1 order.
+
+ .lp alteditor+ 1.0i
+ The editor to use when mailing to a message that already includes text,
+ as the builtin editor cannot handle that situation. Messages that
+ already include text are forwarded messages and replies where the
+ original message is included in the reply. This value is not needed
+ if the \f3editor\f1 variable is not set to \*Qbuiltin\*U.
+
+ .lp alternatives 1.0i
+ This is a list of other machine/username combinations
+ that you receive mail from (forwarded). This is used
+ when the \f2group reply\f1 feature is invoked to ensure that
+ you don't send yourself a copy of the outbound message.
+ The default is a list of no alternatives.
+
+ .lp attribution 1.0i
+ When you \f3forward\f1 a message or \f3reply\f1 to it, you can
+ optionally attribute the quoted text to its original author.
+ Defining the attribution string here allows you to indicate the
+ form that the attribution should take. The sequence \*Q%s\*U in the
+ attribution is replaced by the name of the original author.
+ Examples are:
+ .sp
+ .nf
+ .in 1.5i
+ .ft CW
+ .zf
+ attribution = According to %s:
+ attribution = %s writes:
+ .ft 1
+ .in 0
+ .fi
+
+ .lp calendar* 1.0i
+ This is used in conjunction with the \*q<\*u \f2scan message for
+ calendar entries\f1 command, as the file to append any found
+ calendar entries to. The default is \f2calendar\f1 in your home directory.
+
+ .lp charset 1.0i
+ This is the character set used for messages with a
+ \*QContent-Type: text/plain\*U header.
+ The default depends on your site's installation, but is usually
+ US-ASCII. \f3charset\f1 is only recognized if MIME
+ (Multipurpose Internet Mail Extension)
+ support is configured. You could set \f3charset\f1 to your preferred
+ national character set, but be aware that there is currently no way
+ to change it online. Also you must be aware that Elm probably needs
+ \f2metamail\f1 to display messages with \f3charset\f1=US-ASCII if you change
+ \f3charset\f1. Elm tries to know which character set could display US-ASCII
+ too, but its list of compatible character sets is probably not complete.
+
+ .lp compatcharsets 1.0i
+ This is the list of character sets which are more or less a superset
+ of US-ASCII. This enables Elm to display messages with \f3charset\f1=US-ASCII
+ with the builtin pager, or your preferred pager, instead of calling
+ \f2metamail\f1. \f3compatcharsets\f1 is only recognized if MIME support
+ is configured. The ISO-8859-X character sets are defaulted.
+
+ .lp configoptions 1.0i
+ This is a list of letters that indicate which of the run-time
+ configurable options you desire placed on the options screen (see
+ section 7, \f3Commands\f1, for the \f3options\f1 command). There
+ are 22 run-time configurable options, but only room for 15 on a
+ 24-line screen. The default list is \f2^_cdefsopyv_am_un\f1. Two
+ additional characters can be specified for formatting. Those are \*q_\*u, which
+ adds a blank line, and \*q^\*u, which places the title message on that line
+ instead of the bottom of the screen. The
+ letters \*qi\*u, \*qq\*u, and \*qx\*u are reserved for \*Qreturn to
+ index\*U, \*Qquit\*U,
+ and \*Qexit\*U, respectively, and are not listed as part of the
+ \f3configoptions\f1
+ list. The options controlled by each letter are:
+ .sp
+ .in 1.5i
+ .ta 0.5i
+ a A)rrow cursor \f2(arrow)\f1
+ .br
+ b B)order on copy \f2(prefix)\f1
+ .br
+ c C)alendar file \f2(calendar)\f1
+ .br
+ d D)isplay mail using \f2(pager)\f1
+ .br
+ e E)ditor (primary) \f2(editor)\f1
+ .br
+ f F)older directory \f2(maildir)\f1
+ .br
+ h H)old sent message \f2(copy)\f1
+ .br
+ j J) reply editor \f2(alteditor)\f1
+ .br
+ k K) pause after pager \f2(promptafter)\f1
+ .br
+ l A(l)ias Sorting \f2(aliassortby)\f1
+ .br
+ m M)enu display \f2(menu)\f1
+ .br
+ n N)ames only \f2(names)\f1
+ .br
+ o O)utbound mail saved \f2(sentmail)\f1
+ .br
+ p P)rint mail using \f2(print)\f1
+ .br
+ r R)eply copies msg \f2(autocopy)\f1
+ .br
+ s S)orting criteria \f2(sortby)\f1
+ .br
+ t T)ext editor (~e) \f2(easyeditor)\f1
+ .br
+ u U)ser level \f2(userlevel)\f1
+ .br
+ v V)isual Editor (~v) \f2(visualeditor)\f1
+ .br
+ w W)ant Cc: prompt \f2(askcc)\f1
+ .br
+ y Y)our full name \f2(fullname)\f1
+ .br
+ z Z) signature dashes \f2(sigdashes)\f1
+
+ .lp displaycharset 1.0i
+ This is the character set which is supported by your terminal.
+ The default depends on your site's installation but is usually
+ US-ASCII. For sites with
+ .xw
+ support, ISO-8859-1
+ is a reasonable default.
+
+ .lp easyeditor+ 1.0i
+ The editor to be used by the \*Q~e\*U escape within the builtin editor.
+ The default value is the value of the configuration variable \f2emacs_editor\f1
+ (see \f2The Elm Configuration Guide\f1).
+
+ .lp editor* 1.0i
+ The editor to use when typing in new mail. If you select
+ \*Qnone\*U or \*Qbuiltin\*U you'll get a Berkeley Mail style
+ interface for all mail that doesn't already have text
+ in the buffer (e.g. a reply, mail with a \*Qsignature\*U, etc.)
+ There are two possible formats for it, either a command that
+ can have a filename appended to it before being
+ executed, or a string that contains the metasequence \*Q%s\*U
+ which is replaced by the name of the file before being
+ executed. Examples of each are:
+
+ .nf
+ .in 1.5i
+ .ft CW
+ .zf
+ editor = emacs \-nw
+ editor = emacs \-nw %s \-f text-mode \-f turn-on-auto-fill
+ .ft 1
+ .in 1.0i
+ .fi
+
+ The default is to use the value of $EDITOR in your
+ current environment, and if not set, an editor selected by
+ the person who configured Elm for your system.
+
+ .lp escape 1.0i
+ The character used with the builtin editor (see \f3editor\f1 above)
+ to escape from text entry to input a command.
+ When a line begins with this character, the builtin editor interprets it
+ as a command rather than as text to add.
+ The default is \*q~\*u (tilde).
+
+ .lp fullname* 1.0i
+ This is the name the mailer uses in messages
+ you send. It is highly recommended that you use your
+ full name and nothing strange or unusual, as that can
+ appear extremely rude to people receiving your mail.
+ The default is to use the \*Qgcos\*U field from the \f2/etc/passwd\f1 file
+ on systems that use this field to store full names, and to use the contents
+ of the \f2.\|fullname\f1 file in your home directory on other systems.
+
+ .lp hostdomain 1.0i
+ This is the domain name of your system.
+ This variable is only valid in the system-wide \f2elm.rc\f1 file.
+ It is only necessary if the value returned by
+ the \f2getdomainname\f1 system call is incorrect for your mail use or
+ if that system call is unavailable on your system.
+ If this variable is specified, then the \f3hostfullname\f1 variable must
+ also be specified.
+
+ .lp hostfullname 1.0i
+ This is the \*Qfully qualified domain name\*U of your system.
+ This variable is only valid in the system-wide \f2elm.rc\f1 file.
+ It is only necessary if the value returned by the \f2getdomainname\f1 and
+ \f2gethostname\f1 system calls are incorrect for your mail use or if those
+ system calls are unavailable on your system. It is required if either
+ the \f3hostdomain\f1 or the \f3hostname\f1 variables are used within the
+ system-wide \f2elm.rc\f1 file.
+
+ .lp hostname 1.0i
+ This is the local node-name of your system.
+ This variable is only valid in the system wide \f2elm.rc\f1 file.
+ It is only necessary if the value returned by
+ the \f2gethostname\f1 system call is incorrect for your mail use or if
+ that system call is unavailable on your system.
+ If this variable is specified, then the \f3hostfullname\f1 variable must
+ also be specified.
+
+ .lp localsignature 1.0i
+ See \f3signature\f1.
+
+ .lp maildir* 1.0i
+ This is your folder directory.
+ When you specify a folder name beginning with the \*q=\*u metacharacter,\s-2\u1\d\s0
+ .fn
+ 1. Note that \*q%\*u and \*q+\*u are synonymous with \*q=\*u throughout Elm.
+ .ef
+ it stands for this directory name. That is,
+ if you save a message to folder \f2=stuff\f1
+ the \*q=\*u is expanded to the current value of \f3maildir\f1.
+ The default is the directory \f2Mail\fP in your home directory.
+
+ .lp pager* 1.0i
+ This is the program to be used to display messages. You can
+ specify \*Qbuiltin\*U or the name of any standard pager. If you
+ use \*Qbuiltin+\*U, each screenfull of displayed message is
+ \*Qpaged\*U from the top of your screen with a title line,
+ while \*Qbuiltin\*U simply \*Qscrolls up\*U subsequent screenfulls once
+ it has \*Qpaged\*U the first screenfull.
+ The default is to use the value of $PAGER in your
+ current environment, and if not set, a pager selected by
+ the person who configured Elm for your system, quite likely
+ \*Qbuiltin+\*U.
+
+ .lp precedences 1.0i
+ Some mail transports look at a \*QPrecedence\*U header in outbound
+ mail messages to determine how to deliver the message. The Elm header
+ editing menu allows you to place a precedence on your mail messages.
+ By default, Elm allows any value to be specified as the message
+ precedence. This option may be used to restrict the allowed precedences
+ to a particular list. For example, you might say:
+
+ .nf
+ .in 1.5i
+ .ft CW
+ .zf
+ precedences = special-delivery air-mail first-class bulk junk
+ .ft 1
+ .in 1.0i
+ .fi
+
+ Exactly what precedences your mail transport supports and what they
+ do (if anything at all!) will vary from site to site.
+
+ The distinction between the \*QPrecedence\*U and \*QPriority\*U headers
+ is subtle: the precedence tells the mail system how to handle the
+ message and the priority tells the recipient how important the message
+ is. Although these are quite different things, they are often related.
+ This option will also allow you to associate message priorities with
+ precedences. For example, you might say:
+
+ .nf
+ .in 1.5i
+ .ft CW
+ .zf
+ precedences = special-delivery:urgent air-mail:urgent first-class bulk junk
+ .ft 1
+ .in 1.0i
+ .fi
+
+ In this example, if you select an \*Qair-mail\*U precedence then the
+ message priority defaults to \*Qurgent\*U. If you select a
+ \*Qfirst-class\*U precedence then no special priority is implied. The
+ priorities given in this field are used only if you have not already
+ assigned a priority to your message, and even if one is assigned via
+ \f3precedences\f1 you can always go back and change it.
+
+ .lp prefix+ 1.0i
+ When you \f3reply\f1 to a message or \f3forward\f1 a message to another person,
+ you can optionally include the original message. Defining the
+ prefix value here allows you to indicate what the prefix of
+ each included line should be. The default is \*Q>\ \*U (specified as
+ \*Q>_\*U \(em underscore is interpreted as space) and is
+ standard in the
+ .ux
+ community.
+
+ .lp print* 1.0i
+ This is the command used for printing mail messages. There are two
+ possible formats for the command, depending on whether or not the command
+ contains the sequence \*Q%s\*U. In the first form the mail message(s) to
+ be printed are piped to the specified command. An example of this
+ form is:
+ .sp
+ .in 1.5i
+ .ft CW
+ .zf
+ print = print \-formfeed
+ .ft 1
+ .in 1.0i
+ .sp
+ In the second form the mail message(s) to be printed are dumped into
+ a temporary file, and a \*Q%s\*U in the command string is replaced with
+ the name of the temporary file. An example of this form is:
+ .sp
+ .in 1.5i
+ .ft CW
+ .zf
+ print = pr %s | lpr
+ .ft 1
+ .in 1.0i
+ .sp
+ Another significant difference between the two forms is that in the
+ second form all output from the command is discarded, but in the first
+ form all output is displayed on the terminal. For
+ example, if you wish to use the \*Qpass-through\*U feature to print on
+ the \*Qaux\*U port of a terminal, you must use the first form. The second
+ form is provided for backward compatibility with old versions of Elm.
+ It is depreciated and might be removed in a future release. The
+ default is set by the person who configured Elm for your system.
+
+ .lp receivedmail 1.0i
+ This is the folder to which incoming mail is saved after you've read it.
+ When you answer \f2no\f1 to \*QKeep unread messages in
+ your incoming mailbox?\*U or \f2yes\f1 to \*QStore read
+ messages in your \*Qreceived\*U folder?\*U, this is where the messages go.
+ The default is \*Q=received\*U, that is,
+ a folder called \f2received\f1 in your \f3maildir\f1 directory.
+
+ .lp remotesignature 1.0i
+ See \f3signature\f1.
+
+ .lp sentmail* 1.0i
+ This is the folder to which a copy of outgoing mail is automatically
+ saved. This is only done if the \f3copy\f1 boolean variable is set
+ ON. Also note that if the \f3savename\f1 boolean variable is enabled
+ then this folder may be ignored since the program may save to a folder
+ that has the same name as the login of the person you're sending to.
+ Whether or not a copy is saved, and to what folder, can be changed just
+ prior to sending a message (see the \f3copy\f1 command of the mail
+ command sub-menu in section 7, \f3Commands\f1). The default is
+ \*Q=sent\*U, that is, a folder called \f2sent\f1 in your \f3maildir\f1
+ directory.
+
+ .lp shell 1.0i
+ This defines the shell to use when doing \*q!\*u escapes and
+ such. The default is to use the value of $SHELL in your
+ current environment, and if not set, a shell selected by
+ the person who configured Elm for your system.
+ Note that the \*q!\*u escape is optional and may not be enabled in your
+ version of Elm.
+
+ .lp signature 1.0i
+ This defines the file that is automatically appended to all
+ outbound mail before the editor is invoked. Furthermore,
+ if you'd like a different signature file for \*Qlocal\*U
+ mail and \*Qremote\*U mail (remote being via other hosts),
+ you can alternatively define two variables, \f3localsignature\f1
+ and \f3remotesignature\f1, to have the same functionality.
+ The default is to not have signatures appended to your messages.
+
+ .lp sortby* 1.0i
+ You can have your folder sorted in any of the following ways:
+ .si 1.5i
+ .lp from 10n
+ Sorts according to whom each message is \f2from\f1.
+ .lp lines 10n
+ Sorts \f2shortest\f1 to \f2longest\f1 by message.
+ .lp mailbox 10n
+ Leaves the messages in the order found in the folder.
+ .lp received 10n
+ Sorts \f2least recently received\f1 to \f2most recently received\f1.
+ .lp sent 10n
+ Sorts \f2least recently sent\f1 to \f2most recently sent\f1.
+ .lp status 10n
+ Sorts by \f2priority\f1, \f2action\f1, \f2new\f1, \f2tagged\f1, then
+ \f2deleted\f1.
+ .lp subject 10n
+ Sorts according to the \f2subject\f1 of each message.
+ .ei
+ .in 1.0i \" ei doesn't restore margin
+ .sp
+ Each of these fields can optionally be prepended with the
+ sequence \*Qreverse\-\*U to reverse the order of the sort. This doesn't
+ imply anything about the order of the messages in the folder
+ itself and affects only their order on the index screen. The
+ default is \f2mailbox\f1 order.
+
+ .lp textencoding 1.0i
+ This is the value for the
+ \*QContent-Transfer-Encoding:\*U header,
+ which is used to tell MIME
+ (Multipurpose Internet Mail Extension) capable mail readers how they
+ should decode your mail.
+ The default depends on your site's installation, but is usually
+ \f27bit\f1. Other possible values are \f28bit\f1, \f2base64\f1 or
+ \f2quoted-printable\f1 (see RFC1341 for details).
+ \f27bit\f1 and \f28bit\f1 implies no encoding.
+ .sp
+ Note that Elm doesn't look at this value; it is just placed in your
+ outgoing mail headers.
+ If you put \f2base64\f1 or \f2quoted-printable\f1 as the value,
+ Elm will NOT turn your message into a \f2base64\f1/\f2quoted-printable\f1
+ encoded message. You will have to do that
+ yourself with whatever means are available in your MIME capable mail reader.
+ Metamail, for instance, has a program called mimencode that you can use.
+
+ .lp tmpdir 1.0i
+ Use this if you want to define your own directory for the temporary
+ file Elm creates while running. This is only necessary if using the
+ system temporary directory could cause problems, such as when not all
+ NFS clients mount the common temporary directory, or when the temporary
+ directory is prone to being cleared periodically. The default entry
+ of the system temporary directory is normally OK.
+
+ .lp visualeditor+ 1.0i
+ The editor to be used by the \*Q~v\*U escape within the builtin editor.
+ The default value is the value of the configuration variable \f2vi_editor\f1
+ (see \f2The Elm Configuration Guide\f1).
+
+ .lp weedout 1.0i
+ When specifying this option, you can list headers that
+ you \f2don't\f1 want to see when you are displaying a message.
+ This list can continue for as many lines as desired, as
+ long as the continued lines all have leading indentation.
+ All headers in this entry append to the default weedout list.
+ There are two special header flags. The first, \*Q*clear-weed-list*\*U,
+ clears the default list. The second, \*Q*end-of-user-headers*\*U,
+ terminates the entry, in case the following lines look like they
+ might be more headers for the list.
+ The default \f3weedout\f1 list includes the following header strings:
+ .sp
+ .in 1.5i
+ .ft CW
+ .zf
+ .nf
+ \&>From
+ \&Apparently-To:
+ \&Content-Length
+ \&Content-Transfer-Encoding
+ \&Content-Type:
+ \&From
+ \&In-Reply-To:
+ \&MIME-Version
+ \&Message-Id:
+ \&Newsgroups:
+ \&Received:
+ \&References:
+ \&Status:
+ \&X-Mailer:
+ .ft 1
+ .fi
+ .sp
+ .in 1.0i
+ Note that the \*QFrom\*U entry weeds out both \*QFrom:\*U and the
+ \*QFrom\ \*U headers. If you just want to weed out \*QFrom\ \*U, for example,
+ put a \*Q*clear-weed-list*\*U at the start of the list followed by \*QFrom_\*U
+ or \*QFrom\ \*U.
+ .in 0
+ .ne 8
+ .hu Numeric Variables
+
+ .lp bounceback 1.0i
+ This is a hop count threshold value and allows you to
+ set up the mailer so that when you send mail more than
+ \f2n\f1 machines away, it'll automatically include a
+ \*QCc:\*U to you through the remote machine. In practice
+ this should be very rarely used. Note that this refuses to
+ bounce mail off an Internet address. The default is to
+ have it set to zero, which disables the function.
+
+ .lp builtinlines 1.0i
+ This is used to determine if the builtin pager should be used on some
+ messages even if you would usually use an external pager program.
+ There are two ways of determining whether the builtin pager should be
+ used. If you want any message that is shorter than \f2n\f1 lines to
+ use the internal pager, set this variable to \f2n\f1. If you want the
+ builtin pager to be used if the message is \f2m\f1 lines shorter than
+ the number of lines on your screen, set this variable to \f2\-m\f1.
+ Setting this variable to zero will result in the message always being
+ sent through your external pager. This variable is used only if
+ the pager is not set to the builtin pager. The default is \-3.
+
+ .lp readmsginc 1.0i
+ This variable modifies the display of the message \*QReading in
+ \f2foldername\f1, message: #\*U, which is displayed when reading a new
+ folder. The message count is normally updated as
+ each message in the folder is read. If you are on a slow terminal and are
+ reading a folder with a large number of messages, the time it takes to
+ redraw the message count can significantly exceed the time it takes to
+ simply read the folder.
+ .sp
+ The \f3readmsginc\f1 variable controls the frequency with which the
+ message count is updated. If this parameter is set to 50, the message
+ count will be updated after every 50 messages (i.e., at 50, 100, 150,
+ and so forth). The default value for this parameter is 1. If a value
+ of less than 1 is specified for this parameter, the value is ignored,
+ and the default value is used instead.
+
+ .lp sleepmsg 1.0i
+ This variable modifies the time Elm waits after displaying a transient
+ message before erasing it and continuing. It can be set to zero to
+ suppress the wait entirely. It is in units of whole seconds.
+
+ .lp timeout 1.0i
+ On more advanced systems, it's nice to start up the
+ mailer in a window and let it sit in background
+ until new mail arrives (see \f2wnewmail\f1 for
+ another window based program), at which point
+ it can be brought up to the forefront of the system
+ and read. In this case, it would be quite convenient
+ to have the mailer internally resynchronize every
+ so often. This option specifies the number of seconds that this occurs.
+ .sp
+ This is also useful for non-windowing terminals. For example, you can
+ leave Elm running at night (I usually do) and when you
+ come in in the morning it'll be all ready to read your mail!
+ .sp
+ The default is a 300 second (5 minute) timeout period.
+
+ .lp userlevel* 1.0i
+ This is what the program uses to determine the relative level of
+ sophistication of the user. The values are \*q0\*u for a new user (the
+ default), \*q1\*u for someone familiar with Elm,
+ and \*q2\*u for experts. Some advanced features are hidden from novice
+ users, while experts get less verbose prompt messages.
+ The default is \*q0\*u.
+ .br
+ .ne 8
+ .hu Boolean Variables
+
+ The value assigned to boolean variables can be \*QON\*U or \*QOFF\*U only.
+
+ .lp alwaysdelete 1.0i
+ Set ON to set the default answer to the \*QDelete messages?\*U prompt
+ to \f2yes\f1 (see the \f3quit\f1 command in section 7, \f3Commands\f1,
+ and the \f3ask\f1 variable below). This default answer also applies to
+ deletions from the alias system. The default for \f3alwaysdelete\f1 is
+ OFF.
+
+ .lp alwayskeep 1.0i
+ Set ON to set the default answer to the \*QKeep unread mail in incoming
+ mailbox?\*U prompt to \f2yes\f1. However, if you set \f3alwaysstore\f1
+ OFF or answer \f2no\fP to the \*QStore read mail in \*Qreceived\*U
+ folder?\*U prompt, it is presumed that you also want to keep your
+ unread mail in the incoming mailbox, so the value of \f3alwayskeep\f1
+ is ignored in those cases. See the \f3quit\f1 command in section 7,
+ \f3Commands\f1, and the \f3ask\f1 and \f3alwaysstore\f1 variables
+ below for more details. The default for \f3alwayskeep\f1 is ON.
+
+ .lp alwaysstore 1.0i
+ Set ON to set the default answer to the \*QStore read mail in
+ \*Qreceived\*U folder?\*U prompt to \f2yes\f1 (see the \f3quit\f1
+ command in section 7, \f3Commands\f1, and the \f3ask\f1 variable
+ below). The default for \f3alwaysstore\f1 is OFF.
+
+ .lp arrow* 1.0i
+ Sometimes you are forced to use a slow or \*Qdumb\*U terminal. Set ON
+ to make the current message pointer the \*Q\->\*U sequence rather than
+ the inverse bar. Note that this is overridden by the \*Q\-a\*U command
+ line option (see section 3, \f3Command Line Options\f1). The default
+ is OFF.
+
+ .lp ask 1.0i
+ Set OFF to tell Elm that you'd rather not be asked \*QDelete
+ messages?\*U and such each time you quit, resynchronize, change
+ folders, or return from the alias system, but that it should just use
+ the values of \f3alwaysdelete\f1, \f3alwaysstore\f1, and
+ \f3alwayskeep\f1 without prompting. Note that when you quit \f3Elm\fP,
+ if you use \*qQ\*u instead of \*qq\*u, you will never be questioned,
+ regardless of how you have \f3ask\f1 set. See the \f3quit\f1 commands
+ in section 7, \f3Commands\f1, and the \f3alwaysdelete\f1,
+ \f3alwayskeep\f1, and \f3alwaysstore\f1 variables above for more
+ details. The default for \f3ask\f1 is ON.
+
+ .lp askcc+ 1.0i
+ Set OFF to allow sending mail without being presented the \*QCopies
+ to:\*U prompt for each message. This still allows you to explicitly
+ include addresses in the \*QCc:\*U list via either the header editor or
+ \*Q~c\*U in the builtin editor (see section 8, \f3Using Elm with
+ \*Qeditor = none\*U\f1). The default is ON.
+
+ .lp autocopy+ 1.0i
+ Set ON for Elm to automatically copy the text of each message
+ replied to into the edit buffer. Otherwise you will be prompted as to
+ whether you want the message included in your reply. See the
+ \f3prefix\f1 variable under \f3String Variables\f1 in section 2 for how
+ copied text is marked. The default for \f3autocopy\f1 is OFF.
+
+ .lp confirmappend 1.0i
+ Set ON to make Elm ask for permission
+ to append messages to the end of any file that already exists.
+ Whether the file is a mail folder in the user's mail directory
+ or an ordinary file makes no difference.
+ The default is OFF.
+
+ .lp confirmcreate 1.0i
+ Set ON to make Elm ask for permission before it creates
+ a new file to store messages in.
+ It makes no difference whether the new file would be a mail
+ folder in the user's mail directory or an ordinary file.
+ The default is OFF.
+
+ .lp confirmfiles 1.0i
+ This allows you to have some last resort control over Elm when a
+ message would be appended (by copy, save, or auto-cc) to an existing
+ file which is not a folder in your mail directory (see the
+ \f3maildir\f1 variable under \f3String Variables\f1 in section 2). Set ON
+ to make Elm ask for permission to append a message to the end of
+ an ordinary file, otherwise it silently adds the message to the end of
+ the specified file whether it is a folder or not. The default is OFF.
+
+ .lp confirmfolders 1.0i
+ Set ON to make Elm ask before creating new mail folders in your
+ mail directory (see the \f3maildir\f1 variable under \f3String
+ Variables\f1 in section 2), otherwise it silently creates new mail folders
+ whenever a copy of a message is going to be stored in a folder that
+ does not already exist. See the \f3copy\f1, \f3savename\f1, and
+ \f3forcename\f1 variables below for additional information about
+ copying messages. The default for \f3confirmfolders\f1 is OFF.
+
+ .lp copy+ 1.0i
+ Set ON to have silent copies made of all outgoing mail. Where the copy
+ of the message is saved is determined by the \f3maildir\f1 and
+ \f3sentmail\f1 string variables and the \f3savename\f1 and
+ \f3forcename\f1 boolean variables. Whether a copy is saved and to
+ which folder can also be set prior to sending a message \(em see the
+ \f3copy\f1 command of the mail command sub-menu in section 7,
+ \f3Commands\f1, for details. The default for \f3copy\f1 is OFF.
+
+ .lp forcename 1.0i
+ Set ON to force creation of folders for copies of outbound mail by the
+ recipient name. For complete details of how to enable automatic
+ copying of outbound messages, see the \f3copy\f1 and \f3savename\f1
+ boolean variables. The default is OFF.
+
+ .lp forms 1.0i
+ Set ON to enable the generation of \*Qforms\*U type messages. See the
+ \f2Elm Forms Mode Guide\f1 for further information about mail forms.
+
+ .lp keepempty 1.0i
+ The mail system has a habit of deleting folders when you've removed
+ everything from them. Set ON to preserve empty folders as zero-length
+ files. Note that this option does not apply to your incoming mailbox.
+ The default is OFF.
+
+ .lp keypad 1.0i
+ Set ON to indicate that you have an HP terminal and want the
+ \f2<NEXT>\f1, \f2<PREV>\f1, \f2<HOME>\f1 and \f2<SHIFT-HOME>\f1 keys enabled.
+ The default is OFF.
+
+ .lp menu* 1.0i
+ Set OFF to inhibit the menu display on all screen displays within
+ Elm. Note that this is overridden by the \*Q\-m\*U command line
+ option (see section 3, \f3Command Line Options\f1). The default is
+ ON.
+
+ .lp metoo 1.0i
+ Set ON to get a copy of mail you send to a mailing list you are on,
+ otherwise you do not get a copy of such messages. The default is OFF.
+
+ .lp movepage 1.0i
+ Set ON to enable commands that move through the folder by pages (see
+ the \*q+\*u, \*q\-\*u, \f2<right>\f1, and \f2<left>\f1 keys in section
+ 7, \f3Commands\f1) to move the current message pointer to the top of
+ that page of messages. Set OFF to not alter the current message
+ pointer location when moving through pages. The default is OFF.
+
+ .lp names* 1.0i
+ Set OFF to display the primary recipients' addresses on your screen
+ with their full names when you send a message. Set ON to display only
+ the full names. The default is ON.
+
+ .lp noheader 1.0i
+ Set ON to not include the headers of messages when copying a message
+ into the edit buffer for replying or forwarding (see the \f3autocopy\f1
+ variable above). The default is ON.
+
+ .lp pointnew 1.0i
+ Set ON to cause the current message pointer to point to the first new
+ message in your incoming mailbox when started, instead of at message #1
+ of the index. This has no effect for other folders since they are not
+ expected to have \*Qnew\*U mail. The default is ON.
+
+ .lp promptafter+ 1.0i
+ Set ON to display a command prompt rather than the index screen when
+ exiting from an external pager. This variable has no effect on the
+ builtin pager. See the \f3pager\f1 variable under \f3String Variables\f1
+ in section 2 to specify which pager to use to read messages.
+
+ If your external pager immediately exits when it reaches the end of the
+ message, you should set \f3promptafter\f1 ON so that the last screen of
+ the displayed message is not immediately replaced by the index screen.
+ If your external pager doesn't exit until you command it to, you have a
+ choice. If you usually want to see the index screen before issuing a
+ command, setting this variable OFF eliminates the extra keystroke
+ needed to return to the index screen. If you usually don't need to see
+ the index screen before issuing the next command, setting it ON allows
+ you to enter your next command without waiting for the index screen to
+ be redrawn. The default is ON.
+
+ .lp resolve 1.0i
+ Set ON to move the current message pointer to the next message on the
+ index when a mail message is \*Qdealt with\*U through deleting,
+ undeleting, saving, forwarding, etc. or set OFF to leave the current
+ message pointer unchanged. The default is ON.
+
+ .lp savename 1.0i
+ One of the problems with electronic mail systems is that one tends to
+ get very large, one-dimensional (flat) files that contain lots of
+ completely unrelated mail. Elm can use a more intelligent
+ algorithm: for incoming mail, when you \f3save\f1 or \f3copy\f1 it
+ (see section 7, \f3Commands\f1), the default folder is the login name
+ of the person who sent you the message (changed by pressing anything
+ other than \f2<return>\f1 of course). Similarly, when sending mail,
+ instead of just blindly saving it to the \f3sentmail\f1 folder,
+ Elm can save it to a folder that is the login name of the
+ recipient of the mail.\s-2\u2\d\s0
+ .fn
+ 2. When sending to a group, it's saved to the login name of the first
+ person in the list only.
+ .ef
+ Set \f3savename\f1 ON to enable this algorithm.
+
+ If \f3forcename\f1 is OFF (see above), the copy is saved to that folder
+ only if the folder already exists. In practice, this means that
+ important people that you communicate with (those that you tend to save
+ mail from) have folders that are actually \f2a recorded log of the
+ discussion in both directions\f1 and others (random mailings) are all
+ stuffed in the \f3sentmail\f1 folder for easy perusal and removal (see
+ the \f3sentmail\f1 variable under \f3String Variables\f1 in section
+ 2). If you always want to save copies of outgoing messages in separate
+ folders by recipient login name, you'll want to set \f3forcename\f1
+ ON.
+
+ The default for \f3savename\f1 is ON.
+
+ .lp sigdashes+ 1.0i
+ Set ON to tell Elm that you wish to follow the
+ convention of prefixing your signature with \*Q\f2newline dash dash
+ blank newline\f1\*U. This is placed in your message before your
+ signature file (see the \f3signature\f1, \f3localsignature\f1, and
+ \f3remotesignature\f1 variables under \f3String Variables\f1 in section 2).
+ If OFF, the signature file, if any, is placed at
+ the end of the message without any prefix. The default is ON.
+
+ .lp softkeys 1.0i
+ Set ON to tell Elm that you have an HP terminal with the
+ HP 2622 function key protocol and that you'd like to have the function
+ keys available while in the program. The default is OFF.
+
+ .lp titles 1.0i
+ Set ON to have the first line of a message titled with:
+ .sp
+ .ft CW
+ .zf
+ .ps 9
+ .nf
+ .tl ' Message \f2N/M\fP from \f2username\fP''\f2date\fP at \f2time\f1 '
+ .fi
+ .ps 10
+ .ft 1
+ .sp
+ where all the information is extracted from the message.
+ This is especially useful if you weed out all the headers of each
+ message with a large \f3weedout\f1 list (see the \f3weedout\f1 variable
+ under \f3String Variables\f1 in section 2).
+ The default is ON.
+
+ .lp usetite 1.0i
+ Set ON to enable use of the \f2termcap/terminfo\f1
+ \f3ti/te\f1 capabilities.
+ Many terminal emulators require it (not the least of which is the
+ OpenLook \f2cmdtool\f1).
+ Some terminal emulators clear the screen on \f3te\f1 (some \f2xterm\f1s).
+ Set OFF to disable use of \f3ti/te\f1.
+ Note that this is overridden by the \*Q\-t\*U command line option
+ (see section 3, \f3Command Line Options\f1). The default is ON.
+
+ .lp weed 1.0i
+ Set ON to have Elm \*Qweed out\*U certain headers from displayed
+ messages, that is, not display them. The \f3weedout\f1 variable under
+ \f3String Variables\f1 in section 2 allows you to custom define the set of
+ headers you would like to not have displayed while reading messages.
+ The default for the \f3weed\f1 variable is ON.
+ .in 0
+ .sp
+ .sp
+ For a better idea of how this all works, here's a sample \f2.elm/elmrc\f1
+ file. While looking through it, notice that you can have lots of
+ comments and blank lines for readability and that you can also use
+ \*Qshell variables\*U and the \*q~\*u (tilde) metacharacter for your home
+ directory, and they are expanded accordingly when read in by the
+ mailer. Note that this was automatically saved by the Elm
+ program on the fly from the options screen.
+ .sp
+ .ft CW
+ .zf
+ .nf
+ #
+ # .elm/elmrc \- options file for the ELM mail system
+ #
+ # Saved automatically by ELM 2.4 for Elm Development Group
+ #
+
+ # For yes/no settings with ?, ON means yes, OFF means no
+
+ # where to save calendar entries
+ calendar = ~/.Agenda
+
+ # what editor to use ("none" means simulate Berkeley Mail)
+ # \'%s\' can be used as the temporary filename for the outgoing message
+ editor = none
+
+ # the character to use in the builtin editor for entering commands
+ escape = ~
+
+ # the full user name for outbound mail
+ fullname = Elm Development Group
+
+ # where to save received messages to, default file is "=received"
+ receivedmail = $HOME/Mail/received
+
+ # where to save my mail to, default directory is "Mail"
+ maildir = /users/elmdev/Mail
+
+ #directory to hold my temporary files to avoid NFS cross mount problems
+ tmpdir = /users/elmdev/Mail/tmp
+
+ # program to use for displaying messages (\'builtin\' is recommended)
+ pager = builtin
+
+ # prefix sequence for indenting included message text in outgoing messages...
+ prefix = >_
+
+ # how to print a message (\'%s\' is the filename)
+ print = lpr \-Plw2 %s
+
+ # attribution string for replies (\'%s\' is the author of original message)
+ attribution = According to %s:
+
+ # where to save copies of outgoing mail to, default file is "=sent"
+ sentmail = /users/elmdev/Mail/mail.sent
+
+ # the shell to use for shell escapes
+ shell = /bin/csh
+
+ # local ".signature" file to append to appropriate messages...
+ localsignature = localsig
+
+ # remote ".signature" file to append to appropriate messages...
+ remotesignature = remotesig
+
+ # do we want dashes above signatures? (News 2.11 compatibility and convention)
+ sigdashes = ON
+
+ # how to sort folders, "Reverse Sent" by default
+ sortby = Reverse\-Received
+
+ # should the default be to delete messages we\'ve marked for deletion?
+ alwaysdelete = ON
+
+ # should the default be to store read messages to the "received" folder?
+ alwaysstore = ON
+
+ # should the default be to keep unread messages in the incoming mailbox?
+ alwayskeep = ON
+
+ # should we use the "\->" rather than the inverse video bar?
+ arrow = OFF
+
+ # should the message disposition questions be displayed (ON) or
+ # auto\-answered (OFF) with the default answers when we resync or change folders?
+ ask = ON
+
+ # would you like to be asked for Carbon\-Copies information each msg?
+ askcc = ON
+
+ # automatically copy message being replied to into buffer?
+ autocopy = OFF
+
+ # threshold for bouncing copies of remote uucp messages...
+ # zero = disable function.
+ bounceback = 0
+
+ # save a copy of all outbound messages?
+ copy = ON
+
+ # do we want to be able to mail out AT&T Mail Forms?
+ forms = OFF
+
+ # should we keep folders from which all messages are deleted?
+ keepempty = OFF
+
+ # we\'re running on an HP terminal and want HOME, PREV, NEXT, etc...
+ keypad = OFF
+
+ # should we display the three\-line \'mini\' menu?
+ menu = ON
+
+ # would you like a copy of a message you send to an alias you are on?
+ metoo = OFF
+
+ # when using the page commands (+ \- <NEXT> <PREV>) change the current
+ # message pointer...?
+ movepage = ON
+
+ # just show the names when expanding aliases?
+ names = ON
+
+ # when messages are copied into the outbound buffer, don\'t include headers?
+ noheader = ON
+
+ # start up by pointing to the first new message received, if possible?
+ pointnew = ON
+
+ # prompt for a command after the external pager exits?
+ promptafter = ON
+
+ # emulate the mailx message increment mode (only increment after something
+ # has been \'done\' to a message, either saved or deleted, as opposed to
+ # simply each time something is touched)?
+ resolve = ON
+
+ # save messages, incoming and outbound, by login name of sender/recipient?
+ savename = ON
+
+ # save outbound messages by login name of sender/recipient even if the
+ # associated folder doesn\'t already exist?
+ forcename = OFF
+
+ # are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
+ # (this implies "keypad=ON" too)
+ softkeys = OFF
+
+ # set the main prompt timeout for resynching...
+ timeout = 60
+
+ # display message title when displaying pages of message?
+ titles = ON
+
+ # are we good at it? 0=beginner, 1=intermediate, 2+ = expert!
+ userlevel = 2
+
+ # enable the weedout list to be read?
+ weed = ON
+
+ # what headers I DON\'T want to see, ever.
+ weedout = "Path:" "Via:" "Sent:" "Date" "Status:" "Original" "Phase"
+ "Subject:" "Fruit" "Sun" "Lat" "Buzzword" "Return" "Posted"
+ "Telephone" "Postal\-Address" "Origin" "X\-Sent\-By\-Nmail\-V" "Resent"
+ "X\-Location" "Source" "Mood" "Neuron" "Libido" "To:" "X\-Mailer:"
+ "Full\-Name:" "X\-HPMAIL" "Cc:" "cc:" "Mmdf" "Network\-" "Really\-"
+ "Sender:" "Post" "Message\-" "Relay\-" "Article\-" "Lines:"
+ "Approved:" "Xref:" "Organization:" "*end\-of\-user\-headers*"
+
+ # alternative addresses that I could receive mail from (usually a
+ # forwarding mailbox) and don\'t want to have listed...
+ alternatives = dsidev!elmdev dsirel!elmdev elmdev@dsidev elmdev%dsidev
+
+ # list of delivery precedences allowed, or empty to allow anything
+ # precedence may be followed by optional ":priority" specification
+ precedences = special\-delivery:urgent air\-mail:urgent first\-class bulk junk
+
+ # name of Character Set used with MIME text/plain Content\-type
+ # US\-ASCII is default. Be aware that if you use a national charset
+ # elm probably needs metamail to display US\-ASCII. Elm tries to
+ # know if that charset could display US\-ASCII too, but the list
+ # of us\-ascii compatible charsets is not yet complete
+ charset=US\-ASCII
+
+ # name of Character Set which the display supports. This is independent
+ # of the above "charset".
+ displaycharset=US\-ASCII
+
+ # list of Character Sets, which are more or less a superset of US\-ASCII
+ # so we know that we can display messages with charset=US\-ASCII without
+ # help of metamail
+ compatcharsets = ISO\-8859\-1 ISO\-8859\-2 ISO\-8859\-3 ISO\-8859\-4 ISO\-8859\-5 ISO\-8859\-6 ISO\-8859\-7 ISO\-8859\-8 ISO\-8859\-9
+
+ # would you like to use termcap/terminfo ti/te entries?
+ usetite = ON
+
+ # Value by which message count is incremented while reading a new mailbox.
+ # Setting this value to a number larger than one will speed up the time it
+ # takes to read a large mailbox when using a slow terminal.
+ readmsginc = 5
+
+ # time in seconds which Elm will wait after displaying a transient message
+ # and before erasing it. Can be 0 or positive integer.
+ sleepmsg = 2
+ .fi
+ .br
+ .ne 5
+ .sp 2
+ .hn 1 Command Line Options
+
+ There are a number of command line options to the Elm
+ program, with only one that needs to be remembered: \*Q\-?\*Uor \*Q\-h\*U
+ for help.
+
+ The options are:
+
+ .lp \h'24p'\-a 66p
+ This allows you to have the \*Q\->\*U arrow pointer
+ rather than the inverse bar. This can also be set in
+ the \f2.elm/elmrc\f1
+ file with the boolean variable \f3arrow\f1.
+
+ .lp \h'24p'\-c 66p
+ Check only. This is useful for expanding aliases
+ without sending any mail. The invocation is similar to
+ invoking Elm in send-only mode:
+ .sp
+ .ft CW
+ .zf
+ .ti 1.5i
+ elm \-c\f2 list-of-aliases\f1
+
+ .lp "\h'24p'\-d \f2n\f1" 66p
+ Set debug level to \f2n\f1. Useful for debugging the Elm
+ program, this option will create a file in your home
+ directory called \f2ELM:debug.info\f1 containing
+ a running log of what is going on with
+ the program. Level \f2n\f1 can be 1 through 11,
+ where the higher numbers generate more output.
+ This option might be disabled by the the person who configured
+ Elm for your system.
+
+ .lp "\h'24p'\-f \f2folder\f1" 66p
+ Read the specified folder rather than the default incoming mailbox.
+ Note that you can use the same metacharacters (e.g. \*q=\*u) as when
+ you \f2change folders\f1 from within the program. You can also use the
+ same abbreviatory symbols (\*q!\*u, \*q>\*u and \*q<\*u),
+ but remember to \*Qsingle quote\*U them
+ in case they have special meaning in the shell you use.
+
+ .lp "\h'24p'\-h or \-?" 66p
+ Help message. Gives a short list of all these options and exits.
+
+ .lp "\h'24p'\-i \f2file\f1" 66p
+ Include a prepared file in the edit buffer before sending.
+ This facilitates using Elm with other programs
+ that interface with mail (like news readers, for example). There
+ is an example of how to set up the \f2rn\f1 news reading program to
+ use Elm in \f2The Elm Users Guide\f1. The file specified is
+ copied into the temporary file just before the signature file.
+
+ .lp \h'24p'\-k 66p
+ Keypad enable. This option lets the Elm program
+ know that you're on an HP terminal, and it can then interpret
+ the <PREV>, <NEXT> and <HOME>/<SHIFT>-<HOME> keys accordingly. If you
+ are not on an HP terminal, it is recommended that you do
+ NOT use this option. See also the \f3keypad\f1 variable,
+ described under \f3Boolean Variables\f1 in section 2.
+
+ .lp \h'24p'\-K 66p
+ Keypad + softkeys enable. The Elm mailer can
+ use the HP softkeys as an alternative form of
+ input. If you specify this option be sure that you're on
+ an HP terminal that can accept the standard 2622 terminal
+ escape sequences! See also the \f3softkeys\f1 variable,
+ described under \f3Boolean Variables\f1 in section 2.
+
+ .lp \h'24p'\-m 66p
+ Inhibit display of the 3-line menu when using the mailer. This,
+ of course, gives you three more message headers per page instead.
+ See also the \f3menu\f1 variable, described under \f3Boolean
+ Variables\f1 in section 2.
+
+ .lp "\h'24p'\-s \f2subject\f1" 66p
+ In send-only and batch mode, this is how to indicate the subject of the
+ resulting message. Please see the section on \f3Non-Interactive
+ Uses of Elm\f1 in \f2The Elm Users Guide\f1 for more information.
+
+ .lp \h'24p'\-t 66p
+ Disable use of the \f2termcap/terminfo\f1 \f3ti/te\f1 capabilities.
+ Many terminal emulators require it (not the least of which is the
+ OpenLook \f2cmdtool\f1).
+ Some terminal emulators clear the screen on \f3te\f1 (some \f2xterm\f1s).
+ See also the \f3usetite\f1 variable, described under \f3Boolean
+ Variables\f1 in section 2.
+
+ .lp \h'24p'\-z 66p
+ This causes Elm not to start if you don't
+ have any mail, but instead to display the message \*QYou have no
+ mail.\*U This emulates the behavior of programs
+ like \f2Berkeley Mail\f1.
+
+ .in 0
+ All the above options default to reasonable values, so there is
+ usually no need to use them. Furthermore, the most used options
+ are available through the \f2.elm/elmrc\f1 file, described in section 2.
+ .br
+ .ne 5
+ .sp
+ .hn 1 Multi-Media Capabilities of Elm
+
+ Elm optionally provides you with some Multi-Media features, which
+ are compliant
+ to the MIME (Multipurpose Internet Mail Extension) IETF draft.
+
+ If the support is compiled into Elm, on the receiving side
+ Elm accesses Metamail from Nathaniel Borenstein of
+ Bellcore. If you receive a MIME compliant message, Elm calls
+ Metamail automatically to display the message. Metamail
+ asks you if you want to display each part of the message
+ and uses the display programs available at your site. This
+ is controlled through the \f2mailcap\f1 file.
+
+ On the sending side, there is a simple mechanism integrated in Elm
+ to compose MIME compliant messages. If you have one or more key lines
+ of the form
+
+ .ft CW
+ .zf
+ .ti .5i
+ [\&include \f2file contenttype/subtype encoding\f1]
+ .ft 1
+
+ in the message body, at each
+ of these key lines, a file is included, and becomes a part
+ of the message. The text lines before, between and after the \f2include\f1
+ lines go into extra message parts of type \f2text\f1.
+
+ As an example, say you want to include the file \f2foo.gif\f1 into your message,
+ which is a GIF image, and you want to use \f2base64\f1 encoding, use the
+ following line:
+
+ .ft CW
+ .zf
+ .ti .5i
+ [\&include foo.gif image/gif base64]
+ .ft 1
+
+ Or you want to include a text file which contains plain ASCII:
+
+ .ft CW
+ .zf
+ .ti .5i
+ [\&include foo.txt text/plain]
+ .ft 1
+
+ The \f2encoding\f1 parameter is optional and the default is \f27bit\f1.
+
+ Refer to RFC1341 for valid \f2contenttype/subtype\f1 and \f2encoding\f1
+ parameter values.
+ .br
+ .ne 5
+ .sp
+ .hn 1 Special Outgoing Mail Processing
+
+ There are a few extra features that Elm offers on
+ outgoing mail that are worthy of mention.
+
+ The first, and probably the most exciting feature,\s-2\u3\d\s0 is the
+ .fn
+ 3. Unfortunately, at many non-US sites, it's quite probable that
+ you won't be able to use this feature since you won't have
+ the \f2crypt()\f1 library available due to licensing restrictions.
+ .ef
+ ability to send \f2encrypted\f1 mail! To do this is
+ extremely simple: you need merely to have two key lines
+
+ .ft CW
+ .zf
+ .ti .5i
+ [\&encode]
+ .ft 1
+ .br
+ and
+ .ft CW
+ .zf
+ .ti .5i
+ [\&clear]
+ .ft 1
+
+ in the message body.
+
+ .ne 15
+ Consider the following outgoing message:
+ .sp
+ .nf
+ .ps 9
+ .in .5i
+ .ft CW
+ .zf
+ Joe,
+ Remember that talk we had about Amy? Well, I talked to my manager
+ about it and he said...
+ uhh...better encrypt this...the usual \`key\'...
+ [\&encode]
+ He said that Amy was having family problems and that it had been
+ affecting her work.
+ Given this, I went and talked to her, and told her I was sorry for
+ getting angry. She said that she understood.
+ We\'re friends again!!
+ [\&clear]
+ Exciting stuff, eh?
+ \h'3i'Mike
+ .ps 10
+ .ft 1
+ .in 0
+ .fi
+ .sp
+ While this is obviously quite readable while being typed into
+ the editor, as soon as the message is confirmed as wanting
+ to be sent, the Elm mailer prompts with:
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .ps 9
+ .ti .5i
+ Enter encryption key: @
+ .ps 10
+ .ft 1
+ .fi
+ .sp
+ and accepts a key (a series of 8 or less characters) without
+ echoing them to the screen. After entry, it will ask for the
+ same key again to confirm it, then *\f2poof\f1* it will encrypt and
+ send the mail.
+
+ If you have the \f3copy\f1 option enabled, the program will save
+ your copy of the message encrypted too. (This is to ensure
+ the privacy and security of your mail archive, too.)
+
+ If the mailer doesn't ask for the encryption key, it's because
+ you don't have the \f2[\&encode]\f1 entered as the first 8 characters
+ of the line. It MUST be so for this to work!!
+
+ On the other end, a person receiving this mail (they must also
+ be using Elm to receive it, since this mailer has a
+ unique encryption program) will be reading the
+ message and then suddenly be prompted:
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .ps 9
+ .ti .5i
+ Enter decryption key: @
+ .ft 1
+ .ps 10
+ .fi
+ .sp
+ and will again be asked to re-enter it to confirm.
+ The program will then on-the-fly decrypt the mail
+ and display each line as it is decoded. The \f2[\&clear]\f1
+ line signifies that the block to encrypt is done.
+
+ Note that it is not possible currently to \f3pipe\f1 or \f3print\f1
+ encrypted mail.
+ .sp 2
+ The other feature on outgoing mail is the ability to
+ specify what section of the message you want to have
+ archived (assuming \f3copy\f1 is enabled) and what section
+ you don't. This is most useful for sending out source
+ file listings and so on.
+
+ To indicate the end of the section that should be
+ saved in the archive, you need merely to have the key line
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .ti .5i
+ [\&nosave]
+ .ft 1
+ or
+ .ft CW
+ .zf
+ .ti .5i
+ [\&no save]
+ .ft 1
+ .fi
+ .sp
+ appear by itself on a line. This key line is removed from
+ the outgoing mail, and indicates the last line of
+ the message to be saved.
+ Other than this, the saved mail is identical to the outgoing mail.
+ .br
+ .ne 5
+ .sp
+ .hn 1 Customized header lines
+
+ The mailer provides a facility for including customized
+ header lines in the messages you send.
+ If you have an \f2.elm/elmheaders\f1 file,
+ the mailer will include its contents
+ immediately after the regular headers of all outbound mail.
+ The mailer supports use of the backquote convention in this file
+ to run commands and substitute the commands' output for the backquoted
+ text.
+ Here's a typical \f2.elm/elmheaders\f1 file:
+ .sp
+ .ft CW
+ .zf
+ .nf
+ Organization: Hewlett-Packard Laboratories
+ Phone: (415)-555-1234
+ Operating-System: \`uname -srv\`
+ .fi
+ .ft 1
+ .sp
+ These lines will be inserted after all other header lines in the message.
+ .br
+ .ne 5
+ .sp
+ .hn 1 Commands
+ .sp
+
+ This section discusses each command in the Elm
+ program in more detail than above, including the
+ prompts the user can expect upon executing the
+ command, the meaning of different options, etc.
+
+ .lp \h'24p'? 66p
+ Help. This command used once puts you in the \f2help\f1
+ mode, where any key you press results in a one-line description
+ of the key. Pressing \*q?\*u again at this point produces a
+ summary listing each command available.
+ Pressing \*q.\*u (period) leaves the help mode and returns you to the
+ command level.
+
+ .lp \h'24p'<space> 66p
+ Display the current message.
+ <space> is useful for reading through a mail folder.
+ When issued from the index screen,
+ it displays the first screen of the current message.
+ When issued while in the builtin pager,
+ it pages through the message to the end.
+ When issued at the end of a message
+ (with either the builtin pager or an external pager),
+ it displays the first screen of the next message not marked for deletion.
+
+ .lp \h'24p'<return> 66p
+ Display the current message.
+ <return> behaves somewhat differently from <space>.
+ When issued while in the builtin pager,
+ it scrolls the current message forward one line,
+ and then when issued at the end of a message
+ (with either the builtin pager or an external pager),
+ it redisplays the first screen of the the \f2current\fP message.
+ The latter is useful in case you have issued a non-pager
+ command while in the builtin pager and want to restart the display
+ of the current message.
+
+ .lp \h'24p'! 66p
+ Shell. This allows you to send a command to the shell without
+ leaving the program. Note that it is possible that the person who
+ installed Elm on your system disabled this feature.
+
+ .lp \h'24p'| 66p
+ Pipe. This command allows you to pipe the current message
+ or the set of \f2tagged\f1 messages
+ through other filters as you desire. The shell used for
+ the entire command is either the one specified in
+ your \f2.elm/elmrc\f1 file, or the default shell (see the \f3shell\f1
+ variable under \f3String Variables\f1 in section 2).
+
+ .lp \h'24p'\/ 66p
+ Pattern match. This command, at the command level, allows the
+ user to search through all the \f2from\f1 and \f2subject\f1 lines of
+ the current folder starting at the current message and
+ continuing through the end. If the first character of the
+ pattern is a \*q/\*u, then Elm tries to match the
+ specified pattern against \f2any\f1 line in the folder. Again,
+ this works from the current message through the
+ end. Both searches are case insensitive.
+
+ .lp "\h'24p'\- or <left>" 66p
+ Display the previous page of the message index.
+
+ .lp "\h'24p'+ or <right>" 66p
+ Display the next page of the message index.
+
+ .lp \h'24p'<number><return> 66p
+ Specify new current message. When you type in any digit, Elm
+ prompts \*QSet current to : \f2n\f1\*U, where \f2n\f1 is
+ the digit entered. Continue entering the full number
+ and terminate with <return>. Note that changing the
+ current message to a message not on the
+ current page of headers results in a new page
+ being displayed.
+
+ .lp \h'24p'< 66p
+ Scan message for calendar entries. A rather novel feature of
+ the Elm mailer is the ability to automatically incorporate
+ calendar/agenda information from a mail message into the user's
+ calendar file. This is done quite simply; any line that has
+ the pattern
+
+ .ti +.5i
+ \-> \f2calendar entry\f1
+
+ is automatically added to the user's \f3calendar\f1 file
+ when the \*q<\*u command is used
+ (see the \f3calendar\f1 variable under \f3String Variables\f1 in section 2).
+ .sp
+ For example, let's say we had a message with the text:
+
+ .ft CW
+ .zf
+ .ps 9
+ .ti +.5i
+ Regardless of that meeting, here\'s the seminar stuff:
+ .br
+ .ti +.5i
+ \-> 8/03 3:00pm: AI Seminar with Ira Goldstein of HP Labs
+ .ft 1
+ .ps 10
+
+ then using the \*q<\*u command would add the line:
+
+ .ft CW
+ .zf
+ .ps 9
+ .ti +.5i
+ 8/03 3:00pm: AI Seminar with Ira Goldstein of HP Labs
+ .ps 10
+ .ft 1
+
+ to the user's \f3calendar\f1 file.
+
+ .lp \h'24p'a 66p
+ Alias. The alias system is a way by which more complex mail addresses
+ can be shortened for the mail user. For example:
+ .sp
+ .nf
+ .ps 9
+ .ft CW
+ .zf
+ .ti +.5i
+ joe, bleu = Joe Bleu = j...@hpfcla.SSO.HP.COM
+ .ft 1
+ .ps 10
+ .fi
+ .sp
+ which allows mail to \*Qjoe\*U or \*Qbleu\*U with the system expanding
+ the address properly. Obviously, this saves having to remember
+ complex addresses. A more detailed discussion can
+ be found in either the section entitled \f2The Alias System\f1 in
+ this document or \f2The Elm Alias System Users Guide\f1.
+
+ .lp \h'24p'b 66p
+ Bounce mail. This \*Qremails\*U mail to someone else in such a
+ way as to make the return address the original sender rather
+ than you. The \f3forward\f1 command is similar, but it makes
+ the return address \f2you\f1 rather than the original sender.
+
+ .lp \h'24p'C 66p
+ Copy to folder. This command copies the current message or set of
+ tagged messages to
+ a folder. If there is anything in the folder currently the
+ message is appended to the end, otherwise the folder is created
+ containing only the newly copied messages. The prompt for this command
+ is \*QCopy to folder: \*U. A response of <return> cancels the command
+ and returns the user to the command prompt. The usual filename
+ metacharacters are available, too. That is, this command expands filenames
+ with \*q~\*u (tilde) to your home directory and \*q=\*u to your
+ \f3maildir\f1 directory, if defined. This command also allows you to
+ use \*q>\*u for your \f3receivedmail\f1 folder,
+ \*q<\*u for your \f3sentmail\f1 folder,
+ \*q.\*u for the last folder you saved or copied a message to
+ and \*Q@alias\*U for the default folder for \*Qalias\*U.
+ If you use a shell wildcard in the file or folder name, you are
+ given a list of all files or folders which match the wildcard.
+ Elm uses your shell to find the names, so whatever wildcards you are
+ used to will work.
+ Finally, you can also enter \*q?\*u at the prompt
+ to get detailed help.
+
+ .lp \h'24p'c 66p
+ Change folder. Specifying this command allows the user to change
+ the folder that is currently being read. This is intended
+ for perusal and reply to previously archived messages.
+ The prompt is \*QName of new folder: \*U and entering <return>
+ cancels the operation, while entering a filename causes the program
+ to read that file as the new folder,
+ if possible. This command expands filenames
+ with \*q~\*u (tilde) to your home directory and \*q=\*u to your
+ \f3maildir\f1 directory, if defined. This command also allows you to
+ use \*q!\*u as an abbreviation for you incoming mailbox,
+ \*q>\*u for your \f3receivedmail\f1 folder,
+ \*q<\*u for your \f3sentmail\f1 folder,
+ \*q.\*u for the last folder you saved or copied a message to
+ and \*Q@alias\*U for the default folder for \*Qalias\*U.
+ If you use a shell wildcard in the file or folder name, you are
+ given a list of all files or folders which match the wildcard.
+ Elm uses your shell to find the names, so whatever wildcards you are
+ used to will work.
+ Finally, you can also enter \*q?\*u at the prompt
+ to get detailed help.
+
+ .lp "\h'24p'd, u" 66p
+ Delete and undelete. Neither of these two commands have any prompts
+ and indicate their action by either adding a \*qD\*u to the current
+ message index entry (indicating deletion pending) or removing
+ the \*qD\*u (indicating that the message isn't set for deletion).
+
+ .lp \h'24p'<control>-D 66p
+ This command allows you to easily mark for deletion all messages
+ that have a specific pattern. After \f3<control>-D\f1 is pressed,
+ Elm prompts for the string to match in
+ either the \f2from\f1 or \f2subject\f1 lines of
+ the messages.
+
+ .lp \h'24p'<control>-U 66p
+ This is the direct opposite command to the \f3<control>-D\f1 command
+ \(em all messages
+ that match the specified pattern have any mark for deletion
+ removed by this command.
+
+ .lp \h'24p'e 66p
+ Edit mailbox. This allows you to modify the current mail file at
+ a single keystroke. This is mostly useful for editing messages
+ before saving them. Modifying headers should be done with extreme
+ caution, as they contain routing information and other vital stuff
+ for full functionality. This command may be disabled by whoever
+ configured your Elm installation.
+
+ .lp \h'24p'f 66p
+ Forward. Allows the user to forward the current message to another user.
+ This copies the message into the edit buffer and allows the user to add
+ their own message too. The prompt is \*QForward to:\*U and will expand an alias
+ if entered. See also \f3bounce\f1, above.
+
+ Elm will ask you if you want to edit the message before sending it. If you
+ answer \f2yes\f1, Elm will prepend your prefix string to each line of the
+ message, and let you edit the result. If you do not want the prefix string
+ on each line, answer \f2no\f1; you will have another chance to edit the message
+ when you get to the \*Qsend\*U menu. See the \f3prefix\f1 variable
+ under \f3String Variables\f1 in section 2.
+
+ .lp \h'24p'g 66p
+ Group reply. Identical to \f3reply\f1 below, except that the
+ response is mailed to \f2all recipients\f1 of the original
+ message except yourself. See the \f3alternatives\f1
+ variable under \f3String Variables\f1 in section 2.
+
+ .lp \h'24p'h 66p
+ Display the current message with all headers intact.
+ When you display a message with other commands,
+ certain header lines are formatted and others discarded according
+ to the \f3weedlist\fP variable, described under \f3String
+ Variables\f1 in section 2.
+
+ .lp \h'24p'i 66p
+ Return to the index screen,
+ when issued in the builtin pager or at the end of a message with
+ either the builtin pager or an external pager.
+
+ .lp "\h'24p'j or <down>, k or <up>" 66p
+ These four keys work similarly to what they would do in \f2vi\f1 or
+ any of the other (precious few) screen oriented
+ programs. The \f3j\f1 and \f3<down>\f1 keys move
+ the current message pointer down to the next message skipping
+ over any marked deleted (going to
+ the next page if necessary) and the \f3k\f1 and \f3<up>\f1 keys move
+ the current
+ message pointer back to the previous message skipping
+ over any marked deleted (also changing pages if necessary).
+
+ .lp "\h'24p'J, K" 66p
+ These two keys work similarly to their lower case counterparts,
+ except that they don't skip over deleted messages.
+
+ .lp \h'24p'l 66p
+ Limit. This feature allows you to specify a subset of the existing
+ messages to be dealt with. For example, let's say we had a folder with
+ four hundred messages in it, with only four or five different subjects. We
+ could then limit what we're dealing with by using the \f3limit\f1
+ command. Pressing \f3l\f1 would result in the prompt:
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .ti +.5i
+ Criteria:
+ .ft 1
+ .fi
+ .sp
+ to which we could answer
+ \*Qsubject \f2string\f1\*U,
+ \*Qfrom \f2string\f1\*U or
+ \*Qto \f2string\f1\*U. In our example, we could use
+ \*Qsubject programming\*U
+ as a criterion for selection. Once we've limited our selections,
+ the screen is rewritten with just the selected messages
+ and the top line changes to have a message like:
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .ps 9
+ .tl ''\0\0\0\0\0Folder is "=elm" with 92 shown out of 124 [Elm 2.4]''
+ .ps 10
+ .ft 1
+ .fi
+ .sp
+ We can further limit selections by using the \f3limit\f1 option
+ repeatedly to enter further criteria.
+
+ To clear all the criteria and get back to the \*Qregular\*U display, simply
+ enter \*Qall\*U as the limiting criteria. It should be noted that the
+ selection based on \*Qto\*U isn't fully implemented for this version, so
+ it is recommended that users stay with \*Qsubject\*U and \*Qfrom\*U as the
+ basis for their criteria.
+
+ .lp \h'24p'm 66p
+ Mail. Send mail to a specified user. The prompt associated
+ with this command is \*QSend mail to: \*U. Entering an alias name results
+ in the full address being rewritten in parenthesis immediately. This
+ prompt is followed by \*QSubject: \*U which allows the user to title their
+ note. The final prompt is \*QCopies to: \*U, which allows other people
+ specified to receive \*Qcarbon copies\*U of the message, but see the
+ \f3askcc\f1 variable under \f3Boolean Variables\f1 in section 2. Upon
+ entering all three items the
+ editor is invoked and the message can be composed.
+
+ .lp \h'24p'n 66p
+ Next message that is not marked for deletion.
+ Useful for displaying successive messages in a folder.
+ When issued from the index screen, it displays the current message,
+ and when issued while in the builtin pager or at the end of a message
+ (with either the builtin pager or an external pager),
+ it displays the first screen of the next message not marked for deletion.
+
+ .lp \h'24p'o 66p
+ Options. This full-screen display allows you to alter the settings
+ of a number of parameters, including the current sorting method,
+ the method of printing files, the calendar file, the save file, and
+ so on. It's self-documenting (where have you heard \f2that\f1
+ before?) so isn't explained in too much detail here. See the
+ \f3configoptions\f1 variable under \f3String Variables\f1 in section 2.
+
+ .lp \h'24p'p 66p
+ Print. This allows you to print out the current
+ message or the tagged messages to a previously defined printer. See
+ the \f3print\f1 variable under \f3String Variables\f1 in section 2.
+
+ .lp \h'24p'q 66p
+ Quit. If you in the pager, you are returned to the index screen. If you are
+ at the index screen, Elm quits altogether. However, if you have the
+ \f3ask\fP variable set ON, Elm first prompts you for the disposition of the
+ messages in the current folder. If any messages are marked for deletion, it
+ asks if you want them deleted. If the current folder is your incoming
+ mailbox, you are also asked if read messages should be stored in your
+ \f3receivedmail\f1 folder,
+ and if unread messages should be kept in the incoming mailbox.
+ The default answers to these questions are set by the \f2.elm/elmrc\f1
+ variables \f3alwaysdelete\f1, \f3alwaysstore\f1, and \f3alwayskeep\f1
+ (see \f3Boolean Variables\f1 in section 2).
+ However, if you elect to not store your read messages (i.e. keep them)
+ it is presumed you want to keep your unread messages, too.
+
+ .lp \h'24p'Q 66p
+ Quick quit. This behaves similar to the \f3quit\f1 command except that
+ you are never prompted for answers to the message disposition questions.
+ Elm disposes of messages according to the values you
+ have set for \f3alwaysdelete\f1, \f3alwaysstore\f1, and \f3alwayskeep\f1
+ in your \f2.elm/elmrc\f1 file (see \f3Boolean Variables\f1 in section 2).
+
+ .lp \h'24p'r 66p
+ Reply. Reply to the sender of the current message. If
+ the \f3autocopy\f1 variable is set to OFF in your \f2.elm/elmrc\f1 file,
+ Elm prompts \*QCopy message? (y/n)\*U, to which you can specify
+ whether or not a copy of the source message is to be copied into the edit
+ buffer. If copied in, all lines from the message are
+ prepended with the \f3prefix\f1 character sequence specified in
+ your \f2.elm/elmrc\f1 file (see \f3String Variables\f1 in section 2).
+
+ .lp \h'24p's 66p
+ Save to folder. This command is like the \f3copy\f1 command, except
+ that the saved messages are marked for deletion and, if you are
+ saving just the current message, the current message pointer is
+ incremented afterwards (see the \f3resolve\f1 variable under \f3Boolean
+ Variables\f1 in section 2). This command expands folder names
+ with \*q~\*u (tilde) to your home directory and \*q=\*u to your
+ \f3maildir\f1 directory, if defined. This command also allows you to
+ use \*q>\*u for your \f3receivedmail\f1 folder,
+ \*q<\*u for your \f3sentmail\f1 folder (see \f3String Variables\f1 in
+ section 2),
+ \*q.\*u (period) for the last folder you saved or copied a message to
+ and \*Q@alias\*U for the default folder for \*Qalias\*U.
+
+ .lp \h'24p't 66p
+ Tag.
+ .fn
+ 4. Currently only \f3copy\f1, \f3pipe\f1, \f3print\f1, and \f3save\f1
+ support this.
+ .ef
+ Tag the current message for a later operation.\s-2\u4\d\s0
+
+ .lp \h'24p'T 66p
+ Tag and move to next undeleted message.
+ This command is like the `Tag' command but also increments the current message
+ pointer to the next undeleted message.
+
+ .lp \h'24p'<control>-T 66p
+ Tag all messages containing the specified pattern. Since \f2tagging\f1
+ messages can occur on screens other than the one being viewed,
+ Elm first checks to see if any messages are currently
+ \f2tagged\f1 and ask you if you'd like to remove those tags. After
+ that, it will, similar to the \f3<control>-D\f1 command, prompt for
+ a pattern to match and then mark all messages that contain
+ the (case insensitive) pattern in either the \f2from\f1 or \f2subject\f1
+ lines.
+
+ .lp \h'24p'x 66p
+ Exit. This leaves Elm and discards any changes to the mailbox.
+ If changes are pending (such as messages marked for deletion) you are
+ asked to confirm discarding the changes. If confirmed, no
+ messages are deleted and the status of all messages is unchanged. That is,
+ any messages that were new will remain new instead of being noted as old,
+ and any messages that were read for the first time
+ will be again noted as unread.
+
+ .lp \h'24p'X 66p
+ Exit immediately. This leaves Elm in the quickest possible manner
+ without even prompting about discarding the changes to the mailbox.
+ No messages are deleted and the status of all messages is unchanged. That is,
+ any messages that were new will remain new instead of being noted as old,
+ and any messages that were read for the first time
+ will be again noted as unread.
+
+ .in 0
+ .sp
+ When you are about to send a message with the \f3forward\f1, \f3mail\f1,
+ or \f3reply\f1 commands (see above), a small menu of the following
+ options appears:
+
+ .lp \h'24p'c 66p
+ Specify the folder for saving a copy of the message.
+ This allows you to override the
+ \f3copy\f1, \f3forcename\f1 and \f3savename\f1 variables
+ from your \f2.elm/elmrc\f1 file (see \f3Boolean Variables\f1 in
+ section 2). It prompts you for the name
+ of the folder where a copy of the outgoing message is to be saved. The
+ default displayed is taken from those three \f2.elm/elmrc\f1
+ options and can be changed. This command also allows you to
+ use \*q>\*u for your \f3receivedmail\f1 folder
+ and \*q<\*u for your \f3sentmail\f1 folder (see \f3String Variables\f1
+ in section 2),
+ and \*q=?\*u to mean \*Qconditionally save by name\*U
+ and \*q=\*u to mean \*Qunconditionally save by name\*U.
+ Since you could next enter
+ the \f3edit headers\f1 command and change the recipients
+ of your message, the name of the folder under the
+ two \*Qsave by name\*U options is not established until you enter the \f3send\f1
+ command.
+ If you use a shell wildcard in the file or folder name, you are
+ given a list of all files or folders which match the wildcard.
+ Elm uses your shell to find the names, so whatever wildcards you are
+ used to will work.
+ You can also enter \*q?\*u at the prompt
+ to get help about saving.
+
+ .lp \h'24p'e 66p
+ Edit message (or form). Entering this command allows you to edit
+ the text of your message or form.
+
+ .lp \h'24p'f 66p
+ Forget. This gets you out of sending a message you started. If you are
+ in send-only mode, the message is saved to the file \f2Canceled.mail\f1
+ in your home directory. Otherwise
+ it can be restored at the next \f3forward\f1, \f3mail\f1,
+ or \f3reply\f1 command during the current session of Elm After
+ issuing one of those commands you will be prompted with \*QRecall last
+ kept message?\*U
+
+ .lp \h'24p'h 66p
+ Edit headers. This puts you into the \f2header editing mode\f1, whereby
+ you can edit any of the various headers of your message. Like
+ the options screen, it's self-documenting, so it isn't explained in too much
+ detail here.
+
+ .lp \h'24p'i 66p
+ Run \f2ispell\f1 (or some other configured spelling correction program).
+ The outgoing message is run through an interactive spelling correction program
+ if one is available. The default spelling program is the GNU \f2ispell\f1 program
+ unless changed by the person who installed Elm on your system.
+
+ .lp \h'24p'm 66p
+ Make form. This converts the message you have edited into a form. See
+ the \f3forms\f1 variable under \f3Boolean Variables\f1 in section 2 and
+ \f2The Elm Forms Mode Guide\f1 for more details.
+
+ .lp \h'24p's 66p
+ Send. This sends the message as is without any further ado.
+ .in 0
+ .br
+ .ne 5
+ .sp
+ .hn 1 "Using Elm with \*Qeditor = none\*U"
+ .sp
+ The Elm program also supports a builtin editor for simple message
+ composition that is very (very) similar to the simple line
+ editor available from the \f2Berkeley Mail\f1 system.
+
+ To access it, you need merely to specify \*Q\f3editor=none\f1\*U in
+ your \f2.elm/elmrc\f1 file.
+ With that, any messages to be composed
+ that don't already have text in the buffer (e.g. no reply with
+ the text included, etc.), will use this editor.
+ .sp
+ From the builtin editor, the following options are available for use.
+ Each command here is prefixed with a \*q~\*u (tilde).
+ You can specify a different \*Qescape\*U character in your \f2.elm/elmrc\f1 file,
+ if you desire (see the \f3escape\f1 variable under \f3String
+ Variables\f1 in section 2).
+ .sp
+
+ .lp \h'16p'~? .5i
+ Print a brief help menu.
+
+ .lp \h'16p'~b .5i
+ Change the Blind-Carbon-Copy list.
+
+ .lp \h'16p'~c .5i
+ Change the Carbon-Copy list.
+
+ .lp \h'16p'~e .5i
+ Invoke the \f3easyeditor\f1 editor on the message, if possible
+ (see the \f3easyeditor\f1 variable under \f3String Variables\f1 in
+ section 2).
+
+ .lp \h'16p'~f .5i
+ Add the specified message or current message.
+
+ .lp \h'16p'~h .5i
+ Change all the available headers (To, Cc, Bcc, and Subject).
+
+ .lp \h'16p'~m .5i
+ Same as \f3~f\f1, but with the current \f3prefix\f1 (see the
+ \f3prefix\f1 variable under \f3String Variables\f1 in section 2).
+
+ .lp \h'16p'~o .5i
+ Invoke a user specified editor on the message.
+
+ .lp \h'16p'~p .5i
+ Print out, on the screen, the message as typed in so far.
+
+ .lp \h'16p'~r .5i
+ Include (read in) the contents of the specified file.
+
+ .lp \h'16p'~s .5i
+ Change the Subject line.
+
+ .lp \h'16p'~t .5i
+ Change the To list.
+
+ .lp \h'16p'~v .5i
+ Invoke the \f2vi\f1 visual editor on the message.
+
+ .lp \h'16p'~< .5i
+ Execute the specified
+ .ux
+ command, entering the output
+ of the command into the editor buffer upon completion.
+ For example, \*Q~< who\*U includes the output of
+ the \f2who\f1 command in your message.
+
+ .lp \h'16p'~! .5i
+ Execute a
+ .ux
+ command if one is given (as in \*Q~!ls\*U) or
+ give the user a shell, either from the \f3shell\f1 variable setting in
+ the \f2.elm/elmrc\f1 file or the default (see the \f3shell\f1 variable
+ under \f3String Variables\f1 in section 2).
+
+ .lp \h'16p'~~ .5i
+ Add a line prefixed by a single \*q~\*u character.
+ .in 0
+ .sp
+ A useful note is that the \f3~f\f1 and \f3~m\f1 commands invoke the \f2readmsg\f1
+ command, so you can pass parameters along too. For example, if we
+ wanted to include a message from Joe, without any headers, but with each
+ line prefixed, we could use:
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .ti .5i
+ \&~m \-n Joe
+ .ft 1
+ .fi
+ .sp
+ to accomplish the task.
+
+ To learn more about how they work, try 'em!
+ .br
+ .ne 5
+ .sp
+ .hn 1 The Alias System
+ .sp
+ As mentioned previously, there exists in the Elm
+ system a set of aliases that associate
+ an arbitrary word (such as a persons name) to a complex address or group.
+ The advantages are readily apparent; rather than
+ remembering an address of the form:
+ .sp
+ .nf
+ .ps 9
+ .ft CW
+ .zf
+ .ti .5i
+ host1!host2! ... !hostN!user
+ .ft 1
+ .ps 10
+ .fi
+ .sp
+ the user merely has to remember a single word.
+
+ Two alias tables are available for a each
+ user within Elm,
+ namely the system alias file and the user's alias file. The
+ system alias file is created and maintained (by the system administrator)
+ by editing the file name defined for \f2SYSTEM_ALIASES\f1 in the
+ \f2sysdefs.h\f1 file (see \f2The Elm Configuration Guide\f1) and as described
+ in the documentation with the \f2newalias\f1 command,
+ then running the \f2newalias\f1 program.
+
+ An individual user can also have an alias file which works
+ in conjunction with the system aliases. To do this, one
+ merely needs to enter the alias menu system and create aliases with
+ the \f3a\f1 (\f3alias current message\f1) or \f3n\f1
+ (\f3make new alias\f1) commands.
+ Alternatively, the user can peruse the documentation for the \f2newalias\f1
+ command and create a file as indicated therein. After
+ executing the program, the aliases are available
+ for use from within Elm.
+ .sp
+ Please refer to \f2The Elm Alias Users Guide\f1 for complete details.
+ .sp 2
+ Within Elm,
+ however, the alias system acts as an entirely different program, with
+ its own display, own commands, and own mini-menu. The aliases are
+ presented in a
+ list similar to the index screen with the following menu:
+ .sp
+ .sd
+ .nf
+ .ps 9
+ .ft CW
+ .zf
+ .ce 3
+ Alias commands: ?=help, <n>=set current to n, /=search pattern
+ a)lias current message, c)hange, d)elete, e)dit aliases.text, f)ully expand,
+ l)imit display, m)ail, n)ew alias, r)eturn, t)ag, u)ndelete, or e(x)it
+ .sp
+ Alias: @
+ .sp
+ .ps 10
+ .ft 1
+ .ed
+ .fi
+
+ The commands are:
+
+ .lp \h'16p'? .5i
+ Help. This command used once puts you in the \f2help\f1
+ mode, where any key you press will result in a one-line description
+ of the key. Pressing \*q?\*u again at this point produces a
+ summary listing each command available.
+ Pressing \*q.\*u (period) leaves the help mode and returns you to the
+ alias command prompt.
+
+ .lp "\h'16p'<space> or <return> or v" .5i
+ Display the current alias address. The alias address is displayed below
+ the alias menu. This command allows you to verify the address for a
+ person or the contents of a group alias.
+
+ .lp \h'16p'$ .5i
+ Resynchronize the alias text file (\f2$HOME/.elm/aliases.text\f1) and
+ alias database by rebuilding the database from the text file by running
+ \f2newalias\f1. Aliases marked for deletion are removed, tagged aliases
+ are untagged, and new and changed aliases are recognized. The alias
+ screen is updated to reflect these changes.
+
+ .lp \h'16p'\/ .5i
+ Pattern match. This command allows the
+ user to search through all the \f2alias\f1 and \f2username\f1
+ entries in the alias list
+ starting at the current alias and
+ continuing through the end.
+ If the first character of the
+ pattern is a \*q/\*u, then Elm also includes the \f2comment\f1
+ and the fully expanded \f2address\f1 fields in the search.
+ The search is case insensitive. This allows the user to find a
+ specific alias in the situation where there are a large number of
+ aliases.
+
+ .lp \h'16p'a .5i
+ Alias current message.
+ This allows the user to create an alias that has the
+ return address of the current message as the address field of
+ the alias. It prompts for a unique alias name. If the alias
+ name is not unique, you will be asked if you wish to replace
+ the existing alias. For further
+ information, please see \f2The Elm Alias System Users Guide\f1.
+
+ .lp \h'16p'c .5i
+ Change current alias. This will prompt for changes to the current
+ names and address. If other aliases are tagged you will be asked if you
+ want to create a group alias from the tagged aliases. The original
+ alias is replaced with the new information in
+ your individual alias file (\f2$HOME/.elm/aliases.text\f1) and
+ then added to the database (at the next alias resync). Aliases
+ that have been changed are marked with an \*qN\*u (for new) until
+ the database is updated.
+
+ .lp "\h'16p'd, u" .5i
+ Delete or undelete an alias.
+ This allows the user to mark an alias for deletion in the same fashion
+ as on the index screen. The deletions are not
+ actually made until the user returns to the main menu with the \f3r\f1,
+ \f3q\f1, or \f3i\f1 commands or resyncs
+ the display with the \f3$\f1 command. Deletions on system aliases are not
+ allowed. These commands (plus the \f3<control>-D\f1
+ and \f3<control>-U\f1 versions) behave identically to their index screen
+ counterparts (see section 7, \f3Commands\f1).
+
+ .lp \h'16p'e .5i
+ Edit the \f2.elm/aliases.text\f1 file. The user alias file is edited
+ using the editor defined in the \f3editor\f1 variable in your
+ \f2\&.elm/elmrc\f1 file (see \f3String Variables\f1 in section 2).
+ \f2newalias\f1 is run after the edit.
+
+ .lp \h'16p'f .5i
+ Display fully expanded alias. The currently selected
+ alias is fully expanded and displayed to the user. This is most useful when
+ working with group aliases.
+
+ .lp \h'16p'l .5i
+ Limit the display. You can limit the display by alias type (person/group
+ or user/system) or by search pattern on name or alias. Otherwise, this
+ works exactly like the limit command on the index screen.
+
+ .lp \h'16p'm .5i
+ Send mail to the current alias. The user is prompted to compose a new
+ mail message to be sent to the
+ person or group specified by the selected alias. If aliases are
+ tagged the message is mailed to the person(s) and/or group(s)
+ specified by the tagged aliases. Tags are cleared after mailing the
+ message.
+
+ .lp \h'16p'n .5i
+ Make a new user alias. This prompts for a unique alias name and
+ then for an address. If the alias
+ name is not unique, you are asked if you wish to replace
+ the existing alias. If aliases are tagged you are asked if you
+ want to create a group alias from the tagged aliases.
+ The information provided is added
+ to your individual alias file (\f2$HOME/.elm/aliases.text\f1) and
+ then added to the database at the next alias resync.
+
+ .lp "\h'16p'r or q or i" .5i
+ Return. Return to the index screen of the Elm program. Any pending
+ deletions are processed and newalias is run to update the database. New
+ additions are handled at this time as well.
+
+ .lp "\h'16p'R or Q or I" .5i
+ Quick return. This behaves like the \*qr\*u command except that you are never
+ prompted for answers to alias disposition questions.
+ Elm disposes of aliases according to the value
+ set for the \f3alwaysdelete\f1 variable
+ in your \f2.elm/elmrc\f1 file (see \f3Boolean Variables\f1 in
+ section 2).
+
+ .lp \h'16p't .5i
+ Tag.
+ Tag the current alias for a later operation.\s-2\u5\d\s0
+ .fn
+ 5. Currently only \f3mail\f1, \f3change\f1, and \f2n3w alias\f1 support this.
+ .ef
+ This command (plus the \f3<control>-T\f1
+ version) behaves identically to its index screen
+ counterpart (see section 7, \f3Commands\f1).
+
+ .lp \h'16p'x .5i
+ Exit alias menu. Exits the alias menu without processing any
+ deletions. Aliases marked for deletion are unmarked and
+ \f2newalias\f1 is not run, even if alias additions have been made.
+ .in 0
+ .sp
+ Additionally, the movement keys (\*qj\*u, \*qk\*u, \*q+\*u, \*q\-\*u,
+ etc.) work in the same fashion as on the index screen (see section 7,
+ \f3Commands\f1).
+ .br
+ .ne 5
+ .sp
+ .hn 1 Elm and Signals
+
+ Elm can handle several standard
+ .ux
+ \f2signals\fR to do
+ some special processing.
+ Signals are interrupt messages sent from one program to
+ another. No detailed messages are sent, but a properly configured
+ program (such as Elm) can watch for and handle these signals.
+
+ In particular, Elm watches for the following signals
+ and takes these actions:
+ .lp ALRM .5i
+ This is the alarm clock signal or time warning.
+ Elm uses this to wake itself up periodically and check for
+ new mail.
+ .lp HUP .5i
+ This is the hangup notice.
+ It means that the terminal/modem/whatever which you have been using
+ with Elm has become detached from the system where Elm
+ was running.
+ When Elm gets this signal, it aborts all the pending operations
+ and exits, leaving your mailbox unchanged.
+ .lp USR1 .5i
+ This is the first user-defined signal.
+ When Elm gets this signal, it receives any pending mail,
+ performs all the pending operations (deletes), and exits
+ leaving all unread mail marked as new.
+ This is the same as giving both the \f3$\f1 and \f3X\f1 commands.
+ .lp USR2 .5i
+ This is the second user-defined signal.
+ When Elm gets this signal, it receives any pending mail,
+ performs all the pending operations (deletes), and exits,
+ leaving all unread mail marked as old.
+ This is the same as giving both the \f3$\f1 and \f3Q\f1 commands.
+ .in 0
+ .sp
+ You would only use these signals yourself under the most unusual
+ circumstances. For example, suppose you were using \f3Elm\fR
+ to read mail on \f2host_1\fR. You have many messages, most of
+ which have been read and filed (and therefore deleted), or simply
+ deleted. You have not yet resynchronized your mailbox (\f3$\f1
+ command). Now you go to lunch.
+ On your return, you're stopped at the door and told to take care
+ of an emergency. You go to another part of the building, and want
+ to read your mail to see what the emergency is \(em but you can't,
+ because Elm is still running at your desk.
+
+ What you really want is one of the scenarios given in the
+ description of \f2HUP\f1, \f2USR1\f1 or \f2USR2\f1.
+ Use your local \f2ps\f1 command to find out what the \f2process number\f1
+ of your Elm session is. Then give the command
+ .sp
+ .nf
+ .ft CW
+ .zf
+ .ti .5i
+ kill \-\f2XXX process_number\f1
+ .fi
+ .sp
+ where \f2XXX\f1 is either \*QHUP\*U, \*QUSR1\*U or \*QUSR2\*U and
+ \f2process_number\f1 is the process number for your remote Elm session.
+ Your remote session will terminate with the actions noted above.
+ .br
+ .ne 5
+ .sp
+ .hn 1 Expert Mail Users and Debugging the Mailer
+
+ There are some additional facilities available in the Elm
+ mailer for those people who are knowledgeable about
+ mail protocols, or trying to debug/track down a problem.
+
+ The \f3h\f1 (\f3display with headers\f1) command at the command prompt
+ displays the current message ignoring the current
+ setting of the \f3weed\f1 variable (see \f3Boolean Variables\f1 in
+ section 2). This is most useful
+ for answering questions of the form \*QI wonder what
+ this guy put in his header?\*U and such. This command
+ does not show up on the mini-menu because it is somewhat
+ esoteric, but it does appear on the help screen.
+
+ The \f3@\f1 command at the command prompt
+ outputs a screen of debugging information,
+ including the number of lines and
+ offsets of each of the messages in the current mailbox.
+
+ The \f3#\f1 command at the command prompt
+ displays the entire stored \*Qrecord structure\*U for
+ the current message.
+
+ The \f3%\f1 command
+ displays the full computed return address of the
+ current message.
+
+ Starting up Elm with the \f3\-d\f1 (debug) option (see section 3,
+ \f3Command Line Options\f1) creates a file called
+ \f2ELM:debug.info\f1 in your home directory which contains a wealth of useful
+ information (to me, at least!) to aid in tracking down
+ what errors are occurring and why.
+
+ If there are any problems with Elm, please try
+ to recreate the error with the debug option enabled
+ and set to the highest level (11) before sending defect reports my way.
+
+ One final note: all error names reported by the program
+ are documented in the \f2AT&T System V Interface Definition Reference
+ Manual\f1 in \f3errno\f1(2).
Index: elmME+.2.5.alpha1-cvs/2.4/doc/Users.guide
*** /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/2.4/doc/Users.guide 2004-07-03 20:46:54.000000000 +0300
***************
*** 0 ****
--- 1,1102 ----
+ .\" @(#)$Id: Users.guide,v 1.1.2.1 2004/07/03 17:46:54 hurtta Exp $
+ .\"
+ .\" Users guide to the ELM mail system.
+ .\" format with:
+ .\" 'tbl Users.guide | troff tmac.n - > Users.fmtd'
+ .\"
+ .\" Elm is now in the public trust.
+ .\"
+ .\" (C) Copyright 1986,1987 Dave Taylor
+ .\" (C) Copyright 1988-1992 Usenet Community Trust
+ .\"
+ .\"
+ .tm I trust we've run this through "tbl" first...
+ .\" Define the big box macro for troff
+ .de eb
+ .sp -1
+ .nf
+ .ie t \{\
+ \h'-.5n'\L'|\\nau-1'\l'\\n(.lu+1n\(ul'\L'-|\\nau+1'\l'|0u-.5n\(ul'
+ .\}
+ .el \{\
+ \h'-.5n'\l'\\n(.lu+1n'
+ .\}
+ .fi
+ ..
+ .\" Define break line for user interaction displays
+ .de bl
+ .ie t .tl '\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-'''
+ .el .tl '-----------------------------------------------------------------'''
+ ..
+ .po 1i
+ .ds h0
+ .ds h1
+ .ds h2
+ .ds f0
+ .ds f1
+ .ds f2
+ .nr Hy 1
+ .nr Pt 1
+ .nr Pi 0
+ .lg 0
+ .nf
+ .na
+ .rs
+ .za
+ .\" This will keep the nroff version of the title page on one sheet.
+ .if t .sv |2.0i
+ .ce 99
+ .ps 20
+ .ss 18
+ .vs 12
+ \f3The Elm Users Guide\f1
+ .sp 3
+ .ps 12
+ .ss 14
+ .vs 14
+ \f2A painless introduction to electronic mail
+ using the \f3Elm\fP mail system\f1
+ .sp 3
+ The Elm Mail System
+ (Version 2.4)
+ .sp 2
+ Syd Weinstein, Elm Coordinator


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .fi
+ .ad
+ .ps 8
+ .if t .vs 9
+ .sp 4
+ \f3ABSTRACT\f1
+ .ce 0
+ .sp
+ .in +1i
+ .ll -1i
+ While various UNIX utilities have been designed to
+ take advantage of the CRT screen
+ (rather than line-oriented systems)
+ electronic mail systems haven't \*Qcaught the wave\*U.
+ This document
+ presents Elm, a sophisticated
+ full-screen mail system for interactive use.
+ Elm offers all the features of
+ \f2/bin/mail\f1, \f2Berkeley Mail\f1, \f2uumail\f1, \f2NMail\f1 and
+ the AT&T Mail family of UNIX mailers (namely \f2PMX/TERM\f1) in a
+ unified and intuitive fashion.
+ .br
+ .ll +1i
+ .in -1i
+ .sp |9.0i
+ .ce 99
+ .ps 12
+ .ss 14
+ .vs 14
+ \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
+ \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
+ .fi
+ .ad
+ .bp 1
+ .sv 5v
+ .ps 14
+ .ss 12
+ .vs 16
+ \f3Elm Users Guide\f1
+ .ds h0 "Elm Users Guide
+ .ds h1
+ .ds h2 "Version 2.4
+ .ds f0 "October 1, 1992
+ .ds f1
+ .ds f2 "Page %
+ .sp
+ .ps 10
+ .ss 12
+ .vs 12
+ (The Elm Mail System, \*(h2)
+ .sp
+ \*(f0
+ .sp 2
+ Syd Weinstein


+ Datacomp Systems, Inc.
+ 3837 Byron Road
+ Huntingdon Valley, PA 19006-2320

+ .sp
+ email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
+ .sp 2
+ Derived from
+ \*QThe Elm Mail System, Version 2.0\*U
+ by
+ Dave Taylor
+ Intuitive Systems
+ Mountain View, California
+ email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
+ .ce 0
+ .sp 3
+ .hn 1 Introduction
+
+ The
+ .ux
+ operating system was originally written on a small PDP machine,
+ to work with teletypewriters. Consequently, all the original software for
+ the operating system was written with a \*Qtty\*U in mind;
+ with line oriented interfaces, rather than screen oriented.
+
+ Gradually this began to change, and, with the addition of the Berkeley \f2vi\f1
+ visual shell to the \f2ed\f1
+ line editor, the trend began to be brought to the attention of
+ .ux
+ systems designers.
+ And yet, this transition has seemed
+ too subtle for many software engineers,
+ and so precious few
+ .ux
+ programs are available
+ designed to exploit the entire CRT screen.
+
+ Consequently, after becoming more and more disenchanted
+ with the existing electronic mail facilities (\f2binmail\f1
+ and \f2Berkeley Mail\f1)
+ Dave Taylor decided to undertake creating his own system.
+ Once the ball was rolling it became quite
+ difficult not to keep enhancing it, especially as he and
+ the Elm Development Group
+ became more and more familiar with various different mail
+ systems, but the result, we hope, is a solid, unified interface
+ to electronic mail suitable for almost any environment.
+
+ One thing that sets the Elm mail system off from
+ other packages is that it
+ comes with an extensive documentation set, including;
+ \f2The Elm Users Guide\f1, which you're holding,
+ \f2The Elm Reference Guide\f1,
+ \f2The Elm Alias Users Guide\f1,
+ \f2The Elm Filter System Users Guide\f1,
+ \f2The Elm Forms Mode Guide\f1,
+ and \f2The Elm Configuration Guide\f1.
+ The names of each indicate
+ what they discuss (not unreasonably).
+
+ This particular document contains;
+ this introduction, a tutorial session with the mailer, a
+ discussion of non-interactive uses of Elm,
+ a brief foray into the Elm utilities,
+ and finally, credits and references.
+
+ \f2The Elm Reference Guide\f1 contains a
+ much more in-depth discussion of all the possible options
+ available within the Elm environment, including
+ the \f2.elm/elmrc\f1 file,
+ the available outbound mail processing features,
+ a section for expert users, suggestions
+ on debugging strange installations, and
+ many other useful topics.
+
+ \f2The Elm Alias Users Guide\f1 is the place
+ to go to learn about the format of the \f2.elm/aliases.text\f1
+ file and the associated data files, system aliases, and other
+ related topics.
+
+ One of the more innovative features of Elm is
+ the ability to transmit and receive \*Qforms\*U (as
+ defined by the AT&T Mail system). To learn about
+ how to create and reply to forms you should refer
+ to \f2The Elm Forms Mode Guide\f1.
+
+ If you find yourself getting too much mail delivered in
+ your mailbox, you might be a good candidate for the
+ \f2filter\f1 program. To learn more about what
+ this program is and how to use it please
+ consult \f2The Elm Filter System Users Guide\f1.
+
+ Finally, if you're working with the actual source code
+ and are interested in what all the locally configured
+ options are and mean, please see
+ \f2The Elm Configuration Guide\f1. It is
+ strongly suggested that all system administrators
+ and people installing the system print out the
+ local \f2sysdefs.h\f1 file and have it handy while
+ reading the configuration guide.
+
+ The recommended order of learning the Elm
+ system is to skim this guide until you feel
+ confident enough to start up the program. Once
+ that's reached, \f2use it!\f1 Soon you'll find
+ areas that you need to expand into, and you can
+ achieve that by going into the options
+ screen within Elm and changing your
+ user level accordingly.
+ After a while, sit down again and read through this
+ guide. You should have a couple of \*Qaha!\*U intuitive
+ flashes. After another period of time, you're
+ ready to delve into the real power of the system
+ and read the reference guide. The other manuals
+ should be read as the need arises.
+
+ In any case, the system should be usable without reading
+ \f2any\f1 of the documentation!
+
+ Any comments or problems with any of the documentation or the program
+ itself are welcome; if you can't get electronic mail to the Elm
+ Development Group, please feel free instead to drop me a note via the
+ overland mail address in the title page.
+ .br
+ .ne 20
+ .sp
+ .hn 1 The Main System
+
+ Upon entry to the program, the main screen will be
+ displayed as below:
+
+ .\" display start, constant width, remember loc for BOX
+ .ft CW
+ .zf
+ .ps 9
+ .mk a
+ .sp
+ .ce
+ Mailbox is \'/usr/mail/mymail\' with 15 messages [Elm 2.4PL22]
+ .TS
+ r l n l l l l.
+ \-> N 1 Apr 24 Larry Fenske (49) Hello there
+ N 2 Apr 24 jad@hpcnoe (84) Chico? Why go there?
+ E 3 Apr 23 Carl Smith (53) Dinner tonight?
+ NU 4 Apr 18 Don Knuth (354) Your version of TeX...
+ N 5 Apr 18 games (26) Bug in cribbage game
+ A 6 Apr 15 kevin (27) More software requests
+ 7 Apr 13 John Jacobs (194) How can you hate RUSH?
+ U 8 Apr 8 decvax!mouse (68) Re: your Usenet article
+ 9 Apr 6 root (7)
+ O 10 Apr 5 root (13)
+ .TE
+ .sp
+ .ce 3
+ You can use any of the following commands by pressing the first character;
+ d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit
+ To read a message, press <return>. j = move down, k = move up, ? = help
+ Command : @
+ .sp
+ .\" draw box, proportional Roman font back, display end
+ .eb
+ .ps 10
+ .ft 1
+
+ There are a number of things to notice about this, the main screen;
+
+ .lp \h'12p'\(bu 20p
+ Most likely, on your computer the message currently \*Qactive\*U will be
+ displayed in an inverse bar rather than being delimited by the two
+ character arrow as here. It's nothing to worry about; displaying
+ inverse video is just quite difficult on printable guides!
+
+ .lp \h'12p'\(bu 20p
+ The first line on the screen always displays the name of the current folder,
+ the number of messages in the folder, and the current Elm version number.
+
+ .lp \h'12p'\(bu 20p
+ The arrow (\*Q\->\*U) or inverse video bar will always
+ indicate which is the current message.
+
+ .lp \h'12p'\(bu 20p
+ The first field that appears associated with each message is
+ the status field. This can be blank (as with most of the
+ ones above, or can have any combination of the following:
+
+ The first character signifies temporary status:
+
+ .ta .75iC 102p
+ .nf
+ E for an \f2expired\f1 message
+ N for a \f2new\f1 message
+ O for an \f2old\f1 (i.e. not new but not read) message
+ D for a \f2deleted\f1 message
+
+ The second character which signifies permanent status:
+
+ C for \f2confidential\f1 mail
+ U for \f2urgent\f1 mail
+ P for a \f2private\f1 message
+ A for messages that have an \f2action\f1 associated with them
+ F for a \f2form\f1 letter
+ M for a \f2MIME\f1 compliant message
+ .fi
+
+ The third character of the status field can be a \*q+\*u to
+ indicate that the message is \f2tagged\f1 too.
+
+ .lp \h'12p'\(bu 20p
+ Continuing from left to right, the next field is the message
+ number. For the most part you can ignore these unless you want
+ to quickly move to a specific message (as we'll see later).
+
+ .lp \h'12p'\(bu 20p
+ The date associated with each message is typically
+ the date the person actually \f2sent\f1 the message.
+
+ .lp \h'12p'\(bu 20p
+ The next field displayed indicates whom the message is from.
+ Elm will try to display the \f2full name\f1 of the person who
+ sent the message, rather than the their return address or computer login.
+ Some systems don't generate the correct headers, though, hence
+ messages like numbers 2 and 8, where it's their return address.
+
+ .lp \h'12p'\(bu 20p
+ The number in parentheses is the total number of lines in the message.
+
+ .lp \h'12p'\(bu 20p
+ The final field is the subject of the message. Notice
+ that messages might not have any subject, as in messages #9 and #10.
+
+ .lp \h'12p'\(bu 20p
+ A maximum of ten messages are displayed at one time.\s-2\u1\d\s0
+ .fn
+ 1. On screens with more than 24 lines, additional messages are
+ displayed automatically. Furthermore, if you choose to turn off
+ the menu display, you can have an even greater number
+ displayed.
+ .ef
+ Further into the document we'll learn how to change \*Qpages\*U in the folder.
+
+ .lp \h'12p'\(bu 20p
+ The three line menu display will always
+ indicate the relevant commands. There are actually two possible
+ menus that can be displayed, based
+ on the \f2user level\f1 as set from either the options screen or
+ the \f2.elm/elmrc\f1
+ file. The alternate menu, for more advanced users,
+ lists more options;
+ .sp
+ .ft CW
+ .zf
+ .ps 9
+ .ce 3
+ |=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
+ a)lias, C)copy, c)hange folder, d)elete, e)dit, f)orward, g)roup reply, m)ail,
+ n)ext, o)ptions, p)rint, r)eply, s)ave, t)ag, q)uit, u)ndelete, or e(x)it
+ .ps 10
+ .ft 1
+
+ .lp \h'12p'\(bu 20p
+ Finally, the \*q@\*u character indicates where the cursor would be, awaiting
+ your input.
+
+ .sp
+ .in 0
+ The typical action at this point is to use the \f2<return>\f1
+ key to read the current message, which will clear the
+ screen and display the current message:
+
+ .ne 10
+ .ft CW
+ .zf
+ .ps 9
+ .mk a
+ .tl ' Message 1/15 from Larry Fenske''Apr 24 \'87 at 8:45 pm edt'
+ .tl ''Hello there''
+ .nf
+ Dave,
+ Just wanted to drop you a brief note to see what was going on with
+ you this afternoon. Life here has been the usual fun and games...
+ Ah well, off to the great wilds beyond the desk!
+ Larry
+ Command (\'i\' to return to index): @
+ .fi
+ .eb
+ .ft 1
+ .ps 10
+
+ Before we go further with our example, however, let's very
+ quickly look at all the functions available from the main
+ screen:
+ .\" ensure we get a reasonable chunk of this table on the page...
+ .br
+ .ne 10
+ .lp \h'18p'\f3Command 90p
+ Action\f1
+
+ .lp "\h'18p'<return> or <space>" 90p
+ Read current message.
+ .lp \h'18p'| 90p
+ Pipe current message or tagged messages to specified system command.
+ .lp \h'18p'! 90p
+ Shell escape.
+ .lp \h'18p'$ 90p
+ Resynchronize folder.
+ .lp \h'18p'? 90p
+ Help mode \(em any key pressed will be explained.
+ .lp "\h'18p'+ or <right>" 90p
+ Display next page of subjects.
+ .lp "\h'18p'\- or <left>" 90p
+ Display previous page of subjects.
+ .lp \h'18p'= 90p
+ Set current message to 1.
+ .lp \h'18p'* 90p
+ Set current to last message.
+ .lp \h'18p'<number><return> 90p
+ Set current message to number \f2number\f1.
+ .lp \h'18p'/ 90p
+ Search for pattern in subject/from lines.
+ .lp \h'18p'// 90p
+ Search for pattern in entire folder.
+ .lp \h'18p'< 90p
+ Scan message for calendar entries.\s-2\u2\d\s0
+ .fn
+ 2. Some sites might opt not to have the calendar feature available.
+ .ef
+ .lp \h'18p'> 90p
+ A synonym for \f3s\f1 \(em \f3save\f1 message or messages.
+ .sp
+ .lp \h'18p'a 90p
+ Alias, change to \*Qalias\*U mode.
+ .lp \h'18p'b 90p
+ Bounce \(em remail message (see \f3f\f1 \(em \f3forward\f1 too).
+ .lp \h'18p'C 90p
+ Copy current message or tagged messages to folder.
+ .lp \h'18p'c 90p
+ Change to another folder.
+ .lp \h'18p'd 90p
+ Delete current message.
+ .lp \h'18p'<control>-D 90p
+ Delete all messages matching specified pattern.
+ .lp \h'18p'e 90p
+ Edit current folder, resyncing upon re-entry.\s-2\u3\d\s0
+ .fn
+ 3. Some sites might opt not to have the edit folder feature available.
+ .ef
+ .lp \h'18p'f 90p
+ Forward message to specified user.\s-2\u4\d\s0
+ .fn
+ 4. The difference between \f3forward\f1 and \f3bounce\f1 is rather
+ subtle \(em a forwarded message is \f2from\f1 you, with the
+ original message included, whereas a bounced message
+ is still from the original sender.
+ .ef
+ .lp \h'18p'g 90p
+ Group reply \(em reply to everyone who received the current message.
+ .lp \h'18p'h 90p
+ Display message with headers.
+ .lp \h'18p'i 90p
+ Return to index screen after displaying message.
+ .lp \h'18p'J 90p
+ Set current to next message.
+ .lp "\h'18p'j or <down>" 90p
+ Set current to next message not marked deleted.
+ .lp \h'18p'K 90p
+ Set current to previous message.
+ .lp "\h'18p'k or <up>" 90p
+ Set current to previous message not marked deleted.
+ .lp \h'18p'l 90p
+ Limit displayed messages based on the specified criteria.
+ .lp \h'18p'<control>-L 90p
+ Rewrite screen.
+ .lp \h'18p'm 90p
+ Mail to arbitrary user(s).
+ .lp \h'18p'n 90p
+ Read current message, then increment to next message not marked deleted.
+ .lp \h'18p'o 90p
+ Alter current system options.
+ .lp \h'18p'p 90p
+ Print current message or tagged messages.
+ .lp \h'18p'q 90p
+ Quit \(em maybe prompting for messages to delete, store, or keep.
+ .lp \h'18p'Q 90p
+ Quick quit \(em like quit but without prompting.
+ .lp \h'18p'r 90p
+ Reply to the author of current message.
+ .lp \h'18p's 90p
+ Save current message or tagged messages to folder.
+ .lp \h'18p't 90p
+ Tag current message.
+ .lp \h'18p'<control>-T 90p
+ Tag all messages matching specified pattern.
+ .lp \h'18p'u 90p
+ Undelete current message.
+ .lp \h'18p'<control>-U 90p
+ Undelete all messages matching specified pattern.
+ .lp \h'18p'x 90p
+ Exit \(em prompt if mailbox changed, don't record as read, don't save.
+ .lp \h'18p'X 90p
+ Exit immediately \(em don't record as read, don't save.
+ .in 0
+ .sp
+ .ne 10
+ But let's go back to our example and see some of this at
+ work, shall we?
+ .sp
+ We were reading the message from Larry and the screen looked
+ like:
+
+ .ne 10
+ .ft CW
+ .zf
+ .ps 9
+ .mk a
+ .tl ' Message 1/15 from Larry Fenske''Apr 24 \'87 at 8:45 pm edt'
+ .tl ''Hello there''
+ .nf
+ Dave,
+ Just wanted to drop you a brief note to see what was going on with
+ you this afternoon. Life here has been the usual fun and games...
+ Ah well, off to the great wilds beyond the desk!
+ Larry
+ Command (\'i\' to return to index): @
+ .fi
+ .eb
+ .ft 1
+ .ps 10
+
+ From this point let's go ahead and reply to the message. To
+ do this, we can use the \f3reply\f1 command.
+ To do this, we type \*qr\*u and the last few lines change to
+ something like:
+ .ft CW
+ .zf
+ .ps 9
+ .sp
+ .bl
+ .tl 'Command: Reply to message''Copy message? (y/n) @ '
+ .sp 2
+ .ft 1
+ .ps 10
+ To which we decide that we don't need the text of this message in
+ our new one, so we reply \f2no\f1 by pressing the \*qn\*u key. The
+ bottom part of the window then changes to:
+ .ft CW
+ .zf
+ .ps 9
+ .sp
+ .bl
+ .ie t .tl 'Command: Reply to message'To: Larry Fenske ''
+ .el .tl 'Command: Reply to message''To: Larry Fenske '
+ .tl 'Subject: Re: Hello there@'''
+ .ft 1
+ .ps 10
+ .sp 2
+ At this point we can either decide to enter a new subject (you could
+ use either \f2backup word\f1 (\f2<control>-W\f1) or \f2backup line\f1 (this
+ is the same as your \*Qline kill\*U character,
+ \f2<control>-X\f1 or \f2<control>-U\f1
+ usually)) or go with this one by pressing \f2<return>\f1. We'll
+ just leave it as it is and press \f2<return>\f1, changing the
+ screen to:
+ .ps 9
+ .ft CW
+ .zf
+ .sp
+ .bl
+ .ie t .tl 'Command: reply to message'To: Larry Fenske ''
+ .el .tl 'Command: reply to message''To: Larry Fenske '
+ .tl 'Subject: Re: Hello there'''
+ .tl 'Copies to: @'''
+ .ps 10
+ .ft 1
+ .sp
+ There's no one we want to have receive copies of this message, so we'll
+ just press \f2<return>\f1 again to indicate this.
+
+ Once you've answered these questions the program will put you into
+ your favorite editor and let you compose a response. When you're
+ done it then asks:
+ .ps 9
+ .ft CW
+ .zf
+ .sp
+ .tl 'Please choose one of the following options by parenthesized letter: @'''
+ .tl ''e)dit message, edit h)eaders, s)end it, or f)orget it.''
+ .ft 1
+ .ps 10
+ .sp
+ Since we're just interested in sending the message out, we'll
+ choose the \f3send\f1 option and press \*qs\*u. The program
+ then sends the message, indicating that by the line below
+ saying:
+ .sp
+ .ps 9
+ .ft CW
+ .zf
+ Sending mail...
+ .ft 1
+ .ps 10
+ .sp
+ then putting at the bottom of the screen ``Mail sent!'' and giving us
+ the prompt:
+ .ps 9
+ .ft CW
+ .zf
+ .sp
+ .bl
+ .tl 'Command:''(Use \'i\' to return to index.)''
+ .sp
+ .ps 10
+ .ft 1
+ Pretty easy, isn't it? Let's continue by going back to the main
+ screen pressing the \*qi\*u key to request the \f2index\f1. The
+ screen is then:
+
+ .ne 20
+ .ft CW
+ .zf
+ .ps 9
+ .mk a
+ .sp
+ .ce
+ Mailbox is \'/usr/mail/mymail\' with 15 messages [Elm 2.4PL22]
+ .TS
+ r l r l l l l.
+ \-> 1 Apr 24 Larry Fenske (49) Hello there
+ N 2 Apr 24 jad@hpcnoe (84) Chico? Why go there?
+ E 3 Apr 23 Carl Smith (53) Dinner tonight?
+ NU 4 Apr 18 Don Knuth (354) Your version of TeX...
+ N 5 Apr 18 games (26) Bug in cribbage game
+ A 6 Apr 15 kevin (27) More software requests
+ 7 Apr 13 John Jacobs (194) How can you hate RUSH?
+ U 8 Apr 8 decvax!mouse (68) Re: your Usenet article
+ 9 Apr 6 root (7)
+ O 10 Apr 5 root (13)
+ .TE
+ .sp
+ .ce 3
+ You can use any of the following commands by pressing the first character;
+ d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit
+ To read a message, press <return>. j = move down, k = move up, ? = help
+ Command : @
+ .sp
+ .\" draw box, proportional Roman font back, display end
+ .eb
+ .ft 1
+ .ps 10
+
+ Notice that the first message is no longer marked as \f2new\f1
+ since we've now read it.
+ .sp
+ Let's go ahead and read the message from kevin (message #6) since
+ it has some sort of \f2action\f1 associated with it anyway. To
+ do this, we simply press the \*q6\*u key, which will change the
+ bottom of the screen to:
+ .sp
+ .ps 9
+ .ft CW
+ .zf
+ .tl 'Command: New Current Message''Set current message to : 6@'
+ .ft 1
+ .ps 10
+ .sp
+ We'll just press \f2<return>\f1 to move the active message
+ pointer (the arrow).
+ .sp
+ Now we're pointing at the new message, so let's go ahead and read
+ it by pressing \f2<return>\f1 again, giving us:
+
+ .ne 10
+ .ft CW
+ .zf
+ .ps 9
+ .mk a
+ .tl ' Message 6/15 from kevin''Apr 15 \'87 at 11:36 am pst'
+ .tl ''More software requests''
+ Action: please acknowledge receipt
+ I don\'t suppose you have a nifty netnews reader around too, do you??
+ \-\-
+ kevin
+ Command (\'i\' to return to index): @
+ .eb
+ .sp
+ .ps 10
+ .ft 1
+
+ .br
+ .ne 5
+ Well, it turns out that we don't, but a friend of ours does, so
+ let's \f3forward\f1 the message to them by pressing \*qf\*u:
+ .ps 9
+ .ft CW
+ .zf
+ .sp
+ .tl 'Command: Forward message''Edit outgoing message (y/n) ? @ '
+ .ft 1
+ .ps 10
+ .sp 2
+ No need to edit it, so let's answer \f2no\f1 with \*qn\*u:
+ .sp
+ .ps 9
+ .ft CW
+ .zf
+ .tl 'Command: Forward message''Edit outgoing message (y/n) ? No '
+ .tl 'To: @'''
+ .ps 10
+ .ft 1
+ .sp
+ We type in the address of the person we're forwarding to (in
+ this case
+ .ft CW
+ .zf
+ usenet\f1) and press
+ \f2<return>\f1:
+ .ft CW
+ .zf
+ .ps 9
+ .sp
+ .ie t .tl 'Command: Forward message'To: usenet ''
+ .el .tl 'Command: Forward message''To: usenet '
+ .tl 'Subject: More software requests (fwd)@'''
+ .ft 1
+ .ps 10
+ .sp
+ To which we again press \f2<return>\f1 to take the default subject.
+ Elm asks for any possible copy recipients, asks us if we're
+ sure we want to send it, and shoots it off.
+ .sp
+ Enough mail for now, however, so we just \f3exit\f1 by pressing
+ the \*qx\*u key at the \*QCommand:\*U prompt and the program drops us
+ back into our shell.
+ .sp
+ As you can see, it's quite easy to use the Elm system, so
+ rather than continue with our example, let's
+ look at some other aspects of the program.
+ .br
+ .ne 5
+ .sp
+ .hn 1 Non-Interactive Uses of Elm
+
+ Before we go ahead and discuss the Elm utilities, it's worth
+ noting that
+ there are a couple of other ways to use the main mail
+ system, namely to \*Qsend only\*U and to send files (batchmail).
+
+ To send a message to someone without any of the associated
+ overhead of reading in a mail folder, you can invoke the
+ mailer with the name(s) of the people to send to. For example:
+
+ .nf
+ .ti +.5i
+ $ \f3elm dave_taylor\f1
+ .fi
+
+ Elm then prompts for Subject, Copies, and then drops
+ you in your editor (defined in the \f2.elm/elmrc\f1 file) to compose
+ the message. When composition is complete, the program
+ verifies transmission then terminates.
+
+ .ne 6
+ Elm also supports batch type mailing, of files and so on,
+ by using the following command:
+
+ .nf
+ .ti +.5i
+ $ \f3elm dave_taylor < help.c\f1
+ .fi
+
+ which reads in the file and transmits it to the specified user.
+
+ .ne 3
+ A subject may be specified with \*Q\-s \f2subject\f1\*U as an option
+ to Elm in either \*Qsend only\*U or \*Qbatch\*U modes, as in:
+
+ .nf
+ .ti +.5i
+ $ \f3elm \-s "File help.c, as promised" dave_taylor < help.c\f1
+ .fi
+
+ .ne 3
+ Elm also has an option to specify that a certain file be used as the
+ initial text of the message. This makes it easier to use Elm with
+ other programs that interface with a mailer. Use \*Q\-i \f2file\f1\*U as an
+ option to Elm in \*Qsend only\*U mode. For example, to specify to \f2rn\f1
+ to use Elm as the mailer, define the following in \f3RNINIT\f1:
+
+ .ft CW
+ .zf
+ .nf
+ .ti +.5i
+ \-EMAILPOSTER="elm \-i %h \-s \\"Re: %S\\" %t"
+ .fi
+ .ft 1
+
+ See the man page for \f2rn\f1(1) or the newsreader you use for more specific
+ information.
+
+ .br
+ .ne 5
+ .sp
+ .hn 1 The Elm Utilities
+
+ The Elm mail system is really much more than a single
+ program for reading and writing mail. It's a unified
+ environment for intelligently dealing with electronic
+ correspondence. As a consequence, it contains a number of other
+ programs to aid in the easy processing of \*Qemail\*U,
+ including the following;
+
+ .lp \h'10p'answer 1.0i
+ An answering-machine transcription program. Please see the
+ manual entry for more information on how to use this program.
+
+ .lp \h'10p'checkalias 1.0i
+ A script for checking aliases simply.
+
+ .lp \h'10p'elmalias 1.0i
+ A tool to obtain information on defined aliases.
+
+ .lp \h'10p'listalias 1.0i
+ A script to produce sorted listings of aliases.
+
+ .lp \h'10p'messages 1.0i
+ A script that lists the number of messages in the specified
+ folder. Suitable for login scripts and such.
+
+ .lp \h'10p'newmail 1.0i
+ This program monitors a mailbox or set of mailboxes and can
+ output notification of new mail in one of two possible
+ formats; either:
+
+ .ne 6
+ .nf
+ .ft CW
+ .zf
+ .ps 9
+ .ti +.5i
+ >> New mail from Jimmy Carter \-\- Urgent matters of state
+ .br
+ .ti +.5i
+ >> New mail from j...@ucbvax.arpa \-\- Did I hear someone say PARTY??
+ .ft 1
+ .ps 10
+
+ if running as \f2newmail\f1 or:
+
+ .ft CW
+ .zf
+ .ps 9
+ .ti +.5i
+ Jimmy Carter \-\- Urgent matters of state
+ .br
+ .ti +.5i
+ j...@ucbvax.arpa \-\- Did I hear someone say PARTY??
+ .ft 1
+ .ps 10
+ .fi
+
+ if running as \f2wnewmail\f1. BSD Users will find this is
+ a far superior \f2biff\f1 program.
+
+ .lp \h'10p'wnewmail 1.0i
+ This is the same program as \f2newmail\f1, but has different
+ defaults if invoked this way.
+
+ .lp \h'10p'readmsg 1.0i
+ This handy little program can be used in two ways. First off,
+ it can be used to easily read a specific message in the
+ incoming mailbox, specified by ordinal number, by a string that
+ the message contains, by the metacharacter \*q$\*u which
+ represents the last message in the folder, or \*q*\*u which matches

Kari E. Hurtta

unread,
Jul 9, 2004, 6:15:47 AM7/9/04
to
Archive-name: elmME+2.5/PLalpha1.2

Will be available on ftp.funet.fi


via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


Is available with

via WWW.


Before applying patch catenate parts 1 - 4 first.

This patch is agaist Elm ME+ 2.5 PLalpha0
========================================================== [ part 2/4] =========
+ all the messages in the folder.
+
+ For example;
+
+ .ti +.5i
+ $ \f3readmsg 4 5 9 | lpr\f1
+
+ would generate a printout, \f2sans\f1 superfluous headers, of the fourth,
+ fifth and ninth messages in your mailbox.
+
+ .ti +.5i
+ $ \f3readmsg Carter | page\f1
+
+ would be a fast way to read what \*uole Jimmy has to say, and
+
+ .ti +.5i
+ $ \f3readmsg \-h hear someone say\f1
+
+ would list, including all the message headers, the message
+ containing the string \*Qhear someone say\*U.
+
+ .lp \h'10p'frm 1.0i
+ Similar to the Berkeley \f2from\f1 command, this will
+ give you a \*Qtable of contents\*U or a summary of either the current
+ mailbox or a mailbox of your choice. It's useful to
+ see what mail is pending, or what's in a mailbox.
+ If used with the \*Q\-n\*U option, it will number each message
+ in a way compatible with the arguments \f2readmsg\f1
+ expects to get, too!
+
+ .lp \h'10p'newalias 1.0i
+ This is used to install new user/group aliases. Please see
+ \f2The Elm Alias Users Guide\f1 for further information.
+
+ .lp \h'10p'fastmail 1.0i
+ Sometimes you want to have a batchmailing system that works as
+ quickly as possible, not bothering with aliases or any of the
+ other \*Qdeluxe\*U features of Elm. An example of this would
+ be if you have a large mailing list for a newsletter, say.
+ This command, \f2fastmail\f1, is designed just for that purpose.
+ It avoids the lengthy startup time of Elm while still
+ generating valid RFC-822\s-2\u5\d\s0 mail.
+ .fn
+ 5. If you don't know what RFC-822 is, don't worry about it!
+ .ef
+ Please see the manual entry for more information on this
+ command.


+ .in 0
+ .br
+ .ne 5
+ .sp

+ .hn 1 "Credits and So on \(em Elm's early years from Dave Taylor"
+
+ This mailer has been evolving over the past few years with
+ invaluable comments on the interface and general mail
+ issues from the following people;
+ Jim Davis, Steve Wolf (or should that say Steve!! Wolf!!!! perhaps?),
+ Larry Fenske, Rob Sartin,
+ John Dilley and Carl Dierschow.
+ .sp
+ For the Berkeley implementation, lots of help came from
+ both John Lebovitz and Ken Stone.
+ .sp
+ For the Amdahl/UTS implementation, thanks to Scott McGregor and
+ Stan Isaacs.
+ .sp
+ For the Sun problems, Dave England in Lancaster (UK) turned out to be
+ \*Qbloody useful\*U, as he would no doubt say.
+ .sp
+ The Pyramid version is due to the work of Steve Malone
+ of the University of Washington.
+ .sp
+ A number of other people have been amazingly disciplined at reporting
+ problems and (usually, much to my relief) indicating the fixes needed,
+ especially Guy Hillyer, Bruce Townsend and Eric Negaard.
+ .sp
+ There have been many, many others, too numerous to mention, that
+ have inspired me with questions like \*QWhy can't Elm...\*U or
+ \*QWhy does it ...\*U or \*QCan we make it...\*U too. A loud round of
+ applause and an enthusiastic THANK YOU to you all!!
+ .sp
+ Also helpful was the ability to have my \*Qown\*U machine to
+ close up the many many iterative loops that this software
+ has gone through \(em since being on a big multi-user machine
+ tends to slow it down to a standstill.
+ For that, I thank Hewlett-Packard Colorado Networks Division for their
+ initial support, and now HP Laboratories for the wonderful working
+ environment that I have here (more than any one person is safe having,
+ I suspect).
+ .sp
+ Mailers that have influenced the design and implementation of Elm,
+ for better or worse, include the following;
+
+ .lp \h'4p'\f2/bin/mail\f1 1.0i
+ The most basic of mailers, this one was simply the example of how \f2not\f1
+ to force the user to interact with a program.
+
+ .lp "\h'4p'\f2Berkeley Mail\f1" 1.0i
+ A surprisingly sophisticated mailer, especially the version with 4.3 BSD,
+ \f2Berkeley Mail\f1 still suffers from the tendency to force the user to
+ know too much about the system, and also lacks a friendly, non-cryptic
+ interface for the large subset of the population that use
+ .ux
+ but aren't
+ interested in becoming a \*Qhacker\*U.
+
+ .lp \h'4p'\f2MH\f1 1.0i
+ This is another nifty mailer. The main difference between this and the
+ other mailers about is that it is a discrete set of programs rather than
+ a single unified interface. This is quite useful for those people that
+ receive \f2lots\f1 of mail and are willing to spend some time learning
+ the intricacies of the program. It's quite powerful, but again, misses some
+ of the basic friendly features the majority of users are interested in.
+
+ .lp \h'4p'\f2dmail\f1 1.0i
+ A sort of mutated cross between \f2MH\f1 and \f2Berkeley Mail\f1, it was
+ this program that convinced me to implement the \f3limit\f1 functions.
+
+ .lp \h'4p'\f2NMail\f1 1.0i
+ A part of the HP AI Workstation Software Environment, this program hints
+ at the power that mailers could be given to help deal with mail in a quick
+ and intelligent fashion. Most of what it can do, and a lot more, are
+ therefore part of Elm. Indubitably. And quite fast too!
+
+ .lp \h'4p'\f2PMX/TERM\f1 1.0i
+ Part of the AT&T Mail package, a single glance at this interface convinced
+ me that a PC interface, with almost half of the screen taken up by a silly
+ function key mapping, is most certainly \f2not\f1 the way to do things!!
+ On the other hand, it also shows that the \*Qforms\*U mode can be quite
+ nicely integrated into a more sophisticated mailer.
+
+ .lp \h'4p'\f2fmail\f1 1.0i
+ A nickel addition to the \f2/bin/mail\f1 program to add some rudimentary
+ screen interface stuff, this nonetheless interesting mailer is part of
+ the AT&T Toolchest.
+
+ .lp \h'4p'\f2Laurel\f1 1.0i
+ A program only available within Xerox PARC, this was an interesting
+ early attempt at a graphics based full-screen mail program. The one,
+ perhaps trivial, part of the interface I really like was the fact that
+ it would \f2cross out\f1 a message that was marked for deletion. One
+ day when we get real graphics and the ability to use them in
+ a facility (not too) like \f2termcap\f1, perhaps Elm will do
+ this too!
+
+ .lp \h'4p'\f2Mailtool\f1 1.0i
+ Part of the Sun distribution package, this program is a really nice
+ example of what can be done by putting a smart shell on top of a dumb
+ program \(em it uses \f2/bin/mail\f1 for all the \*Qdirty work\*U. Other than
+ that, it's not a particularly interesting interface or mailer, and it
+ certainly doesn't add much functionality!
+
+ .lp \h'4p'\f2Metamail\f1 1.0i
+ What can I say? This isn't even a real mailer,\s-2\u6\d\s0
+ .fn
+ 6. Not to be confused with the multi-media mailer, \f2metamail\f1, from
+ Nathaniel Borenstein of Bellcore.
+ .ef
+ but is just what I dream
+ of as an interface to mail in the future. A program that works sort of
+ like HAL did in \f22001: A Space Odyssey\f1 \(em where it interrupts
+ me as appropriate for important mail, and can answer inane and other
+ queries itself according to what I teach it. Maybe Elm, by some sort
+ of groupmind metamorphosis, will change into that someday. Maybe not. Maybe
+ no one bothers to read this far into the document!!
+
+ .in 0
+ Finally, it's also been a very useful experience overall,
+ confirming my beliefs that iterative software design and
+ keeping a close watch on users (not to mention an open
+ mind and mailbox!) improves a product manyfold. Comments,
+ feedback and bug reports (and fixes!) are, of course, always welcome!


+ .br
+ .ne 5
+ .sp

+ .hn 1 "Credits and So on Part II \(em The Usenet Elm Development Group"
+
+ As coordinator of the Elm Development Group, I must add to the credits.
+ This group of volunteers has taken the Elm code from Dave Taylor and
+ added features, made it more robust, and more portable.
+ .sp
+ For getting the Usenet Elm group going, for without which I wouldn't be
+ writing this, thanks to Greg Hackney at Southwestern Bell Telephone Co.
+ .sp
+ For the Configuration system and its newer Dist 2.0 version, thanks are
+ due to Larry Wall of JPL-NASA.
+ .sp
+ For his over two hundred sets of changes to version 2.2, Elm owes a lot
+ to Rob Bernardo who was at Pacbell at that time.
+ .sp
+ The ability to run Elm at all on Intel 286 machines owes a lot to the
+ insistent nudging of the coordinator by Chip Salzenberg,
+ Chip Rosenthal, and Tim Evans.
+ .sp
+ For getting us the rights to use the news macros and converting all
+ the documentation over to those macros, thanks to Mike Brown.
+ .sp
+ For pushing us into the \*u90s and forcing the issues of
+ NLS and foreign language support, I thank Jan Saell of Administration & Systemkonsult AB
+ along with Larry Philps of SCO Canada.
+ .P
+ I'd also like to thank the many current and prior members of the Elm
+ development and testing groups. The list varies from time to time
+ as people come and go. Also, to all the Elm users out there who
+ send in patches. The group can use all the extra help it gets.
+ As a postScript, if you wish to join the group, all it takes is some
+ time to work on things, and to ask.
+
+ Syd Weinstein, Elm Coordinator.
Index: elmME+.2.5.alpha1-cvs/Configure
*** elmME+.2.5.alpha0/Configure 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/Configure 2004-07-03 20:46:52.000000000 +0300
***************


*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150.8.6 2004/05/16 12:26:42 hurtta Exp $
#


: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150.8.7 2004/07/03 17:46:52 hurtta Exp $
#

: sanity checks
***************
*** 1374,1379 ****
--- 1374,1385 ----
EOSS
chmod +x filexp

+ : ############### >>>>>>>>>>>>>>> Commented out ROFF section
+ if true
+ then
+ roff=none
+ else
+
# determine text processor to use, default to troff if found.
case "$roff" in
'')
***************
*** 1460,1465 ****
--- 1466,1474 ----
esac
fi

+ fi
+ : ############### <<<<<<<<<<<<<<<<<<<< Commented out ROFF section
+
: default clear to no extra flags
xencf=
xenlf=
Index: elmME+.2.5.alpha1-cvs/doc/Alias.guide
*** elmME+.2.5.alpha0/doc/Alias.guide 2002-01-26 13:14:45.000000000 +0200
--- /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
***************
*** 1,354 ****
- .\" @(#)$Id: Alias.guide,v 1.2 1998/10/20 19:57:19 hurtta Exp $
- .\"
- .\" A guide to the ELM alias system and so on.
- .\" format with:
- .\" tbl Alias.guide | troff tmac.n - > Alias.format'
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust
- .\" Elm is now in the public trust.
- .\"
- .\"
- .\"
- .tm Have we been run through "tbl" first?? I hope so!
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .za
- .sp |3.0i
- .ce 99
- .ps 20
- .ss 18
- .vs 12
- \f3The Elm Alias System Users Guide\f1
- .sp 4
- .ps 12
- .ss 14
- .vs 14
- \f2What aliases are and how to use them
- in the \f3Elm\fP mail system\f1
- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp |9.0i
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .fi
- .ad
- .bp 1
- .sv 5v
- .ps 14
- .ss 12
- .vs 16
- \f3The Elm Alias System Users Guide\f1
- .ds h0 "Alias Users Guide
- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- Syd Weinstein


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- This document is intended as a supplement to the \f2Elm Users Guide\f1
- and is only of interest to those users desiring more knowledge
- about how aliases work and how to create strange and exciting
- aliases for their systems (okay, so maybe it's not \f2that\f1 exciting!)
- .sp
- This document is broken up into the following sections;
- user aliases,
- group aliases,
- system aliases,
- editing and installing new aliases,
- general warnings and other chit-chat.
- .sp
- .hn 1 User Aliases
-
- The simplest type of aliases in the Elm system are individual
- user aliases. These are made up of three parts;
-
- .nf
- \f2aliasname list\f1 = \f2username\f1 = \f2address\f1
- .fi
-
- Where the \f2aliasname list\f1 is either a single aliasname\s-1\u1\d\s0
- .fn
- 1. Aliasnames can be any combination of letters, numbers, hyphens (\*q\-\*u),
- periods (\*q.\*u), or underscores (\*q_\*u). Letter case is not significant,
- that is, \*QFRED\*U, \*QFred\*U, and \*Qfred\*U are identical.
- .ef
- or a list of aliasnames separated by commas. Aliasnames are case insensitive and will be
- converted to all lower case by the alias system.
- .sp
- \f2Username\f1 is used to indicate the full \*Qreal name\*U of the user. For
- example, if you had an alias for \*Qtaylor\*U to get to me, the
- \f2username\f1 field would contain \*QDave Taylor\*U or
- perhaps \*QDave Taylor at HP\*U
- or some other permutation. The
- name can optionally be entered in the format of \*QTaylor; Dave\*U. When
- this is done, the alias system can sort aliases on a last name basis
- for presentation on the alias menu within Elm.
- Elm uses this information to add the user's full name to the addresses of
- outbound mail to get more readable addresses. No
- matter which format a name is entered, Elm displays it
- and puts it in mail headers the way you would expect (i.e., \*QDave Taylor\*U).
- .sp
- \f2Address\f1 is either the user's full electronic mail address or, if
- your system uses a smart mailer, the minimum address needed to specify
- the destination. For example, say my smart mailer
- contained information on how to get to machine \*Qhp-sdd\*U and I wanted
- to have an address for my friend Ken there \(em I could have his address
- specified as simply \*Qken@hp-sdd\*U (or alternatively \*Qhp-sdd!ken\*U since
- the two are functionally equivalent).
- .sp
- Let's get on to some examples, shall we?
- .sp
- Consider this excerpt from my own \f2.elm/aliases.text\f1 file;
-
- .nf
- .ft CW
- .zf
- .in .5i
- .ta \w'frank,minjarez 'u \w'frank,minjarez = Frank Minjarez 'u
- # Mail aliases for Dave Taylor
- # Friends from UCSD
- addie = Addie Silva = ad...@hp-sdd.SDD.HP.COM
- frank,minjarez = Frank Minjarez = Minjare...@dockmaster.ddn.mil
- pizzini = Ken Pizzini = hplabs!ucbvax!ucdavis!pai!ken
- george = Burdell; George P., Famous GT Guy = gbur...@matd.gatech.edu
- .ft 1
-
- .in 0
- .fi
- Note that the alias for Frank Minjarez has two \f2aliasnames\f1 associated
- with it, \f2frank\f1 and \f2minjarez\f1.
- Also notice that the first and second aliases
- use the Internet style naming convention of \f2user@machine\f1
- whereas the third uses the \f2uucp\f1 notation of \f2machine!user\f1.
- The fourth alias illustrates two features for the \f2username\f1
- field. An individual's name can be entered in the form of
- \f2lastname; firstname, comment\f1 which allows the alias system to be able
- to sort alias names on a last name basis. Additionally, any
- text after the comma is treated as a comment. It is stored in
- the alias file and displayed on the alias menu but will not
- appear in the comment field (between the parentheses) in the header
- of a message. This allows you to enter useful notes about an
- individual that you would not otherwise want to include in the
- \f3To:\f1 header of a mail message.
- .sp
- For the most part, the notational format is transparent within the
- alias file \(em the only time it \f2does\f1 make a difference
- is if you have to specify more than the machine that the user is
- receiving mail on (as in the third example above).
- .sp
- Suffice to say that if you must specify any sort of uucp route
- that you should use the uucp notation as much as possible to ensure
- that the system expands the correct machine name. Similarly, if
- you're bouncing mail through different Internet sites (to
- get to a foreign system, as in the example below) you should use the
- notation that system expects, e.g.:
-
- .ft CW
- .zf
- .ti .5i
- listserv%byuadmi...@rugters.edu
- .ft 1
- .sp
- .hn 1 Group Aliases
-
- After the confusion of user aliases, group aliases are even more
- fun! For the most part the notation is very similar:
-
- .nf
- .ti .5i
- \f2aliasname list\f1 = \f2groupname\f1 = \f2address list\f1
- .fi
-
- Where \f2aliasname list\f1 and \f2groupname\f1 are exactly equivalent
- to the corresponding fields in user aliases.
- .sp
- The interesting part is the \f2address list\f1 field; this
- field is actually in the same notation as the aliasname list (i.e.,
- a list of addresses separated by commas),
- so it's really quite easy to create.
- It's best to illustrate by example:
-
- .ft CW
- .zf
- .nf
- .in .5i
- friends, mypals = The Gang of Six = joe, larry, mary, joanna,
- \h'\w'friends, mypals = The Gang of Six = 'u'nancy, michael
- .ft 1
- .in 0
- .fi
-
- Notice that you can continue onto as many lines as you'd like so
- long as each additional line starts with either a \f2<space>\f1 or a
- \f2<tab>\f1 character.
- .sp
- At times it may be desirable to send a message to everyone in
- the group except one or two people. This can be accomplished by
- adding the individuals' actual IDs to the \f3To:\f1 list, preceded
- by a minus sign (\*q\-\*u). For example, if you were having a surprise
- party for \f2nancy\f1 from the above group and you wanted to discuss the
- details with the others, you could mail the message to:
-
- .ft CW
- .zf
- .nf
- .in .5i
- friends \-nancy
- .ft 1
- .in 0
- .fi
-
- Unlike in prior versions of Elm, group alias addresses need not
- be \f2previously defined aliases\f1 or valid mail addresses on
- the current machine. Any valid delivery address, local user, or
- prior user or group alias may now be part of a group alias
- \f2address list\f1.
- .sp
- .hn 1 System Aliases
-
- System aliases are functionally equivalent to the individual Elm
- alias lists each Elm user has (both user aliases and group aliases)
- but are \f2read only\f1 for everyone but the Elm administrator. The
- format of the file is identical to the users' files, and the only difference is
- that this file is expected to be located in the directory that contains
- the \f3system_hash_file\f1 and \f3system_data_file\f1 files (see the
- \f2Elm Configuration Guide\f1 for more details on these variables).
- .sp
- Simply create the system alias file in the specified directory
- as you would a normal alias file, and install it using the newalias
- command with the -g option (see the following section for more details
- on that). Voila!!
- .sp
- .hn 1 Editing and Installing New Aliases
-
- To install new aliases, you need merely to create, or modify,
- the file \f2$HOME/.elm/aliases.text\f1 until you're
- satisfied with it and it meets the requirements discussed above.
- You can then try to install it with the command:
-
- .ti .5i
- $ \f3newalias\f1
-
- which either reports the number of aliases installed
- or the errors encountered trying to parse and store the
- given alias list.
- .sp
- Note that blank lines are no problem and that comments are not only
- allowed but actually encouraged, and must have \*q#\*u as the first
- character of each comment line.
- .sp
- .hn 1 Other Stuff not Covered Yet
-
- Probably the biggest question you have in your mind right now
- is \*QBut how the heck does this relate to my existing \f2Berkeley Mail\f1
- aliases and the lower-level \f2sendmail\f1 alias system?\*U Well,
- rest assured that if you \f2really\f1 want to have
- your aliases down in the transport you can. No problem.
- .sp
- And for those ex-\f2Berkeley Mail\f1 fans, you can translate your
- aliases into the format that Elm wants by running them
- through the \f2awk\f1 script listed in the appendix.
- .sp
- Finally, if you have any problems or questions, try looking in
- the \f2newalias\f1 manual entry.
- .bp
- .ce 99
- \f3Appendix One
- An \f2awk\fP Script for Translating Aliases
- from a Berkeley Mail \f2.mailrc\fP File
- to an Elm \f2.elm/aliases.text\fP File\f1
- .ce 0
- .sp
- .nf
-
- .ta .5i
- .ft CW
- .zf
- BEGIN { print "# Elm .elm/aliases.text file, from a .mailrc file..."
- print ""
- }
- next_line == 1 {
- next_line = 0;
- group = ""
- for (i = 1; i <= NF; i++) {
- if (i == NF && $i == "\\\\") sep = ""
- else sep = ", "
- if ($i == "\\\\") {
- group = sprintf("%s,", group)
- next_line = 1;
- }
- else if (length(group) > 0)
- group = sprintf("%s%s%s", group, sep, $i);
- else
- group = $i;
- }
- print "\\t" group
- }
- $1 ~ /[Aa]lias | [Gg]roup/ {
- if ( NF == 3)
- print $2 " = user alias = " $3;
- else {
- group = ""
- for (i = 3; i <= NF; i++) {
- if (i == NF && $i == "\\\\") sep = ""
- else sep = ", "
- if ($i == "\\\\") {
- group = sprintf("%s,", group)
- next_line = 1;
- }
- else if (length(group) > 0)
- group = sprintf("%s%s%s", group, sep, $i);
- else
- group = $i;
- }
- print $2 " = group alias = " group;
- }
- }
-
- .ft 1
- .fi
- Note: this script is contained in the release as \f2utils/mailrc.awk\f1.
--- 0 ----
Index: elmME+.2.5.alpha1-cvs/doc/Config.guid
*** elmME+.2.5.alpha0/doc/Config.guid 2002-01-26 13:14:45.000000000 +0200
--- /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
***************
*** 1,390 ****
- .\" @(#)$Id: Config.guid,v 1.1.1.1 1998/10/15 15:36:39 hurtta Exp $
- .\"
- .\" A guide to the ELM alias system and so on.
- .\" format with:
- .\" 'troff tmac.n Config.guid > Config.fmtd'
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust
- .\"
- .\"
- .\"
- .\"
- .tm Have we been run through "tbl" first?? I hope so!
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .za
- .sp |3.0i
- .ce 99
- .ps 20
- \f3Elm Configuration Guide\f1
- .sp 4
- .ps 12
- .ss 14
- .vs 14
- \f2How to install and customize the Elm mail system\f1
- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp |9.0i
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .ps 10
- .ss 12
- .vs 12
- .fi
- .ad
- .bp 1
- .fi
- .ad
- .bp 1
- .sv 5v
- .ps 14
- \f3Elm Configuration Guide\f1
- .ds h0 "Elm Configuration Guide
- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- .sp 2
- Syd Weinstein


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- This document is intended as a supplement to the \f2Elm Users Guide\f1
- and \f2Elm Reference Guide\f1
- and should be of interest mainly to people at a site installing,
- maintaining, and/or modifying the source code to the Elm mail system.
- .sp
- It is \f2required\f1 that installation be done by using the
- \f2Configure\f1 script supplied with the system. Please see the
- file \f2Instruct\f1 for further information on running \f2Configure\f1.
- .sp
- The remainder of this document discusses the various questions
- asked by the \f2Configure\f1 script and the
- options available via direct editing of various files and
- parameters. As indicated above, almost all of the sites that install
- Elm should find the \f2Configure\f1 script more than
- sufficient.
- .hu Using \f2Configure\fP
-
- \f2Configure\fP is a shell script that automatically determines the
- type of system it is running on and tunes the parameters of Elm to fit
- that system and its environment. Where the installer has a choice, it
- asks questions of the installer. \f2Configure\fP provides its own
- instructions when run, so they are not repeated here. However, when
- the installer is presented with a choice, this next section explains
- some of the options available. Not all the questions or options to
- those questions are explained here.
- .sp
- .ne 6
- \f3Use fcntl style locking?\f1
- .br
- \f3Use flock style locking?\f1
- .br
- \f3Use dotlock (.lock) style locking?\f1
- .sp
- Elm, like all Mail User Agents (MUAs), has times when it needs exclusive
- access to the mail spool file. There are three methods of locking the
- mail spool file: \f2.lock\f1 files, \f2fcntl\f1, and \f2flock\f1.
- \&\f2.lock\f1 files is the original method,
- and is used by MUAs and Mail Transport Agents (MTAs). Whenever
- possible \f2.lock\f1 files should be enabled to assure backwards
- compatibility with older MUAs and MTAs.
- .sp
- BSD systems introduced \f2flock\f1 style locking. It uses the
- \f2flock(2)\f1 system call
- to lock the file on the local node. System V later introduced
- \f2fcntl\f1 style locking, which can also use a protocol for remote locking
- across the network. Where both styles are available, it is advisable
- to use both, unless you are sure that only one is in use at your site.
- Under many System V Release 4 (SVR4) systems, they both use the same underlying
- system call (\f2flock\f1 is translated into \f2fcntl\f1 style locking),
- so for that version of
- .ux ,
- \f2flock\f1 is not needed and \f2fcntl\f1 style alone can be used.
- .sp
- .ne 4
- \f3Enable calendar feature?\f1
- .sp
- Elm has a feature to take specially marked lines within mail messages
- and add them to a file for use by the system calendar program. The
- command to do this extraction needs to be enabled to work. There is
- also a follow on question regarding the name of the calendar file:
- .sp
- .ti .5i
- \f3Default calendar file?\f1
- .sp
- which is usually \f2calendar\f1 on most systems. This file resides in
- the user's home directory, not their \f2.elm\f1 directory.
- .sp
- .ne 5
- \f3Does your /etc/passwd file keep full names in Berkeley/V7 format (name
- first thing after \*q:\*u in GCOS field)?\f1
- .sp
- Elm uses the full name from the password file if it is available.
- There are two major ways this name is stored. Berkeley/V7 systems
- place the name as the entire GCOS field string, that is it starts
- directly after the \*q:\*u that delimits the fields. USG (UNIX Systems
- Group, or AT&T) systems put the user's name after a department number
- and separate it from that number by a hyphen (\*q\-\*u).
- The end of the user's full
- name in these systems is a \*q(\*u. Look at your \f2/etc/passwd\f1 file and if
- either version applies, answer \f2yes\f1 to this question; if neither
- applies, answer \f2no\f1. Elm can still get the user's name from the
- \&\f2.fullname\f1 file in their home directory.
- .sp
- .ne 6
- \f3Every now and then someone has a gethostname()/uname() that lies about
- the hostname but can't be fixed for political or economic reasons.
- Would you like to pretend gethostname()/uname() isn't there and maybe
- compile in the hostname?\f1
- .sp
- Elm needs to know the correct name of the host on which it is executing
- to be able to create the proper headers for the outbound mail. Some
- systems use one name for uucp and another name for the system and
- others just don't reply to the subroutines with the proper name. In
- this case it will be necessary to compile in the name. In all other
- cases this should not be needed. It is provided just in case there is
- a problem with your system.
- .sp
- .ne 4
- \f3Honors Content-Length: header?\f1
- .sp
- Starting with SVR4, many of the MTAs are
- binary transparent. This allows for sending binary messages, such as
- encoded voice or graphics. In doing so, they no longer can tolerate changes in
- the message content by the mailers to aid in determining the start of
- the next message. To solve this problem the \f3Content-Length:\f1 header was
- added. Elm generates the \f3Content-Length:\f1 header, but to make full use
- of it, Elm should also not escape such sequences as \*QFrom \*U at the
- start of a line of the message. If your MTA (mailer)
- does honor the \f3Content-Length:\f1 header for determining the start of the
- next message, answer this question \f2yes\f1.
- .sp
- Along the same lines, but now obsolete and being phased out, is a
- problem where an MTA thinks a message is terminated
- by a single lone period on a line. \f2sendmail\f1 has an option to turn off
- this behavior and this option is set by default in \f2Configure\f1. If your
- mailer cannot turn off this option, add a line to \f2sysdefs.SH\f1 to define
- the symbol \f3NEED_LONE_PERIOD_ESCAPE\f1. This symbol turns a line with
- a lone period into a period and a blank to avoid this problem.
- This symbol is ignored if the \*QHonors Content-Length: header?\*U question
- is answered \f2yes\f1.
- .sp
- .ne 4
- \f3Am I going to be running as a setgid program?\f1
- .sp
- On USG and many other type systems, access to the mailboxes and
- the mailbox directory is via the group permissions. The MUAs,
- such as Elm, need write access in this directory to be able
- to move the mailbox around for internal editing and to create lock
- files. If the permissions on your mailbox directory are \*Qdrwxrwxr-x\*U
- (no write access for \*Qothers\*U),
- then Elm needs to be a \f2setgid\f1 program.
- .sp
- .ne 4
- \f3What is the default editor on your system?\f1
- .sp
- If no editor is specified in the user's \f2.elm/elmrc\f1 file, this is
- which editor to use. The editor is used to compose outbound mail
- messages.
- .sp
- .ne 4
- \f3What pager do you prefer to use with Elm?\f1
- .sp
- This is the standard pager to use for reading messages. Besides the
- usual system pagers, two Elm specific internal options exist: \f2builtin\f1
- and \f2builtin+\f1. The \f2builtin\f1 pager is faster to execute but much less
- flexible than the system provided pagers. The \f2builtin+\f1 pager just clears
- the page before displaying the next page, otherwise the two versions
- are identical.
- .hu Other Configurable Parameters
- The following parameters rarely need to be changed, but are provided if
- you need them. \f2Configure\fP does not prompt for their values. To
- change them, edit the \f2hdrs/sysdefs.h\f1 file directly after running
- \f2Configure\f1.
- .lp MAX_IN_WEEDLIST 1.0i
- The maximum number of headers that can be specified in the weedout
- list of the \f2.elm/elmrc\f1 file. A suggested alternative approach if this
- number is too small is to specify initial substrings in the file
- rather than increasing the number. For example, say you want to
- weedout the headers \*QLatitude:\*U and \*QLatitudinal-Coords:\*U, you
- could simply specify \*QLatitud\*U and match them both! Furthermore
- you could also specify headers like \*QX\-\*U and remove all the user
- defined headers!
- .lp MAX_HOPS 1.0i
- When using the \f3group reply\f1 command, this is the maximum number of
- hops that a message can have taken. This is used to try to optimize the
- return address (remove cyclic loops and so on) and regular use
- should show that the default of 35 is plenty more than you'll
- ever need!
- .lp system_text_file 1.0i
- This is the source text file for the system level aliases.
- See either the \f2newalias\f1 man page or \f2The Elm
- Alias System Users Guide\f1 for further details.
- .lp system_hash_file 1.0i
- This is the file that contains the hashed version of the system
- aliases generated by \f2newalias\f1.
- .lp system_data_file 1.0i
- This is the other file the \f2newalias\f1 command installs in the system
- alias area and contains the actual addresses for each of the aliases
- contained in the hashed data file.
- .lp DEBUGFILE 1.0i
- The name of the file to put in the user's home directory if they choose to
- use the \f3\-d\f1 (\f3debug\f1) option.
- .lp OLDEBUG 1.0i
- The name of the file to save the previous debug output as (this feature
- was added to ensure that users wanting to mail bug reports wouldn't
- automatically overwrite the debug log of the session in question).
- .lp temp_lock_dir 1.0i
- Directory for lock files for XENIX.
- .lp temp_file 1.0i
- Temporary file for sending outbound messages.
- .lp temp_form_file 1.0i
- A place to store temporary forms (for Forms Mode) while answering them.
- .lp temp_mbox 1.0i
- Place to keep a copy of the incoming mailbox to avoid collisions with newer
- mail.
- .lp temp_print 1.0i
- File to use when creating a printout of a message.
- .lp temp_edit 1.0i
- File to use when editing the mailbox file on XENIX.
- .lp temp_uuname 1.0i
- Where to redirect output of the \f2uuname\f1 command.
- .lp mailtime_file 1.0i
- File to compare date to to determine if a given message is new
- since the last time the mail was read or not.
- .lp readmsg_file 1.0i
- File to use when communicating with the \f2readmsg\f1 program (see
- that program for more information).
- .lp smflags 1.0i
- Defines the options to hand to \f2sendmail\f1 if and when the program
- chooses to use it.
- .lp smflagsv 1.0i
- Defines the options to hand to \f2sendmail\f1 in verbose voyeur mode.
- .lp mailer 1.0i
- If you don't have \f2sendmail\f1, this is the mailer that'll be used.
- .lp helpfile 1.0i
- The help file name prefix.
- .lp ELMRC_INFO 1.0i
- The file containing textual messages associated with each
- Elm variable setting in the user's \f2.elm/elmrc\f1
- file. This is used when the user chooses to save the
- options from within the main program.
- .lp elmrcfile 1.0i
- The name of the automatic control file within the \f2.elm\f1
- directory (by default \f2elmrc\f1).
- .lp old_elmrcfile 1.0i
- When a new \f2elmrc\f1 file is saved, the old one is also saved by
- renaming it to whatever this identifier is set to.
- .lp system_rc_file 1.0i
- The name of the global \f2elmrc\f1 file (default is \f2$lib/elm.rc\f1). This
- is where the system administrator puts global default values for any
- parameters controlled by the \f2.elm/elmrc\f1 file.
- .lp mailheaders 1.0i
- The name of the optional file that users may have that is
- included in the headers of each outbound message.
- .lp dead_letter 1.0i
- If the user decides not to send a message it is instead saved
- to this filename in their home directory.
- .lp unedited_mail 1.0i
- In the strange case when the mailer suddenly finds all the directories
- it uses shut off (like \f2/usr/mail\f1 and \f2/tmp\f1)
- then it'll put the current
- mailbox into this file in the user's home directory.
- .lp newalias 1.0i
- How to install new aliases (note that you MUST have the \f3\-g\f1 option!).
- .lp readmsg 1.0i
- What the \f2readmsg\f1 program is installed as.
- .hu Runtime configuration \(em the global \f2$lib/elm.rc\fP file
-
- No global default file is provided as part of the installation of
- Elm. If you wish to override any default parameters for all
- users, create a file as defined in the \f3system_rc_file\f1 above. An
- easy way to create it is to copy a saved \f2.elm/elmrc\f1 and edit it
- to remove all user-specific parameters. Of particular interest are
- three additional parameters you may set: \f3hostdomain\f1, \f3hostfullname\f1,
- and \f3hostname\f1. See \f3String Variables\f1 in section 2
- of the \f2Elm Reference Guide\f1 for details on these variables.
- .hu When \f2Configure\fP Fails
-
- The \f2Configure\f1 script has run successfully tens of thousands of
- times. But maybe your system is the one in ten thousand that will
- confuse it. For example, \f2Configure\f1 assumes that if your system
- has a feature it would like, then it should be used. If vendors never
- made mistakes, then that might be a good assumption. In reality,
- \f2Configure\f1 might want to use a feature you'd prefer it didn't.
- .sp
- When \f2Configure\f1 completes its examination of your system, it
- gives you a final chance to make changes. When \f2Configure\f1 asks
- .sp
- .ti .5i
- \f3If you need to edit config.sh, do it as a shell escape here:\f1
- .sp
- you may briefly jump out of \f2Configure\f1 to make changes. For
- example, if \f2vi\f1 is your preferred editor, type \f3!vi config.sh\f1.
- .sp
- Unfortunately, \f2Configure\f1 makes the same mistakes every time it
- runs. This means that if you ever apply updates or changes to the
- Elm system and rerun \f2Configure\f1, you will have to manually make
- the same configuration changes. Or more likely, you'll forget that
- the changes are required.
- .sp
- The solution to this problem is to create a \f2config.over\f1 file
- in the Elm base directory. This file may contain any valid \f2sh\f1
- commands, and is loaded by \f2Configure\f1 immediately before the
- \f2config.sh\f1 file is created.
- For example, supposed that \f2Configure\f1 creates a \f2config.sh\f1
- file with the definition
- .sp
- .ti .5i
- \f3d_feature=define\f1
- .sp
- but instead you want it to say
- .sp
- .ti .5i
- \f3d_feature=undef\f1
- .sp
- All you need to do is create a \f2config.over\f1 file and put that
- final line in it.
--- 0 ----
Index: elmME+.2.5.alpha1-cvs/doc/Elm.cover
*** elmME+.2.5.alpha0/doc/Elm.cover 2002-01-26 13:14:45.000000000 +0200
--- /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
***************
*** 1,69 ****
- .\" @(#)$Id: Elm.cover,v 1.2 1998/10/20 19:57:19 hurtta Exp $
- .\"
- .\" Cover sheet for the ELM mail system...
- .\" format with
- .\" troff tmac.n Elm.cover > Coversheet.fmtd'
- .\"
- .\" Elm is now in the public trust.
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust
- .\"
- .\"
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 8
- .lg 0
- .nf
- .na
- .rs
- .za
- .sv |2.0i
- .ce 99
- .ps 28
- \fBThe \s30Elm\s28 Mail System\fR
- .sp 2
- .ps 18
- .ss 16
- .vs 20
- \fIA Replacement Mailer for All Unix Systems\fR
- .sp 3
- \fBUSENET VERSION\fR
- .sp
- (2.4 Release System)
- .ps 14
- .vs 16
- .sp
- Syd Weinstein, Elm Coordinator


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 5
- .ps 10
- .ss 10
- .vs 12
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s11@\s10intuitive.com \ or \ limbo!taylor
-
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .sp
- .fi
- NOTICE: You may, without additional permission from the authors, distribute
- copies of the Elm Documentation, with or without additions developed by
- you or by others at no charge or at a charge that covers the cost of
- reproducing the copies, provided that the Elm copyright notice is retained.
--- 0 ----
Index: elmME+.2.5.alpha1-cvs/doc/elmrc-info
*** elmME+.2.5.alpha0/doc/elmrc-info 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/doc/elmrc-info 2004-07-03 18:23:02.000000000 +0300
***************
*** 1,4 ****


! #@(#)$Id: elmrc-info,v 1.61.2.12 2004/05/15 20:11:35 hurtta Exp $

# Elm Version ME+ 2.5
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.

--- 1,4 ----
! #@(#)$Id: elmrc-info,v 1.61.2.13 2004/07/03 15:23:02 hurtta Exp $


# Elm Version ME+ 2.5
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.

***************
*** 707,712 ****
--- 707,720 ----


# messages so that the receiver can correctly view the message!
# OFF: Elm will include the forwarded message in your editor instead
# of making it an separate mime body part.

+ #


+ # See also: askmimeforward
+
+ askmimeforward
+ # This option controls is forwarding as message/rfc822 prompted or not
+ # if set, option mnimeforward controls only default value for prompt

+ #


+ # See also: mimeforward

quoteforward
# Forwarded messages are quoted like replies, rather than included
***************

*** 747,752 ****
--- 755,763 ----


# none Don't call gpg
# /path Call gpg via that path, if it is executable

+ pgp-interactive
+ # Run pgp/gpg signing and encryption always on interactive mode
+
pgp-sign-type
# Specifies content-type for pgp signed messages.
# Possible values are: application/pgp, text/plain, text/x-pgp

Index: elmME+.2.5.alpha1-cvs/doc/elmregister.1
*** elmME+.2.5.alpha0/doc/elmregister.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/doc/elmregister.1 2004-05-22 17:50:34.000000000 +0300


***************
*** 26,31 ****
--- 26,33 ----
.br
.B #LIB#/elmregister copy
.br
+ .B #LIB#/elmregister copydoc
+ .br
.B #LIB#/elmregister
.I command

***************

*** 105,108 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003 by Kari Hurtta

--- 107,110 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003, 2004 by Kari Hurtta

Index: elmME+.2.5.alpha1-cvs/doc/Form.guide
*** elmME+.2.5.alpha0/doc/Form.guide 2002-01-26 13:14:45.000000000 +0200
--- /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
***************
*** 1,402 ****
- .\" @(#)$Id: Form.guide,v 1.2 1998/10/20 19:57:19 hurtta Exp $
- .\"
- .\" A guide to using the Elm Forms mode
- .\" format with:
- .\" 'troff tmac.n - > Forms.format'
- .\"
- .\" Elm is now in the public trust.
- .\"
- .\" Copyright (c) 1988-1992 USENET Community Trust
- .\" Copyright (c) 1986,1987 Dave Taylor
- .\"
- .\"
- .\"
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .\" Define the big box macro for troff
- .de eb
- .sp -1
- .nf
- .ie t \{\
- \h'-.5n'\L'|\\nau-1'\l'\\n(.lu+1n\(ul'\L'-|\\nau+1'\l'|0u-.5n\(ul'
- .\}
- .el \{\
- \h'-.5n'\l'\\n(.lu+1n'
- .\}
- .fi
- ..
- .sv |3.0i
- .ce 99
- .ps 20
- .ss 18
- .vs 12
- \f3Elm Forms Mode Guide\f1
- .sp 3
- .ps 12
- .ss 14
- .vs 14
- \f2What Forms Mode is, how to use it to create
- custom forms, how to reply to forms, and how to
- use it for AT&T Mail messages\f1
- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp |9.0i
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .fi
- .ad
- .bp 1
- .sv 5v
- .ps 14
- .ss 12
- .vs 16
- .sp 2
- \f3A Guide to Forms Mode in Elm\f1
- .ds h0 "Forms Mode Guide
- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- Syd Weinstein


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- While there are a lot of mail systems that allow the transmission
- of text and primitive pictures, to send and reply to more complex
- forms is simply not possible. Elm, however, took
- the forms mode implemented as part of the AT&T Mail package and has
- expanded on it to be a smoothly fit part of the overall mail system.
- .sp
- Forms mode gives you the ability to send \*Qtemplate\*U files to people
- and receive the filled-in replies.\s-2\u1\d\s0
- .fn
- 1. Note that this feature assumes that the person on the other end is
- also using the Elm mail system, that both yourself and the person on
- the other end have their user levels set to something other than
- \f2Beginner\f1 (\f30\f1) and the \f3forms\f1 variable set ON in
- their \f2.elm/elmrc\f1 files.
- .ef
- Let's look at an example right off.
- .sp
- Say we were going to use computer mail as a way to file defects with
- software. There is a certain amount of information we want to be able
- to collect when each report is made, and if it is in a specific format
- we can use programs to file the defects upon receipt.
- .sp
- The form we'll try to emulate starts out looking like:
- .\" A manual page break has been done because the 'sd' macro doesn't like
- .\" coming up right after the footer or just doesn't like going to a new
- .\" page by itself. The bug has been reported.
- .bp
- .ft CW
- .zf
- .sd c
- .mk a
- .sp
- .tl ''Defect Reporting Form''
- .sp
- .tl 'Program:\ \l'2.3i-\w'Program:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
- .tl 'Operating\ System:\ \l'2.3i-\w'Operating\ System:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
- .sp
- .tl 'Defect\ Type:\ \l'2.3i-\w'Defect\ Type:\ 'u''''
- .sp
- .tl 'Date\ Found:\ \l'2.3i-\w'Date\ Found:\ 'u'''By\ Whom:\ \l'2.3i-\w'By\ Whom:\ 'u'\h'.2i''
- .tl 'Date\ Reported:\ \l'2.3i-\w'Date\ Reported:\ 'u'''Phone:\ \l'2.3i-\w'Phone:\ 'u'\h'.2i''
- .sp
- .tl 'Description:\ \l'6.4i-\w'Description:\ 'u''''
- .tl '\l'6.4i''''
- .tl '\l'6.4i''''
- .sp
- .eb
- .ed
- .ft 1
- .rs \" restore spacing from ed macro
- .sp
- This form can actually be created almost exactly as listed above in
- the Elm mail system by using your standard editor and can then
- be mailed about as needed.
- .sp
- Let's say that we want a bit more information, however, especially with
- fields like \f2Defect Type\f1, we want to list all the recommended answers.
- To create the actual form, we need merely to replace the underlines in
- the above form with spaces. The multi-line comments can simply be
- indicated by a \*q:\*u by itself on a line:
-
- .ft CW
- .zf
- .sd c
- .mk a
- .sp
- .tl ''Defect Reporting Form''
- .sp
- .tl 'Program:''Version:\h'1.7i-\w'Version:'u''
- .tl 'Operating System:''Version:\h'1.7i-\w'Version:'u''
- .sp
- .tl '(Valid Defect Types are: user-error, doc-error, fatal, other)'''
- .tl 'Defect Type:'''
- .sp
- .tl 'Date Found:''By\ Whom:\h'2.3i-\w'By\ Whom:'u''
- .tl 'Date Reported:''Phone:\h'2.3i-\w'Phone:'u''
- .sp
- .tl 'Description'''
- .tl ':'''
- .sp
- Thank you for filling in this form.
- .sp 2
- .eb
- .ed
- .ft 1
- .rs \" restore spacing from ed macro
- .sp
- As you can see, it is quite simple to create forms!!
- .sp
- Now that you have an idea what we're talking about, let's actually officially
- define the system.
- .br
- .ne 5
- .hu Forms Mode Specification
-
- [Note that this is all taken from the document \f2Standard for Exchanging
- Forms on AT&T Mail\f1, Version 1.9 of 6/7/86, from AT&T.]
- .sp
- The forms mode is really quite simple. Simple enough that it is amazing
- that it hadn't been implemented before AT&T Mail came along!!
- .sp
- In a nutshell, each field is delimited by a \*q:\*u followed by a number of
- blank spaces or tabs that represent the valid size for that field. That
- is, if we have a line in the form like:
- .sp
- .nf
- .ft CW
- .zf
- .tl ''Phone (area-code):\0\0\0\0\0Number:\0\0\0\0\0\0\0\0\0\0''
- .ft 1
- .fi
- .sp
- The area-code field is limited to three characters and the number to nine
- (this is kind of hard to see with the proportionally spaced formatted copy,
- alas).
- The only exception to the rule is that a \*q:\*u by itself on a line represents
- a field that is as large as the user entering the data desires.
-
- The actual form that is transmitted, in AT&T Mail parlance, is a \*QSIMPLE\*U
- forms handler message (as opposed to the \*QADVANCED\*U handler). This means
- that it contains three sections:
- .sp
- .ne 8
- .nf
- .in .5i
- .ft 2
- The Message Header
- .ft CW
- .zf
- [\&OPTIONS-SECTION]
- ***
- [\&FORMS-IMAGE]
- ***
- [\&RULES-SECTION]\f1
- .in 0
- .fi
- .sp
- Elm generates form messages with the \f2OPTIONS-SECTION\f1 filled out,
- but ignores it when receiving mail. The filled out \f2OPTIONS-SECTION\f1 is:
- .sp
- .ft CW
- .zf
- .nf
- .in .5i
- WIDTH=80
- TYPE=SIMPLE
- OUTPUT=TEXT\f1
- .in 0
- .fi
- .sp
- The \f2FORMS-IMAGE\f1 section is that described above, i.e. prompting
- text followed by a \*q:\*u, followed by spaces or tabs.
- The \f2RULES-SECTION\f1 can
- contain explicit rules about the possible values of each field, but
- this is currently ignored by Elm, being a \*QSIMPLE\*U forms mode
- mail system.
- .sp
- Forms also have the header \*QContent-Type: mailform\*U to indicate to the
- mail system (either Elm or AT&T Mail) that a form is being sent.
- .sp
- Elm further indicates that a form has been received by having an
- \*qF\*u as the status character in the header display section (instead of
- \*qN\*u for new, etc).
- .br
- .ne 5
- .hu Composing and Sending a Form
-
- The first step to enable sending forms is to change the setting of
- the variable \f3forms\f1 in your \f2.elm/elmrc\f1 file to ON:
- .sp
- .nf
- .ti .5i
- forms = ON
- .fi
- .sp
- The next step is to send the message to someone using the \f3m\f1 (\f3mail\f1)
- command, which drops you into an editor. Type in the form as
- indicated above, with appropriate colons and comments, and end the entry
- by leaving the editor.
- .sp
- The prompt is now:
- .sp
- .nf
- .ft CW
- .zf
- .tl ''Choose: E)dit msg, edit H)eaders, M)ake form, S)end or F)orget : @''
- .ft 1
- .fi
- .sp
- so we choose \f3m\f1 \(em \f3make form\f1. Elm then either
- rewrites the prompt without the \*QM)ake form\*U option, indicating that
- the form has been accepted, or indicates the problem and gives you
- a chance to correct it.
- .sp
- Once it has been accepted, simply use the \f3s\f1 \(em \f3send message\f1 \(em
- command and it's off!
- .sp
- Note that you cannot reply to a message with a form.
- .br
- .ne 6
- .hu Replying to a Form
-
- Let's reply to the form message we generated now. The header page of the
- Elm mail system indicates that the message is a form by having
- an \*qF\*u next to it. So we use \f3r\f1 to reply and the screen is immediately
- cleared and we're prompted, field by field, for the data requested.
- Each field has underscores in the input area to indicate the size field that
- is expected.
- .sp
- After answering all the questions we'll have a screen that looks like:
-
- .ft CW
- .zf
- .sd c
- .mk a
- .sp
- .tl ''Defect Reporting Form''
- .sp
- Program: \f3The Elm Mail System\f1\l'3i-\w'\f3The Elm Mail System'u'
- Version: \f31.5\f1\l'3i-\w'\f31.5'u'
- Operating System: \f3HP-UX\f1\l'3i-\w'\f3HP-UX'u'
- Version: \f35.141 C\f1\l'3i-\w'\f35.141 C'u'
- .sp
- (Valid Defect Types are: user-error, doc-error, fatal, other)
- Defect Type: \f3fatal\f1\l'5i-\w'\f3fatal\f1'u'
- .sp
- Date Found: \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u'
- By Whom: \f3Dave Taylor\f1\l'3i-\w'\f3Dave Taylor\f1'u'
- Date Reported: \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u'
- Phone: \f3(415) 857\-6887\f1\l'3i-\w'\f3(415) 857-6887\f1'u'
- .sp
- Description
- (Enter as many lines as needed, ending with a \*q.\*u by itself on a line)
- \f3When running it on a CPM system I cannot compile successfully.\f1
- \f3.\f1
- Thank you for filling in this form.
- .tl ''Choose: E)dit form, edit H)eaders, S)end or F)orget : @''
- .sp
- .eb
- .ed
- .ft 1
- .rs \" restore spacing from ed macro
- .sp
- Quite simple. Notice, however, that the order of prompting is
- left-to-right on each line, so the fields, \f2By Whom:\f1 and
- \f2Phone:\f1, although placed in what seems like a logical place on the
- form, turn out to be confusing when filling in the received form since
- it isn't clear what \f2Phone:\f1 is being asked for because of the
- intervention of the \f2Date Reported:\f1 field.
- .sp
- The message that is actually sent out from this has the
- fields in a more acceptable format:
- .\" Force page break, as there seems to be a bug in the .sd macro
- .bp
- .\"
- .ft CW
- .zf
- .mk a
- .sp
- WIDTH=80
- TYPE=SIMPLE
- OUTPUT=TEXT
- ***
- .tl ''Defect Reporting Form''
- .sp
- .tl ' Program: The Elm Mail System''Version: 1.5\h'1.5i-\w'Version: 1.5'u''
- .tl ' Operating System: HP-UX''Version: 5.141 C\h'1.5i-\w'Version: 5.141 C'u''
- .sp
- .tl ' (Valid Defect Types are: user-error, doc-error, fatal, other)'''
- .tl ' Defect Type: fatal'''
- .sp
- .tl ' Date Found: 10/9/86''By Whom: Dave Taylor\h'2.3i-\w'By Whom: Dave Taylor'u''
- .tl ' Date Reported: 10/9/86''Phone: (415) 857-6887\h'2.3i-\w'Phone: (415) 857-6887'u''
- .sp
- .tl ' Description'''
- .sp
- When running it on a CPM system I cannot compile successfully.
- .sp
- .tl ' Thank you for filling in this form.'''
- ***
- .sp
- .eb
- .ft 1
-
- .hu Comments on Forms Mode
-
- As was said at the beginning, this way of sending about forms could
- prove to be very helpful and useful in a variety of contexts. On the
- other hand, until a more sophisticated forms language is used for the
- forms, this should be sufficient to embody the power of the idea.
- .sp
- I welcome any comments and thoughts on this system and also welcome
- possible enhancements.
- .sp
- I also gratefully thank Dale DeJager of AT&T Information Systems
- for sending me more
- information on AT&T Mail than I could possibly digest in any finite
- amount of time.
--- 0 ----
Index: elmME+.2.5.alpha1-cvs/doc/Makefile.SH
*** elmME+.2.5.alpha0/doc/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elmME+.2.5.alpha1-cvs/doc/Makefile.SH 2004-07-03 20:46:54.000000000 +0300
***************
*** 17,23 ****


cat >Makefile <<!GROK!THIS!
#!$make
#

! # $Id: Makefile.SH,v 1.30 2004/01/03 20:12:28 hurtta Exp $
#


# Makefile for the documentation of the ELM mail system
#

--- 17,23 ----
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.30.26.2 2004/07/03 17:46:54 hurtta Exp $
#


# Makefile for the documentation of the ELM mail system
#
***************

*** 32,39 ****
SUBS = 's"\#LIB\#"$lib"g; s"\#ETC\#"$etc"g;'
DEST = $bin
ECHO = $echo
- FORMATTER = $roff
- FORMATTER_OPTS = $roffopts
LIB = \$(ELM_ROOT)//$lib
LN = $ln
MAN = \$(ELM_ROOT)//$mansrc
--- 32,37 ----
***************
*** 68,92 ****
REGCATMAN = $regcatman

!GROK!THIS!
- if $test "$roff" != none ; then
- cat >>Makefile <<!GROK!THIS!
- # List of formatted guides (obsolete)
- FORMATTED_LIST = Alias.fmtd \
- Config.fmtd \
- Cover.fmtd \
- Form.fmtd \
- Ref.fmtd \
- Users.fmtd
-
- !GROK!THIS!
- else
- cat >>Makefile <<!GROK!THIS!
- # No formatted quides (obsolete)
- FORMATTED_LIST =
-
- !GROK!THIS!
- fi
-

if $test "$make_sets_make" != "$define" ; then

--- 66,71 ----

--- 282,318 ----

--- 321,354 ----

--- 371,425 ----

--- 432,447 ----
$(REG) link $? $@


$(CATMAN)/elmstringconvert$(CATMANEXT)$(SUFFIX): catman/elmstringconvert$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/prlong$(CATMANEXT)$(SUFFIX): catman/prlong$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmregister$(CATMANEXT)$(SUFFIX): catman/elmregister$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

$(CATMAN)/elmlibregister$(CATMANEXT)$(SUFFIX): catman/elmlibregister$(CATMANEXT)$(SUFFIX)
! $(REG) copydoc -m 444 $? $@

# Dependencies and rules for making catman pages
catman/answer$(CATMANEXT)$(SUFFIX): answer.1.subs

***************
*** 655,681 ****
true ; \
fi

- # Dependencies and rules for formatting guides
- documentation: $(FORMATTED_LIST)
-
- Alias.fmtd: Alias.guide
- $(TBL) $? | $(FORMATTER) $(FORMATTER_OPTS) tmac.n - > $@
-
- Config.fmtd: Config.guid
- $(TBL) $? | $(FORMATTER) $(FORMATTER_OPTS) tmac.n - > $@
-
- Cover.fmtd: Elm.cover
- $(FORMATTER) $(FORMATTER_OPTS) tmac.n $? > $@
-
- Form.fmtd: Form.guide
- $(FORMATTER) $(FORMATTER_OPTS) tmac.n $? > $@
-
- Ref.fmtd: Ref.guide
- $(FORMATTER) $(FORMATTER_OPTS) tmac.n $? > $@
-
- Users.fmtd: Users.guide
- $(TBL) $? | $(FORMATTER) $(FORMATTER_OPTS) tmac.n - > $@
-
!NO!SUBS!

case "$install_prefix" in
--- 634,639 ----
Index: elmME+.2.5.alpha1-cvs/doc/Ref.guide
*** elmME+.2.5.alpha0/doc/Ref.guide 2002-01-26 13:14:45.000000000 +0200
--- /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
***************
*** 1,2359 ****
- .\" @(#)$Id: Ref.guide,v 1.2 1998/10/20 19:57:19 hurtta Exp $
- .\"
- .\" Reference guide to the Elm mail system.
- .\" format with
- .\" troff tmac.n Ref.guide > Ref.format
- .\"
- .\" Elm is now in the public trust.
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust
- .\"
- .\"
- .\"
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .za
- .sv |3.0i
- .ce 99
- .ps 20
- .ss 18
- .vs 12
- \f3The Elm Reference Guide\f1
- .sp 4
- .ps 12
- .ss 14
- .vs 14
- \f2A comprehensive list of all commands,
- options and such to the \f3Elm\fP mail system\f1
- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp |9.0i
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .fi
- .ad
- .bp 1
- .sv 5v
- .ce 99
- .ps 14
- .vs 16
- \f3The Elm Reference Guide\f1
- .ds h0 "Elm Reference Guide
- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- Syd Weinstein


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- .hn 1 Introduction
-
- There are many parts to a complex software system and \f3The Elm
- Mail System\f1
- is no different. This document describes fully all the options
- available in the mailer, including the command line options,
- the commands (in considerably more detail than
- in \f2The Elm Users Guide\f1) and
- the \f2.elm/elmrc\f1 file.
-
- To be more explicit, this document covers:
- a discussion of
- the \f2.elm/elmrc\f1 file,
- command line options of Elm,
- outgoing mail processing,
- responses of various commands,
- mail archive folders,
- the Alias system,
- system aliases etc,
- more on the Elm utilities,
- and a section for expert mail users.
-
- Without any further ado, then, let's get this show on the road!!
- .sp
- .ne 8 \" footnote for UNIX forces text to next page but leaves footnote & hdr
- .hn 1 "The .elm/elmrc File"
-
- Elm, like lots of other software on the
- .ux
- system, has the ability to automatically read
- in a configuration file at each invocation. The file must be
- called \f2elmrc\f1 and reside in the \f2.elm\f1 directory located
- in your home directory. It can have any of the entries below, in any order.
- If you are missing any entries, or if you don't have an \f2.elm/elmrc\f1
- file, the default values (listed below for each option) or those values specified
- by your systems administrator in a system wide \f2elm.rc\f1 file are used.
- Note that those options below designated with \*q*\*u can be altered
- using Elm via the options screen, while those designated with a
- \*q+\*u can be placed
- on the options screen using the \f3configoptions\f1 variable.
- Also note that when you save a new \f2.elm/elmrc\f1 file via the \*q>\*u command
- of the options
- screen, it is (re)created including only those options that you
- have changed via your original \f2.elm/elmrc\f1 file or via the options screen.
-
- The format for each line of the \f2.elm/elmrc\f1 file is:
- .sp
- .nf
- .ft CW
- .zf
- .ti +.5i
- variable = value\f1
- .fi
- .sp
- .ne 8
- .hu String Variables
-
- .lp aliassortby* 1.0i
- You can have your alias display sorted by any of the following ways:
- .si 1.5i
- .lp alias 10n
- Sorts according to \f2aliasname\f1 for each address.
- .lp name 10n
- Sorts according to \f2username\f1 for each address.
- .lp text 10n
- Presents the aliases in the order found in the
- \f2aliases.text\f1 file.
- .ei
- .in 1.0i \" ei doesn't restore margin
- .sp
- Each of these fields can also optionally be prepended with the
- sequence \*Qreverse\-\*U to reverse the order of the sort. This doesn't
- imply anything about the order of the message in the \f2aliases.text\f1
- file itself and affects only their order on the display screen. The
- default is \f2name\f1 order.
-
- .lp alteditor+ 1.0i
- The editor to use when mailing to a message that already includes text,
- as the builtin editor cannot handle that situation. Messages that
- already include text are forwarded messages and replies where the
- original message is included in the reply. This value is not needed
- if the \f3editor\f1 variable is not set to \*Qbuiltin\*U.
-
- .lp alternatives 1.0i
- This is a list of other machine/username combinations
- that you receive mail from (forwarded). This is used
- when the \f2group reply\f1 feature is invoked to ensure that
- you don't send yourself a copy of the outbound message.
- The default is a list of no alternatives.
-
- .lp attribution 1.0i
- When you \f3forward\f1 a message or \f3reply\f1 to it, you can
- optionally attribute the quoted text to its original author.
- Defining the attribution string here allows you to indicate the
- form that the attribution should take. The sequence \*Q%s\*U in the
- attribution is replaced by the name of the original author.
- Examples are:
- .sp
- .nf
- .in 1.5i
- .ft CW
- .zf
- attribution = According to %s:
- attribution = %s writes:
- .ft 1
- .in 0
- .fi
-
- .lp calendar* 1.0i
- This is used in conjunction with the \*q<\*u \f2scan message for
- calendar entries\f1 command, as the file to append any found
- calendar entries to. The default is \f2calendar\f1 in your home directory.
-
- .lp charset 1.0i
- This is the character set used for messages with a
- \*QContent-Type: text/plain\*U header.
- The default depends on your site's installation, but is usually
- US-ASCII. \f3charset\f1 is only recognized if MIME
- (Multipurpose Internet Mail Extension)
- support is configured. You could set \f3charset\f1 to your preferred
- national character set, but be aware that there is currently no way
- to change it online. Also you must be aware that Elm probably needs
- \f2metamail\f1 to display messages with \f3charset\f1=US-ASCII if you change
- \f3charset\f1. Elm tries to know which character set could display US-ASCII
- too, but its list of compatible character sets is probably not complete.
-
- .lp compatcharsets 1.0i
- This is the list of character sets which are more or less a superset
- of US-ASCII. This enables Elm to display messages with \f3charset\f1=US-ASCII
- with the builtin pager, or your preferred pager, instead of calling
- \f2metamail\f1. \f3compatcharsets\f1 is only recognized if MIME support
- is configured. The ISO-8859-X character sets are defaulted.
-
- .lp configoptions 1.0i
- This is a list of letters that indicate which of the run-time
- configurable options you desire placed on the options screen (see
- section 7, \f3Commands\f1, for the \f3options\f1 command). There
- are 22 run-time configurable options, but only room for 15 on a
- 24-line screen. The default list is \f2^_cdefsopyv_am_un\f1. Two
- additional characters can be specified for formatting. Those are \*q_\*u, which
- adds a blank line, and \*q^\*u, which places the title message on that line
- instead of the bottom of the screen. The
- letters \*qi\*u, \*qq\*u, and \*qx\*u are reserved for \*Qreturn to
- index\*U, \*Qquit\*U,
- and \*Qexit\*U, respectively, and are not listed as part of the
- \f3configoptions\f1
- list. The options controlled by each letter are:
- .sp
- .in 1.5i
- .ta 0.5i
- a A)rrow cursor \f2(arrow)\f1
- .br
- b B)order on copy \f2(prefix)\f1
- .br
- c C)alendar file \f2(calendar)\f1
- .br
- d D)isplay mail using \f2(pager)\f1
- .br
- e E)ditor (primary) \f2(editor)\f1
- .br
- f F)older directory \f2(maildir)\f1
- .br
- h H)old sent message \f2(copy)\f1
- .br
- j J) reply editor \f2(alteditor)\f1
- .br
- k K) pause after pager \f2(promptafter)\f1
- .br
- l A(l)ias Sorting \f2(aliassortby)\f1
- .br
- m M)enu display \f2(menu)\f1
- .br
- n N)ames only \f2(names)\f1
- .br
- o O)utbound mail saved \f2(sentmail)\f1
- .br
- p P)rint mail using \f2(print)\f1
- .br
- r R)eply copies msg \f2(autocopy)\f1
- .br
- s S)orting criteria \f2(sortby)\f1
- .br
- t T)ext editor (~e) \f2(easyeditor)\f1
- .br
- u U)ser level \f2(userlevel)\f1
- .br
- v V)isual Editor (~v) \f2(visualeditor)\f1
- .br
- w W)ant Cc: prompt \f2(askcc)\f1
- .br
- y Y)our full name \f2(fullname)\f1
- .br
- z Z) signature dashes \f2(sigdashes)\f1
-
- .lp displaycharset 1.0i
- This is the character set which is supported by your terminal.
- The default depends on your site's installation but is usually
- US-ASCII. For sites with
- .xw
- support, ISO-8859-1
- is a reasonable default.
-
- .lp easyeditor+ 1.0i
- The editor to be used by the \*Q~e\*U escape within the builtin editor.
- The default value is the value of the configuration variable \f2emacs_editor\f1
- (see \f2The Elm Configuration Guide\f1).
-
- .lp editor* 1.0i
- The editor to use when typing in new mail. If you select
- \*Qnone\*U or \*Qbuiltin\*U you'll get a Berkeley Mail style
- interface for all mail that doesn't already have text
- in the buffer (e.g. a reply, mail with a \*Qsignature\*U, etc.)
- There are two possible formats for it, either a command that
- can have a filename appended to it before being
- executed, or a string that contains the metasequence \*Q%s\*U
- which is replaced by the name of the file before being
- executed. Examples of each are:
-
- .nf
- .in 1.5i
- .ft CW
- .zf
- editor = emacs \-nw
- editor = emacs \-nw %s \-f text-mode \-f turn-on-auto-fill
- .ft 1
- .in 1.0i
- .fi
-
- The default is to use the value of $EDITOR in your
- current environment, and if not set, an editor selected by
- the person who configured Elm for your system.
-
- .lp escape 1.0i
- The character used with the builtin editor (see \f3editor\f1 above)
- to escape from text entry to input a command.
- When a line begins with this character, the builtin editor interprets it
- as a command rather than as text to add.
- The default is \*q~\*u (tilde).
-
- .lp fullname* 1.0i
- This is the name the mailer uses in messages
- you send. It is highly recommended that you use your
- full name and nothing strange or unusual, as that can
- appear extremely rude to people receiving your mail.
- The default is to use the \*Qgcos\*U field from the \f2/etc/passwd\f1 file
- on systems that use this field to store full names, and to use the contents
- of the \f2.\|fullname\f1 file in your home directory on other systems.
-
- .lp hostdomain 1.0i
- This is the domain name of your system.
- This variable is only valid in the system-wide \f2elm.rc\f1 file.
- It is only necessary if the value returned by
- the \f2getdomainname\f1 system call is incorrect for your mail use or
- if that system call is unavailable on your system.
- If this variable is specified, then the \f3hostfullname\f1 variable must
- also be specified.
-
- .lp hostfullname 1.0i
- This is the \*Qfully qualified domain name\*U of your system.
- This variable is only valid in the system-wide \f2elm.rc\f1 file.
- It is only necessary if the value returned by the \f2getdomainname\f1 and
- \f2gethostname\f1 system calls are incorrect for your mail use or if those
- system calls are unavailable on your system. It is required if either
- the \f3hostdomain\f1 or the \f3hostname\f1 variables are used within the
- system-wide \f2elm.rc\f1 file.
-
- .lp hostname 1.0i
- This is the local node-name of your system.
- This variable is only valid in the system wide \f2elm.rc\f1 file.
- It is only necessary if the value returned by
- the \f2gethostname\f1 system call is incorrect for your mail use or if
- that system call is unavailable on your system.
- If this variable is specified, then the \f3hostfullname\f1 variable must
- also be specified.
-
- .lp localsignature 1.0i
- See \f3signature\f1.
-
- .lp maildir* 1.0i
- This is your folder directory.
- When you specify a folder name beginning with the \*q=\*u metacharacter,\s-2\u1\d\s0
- .fn
- 1. Note that \*q%\*u and \*q+\*u are synonymous with \*q=\*u throughout Elm.
- .ef
- it stands for this directory name. That is,
- if you save a message to folder \f2=stuff\f1
- the \*q=\*u is expanded to the current value of \f3maildir\f1.
- The default is the directory \f2Mail\fP in your home directory.
-
- .lp pager* 1.0i
- This is the program to be used to display messages. You can
- specify \*Qbuiltin\*U or the name of any standard pager. If you
- use \*Qbuiltin+\*U, each screenfull of displayed message is
- \*Qpaged\*U from the top of your screen with a title line,
- while \*Qbuiltin\*U simply \*Qscrolls up\*U subsequent screenfulls once
- it has \*Qpaged\*U the first screenfull.
- The default is to use the value of $PAGER in your
- current environment, and if not set, a pager selected by
- the person who configured Elm for your system, quite likely
- \*Qbuiltin+\*U.
-
- .lp precedences 1.0i
- Some mail transports look at a \*QPrecedence\*U header in outbound
- mail messages to determine how to deliver the message. The Elm header
- editing menu allows you to place a precedence on your mail messages.
- By default, Elm allows any value to be specified as the message
- precedence. This option may be used to restrict the allowed precedences
- to a particular list. For example, you might say:
-
- .nf
- .in 1.5i
- .ft CW
- .zf
- precedences = special-delivery air-mail first-class bulk junk
- .ft 1
- .in 1.0i
- .fi
-
- Exactly what precedences your mail transport supports and what they
- do (if anything at all!) will vary from site to site.
-
- The distinction between the \*QPrecedence\*U and \*QPriority\*U headers
- is subtle: the precedence tells the mail system how to handle the
- message and the priority tells the recipient how important the message
- is. Although these are quite different things, they are often related.
- This option will also allow you to associate message priorities with
- precedences. For example, you might say:
-
- .nf
- .in 1.5i
- .ft CW
- .zf
- precedences = special-delivery:urgent air-mail:urgent first-class bulk junk
- .ft 1
- .in 1.0i
- .fi
-
- In this example, if you select an \*Qair-mail\*U precedence then the
- message priority defaults to \*Qurgent\*U. If you select a
- \*Qfirst-class\*U precedence then no special priority is implied. The
- priorities given in this field are used only if you have not already
- assigned a priority to your message, and even if one is assigned via
- \f3precedences\f1 you can always go back and change it.
-
- .lp prefix+ 1.0i
- When you \f3reply\f1 to a message or \f3forward\f1 a message to another person,
- you can optionally include the original message. Defining the
- prefix value here allows you to indicate what the prefix of
- each included line should be. The default is \*Q>\ \*U (specified as
- \*Q>_\*U \(em underscore is interpreted as space) and is
- standard in the
- .ux
- community.
-
- .lp print* 1.0i
- This is the command used for printing mail messages. There are two
- possible formats for the command, depending on whether or not the command
- contains the sequence \*Q%s\*U. In the first form the mail message(s) to
- be printed are piped to the specified command. An example of this
- form is:
- .sp
- .in 1.5i
- .ft CW
- .zf
- print = print \-formfeed
- .ft 1
- .in 1.0i
- .sp
- In the second form the mail message(s) to be printed are dumped into
- a temporary file, and a \*Q%s\*U in the command string is replaced with
- the name of the temporary file. An example of this form is:
- .sp
- .in 1.5i
- .ft CW
- .zf
- print = pr %s | lpr
- .ft 1
- .in 1.0i
- .sp
- Another significant difference between the two forms is that in the
- second form all output from the command is discarded, but in the first
- form all output is displayed on the terminal. For
- example, if you wish to use the \*Qpass-through\*U feature to print on
- the \*Qaux\*U port of a terminal, you must use the first form. The second
- form is provided for backward compatibility with old versions of Elm.
- It is depreciated and might be removed in a future release. The
- default is set by the person who configured Elm for your system.
-
- .lp receivedmail 1.0i
- This is the folder to which incoming mail is saved after you've read it.
- When you answer \f2no\f1 to \*QKeep unread messages in
- your incoming mailbox?\*U or \f2yes\f1 to \*QStore read
- messages in your \*Qreceived\*U folder?\*U, this is where the messages go.
- The default is \*Q=received\*U, that is,
- a folder called \f2received\f1 in your \f3maildir\f1 directory.
-
- .lp remotesignature 1.0i
- See \f3signature\f1.
-
- .lp sentmail* 1.0i
- This is the folder to which a copy of outgoing mail is automatically
- saved. This is only done if the \f3copy\f1 boolean variable is set
- ON. Also note that if the \f3savename\f1 boolean variable is enabled
- then this folder may be ignored since the program may save to a folder
- that has the same name as the login of the person you're sending to.
- Whether or not a copy is saved, and to what folder, can be changed just
- prior to sending a message (see the \f3copy\f1 command of the mail
- command sub-menu in section 7, \f3Commands\f1). The default is
- \*Q=sent\*U, that is, a folder called \f2sent\f1 in your \f3maildir\f1
- directory.
-
- .lp shell 1.0i
- This defines the shell to use when doing \*q!\*u escapes and
- such. The default is to use the value of $SHELL in your
- current environment, and if not set, a shell selected by
- the person who configured Elm for your system.
- Note that the \*q!\*u escape is optional and may not be enabled in your
- version of Elm.
-
- .lp signature 1.0i
- This defines the file that is automatically appended to all
- outbound mail before the editor is invoked. Furthermore,
- if you'd like a different signature file for \*Qlocal\*U
- mail and \*Qremote\*U mail (remote being via other hosts),
- you can alternatively define two variables, \f3localsignature\f1
- and \f3remotesignature\f1, to have the same functionality.
- The default is to not have signatures appended to your messages.
-
- .lp sortby* 1.0i
- You can have your folder sorted in any of the following ways:
- .si 1.5i
- .lp from 10n
- Sorts according to whom each message is \f2from\f1.
- .lp lines 10n
- Sorts \f2shortest\f1 to \f2longest\f1 by message.
- .lp mailbox 10n
- Leaves the messages in the order found in the folder.
- .lp received 10n
- Sorts \f2least recently received\f1 to \f2most recently received\f1.
- .lp sent 10n
- Sorts \f2least recently sent\f1 to \f2most recently sent\f1.
- .lp status 10n
- Sorts by \f2priority\f1, \f2action\f1, \f2new\f1, \f2tagged\f1, then
- \f2deleted\f1.
- .lp subject 10n
- Sorts according to the \f2subject\f1 of each message.
- .ei
- .in 1.0i \" ei doesn't restore margin
- .sp
- Each of these fields can optionally be prepended with the
- sequence \*Qreverse\-\*U to reverse the order of the sort. This doesn't
- imply anything about the order of the messages in the folder
- itself and affects only their order on the index screen. The
- default is \f2mailbox\f1 order.
-
- .lp textencoding 1.0i
- This is the value for the
- \*QContent-Transfer-Encoding:\*U header,
- which is used to tell MIME
- (Multipurpose Internet Mail Extension) capable mail readers how they
- should decode your mail.
- The default depends on your site's installation, but is usually
- \f27bit\f1. Other possible values are \f28bit\f1, \f2base64\f1 or
- \f2quoted-printable\f1 (see RFC1341 for details).
- \f27bit\f1 and \f28bit\f1 implies no encoding.
- .sp
- Note that Elm doesn't look at this value; it is just placed in your
- outgoing mail headers.
- If you put \f2base64\f1 or \f2quoted-printable\f1 as the value,
- Elm will NOT turn your message into a \f2base64\f1/\f2quoted-printable\f1
- encoded message. You will have to do that
- yourself with whatever means are available in your MIME capable mail reader.
- Metamail, for instance, has a program called mimencode that you can use.
-
- .lp tmpdir 1.0i
- Use this if you want to define your own directory for the temporary
- file Elm creates while running. This is only necessary if using the
- system temporary directory could cause problems, such as when not all
- NFS clients mount the common temporary directory, or when the temporary
- directory is prone to being cleared periodically. The default entry
- of the system temporary directory is normally OK.
-
- .lp visualeditor+ 1.0i
- The editor to be used by the \*Q~v\*U escape within the builtin editor.
- The default value is the value of the configuration variable \f2vi_editor\f1
- (see \f2The Elm Configuration Guide\f1).
-
- .lp weedout 1.0i
- When specifying this option, you can list headers that
- you \f2don't\f1 want to see when you are displaying a message.
- This list can continue for as many lines as desired, as
- long as the continued lines all have leading indentation.
- All headers in this entry append to the default weedout list.
- There are two special header flags. The first, \*Q*clear-weed-list*\*U,
- clears the default list. The second, \*Q*end-of-user-headers*\*U,
- terminates the entry, in case the following lines look like they
- might be more headers for the list.
- The default \f3weedout\f1 list includes the following header strings:
- .sp
- .in 1.5i
- .ft CW
- .zf
- .nf
- \&>From
- \&Apparently-To:
- \&Content-Length
- \&Content-Transfer-Encoding
- \&Content-Type:
- \&From
- \&In-Reply-To:
- \&MIME-Version
- \&Message-Id:
- \&Newsgroups:
- \&Received:
- \&References:
- \&Status:
- \&X-Mailer:
- .ft 1
- .fi
- .sp
- .in 1.0i
- Note that the \*QFrom\*U entry weeds out both \*QFrom:\*U and the
- \*QFrom\ \*U headers. If you just want to weed out \*QFrom\ \*U, for example,
- put a \*Q*clear-weed-list*\*U at the start of the list followed by \*QFrom_\*U
- or \*QFrom\ \*U.
- .in 0
- .ne 8
- .hu Numeric Variables
-
- .lp bounceback 1.0i
- This is a hop count threshold value and allows you to
- set up the mailer so that when you send mail more than
- \f2n\f1 machines away, it'll automatically include a
- \*QCc:\*U to you through the remote machine. In practice
- this should be very rarely used. Note that this refuses to
- bounce mail off an Internet address. The default is to
- have it set to zero, which disables the function.
-
- .lp builtinlines 1.0i
- This is used to determine if the builtin pager should be used on some
- messages even if you would usually use an external pager program.
- There are two ways of determining whether the builtin pager should be
- used. If you want any message that is shorter than \f2n\f1 lines to
- use the internal pager, set this variable to \f2n\f1. If you want the
- builtin pager to be used if the message is \f2m\f1 lines shorter than
- the number of lines on your screen, set this variable to \f2\-m\f1.
- Setting this variable to zero will result in the message always being
- sent through your external pager. This variable is used only if
- the pager is not set to the builtin pager. The default is \-3.
-
- .lp readmsginc 1.0i
- This variable modifies the display of the message \*QReading in
- \f2foldername\f1, message: #\*U, which is displayed when reading a new
- folder. The message count is normally updated as
- each message in the folder is read. If you are on a slow terminal and are
- reading a folder with a large number of messages, the time it takes to
- redraw the message count can significantly exceed the time it takes to
- simply read the folder.
- .sp
- The \f3readmsginc\f1 variable controls the frequency with which the
- message count is updated. If this parameter is set to 50, the message
- count will be updated after every 50 messages (i.e., at 50, 100, 150,
- and so forth). The default value for this parameter is 1. If a value
- of less than 1 is specified for this parameter, the value is ignored,
- and the default value is used instead.
-
- .lp sleepmsg 1.0i
- This variable modifies the time Elm waits after displaying a transient
- message before erasing it and continuing. It can be set to zero to
- suppress the wait entirely. It is in units of whole seconds.
-
- .lp timeout 1.0i
- On more advanced systems, it's nice to start up the
- mailer in a window and let it sit in background
- until new mail arrives (see \f2wnewmail\f1 for
- another window based program), at which point
- it can be brought up to the forefront of the system
- and read. In this case, it would be quite convenient
- to have the mailer internally resynchronize every
- so often. This option specifies the number of seconds that this occurs.
- .sp
- This is also useful for non-windowing terminals. For example, you can
- leave Elm running at night (I usually do) and when you
- come in in the morning it'll be all ready to read your mail!
- .sp
- The default is a 300 second (5 minute) timeout period.
-
- .lp userlevel* 1.0i
- This is what the program uses to determine the relative level of
- sophistication of the user. The values are \*q0\*u for a new user (the
- default), \*q1\*u for someone familiar with Elm,
- and \*q2\*u for experts. Some advanced features are hidden from novice
- users, while experts get less verbose prompt messages.
- The default is \*q0\*u.
- .br
- .ne 8
- .hu Boolean Variables
-
- The value assigned to boolean variables can be \*QON\*U or \*QOFF\*U only.
-
- .lp alwaysdelete 1.0i
- Set ON to set the default answer to the \*QDelete messages?\*U prompt
- to \f2yes\f1 (see the \f3quit\f1 command in section 7, \f3Commands\f1,
- and the \f3ask\f1 variable below). This default answer also applies to
- deletions from the alias system. The default for \f3alwaysdelete\f1 is
- OFF.
-
- .lp alwayskeep 1.0i
- Set ON to set the default answer to the \*QKeep unread mail in incoming
- mailbox?\*U prompt to \f2yes\f1. However, if you set \f3alwaysstore\f1
- OFF or answer \f2no\fP to the \*QStore read mail in \*Qreceived\*U
- folder?\*U prompt, it is presumed that you also want to keep your
- unread mail in the incoming mailbox, so the value of \f3alwayskeep\f1
- is ignored in those cases. See the \f3quit\f1 command in section 7,
- \f3Commands\f1, and the \f3ask\f1 and \f3alwaysstore\f1 variables
- below for more details. The default for \f3alwayskeep\f1 is ON.
-
- .lp alwaysstore 1.0i
- Set ON to set the default answer to the \*QStore read mail in
- \*Qreceived\*U folder?\*U prompt to \f2yes\f1 (see the \f3quit\f1
- command in section 7, \f3Commands\f1, and the \f3ask\f1 variable
- below). The default for \f3alwaysstore\f1 is OFF.
-
- .lp arrow* 1.0i
- Sometimes you are forced to use a slow or \*Qdumb\*U terminal. Set ON
- to make the current message pointer the \*Q\->\*U sequence rather than
- the inverse bar. Note that this is overridden by the \*Q\-a\*U command
- line option (see section 3, \f3Command Line Options\f1). The default
- is OFF.
-
- .lp ask 1.0i
- Set OFF to tell Elm that you'd rather not be asked \*QDelete
- messages?\*U and such each time you quit, resynchronize, change
- folders, or return from the alias system, but that it should just use
- the values of \f3alwaysdelete\f1, \f3alwaysstore\f1, and
- \f3alwayskeep\f1 without prompting. Note that when you quit \f3Elm\fP,
- if you use \*qQ\*u instead of \*qq\*u, you will never be questioned,
- regardless of how you have \f3ask\f1 set. See the \f3quit\f1 commands
- in section 7, \f3Commands\f1, and the \f3alwaysdelete\f1,
- \f3alwayskeep\f1, and \f3alwaysstore\f1 variables above for more
- details. The default for \f3ask\f1 is ON.
-
- .lp askcc+ 1.0i
- Set OFF to allow sending mail without being presented the \*QCopies
- to:\*U prompt for each message. This still allows you to explicitly
- include addresses in the \*QCc:\*U list via either the header editor or
- \*Q~c\*U in the builtin editor (see section 8, \f3Using Elm with
- \*Qeditor = none\*U\f1). The default is ON.
-
- .lp autocopy+ 1.0i
- Set ON for Elm to automatically copy the text of each message
- replied to into the edit buffer. Otherwise you will be prompted as to
- whether you want the message included in your reply. See the
- \f3prefix\f1 variable under \f3String Variables\f1 in section 2 for how
- copied text is marked. The default for \f3autocopy\f1 is OFF.
-
- .lp confirmappend 1.0i
- Set ON to make Elm ask for permission
- to append messages to the end of any file that already exists.
- Whether the file is a mail folder in the user's mail directory
- or an ordinary file makes no difference.
- The default is OFF.
-
- .lp confirmcreate 1.0i
- Set ON to make Elm ask for permission before it creates
- a new file to store messages in.
- It makes no difference whether the new file would be a mail
- folder in the user's mail directory or an ordinary file.
- The default is OFF.
-
- .lp confirmfiles 1.0i
- This allows you to have some last resort control over Elm when a
- message would be appended (by copy, save, or auto-cc) to an existing
- file which is not a folder in your mail directory (see the
- \f3maildir\f1 variable under \f3String Variables\f1 in section 2). Set ON
- to make Elm ask for permission to append a message to the end of
- an ordinary file, otherwise it silently adds the message to the end of
- the specified file whether it is a folder or not. The default is OFF.
-
- .lp confirmfolders 1.0i
- Set ON to make Elm ask before creating new mail folders in your
- mail directory (see the \f3maildir\f1 variable under \f3String
- Variables\f1 in section 2), otherwise it silently creates new mail folders
- whenever a copy of a message is going to be stored in a folder that
- does not already exist. See the \f3copy\f1, \f3savename\f1, and
- \f3forcename\f1 variables below for additional information about
- copying messages. The default for \f3confirmfolders\f1 is OFF.
-
- .lp copy+ 1.0i
- Set ON to have silent copies made of all outgoing mail. Where the copy
- of the message is saved is determined by the \f3maildir\f1 and
- \f3sentmail\f1 string variables and the \f3savename\f1 and
- \f3forcename\f1 boolean variables. Whether a copy is saved and to
- which folder can also be set prior to sending a message \(em see the
- \f3copy\f1 command of the mail command sub-menu in section 7,
- \f3Commands\f1, for details. The default for \f3copy\f1 is OFF.
-
- .lp forcename 1.0i
- Set ON to force creation of folders for copies of outbound mail by the
- recipient name. For complete details of how to enable automatic
- copying of outbound messages, see the \f3copy\f1 and \f3savename\f1
- boolean variables. The default is OFF.
-
- .lp forms 1.0i
- Set ON to enable the generation of \*Qforms\*U type messages. See the
- \f2Elm Forms Mode Guide\f1 for further information about mail forms.
-
- .lp keepempty 1.0i
- The mail system has a habit of deleting folders when you've removed
- everything from them. Set ON to preserve empty folders as zero-length
- files. Note that this option does not apply to your incoming mailbox.
- The default is OFF.
-
- .lp keypad 1.0i
- Set ON to indicate that you have an HP terminal and want the
- \f2<NEXT>\f1, \f2<PREV>\f1, \f2<HOME>\f1 and \f2<SHIFT-HOME>\f1 keys enabled.
- The default is OFF.
-
- .lp menu* 1.0i
- Set OFF to inhibit the menu display on all screen displays within
- Elm. Note that this is overridden by the \*Q\-m\*U command line
- option (see section 3, \f3Command Line Options\f1). The default is
- ON.
-
- .lp metoo 1.0i
- Set ON to get a copy of mail you send to a mailing list you are on,
- otherwise you do not get a copy of such messages. The default is OFF.
-
- .lp movepage 1.0i
- Set ON to enable commands that move through the folder by pages (see
- the \*q+\*u, \*q\-\*u, \f2<right>\f1, and \f2<left>\f1 keys in section
- 7, \f3Commands\f1) to move the current message pointer to the top of
- that page of messages. Set OFF to not alter the current message
- pointer location when moving through pages. The default is OFF.
-
- .lp names* 1.0i
- Set OFF to display the primary recipients' addresses on your screen
- with their full names when you send a message. Set ON to display only
- the full names. The default is ON.
-
- .lp noheader 1.0i
- Set ON to not include the headers of messages when copying a message
- into the edit buffer for replying or forwarding (see the \f3autocopy\f1
- variable above). The default is ON.
-
- .lp pointnew 1.0i
- Set ON to cause the current message pointer to point to the first new
- message in your incoming mailbox when started, instead of at message #1
- of the index. This has no effect for other folders since they are not
- expected to have \*Qnew\*U mail. The default is ON.
-
- .lp promptafter+ 1.0i
- Set ON to display a command prompt rather than the index screen when
- exiting from an external pager. This variable has no effect on the
- builtin pager. See the \f3pager\f1 variable under \f3String Variables\f1
- in section 2 to specify which pager to use to read messages.
-
- If your external pager immediately exits when it reaches the end of the
- message, you should set \f3promptafter\f1 ON so that the last screen of
- the displayed message is not immediately replaced by the index screen.
- If your external pager doesn't exit until you command it to, you have a
- choice. If you usually want to see the index screen before issuing a
- command, setting this variable OFF eliminates the extra keystroke
- needed to return to the index screen. If you usually don't need to see
- the index screen before issuing the next command, setting it ON allows
- you to enter your next command without waiting for the index screen to
- be redrawn. The default is ON.
-
- .lp resolve 1.0i
- Set ON to move the current message pointer to the next message on the
- index when a mail message is \*Qdealt with\*U through deleting,
- undeleting, saving, forwarding, etc. or set OFF to leave the current
- message pointer unchanged. The default is ON.
-
- .lp savename 1.0i
- One of the problems with electronic mail systems is that one tends to
- get very large, one-dimensional (flat) files that contain lots of
- completely unrelated mail. Elm can use a more intelligent
- algorithm: for incoming mail, when you \f3save\f1 or \f3copy\f1 it
- (see section 7, \f3Commands\f1), the default folder is the login name
- of the person who sent you the message (changed by pressing anything
- other than \f2<return>\f1 of course). Similarly, when sending mail,
- instead of just blindly saving it to the \f3sentmail\f1 folder,
- Elm can save it to a folder that is the login name of the
- recipient of the mail.\s-2\u2\d\s0
- .fn
- 2. When sending to a group, it's saved to the login name of the first
- person in the list only.
- .ef
- Set \f3savename\f1 ON to enable this algorithm.
-
- If \f3forcename\f1 is OFF (see above), the copy is saved to that folder
- only if the folder already exists. In practice, this means that
- important people that you communicate with (those that you tend to save
- mail from) have folders that are actually \f2a recorded log of the
- discussion in both directions\f1 and others (random mailings) are all
- stuffed in the \f3sentmail\f1 folder for easy perusal and removal (see
- the \f3sentmail\f1 variable under \f3String Variables\f1 in section
- 2). If you always want to save copies of outgoing messages in separate
- folders by recipient login name, you'll want to set \f3forcename\f1
- ON.
-
- The default for \f3savename\f1 is ON.
-
- .lp sigdashes+ 1.0i
- Set ON to tell Elm that you wish to follow the
- convention of prefixing your signature with \*Q\f2newline dash dash
- blank newline\f1\*U. This is placed in your message before your
- signature file (see the \f3signature\f1, \f3localsignature\f1, and
- \f3remotesignature\f1 variables under \f3String Variables\f1 in section 2).
- If OFF, the signature file, if any, is placed at
- the end of the message without any prefix. The default is ON.
-
- .lp softkeys 1.0i
- Set ON to tell Elm that you have an HP terminal with the
- HP 2622 function key protocol and that you'd like to have the function
- keys available while in the program. The default is OFF.
-
- .lp titles 1.0i
- Set ON to have the first line of a message titled with:
- .sp
- .ft CW
- .zf
- .ps 9
- .nf
- .tl ' Message \f2N/M\fP from \f2username\fP''\f2date\fP at \f2time\f1 '
- .fi
- .ps 10
- .ft 1
- .sp
- where all the information is extracted from the message.
- This is especially useful if you weed out all the headers of each
- message with a large \f3weedout\f1 list (see the \f3weedout\f1 variable
- under \f3String Variables\f1 in section 2).
- The default is ON.
-
- .lp usetite 1.0i
- Set ON to enable use of the \f2termcap/terminfo\f1
- \f3ti/te\f1 capabilities.
- Many terminal emulators require it (not the least of which is the
- OpenLook \f2cmdtool\f1).
- Some terminal emulators clear the screen on \f3te\f1 (some \f2xterm\f1s).
- Set OFF to disable use of \f3ti/te\f1.
- Note that this is overridden by the \*Q\-t\*U command line option
- (see section 3, \f3Command Line Options\f1). The default is ON.
-
- .lp weed 1.0i
- Set ON to have Elm \*Qweed out\*U certain headers from displayed
- messages, that is, not display them. The \f3weedout\f1 variable under
- \f3String Variables\f1 in section 2 allows you to custom define the set of
- headers you would like to not have displayed while reading messages.
- The default for the \f3weed\f1 variable is ON.
- .in 0
- .sp
- .sp
- For a better idea of how this all works, here's a sample \f2.elm/elmrc\f1
- file. While looking through it, notice that you can have lots of
- comments and blank lines for readability and that you can also use
- \*Qshell variables\*U and the \*q~\*u (tilde) metacharacter for your home
- directory, and they are expanded accordingly when read in by the
- mailer. Note that this was automatically saved by the Elm
- program on the fly from the options screen.
- .sp
- .ft CW
- .zf
- .nf
- #
- # .elm/elmrc \- options file for the ELM mail system
- #
- # Saved automatically by ELM 2.4 for Elm Development Group
- #
-
- # For yes/no settings with ?, ON means yes, OFF means no
-
- # where to save calendar entries
- calendar = ~/.Agenda
-
- # what editor to use ("none" means simulate Berkeley Mail)
- # \'%s\' can be used as the temporary filename for the outgoing message
- editor = none
-
- # the character to use in the builtin editor for entering commands
- escape = ~
-
- # the full user name for outbound mail
- fullname = Elm Development Group
-
- # where to save received messages to, default file is "=received"
- receivedmail = $HOME/Mail/received
-
- # where to save my mail to, default directory is "Mail"
- maildir = /users/elmdev/Mail
-
- #directory to hold my temporary files to avoid NFS cross mount problems
- tmpdir = /users/elmdev/Mail/tmp
-
- # program to use for displaying messages (\'builtin\' is recommended)
- pager = builtin
-
- # prefix sequence for indenting included message text in outgoing messages...
- prefix = >_
-
- # how to print a message (\'%s\' is the filename)
- print = lpr \-Plw2 %s
-
- # attribution string for replies (\'%s\' is the author of original message)
- attribution = According to %s:
-
- # where to save copies of outgoing mail to, default file is "=sent"
- sentmail = /users/elmdev/Mail/mail.sent
-
- # the shell to use for shell escapes
- shell = /bin/csh
-
- # local ".signature" file to append to appropriate messages...
- localsignature = localsig
-
- # remote ".signature" file to append to appropriate messages...
- remotesignature = remotesig
-
- # do we want dashes above signatures? (News 2.11 compatibility and convention)
- sigdashes = ON
-
- # how to sort folders, "Reverse Sent" by default
- sortby = Reverse\-Received
-
- # should the default be to delete messages we\'ve marked for deletion?
- alwaysdelete = ON
-
- # should the default be to store read messages to the "received" folder?
- alwaysstore = ON
-
- # should the default be to keep unread messages in the incoming mailbox?
- alwayskeep = ON
-
- # should we use the "\->" rather than the inverse video bar?
- arrow = OFF
-
- # should the message disposition questions be displayed (ON) or
- # auto\-answered (OFF) with the default answers when we resync or change folders?
- ask = ON
-
- # would you like to be asked for Carbon\-Copies information each msg?
- askcc = ON
-
- # automatically copy message being replied to into buffer?
- autocopy = OFF
-
- # threshold for bouncing copies of remote uucp messages...
- # zero = disable function.
- bounceback = 0
-
- # save a copy of all outbound messages?
- copy = ON
-
- # do we want to be able to mail out AT&T Mail Forms?
- forms = OFF
-
- # should we keep folders from which all messages are deleted?
- keepempty = OFF
-
- # we\'re running on an HP terminal and want HOME, PREV, NEXT, etc...
- keypad = OFF
-
- # should we display the three\-line \'mini\' menu?
- menu = ON
-
- # would you like a copy of a message you send to an alias you are on?
- metoo = OFF
-
- # when using the page commands (+ \- <NEXT> <PREV>) change the current
- # message pointer...?
- movepage = ON
-
- # just show the names when expanding aliases?
- names = ON
-
- # when messages are copied into the outbound buffer, don\'t include headers?
- noheader = ON
-
- # start up by pointing to the first new message received, if possible?
- pointnew = ON
-
- # prompt for a command after the external pager exits?
- promptafter = ON
-
- # emulate the mailx message increment mode (only increment after something
- # has been \'done\' to a message, either saved or deleted, as opposed to
- # simply each time something is touched)?
- resolve = ON
-
- # save messages, incoming and outbound, by login name of sender/recipient?
- savename = ON
-
- # save outbound messages by login name of sender/recipient even if the
- # associated folder doesn\'t already exist?
- forcename = OFF
-
- # are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
- # (this implies "keypad=ON" too)
- softkeys = OFF
-
- # set the main prompt timeout for resynching...
- timeout = 60
-
- # display message title when displaying pages of message?
- titles = ON
-
- # are we good at it? 0=beginner, 1=intermediate, 2+ = expert!
- userlevel = 2
-
- # enable the weedout list to be read?
- weed = ON
-
- # what headers I DON\'T want to see, ever.
- weedout = "Path:" "Via:" "Sent:" "Date" "Status:" "Original" "Phase"
- "Subject:" "Fruit" "Sun" "Lat" "Buzzword" "Return" "Posted"
- "Telephone" "Postal\-Address" "Origin" "X\-Sent\-By\-Nmail\-V" "Resent"
- "X\-Location" "Source" "Mood" "Neuron" "Libido" "To:" "X\-Mailer:"
- "Full\-Name:" "X\-HPMAIL" "Cc:" "cc:" "Mmdf" "Network\-" "Really\-"
- "Sender:" "Post" "Message\-" "Relay\-" "Article\-" "Lines:"
- "Approved:" "Xref:" "Organization:" "*end\-of\-user\-headers*"
-
- # alternative addresses that I could receive mail from (usually a
- # forwarding mailbox) and don\'t want to have listed...
- alternatives = dsidev!elmdev dsirel!elmdev elmdev@dsidev elmdev%dsidev
-
- # list of delivery precedences allowed, or empty to allow anything
- # precedence may be followed by optional ":priority" specification
- precedences = special\-delivery:urgent air\-mail:urgent first\-class bulk junk
-
- # name of Character Set used with MIME text/plain Content\-type
- # US\-ASCII is default. Be aware that if you use a national charset
- # elm probably needs metamail to display US\-ASCII. Elm tries to
- # know if that charset could display US\-ASCII too, but the list
- # of us\-ascii compatible charsets is not yet complete
- charset=US\-ASCII
-
- # name of Character Set which the display supports. This is independent
- # of the above "charset".
- displaycharset=US\-ASCII
-
- # list of Character Sets, which are more or less a superset of US\-ASCII
- # so we know that we can display messages with charset=US\-ASCII without
- # help of metamail
- compatcharsets = ISO\-8859\-1 ISO\-8859\-2 ISO\-8859\-3 ISO\-8859\-4 ISO\-8859\-5 ISO\-8859\-6 ISO\-8859\-7 ISO\-8859\-8 ISO\-8859\-9
-
- # would you like to use termcap/terminfo ti/te entries?
- usetite = ON
-
- # Value by which message count is incremented while reading a new mailbox.
- # Setting this value to a number larger than one will speed up the time it
- # takes to read a large mailbox when using a slow terminal.
- readmsginc = 5
-
- # time in seconds which Elm will wait after displaying a transient message
- # and before erasing it. Can be 0 or positive integer.
- sleepmsg = 2
- .fi
- .br
- .ne 5
- .sp 2
- .hn 1 Command Line Options
-
- There are a number of command line options to the Elm
- program, with only one that needs to be remembered: \*Q\-?\*Uor \*Q\-h\*U
- for help.
-
- The options are:
-
- .lp \h'24p'\-a 66p
- This allows you to have the \*Q\->\*U arrow pointer
- rather than the inverse bar. This can also be set in
- the \f2.elm/elmrc\f1
- file with the boolean variable \f3arrow\f1.
-
- .lp \h'24p'\-c 66p
- Check only. This is useful for expanding aliases
- without sending any mail. The invocation is similar to
- invoking Elm in send-only mode:
- .sp
- .ft CW
- .zf
- .ti 1.5i
- elm \-c\f2 list-of-aliases\f1
-
- .lp "\h'24p'\-d \f2n\f1" 66p
- Set debug level to \f2n\f1. Useful for debugging the Elm
- program, this option will create a file in your home
- directory called \f2ELM:debug.info\f1 containing
- a running log of what is going on with
- the program. Level \f2n\f1 can be 1 through 11,
- where the higher numbers generate more output.
- This option might be disabled by the the person who configured
- Elm for your system.
-
- .lp "\h'24p'\-f \f2folder\f1" 66p
- Read the specified folder rather than the default incoming mailbox.
- Note that you can use the same metacharacters (e.g. \*q=\*u) as when
- you \f2change folders\f1 from within the program. You can also use the
- same abbreviatory symbols (\*q!\*u, \*q>\*u and \*q<\*u),
- but remember to \*Qsingle quote\*U them
- in case they have special meaning in the shell you use.
-
- .lp "\h'24p'\-h or \-?" 66p
- Help message. Gives a short list of all these options and exits.
-
- .lp "\h'24p'\-i \f2file\f1" 66p
- Include a prepared file in the edit buffer before sending.
- This facilitates using Elm with other programs
- that interface with mail (like news readers, for example). There
- is an example of how to set up the \f2rn\f1 news reading program to
- use Elm in \f2The Elm Users Guide\f1. The file specified is
- copied into the temporary file just before the signature file.
-
- .lp \h'24p'\-k 66p
- Keypad enable. This option lets the Elm program
- know that you're on an HP terminal, and it can then interpret
- the <PREV>, <NEXT> and <HOME>/<SHIFT>-<HOME> keys accordingly. If you
- are not on an HP terminal, it is recommended that you do
- NOT use this option. See also the \f3keypad\f1 variable,
- described under \f3Boolean Variables\f1 in section 2.
-
- .lp \h'24p'\-K 66p
- Keypad + softkeys enable. The Elm mailer can
- use the HP softkeys as an alternative form of
- input. If you specify this option be sure that you're on
- an HP terminal that can accept the standard 2622 terminal
- escape sequences! See also the \f3softkeys\f1 variable,
- described under \f3Boolean Variables\f1 in section 2.
-
- .lp \h'24p'\-m 66p
- Inhibit display of the 3-line menu when using the mailer. This,
- of course, gives you three more message headers per page instead.
- See also the \f3menu\f1 variable, described under \f3Boolean
- Variables\f1 in section 2.
-
- .lp "\h'24p'\-s \f2subject\f1" 66p
- In send-only and batch mode, this is how to indicate the subject of the
- resulting message. Please see the section on \f3Non-Interactive
- Uses of Elm\f1 in \f2The Elm Users Guide\f1 for more information.
-
- .lp \h'24p'\-t 66p
- Disable use of the \f2termcap/terminfo\f1 \f3ti/te\f1 capabilities.
- Many terminal emulators require it (not the least of which is the
- OpenLook \f2cmdtool\f1).
- Some terminal emulators clear the screen on \f3te\f1 (some \f2xterm\f1s).
- See also the \f3usetite\f1 variable, described under \f3Boolean
- Variables\f1 in section 2.
-
- .lp \h'24p'\-z 66p
- This causes Elm not to start if you don't
- have any mail, but instead to display the message \*QYou have no
- mail.\*U This emulates the behavior of programs
- like \f2Berkeley Mail\f1.
-
- .in 0
- All the above options default to reasonable values, so there is
- usually no need to use them. Furthermore, the most used options
- are available through the \f2.elm/elmrc\f1 file, described in section 2.
- .br
- .ne 5
- .sp
- .hn 1 Multi-Media Capabilities of Elm
-
- Elm optionally provides you with some Multi-Media features, which
- are compliant
- to the MIME (Multipurpose Internet Mail Extension) IETF draft.
-
- If the support is compiled into Elm, on the receiving side
- Elm accesses Metamail from Nathaniel Borenstein of
- Bellcore. If you receive a MIME compliant message, Elm calls
- Metamail automatically to display the message. Metamail
- asks you if you want to display each part of the message
- and uses the display programs available at your site. This
- is controlled through the \f2mailcap\f1 file.
-
- On the sending side, there is a simple mechanism integrated in Elm
- to compose MIME compliant messages. If you have one or more key lines
- of the form
-
- .ft CW
- .zf
- .ti .5i
- [\&include \f2file contenttype/subtype encoding\f1]
- .ft 1
-
- in the message body, at each
- of these key lines, a file is included, and becomes a part
- of the message. The text lines before, between and after the \f2include\f1
- lines go into extra message parts of type \f2text\f1.
-
- As an example, say you want to include the file \f2foo.gif\f1 into your message,
- which is a GIF image, and you want to use \f2base64\f1 encoding, use the
- following line:
-
- .ft CW
- .zf
- .ti .5i
- [\&include foo.gif image/gif base64]
- .ft 1
-
- Or you want to include a text file which contains plain ASCII:
-
- .ft CW
- .zf
- .ti .5i
- [\&include foo.txt text/plain]
- .ft 1
-
- The \f2encoding\f1 parameter is optional and the default is \f27bit\f1.
-
- Refer to RFC1341 for valid \f2contenttype/subtype\f1 and \f2encoding\f1
- parameter values.
- .br
- .ne 5
- .sp
- .hn 1 Special Outgoing Mail Processing
-
- There are a few extra features that Elm offers on
- outgoing mail that are worthy of mention.
-
- The first, and probably the most exciting feature,\s-2\u3\d\s0 is the
- .fn
- 3. Unfortunately, at many non-US sites, it's quite probable that
- you won't be able to use this feature since you won't have
- the \f2crypt()\f1 library available due to licensing restrictions.
- .ef
- ability to send \f2encrypted\f1 mail! To do this is
- extremely simple: you need merely to have two key lines
-
- .ft CW
- .zf
- .ti .5i
- [\&encode]
- .ft 1
- .br
- and
- .ft CW
- .zf
- .ti .5i
- [\&clear]
- .ft 1
-
- in the message body.
-
- .ne 15
- Consider the following outgoing message:
- .sp
- .nf
- .ps 9
- .in .5i
- .ft CW
- .zf
- Joe,
- Remember that talk we had about Amy? Well, I talked to my manager
- about it and he said...
- uhh...better encrypt this...the usual \`key\'...
- [\&encode]
- He said that Amy was having family problems and that it had been
- affecting her work.
- Given this, I went and talked to her, and told her I was sorry for
- getting angry. She said that she understood.
- We\'re friends again!!
- [\&clear]
- Exciting stuff, eh?
- \h'3i'Mike
- .ps 10
- .ft 1
- .in 0
- .fi
- .sp
- While this is obviously quite readable while being typed into
- the editor, as soon as the message is confirmed as wanting
- to be sent, the Elm mailer prompts with:
- .sp
- .nf
- .ft CW
- .zf
- .ps 9
- .ti .5i
- Enter encryption key: @
- .ps 10
- .ft 1
- .fi
- .sp
- and accepts a key (a series of 8 or less characters) without
- echoing them to the screen. After entry, it will ask for the
- same key again to confirm it, then *\f2poof\f1* it will encrypt and
- send the mail.
-
- If you have the \f3copy\f1 option enabled, the program will save
- your copy of the message encrypted too. (This is to ensure
- the privacy and security of your mail archive, too.)
-
- If the mailer doesn't ask for the encryption key, it's because
- you don't have the \f2[\&encode]\f1 entered as the first 8 characters
- of the line. It MUST be so for this to work!!
-
- On the other end, a person receiving this mail (they must also
- be using Elm to receive it, since this mailer has a
- unique encryption program) will be reading the
- message and then suddenly be prompted:
- .sp
- .nf
- .ft CW
- .zf
- .ps 9
- .ti .5i
- Enter decryption key: @
- .ft 1
- .ps 10
- .fi
- .sp
- and will again be asked to re-enter it to confirm.
- The program will then on-the-fly decrypt the mail
- and display each line as it is decoded. The \f2[\&clear]\f1
- line signifies that the block to encrypt is done.
-
- Note that it is not possible currently to \f3pipe\f1 or \f3print\f1
- encrypted mail.
- .sp 2
- The other feature on outgoing mail is the ability to
- specify what section of the message you want to have
- archived (assuming \f3copy\f1 is enabled) and what section
- you don't. This is most useful for sending out source
- file listings and so on.
-
- To indicate the end of the section that should be
- saved in the archive, you need merely to have the key line
- .sp
- .nf
- .ft CW
- .zf
- .ti .5i
- [\&nosave]
- .ft 1
- or
- .ft CW
- .zf
- .ti .5i
- [\&no save]
- .ft 1
- .fi
- .sp
- appear by itself on a line. This key line is removed from
- the outgoing mail, and indicates the last line of
- the message to be saved.
- Other than this, the saved mail is identical to the outgoing mail.
- .br
- .ne 5
- .sp
- .hn 1 Customized header lines
-
- The mailer provides a facility for including customized
- header lines in the messages you send.
- If you have an \f2.elm/elmheaders\f1 file,
- the mailer will include its contents
- immediately after the regular headers of all outbound mail.
- The mailer supports use of the backquote convention in this file
- to run commands and substitute the commands' output for the backquoted
- text.
- Here's a typical \f2.elm/elmheaders\f1 file:
- .sp
- .ft CW
- .zf
- .nf
- Organization: Hewlett-Packard Laboratories
- Phone: (415)-555-1234
- Operating-System: \`uname -srv\`
- .fi
- .ft 1
- .sp
- These lines will be inserted after all other header lines in the message.
- .br
- .ne 5
- .sp
- .hn 1 Commands
- .sp
-
- This section discusses each command in the Elm
- program in more detail than above, including the
- prompts the user can expect upon executing the
- command, the meaning of different options, etc.
-
- .lp \h'24p'? 66p
- Help. This command used once puts you in the \f2help\f1
- mode, where any key you press results in a one-line description
- of the key. Pressing \*q?\*u again at this point produces a
- summary listing each command available.
- Pressing \*q.\*u (period) leaves the help mode and returns you to the
- command level.
-
- .lp \h'24p'<space> 66p
- Display the current message.
- <space> is useful for reading through a mail folder.
- When issued from the index screen,
- it displays the first screen of the current message.
- When issued while in the builtin pager,
- it pages through the message to the end.
- When issued at the end of a message
- (with either the builtin pager or an external pager),
- it displays the first screen of the next message not marked for deletion.
-
- .lp \h'24p'<return> 66p
- Display the current message.
- <return> behaves somewhat differently from <space>.
- When issued while in the builtin pager,
- it scrolls the current message forward one line,
- and then when issued at the end of a message
- (with either the builtin pager or an external pager),
- it redisplays the first screen of the the \f2current\fP message.
- The latter is useful in case you have issued a non-pager
- command while in the builtin pager and want to restart the display
- of the current message.
-
- .lp \h'24p'! 66p
- Shell. This allows you to send a command to the shell without
- leaving the program. Note that it is possible that the person who
- installed Elm on your system disabled this feature.
-
- .lp \h'24p'| 66p
- Pipe. This command allows you to pipe the current message
- or the set of \f2tagged\f1 messages
- through other filters as you desire. The shell used for
- the entire command is either the one specified in
- your \f2.elm/elmrc\f1 file, or the default shell (see the \f3shell\f1
- variable under \f3String Variables\f1 in section 2).
-
- .lp \h'24p'\/ 66p
- Pattern match. This command, at the command level, allows the
- user to search through all the \f2from\f1 and \f2subject\f1 lines of
- the current folder starting at the current message and
- continuing through the end. If the first character of the
- pattern is a \*q/\*u, then Elm tries to match the
- specified pattern against \f2any\f1 line in the folder. Again,
- this works from the current message through the
- end. Both searches are case insensitive.
-
- .lp "\h'24p'\- or <left>" 66p
- Display the previous page of the message index.
-
- .lp "\h'24p'+ or <right>" 66p
- Display the next page of the message index.
-
- .lp \h'24p'<number><return> 66p
- Specify new current message. When you type in any digit, Elm
- prompts \*QSet current to : \f2n\f1\*U, where \f2n\f1 is
- the digit entered. Continue entering the full number
- and terminate with <return>. Note that changing the
- current message to a message not on the
- current page of headers results in a new page
- being displayed.
-
- .lp \h'24p'< 66p
- Scan message for calendar entries. A rather novel feature of
- the Elm mailer is the ability to automatically incorporate
- calendar/agenda information from a mail message into the user's
- calendar file. This is done quite simply; any line that has
- the pattern
-
- .ti +.5i
- \-> \f2calendar entry\f1
-
- is automatically added to the user's \f3calendar\f1 file
- when the \*q<\*u command is used
- (see the \f3calendar\f1 variable under \f3String Variables\f1 in section 2).
- .sp
- For example, let's say we had a message with the text:
-
- .ft CW
- .zf
- .ps 9
- .ti +.5i
- Regardless of that meeting, here\'s the seminar stuff:
- .br
- .ti +.5i
- \-> 8/03 3:00pm: AI Seminar with Ira Goldstein of HP Labs
- .ft 1
- .ps 10
-
- then using the \*q<\*u command would add the line:
-
- .ft CW
- .zf
- .ps 9
- .ti +.5i


- 8/03 3:00pm: AI Seminar with Ira Goldstein of HP Labs

- .ps 10
- .ft 1
-
- to the user's \f3calendar\f1 file.
-
- .lp \h'24p'a 66p
- Alias. The alias system is a way by which more complex mail addresses
- can be shortened for the mail user. For example:
- .sp
- .nf
- .ps 9
- .ft CW
- .zf
- .ti +.5i
- joe, bleu = Joe Bleu = j...@hpfcla.SSO.HP.COM
- .ft 1
- .ps 10
- .fi
- .sp
- which allows mail to \*Qjoe\*U or \*Qbleu\*U with the system expanding
- the address properly. Obviously, this saves having to remember
- complex addresses. A more detailed discussion can
- be found in either the section entitled \f2The Alias System\f1 in
- this document or \f2The Elm Alias System Users Guide\f1.
-
- .lp \h'24p'b 66p
- Bounce mail. This \*Qremails\*U mail to someone else in such a
- way as to make the return address the original sender rather
- than you. The \f3forward\f1 command is similar, but it makes
- the return address \f2you\f1 rather than the original sender.
-
- .lp \h'24p'C 66p
- Copy to folder. This command copies the current message or set of
- tagged messages to
- a folder. If there is anything in the folder currently the
- message is appended to the end, otherwise the folder is created
- containing only the newly copied messages. The prompt for this command
- is \*QCopy to folder: \*U. A response of <return> cancels the command
- and returns the user to the command prompt. The usual filename
- metacharacters are available, too. That is, this command expands filenames
- with \*q~\*u (tilde) to your home directory and \*q=\*u to your
- \f3maildir\f1 directory, if defined. This command also allows you to
- use \*q>\*u for your \f3receivedmail\f1 folder,
- \*q<\*u for your \f3sentmail\f1 folder,
- \*q.\*u for the last folder you saved or copied a message to
- and \*Q@alias\*U for the default folder for \*Qalias\*U.
- If you use a shell wildcard in the file or folder name, you are
- given a list of all files or folders which match the wildcard.
- Elm uses your shell to find the names, so whatever wildcards you are
- used to will work.
- Finally, you can also enter \*q?\*u at the prompt
- to get detailed help.
-
- .lp \h'24p'c 66p
- Change folder. Specifying this command allows the user to change
- the folder that is currently being read. This is intended
- for perusal and reply to previously archived messages.
- The prompt is \*QName of new folder: \*U and entering <return>
- cancels the operation, while entering a filename causes the program
- to read that file as the new folder,
- if possible. This command expands filenames
- with \*q~\*u (tilde) to your home directory and \*q=\*u to your
- \f3maildir\f1 directory, if defined. This command also allows you to
- use \*q!\*u as an abbreviation for you incoming mailbox,
- \*q>\*u for your \f3receivedmail\f1 folder,
- \*q<\*u for your \f3sentmail\f1 folder,
- \*q.\*u for the last folder you saved or copied a message to
- and \*Q@alias\*U for the default folder for \*Qalias\*U.
- If you use a shell wildcard in the file or folder name, you are
- given a list of all files or folders which match the wildcard.
- Elm uses your shell to find the names, so whatever wildcards you are
- used to will work.
- Finally, you can also enter \*q?\*u at the prompt
- to get detailed help.
-
- .lp "\h'24p'd, u" 66p
- Delete and undelete. Neither of these two commands have any prompts
- and indicate their action by either adding a \*qD\*u to the current
- message index entry (indicating deletion pending) or removing
- the \*qD\*u (indicating that the message isn't set for deletion).
-
- .lp \h'24p'<control>-D 66p
- This command allows you to easily mark for deletion all messages
- that have a specific pattern. After \f3<control>-D\f1 is pressed,
- Elm prompts for the string to match in
- either the \f2from\f1 or \f2subject\f1 lines of
- the messages.
-
- .lp \h'24p'<control>-U 66p
- This is the direct opposite command to the \f3<control>-D\f1 command
- \(em all messages
- that match the specified pattern have any mark for deletion
- removed by this command.
-
- .lp \h'24p'e 66p
- Edit mailbox. This allows you to modify the current mail file at
- a single keystroke. This is mostly useful for editing messages
- before saving them. Modifying headers should be done with extreme
- caution, as they contain routing information and other vital stuff
- for full functionality. This command may be disabled by whoever
- configured your Elm installation.
-
- .lp \h'24p'f 66p
- Forward. Allows the user to forward the current message to another user.
- This copies the message into the edit buffer and allows the user to add
- their own message too. The prompt is \*QForward to:\*U and will expand an alias
- if entered. See also \f3bounce\f1, above.
-
- Elm will ask you if you want to edit the message before sending it. If you
- answer \f2yes\f1, Elm will prepend your prefix string to each line of the
- message, and let you edit the result. If you do not want the prefix string
- on each line, answer \f2no\f1; you will have another chance to edit the message
- when you get to the \*Qsend\*U menu. See the \f3prefix\f1 variable
- under \f3String Variables\f1 in section 2.
-
- .lp \h'24p'g 66p
- Group reply. Identical to \f3reply\f1 below, except that the
- response is mailed to \f2all recipients\f1 of the original
- message except yourself. See the \f3alternatives\f1
- variable under \f3String Variables\f1 in section 2.
-
- .lp \h'24p'h 66p
- Display the current message with all headers intact.
- When you display a message with other commands,
- certain header lines are formatted and others discarded according
- to the \f3weedlist\fP variable, described under \f3String
- Variables\f1 in section 2.
-
- .lp \h'24p'i 66p
- Return to the index screen,
- when issued in the builtin pager or at the end of a message with
- either the builtin pager or an external pager.
-
- .lp "\h'24p'j or <down>, k or <up>" 66p
- These four keys work similarly to what they would do in \f2vi\f1 or
- any of the other (precious few) screen oriented
- programs. The \f3j\f1 and \f3<down>\f1 keys move
- the current message pointer down to the next message skipping
- over any marked deleted (going to
- the next page if necessary) and the \f3k\f1 and \f3<up>\f1 keys move
- the current
- message pointer back to the previous message skipping
- over any marked deleted (also changing pages if necessary).
-
- .lp "\h'24p'J, K" 66p
- These two keys work similarly to their lower case counterparts,
- except that they don't skip over deleted messages.
-
- .lp \h'24p'l 66p
- Limit. This feature allows you to specify a subset of the existing
- messages to be dealt with. For example, let's say we had a folder with
- four hundred messages in it, with only four or five different subjects. We
- could then limit what we're dealing with by using the \f3limit\f1
- command. Pressing \f3l\f1 would result in the prompt:
- .sp
- .nf
- .ft CW
- .zf
- .ti +.5i
- Criteria:
- .ft 1
- .fi
- .sp
- to which we could answer
- \*Qsubject \f2string\f1\*U,
- \*Qfrom \f2string\f1\*U or
- \*Qto \f2string\f1\*U. In our example, we could use
- \*Qsubject programming\*U
- as a criterion for selection. Once we've limited our selections,
- the screen is rewritten with just the selected messages
- and the top line changes to have a message like:
- .sp
- .nf
- .ft CW
- .zf
- .ps 9
- .tl ''\0\0\0\0\0Folder is "=elm" with 92 shown out of 124 [Elm 2.4]''
- .ps 10
- .ft 1
- .fi
- .sp
- We can further limit selections by using the \f3limit\f1 option
- repeatedly to enter further criteria.
-
- To clear all the criteria and get back to the \*Qregular\*U display, simply
- enter \*Qall\*U as the limiting criteria. It should be noted that the
- selection based on \*Qto\*U isn't fully implemented for this version, so
- it is recommended that users stay with \*Qsubject\*U and \*Qfrom\*U as the
- basis for their criteria.
-
- .lp \h'24p'm 66p
- Mail. Send mail to a specified user. The prompt associated
- with this command is \*QSend mail to: \*U. Entering an alias name results
- in the full address being rewritten in parenthesis immediately. This
- prompt is followed by \*QSubject: \*U which allows the user to title their
- note. The final prompt is \*QCopies to: \*U, which allows other people
- specified to receive \*Qcarbon copies\*U of the message, but see the
- \f3askcc\f1 variable under \f3Boolean Variables\f1 in section 2. Upon
- entering all three items the
- editor is invoked and the message can be composed.
-
- .lp \h'24p'n 66p
- Next message that is not marked for deletion.
- Useful for displaying successive messages in a folder.
- When issued from the index screen, it displays the current message,
- and when issued while in the builtin pager or at the end of a message
- (with either the builtin pager or an external pager),
- it displays the first screen of the next message not marked for deletion.
-
- .lp \h'24p'o 66p
- Options. This full-screen display allows you to alter the settings
- of a number of parameters, including the current sorting method,
- the method of printing files, the calendar file, the save file, and
- so on. It's self-documenting (where have you heard \f2that\f1
- before?) so isn't explained in too much detail here. See the
- \f3configoptions\f1 variable under \f3String Variables\f1 in section 2.
-
- .lp \h'24p'p 66p
- Print. This allows you to print out the current
- message or the tagged messages to a previously defined printer. See
- the \f3print\f1 variable under \f3String Variables\f1 in section 2.
-
- .lp \h'24p'q 66p
- Quit. If you in the pager, you are returned to the index screen. If you are
- at the index screen, Elm quits altogether. However, if you have the
- \f3ask\fP variable set ON, Elm first prompts you for the disposition of the
- messages in the current folder. If any messages are marked for deletion, it
- asks if you want them deleted. If the current folder is your incoming
- mailbox, you are also asked if read messages should be stored in your
- \f3receivedmail\f1 folder,
- and if unread messages should be kept in the incoming mailbox.
- The default answers to these questions are set by the \f2.elm/elmrc\f1
- variables \f3alwaysdelete\f1, \f3alwaysstore\f1, and \f3alwayskeep\f1
- (see \f3Boolean Variables\f1 in section 2).
- However, if you elect to not store your read messages (i.e. keep them)
- it is presumed you want to keep your unread messages, too.
-
- .lp \h'24p'Q 66p
- Quick quit. This behaves similar to the \f3quit\f1 command except that
- you are never prompted for answers to the message disposition questions.
- Elm disposes of messages according to the values you
- have set for \f3alwaysdelete\f1, \f3alwaysstore\f1, and \f3alwayskeep\f1
- in your \f2.elm/elmrc\f1 file (see \f3Boolean Variables\f1 in section 2).
-
- .lp \h'24p'r 66p
- Reply. Reply to the sender of the current message. If
- the \f3autocopy\f1 variable is set to OFF in your \f2.elm/elmrc\f1 file,
- Elm prompts \*QCopy message? (y/n)\*U, to which you can specify
- whether or not a copy of the source message is to be copied into the edit
- buffer. If copied in, all lines from the message are
- prepended with the \f3prefix\f1 character sequence specified in
- your \f2.elm/elmrc\f1 file (see \f3String Variables\f1 in section 2).
-
- .lp \h'24p's 66p
- Save to folder. This command is like the \f3copy\f1 command, except
- that the saved messages are marked for deletion and, if you are
- saving just the current message, the current message pointer is
- incremented afterwards (see the \f3resolve\f1 variable under \f3Boolean
- Variables\f1 in section 2). This command expands folder names
- with \*q~\*u (tilde) to your home directory and \*q=\*u to your
- \f3maildir\f1 directory, if defined. This command also allows you to
- use \*q>\*u for your \f3receivedmail\f1 folder,
- \*q<\*u for your \f3sentmail\f1 folder (see \f3String Variables\f1 in
- section 2),
- \*q.\*u (period) for the last folder you saved or copied a message to
- and \*Q@alias\*U for the default folder for \*Qalias\*U.
-
- .lp \h'24p't 66p
- Tag.
- .fn
- 4. Currently only \f3copy\f1, \f3pipe\f1, \f3print\f1, and \f3save\f1
- support this.
- .ef
- Tag the current message for a later operation.\s-2\u4\d\s0
-
- .lp \h'24p'T 66p
- Tag and move to next undeleted message.
- This command is like the `Tag' command but also increments the current message
- pointer to the next undeleted message.
-
- .lp \h'24p'<control>-T 66p
- Tag all messages containing the specified pattern. Since \f2tagging\f1
- messages can occur on screens other than the one being viewed,
- Elm first checks to see if any messages are currently
- \f2tagged\f1 and ask you if you'd like to remove those tags. After
- that, it will, similar to the \f3<control>-D\f1 command, prompt for
- a pattern to match and then mark all messages that contain
- the (case insensitive) pattern in either the \f2from\f1 or \f2subject\f1
- lines.
-
- .lp \h'24p'x 66p
- Exit. This leaves Elm and discards any changes to the mailbox.
- If changes are pending (such as messages marked for deletion) you are
- asked to confirm discarding the changes. If confirmed, no
- messages are deleted and the status of all messages is unchanged. That is,
- any messages that were new will remain new instead of being noted as old,
- and any messages that were read for the first time
- will be again noted as unread.
-
- .lp \h'24p'X 66p
- Exit immediately. This leaves Elm in the quickest possible manner
- without even prompting about discarding the changes to the mailbox.
- No messages are deleted and the status of all messages is unchanged. That is,
- any messages that were new will remain new instead of being noted as old,
- and any messages that were read for the first time
- will be again noted as unread.
-
- .in 0
- .sp
- When you are about to send a message with the \f3forward\f1, \f3mail\f1,
- or \f3reply\f1 commands (see above), a small menu of the following
- options appears:
-
- .lp \h'24p'c 66p
- Specify the folder for saving a copy of the message.
- This allows you to override the
- \f3copy\f1, \f3forcename\f1 and \f3savename\f1 variables
- from your \f2.elm/elmrc\f1 file (see \f3Boolean Variables\f1 in
- section 2). It prompts you for the name
- of the folder where a copy of the outgoing message is to be saved. The
- default displayed is taken from those three \f2.elm/elmrc\f1
- options and can be changed. This command also allows you to
- use \*q>\*u for your \f3receivedmail\f1 folder
- and \*q<\*u for your \f3sentmail\f1 folder (see \f3String Variables\f1
- in section 2),
- and \*q=?\*u to mean \*Qconditionally save by name\*U
- and \*q=\*u to mean \*Qunconditionally save by name\*U.
- Since you could next enter
- the \f3edit headers\f1 command and change the recipients
- of your message, the name of the folder under the
- two \*Qsave by name\*U options is not established until you enter the \f3send\f1
- command.
- If you use a shell wildcard in the file or folder name, you are
- given a list of all files or folders which match the wildcard.
- Elm uses your shell to find the names, so whatever wildcards you are
- used to will work.
- You can also enter \*q?\*u at the prompt
- to get help about saving.
-
- .lp \h'24p'e 66p
- Edit message (or form). Entering this command allows you to edit
- the text of your message or form.
-
- .lp \h'24p'f 66p
- Forget. This gets you out of sending a message you started. If you are
- in send-only mode, the message is saved to the file \f2Canceled.mail\f1
- in your home directory. Otherwise
- it can be restored at the next \f3forward\f1, \f3mail\f1,
- or \f3reply\f1 command during the current session of Elm After
- issuing one of those commands you will be prompted with \*QRecall last
- kept message?\*U
-
- .lp \h'24p'h 66p
- Edit headers. This puts you into the \f2header editing mode\f1, whereby
- you can edit any of the various headers of your message. Like
- the options screen, it's self-documenting, so it isn't explained in too much
- detail here.
-
- .lp \h'24p'i 66p
- Run \f2ispell\f1 (or some other configured spelling correction program).
- The outgoing message is run through an interactive spelling correction program
- if one is available. The default spelling program is the GNU \f2ispell\f1 program
- unless changed by the person who installed Elm on your system.
-
- .lp \h'24p'm 66p
- Make form. This converts the message you have edited into a form. See
- the \f3forms\f1 variable under \f3Boolean Variables\f1 in section 2 and
- \f2The Elm Forms Mode Guide\f1 for more details.
-
- .lp \h'24p's 66p
- Send. This sends the message as is without any further ado.
- .in 0
- .br
- .ne 5
- .sp
- .hn 1 "Using Elm with \*Qeditor = none\*U"
- .sp
- The Elm program also supports a builtin editor for simple message
- composition that is very (very) similar to the simple line
- editor available from the \f2Berkeley Mail\f1 system.
-
- To access it, you need merely to specify \*Q\f3editor=none\f1\*U in
- your \f2.elm/elmrc\f1 file.
- With that, any messages to be composed
- that don't already have text in the buffer (e.g. no reply with
- the text included, etc.), will use this editor.
- .sp
- From the builtin editor, the following options are available for use.
- Each command here is prefixed with a \*q~\*u (tilde).
- You can specify a different \*Qescape\*U character in your \f2.elm/elmrc\f1 file,
- if you desire (see the \f3escape\f1 variable under \f3String
- Variables\f1 in section 2).
- .sp
-
- .lp \h'16p'~? .5i
- Print a brief help menu.
-
- .lp \h'16p'~b .5i
- Change the Blind-Carbon-Copy list.
-
- .lp \h'16p'~c .5i
- Change the Carbon-Copy list.
-
- .lp \h'16p'~e .5i
- Invoke the \f3easyeditor\f1 editor on the message, if possible
- (see the \f3easyeditor\f1 variable under \f3String Variables\f1 in
- section 2).
-
- .lp \h'16p'~f .5i
- Add the specified message or current message.
-
- .lp \h'16p'~h .5i
- Change all the available headers (To, Cc, Bcc, and Subject).
-
- .lp \h'16p'~m .5i
- Same as \f3~f\f1, but with the current \f3prefix\f1 (see the
- \f3prefix\f1 variable under \f3String Variables\f1 in section 2).
-
- .lp \h'16p'~o .5i
- Invoke a user specified editor on the message.
-
- .lp \h'16p'~p .5i
- Print out, on the screen, the message as typed in so far.
-
- .lp \h'16p'~r .5i
- Include (read in) the contents of the specified file.
-
- .lp \h'16p'~s .5i
- Change the Subject line.
-
- .lp \h'16p'~t .5i
- Change the To list.
-
- .lp \h'16p'~v .5i
- Invoke the \f2vi\f1 visual editor on the message.
-
- .lp \h'16p'~< .5i
- Execute the specified
- .ux
- command, entering the output
- of the command into the editor buffer upon completion.
- For example, \*Q~< who\*U includes the output of
- the \f2who\f1 command in your message.
-
- .lp \h'16p'~! .5i
- Execute a
- .ux
- command if one is given (as in \*Q~!ls\*U) or
- give the user a shell, either from the \f3shell\f1 variable setting in
- the \f2.elm/elmrc\f1 file or the default (see the \f3shell\f1 variable
- under \f3String Variables\f1 in section 2).
-
- .lp \h'16p'~~ .5i
- Add a line prefixed by a single \*q~\*u character.
- .in 0
- .sp
- A useful note is that the \f3~f\f1 and \f3~m\f1 commands invoke the \f2readmsg\f1
- command, so you can pass parameters along too. For example, if we
- wanted to include a message from Joe, without any headers, but with each
- line prefixed, we could use:
- .sp
- .nf
- .ft CW
- .zf
- .ti .5i
- \&~m \-n Joe
- .ft 1
- .fi
- .sp
- to accomplish the task.
-
- To learn more about how they work, try 'em!
- .br
- .ne 5
- .sp
- .hn 1 The Alias System
- .sp
- As mentioned previously, there exists in the Elm
- system a set of aliases that associate
- an arbitrary word (such as a persons name) to a complex address or group.
- The advantages are readily apparent; rather than
- remembering an address of the form:
- .sp
- .nf
- .ps 9
- .ft CW
- .zf
- .ti .5i
- host1!host2! ... !hostN!user
- .ft 1
- .ps 10
- .fi
- .sp
- the user merely has to remember a single word.
-
- Two alias tables are available for a each
- user within Elm,
- namely the system alias file and the user's alias file. The
- system alias file is created and maintained (by the system administrator)
- by editing the file name defined for \f2SYSTEM_ALIASES\f1 in the
- \f2sysdefs.h\f1 file (see \f2The Elm Configuration Guide\f1) and as described
- in the documentation with the \f2newalias\f1 command,
- then running the \f2newalias\f1 program.
-
- An individual user can also have an alias file which works
- in conjunction with the system aliases. To do this, one
- merely needs to enter the alias menu system and create aliases with
- the \f3a\f1 (\f3alias current message\f1) or \f3n\f1
- (\f3make new alias\f1) commands.
- Alternatively, the user can peruse the documentation for the \f2newalias\f1
- command and create a file as indicated therein. After
- executing the program, the aliases are available
- for use from within Elm.
- .sp
- Please refer to \f2The Elm Alias Users Guide\f1 for complete details.
- .sp 2
- Within Elm,
- however, the alias system acts as an entirely different program, with
- its own display, own commands, and own mini-menu. The aliases are
- presented in a
- list similar to the index screen with the following menu:
- .sp
- .sd
- .nf
- .ps 9
- .ft CW
- .zf
- .ce 3
- Alias commands: ?=help, <n>=set current to n, /=search pattern
- a)lias current message, c)hange, d)elete, e)dit aliases.text, f)ully expand,
- l)imit display, m)ail, n)ew alias, r)eturn, t)ag, u)ndelete, or e(x)it
- .sp
- Alias: @
- .sp
- .ps 10
- .ft 1
- .ed
- .fi
-
- The commands are:
-
- .lp \h'16p'? .5i
- Help. This command used once puts you in the \f2help\f1
- mode, where any key you press will result in a one-line description
- of the key. Pressing \*q?\*u again at this point produces a
- summary listing each command available.
- Pressing \*q.\*u (period) leaves the help mode and returns you to the
- alias command prompt.
-
- .lp "\h'16p'<space> or <return> or v" .5i
- Display the current alias address. The alias address is displayed below
- the alias menu. This command allows you to verify the address for a
- person or the contents of a group alias.
-
- .lp \h'16p'$ .5i
- Resynchronize the alias text file (\f2$HOME/.elm/aliases.text\f1) and
- alias database by rebuilding the database from the text file by running
- \f2newalias\f1. Aliases marked for deletion are removed, tagged aliases
- are untagged, and new and changed aliases are recognized. The alias
- screen is updated to reflect these changes.
-
- .lp \h'16p'\/ .5i
- Pattern match. This command allows the
- user to search through all the \f2alias\f1 and \f2username\f1
- entries in the alias list
- starting at the current alias and
- continuing through the end.
- If the first character of the
- pattern is a \*q/\*u, then Elm also includes the \f2comment\f1
- and the fully expanded \f2address\f1 fields in the search.
- The search is case insensitive. This allows the user to find a
- specific alias in the situation where there are a large number of
- aliases.
-
- .lp \h'16p'a .5i
- Alias current message.
- This allows the user to create an alias that has the
- return address of the current message as the address field of
- the alias. It prompts for a unique alias name. If the alias
- name is not unique, you will be asked if you wish to replace
- the existing alias. For further
- information, please see \f2The Elm Alias System Users Guide\f1.
-
- .lp \h'16p'c .5i
- Change current alias. This will prompt for changes to the current
- names and address. If other aliases are tagged you will be asked if you
- want to create a group alias from the tagged aliases. The original
- alias is replaced with the new information in
- your individual alias file (\f2$HOME/.elm/aliases.text\f1) and
- then added to the database (at the next alias resync). Aliases
- that have been changed are marked with an \*qN\*u (for new) until
- the database is updated.
-
- .lp "\h'16p'd, u" .5i
- Delete or undelete an alias.
- This allows the user to mark an alias for deletion in the same fashion
- as on the index screen. The deletions are not
- actually made until the user returns to the main menu with the \f3r\f1,
- \f3q\f1, or \f3i\f1 commands or resyncs
- the display with the \f3$\f1 command. Deletions on system aliases are not
- allowed. These commands (plus the \f3<control>-D\f1
- and \f3<control>-U\f1 versions) behave identically to their index screen
- counterparts (see section 7, \f3Commands\f1).
-
- .lp \h'16p'e .5i
- Edit the \f2.elm/aliases.text\f1 file. The user alias file is edited
- using the editor defined in the \f3editor\f1 variable in your
- \f2\&.elm/elmrc\f1 file (see \f3String Variables\f1 in section 2).
- \f2newalias\f1 is run after the edit.
-
- .lp \h'16p'f .5i
- Display fully expanded alias. The currently selected
- alias is fully expanded and displayed to the user. This is most useful when
- working with group aliases.
-
- .lp \h'16p'l .5i
- Limit the display. You can limit the display by alias type (person/group
- or user/system) or by search pattern on name or alias. Otherwise, this
- works exactly like the limit command on the index screen.
-
- .lp \h'16p'm .5i
- Send mail to the current alias. The user is prompted to compose a new
- mail message to be sent to the
- person or group specified by the selected alias. If aliases are
- tagged the message is mailed to the person(s) and/or group(s)
- specified by the tagged aliases. Tags are cleared after mailing the
- message.
-
- .lp \h'16p'n .5i
- Make a new user alias. This prompts for a unique alias name and
- then for an address. If the alias
- name is not unique, you are asked if you wish to replace
- the existing alias. If aliases are tagged you are asked if you
- want to create a group alias from the tagged aliases.
- The information provided is added
- to your individual alias file (\f2$HOME/.elm/aliases.text\f1) and
- then added to the database at the next alias resync.
-
- .lp "\h'16p'r or q or i" .5i
- Return. Return to the index screen of the Elm program. Any pending
- deletions are processed and newalias is run to update the database. New
- additions are handled at this time as well.
-
- .lp "\h'16p'R or Q or I" .5i
- Quick return. This behaves like the \*qr\*u command except that you are never
- prompted for answers to alias disposition questions.
- Elm disposes of aliases according to the value
- set for the \f3alwaysdelete\f1 variable
- in your \f2.elm/elmrc\f1 file (see \f3Boolean Variables\f1 in
- section 2).
-
- .lp \h'16p't .5i
- Tag.
- Tag the current alias for a later operation.\s-2\u5\d\s0
- .fn
- 5. Currently only \f3mail\f1, \f3change\f1, and \f2n3w alias\f1 support this.
- .ef
- This command (plus the \f3<control>-T\f1
- version) behaves identically to its index screen
- counterpart (see section 7, \f3Commands\f1).
-
- .lp \h'16p'x .5i
- Exit alias menu. Exits the alias menu without processing any
- deletions. Aliases marked for deletion are unmarked and
- \f2newalias\f1 is not run, even if alias additions have been made.
- .in 0
- .sp
- Additionally, the movement keys (\*qj\*u, \*qk\*u, \*q+\*u, \*q\-\*u,
- etc.) work in the same fashion as on the index screen (see section 7,
- \f3Commands\f1).
- .br
- .ne 5
- .sp
- .hn 1 Elm and Signals
-
- Elm can handle several standard
- .ux
- \f2signals\fR to do
- some special processing.
- Signals are interrupt messages sent from one program to
- another. No detailed messages are sent, but a properly configured
- program (such as Elm) can watch for and handle these signals.
-
- In particular, Elm watches for the following signals
- and takes these actions:
- .lp ALRM .5i
- This is the alarm clock signal or time warning.
- Elm uses this to wake itself up periodically and check for
- new mail.
- .lp HUP .5i
- This is the hangup notice.
- It means that the terminal/modem/whatever which you have been using
- with Elm has become detached from the system where Elm
- was running.
- When Elm gets this signal, it aborts all the pending operations
- and exits, leaving your mailbox unchanged.
- .lp USR1 .5i
- This is the first user-defined signal.
- When Elm gets this signal, it receives any pending mail,
- performs all the pending operations (deletes), and exits
- leaving all unread mail marked as new.
- This is the same as giving both the \f3$\f1 and \f3X\f1 commands.
- .lp USR2 .5i
- This is the second user-defined signal.
- When Elm gets this signal, it receives any pending mail,
- performs all the pending operations (deletes), and exits,
- leaving all unread mail marked as old.
- This is the same as giving both the \f3$\f1 and \f3Q\f1 commands.
- .in 0
- .sp
- You would only use these signals yourself under the most unusual
- circumstances. For example, suppose you were using \f3Elm\fR
- to read mail on \f2host_1\fR. You have many messages, most of
- which have been read and filed (and therefore deleted), or simply
- deleted. You have not yet resynchronized your mailbox (\f3$\f1
- command). Now you go to lunch.
- On your return, you're stopped at the door and told to take care
- of an emergency. You go to another part of the building, and want
- to read your mail to see what the emergency is \(em but you can't,
- because Elm is still running at your desk.
-
- What you really want is one of the scenarios given in the
- description of \f2HUP\f1, \f2USR1\f1 or \f2USR2\f1.
- Use your local \f2ps\f1 command to find out what the \f2process number\f1
- of your Elm session is. Then give the command
- .sp
- .nf
- .ft CW
- .zf
- .ti .5i
- kill \-\f2XXX process_number\f1
- .fi
- .sp
- where \f2XXX\f1 is either \*QHUP\*U, \*QUSR1\*U or \*QUSR2\*U and
- \f2process_number\f1 is the process number for your remote Elm session.
- Your remote session will terminate with the actions noted above.
- .br
- .ne 5
- .sp
- .hn 1 Expert Mail Users and Debugging the Mailer
-
- There are some additional facilities available in the Elm
- mailer for those people who are knowledgeable about
- mail protocols, or trying to debug/track down a problem.
-
- The \f3h\f1 (\f3display with headers\f1) command at the command prompt
- displays the current message ignoring the current
- setting of the \f3weed\f1 variable (see \f3Boolean Variables\f1 in
- section 2). This is most useful
- for answering questions of the form \*QI wonder what
- this guy put in his header?\*U and such. This command
- does not show up on the mini-menu because it is somewhat
- esoteric, but it does appear on the help screen.
-
- The \f3@\f1 command at the command prompt
- outputs a screen of debugging information,
- including the number of lines and
- offsets of each of the messages in the current mailbox.
-
- The \f3#\f1 command at the command prompt
- displays the entire stored \*Qrecord structure\*U for
- the current message.
-
- The \f3%\f1 command
- displays the full computed return address of the
- current message.
-
- Starting up Elm with the \f3\-d\f1 (debug) option (see section 3,
- \f3Command Line Options\f1) creates a file called
- \f2ELM:debug.info\f1 in your home directory which contains a wealth of useful
- information (to me, at least!) to aid in tracking down
- what errors are occurring and why.
-
- If there are any problems with Elm, please try
- to recreate the error with the debug option enabled
- and set to the highest level (11) before sending defect reports my way.
-
- One final note: all error names reported by the program
- are documented in the \f2AT&T System V Interface Definition Reference
- Manual\f1 in \f3errno\f1(2).
--- 0 ----
Index: elmME+.2.5.alpha1-cvs/doc/Users.guide
*** elmME+.2.5.alpha0/doc/Users.guide 2002-01-26 13:14:45.000000000 +0200
--- /tmp/12834-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-04 14:00:44.000000000 +0300
***************
*** 1,1102 ****
- .\" @(#)$Id: Users.guide,v 1.2 1998/10/20 19:57:20 hurtta Exp $
- .\"
- .\" Users guide to the ELM mail system.
- .\" format with:
- .\" 'tbl Users.guide | troff tmac.n - > Users.fmtd'
- .\"
- .\" Elm is now in the public trust.
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust
- .\"
- .\"
- .tm I trust we've run this through "tbl" first...
- .\" Define the big box macro for troff
- .de eb
- .sp -1
- .nf
- .ie t \{\
- \h'-.5n'\L'|\\nau-1'\l'\\n(.lu+1n\(ul'\L'-|\\nau+1'\l'|0u-.5n\(ul'
- .\}
- .el \{\
- \h'-.5n'\l'\\n(.lu+1n'
- .\}
- .fi
- ..
- .\" Define break line for user interaction displays
- .de bl
- .ie t .tl '\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-'''
- .el .tl '-----------------------------------------------------------------'''
- ..
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .za
- .\" This will keep the nroff version of the title page on one sheet.
- .if t .sv |2.0i
- .ce 99
- .ps 20
- .ss 18
- .vs 12
- \f3The Elm Users Guide\f1
- .sp 3
- .ps 12
- .ss 14
- .vs 14
- \f2A painless introduction to electronic mail
- using the \f3Elm\fP mail system\f1
- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .fi
- .ad
- .ps 8
- .if t .vs 9
- .sp 4
- \f3ABSTRACT\f1
- .ce 0
- .sp
- .in +1i
- .ll -1i
- While various UNIX utilities have been designed to
- take advantage of the CRT screen
- (rather than line-oriented systems)
- electronic mail systems haven't \*Qcaught the wave\*U.
- This document
- presents Elm, a sophisticated
- full-screen mail system for interactive use.
- Elm offers all the features of
- \f2/bin/mail\f1, \f2Berkeley Mail\f1, \f2uumail\f1, \f2NMail\f1 and
- the AT&T Mail family of UNIX mailers (namely \f2PMX/TERM\f1) in a
- unified and intuitive fashion.
- .br
- .ll +1i
- .in -1i
- .sp |9.0i
- .ce 99
- .ps 12
- .ss 14
- .vs 14
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .fi
- .ad
- .bp 1
- .sv 5v
- .ps 14
- .ss 12
- .vs 16
- \f3Elm Users Guide\f1
- .ds h0 "Elm Users Guide
- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- Syd Weinstein


- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320

- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- .hn 1 Introduction
-
- The
- .ux
- operating system was originally written on a small PDP machine,
- to work with teletypewriters. Consequently, all the original software for
- the operating system was written with a \*Qtty\*U in mind;
- with line oriented interfaces, rather than screen oriented.
-
- Gradually this began to change, and, with the addition of the Berkeley \f2vi\f1
- visual shell to the \f2ed\f1
- line editor, the trend began to be brought to the attention of
- .ux
- systems designers.
- And yet, this transition has seemed
- too subtle for many software engineers,
- and so precious few
- .ux
- programs are available
- designed to exploit the entire CRT screen.
-
- Consequently, after becoming more and more disenchanted
- with the existing electronic mail facilities (\f2binmail\f1
- and \f2Berkeley Mail\f1)
- Dave Taylor decided to undertake creating his own system.
- Once the ball was rolling it became quite
- difficult not to keep enhancing it, especially as he and
- the Elm Development Group
- became more and more familiar with various different mail
- systems, but the result, we hope, is a solid, unified interface
- to electronic mail suitable for almost any environment.
-
- One thing that sets the Elm mail system off from
- other packages is that it
- comes with an extensive documentation set, including;
- \f2The Elm Users Guide\f1, which you're holding,
- \f2The Elm Reference Guide\f1,
- \f2The Elm Alias Users Guide\f1,
- \f2The Elm Filter System Users Guide\f1,
- \f2The Elm Forms Mode Guide\f1,
- and \f2The Elm Configuration Guide\f1.
- The names of each indicate
- what they discuss (not unreasonably).
-
- This particular document contains;
- this introduction, a tutorial session with the mailer, a
- discussion of non-interactive uses of Elm,
- a brief foray into the Elm utilities,
- and finally, credits and references.
-
- \f2The Elm Reference Guide\f1 contains a
- much more in-depth discussion of all the possible options
- available within the Elm environment, including
- the \f2.elm/elmrc\f1 file,
- the available outbound mail processing features,
- a section for expert users, suggestions
- on debugging strange installations, and
- many other useful topics.
-
- \f2The Elm Alias Users Guide\f1 is the place
- to go to learn about the format of the \f2.elm/aliases.text\f1
- file and the associated data files, system aliases, and other
- related topics.
-
- One of the more innovative features of Elm is
- the ability to transmit and receive \*Qforms\*U (as
- defined by the AT&T Mail system). To learn about
- how to create and reply to forms you should refer
- to \f2The Elm Forms Mode Guide\f1.
-
- If you find yourself getting too much mail delivered in
- your mailbox, you might be a good candidate for the
- \f2filter\f1 program. To learn more about what
- this program is and how to use it please
- consult \f2The Elm Filter System Users Guide\f1.
-
- Finally, if you're working with the actual source code
- and are interested in what all the locally configured
- options are and mean, please see
- \f2The Elm Configuration Guide\f1. It is
- strongly suggested that all system administrators
- and people installing the system print out the
- local \f2sysdefs.h\f1 file and have it handy while
- reading the configuration guide.
-
- The recommended order of learning the Elm
- system is to skim this guide until you feel
- confident enough to start up the program. Once
- that's reached, \f2use it!\f1 Soon you'll find
- areas that you need to expand into, and you can
- achieve that by going into the options
- screen within Elm and changing your
- user level accordingly.
- After a while, sit down again and read through this
- guide. You should have a couple of \*Qaha!\*U intuitive
- flashes. After another period of time, you're
- ready to delve into the real power of the system
- and read the reference guide. The other manuals
- should be read as the need arises.
-
- In any case, the system should be usable without reading
- \f2any\f1 of the documentation!
-
- Any comments or problems with any of the documentation or the program
- itself are welcome; if you can't get electronic mail to the Elm
- Development Group, please feel free instead to drop me a note via the
- overland mail address in the title page.
- .br
- .ne 20
- .sp
- .hn 1 The Main System
-
- Upon entry to the program, the main screen will be
- displayed as below:
-
- .\" display start, constant width, remember loc for BOX
- .ft CW
- .zf
- .ps 9
- .mk a
- .sp
- .ce
- Mailbox is \'/usr/mail/mymail\' with 15 messages [Elm 2.4PL22]
- .TS
- r l n l l l l.
- \-> N 1 Apr 24 Larry Fenske (49) Hello there
- N 2 Apr 24 jad@hpcnoe (84) Chico? Why go there?
- E 3 Apr 23 Carl Smith (53) Dinner tonight?
- NU 4 Apr 18 Don Knuth (354) Your version of TeX...
- N 5 Apr 18 games (26) Bug in cribbage game
- A 6 Apr 15 kevin (27) More software requests
- 7 Apr 13 John Jacobs (194) How can you hate RUSH?
- U 8 Apr 8 decvax!mouse (68) Re: your Usenet article
- 9 Apr 6 root (7)
- O 10 Apr 5 root (13)
- .TE
- .sp
- .ce 3
- You can use any of the following commands by pressing the first character;
- d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit
- To read a message, press <return>. j = move down, k = move up, ? = help
- Command : @
- .sp
- .\" draw box, proportional Roman font back, display end
- .eb
- .ps 10
- .ft 1
-
- There are a number of things to notice about this, the main screen;
-
- .lp \h'12p'\(bu 20p
- Most likely, on your computer the message currently \*Qactive\*U will be
- displayed in an inverse bar rather than being delimited by the two
- character arrow as here. It's nothing to worry about; displaying
- inverse video is just quite difficult on printable guides!
-
- .lp \h'12p'\(bu 20p
- The first line on the screen always displays the name of the current folder,
- the number of messages in the folder, and the current Elm version number.
-
- .lp \h'12p'\(bu 20p
- The arrow (\*Q\->\*U) or inverse video bar will always
- indicate which is the current message.
-
- .lp \h'12p'\(bu 20p
- The first field that appears associated with each message is
- the status field. This can be blank (as with most of the
- ones above, or can have any combination of the following:
-
- The first character signifies temporary status:
-
- .ta .75iC 102p
- .nf
- E for an \f2expired\f1 message
- N for a \f2new\f1 message
- O for an \f2old\f1 (i.e. not new but not read) message
- D for a \f2deleted\f1 message
-
- The second character which signifies permanent status:
-
- C for \f2confidential\f1 mail
- U for \f2urgent\f1 mail
- P for a \f2private\f1 message
- A for messages that have an \f2action\f1 associated with them
- F for a \f2form\f1 letter
- M for a \f2MIME\f1 compliant message
- .fi
-
- The third character of the status field can be a \*q+\*u to
- indicate that the message is \f2tagged\f1 too.
-
- .lp \h'12p'\(bu 20p
- Continuing from left to right, the next field is the message
- number. For the most part you can ignore these unless you want
- to quickly move to a specific message (as we'll see later).
-
- .lp \h'12p'\(bu 20p
- The date associated with each message is typically
- the date the person actually \f2sent\f1 the message.
-
- .lp \h'12p'\(bu 20p
- The next field displayed indicates whom the message is from.
- Elm will try to display the \f2full name\f1 of the person who
- sent the message, rather than the their return address or computer login.
- Some systems don't generate the correct headers, though, hence
- messages like numbers 2 and 8, where it's their return address.
-
- .lp \h'12p'\(bu 20p
- The number in parentheses is the total number of lines in the message.
-
- .lp \h'12p'\(bu 20p
- The final field is the subject of the message. Notice
- that messages might not have any subject, as in messages #9 and #10.
-
- .lp \h'12p'\(bu 20p
- A maximum of ten messages are displayed at one time.\s-2\u1\d\s0
- .fn
- 1. On screens with more than 24 lines, additional messages are
- displayed automatically. Furthermore, if you choose to turn off
- the menu display, you can have an even greater number
- displayed.
- .ef
- Further into the document we'll learn how to change \*Qpages\*U in the folder.
-
- .lp \h'12p'\(bu 20p
- The three line menu display will always
- indicate the relevant commands. There are actually two possible
- menus that can be displayed, based
- on the \f2user level\f1 as set from either the options screen or
- the \f2.elm/elmrc\f1
- file. The alternate menu, for more advanced users,
- lists more options;
- .sp
- .ft CW
- .zf
- .ps 9
- .ce 3
- |=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
- a)lias, C)copy, c)hange folder, d)elete, e)dit, f)orward, g)roup reply, m)ail,
- n)ext, o)ptions, p)rint, r)eply, s)ave, t)ag, q)uit, u)ndelete, or e(x)it
- .ps 10
- .ft 1
-
- .lp \h'12p'\(bu 20p
- Finally, the \*q@\*u character indicates where the cursor would be, awaiting
- your input.
-
- .sp
- .in 0
- The typical action at this point is to use the \f2<return>\f1
- key to read the current message, which will clear the
- screen and display the current message:
-
- .ne 10
- .ft CW
- .zf
- .ps 9
- .mk a
- .tl ' Message 1/15 from Larry Fenske''Apr 24 \'87 at 8:45 pm edt'
- .tl ''Hello there''
- .nf
- Dave,
- Just wanted to drop you a brief note to see what was going on with
- you this afternoon. Life here has been the usual fun and games...
- Ah well, off to the great wilds beyond the desk!
- Larry
- Command (\'i\' to return to index): @
- .fi
- .eb
- .ft 1
- .ps 10
-
- Before we go further with our example, however, let's very
- quickly look at all the functions available from the main
- screen:
- .\" ensure we get a reasonable chunk of this table on the page...
- .br
- .ne 10
- .lp \h'18p'\f3Command 90p
- Action\f1
-
- .lp "\h'18p'<return> or <space>" 90p
- Read current message.
- .lp \h'18p'| 90p
- Pipe current message or tagged messages to specified system command.
- .lp \h'18p'! 90p
- Shell escape.
- .lp \h'18p'$ 90p
- Resynchronize folder.
- .lp \h'18p'? 90p
- Help mode \(em any key pressed will be explained.
- .lp "\h'18p'+ or <right>" 90p
- Display next page of subjects.
- .lp "\h'18p'\- or <left>" 90p
- Display previous page of subjects.
- .lp \h'18p'= 90p
- Set current message to 1.
- .lp \h'18p'* 90p
- Set current to last message.
- .lp \h'18p'<number><return> 90p
- Set current message to number \f2number\f1.
- .lp \h'18p'/ 90p
- Search for pattern in subject/from lines.
- .lp \h'18p'// 90p
- Search for pattern in entire folder.
- .lp \h'18p'< 90p
- Scan message for calendar entries.\s-2\u2\d\s0
- .fn
- 2. Some sites might opt not to have the calendar feature available.
- .ef
- .lp \h'18p'> 90p
- A synonym for \f3s\f1 \(em \f3save\f1 message or messages.
- .sp
- .lp \h'18p'a 90p
- Alias, change to \*Qalias\*U mode.
- .lp \h'18p'b 90p
- Bounce \(em remail message (see \f3f\f1 \(em \f3forward\f1 too).
- .lp \h'18p'C 90p
- Copy current message or tagged messages to folder.
- .lp \h'18p'c 90p
- Change to another folder.
- .lp \h'18p'd 90p
- Delete current message.
- .lp \h'18p'<control>-D 90p
- Delete all messages matching specified pattern.
- .lp \h'18p'e 90p
- Edit current folder, resyncing upon re-entry.\s-2\u3\d\s0
- .fn
- 3. Some sites might opt not to have the edit folder feature available.
- .ef
- .lp \h'18p'f 90p
- Forward message to specified user.\s-2\u4\d\s0
- .fn
- 4. The difference between \f3forward\f1 and \f3bounce\f1 is rather
- subtle \(em a forwarded message is \f2from\f1 you, with the
- original message included, whereas a bounced message
- is still from the original sender.
- .ef
- .lp \h'18p'g 90p
- Group reply \(em reply to everyone who received the current message.
- .lp \h'18p'h 90p
- Display message with headers.
- .lp \h'18p'i 90p
- Return to index screen after displaying message.
- .lp \h'18p'J 90p
- Set current to next message.
- .lp "\h'18p'j or <down>" 90p
- Set current to next message not marked deleted.
- .lp \h'18p'K 90p
- Set current to previous message.
- .lp "\h'18p'k or <up>" 90p
- Set current to previous message not marked deleted.
- .lp \h'18p'l 90p
- Limit displayed messages based on the specified criteria.
- .lp \h'18p'<control>-L 90p
- Rewrite screen.
- .lp \h'18p'm 90p
- Mail to arbitrary user(s).
- .lp \h'18p'n 90p
- Read current message, then increment to next message not marked deleted.
- .lp \h'18p'o 90p
- Alter current system options.
- .lp \h'18p'p 90p
- Print current message or tagged messages.
- .lp \h'18p'q 90p
- Quit \(em maybe prompting for messages to delete, store, or keep.
- .lp \h'18p'Q 90p
- Quick quit \(em like quit but without prompting.
- .lp \h'18p'r 90p
- Reply to the author of current message.
- .lp \h'18p's 90p
- Save current message or tagged messages to folder.
- .lp \h'18p't 90p
- Tag current message.
- .lp \h'18p'<control>-T 90p
- Tag all messages matching specified pattern.
- .lp \h'18p'u 90p
- Undelete current message.
- .lp \h'18p'<control>-U 90p
- Undelete all messages matching specified pattern.
- .lp \h'18p'x 90p
- Exit \(em prompt if mailbox changed, don't record as read, don't save.
- .lp \h'18p'X 90p
- Exit immediately \(em don't record as read, don't save.
- .in 0
- .sp
- .ne 10
- But let's go back to our example and see some of this at
- work, shall we?
- .sp
- We were reading the message from Larry and the screen looked
- like:
-
- .ne 10
- .ft CW
- .zf
- .ps 9
- .mk a
- .tl ' Message 1/15 from Larry Fenske''Apr 24 \'87 at 8:45 pm edt'
- .tl ''Hello there''
- .nf
- Dave,
- Just wanted to drop you a brief note to see what was going on with
- you this afternoon. Life here has been the usual fun and games...
- Ah well, off to the great wilds beyond the desk!
- Larry
- Command (\'i\' to return to index): @
- .fi
- .eb
- .ft 1
- .ps 10
-
- From this point let's go ahead and reply to the message. To
- do this, we can use the \f3reply\f1 command.
- To do this, we type \*qr\*u and the last few lines change to
- something like:
- .ft CW
- .zf
- .ps 9
- .sp
- .bl
- .tl 'Command: Reply to message''Copy message? (y/n) @ '
- .sp 2
- .ft 1
- .ps 10
- To which we decide that we don't need the text of this message in
- our new one, so we reply \f2no\f1 by pressing the \*qn\*u key. The
- bottom part of the window then changes to:
- .ft CW
- .zf
- .ps 9
- .sp
- .bl
- .ie t .tl 'Command: Reply to message'To: Larry Fenske ''
- .el .tl 'Command: Reply to message''To: Larry Fenske '
- .tl 'Subject: Re: Hello there@'''
- .ft 1
- .ps 10
- .sp 2
- At this point we can either decide to enter a new subject (you could
- use either \f2backup word\f1 (\f2<control>-W\f1) or \f2backup line\f1 (this
- is the same as your \*Qline kill\*U character,
- \f2<control>-X\f1 or \f2<control>-U\f1
- usually)) or go with this one by pressing \f2<return>\f1. We'll
- just leave it as it is and press \f2<return>\f1, changing the
- screen to:
- .ps 9
- .ft CW
- .zf
- .sp
- .bl
- .ie t .tl 'Command: reply to message'To: Larry Fenske ''
- .el .tl 'Command: reply to message''To: Larry Fenske '
- .tl 'Subject: Re: Hello there'''
- .tl 'Copies to: @'''
- .ps 10
- .ft 1
- .sp
- There's no one we want to have receive copies of this message, so we'll
- just press \f2<return>\f1 again to indicate this.
-
- Once you've answered these questions the program will put you into
- your favorite editor and let you compose a response. When you're
- done it then asks:
- .ps 9
- .ft CW
- .zf
- .sp
- .tl 'Please choose one of the following options by parenthesized letter: @'''
- .tl ''e)dit message, edit h)eaders, s)end it, or f)orget it.''
- .ft 1
- .ps 10
- .sp
- Since we're just interested in sending the message out, we'll
- choose the \f3send\f1 option and press \*qs\*u. The program
- then sends the message, indicating that by the line below
- saying:
- .sp
- .ps 9
- .ft CW
- .zf
- Sending mail...
- .ft 1
- .ps 10
- .sp
- then putting at the bottom of the screen ``Mail sent!'' and giving us
- the prompt:
- .ps 9
- .ft CW
- .zf
- .sp
- .bl
- .tl 'Command:''(Use \'i\' to return to index.)''
- .sp
- .ps 10
- .ft 1
- Pretty easy, isn't it? Let's continue by going back to the main
- screen pressing the \*qi\*u key to request the \f2index\f1. The
- screen is then:
-
- .ne 20
- .ft CW
- .zf
- .ps 9
- .mk a
- .sp
- .ce
- Mailbox is \'/usr/mail/mymail\' with 15 messages [Elm 2.4PL22]
- .TS
- r l r l l l l.
- \-> 1 Apr 24 Larry Fenske (49) Hello there
- N 2 Apr 24 jad@hpcnoe (84) Chico? Why go there?
- E 3 Apr 23 Carl Smith (53) Dinner tonight?
- NU 4 Apr 18 Don Knuth (354) Your version of TeX...
- N 5 Apr 18 games (26) Bug in cribbage game
- A 6 Apr 15 kevin (27) More software requests
- 7 Apr 13 John Jacobs (194) How can you hate RUSH?
- U 8 Apr 8 decvax!mouse (68) Re: your Usenet article
- 9 Apr 6 root (7)
- O 10 Apr 5 root (13)
- .TE
- .sp
- .ce 3
- You can use any of the following commands by pressing the first character;
- d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit
- To read a message, press <return>. j = move down, k = move up, ? = help
- Command : @
- .sp
- .\" draw box, proportional Roman font back, display end
- .eb
- .ft 1
- .ps 10
-
- Notice that the first message is no longer marked as \f2new\f1
- since we've now read it.
- .sp
- Let's go ahead and read the message from kevin (message #6) since
- it has some sort of \f2action\f1 associated with it anyway. To
- do this, we simply press the \*q6\*u key, which will change the
- bottom of the screen to:
- .sp
- .ps 9
- .ft CW
- .zf
- .tl 'Command: New Current Message''Set current message to : 6@'

Kari E. Hurtta

unread,
Jul 9, 2004, 6:16:16 AM7/9/04
to
Archive-name: elmME+2.5/PLalpha1.3

Will be available on ftp.funet.fi


via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


Is available with

via WWW.


Before applying patch catenate parts 1 - 4 first.

This patch is agaist Elm ME+ 2.5 PLalpha0
============================================= [ part 3/4 ] =================


- .ft 1
- .ps 10
- .sp

- We'll just press \f2<return>\f1 to move the active message
- pointer (the arrow).
- .sp
- Now we're pointing at the new message, so let's go ahead and read
- it by pressing \f2<return>\f1 again, giving us:


-
- .ne 10
- .ft CW
- .zf
- .ps 9

- .mk a
- .tl ' Message 6/15 from kevin''Apr 15 \'87 at 11:36 am pst'
- .tl ''More software requests''
- Action: please acknowledge receipt
- I don\'t suppose you have a nifty netnews reader around too, do you??
- \-\-
- kevin
- Command (\'i\' to return to index): @
- .eb
- .sp


- .ps 10
- .ft 1
-

- .br
- .ne 5

- Well, it turns out that we don't, but a friend of ours does, so
- let's \f3forward\f1 the message to them by pressing \*qf\*u:


- .ps 9
- .ft CW
- .zf
- .sp

- .tl 'Command: Forward message''Edit outgoing message (y/n) ? @ '


- .ft 1
- .ps 10

- .sp 2
- No need to edit it, so let's answer \f2no\f1 with \*qn\*u:


- .sp
- .ps 9
- .ft CW
- .zf

- .tl 'Command: Forward message''Edit outgoing message (y/n) ? No '
- .tl 'To: @'''


- .ps 10
- .ft 1

- .sp
- We type in the address of the person we're forwarding to (in
- this case


- .ft CW
- .zf

- usenet\f1) and press
- \f2<return>\f1:


- .ft CW
- .zf
- .ps 9
- .sp

- .ie t .tl 'Command: Forward message'To: usenet ''
- .el .tl 'Command: Forward message''To: usenet '
- .tl 'Subject: More software requests (fwd)@'''


- .ft 1
- .ps 10
- .sp

- To which we again press \f2<return>\f1 to take the default subject.
- Elm asks for any possible copy recipients, asks us if we're
- sure we want to send it, and shoots it off.
- .sp
- Enough mail for now, however, so we just \f3exit\f1 by pressing
- the \*qx\*u key at the \*QCommand:\*U prompt and the program drops us
- back into our shell.
- .sp
- As you can see, it's quite easy to use the Elm system, so
- rather than continue with our example, let's
- look at some other aspects of the program.


- .br
- .ne 5
- .sp

- .hn 1 Non-Interactive Uses of Elm
-
- Before we go ahead and discuss the Elm utilities, it's worth
- noting that
- there are a couple of other ways to use the main mail
- system, namely to \*Qsend only\*U and to send files (batchmail).
-
- To send a message to someone without any of the associated
- overhead of reading in a mail folder, you can invoke the
- mailer with the name(s) of the people to send to. For example:
-
- .nf
- .ti +.5i
- $ \f3elm dave_taylor\f1
- .fi
-
- Elm then prompts for Subject, Copies, and then drops
- you in your editor (defined in the \f2.elm/elmrc\f1 file) to compose
- the message. When composition is complete, the program
- verifies transmission then terminates.
-
- .ne 6
- Elm also supports batch type mailing, of files and so on,
- by using the following command:
-
- .nf
- .ti +.5i
- $ \f3elm dave_taylor < help.c\f1
- .fi
-
- which reads in the file and transmits it to the specified user.
-
- .ne 3
- A subject may be specified with \*Q\-s \f2subject\f1\*U as an option
- to Elm in either \*Qsend only\*U or \*Qbatch\*U modes, as in:
-
- .nf
- .ti +.5i
- $ \f3elm \-s "File help.c, as promised" dave_taylor < help.c\f1
- .fi
-
- .ne 3
- Elm also has an option to specify that a certain file be used as the
- initial text of the message. This makes it easier to use Elm with
- other programs that interface with a mailer. Use \*Q\-i \f2file\f1\*U as an
- option to Elm in \*Qsend only\*U mode. For example, to specify to \f2rn\f1
- to use Elm as the mailer, define the following in \f3RNINIT\f1:


-
- .ft CW
- .zf
- .nf

- .ti +.5i
- \-EMAILPOSTER="elm \-i %h \-s \\"Re: %S\\" %t"


- .fi
- .ft 1
-

- See the man page for \f2rn\f1(1) or the newsreader you use for more specific
- information.
-

- .br
- .ne 5
- .sp

- .hn 1 The Elm Utilities
-
- The Elm mail system is really much more than a single
- program for reading and writing mail. It's a unified
- environment for intelligently dealing with electronic
- correspondence. As a consequence, it contains a number of other
- programs to aid in the easy processing of \*Qemail\*U,
- including the following;
-
- .lp \h'10p'answer 1.0i
- An answering-machine transcription program. Please see the
- manual entry for more information on how to use this program.
-
- .lp \h'10p'checkalias 1.0i
- A script for checking aliases simply.
-
- .lp \h'10p'elmalias 1.0i
- A tool to obtain information on defined aliases.
-
- .lp \h'10p'listalias 1.0i
- A script to produce sorted listings of aliases.
-
- .lp \h'10p'messages 1.0i
- A script that lists the number of messages in the specified
- folder. Suitable for login scripts and such.
-
- .lp \h'10p'newmail 1.0i
- This program monitors a mailbox or set of mailboxes and can
- output notification of new mail in one of two possible
- formats; either:
-
- .ne 6


- .nf
- .ft CW
- .zf
- .ps 9

- .ti +.5i
- >> New mail from Jimmy Carter \-\- Urgent matters of state


- .br
- .ti +.5i

- >> New mail from j...@ucbvax.arpa \-\- Did I hear someone say PARTY??


- .ft 1
- .ps 10
-

- if running as \f2newmail\f1 or:


-
- .ft CW
- .zf
- .ps 9
- .ti +.5i

- Jimmy Carter \-\- Urgent matters of state


- .br
- .ti +.5i

- j...@ucbvax.arpa \-\- Did I hear someone say PARTY??


- .ft 1
- .ps 10
- .fi
-

- if running as \f2wnewmail\f1. BSD Users will find this is
- a far superior \f2biff\f1 program.
-
- .lp \h'10p'wnewmail 1.0i
- This is the same program as \f2newmail\f1, but has different
- defaults if invoked this way.
-
- .lp \h'10p'readmsg 1.0i
- This handy little program can be used in two ways. First off,
- it can be used to easily read a specific message in the
- incoming mailbox, specified by ordinal number, by a string that
- the message contains, by the metacharacter \*q$\*u which
- represents the last message in the folder, or \*q*\*u which matches
- all the messages in the folder.
-
- For example;
-
- .ti +.5i
- $ \f3readmsg 4 5 9 | lpr\f1
-
- would generate a printout, \f2sans\f1 superfluous headers, of the fourth,
- fifth and ninth messages in your mailbox.
-
- .ti +.5i
- $ \f3readmsg Carter | page\f1
-
- would be a fast way to read what \*uole Jimmy has to say, and
-
- .ti +.5i
- $ \f3readmsg \-h hear someone say\f1
-
- would list, including all the message headers, the message
- containing the string \*Qhear someone say\*U.
-
- .lp \h'10p'frm 1.0i
- Similar to the Berkeley \f2from\f1 command, this will
- give you a \*Qtable of contents\*U or a summary of either the current
- mailbox or a mailbox of your choice. It's useful to
- see what mail is pending, or what's in a mailbox.
- If used with the \*Q\-n\*U option, it will number each message
- in a way compatible with the arguments \f2readmsg\f1
- expects to get, too!
-
- .lp \h'10p'newalias 1.0i
- This is used to install new user/group aliases. Please see
- \f2The Elm Alias Users Guide\f1 for further information.
-
- .lp \h'10p'fastmail 1.0i
- Sometimes you want to have a batchmailing system that works as
- quickly as possible, not bothering with aliases or any of the
- other \*Qdeluxe\*U features of Elm. An example of this would
- be if you have a large mailing list for a newsletter, say.
- This command, \f2fastmail\f1, is designed just for that purpose.
- It avoids the lengthy startup time of Elm while still
- generating valid RFC-822\s-2\u5\d\s0 mail.
- .fn
- 5. If you don't know what RFC-822 is, don't worry about it!
- .ef
- Please see the manual entry for more information on this
- command.


- .in 0
- .br
- .ne 5
- .sp

- .hn 1 "Credits and So on \(em Elm's early years from Dave Taylor"
-
- This mailer has been evolving over the past few years with
- invaluable comments on the interface and general mail
- issues from the following people;
- Jim Davis, Steve Wolf (or should that say Steve!! Wolf!!!! perhaps?),
- Larry Fenske, Rob Sartin,
- John Dilley and Carl Dierschow.
- .sp
- For the Berkeley implementation, lots of help came from
- both John Lebovitz and Ken Stone.
- .sp
- For the Amdahl/UTS implementation, thanks to Scott McGregor and
- Stan Isaacs.
- .sp
- For the Sun problems, Dave England in Lancaster (UK) turned out to be
- \*Qbloody useful\*U, as he would no doubt say.
- .sp
- The Pyramid version is due to the work of Steve Malone
- of the University of Washington.
- .sp
- A number of other people have been amazingly disciplined at reporting
- problems and (usually, much to my relief) indicating the fixes needed,
- especially Guy Hillyer, Bruce Townsend and Eric Negaard.
- .sp
- There have been many, many others, too numerous to mention, that
- have inspired me with questions like \*QWhy can't Elm...\*U or
- \*QWhy does it ...\*U or \*QCan we make it...\*U too. A loud round of
- applause and an enthusiastic THANK YOU to you all!!
- .sp
- Also helpful was the ability to have my \*Qown\*U machine to
- close up the many many iterative loops that this software
- has gone through \(em since being on a big multi-user machine
- tends to slow it down to a standstill.
- For that, I thank Hewlett-Packard Colorado Networks Division for their
- initial support, and now HP Laboratories for the wonderful working
- environment that I have here (more than any one person is safe having,
- I suspect).
- .sp
- Mailers that have influenced the design and implementation of Elm,
- for better or worse, include the following;
-
- .lp \h'4p'\f2/bin/mail\f1 1.0i
- The most basic of mailers, this one was simply the example of how \f2not\f1
- to force the user to interact with a program.
-
- .lp "\h'4p'\f2Berkeley Mail\f1" 1.0i
- A surprisingly sophisticated mailer, especially the version with 4.3 BSD,
- \f2Berkeley Mail\f1 still suffers from the tendency to force the user to
- know too much about the system, and also lacks a friendly, non-cryptic
- interface for the large subset of the population that use
- .ux
- but aren't
- interested in becoming a \*Qhacker\*U.
-
- .lp \h'4p'\f2MH\f1 1.0i
- This is another nifty mailer. The main difference between this and the
- other mailers about is that it is a discrete set of programs rather than
- a single unified interface. This is quite useful for those people that
- receive \f2lots\f1 of mail and are willing to spend some time learning
- the intricacies of the program. It's quite powerful, but again, misses some
- of the basic friendly features the majority of users are interested in.
-
- .lp \h'4p'\f2dmail\f1 1.0i
- A sort of mutated cross between \f2MH\f1 and \f2Berkeley Mail\f1, it was
- this program that convinced me to implement the \f3limit\f1 functions.
-
- .lp \h'4p'\f2NMail\f1 1.0i
- A part of the HP AI Workstation Software Environment, this program hints
- at the power that mailers could be given to help deal with mail in a quick
- and intelligent fashion. Most of what it can do, and a lot more, are
- therefore part of Elm. Indubitably. And quite fast too!
-
- .lp \h'4p'\f2PMX/TERM\f1 1.0i
- Part of the AT&T Mail package, a single glance at this interface convinced
- me that a PC interface, with almost half of the screen taken up by a silly
- function key mapping, is most certainly \f2not\f1 the way to do things!!
- On the other hand, it also shows that the \*Qforms\*U mode can be quite
- nicely integrated into a more sophisticated mailer.
-
- .lp \h'4p'\f2fmail\f1 1.0i
- A nickel addition to the \f2/bin/mail\f1 program to add some rudimentary
- screen interface stuff, this nonetheless interesting mailer is part of
- the AT&T Toolchest.
-
- .lp \h'4p'\f2Laurel\f1 1.0i
- A program only available within Xerox PARC, this was an interesting
- early attempt at a graphics based full-screen mail program. The one,
- perhaps trivial, part of the interface I really like was the fact that
- it would \f2cross out\f1 a message that was marked for deletion. One
- day when we get real graphics and the ability to use them in
- a facility (not too) like \f2termcap\f1, perhaps Elm will do
- this too!
-
- .lp \h'4p'\f2Mailtool\f1 1.0i
- Part of the Sun distribution package, this program is a really nice
- example of what can be done by putting a smart shell on top of a dumb
- program \(em it uses \f2/bin/mail\f1 for all the \*Qdirty work\*U. Other than
- that, it's not a particularly interesting interface or mailer, and it
- certainly doesn't add much functionality!
-
- .lp \h'4p'\f2Metamail\f1 1.0i
- What can I say? This isn't even a real mailer,\s-2\u6\d\s0
- .fn
- 6. Not to be confused with the multi-media mailer, \f2metamail\f1, from
- Nathaniel Borenstein of Bellcore.
- .ef
- but is just what I dream
- of as an interface to mail in the future. A program that works sort of
- like HAL did in \f22001: A Space Odyssey\f1 \(em where it interrupts
- me as appropriate for important mail, and can answer inane and other
- queries itself according to what I teach it. Maybe Elm, by some sort
- of groupmind metamorphosis, will change into that someday. Maybe not. Maybe
- no one bothers to read this far into the document!!
-
- .in 0
- Finally, it's also been a very useful experience overall,
- confirming my beliefs that iterative software design and
- keeping a close watch on users (not to mention an open
- mind and mailbox!) improves a product manyfold. Comments,
- feedback and bug reports (and fixes!) are, of course, always welcome!


- .br
- .ne 5
- .sp

- .hn 1 "Credits and So on Part II \(em The Usenet Elm Development Group"
-
- As coordinator of the Elm Development Group, I must add to the credits.
- This group of volunteers has taken the Elm code from Dave Taylor and
- added features, made it more robust, and more portable.
- .sp
- For getting the Usenet Elm group going, for without which I wouldn't be
- writing this, thanks to Greg Hackney at Southwestern Bell Telephone Co.
- .sp
- For the Configuration system and its newer Dist 2.0 version, thanks are
- due to Larry Wall of JPL-NASA.
- .sp
- For his over two hundred sets of changes to version 2.2, Elm owes a lot
- to Rob Bernardo who was at Pacbell at that time.
- .sp
- The ability to run Elm at all on Intel 286 machines owes a lot to the
- insistent nudging of the coordinator by Chip Salzenberg,
- Chip Rosenthal, and Tim Evans.
- .sp
- For getting us the rights to use the news macros and converting all
- the documentation over to those macros, thanks to Mike Brown.
- .sp
- For pushing us into the \*u90s and forcing the issues of
- NLS and foreign language support, I thank Jan Saell of Administration & Systemkonsult AB
- along with Larry Philps of SCO Canada.
- .P
- I'd also like to thank the many current and prior members of the Elm
- development and testing groups. The list varies from time to time
- as people come and go. Also, to all the Elm users out there who
- send in patches. The group can use all the extra help it gets.
- As a postScript, if you wish to join the group, all it takes is some
- time to work on things, and to ask.
-
- Syd Weinstein, Elm Coordinator.
--- 0 ----
Index: elmME+.2.5.alpha1-cvs/hdrs/elm_globals.h
*** elmME+.2.5.alpha0/hdrs/elm_globals.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/elm_globals.h 2004-07-03 18:23:03.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elm_globals.h,v 1.1.2.2 2004/05/13 16:26:18 hurtta Exp $ */

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.1.2.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
******************************************************************************

--- 1,7 ----
! /* $Id: elm_globals.h,v 1.1.2.3 2004/07/03 15:23:03 hurtta Exp $ */

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.1.2.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
******************************************************************************

***************
*** 180,187 ****
#define MAIL_REPLYING (1<<3)
#define MAIL_FORWARDING (1<<4)


#define MAIL_HAVE_ATTACHMENTS (1<<5) /* Flag for verify transmission */

! #define MAIL_HAVE_PGP_ENCODED (1<<6) /* Falg for verify transmission */
!


#if 0 /* XXXX not used */

--- 180,187 ----
#define MAIL_REPLYING (1<<3)
#define MAIL_FORWARDING (1<<4)


#define MAIL_HAVE_ATTACHMENTS (1<<5) /* Flag for verify transmission */

! #define MAIL_HAVE_PGP_ENCODED (1<<6) /* Flag for verify transmission */
! #define MAIL_MIME_ATTCH (1<<7) /* mimeforward */



#if 0 /* XXXX not used */

Index: elmME+.2.5.alpha1-cvs/hdrs/elmlib.h
*** elmME+.2.5.alpha0/hdrs/elmlib.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/elmlib.h 2004-07-03 18:23:03.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmlib.h,v 1.207.4.14 2004/05/15 20:11:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207.4.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.207.4.16 2004/07/03 15:23:03 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207.4.16 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

! extern ESTR defaultfile_e; /* name of default folder */
! extern ESTR calendar_file_e; /* name of file for clndr */

extern nl_catd elm_msg_cat; /* message catalog */
extern int title_messages; /* flag: title message display? */
extern char home[SLEN]; /* home directory of user */
extern char username[SLEN]; /* return address name! */
***************
*** 739,744 ****
--- 756,763 ----
extern int prompt_for_cc; /* flag: prompt user for 'cc' value? */
#ifdef USE_PGP


extern int pgp_askpgpsig; /* Should pgp ask userid to sign messages with? */
+ extern int pgp_interactive; /* Should pgp/gpg encryption/signing to be
+ run always on interactive mode */

extern int pgp_sign_type; /* 0 = application/pgp


1 = text/plain
2 = text/x-pgp

***************
*** 795,806 ****


extern charset_t wanted_display_charset; /* name of character set */
extern int DSN_success; /* flag: Ask successfull DSNes */
extern char e_editor[SLEN]; /* "~e" editor... */
! extern char editor[SLEN]; /* default editor for mail */

extern int env_from_source; /* 0 == forward-from,


1 == from,
2 == return-path
*/

! extern char raw_editor[SLEN]; /* unexpanded default editor for mail */
extern char escape_char; /* '~' or something else... */
extern int force_name; /* flag: save by name forced? */
extern int fragment_handling; /* 0 == none,

--- 814,825 ----
extern charset_t wanted_display_charset; /* name of character set */
extern int DSN_success; /* flag: Ask successfull DSNes */
extern char e_editor[SLEN]; /* "~e" editor... */
! extern ESTR editor_e; /* editor for outgoing mail*/
extern int env_from_source; /* 0 == forward-from,


1 == from,
2 == return-path
*/
!

extern char escape_char; /* '~' or something else... */

extern int force_name; /* flag: save by name forced? */
extern int fragment_handling; /* 0 == none,
***************

*** 827,834 ****
3 == non-spool */


extern char raw_local_fs_charset[SLEN]; /* filesystem charset */

extern charset_t local_fs_charset; /* filesystem charset */
! extern char local_signature[SLEN];/* local msg signature file */
! extern char raw_local_signature[SLEN];/* unexpanded local msg signature file */
extern int lockfolders; /* Lock folder when open */
extern int lock_in_copy; /* Lock folder when copied to it */
extern char folders[SLEN]; /* folder home directory */
--- 846,852 ----
3 == non-spool */


extern char raw_local_fs_charset[SLEN]; /* filesystem charset */

extern charset_t local_fs_charset; /* filesystem charset */
! extern ESTR local_signature_e; /* local msg signature file */
extern int lockfolders; /* Lock folder when open */
extern int lock_in_copy; /* Lock folder when copied to it */
extern char folders[SLEN]; /* folder home directory */
***************
*** 850,855 ****
--- 868,874 ----


extern int internal_mailcap_t_prompt; /* ... really? */

extern int metoo; /* flag: copy me on mail to alias? */
extern int mimeforward;
+ extern int askmimeforward;
extern int mime_body_keywords; /* flag: if false the body is not parsed for keywords */
extern int move_when_paged; /* flag: move when '+' or '-' used? */
extern int names_only; /* flag: display names but no addrs? */
***************

*** 864,871 ****


extern int page_known_charsets;
extern int pagemultipart;
extern int pagesigned;
! extern char pager[SLEN]; /* what pager to use... */
! extern char raw_pager[SLEN]; /* unexpanded what pager to use... */
#ifdef USE_PGP
extern char pgp2_path[SLEN]; /* Pgp2 path or "none" if no pgp2 */
extern char raw_pgp2_path[SLEN];

--- 883,889 ----


extern int page_known_charsets;
extern int pagemultipart;
extern int pagesigned;
! extern ESTR pager_e; /* what pager to use... */
#ifdef USE_PGP
extern char pgp2_path[SLEN]; /* Pgp2 path or "none" if no pgp2 */
extern char raw_pgp2_path[SLEN];
***************

*** 885,903 ****


extern int quote_forward; /* flag: fwd'd msgs quoted like replies */
extern int readdatapercentinc; /* data percent increment during new mbox read */
extern int readmsginc; /* msg cnt increment during new mbox read */
! extern char recvd_mail[SLEN]; /* folder for storing received mail */
! extern char raw_recvdmail[SLEN];/* unexpanded recvd_mail name */
! extern char remote_signature[SLEN];/* remote msg signature file */
! extern char raw_remote_signature[SLEN];/* unexpanded remote msg signature file*/
extern int req_mime_bodyencoding;

extern int req_mime_hdrencoding;
extern int resolve_mode; /* flag: resolve before moving mode? */

extern int save_by_name; /* flag: save mail by login name? */
extern int save_by_alias; /* save mail by alias of login name? */
! extern char sent_mail[SLEN]; /* name of file to save copies to */
extern int set_window_title; /* flag: set (xterm?) window title and
icon name */


- extern char raw_sentmail[SLEN]; /* unexpanded name of file to save to */
extern char shell[SLEN]; /* default system shell */
extern char raw_shell[SLEN]; /* unexpanded default system shell */
#ifdef USE_PGP

--- 903,918 ----


extern int quote_forward; /* flag: fwd'd msgs quoted like replies */
extern int readdatapercentinc; /* data percent increment during new mbox read */

extern int readmsginc; /* msg cnt increment during new mbox read */
! extern ESTR recvd_mail_e; /* folder for storing received mail */
! extern ESTR remote_signature_e;/* remote msg signature file */
extern int req_mime_bodyencoding;


extern int req_mime_hdrencoding;
extern int resolve_mode; /* flag: resolve before moving mode? */

extern int save_by_name; /* flag: save mail by login name? */
extern int save_by_alias; /* save mail by alias of login name? */
! extern ESTR sent_mail_e; /* name of file to save copies to */
extern int set_window_title; /* flag: set (xterm?) window title and
icon name */


extern char shell[SLEN]; /* default system shell */

extern char raw_shell[SLEN]; /* unexpanded default system shell */
#ifdef USE_PGP
***************
*** 1980,1985 ****
--- 1995,2007 ----


extern int query_mailer_info P_((struct mailer_info *I,
enum MI_query query));

+ /* -1 if connection lost
+ 0 if OK
+ 1 if mailer reinitialized and query_mailer_info()
+ need to be called again
+ */
+ extern int mailer_restarted P_((struct mailer_info *I));
+
/* Should return 1 if verify succees and fields of result to be filled
-- caller should free fields of result
Returns 0 on failure
***************

*** 2103,2108 ****
--- 2125,2133 ----


extern void dump_expanded_address P_((int debuglevel, const char *text,
struct expanded_address expanded));

+ extern void expanded_address_from_items P_((struct expanded_address *result,
+ struct addr_item *TMP));
+

struct mailing_headers {
unsigned short magic; /* MAIL_HDR_magic */

Index: elmME+.2.5.alpha1-cvs/hdrs/mailer_imp.h
*** elmME+.2.5.alpha0/hdrs/mailer_imp.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/mailer_imp.h 2004-05-23 19:24:48.000000000 +0300
***************
*** 1,7 ****
! /* $Id: mailer_imp.h,v 1.7 2004/03/27 18:31:36 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! /* $Id: mailer_imp.h,v 1.7.8.1 2004/05/23 16:24:48 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 37,42 ****


--- 37,51 ----
struct mailer_info *I,
enum MI_query query));

+ /* Return
+ 1 == mailer restarted, reconnect succeed -- reask info
+ 0 == mailer not disconnected
+ -1 == mailer disconnected, reconnect failed
+ */
+ typedef int mailer_info_restart_hook P_((struct mailer_config *M,
+ struct mailer_info *I));
+
+
/* Return
-1 if caller should result with default data (return 1)
-2 if caller should just test passwd
***************
*** 88,93 ****
--- 97,103 ----
mailer_info_verify_addr * mi_verify_addr;
mailer_info_gen_def_ef * mi_def_env_from;
mailer_info_set_ef * mi_set_env_from;
+ mailer_info_restart_hook * mi_restart_hook;

int mailer_bits;
/* TODO: Add to this mailer specific data

Index: elmME+.2.5.alpha1-cvs/hdrs/me.h
*** elmME+.2.5.alpha0/hdrs/me.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/me.h 2004-07-03 18:23:03.000000000 +0300
***************
*** 1,7 ****


! /* $Id: me.h,v 1.87.8.8 2004/05/16 09:54:13 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.87.8.10 2004/07/03 15:23:03 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87.8.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 360,367 ****


/* mime.c */

extern int have_metamail P_((void));
! extern void clear_mime_send_info P_((mime_send_t *mime_info,
! struct mailer_info *mailer_info));
extern void free_mime_send_info P_((mime_send_t *mime_info));
extern void add_paramater_1 P_((char **ptr, char *name,
char *value, int quoted));

--- 360,366 ----


/* mime.c */

extern int have_metamail P_((void));
! extern void clear_mime_send_info P_((mime_send_t *mime_info));
extern void free_mime_send_info P_((mime_send_t *mime_info));
extern void add_paramater_1 P_((char **ptr, char *name,
char *value, int quoted));
***************

*** 492,498 ****




extern int a_sendmsg P_((int edit_message, int form_letter,
! struct MailboxView *mailbox /* save_copy needs */,
struct AliasView *aview, int header_page,

struct menu_context *page));


extern int send_msg_argv P_((char *argv[],

--- 491,497 ----




extern int a_sendmsg P_((int edit_message, int form_letter,
! struct MailboxView *mailbox,
struct AliasView *aview, int header_page,

struct menu_context *page));


extern int send_msg_argv P_((char *argv[],
***************

*** 501,513 ****


struct AliasView *aview,
struct menu_context *page));

! extern int send_msg_l P_((struct header_rec * current_header,
struct addr_item *given_to,
struct addr_item *given_cc,
char *given_subject,
int options, int form_letter,
! FILE *infile,
! struct MailboxView *mailbox /* for save_copy */,
struct AliasView *aview,
struct menu_context *page
));

--- 500,511 ----


struct AliasView *aview,
struct menu_context *page));

! extern int send_msg_l P_((int index,
struct addr_item *given_to,
struct addr_item *given_cc,
char *given_subject,
int options, int form_letter,
! struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page
));

***************
*** 518,523 ****
--- 516,522 ----


struct AliasView *aview,
struct menu_context *page));

+
/* mailmsg2.c */

#if ANSI_C
***************

*** 526,542 ****



extern struct string * gen_From_buffer P_((const struct header_rec * current_header));

! extern int mail P_((struct header_rec *current_header,
int options, int form,

struct mailing_headers *headers,
struct mailer_info *mailer_info,
! FILE *infile,

! struct MailboxView *mailbox,
struct AliasView *aview));


! extern int mail_form P_((struct header_rec *current_header,
struct addr_item *address,
char *subj,
- FILE *infile,

struct MailboxView *mailbox,
struct AliasView *aview));

--- 525,539 ----



extern struct string * gen_From_buffer P_((const struct header_rec * current_header));

! extern int mail P_((int idx,
int options, int form,
struct mailing_headers *headers,
struct mailer_info *mailer_info,
! struct MailboxView *mailbox /* system_call() */,
struct AliasView *aview));
! extern int mail_form P_((int mail_index,
struct addr_item *address,
char *subj,

struct MailboxView *mailbox,
struct AliasView *aview));

***************
*** 545,554 ****



/* froms.c */

! extern int mail_filled_in_form P_((struct header_rec * current_header,
struct addr_item *address,
char *subject,
- FILE *infile,
struct MailboxView *
mailbox /* for save_copy */,
struct AliasView *aview));

--- 542,550 ----



/* froms.c */

! extern int mail_filled_in_form P_((int mail_index,
struct addr_item *address,
char *subject,
struct MailboxView *
mailbox /* for save_copy */,
struct AliasView *aview));
***************

*** 609,615 ****
int form,


mime_send_t *mime_info,
FILE * conv_file,

- struct MailboxView *mailbox,
struct menu_context *page,
struct AliasView *aview));

--- 605,610 ----
***************
*** 722,741 ****


extern void get_return_name P_((char *address, char *name,
int trans_to_lowercase,
int size));
! extern int forward P_((struct header_rec *hdr,
! FILE *infile,
struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));
! extern int reply_to_everyone P_((struct header_rec *hdr,
! FILE *infile,
! struct MailboxView *mailbox
! /* for save_copy */,
struct AliasView *aview,
struct menu_context *page));
! extern int reply P_((struct header_rec *hdr,
! FILE *infile,
! struct MailboxView *mailbox /* for save_copy */,
struct AliasView *aview,
struct menu_context *page));

--- 717,732 ----


extern void get_return_name P_((char *address, char *name,
int trans_to_lowercase,
int size));
! extern int forward P_((int index,
struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));
! extern int reply_to_everyone P_((int index,
! struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));
! extern int reply P_((int index,
! struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));

***************

*** 814,819 ****
--- 805,818 ----


struct menu_context *page
));

+ extern int no_editor_edit_the_message P_((char *filename,
+ struct mailing_headers * headers,
+ charset_t file_set,
+ struct mailer_info *mailer_info,
+ struct MailboxView *mailbox
+ /* needed for system_call() */,

+ struct AliasView *aview


+ ));

/* delete.c */

***************

*** 1015,1020 ****
--- 1014,1025 ----



extern struct MailboxView * current_mailbox;

+ /* Better handling of current mailbox:
+ idx == 0 first
+ */
+
+ extern struct MailboxView * give_next_open_mailbox P_((int *idx,
+ int signal));

/* Joins storage to new view */
extern struct MailboxView * malloc_mailbox_view P_((struct current_storage *
***************

*** 1104,1110 ****


struct counter_data *counter,
parse_mime_callback *parse_mime));

-
extern void write_mailbox_info P_((FILE *fp, struct MailboxView *mailbox));

/* caller must string_free() result -- calculated if not set */

--- 1109,1114 ----
***************
*** 1128,1134 ****



extern int have_partial P_((struct MailboxView *parent_mailbox));

-
/* screen/screen.c */

extern int InitScreen P_((struct menu_context **page));

--- 1132,1137 ----
Index: elmME+.2.5.alpha1-cvs/hdrs/rc_imp.h
*** elmME+.2.5.alpha0/hdrs/rc_imp.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/rc_imp.h 2004-07-03 18:23:03.000000000 +0300
***************
*** 1,7 ****
! /* $Id: rc_imp.h,v 1.10.8.2 2004/05/01 20:07:50 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: rc_imp.h,v 1.10.8.3 2004/07/03 15:23:03 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 29,35 ****
--- 29,40 ----
/* Returns pointer to static buffer */
typedef char * rc_get_value P_((struct rc_save_info_rec *r));

+ #define RCTYPE_magic 0xF402
+
extern struct rc_type {
+ unsigned short magic; /* RCTYPE_magic */
+
+
rc_parse_line * parse_line; /* Parse line */
rc_parse_cline * parse_cline; /* Parse continuation line */
rc_print_value * print_value;
***************
*** 38,44 ****
} rc_DT_SYN, rc_DT_STR, rc_DT_NUM, rc_DT_BOL,

rc_DT_CHR, rc_DT_SRT,
rc_DT_MLT, rc_DT_ASR, rc_DT_PRM, rc_DT_FUNC,

! rc_DT_LONG, rc_DT_PATH, rc_DT_OBS;

extern int valid_rc_type P_((struct rc_type *T));

--- 43,49 ----
} rc_DT_SYN, rc_DT_STR, rc_DT_NUM, rc_DT_BOL,

rc_DT_CHR, rc_DT_SRT,
rc_DT_MLT, rc_DT_ASR, rc_DT_PRM, rc_DT_FUNC,

! rc_DT_LONG, rc_DT_PATH, rc_DT_OBS, rc_DT_ESTR;

extern int valid_rc_type P_((struct rc_type *T));

***************
*** 76,81 ****
--- 81,90 ----


extern int expand_dt_path P_((struct dt_path_info *ptr, char *fieldname,
char *val, int recursive));

+ extern int expand_dt_estr P_((struct dt_estr_info *ptr,
+ char *fieldname,
+ char *val));

+
/*
* Local Variables:
* mode:c

Index: elmME+.2.5.alpha1-cvs/hdrs/save_opts.h
*** elmME+.2.5.alpha0/hdrs/save_opts.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/save_opts.h 2004-07-03 18:23:04.000000000 +0300
***************
*** 1,7 ****
! /* @(#)$Id: save_opts.h,v 1.82.2.14 2004/05/15 20:11:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.82.2.14 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* @(#)$Id: save_opts.h,v 1.82.2.15 2004/07/03 15:23:04 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.82.2.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 67,72 ****
--- 67,80 ----


char ** list;
};

+ #define ESTR_meta 1
+
+ struct dt_estr_info {
+ int flags;
+ char * unexpanded;
+ char * expanded;
+ };
+
#ifdef USE_DLOPEN
struct dt_shared_info {
struct shared_loader *loader;
***************

*** 103,109 ****


#ifdef USE_DLOPEN
struct dt_shared_info *shared;
#endif
! void *dummy;
} val;
option_func *func_val;
int size_val;

--- 111,118 ----


#ifdef USE_DLOPEN
struct dt_shared_info *shared;
#endif
! struct dt_estr_info *estr;
! void *dummy;
} val;
option_func *func_val;
int size_val;

***************
*** 142,147 ****
--- 151,157 ----


#define ZZZ_DT_PATH(A) &rc_DT_PATH,0, { path: A }, null_option_func
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, { str: NULL }, null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, { shared: A }, null_option_func

+ #define ZZZ_DT_ESTR(A) &rc_DT_ESTR,0, { estr: A }, null_option_func
#else


***************

*** 182,187 ****
--- 192,198 ----


#define ZZZ_DT_PATH(A) &rc_DT_PATH,0, (char *)A, null_option_func
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, NULL , null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, (char *)A, null_option_func

+ #define ZZZ_DT_ESTR(A) &rc_DT_ESTR,0, (char *)A, null_option_func
#endif

/* shared.c */

***************
*** 269,274 ****
--- 280,286 ----


{"askcc", -1L,ZZZ_DT_BOL(&prompt_for_cc), 0, NULL},

{"askdelete", -1L,ZZZ_DT_BOL(&ask_delete), 0, NULL },

{"askkeep", -1L,ZZZ_DT_BOL(&ask_keep), 0, NULL },

+ {"askmimeforward", -1L,ZZZ_DT_BOL(&askmimeforward), 0, NULL},


#ifdef USE_PGP
{"askpgpsig", -1L,ZZZ_DT_BOL(&pgp_askpgpsig), 0, NULL},
#endif

***************
*** 294,301 ****



{"browser-wildcard-matching", -1L,ZZZ_DT_BOL(&browser_wildcards), 0, NULL},
{"builtinlines", -1L,ZZZ_DT_NUM(&builtin_lines), 0, NULL},
! {"calendar", -1L,ZZZ_DT_STR(raw_calendar_file),
! sizeof raw_calendar_file, NULL},
{"cc", -1L,ZZZ_DT_SYN("askcc"), 0, NULL},
{"charset", -1L,ZZZ_DT_SYN("text-charset"), 0, NULL},
{"charset-convert-ok", -1L,ZZZ_DT_BOL(&charset_convert_ok), 0, NULL},

--- 306,312 ----



{"browser-wildcard-matching", -1L,ZZZ_DT_BOL(&browser_wildcards), 0, NULL},
{"builtinlines", -1L,ZZZ_DT_NUM(&builtin_lines), 0, NULL},
! {"calendar", -1L,ZZZ_DT_ESTR(&calendar_file_e), 0, NULL},
{"cc", -1L,ZZZ_DT_SYN("askcc"), 0, NULL},
{"charset", -1L,ZZZ_DT_SYN("text-charset"), 0, NULL},

{"charset-convert-ok", -1L,ZZZ_DT_BOL(&charset_convert_ok), 0, NULL},
***************
*** 322,328 ****


{"dsn-success", -1L,ZZZ_DT_BOL(&DSN_success), 0, NULL },
{"easyeditor", -1L,ZZZ_DT_STR(e_editor), sizeof e_editor, NULL},

{"editflush", -1L,ZZZ_DT_BOL(&edit_flush), 0, NULL },

! {"editor", -1L,ZZZ_DT_STR(raw_editor), sizeof raw_editor, NULL},


{"env-from-source", -1L,ZZZ_DT_NUM(&env_from_source),
sizeof env_from_source, &ENV_FROM_SOURCE},

{"escape", -1L,ZZZ_DT_CHR(&escape_char), 0, NULL},

--- 333,339 ----


{"dsn-success", -1L,ZZZ_DT_BOL(&DSN_success), 0, NULL },
{"easyeditor", -1L,ZZZ_DT_STR(e_editor), sizeof e_editor, NULL},

{"editflush", -1L,ZZZ_DT_BOL(&edit_flush), 0, NULL },

! {"editor", -1L,ZZZ_DT_ESTR(&editor_e), 0, NULL},


{"env-from-source", -1L,ZZZ_DT_NUM(&env_from_source),
sizeof env_from_source, &ENV_FROM_SOURCE},

{"escape", -1L,ZZZ_DT_CHR(&escape_char), 0, NULL},
***************
*** 362,369 ****


{"imap-show-warning", -1L,ZZZ_DT_BOL(&IMAP_show_warning), 0, NULL},
{"imap-use-examine", -1L,ZZZ_DT_BOL(&IMAP_use_examine), 0, NULL},
#endif

! {"incoming-mailbox", -1L,ZZZ_DT_STR(raw_defaultfile),
! sizeof raw_defaultfile, NULL },

{"incomingfolders", -1L,ZZZ_DT_PATH(&incomingfolders), 0, NULL},
{"internal-mailcap-prompt-trusted", -1L,
ZZZ_DT_BOL(&internal_mailcap_t_prompt), 0, NULL },

--- 373,379 ----


{"imap-show-warning", -1L,ZZZ_DT_BOL(&IMAP_show_warning), 0, NULL},
{"imap-use-examine", -1L,ZZZ_DT_BOL(&IMAP_use_examine), 0, NULL},
#endif

! {"incoming-mailbox", -1L,ZZZ_DT_ESTR(&defaultfile_e), 0, NULL },

{"incomingfolders", -1L,ZZZ_DT_PATH(&incomingfolders), 0, NULL},
{"internal-mailcap-prompt-trusted", -1L,

ZZZ_DT_BOL(&internal_mailcap_t_prompt), 0, NULL },
***************
*** 385,392 ****


{"local-sessionlock-use-home", -1L, ZZZ_DT_NUM_(FL_SYS,
&local_sessionlock_use_home),
0, &local_sessionlock_list },
! {"localsignature", -1L,ZZZ_DT_STR(raw_local_signature),

! sizeof raw_local_signature, NULL},
#ifdef SYSCALL_LOCKING


{"lock-folders", -1L,ZZZ_DT_BOL(&lockfolders),0, NULL},
{"lock-in-copy", -1L,ZZZ_DT_BOL(&lock_in_copy),0, NULL},

--- 395,401 ----


{"local-sessionlock-use-home", -1L, ZZZ_DT_NUM_(FL_SYS,
&local_sessionlock_use_home),
0, &local_sessionlock_list },
! {"localsignature", -1L,ZZZ_DT_ESTR(&local_signature_e), 0, NULL},
#ifdef SYSCALL_LOCKING
{"lock-folders", -1L,ZZZ_DT_BOL(&lockfolders),0, NULL},
{"lock-in-copy", -1L,ZZZ_DT_BOL(&lock_in_copy),0, NULL},
***************

*** 426,435 ****


{"page-known-charsets", -1L,ZZZ_DT_BOL(&page_known_charsets), 0, NULL},
{"pagealternative", -1L,ZZZ_DT_BOL(&pagealternative), 0, NULL},
{"pagemultipart", -1L,ZZZ_DT_BOL(&pagemultipart), 0, NULL},
! {"pager", -1L,ZZZ_DT_STR(raw_pager), sizeof raw_pager, NULL},

{"pagesigned", -1L,ZZZ_DT_BOL(&pagesigned), 0, NULL},
#ifdef USE_PGP


{"pgp", -1L,ZZZ_DT_SYN("pgp2"), 0, NULL},
{"pgp-sign-type", -1L,ZZZ_DT_NUM(&pgp_sign_type),
sizeof pgp_sign_type, &PGP_SIGN_TYPE},
{"pgp-version", -1L,ZZZ_DT_PGPVER(&send_pgp_version),

--- 435,445 ----


{"page-known-charsets", -1L,ZZZ_DT_BOL(&page_known_charsets), 0, NULL},
{"pagealternative", -1L,ZZZ_DT_BOL(&pagealternative), 0, NULL},
{"pagemultipart", -1L,ZZZ_DT_BOL(&pagemultipart), 0, NULL},
! {"pager", -1L,ZZZ_DT_ESTR(&pager_e), 0, NULL},

{"pagesigned", -1L,ZZZ_DT_BOL(&pagesigned), 0, NULL},
#ifdef USE_PGP


{"pgp", -1L,ZZZ_DT_SYN("pgp2"), 0, NULL},
+ {"pgp-interactive", -1L,ZZZ_DT_BOL(&pgp_interactive), 0, NULL},
{"pgp-sign-type", -1L,ZZZ_DT_NUM(&pgp_sign_type),
sizeof pgp_sign_type, &PGP_SIGN_TYPE},
{"pgp-version", -1L,ZZZ_DT_PGPVER(&send_pgp_version),
***************

*** 460,469 ****


{"quoteforward", -1L,ZZZ_DT_BOL(&quote_forward), 0, NULL},
{"readdatapercentinc", -1L,ZZZ_DT_NUM(&readdatapercentinc), 0, NULL},
{"readmsginc", -1L,ZZZ_DT_NUM(&readmsginc), 0, NULL},
! {"receivedmail", -1L,ZZZ_DT_STR(raw_recvdmail),
! sizeof raw_recvdmail, NULL},
! {"remotesignature", -1L,ZZZ_DT_STR(raw_remote_signature),
! sizeof raw_remote_signature, NULL},

{"replycopy", -1L,ZZZ_DT_BOL(&reply_copy), 0, NULL},
{"require-mime-version-for-body-encoding",
-1L,ZZZ_DT_BOL(&req_mime_bodyencoding), 0, NULL},

--- 470,477 ----


{"quoteforward", -1L,ZZZ_DT_BOL(&quote_forward), 0, NULL},
{"readdatapercentinc", -1L,ZZZ_DT_NUM(&readdatapercentinc), 0, NULL},
{"readmsginc", -1L,ZZZ_DT_NUM(&readmsginc), 0, NULL},
! {"receivedmail", -1L,ZZZ_DT_ESTR(&recvd_mail_e), 0, NULL},
! {"remotesignature", -1L,ZZZ_DT_ESTR(&remote_signature_e), 0, NULL},

{"replycopy", -1L,ZZZ_DT_BOL(&reply_copy), 0, NULL},
{"require-mime-version-for-body-encoding",

-1L,ZZZ_DT_BOL(&req_mime_bodyencoding), 0, NULL},
***************
*** 477,484 ****


{"saveto", -1L,ZZZ_DT_SYN("sentmail"), 0, NULL},
{"send-mime-plain-text", -1L, ZZZ_DT_BOL(&send_mime_plain),
sizeof send_mime_plain, NULL },
! {"sentmail", -1L,ZZZ_DT_STR(raw_sentmail),
! sizeof raw_sentmail, NULL},
{"set-window-title", -1L, ZZZ_DT_BOL(&set_window_title),

sizeof set_window_title, NULL },
{"shell", -1L,ZZZ_DT_STR(raw_shell), sizeof raw_shell, NULL},

--- 485,491 ----


{"saveto", -1L,ZZZ_DT_SYN("sentmail"), 0, NULL},
{"send-mime-plain-text", -1L, ZZZ_DT_BOL(&send_mime_plain),
sizeof send_mime_plain, NULL },
! {"sentmail", -1L,ZZZ_DT_ESTR(&sent_mail_e), 0, NULL},
{"set-window-title", -1L, ZZZ_DT_BOL(&set_window_title),

sizeof set_window_title, NULL },
{"shell", -1L,ZZZ_DT_STR(raw_shell), sizeof raw_shell, NULL},

Index: elmME+.2.5.alpha1-cvs/hdrs/s_elm.h
*** elmME+.2.5.alpha0/hdrs/s_elm.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/s_elm.h 2004-07-03 18:23:04.000000000 +0300


***************
*** 470,476 ****
#define ElmCouldNotOpenNewElmrc 0x22a
#define ElmBadSortKeyInElmrc 0x22b
#define ElmBadAliasSortInElmrc 0x22c
- #define ElmSignatureObsolete 0x22d
#define ElmBouncebackGTMaxhops 0x22e
#define ElmTimeoutLTTen 0x22f
#define ElmBadLineElmrc 0x230
--- 470,475 ----
***************

*** 1101,1103 ****
--- 1100,1108 ----
#define ElmMlistOff 0x86c
#define ElmMlistOn 0x86d
#define ElmHelpToggleMailingList 0x86e
+ #define ElmChangedAttachEnc 0x86f
+ #define ElmNoDSN 0x870
+ #define ElmMailerDisconnected 0x871
+ #define ElmNoRecipientsKeptMessage 0x872
+ #define ElmNoRecipients 0x873
+ #define ElmMimeFWMessageYN 0x874
Index: elmME+.2.5.alpha1-cvs/hdrs/shared_imp.h
*** elmME+.2.5.alpha0/hdrs/shared_imp.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/shared_imp.h 2004-07-03 18:23:04.000000000 +0300
***************
*** 1,7 ****
! /* $Id: shared_imp.h,v 1.16 2004/03/28 13:37:38 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: shared_imp.h,v 1.16.8.1 2004/07/03 15:23:04 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 32,43 ****
} * shared_SE_option_types;
extern int shared_SE_option_type_count;

- extern struct shared_RCT {
- struct rc_type * T;
- struct ImpInfo * imp_idx;
- } * shared_RC_types;
- extern int shared_RC_type_count;
-
extern struct shared_CST {
struct charset_type * T;
struct ImpInfo * imp_idx;
--- 32,37 ----

Index: elmME+.2.5.alpha1-cvs/hdrs/sysdefs.SH
*** elmME+.2.5.alpha0/hdrs/sysdefs.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/hdrs/sysdefs.SH 2004-07-03 18:23:04.000000000 +0300


***************
*** 22,30 ****

echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'

! /* $Id: sysdefs.SH,v 1.23.4.1 2004/04/18 16:55:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.4.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 22,30 ----

echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'

! /* $Id: sysdefs.SH,v 1.23.4.2 2004/07/03 15:23:04 hurtta Exp $ */
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.4.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 69,78 ****


#define default_temp "$tmpdir/"
#define temp_file "snd."
#define temp_form_file "form."

- /* #define temp_mbox "mbox." */

#define temp_print "print."
#define temp_edit "elm-edit"

- /* #define temp_uuname "uuname." */
#define temp_state "est."

#define emacs_editor "$emacs"
--- 69,76 ----

Index: elmME+.2.5.alpha1-cvs/lib/MAGIC
*** elmME+.2.5.alpha0/lib/MAGIC 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha1-cvs/lib/MAGIC 2004-07-03 18:23:04.000000000 +0300


***************
*** 10,15 ****
--- 10,16 ----
#define DISPLAY_STATE_magic 0xF304
#define MAILCAP_magic 0xF400
#define MAILCAP_PARAM_magic 0xF401
+ #define RCTYPE_magic 0xF402
#define MAILBOXVIEW_magic 0xF500
#define LDSTATE_magic 0xF501
#define MAILBOXTYPE_magic 0xF502

Index: elmME+.2.5.alpha1-cvs/lib/mailer.c
*** elmME+.2.5.alpha0/lib/mailer.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/lib/mailer.c 2004-05-23 19:24:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailer.c,v 1.46.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailer.c,v 1.46.8.2 2004/05/23 16:24:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 138,143 ****
--- 138,157 ----
X->mail_from = strmcpy(X->mail_from,value);
}

+ /* Return
+ 1 == mailer restarted, reconnect succeed -- reask info
+ 0 == mailer not disconnected
+ -1 == mailer disconnected, reconnect failed
+ */
+ S_(mailer_info_restart_hook default_mailer_info_rs_hook)
+ static int default_mailer_info_rs_hook P_((struct mailer_config *M,
+ struct mailer_info *I));
+ static int default_mailer_info_rs_hook(M,I)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ {
+ return 0; /* Assume not restarted */
+ }

S_(mailer_info_set_ef sendmail_mailer_info_set_ef)
static void sendmail_mailer_info_set_ef();

***************
*** 460,465 ****

+ return ret;
+ }
+

static int default_mailer_init(M,C,I)
struct mailer_config *M;
struct mail_send_state *C;

Index: elmME+.2.5.alpha1-cvs/lib/mail_gets.c
*** elmME+.2.5.alpha0/lib/mail_gets.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/lib/mail_gets.c 2004-07-03 18:23:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.8.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.8.8.2 2004/07/03 15:23:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 53,58 ****
--- 53,114 ----
return line_bytes;
}

+ /* malloc_gets added by Kari Hurtta
+ Do not return \n
+
+ return -1 if limit exceeded, buffer is still alloced
+ return -2 if error or if feof() is true before reading anything
+ */
+
+ int malloc_gets(buffer, limit, mailfile)
+ char **buffer;
+ int limit; /* -1 if no limit */
+ FILE *mailfile;
+ {
+ char * buf = *buffer;
+ int line_bytes = 0, ch;

+ int alloced = 0;
+

+ if (feof(mailfile))
+ return -2; /* Is called after EOF */
+
+ while (!feof(mailfile) && !ferror(mailfile) &&
+ (line_bytes < limit || limit < 0)) {
+
+ int ch = getc(mailfile); /* Macro, faster than fgetc() ! */
+
+ if (EOF == ch ||
+ '\n' == ch)

+ break;
+

+ if (line_bytes+1 > alloced) {
+ int n = alloced + 100;
+ if (n > limit && limit > line_bytes)
+ n = limit;
+
+ buf = safe_realloc(buf,n);
+ alloced = n;
+ }
+ buf[line_bytes++] = ch;
+ }
+
+ if (line_bytes > 0 ||
+ !feof(mailfile) && !ferror(mailfile)) {
+
+ buf = safe_realloc(buf,line_bytes+1);

+ buf[line_bytes] = '\0';
+ }
+
+ *buffer = buf;
+
+ if (line_bytes >= limit)
+ return -1;
+

+ if (ferror(mailfile))
+ return-2;
+
+ return line_bytes;

+ }

/*
* Local Variables:

Index: elmME+.2.5.alpha1-cvs/lib/mbox.c
*** elmME+.2.5.alpha0/lib/mbox.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/lib/mbox.c 2004-07-03 18:23:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51.8.4 2004/05/01 07:41:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51.8.5 2004/07/03 15:23:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 17,23 ****
* Incorparated Elm 2.5 code from src/screen.c (show_message_status()):


* That code was following copyright:

*
! * The Elm Mail System - $Revision: 1.51.8.4 $ $State: Exp $
*


* Copyright (c) 1988-1995 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor

--- 17,23 ----
* Incorparated Elm 2.5 code from src/screen.c (show_message_status()):


* That code was following copyright:

*
! * The Elm Mail System - $Revision: 1.51.8.5 $ $State: Exp $
*


* Copyright (c) 1988-1995 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor
***************

*** 689,699 ****


/* if file name == default mailbox, its a spool file also
* even if its not in the spool directory. (SVR4)
*/

! if (strcmp(filename, defaultfile) == 0) {
! DPRINT(Debug,8,(&Debug,
"get_folder_type=SPOOL\n"));
! return(SPOOL);
}

if (buf) {
if (buf->st_mode & 07000) {

--- 689,707 ----


/* if file name == default mailbox, its a spool file also
* even if its not in the spool directory. (SVR4)
*/

!
!
! {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val &&
! strcmp(filename, default_val) == 0) {
! DPRINT(Debug,8,(&Debug,
"get_folder_type=SPOOL\n"));
! return(SPOOL);
! }
}
+

if (buf) {
if (buf->st_mode & 07000) {

Index: elmME+.2.5.alpha1-cvs/lib/outheaders.c
*** elmME+.2.5.alpha0/lib/outheaders.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/lib/outheaders.c 2004-07-03 18:23:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14.8.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14.8.5 2004/07/03 15:23:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 285,291 ****
add_unicode_to_string(result,1,&code);
}

! add_ascii_to_string(result,s2us(" ("));


}
--- 285,291 ----
add_unicode_to_string(result,1,&code);
}

! add_ascii_to_string(result,s2us(")"));


}

int demime;
charset_t defcharset;
int replace;

! {
! int j;
!
struct addr_item * TMP;

TMP = break_down_address(value,demime,defcharset);
--- 419,425 ----

int demime;
charset_t defcharset;
int replace;

Index: elmME+.2.5.alpha1-cvs/lib/rc_handle.c
*** elmME+.2.5.alpha0/lib/rc_handle.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/lib/rc_handle.c 2004-07-03 18:23:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17.8.6 2004/05/01 20:07:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17.8.8 2004/07/03 15:23:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

- return 1;
- }
-

- #ifdef USE_DLOPEN
- for (i = 0; i < shared_RC_type_count; i++)
- if (shared_RC_types[i].T == T)
- return 1;
- #endif
-
- DPRINT(Debug,1,(&Debug,
- "valid_rc_type=0: type=%p (magic)\n",
- T));
-

- return 0;
- }
-

! struct rc_type rc_DT_CHR = { dt_CHR_parse_line, BAD_parse_cline,
dt_CHR_print_value, dt_CHR_get_value };

*** 1468,1473 ****
--- 1439,1447 ----


fprintf(F, "%s = ",r->name);

for (i = 0; i < r->val.path->nlen; i++) {
+ /* NOTE: space is always valid separator even when

+ PATH_sep_comma or PATH_sep_colon is set */
+
if (i > 0) {


if (len + strlen(r->val.path->list[i]) > 70) {
fprintf(F, "\n");

***************
*** 1480,1486 ****



}
if (r->val.path->flags & PATH_quote)

! elm_fprintf(F,FRM("Q"),r->val.path->list[i]);


else if (r->val.path->flags & PATH_quote_single) {

fputc('\'',F);


fputs(r->val.path->list[i],F);

--- 1454,1460 ----



}
if (r->val.path->flags & PATH_quote)

! elm_fprintf(F,FRM("%Q"),r->val.path->list[i]);


else if (r->val.path->flags & PATH_quote_single) {

fputc('\'',F);


fputs(r->val.path->list[i],F);

***************
*** 1493,1499 ****


}
}

! struct rc_type rc_DT_PATH = { dt_PATH_parse_line, dt_PATH_parse_cline,
dt_PATH_print_value, NO_get_value };


--- 1467,1474 ----


}
}

! struct rc_type rc_DT_PATH = { RCTYPE_magic,
! dt_PATH_parse_line, dt_PATH_parse_cline,
dt_PATH_print_value, NO_get_value };


***************

*** 1520,1530 ****


}


! struct rc_type rc_DT_OBS = { dt_OBS_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };



/*
* Local Variables:
* mode:c

--- 1495,1635 ----

+ }
+ }
+
+

+
+ #if ANSI_C


+ static rc_get_value dt_ESTR_get_value;
+ #endif
+ static char * dt_ESTR_get_value(r)
+ struct rc_save_info_rec *r;
+ {
+ return r->val.estr->unexpanded;
+ }

+
+ #if ANSI_C


+ static rc_print_value dt_ESTR_print_value;
+ #endif
+ static void dt_ESTR_print_value(F,r,comment)
+ FILE *F;
+ struct rc_save_info_rec *r;
+ int comment;
+ {
+ if (r->val.estr->unexpanded) {
+ if (comment)
+ fprintf(F, "### ");
+ fprintf(F, "%s = %s\n", r->name, r->val.estr->unexpanded);
+ } else {
+ fprintf(F, "### %s (not set)\n", r->name);
+ }
+ }
+
+ struct rc_type rc_DT_ESTR = { RCTYPE_magic,
+ dt_ESTR_parse_line, BAD_parse_cline,
+ dt_ESTR_print_value, dt_ESTR_get_value };

+
+
+
+
/*

* Local Variables:
* mode:c

Index: elmME+.2.5.alpha1-cvs/lib/read_rc.c
*** elmME+.2.5.alpha0/lib/read_rc.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/lib/read_rc.c 2004-07-03 18:23:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133.4.15 2004/05/15 20:11:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133.4.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133.4.18 2004/07/03 15:23:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133.4.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 109,119 ****


char user_terminal_info[SLEN] = USER_TERMINAL_INFO; /* user_init fixes */
char user_mail_services[SLEN] = USER_MAIL_SERVICES; /* user_init fixes */

! char defaultfile[SLEN]; /* name of default folder */
! char raw_defaultfile[SLEN] = "$MAIL"; /* init_defaults fixes */


! char calendar_file[SLEN]; /* name of file for clndr */
! char raw_calendar_file[SLEN]; /* unexpanded name of file for clndr */

int clear_pages; /* flag: act like "page" (more -c)? */
int title_messages = 1; /* flag: title message display? */

nl_catd elm_msg_cat; /* message catalog */

--- 109,118 ----


char user_terminal_info[SLEN] = USER_TERMINAL_INFO; /* user_init fixes */
char user_mail_services[SLEN] = USER_MAIL_SERVICES; /* user_init fixes */

! ESTR defaultfile_e; /* name of default folder */
! ESTR calendar_file_e; /* name of file for clndr */


int clear_pages; /* flag: act like "page" (more -c)? */

+

int title_messages = 1; /* flag: title message display? */

nl_catd elm_msg_cat; /* message catalog */

***************
*** 144,150 ****


int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */

PATH alternative_addresses = { /* how else do we get mail? */
! PATH_sep_comma|PATH_quote|PATH_quote_single,

NULL, 0,NULL
};

--- 143,149 ----

int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */

PATH alternative_addresses = { /* how else do we get mail? */

! PATH_sep_comma,
NULL, 0,NULL
};

***************

*** 166,171 ****
--- 165,172 ----


1 = text/plain
2 = text/x-pgp
*/

+ int pgp_interactive=0; /* Should pgp/gpg encryption/signing to be

+ run always on interactive mode */


enum pgp_version send_pgp_version = pgp_none; /* preferred pgp version*/
#endif

char attribution[SLEN]; /* attribution string for replies */

***************
*** 216,229 ****


charset_t wanted_display_charset;
char raw_display_charset[SLEN] = "SYSTEM";
/* the wanted display charset set */

int DSN_success; /* flag: Ask successfull DSNes */

char e_editor[SLEN]; /* "~e" editor... */
! char editor[SLEN]; /* editor for outgoing mail*/
! int env_from_source; /* 0 == forward-from,

! 1 == from,
! 2 == return-path


*/
! char raw_editor[SLEN]; /* unexpanded editor for outgoing mail*/
char escape_char = TILDE_ESCAPE;/* '~' or something else.. */

int force_name; /* flag: save by name forced? */


int fragment_handling = 1; /* 0 == none,

--- 217,233 ----


charset_t wanted_display_charset;
char raw_display_charset[SLEN] = "SYSTEM";
/* the wanted display charset set */

+

int DSN_success; /* flag: Ask successfull DSNes */

char e_editor[SLEN]; /* "~e" editor... */
!

! ESTR editor_e; /* editor for outgoing mail */
!

! int env_from_source; /* 0 == forward-from,

! 1 == from,
! 2 == return-path
*/
!

char escape_char = TILDE_ESCAPE;/* '~' or something else.. */

int force_name; /* flag: save by name forced? */


int fragment_handling = 1; /* 0 == none,

***************
*** 256,264 ****


char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */

charset_t local_fs_charset; /* filesystem charset */

! char local_signature[SLEN]; /* local msg signature file */
! char raw_local_signature[SLEN]; /* unexpanded local msg */

! /* signature file */


#ifdef SYSCALL_LOCKING
int lockfolders = 1; /* Lock folder when open */
int lock_in_copy = 1; /* Lock folder when copied to it */

--- 260,267 ----


char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */

charset_t local_fs_charset; /* filesystem charset */

! ESTR local_signature_e; /* local msg signature file */
!

#ifdef SYSCALL_LOCKING
int lockfolders = 1; /* Lock folder when open */
int lock_in_copy = 1; /* Lock folder when copied to it */

***************
*** 290,299 ****
NULL, 0,NULL
};

! PATH internal_mailcap_t_programs = {
! 0,
! NULL, 0, NULL
! };
int internal_mailcap_t_prompt;



PATH incomingfolders = { /* treate as mailbox */

--- 293,299 ----
NULL, 0,NULL
};

! PATH internal_mailcap_t_programs;
int internal_mailcap_t_prompt;



PATH incomingfolders = { /* treate as mailbox */

***************
*** 305,311 ****
--- 305,313 ----


int mime_body_keywords = TRUE; /* flag: parse body looking for encode */
/* keywords */
int mimeforward = FALSE; /* flag: Forward as Message/rfc822 */

+ int askmimeforward = 1; /* flag: prompt about messaga/rfc822 forward */

int move_when_paged; /* flag: move when '+' or '-' used? */

+

int names_only = 1; /* flag: display user names only? */

int allow_no_encoding; /* 1: Allow 8bit without -B8BITMIME */
/* 2: Allow binary without -BBINARYMIME and */

***************
*** 317,326 ****


int pagealternative=1; /* Page if alternative have one know*/
/* subtype ? */
int page_known_charsets=1; /* Page if charset is not unknown? */
! int pagemultipart; /* Page unknown mime subparts? */
! int pagesigned; /* Page unknown signed protocols? */
! char pager[SLEN]; /* what pager to use */

! char raw_pager[SLEN]; /* unexpanded what pager to use */
#ifdef USE_PGP


char pgp2_path[SLEN] = "none"; /* Pgp path or "none" if no pgp */
char raw_pgp2_path[SLEN] = PGP2_PATH;

--- 319,327 ----


int pagealternative=1; /* Page if alternative have one know*/
/* subtype ? */
int page_known_charsets=1; /* Page if charset is not unknown? */
! int pagemultipart; /* Page unknown mime subparts? */
! int pagesigned; /* Page unknown signed protocols? */

! ESTR pager_e; /* what pager to use */
#ifdef USE_PGP


char pgp2_path[SLEN] = "none"; /* Pgp path or "none" if no pgp */
char raw_pgp2_path[SLEN] = PGP2_PATH;
***************

*** 343,363 ****


int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/
/* new mbox */
! char recvd_mail[SLEN]; /* folder for storing received mail */
! char raw_recvdmail[SLEN]; /* unexpanded recvd_mail name */
! char remote_signature[SLEN]; /* remote msg signature file */
! char raw_remote_signature[SLEN]; /* unexpanded remote msg */

! /* signature file */


int req_mime_bodyencoding = 1; /* */

int req_mime_hdrencoding; /* */
int resolve_mode = 1; /* flag: delete saved mail? */
int save_by_name = 1; /* flag: save mail by login name? */

int save_by_alias = 1; /* save mail by alias of login name? */
! char sent_mail[SLEN]; /* name of file to save copies to */
int send_mime_plain = 1; /* flag: send plain text as MIME? */

- char raw_sentmail[SLEN]; /* unexpanded name of file to save to*/


char shell[SLEN]; /* current system shell */
! char raw_shell[SLEN]; /* unexpanded current system shell */

int set_window_title; /* flag: set (xterm?) window title and
icon name */
#ifdef USE_PGP

--- 344,371 ----


int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/
/* new mbox */

! ESTR recvd_mail_e = { /* folder for storing received mail */
! ESTR_meta,
! NULL,
! NULL
! };
!

! ESTR remote_signature_e; /* remote msg signature file */


int req_mime_bodyencoding = 1; /* */

int req_mime_hdrencoding; /* */
int resolve_mode = 1; /* flag: delete saved mail? */
int save_by_name = 1; /* flag: save mail by login name? */

int save_by_alias = 1; /* save mail by alias of login name? */
!

! ESTR sent_mail_e = { /* name of file to save copies to */


! ESTR_meta,
! NULL,
! NULL
! };
!

int send_mime_plain = 1; /* flag: send plain text as MIME? */

char shell[SLEN]; /* current system shell */
! char raw_shell[SLEN]; /* unexpanded current system shell */

int set_window_title; /* flag: set (xterm?) window title and
icon name */
#ifdef USE_PGP

***************
*** 514,520 ****
*/


! elm_msg_cat = catopen("elm2.4me+", 0);
if (0 == elm_msg_cat ||
(nl_catd) -1 == elm_msg_cat) {
DPRINT(Debug,9,(&Debug,
--- 522,528 ----
*/


! elm_msg_cat = catopen("elmme+2.5", 0);
if (0 == elm_msg_cat ||
(nl_catd) -1 == elm_msg_cat) {
DPRINT(Debug,9,(&Debug,
***************
*** 1133,1155 ****


* First look for an environment variable MAIL, then
* use then mailhome if it is not found
*/
- if ((cp = getenv("MAIL")) == NULL) {
- elm_sfprintf(defaultfile, sizeof defaultfile,
- FRM("%s%s"), mailhome, username);
- elm_sfprintf(raw_defaultfile, sizeof raw_defaultfile,
- FRM("%s%s"), mailhome, username);
-
- } else {

- strfcpy(raw_defaultfile, "$MAIL", sizeof raw_defaultfile);
- strfcpy(defaultfile, cp, sizeof defaultfile);
- }


! raw_local_signature[0] = raw_remote_signature[0] =
! local_signature[0] = remote_signature[0] =
! raw_recvdmail[0] = raw_sentmail[0] =
! allowed_precedences[0] = '\0';
/* no defaults for those */
!
if (NULL != (cp = getenv("SHELL")) && '\0' != cp[0]) {
strfcpy(raw_shell, "$SHELL", sizeof raw_shell);
do_expand_env("shell", shell, raw_shell, sizeof(shell));

--- 1141,1156 ----


* First look for an environment variable MAIL, then
* use then mailhome if it is not found
*/

! {
! char *X = elm_message(FRM("%s%s"), mailhome, username);
! set_dt_estr(&defaultfile_e,X,"MAIL");
! free(X);
! }
!
! allowed_precedences[0] = '\0';
/* no defaults for those */
!
if (NULL != (cp = getenv("SHELL")) && '\0' != cp[0]) {
strfcpy(raw_shell, "$SHELL", sizeof raw_shell);
do_expand_env("shell", shell, raw_shell, sizeof(shell));
***************

*** 1159,1170 ****


}

#ifdef USE_BUILTIN_PAGER
! strfcpy(raw_pager,"builtin++", sizeof raw_pager);
! strfcpy(pager,"builtin++", sizeof pager);
#else
! strfcpy(raw_pager, ((cp = getenv("PAGER")) == NULL)? default_pager : cp,
! sizeof raw_pager);
! do_expand_env("pager", pager, raw_pager, sizeof(pager));
#endif

strfcpy(raw_temp_dir, (cp = getenv("TMPDIR")) ? cp : default_temp,

--- 1160,1168 ----


}

#ifdef USE_BUILTIN_PAGER
! set_dt_estr(&pager_e, "builtin++", NULL);
#else
! set_dt_estr(&pager_e,default_pager,"PAGER");
#endif

strfcpy(raw_temp_dir, (cp = getenv("TMPDIR")) ? cp : default_temp,
***************

*** 1175,1188 ****


temp_dir[strlen (temp_dir)-1] != '/')
strfcat(temp_dir, "/", sizeof temp_dir);

! if ((cp = getenv("EDITOR")) != NULL && '\0' != cp[0]) {
! strfcpy(raw_editor, "$EDITOR", sizeof raw_editor);
! strfcpy(editor, cp, sizeof editor);
! } else {
! strfcpy(raw_editor, default_editor, sizeof raw_editor);
! do_expand_env("editor", editor, raw_editor, sizeof(editor));
! }
!

if ((cp = getenv("MAILCAPS")) == NULL) {
/* RFC 1524:

--- 1173,1179 ----


temp_dir[strlen (temp_dir)-1] != '/')
strfcat(temp_dir, "/", sizeof temp_dir);

! set_dt_estr(&editor_e,default_editor,"EDITOR");

if ((cp = getenv("MAILCAPS")) == NULL) {
/* RFC 1524:
***************

*** 1254,1263 ****


do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
sizeof(map_bindir));

! elm_sfprintf(raw_calendar_file, sizeof raw_calendar_file,
! FRM("~/%s"), dflt_calendar_file);
! do_expand_env("calendar_file", calendar_file, raw_calendar_file,
! sizeof(calendar_file));

strfcpy(e_editor, emacs_editor, sizeof e_editor);
strfcpy(v_editor, default_editor, sizeof v_editor);

--- 1245,1252 ----


do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
sizeof(map_bindir));

! calendar_file_e.unexpanded =
! elm_message(FRM("~/%s"), dflt_calendar_file);

strfcpy(e_editor, emacs_editor, sizeof e_editor);
strfcpy(v_editor, default_editor, sizeof v_editor);
***************

*** 1266,1274 ****


FRM("%s/%s"), home, default_folders);
strfcpy(folders, raw_folders, sizeof folders);

- elm_sfprintf(raw_calendar_file, sizeof raw_calendar_file,
- FRM("%s/%s"), home, dflt_calendar_file);
- strfcpy(calendar_file, raw_calendar_file, sizeof calendar_file);

/* try system-wide rc file */
file = fopen(system_rc_file, "r");

--- 1255,1260 ----
***************
*** 1392,1398 ****


"Setting (wanted) display-charset to %s instead.\n",
wanted_display_charset->MIME_name ?
wanted_display_charset->MIME_name :
! "<no MIME name"));
}
if (!text_charset || !text_charset->MIME_name) {
text_charset = ASCII_SET;

--- 1378,1384 ----


"Setting (wanted) display-charset to %s instead.\n",
wanted_display_charset->MIME_name ?
wanted_display_charset->MIME_name :
! "<no MIME name>"));
}
if (!text_charset || !text_charset->MIME_name) {
text_charset = ASCII_SET;
***************

*** 1496,1507 ****


}

void post_init_check(int flag) {

do_expand_env("folders", folders, raw_folders, sizeof(folders));

do_expand_env("extra-mailbox-dir", extra_mailbox_dir,
raw_extra_mailbox_dir, sizeof(extra_mailbox_dir));
!
if (raw_extra_mailbox_dir[0] &&
0 == strcmp(extra_mailbox_dir,folders)) {
errors++;

--- 1482,1494 ----


}

void post_init_check(int flag) {
+ char *t;

do_expand_env("folders", folders, raw_folders, sizeof(folders));

do_expand_env("extra-mailbox-dir", extra_mailbox_dir,
raw_extra_mailbox_dir, sizeof(extra_mailbox_dir));
!
if (raw_extra_mailbox_dir[0] &&
0 == strcmp(extra_mailbox_dir,folders)) {
errors++;
***************

*** 1529,1548 ****


strfcpy(temp_dir,"/tmp/", sizeof temp_dir);
else if (temp_dir[strlen (temp_dir)-1] != '/')
strfcat(temp_dir, "/", sizeof temp_dir);
!
! do_expand_env("incoming-mailbox",
! defaultfile, raw_defaultfile,
! sizeof(defaultfile));
!
if (raw_shell[0] != '\0') {
/* shell is taken from /etc/passwd in initialize() */
do_expand_env("shell", shell, raw_shell, sizeof(shell));
}
! do_expand_env("editor", editor, raw_editor, sizeof(editor));
!
! do_expand_env("calendar_file", calendar_file, raw_calendar_file,
! sizeof(calendar_file));
!
if (strcmp(raw_printout,"none") == 0 ||
raw_printout[0] == '\0') {
strfcpy(raw_printout,"none", sizeof raw_printout);

--- 1516,1527 ----


strfcpy(temp_dir,"/tmp/", sizeof temp_dir);
else if (temp_dir[strlen (temp_dir)-1] != '/')
strfcat(temp_dir, "/", sizeof temp_dir);
!
if (raw_shell[0] != '\0') {
/* shell is taken from /etc/passwd in initialize() */
do_expand_env("shell", shell, raw_shell, sizeof(shell));
}
!
if (strcmp(raw_printout,"none") == 0 ||
raw_printout[0] == '\0') {
strfcpy(raw_printout,"none", sizeof raw_printout);
***************

*** 1550,1580 ****

--- 1529,1535 ----


} else {
do_expand_env("printout", printout, raw_printout, sizeof(printout));
}
!
allow_forms = (allow_forms?MAYBE:NO);

if ((elm_timeout != 0) && (elm_timeout < 10)) {
***************

*** 1620,1642 ****


* Then if they begin with a metacharacter, replace it with the
* folders directory name.
*/
! if(*raw_recvdmail == '\0') {
! strfcpy(raw_recvdmail, default_recvdmail,
! sizeof raw_recvdmail);
}

! do_expand_meta("recvd_mail", recvd_mail, raw_recvdmail,
! sizeof(recvd_mail));
!
! if(*raw_sentmail == '\0') {
! strfcpy(raw_sentmail, default_sentmail, sizeof raw_sentmail);
! strfcpy(sent_mail, default_sentmail, sizeof sent_mail);
}

- do_expand_meta("sent_mail", sent_mail, raw_sentmail,
- sizeof(sent_mail));
-
-
expand_map_bin("unidata", unidata_path, raw_unidata_path,
sizeof(unidata_path));

--- 1575,1588 ----


* Then if they begin with a metacharacter, replace it with the
* folders directory name.
*/
! if(!recvd_mail_e.unexpanded) {
! recvd_mail_e.unexpanded = safe_strdup(default_recvdmail);
}

! if(!sent_mail_e.unexpanded) {
! sent_mail_e.unexpanded = safe_strdup(default_sentmail);
}

expand_map_bin("unidata", unidata_path, raw_unidata_path,
sizeof(unidata_path));

***************

*** 2020,2026 ****


} else if (!keyword[0]) {
if (prev_type != NULL) {

! if (!valid_rc_type(prev_type->dt_type))
panic("RC PANIC",__FILE__,__LINE__,"do_rc",
"Bad prev_type",0);

--- 1966,1972 ----


} else if (!keyword[0]) {
if (prev_type != NULL) {

! if (RCTYPE_magic != prev_type->dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"do_rc",
"Bad prev_type",0);

***************

*** 2178,2194 ****


} else
e_val = 0;

! if (!valid_rc_type(rc_options[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"do_set",
"Bad config item type",0);

if (!rc_options[x].dt_type->parse_line(& (rc_options[x]),
! lcl,
! word2,
! lineno,
! filename,
! e_val,
! negate))
errors++;

return & (rc_options[x]);

--- 2124,2140 ----


} else
e_val = 0;

! if (RCTYPE_magic != rc_options[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"do_set",
"Bad config item type",0);

if (!rc_options[x].dt_type->parse_line(& (rc_options[x]),
! lcl,
! word2,
! lineno,
! filename,
! e_val,
! negate))
errors++;

return & (rc_options[x]);

Index: elmME+.2.5.alpha1-cvs/lib/savefolder.c
*** elmME+.2.5.alpha0/lib/savefolder.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/lib/savefolder.c 2004-07-03 18:23:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75.8.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75.8.3 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

! }
! }
!
! {

! /* '!' incoming mailbox */
!

! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (!default_val)

ret = 0;
+ else {


+ ret = tail_expander(dir,buffer,1,default_val,
+ relative_to_type);
+ if (ret && dir->sel_type == selection_file) {
+ if (*relative_to_type && 0 < string_len(*relative_to_type))
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile1,
+ "Name %S (expands to %s, %S) is unsafe use as file"),
+ *buffer, default_val, *relative_to_type);
+ else
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile2,
+ "Name %S (expands to %s) is unsafe use as file"),
+ *buffer, default_val);
+ ret = 0;
+ }
}
+ }
break;
! case 0x003E: {

! /* '>' received folder */
!

! char * recvd_val = give_dt_estr_as_str(&recvd_mail_e,"receivedmail");
!
! if (!recvd_val)
! ret = 0 ;

! else {


! ret = tail_expander(dir,buffer,1,recvd_val,
! relative_to_type);
! if (ret && dir->sel_type == selection_file) {
! if (*relative_to_type && 0 < string_len(*relative_to_type))
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile1,
! "Name %S (expands to %s, %S) is unsafe use as file"),
! *buffer, recvd_val, *relative_to_type);
! else
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile2,
! "Name %S (expands to %s) is unsafe use as file"),
! *buffer, recvd_val);
! ret = 0;
! }
}
+ }
break;
! case 0x003C: {

! /* '<' sent folder */
!

! char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
!
! if (!sent_val)
! ret = 0 ;
! else {
!
! ret = tail_expander(dir,buffer,1,sent_val,
! relative_to_type);
! if (ret && dir->sel_type == selection_file) {
! if (*relative_to_type && 0 < string_len(*relative_to_type))
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile1,
! "Name %S (expands to %s, %S) is unsafe use as file"),
! *buffer, sent_val, *relative_to_type);
! else
! lib_error(CATGETS(elm_msg_cat, MeSet, MeUnsafeFile2,
! "Name %S (expands to %s) is unsafe use as file"),
! *buffer, sent_val);
! ret = 0;
! }
}
+ }
break;

default:

Index: elmME+.2.5.alpha1-cvs/lib/shared.c
*** elmME+.2.5.alpha0/lib/shared.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/lib/shared.c 2004-07-03 18:23:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared.c,v 1.54.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: shared.c,v 1.54.8.3 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 47,55 ****
struct shared_SEOT * shared_SE_option_types = NULL;
int shared_SE_option_type_count = 0;

- struct shared_RCT * shared_RC_types = NULL;
- int shared_RC_type_count = 0;
-
struct shared_CST * shared_CS_types = NULL;
int shared_CS_type_count = 0;

--- 47,52 ----
***************
*** 214,227 ****

provides_shared_FT_f * f2;
} f2; /* not in use */

-
-
-

--- 286,291 ----
***************


*** 793,799 ****
return return_buffer;
}

! struct rc_type rc_DT_SHARED = { dt_SHARED_parse_line, dt_SHARED_parse_cline,
dt_SHARED_print_value, dt_SHARED_get_value };


--- 753,760 ----
return return_buffer;
}

! struct rc_type rc_DT_SHARED = { RCTYPE_magic,
! dt_SHARED_parse_line, dt_SHARED_parse_cline,
dt_SHARED_print_value, dt_SHARED_get_value };


***************
*** 1046,1052 ****
local_value =
library_list[i]->rc_options[x].flags & FL_LOCAL;

! if (!valid_rc_type(library_list[i]->rc_options[x].dt_type)) {
DPRINT(Debug,1,(&Debug,
"shlib/option %d -- \"%s\" BAD, flags=%0x (library=%s)\n",
x,library_list[i]->rc_options[x].name,
--- 1007,1013 ----
local_value =
library_list[i]->rc_options[x].flags & FL_LOCAL;

! if (RCTYPE_magic != library_list[i]->rc_options[x].dt_type->magic) {
DPRINT(Debug,1,(&Debug,

"shlib/option %d -- \"%s\" BAD, flags=%0x (library=%s)\n",
x,library_list[i]->rc_options[x].name,
Index: elmME+.2.5.alpha1-cvs/Makefile-1.SH
*** elmME+.2.5.alpha0/Makefile-1.SH 2004-01-24 13:51:43.000000000 +0200
--- elmME+.2.5.alpha1-cvs/Makefile-1.SH 2004-05-22 17:50:33.000000000 +0300
***************


*** 27,33 ****
echo "Extracting Makefile-1 (with variable substitutions)"

cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.11 2004/01/24 11:05:54 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 27,33 ----
echo "Extracting Makefile-1 (with variable substitutions)"

cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.11.22.1 2004/05/22 14:50:33 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

Index: elmME+.2.5.alpha1-cvs/MANIFEST
*** elmME+.2.5.alpha0/MANIFEST 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/MANIFEST 2004-07-03 20:46:53.000000000 +0300
***************
*** 14,26 ****
2.4/Patchlist
2.4/README
config.h.SH
! doc/Alias.guide
! doc/Config.guid
! doc/Elm.cover
! doc/Form.guide
doc/Makefile.SH
! doc/Ref.guide
! doc/Users.guide
doc/answer.1
doc/chkalias.1
doc/elm-help.0
--- 14,26 ----
2.4/Patchlist
2.4/README
config.h.SH
! 2.4/doc/Alias.guide
! 2.4/doc/Config.guid
! 2.4/doc/Elm.cover
! 2.4/doc/Form.guide
doc/Makefile.SH
! 2.4/doc/Ref.guide
! 2.4/doc/Users.guide
doc/answer.1
doc/chkalias.1
doc/elm-help.0
Index: elmME+.2.5.alpha1-cvs/melib/mime_parse.c
*** elmME+.2.5.alpha0/melib/mime_parse.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/melib/mime_parse.c 2004-07-03 18:23:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.45 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.45.8.1 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Index: elmME+.2.5.alpha1-cvs/nls/C/C/C/s_elm.m
*** elmME+.2.5.alpha0/nls/C/C/C/s_elm.m 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/nls/C/C/C/s_elm.m 2004-07-03 18:23:05.000000000 +0300


***************
*** 995,1003 ****
555 I can't understand sort key "%s" in line %d in "%s" file
$ #BadAliasSortInElmrc
556 I can't understand alias sort key "%s" in line %d in "%s" file
- $ #SignatureObsolete
- 557 "signature" used in obsolete way in .elm/elmrc file. Ignored!\n\
- \t(Signature should specify the filename to use rather than on/off.)
$ #BouncebackGTMaxhops
558 Warning: bounceback is set to greater than %d (max-hops). Ignored.\n\r
$ #TimeoutLTTen
--- 995,1000 ----
***************

*** 2317,2319 ****
--- 2314,2329 ----
2157 "[Mlists On]"
$ #HelpToggleMailingList
2158 "M = Toggle display of mailing list information."
+ $ #ChangedAttachEnc
+ 2159 "Changed encoding of %d attachments"
+ $ #NoDSN
+ 2160 "Mailer do not support DSN, disabling it"
+ $ #MailerDisconnected
+ 2161 "Mailer disconnected! Can't send message. Use f)orget !"
+ $ #NoRecipientsKeptMessage
+ 2162 "No recipients specified! Message kept."
+ $ #NoRecipients
+ 2163 "No recipients specified!"
+ $ #MimeFWMessageYN
+ 2164 "Forward message as separate part? (%c/%c) "
+
Index: elmME+.2.5.alpha1-cvs/nls/Makefile
*** elmME+.2.5.alpha0/nls/Makefile 2002-03-20 09:04:46.000000000 +0200
--- elmME+.2.5.alpha1-cvs/nls/Makefile 2004-05-23 19:24:48.000000000 +0300
***************
*** 1,8 ****
#
! # $Id: Makefile,v 1.4 2002/03/06 15:05:12 hurtta Exp $
#
LANGFILE=LANGS
! CATNAME=elm2.4me+.cat
GENCAT= nls/gencat

HDIR= ../hdrs
--- 1,8 ----
#
! # $Id: Makefile,v 1.4.86.1 2004/05/23 16:24:48 hurtta Exp $
#
LANGFILE=LANGS
! CATNAME=elmme+2.5.cat
GENCAT= nls/gencat

HDIR= ../hdrs
Index: elmME+.2.5.alpha1-cvs/OBSOLETE
*** elmME+.2.5.alpha0/OBSOLETE 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/OBSOLETE 2004-07-04 13:58:35.000000000 +0300
***************
*** 45,47 ****
--- 45,53 ----
Changes
Instruct
README
+ doc/Alias.guide
+ doc/Form.guide
+ doc/Ref.guide
+ doc/Users.guide
+ doc/Config.guid
+ doc/Elm.cover
Index: elmME+.2.5.alpha1-cvs/shared_libs/include/shared.h
*** elmME+.2.5.alpha0/shared_libs/include/shared.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/shared_libs/include/shared.h 2004-07-03 18:23:05.000000000 +0300
***************
*** 1,7 ****
! /* $Id: shared.h,v 1.25 2004/03/27 18:31:43 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: shared.h,v 1.25.8.1 2004/07/03 15:23:05 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 55,63 ****
typedef struct SE_option_type **
provides_shared_SEOT_f P_((int *count, size_t *s_size));

- typedef struct rc_type **
- provides_shared_RCT_f P_((int *count, size_t *s_size));
-
typedef struct rc_save_info_rec
* provides_RC_options_f P_((int *count, size_t *s_size));

--- 55,60 ----

Index: elmME+.2.5.alpha1-cvs/shared_libs/smtp/smtp.c
*** elmME+.2.5.alpha0/shared_libs/smtp/smtp.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/shared_libs/smtp/smtp.c 2004-05-23 19:24:49.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: smtp.c,v 1.42 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: smtp.c,v 1.42.8.1 2004/05/23 16:24:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1717,1723 ****
I->p.p1->response_code[0] = '\0';
I->p.p1->response_text = NULL;
I->p.p1->response_text_len = 0;
- I->p.p1->SMTP_flags = 0;

I->p.p1->incomplete_command = NULL;
I->p.p1->incomplete_command_len = 0;
--- 1717,1722 ----
***************
*** 1726,1731 ****
--- 1725,1733 ----
I->p.p1->ESMPT_keyword_len = -1; /* -1 == EHLO not issued yet */
I->p.p1->state = smtp_error;

+ I->p.p1->SMTP_flags = 0;
+
+

if (!connect_remote_account(&(I->p.p1->RA),&got,se,ports))
goto clean;

***************
*** 1748,1756 ****
DPRINT(Debug,8,(&Debug,
"submission_mailer_info_init: smtp service\n"));

default:
DPRINT(Debug,1,(&Debug,
! "submission_mailer_info_init: Unknown sercide!\n"));
}

I->p.p1->state = smtp_wait_reply;
--- 1750,1760 ----
DPRINT(Debug,8,(&Debug,

"submission_mailer_info_init: smtp service\n"));

+ break;
+
default:


DPRINT(Debug,1,(&Debug,
! "submission_mailer_info_init: Unknown service!\n"));
}

I->p.p1->state = smtp_wait_reply;
***************
*** 1781,1786 ****
--- 1785,1946 ----
return status;
}

+ static void mailer_close2 P_((struct mailer_info *I));
+ static void mailer_close2(I)
+ struct mailer_info *I;
+ {
+ free_Read_Buffer(& (I->p.p1->read_buffer));
+ free_Write_Buffer(& (I->p.p1->write_buffer));
+
+ free_response_text(I->p.p1);
+
+ if (I->p.p1->incomplete_command)
+ free(I->p.p1->incomplete_command);
+
+ I->p.p1->incomplete_command = NULL;

+ I->p.p1->incomplete_command_len = 0;
+

+ if (I->p.p1->ESMPT_keywords) {
+ int i;
+ for (i = 0; i < I->p.p1->ESMPT_keyword_len; i++) {
+ if (I->p.p1->ESMPT_keywords[i])
+ free(I->p.p1->ESMPT_keywords[i]);
+ I->p.p1->ESMPT_keywords[i] = NULL;
+ }
+ free(I->p.p1->ESMPT_keywords);
+ }
+ I->p.p1->ESMPT_keywords = NULL;

+ I->p.p1->ESMPT_keyword_len = -1; /* -1 == EHLO not issued yet */
+ }
+

+ /* Return
+ 1 == mailer restarted, reconnect succeed -- reask info
+ 0 == mailer not disconnected
+ -1 == mailer disconnected, reconnect failed
+ */
+ S_(mailer_info_restart_hook submission_mailer_info_rs_hook)
+ static int submission_mailer_info_rs_hook P_((struct mailer_config *M,
+ struct mailer_info *I));
+ static int submission_mailer_info_rs_hook(M,I)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ {
+ int is_ok = 1;
+ int status = 0;
+
+ char response_code[3];
+
+ PORTS ports[] = { PORT_submission, PORT_smtp, PORT_end };
+ int got; /* port number */
+

+ struct service_entry *se = NULL;
+

+ if (smtp_start_command(I->p.p1,"NOOP")) {
+
+ smtp_command_ready(I->p.p1,0);
+
+ is_ok = smtp_command_ok(I->p.p1,response_code);
+
+ smtp_command_reset(I->p.p1);
+ } else

+ is_ok = 0;
+

+ if (is_ok) {
+ DPRINT(Debug,12,(&Debug,
+ "submission_mailer_info_rs_hook=0 (OK, mailer not disconnected)\n"));
+
+ return 0; /* Mailer OK -- need not restart */

+ }
+

+ /* Send QUIT */
+ if (smtp_idle == I->p.p1->state) {
+ int status = smtp_start_command(I->p.p1,"QUIT");
+
+ if (status) {
+ smtp_command_ready(I->p.p1,0);
+

+ /* Wait for QUIT */
+ smtp_command_reset(I->p.p1);
+ }
+ }
+
+

+ status = -1;
+
+ /* Actually close connection */
+ free_remote_account(& (I->p.p1->RA));
+ mailer_close2(I);
+
+ se = give_service_entry(submission_server, STFLAG_smtp_like);
+ if (!se) {
+ status = -1;
+ goto clean;
+ }
+
+ /* Try reconnect */
+ I->p.p1->state = smtp_error;

+ I->p.p1->SMTP_flags = 0;
+
+

+ if (!connect_remote_account(&(I->p.p1->RA),&got,se,ports))
+ goto clean;
+
+ if (SUBMISSION_SERVICE == se->service)
+ goto is_submission;
+ else if (SMTP_SERVICE == se->service)
+ goto is_smtp;
+ else switch (got) {
+ case PORT_submission:
+ is_submission:
+
+ DPRINT(Debug,8,(&Debug,
+ "submission_mailer_info_rs_hook: Submission service\n"));
+ I->p.p1->SMTP_flags = SMTP_submission;

+ break;
+

+ case PORT_smtp:
+ is_smtp:
+
+ DPRINT(Debug,8,(&Debug,
+ "submission_mailer_info_rs_hook: smtp service\n"));
+

+ break;
+ default:


+ DPRINT(Debug,1,(&Debug,
+ "submission_mailer_info_rs_hook: Unknown sercide!\n"));
+ }
+
+ I->p.p1->state = smtp_wait_reply;
+
+ ConfigStream(I->p.p1->RA.stream,
+ smtp_read_action,ss_noaction_routine,smtp_timeout_action,
+ SMTP_TIMEOUT,I->p.p1);

+
+
+

+ if (!smtp_command_ok(I->p.p1,response_code)) {
+ DPRINT(Debug,12,(&Debug,
+ "submission_mailer_info_rs_hook: Failed to get greeting from server\n"));
+
+ /* Caller will call sendmailbs_mailer_info_close ... */
+ status = -1;
+ goto clean;
+ }
+ smtp_command_reset(I->p.p1);

+ status = 1; /* reconnect succeed */
+
+ clean:

/* bzero is defined on hdrs/defs.h */

+ int is_ok = 0;
+

+ if (smtp_start_command(I->p.p1,"NOOP")) {
+ char response_code[3];
+
+ smtp_command_ready(I->p.p1,0);
+
+ is_ok = smtp_command_ok(I->p.p1,response_code);
+
+ smtp_command_reset(I->p.p1);
+ } else

+ is_ok = 0;
+

+ if (is_ok) {
+ DPRINT(Debug,12,(&Debug,
+ "sendmailbs_mailer_info_rs_hook=0 (OK, mailer not disconnected)\n"));
+

+ return 0; /* Mailer OK -- need not restart */
+ }
+

! for (i = 0; i < I->p.p1->ESMPT_keyword_len; i++) {
! if (I->p.p1->ESMPT_keywords[i])
! free(I->p.p1->ESMPT_keywords[i]);
! I->p.p1->ESMPT_keywords[i] = NULL;
! }
! free(I->p.p1->ESMPT_keywords);
! }
! I->p.p1->ESMPT_keywords = NULL;

! I->p.p1->ESMPT_keyword_len = -1; /* -1 == EHLO not issued yet */

/* bzero is defined on hdrs/defs.h */
bzero((void *)I->p.p1,sizeof (* (I->p.p1)));
--- 2293,2299 ----
}
}

! mailer_close2(I);

/* bzero is defined on hdrs/defs.h */

Index: elmME+.2.5.alpha1-cvs/src/addr_util.c
*** elmME+.2.5.alpha0/src/addr_util.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/addr_util.c 2004-05-22 23:18:06.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.42 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This file contains addressing utilities
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.42.8.1 2004/05/22 20:18:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
******************************************************************************

+ * Based on Elm 2.4 src/addr_util.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/addr_util.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This file contains addressing utilities
***************
*** 444,460 ****
struct textual *ptr;
int expands = 0;
struct expanded_address result;
! int too_long = FALSE;

dump_expanded_address(9,"build_address_l",*expanded);

zero_expanded_address(&result);

for (ptr = expanded->surface;
ptr < expanded->surface + expanded->surface_len;
ptr++) {
CONST int NEWPOS = result.addrs_len;
- struct addr_item * aliases;

struct addr_item verify_result;

--- 454,576 ----
struct textual *ptr;
int expands = 0;
struct expanded_address result;
! struct addr_item *elim_list = NULL;
! int elim_list_len = 0;
! charset_t utf8 = MIME_name_to_charset("UTF-8",0);
!
! if (!utf8) {
! DPRINT(Debug,1,(&Debug, "UTF-8 do not found!!\n"));
! utf8 = MIME_name_to_charset("ISO-8859-1",0);
! if (!utf8)
! utf8 = ASCII_SET;
! }

dump_expanded_address(9,"build_address_l",*expanded);

zero_expanded_address(&result);

+ /** 1) Look for addresses to be eliminated from aliases **/
+
+ for (ptr = expanded->surface;
+ ptr < expanded->surface + expanded->surface_len;
+ ptr++) {
+
+ if (ptr->Textual) {
+ struct string * utf8_temp;
+ unsigned char * utf8_textual;
+
+ utf8_temp = convert_string(utf8,ptr->Textual,0);
+ utf8_textual = stream_from_string(utf8_temp,0,NULL);
+
+ if (utf8_textual[0] == '-') {
+ struct addr_item * aliases2 = NULL;
+ int too_long = FALSE;
+
+ /* expand alias and eliminate all members */
+
+ if (NULL != (aliases2 =
+ get_alias_address_l(us2s(utf8_textual+1), TRUE,
+ &too_long,mailer_info,
+ aview))) {
+
+ struct addr_item *ptr2;
+
+ /* Count them */
+
+ for (ptr2=aliases2; ptr2->addr && ptr2->fullname; ptr2++)
+ /* do nothing */;
+
+ if (aliases2 == ptr2) {
+ DPRINT(Debug,2,
+ (&Debug, "... %S expands to zero list\n",
+ ptr->Textual));
+ }
+
+
+ if (ptr2 > aliases2) {
+ int count = (ptr2 - aliases2);
+ int new_len = elim_list_len + count;
+
+ elim_list =
+ safe_realloc(elim_list,
+ (new_len + 1) *
+ sizeof (elim_list[0]));
+
+ for (ptr2=aliases2;
+ ptr2->addr && ptr2->fullname; ptr2++) {
+
+ if (elim_list_len >= new_len)
+ panic("ADDR PANIC",__FILE__,__LINE__,
+ "build_address_l",
+ "elm_list_len overflow",0);
+
+ elim_list[elim_list_len++] = *ptr2;
+ }
+
+ elim_list[elim_list_len].addr = NULL;
+ elim_list[elim_list_len].fullname = NULL;
+
+ }
+
+ free(aliases2); /* just remove array */
+
+ } else if (too_long) {
+ DPRINT(Debug,2,
+ (&Debug, "Overflowed alias expansion for %S\n",
+ ptr->Textual));
+ continue; /* Don't process */
+ } else {
+
+ int new_len = elim_list_len + 1;
+
+ elim_list =
+ safe_realloc(elim_list,
+ (new_len + 1) *
+ sizeof (elim_list[0]));
+
+ elim_list[elim_list_len].addr =
+ safe_strdup(utf8_textual+1);
+ elim_list[elim_list_len].fullname = /* must be non-null */
+ new_string2(utf8,utf8_textual+1);
+
+ elim_list_len++;
+ elim_list[elim_list_len].addr = NULL;
+ elim_list[elim_list_len].fullname = NULL;
+
+ }
+ }
+
+ free_string(&utf8_temp);
+ free(utf8_textual);
+ }
+ }
+
+ /* 2) now rebuild list */
+
for (ptr = expanded->surface;
ptr < expanded->surface + expanded->surface_len;
ptr++) {
CONST int NEWPOS = result.addrs_len;

struct addr_item verify_result;

***************
*** 479,508 ****
(&Debug,
"build_address_l: SOFWARE ERROR: [%d]: textual=NULL, len=%d\n",
ptr - expanded->surface, ptr->len));
}
}

else {
! charset_t utf8 = MIME_name_to_charset("UTF-8",0);

struct string * utf8_temp;
unsigned char * utf8_textual;

/* HACK: We use UTF-8 version of Textual .... */

- if (!utf8) {
- DPRINT(Debug,1,(&Debug, "UTF-8 do not found!!\n"));
- utf8 = MIME_name_to_charset("ISO-8859-1",0);
- if (!utf8)
- utf8 = ASCII_SET;
- }

utf8_temp = convert_string(utf8,ptr->Textual,0);
utf8_textual = stream_from_string(utf8_temp,0,NULL);

if (utf8_textual[0] == '-') {
/* Is also on result's remove list */
ADD_TEXTUAL(result,ptr->Textual,NEWPOS,0);
}

else if (qstrpbrk(us2s(utf8_textual),"!@: <>,()") != NULL) {
--- 595,626 ----
(&Debug,
"build_address_l: SOFWARE ERROR: [%d]: textual=NULL, len=%d\n",
ptr - expanded->surface, ptr->len));
+
+ panic("ADDR PANIC",__FILE__,__LINE__,
+ "build_address_l",
+ "tectual=NULL",0);
}
}

else {
!
! struct addr_item * aliases = NULL;
! int too_long = FALSE;

struct string * utf8_temp;
unsigned char * utf8_textual;

/* HACK: We use UTF-8 version of Textual .... */


utf8_temp = convert_string(utf8,ptr->Textual,0);
utf8_textual = stream_from_string(utf8_temp,0,NULL);

if (utf8_textual[0] == '-') {
+
/* Is also on result's remove list */
ADD_TEXTUAL(result,ptr->Textual,NEWPOS,0);
+
}

else if (qstrpbrk(us2s(utf8_textual),"!@: <>,()") != NULL) {
***************
*** 609,645 ****
for (ptr1 = aliases;
ptr1 && ptr1 -> addr && ptr1->fullname && ptr1->comment;
ptr1++) {
! struct textual *ptr2;
int p;

! /* scan words to be eleminated */
! for (ptr2 = expanded->surface;
! ptr2 < expanded->surface + expanded->surface_len;
! ptr2++) {
! if (ptr2 -> Textual) {
!
! /* FIXME: This is very ineffective */
!
! struct string * utf8_temp2 =
! convert_string(utf8,ptr2->Textual,0);
! unsigned char * utf8_textual2 =
! stream_from_string(utf8_temp2,0,NULL);
!
! if (utf8_textual2[0] == '-') {
! if (0 == strcmp(ptr1->addr,
! &(us2s(utf8_textual2)[1])))
! break;
! }
! free_string(&utf8_temp2);
! free(utf8_textual2);
}
}

- if (ptr2 &&
- ptr2 < expanded->surface + expanded->surface_len)
- /* Is on eliminating list -- don't add */
- continue;
-
p = ADD_EXPANDED(result,ptr1->addr,ptr1->fullname,
ptr1->comment);
if (0 == count)
--- 727,756 ----
for (ptr1 = aliases;
ptr1 && ptr1 -> addr && ptr1->fullname && ptr1->comment;
ptr1++) {
!
int p;

! if (elim_list_len) {
!
! struct addr_item *ptr2;
!
! /* scan words to be eleminated */
! for (ptr2 = elim_list;
! ptr2 < elim_list + elim_list_len;
! ptr2++) {
!
! if (0 == strcmp(ptr1->addr,
! ptr2->addr))
! break;
}
+
+ if (ptr2 &&
+ ptr2 < elim_list + elim_list_len)
+ /* Is on eliminating list -- don't add */
+ continue;
+
}

p = ADD_EXPANDED(result,ptr1->addr,ptr1->fullname,
ptr1->comment);
if (0 == count)
***************
*** 752,761 ****
}
free_expanded_address(expanded);
*expanded = result; /* put new (same?) result to place */
!
dump_expanded_address(9,"build_address_l: (result)",*expanded);
DPRINT(Debug,9,
(&Debug,"build_address_l=%d\n",expands));

return expands;
}
--- 863,878 ----
}
free_expanded_address(expanded);
*expanded = result; /* put new (same?) result to place */
!
dump_expanded_address(9,"build_address_l: (result)",*expanded);
+
+ if (elim_list)
+ free_addr_items(elim_list);
+
DPRINT(Debug,9,
(&Debug,"build_address_l=%d\n",expands));
+
+

return expands;
}
Index: elmME+.2.5.alpha1-cvs/src/alias.c
*** elmME+.2.5.alpha0/src/alias.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/alias.c 2004-07-03 18:23:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.35.2.1 2004/05/15 10:52:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.2.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.35.2.2 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.2.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1147,1153 ****


FlushBuffer();

redraw += a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,
page);
}
else {

--- 1147,1153 ----


FlushBuffer();

redraw += a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,
page);
}
else {

Index: elmME+.2.5.alpha1-cvs/src/args.c
*** elmME+.2.5.alpha0/src/args.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/args.c 2004-07-03 18:23:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: args.c,v 1.61.8.1 2004/04/17 09:03:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.61.8.2 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 472,478 ****


printf("\tHostname: %s\n",hostname);
printf("\tHost's domain: %s\n",hostdomain);
printf("\tQualified hostname: %s\n",hostfullname);
! printf("\tMailbox: %s\n",defaultfile);

if(mailerfunc(&value,0,0,NULL))
printf("\tMailer: %s\n",value);

--- 472,483 ----


printf("\tHostname: %s\n",hostname);
printf("\tHost's domain: %s\n",hostdomain);
printf("\tQualified hostname: %s\n",hostfullname);
! {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! printf("\tMailbox: %s\n",
! default_val ? default_val : "<no value>");
! }

if(mailerfunc(&value,0,0,NULL))
printf("\tMailer: %s\n",value);
***************

*** 620,626 ****


printf("(%s)",raw_default_nomime_charset);
putchar('\n');

! printf("\tMailbox: %s\n",defaultfile);


}

--- 625,635 ----
printf("(%s)",raw_default_nomime_charset);
putchar('\n');

! {


! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
! printf("\tMailbox: %s\n",
! default_val ? default_val : "<no value>");
! }


}

Index: elmME+.2.5.alpha1-cvs/src/attach_menu.c
*** elmME+.2.5.alpha0/src/attach_menu.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/attach_menu.c 2004-07-03 18:23:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.62.8.1 2004/04/25 16:59:27 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.62.8.2 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Index: elmME+.2.5.alpha1-cvs/src/browser.c
*** elmME+.2.5.alpha0/src/browser.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/browser.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: browser.c,v 1.29.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: browser.c,v 1.29.8.2 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

Index: elmME+.2.5.alpha1-cvs/src/calendar.c
*** elmME+.2.5.alpha0/src/calendar.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/calendar.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: calendar.c,v 1.13 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: calendar.c,v 1.13.8.1 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Index: elmME+.2.5.alpha1-cvs/src/edit.c
*** elmME+.2.5.alpha0/src/edit.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/edit.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: edit.c,v 1.19 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: edit.c,v 1.19.8.1 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 97,142 ****

char buffer[SLEN];
int LINES, COLUMNS;
!
menu_get_sizes(page,&LINES, &COLUMNS);


PutLineX(LINES-2,0, CATGETS(elm_msg_cat, ElmSet, ElmInvokeEditor,
"Invoking editor..."));

! if (strcmp(editor, "builtin") == 0 || strcmp(editor, "none") == 0) {
! if (in_string(alternative_editor, "%s"))
elm_sfprintf(buffer, sizeof buffer,
FRM(alternative_editor), editfile);
! else
elm_sfprintf(buffer, sizeof buffer,
FRM("%s %s"), alternative_editor, editfile);
! } else {
! if (in_string(editor, "%s"))
elm_sfprintf(buffer, sizeof buffer,
! FRM(editor), editfile);
! else

elm_sfprintf(buffer, sizeof buffer,

elm_sfprintf(buffer, sizeof buffer,


! FRM("%s %s"), editor_val, editfile);
! }
!
! Raw(OFF);
!
! if (system_call(buffer, SY_ENAB_SIGHUP, NULL) == -1) {
Raw(ON);
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmProblemsInvokingEditor,
! "Problems invoking editor %s!"),
! alternative_editor);
! sleep_message();
! return(0);
! }
!
! Raw(ON);
!
! InvalidateLocation();
!
! return(1);
}

/*

Index: elmME+.2.5.alpha1-cvs/src/editmsg.c
*** elmME+.2.5.alpha0/src/editmsg.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/editmsg.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.42.8.2 2004/05/04 18:39:33 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.42.8.3 2004/07/03 15:23:06 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 46,60 ****


int interrupts_while_editing; /* keep track 'o dis stuff */
JMP_BUF edit_location; /* for getting back from interrupt */

- static int no_editor_edit_the_message P_((char *filename,
- struct mailing_headers * headers,
- charset_t file_set,
- struct mailer_info *mailer_info,
- struct MailboxView *mailbox
- /* needed for system_call() */,
- struct AliasView *aview
- ));
-
struct builtin_edit {
struct mailing_headers * headers;
FILE * edit_fd;

--- 46,51 ----
***************
*** 1979,1986 ****


}


! static int no_editor_edit_the_message(filename,headers,file_set,mailer_info,
! mailbox,aview)
char *filename;
struct mailing_headers * headers;
charset_t file_set;

--- 1970,1977 ----


}


! int no_editor_edit_the_message(filename,headers,file_set,mailer_info,
! mailbox,aview)
char *filename;
struct mailing_headers * headers;
charset_t file_set;

Index: elmME+.2.5.alpha1-cvs/src/elm.c

Kari E. Hurtta

unread,
Jul 9, 2004, 6:16:39 AM7/9/04
to
Archive-name: elmME+2.5/PLalpha1.4

Will be available on ftp.funet.fi


via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


Is available with

via WWW.


Before applying patch catenate parts 1 - 4 first.

This patch is agaist Elm ME+ 2.5 PLalpha0
==================================================== [ part 4/4 ] ===========
*** elmME+.2.5.alpha0/src/elm.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/elm.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.69.8.3 2004/05/15 20:11:36 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.69.8.4 2004/07/03 15:23:06 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 263,283 ****


ElmNoMailToForward,
"No mail to forward!"));

! else if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine)) {

! if (forward(hdr,F,mailbox, aview, page))
(*redraw)++;
else {
(*nufoot)++;
show_msg_status(current-1,&MENU, *header_page);
}
! } else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
!
! }
/* define_softkeys(MAIN); */
}
break;

--- 263,277 ----


ElmNoMailToForward,
"No mail to forward!"));

! else {

! if (forward(current-1,mailbox, aview, page))
(*redraw)++;
else {
(*nufoot)++;
show_msg_status(current-1,&MENU, *header_page);
}
! }
/* define_softkeys(MAIN); */
}
break;
***************

*** 298,304 ****


ElmNoMailToReply,
"No mail to reply to!"));
else if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
mime_parse_routine)) {

if (hdr->status & FORM_LETTER) {

--- 292,298 ----


ElmNoMailToReply,
"No mail to reply to!"));
else if (give_message_data(mailbox,current-1,
! &hdr,NULL,NULL,
mime_parse_routine)) {

if (hdr->status & FORM_LETTER) {
***************

*** 309,315 ****


} else {
/* define_softkeys(YESNO); */

! (*redraw) += reply_to_everyone(hdr,F,
mailbox,
aview,
page);

--- 303,309 ----


} else {
/* define_softkeys(YESNO); */

! (*redraw) += reply_to_everyone(current-1,
mailbox,
aview,
page);
***************

*** 432,440 ****


ElmMail,
"Mail"));
FlushBuffer();
! (*redraw) += send_msg_l(NULL,NULL, NULL, NULL,
! MAIL_EDIT_MSG,allow_forms,NULL,
! mailbox,aview,page);
break;

case ' ' :

--- 426,434 ----


ElmMail,
"Mail"));
FlushBuffer();
! (*redraw) += send_msg_l(-1, NULL, NULL, NULL,
! MAIL_EDIT_MSG,allow_forms,
! mailbox, aview,page);
break;

case ' ' :
***************

*** 697,715 ****


lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMailToReplyTo,
"No mail to reply to!"));
! else if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine)) {

! (*redraw) += reply(hdr,F,mailbox, aview, page);

if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
! } else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
!
/* softkeys_on(); */
}
break;

--- 691,703 ----


lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMailToReplyTo,
"No mail to reply to!"));
! else {

! (*redraw) += reply(current-1,mailbox, aview, page);

if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
! }
/* softkeys_on(); */
}
break;

Index: elmME+.2.5.alpha1-cvs/src/fileio.c
*** elmME+.2.5.alpha0/src/fileio.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/fileio.c 2004-07-04 13:45:05.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: fileio.c,v 1.56.8.5 2004/05/16 13:46:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56.8.5 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.56.8.6 2004/07/04 10:45:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1132,1138 ****


case 0x0044 /* 'D' */: /* expand date */

c = ctime(&messageHeader->time_sent);
l = strlen(c)-1;
! c[l-1] = '\0';

expval = new_string(system_charset);
add_ascii_to_string(expval,s2us(c));
--- 1132,1138 ----


case 0x0044 /* 'D' */: /* expand date */

c = ctime(&messageHeader->time_sent);
l = strlen(c)-1;
! c[l] = '\0';

expval = new_string(system_charset);
add_ascii_to_string(expval,s2us(c));
Index: elmME+.2.5.alpha1-cvs/src/forms.c
*** elmME+.2.5.alpha0/src/forms.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/forms.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forms.c,v 1.23 2004/03/27 18:31:45 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forms.c,v 1.23.8.1 2004/07/03 15:23:06 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

mailbox /* for save_copy */,

aview);

--- 345,351 ----

/** let's just mail this off now... **/

! mail_form(mail_index,address, subject,

mailbox /* for save_copy */,

aview);

Index: elmME+.2.5.alpha1-cvs/src/hdrconfg.c
*** elmME+.2.5.alpha0/src/hdrconfg.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/hdrconfg.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.39 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.39.8.1 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 756,765 ****
struct hdr_menu_item *h;
int precmd = 0;

!
int editor_available =
! strcmp(editor, "builtin") != 0 &&
! strcmp(editor, "none") != 0;


int LINES, COLUMNS;
--- 756,766 ----
struct hdr_menu_item *h;
int precmd = 0;

! char * editor_val = give_dt_estr_as_str(&editor_e,"editor");
int editor_available =
! editor_val &&
! strcmp(editor_val, "builtin") != 0 &&
! strcmp(editor_val, "none") != 0;


int LINES, COLUMNS;
***************


*** 901,912 ****
break;

case 'e':
! editor_available &= have_editor(editor);
!
! if (editor_available)
! edit_headers_on_editor(headers,editor,
! hdr_encoding_supported,
! page);

do_redraw = TRUE;
break;
--- 902,915 ----
break;

case 'e':
! if (editor_val) {
! editor_available &= have_editor(editor_val);
!
! if (editor_available)
! edit_headers_on_editor(headers,editor_val,
! hdr_encoding_supported,
! page);
! }

do_redraw = TRUE;
break;

Index: elmME+.2.5.alpha1-cvs/src/init.c
*** elmME+.2.5.alpha0/src/init.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/init.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: init.c,v 1.49.8.3 2004/05/01 07:41:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.8.3 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: init.c,v 1.49.8.4 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 645,653 ****


}

/* Determine the mail file to read */
! if (!requestedmfiles || ! requestedmfiles[0])
! folder = enter_new_folder(defaultfile);
! else {
/* Assuming that file name given with -f is on
local-fs-charset and not system_charset
*/

--- 645,658 ----


}

/* Determine the mail file to read */
! if (!requestedmfiles || ! requestedmfiles[0]) {

! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val)

! folder = enter_new_folder(default_val);
! else
! folder = NULL;
! } else {
/* Assuming that file name given with -f is on
local-fs-charset and not system_charset
*/
***************

*** 741,767 ****


"hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
hostname, username, full_username);
debug_action_call(&Debug,
! "home = %-20s \teditor = %-20s \trecvd_mail = %-20s\n",
! home, editor, recvd_mail);

debug_action_call(&Debug,
"folders = %-20s \tprintout = %-20s\n",
folders, printout);

debug_action_call(&Debug,
! "sent_mail = %-20s \tprefix = %-20s \tshell = %-20s\n\n",
! sent_mail, prefixchars, shell);
!
! if (local_signature[0])
! debug_action_call(&Debug,
! "local_signature = \"%s\"\n",
! local_signature);
! if (remote_signature[0])
! debug_action_call(&Debug,
! "remote_signature = \"%s\"\n",
! remote_signature);
! if (local_signature[0] || remote_signature[0])
! debug_action_call(&Debug, "\n");
}
#endif
}

--- 746,761 ----


"hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
hostname, username, full_username);
debug_action_call(&Debug,
! "home = %-20s \n",
! home);

debug_action_call(&Debug,
"folders = %-20s \tprintout = %-20s\n",
folders, printout);

debug_action_call(&Debug,
! " \tprefix = %-20s \tshell = %-20s\n\n",
! prefixchars, shell);
}
#endif
}

Index: elmME+.2.5.alpha1-cvs/src/leavembox.c
*** elmME+.2.5.alpha0/src/leavembox.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/leavembox.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.4 2004/05/02 11:05:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.4 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.5 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 209,217 ****


/* Permissons check for and opening of =received done earlier */

DPRINT(Debug,10,(&Debug,
! "!! Copying from %s to %s\n",
! storage->current_folder->cur_folder_sys,
! recvd_mail));

DPRINT(Debug,2,(&Debug, "Storing message%s ", plural(to_store)));

for (i = 0; i < storage->message_count; i++) {
--- 209,216 ----


/* Permissons check for and opening of =received done earlier */

DPRINT(Debug,10,(&Debug,
! "!! Copying from %s to received folder\n",
! storage->current_folder->cur_folder_sys));

DPRINT(Debug,2,(&Debug, "Storing message%s ", plural(to_store)));

for (i = 0; i < storage->message_count; i++) {
Index: elmME+.2.5.alpha1-cvs/src/mailmsg1.c
*** elmME+.2.5.alpha0/src/mailmsg1.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/mailmsg1.c 2004-07-03 18:23:06.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.36.8.4 2004/05/04 18:39:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.4 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.36.8.5 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 38,49 ****


}


-
static int to_line, to_col;

! static int copy_the_msg P_((struct mailing_headers *headers,
! int *is_a_response, int options,
! struct menu_context *page));

static CONST unsigned char * csUs P_((const char *str));

static CONST unsigned char * csUs(str)

--- 38,50 ----


}


static int to_line, to_col;

! static enum copy_msg_mode { cm_no_copy = 0, cm_get_copy, cm_canceled_mail,
! cm_mimeforward
! } copy_the_msg P_((struct mailing_headers *headers,
! int options,
! struct menu_context *page));

static CONST unsigned char * csUs P_((const char *str));

static CONST unsigned char * csUs(str)

***************
*** 261,294 ****


struct menu_context *page));

static int send_msg_middle P_((
! struct header_rec * current_header,
struct expanded_address *given_to,

struct expanded_address *given_cc,


char *given_subject,
int options, int form_letter,

struct mailer_info *mailer_info,


- FILE *infile,
struct MailboxView *mailbox,

struct AliasView *aview,
struct menu_context *page
));

! static int send_msg_middle(current_header,
given_to, given_cc, given_subject, options,
! form_letter,mailer_info, infile,
mailbox,aview, page)
! struct header_rec * current_header;
struct expanded_address *given_to, *given_cc;
char *given_subject;
int options, form_letter;
struct mailer_info *mailer_info;
- FILE *infile;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{
int res;
! int copy_msg = FALSE, is_a_response = FALSE;
char *p;
struct mailing_headers headers;
int LINES, COLUMNS;

--- 262,293 ----


struct menu_context *page));

static int send_msg_middle P_((
! int index,
struct expanded_address *given_to,

struct expanded_address *given_cc,


char *given_subject,
int options, int form_letter,

struct mailer_info *mailer_info,


struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page
));

! static int send_msg_middle(index,
given_to, given_cc, given_subject, options,
! form_letter,mailer_info,
mailbox,aview, page)
! int index;
struct expanded_address *given_to, *given_cc;
char *given_subject;
int options, form_letter;
struct mailer_info *mailer_info;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{
int res;
! enum copy_msg_mode copy_msg = cm_no_copy;
char *p;
struct mailing_headers headers;

int LINES, COLUMNS;
***************
*** 328,339 ****


free_string(&X);
}

/* copy msg into edit buffer? */
copy_msg = copy_the_msg(&headers,
! &is_a_response, options, page);
! if (copy_msg) options |= MAIL_COPY_MSG;

! /* get the To: address and expand */
if (! get_to(&headers.to,mailer_info,aview, page))
return(0);

--- 327,349 ----


free_string(&X);
}

+
/* copy msg into edit buffer? */
copy_msg = copy_the_msg(&headers,
! options, page);

! switch (copy_msg) {
! case cm_get_copy:
! options |= MAIL_COPY_MSG;
! break;
! case cm_mimeforward:
! options |= MAIL_MIME_ATTCH;
! options |= MAIL_COPY_MSG;

! break;
! }
!

! /* get the To: address and expand --
! */
if (! get_to(&headers.to,mailer_info,aview, page))
return(0);

***************

*** 353,360 ****



if (batch_only) {
/** if we're batchmailing, let's send it and GET OUTTA HERE! **/
! res = mail(NULL, 0, form_letter,&headers,mailer_info,
! infile, mailbox /* for save_copy */, aview);
} else {
display_to(headers.to, page);

--- 363,370 ----



if (batch_only) {
/** if we're batchmailing, let's send it and GET OUTTA HERE! **/
! res = mail(-1, 0, form_letter,&headers,mailer_info,
! mailbox, aview);
} else {
display_to(headers.to, page);

***************

*** 378,385 ****



/** generate the In-Reply-To: header... **/

! if (is_a_response && 0 != (options & MAIL_REPLYING))
! generate_reply_to(current_header,&headers);

/* and mail that puppy outta here! */

--- 388,398 ----



/** generate the In-Reply-To: header... **/

! if ( 0 != (options & MAIL_REPLYING)) {
! struct header_rec *current_header = give_header(mailbox,index);
! if (current_header)
! generate_reply_to(current_header,&headers);
! }

/* and mail that puppy outta here! */

***************

*** 395,420 ****


dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

! res=mail(current_header,options, form_letter,&headers,
! mailer_info, infile,
! mailbox /* save_copy needs */, aview);
}

free_it:
free_mailing_headers(&headers);

return res;
}

! int send_msg_l(current_header,
given_to, given_cc, given_subject, options, form_letter,
! infile, mailbox, aview, page
)
! struct header_rec * current_header;
struct addr_item *given_to, *given_cc;
char *given_subject;
int options, form_letter;
- FILE *infile;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

--- 408,433 ----


dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

! res=mail(index,options, form_letter,&headers,
! mailer_info,
! mailbox, aview);
}

free_it:
+
free_mailing_headers(&headers);

return res;
}

! int send_msg_l(index,
given_to, given_cc, given_subject, options, form_letter,

! mailbox, aview, page
)


! int index;
struct addr_item *given_to, *given_cc;
char *given_subject;
int options, form_letter;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
***************

*** 432,442 ****


addr_to_expanded(&A,given_to,mailer_info,aview);
addr_to_expanded(&B,given_cc,mailer_info,aview);

! ret = send_msg_middle(current_header,&A,&B,
given_subject,options,form_letter,
! mailer_info, infile,
! mailbox /* save_copy needs */,
! aview, page);
free_expanded_address(&A);
free_expanded_address(&B);

--- 445,454 ----


addr_to_expanded(&A,given_to,mailer_info,aview);
addr_to_expanded(&B,given_cc,mailer_info,aview);

! ret = send_msg_middle(index,&A,&B,
given_subject,options,form_letter,
! mailer_info,
! mailbox, aview, page);
free_expanded_address(&A);
free_expanded_address(&B);

***************

*** 468,476 ****



argv_to_expanded(&A,argv,mailer_info,aview);

! ret = send_msg_middle(NULL,&A,&B,
given_subject,options,form,mailer_info,
! NULL,mailbox, aview, page);

free_expanded_address(&A);
free_expanded_address(&B);

--- 480,488 ----



argv_to_expanded(&A,argv,mailer_info,aview);

! ret = send_msg_middle(-1,&A,&B,
given_subject,options,form,mailer_info,
! mailbox, aview, page);

free_expanded_address(&A);
free_expanded_address(&B);
***************

*** 643,650 ****


if (build_address_l(cc,mailer_info, aview)) {
struct string * B = hdr_to_expval(*cc);
if (B) {
PutLineX(prompt_line, 11, FRM("%S"), B);
! if ((strcmp(editor, "builtin") != 0 && strcmp(editor, "none") != 0)
|| copy_message)
sleep_message();
free_string(&B);

--- 655,667 ----


if (build_address_l(cc,mailer_info, aview)) {
struct string * B = hdr_to_expval(*cc);
if (B) {

+ char * editor_val = give_dt_estr_as_str(&editor_e,"editor");
+

PutLineX(prompt_line, 11, FRM("%S"), B);

!
! if (!editor_val ||


! (strcmp(editor_val, "builtin") != 0 &&
! strcmp(editor_val, "none") != 0)
|| copy_message)
sleep_message();
free_string(&B);
***************

*** 654,691 ****


return(1); /* everything looks okay! */
}

!
!
! static int copy_the_msg(headers,is_a_response, options, page)
struct mailing_headers *headers;


- int *is_a_response;
int options;

struct menu_context *page;
{
int forwarding = 0 != (options & MAIL_FORWARDING);
!
int LINES, COLUMNS;

/** Returns True iff the user wants to copy the message being

replied to into the edit buffer before invoking the editor!

- Sets "is_a_response" to true if message is a response...
**/


! char msg[SLEN];
! int answer = FALSE;
!
!

again:
menu_get_sizes(page,&LINES, &COLUMNS);



! if (forwarding)
! answer = TRUE;
! else if (headers->to.addrs_len > 0 && !mail_only) {

/* predefined 'to' line! */

! if (!ask_reply_copy)
! answer = reply_copy;
! else {

int ret;

--- 671,726 ----


return(1); /* everything looks okay! */
}

! static enum copy_msg_mode copy_the_msg(headers, options, page)
struct mailing_headers *headers;
int options;


struct menu_context *page;
{
int forwarding = 0 != (options & MAIL_FORWARDING);

! int replying = 0 != (options & MAIL_REPLYING);
!
int LINES, COLUMNS;



/** Returns True iff the user wants to copy the message being

replied to into the edit buffer before invoking the editor!

**/



! static enum copy_msg_mode answer = cm_no_copy;

!
again:
menu_get_sizes(page,&LINES, &COLUMNS);


! if (forwarding) {
! int X = mimeforward;
!
! if (askmimeforward) {
! int def = mimeforward ? *def_ans_yes : *def_ans_no;

! int ret;
!
! ret = prompt_letter(LINES-4,"",def,


! PROMPT_yesno|PROMPT_redraw_mark,
! page,

! CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,
! "Forward message as separate part? (%c/%c) "),

! *def_ans_yes, *def_ans_no);
!
! if (REDRAW_MARK == ret)
! goto again;
! if (EOF == ret)
! return 0;
!
!

! X = (ret == *def_ans_yes);


! }
!
! answer = X ? cm_mimeforward : cm_get_copy;
!
! } else if (replying) {

! int X = reply_copy;


!
/* predefined 'to' line! */

! if (ask_reply_copy) {

int ret;

***************
*** 710,722 ****

if (REDRAW_MARK == ret)
goto again;
-
if (EOF == ret)


return 0;
!
! answer = ret == *def_ans_yes;
}

! *is_a_response = TRUE;
}

return(answer);

--- 745,758 ----

if (REDRAW_MARK == ret)
goto again;
if (EOF == ret)
return 0;
!
! X = (ret == *def_ans_yes);
!
}
!
! answer = X ? cm_get_copy : cm_no_copy;
}

return(answer);
***************
*** 797,805 ****


dump_expanded_address(5,"bcc",headers.bcc);

main_state();
! ret = mail(NULL, edit_message ? MAIL_EDIT_MSG : 0, form_letter,
! &headers,mailer_info, NULL,
! mailbox /* save_copy needs */, aview);
main_state();

/*

--- 833,841 ----


dump_expanded_address(5,"bcc",headers.bcc);

main_state();
! ret = mail(-1, edit_message ? MAIL_EDIT_MSG : 0, form_letter,
! &headers,mailer_info,
! mailbox, aview);
main_state();

/*

Index: elmME+.2.5.alpha1-cvs/src/mailmsg2.c
*** elmME+.2.5.alpha0/src/mailmsg2.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/mailmsg2.c 2004-07-03 19:03:36.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.8.6 2004/05/15 11:52:25 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.6 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.8.12 2004/07/03 16:03:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 87,93 ****


static int append_sig P_((FILE *file,struct mailing_headers *headers,
struct menu_context *page));

! static int recall_last_msg P_((char *filename, int copy_msg,
int *cancelled_msg, int *already_has_text,
struct menu_context *page));

--- 87,93 ----


static int append_sig P_((FILE *file,struct mailing_headers *headers,
struct menu_context *page));

! static int recall_last_msg P_((char *filename, int copy_msg,
int *cancelled_msg, int *already_has_text,

struct menu_context *page));

***************
*** 113,119 ****


return (CONST unsigned char *)str;
}

-
struct string * gen_From_buffer(current_header)


CONST struct header_rec * current_header;

{
--- 113,118 ----
***************
*** 141,160 ****
return From_buffer;


}

! int mail(current_header,options,form, headers,mailer_info,
! infile,mailbox,aview)
! struct header_rec * current_header;
int options,form;

struct mailing_headers * headers;


struct mailer_info *mailer_info;
! FILE *infile;
! struct MailboxView *mailbox; /* savecopy() needs list of folders */
struct AliasView *aview;
{

! int copy_msg = 0 != current_header && 0 != (options & MAIL_COPY_MSG);
! int edit_message = 0 != (options & MAIL_EDIT_MSG);
! int forwarding = 0 != current_header && 0 != (options & MAIL_FORWARDING);
! int replying = 0 != (options & MAIL_REPLYING);



struct Attachments attachments = NULL_Attachments;

--- 140,241 ----
return From_buffer;
}

! static void handle_mailer_options P_((struct mailer_info *mailer_info,
! mime_send_t *mime_info,
! int *dsn,
! struct Attachments *attachments,
! int *reask));
!
! static void handle_mailer_options(mailer_info,mime_info,dsn, attachments,
! reask)
! struct mailer_info *mailer_info;
! mime_send_t *mime_info;
! int *dsn;
! struct Attachments *attachments;
! int *reask; /* on reask loop */
! {
! int i;
! int changed = 0;
!
! if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
! DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));
! if(DSN_success && !reask) {
! (*dsn) |= DSN_SUCCESS|DSN_FAILURE|DSN_DELAY;
! DPRINT(Debug,8,(&Debug," dsn-success is set .. enabling\n"));
! }
! } else if (*dsn) {
! *dsn = 0;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoDSN,
! "Mailer do not support DSN, disabling it"));


!
! if (reask)
! *reask = 1;

!
! }
!
!
! mime_info->raw_level = mailer_7bit;
!
! if (query_mailer_info(mailer_info,MI_HAVE_8BITMIME)) {
! DPRINT(Debug,8,(&Debug,"mailer supports 8BITMIME\n"));


! mime_info->raw_level = mailer_8bit;
!

! if (query_mailer_info(mailer_info,MI_HAVE_BINARYMIME)) {
! DPRINT(Debug,8,(&Debug,"mailer supports BINARYMIME\n"));
! mime_info->raw_level = mailer_binary;
! }
! }
!
! if (allow_no_encoding >= 2)
! /* Just send BINARY anyway */
! mime_info->raw_level = mailer_binary;
! else if (allow_no_encoding >= 1 &&
! mime_info->raw_level < mailer_8bit)

! /* Just send 8BIT anyway */
! mime_info->raw_level = mailer_8bit;
!

! for (i = 0; i < attachments->attachment_count; i++) {
! mime_t *part = & (attachments->attach_files[i]);
!
! if (ENCODING_BINARY == part->encoding &&
! mime_info->raw_level < mailer_binary) {
! part->encoding = ENCODING_BASE64;
! changed++;
! }
!
! if (ENCODING_8BIT == part->encoding &&
! mime_info->raw_level < mailer_8bit) {
! part->encoding = ENCODING_BASE64;
! changed++;
! }
! }
!
! if (changed) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmChangedAttachEnc,
! "Changed encoding of %d attachments"),
! changed);
!
! if (reask)
! *reask = 1;

! }
! }
!
!

! int mail(mail_index,options,form, headers,mailer_info,
! mailbox,aview)
! int mail_index;
int options,form;

struct mailing_headers * headers;


struct mailer_info *mailer_info;
! struct MailboxView *mailbox /* for mail_index */;
struct AliasView *aview;
{

! int replying = 0 != (options & MAIL_REPLYING);
! int copy_msg = 0 != (options & MAIL_COPY_MSG);
! int edit_message = 0 != (options & MAIL_EDIT_MSG);
! int forwarding = 0 != (options & MAIL_FORWARDING);
! int mime_attach = 0 != (options & MAIL_MIME_ATTCH);



struct Attachments attachments = NULL_Attachments;

***************

*** 175,181 ****


char fname[SLEN], very_long_buffer[VERY_LONG_STRING];

int ch, line_len;
! register int retransmit = FALSE;
int already_has_text = FALSE; /* we need an ADDRESS */
int signature_done = FALSE;
int need_redraw = 0;

--- 256,262 ----


char fname[SLEN], very_long_buffer[VERY_LONG_STRING];

int ch, line_len;
! int retransmit = FALSE;
int already_has_text = FALSE; /* we need an ADDRESS */
int signature_done = FALSE;
int need_redraw = 0;
***************

*** 183,192 ****
int reask_verify = FALSE;
int dsn = 0;
mime_send_t MIME_info;
-

FILE * converted_buffer = NULL; /* Temp file which hold converted
! nody parts -- now include mime
headers however ...
*/
static int conv_count = 0;
--- 264,272 ----
int reask_verify = FALSE;
int dsn = 0;
mime_send_t MIME_info;

FILE * converted_buffer = NULL; /* Temp file which hold converted
! body parts -- now include mime
headers however ...
*/
static int conv_count = 0;
***************
*** 212,238 ****



zero_copy_file(&COPY_FILE);

- if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
- DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));
- if(DSN_success)
- dsn |= DSN_SUCCESS|DSN_FAILURE|DSN_DELAY;
- }
-
- if (current_header && (options & MAIL_ISFORM))
- copy_msg = FORM;
-
- /* Initialize structure */
- clear_mime_send_info(&MIME_info,mailer_info);
-
- if (allow_no_encoding >= 2)
- /* Just send BINARY anyway */
- MIME_info.raw_level = mailer_binary;
- else if (allow_no_encoding >= 1 &&
- MIME_info.raw_level < mailer_8bit)
- /* Just send 8BIT anyway */
- MIME_info.raw_level = mailer_8bit;
-
-
dump_expanded_address(4,"Mailing to",headers->to);

DPRINT(Debug,4, (&Debug," (with%s editing)\n",
edit_message? "" : "out"));

--- 292,297 ----
***************
*** 264,276 ****


cur_editfile,
cancelled_msg ? "" : " not"
));
! retransmit = recall_last_msg(cur_editfile, copy_msg, &cancelled_msg,
! &already_has_text,
page);
if (retransmit)
cur_editcharset = display_charset; /* ???? FIXME */
}

/** if we're not retransmitting, create the file.. **/

if (! retransmit) {
--- 323,336 ----


cur_editfile,
cancelled_msg ? "" : " not"
));
! retransmit = recall_last_msg(cur_editfile, copy_msg, &cancelled_msg,
! &already_has_text,
page);
if (retransmit)
cur_editcharset = display_charset; /* ???? FIXME */
}

+
/** if we're not retransmitting, create the file.. **/

if (! retransmit) {
***************
*** 335,448 ****
fclose(input);
already_has_text = TRUE;
}


! if (copy_msg == FORM) {
! elm_sfprintf(fname, sizeof fname,
! FRM("%s%s%d"), temp_dir, temp_form_file, getpid());

! fclose(reply); /* we can't retransmit a form! */


! if (access(fname,ACCESS_EXISTS) != 0) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotFindForm,
! "Couldn't find forms file!"));

goto fail_label;
}
- DPRINT(Debug,4,(&Debug,
- "-- renaming existing file %s to file %s --\n",
- fname, cur_editfile));
- rename(fname, cur_editfile);
- cur_editcharset = system_charset; /* FIXME: Is correct? */

- } else if (copy_msg && ! retransmit) { /* if retransmit we have it! */
- struct string * From_buffer = gen_From_buffer(current_header);


-
- if (!cur_editcharset)
- cur_editcharset = display_charset;

! if (!forwarding || (forwarding && !mimeforward)) {



! if (edit_message && infile) {

! int NOHDR = forwarding ? noheaderfwd : noheader;
! int NOQUOTE = forwarding && !quote_forward;
! int FORW = forwarding;
!
! copy_message_f(infile,current_header,


! NOQUOTE ? "" : prefixchars, reply,
! ( NOHDR ? CM_REMOVE_HEADER : 0 ) |
! CM_REMOVE_ENVELOPE | CM_DECODE |
! ( FORW ? CM_FORWARDING : 0 ) |
! CM_ATTRIBUTION

! /* I think it is good idea to use CM_FILT_HDR
! * even when we don't have forwarding ... -KEH
! */
! | CM_FILT_HDR, cur_editcharset);
! already_has_text = TRUE; /* we just added it, right? */
! } else if (infile) {

! int NOHDR = forwarding ? noheaderfwd : noheader;
! int FORW = forwarding;

! copy_message_f(infile,current_header,
! "", reply,


! ( NOHDR ? CM_REMOVE_HEADER : 0 ) |
! CM_REMOVE_ENVELOPE |
! ( FORW ? CM_FORWARDING : 0 ) |
! CM_ATTRIBUTION
! /* I added CM_DECODE to here -KEH */
! | CM_DECODE, cur_editcharset);

! }


! if (forwarding && !quote_forward) {
}

- } else {
- FILE *tmpfp;
-
- /* Use MESSAGE/RFC822 to forward messages. */

-
- elm_sfprintf (very_long_buffer, sizeof very_long_buffer,
- FRM("%selmfwd.%d"),
- temp_dir, getpid ());
- if (! (tmpfp = safeopen_rdwr (very_long_buffer))) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailFileForward,
- "Failed to create file for forwarding"));
- } else if (infile) {
- mime_t attach;



! mime_t_zero(&attach);

! attach.pathname = safe_strdup(very_long_buffer);
!
! copy_message_f(infile,current_header,"",tmpfp,
! CM_REMOVE_ENVELOPE,NULL);

! attach.length = fsize(tmpfp);
! fclose (tmpfp);

! attach.unlink = 1; /* mark for later deletion */
! attach.TYPE = give_media_type2(MIME_TYPE_MESSAGE,"rfc822", 0);
! if (!attach.TYPE)
! mime_panic(__FILE__,__LINE__,"mail",
! "message/rfc822 is not known");
! if (From_buffer)
! attach.description =
! format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmForwardedMesg1,

! "Forwarded message from %S"),
! From_buffer);
! else


! attach.description =
! format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmForwardedMesg2,

! "Forwarded message from %s"),
! current_header->env_from);
!

! /* Pick up the encoding from the message. */
! attach.encoding = ENCODING_7BIT;
! (void) update_encoding (&(attach.encoding),
! current_header->mime_rec.encoding);
! add_Attachments(&attachments,&attach);
}
}
! if (From_buffer)
! free_string(&From_buffer);

! }

if (!cur_editcharset)
cur_editcharset = display_charset;

--- 395,546 ----


fclose(input);
already_has_text = TRUE;
}
+

+ /* Initialize structure */


+ clear_mime_send_info(&MIME_info);
+ handle_mailer_options(mailer_info,&MIME_info,&dsn,
+ &attachments, NULL);
+
+ if (mailbox && mail_index >= 0 &&
+ (copy_msg || forwarding)) {
+ struct header_rec * hdr = NULL;
+ FILE * mailbox_file = NULL;
+

! if (!give_message_data(mailbox,mail_index,
! &hdr,&mailbox_file,NULL,
! mime_parse_routine)) {
!
! DPRINT(Debug,4,(&Debug,
! "Failed to retrieve original mail for replying/forwarding\n"));

+ fclose(reply); reply = NULL;
+
goto fail_label;


}


! if ((options & MAIL_ISFORM))
! copy_msg = FORM;
!

!

! if (copy_msg == FORM) {
! elm_sfprintf(fname, sizeof fname,
! FRM("%s%s%d"), temp_dir, temp_form_file, getpid());

! /* we can't retransmit a form! */
! fclose(reply); reply = NULL;
!
! if (access(fname,ACCESS_EXISTS) != 0) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotFindForm,
! "Couldn't find forms file!"));

! goto fail_label;
}

!
! DPRINT(Debug,4,(&Debug,

! "-- renaming existing file %s to file %s --\n",
! fname, cur_editfile));
! rename(fname, cur_editfile);
! cur_editcharset = system_charset; /* FIXME: Is correct? */
!

! } else if (! retransmit) { /* if retransmit we have it! */
! struct string * From_buffer = gen_From_buffer(hdr);

! if (!cur_editcharset)
! cur_editcharset = display_charset;
!

!
! if (!mime_attach) {


!
! if (edit_message && mailbox_file) {

! int NOHDR = forwarding ? noheaderfwd : noheader;
! int NOQUOTE = forwarding && !quote_forward;
! int FORW = forwarding;
!
! copy_message_f(mailbox_file,hdr,


! NOQUOTE ? "" : prefixchars, reply,
! ( NOHDR ? CM_REMOVE_HEADER : 0 ) |
! CM_REMOVE_ENVELOPE | CM_DECODE |
! ( FORW ? CM_FORWARDING : 0 ) |
! CM_ATTRIBUTION

! /* I think it is good idea to use CM_FILT_HDR
! * even when we don't have forwarding ... -KEH
! */
! | CM_FILT_HDR, cur_editcharset);

! already_has_text = TRUE; /* we just added it, right? */
! } else if (mailbox_file) {

! int NOHDR = forwarding ? noheaderfwd : noheader;
! int FORW = forwarding;

! copy_message_f(mailbox_file,hdr,
! "", reply,


! ( NOHDR ? CM_REMOVE_HEADER : 0 ) |
! CM_REMOVE_ENVELOPE |
! ( FORW ? CM_FORWARDING : 0 ) |
! CM_ATTRIBUTION
! /* I added CM_DECODE to here -KEH */
! | CM_DECODE, cur_editcharset);

! }

!
! if (forwarding) {


! if (From_buffer)
! attach.description =
! format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmForwardedMesg1,

! "Forwarded message from %S"),
! From_buffer);
! else


! attach.description =
! format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmForwardedMesg2,
! "Forwarded message from %s"),
! hdr->env_from);
! }
!
! /* Pick up the encoding from the message. */
! attach.encoding = ENCODING_7BIT;
! (void) update_encoding (&(attach.encoding),
! hdr->mime_rec.encoding);
! add_Attachments(&attachments,&attach);
! }
}
+ if (From_buffer)
+ free_string(&From_buffer);
}

!
! }

if (!cur_editcharset)
cur_editcharset = display_charset;

***************
*** 463,478 ****


/* append signature now if we are going to use an external editor */
/* Don't worry about the remote/local determination too much */

! if (already_has_text ||
! (strcmp(editor,"builtin") != 0 && strcmp(editor,"none") != 0)) {
! signature_done = TRUE;
! if (!retransmit && copy_msg != FORM)
! already_has_text |= append_sig(reply, headers, page);
}

! if (! retransmit && copy_msg != FORM)
! if (reply != NULL)
! (void) fclose(reply); /* on replies, it won't be open! */

/** Edit the message **/

--- 561,583 ----


/* append signature now if we are going to use an external editor */

/* Don't worry about the remote/local determination too much */

! {
! char * editor_val = give_dt_estr_as_str(&editor_e,"editor");
!

! if (already_has_text ||
! (editor_val &&
! strcmp(editor_val,"builtin") != 0 &&
! strcmp(editor_val,"none") != 0)) {
! signature_done = TRUE;
! if (!retransmit && copy_msg != FORM)
! already_has_text |= append_sig(reply, headers, page);
! }
}

! if (reply != NULL) {
! (void) fclose(reply);
! reply = NULL;
! }

/** Edit the message **/

***************

*** 499,507 ****


if (attachments.attachment_count > 0)
options |= MAIL_HAVE_ATTACHMENTS;
#ifdef USE_PGP
! if (current_header &&
! current_header->pgp & PGP_MESSAGE)
! options |= MAIL_HAVE_PGP_ENCODED;
#endif

/* Now .mailheaders is read before mail is composed! */

--- 604,615 ----


if (attachments.attachment_count > 0)
options |= MAIL_HAVE_ATTACHMENTS;
#ifdef USE_PGP
! if (mailbox && mail_index >= 0) {
! struct header_rec *hdr = give_header(mailbox,mail_index);
! if (hdr &&
! hdr->pgp & PGP_MESSAGE)
! options |= MAIL_HAVE_PGP_ENCODED;
! }
#endif

/* Now .mailheaders is read before mail is composed! */
***************
*** 577,582 ****
--- 685,706 ----


signature_done = TRUE;
}

+ if (code >= 0) { /* If not canceled */
+ int r = mailer_restarted(mailer_info);
+
+ if (r > 0)
+ handle_mailer_options(mailer_info,&MIME_info,&dsn,
+ &attachments, &reask_verify);
+
+ if (r < 0) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailerDisconnected,
+ "Mailer disconnected! Can't send message. Use f)orget !"));
+
+
+ reask_verify = TRUE; /* Go to verify_transmission again. */
+ }
+ }
+
MIME_info.encoding_top = ENCODING_7BIT;/* Encoding for Multipart/ */

#if 0
***************

*** 590,595 ****
--- 714,734 ----
"Message %s was%s cancelled ...\n",


cur_editfile, cancelled_msg ? "": " not"));

+ } else if (headers->to.addrs_len < 1 &&
+ headers->cc.addrs_len < 1 &&
+ headers->bcc.addrs_len < 1) {
+
+ cancelled_msg = (bytes(cur_editfile) > 0);
+
+ if (cancelled_msg)
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoRecipientsKeptMessage,
+ "No recipients specified! Message kept."));
+ else
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoRecipients,
+ "No recipients specified!"));
+
+ code = -1;
+
} else
cancelled_msg = FALSE; /* it ain't cancelled, is it? */

***************
*** 738,747 ****
if (COPY_FILE.copy_file) /* i.e. if copy_file contains a name */


save_copy(headers,&COPY_FILE, form, &MIME_info,
converted_buffer,
-

- mailbox,


page,aview); /* Need access for all open

! mailboxes/folders */



/** write all header information into whole_msg_file **/

--- 877,884 ----
if (COPY_FILE.copy_file) /* i.e. if copy_file contains a name */
save_copy(headers,&COPY_FILE, form, &MIME_info,
converted_buffer,

page,aview); /* Need access for all open

! mailboxes/folders */



/** write all header information into whole_msg_file **/

***************

*** 806,823 ****


/* NOTE: succees failure, backgrouded status currently ignored */

/* mark the "replied" status of the message */

! if (replying && current_header &&
! 0 != (current_header->status && REPLIED_TO)) {

! DPRINT(Debug,4,(&Debug,
! "Adding replied mark to current message\n"));

- current_header->status |= REPLIED_TO;


- current_header->status_chgd = TRUE;

} else {


DPRINT(Debug,8,(&Debug,"Not adding replied mark %s%s\n",

replying ? "" : " -- not replying ",

! current_header ? "" : " -- no current_header"));
}
}

--- 943,967 ----


/* NOTE: succees failure, backgrouded status currently ignored */

/* mark the "replied" status of the message */

! if (replying && mailbox && mail_index >= 0) {



! struct header_rec *hdr = give_header(mailbox,mail_index);

! if (hdr && 0 != (hdr->status && REPLIED_TO)) {
!
! DPRINT(Debug,4,(&Debug,
! "Adding replied mark to current message\n"));
!
! hdr->status |= REPLIED_TO;
! hdr->status_chgd = TRUE;
! } else {
! DPRINT(Debug,8,(&Debug,
! "Not adding replied mark -- getiing header failed\n"));
! }

} else {


DPRINT(Debug,8,(&Debug,"Not adding replied mark %s%s\n",

replying ? "" : " -- not replying ",

! mailbox ? "" : " -- no mailbox"));
}
}

***************
*** 896,906 ****


}
}

! int mail_form(current_header, address, subj, infile,mailbox, aview)
! struct header_rec *current_header;
struct addr_item *address;
char *subj;
- FILE *infile;
struct MailboxView *mailbox;
struct AliasView *aview;
{

--- 1040,1049 ----


}
}

! int mail_form(mail_index, address, subj, mailbox, aview)
! int mail_index;
struct addr_item *address;
char *subj;
struct MailboxView *mailbox;
struct AliasView *aview;
{
***************

*** 921,928 ****


addr_to_expanded(&A,address,mailer_info,aview);
copy_expanded_address(&headers.to, A);

! res = mail(current_header,MAIL_ISFORM,NO, &headers,mailer_info,
! infile, mailbox /* save_copy needs */,
aview);

free_expanded_address(&A);

--- 1064,1071 ----


addr_to_expanded(&A,address,mailer_info,aview);
copy_expanded_address(&headers.to, A);

! res = mail(mail_index,MAIL_ISFORM,NO, &headers,mailer_info,
! mailbox /* save_copy needs */,
aview);

free_expanded_address(&A);
***************

*** 1191,1203 ****


if (do_redraw) {
do_redraw = 0;
*need_redraw_p = TRUE;
!
menu_ClearScreen(page);
print_format_center(0,
CATGETS(elm_msg_cat, ElmSet,
ElmMailScreenTitle,
"Mail Pre-Send Screen"));

show_presend_headers(headers,hdr_charset, page);

if (headers->env_from && user_level > 0) {

--- 1334,1348 ----


if (do_redraw) {
do_redraw = 0;
*need_redraw_p = TRUE;
!
menu_ClearScreen(page);
print_format_center(0,
CATGETS(elm_msg_cat, ElmSet,
ElmMailScreenTitle,
"Mail Pre-Send Screen"));

+ show_last_error();
+
show_presend_headers(headers,hdr_charset, page);

if (headers->env_from && user_level > 0) {
***************

*** 1472,1486 ****


if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
if (*form_p == YES)
*form_p = MAYBE;
*need_redraw_p = TRUE;
! do_redraw = 1;
! if (edit_the_message(filename, already_has_text,
! headers,editor,file_set,
! mailer_info, mailbox,
! aview, page) != 0)
! return -1;
}
break;

--- 1617,1641 ----


if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
+

+ char * editor_val = give_dt_estr_as_str(&editor_e,"editor");
+

if (*form_p == YES)
*form_p = MAYBE;
*need_redraw_p = TRUE;
! if (editor_val) {
! do_redraw = 1;
! if (edit_the_message(filename, already_has_text,
! headers,editor_val,file_set,
! mailer_info, mailbox,
! aview, page) != 0)
! return -1;
! } else {
! sleep_message();
! if (no_editor_edit_the_message(filename,headers,file_set,
! mailer_info,mailbox,aview))
! return -1;
! }
}
break;

***************

*** 1958,1964 ****


information). You can't necessarily finger someone in the
same domain. */

! if (!batch_only && (local_signature[0] || remote_signature[0])) {

char filename2[SLEN];
char *sig = "";

--- 2113,2126 ----


information). You can't necessarily finger someone in the
same domain. */

! char * lsig = give_dt_estr_as_str(&local_signature_e, "localsignature");

! char * rsig = give_dt_estr_as_str(&remote_signature_e,"remotesignature");
!
!

! if (!lsig || !rsig)
! error_wait();
!
! if (!batch_only && (lsig || rsig)) {

char filename2[SLEN];
char *sig = "";
***************

*** 1968,1974 ****



struct addr_item *p;

! sig = local_signature;

/* check To: list */
for (p = headers->to.addrs ;

--- 2130,2136 ----



struct addr_item *p;

! sig = lsig;

/* check To: list */
for (p = headers->to.addrs ;
***************

*** 1987,1998 ****


ptr++;

if (istrcmp(ptr, hostfullname) != 0) {
! sig = remote_signature;
break;
}
}

! if (sig == local_signature) /* still local? */
/* check Cc: */
for (p = headers->cc.addrs ;
p < headers->cc.addrs + headers->cc.addrs_len;

--- 2149,2160 ----


ptr++;

if (istrcmp(ptr, hostfullname) != 0) {
! sig = rsig;
break;
}
}

! if (sig == lsig) /* still local? */
/* check Cc: */
for (p = headers->cc.addrs ;
p < headers->cc.addrs + headers->cc.addrs_len;
***************

*** 2010,2021 ****


ptr++;

if (istrcmp(ptr, hostfullname) != 0) {
! sig = remote_signature;
break;
}
}

! if (sig[0]) { /* if there is a signature file */
if (sig[0] != '/')
elm_sfprintf(filename2, sizeof filename2,
FRM("%s/%s"),

--- 2172,2183 ----


ptr++;

if (istrcmp(ptr, hostfullname) != 0) {
! sig = rsig;
break;
}
}

! if (sig && sig[0]) { /* if there is a signature file */
if (sig[0] != '/')
elm_sfprintf(filename2, sizeof filename2,
FRM("%s/%s"),

Index: elmME+.2.5.alpha1-cvs/src/messages/def_messages.h
*** elmME+.2.5.alpha0/src/messages/def_messages.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/messages/def_messages.h 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,4 ****


! /* $Id: def_messages.h,v 1.6.8.1 2004/04/18 16:55:43 hurtta Exp $ */

#include "elm_defs.h"
#include "mime.h"
--- 1,4 ----
! /* $Id: def_messages.h,v 1.6.8.2 2004/07/03 15:23:07 hurtta Exp $ */

#include "elm_defs.h"
#include "mime.h"
***************
*** 91,108 ****


struct mailbox_type * mailbox_type;

union {
! struct mv_storage {
! struct current_storage ** the_mailbox;
! int mailbox_count;
!
! } * storage;
!
! struct mv_digest {
! struct current_digest ** the_digest;
! int digest_count;
! } * digest;

struct mv_partial {
struct MailboxView * parent_mailbox;

struct composite_vector * composite;

--- 91,103 ----


struct mailbox_type * mailbox_type;

union {
! struct mv_storage * storage;
!
! struct mv_digest * digest;

struct mv_partial {
+ /* partial_to_mailbox_view() sets parent so mv_partial need to
+ be defined on here */
struct MailboxView * parent_mailbox;

struct composite_vector * composite;

Index: elmME+.2.5.alpha1-cvs/src/messages/digest.c
*** elmME+.2.5.alpha0/src/messages/digest.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/messages/digest.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: digest.c,v 1.9.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: digest.c,v 1.9.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 20,25 ****
--- 20,30 ----
};


+ struct mv_digest {
+ struct current_digest ** the_digest;
+ int digest_count;
+ };
+
#if ANSI_C
#define S_(x) static x;
#else

Index: elmME+.2.5.alpha1-cvs/src/messages/Makefile.SH
*** elmME+.2.5.alpha0/src/messages/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/messages/Makefile.SH 2004-07-03 18:23:07.000000000 +0300


***************
*** 17,23 ****
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.5.44.1 2004/04/18 16:55:43 hurtta Exp $
# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.5.44.2 2004/07/03 15:23:07 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************

*** 43,49 ****
SHELL = /bin/sh

OBJ = messages.o header_alloc.o storage.o digest.o \
! partial.o

all: Makefile libmessages.a

--- 43,49 ----
SHELL = /bin/sh

OBJ = messages.o header_alloc.o storage.o digest.o \
! partial.o

all: Makefile libmessages.a

Index: elmME+.2.5.alpha1-cvs/src/messages/messages.c
*** elmME+.2.5.alpha0/src/messages/messages.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/messages/messages.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: messages.c,v 1.12.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: messages.c,v 1.12.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 14,24 ****

#define MAILBOXVIEW_magic 0xF500

static struct MailboxView * malloc_view P_((struct mailbox_type *t));
static struct MailboxView * malloc_view(t)
struct mailbox_type *t;
{
! struct MailboxView *ret;

ret = safe_malloc(sizeof (*ret));

--- 14,64 ----

#define MAILBOXVIEW_magic 0xF500

+ static struct MailboxView ** mailbox_list = NULL;
+ static int mailbox_list_len = 0;
+
+ struct MailboxView * give_next_open_mailbox(idx, signal)
+ int *idx;
+ int signal;
+ {
+ int i = *idx;
+
+ struct MailboxView *ret = NULL;
+
+ do {
+ if (*idx >= mailbox_list_len || *idx < 0)

+ return NULL;
+
+

+ if (mailbox_list[*idx]) {
+
+

+ if (mailbox_list[*idx]->magic != MAILBOXVIEW_magic)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"malloc_view",
+ "Bad type magic number",signal);
+
+
+ ret = mailbox_list[*idx];
+
+ }
+
+ (*idx)++;
+
+ } while (!ret);
+
+
+ SIGDPRINT(Debug,7,(&Debug,
+ "give_next_open_mailbox[%d->%d] = %p\n",
+ i,*idx,ret));
+

+ return ret;
+ }
+

Index: elmME+.2.5.alpha1-cvs/src/messages/storage.c
*** elmME+.2.5.alpha0/src/messages/storage.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/messages/storage.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: storage.c,v 1.6.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: storage.c,v 1.6.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6.8.2 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 17,22 ****
--- 17,28 ----
#define S_(x)
#endif

+ struct mv_storage {
+ struct current_storage ** the_mailbox;
+ int mailbox_count;
+
+ };
+
static void mt_make_storage_view P_((struct MailboxView *mailbox));


Index: elmME+.2.5.alpha1-cvs/src/metapager.c
*** elmME+.2.5.alpha0/src/metapager.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/metapager.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: metapager.c,v 1.38 2004/03/27 18:31:45 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: metapager.c,v 1.38.8.1 2004/07/03 15:23:07 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Index: elmME+.2.5.alpha1-cvs/src/mime.c
*** elmME+.2.5.alpha0/src/mime.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/mime.c 2004-05-23 19:24:49.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime.c,v 1.31 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime.c,v 1.31.8.1 2004/05/23 16:24:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Index: elmME+.2.5.alpha1-cvs/src/options.c
*** elmME+.2.5.alpha0/src/options.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/options.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: options.c,v 1.24.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.24.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 100,129 ****


static int resort = 0;


- static int post_cal P_((int f));
- static int post_cal(f)
- int f;
- {
- (void) expand_env(calendar_file, raw_calendar_file, sizeof(calendar_file));

- return 0;
- }


- static int post_editor P_((int f));
- static int post_editor(f)
- int f;
- {
- (void) expand_env(editor, raw_editor, sizeof(editor));

- return 0;
- }


- static int post_pager P_((int f));
- static int post_pager(f)
- int f;
- {
- (void) expand_env(pager, raw_pager, sizeof(pager));
- clear_pages = (equal(pager, "builtin+") || equal(pager, "internal+"));
- return 0;
- }

static int post_folder P_((int f));
static int post_folder(f)

--- 100,107 ----
***************
*** 142,155 ****


return 0;
}

- static int post_sent P_((int f));
- static int post_sent(f)
- int f;
- {
- (void) expand_meta(sent_mail, raw_sentmail, sizeof(sent_mail));

-
- return 0;
- }

static int post_print P_((int f));
static int post_print(f)

--- 120,125 ----
***************
*** 160,173 ****


}

/* ? ? ? What this is ? */
! static int post_menu P_((int f, struct menu_context *page));
! static int post_menu(f, page)
int f;
- struct menu_context *page;
{

int LINES, COLUMNS;

! menu_get_sizes(page,&LINES, &COLUMNS);

headers_per_page = LINES - (mini_menu ? 14 : 9);
return 0;

--- 130,142 ----


}

/* ? ? ? What this is ? */
! static int post_menu P_((int f));
! static int post_menu(f)
int f;
{
int LINES, COLUMNS;

! menu_get_sizes(default_context,&LINES, &COLUMNS);

headers_per_page = LINES - (mini_menu ? 14 : 9);
return 0;
***************

*** 182,195 ****


"Left margin string (prefix) for reply and forward.", ElmOptionBorderHelp},

#ifdef ENABLE_CALENDAR
! {'c', "C)alendar file", ElmOptionCalendarMenu, "calendar", post_cal,
"This is the file where calendar entries from messages are saved.", ElmOptionCalendarHelp},
#endif

! {'d', "D)isplay mail using", ElmOptionDisplayMenu, "pager", post_pager,
"This is the program invoked to display individual messages (try 'builtin').", ElmOptionDisplayHelp},

! {'e', "E)ditor (primary)", ElmOptionEditorMenu, "editor", post_editor,
"This is the editor used for all outbound messages (may be 'builtin').", ElmOptionEditorHelp},

{'f', "F)older directory", ElmOptionFolderMenu, "maildir", post_folder,

--- 151,164 ----


"Left margin string (prefix) for reply and forward.", ElmOptionBorderHelp},

#ifdef ENABLE_CALENDAR
! {'c', "C)alendar file", ElmOptionCalendarMenu, "calendar", NULL,
"This is the file where calendar entries from messages are saved.", ElmOptionCalendarHelp},
#endif

! {'d', "D)isplay mail using", ElmOptionDisplayMenu, "pager", NULL,
"This is the program invoked to display individual messages (try 'builtin').", ElmOptionDisplayHelp},

! {'e', "E)ditor (primary)", ElmOptionEditorMenu, "editor", NULL,
"This is the editor used for all outbound messages (may be 'builtin').", ElmOptionEditorHelp},

{'f', "F)older directory", ElmOptionFolderMenu, "maildir", post_folder,
***************

*** 213,219 ****


{'n', "N)ames only", ElmOptionNameMenu, "names", NULL,
"Whether to display the names and addresses on mail, or names only.", ElmOptionNameHelp},

! {'o', "O)utbound mail saved", ElmOptionOutboundMenu, "sentmail", post_sent,
"This is where copies of outbound messages are saved automatically.", ElmOptionOutboundHelp},

{'p', "P)rint mail using", ElmOptionPrintMenu, "print", post_print,

--- 182,188 ----


{'n', "N)ames only", ElmOptionNameMenu, "names", NULL,
"Whether to display the names and addresses on mail, or names only.", ElmOptionNameHelp},

! {'o', "O)utbound mail saved", ElmOptionOutboundMenu, "sentmail", NULL,
"This is where copies of outbound messages are saved automatically.", ElmOptionOutboundHelp},

{'p', "P)rint mail using", ElmOptionPrintMenu, "print", post_print,
***************

*** 920,955 ****

--- 889,895 ----


if (q)
return(1);

! if (DT_SRT == save_info[x].dt_type) {
number = *SAVE_INFO_SRT(x);
if (change_sort(&number, ypos, xpos, mailbox, page) != 0) {
*SAVE_INFO_SRT(x) = number;

***************
*** 984,989 ****
--- 924,956 ----


++q;
}

+ } else { /* Hopefully generic routine ... */
+ char * s;
+
+ if (RCTYPE_magic != save_info[x].dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"info_enter",
+ "Bad config item type",0);
+
+ s = save_info[x].dt_type->get_value(& save_info[x]);
+
+ if (s)

+ strfcpy(buffer,s, sizeof buffer);
+ else
+ buffer[0] = '\0';
+

+ optionally_enter(buffer, ypos, xpos,
+ (append_current ? OE_APPEND_CURRENT : 0) |
+ (passwd ? OE_PASSWD : 0),
+ sizeof buffer,page);
+
+ if (!s || !equal(buffer,s)) {
+
+ if (save_info[x].dt_type->parse_line(& save_info[x],
+ 1 /* local */ ,buffer,
+ 0,"<config editor>",
+ 0,0))
+ q++;
+ }
}

if (q)

Index: elmME+.2.5.alpha1-cvs/src/pgp.c
*** elmME+.2.5.alpha0/src/pgp.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/pgp.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

+ "GetPGPKey()=-1: running pgp/gpg failed\n"));


+ return -1;
+ }
+
+

p = fdopen (fd[0], "r");
if (p == NULL) {
+ int tmp;
+ int err = errno;
+
DPRINT(Debug,1,(&Debug,
! "GetPGPKey()=-1: ERROR: fdopen (errno %d)\n",
! err));
! kill(RS.pid,SIGTERM);
! wait_end(&RS,&tmp);
!
return -1;
}

+ retry:
while (fgets(buf, STRING, p) != NULL) {
DPRINT(Debug,10,(&Debug,
"GetPGPKey: %s\n",buf));

***************
*** 262,268 ****


--- 283,318 ----
}
}
}
+
+ if (ferror(p) && EINTR == errno) {
+ clearerr(p);
+ DPRINT(Debug,5,(&Debug,
+ "Reading of result interrupted (EINTR) -- retrying\n"));
+
+ if (0 == code) {
+ code = run_already_done(&RS,&stat);
+ if (0 != code) {
+ DPRINT(Debug,5,(&Debug,

+ "now pgp/gpg is completing\n"));
+ }
+ }
+

Index: elmME+.2.5.alpha1-cvs/src/read_rc.c
*** elmME+.2.5.alpha0/src/read_rc.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/read_rc.c 2004-05-22 17:50:34.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.24.8.2 2004/05/01 20:07:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.24.8.3 2004/05/22 14:50:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 39,45 ****
remotesignature = <.signature file for non-local mail>
--

- bounceback= <hop count threshold, or zero to disable>
readmsginc = <new folder message count display increment>
sleepmsg = time to 'sleep' while displaying transient messages
timeout = <seconds for main menu timeout or zero to disable>
--- 39,44 ----
Index: elmME+.2.5.alpha1-cvs/src/reply.c
*** elmME+.2.5.alpha0/src/reply.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/reply.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: reply.c,v 1.35.8.2 2004/05/01 08:45:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: reply.c,v 1.35.8.3 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

! struct header_rec *current_header = NULL;
!
!

! if (!give_message_data(mailbox,index,
! &current_header,&F,NULL,
! NO_mime_parse))
return 0;

+ if (! current_header || !F)

+ return 0;
+

+ rt = handle_reply_to(current_header,F);
+
+
if (current_header->subject)
temp1 = convert_string(display_charset,current_header->subject,1);
else
***************
*** 343,356 ****
"Re: your mail") ),
sizeof subject);

- rt = handle_reply_to(current_header,infile);
if (form_letter)
! return_value = mail_filled_in_form(current_header,rt, subject,
! infile,mailbox, aview);
else {
! return_value = send_msg_l(current_header,rt, NULL, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, infile,mailbox, aview,
page);
}

--- 353,365 ----
"Re: your mail") ),
sizeof subject);

if (form_letter)
! return_value = mail_filled_in_form(index,rt, subject,
! mailbox, aview);
else {
! return_value = send_msg_l(index,rt, NULL, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
page);
}

***************
*** 363,371 ****


return(return_value);
}

! int reply_to_everyone(current_header,infile,mailbox, aview, page)
! struct header_rec *current_header;
! FILE *infile;

struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;
struct menu_context *page;

--- 372,379 ----


return(return_value);
}

! int reply_to_everyone(index,mailbox, aview, page)
! int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;
struct menu_context *page;
***************

*** 383,395 ****


struct string * temp1 = NULL;
char * temp2 = NULL;

! if (!current_header)
return 0;

! rt = handle_reply_to(current_header, infile);
cc = get_and_expand_everyone(current_header,rt);

-
if (current_header->subject)
temp1 = convert_string(display_charset,current_header->subject,1);
else

--- 391,412 ----


struct string * temp1 = NULL;
char * temp2 = NULL;

!
! FILE *F = NULL;

! struct header_rec *current_header = NULL;
!
!

! if (!give_message_data(mailbox,index,
! &current_header,&F,NULL,
! NO_mime_parse))
return 0;

! if (! current_header || !F)

! return 0;
!

! rt = handle_reply_to(current_header,F);
cc = get_and_expand_everyone(current_header,rt);

if (current_header->subject)
temp1 = convert_string(display_charset,current_header->subject,1);
else
***************

*** 402,410 ****


"Re: your mail"),
sizeof subject);

! return_value = send_msg_l(current_header,rt, cc, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, infile,mailbox, aview,
page);

if (rt)
free_addr_items(rt);
--- 419,427 ----


"Re: your mail"),
sizeof subject);

! return_value = send_msg_l(index,rt, cc, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
page);

if (rt)
free_addr_items(rt);
***************
*** 417,425 ****


return(return_value);
}

! int forward(current_header,infile,mailbox,aview, page)
! struct header_rec *current_header;
! FILE *infile;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

--- 434,441 ----


return(return_value);
}

! int forward(index,mailbox,aview, page)
! int index;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
***************

*** 436,441 ****
--- 452,458 ----


char subject[SLEN];
int results, edit_msg = FALSE;
int LINES, COLUMNS;
+ struct header_rec *current_header = give_header(mailbox,index);

menu_get_sizes(page, &LINES, &COLUMNS);

***************

*** 478,490 ****


"(fwd)") != 0))
strfcat(subject, " (fwd)", sizeof subject);

! results = send_msg_l(current_header,
NULL, NULL, subject,
(edit_msg ? MAIL_EDIT_MSG : 0 ) |
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,
! infile,mailbox, aview,
page);

free_string(&temp1);

--- 495,507 ----


"(fwd)") != 0))
strfcat(subject, " (fwd)", sizeof subject);

! results = send_msg_l(index,
NULL, NULL, subject,
(edit_msg ? MAIL_EDIT_MSG : 0 ) |
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,
! mailbox, aview,
page);

free_string(&temp1);
***************

*** 492,498 ****



}
else
! results = send_msg_l(current_header,
NULL, NULL,
/* TODO: Fix this mess... */
catgets(elm_msg_cat, ElmSet, ElmForwardedMail,

--- 509,515 ----



}
else
! results = send_msg_l(index,
NULL, NULL,
/* TODO: Fix this mess... */
catgets(elm_msg_cat, ElmSet, ElmForwardedMail,
***************

*** 501,507 ****


MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,
! infile, mailbox, aview,
page);
return(results);
}

--- 518,524 ----


MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,
! mailbox, aview,
page);
return(results);
}

Index: elmME+.2.5.alpha1-cvs/src/savecopy.c
*** elmME+.2.5.alpha0/src/savecopy.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/savecopy.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44.8.1 2004/05/15 10:52:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 67,80 ****


* the filenames right, and then invokes "append_copy_to_file()" to do

* the dirty work.
*/

! int save_copy(headers, cf, form, mime_info, conv_file, mailbox,


page, aview)
struct mailing_headers * headers;
struct copy_file *cf;
int form;

mime_send_t *mime_info;
FILE * conv_file;

- struct MailboxView *mailbox;
struct menu_context *page;
struct AliasView *aview;
{
--- 67,79 ----


* the filenames right, and then invokes "append_copy_to_file()" to do

* the dirty work.
*/

! int save_copy(headers, cf, form, mime_info, conv_file,

page, aview)
struct mailing_headers * headers;
struct copy_file *cf;
int form;

mime_send_t *mime_info;
FILE * conv_file;
struct menu_context *page;

struct AliasView *aview;
{
***************
*** 87,93 ****


int ra, rb;
int reopen_current = 0;
struct current_storage *storage = NULL;
!

if (!cf->copy_file)
return 0; /* Selected NONE */

--- 86,93 ----


int ra, rb;
int reopen_current = 0;
struct current_storage *storage = NULL;
! struct MailboxView *m;
! int idx;

if (!cf->copy_file)
return 0; /* Selected NONE */
***************

*** 159,170 ****




} else {
use_sent_mail:

lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotDetermineToName,
"Cannot determine `to' name to save by! Saving to \"sent\" folder %s instead."),
! sent_mail);

is_sent_mail++;
}

--- 159,175 ----




} else {
+
+ char * sent_val;
+
use_sent_mail:

+ sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotDetermineToName,
"Cannot determine `to' name to save by! Saving to \"sent\" folder %s instead."),
! sent_val ? sent_val : "<");

is_sent_mail++;
}
***************

*** 174,181 ****



if (is_sent_mail) {
int r;
use_sent_mail2:
! /* If we come here via gtoto label, increment is_sent_mail */

if (!is_sent_mail)
is_sent_mail++;

--- 179,187 ----



if (is_sent_mail) {
int r;
+
use_sent_mail2:
! /* If we come here via goto label, increment is_sent_mail */

if (!is_sent_mail)
is_sent_mail++;
***************

*** 190,197 ****


r = select_dir_item(cf->dir,&(cf->copy_file));

if (!r) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
! "Cannot save to %s!"), sent_mail);
sleep_message();
return 0;
}

--- 196,207 ----


r = select_dir_item(cf->dir,&(cf->copy_file));

if (!r) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
! "Cannot save to %s!"),
! sent_val ? sent_val : "<");
!
sleep_message();
return 0;
}
***************

*** 201,209 ****



if (!flags) { /* No selection so try it */
if (!select_dir_item(cf->dir,&(cf->copy_file))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,sent_mail);
sleep_message();
if (is_sent_mail)
panic("FILE PANIC",__FILE__,__LINE__,"save copy",

--- 211,224 ----



if (!flags) { /* No selection so try it */
if (!select_dir_item(cf->dir,&(cf->copy_file))) {
+
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,
! sent_val ? sent_val : "<");
!
sleep_message();
if (is_sent_mail)
panic("FILE PANIC",__FILE__,__LINE__,"save copy",
***************

*** 240,252 ****


free_string(&(cf->copy_file));
cf->copy_file = selection_name_dir(cf->dir);

! if (mailbox) {
int mbc,i;

! mbc = get_storage_count(mailbox);
is_current_folder = 0;
for (i = 0; i < mbc; i++) {
! storage = get_storage(mailbox,i);

if (storage &&
storage->current_folder)

--- 255,269 ----


free_string(&(cf->copy_file));
cf->copy_file = selection_name_dir(cf->dir);

!
! idx = 0;
! while (NULL != (m = give_next_open_mailbox(&idx,0))) {
int mbc,i;

! mbc = get_storage_count(m);
is_current_folder = 0;
for (i = 0; i < mbc; i++) {
! storage = get_storage(m,i);

if (storage &&
storage->current_folder)
***************

*** 255,260 ****
--- 272,280 ----


if (is_current_folder)
break; /* FOUND */
}
+
+ if (is_current_folder)
+ break; /* FOUND */
}

if (is_sent_mail) {
***************

*** 298,308 ****


free(msg_buffer);

if (answer != *def_ans_yes) {
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat,
ElmSet,
ElmSavingToInstead,
"Alright - saving to `%s' instead"),
! sent_mail);
if (sleepmsg > 0)
sleep(sleepmsg);
ClearLine (LINES-1-2);

--- 318,330 ----


free(msg_buffer);

if (answer != *def_ans_yes) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat,
ElmSet,
ElmSavingToInstead,
"Alright - saving to `%s' instead"),
! sent_val ? sent_val : "<" );
if (sleepmsg > 0)
sleep(sleepmsg);
ClearLine (LINES-1-2);
***************

*** 345,356 ****


free(msg_buffer);

if (answer != *def_ans_yes) {
PutLineX (LINES-1-2, 0,
CATGETS(elm_msg_cat,
ElmSet,
ElmSavingToInstead,
"Alright - saving to `%s' instead"),
! sent_mail);
if (sleepmsg > 0)
sleep(sleepmsg);
ClearLine (LINES-1-2);

--- 367,380 ----


free(msg_buffer);

if (answer != *def_ans_yes) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
PutLineX (LINES-1-2, 0,
CATGETS(elm_msg_cat,
ElmSet,
ElmSavingToInstead,
"Alright - saving to `%s' instead"),
! sent_val ? sent_val : "<");
if (sleepmsg > 0)
sleep(sleepmsg);
ClearLine (LINES-1-2);
***************

*** 360,369 ****


}
/* Create it now ... */
if (!create_selection_dir(cf->dir)) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,sent_mail);
sleep_message();
goto use_sent_mail2;
}

--- 384,396 ----


}
/* Create it now ... */
if (!create_selection_dir(cf->dir)) {

+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,

"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,
! sent_val ? sent_val : "<");
sleep_message();
goto use_sent_mail2;
}
***************

*** 396,412 ****


}

if (!prepare_write_folder(cf->dir,&write_ptr)) {
if (!is_sent_mail) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,sent_mail);
sleep_message();
goto use_sent_mail2;
}
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
"Cannot save to %s!"),
! sent_mail);
sleep_message();
return 0;
}

--- 423,443 ----


}

if (!prepare_write_folder(cf->dir,&write_ptr)) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
if (!is_sent_mail) {
+
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,
! sent_val ? sent_val : "<");
sleep_message();
goto use_sent_mail2;
}
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
"Cannot save to %s!"),
! sent_val ? sent_val : "<");
sleep_message();
return 0;
}
***************

*** 428,444 ****


}

if (!rb || ra < 0) {
if (!is_sent_mail) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,sent_mail);
sleep_message();
goto use_sent_mail2;
}
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
"Cannot save to %s!"),
! sent_mail);
return 0;
}
return 1;

--- 459,478 ----


}

if (!rb || ra < 0) {
+ char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");
+
if (!is_sent_mail) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCannotSaveToSavingInstead,
"Cannot save to %S! Saving to \"sent\" folder %s instead."),
! cf->copy_file,
! sent_val ? sent_val : "<");
sleep_message();
goto use_sent_mail2;
}
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCannotSaveTo,
"Cannot save to %s!"),
! sent_val ? sent_val : "<");
return 0;
}
return 1;

Index: elmME+.2.5.alpha1-cvs/src/save_opts.c
*** elmME+.2.5.alpha0/src/save_opts.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/save_opts.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.26 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.26.8.1 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 147,153 ****
int x = find_opt(s);
if (x >= 0) {

! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"str_opt_nam",


"Bad config item type",0);

--- 147,153 ----
int x = find_opt(s);
if (x >= 0) {

! if (RCTYPE_magic != save_info[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"str_opt_nam",


"Bad config item type",0);

***************
*** 214,220 ****
local_value = save_info[x].flags & FL_LOCAL;
add_comment(x, newelmrc);

! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"save_user_options",


"Bad config item type",0);

--- 214,220 ----
local_value = save_info[x].flags & FL_LOCAL;
add_comment(x, newelmrc);

! if (RCTYPE_magic != save_info[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"save_user_options",


"Bad config item type",0);

Index: elmME+.2.5.alpha1-cvs/src/showmsg.c
*** elmME+.2.5.alpha0/src/showmsg.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/showmsg.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.36 2004/03/27 18:31:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.36.8.1 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 665,673 ****
menu_get_sizes(page,&LINES, &COLUMNS);

DPRINT(Debug,4,(&Debug,
! "displaying %d lines from message #%d using %s\n",
current_header->lines,
! current, pager));


if(ison(current_header->status, NEW)) {
--- 665,673 ----
menu_get_sizes(page,&LINES, &COLUMNS);

DPRINT(Debug,4,(&Debug,
! "displaying %d lines from message #%d\n",
current_header->lines,
! current));


if(ison(current_header->status, NEW)) {

Index: elmME+.2.5.alpha1-cvs/src/showmsg_c.c
*** elmME+.2.5.alpha0/src/showmsg_c.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/src/showmsg_c.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.35 2004/03/27 18:31:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.35.8.1 2004/07/03 15:23:07 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 253,267 ****
"Forward message"), TRUE, &MENU,
page);

! if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine)) {
! if (forward(hdr,F,mailbox, aview, page))
! put_border(page);
! } else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
}

break;

--- 253,261 ----

Index: elmME+.2.5.alpha1-cvs/utils/elmlibregister.c
*** elmME+.2.5.alpha0/utils/elmlibregister.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/utils/elmlibregister.c 2004-07-03 18:23:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.6 2004/03/28 13:37:39 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.6.8.1 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************
***************
*** 300,306 ****
local_value = save_info[x].flags & FL_CHANGED;
else

local_value = save_info[x].flags & FL_LOCAL;
! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

--- 300,306 ----


local_value = save_info[x].flags & FL_CHANGED;
else

local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

***************
*** 345,351 ****
local_value = save_info[x].flags & FL_CHANGED;
else

local_value = save_info[x].flags & FL_LOCAL;
! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

--- 345,351 ----
local_value = save_info[x].flags & FL_CHANGED;
else

local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

Index: elmME+.2.5.alpha1-cvs/utils/elmrc-write.c
*** elmME+.2.5.alpha0/utils/elmrc-write.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/utils/elmrc-write.c 2004-07-03 18:23:08.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.13 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.13.8.1 2004/07/03 15:23:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 320,326 ****
local_value = save_info[x].flags & FL_CHANGED;
else

local_value = save_info[x].flags & FL_LOCAL;
! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

--- 320,326 ----
local_value = save_info[x].flags & FL_CHANGED;
else

local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

***************
*** 365,371 ****
local_value = save_info[x].flags & FL_CHANGED;
else

local_value = save_info[x].flags & FL_LOCAL;
! if (!valid_rc_type(save_info[x].dt_type))
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

--- 365,371 ----
local_value = save_info[x].flags & FL_CHANGED;
else

local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
panic("RC PANIC",__FILE__,__LINE__,"main",


"Bad config item type",0);

Index: elmME+.2.5.alpha1-cvs/utils/elmregister.c
*** elmME+.2.5.alpha0/utils/elmregister.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha1-cvs/utils/elmregister.c 2004-05-22 17:50:34.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.15 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.15.8.1 2004/05/22 14:50:34 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

+
+
+

+ int l;
+

+ case 'd':
case 'C':


case 'M':

***************
*** 2870,2875 ****
--- 2929,2935 ----
case 'M':

case '{':
case 'F':


+ case 'd':
case 'C':

if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
***************
*** 3077,3082 ****
--- 3137,3143 ----
break;

case 'F':
+ case 'd':
case 's': /* also handled by unstage_list() */

if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
***************
*** 3188,3193 ****
--- 3249,3255 ----
break;

case 'F':

+ case 'd':
case 'C':


case 'L': /* link */
case 'M':
***************
*** 3407,3412 ****
--- 3469,3475 ----

case 'M':
case 'F':
+ case 'd':
case 'C':

p = NULL;

Index: elmME+.2.5.alpha1-cvs/utils/from.c
*** elmME+.2.5.alpha0/utils/from.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/utils/from.c 2004-07-03 18:23:08.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: from.c,v 1.48.8.1 2004/05/01 07:41:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: from.c,v 1.48.8.2 2004/07/03 15:23:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 237,243 ****
infile[0] = '\0';

if (no_files = (optind == argc)) { /* assignment intentional */
! strfcpy(infile, defaultfile, sizeof infile);
optind -= 1; /* ensure one pass through loop */
}

--- 237,247 ----
infile[0] = '\0';

if (no_files = (optind == argc)) { /* assignment intentional */

! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (!default_val)

! exit(1);
! strfcpy(infile, default_val, sizeof infile);
optind -= 1; /* ensure one pass through loop */
}

Index: elmME+.2.5.alpha1-cvs/utils/newmail.c
*** elmME+.2.5.alpha0/utils/newmail.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/utils/newmail.c 2004-07-03 18:23:08.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35.8.1 2004/05/01 07:41:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35.8.2 2004/07/03 15:23:08 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 715,727 ****
static void add_default_folder()
{
struct read_folder_state * read_state_ptr;
!
! folder_list[0].F = enter_new_folder(defaultfile);

if (!folder_list[0].F) {
DPRINT(Debug,1,(&Debug,
"failed to add folder %s\n",
! defaultfile));
return;
}

--- 715,731 ----


static void add_default_folder()
{
struct read_folder_state * read_state_ptr;

! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (!default_val)

! return;
!
! folder_list[0].F = enter_new_folder(default_val);

if (!folder_list[0].F) {
DPRINT(Debug,1,(&Debug,

"failed to add folder %s\n",
! default_val));
return;
}

Index: elmME+.2.5.alpha1-cvs/utils/readmsg.c
*** elmME+.2.5.alpha0/utils/readmsg.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha1-cvs/utils/readmsg.c 2004-07-03 18:23:08.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.18.8.2 2004/05/16 09:30:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.18.8.3 2004/07/03 15:23:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 369,382 ****


sizeof folder_name);


! } else if (defaultfile[0] != '\0')
! strfcpy(folder_name, defaultfile, sizeof folder_name);
! else {
! lib_error(CATGETS(elm_msg_cat, ReadmsgSet,
! ReadmsgCannotGetIncomingName,
! "%s: Cannot figure out name of your incoming mail folder.\n"),
! prog);
! exit(1);
}
}

--- 369,386 ----
sizeof folder_name);


! } else {


! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val)

Kari E. Hurtta

unread,
Jul 10, 2004, 7:53:17 AM7/10/04
to
Archive-name: elm2.4ME+/PL117b

Is available on ozone.FMI.FI


via anonymous ftp
directory KEH/

file elm-2.4ME+PL117b.patch.gz
for a moment (1).


Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL117b.patch.gz >
via WWW (1).

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL117b.patch.gz >
via WWW.

1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire.


For apply patch use command

patch -p1 < {path...}/elm-2.4ME+PL117b.patch


on top level directory of Elm 2.4ME+ distribution
(ie. on directory where Configure is.)

SUMMARY: This patch fixes problem where Ctrl-C is
ignored only if Elm ME+ is compiled with
-DDEBUG define.

Notice: ME+ series is not official Elm.

This patch is agaist Elm 2.4ME+ PL117a (25) --------------------------------
Index: elm2.4.ME+.117b-cvs/hdrs/patchlevel.h
Prereq: 1120000000
*** elm2.4.ME+.117a/hdrs/patchlevel.h 2004-07-10 11:16:33.000000000 +0300
--- elm2.4.ME+.117b-cvs/hdrs/patchlevel.h 2004-07-10 11:08:20.000000000 +0300
***************
*** 1,8 ****
! #define PATCHLEVEL "117a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.117
*/
! #define LAST_REPORT_TIME 1120000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Jul, 2004" /* for elm -v option */
#define WHAT_STRING \
--- 1,8 ----
! #define PATCHLEVEL "117b (25)"
/* Used by Configure:
SHAREDTAG: .1.0.117
*/
! #define LAST_REPORT_TIME 1120900000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Jul, 2004" /* for elm -v option */
#define WHAT_STRING \
Index: elm2.4.ME+.117b-cvs/README.ME+
*** elm2.4.ME+.117a/README.ME+ 2004-07-10 11:16:33.000000000 +0300
--- elm2.4.ME+.117b-cvs/README.ME+ 2004-07-10 11:08:20.000000000 +0300
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.779 2004/07/04 05:53:02 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.780 2004/07/10 08:08:20 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,28 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+

+ Changes of Elm2.4ME+ PL117b (25) compared with Elm2.4ME+ PL117a (25)
+ --------------------------------------------------------------------


+
+ [ This patch is branch from the main line. ]
+

+ - Interrupt signal (Ctrl-C) was ignored only,
+ if Elm ME+ was compiled with -DDEBUG option.
+ Problem noted by: Laura Kataja


+
Changes of Elm2.4ME+ PL117a (25) compared with Elm2.4ME+ PL117 (25)

-------------------------------------------------------------------

Index: elm2.4.ME+.117b-cvs/src/args.c
*** elm2.4.ME+.117a/src/args.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.117b-cvs/src/args.c 2004-07-10 11:08:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: args.c,v 1.62 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.63 2004/07/10 08:08:20 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.63 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 106,113 ****
#if DEBUG
set_debugging(optarg);
#else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,
! "Warning: system created without debugging enabled - request ignored\n"));
#endif
break;
case 'D' :
--- 106,114 ----
#if DEBUG
set_debugging(optarg);
#else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,
! "Warning: system created without debugging enabled - request ignored\n"));
! error_sleep(1);
#endif
break;
case 'D' :
Index: elm2.4.ME+.117b-cvs/src/init.c
*** elm2.4.ME+.117a/src/init.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.117b-cvs/src/init.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: init.c,v 1.50 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: init.c,v 1.51 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 245,251 ****

/*
* If debug level is fairly low, ignore keyboard signals
- * until the screen is set up.
*/

/* FIXME -- Probably wrong variable ... */
--- 245,250 ----
***************
*** 253,258 ****
--- 252,260 ----
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
}
+ #else
+ signal(SIGINT, SIG_IGN);
+ signal(SIGQUIT, SIG_IGN);
#endif

if(!check_only && !batch_only) {
Index: elm2.4.ME+.117b-cvs/utils/answer.c
*** elm2.4.ME+.117a/utils/answer.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/answer.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: answer.c,v 1.16 2004/03/27 18:31:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: answer.c,v 1.17 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 105,111 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 105,111 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/elmalias.c
*** elm2.4.ME+.117a/utils/elmalias.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/elmalias.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.16 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.17 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 239,245 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 239,245 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/elmbindata.c
*** elm2.4.ME+.117a/utils/elmbindata.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/elmbindata.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.5 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.6 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 133,139 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 133,139 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/elmcharset.c
*** elm2.4.ME+.117a/utils/elmcharset.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/elmcharset.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.29 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.30 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

***************
*** 163,169 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 163,169 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/elmlibregister.c
*** elm2.4.ME+.117a/utils/elmlibregister.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/elmlibregister.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.7 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.8 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 135,141 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 135,141 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/elmrc-write.c
*** elm2.4.ME+.117a/utils/elmrc-write.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/elmrc-write.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.14 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.15 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 133,139 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 133,139 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/elmstringconvert.c
*** elm2.4.ME+.117a/utils/elmstringconvert.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/elmstringconvert.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.8 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.9 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 252,258 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 252,258 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/elmterminal.c
*** elm2.4.ME+.117a/utils/elmterminal.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/elmterminal.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.13 2004/03/27 18:31:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.14 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 88,94 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
}
#endif
}
--- 88,94 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
}
#endif
}
Index: elm2.4.ME+.117b-cvs/utils/elmunidata.c
*** elm2.4.ME+.117a/utils/elmunidata.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/elmunidata.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.18 2004/03/27 18:31:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.19 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 111,117 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 111,117 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/fastmail.c
*** elm2.4.ME+.117a/utils/fastmail.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/fastmail.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.30 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.31 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 406,412 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 406,412 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/newalias.c
*** elm2.4.ME+.117a/utils/newalias.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/newalias.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newalias.c,v 1.15 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newalias.c,v 1.16 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 87,93 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 87,93 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}
Index: elm2.4.ME+.117b-cvs/utils/prlong.c
*** elm2.4.ME+.117a/utils/prlong.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.117b-cvs/utils/prlong.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: prlong.c,v 1.12 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 140,146 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 140,146 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! xsleep(5+sleepmsg);
#endif
}
}

Kari E. Hurtta

unread,
Jul 23, 2004, 3:49:02 AM7/23/04
to
Archive-name: elm2.4ME+/PL118.0

Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

files elm-2.4ME+PL118.patch.gz
and elm-2.4ME+118.tar.gz
for a moment.

Will be available on ftp.funet.fi (2) (or ftp.ipv6.funet.fi with IPv6)


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

files elm-2.4ME+PL118.patch.gz
and elm-2.4ME+118.tar.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL118.patch.gz >
and <URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+118.tar.gz >
via WWW.

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL118.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+118.tar.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL118.patch.gz >
and <URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+118.tar.gz >
via WWW.

(1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi

www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

(2) Is submitted to pub/unix/incoming/ on ftp.funet.fi
( http://www.nic.funet.fi/pub/unix/incoming/elm-2.4ME+/ )

Before applying patch catenate parts 1 - 2 first.


That part (part 0) do not include patch. Patch

is on part 1 - 2.

This patch is agaist Elm 2.4ME+ PL117 (25)

Changes of Elm 2.4ME+ PL118 (25) compared with Elm 2.4ME+ PL117 (25)
--------------------------------------------------------------------

Undo Elm 2.4ME+ PL117a (25) and Elm 2.4ME+ PL117b (25)
patches before applying this patch.

SUMMARY: This release collects PL117a and PL117b
patches, make possible to cancel some
actions or prompts with interrupt character
on POSIX systems, changes letter of 'invoke
editor' command on header editing screen
and makes some other changes or fixes.

- Interrupt signal (Ctrl-C) was ignored only,

if Elm ME+ was compiled with -DDEBUG option.

Problem noted by: Laura Kataja

- Fix bug where Elm2.4ME+ PL117 was acting always as
dsn-success was set.

- Message/check


"signature" used in obsolete way in .elm/elmrc file.

removed.

- Moved get_term_chars() from src/init.c to
src/screen/init.c

- PL108 added 'invoke e)ditor' command to header editing
screen. That conflicts with 'E)xpires' command.
Changed command to 'invoke e(d)itor'.

- Allow canceling of following prompts
with Ctrl-C (interrupt character) on systems
which supports POSIX termios:
Set current XXX to :
Description: (Attachment Configuration)
Content-Type: (Attachment Configuration)
Content-Disposition: (Attachment Configuration)
Search: (builtin pager)
From: (Message Header Edit Screen)
To: (Message Header Edit Screen)
Cc: (Message Header Edit Screen)
Bcc: (Message Header Edit Screen)
Subject: (Message Header Edit Screen)
Reply-to: (Message Header Edit Screen)
Action: (Message Header Edit Screen)
Priority: (Message Header Edit Screen)
Precedence: (Message Header Edit Screen)
In-reply-to: (Message Header Edit Screen)
user defined header on Message Header Edit Screen
Enter criteria or '?' for help:
Send the message to: (prompt of m)ail command)
To: (prompt of m)ail command)
Subject: (prompt of m)ail command)
Copies to: (prompt of m)ail command)
Return-path: (Mail Pre-Send Screen)
E)ditor (primary) : (ELM Options Editor)
D)isplay mail using : (ELM Options Editor)
C)alendar file : (ELM Options Editor)
O)utbound mail saved : (ELM Options Editor)
P)rint mail using : (ELM Options Editor)
Y)our full name : (ELM Options Editor)
V)isual Editor (~v) : (ELM Options Editor)
E)xpires: (ELM Options Editor)
Precede(n)ce: (ELM Options Editor)
Enter pattern:
To: (when encrypting message (pgp))
From: (when signing message (pgp))
Enter userid of public key: (prompt of Ctrl-K command)
Override charset:
Shell command:
Pipe to:
Enter alias name: (Alias mode)
Current message address aliased to:
Enter address for XXX: (Alias mode)
Fully expand alias: (Alias mode)
Enter last name for XXX:
Enter first name for XXX:
Enter optional comment for XXX:


Forward message as separate part?

Copy message? (prompt of m)ail command)
Edit outgoing message? (prompt of f)orward command)
Enter encryption key: (on sending mail)
Text part XX have control characters.
Encode text with quoted-printable? (on sending mail)

- Treate Ctrl-C (interrupt character) as No on following
prompts (on systems which support POSIX termios):
Abandon change to mailbox?
Abandon changes to mailbox?

- Handling interrupt (Ctrl-C) on builtin editor without
signals on systems which support POSIX termios
(that edit_interrupt signal handler is not safe!)

- GetPGPKey() did not always re-enabled raw-mode

- Allow canceling of following (folder browser) prompts
with Ctrl-C (interrupt character) on systems
which supports POSIX termios:
Change to which folder:
Save text of message to:
Copy text of message to:
Save text messages to:
Copy text messages to:
Save message to:
Copy message to:
Save messages to:
Copy messages to:
Save copy in (use '?' for help):

- Allow canceling of following (file browser) prompts
with Ctrl-C (interrupt character) on systems
which supports POSIX termios:
To file: (MIME structure Menu)
Filename: (Attachment Configuration)

- Allow canceling leaving of folder on following
prompts with Ctrl-C (interrupt character) on systems
which supports POSIX termios:
Delete message?
Delete messages?
Move read message to \"received\" folder?


Move read messages to \"received\" folder?

Keep unread message in incoming mailbox?


Keep unread messages in incoming mailbox?

- Now on address prompts also works \ quotation
of interrupt character (for example @, if set that way)
on systems which supports POSIX termios.

- Allow canceling of password prompt of IMAP/POP
with Ctrl-C (interrupt character) on systems
which supports POSIX termios:
Password for XXX@YYY:

- Allow canceling of IMAP/POP connection attempt
with Ctrl-C (interrupt character) on systems
which supports POSIX sigaction:
Connecting to XXX

- Allow canceling alias menu help prompt
with Ctrl-C (interrupt character) on systems
which supports POSIX termios
- Allow canceling messages/mailbox menu help
prompt with Ctrl-C (interrupt character) on systems
which supports POSIX termios
- Allow canceling options menu help prompt
with Ctrl-C (interrupt character) on systems
which supports POSIX termios

- Add READCH_CURSOR to ReadCh options (on
options screen and elsewhere) so that escape
sequences from cursor keys do not cause
misinterpration of selected option.

- Allow folowing ON/OFF prompts to be canceled
on options menu with Ctrl-C (interrupt character)
on systems which supports POSIX termios:
A)rrow cursor :
M)enu display :
- Allow options menu sorting criteria prompt
to be canceled with Ctrl-C (interrupt character)
on systems which supports POSIX termios:
S)orting criteria :

- Allow canceling DSN (Delivery Status Notification) Configuration
menu with Ctrl-C (interrupt character) on systems which supports
POSIX termios
- Allow canceling DSN (Delivery Status Notification) Configuration
menu prompts with Ctrl-C (interrupt character) on systems which
supports POSIX termios:
Return H)eaders only on FAILURE:
Return DSN on F)AILURE : TRUE
D)ELAY : TRUE
S)UCCESS : TRUE
U)se defaults (DSN off) : FALSE

- Allow quiting Attachment Configuration menu
with Ctrl-C (interrupt character) on systems which supports
POSIX termios (this not necessary forget/undo made changes
however.)
- Allow canceling encoding prompt on Configuration menu
with Ctrl-C (interrupt character) on systems which supports
POSIX termios:
Content-Transfer-Encoding:
- Allow quiting Attachment Menu with Ctrl-C (interrupt
character) on systems which supports POSIX termios (this not
necessary forget/undo made changes however.)

- Redraw Mail Pre-Send Screen when quiting Attachment Menu
or DSN menu.

- Allow quiting Message Header Edit Screen with Ctrl-C
(interrupt character) on systems which supports POSIX
termios (this not necessary forget/undo made changes
however.)

- Allow quiting help text viewer with Ctrl-C (interrupt
character) on systems which supports POSIX
termios:
Press <space> to continue, 'q' to return.

- Allow quiting of builtin pager with Ctrl-C (interrupt
character) on systems which supports POSIX termios

- Treate message/disposition-notification as
message/delivery-status (similar than text/plain).

- Fix for valgrind reported error
Conditional jump or move depends on uninitialised value(s)
at 0x80E3654: mail_gets (mail_gets.c:37)

- Fix for valgrind reported error
Conditional jump or move depends on uninitialised value(s)
at 0x80E73AC: give_media_type2 (mediatype.c:282)
by 0x80E7260: give_media_type (mediatype.c:241)

- Allow interrupting pgp/gpg message signing
wint interrupt character (or SIGINT, Ctrl-C).

- Allow canceling leaving of alias menu on following
prompts with Ctrl-C (interrupt character) on systems
which supports POSIX termios:
Delete 1 alias?
Delete XX aliases?

New file:
src/screen/init.c
lib/cancel.c

Warnings
--------

- Not compiled with MMDF support defined, so probably it doesn't
work (or even compile).

- This has not been tested much so there can be bad bugs.
Bug reports to: Kari E. Hurtta <hurtt...@posti.FMI.FI>

- Support for multipart/signed and multipart/encrypted (specially:
support for PGP/MIME) only in reading side. There is no support
for attachments with multipart/encrypted.

> But anyway, Elm will never be MIME Conformant

- HP's shoftkeys are no longer supported

- DECNET addresses like host::user may be interpreted as phrase
of group syntax or as route of source routed address.

- Header editing screen now uses addresses in form phrase <address>,
but because it does not require using of comma (,), multiword
phrases must be entered in quotes.

For example: "Kari Hurtta" <hurtta>

- If address includes <> or comments (), they are not aliased
expanded. So aliases must be entered as bare words.

- Addresses given as arguments to elm command should be given
as one address as arguments. Giving of sevaral addresses as
one arguments causes that address is misparsed if header is
edited on header editing screen.

That is:

Use: elm '"Kari Hurtta" <hurtta>' 'Admin <root>'

Don't use: elm 'Kari Hurtta <hurtta>, Admin <root>'

- readmsg does not use mailbox (lib/mbox.c) routines!
- p)rint command on article menu is still broken
(but you perhaps may use P)rint text command)
- Elm tools (on utils/*) do not use mime routines (melib).

- Some Linux libraries does not follow $LC_CTYPE when program is
setgid. Net result is that your locale is always C. That is
visible that $LC_CTYPE does not effect to locale printed by
'elm -vvvvv':

Locale (LC_CTYPE): C
Display character-set: US-ASCII
Sending character-set: US-ASCII

- Conversion from Display character-set to Sending character-set
is not possible it should be refused (but if it is not detected
result of conversion will be practically empty.)

- All refrences iso2022 maps are parsed and read to memory.
This may cause quite big memory consumption specially because
eastern (multibyte) sets tend to be lot of characters. That
mapping information should be shared between processes to
reduce memory consuption.

- If display charset is produced by using mapping from locale
to charset where charset definition is later invalidated
("removed") by setting explicit compatcharsets on user's
.elm/elmrc, that may cause PANIC on elm's internal pager
or other problems. Invalidation happens if display charset
is on implicit compatcharsets list (because of charset
definition), but does not have explicit compatcharsets list
given by user.

- Neither Unicode didirectional algorithm nor Right-Left scripts
are supported.

- In some situations two Status headers may be generated two
Status headers -- one by IMAP deamon and one from APPENDed
message.

- When APPENDing message to IMAP folder (which is normal UNIX
mailbox format) original "From " separator line can not be
preserved -- specially it is not possible to pass envelope
sender address.

- For UTF-8 charset Elm only knows printable characters from
Latin/1 range, if unicode database (see elmrc option "unidata")
is not loaded.

- For using of ISO2022 character sets it is required that mapping
them to unicode is know -- otherwise Elm ME+ does not know which
characters are printable.

- UTF-16 surrogate pairs (D800-DFFF) are not supported on UTF-7
charset.

- Mixing of names using IMAP naming convention
(imap-naming-convention = yes)
and names using imap-charset does not work very well...

- Some Linux gethostbyname implementations accept ip-address as
name, but return garbage on h_name -field of struct hostent.

- " Regarding my message (8 Aug 2000) regarding 'newmail' on
AIX 4.3.3 in an 'aixterm' window and the 'aixterm' did not
close, indeed the problem was NOT related to 'newmail' but an
AIX bug.

IBM has release a patch, and the 'aixterm' in AIX 4.3.3 must
be update with fileset X11.apps.aixterm.4.3.3.26 (PTF
U473920) is solved to problem."
From: Noam G. Nudelman <no...@mail.biu.ac.il>

- File /usr/share/locale/fi/charset gives charset name utf-8 on
Linux Mandrake 7.2. This causes that Configure generates
mapping
fi utf-8
to elm.mimecharsets. However that seems to have
incorrect mapping. You may want change this to
fi ISO-8859-1

( however nl_langinfo(CODESET) gives charset ISO-8859-15
but look following entry. )

- Locale 'fi' seems to have charset ISO-8859-15 according
of nl_langinfo(CODESET) on Mandrake Linux 7.2 (and probaly
others with same glibc version). However for example gnome
terminal uses font
-misc-fixed-medium-r-normal--12-200-75-75-c-100-iso8859-1
and not
-misc-fixed-medium-r-normal--12-200-75-75-c-100-iso8859-15

Also KDE's konsole program seems use iso8859-1 character set
although locale is 'fi' which should have ISO-8859-15 according
of nl_langinfo (selecting "unicode" from menu seems fix that.)

Because of mismatch more correct locale is fi_FI.88591, which gives
ISO-8859-1 character set according of nl_langinfo(CODESET).

( Locale seems come from /etc/sysconfig/i18n or $HOME/.i18n )

> To enable handling of ISO-8859-1 and ISO-8859-15 character sets
on linux console, read comments from doc/terminal.info file.

- Mandrake Linux 7.2 seems set LD_PRELOAD to load
/usr/lib/libxalflaunch.so.0. That (xalf-0.4-2mdk) causes that
elm to crash on startup (actually before main() is reached.)

- fastmail is broken

- kterm on Mandrake Linux 7.2 seems have (at least on my test
environment) seems get bad fontlist (*VT100*fontList) which
gives bad font for iso8859-1 -- therefore ISO-8859-1 characters
do not work.

("xrdb -query" seems report resource with name "*fontList"
-- that probably overrides "*VT100*fontList" which comes
from /usr/lib/X11/app-defaults/KTerm )

- Also note that initially kterm does NOT default to
ISO-8859-1 -- therefore ISO-8859-1 works only when
elm explicity switch to ISO-8859-1 (for example
with 'elm -D ISO-8859-1')

- When assembling message/partial MIME (RFC 2046)
requires that all headers except Content-*, Subject,
MIME-Version, Message-ID and Encrypted are copied from
initial enclosing message to assembled message. It also
requires that headers except Content-*, Subject,
MIME-Version, Message-ID and Encrypted are ignored and
dropped from enclosed message.

For now we copy only Received: -headers. Dropping extra
headers from enclosed message makes assembly more
complicated (and dropping of Received: -headers
from enclosed message do not make sense.)

- Running '//' Match pattern (in entire message): on
one big mailbox seems cause segementation violation
on malloc(). Seems memory corruption to me. However
running same search on same mailbox undef of valgrind
do not report error. Valgrind do not report that there is
illegal free() somewhere occured.

/ Kari Hurtta

Kari E. Hurtta

unread,
Jul 23, 2004, 3:50:56 AM7/23/04
to
Archive-name: elm2.4ME+/PL118.1

Before applying patch catenate parts 1 - 2 first.

This patch is agaist Elm 2.4ME+ PL117 (25)

==========================================================================
Index: elm2.4.ME+.118-cvs/hdrs/patchlevel.h
Prereq: 1119000000
*** elm2.4.ME+.117/hdrs/patchlevel.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/hdrs/patchlevel.h 2004-07-21 13:36:32.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "117 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.117
*/
! #define LAST_REPORT_TIME 1119000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "Jun, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jun, 2004"

/*
* Local Variables:
--- 1,12 ----

! #define PATCHLEVEL "118 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.118
*/
! #define LAST_REPORT_TIME 1121000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Jul, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jul, 2004"

/*
* Local Variables:
Index: elm2.4.ME+.118-cvs/README.ME+
*** elm2.4.ME+.117/README.ME+ 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/README.ME+ 2004-07-21 13:36:31.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.776 2004/06/27 16:19:51 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.820 2004/07/21 10:36:31 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,21 ****
--- 13,267 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL118 (25) compared with Elm 2.4ME+ PL117 (25)
+ --------------------------------------------------------------------
+
+ Undo Elm 2.4ME+ PL117a (25) and Elm 2.4ME+ PL117b (25)
+ patches before applying this patch.
+
+ SUMMARY: This release collects PL117a and PL117b
+ patches, make possible to cancel some
+ actions or prompts with interrupt character
+ on POSIX systems, changes letter of 'invoke
+ editor' command on header editing screen
+ and makes some other changes or fixes.
+
+ - Interrupt signal (Ctrl-C) was ignored only,
+ if Elm ME+ was compiled with -DDEBUG option.
+ Problem noted by: Laura Kataja


+
+ - Fix bug where Elm2.4ME+ PL117 was acting always as
+ dsn-success was set.
+

+ - Moved get_term_chars() from src/init.c to
+ src/screen/init.c
+
+ - PL108 added 'invoke e)ditor' command to header editing
+ screen. That conflicts with 'E)xpires' command.
+ Changed command to 'invoke e(d)itor'.
+
+ - Allow canceling of following prompts
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:
+ Set current XXX to :
+ Description: (Attachment Configuration)
+ Content-Type: (Attachment Configuration)
+ Content-Disposition: (Attachment Configuration)
+ Search: (builtin pager)
+ From: (Message Header Edit Screen)
+ To: (Message Header Edit Screen)
+ Cc: (Message Header Edit Screen)
+ Bcc: (Message Header Edit Screen)
+ Subject: (Message Header Edit Screen)
+ Reply-to: (Message Header Edit Screen)
+ Action: (Message Header Edit Screen)
+ Priority: (Message Header Edit Screen)
+ Precedence: (Message Header Edit Screen)
+ In-reply-to: (Message Header Edit Screen)
+ user defined header on Message Header Edit Screen
+ Enter criteria or '?' for help:
+ Send the message to: (prompt of m)ail command)
+ To: (prompt of m)ail command)
+ Subject: (prompt of m)ail command)
+ Copies to: (prompt of m)ail command)
+ Return-path: (Mail Pre-Send Screen)
+ E)ditor (primary) : (ELM Options Editor)
+ D)isplay mail using : (ELM Options Editor)
+ C)alendar file : (ELM Options Editor)
+ O)utbound mail saved : (ELM Options Editor)
+ P)rint mail using : (ELM Options Editor)
+ Y)our full name : (ELM Options Editor)
+ V)isual Editor (~v) : (ELM Options Editor)
+ E)xpires: (ELM Options Editor)
+ Precede(n)ce: (ELM Options Editor)
+ Enter pattern:
+ To: (when encrypting message (pgp))
+ From: (when signing message (pgp))
+ Enter userid of public key: (prompt of Ctrl-K command)
+ Override charset:
+ Shell command:
+ Pipe to:
+ Enter alias name: (Alias mode)
+ Current message address aliased to:
+ Enter address for XXX: (Alias mode)
+ Fully expand alias: (Alias mode)
+ Enter last name for XXX:
+ Enter first name for XXX:
+ Enter optional comment for XXX:


+ Forward message as separate part?

+ Copy message? (prompt of m)ail command)
+ Edit outgoing message? (prompt of f)orward command)
+ Enter encryption key: (on sending mail)
+ Text part XX have control characters.
+ Encode text with quoted-printable? (on sending mail)
+
+ - Treate Ctrl-C (interrupt character) as No on following
+ prompts (on systems which support POSIX termios):
+ Abandon change to mailbox?
+ Abandon changes to mailbox?
+
+ - Handling interrupt (Ctrl-C) on builtin editor without
+ signals on systems which support POSIX termios
+ (that edit_interrupt signal handler is not safe!)
+
+ - GetPGPKey() did not always re-enabled raw-mode
+
+ - Allow canceling of following (folder browser) prompts
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:
+ Change to which folder:
+ Save text of message to:
+ Copy text of message to:
+ Save text messages to:
+ Copy text messages to:
+ Save message to:
+ Copy message to:
+ Save messages to:
+ Copy messages to:
+ Save copy in (use '?' for help):
+
+ - Allow canceling of following (file browser) prompts
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:
+ To file: (MIME structure Menu)
+ Filename: (Attachment Configuration)
+
+ - Allow canceling leaving of folder on following
+ prompts with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:
+ Delete message?
+ Delete messages?
+ Move read message to \"received\" folder?
+ Move read messages to \"received\" folder?
+ Keep unread message in incoming mailbox?
+ Keep unread messages in incoming mailbox?
+
+ - Now on address prompts also works \ quotation
+ of interrupt character (for example @, if set that way)
+ on systems which supports POSIX termios.
+
+ - Allow canceling of password prompt of IMAP/POP
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:
+ Password for XXX@YYY:
+
+ - Allow canceling of IMAP/POP connection attempt
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX sigaction:
+ Connecting to XXX
+
+ - Allow canceling alias menu help prompt
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios
+ - Allow canceling messages/mailbox menu help
+ prompt with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios
+ - Allow canceling options menu help prompt
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios
+
+ - Add READCH_CURSOR to ReadCh options (on
+ options screen and elsewhere) so that escape
+ sequences from cursor keys do not cause
+ misinterpration of selected option.
+
+ - Allow folowing ON/OFF prompts to be canceled
+ on options menu with Ctrl-C (interrupt character)
+ on systems which supports POSIX termios:
+ A)rrow cursor :
+ M)enu display :
+ - Allow options menu sorting criteria prompt
+ to be canceled with Ctrl-C (interrupt character)
+ on systems which supports POSIX termios:
+ S)orting criteria :
+
+ - Allow canceling DSN (Delivery Status Notification) Configuration
+ menu with Ctrl-C (interrupt character) on systems which supports
+ POSIX termios
+ - Allow canceling DSN (Delivery Status Notification) Configuration
+ menu prompts with Ctrl-C (interrupt character) on systems which
+ supports POSIX termios:
+ Return H)eaders only on FAILURE:
+ Return DSN on F)AILURE : TRUE
+ D)ELAY : TRUE
+ S)UCCESS : TRUE
+ U)se defaults (DSN off) : FALSE
+
+ - Allow quiting Attachment Configuration menu
+ with Ctrl-C (interrupt character) on systems which supports
+ POSIX termios (this not necessary forget/undo made changes
+ however.)
+ - Allow canceling encoding prompt on Configuration menu
+ with Ctrl-C (interrupt character) on systems which supports
+ POSIX termios:
+ Content-Transfer-Encoding:
+ - Allow quiting Attachment Menu with Ctrl-C (interrupt
+ character) on systems which supports POSIX termios (this not
+ necessary forget/undo made changes however.)
+
+ - Redraw Mail Pre-Send Screen when quiting Attachment Menu
+ or DSN menu.
+
+ - Allow quiting Message Header Edit Screen with Ctrl-C
+ (interrupt character) on systems which supports POSIX
+ termios (this not necessary forget/undo made changes
+ however.)
+
+ - Allow quiting help text viewer with Ctrl-C (interrupt
+ character) on systems which supports POSIX
+ termios:
+ Press <space> to continue, 'q' to return.
+
+ - Allow quiting of builtin pager with Ctrl-C (interrupt
+ character) on systems which supports POSIX termios
+
+ - Treate message/disposition-notification as
+ message/delivery-status (similar than text/plain).
+
+ - Fix for valgrind reported error
+ Conditional jump or move depends on uninitialised value(s)
+ at 0x80E3654: mail_gets (mail_gets.c:37)
+
+ - Fix for valgrind reported error
+ Conditional jump or move depends on uninitialised value(s)
+ at 0x80E73AC: give_media_type2 (mediatype.c:282)
+ by 0x80E7260: give_media_type (mediatype.c:241)
+
+ - Allow interrupting pgp/gpg message signing
+ wint interrupt character (or SIGINT, Ctrl-C).
+
+ - Allow canceling leaving of alias menu on following
+ prompts with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:
+ Delete 1 alias?
+ Delete XX aliases?
+
+ New file:
+ src/screen/init.c
+ lib/cancel.c
+
+ Changes of Elm2.4ME+ PL117b (25) compared with Elm2.4ME+ PL117a (25)
+ --------------------------------------------------------------------


+
+ [ This patch is branch from the main line. ]
+

+ - Interrupt signal (Ctrl-C) was ignored only,
+ if Elm ME+ was compiled with -DDEBUG option.
+ Problem noted by: Laura Kataja
+
+ Changes of Elm2.4ME+ PL117a (25) compared with Elm2.4ME+ PL117 (25)
+ -------------------------------------------------------------------
+

+ [ This patch is branch from the main line. ]
+

+ - Fix bug where Elm2.4ME+ PL117 was acting always as
+ dsn-success was set.


+
Changes of Elm2.4ME+ PL117 (25) compared with Elm2.4ME+ PL116 (25)

-------------------------------------------------------------------

+ Undo Elm 2.4ME+ PL116a (25) patch before applying this patch.


+
SUMMARY: This release collects patch Elm2.4ME+ PL116a,

implements reconnection to mailer=submission, adds
pgp-interactive and askmimeforward elmrc options

***************
*** 101,106 ****
--- 347,354 ----


Changes of Elm2.4ME+ PL116a (25) compared with Elm2.4ME+ PL116 (25)

-------------------------------------------------------------------



+ [ This patch is branch from the main line. ]

+
- Alternatives and weedout and list was replaced with Q letters

Problem noted by: Cyrille Lefevre <cyrille...@laposte.net>

***************
*** 10384,10389 ****
--- 10632,10644 ----


complicated (and dropping of Received: -headers
from enclosed message do not make sense.)

+ - Running '//' Match pattern (in entire message): on
+ one big mailbox seems cause segementation violation
+ on malloc(). Seems memory corruption to me. However
+ running same search on same mailbox undef of valgrind
+ do not report error. Valgrind do not report that there is
+ illegal free() somewhere occured.
+
Collector of these patches
--------------------------

Index: elm2.4.ME+.118-cvs/doc/elmrc-info
*** elm2.4.ME+.117/doc/elmrc-info 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/doc/elmrc-info 2004-07-20 18:35:30.000000000 +0300
***************
*** 1,4 ****


! #@(#)$Id: elmrc-info,v 1.64 2004/06/27 15:18:05 hurtta Exp $
# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.65 2004/07/20 15:35:30 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************

*** 156,165 ****


# If first element on list is "*clear-weed-list*" then builtin

# weedout list is not used.

- bounceback


- # threshold for bouncing copies of remote uucp messages...
- # zero = disable function.
-

timeout
# Set the main prompt timeout for resynching...

--- 156,161 ----
***************
*** 330,342 ****
keepempty


# should we keep folders from which all messages are deleted?

- keypad


- # are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
-

- softkeys
- # are we running on an HP terminal and want softkeys available too?


- # (this implies "keypad=ON" too)
-

alternatives


# alternative addresses that I could receive mail from (usually a

# forwarding mailbox) and don't want to have listed...

--- 326,331 ----
***************
*** 572,585 ****


# time in seconds which Elm will wait after displaying a transient message

# and before erasing it. Can be 0 or positive integer.

- textencoding
- # Type of encoding to be put into the MIME Content-Transfer-Encoding header.
- # Usual values are 7bit or 8bit.
- #
- # -- NOT Used in this version of elm (2.4 PL24 ME7) or ELM 2.4ME+ PLxx (25)
- # Now elm analyzes mail when sending and does that encoding of quoted-printable
- # when necessary.
-
show-header-errors
# if this variable is ON, show certain header errors

--- 561,566 ----
Index: elm2.4.ME+.118-cvs/doc/elmrc.samp
*** elm2.4.ME+.117/doc/elmrc.samp 2002-01-26 13:14:45.000000000 +0200
--- elm2.4.ME+.118-cvs/doc/elmrc.samp 2004-07-20 18:35:31.000000000 +0300
***************
*** 1,8 ****
! #@(#)$Id: elmrc.samp,v 1.2 1998/11/08 18:20:15 hurtta Exp $
#
# .elm/elmrc - options file for the ELM mail system
#
! # Saved automatically by ELM 2.4ME+ PL50 (25) for Kari E. Hurtta
#

#
--- 1,8 ----
! # @(#)$Id: elmrc.samp,v 1.5 2004/07/20 15:35:31 hurtta Exp $
#
# .elm/elmrc - options file for the ELM mail system
#
! # Saved automatically by ELM 2.4ME+ PL118rc2 (25) for Kari Hurtta
#

#
***************
*** 16,30 ****
# then and now.
#



# how to sort the alias list, "Name" by default

! aliassortby = Name

# name of editor to use for replies that have text
! ### alteditor = /bin/vi


# alternative addresses that I could receive mail from (usually a

# forwarding mailbox) and don't want to have listed...

! # alternatives =


# should the default be to delete messages we've marked for deletion?

### alwaysdelete = OFF
--- 16,42 ----
# then and now.
#

+ # RFC 2822 (obsoletes RFC 822) allows only message-id to be included
+ # to in-reply-to.
+ # When set, adds also phrase to in-reply-to (violates RFC 2822)
+ ### add-in-reply-to-phrase = OFF
+

# how to sort the alias list, "Name" by default

! aliassortby = name
!
! # When set, switch display charset between charsets supported by terminal
! #
! # See also: page-known-charsets, displaycharset, charset-convert-ok
! ### allow-charset-switching = OFF

# name of editor to use for replies that have text
! # Value EDITOR means that use value of "editor"
! # See also: editor
! ### alteditor = EDITOR



# alternative addresses that I could receive mail from (usually a

# forwarding mailbox) and don't want to have listed...

! ### alternatives =


# should the default be to delete messages we've marked for deletion?

### alwaysdelete = OFF
***************
*** 32,37 ****
--- 44,50 ----


# should the default be to keep unread messages in the incoming mailbox?

### alwayskeep = ON

+

# should the default be to store read messages to the "received" folder?

### alwaysstore = OFF

***************
*** 46,58 ****
--- 59,108 ----
# would you like to be asked for Carbon-Copies information each msg?
### askcc = ON



+ # This option controls is forwarding as message/rfc822 prompted or not
+ # if set, option mnimeforward controls only default value for prompt
+ #
+ # See also: mimeforward

+ ### askmimeforward = ON
+
# If ON, Elm will prompt you for a username with which to sign the pgp
# message
### askpgpsig = OFF

+ # From which or to which directory read/save attachments.
+ # This is provided as {doc}/ prefix on correspond filename prompts.
+ ### attachment-dir = ~/Documents
+

# attribution string for replies ('%s' is the author of original message)

attribution = %s:

+ # Possible values are: none, application, non-text
+ # This affect how mime-parts with no Content-Disposition header,
+ # are treated.
+ # * If auto-attachment is none, missing Content-Disposition is
+ # treated as "Content-Disposition: inline".
+ # That is what MIME requires.
+ # * If auto-attachment is application, type is subtype of
+ # application and Elm can not handle type without calling
+ # metamail (or mailcap programs), missing Content-Disposition
+ # is treated as "Content-Disposition: attachment".
+ # * If auto-attachment is non-text, type is not subtype
+ # of text or multipart, type is not message/rfc822
+ # and Elm can not handle type without calling
+ # metamail (or mailcap programs), missing Content-Disposition
+ # is treated as "Content-Disposition: attachment".
+ #
+ # See also: charset-convert-ok, page-known-charsets, pagealternative,
+ # pagemultipart
+ ### auto-attachment = application
+
+
+ # Autocreate undefined ISO-8859-X charsets as superset of US-ASCII.
+ # RFC 2046 (MIME Part Two: Media Types) requires this.
+ #
+ # See also: compatcharsets, auto-attachment
+ ### auto-iso-8859 = ON
+
# automatically copy message being replied to into buffer?
autocopy = ON

***************
*** 60,69 ****
# > 0 wait background_wait_time seconds for completion
# if not completed in this time, let it go to background
#
! # (completion of mailing is still reported if user have
! # not exited in that time when mailer have completed)
### background-wait-time = 2

# This is used to determine if the builtin pager should be used on some
# messages even if you would usually use an external pager program.
# There are two ways of determining whether the builtin pager should be
--- 110,140 ----
# > 0 wait background_wait_time seconds for completion
# if not completed in this time, let it go to background
#
! # (completion of mailing is still reported if user have
! # not exited in that time when mailer have completed)
### background-wait-time = 2

+ # Binary charset map file. Includes type=ascii and type=one-byte-map maps
+ # from map-text-dir (and elsewhere). If that variable is set both
+ # on global elm.rc and user's elm.rc then both files may be readed
+ # or mmapped.
+ # Filaname can be
+ # filename File is read from directory
+ # given on map-bin-dir directory
+ # (normally $lib/elm.map.bin)
+ # {rc}/filename File is readed from .elm subdirectory
+ # of user's home
+ # ~/filename File is readed from user's home
+ # directory
+ # See also: map-bin-dir
+ ### bindata = bindata.bin
+
+
+
+ # If '*' or '?' are used on filename prompts, should these interprete
+ # as wildcards?
+ ### browser-wildcard-matching = ON
+
# This is used to determine if the builtin pager should be used on some
# messages even if you would usually use an external pager program.
# There are two ways of determining whether the builtin pager should be
***************
*** 76,97 ****
### builtinlines = -3



# where to save calendar entries

! ### calendar = /home/people/hurtta/

! # name of Character Set used with MIME text/plain Content-type
! # US-ASCII is default. Be aware that if you use a national charset
! # elm probably needs metamail to display US-ASCII. Special value
! # DISPLAY means that Charcter Set used in content-type is same
! # which the display supports (see: displaycharset)
! charset = DISPLAY
!
! # list of Character Sets, which are more or less a superset of US-ASCII
! # so we know that we can display messages with charset=US-ASCII without
! # help of metamail
! ### compatcharsets = ISO-8859-1 ISO-8859-2 ISO-8859-3 ISO-8859-4 ISO-8859-5 ISO-8859-7 ISO-8859-8 ISO-8859-9 KOI8-R X-ROMAN8

# list of options that can be configured at the "o)ptions" screen
! ### configoptions = ^_defspyv_am_un_ho

# Should elm always ask the user to confirm before it appends
# messages to any existing file?
--- 147,177 ----
### builtinlines = -3



# where to save calendar entries

! ### calendar = ~/calendar
!
!
!
! # Inhibit "[ Charset xxx converted... ]" message when charset
! # is converted (to unicode ie. without loss). Also use "pager"
! # to display charset (instead of metamail).
! #
! # See also: allow-charset-switching, displaycharset, page-known-charsets,
! # auto-attachment
! ### charset-convert-ok = OFF

! # List of (8-bit) Character Sets, which are byte-to-byte supersets of
! # US-ASCII.
! #
! # NOTE: That same information can be given on .elm/mime.charsets file with
! # ';MIME-subset=US-ASCII' qualifier -- that is preferred method.
! #
! # In fact this option should never be set explicity.
! #
! # See also: page-known-charsets, iso646-charsets, auto-iso-8859
! ### compatcharsets = ISO-8859-1 ISO-8859-15 KOI8-R KOI8-U windows-1251 ISO-8859-6-E ISO-8859-6-I ISO-8859-8-E ISO-8859-8-I CP775 CP855 CP857 CP861 CP862 CP864 CP866 CP869 ISO-8859-2 ISO-8859-3 ISO-8859-4 ISO-8859-5 ISO-8859-6 ISO-8859-7 ISO-8859-8 ISO-8859-9 ISO-8859-10 ISO-8859-11 ISO-8859-13 ISO-8859-14 ISO-8859-16 CP850 CP852 CP860 CP863 CP865 DEC-MCS hp-roman8 CP437 windows-1250 windows-1253 windows-1254 windows-1255 windows-1256 windows-1257 windows-1258

# list of options that can be configured at the "o)ptions" screen
! ### configoptions =

# Should elm always ask the user to confirm before it appends
# messages to any existing file?
***************
*** 118,155 ****


# does not affect ordinary files.

### confirmfolders = OFF



# save a copy of all outbound messages?

copy = ON

! # name of Character Set which the display supports. This is independent
! # of the above "charset". This is also copied to environment variable
! # MM_CHARSET when metamail is called. This is used only as default
! # on systems which supports locale. In these systems LC_CTYPE locale
! # is mapped to Character Set. Mapping is given in file elm.mimecharsets
! # on elm library directory or on file .elm/mime.charsets
! ### displaycharset = ISO-8859-1



# If TRUE, success Delivery-Status-Notifications are asked by default.

dsn-success = ON

# name of editor for ~e command (when editor="builtin")
! ### easyeditor = emacs



# what editor to use ("none" means simulate Berkeley Mail)

! ### editor = /bin/vi


# the character to use in the builtin editor for entering commands

### escape = ~



# save outbound messages by login name of sender/recipient even if the

# associated folder doesn't already exist?

### forcename = OFF



# do we want to be able to mail out AT&T Mail Forms?

### forms = OFF

# The full user name for outbound mail
! ### fullname = Kari E. Hurtta



# should we keep folders from which all messages are deleted?

### keepempty = OFF
--- 198,408 ----


# does not affect ordinary files.

### confirmfolders = OFF

+ # Elm 2.4ME+ PL55 parses addresses like:
+ # fullname <address>
+ # fullname <address> (comment)
+ # address (comment)
+ # When convert-comment-to-fullname is set, addresses are parsed like
+ # address (fullname)
+ # instead. That convert-comment-to-fullname is set by default for
+ # compatibilty of older versions of Elm.
+ ### convert-comment-to-fullname = ON
+
+ # Convert utf-8 mime encoded words to utf-7 when sending?
+ ### convert-utf-header = ON
+

# save a copy of all outbound messages?

copy = ON

! # In folders, should messages without Status header be marked
! # Old (0)
! # New (1)
! # Read (2)
! ### default-folder-status = Old
!
! # Name of (assumed) charset for text/plain MIME messages (if charset is
! # not given):
! # DISPLAY charset is same than used by terminal
! # SYSTEM charset is same than used by system (locale charset)
! # TEXT value of text-charset
! # US-ASCII charset is US-ASCII (required by standards)
! ### default-mime-text-charset = US-ASCII
!
! # Name of (assumed) charset of non-MIME messages:
! # DISPLAY charset is same than used by terminal
! # SYSTEM charset is same than used by system (locale charset)
! # TEXT value of text-charset
! # US-ASCII charset is US-ASCII (required by standards)
! ### default-nomime-charset = SYSTEM
!
!
! # When set other that SYSTEM, specifies Character Set to which
! # display should be switch if supported by terminal. Character
! # Set of terminal is switched back to System Character Set (given
! # on elm.mimecharsets or ~/.elm/mime.charsets file) when running
! # external programs. This switching is done even when option
! # allow-charset-switching is not set.
! #
! # Needs information from elm.terminalinfo or ~/.elm/terminal.info file.
! #
! # NOTICE that this (or Character Sets provided by locale) must have
! # mapping tables available if "text-charset" value is not DISPLAY
! #
! #
! # See also: page-known-charsets, allow-charset-switching, local-fs-charset,
! # text-charset
! ### displaycharset = SYSTEM



# If TRUE, success Delivery-Status-Notifications are asked by default.

dsn-success = ON

# name of editor for ~e command (when editor="builtin")
! ### easyeditor = /usr//bin/emacs



# what editor to use ("none" means simulate Berkeley Mail)

! # See also: alteditor
! ### editor = /usr//bin/vi
!
! # Tells which information to use for envelope from address.
! # Possible values include:
! # forward-from (0) Use: "From " separator line
! # ">From " forwarded indicator
! # "Return-Path:" header
! # from (1) Use: "From " separator line
! # "Return-Path:" header
! # return-path (2) Use: "Return-Path:" header
! #
! # Setting this to value return-path requires that on every mail have
! # Return-Path: -header.
! ### env-from-source = forward-from



# the character to use in the builtin editor for entering commands

### escape = ~

+ # Folders on that directory is considered to be mailboxes
+ # (ie. it is prepared that to they is arrived new mail when
+ # they are open). This directory must be different than
+ # folders or maildir directory (ie. ~/Mail).
+ ### extra-mailbox-dir =
+
+

# save outbound messages by login name of sender/recipient even if the

# associated folder doesn't already exist?

### forcename = OFF

+

# do we want to be able to mail out AT&T Mail Forms?

### forms = OFF

+ # How fragmented (message/partial) should be handled?
+ # none Call metamail (if available) for these
+ # manual Let user give command 'A' to enter message
+ # assembly mode
+ # auto Go automatically message assembly mode
+ ### fragment-handling = manual
+
# The full user name for outbound mail
! ### fullname = Kari Hurtta
!
! # What is the path for gnupg?
! # Possible values include:
! # none Don't call gpg
! # /path Call gpg via that path, if it is executable
! ### gpg = /usr//bin/gpg
!
! # plain: Show phrases as is (without quotation)
! # quoted: Show phrases on quoted form
! ### header-phrase-display-mode = plain
!
!
!
! # Character set used with IMAP
! # Special values: SYSTEM character set used by system (from locale)
! # DISPLAY character set used by terminal
! # TEXT value of text-charset
! # See also: imap-naming-convention, imap-fast-lookup
! ### imap-charset = SYSTEM
!
! # Should IMAP connections to be cached? (to reduce need to re-login to IMAP
! # service)
! ### imap-connection-cache = ON
!
! # If set indicates that IMAP directory listing not needed for lookup
! #
! # Need to be unset, if same character on imap-charset is several
! # repesentations (or encodings). Also need to be unset, if
! # both imap-naming-convention and imap-charset is used.
! #
! # See also: imap-charset, imap-naming-convention, local-fast-lookup
! ### imap-fast-lookup = OFF
!
! # maximum size of message on bytes which is downloaded by IMAP
! # when mailbox is parsed.
! #
! # Value -1 for imap-max-download-size causes that all messages are downloaded.
! # ! character as second letter on message status indicates that message
! # is not downloaded.
! # See also: pop-max-download-size
! ### imap-max-download-size = 4096
!
! # Should IMAP's Mailbox International Naming Convention to be used?
! #
! # If path name on folder listing does not match use IMAP's Mailbox
! # International Naming Convention, imap-charset is used instead for
! # interprering of name. That requires that imap-fast-lookup is NOT
! # set.
! #
! # See also: imap-charset, imap-fast-lookup
! ### imap-naming-convention = ON
!
! # Show untagged BAD messages?
! ### imap-show-error = ON
!
! # Show server greeting and other untagged OK messages (without machine
! # readable codes) ?
! ### imap-show-greeting = ON
!
! # Show untagged NO messages?
! ### imap-show-warning = ON
!
! # Should IMAP use EXAMINE when looking mail (ie. when using programs
! # like "frm" or "newmail")? If this is set, EXAMINE is used to get
! # read-only access (so that \Recent flag if mails is preserved).
! # However seems that (some?) IMAP servers does not report new mails
! # when mailbox is opened as read-only.
! ### imap-use-examine = ON
!
! # Name of incoming-mailbox, useful if POP or IMAP is used
! ### incoming-mailbox = $MAIL
!
! # If set, Mailcap program selection -screen is shown even when
! # all programs asked on screen are executed by default
! # See also: internal-mailcap-trusted-programs
! ### internal-mailcap-prompt-trusted = OFF
!
! # List of programs which are executed by default when using internal
! # mailcap. Programs given on test= are always executed without
! # prompting.
! # See also: internal-mailcap-prompt-trusted, internal-mailcaps
! ### internal-mailcap-trusted-programs =
!
! # List of mailcaps for internal mailcap support (without metmail).
! # List may be space or ':' seperated. Separate values may be quoted.
! # Set value to "none" to disable internal mailcap support.
! # See also: metamail-mailcaps, internal-mailcap-trusted-programs
! ### internal-mailcaps = /home/hurtta/.mailcap /etc/mailcap
!
! # List of 7-bit Character Sets, which are byte-to-byte supersets of
! # INVARIANT.
! #
! # NOTE: That same information can be given on .elm/mime.charsets file with
! # ';MIME-subset=INVARIANT' qualifier -- that is preferred method.
! #
! # In fact this option should never be set explicity.
! #
! # See also: page-known-charsets, compatcharsets
! ### iso646-charsets = US-ASCII IRV ISO646-GB ISO646-FI ISO646-SE2 ISO646-JP ISO646-IT ISO646-ES ISO646-DE
!


# should we keep folders from which all messages are deleted?

### keepempty = OFF
***************
*** 158,172 ****
# expire it.
### keeppassfor = 300



# local ".signature" file to append to appropriate messages...

! ### localsignature =

# If set, elm will lock a folder when trying to save or copy to it.
# NOTICE: Does not work with dot-locking
### lock-in-copy = ON



# where to save my mail to, default directory is "Mail"

! ### maildir = /home/people/hurtta/Mail

# permissions to be given to newly-created saved mail files, default rw-------
### mailpermissions = rw-------
--- 411,459 ----
# expire it.
### keeppassfor = 300

+
+ # If set indicates that directory listing not needed for lookup.
+ # Need to be unset, if same character on local-fs-charset has several
+ # repesentations (or encodings).
+ #
+ # See also: local-fs-charset, imap-fast-lookup
+ ### local-fast-lookup = OFF
+
+ # Character set used on local filenames
+ # Special values: SYSTEM character set used by system (from locale)
+ # DISPLAY character set used by terminal
+ # TEXT value of text-charset
+ #
+ # If local-fs-charset is well behaved (no multiple encodings for a
+ # single character), set local-fast-lookup also.
+ # Normally local-fs-charset have value SYSTEM, but sometime it is useful to
+ # set to fixed value.
+ #
+ # See also: allow-charset-switching, local-fast-lookup, displaycharset,
+ # text-charset, page-known-charsets
+ ### local-fs-charset = SYSTEM
+

# local ".signature" file to append to appropriate messages...

! ### localsignature (not set)
!
! # if set, elm will lock a folder, when it is open.
! #
! # NOTICE: It is not possible to deliver mail to a locked folder. So
! # take care that incoming mail folders are treated as mailboxes.
! # This variable does not effect handling of mailboxes.
! #
! # NOTICE: Does not work with dot-locking
! ### lock-folders = ON

# If set, elm will lock a folder when trying to save or copy to it.
# NOTICE: Does not work with dot-locking
### lock-in-copy = ON

+
+

# where to save my mail to, default directory is "Mail"

! ### maildir = /home/hurtta/Mail
!

# permissions to be given to newly-created saved mail files, default rw-------
### mailpermissions = rw-------
***************
*** 174,205 ****
# should we display the three-line 'mini' menu?
### menu = ON

# This tells path of metamail program
#
# That version (Elm 2.4ME+) does not use Metamail's companion programs
# (suchs as mmencode) directly, but metamail package supposes that
# companion programs are installed to search path.
#
! # Special values: none Don't call metamail
! # metamail Don't call metamail if environment
! # variable $NOMETAMAIL is defined
! ### metamail = /usr/freeware/bin/metamail



# would you like a copy of a message you send to an alias you are on?

### metoo = OFF

# This option controls how Elm will forward messages when MIME is defined.
! # ON: Causes Elm to send the message as a MIME attachment of type
! # MESSAGE/RFC822. Highly recommended when forwarding MIME
! # messages so that the receiver can correctly view the message!
! # OFF: Elm will include the forwarded message in your editor instead
! # of making it an attachment.
mimeforward = ON



# when using the page commands (+ - <NEXT> <PREV>) change the current

# message pointer...?
movepage = ON



# just show the names when expanding aliases?

### names = ON

--- 461,530 ----
# should we display the three-line 'mini' menu?
### menu = ON

+ # Should we display host on mailbox menu?
+ ### menu-display-host = OFF
+
+
+ # Possible values: none
+ # FOLDER INTERNAL DATA
+ # If set to FOLDER INTERNAL DATA, hides messages which have
+ # subject DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
+ # and X-IMAP: -header.
+ #
+ # Hiding of mail do not affect to '-z' option -- that option
+ # still sees that mailbox is non-zero size. Also that option do
+ # not effect to any tools of elm. In other words 'frm' shows that
+ # management mail.
+ ### message-hide-hack = none
+
# This tells path of metamail program
#
# That version (Elm 2.4ME+) does not use Metamail's companion programs
# (suchs as mmencode) directly, but metamail package supposes that
# companion programs are installed to search path.
#
! # Special values: none Don't call metamail
! # metamail Don't call metamail if environment
! # variable $NOMETAMAIL is defined
! ### metamail = /usr//bin/metamail
!
! # List of mailcaps for metamail. List may be space or ':' seperated. Separate
! # values may be quoted. When metamail is called values are put to variable
! # $MAILCAPS (as ':' -separated list). metamail-mailcaps may include variables
! # (for example $MAILCAPS). Value of variables is splitted only from ':'
! # (quotes and spaces are not treated specially.)
! # See also: internal-mailcaps
! ### metamail-mailcaps = /home/hurtta/.mailcap /etc/mailcap



# would you like a copy of a message you send to an alias you are on?

### metoo = OFF

+ # If TRUE detect following keywords from mail (when sending it):
+ # [clear]
+ # [encode]
+ # [no save]
+ # [nosave]
+ # [include
+ # [[ (incidate line starting with [ )
+ # Unknown keywords gives error
+ ### mimebodykeywords = ON
+
# This option controls how Elm will forward messages when MIME is defined.
! # ON: Causes Elm to send the message as a MIME part of type
! # MESSAGE/RFC822. Highly recommended when forwarding MIME
! # messages so that the receiver can correctly view the message!
! # OFF: Elm will include the forwarded message in your editor instead
! # of making it an separate mime body part.
! #
! # See also: askmimeforward
mimeforward = ON



# when using the page commands (+ - <NEXT> <PREV>) change the current

# message pointer...?


movepage = ON

+
+

# just show the names when expanding aliases?

### names = ON

***************
*** 246,256 ****
### noheader = ON



# when messages are copied into the outbound buffer, don't include headers?

! # when forwarding
# (Notice that messages are not copiend to outbound buffer when
# mimeworward = ON)
### noheaderfwd = OFF

# Should Elm use "pager" for display one part of multipart/alternative,
# if there are found one part which can be displayed. If not
# set, Elm uses "pager" for display one part of multipart/alternative,
--- 571,591 ----
### noheader = ON



# when messages are copied into the outbound buffer, don't include headers?

! # when forwarding
# (Notice that messages are not copiend to outbound buffer when
# mimeworward = ON)
### noheaderfwd = OFF

+
+ # Should Elm use "pager" to display charsets (other than display charset)
+ # if charset is known (ie. it probably can be converted to display charset).
+ # This should be set, if mapping information is given to elm and metapager
+ # can not do better.
+ #
+ # See also: allow-charset-switching, displaycharset, charset-convert-ok,
+ # auto-attachment
+ ### page-known-charsets = ON
+
# Should Elm use "pager" for display one part of multipart/alternative,
# if there are found one part which can be displayed. If not
# set, Elm uses "pager" for display one part of multipart/alternative,
***************
*** 259,278 ****

# Should Elm use "pager" to display MIME multipart messages
# with unknown subparts or with unknown subtype?
### pagemultipart = OFF



# program to use for displaying messages ('builtin' is recommended)

pager = builtin

! # What is the path for pgp?
# Possible values include:
! # none Don't call pgp
! # /path Call metamail via that path, if it is executable
! pgp = /usr/local/pgp/bin/pgp



# start up by pointing to the first new message received, if possible?

### pointnew = ON



# list of delivery precedences allowed, or empty to allow anything

# precedence may be followed by optional ":priority" specification

### precedences =
--- 594,650 ----

# Should Elm use "pager" to display MIME multipart messages
# with unknown subparts or with unknown subtype?
+ #
+ # See also: auto-attachment
### pagemultipart = OFF



# program to use for displaying messages ('builtin' is recommended)

pager = builtin

! # Should Elm use "pager" to display MIME multipart/signed
! # with unknown signing protocol ?
! ### pagesigned = OFF
!
!
! # Run pgp/gpg signing and encryption always on interactive mode
! ### pgp-interactive = OFF
!
! # Specifies content-type for pgp signed messages.
! # Possible values are: application/pgp, text/plain, text/x-pgp
! ### pgp-sign-type = application/pgp
!
! # What pgp use on sending of mail: pgp2, pgp5, gpg
! ### pgp-version = pgp2
!
! # What is the path for pgp 2?
# Possible values include:
! # none Don't call pgp
! # /path Call pgp via that path, if it is executable
! pgp2 = /usr/local/pgp/bin/pgp
!
! # What is the directory path for pgp 5 binaries?
! # Possible values include:
! # none Don't call pgp
! # /path Call pgp binaries from that directiry
! ### pgp5-dir = none



# start up by pointing to the first new message received, if possible?

### pointnew = ON

+
+ # maximum size of message on bytes which is downloaded by POP
+ # when mailbox is parsed. If POP server does not support TOP
+ # command, all messages are downloaded.
+ #
+ # Value -1 for pop-max-download-size causes all messages to be downloaded.
+ # ! character as second letter on message status indicates that message
+ # is not downloaded.
+ # See also: imap-max-download-size
+ ### pop-max-download-size = 4096
+
+ # Show server greeting?
+ ### pop-show-greeting = ON
+

# list of delivery precedences allowed, or empty to allow anything

# precedence may be followed by optional ":priority" specification

### precedences =
***************
*** 283,306 ****


# how to print a message ('%s' is the filename)

print = mpage -o2p -Parth7bw %s



# prompt for a command after the external pager exits?

! ### promptafter = ON



# Forwarded messages are quoted like replies, rather than included

# with "Forwarded message" and "End of forwarded message" banners
! # above and below. This don't have effect if "mimeforward" is TRUE.
### quoteforward = OFF



# Value by which message count is incremented while reading a new mailbox.

# Setting this value to a number larger than one will speed up the time it

# takes to read a large mailbox when using a slow terminal.

readmsginc = 25



# where to save received messages to, default file is "=received"

### receivedmail = =received



# remote ".signature" file to append to appropriate messages...

! ### remotesignature =

# If set MIME Part 1 (RFC 1521) decoding is only done when MIME-version
# header is present. Default: True
--- 655,691 ----


# how to print a message ('%s' is the filename)

print = mpage -o2p -Parth7bw %s

+
+ # prompt after the metamail exits?
+ ### prompt-after-metamail = ON
+

# prompt for a command after the external pager exits?

! ### prompt-after-pager = ON
!
!


# Forwarded messages are quoted like replies, rather than included

# with "Forwarded message" and "End of forwarded message" banners
! # above and below. This has no effect if "mimeforward" is TRUE.
### quoteforward = OFF

+ # Value by which percent count is incremented while reading a new mailbox.
+ # Actual increments depends both of readdatapercentinc and readmsginc
+ # See also: readmsginc
+ ### readdatapercentinc = 5
+

# Value by which message count is incremented while reading a new mailbox.

# Setting this value to a number larger than one will speed up the time it

# takes to read a large mailbox when using a slow terminal.

+ # Actual increments depends both of readdatapercentinc and readmsginc
+ # See also: readdatapercentinc
readmsginc = 25



# where to save received messages to, default file is "=received"

### receivedmail = =received



# remote ".signature" file to append to appropriate messages...

! ### remotesignature (not set)

# If set MIME Part 1 (RFC 1521) decoding is only done when MIME-version
# header is present. Default: True
***************
*** 315,330 ****
--- 700,731 ----
# as opposed to simply each time something is touched)?
### resolve = ON

+
+

# save messages, incoming and outbound, by login name of sender/recipient?

### savename = ON

+
+ # When set, Text/Plain with charset US-ASCII is sent with MIME headers.
+ # When unset, MIME headers are not included to plain US-ASCII text messages
+ # when content-transfer-encoding is 7bit (identity). Default: True
+ ### send-mime-plain-text = ON
+

# where to save copies of outgoing mail to, default file is "=sent"

### sentmail = =sent

+ # Enables automatic updating of window's tile and incon name when
+ # folder is changed. File ~/.elm/terminal.info or global elm.terminalinfo
+ # must specify chnaging method used for given terminal.
+ ### set-window-title = OFF
+
# The shell to use for shell escapes
# If not set value from passwd is used
### shell = $SHELL

+ # if this variable is ON, show certain header errors
+ ### show-header-errors = ON
+
# if this variable is ON, display text before PGP armor.
### showpgppreamble = ON

***************
*** 335,346 ****


# do we want dashes above signatures? (News 2.11 compatibility and convention)

### sigdashes = ON



# time in seconds which Elm will wait after displaying a transient message

# and before erasing it. Can be 0 or positive integer.

### sleepmsg = 2



# how to sort folders, "Reverse Sent" by default

! sortby = Reverse-Sent

# Set the main prompt timeout for resynching...
### timeout = 600
--- 736,776 ----


# do we want dashes above signatures? (News 2.11 compatibility and convention)

### sigdashes = ON

+ # ".signature" file to append to outbound messages...
+

# time in seconds which Elm will wait after displaying a transient message

# and before erasing it. Can be 0 or positive integer.

### sleepmsg = 2

+
+
+ # What is maximum time in days between mails so that
+ # they can considered to be same thread (when subject is same)
+ ### sort-thread-max-time = 30
+

# how to sort folders, "Reverse Sent" by default

! sortby = reverse-sent
!
!
! # Name of Character Set used with MIME text/plain Content-type
! # - Special value DISPLAY means that Character Set used in content-type
! # is same than used by terminal
! # - Special value SYSTEM means that Character Set used in content-type
! # is same than used by system (locale charset)
! # - Text of current used display Character Set is converted to
! # that Character Set
! # NOTICE thar both displaycharset and text-charset must have know,
! # and both Character Set must have mapping tables available, otherwise
! # conversion fails (and produces no output) !
! #
! # So this variable should almost always have value DISPLAY
! # Other useful values are UTF-7 and perhaps UTF-8 (however
! # UTF-7 is better encoding of Unicode for Mail than UTF-8)
! #
! # See also: displaycharset, local-fs-charset, allow-charset-switching,
! # utf7-encode-optional
! text-charset = DISPLAY
!

# Set the main prompt timeout for resynching...
### timeout = 600
***************
*** 349,355 ****
### titles = ON



# where to place temporary files, default directory is "/tmp"

! ### tmpdir = /usr/tmp/

# If ON, Elm will prompt you for your PGP passphrase and use it whenever
# necessary to make it more convenient to hand PGP messages.
--- 779,811 ----
### titles = ON



# where to place temporary files, default directory is "/tmp"

! #
! # See also: local-sessionlock-dir
! ### tmpdir = /tmp/
!
! # Binary unidata file, filename can be
! # filename File is read from directory
! # given on map-bin-dir directory
! # (normally $lib/elm.map.bin)
! # {rc}/filename File is readed from .elm subdirectory
! # of user's home
! # ~/filename File is readed from user's home
! # directory
! # See also: map-bin-dir
! ### unidata = unidata.bin
!
! # Specify tags for shared libraries, which should be loaded.
! ### use-base-library = iconv
!
! # Specify tags for shared libraries, which should be loaded.
! ### use-connect-library = smtp tls
!
! # Specify tags for shared libraries, which should be loaded.
! # These libraries are loaded on startup and relocated to variables
! # use-base-library and use-connect-library
! #
! # See also: use-base-library, use-connect-library
! ### use-library =

# If ON, Elm will prompt you for your PGP passphrase and use it whenever
# necessary to make it more convenient to hand PGP messages.
***************
*** 358,371 ****
# are we good at it? beginner (0), intermediate (1), expert (2)
userlevel = intermediate



# would you like to use termcap/terminfo ti/te entries?

### usetite = ON

# name of editor for ~v command (when editor="builtin")
! ### visualeditor = /bin/vi


# enable the weedout list to be read?

### weed = ON



# what headers I DON'T want to see, ever.

! ### weedout = "*end-of-user-headers*"
--- 814,850 ----
# are we good at it? beginner (0), intermediate (1), expert (2)
userlevel = intermediate

+

# would you like to use termcap/terminfo ti/te entries?

### usetite = ON

+ # Should UTF-7 'optional direct characters' utf-7 encoded?
+ # Optional direct characters are:
+ # ! " # $ % & * ; < = > @ [ ] ^ _ ' { | }
+ # See also: text-charset
+ ### utf7-encode-optional = ON
+
# name of editor for ~v command (when editor="builtin")
! ### visualeditor = /usr//bin/vi


# enable the weedout list to be read?

### weed = ON



# what headers I DON'T want to see, ever.

! #
! # If first element on list is "*clear-weed-list*" then builtin
! # weedout list is not used.
! ### weedout =
!
! # Options for iconv section (shared library)
! #
!
! iconv:
! ### auto-charset = OFF
!
! # Options for tls section (shared library)
! #
!
! tls:
! ### rand-egd = none
! ### rand-file = /home/hurtta/.rnd
Index: elm2.4.ME+.118-cvs/doc/terminal.info
*** elm2.4.ME+.117/doc/terminal.info 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.118-cvs/doc/terminal.info 2004-07-20 18:35:31.000000000 +0300
***************
*** 59,72 ****
# working font for *-iso8859-1
kterm ISO-2022 ISO-8859-1

! # These are for Linux Mandrake 7.1
#
! # Following does not work, to geto these work change on /etc/profile.d/lang.sh
# unset SYSFONTACM SYSFONT
# to
# unset SYSFONT
# export SYSFONTACM
! # Also remove following from /etc/profile.d/lang.csh
# unsetenv SYSFONTACM
#
# That assumes that /etc/rc.d/rc.sysinit sets default font and loads translation table ($SYSFONTACM)
--- 59,75 ----
# working font for *-iso8859-1
kterm ISO-2022 ISO-8859-1

! # These are for Linux Mandrake 7.1 and 9.0
#
! # Following does not work, to geto these work change on
! # /etc/profile.d/lang.sh (Mandrake 7.1)
! # or /etc/profile.d/10lang.sh (Mandrake 9.0)
# unset SYSFONTACM SYSFONT
# to
# unset SYSFONT
# export SYSFONTACM
! # Also remove following from /etc/profile.d/lang.csh (Mandrake 7.1)
! # or /etc/profile.d/10lang.csh (Mandrake 9.0)
# unsetenv SYSFONTACM
#
# That assumes that /etc/rc.d/rc.sysinit sets default font and loads translation table ($SYSFONTACM)
Index: elm2.4.ME+.118-cvs/hdrs/defs.h
*** elm2.4.ME+.117/hdrs/defs.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/hdrs/defs.h 2004-07-11 20:44:51.000000000 +0300
***************
*** 1,7 ****


! /* $Id: defs.h,v 1.47 2004/06/20 18:03:06 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: defs.h,v 1.49 2004/07/11 17:44:51 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 65,70 ****
--- 65,72 ----


#define READCH_NOCURSOR 0x2000 /* Disable cursor keys */

#define READCH_term_char 0x4000 /* Return term chars */

#define READCH_resize 0x8000 /* Check resize .... */

+ #define READCH_sig_char 0x10000 /* Return sig chars */
+ #define READCH_quote 0x20000 /* Try quote next control character */



#define REDRAW_MARK 257 /* Artificial "char" for redrawing */

#define UP_MARK 258 /* Artificial UP key */

Index: elm2.4.ME+.118-cvs/hdrs/elm.h
*** elm2.4.ME+.117/hdrs/elm.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.118-cvs/hdrs/elm.h 2004-07-11 14:36:07.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elm.h,v 1.22 2004/03/27 18:31:35 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: elm.h,v 1.23 2004/07/11 11:36:07 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 76,89 ****


char *saved_word; /* saved */

char *copied_word; /* copied */

- char backspace, /* the current backspace char */
-
- kill_line, /* the current kill-line char */

- word_erase, /* the current word-erase char */
- interrupt_char, /* the current interrupt char */
- reprint_char, /* the current reprint-line char */
- eof_char; /* the current end-of-file char */


-
int has_highlighting = FALSE; /* highlighting available? */


--- 76,81 ----
Index: elm2.4.ME+.118-cvs/hdrs/elmlib.h
*** elm2.4.ME+.117/hdrs/elmlib.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/hdrs/elmlib.h 2004-07-12 20:48:38.000000000 +0300
***************
*** 1,7 ****


! /* $Id: elmlib.h,v 1.215 2004/06/27 15:18:05 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.215 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.216 2004/07/12 17:48:38 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.216 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 2273,2278 ****
--- 2273,2300 ----



extern void free_string_tokenized P_((struct string_token **ptr));

+

+ /* cancel.c */
+
+ typedef void cancel_set_ttysig_f P_(());
+ typedef void cancel_reset_ttysig_f P_(());
+ typedef void cancel_transient_f P_((struct string *x));
+ typedef void cancel_clear_f P_((void));
+
+ extern void setup_cancel_cb P_((cancel_set_ttysig_f *cancel_set_ttysig,
+ cancel_reset_ttysig_f *cancel_reset_ttysig,
+ cancel_transient_f *cancel_transient,
+ cancel_clear_f *cancel_clear));
+
+ extern struct chancel_data * new_cancel P_((const char * format,
+ const char *msg, ...));
+
+
+ extern int is_canceled P_((struct chancel_data *cd));
+
+ extern void free_cancel P_((struct chancel_data **cd));


+
+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.118-cvs/hdrs/headers.h
*** elm2.4.ME+.117/hdrs/headers.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.118-cvs/hdrs/headers.h 2004-07-11 14:36:07.000000000 +0300
***************
*** 1,7 ****
! /* $Id: headers.h,v 1.25 2004/05/19 11:52:30 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: headers.h,v 1.26 2004/07/11 11:36:07 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 59,72 ****

extern char *saved_word; /* saved */

extern char *copied_word; /* copied */

- extern char backspace, /* the current backspace char */
-
- kill_line, /* the current kill_line char */
- word_erase, /* the current word-erase char */
- interrupt_char, /* the current interrupt char */
- reprint_char, /* the current reprint-line char */
- eof_char; /* the current end-of-file char */
-

extern int has_highlighting; /* highlighting available? */

extern int write_elmrc; /* flag: write elmrc in starting */

--- 59,64 ----
Index: elm2.4.ME+.118-cvs/hdrs/me.h
*** elm2.4.ME+.117/hdrs/me.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/hdrs/me.h 2004-07-21 13:04:32.000000000 +0300
***************
*** 1,7 ****


! /* $Id: me.h,v 1.92 2004/06/18 20:40:56 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.92 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.97 2004/07/21 10:04:32 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.97 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 122,128 ****
#define PROMPT_center 1
#define PROMPT_yesno 2
#define PROMPT_redraw_mark 4
! #define PROMTP_ctrlL 8



extern int prompt_letter P_((int line, char *letters, int def,

int flags,
--- 122,129 ----
#define PROMPT_center 1
#define PROMPT_yesno 2
#define PROMPT_redraw_mark 4
! #define PROMPT_ctrlL 8
! #define PROMPT_cancel 16



extern int prompt_letter P_((int line, char *letters, int def,

int flags,
***************
*** 138,143 ****
--- 139,145 ----
#define OE_ALLOW_MIMEENC (1<<5)
#define OE_EDITOR_ESCAPE (1<<6)
#define OE_TABACTION (1<<7)
+ #define OE_SIG_CHAR (1<<8)

extern int optionally_enter2 P_((struct menu_context *page,
struct string **buffer,
***************
*** 304,309 ****
--- 306,317 ----
/* a_quit.c */

extern void exit_alias P_((struct AliasView *aview));
+
+
+ /* Return 1 Aliases were deleted
+ * newalias Aliases were not deleted
+ * -1 Interrupted witn Ctrl-C
+ */
extern int delete_aliases P_((int newaliases, int prompt,


struct AliasView *aview,
struct menu_context * page));

***************
*** 825,831 ****

/* encode.c */

! extern void getkey P_((int send));
extern void get_key_no_prompt P_((void));
extern void encode P_((char *line));
extern void makekey P_((char *rkey));
--- 833,843 ----

/* encode.c */

! /* 0 == failure
! 1 == OK
! -1 == Ctrl-C */
! extern int getkey P_((int send));
!
extern void get_key_no_prompt P_((void));
extern void encode P_((char *line));
extern void makekey P_((char *rkey));
***************
*** 932,938 ****
enum word_sel { word_change, word_save, word_copy, word_save_copy,
word_read };

! extern void gen_browser P_((struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
int *redraw,
--- 944,950 ----
enum word_sel { word_change, word_save, word_copy, word_save_copy,
word_read };

! extern int gen_browser P_((struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
int *redraw,
***************
*** 1149,1154 ****
--- 1161,1170 ----
int flags));


+ extern void cancel_set_ttysig_X P_(());
+ extern void cancel_reset_ttysig_X P_(());
+
+
/* ------------------------------------------------------- */

extern void Writechar P_((int ch));
Index: elm2.4.ME+.118-cvs/hdrs/melib.h
*** elm2.4.ME+.117/hdrs/melib.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.118-cvs/hdrs/melib.h 2004-07-20 21:33:02.000000000 +0300
***************
*** 1,7 ****
! /* $Id: melib.h,v 1.43 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! /* $Id: melib.h,v 1.44 2004/07/20 18:33:02 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 348,354 ****


/* --------------- */

/* mime_decode.c uses this ... */

! extern void getkey P_((int send));
extern void encode P_((char *line));

/*
--- 348,354 ----


/* --------------- */

/* mime_decode.c uses this ... */

! extern int getkey P_((int send));
extern void encode P_((char *line));

/*
Index: elm2.4.ME+.118-cvs/hdrs/menu2.h
*** elm2.4.ME+.117/hdrs/menu2.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.118-cvs/hdrs/menu2.h 2004-07-13 23:31:30.000000000 +0300
***************
*** 1,7 ****
! /* $Id: menu2.h,v 1.5 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: menu2.h,v 1.6 2004/07/13 20:31:30 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,27 ****
int size;
};

! extern void generic_menu P_((struct menu_item items[], int max,
char *prompt, char *title));


--- 21,27 ----
int size;
};

! extern int generic_menu P_((struct menu_item items[], int max,
char *prompt, char *title));


Index: elm2.4.ME+.118-cvs/hdrs/s_me.h
*** elm2.4.ME+.117/hdrs/s_me.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.118-cvs/hdrs/s_me.h 2004-07-12 20:48:39.000000000 +0300
***************
*** 331,333 ****
--- 331,335 ----
#define MeDecodeUseOtoOverride 0x15f
#define MeSuboptimalInElmrc 0x160
#define MeUUDECODECorrupt 0x161
+ #define MeCanceled 0x162
+ #define MeConnectCanceled 0x163
Index: elm2.4.ME+.118-cvs/lib/cancel.c
*** /tmp/1444-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-21 14:45:25.000000000 +0300
--- elm2.4.ME+.118-cvs/lib/cancel.c 2004-07-12 20:48:39.000000000 +0300
***************
*** 0 ****
--- 1,253 ----
+ static char rcsid[] = "@(#)$Id: cancel.c,v 1.2 2004/07/12 17:48:39 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+
+
+ #include "headers.h"
+ #include "s_me.h"
+
+ DEBUG_VAR(Debug,__FILE__,"ui");
+
+ static void cancel_set_ttysig_d()
+ {
+ /* NULL */
+ }
+
+ static cancel_set_ttysig_f * SET_TTYSIG = &cancel_set_ttysig_d;
+
+ static void cancel_reset_ttysig_d()
+ {
+ /* NULL */
+ }
+
+ static cancel_reset_ttysig_f * RESET_TTYSIG = &cancel_reset_ttysig_d;
+
+ static void cancel_transient_d(x)
+ struct string *x;
+ {
+ lib_transient(FRM("%S"),x);
+ }
+
+ static cancel_transient_f * TRANSIENT = &cancel_transient_d;
+
+ static void cancel_clear_d()
+ {
+ lib_transient(FRM(""));
+ }
+
+ static cancel_clear_f * CLEAR = &cancel_clear_d;
+
+ extern void setup_cancel_cb(cancel_set_ttysig,cancel_reset_ttysig,
+ cancel_transient,cancel_clear)
+ cancel_set_ttysig_f *cancel_set_ttysig;
+ cancel_reset_ttysig_f *cancel_reset_ttysig;
+ cancel_transient_f *cancel_transient;
+ cancel_clear_f *cancel_clear;
+ {
+ SET_TTYSIG = cancel_set_ttysig;
+ RESET_TTYSIG = cancel_reset_ttysig;
+ TRANSIENT = cancel_transient;
+ CLEAR = cancel_clear;
+ }
+
+ #define CANCEL_magic 0xF903
+
+ struct chancel_data {
+ unsigned short magic; /* CANCEL_magic */
+
+ struct string *msg;
+ VOLATILE int is_canceled;
+ struct chancel_data * previous;
+
+ } * new_cancel P_((const char * format, const char *msg, ...));
+
+ static struct chancel_data * VOLATILE current = NULL;
+
+ #ifdef POSIX_SIGNALS
+ static struct sigaction saved_state;
+ static int state_set = 0;
+
+ static void SA_HANDLER P_((int sig));
+ static void SA_HANDLER(sig)
+ int sig;
+ {
+ SIGDPRINT(Debug,1,(&Debug,"Got SIGINT ...\n"));
+
+ if (!current) {
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "SA_HANDLER",
+ "current pointer is not set",1);
+ return;
+ }
+
+ if (CANCEL_magic != current->magic)
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "SA_HANDLER",
+ "Bad current pointer",1);
+
+ current->is_canceled = 1;
+ }
+
+ #endif
+
+ struct chancel_data * new_cancel (
+ #if ANSI_C


+ const char * format,

+ const char *msg,
+ ...
+ #else
+ format,msg, va_alist


+ #endif
+ )
+ #if !ANSI_C

+ CONST char * format;
+ CONST char *msg;
+ va_dcl
+ #endif
+ {

+ va_list vl;
+
+ struct string *store;
+ struct chancel_data *ret;


+
+ Va_start(vl, msg); /* defined in defs.h */
+

+ store = elm_smessage(160,format,msg,vl);
+
+ va_end(vl);
+
+ TRANSIENT(store);
+
+ ret = safe_malloc(sizeof (*ret));
+
+ bzero((void *)ret,sizeof (*ret));
+
+ ret->magic = CANCEL_magic;
+ ret->msg = store;
+ ret->is_canceled = 0;
+ ret->previous = NULL;
+
+ if (current) {
+ if (CANCEL_magic != current->magic)
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "new_cancel",
+ "Bad current pointer",0);
+
+ ret->previous = current;
+ } else {
+ #ifdef POSIX_SIGNALS
+ struct sigaction act;
+
+ bzero((void *)&act,sizeof (act));
+
+ act.sa_handler = &SA_HANDLER;
+ sigemptyset(&(act.sa_mask)); /* No signal to mask while in handler */
+ act.sa_flags = 0;
+ #ifdef SA_INTERRUPT
+ act.sa_flags |= SA_INTERRUPT; /* SunOS */
+ #endif
+
+ state_set = 0;
+ bzero((void *)&saved_state,sizeof (saved_state));
+
+ current = ret;
+
+ if (0 == sigaction(SIGINT,&act,&saved_state)) {
+ DPRINT(Debug,10,(&Debug,"SIGINT handler installed\n"));
+ state_set = 1;
+ } else {
+ DPRINT(Debug,10,(&Debug,"Failed to set SIGINT handler\n"));
+ }
+
+ #endif
+ SET_TTYSIG();
+ }
+ current = ret;


+
+ return ret;
+ }
+

+
+ int is_canceled(cd)
+ struct chancel_data *cd;
+ {
+ int ret;
+ if (CANCEL_magic != cd->magic)
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "is_canceled",
+ "Bad pointer (magic)",0);
+
+ ret = cd->is_canceled;
+ if (ret) {
+ struct string * X =
+ format_string(CATGETS(elm_msg_cat, MeSet, MeCanceled,
+ "%S canceled"),
+ cd->msg);
+ TRANSIENT(X);
+ free_string(&X);


+ }
+ return ret;
+ }
+

+ void free_cancel(cd)
+ struct chancel_data **cd;
+ {
+ struct chancel_data *x = *cd;
+
+ if (CANCEL_magic != x->magic)
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "free_cancel",
+ "Bad pointer (magic)",0);
+
+ if (current != x)
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "free_cancel",
+ "pointer not current",0);
+
+ if (x->previous &&
+ CANCEL_magic != x->previous->magic)
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "free_cancel",
+ "bad previous pointer",0);
+
+ if (x->previous) {
+ TRANSIENT(x->previous->msg);
+ } else {
+ RESET_TTYSIG();
+ CLEAR();
+
+ #ifdef POSIX_SIGNALS
+ if (!state_set) {
+ DPRINT(Debug,10,(&Debug,"SIGINT was not handler installed\n"));
+ } else if (0 == sigaction(SIGINT,&saved_state,NULL)) {
+ DPRINT(Debug,10,(&Debug,"SIGINT handler is reset\n"));
+ } else {
+ DPRINT(Debug,1,(&Debug,"failed to reset SIGINT handler\n"));
+ }
+ state_set = 1;
+ #endif
+ }
+
+ current = x->previous;
+
+ free_string (& (x->msg) );
+ x->magic = 0;
+ free(x);
+ x = NULL;
+
+ *cd = x;
+ }
+
+
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4

+ * buffer-file-coding-system: iso-8859-1


+ * End:
+ */

Index: elm2.4.ME+.118-cvs/lib/MAGIC
*** elm2.4.ME+.117/lib/MAGIC 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/lib/MAGIC 2004-07-12 20:48:39.000000000 +0300
***************
*** 23,28 ****
--- 23,29 ----
#define SHARED_LOADER_magic 0xF900
#define SHARED_CONNECT_magic 0xF901
#define SHARED_BASE_magic 0xF902
+ #define CANCEL_magic 0xF903
#define RF_magic 0xFA00
#define UNIDATA_magic 0xFB00
#define BINDATA_magic 0xFB01
Index: elm2.4.ME+.118-cvs/lib/mail_gets.c
*** elm2.4.ME+.117/lib/mail_gets.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/lib/mail_gets.c 2004-07-19 22:39:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.9 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.10 2004/07/19 19:39:47 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 34,40 ****

if (ch == EOF) {

! if (line_bytes > 0 && *c != '\n') {
++line_bytes;
*c++ = '\n';
}
--- 34,40 ----

if (ch == EOF) {

! if (line_bytes > 0 && *(c-1) != '\n') {
++line_bytes;
*c++ = '\n';
}
Index: elm2.4.ME+.118-cvs/lib/Makefile.SH
*** elm2.4.ME+.117/lib/Makefile.SH 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.118-cvs/lib/Makefile.SH 2004-07-12 20:48:39.000000000 +0300
***************
*** 46,52 ****
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.89 2004/03/28 13:37:39 hurtta Exp $


#
# Makefile for the ELM mail program.
#

--- 46,52 ----
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.90 2004/07/12 17:48:39 hurtta Exp $


#
# Makefile for the ELM mail program.
#

***************
*** 147,152 ****
--- 147,153 ----
mk_lockname.c \
can_access.c \
can_open.c \
+ cancel.c \
chloc.c \
charset.c \
precompiled_sets.c \
***************
*** 245,250 ****
--- 246,252 ----
mk_lockname.o \
can_access.o \
can_open.o \
+ cancel.o \
chloc.o \
charset.o \
precompiled_sets.o \
***************
*** 406,411 ****
--- 408,414 ----
mk_lockname.o: $(INCLDIR)/headers.h
can_access.o: $(INCLDIR)/headers.h
can_open.o: $(INCLDIR)/headers.h
+ cancel.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h
chloc.o: $(INCLDIR)/headers.h


charset.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/shared_imp.h

Index: elm2.4.ME+.118-cvs/lib/mediatype.c
*** elm2.4.ME+.117/lib/mediatype.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.118-cvs/lib/mediatype.c 2004-07-19 22:39:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.13 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.14 2004/07/19 19:39:47 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 211,218 ****
(major_type_count+1) *
sizeof (major_type_list[0]));

! major_type_list[major_type_count].name = safe_strdup(major);
! major_type_list[major_type_count].list = NULL;

major_type_list[major_type_count].handles = NULL;
major_type_list[major_type_count].handle_count = 0;
--- 211,219 ----
(major_type_count+1) *
sizeof (major_type_list[0]));

! major_type_list[major_type_count].name = safe_strdup(major);
! major_type_list[major_type_count].list = NULL;
! major_type_list[major_type_count].flags = 0;

major_type_list[major_type_count].handles = NULL;
major_type_list[major_type_count].handle_count = 0;
Index: elm2.4.ME+.118-cvs/lib/output.c
*** elm2.4.ME+.117/lib/output.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.118-cvs/lib/output.c 2004-07-12 20:48:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: output.c,v 1.32 2004/03/27 18:31:40 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: output.c,v 1.33 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1352,1363 ****
}


! int lib_transient P_((CONST char * format, CONST char *msg, ...));

int lib_transient (
#if ANSI_C
! CONST char * format,
! CONST char *msg, ...
#else
format, msg, va_alist
#endif
--- 1352,1363 ----
}


! int lib_transient P_((const char * format, const char *msg, ...));

int lib_transient (
#if ANSI_C


! const char * format,

! const char *msg, ...
#else
format, msg, va_alist
#endif
Index: elm2.4.ME+.118-cvs/lib/rc_handle.c
*** elm2.4.ME+.117/lib/rc_handle.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/lib/rc_handle.c 2004-07-20 18:35:31.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.27 2004/06/18 09:29:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.29 2004/07/20 15:35:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************
***************

*** 1449,1455 ****
dt_PATH_parse_line, dt_PATH_parse_cline,
dt_PATH_print_value, NO_get_value };

-
#ifdef ANSI_C
static rc_parse_line dt_OBS_parse_line;
#endif
--- 1449,1454 ----
Index: elm2.4.ME+.118-cvs/lib/remote_mbx.c
*** elm2.4.ME+.117/lib/remote_mbx.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.118-cvs/lib/remote_mbx.c 2004-07-12 20:48:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.50 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.51 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 277,287 ****


static int connect_one_IN P_((struct remote_account *ra,
! int *cur_socket, int *last_error));
! static int connect_one_IN(ra,cur_socket,last_error)
struct remote_account *ra;
int *cur_socket;
int *last_error;
{
int r = 0;

--- 277,289 ----


static int connect_one_IN P_((struct remote_account *ra,
! int *cur_socket, int *last_error,
! struct chancel_data *can));
! static int connect_one_IN(ra,cur_socket,last_error,can)
struct remote_account *ra;
int *cur_socket;
int *last_error;
+ struct chancel_data *can;


{
int r = 0;

***************

*** 319,324 ****
--- 321,328 ----
"connect_one_IN: socket=%d\n",(*cur_socket)));
}

+ retry:
+
if (-1 == connect((*cur_socket),& (ra->hostaddr.sa),
sizeof (ra->hostaddr.sin))) {
(*last_error) = errno;
***************
*** 351,356 ****
--- 355,372 ----
} else
r = 1;
}
+
+ if (0 == r && EINTR == errno) {
+
+ if (is_canceled(can)) {
+ DPRINT(Debug,12,(&Debug,"connect canceled...\n"));
+ r = -1;
+ } else {
+ DPRINT(Debug,12,(&Debug,"Retrying connect...\n"));


+ goto retry;
+ }
+

+ }
} else
r = 1;

***************
*** 377,383 ****
int last_error = 0;
int cur_socket = -1;
int prev_family = AF_UNSPEC;
!
int idx;

if(ra->stream) {
--- 393,400 ----
int last_error = 0;
int cur_socket = -1;
int prev_family = AF_UNSPEC;
! int was_canceled = 0;
!
int idx;

if(ra->stream) {
***************
*** 407,419 ****
switch (ra->hostaddr.sa.sa_family) {
int r;
#ifdef I_NETINET_IN
! case AF_INET:

! lib_transient(CATGETS(elm_msg_cat, MeSet,MeConnecting,
! "Connecting to %s [%s]... (%d)"),
! se->official_name,
! inet_ntoa(ra->hostaddr.sin.sin_addr),
! idx);

/* r == 0: not succeed
r < 0: fatal error
--- 424,437 ----
switch (ra->hostaddr.sa.sa_family) {
int r;
#ifdef I_NETINET_IN
! case AF_INET: {

! struct chancel_data *
! can = new_cancel(CATGETS(elm_msg_cat, MeSet,MeConnecting,
! "Connecting to %s [%s]... (%d)"),
! se->official_name,
! inet_ntoa(ra->hostaddr.sin.sin_addr),
! idx);

/* r == 0: not succeed
r < 0: fatal error
***************
*** 424,430 ****
if (ra->hostaddr.sin.sin_port != htons(PORT_end)) {
DPRINT(Debug,11,(&Debug,"-- address record gives port %d\n",
ntohs(ra->hostaddr.sin.sin_port)));
! r = connect_one_IN(ra,&cur_socket,&last_error);
if (r > 0)
*got = ntohs(ra->hostaddr.sin.sin_port);
} else if (se->port_count > 0) {
--- 442,448 ----
if (ra->hostaddr.sin.sin_port != htons(PORT_end)) {
DPRINT(Debug,11,(&Debug,"-- address record gives port %d\n",
ntohs(ra->hostaddr.sin.sin_port)));
! r = connect_one_IN(ra,&cur_socket,&last_error,can);
if (r > 0)
*got = ntohs(ra->hostaddr.sin.sin_port);
} else if (se->port_count > 0) {
***************
*** 436,442 ****
for (idx2 = 0; idx2 < se->port_count && 0 == r; idx2++) {
ra->hostaddr.sin.sin_port =
htons(se->port_list[idx2]);
! r = connect_one_IN(ra,&cur_socket,&last_error);
if (r > 0)
*got = se->port_list[idx2];
}
--- 454,460 ----
for (idx2 = 0; idx2 < se->port_count && 0 == r; idx2++) {
ra->hostaddr.sin.sin_port =
htons(se->port_list[idx2]);
! r = connect_one_IN(ra,&cur_socket,&last_error,can);
if (r > 0)
*got = se->port_list[idx2];
}
***************
*** 451,457 ****

ra->hostaddr.sin.sin_port =
htons(default_portlist[idx2]);
! r = connect_one_IN(ra,&cur_socket,&last_error);
if (r > 0)
*got = default_portlist[idx2];
}
--- 469,475 ----

ra->hostaddr.sin.sin_port =
htons(default_portlist[idx2]);
! r = connect_one_IN(ra,&cur_socket,&last_error,can);
if (r > 0)
*got = default_portlist[idx2];
}
***************
*** 479,485 ****
inet_ntoa(ra->hostaddr.sin.sin_addr),
*got);
}
! }
break;
#endif
default:
--- 497,508 ----
inet_ntoa(ra->hostaddr.sin.sin_addr),
*got);
}
! }
!
! was_canceled = is_canceled(can);
! free_cancel(&can);
!
! }
break;
#endif
default:
***************
*** 506,514 ****
cur_socket = -1;
}

! lib_error(CATGETS(elm_msg_cat, MeSet,MeConnectFailed,
! "Failed to connect %s: %s"),
! se->official_name,error_description(last_error));
ok = 0;
goto clean;
}
--- 529,542 ----
cur_socket = -1;
}

! if (was_canceled)
! lib_error(CATGETS(elm_msg_cat, MeSet,MeConnectCanceled,
! "Connect %s canceled."),
! se->official_name);
! else
! lib_error(CATGETS(elm_msg_cat, MeSet,MeConnectFailed,
! "Failed to connect %s: %s"),
! se->official_name,error_description(last_error));
ok = 0;
goto clean;
}
Index: elm2.4.ME+.118-cvs/lib/syscall.c
*** elm2.4.ME+.117/lib/syscall.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/lib/syscall.c 2004-07-12 20:48:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.12 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.13 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 18,24 ****
#include "headers.h"
#include "s_elm.h"

! DEBUG_VAR(Debug,__FILE__,"mailer");

#include <errno.h>

--- 18,24 ----
#include "headers.h"
#include "s_elm.h"

! DEBUG_VAR(Debug,__FILE__,"system");

#include <errno.h>

Index: elm2.4.ME+.118-cvs/MANIFEST
*** elm2.4.ME+.117/MANIFEST 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/MANIFEST 2004-07-12 20:48:37.000000000 +0300
***************
*** 419,421 ****
--- 419,423 ----
lib/shared_base.c
lib/shared_connect.c
lib/shared_all.c
+ src/screen/init.c
+ lib/cancel.c
Index: elm2.4.ME+.118-cvs/melib/mime_decode.c
*** elm2.4.ME+.117/melib/mime_decode.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/melib/mime_decode.c 2004-07-20 21:33:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.64 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.66 2004/07/20 18:33:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 2227,2260 ****
mss ? mss->override_charset : NULL)) {
int len, crypted = 0;
int count = 0;
! getkey(OFF);

while((len = state_getl(buffer,sizeof(buffer),&newstate2)) > 0) {
count += len;

! if (!strncmp(buffer, START_ENCODE, strlen(START_ENCODE))) {
! state_printf(state_out,
! CATGETS(elm_msg_cat, MeSet, MeDecodeStartElmEncoded,
! "-- Start of (Elm) encoded section.\n"));
! crypted = ON;
! continue;
! } else if (!strncmp(buffer, END_ENCODE, strlen(END_ENCODE))) {
! crypted = OFF;
! state_printf(state_out,
! CATGETS(elm_msg_cat, MeSet, MeDecodeEndElmEncoded,
! "-- End of (Elm) encoded section.\n"));
! continue;
! } else if (crypted) {
! no_ret(buffer);
! encode(buffer);
! if (state_out->EOLN_is_CRLF)
! strfcat(buffer, "\r\n", sizeof buffer);
! else
! strfcat(buffer, "\n", sizeof buffer);
! }
! state_add_prefix(state_out);
! state_puts(buffer,state_out);
! }

DPRINT(Debug,11,(&Debug,
"elm_decode: Read %d bytes from temp file\n",
--- 2227,2262 ----
mss ? mss->override_charset : NULL)) {
int len, crypted = 0;
int count = 0;
! int ok = getkey(OFF);

while((len = state_getl(buffer,sizeof(buffer),&newstate2)) > 0) {
count += len;

! if (ok > 0) {
! if (!strncmp(buffer, START_ENCODE, strlen(START_ENCODE))) {
! state_printf(state_out,
! CATGETS(elm_msg_cat, MeSet, MeDecodeStartElmEncoded,
! "-- Start of (Elm) encoded section.\n"));
! crypted = ON;
! continue;
! } else if (!strncmp(buffer, END_ENCODE, strlen(END_ENCODE))) {
! crypted = OFF;
! state_printf(state_out,
! CATGETS(elm_msg_cat, MeSet, MeDecodeEndElmEncoded,
! "-- End of (Elm) encoded section.\n"));
! continue;
! } else if (crypted) {
! no_ret(buffer);
! encode(buffer);
! if (state_out->EOLN_is_CRLF)
! strfcat(buffer, "\r\n", sizeof buffer);
! else
! strfcat(buffer, "\n", sizeof buffer);
! }
! }
! state_add_prefix(state_out);
! state_puts(buffer,state_out);
! }

DPRINT(Debug,11,(&Debug,
"elm_decode: Read %d bytes from temp file\n",
***************
*** 2449,2455 ****
REGISTER_MT_HANDLER(MIME_TYPE_MESSAGE,"rfc822", rfc822_2);
REGISTER_MT_HANDLER(MIME_TYPE_MESSAGE,"delivery-status", text_2);
REGISTER_MT_HANDLER(MIME_TYPE_MESSAGE,"partial", partial_2);
!

/* text types */
REGISTER_MT_HANDLER(MIME_TYPE_TEXT,"plain", text_2);
--- 2451,2457 ----
REGISTER_MT_HANDLER(MIME_TYPE_MESSAGE,"rfc822", rfc822_2);
REGISTER_MT_HANDLER(MIME_TYPE_MESSAGE,"delivery-status", text_2);
REGISTER_MT_HANDLER(MIME_TYPE_MESSAGE,"partial", partial_2);
! REGISTER_MT_HANDLER(MIME_TYPE_MESSAGE,"disposition-notification", text_2);

/* text types */
REGISTER_MT_HANDLER(MIME_TYPE_TEXT,"plain", text_2);
Index: elm2.4.ME+.118-cvs/melib/pgp_decode.c
*** elm2.4.ME+.117/melib/pgp_decode.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.118-cvs/melib/pgp_decode.c 2004-07-21 12:00:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.39 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.40 2004/07/21 09:00:43 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 177,182 ****
--- 177,183 ----
{
char * buffer;
struct timeval now;
+ int r;

DPRINT(Debug,2,(&Debug,
"GetPassphrase(%d) -- pgp_names[%d]=%s\n",
***************
*** 186,193 ****
CATGETS(elm_msg_cat, MeSet, MePgpEnterPassphrase,
"Please enter your %s passphrase: "),
pgp_names[v]);
! if (!buffer)
return 0;

strfcpy(pgp_passphrase[v],buffer,sizeof pgp_passphrase[v]);

--- 187,197 ----
CATGETS(elm_msg_cat, MeSet, MePgpEnterPassphrase,
"Please enter your %s passphrase: "),
pgp_names[v]);
! if (!buffer) {
! DPRINT(Debug,2,(&Debug,
! "GetPassphrase=0 -- lib_prompt failed\n"));
return 0;
+ }

strfcpy(pgp_passphrase[v],buffer,sizeof pgp_passphrase[v]);

***************
*** 196,202 ****
pgp_expires = now.tv_sec + pgp_keeppassfor;

free(buffer);
! return(pgp_passphrase[v][0] != '\0');
}

int pgp_goodPassphrase(v)
--- 200,210 ----
pgp_expires = now.tv_sec + pgp_keeppassfor;

free(buffer);
! r = pgp_passphrase[v][0] != '\0';
! DPRINT(Debug,2,(&Debug,
! "GetPassphrase=%d\n",r));
!
! return(r);
}

int pgp_goodPassphrase(v)
Index: elm2.4.ME+.118-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.117/nls/C/C/C/s_elm.m 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/nls/C/C/C/s_elm.m 2004-07-12 00:11:43.000000000 +0300
***************
*** 2253,2261 ****
$ #SearchingInMessageDone
2131 "Searching %d. Done "
$ #HdrmenuInstruct1
! 2132 "Choose header, u)ser defined header, !)shell, invoke e)ditor, or <return>."
$ #HdrmenuInstruct1NoShell
! 2133 "Choose header, u)ser defined header, invoke e)ditor, or <return>."
$ #HdrEditComment
2134 "# Headers are automatically converted from %s charset and not need encoded\n"
$ #HdrEditCommentEnc
--- 2253,2261 ----
$ #SearchingInMessageDone
2131 "Searching %d. Done "
$ #HdrmenuInstruct1
! 2132 "Choose header, u)ser defined header, !)shell, invoke e(d)itor, or <return>."
$ #HdrmenuInstruct1NoShell
! 2133 "Choose header, u)ser defined header, invoke e(d)itor, or <return>."
$ #HdrEditComment
2134 "# Headers are automatically converted from %s charset and not need encoded\n"
$ #HdrEditCommentEnc


***************
*** 2303,2306 ****
$ #MailerDisconnected

2155 "Mailer disconnected! Can't send message. Use f)orget !"

$ #MimeFWMessageYN
! 2156 'Forward message as separate part? (%c/%c) '
--- 2303,2306 ----
$ #MailerDisconnected

2155 "Mailer disconnected! Can't send message. Use f)orget !"

$ #MimeFWMessageYN
! 2156 "Forward message as separate part? (%c/%c) "
Index: elm2.4.ME+.118-cvs/nls/C/C/C/s_me.m
*** elm2.4.ME+.117/nls/C/C/C/s_me.m 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/nls/C/C/C/s_me.m 2004-07-12 20:48:39.000000000 +0300
***************
*** 667,669 ****
--- 667,673 ----
352 Setting "%s" on line %d in "%s" file is suboptimal.\nUse file %.100s or %.100s instead.
$ #UUDECODECorrupt
353 UUENCODED data was corrupt!
+ $ #Canceled
+ 354 %S canceled
+ $ #ConnectCanceled
+ 355 Connect %s canceled.
Index: elm2.4.ME+.118-cvs/src/alias.c
*** elm2.4.ME+.117/src/alias.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/alias.c 2004-07-21 13:04:32.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: alias.c,v 1.36 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.39 2004/07/21 10:04:32 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 56,62 ****
extern char *alias_type();
char *error_description(), *get_parens();

! static void get_realnames P_((char *aliasname,
char *firstname,
char *lastname,
char *comment,
--- 56,62 ----
extern char *alias_type();
char *error_description(), *get_parens();

! static int get_realnames P_((char *aliasname,
char *firstname,
char *lastname,
char *comment,
***************
*** 450,456 ****
do {
int status =
optionally_enter(address1, LINES-3, strlen(buffer),
! OE_REDRAW_MARK, sizeof address1,
page);

while (REDRAW_MARK == status) {
--- 450,457 ----
do {
int status =
optionally_enter(address1, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, sizeof address1,
page);

while (REDRAW_MARK == status) {
***************
*** 462,468 ****
PutLine0(LINES-3,0, buffer);
status =
optionally_enter(address1, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
sizeof address1,
page);
}
--- 463,470 ----
PutLine0(LINES-3,0, buffer);
status =
optionally_enter(address1, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
sizeof address1,
page);
}
***************
*** 482,490 ****


if (!is_group && strchr(address1,',') != NULL)

is_group = 1;

! get_realnames(aliasname, firstname, lastname, comment, bufferA,
! sizeof firstname, sizeof lastname, sizeof comment,
! sizeof bufferA, is_group, page);


if(ask_accept(aliasname, firstname, lastname, comment, address1,
--- 484,493 ----


if (!is_group && strchr(address1,',') != NULL)

is_group = 1;

! if (!get_realnames(aliasname, firstname, lastname, comment, bufferA,
! sizeof firstname, sizeof lastname, sizeof comment,
! sizeof bufferA, is_group, page))
! return 0;


if(ask_accept(aliasname, firstname, lastname, comment, address1,
***************
*** 702,710 ****
}
}

! get_realnames(aliasname, firstname, lastname, comment, buffer,
! sizeof firstname, sizeof lastname, sizeof comment,
! sizeof buffer, 0, page);

/* grab the return address of this message */
strfcpy(address1,current_header->from[0].addr,sizeof address1);
--- 705,714 ----
}
}

! if (!get_realnames(aliasname, firstname, lastname, comment, buffer,
! sizeof firstname, sizeof lastname, sizeof comment,
! sizeof buffer, 0, page))
! return 0;

/* grab the return address of this message */
strfcpy(address1,current_header->from[0].addr,sizeof address1);
***************
*** 1166,1172 ****
case 'i':
case 'I':
case 'r':
! case 'R':
Write_to_screen(CATGETS(elm_msg_cat, AliasesSet,
AliasesAddReturn,
"Return to main menu..."));
--- 1170,1177 ----
case 'i':
case 'I':
case 'r':
! case 'R': {
! int r;
Write_to_screen(CATGETS(elm_msg_cat, AliasesSet,
AliasesAddReturn,
"Return to main menu..."));
***************
*** 1178,1193 ****
* on uppercase letters so that deletions are
* NOT queried.
*/
! if (delete_aliases(newaliases, islower(ch), aview, page)) {
! install_aliases(aview,&header_page);
! newaliases = 0;
! }
! clear_error();
! main_state(); /* Done with aliases. */

! goto OUT;

! case RETURN:
case LINE_FEED:
case SPACE:
case 'v': {
--- 1183,1203 ----
* on uppercase letters so that deletions are
* NOT queried.
*/
! r = delete_aliases(newaliases, islower(ch), aview, page);
! if (-1 == r) { /* Ctrl-C */
! break;
! }

! if (r > 0) {
! install_aliases(aview,&header_page);
! newaliases = 0;
! }
! clear_error();
! main_state(); /* Done with aliases. */

! goto OUT;
! }
! case RETURN:
case LINE_FEED:
case SPACE:
case 'v': {
***************
*** 1278,1284 ****

status = optionally_enter(name, LINES-3,
strlen(buffer),
! OE_REDRAW_MARK,
sizeof name,
page);
while (REDRAW_MARK == status) {
--- 1288,1295 ----

status = optionally_enter(name, LINES-3,
strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,
sizeof name,
page);
while (REDRAW_MARK == status) {
***************
*** 1286,1292 ****
status = optionally_enter(name, LINES-3,
strlen(buffer),
OE_REDRAW_MARK|
! OE_APPEND_CURRENT,
sizeof name,
page);
redraw++;
--- 1297,1304 ----
status = optionally_enter(name, LINES-3,
strlen(buffer),
OE_REDRAW_MARK|
! OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
sizeof name,
page);
redraw++;
***************
*** 1509,1515 ****

lower_prompt(alias_prompt);

! while ((ch = menu_ReadCh(page,0|READCH_CURSOR)) != '.') {
switch(ch) {
case EOF :
leave(0, &current_mailbox, &current_aliaslist);
--- 1521,1531 ----

lower_prompt(alias_prompt);

! while ((ch = menu_ReadCh(page,0|READCH_CURSOR|READCH_sig_char)) != '.') {
!
! if (ch == TERMCH_interrupt_char)
!
! break;
switch(ch) {
case EOF :
leave(0, &current_mailbox, &current_aliaslist);
***************
*** 1761,1767 ****
do {
int status =
optionally_enter(aliasname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK, size, page);

if (REDRAW_MARK == status)
return REDRAW_MARK;
--- 1777,1783 ----
do {
int status =
optionally_enter(aliasname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_SIG_CHAR, size, page);

if (REDRAW_MARK == status)
return REDRAW_MARK;
***************
*** 1879,1885 ****

}

! static void get_realnames(aliasname, firstname, lastname, comment, buffer,
size_first, size_last, size_comment, size_buffer,
is_group, page)
char *aliasname, *firstname, *lastname, *comment, *buffer;
--- 1895,1901 ----

}

! static int get_realnames(aliasname, firstname, lastname, comment, buffer,
size_first, size_last, size_comment, size_buffer,
is_group, page)
char *aliasname, *firstname, *lastname, *comment, *buffer;
***************
*** 1898,1931 ****
lastname[0] = '\0';
firstname[0] = '\0';
} else {
! elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterLastName,
"Enter last name for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
CleartoEOLN();
status = optionally_enter(lastname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK, size_last, page);
while (REDRAW_MARK == status) {
PutLine0(LINES-3,0, buffer);
status = optionally_enter(lastname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
size_last, page);
}

elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterFirstName,
"Enter first name for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
CleartoEOLN();
status = optionally_enter(firstname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK, size_first, page);
while (REDRAW_MARK == status) {
PutLine0(LINES-3,0, buffer);
status = optionally_enter(firstname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
size_first, page);
}

if (strlen(lastname) == 0) {
strfcpy(lastname, firstname, size_last);
*firstname = '\0';
--- 1914,1957 ----
lastname[0] = '\0';
firstname[0] = '\0';
} else {
! elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterLastName,
"Enter last name for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
CleartoEOLN();
status = optionally_enter(lastname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_last, page);
while (REDRAW_MARK == status) {
PutLine0(LINES-3,0, buffer);
status = optionally_enter(lastname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
size_last, page);
}

+ if (status != 0) /* Error or Ctrl-C */
+ return 0;
+
elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterFirstName,
"Enter first name for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
CleartoEOLN();
status = optionally_enter(firstname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_first, page);
while (REDRAW_MARK == status) {
PutLine0(LINES-3,0, buffer);
status = optionally_enter(firstname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
size_first, page);
}

+ if (0 != status) /* Ctrl-C or error */
+ return 0;
+
if (strlen(lastname) == 0) {
strfcpy(lastname, firstname, size_last);
*firstname = '\0';
***************
*** 1937,1949 ****
"Enter optional comment for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
status = optionally_enter(comment, LINES-3, strlen(buffer),
! OE_REDRAW_MARK, size_comment, page);
while (status == REDRAW_MARK) {
PutLine0(LINES-3,0, buffer);
status = optionally_enter(comment, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
size_comment, page);
}
}

static int ask_accept(aliasname, firstname, lastname, comment, address, buffer,
--- 1963,1982 ----
"Enter optional comment for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
status = optionally_enter(comment, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_comment, page);
while (status == REDRAW_MARK) {
PutLine0(LINES-3,0, buffer);
status = optionally_enter(comment, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
size_comment, page);
}
+
+ if (0 != status) /* Ctrl-C or error */
+ return 0;
+
+ return 1;
}

static int ask_accept(aliasname, firstname, lastname, comment, address, buffer,
Index: elm2.4.ME+.118-cvs/src/a_quit.c
*** elm2.4.ME+.117/src/a_quit.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/a_quit.c 2004-07-21 13:04:32.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_quit.c,v 1.17 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: a_quit.c,v 1.18 2004/07/21 10:04:32 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 45,50 ****
--- 45,51 ----
*
* Return 1 Aliases were deleted
* newalias Aliases were not deleted
+ * -1 Interrupted witn Ctrl-C
*
* The return allows the caller to determine if the "newalias"
* routine should be run.
***************
*** 55,61 ****
char **list;

int to_delete = 0, to_keep = 0, i, marked_deleted = 0, ask_questions;
! char answer;
int ac = get_alias_count(aview);
int LINES, COLUMNS;

--- 56,62 ----
char **list;

int to_delete = 0, to_keep = 0, i, marked_deleted = 0, ask_questions;
! int answer;
int ac = get_alias_count(aview);
int LINES, COLUMNS;

***************
*** 91,112 ****
marked_deleted));

if(marked_deleted) {
! answer = (always_del ? *def_ans_yes : *def_ans_no); /* default answer */
! if(ask_questions) {
if (marked_deleted == 1)
! elm_sfprintf(buffer, sizeof buffer,
! CATGETS(elm_msg_cat, AliasesSet, AliasesDelete,
! "Delete 1 alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
else
! elm_sfprintf(buffer, sizeof buffer,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesDeletePlural,
! "Delete %d aliases? (%c/%c) "),
! marked_deleted, *def_ans_yes, *def_ans_no);
!
! answer = want_to(buffer, answer, LINES-4, 0,
! page);
}

if(answer == *def_ans_yes) {
--- 92,122 ----
marked_deleted));

if(marked_deleted) {
! answer = (always_del ? *def_ans_yes : *def_ans_no); /* default answer */
! if(ask_questions) {
! int def = answer;
!
if (marked_deleted == 1)
! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel,
! page,
! CATGETS(elm_msg_cat, AliasesSet, AliasesDelete,
! "Delete 1 alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
else
! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel,
! page,
!
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesDeletePlural,
! "Delete %d aliases? (%c/%c) "),
! marked_deleted, *def_ans_yes, *def_ans_no);
!
!
! if (TERMCH_interrupt_char == answer) {
! return -1;
! }
}

if(answer == *def_ans_yes) {
Index: elm2.4.ME+.118-cvs/src/args.c
*** elm2.4.ME+.117/src/args.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/args.c 2004-07-10 11:08:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: args.c,v 1.62 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.63 2004/07/10 08:08:20 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.63 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 106,113 ****
#if DEBUG
set_debugging(optarg);
#else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,
! "Warning: system created without debugging enabled - request ignored\n"));
#endif
break;
case 'D' :
--- 106,114 ----
#if DEBUG
set_debugging(optarg);
#else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,
! "Warning: system created without debugging enabled - request ignored\n"));
! error_sleep(1);
#endif
break;
case 'D' :

Index: elm2.4.ME+.118-cvs/src/attach_menu.c
*** elm2.4.ME+.117/src/attach_menu.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/attach_menu.c 2004-07-14 10:38:04.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.63 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.63 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.67 2004/07/14 07:38:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1079,1085 ****
PutLineX (LINES-3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachEnter1,
"Enter letter or RETURN to quit: "));
! ch = menu_ReadCh(page,REDRAW_MARK|READCH_resize);
clear_error();
}

--- 1079,1086 ----
PutLineX (LINES-3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachEnter1,
"Enter letter or RETURN to quit: "));
! CleartoEOS();
! ch = menu_ReadCh(page,REDRAW_MARK|READCH_resize|READCH_sig_char);
clear_error();
}

***************
*** 1092,1098 ****
goto resize_mark;
} else if (ch == ctrl('L') || ch == REDRAW_MARK)
update = TRUE;
! else if (ch == 'f' || ch == 'F') {

struct string * tmpname = NULL;
int old_is_text = is_text;
--- 1093,1101 ----
goto resize_mark;
} else if (ch == ctrl('L') || ch == REDRAW_MARK)
update = TRUE;
! else if (ch == TERMCH_interrupt_char)
! goto cleanup;
! else if (ch == 'f' || ch == 'F') {

struct string * tmpname = NULL;
int old_is_text = is_text;
***************
*** 1291,1297 ****
int code = optionally_enter2(page,
&(att->description),
LINES-3, 0,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
CATGETS(elm_msg_cat, MeSet,
MeAttachEnterDescription,
"Description: "));
--- 1294,1301 ----
int code = optionally_enter2(page,
&(att->description),
LINES-3, 0,
! OE_APPEND_CURRENT|OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, MeSet,
MeAttachEnterDescription,
"Description: "));
***************
*** 1329,1336 ****
strfcpy (buf + l, att->type_opts, sizeof (buf) - l);
}

! code = optionally_enter (buf, LINES-3, 14, OE_APPEND_CURRENT|
! OE_REDRAW_MARK, sizeof buf, page);
if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
--- 1333,1341 ----
strfcpy (buf + l, att->type_opts, sizeof (buf) - l);
}

! code = optionally_enter(buf, LINES-3, 14, OE_APPEND_CURRENT|
! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,
! sizeof buf, page);
if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
***************
*** 1432,1440 ****
strfcpy (buf + l, att->disposition_opts, sizeof (buf) - l);
}

! code = optionally_enter (buf, LINES-3, 21,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
! sizeof buf, page);
if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
--- 1437,1446 ----
strfcpy (buf + l, att->disposition_opts, sizeof (buf) - l);
}

! code = optionally_enter(buf, LINES-3, 21,
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
! sizeof buf, page);
if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
***************
*** 1446,1451 ****
--- 1452,1458 ----
update = TRUE;
}
else if (ch == 'e' || ch == 'E') {
+ int oldenc = att->encoding;
prompt = TRUE;
PutLineX (LINES-3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachEnterContentTE,
***************
*** 1541,1550 ****
}

Write_to_screen (FRM("%s"),ENCODING(att->encoding));
! ch = menu_ReadCh(page,REDRAW_MARK);
if (ch == '\n')
break;
! else if (ch == ' ') {
NEXT_ENCODING;
}
else if (ch == REDRAW_MARK) {
--- 1548,1562 ----
}

Write_to_screen (FRM("%s"),ENCODING(att->encoding));
! ch = menu_ReadCh(page,REDRAW_MARK|READCH_sig_char);
if (ch == '\n')
break;
! else if (ch == TERMCH_interrupt_char) {
! att->encoding = oldenc;
! update = TRUE;
!
! break;
! } else if (ch == ' ') {
NEXT_ENCODING;
}
else if (ch == REDRAW_MARK) {
***************
*** 2319,2325 ****
PutLineX (LINES-3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachMenuPrompt,
"Attachments: "));
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize);
clear_error(); /* Clear the error message (from buffer also) */

switch (ch) {
--- 2331,2338 ----
PutLineX (LINES-3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachMenuPrompt,
"Attachments: "));
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);
clear_error(); /* Clear the error message (from buffer also) */

switch (ch) {
***************
*** 2571,2576 ****
--- 2584,2590 ----
case 'i':
case 'q':
case 'x':
+ case TERMCH_interrupt_char:
goto OUT;

case ctrl('F'):
Index: elm2.4.ME+.118-cvs/src/browser.c
*** elm2.4.ME+.117/src/browser.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/browser.c 2004-07-11 20:44:51.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: browser.c,v 1.31 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: browser.c,v 1.32 2004/07/11 17:44:51 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 768,774 ****
{
int ret = 0;
int code;
- int flags;

struct string *text;
struct string *vector[4];
--- 768,773 ----
***************
*** 791,800 ****
INFO.py = 0; /* flags here */
INFO.give_buffer = gb_browser;
if (save_copy)
! INFO.flags = OE_REDRAW_MARK | OE_TABACTION;
else
INFO.flags = (*buffer ? 0 : OE_APPEND_CURRENT ) |
! OE_REDRAW_MARK | OE_TABACTION;
INFO.ch_count = 0;
INFO.builtin = NULL;
INFO.dir_p = p;
--- 790,800 ----
INFO.py = 0; /* flags here */
INFO.give_buffer = gb_browser;
if (save_copy)
! INFO.flags = OE_REDRAW_MARK | OE_TABACTION |
! OE_SIG_CHAR /* Ctrl-C */;
else
INFO.flags = (*buffer ? 0 : OE_APPEND_CURRENT ) |
! OE_REDRAW_MARK | OE_TABACTION | OE_SIG_CHAR /* Ctrl-C */;
INFO.ch_count = 0;
INFO.builtin = NULL;
INFO.dir_p = p;
***************
*** 815,825 ****
CleartoEOS();
show_last_error();

! flags = give_dir_flags(p);

- if (0 != (BROWSER_SELECTED & flags))
- ret = 1;
-
if (INFO.GB_FLAGS & GB_REDRAW)
*redraw = TRUE;

--- 815,830 ----
CleartoEOS();
show_last_error();

! if (0 != code) {
! DPRINT(Debug,4, (&Debug, "run_browser: Ctrl-C or error\n"));


! ret = 0;
! } else {

! int flags = give_dir_flags(p);
!
! if (0 != (BROWSER_SELECTED & flags))
! ret = 1;
! }

if (INFO.GB_FLAGS & GB_REDRAW)
*redraw = TRUE;

***************
*** 1280,1286 ****
return &(I->pvector[0]);
}

! void gen_browser(


#if ANSI_C
struct menu_context *page,

struct folder_browser *p,
--- 1285,1291 ----
return &(I->pvector[0]);
}

! int gen_browser(


#if ANSI_C
struct menu_context *page,

struct folder_browser *p,
***************
*** 1311,1316 ****
--- 1316,1322 ----
va_list vl;
struct string * word = NULL;
int save_copy = 0;
+ int r;

switch (w) {
case word_change:
***************
*** 1337,1348 ****



Va_start(vl, msg); /* defined in defs.h */

! run_browser(page,p,buffer,redraw,save_copy,word,prev_fold,
! aview,format,msg,vl);
va_end(vl);


free_string(&word);
}

int file_browser(
--- 1343,1359 ----



Va_start(vl, msg); /* defined in defs.h */

! r = run_browser(page,p,buffer,redraw,save_copy,word,prev_fold,
! aview,format,msg,vl);
va_end(vl);


free_string(&word);
+
+ DPRINT(Debug,4, (&Debug, "gen_browser=%d\n",
+ r));
+
+ return r;
}

int file_browser(
***************
*** 1373,1379 ****
{
int ret = 0;
int code;
- int flags;
va_list vl;

struct string *text;
--- 1384,1389 ----
***************
*** 1426,1432 ****
INFO.give_buffer = gb_filebrowser;

INFO.flags = (*buffer ? 0 : OE_APPEND_CURRENT ) |
! OE_REDRAW_MARK | OE_TABACTION;

INFO.ch_count = 0;
INFO.builtin = NULL;
--- 1436,1442 ----
INFO.give_buffer = gb_filebrowser;

INFO.flags = (*buffer ? 0 : OE_APPEND_CURRENT ) |
! OE_REDRAW_MARK | OE_TABACTION | OE_SIG_CHAR;

INFO.ch_count = 0;
INFO.builtin = NULL;
***************
*** 1451,1461 ****
CleartoEOS();
show_last_error();

! flags = give_dir_flags(p);

- if (0 != (BROWSER_SELECTED & flags))
- ret = 1;
-
if (INFO.GB_FLAGS & GB_REDRAW)
*redraw = TRUE;

--- 1461,1476 ----
CleartoEOS();
show_last_error();

! if (0 != code) {
! DPRINT(Debug,4, (&Debug, "file_browser: Ctrl-C or error\n"));


! ret = 0;
! } else {

! int flags = give_dir_flags(p);
!
! if (0 != (BROWSER_SELECTED & flags))
! ret = 1;
! }

if (INFO.GB_FLAGS & GB_REDRAW)
*redraw = TRUE;

Index: elm2.4.ME+.118-cvs/src/builtin++.c
*** elm2.4.ME+.117/src/builtin++.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/builtin++.c 2004-07-14 15:23:31.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.23 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.25 2004/07/14 12:23:31 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 398,406 ****
is_end = 0;
}
EndBold();
!
read_key:
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize);

if (ch != '/') {
if (search_pattern) {
--- 398,407 ----
is_end = 0;
}
EndBold();
! CleartoEOS();
read_key:
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);

if (ch != '/') {
if (search_pattern) {
***************
*** 409,414 ****
--- 410,419 ----
}

switch (ch) {
+ case TERMCH_interrupt_char:
+ ret = 0;
+ goto finish;
+
case RESIZE_MARK:
DPRINT(Debug,4, (&Debug, " ... resizing\n"));
idx = idx_top;
***************
*** 446,463 ****
{
int code;

! /* KESKEN */
! code = optionally_enter2 (page,
! &search_pattern,
! LINES-1, 0,
! OE_REDRAW_MARK,
! CATGETS(elm_msg_cat, ElmSet,
! ElmBuiltinSearch,
! "Search: "));

if (REDRAW_MARK == code)
goto redraw;
! if (code < 0)
goto quit;
if (search_pattern && string_len(search_pattern)) {
int start_idx;
--- 451,470 ----
{
int code;

! code = optionally_enter2(page,
! &search_pattern,
! LINES-1, 0,
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,
! CATGETS(elm_msg_cat, ElmSet,
! ElmBuiltinSearch,
! "Search: "));

if (REDRAW_MARK == code)
goto redraw;
! if (-1 == code) /* Ctrl-C */
! goto reprompt;
! if (code != 0)
goto quit;
if (search_pattern && string_len(search_pattern)) {
int start_idx;
Index: elm2.4.ME+.118-cvs/src/editmsg.c
*** elm2.4.ME+.117/src/editmsg.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/editmsg.c 2004-07-11 14:36:08.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.43 2004/06/18 09:29:51 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.44 2004/07/11 11:36:08 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 425,430 ****
--- 425,433 ----
signal(SIGINT, edit_interrupt);
signal(SIGQUIT, edit_interrupt);

+ SIGDPRINT(Debug,1,(&Debug,
+ " edit_interrupt() --- DANGER\n"));
+
if (interrupts_while_editing++ == 0)
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmEditmsgOneMoreCancel,
***************
*** 985,991 ****
CATGETS(elm_msg_cat, ElmSet,
ElmEnterNameEditor,
"Please enter the name of the editor: "));
! I->flags = OE_REDRAW_MARK;
if (I->pvector[0])
Write_to_screen(FRM("%S"),I->pvector[0]);
CleartoEOS();
--- 988,994 ----
CATGETS(elm_msg_cat, ElmSet,
ElmEnterNameEditor,
"Please enter the name of the editor: "));
! I->flags = OE_REDRAW_MARK| OE_SIG_CHAR;
if (I->pvector[0])
Write_to_screen(FRM("%S"),I->pvector[0]);
CleartoEOS();
***************
*** 1020,1026 ****
/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA;
break;
case -3:
PutLineX(LINES-2,0,
--- 1023,1030 ----
/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA
! | OE_SIG_CHAR;
break;
case -3:
PutLineX(LINES-2,0,
***************
*** 1032,1038 ****
/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA;
break;
case -2:
PutLineX(LINES-2,0,
--- 1036,1043 ----
/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA
! | OE_SIG_CHAR;
break;
case -2:
PutLineX(LINES-2,0,
***************
*** 1044,1050 ****
/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA;
break;
case -1:
PutLineX(LINES-2,0,
--- 1049,1056 ----
/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA
! | OE_SIG_CHAR;
break;
case -1:
PutLineX(LINES-2,0,
***************
*** 1055,1061 ****
/* OE_ALLOW_MIMEENC so that user can paste mime encoded words
to buffer and they are converted
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ALLOW_MIMEENC;
break;
}

--- 1061,1068 ----
/* OE_ALLOW_MIMEENC so that user can paste mime encoded words
to buffer and they are converted
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ALLOW_MIMEENC
! | OE_SIG_CHAR;
break;
}

***************
*** 1070,1076 ****
if (I->pvector[0])
Write_to_screen(FRM("%S"),I->pvector[0]);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK;
return & (I->pvector[0]);
} else { /* Text editor */
int ok = 0;
--- 1077,1083 ----
if (I->pvector[0])
Write_to_screen(FRM("%S"),I->pvector[0]);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK| OE_SIG_CHAR;
return & (I->pvector[0]);
} else { /* Text editor */
int ok = 0;
***************
*** 1172,1178 ****
}
/* handle escape_char */
I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK |
! OE_EDITOR_ESCAPE;

/* Update end of file mark and wrapped lines*/
if (added && line_cordinate+1 < LINES-2) {
--- 1179,1185 ----
}
/* handle escape_char */
I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK |
! OE_EDITOR_ESCAPE| OE_SIG_CHAR;

/* Update end of file mark and wrapped lines*/
if (added && line_cordinate+1 < LINES-2) {
***************
*** 1216,1222 ****
I->pvector[0] = tmp2;
}
free_string(&tmp);
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA;
}

static void start_edit_subject P_((struct enter_info *I));
--- 1223,1230 ----
I->pvector[0] = tmp2;
}
free_string(&tmp);
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA
! | OE_SIG_CHAR;
}

static void start_edit_subject P_((struct enter_info *I));
***************
*** 1241,1247 ****
/* OE_ALLOW_MIMEENC so that user can paste mime encoded words
to buffer and they are converted
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ALLOW_MIMEENC;
}

static void redraw_editor(I)
--- 1249,1256 ----
/* OE_ALLOW_MIMEENC so that user can paste mime encoded words
to buffer and they are converted
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ALLOW_MIMEENC
! | OE_SIG_CHAR;
}

static void redraw_editor(I)
***************
*** 1477,1483 ****

free_string(&(I->pvector[0]));
I->py = I->counter-1;
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
return write_edit_line(I);
} else if (0 == (I->flags & OE_EDITOR_ESCAPE)) { /* Command editor */
int buffer_line = I->py+1;
--- 1486,1493 ----

free_string(&(I->pvector[0]));
I->py = I->counter-1;
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
return write_edit_line(I);
} else if (0 == (I->flags & OE_EDITOR_ESCAPE)) { /* Command editor */
int buffer_line = I->py+1;
***************
*** 1487,1493 ****

if (! I->pvector[0] ||
0 == string_len(I->pvector[0])) {
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
return write_edit_line(I);
}

--- 1497,1504 ----

if (! I->pvector[0] ||
0 == string_len(I->pvector[0])) {
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
return write_edit_line(I);
}

***************
*** 1505,1518 ****
tilde_help();
redraw_editor(I);
free_string(&I->pvector[0]);
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
return write_edit_line(I);
case 0x007E: /* '~' */
if (I->pvector[buffer_line])
free_string(&(I->pvector[buffer_line]));
I->pvector[buffer_line] = I->pvector[0];
I->pvector[0] = NULL;
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
I->ch_count = 1;
return write_edit_line(I);


case 0x0074: /* 't' */

--- 1516,1531 ----
tilde_help();
redraw_editor(I);
free_string(&I->pvector[0]);
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
return write_edit_line(I);
case 0x007E: /* '~' */
if (I->pvector[buffer_line])
free_string(&(I->pvector[buffer_line]));
I->pvector[buffer_line] = I->pvector[0];
I->pvector[0] = NULL;
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
I->ch_count = 1;
return write_edit_line(I);


case 0x0074: /* 't' */

***************
*** 1543,1549 ****
case 0x0048: /* 'H' */
/* TODO: Ask To: Cc: Bcc: Subject: */

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);

return write_edit_line(I);
--- 1556,1562 ----
case 0x0048: /* 'H' */
/* TODO: Ask To: Cc: Bcc: Subject: */

! I->flags |= OE_EDITOR_ESCAPE| OE_SIG_CHAR;
free_string(&I->pvector[0]);

return write_edit_line(I);
***************
*** 1557,1563 ****

free_string(&S);
free(s);
! I->flags |= OE_EDITOR_ESCAPE;

free_string(&I->pvector[0]);

--- 1570,1576 ----

free_string(&S);
free(s);
! I->flags |= OE_EDITOR_ESCAPE| OE_SIG_CHAR;

free_string(&I->pvector[0]);

***************
*** 1565,1571 ****
case 0x0065: /* 'e' */
case 0x0045: /* 'E' */

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);

if (strlen(e_editor) > 0 ||
--- 1578,1584 ----
case 0x0065: /* 'e' */
case 0x0045: /* 'E' */

! I->flags |= OE_EDITOR_ESCAPE| OE_SIG_CHAR;
free_string(&I->pvector[0]);

if (strlen(e_editor) > 0 ||
***************
*** 1607,1613 ****
case 0x0076: /* 'v' */
case 0x0056: /* 'V' */

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);

if (have_editor(v_editor)) {
--- 1620,1626 ----
case 0x0076: /* 'v' */
case 0x0056: /* 'V' */

! I->flags |= OE_EDITOR_ESCAPE| OE_SIG_CHAR;
free_string(&I->pvector[0]);

if (have_editor(v_editor)) {
***************
*** 1641,1647 ****

X = 1;
S = clip_from_string(I->pvector[0],&X,string_len(I->pvector[0]));
! I->flags = OE_REDRAW_MARK ;
I->ch_count = 0;
free_string(&I->pvector[0]);
I->pvector[0] = S;
--- 1654,1661 ----

X = 1;
S = clip_from_string(I->pvector[0],&X,string_len(I->pvector[0]));
! I->flags = OE_REDRAW_MARK
! | OE_SIG_CHAR;
I->ch_count = 0;
free_string(&I->pvector[0]);
I->pvector[0] = S;
***************
*** 1675,1681 ****
free(s1);
free(s);
}
! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);
return write_edit_line(I);
case 0x0021: /* '!' */
--- 1689,1695 ----
free(s1);
free(s);
}
! I->flags |= OE_EDITOR_ESCAPE | OE_SIG_CHAR;
free_string(&I->pvector[0]);
return write_edit_line(I);
case 0x0021: /* '!' */
***************
*** 1719,1725 ****
ElmSimpleContinue,
"(Continue.)"));
}
! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);
return write_edit_line(I);

--- 1733,1739 ----
ElmSimpleContinue,
"(Continue.)"));
}
! I->flags |= OE_EDITOR_ESCAPE | OE_SIG_CHAR;
free_string(&I->pvector[0]);
return write_edit_line(I);

***************
*** 1734,1740 ****

read_in_messages(I);

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);
return write_edit_line(I);

--- 1748,1754 ----

read_in_messages(I);

! I->flags |= OE_EDITOR_ESCAPE | OE_SIG_CHAR;
free_string(&I->pvector[0]);
return write_edit_line(I);

***************
*** 1743,1749 ****
I->py = 0;
redraw_editor(I);

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);
return write_edit_line(I);

--- 1757,1763 ----
I->py = 0;
redraw_editor(I);

! I->flags |= OE_EDITOR_ESCAPE | OE_SIG_CHAR;
free_string(&I->pvector[0]);
return write_edit_line(I);

***************
*** 1755,1761 ****

sleep_message();
/* reprompt */
! I->flags = OE_REDRAW_MARK;
I->ch_count = 0;
return write_edit_line(I);
}
--- 1769,1775 ----

sleep_message();
/* reprompt */
! I->flags = OE_REDRAW_MARK | OE_SIG_CHAR;
I->ch_count = 0;
return write_edit_line(I);
}
***************
*** 1811,1817 ****
if (0 == (I->flags & OE_EDITOR_ESCAPE)) {
MoveCursor(LINES-2,0);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
}
I->py--;
}
--- 1825,1832 ----
if (0 == (I->flags & OE_EDITOR_ESCAPE)) {
MoveCursor(LINES-2,0);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
}
I->py--;
}
***************
*** 1830,1836 ****
if (0 == (I->flags & OE_EDITOR_ESCAPE)) {
MoveCursor(LINES-2,0);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
}
if (I->py <= I->counter)
I->py++;
--- 1845,1852 ----
if (0 == (I->flags & OE_EDITOR_ESCAPE)) {
MoveCursor(LINES-2,0);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
}
if (I->py <= I->counter)
I->py++;
***************
*** 1915,1921 ****
GetXYLocation(&line, &col);
write_line(I,line);

! I->flags = OE_REDRAW_MARK;
MoveCursor(LINES-2,0);
CleartoEOS();
if (I->pvector[0])
--- 1931,1937 ----
GetXYLocation(&line, &col);
write_line(I,line);

! I->flags = OE_REDRAW_MARK| OE_SIG_CHAR;
MoveCursor(LINES-2,0);
CleartoEOS();
if (I->pvector[0])
***************
*** 1980,1985 ****
--- 1996,2002 ----

struct menu_context * page = NULL;
int LINES, COLUMNS;
+ int code1;

/* The built-in editor is not re-entrant! */
if (builtin_editor_active) {
***************
*** 2006,2012 ****
INFO.px = -1;
INFO.py = 0;
INFO.give_buffer = gb_editmsg;
! INFO.flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
INFO.ch_count = 0;
INFO.builtin = &INFO_1;
INFO.dir_p = NULL;
--- 2023,2030 ----
INFO.px = -1;
INFO.py = 0;
INFO.give_buffer = gb_editmsg;
! INFO.flags = OE_APPEND_CURRENT | OE_REDRAW_MARK |
! OE_EDITOR_ESCAPE | OE_SIG_CHAR;
INFO.ch_count = 0;
INFO.builtin = &INFO_1;
INFO.dir_p = NULL;
***************
*** 2037,2042 ****
--- 2055,2061 ----
interrupts_while_editing = 0;

if (SETJMP(edit_location) != 0) {
+ restart_sig:
if (interrupts_while_editing > 1) {
(void) signal(SIGINT, oldint);
(void) signal(SIGQUIT, oldquit);
***************
*** 2047,2053 ****
}

more_input:
! while (REDRAW_MARK == enter_helper(&INFO, page)) {

if (menu_resized(page))
menu_get_sizes(page, &LINES, &COLUMNS);
--- 2066,2072 ----
}

more_input:
! while (REDRAW_MARK == (code1 = enter_helper(&INFO, page))) {

if (menu_resized(page))
menu_get_sizes(page, &LINES, &COLUMNS);
***************
*** 2059,2064 ****
--- 2078,2097 ----

}

+ if (-1 == code1) {
+ DPRINT(Debug,1,(&Debug,"interrupt char given (no signal)\n"));
+
+ if (interrupts_while_editing++ == 0)
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmEditmsgOneMoreCancel,
+ "(Interrupt. One more to cancel this letter.)"));
+ else
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEditmsgCancelled,
+ "(Interrupt. Letter canceled.)"));
+
+ goto restart_sig;
+ }
+
(void) signal(SIGINT, oldint);
(void) signal(SIGQUIT, oldquit);

Index: elm2.4.ME+.118-cvs/src/elm.c
*** elm2.4.ME+.117/src/elm.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/elm.c 2004-07-11 14:36:08.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elm.c,v 1.70 2004/06/18 20:40:56 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.70 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.71 2004/07/11 11:36:08 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1113,1119 ****
prompt_s(mcommon_give_item(&MENU, m_Prompt));
GetXYLocation(&lin,&col);

! CleartoEOLN();

/* fragment_handling: 0 == none,
1 == manual,
--- 1113,1121 ----
prompt_s(mcommon_give_item(&MENU, m_Prompt));
GetXYLocation(&lin,&col);

! CleartoEOS();
! show_last_error();
! MoveCursor(lin,col);

/* fragment_handling: 0 == none,
1 == manual,
Index: elm2.4.ME+.118-cvs/src/encode.c
*** elm2.4.ME+.117/src/encode.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/encode.c 2004-07-20 21:33:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: encode.c,v 1.12 2004/03/27 18:31:45 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: encode.c,v 1.13 2004/07/20 18:33:03 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 58,67 ****
return (char *)str;
}

! void getkey(send)
int send;
{
! struct menu_context *page = default_context; /* FIX THIS */

/** this routine prompts for and returns an encode/decode
key for use in the rest of the program. **/
--- 58,70 ----
return (char *)str;
}

! /* 0 == failure
! 1 == OK
! -1 == Ctrl-C */
! int getkey(send)
int send;
{
! struct menu_context *page = default_context; /* FIX THIS */

/** this routine prompts for and returns an encode/decode
key for use in the rest of the program. **/
***************
*** 86,108 ****
PutLine0(LINES-2, 0, (send ? first_enc_prompt : decrypt_prompt));
CleartoEOLN();
code = optionally_enter(buffer[0], -1, -1,
! OE_PASSWD|OE_REDRAW_MARK,
sizeof buffer[0], page);
if (REDRAW_MARK == code)
! continue;
! if (code < 0)
! return;

if (send) {
PutLine0(LINES-2, 0, second_enc_prompt);
CleartoEOLN();
code = optionally_enter(buffer[1], -1, -1,
! OE_PASSWD|OE_REDRAW_MARK,
sizeof buffer[1], page);
if (REDRAW_MARK == code)
! continue;
! if (code < 0)
! return;
if(strcmp(buffer[0], buffer[1]) != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmKeysNotSame,
"Your keys were not the same!"));
--- 89,117 ----
PutLine0(LINES-2, 0, (send ? first_enc_prompt : decrypt_prompt));
CleartoEOLN();
code = optionally_enter(buffer[0], -1, -1,
! OE_PASSWD|OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */ ,
sizeof buffer[0], page);
if (REDRAW_MARK == code)
! continue;
! if (-1 == code) /* Ctrl-C */
! return -1;
! if (code != 0)
! return 0;

if (send) {
PutLine0(LINES-2, 0, second_enc_prompt);
CleartoEOLN();
code = optionally_enter(buffer[1], -1, -1,
! OE_PASSWD|OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,
sizeof buffer[1], page);
if (REDRAW_MARK == code)
! continue;
! if (-1 == code) /* Ctrl-C */
! return -1;
! if (code != 0)
! return 0;
if(strcmp(buffer[0], buffer[1]) != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmKeysNotSame,
"Your keys were not the same!"));
***************
*** 122,127 ****
--- 131,137 ----

ClearLine(LINES-2);
clear_error();
+ return 1;
}

void get_key_no_prompt()
Index: elm2.4.ME+.118-cvs/src/exitprog.c
*** elm2.4.ME+.117/src/exitprog.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/exitprog.c 2004-07-18 23:55:15.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: exitprog.c,v 1.12 2004/03/27 18:31:45 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: exitprog.c,v 1.14 2004/07/18 20:55:15 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 26,32 ****
any, and if the user say's it's ok)
**/

! char msg[SLEN], answer;
int i, changes = 0;
int mc;
int LINES, COLUMNS;
--- 26,32 ----
any, and if the user say's it's ok)


**/

! char msg[SLEN];

int i, changes = 0;
int mc;
int LINES, COLUMNS;
***************
*** 50,55 ****
--- 50,57 ----


if (changes) {
+
+ int X1;


/* YES or NO on softkeys */
/*

if (hp_softkeys) {
***************
*** 57,80 ****
softkeys_on();
}
*/
if (changes == 1)
! elm_sfprintf(msg, sizeof msg,
! CATGETS(elm_msg_cat, ElmSet, ElmAbandonChange,
! "Abandon change to mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


else
! elm_sfprintf(msg, sizeof msg,

! CATGETS(elm_msg_cat, ElmSet, ElmAbandonChangePlural,
! "Abandon changes to mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! answer = want_to(msg, *def_ans_no, LINES-4, 0,
! *page);
!
! if(answer != *def_ans_yes) return -1;
}

FlushBuffer();
-

erase_menu_context(page);
leave(0, mailbox, aview);
--- 59,93 ----
softkeys_on();
}
*/
+
+ /* Ctrl-C is equivalent of NO here*/
+
+ /* NOTICE: prompt_letter may return EOF */
+
if (changes == 1)


! X1 = prompt_letter(LINES-4,"",*def_ans_no,

! PROMPT_yesno|PROMPT_cancel,*page,
!
! CATGETS(elm_msg_cat, ElmSet, ElmAbandonChange,
! "Abandon change to mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
else


! X1 = prompt_letter(LINES-4,"",*def_ans_no,

! PROMPT_yesno|PROMPT_cancel,*page,
!
! CATGETS(elm_msg_cat, ElmSet, ElmAbandonChangePlural,
! "Abandon changes to mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
! if (X1 == EOF)
! emergency_exit(0);
!
!
! if(X1 != *def_ans_yes)
! return -1;
}

FlushBuffer();

erase_menu_context(page);
leave(0, mailbox, aview);
Index: elm2.4.ME+.118-cvs/src/file.c
*** elm2.4.ME+.117/src/file.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/file.c 2004-07-11 20:44:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file.c,v 1.36 2004/03/27 18:31:45 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file.c,v 1.37 2004/07/11 17:44:51 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 121,126 ****
--- 121,127 ----
struct header_rec * mhdr = give_header(mailbox,mesgnum);

int LINES, COLUMNS;
+ int r = 0;

menu_get_sizes(page, &LINES, &COLUMNS);

***************
*** 139,145 ****


/* 2 == text_only -- Not envelope information */
if (text_only > 0) {

if (tagged == 1)
! gen_browser(page,


XXX,&buffer,redraw,
delete ? word_save : word_copy,

prev_fold,
--- 140,146 ----


/* 2 == text_only -- Not envelope information */
if (text_only > 0) {

if (tagged == 1)
! r = gen_browser(page,


XXX,&buffer,redraw,
delete ? word_save : word_copy,

prev_fold,
***************
*** 148,154 ****
"%s text of message to: "),

(delete ? cap_save_word : cap_copy_word));
else

! gen_browser(page,


XXX,&buffer,redraw,
delete ? word_save : word_copy,

prev_fold,
--- 149,155 ----
"%s text of message to: "),

(delete ? cap_save_word : cap_copy_word));
else

! r = gen_browser(page,


XXX,&buffer,redraw,
delete ? word_save : word_copy,

prev_fold,
***************
*** 158,164 ****


(delete ? cap_save_word : cap_copy_word));
} else {

if (tagged == 1)
! gen_browser(page,


XXX,&buffer,redraw,
delete ? word_save : word_copy,

prev_fold,
--- 159,165 ----


(delete ? cap_save_word : cap_copy_word));
} else {

if (tagged == 1)
! r = gen_browser(page,


XXX,&buffer,redraw,
delete ? word_save : word_copy,

prev_fold,
***************
*** 167,173 ****
"%s message to: "),

(delete ? cap_save_word : cap_copy_word));
else

! gen_browser(page,


XXX,&buffer,redraw,
delete ? word_save : word_copy,

prev_fold,
--- 168,174 ----
"%s message to: "),

(delete ? cap_save_word : cap_copy_word));
else

! r = gen_browser(page,


XXX,&buffer,redraw,
delete ? word_save : word_copy,

prev_fold,
***************
*** 176,183 ****
--- 177,195 ----
"%s messages to: "),
(delete ? cap_save_word : cap_copy_word));
}
+
GetXYLocation(&X,&Y);

+
+ if (!r) {
+ DPRINT(Debug,4,(&Debug, "Canceled...\n"));
+ if (chdr)
+ chdr->status = oldstat; /* BACK! */
+
+ retval = 0;


+ goto clean;
+ }
+

code = give_dir_flags(XXX);

DPRINT(Debug,4,(&Debug,
Index: elm2.4.ME+.118-cvs/src/fileio.c
*** elm2.4.ME+.117/src/fileio.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/fileio.c 2004-07-20 21:33:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.56 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fileio.c,v 1.57 2004/07/20 18:33:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 427,438 ****
long body_bytes = 0;
int crypted = OFF;
int buf_len;

DPRINT(Debug,5,(&Debug,
"copy_encrypted called: Need read %d bytes\n",
current_header->content_length));

! getkey(OFF);

/* default-nomime-charset gives assumed charset */
dest_file -> filter = default_nomime_charset;
--- 427,439 ----
long body_bytes = 0;
int crypted = OFF;
int buf_len;
+ int ok;

DPRINT(Debug,5,(&Debug,
"copy_encrypted called: Need read %d bytes\n",
current_header->content_length));

! ok = getkey(OFF);

/* default-nomime-charset gives assumed charset */
dest_file -> filter = default_nomime_charset;
***************
*** 449,474 ****
LF -> CRLF conversion
*/
state_convert_EOLN(buffer,&buf_len,sizeof buffer,dest_file);
!
! if (mime_body_keywords && !strncmp(buffer, START_ENCODE, strlen(START_ENCODE))) {
! crypted = ON;
! state_printf(dest_file,
! CATGETS(elm_msg_cat, MeSet, MeDecodeStartElmEncoded,
! "-- Start of (Elm) encoded section.\n"));
! continue;
! } else if (mime_body_keywords && !strncmp(buffer, END_ENCODE, strlen(END_ENCODE))) {
! crypted = OFF;
! state_printf(dest_file,
! CATGETS(elm_msg_cat, MeSet, MeDecodeEndElmEncoded,
! "-- End of (Elm) encoded section.\n"));
! continue;
! } else if (crypted) {
! no_ret(buffer);
! encode(buffer);
! if (dest_file->EOLN_is_CRLF)
! strfcat(buffer, "\r\n", sizeof buffer);
! else
! strfcat(buffer, "\n", sizeof buffer);
}

err = state_puts(prefix,dest_file);
--- 450,477 ----
LF -> CRLF conversion
*/
state_convert_EOLN(buffer,&buf_len,sizeof buffer,dest_file);
!
! if (ok > 0) {
! if (mime_body_keywords && !strncmp(buffer, START_ENCODE, strlen(START_ENCODE))) {
! crypted = ON;
! state_printf(dest_file,
! CATGETS(elm_msg_cat, MeSet, MeDecodeStartElmEncoded,
! "-- Start of (Elm) encoded section.\n"));
! continue;
! } else if (mime_body_keywords && !strncmp(buffer, END_ENCODE, strlen(END_ENCODE))) {
! crypted = OFF;
! state_printf(dest_file,
! CATGETS(elm_msg_cat, MeSet, MeDecodeEndElmEncoded,
! "-- End of (Elm) encoded section.\n"));
! continue;
! } else if (crypted) {
! no_ret(buffer);
! encode(buffer);
! if (dest_file->EOLN_is_CRLF)
! strfcat(buffer, "\r\n", sizeof buffer);
! else
! strfcat(buffer, "\n", sizeof buffer);
! }
}

err = state_puts(prefix,dest_file);
Index: elm2.4.ME+.118-cvs/src/hdrconfg.c
*** elm2.4.ME+.117/src/hdrconfg.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/hdrconfg.c 2004-07-14 10:54:05.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.40 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.43 2004/07/14 07:54:05 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 831,842 ****
print_format_center(INSTRUCT_LINE,
CATGETS(elm_msg_cat, ElmSet,
ElmHdrmenuInstruct1,
! "Choose header, u)ser defined header, !)shell, invoke e)ditor, or <return>."));
#else
print_format_center(INSTRUCT_LINE,
CATGETS(elm_msg_cat, ElmSet,
ElmHdrmenuInstruct1NoShell,
! "Choose header, u)ser defined header, invoke e)ditor, or <return>."));
#endif

} else {
--- 831,842 ----
print_format_center(INSTRUCT_LINE,
CATGETS(elm_msg_cat, ElmSet,
ElmHdrmenuInstruct1,
! "Choose header, u)ser defined header, !)shell, invoke e(d)itor, or <return>."));
#else
print_format_center(INSTRUCT_LINE,
CATGETS(elm_msg_cat, ElmSet,
ElmHdrmenuInstruct1NoShell,
! "Choose header, u)ser defined header, invoke e(d)itor, or <return>."));
#endif

} else {
***************
*** 862,873 ****
c = precmd;
precmd = 0;
} else {
! c = menu_ReadCh(page,REDRAW_MARK|READCH_resize);
if (c == REDRAW_MARK) {
do_redraw = TRUE;
continue;
}

if (c == RESIZE_MARK) {
DPRINT(Debug,4, (&Debug, " ... resizing\n"));
goto resize_mark;
--- 862,876 ----
c = precmd;
precmd = 0;
} else {
! c = menu_ReadCh(page,REDRAW_MARK|READCH_resize|READCH_sig_char);
if (c == REDRAW_MARK) {
do_redraw = TRUE;
continue;
}

+ if (c == TERMCH_interrupt_char)
+ goto OUT;
+
if (c == RESIZE_MARK) {
DPRINT(Debug,4, (&Debug, " ... resizing\n"));
goto resize_mark;
***************
*** 901,907 ****
do_redraw = TRUE;
break;

! case 'e':
if (editor_val) {
editor_available &= have_editor(editor_val);

--- 904,910 ----
do_redraw = TRUE;
break;

! case 'd':
if (editor_val) {
editor_available &= have_editor(editor_val);

***************
*** 1039,1045 ****
ret = optionally_enter2(page, &buffer, INPUT_LINE, 0,
(do_append ? OE_APPEND_CURRENT : 0) |
(do_comma ? OE_ADD_COMMA : 0) |
! OE_REDRAW_MARK,
FRM("%s"),header_name);
if (ret == REDRAW_MARK) {
h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page);
--- 1042,1048 ----
ret = optionally_enter2(page, &buffer, INPUT_LINE, 0,
(do_append ? OE_APPEND_CURRENT : 0) |
(do_comma ? OE_ADD_COMMA : 0) |
! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,
FRM("%s"),header_name);
if (ret == REDRAW_MARK) {
h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page);
***************
*** 1049,1056 ****
hdrmenu_clear_promptarea(page);

/* bail out on error */
! if (ret < 0) {
! h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page);
return -1;
}
/* see if there is some processing required on this value */
--- 1052,1061 ----
hdrmenu_clear_promptarea(page);

/* bail out on error */
! if (ret != 0) {
! if (buffer)
! h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,
! page);
return -1;
}
/* see if there is some processing required on this value */
Index: elm2.4.ME+.118-cvs/src/help.c
*** elm2.4.ME+.117/src/help.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/help.c 2004-07-14 15:07:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.18 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.20 2004/07/14 12:07:43 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 76,85 ****
CATGETS(elm_msg_cat, ElmSet, ElmHelpPrompt,
"Help for key: "));

! ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR);

if (ch == REDRAW_MARK) return 1;
if (ch == '.') return(0); /* zero means footer rewrite only */

s = unknown_command;

Kari E. Hurtta

unread,
Jul 23, 2004, 3:51:42 AM7/23/04
to
Archive-name: elm2.4ME+/PL118.2

Before applying patch catenate parts 1 - 2 first.

This patch is agaist Elm 2.4ME+ PL117 (25)

========================================================================
--- 76,87 ----


CATGETS(elm_msg_cat, ElmSet, ElmHelpPrompt,
"Help for key: "));

! ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR

! |READCH_sig_char);



if (ch == REDRAW_MARK) return 1;
if (ch == '.') return(0); /* zero means footer rewrite only */

+ if (ch == TERMCH_interrupt_char) return 0;

s = unknown_command;

***************
*** 424,449 ****

while (fgets(buffer, SLEN, fileptr) != NULL) {
if (lines > LINES-4) {
PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHelpPressSpaceToContinue,
! "Press <space> to continue, 'q' to return."));
! if(menu_ReadCh(page,0) == 'q') {
! clear_error();
! fclose(fileptr);
!
! goto OUT;
}
! lines = 0;
! menu_ClearScreen(page);
! Write_to_screen(FRM("%s\r"), buffer);
! }
! else
! Write_to_screen(FRM("%s\r"), buffer);
!
lines += strlen(buffer)/COLUMNS + 1;
}
!
PutLineX(LINES-1, 0,
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressAnyKeyToReturn,
--- 426,454 ----

while (fgets(buffer, SLEN, fileptr) != NULL) {
if (lines > LINES-4) {
+ int X;
PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHelpPressSpaceToContinue,
! "Press <space> to continue, 'q' to return."));
! X = menu_ReadCh(page,READCH_sig_char);
! if(X == 'q' || X == 'Q' ||
! X == TERMCH_interrupt_char) {
! clear_error();
! fclose(fileptr);
!
! goto OUT;
! }
! lines = 0;
! menu_ClearScreen(page);
! Write_to_screen(FRM("%s\r"), buffer);
}
! else
! Write_to_screen(FRM("%s\r"), buffer);
!
lines += strlen(buffer)/COLUMNS + 1;
}
!
PutLineX(LINES-1, 0,
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressAnyKeyToReturn,
Index: elm2.4.ME+.118-cvs/src/init.c
*** elm2.4.ME+.117/src/init.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/init.c 2004-07-10 21:55:34.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: init.c,v 1.50 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: init.c,v 1.52 2004/07/10 18:55:34 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 30,58 ****
}


- static void get_term_chars P_((void));
-
- #ifdef TERMIOS
- # include <termios.h>
- typedef struct termios term_buff;
- #else
- # ifdef TERMIO
- # include <termio.h>
- # define tcgetattr(fd,buf) ioctl((fd),TCGETA,(buf))
- typedef struct termio term_buff;
- # else
- # include <sgtty.h>
- typedef struct {
- struct sgttyb sgttyb;
- struct tchars tchars;
- #ifdef TIOCLGET
- struct ltchars ltchars;
- #endif
- } term_buff;
- static int tcgetattr P_((int,term_buff *)); /* Prototype */


- # endif
- #endif
-

#ifdef PWDINSYS
# include <sys/pwd.h>
#else

--- 30,35 ----


***************
*** 245,251 ****

/*
* If debug level is fairly low, ignore keyboard signals
- * until the screen is set up.
*/

/* FIXME -- Probably wrong variable ... */

--- 222,227 ----
***************
*** 253,258 ****
--- 229,237 ----


signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
}
+ #else
+ signal(SIGINT, SIG_IGN);
+ signal(SIGQUIT, SIG_IGN);
#endif

if(!check_only && !batch_only) {

***************
*** 308,315 ****
init_backgroud_handling();
#endif

- /* ? ? ? ? */
- get_term_chars();

/* Determine options that might be set in the global elmrc */
if (init_defaults() != 0) {
--- 287,292 ----
***************
*** 730,807 ****
#endif
}

- static void get_term_chars()
- {
- /** This routine sucks out the special terminal characters
- ERASE and KILL for use in the input routine. The meaning
- of the characters are (dare I say it?) fairly obvious... **/
-
- term_buff term_buffer;
-
- if (tcgetattr(STANDARD_INPUT,&term_buffer) == -1) {
- int err = errno;
-
- DPRINT(Debug,3,
- (&Debug,
- "Error: %s encountered on ioctl call (get_term_chars)\n",
- error_description(err)));
-
- /* set to defaults for terminal driver */
- backspace = BACKSPACE;
- kill_line = ctrl('U');
- word_erase = ctrl('W');
- interrupt_char = 0177; /* DEL */
- reprint_char = ctrl('R');
- eof_char = ctrl('D');
- } else {
- #if defined(TERMIO) || defined(TERMIOS)
- backspace = term_buffer.c_cc[VERASE];
- kill_line = term_buffer.c_cc[VKILL];
- #if defined(TERMIOS) && defined(VWERASE)
- word_erase = term_buffer.c_cc[VWERASE];
- #else
- word_erase = ctrl('W');
- #endif
- interrupt_char = term_buffer.c_cc[VINTR];
- #if defined(TERMIOS) && defined(VREPRINT)
- reprint_char = term_buffer.c_cc[VREPRINT];
- #else
- reprint_char = ctrl('R');
- #endif
- eof_char = term_buffer.c_cc[VEOF];
- #else
- backspace = term_buffer.sgttyb.sg_erase;
- kill_line = term_buffer.sgttyb.sg_kill;
- #ifdef TIOCLGET
- word_erase = term_buffer.ltchars.t_werasc;
- reprint_char = term_buffer.ltchars.t_rprntc;
- #else
- word_erase = ctrl('W');
- reprint_char = ctrl('R');
- #endif
- interrupt_char = term_buffer.tchars.t_intrc;
- eof_char = term_buffer.tchars.t_eofc;


- #endif
- }
- }
-

- #if !defined(TERMIO) && !defined(TERMIOS)
- static int
- tcgetattr(fd, buf)
- int fd;
- term_buff *buf;
- {
- if (ioctl(fd, TIOCGETP, &buf->sgttyb) < 0)
- return(-1);
- if (ioctl(fd, TIOCGETC, &buf->tchars) < 0)
- return(-1);
- #ifdef TIOCLGET
- if (ioctl(fd, TIOCLGET, &buf->ltchars) < 0)
- return(-1);
- #endif
- return(0);
- }
- #endif

/*
* Local Variables:
--- 707,712 ----
Index: elm2.4.ME+.118-cvs/src/in_utils.c
*** elm2.4.ME+.117/src/in_utils.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.118-cvs/src/in_utils.c 2004-07-11 20:44:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.37 2004/05/02 11:15:26 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.39 2004/07/11 17:44:51 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 73,79 ****


int center = flags & PROMPT_center;

int yesno = flags & PROMPT_yesno;

int mark = flags & PROMPT_redraw_mark;

! int ctrlL = flags & PROMTP_ctrlL;
int cols = 0;


--- 73,80 ----


int center = flags & PROMPT_center;

int yesno = flags & PROMPT_yesno;

int mark = flags & PROMPT_redraw_mark;

! int ctrlL = flags & PROMPT_ctrlL;
! int cancel = flags & PROMPT_cancel;
int cols = 0;


***************
*** 105,121 ****


FRM("%S%c%c"), question, def, BACKSPACE);

FlushBuffer();

! ch = menu_ReadCh(page, REDRAW_MARK);
if (ch == REDRAW_MARK) {
if (mark)
break;
continue;
}

! if (PROMTP_ctrlL && ch == ('L'&31)) {
break;
}

if (ch == EOF)
break;

--- 106,126 ----


FRM("%S%c%c"), question, def, BACKSPACE);

FlushBuffer();

! ch = menu_ReadCh(page, REDRAW_MARK
! | ( cancel ? READCH_sig_char : 0 ));
if (ch == REDRAW_MARK) {
if (mark)
break;
continue;
}

! if (ctrlL && ch == ('L'&31)) {
break;
}

+ if (cancel && ch == TERMCH_interrupt_char)
+ break;


+
if (ch == EOF)

break;

***************
*** 167,173 ****
out:
FlushBuffer();

! if (EOF != ch && REDRAW_MARK != ch && ('L'&31) != ch) {
if (sleepmsg > 0) {
#if POLL_METHOD


wait_for_timeout((sleepmsg + 1) / 2);

--- 172,179 ----
out:
FlushBuffer();

! if (EOF != ch && REDRAW_MARK != ch && ('L'&31) != ch &&
! TERMCH_interrupt_char != ch) {
if (sleepmsg > 0) {
#if POLL_METHOD


wait_for_timeout((sleepmsg + 1) / 2);

***************
*** 281,292 ****

status = optionally_enter2(page,
&buff, LINES-4, COLUMNS-40,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
CATGETS(elm_msg_cat, ElmSet,
ElmSetCurrentTo,
"Set current %S to :"), item);

! if (status == -1)
return(current);
if (status == REDRAW_MARK) {
*redraw = 1;
--- 287,299 ----

status = optionally_enter2(page,
&buff, LINES-4, COLUMNS-40,
! OE_APPEND_CURRENT|OE_REDRAW_MARK|
! OE_SIG_CHAR /* allow Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
ElmSetCurrentTo,
"Set current %S to :"), item);

! if (status == -1) /* Ctrl-C */
return(current);
if (status == REDRAW_MARK) {
*redraw = 1;
***************
*** 310,316 ****
{
int append_current, passwd, allowmime,
redraw, alt_solidus, allowtab, use_editor_escape,
! tabaction;
struct string **buffer;
int ret = 0;

--- 317,323 ----
{
int append_current, passwd, allowmime,
redraw, alt_solidus, allowtab, use_editor_escape,
! tabaction, sig_char;
struct string **buffer;


int ret = 0;

***************

*** 330,339 ****
use_editor_escape = 0 != (info -> flags & OE_EDITOR_ESCAPE);
tabaction = 0 != (info -> flags & OE_TABACTION);
allowtab = !tabaction;

DPRINT(Debug,4,
(&Debug,
! "== enter_helper: ch_count=%d %s%s%s%s%s%s%s%s%s\n",
info->ch_count,
append_current ? "append_current " : "",
add_comma ? "add_comma " : "",
--- 337,347 ----
use_editor_escape = 0 != (info -> flags & OE_EDITOR_ESCAPE);
tabaction = 0 != (info -> flags & OE_TABACTION);
allowtab = !tabaction;
+ sig_char = 0 != (info -> flags & OE_SIG_CHAR) ? READCH_sig_char : 0;

DPRINT(Debug,4,
(&Debug,
! "== enter_helper: ch_count=%d %s%s%s%s%s%s%s%s%s%s\n",
info->ch_count,
append_current ? "append_current " : "",
add_comma ? "add_comma " : "",
***************
*** 343,349 ****
alt_solidus ? "alt_solidus " : "",
use_editor_escape ? "use_editor_escape " : "",
allowtab ? "allowtab " : "",
! tabaction ? "tabaction " : ""));

while(buffer) {
int escaped = OFF;
--- 351,358 ----
alt_solidus ? "alt_solidus " : "",
use_editor_escape ? "use_editor_escape " : "",
allowtab ? "allowtab " : "",
! tabaction ? "tabaction " : "",
! sig_char ? "sig_char " : ""));

while(buffer) {
int escaped = OFF;
***************
*** 393,399 ****
wrap_column = COLUMNS -5;
ch = menu_ReadCh2(info->current_page,
redraw|READCH_CURSOR|resize|
! (escaped ? 0 : READCH_term_char));

reprocess_key:
if (!ch) {
--- 402,410 ----
wrap_column = COLUMNS -5;
ch = menu_ReadCh2(info->current_page,
redraw|READCH_CURSOR|resize|
! (escaped ? 0 :
! READCH_term_char|sig_char)|
! (escaped ? READCH_quote : 0));

reprocess_key:
if (!ch) {
Index: elm2.4.ME+.118-cvs/src/leavembox.c
*** elm2.4.ME+.117/src/leavembox.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/leavembox.c 2004-07-11 20:44:51.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.47 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.48 2004/07/11 17:44:51 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 636,659 ****
/* ============================================================== */

if(marked_deleted) {
! char answer = (always_del ?

*def_ans_yes : *def_ans_no); /* default answer */

if(ask_questions) {
! char * buffer = NULL;

if (marked_deleted == 1)
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveDeleteMessage,
! "Delete message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
else
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveDeleteMessages,
! "Delete messages? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! answer = want_to(buffer, answer, LINES-4, 0, page);
! free(buffer);
}

if(answer == *def_ans_yes) {
--- 636,682 ----
/* ============================================================== */

if(marked_deleted) {
! int answer = (always_del ?

*def_ans_yes : *def_ans_no); /* default answer */

if(ask_questions) {
! int def = answer;

+ againD:


+ menu_get_sizes(page, &LINES, &COLUMNS);
+

+ /* NOTICE: prompt_letter may return EOF */


if (marked_deleted == 1)
! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|

! PROMPT_redraw_mark|PROMPT_ctrlL,

! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLeaveDeleteMessage,
! "Delete message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


else
! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|

! PROMPT_redraw_mark|PROMPT_ctrlL,

! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLeaveDeleteMessages,
! "Delete messages? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!

! if (TERMCH_interrupt_char == answer) {

! return_value = -1; /* failure */
! goto cleanup;
! }
!

! if (answer == ('L'&31) || answer == REDRAW_MARK) {
! menu_ClearScreen(page);

! goto againD;
! }
!
! if (answer == EOF)
! emergency_exit(0);
}

if(answer == *def_ans_yes) {
***************
*** 740,747 ****


/* NOTICE: prompt_letter may return EOF */

answer = prompt_letter(LINES-4,"P",*def_ans_yes,
! PROMPT_center|PROMPT_yesno|
! PROMPT_redraw_mark|PROMTP_ctrlL,

page,
CATGETS(elm_msg_cat, ElmSet,
ElmNoReceived,
--- 763,770 ----



/* NOTICE: prompt_letter may return EOF */

answer = prompt_letter(LINES-4,"P",*def_ans_yes,

! PROMPT_center|PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet,
ElmNoReceived,
***************
*** 756,762 ****



if (answer == 'P' || answer == EOF)

emergency_exit(0);
!

if (answer != *def_ans_yes) {
return_value = -2; /* failure */

goto cleanup;
--- 779,790 ----



if (answer == 'P' || answer == EOF)

emergency_exit(0);


!
! if (TERMCH_interrupt_char == answer) {

! return_value = -1; /* failure */
! goto cleanup;
! }
!

if (answer != *def_ans_yes) {
return_value = -2; /* failure */

goto cleanup;
***************
*** 785,791 ****
to_keep));

} else {


! char answer = '\0';

int marked_read=0;

/* Let's first see if user wants to store read messages
--- 813,819 ----
to_keep));

} else {


! int answer = '\0';

int marked_read=0;

/* Let's first see if user wants to store read messages
***************
*** 822,843 ****


*def_ans_yes : *def_ans_no); /* default answer */

if(ask_questions) {
! char * buffer = NULL;

if (marked_read == 1)
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveMoveMessage,
! "Move read message to \"received\" folder? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
else
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveMoveMessages,
! "Move read messages to \"received\" folder? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


! answer = want_to(buffer, answer, LINES-4, 0,
! page);

! asked_storage_q = TRUE;
! free(buffer);
}

sc = get_storage_count(mailbox);
--- 850,896 ----


*def_ans_yes : *def_ans_no); /* default answer */

if(ask_questions) {
! int def = answer;
!

! againR:


! menu_get_sizes(page, &LINES, &COLUMNS);
!
! /* NOTICE: prompt_letter may return EOF */

if (marked_read == 1)


! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|

! PROMPT_redraw_mark|PROMPT_ctrlL,

! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLeaveMoveMessage,
! "Move read message to \"received\" folder? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


else
! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|

! PROMPT_redraw_mark|PROMPT_ctrlL,
! page,
!
! CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveMoveMessages,
! "Move read messages to \"received\" folder? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!

! if (TERMCH_interrupt_char == answer) {

! return_value = -1; /* failure */
! goto cleanup;
! }
!

! if (answer == ('L'&31) || answer == REDRAW_MARK) {
! menu_ClearScreen(page);

! goto againR;
! }
!
! if (answer == EOF)
! emergency_exit(0);
!
! asked_storage_q = TRUE;
}

sc = get_storage_count(mailbox);
***************
*** 945,964 ****
answer = (always_keep ?

*def_ans_yes : *def_ans_no); /* default answer */

if(ask_questions) {
! char * buffer = NULL;

if (marked_unread == 1)
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveKeepMessage,
"Keep unread message in incoming mailbox? (%c/%c) "),
*def_ans_yes, *def_ans_no);
else
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet, ElmLeaveKeepMessages,
! "Keep unread messages in incoming mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


! answer = want_to(buffer, answer, LINES-4, 0,
! page);

! free(buffer);
}


--- 998,1041 ----
answer = (always_keep ?

*def_ans_yes : *def_ans_no); /* default answer */

if(ask_questions) {
! int def = answer;
!

! againK:


! menu_get_sizes(page, &LINES, &COLUMNS);
!
! /* NOTICE: prompt_letter may return EOF */

if (marked_unread == 1)


! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|

! PROMPT_redraw_mark|PROMPT_ctrlL,

! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLeaveKeepMessage,
"Keep unread message in incoming mailbox? (%c/%c) "),


*def_ans_yes, *def_ans_no);
else
! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|

! PROMPT_redraw_mark|PROMPT_ctrlL,
! page,
! CATGETS(elm_msg_cat, ElmSet, ElmLeaveKeepMessages,
! "Keep unread messages in incoming mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!

! if (TERMCH_interrupt_char == answer) {

! return_value = -1; /* failure */
! goto cleanup;
! }
!

! if (answer == ('L'&31) || answer == REDRAW_MARK) {
! menu_ClearScreen(page);

! goto againK;
! }
!
! if (answer == EOF)
! emergency_exit(0);
!
}


Index: elm2.4.ME+.118-cvs/src/limit.c
*** elm2.4.ME+.117/src/limit.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/limit.c 2004-07-11 14:36:08.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: limit.c,v 1.32 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: limit.c,v 1.33 2004/07/11 11:36:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 107,113 ****

if (0 != optionally_enter2(page,
&criteria,LINES-3,0,
! OE_ALLOW_MIMEENC,
CATGETS(elm_msg_cat, ElmSet,
ElmLimitEnterCriteria,
"Enter criteria or '?' for help: "))
--- 107,114 ----

if (0 != optionally_enter2(page,
&criteria,LINES-3,0,
! OE_ALLOW_MIMEENC|


! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmLimitEnterCriteria,
"Enter criteria or '?' for help: "))
Index: elm2.4.ME+.118-cvs/src/mailmsg1.c
*** elm2.4.ME+.117/src/mailmsg1.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/mailmsg1.c 2004-07-18 23:55:15.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.40 2004/06/27 15:18:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.43 2004/07/18 20:55:15 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 30,36 ****
static int to_line, to_col;



static enum copy_msg_mode { cm_no_copy = 0, cm_get_copy, cm_canceled_mail,
! cm_mimeforward

} copy_the_msg P_((struct mailing_headers *headers,
int options,
struct menu_context *page));
--- 30,36 ----
static int to_line, to_col;


static enum copy_msg_mode { cm_no_copy = 0, cm_get_copy, cm_canceled_mail,

! cm_mimeforward, cm_CANCEL
} copy_the_msg P_((struct mailing_headers *headers,
int options,
struct menu_context *page));
***************
*** 174,186 ****
expanded_to_edit_buffer(&buffer, *to);

if (to->surface_len == 0) {


!
! if (user_level < 2) {

! int code;

code = optionally_enter2(page,
&buffer, LINES-3, 0,
! OE_REDRAW_MARK,
CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));
--- 174,187 ----
expanded_to_edit_buffer(&buffer, *to);

if (to->surface_len == 0) {
! int code;
!
! if (user_level < 2) {

code = optionally_enter2(page,
&buffer, LINES-3, 0,


! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));
***************
*** 189,223 ****
while (REDRAW_MARK == code) {
code = optionally_enter2(page,
&buffer, LINES-3, 0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));
}
- if (0 != code) {
- free_string(&buffer);
- return 0;
- }
}
else {
- int code;
code = optionally_enter2(page,
&buffer, LINES-3, 0,
! OE_REDRAW_MARK,
CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));
while (code == REDRAW_MARK) {
code = optionally_enter2(page,
&buffer, LINES-3, 0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));


}
! if (0 != code) {

! free_string(&buffer);
! return 0;
}
}
if (string_len(buffer) == 0) {
free_expanded_address(to);
ClearLine(LINES-3);
--- 190,234 ----
while (REDRAW_MARK == code) {
code = optionally_enter2(page,
&buffer, LINES-3, 0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));
}
}
else {
code = optionally_enter2(page,
&buffer, LINES-3, 0,

! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));
while (code == REDRAW_MARK) {
code = optionally_enter2(page,
&buffer, LINES-3, 0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));
}
! }
!
! if (0 != code) {
!

! if (-1 == code) { /* Ctrl-C */

! MoveCursor(LINES-3,0);
! CleartoEOLN();
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
! "Mail not sent."));
}
+
+ if (buffer)
+ free_string(&buffer);


+ return 0;
}
+
+

if (string_len(buffer) == 0) {
free_expanded_address(to);
ClearLine(LINES-3);
***************
*** 322,327 ****
--- 333,342 ----
options, page);

switch (copy_msg) {
+ case cm_CANCEL:
+ res = 0;
+ goto free_it;
+
case cm_get_copy:
options |= MAIL_COPY_MSG;
break;
***************
*** 333,340 ****



/* get the To: address and expand --

*/
! if (! get_to(&headers.to,mailer_info,aview, page))
! return(0);

/* expand the Cc: address */
if (&headers.cc.surface_len)
--- 348,357 ----



/* get the To: address and expand --

*/
! if (! get_to(&headers.to,mailer_info,aview, page)) {
! res = 0;
! goto free_it;
! }

/* expand the Cc: address */
if (&headers.cc.surface_len)
***************
*** 503,509 ****
OE_APPEND_CURRENT|OE_REDRAW_MARK
/* Allow user paste mime encoded
words to buffer */
! |OE_ALLOW_MIMEENC,
CATGETS(elm_msg_cat, ElmSet,
ElmSubjectOfMessage,
"Subject of message: "));
--- 520,527 ----
OE_APPEND_CURRENT|OE_REDRAW_MARK
/* Allow user paste mime encoded
words to buffer */
! |OE_ALLOW_MIMEENC


! |OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmSubjectOfMessage,
"Subject of message: "));
***************
*** 513,519 ****
OE_APPEND_CURRENT|OE_REDRAW_MARK
/* Allow user paste mime encoded
words to buffer */
! |OE_ALLOW_MIMEENC,
CATGETS(elm_msg_cat, ElmSet, ElmSubject,
"Subject: "));

--- 531,538 ----
OE_APPEND_CURRENT|OE_REDRAW_MARK
/* Allow user paste mime encoded
words to buffer */
! |OE_ALLOW_MIMEENC


! |OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmSubject,
"Subject: "));

***************
*** 521,527 ****
goto redraw;

if(code==-1){
! /** User hit the BREAK key! **/
MoveCursor(prompt_line,0);
CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
--- 540,546 ----
goto redraw;

if(code==-1){
! /** User hit Ctrl-C key! **/
MoveCursor(prompt_line,0);
CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
***************
*** 607,624 ****

code = optionally_enter2(page,
&buffer, prompt_line,0,
! OE_REDRAW_MARK,
CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));
while (REDRAW_MARK == code) {
code = optionally_enter2(page,
&buffer, prompt_line,0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));

}
! if (code == -1) {
ClearLine(prompt_line-1);
ClearLine(prompt_line);

--- 626,645 ----

code = optionally_enter2(page,
&buffer, prompt_line,0,

! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));
while (REDRAW_MARK == code) {
code = optionally_enter2(page,
&buffer, prompt_line,0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));

}
! if (code == -1) { /* Ctrl-C */
ClearLine(prompt_line-1);
ClearLine(prompt_line);

***************
*** 626,632 ****
"Mail not sent."));

/* Free it */
! buffer_to_header(cc,&buffer,TRUE,mailer_info,aview);

return(0);
}
--- 647,654 ----
"Mail not sent."));

/* Free it */
! if (buffer)
! buffer_to_header(cc,&buffer,TRUE,mailer_info,aview);

return(0);
}
***************
*** 686,696 ****


int def = mimeforward ? *def_ans_yes : *def_ans_no;

int X1;



X1 = prompt_letter(LINES-4,"",def,
! PROMPT_yesno,page,

CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,


"Forward message as separate part? (%c/%c) "),

*def_ans_yes, *def_ans_no);


X = (X1 == *def_ans_yes);
}

--- 708,730 ----


int def = mimeforward ? *def_ans_yes : *def_ans_no;

int X1;

+ /* NOTICE: prompt_letter may return EOF */
+
X1 = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel,page,
CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,


"Forward message as separate part? (%c/%c) "),

*def_ans_yes, *def_ans_no);
+
+ if (TERMCH_interrupt_char == X1) {
+ answer = cm_CANCEL;
+ goto out;
+ }
+
+ if (EOF == X1)

+ goto out;
+
+

X = (X1 == *def_ans_yes);
}

***************
*** 703,719 ****
else {
int X,X1;



! X1 = prompt_letter(LINES-4,"",*def_ans_no,
! PROMPT_yesno,page,
! CATGETS(elm_msg_cat, ElmSet, ElmCopyMessageYN,
! "Copy message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! X = (X1 == *def_ans_yes);

! answer = X ? cm_get_copy : cm_no_copy;
}
}

return(answer);
}

--- 737,765 ----
else {
int X,X1;



! /* NOTICE: prompt_letter may return EOF */

! X1 = prompt_letter(LINES-4,"",*def_ans_no,

! PROMPT_yesno|PROMPT_cancel,page,

! CATGETS(elm_msg_cat, ElmSet, ElmCopyMessageYN,
! "Copy message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!

! if (TERMCH_interrupt_char == X1) {
! answer = cm_CANCEL;
! goto out;
! }
!
! if (EOF == X1)
! goto out;
!

! X = (X1 == *def_ans_yes);
!
! answer = X ? cm_get_copy : cm_no_copy;
}
}

+ out:
return(answer);
}

Index: elm2.4.ME+.118-cvs/src/mailmsg2.c
*** elm2.4.ME+.117/src/mailmsg2.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/mailmsg2.c 2004-07-14 14:17:24.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.83 2004/06/27 15:18:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.83 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.89 2004/07/14 11:17:24 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.89 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 121,128 ****

if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {

DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));

! if(DSN_success || !reask)


(*dsn) |= DSN_SUCCESS|DSN_FAILURE|DSN_DELAY;

} else if (*dsn) {
*dsn = 0;

--- 121,130 ----

if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {

DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));

! if(DSN_success && !reask) {


(*dsn) |= DSN_SUCCESS|DSN_FAILURE|DSN_DELAY;

+ DPRINT(Debug,8,(&Debug," dsn-success is set .. enabling\n"));
+ }
} else if (*dsn) {
*dsn = 0;

***************
*** 1084,1090 ****
} else if (ch != *def_ans_no) {
Write_to_screen(FRM("%c??"), 07); /* BEEP */
if (sleepmsg > 0)
! sleep((sleepmsg + 1) / 2);
ch = 0;
}
} while (ch == 0);
--- 1086,1092 ----
} else if (ch != *def_ans_no) {
Write_to_screen(FRM("%c??"), 07); /* BEEP */
if (sleepmsg > 0)
! error_sleep((sleepmsg + 1) / 2);
ch = 0;
}
} while (ch == 0);
***************
*** 1132,1152 ****
if (DSN_NEVER & *dsn) { success = 0; failure = 0; delay = 0; }
}

! generic_menu(dsn_items,sizeof dsn_items / sizeof (struct menu_item),
"DSN (Delivery Status Notification) Configuration",
! "DSN: ");
!
! if (DSN_off) *dsn = 0;
! else if (!success && !failure && !delay) *dsn = DSN_NEVER;
! else {
! int val = 0;
! if (hdr_only) val |= DSN_HDRS;
! else val |= DSN_FULL;
! if (success) val |= DSN_SUCCESS;
! if (failure) val |= DSN_FAILURE;
! if (delay) val |= DSN_DELAY;

! *dsn = val;
}
}

--- 1134,1155 ----
if (DSN_NEVER & *dsn) { success = 0; failure = 0; delay = 0; }
}

! if (generic_menu(dsn_items,sizeof dsn_items / sizeof (struct menu_item),
"DSN (Delivery Status Notification) Configuration",
! "DSN: ")) {

! if (DSN_off) *dsn = 0;
! else if (!success && !failure && !delay) *dsn = DSN_NEVER;
! else {
! int val = 0;
! if (hdr_only) val |= DSN_HDRS;
! else val |= DSN_FULL;
! if (success) val |= DSN_SUCCESS;
! if (failure) val |= DSN_FAILURE;
! if (delay) val |= DSN_DELAY;
!
! *dsn = val;
! }
}
}

***************
*** 1184,1190 ****
/* NOTE: Currently alias expansion is not possble */

ret = optionally_enter2(page,
! &buffer,LINES-2, 0, OE_REDRAW_MARK,
CATGETS(elm_msg_cat, ElmSet,
ElmPreSEnvFromPrompt,
"Return-path: "));
--- 1187,1195 ----
/* NOTE: Currently alias expansion is not possble */

ret = optionally_enter2(page,
! &buffer,LINES-2, 0,

! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmPreSEnvFromPrompt,
"Return-path: "));
***************
*** 1197,1205 ****
--- 1202,1216 ----
free(s);
}

+ if (buffer)
+ free_string(&buffer);
+
if (ret == REDRAW_MARK)
return REDRAW_MARK;

+ if (0 != ret) /* Error or Ctrl-C */
+ return 1;
+
ClearLine(5);

t = mailer_env_from_value(headers->env_from,&can_edit);
***************
*** 1426,1432 ****
if (bad_cmd) {
Write_to_screen(FRM("%c??"), 07);
if (sleepmsg > 0)
! sleep((sleepmsg + 1) / 2);
bad_cmd = FALSE;
}

--- 1437,1443 ----
if (bad_cmd) {
Write_to_screen(FRM("%c??"), 07);
if (sleepmsg > 0)
! error_sleep((sleepmsg + 1) / 2);
bad_cmd = FALSE;
}

***************
*** 1468,1473 ****
--- 1479,1488 ----
#endif
cmd = tolower((unsigned char)cmd);
did_prompt = TRUE;
+ clear_error();
+
+ /* Put cursor pack to correct place */
+ MoveCursor(x_coord, y_coord);
}

switch (cmd) {
***************
*** 1486,1491 ****
--- 1501,1507 ----

attach_menu(NULL,NULL,attachments,display_charset,mailer_info,
NULL, aview);
+ do_redraw = 1;
break;

case 'd':
***************
*** 1495,1501 ****
if (did_prompt)
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuDsn,
"Dsn"));
! if (dsn) dsn_menu(dsn);
}
break;

--- 1511,1520 ----
if (did_prompt)
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuDsn,
"Dsn"));
! if (dsn) {
! dsn_menu(dsn);


! do_redraw = 1;
! }
}

break;

***************
*** 1628,1635 ****
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmVfyNoFieldsInForm,
"No fields in form!\007"));
! if (sleepmsg > 0)
! sleep(sleepmsg);
break;
default:
/* looks like a good form */
--- 1647,1653 ----
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmVfyNoFieldsInForm,
"No fields in form!\007"));
! sleep_message();
break;
default:
/* looks like a good form */
***************
*** 1743,1749 ****
assumes that anything the user sends is part of the
message body unless either:
1. the "-s" flag is used (although it doesn't seem
! to be supported on all implementations?? )
2. the first line is "Subject:". If so, then it'll
read until a blank line and assume all are meant
to be headers.
--- 1761,1767 ----
assumes that anything the user sends is part of the
message body unless either:
1. the "-s" flag is used (although it doesn't seem
! to be supported on all implementations? )
2. the first line is "Subject:". If so, then it'll
read until a blank line and assume all are meant
to be headers.
Index: elm2.4.ME+.118-cvs/src/menu2.c
*** elm2.4.ME+.117/src/menu2.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/menu2.c 2004-07-19 11:48:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: menu2.c,v 1.10 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: menu2.c,v 1.12 2004/07/19 08:48:51 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 24,84 ****
struct menu_item *it;
struct menu_context *page;
{
! short len;
! char buf[STRING];
! int ch;
!
! ClearLine (it->offset);
! Write_to_screen (FRM("%s"),it->option);
! len = strlen (it->option) + 1;
! if (it->type == STR)
! return
! optionally_enter (it->d.c, it->offset, len,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! it->size,page);
! else if (it->type == BOL) {
! for (;;) {
! MoveCursor (it->offset, len);
! CleartoEOLN ();
! if (*(it->d.i) == TRUE)
! Write_to_screen (CATGETS(elm_msg_cat, ElmSet,
! ElmMenu2True,
! "TRUE"));
! else if (*(it->d.i) == FALSE)
! Write_to_screen (CATGETS(elm_msg_cat, ElmSet,
! ElmMenu2False,
! "FALSE"));
! ch = menu_ReadCh (page,OE_REDRAW_MARK);


! if (ch == EOF)

! return -1;


! if (ch == REDRAW_MARK)

! return REDRAW_MARK;
! if (ch == '\n')
! return 0;


! else if (ch == ' ')

! *(it->d.i) = *(it->d.i) ? FALSE : TRUE;
}
! }
! else if (it->type == INT) {
! int code;
! elm_sfprintf (buf,sizeof buf,
! FRM("%d"), *(it->d.i));
! code = optionally_enter (buf, it->offset, len,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! sizeof buf, page);


! if (code != 0)

! return code;
! *(it->d.i) = atoi (buf);
! }
! return 0;
}

! void generic_menu (items, max, title, prompt)
struct menu_item items[];
int max;
char *prompt, *title;
{
! short i = 0;
char buf[STRING], buf2[STRING];
int ch;
short update = TRUE;
--- 24,92 ----
struct menu_item *it;
struct menu_context *page;
{
! short len;
! char buf[STRING];
! int ch;
!
! ClearLine (it->offset);
! Write_to_screen (FRM("%s"),it->option);
! len = strlen (it->option) + 1;
! if (it->type == STR)
! return
! optionally_enter (it->d.c, it->offset, len,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! it->size,page);
! else if (it->type == BOL) {
! int old_val = *(it->d.i);
! for (;;) {
! MoveCursor (it->offset, len);
! CleartoEOLN ();
! if (*(it->d.i) == TRUE)
! Write_to_screen (CATGETS(elm_msg_cat, ElmSet,
! ElmMenu2True,
! "TRUE"));
! else if (*(it->d.i) == FALSE)
! Write_to_screen (CATGETS(elm_msg_cat, ElmSet,
! ElmMenu2False,
! "FALSE"));
! ch = menu_ReadCh (page,OE_REDRAW_MARK|READCH_sig_char);


! if (ch == EOF)

! return -1;


! if (ch == REDRAW_MARK)

! return REDRAW_MARK;


!
! if (ch == TERMCH_interrupt_char) {

! *(it->d.i) = old_val;


! return 0;
! }
!

! if (ch == '\n')
! return 0;


! else if (ch == ' ')

! *(it->d.i) = *(it->d.i) ? FALSE : TRUE;
! }
}
! else if (it->type == INT) {
! int code;
! elm_sfprintf (buf,sizeof buf,
! FRM("%d"), *(it->d.i));
! code = optionally_enter (buf, it->offset, len,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! sizeof buf, page);


! if (code != 0)

! return code;
! *(it->d.i) = atoi (buf);
! }
! return 0;
}

! int generic_menu (items, max, title, prompt)
struct menu_item items[];
int max;
char *prompt, *title;
{
! int ret = 1;
! short i = 0;
char buf[STRING], buf2[STRING];
int ch;
short update = TRUE;
***************
*** 133,149 ****
ch = precmd;
precmd = 0;
} else
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_resize);

! if (EOF == ch)
! return;
switch (ch) {
case RESIZE_MARK:
DPRINT(Debug,4, (&Debug, " .... resizing\n"));
goto resize_mark;

case '\n':
! return;
case REDRAW_MARK:
update = TRUE;
break;
--- 141,165 ----
ch = precmd;
precmd = 0;
} else
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_resize|READCH_sig_char);

! if (ch == TERMCH_interrupt_char) {
! ret = 0;
! goto OUT;
! }
!
! if (EOF == ch) {
! ret = 0;
! goto OUT;
! }
switch (ch) {
case RESIZE_MARK:
DPRINT(Debug,4, (&Debug, " .... resizing\n"));
goto resize_mark;

case '\n':
! ret = 1;
! goto OUT;
case REDRAW_MARK:
update = TRUE;
break;
***************
*** 151,162 ****
for (i = 0; i < max ; i++) {
if (ch == items[i].key) {
int code = do_item (&items[i], page);
! if (REDRAW_MARK == code)
! precmd = ch;


! if (-1 == code)

! return;
! update = TRUE;
! break;
}
}
if (i == max && isascii(ch)) {
--- 167,179 ----
for (i = 0; i < max ; i++) {
if (ch == items[i].key) {
int code = do_item (&items[i], page);
! if (REDRAW_MARK == code)
! precmd = ch;
! if (-1 == code) {
! goto OUT;
! }
! update = TRUE;
! break;
}
}
if (i == max && isascii(ch)) {
***************
*** 166,173 ****
int code = do_item (&items[i], page);
if (REDRAW_MARK == code)
precmd = ch;


! if (-1 == code)

! return;
update = TRUE;
break;
}
--- 183,191 ----
int code = do_item (&items[i], page);
if (REDRAW_MARK == code)
precmd = ch;
! if (-1 == code) {
! goto OUT;
! }
update = TRUE;
break;
}
***************
*** 178,183 ****
--- 196,202 ----

OUT:
erase_menu_context(&page);
+ return ret;
}

/*
Index: elm2.4.ME+.118-cvs/src/mime.c
*** elm2.4.ME+.117/src/mime.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/mime.c 2004-07-20 22:54:30.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mime.c,v 1.32 2004/05/23 12:31:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime.c,v 1.34 2004/07/20 19:54:30 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 234,247 ****
if (batch_only)
X->encoding_part = ENCODING_QUOTED;
else {
! int ch;
! char * msg =
! elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmTextHaveControl,
! "Text part %d have control characters. Encode text with quoted-printable? "),
! (X - mime_info->top_parts) +1);
! ch = want_to(msg,*def_ans_yes,LINES-2,0, page);
! free(msg);
if (ch == *def_ans_yes)
X->encoding_part = ENCODING_QUOTED;
else if (ch != *def_ans_no) {
--- 234,247 ----
if (batch_only)
X->encoding_part = ENCODING_QUOTED;
else {
! int ch = prompt_letter(LINES-3,"",
! *def_ans_yes,
! PROMPT_yesno|PROMPT_cancel,


! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmTextHaveControl,
! "Text part %d have control characters. Encode text with quoted-printable? "),
! (X - mime_info->top_parts) +1);
if (ch == *def_ans_yes)
X->encoding_part = ENCODING_QUOTED;
else if (ch != *def_ans_no) {
***************
*** 558,564 ****
X->is_text = 0;

if (Include_Part(dest,buffer,mime_info,X,mailer_info) < 0)
! return ok = 0;
continue;
} else if (strncmp(buffer, START_ENCODE,
strlen(START_ENCODE))==0) {
--- 558,564 ----
X->is_text = 0;

if (Include_Part(dest,buffer,mime_info,X,mailer_info) < 0)
! ok = 0;
continue;
} else if (strncmp(buffer, START_ENCODE,
strlen(START_ENCODE))==0) {
***************
*** 568,576 ****
ok = 0;
} else {
crypted = TRUE;
! if (! gotten_key++)
! getkey(ON);
! else
get_key_no_prompt(); /* reinitialize.. */
}
continue;
--- 568,583 ----
ok = 0;
} else {
crypted = TRUE;
! if (! gotten_key) {
! int zz = getkey(ON);
!
! if (zz > 0)
! gotten_key = 1;
! else
! ok = 0;
! if (zz < 0) /* Ctrl-C */
! break;
! } else
get_key_no_prompt(); /* reinitialize.. */
}
continue;
Index: elm2.4.ME+.118-cvs/src/options.c
*** elm2.4.ME+.117/src/options.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/options.c 2004-07-13 22:38:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: options.c,v 1.25 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.30 2004/07/13 19:38:20 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 324,332 ****

lower_prompt(prompt = catgets(elm_msg_cat, ElmSet, ElmKeyPrompt, "Key : "));

! while ((c = menu_ReadCh(page,0)) != '.') {
! if (c == EOF)
! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */

#ifdef ASCII_CTYPE
if (isascii(c))
--- 324,335 ----

lower_prompt(prompt = catgets(elm_msg_cat, ElmSet, ElmKeyPrompt, "Key : "));

! while ((c = menu_ReadCh(page,0|READCH_sig_char|READCH_CURSOR)) != '.') {
! if (c == EOF)
! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */
!
! if (c == TERMCH_interrupt_char)
! break;

#ifdef ASCII_CTYPE
if (isascii(c))
***************
*** 454,460 ****
PutLineX(LINES-3, 0,
CATGETS(elm_msg_cat, ElmSet, ElmPrompt, "Command: "));

! ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize);
if (ch == REDRAW_MARK)
goto redraw;
if (ch == EOF) {
--- 457,463 ----
PutLineX(LINES-3, 0,
CATGETS(elm_msg_cat, ElmSet, ElmPrompt, "Command: "));

! ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize|READCH_CURSOR);
if (ch == REDRAW_MARK)
goto redraw;
if (ch == EOF) {
***************
*** 483,488 ****
--- 486,497 ----
page);
if (o->post)
(o->post)(y);
+
+ if (!y) { /* FAILED -- REDRAW */
+ goto redraw;
+ }
+
+
} else
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCommandUnknown,
"Command unknown!"));
***************
*** 523,529 ****
{
/** 'var' field at x.y toggles between on and off... **/

! char ch;

PutLineX(x, y+6,
CATGETS(elm_msg_cat, ElmSet, ElmUseSpaceToToggle,
--- 532,539 ----
{
/** 'var' field at x.y toggles between on and off... **/

! int ch;
! int oldvar = *var;

PutLineX(x, y+6,
CATGETS(elm_msg_cat, ElmSet, ElmUseSpaceToToggle,
***************
*** 532,542 ****
MoveCursor(x,y+3); /* at end of value... */

do {
! ch = menu_ReadCh(page,0);

! if (ch == SPACE) {
! *var = ! *var;
! PutLine0(x,y, onoff(*var));
}
} while (ch == SPACE);

--- 542,557 ----
MoveCursor(x,y+3); /* at end of value... */

do {
! ch = menu_ReadCh(page,READCH_sig_char|READCH_CURSOR);


!
! if (ch == TERMCH_interrupt_char) {

! *var = oldvar;
! break;
! }

! if (ch == SPACE) {
! *var = ! *var;
! PutLine0(x,y, onoff(*var));
}
} while (ch == SPACE);

***************
*** 593,599 ****
MoveCursor(x, y);

do {
! ch = menu_ReadCh(page, 0);
#ifdef ASCII_CTYPE
if (isascii(ch))
#endif
--- 608,620 ----
MoveCursor(x, y);

do {
! ch = menu_ReadCh(page, READCH_sig_char|READCH_CURSOR);


!
! if (ch == TERMCH_interrupt_char) {

! sortby = last_sortby;
! break;
! }
!
#ifdef ASCII_CTYPE
if (isascii(ch))
#endif
***************
*** 929,934 ****
--- 950,956 ----


}

} else { /* Hopefully generic routine ... */

+ int code;
char * s;



if (RCTYPE_magic != save_info[x].dt_type->magic)

***************
*** 942,952 ****
else
buffer[0] = '\0';



! optionally_enter(buffer, ypos, xpos,
! (append_current ? OE_APPEND_CURRENT : 0) |
! (passwd ? OE_PASSWD : 0),

sizeof buffer,page);
!
if (!s || !equal(buffer,s)) {



if (save_info[x].dt_type->parse_line(& save_info[x],

--- 964,978 ----
else
buffer[0] = '\0';

! code = optionally_enter(buffer, ypos, xpos,

! (append_current ? OE_APPEND_CURRENT : 0) |
! (passwd ? OE_PASSWD : 0) |

! OE_SIG_CHAR|OE_REDRAW_MARK,
sizeof buffer,page);
!
! if (0 != code) /* Ctrl-C, error or REDRAW_MARK*/
! return 0;
!
if (!s || !equal(buffer,s)) {



if (save_info[x].dt_type->parse_line(& save_info[x],

Index: elm2.4.ME+.118-cvs/src/out_utils.c
*** elm2.4.ME+.117/src/out_utils.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.118-cvs/src/out_utils.c 2004-07-20 15:28:27.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.25 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.28 2004/07/20 12:28:27 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 25,30 ****
--- 25,32 ----
static struct string * central_message_buffer = NULL;

static time_t LAST_ERROR = 0;
+ static int is_cancel_error = 0;
+

static void error_middle P_((CONST char *s));
void show_last_error()
***************
*** 61,66 ****
--- 63,69 ----
MoveCursor(LINES-1,0);
CleartoEOLN();
err_buffer[0] = '\0';
+ is_cancel_error = 0;
}
}

***************
*** 87,101 ****
FlushBuffer();
}

- /* Used by newmbox.c */
- int need_refresh_low_line() {
- if ('\0' != err_buffer[0]) {
- clear_error();
- return 1;
- }
- return 0;
- }
-
void set_error(s)
char *s;
{
--- 90,95 ----
***************
*** 187,196 ****
DPRINT(Debug,1,(&Debug,
"TRANSIENT message: %s\n",
s));
! LAST_ERROR = 0; /* NO SLEEP */
! error_middle(s);
! strfcpy(err_buffer, s, sizeof err_buffer); /* save it too! */
! return 0;
}

static char * prompt_it P_((CONST char *str, int pass));
--- 181,190 ----
DPRINT(Debug,1,(&Debug,
"TRANSIENT message: %s\n",
s));
! LAST_ERROR = 0; /* NO SLEEP */
! error_middle(s);
! strfcpy(err_buffer, s, sizeof err_buffer); /* save it too! */
! return 0;
}

static char * prompt_it P_((CONST char *str, int pass));
***************
*** 215,221 ****
CleartoEOS();
show_last_error();
status = optionally_enter(buffer,LINES-1-2, len+1,
! (pass ? OE_PASSWD : 0) |OE_REDRAW_MARK,
sizeof buffer,
cpage);
if (REDRAW_MARK == status)
--- 209,216 ----
CleartoEOS();
show_last_error();
status = optionally_enter(buffer,LINES-1-2, len+1,
! (pass ? OE_PASSWD : 0) |OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof buffer,
cpage);
if (REDRAW_MARK == status)
***************
*** 232,243 ****
--- 227,310 ----
return safe_strdup(buffer);
}

+ static void cancel_transient_X P_((struct string *x));
+ static void cancel_transient_X(x)


+ struct string *x;
+ {

+ int LINES, COLUMNS;
+ int pos = 0;
+ int vlen;
+ struct string *Y;
+ int s = 0;
+
+ clear_error();
+ menu_get_sizes(default_context,&LINES, &COLUMNS);
+
+ DPRINT(Debug,1,(&Debug,
+ "CANCEL TRANSIENT message: %S\n",
+ x));
+
+ is_cancel_error = 1;
+ while (NULL != (Y = curses_printable_clip(x,&pos,99,&vlen,COLUMNS-1))) {
+
+ if (vlen > 0) {
+ if (s)
+ error_sleep(1);
+ s = 1;
+
+ MoveCursor(LINES-1,0);
+ CleartoEOLN();
+ PutLineX(LINES-1,(COLUMNS-vlen)/2,FRM("%S"),Y);
+ FlushBuffer();
+
+ }
+ free_string(&Y);
+
+ if (!vlen)
+ break;
+ }
+ }
+
+ static void cancel_clear_X P_((void));
+ static void cancel_clear_X()
+ {

+ int LINES, COLUMNS;
+

+ menu_get_sizes(default_context,&LINES, &COLUMNS);
+
+ MoveCursor(LINES-1,0);
+ CleartoEOLN();
+ is_cancel_error = 0;
+ }
+
void out_util_setup() {
set_error_handler(error);
set_transient_handler(transient);
set_prompt_handler(prompt_it);
+
+ setup_cancel_cb(cancel_set_ttysig_X,
+ cancel_reset_ttysig_X,
+ cancel_transient_X,
+ cancel_clear_X);
}

+
+ /* Used by newmbox.c */
+ int need_refresh_low_line() {
+ if ('\0' != err_buffer[0]) {
+ clear_error();


+ return 1;
+ }
+

+ if (is_cancel_error) {
+ cancel_clear_X();


+ return 1;
+ }
+

+ return 0;
+ }
+
+

void lower_prompt(s)
char *s;
{
Index: elm2.4.ME+.118-cvs/src/pattern.c
*** elm2.4.ME+.117/src/pattern.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/pattern.c 2004-07-12 20:48:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pattern.c,v 1.33 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pattern.c,v 1.35 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 33,39 ****


return (CONST unsigned char *)str;
}

-

#include <errno.h>
#ifndef ANSI_C
extern int errno;

--- 33,38 ----
***************
*** 144,157 ****

status = optionally_enter2(page,
&meta_pattern, LINES-1-2, 0,
! OE_REDRAW_MARK,
CATGETS(elm_msg_cat, ElmSet, ElmEnterPattern,
"Enter pattern: "));

while (status == REDRAW_MARK) {
status = optionally_enter2(page,
&meta_pattern, LINES-1-2, 0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
CATGETS(elm_msg_cat, ElmSet,
ElmEnterPattern,
"Enter pattern: "));
--- 143,158 ----

status = optionally_enter2(page,
&meta_pattern, LINES-1-2, 0,


! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmEnterPattern,
"Enter pattern: "));

while (status == REDRAW_MARK) {
status = optionally_enter2(page,
&meta_pattern, LINES-1-2, 0,


! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmEnterPattern,
"Enter pattern: "));
Index: elm2.4.ME+.118-cvs/src/pgp.c
*** elm2.4.ME+.117/src/pgp.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/pgp.c 2004-07-21 12:00:43.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: pgp.c,v 1.42 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp.c,v 1.44 2004/07/21 09:00:43 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 222,227 ****
--- 222,233 ----
return -1;


}

+ code = run_already_done(&RS,&stat);
+ if (0 != code) {
+ DPRINT(Debug,5,(&Debug,

+ "now pgp/gpg is ALREADY completing\n"));
+ }
+

retry:
while (fgets(buf, STRING, p) != NULL) {
DPRINT(Debug,10,(&Debug,

***************
*** 413,425 ****
redraw:
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpTo,
"To: "));
! status = optionally_enter (tobuf, LINES-1-2, 4,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! sizeof tobuf,
! page);
if (REDRAW_MARK == status)
goto redraw;
! if (status < 0 || tobuf[0] == '\0')
return FALSE;
}

--- 419,432 ----
redraw:
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpTo,
"To: "));
! status = optionally_enter(tobuf, LINES-1-2, 4,

! OE_APPEND_CURRENT|OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

! sizeof tobuf,
! page);
if (REDRAW_MARK == status)
goto redraw;
! if (status != 0 || tobuf[0] == '\0')
return FALSE;
}

***************
*** 431,443 ****
redraw2:
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpFrom,
"From: "));
! status = optionally_enter (frombuf, LINES-1-2, 6,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! sizeof frombuf,
! page);
if (REDRAW_MARK == status)
goto redraw2;
! if (status < 0 || frombuf[0] == '\0')
return FALSE;
}
r = pgp_encrypt (filename, tobuf, frombuf, opts, auto_copy_sent, v,
--- 438,451 ----
redraw2:
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpFrom,
"From: "));
! status = optionally_enter(frombuf, LINES-1-2, 6,


! OE_APPEND_CURRENT|OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

! sizeof frombuf,
! page);
if (REDRAW_MARK == status)
goto redraw2;
! if (status != 0 || frombuf[0] == '\0')
return FALSE;
}
r = pgp_encrypt (filename, tobuf, frombuf, opts, auto_copy_sent, v,
***************
*** 636,642 ****

joined = join_argv(argv0,id_array);

! ret = start_run(&RS,SY_RUN_STATE_ENV|SY_RUN_STATE_INIT,
joined,-1,-1);

break;
--- 644,651 ----

joined = join_argv(argv0,id_array);

! ret = start_run(&RS,SY_RUN_STATE_ENV|SY_RUN_STATE_INIT|
! SY_ENAB_SIGINT,
joined,-1,-1);

break;
***************
*** 680,686 ****
argv[a++] = filename;
argv[a] = NULL;

! ret = start_run(&RS,SY_RUN_STATE_ENV|SY_RUN_STATE_INIT,
argv,-1,-1);

break;
--- 689,696 ----
argv[a++] = filename;
argv[a] = NULL;

! ret = start_run(&RS,SY_RUN_STATE_ENV|SY_RUN_STATE_INIT|
! SY_ENAB_SIGINT,
argv,-1,-1);

break;
***************
*** 745,751 ****
argv[a++] = filename;
argv[a] = NULL;

! ret = start_run(&RS,SY_RUN_STATE_ENV|SY_RUN_STATE_INIT,
argv,-1,-1);

break;
--- 755,762 ----
argv[a++] = filename;
argv[a] = NULL;

! ret = start_run(&RS,SY_RUN_STATE_ENV|SY_RUN_STATE_INIT|
! SY_ENAB_SIGINT,
argv,-1,-1);

break;
***************
*** 916,931 ****
CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,
"Enter userid of public key: "));
CleartoEOS ();
! status = optionally_enter(userid, LINES-3, 28, OE_REDRAW_MARK,
sizeof userid, page);
while(REDRAW_MARK == status) {
PutLineX(LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,
"Enter userid of public key: "));
status = optionally_enter(userid, LINES-3, 28,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
sizeof userid, page);
need_redraw = TRUE;
}
if ( status != 0)
return(need_redraw);

--- 927,945 ----
CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,
"Enter userid of public key: "));
CleartoEOS ();
! status = optionally_enter(userid, LINES-3, 28, OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof userid, page);
while(REDRAW_MARK == status) {
PutLineX(LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,
"Enter userid of public key: "));
status = optionally_enter(userid, LINES-3, 28,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

sizeof userid, page);
need_redraw = TRUE;
}
+
if ( status != 0)
return(need_redraw);

Index: elm2.4.ME+.118-cvs/src/quit.c
*** elm2.4.ME+.117/src/quit.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.118-cvs/src/quit.c 2004-07-11 20:44:52.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: quit.c,v 1.40 2004/05/02 11:15:26 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: quit.c,v 1.41 2004/07/11 17:44:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 68,74 ****


/* NOTICE: prompt_letter may return EOF */

ans = prompt_letter(LINES-1,"P",*def_ans_no,

PROMPT_center|PROMPT_yesno|
! PROMPT_redraw_mark|PROMTP_ctrlL,

page,
CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveFolderQuit,
"Failed to leave folder: Try to quit again ? ([P]anic/%c/%c) "),
--- 68,74 ----


/* NOTICE: prompt_letter may return EOF */

ans = prompt_letter(LINES-1,"P",*def_ans_no,

PROMPT_center|PROMPT_yesno|
! PROMPT_redraw_mark|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveFolderQuit,
"Failed to leave folder: Try to quit again ? ([P]anic/%c/%c) "),
***************
*** 297,303 ****


/* NOTICE: prompt_letter may return EOF */

ans = prompt_letter(LINES-1,"P",*def_ans_no,

PROMPT_center|PROMPT_yesno|
! PROMPT_redraw_mark|PROMTP_ctrlL,

page,
CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveChange,
"Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "),
--- 297,303 ----


/* NOTICE: prompt_letter may return EOF */

ans = prompt_letter(LINES-1,"P",*def_ans_no,

PROMPT_center|PROMPT_yesno|
! PROMPT_redraw_mark|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveChange,
"Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "),
Index: elm2.4.ME+.118-cvs/src/reply.c
*** elm2.4.ME+.117/src/reply.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/reply.c 2004-07-18 23:55:15.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reply.c,v 1.36 2004/06/18 20:40:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: reply.c,v 1.38 2004/07/18 20:55:15 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 472,484 ****
ElmNoEditingAllowed,
"<No editing allowed.>"));
else {
! elm_sfprintf(subject, sizeof subject,
! CATGETS(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
! "Edit outgoing message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! edit_msg = (want_to(subject,
! *def_ans_yes, LINES-4, 0,page
! ) != *def_ans_no);
}

if (current_header-> subject &&
--- 472,496 ----
ElmNoEditingAllowed,
"<No editing allowed.>"));
else {


!
! /* NOTICE: prompt_letter may return EOF */
!

!
! int X1 = prompt_letter(LINES-4,"",*def_ans_yes,
! PROMPT_yesno|PROMPT_cancel,page,
!
! CATGETS(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
! "Edit outgoing message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
! if (TERMCH_interrupt_char == X1) {


! return 0;
! }
!

! if (EOF == X1)
! return 0;
!
! edit_msg = (X1 != *def_ans_no);
}

if (current_header-> subject &&
Index: elm2.4.ME+.118-cvs/src/screen/curses.c
*** elm2.4.ME+.117/src/screen/curses.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/screen/curses.c 2004-07-13 17:36:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curses.c,v 1.7 2004/03/27 18:31:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curses.c,v 1.11 2004/07/13 14:36:54 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 29,35 ****


#undef columns /* ... But undefine columns macro */

#ifdef TERMIOS

- # include <termios.h>
# ifndef sun
# include <sys/ioctl.h> /* for TIOCGWINSZ */
# endif
--- 29,34 ----
***************
*** 177,182 ****
--- 176,182 ----
"/dev/tty is fd %d\n",terminal_fd));
}

+ get_term_chars(terminal_fd);

/* load in all those pesky values */
_clearscreen = tgetstr("cl", &ptr); /* Clear screen and cursor home */
***************
*** 1244,1249 ****
--- 1244,1307 ----
}
}

+ #ifdef TERMIOS
+
+ int toggle_lflag(T,enab,disab)
+ struct tf_state *T;
+ int enab,disab;
+ {
+ T->old_raw_ok = 0;
+
+ if (! _inraw) {
+ DPRINT(Debug,1,(&Debug,"toggle_lflag: _in_raw not set!\n"));


+ return 0;
+ }
+

+ if (tcgetattr(terminal_fd,&_raw_tty) < 0) {
+ DPRINT(Debug,1,(&Debug,"toggle_lflag: tcgetattr failed\n"));
+ return 0;
+ }
+ T->old_raw = _raw_tty;
+ T->old_raw_ok = 1;
+
+ DPRINT(Debug,10,(&Debug,
+ "toggle_lflag: enable 0x%04x disable 0x%04x old: 0x%04x\n",
+ enab,disab,_raw_tty.c_lflag));
+
+ _raw_tty.c_lflag |= enab;
+ _raw_tty.c_lflag &= ~disab;
+
+ if (tcsetattr(terminal_fd,TCSANOW,&_raw_tty) < 0) {
+ DPRINT(Debug,1,(&Debug,"reset_lfalg: tcsetattr failed\n"));
+ return 0;
+ }
+
+ DPRINT(Debug,10,(&Debug,"toggle_lflag: set: 0x%04x\n",_raw_tty.c_lflag));


+
+ return 1;
+ }
+

+ void reset_lfag(T)
+ struct tf_state *T;
+ {
+ if (!T->old_raw_ok) {
+ DPRINT(Debug,1,(&Debug,"reset_lfalg: old_raw not ok\n"));
+ return;
+ }
+
+ if (! _inraw) {
+ DPRINT(Debug,1,(&Debug,"reset_lflag: _inraw not set!\n"));
+ return;
+ }
+
+ if (tcsetattr(terminal_fd,TCSANOW,& (T->old_raw)) < 0) {
+ DPRINT(Debug,1,(&Debug,"toggle_lflag: tcsetattr failed\n"));
+ return;
+ }
+
+ DPRINT(Debug,10,(&Debug,"reset_lflag: set: 0x%04x\n",T->old_raw.c_lflag));
+ }
+ #endif

/* NOTE: Is called from signal handler! */
void transmit_functions(newstate)
Index: elm2.4.ME+.118-cvs/src/screen/curs_input.c
*** elm2.4.ME+.117/src/screen/curs_input.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/screen/curs_input.c 2004-07-14 14:21:09.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.6 2004/03/27 18:31:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.11 2004/07/14 11:21:09 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 97,102 ****
--- 97,104 ----
seconds));
return 1;
}
+ FlushBuffer();
+
SIGDPRINT(Debug,5,(&Debug,
"error_sleep(%d) ...\n",seconds));
ret = wait_for_action_or_timeout(background_read,seconds);
***************
*** 109,114 ****
--- 111,118 ----
int error_sleep(seconds)
int seconds;
{
+ FlushBuffer();
+
return sleep(seconds);
}
#endif
***************
*** 127,147 ****
if (!ch) {
ret = EOF;
DPRINT(Debug,4,(&Debug,
! "ReadCh=EOF (errno=%d)\n",errno));
} else if (ch -> caller_flags) {
ret = ch -> caller_flags;
DPRINT(Debug,4,(&Debug,
! "ReadCh=%d (flags)\n",ret));
} else
ret = state_is_onebyte(ch);
if (!ret) {
DPRINT(Debug,4,(&Debug,
! "ReadCh: Not a one byte character or zero byte!"));
/* Ring a bell */
Writechar('\007');
} else {
DPRINT(Debug,4,(&Debug,
! "ReadCh=%d (one byte character)\n",
ret));
}
} while (0 == ret);
--- 131,151 ----
if (!ch) {
ret = EOF;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh=EOF (errno=%d)\n",errno));
} else if (ch -> caller_flags) {
ret = ch -> caller_flags;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh=%d (flags)\n",ret));
} else
ret = state_is_onebyte(ch);
if (!ret) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh: Not a one byte character or zero byte!"));
/* Ring a bell */
Writechar('\007');
} else {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh=%d (one byte character)\n",
ret));
}
} while (0 == ret);
***************
*** 149,154 ****
--- 153,162 ----
}


+ #ifdef TERMIOS
+ #include <termios.h>
+ #endif
+
struct charset_state * cur_ReadCh2(flags,break_flag,
mc)
int flags;
***************
*** 159,166 ****
int cursorkeys = (flags & READCH_CURSOR) != 0;
int nocursor = (flags & READCH_NOCURSOR) != 0 && cursor_control;
int term_char = (flags & READCH_term_char) != 0;
! int resize_flag = (flags & READCH_resize) != 0;
! int x,y;

unsigned char input_buffer[20];

--- 167,176 ----
int cursorkeys = (flags & READCH_CURSOR) != 0;
int nocursor = (flags & READCH_NOCURSOR) != 0 && cursor_control;
int term_char = (flags & READCH_term_char) != 0;
! int resize_flag = (flags & READCH_resize) != 0;
! int sig_char = (flags & READCH_sig_char) != 0;
! int quote_char = (flags & READCH_quote) != 0;
! int line,col;

unsigned char input_buffer[20];

***************
*** 194,206 ****

int read_p,found_key;

#if POLL_METHOD
change_action(terminal_fd,0,background_read,no_action_routine,
no_action_routine,
NULL);
#endif

! cur_GetXYLocation(&x,&y); /* Background actions may print error messages .. */

if (!last_state) {
last_state = new_state(system_charset);
--- 204,224 ----

int read_p,found_key;

+ #ifdef TERMIOS
+ struct tf_state T;
+
+ bzero((void *)&T,sizeof T);
+ #endif
+
#if POLL_METHOD
change_action(terminal_fd,0,background_read,no_action_routine,
no_action_routine,
NULL);
#endif

! cur_GetXYLocation(&line,&col); /* Background actions may print error messages .. */
! DPRINT(Debug,4,(&Debug,"cur_ReadCH2: line=%d col=%d\n",
! line,col));

if (!last_state) {
last_state = new_state(system_charset);
***************
*** 213,219 ****

if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: starting reading new character (set %s)\n",
last_state->charset->MIME_name ?
last_state->charset->MIME_name :
"<no MIME name>"));
--- 231,237 ----

if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: starting reading new character (set %s)\n",
last_state->charset->MIME_name ?
last_state->charset->MIME_name :
"<no MIME name>"));
***************
*** 221,283 ****
}
last_state->caller_flags = 0;

reinit_ReadChar:
read_p = 0;
found_key = 0;
-
- FlushBuffer();

if (redraw && !cur_RawState()) { /* Check that we have in 'raw' mode */
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;

return last_state;
}

check_changes();
if (resize_flag && mc->changed) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Pending resize...\n"));
reset_state(last_state,1);
last_state->caller_flags = RESIZE_MARK;

return last_state;
}

if (redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Pending redraw...\n"));
cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;

return last_state;
}

if ((_intransmit != ON || mc->redraw) &&
cursorkeys && _transmit_on) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Enabling cursor keys...\n"));
transmit_functions(ON);
}

if ((_intransmit != OFF || mc->redraw) &&
nocursor && _transmit_off) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Disabling cursor keys...\n"));
transmit_functions(OFF);
}

if (cursorkeys) {
int i;
DPRINT(Debug,8,(&Debug,
! "ReadCh2: Available function keys:"));

for (i = 0; keytable[i].str != 0; i++) {
char * CONST str = *(keytable[i].str);
--- 239,323 ----
}
last_state->caller_flags = 0;

+ #ifdef TERMIOS
+ if (sig_char || quote_char) {
+ if (toggle_lflag(&T,0,ISIG)) {
+ DPRINT(Debug,4,(&Debug,
+ "cur_ReadCh2: Disabled generation of signals\n"));
+
+ }
+ } else {
+ toggle_lflag(&T,0,0); /* Just read values */
+ }
+ #endif
+
reinit_ReadChar:
read_p = 0;
found_key = 0;

if (redraw && !cur_RawState()) { /* Check that we have in 'raw' mode */
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;

+ #ifdef TERMIOS
+ reset_lfag(&T);
+ #endif
return last_state;
}

+ cur_MoveCursor(line,col);
+ FlushBuffer();
+
check_changes();
if (resize_flag && mc->changed) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Pending resize...\n"));
reset_state(last_state,1);
last_state->caller_flags = RESIZE_MARK;

+ #ifdef TERMIOS
+ reset_lfag(&T);
+ #endif
return last_state;
}

if (redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Pending redraw...\n"));
cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;

+ #ifdef TERMIOS
+ reset_lfag(&T);
+ #endif
return last_state;
}

if ((_intransmit != ON || mc->redraw) &&
cursorkeys && _transmit_on) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Enabling cursor keys...\n"));
transmit_functions(ON);
}

if ((_intransmit != OFF || mc->redraw) &&
nocursor && _transmit_off) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Disabling cursor keys...\n"));
transmit_functions(OFF);
}

if (cursorkeys) {
int i;
DPRINT(Debug,8,(&Debug,
! "cur_ReadCh2: Available function keys:"));

for (i = 0; keytable[i].str != 0; i++) {
char * CONST str = *(keytable[i].str);
***************
*** 299,305 ****
if(!wait_for_action(background_read)) {
if (errno != 0) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: wait_for_action got error %d (%s)\n",
errno, error_description(errno)));

check_changes();
--- 339,345 ----
if(!wait_for_action(background_read)) {
if (errno != 0) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: wait_for_action got error %d (%s)\n",
errno, error_description(errno)));

check_changes();
***************
*** 338,344 ****
continue;
}
DPRINT(Debug,4,(&Debug,
! "ReadCh2: interrupted (ignored)\n"));
continue;
}
}
--- 378,384 ----
continue;
}
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: interrupted (ignored)\n"));
continue;
}
}
***************
*** 349,355 ****
} else if (last_read_error != 0) {
if (-1 == last_read_error) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: background_read got zero bytes...\n"));
found_key = -1;
continue;
}
--- 389,395 ----
} else if (last_read_error != 0) {
if (-1 == last_read_error) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: background_read got zero bytes...\n"));
found_key = -1;
continue;
}
***************
*** 375,381 ****
if (last_read_error != 0) {
errno = last_read_error;
DPRINT(Debug,4,(&Debug,
! "ReadCh2: background_read got error %d (%s)\n",
last_read_error,
error_description(last_read_error)));
found_key = -1;
--- 415,421 ----
if (last_read_error != 0) {
errno = last_read_error;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: background_read got error %d (%s)\n",
last_read_error,
error_description(last_read_error)));
found_key = -1;
***************
*** 383,389 ****
continue; /* continue or quit */
} else {
DPRINT(Debug,1,(&Debug,
! "ReadCh2: SOFTWARE ERROR !!\n"));
break;
}
#else
--- 423,429 ----
continue; /* continue or quit */
} else {
DPRINT(Debug,1,(&Debug,
! "cur_ReadCh2: SOFTWARE ERROR !!\n"));
break;
}
#else
***************
*** 394,400 ****
if (result < 0) {
int err = errno;
DPRINT(Debug,4,(&Debug,
! "ReadCh2: errno = %d [%s]\n",err,
error_description(err)));

check_changes();
--- 434,440 ----
if (result < 0) {
int err = errno;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: errno = %d [%s]\n",err,
error_description(err)));

check_changes();
***************
*** 429,435 ****
}
if (0 == result) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Got zero bytes...\n"));
found_key = -1;
continue;
}
--- 469,475 ----
}
if (0 == result) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Got zero bytes...\n"));
found_key = -1;
continue;
}
***************
*** 451,457 ****


DPRINT(Debug,50,(&Debug,
! "ReadCh2: Looking char %d (read_p=%d)\n",ch,read_p));

if (term_char) {
if (backspace == ch)
--- 491,503 ----


DPRINT(Debug,50,(&Debug,
! "cur_ReadCh2: Looking char %d (read_p=%d)\n",ch,read_p));
!
! if (quote_char) {
! DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Quoting current character %0xd\n",ch));
! found_key = ch;
! }

if (term_char) {
if (backspace == ch)
***************
*** 460,474 ****
found_key = TERMCH_kill_line;
if (word_erase == ch)
found_key = TERMCH_word_erase;
- if (interrupt_char == ch)
- found_key = TERMCH_interrupt_char;
if (reprint_char == ch)
found_key = TERMCH_reprint_char;
if (eof_char == ch)
found_key = TERMCH_eof_char;
if (found_key) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: found termchar = %d (char=%02X)\n",
found_key,ch));
/* Soft reset state */
reset_state(last_state,0);
--- 506,573 ----
found_key = TERMCH_kill_line;
if (word_erase == ch)
found_key = TERMCH_word_erase;
if (reprint_char == ch)
found_key = TERMCH_reprint_char;
if (eof_char == ch)
found_key = TERMCH_eof_char;
+
+ if (found_key) {
+ DPRINT(Debug,4,(&Debug,
+ "cur_ReadCh2: found termchar = %d (char=%02X)\n",
+ found_key,ch));
+ /* Soft reset state */
+ reset_state(last_state,0);
+ break;
+ }
+ }
+
+ if (sig_char) {
+ if (interrupt_char == ch)
+ found_key = TERMCH_interrupt_char;
+ if (VQUIT_char == ch)
+ found_key = TERMCH_interrupt_char;
+ if (VSUSP_char == ch) {
+ SIGHAND_TYPE (*sig1)(), (*sig2)();
+
+ DPRINT(Debug,1,(&Debug,
+ "cur_ReadCh2: Found suspend character!\n"));
+
+ #ifdef SIGTSTP
+ menu_context_redraw();
+ switch_title(0);
+ CarriageReturn();
+
+ Raw(OFF);
+ sig1 = signal(SIGTSTP, SIG_DFL);
+ sig2 = signal(SIGCONT, SIG_DFL);
+
+ WriteRaw(Stopped_Text);
+
+ kill(getpid(), SIGSTOP);
+
+ CarriageReturn();
+
+ WriteRaw(Back_Text);
+
+ Raw(ON);
+
+ signal(SIGTSTP, sig1);
+ signal(SIGCONT, sig2);
+
+ reset_state(last_state,1);
+ if (redraw) {
+ DPRINT(Debug,1,(&Debug,
+ "cur_ReadCh2: returning redraw because of suspend\n"));
+ cur_ClearScreen(mc);
+ found_key = redraw;
+ } else
+ goto reinit_ReadChar;
+ #endif
+ }
+
if (found_key) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: found sigchar = %d (char=%02X)\n",
found_key,ch));
/* Soft reset state */
reset_state(last_state,0);
***************
*** 488,494 ****
if (str[read_p+1] == '\0') {
found_key = keytable[i].result;
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Found function key = %d (keytable = %d, read_p =%d)\n",
found_key,i,read_p));

/* Soft reset state */
--- 587,593 ----
if (str[read_p+1] == '\0') {
found_key = keytable[i].result;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Found function key = %d (keytable = %d, read_p =%d)\n",
found_key,i,read_p));

/* Soft reset state */
***************
*** 519,525 ****

if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Unsupporting -- function keys and state change sequences overlap? (OR BAD SEQUENCE) \n"));
goto BAD_sequence;
}

--- 618,624 ----

if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Unsupporting -- function keys and state change sequences overlap? (OR BAD SEQUENCE) \n"));
goto BAD_sequence;
}

***************
*** 532,538 ****
if (state_ready(last_state))
goto got_key;
DPRINT(Debug,4,(&Debug,
! "ReadCh2: need more bytes for character...\n"));
goto reinit_ReadChar;


--- 631,637 ----
if (state_ready(last_state))
goto got_key;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: need more bytes for character...\n"));
goto reinit_ReadChar;


***************
*** 542,552 ****
reset_state(last_state,0);

DPRINT(Debug,4,(&Debug,
! "ReadCh2: Bad escape sequence; ch = %d, read_p = %d\n",
ch,read_p));
#ifdef DEBUG
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Sequence was:"));
for (i = 0; i <= read_p && i < sizeof input_buffer -1; i++) {
if (isascii(input_buffer[i]) && isprint(input_buffer[i])) {
DPRINT(Debug,4,(&Debug," %c (0x%02X)",
--- 641,651 ----
reset_state(last_state,0);

DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Bad escape sequence; ch = %d, read_p = %d\n",
ch,read_p));
#ifdef DEBUG
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Sequence was:"));
for (i = 0; i <= read_p && i < sizeof input_buffer -1; i++) {
if (isascii(input_buffer[i]) && isprint(input_buffer[i])) {
DPRINT(Debug,4,(&Debug," %c (0x%02X)",
***************
*** 570,582 ****
found_key = ch;

}
!
if (found_key <= 0 && redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Redraw...\n"));
if(!cur_RawState()) { /* Check that we have in 'raw' mode */
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
}
cur_ClearScreen(mc);
--- 669,681 ----
found_key = ch;

}
!
if (found_key <= 0 && redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Redraw...\n"));
if(!cur_RawState()) { /* Check that we have in 'raw' mode */
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
}
cur_ClearScreen(mc);
***************
*** 584,600 ****
reset_state(last_state,1);
last_state->caller_flags = redraw;

return last_state;
}

! cur_MoveCursor(x,y);
DPRINT(Debug,50,(&Debug,
! "ReadCh2: found_key=%d\n",found_key));

if (found_key < 0) {
reset_state(last_state,1);
DPRINT(Debug,4,(&Debug,
! "ReadCh2=NULL (state)\n"));
return NULL;
} else {
if (found_key >= 256) {
--- 683,709 ----
reset_state(last_state,1);
last_state->caller_flags = redraw;

+ #ifdef TERMIOS
+ reset_lfag(&T);
+ #endif
+
return last_state;
}

! cur_MoveCursor(line,col);
DPRINT(Debug,50,(&Debug,
! "cur_ReadCh2: found_key=%d (line=%d col=%d)\n",
! found_key, line,col));

if (found_key < 0) {
reset_state(last_state,1);
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2=NULL (state)\n"));
!
! #ifdef TERMIOS
! reset_lfag(&T);
! #endif
!
return NULL;
} else {
if (found_key >= 256) {
***************
*** 606,612 ****
/* Ring a bell */
Writechar('\007');
DPRINT(Debug,4,(&Debug,
! "ReadCh2: bad sequence...\n"));
reset_state(last_state,1);
}
}
--- 715,721 ----
/* Ring a bell */
Writechar('\007');
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: bad sequence...\n"));
reset_state(last_state,1);
}
}
***************
*** 615,629 ****
if (!state_ready(last_state) &&
!last_state->caller_flags) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: need more bytes for character...\n"));
goto reinit_ReadChar;
}

got_key:
DPRINT(Debug,4,(&Debug,
! "ReadCh2=%p (state): caller_flags=%d, ready=%d\n",
last_state,last_state->caller_flags,
state_ready(last_state)));
return last_state;
}

--- 724,743 ----
if (!state_ready(last_state) &&
!last_state->caller_flags) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: need more bytes for character...\n"));
goto reinit_ReadChar;
}

got_key:
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2=%p (state): caller_flags=%d, ready=%d\n",
last_state,last_state->caller_flags,
state_ready(last_state)));
+
+ #ifdef TERMIOS
+ reset_lfag(&T);
+ #endif
+
return last_state;
}

Index: elm2.4.ME+.118-cvs/src/screen/def_screen.h
*** elm2.4.ME+.117/src/screen/def_screen.h 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/screen/def_screen.h 2004-07-13 17:39:29.000000000 +0300
***************
*** 1,4 ****
! /* $Id: def_screen.h,v 1.4 2004/03/27 18:31:48 hurtta Exp $ */



#include "headers.h"
#include "me.h"
--- 1,4 ----

! /* $Id: def_screen.h,v 1.8 2004/07/13 14:39:29 hurtta Exp $ */



#include "headers.h"
#include "me.h"
***************

*** 82,89 ****
*_key_help, *_key_find;
extern char *_transmit_on, *_transmit_off;

! /* cur_process.c */


extern void print_status P_((struct run_state *rs,int sig,int exit_code));
extern void start_run_tty_init P_((void));
--- 82,100 ----
*_key_help, *_key_find;
extern char *_transmit_on, *_transmit_off;

! #ifdef TERMIOS
! # include <termios.h>
!
! struct tf_state {
! struct termios old_raw;
! int old_raw_ok;
! };

+ extern int toggle_lflag P_((struct tf_state *T,int enab,int disab) );
+ extern void reset_lfag P_((struct tf_state *T));
+ #endif
+
+ /* cur_process.c */

extern void print_status P_((struct run_state *rs,int sig,int exit_code));
extern void start_run_tty_init P_((void));
***************
*** 107,112 ****
--- 118,137 ----

extern void check_changes P_((void));

+ /* init.c */
+
+ extern void get_term_chars P_((int fd));
+
+ extern char backspace, /* the current backspace char */
+ kill_line, /* the current kill-line char */
+ word_erase, /* the current word-erase char */
+ interrupt_char, /* the current interrupt char */
+ reprint_char, /* the current reprint-line char */
+ eof_char; /* the current end-of-file char */
+
+ extern char VQUIT_char, /* the current quit char */
+ VSUSP_char; /* the current suspend char */


+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.118-cvs/src/screen/init.c


*** /tmp/1444-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-07-21 14:45:25.000000000 +0300

--- elm2.4.ME+.118-cvs/src/screen/init.c 2004-07-11 14:36:09.000000000 +0300
***************
*** 0 ****
--- 1,168 ----
+ static char rcsid[] = "@(#)$Id: init.c,v 1.3 2004/07/11 11:36:09 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
+ *
+ * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
+ * (was hurtt...@ozone.FMI.FI)
+ ******************************************************************************
+ * Most of code copied from src/init.c. It have following copyright:


+ *
+ * The Elm Mail System
+ *

+ * Copyright (c) 1988-1992 USENET Community Trust


+ * Copyright (c) 1986,1987 Dave Taylor

+ *****************************************************************************/
+
+ #include "def_screen.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ #include <errno.h>
+ #ifndef ANSI_C
+ extern int errno; /* system error number on failure */
+ #endif
+
+

+ #ifdef TERMIOS
+ # include <termios.h>

+ typedef struct termios term_buff;
+ #else
+ # ifdef TERMIO
+ # include <termio.h>
+ # define tcgetattr(fd,buf) ioctl((fd),TCGETA,(buf))
+ typedef struct termio term_buff;
+ # else
+ # include <sgtty.h>
+ typedef struct {
+ struct sgttyb sgttyb;
+ struct tchars tchars;
+ #ifdef TIOCLGET
+ struct ltchars ltchars;
+ #endif
+ } term_buff;
+ static int tcgetattr P_((int,term_buff *)); /* Prototype */


+ # endif
+ #endif
+

+ char backspace, /* the current backspace char */
+
+ kill_line, /* the current kill-line char */
+ word_erase, /* the current word-erase char */
+ interrupt_char, /* the current interrupt char */
+ reprint_char, /* the current reprint-line char */
+ eof_char; /* the current end-of-file char */
+
+ char VQUIT_char, /* the current quit char */
+ VSUSP_char; /* the current suspend char */
+
+ void get_term_chars(fd)
+ int fd;
+ {
+ /** This routine sucks out the special terminal characters
+ ERASE and KILL for use in the input routine. The meaning
+ of the characters are (dare I say it?) fairly obvious... **/
+
+ term_buff term_buffer;
+
+ if (tcgetattr(fd,&term_buffer) == -1) {


+ int err = errno;
+

+ DPRINT(Debug,3,
+ (&Debug,
+ "Error: %s encountered on ioctl call (get_term_chars, fd=%d)\n",
+ error_description(err), fd));
+
+ /* set to defaults for terminal driver */
+ backspace = BACKSPACE;
+ kill_line = ctrl('U');
+ word_erase = ctrl('W');
+ interrupt_char = 0177; /* DEL */
+ reprint_char = ctrl('R');
+ eof_char = ctrl('D');
+ VQUIT_char = 034; /* Ctrl \ */
+ VSUSP_char = ctrl('Z');
+ } else {
+ #if defined(TERMIO) || defined(TERMIOS)
+ backspace = term_buffer.c_cc[VERASE];
+ kill_line = term_buffer.c_cc[VKILL];
+ #if defined(TERMIOS) && defined(VWERASE)
+ word_erase = term_buffer.c_cc[VWERASE];
+ #else
+ word_erase = ctrl('W');
+ #endif
+ interrupt_char = term_buffer.c_cc[VINTR];
+ #if defined(TERMIOS) && defined(VREPRINT)
+ reprint_char = term_buffer.c_cc[VREPRINT];
+ #else
+ reprint_char = ctrl('R');
+ #endif
+ eof_char = term_buffer.c_cc[VEOF];
+ #else
+ backspace = term_buffer.sgttyb.sg_erase;
+ kill_line = term_buffer.sgttyb.sg_kill;
+ #ifdef TIOCLGET
+ word_erase = term_buffer.ltchars.t_werasc;
+ reprint_char = term_buffer.ltchars.t_rprntc;
+ #else
+ word_erase = ctrl('W');
+ reprint_char = ctrl('R');
+ #endif
+ interrupt_char = term_buffer.tchars.t_intrc;
+ eof_char = term_buffer.tchars.t_eofc;
+ #endif
+
+ #if defined(TERMIOS)
+ VQUIT_char = term_buffer.c_cc[VQUIT];
+ VSUSP_char = term_buffer.c_cc[VSUSP];
+ #else
+ VQUIT_char = 034; /* Ctrl \ */
+ VSUSP_char = ctrl('Z');
+ #endif
+ }
+
+ DPRINT(Debug,4,
+ (&Debug,"get_term_chars(%d): \n\
+ backspace %3d\n\
+ kill_line %3d\n\
+ word_erase %3d\n\
+ interrupt_char %3d\n\
+ reprint_char %3d\n\
+ eof_char %3d\n\
+ ",
+ fd,
+ backspace,
+ kill_line,
+ word_erase,
+ interrupt_char,
+ reprint_char,
+ eof_char));
+
+ }
+
+ #if !defined(TERMIO) && !defined(TERMIOS)
+ static int
+ tcgetattr(fd, buf)
+ int fd;
+ term_buff *buf;
+ {
+ if (ioctl(fd, TIOCGETP, &buf->sgttyb) < 0)
+ return(-1);
+ if (ioctl(fd, TIOCGETC, &buf->tchars) < 0)
+ return(-1);
+ #ifdef TIOCLGET
+ if (ioctl(fd, TIOCLGET, &buf->ltchars) < 0)
+ return(-1);
+ #endif
+ return(0);


+ }
+ #endif
+
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.118-cvs/src/screen/Makefile.SH
*** elm2.4.ME+.117/src/screen/Makefile.SH 2004-03-16 21:17:43.000000000 +0200
--- elm2.4.ME+.118-cvs/src/screen/Makefile.SH 2004-07-10 21:55:35.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.3 2004/03/14 17:05:59 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----

echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.4 2004/07/10 18:55:35 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************
*** 43,49 ****
SHELL = /bin/sh

OBJ = screen.o curses.o curs_input.o termbuffer.o \
! termtitle.o termcharset.o cur_process.o context.o

all: Makefile libscreen.a



--- 43,49 ----
SHELL = /bin/sh

OBJ = screen.o curses.o curs_input.o termbuffer.o \
! termtitle.o termcharset.o cur_process.o context.o init.o

all: Makefile libscreen.a

***************
*** 87,90 ****
--- 87,91 ----
termcharset.o: def_screen.h
cur_process.o: def_screen.h $(INCLDIR)/s_elm.h
context.o: def_screen.h
+ init.o: def_screen.h
!NO!SUBS!
Index: elm2.4.ME+.118-cvs/src/screen/screen.c
*** elm2.4.ME+.117/src/screen/screen.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/screen/screen.c 2004-07-14 14:17:24.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: screen.c,v 1.7 2004/03/27 18:31:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: screen.c,v 1.10 2004/07/14 11:17:24 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
***************
*** 188,194 ****
int on_cooked = default_context == &COOKED_MENU;

SIGDPRINT(Debug,4, (&Debug, "Raw(%d): sig = %d tite=%d on_cooked=%d\n",
! state,sig,tite));

cur_Raw(state);

--- 188,194 ----
int on_cooked = default_context == &COOKED_MENU;

SIGDPRINT(Debug,4, (&Debug, "Raw(%d): sig = %d tite=%d on_cooked=%d\n",
! state,sig,tite,on_cooked));

cur_Raw(state);

***************
*** 266,271 ****
--- 266,273 ----

c = cur_ReadCh(flags,InGetPrompt,default_context);

+ DPRINT(Debug,50, (&Debug, "ReadCh=0x%02x\n",c));
+
return c;
}

***************
*** 283,288 ****
--- 285,292 ----

c = cur_ReadCh(flags,InGetPrompt,ptr);

+ DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x\n",c));
+
return c;
}

***************
*** 441,446 ****
--- 445,472 ----
return cur_tabspacing;
}

+ #ifdef TERMIOS
+ static struct tf_state ttysig_state;
+
+ #endif
+
+ void cancel_set_ttysig_X()
+ {
+ DPRINT(Debug,49, (&Debug, "cancel_set_ttysig_X()\n"));
+
+ #ifdef TERMIOS
+ toggle_lflag(&ttysig_state,ISIG,0);
+ #endif
+ }
+
+ void cancel_reset_ttysig_X()
+ {
+ DPRINT(Debug,49, (&Debug, "cancel_reset_ttysig_X()\n"));
+ #ifdef TERMIOS
+ reset_lfag(&ttysig_state);
+ #endif


+ }
+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.118-cvs/src/showmsg.c
*** elm2.4.ME+.117/src/showmsg.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/src/showmsg.c 2004-07-11 14:36:09.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.37 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.38 2004/07/11 11:36:09 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 94,100 ****
PutLineX(LINES-2,0,CATGETS(elm_msg_cat, ElmSet, ElmOverrideCSprompt,
"Override charset: "));

! code = optionally_enter(override_charset,-1,-1,OE_REDRAW_MARK,
sizeof override_charset, page);

switch(code) {
--- 94,101 ----
PutLineX(LINES-2,0,CATGETS(elm_msg_cat, ElmSet, ElmOverrideCSprompt,
"Override charset: "));

! code = optionally_enter(override_charset,-1,-1,OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof override_charset, page);

switch(code) {
Index: elm2.4.ME+.118-cvs/src/signals.c
*** elm2.4.ME+.117/src/signals.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/src/signals.c 2004-07-11 14:36:09.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: signals.c,v 1.24 2004/03/27 18:31:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: signals.c,v 1.25 2004/07/11 11:36:09 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 147,155 ****

menu_context_redraw();

- #ifdef SIGTSTP
signal(SIGTSTP, SIG_DFL);
- #endif

was_in_raw_state = RawState();
Raw(OFF|RAW_FROM_SIGNAL); /* turn it off regardless */
--- 147,153 ----
Index: elm2.4.ME+.118-cvs/src/syscall.c
*** elm2.4.ME+.117/src/syscall.c 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.118-cvs/src/syscall.c 2004-07-11 14:36:09.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33 2004/04/12 18:40:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.34 2004/07/11 11:36:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,27 ****
#include "s_elm.h"
#include "s_me.h"

! DEBUG_VAR(Debug,__FILE__,"misc");


#include <errno.h>
--- 21,27 ----
#include "s_elm.h"
#include "s_me.h"



! DEBUG_VAR(Debug,__FILE__,"system");


#include <errno.h>

***************
*** 63,69 ****
"Shell command: "));
CleartoEOS();
command[0] = '\0';
! status = optionally_enter(command, LINES-3, 15, OE_REDRAW_MARK,
sizeof command, page);

while (REDRAW_MARK == status) {
--- 63,70 ----
"Shell command: "));
CleartoEOS();
command[0] = '\0';
! status = optionally_enter(command, LINES-3, 15, OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof command, page);



while (REDRAW_MARK == status) {
***************

*** 72,82 ****
CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
"Shell command: "));
status = optionally_enter(command, LINES-3, 15,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
sizeof command, page);

}
! if (0 != status && command[0] == 0) {
if (helpful)
MoveCursor(LINES-4,COLUMNS-40);
else
--- 73,85 ----
CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
"Shell command: "));
status = optionally_enter(command, LINES-3, 15,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

sizeof command, page);

}
!
! if (0 != status || command[0] == 0) {
if (helpful)
MoveCursor(LINES-4,COLUMNS-40);
else
***************
*** 358,370 ****
PutLine0(LINES-3, 0, prompt);
command[0] = '\0';
status = optionally_enter(command, LINES-3, strlen(prompt),
! OE_REDRAW_MARK, sizeof command,


page);
while (status == REDRAW_MARK) {

redraw = TRUE;
PutLine0(LINES-1-2, 0, prompt);
status = optionally_enter(command, LINES-3, strlen(prompt),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
sizeof command, page);

}
--- 361,375 ----
PutLine0(LINES-3, 0, prompt);
command[0] = '\0';
status = optionally_enter(command, LINES-3, strlen(prompt),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, sizeof command,


page);
while (status == REDRAW_MARK) {

redraw = TRUE;
PutLine0(LINES-1-2, 0, prompt);
status = optionally_enter(command, LINES-3, strlen(prompt),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

sizeof command, page);

}
Index: elm2.4.ME+.118-cvs/utils/answer.c
*** elm2.4.ME+.117/utils/answer.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/answer.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: answer.c,v 1.16 2004/03/27 18:31:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: answer.c,v 1.17 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 105,111 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 105,111 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/elmalias.c
*** elm2.4.ME+.117/utils/elmalias.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/elmalias.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.16 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.17 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 239,245 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 239,245 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/elmbindata.c
*** elm2.4.ME+.117/utils/elmbindata.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/elmbindata.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.5 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.6 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 133,139 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 133,139 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/elmcharset.c
*** elm2.4.ME+.117/utils/elmcharset.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/elmcharset.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.29 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.30 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

***************
*** 163,169 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 163,169 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/elmlibregister.c
*** elm2.4.ME+.117/utils/elmlibregister.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/elmlibregister.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.7 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.8 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************
***************
*** 135,141 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 135,141 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/elmrc-write.c
*** elm2.4.ME+.117/utils/elmrc-write.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/elmrc-write.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.14 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.15 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 133,139 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 133,139 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/elmstringconvert.c
*** elm2.4.ME+.117/utils/elmstringconvert.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/elmstringconvert.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.8 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.9 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 252,258 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 252,258 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/elmterminal.c
*** elm2.4.ME+.117/utils/elmterminal.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/elmterminal.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.13 2004/03/27 18:31:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.14 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 88,94 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
}
#endif
}
--- 88,94 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
}
#endif
}

Index: elm2.4.ME+.118-cvs/utils/elmunidata.c
*** elm2.4.ME+.117/utils/elmunidata.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/elmunidata.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.18 2004/03/27 18:31:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.19 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 111,117 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 111,117 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/fastmail.c
*** elm2.4.ME+.117/utils/fastmail.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/fastmail.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.30 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.31 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 406,412 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 406,412 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/newalias.c
*** elm2.4.ME+.117/utils/newalias.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/newalias.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newalias.c,v 1.15 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newalias.c,v 1.16 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 87,93 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 87,93 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elm2.4.ME+.118-cvs/utils/prlong.c
*** elm2.4.ME+.117/utils/prlong.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.118-cvs/utils/prlong.c 2004-07-10 11:08:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: prlong.c,v 1.12 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Kari E. Hurtta

unread,
Aug 5, 2004, 12:05:57 PM8/5/04
to
Archive-name: elm2.4ME+/PL119.0

Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

files elm-2.4ME+PL119.patch.gz
and elm-2.4ME+119.tar.gz
for a moment.

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL119.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+119.tar.gz >
via WWW.

Is available with
<URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+PL119.patch.gz >
and <URL: http://personal.inet.fi/atk/elmme/elm-2.4ME+119.tar.gz >
via WWW.

(1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.


Before applying patch catenate parts 1 - 3 first.


That part (part 0) do not include patch. Patch

is on part 1 - 3.

Changes of Elm 2.4ME+ PL119 (25) compared with Elm 2.4ME+ PL118 (25)
--------------------------------------------------------------------

SUMMARY: This release includes various code changes,
changes f)orget command and moves
*.Canceled.mail to own directory. This
release introduces elmrc option
"dead-letter-dir". Any canceled mail
can be picked with m)ail command.

- Configure now locates system gencat command
- Added file nls/Makefile.SH
- File nls/Makefile is removed. Now it is
generated by Configure

- Made leave() to use give_next_open_mailbox()
- Added free_all_mailboxes() to src/messages/messages.c
- Made leave() to use free_all_mailboxes()
- Made rm_temps_exit() to use free_all_mailboxes()
- Made silently_exit() to use give_next_open_mailbox()
- Made emergency_exit() to use give_next_open_mailbox()
- Made leave_locked() to use give_next_open_mailbox()
- Made usr1_signal() to use give_next_open_mailbox()
- Made usr2_signal() to use give_next_open_mailbox()
- Removed current_mailbox global variable

- Added free_all_aliasviews() to src/aliases/aliases.c
- Made leave() to use free_all_aliasviews()
- Made silently_exit() to use free_all_aliasviews()
- Made rm_temps_exit() to use free_all_aliasviews()
- Made leave_locked() to use free_all_aliasviews()
- Removed current_aliaslist global variable

- Added menu_trigger_redraw() to src/screen/context.c
- Changed resync() to use menu_trigger_redraw()
- Changed help() to use menu_trigger_redraw()
- Changed do_pipe() to use menu_trigger_redraw()
- Changed change_file() to use menu_trigger_redraw()
- Changed print_msg() to use menu_trigger_redraw()
- Changed subshell() to use menu_trigger_redraw()
- Changed pgp_extract_public_key() to use menu_trigger_redraw()
- Changed forward() to use menu_trigger_redraw()
- Changed reply_to_everyone() to use menu_trigger_redraw()
- Changed pgp_mail_public_key() to use menu_trigger_redraw()
- Changed send_msg_l() to use menu_trigger_redraw()
- Changed print_text() to use menu_trigger_redraw()
- Changed reply() to use menu_trigger_redraw()
- Changed save() to use menu_trigger_redraw()

- Changed pattern_match() to use menu_trigger_redraw()
- Changed limit() to use menu_trigger_redraw()
- Changed read_number to use menu_trigger_redraw()

- Changed alias_help() to use menu_trigger_redraw()
- Changed a_sendmsg() to use menu_trigger_redraw()

- Changed mailbox_command() to use menu_trigger_redraw()
- Changed motion() to use menu_trigger_redraw()
- Changed new_mail_check() to use menu_trigger_redraw()
- Changed mail() to use menu_trigger_redraw()
- Changed send_msg_middle() to use menu_trigger_redraw()
- Changed send_form() to use menu_trigger_redraw()
- Added menu_trigger_redraw() to get_copies()
- Added menu_trigger_redraw() to get_to()
- Added menu_trigger_redraw() to copy_the_msg()
- Added menu_trigger_redraw() to get_subject()
- Changed send_msg_argv() to use menu_trigger_redraw()

- Moved *.Canceled.mail to own directory
Canceled.mail.dir
- Editor buffer for f)orget messages is not kept.
Instead cancele mails are picked from
Canceled.mail.dir on m)ail -command ('/' on
To: prompt gives menu of cancelled messages.)
- Canceled.mail.dir is not available as folder
(it can not given for c)hange folder commmand
or -f option of Elm.)
- When canceled mail is picked from re-sending,
is is also deleted from Canceled.mail.dir
(f)orget command will re-add it to Canceled.mail.dir.)
- Name of Canceled.mail.dir can be changed with elmrc
option dead-letter-dir.

- Removed give_message_folder()

- Added -g option to Configure

New elmrc options:
dead-letter-dir

New file:
src/messages/canceled_mail.c
src/canceled.c
nls/Makefile.SH

Removed file:
nls/Makefile (this is now generated by Configure)

Warnings
--------

That is:

- fastmail is broken

complicated (and dropping of Received: -headers
from enclosed message do not make sense.)

- Running '//' Match pattern (in entire message): on


one big mailbox seems cause segementation violation

on malloc(). Seems memory corruption to me. However

running same search on same mailbox undef of valgrind

do not report error. Valgrind do not report that there is

Kari E. Hurtta

unread,
Aug 5, 2004, 12:06:21 PM8/5/04
to
Archive-name: elm2.4ME+/PL119.1

Before applying patch catenate parts 1 - 3 first.

This patch is agaist Elm 2.4ME+ PL118 (25) part 1/3
============================================================================
To apply this patch use
patch -p1 < this_file
on directory where Configure is located.

You can remove empty
nls/Makefile
applying this patch.

Index: elm2.4.ME+.119-cvs/hdrs/patchlevel.h
Prereq: 1121000000
*** elm2.4.ME+.118/hdrs/patchlevel.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/hdrs/patchlevel.h 2004-08-04 19:29:11.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "118 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.118
*/
! #define LAST_REPORT_TIME 1121000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "Jul, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jul, 2004"

/*
* Local Variables:
--- 1,12 ----
! #define PATCHLEVEL "119 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.119
*/
! #define LAST_REPORT_TIME 1123000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Aug, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Aug, 2004"

/*
* Local Variables:
Index: elm2.4.ME+.119-cvs/README.ME+
*** elm2.4.ME+.118/README.ME+ 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/README.ME+ 2004-08-04 19:29:11.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.820 2004/07/21 10:36:31 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.828 2004/08/04 16:29:11 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,18 ****
--- 13,116 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL119 (25) compared with Elm 2.4ME+ PL118 (25)
+ --------------------------------------------------------------------
+
+ SUMMARY: This release includes various code changes,
+ changes f)orget command and moves
+ *.Canceled.mail to own directory. This
+ release introduces elmrc option
+ "dead-letter-dir". Any canceled mail
+ can be picked with m)ail command.
+
+ - Configure now locates system gencat command
+ - Added file nls/Makefile.SH
+ - File nls/Makefile is removed. Now it is
+ generated by Configure
+
+ - Made leave() to use give_next_open_mailbox()
+ - Added free_all_mailboxes() to src/messages/messages.c
+ - Made leave() to use free_all_mailboxes()
+ - Made rm_temps_exit() to use free_all_mailboxes()
+ - Made silently_exit() to use give_next_open_mailbox()
+ - Made emergency_exit() to use give_next_open_mailbox()
+ - Made leave_locked() to use give_next_open_mailbox()
+ - Made usr1_signal() to use give_next_open_mailbox()
+ - Made usr2_signal() to use give_next_open_mailbox()
+ - Removed current_mailbox global variable
+
+ - Added free_all_aliasviews() to src/aliases/aliases.c
+ - Made leave() to use free_all_aliasviews()
+ - Made silently_exit() to use free_all_aliasviews()
+ - Made rm_temps_exit() to use free_all_aliasviews()
+ - Made leave_locked() to use free_all_aliasviews()
+ - Removed current_aliaslist global variable
+
+ - Added menu_trigger_redraw() to src/screen/context.c
+ - Changed resync() to use menu_trigger_redraw()
+ - Changed help() to use menu_trigger_redraw()
+ - Changed do_pipe() to use menu_trigger_redraw()
+ - Changed change_file() to use menu_trigger_redraw()
+ - Changed print_msg() to use menu_trigger_redraw()
+ - Changed subshell() to use menu_trigger_redraw()
+ - Changed pgp_extract_public_key() to use menu_trigger_redraw()
+ - Changed forward() to use menu_trigger_redraw()
+ - Changed reply_to_everyone() to use menu_trigger_redraw()
+ - Changed pgp_mail_public_key() to use menu_trigger_redraw()
+ - Changed send_msg_l() to use menu_trigger_redraw()
+ - Changed print_text() to use menu_trigger_redraw()
+ - Changed reply() to use menu_trigger_redraw()
+ - Changed save() to use menu_trigger_redraw()
+
+ - Changed pattern_match() to use menu_trigger_redraw()
+ - Changed limit() to use menu_trigger_redraw()
+ - Changed read_number to use menu_trigger_redraw()
+
+ - Changed alias_help() to use menu_trigger_redraw()
+ - Changed a_sendmsg() to use menu_trigger_redraw()
+
+ - Changed mailbox_command() to use menu_trigger_redraw()
+ - Changed motion() to use menu_trigger_redraw()
+ - Changed new_mail_check() to use menu_trigger_redraw()
+ - Changed mail() to use menu_trigger_redraw()
+ - Changed send_msg_middle() to use menu_trigger_redraw()
+ - Changed send_form() to use menu_trigger_redraw()
+ - Added menu_trigger_redraw() to get_copies()
+ - Added menu_trigger_redraw() to get_to()
+ - Added menu_trigger_redraw() to copy_the_msg()
+ - Added menu_trigger_redraw() to get_subject()
+ - Changed send_msg_argv() to use menu_trigger_redraw()
+
+ - Moved *.Canceled.mail to own directory
+ Canceled.mail.dir
+ - Editor buffer for f)orget messages is not kept.
+ Instead cancele mails are picked from
+ Canceled.mail.dir on m)ail -command ('/' on
+ To: prompt gives menu of cancelled messages.)
+ - Canceled.mail.dir is not available as folder
+ (it can not given for c)hange folder commmand
+ or -f option of Elm.)
+ - When canceled mail is picked from re-sending,
+ is is also deleted from Canceled.mail.dir
+ (f)orget command will re-add it to Canceled.mail.dir.)
+ - Name of Canceled.mail.dir can be changed with elmrc
+ option dead-letter-dir.
+
+ - Removed give_message_folder()
+
+ - Added -g option to Configure


+
+ New elmrc options:

+ dead-letter-dir
+
+ New file:
+ src/messages/canceled_mail.c
+ src/canceled.c
+ nls/Makefile.SH
+
+ Removed file:
+ nls/Makefile (this is now generated by Configure)


+
Changes of Elm 2.4ME+ PL118 (25) compared with Elm 2.4ME+ PL117 (25)

--------------------------------------------------------------------

***************
*** 33,38 ****
--- 131,140 ----


- Fix bug where Elm2.4ME+ PL117 was acting always as
dsn-success was set.

+ - Message/check
+ "signature" used in obsolete way in .elm/elmrc file.
+ removed.


+
- Moved get_term_chars() from src/init.c to

src/screen/init.c

***************
*** 323,329 ****


and reply() to use index, mailbox instead of

current_header, infile, mailbox.

! - Added give_next_open_mailbox() or src/messages.c and


made save_copy() to use it.

- Moved defination of struct mv_storage and

--- 425,431 ----


and reply() to use index, mailbox instead of

current_header, infile, mailbox.

! - Added give_next_open_mailbox() to src/messages.c and


made save_copy() to use it.

- Moved defination of struct mv_storage and

Index: elm2.4.ME+.119-cvs/Configure
*** elm2.4.ME+.118/Configure 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/Configure 2004-07-27 23:25:01.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.151 2004/06/18 20:40:55 hurtta Exp $
#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.155 2004/07/27 20:25:01 hurtta Exp $
#

: sanity checks


***************
*** 45,50 ****
--- 45,51 ----

batchmode=''
newmimecharsets='n'
config=''
+ addg=''

while test $# -gt 0; do
case "$1" in
***************
*** 55,60 ****
--- 56,62 ----
-M) shift; extractsh=map;;
-N) shift; newmimecharsets=y;;
-h) shift; error=true;;
+ -g) shift; addg=-g;;
-D*)
if test "$extradefs" = "" ; then
extradefs="$1"
***************
*** 122,128 ****
case "$error" in
true)
cat >&2 << EOM
! Usage: Configure [-dS]
-d : use defaults for all answers.
-b : batchmode -- do not prompt user (implies -d)
-h : print this help message and exit (with an error status).
--- 124,130 ----
case "$error" in
true)
cat >&2 << EOM
! Usage: Configure [-dSbhSMN] [-P'suffix'] [-s'suffix'] [-c'config'] [-DDEBUG]
-d : use defaults for all answers.
-b : batchmode -- do not prompt user (implies -d)
-h : print this help message and exit (with an error status).
***************
*** 134,139 ****
--- 136,142 ----
-s'suffix' : use as extra version suffix for shared libraries
-c'config' : Read file 'config' instead of config.sh (NOTE: config.sh is still written)
-DDEBUG : Compile with debugging
+ -g : COmpile with debugging symbols
EOM
exit 1
;;
***************
*** 186,191 ****
--- 189,210 ----
echo "Setting ccflags to $ccflags"
echo "Setting cppflags to $cppflags"
fi
+
+ if test "$addg" != "" ; then
+ . config.sh
+
+ optimize="$optimize $addg"
+ ldflags="$ldflags $addg"
+
+ cat >>config.sh <<EOT
+ optimize='$optimize'
+ ldflags='$ldflags'
+ EOT
+
+ echo "Setting optimize to $optimize"
+ echo "Setting ldflags to $ldflags"
+ fi
+
. ConfTool/Substitute


***************
*** 979,985 ****
diff
emacs
execmail
! finger
gpg
ispell
line
--- 998,1004 ----
diff
emacs
execmail
! gencat
gpg
ispell
line
***************
*** 1495,1505 ****

: determine optimize, if desired, or use for debug flag also
case "$optimize" in
! ' ') dflt="none"
;;
! '') dflt="-O";
;;
! *) dflt="$optimize"
;;
esac
cat <<EOH
--- 1514,1532 ----

: determine optimize, if desired, or use for debug flag also
case "$optimize" in
! ' ') case "$addg" in
! '') dflt="none"
! ;;
! *) dflt="$addg"
! ;;
! esac
;;
! '') dflt="-O $addg";
! ;;
! *$addg*)
! dflt="$optimize"
;;
! *) dflt="$optimize $addg"
;;
esac
cat <<EOH
***************
*** 1617,1629 ****
$echo ""
fi
case "$ldflags" in
! '') if venix; then
! dflt='-i -z'
! else
! dflt='none'
! fi
;;
! *) dflt="$ldflags";;
esac
cat <<EOH

--- 1644,1664 ----
$echo ""
fi
case "$ldflags" in
! '') case "$addg" in
! '')
! if venix; then
! dflt='-i -z'
! else
! dflt='none'
! fi
! ;;
! *)
! dflt="$addg"
! ;;
! esac
;;
! *$addg*) dflt="$ldflags";;
! *) dflt="$ldflags $addg";;
esac
cat <<EOH

***************
*** 2311,2317 ****
echo "Found shlib directory"
fi

! $echo "Trying create chared library"

LibLoc=`cd ..; pwd`/shlib

--- 2346,2352 ----
echo "Found shlib directory"
fi

! $echo "Trying create shared library"

LibLoc=`cd ..; pwd`/shlib

***************
*** 3752,3757 ****
--- 3787,3801 ----
if $test "$d_msgcat" = "$define" -a ! -z "$dflt" ; then
echo "Message catalog routines and nl_types.h found"
d_nl_types="$define"
+
+ if $test -f "$gencat" ; then
+ echo "System gencat command $gencat found"
+ else
+ echo "WARNING: System gencat command not found!"
+ echo
+ sleep 1
+ fi
+
else
echo "Message catalog routines or nl_types.h not found, $package will use its own"
d_msgcat="$undef"
***************
*** 6633,6638 ****
--- 6677,6683 ----
pack='$pack'
compress='$compress'
execmail='$execmail'
+ gencat='$gencat'
libswanted='$libswanted'
noaddlib='$noaddlib'
c_date='$c_date'
Index: elm2.4.ME+.119-cvs/hdrs/defs.h
*** elm2.4.ME+.118/hdrs/defs.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/hdrs/defs.h 2004-07-28 20:10:12.000000000 +0300
***************
*** 1,7 ****
! /* $Id: defs.h,v 1.49 2004/07/11 17:44:51 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: defs.h,v 1.51 2004/07/28 17:10:12 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 135,140 ****
--- 135,143 ----


#define MAIL_HAVE_ATTACHMENTS (1<<5) /* Flag for verify transmission */
#define MAIL_HAVE_PGP_ENCODED (1<<6) /* Falg for verify transmission */

#define MAIL_MIME_ATTCH (1<<7) /* mimeforward */

+ #define MAIL_COPY_SELECTION (1<<8) /* canceled mail */
+ #define MAIL_DELETE_CANCEL (1<<9) /* And delete canceled_view mail also
+ */



/* xxx_ACCESS moved to down after including of unistd.h */

Index: elm2.4.ME+.119-cvs/hdrs/elmlib.h
*** elm2.4.ME+.118/hdrs/elmlib.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/hdrs/elmlib.h 2004-07-27 23:25:01.000000000 +0300
***************
*** 1,7 ****


! /* $Id: elmlib.h,v 1.216 2004/07/12 17:48:38 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.216 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.217 2004/07/27 20:25:01 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.217 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 782,787 ****
--- 782,788 ----
extern int charset_convert_ok; /* flag: no warning about conversion? */
extern char raw_text_charset[SLEN]; /* name of character set */
extern charset_t text_charset; /* pointer to character set */
+ extern ESTR dead_letter_dir_e; /* Canceled.mail.dir */
extern char raw_default_mimetext_charset[SLEN]; /* name of character set */
extern charset_t default_mimetext_charset; /* pointer to character set */
extern char raw_default_nomime_charset[SLEN]; /* name of character set */
Index: elm2.4.ME+.119-cvs/hdrs/me.h
*** elm2.4.ME+.118/hdrs/me.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/hdrs/me.h 2004-07-28 20:10:12.000000000 +0300
***************
*** 1,7 ****


! /* $Id: me.h,v 1.97 2004/07/21 10:04:32 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.97 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.102 2004/07/28 17:10:12 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.102 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 87,114 ****

/* Return key if unknown */
extern int motion P_((int ch, struct menu_common *mc,
! int *redraw, int *nufoot,
int *header_page,
struct menu_context *page));
extern void check_range P_((struct menu_common *mc));
extern void forget_passphrase P_((void) );

extern int mailbox_command P_((struct MailboxView *mailbox, int ch,
! int *redraw, int *nufoot,
showmsg_cmd cmdX,
struct AliasView *aview,
int *header_page,
struct menu_context *page
));
extern void new_mail_check P_((struct MailboxView *mailbox,
! int *redraw, int *header_page,
struct menu_context *page));


/* help.c */

extern int display_helpfile P_((int section));
! extern int help P_((int pager_help, struct menu_context *page));

/* in_utils.c */

--- 87,114 ----

/* Return key if unknown */
extern int motion P_((int ch, struct menu_common *mc,
! int *nufoot,
int *header_page,
struct menu_context *page));
extern void check_range P_((struct menu_common *mc));
extern void forget_passphrase P_((void) );

extern int mailbox_command P_((struct MailboxView *mailbox, int ch,
! int *nufoot,
showmsg_cmd cmdX,
struct AliasView *aview,
int *header_page,
struct menu_context *page
));
extern void new_mail_check P_((struct MailboxView *mailbox,
! int *header_page,
struct menu_context *page));


/* help.c */

extern int display_helpfile P_((int section));
! extern void help P_((int pager_help, struct menu_context *page));

/* in_utils.c */

***************
*** 116,122 ****
int clear_and_center,
struct menu_context *page));
extern int read_number P_((int ch, const struct string *item, int current,
- int *redraw,
struct menu_context *page));

#define PROMPT_center 1
--- 116,121 ----
***************
*** 226,232 ****
extern int match_in_message P_((struct string *pat,


struct MailboxView *mailbox,
struct AliasView *aview));

! extern int pattern_match P_((struct menu_common *mc, int *redraw,


int header_page, struct menu_context *page));

extern int meta_match P_((int function, struct menu_common *mc,
int meta_match, struct menu_context *page));
--- 225,231 ----
extern int match_in_message P_((struct string *pat,


struct MailboxView *mailbox,
struct AliasView *aview));

! extern int pattern_match P_((struct menu_common *mc,

int header_page, struct menu_context *page));

extern int meta_match P_((int function, struct menu_common *mc,
int meta_match, struct menu_context *page));
***************
*** 326,332 ****

extern int expand_filename P_((char *, int, int));
extern void init_helpmsg P_(( char *, char *, int, int ));
! extern int save P_((int *redraw, int silently, int delete, int text_only,


struct MailboxView *mailbox,
struct AliasView *aview, int header_page,
struct menu_context *page));

--- 325,331 ----

extern int expand_filename P_((char *, int, int));
extern void init_helpmsg P_(( char *, char *, int, int ));
! extern int save P_((int silently, int delete, int text_only,


struct MailboxView *mailbox,
struct AliasView *aview, int header_page,

struct menu_context *page));
***************
*** 340,348 ****
extern int pgp_menu P_((char *filename,


struct mailing_headers *headers,
struct menu_context *page));

! extern int pgp_extract_public_key P_((struct header_rec *hdr,
! FILE *infile));
! extern int pgp_mail_public_key P_((struct MailboxView *mailbox,


struct AliasView *aview,
struct menu_context *page));

#endif
--- 339,348 ----
extern int pgp_menu P_((char *filename,


struct mailing_headers *headers,
struct menu_context *page));

! extern void pgp_extract_public_key P_((struct header_rec *hdr,
! FILE *infile,
! struct menu_context *page));
! extern void pgp_mail_public_key P_((struct MailboxView *mailbox,


struct AliasView *aview,
struct menu_context *page));

#endif
***************
*** 492,508 ****
/* mailmsg1.c */


! extern int a_sendmsg P_((int edit_message, int form_letter,


struct MailboxView *mailbox,
struct AliasView *aview, int header_page,
struct menu_context *page));

! extern int send_msg_argv P_((char *argv[],
char *given_subject,int options, int form,
struct MailboxView *mailbox /* null ?? */,
struct AliasView *aview,


struct menu_context *page));

! extern int send_msg_l P_((int index,
struct addr_item *given_to,
struct addr_item *given_cc,
char *given_subject,

--- 492,508 ----
/* mailmsg1.c */


! extern void a_sendmsg P_((int edit_message, int form_letter,


struct MailboxView *mailbox,
struct AliasView *aview, int header_page,
struct menu_context *page));

! extern void send_msg_argv P_((char *argv[],
char *given_subject,int options, int form,
struct MailboxView *mailbox /* null ?? */,


struct AliasView *aview,
struct menu_context *page));

! extern void send_msg_l P_((int index,


struct addr_item *given_to,
struct addr_item *given_cc,
char *given_subject,

***************
*** 514,522 ****
extern void display_to P_((struct expanded_address address,
struct menu_context *page));
extern int get_to P_((struct expanded_address *to,
! struct mailer_info *mailer_info,
! struct AliasView *aview,
! struct menu_context *page));


/* mailmsg2.c */
--- 514,524 ----
extern void display_to P_((struct expanded_address address,
struct menu_context *page));
extern int get_to P_((struct expanded_address *to,
! struct mailer_info *mailer_info,
! struct AliasView *aview,
! struct menu_context *page,
! struct MailboxView *cancel_view,
! int *cancel_selection));


/* mailmsg2.c */
***************
*** 526,542 ****
#endif


! extern int mail P_((int idx,
! int options, int form,
! struct mailing_headers *headers,
! struct mailer_info *mailer_info,


! struct MailboxView *mailbox /* system_call() */,

! struct AliasView *aview));


! extern int mail_form P_((int mail_index,
struct addr_item *address,
char *subj,
struct MailboxView *mailbox,

! struct AliasView *aview));

/* id_phrase.c */

--- 528,556 ----
#endif


! extern void mail P_((int idx,
! int options, int form,
! struct mailing_headers *headers,
! struct mailer_info *mailer_info,
! struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *parent_page,
! struct MailboxView *selection_view,
! int selection_idx));
!
! extern void mail_form P_((int mail_index,


struct addr_item *address,
char *subj,
struct MailboxView *mailbox,

! struct AliasView *aview,
! struct menu_context *page));
!
! /* canceled.c */
!
! extern char * last_canceled_mail;
! extern int view_canceled_mails P_((struct MailboxView * cancel_view,
! int *cancel_selection,
! struct AliasView *aview));

/* id_phrase.c */

***************
*** 566,581 ****
extern int system_call P_((char *, VOLATILE int,
struct MailboxView *mailbox));
#ifdef ALLOW_SUBSHELL
! extern int subshell P_((struct MailboxView *mailbox,
struct menu_context *page));
#endif
! extern int do_pipe P_((struct MailboxView *mailbox,
struct menu_context *page));
extern int have_printout P_((void));
! extern int print_msg P_((int pause_on_scroll,


struct MailboxView *mailbox,
struct menu_context *page));

! extern int print_text P_((int pause_on_scroll,
struct MailboxView *mailbox,


int header_page,
struct menu_context *page));

--- 580,595 ----
extern int system_call P_((char *, VOLATILE int,
struct MailboxView *mailbox));
#ifdef ALLOW_SUBSHELL
! extern void subshell P_((struct MailboxView *mailbox,
struct menu_context *page));
#endif
! extern void do_pipe P_((struct MailboxView *mailbox,
struct menu_context *page));
extern int have_printout P_((void));
! extern void print_msg P_((int pause_on_scroll,


struct MailboxView *mailbox,
struct menu_context *page));

! extern void print_text P_((int pause_on_scroll,
struct MailboxView *mailbox,
int header_page,
struct menu_context *page));
***************
*** 686,702 ****
/* utils.c */

extern void emergency_exit P_((int interrupt));
! extern void leave P_((int interrupt,
! struct MailboxView **mailbox,
! struct AliasView **aview));
extern void create_new_folders P_((void));
extern void create_new_elmdir P_((void));
! extern void rm_temps_exit P_((struct MailboxView **mailbox,
! struct AliasView **aview));
! extern void silently_exit P_((struct MailboxView **mailbox,
! struct AliasView **aview));
! extern void leave_locked P_((struct MailboxView **mailbox,
! struct AliasView **aview));
extern int get_page P_((int msg_pointer, struct menu_common *mc,
int *header_page));

--- 700,711 ----
/* utils.c */

extern void emergency_exit P_((int interrupt));
! extern void leave P_((int interrupt));
extern void create_new_folders P_((void));
extern void create_new_elmdir P_((void));
! extern void rm_temps_exit P_((void));
! extern void silently_exit P_((void));
! extern void leave_locked P_((void));
extern int get_page P_((int msg_pointer, struct menu_common *mc,
int *header_page));

***************
*** 717,731 ****


extern void get_return_name P_((char *address, char *name,
int trans_to_lowercase,
int size));

! extern int forward P_((int index,
struct MailboxView *mailbox,

struct AliasView *aview,


struct menu_context *page));
! extern int reply_to_everyone P_((int index,

struct MailboxView *mailbox,
struct AliasView *aview,


struct menu_context *page));
! extern int reply P_((int index,

struct MailboxView *mailbox,


struct AliasView *aview,
struct menu_context *page));

--- 726,740 ----


extern void get_return_name P_((char *address, char *name,
int trans_to_lowercase,
int size));

! extern void forward P_((int index,
struct MailboxView *mailbox,


struct AliasView *aview,
struct menu_context *page));

! extern void reply_to_everyone P_((int index,
struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));
! extern void reply P_((int index,


struct MailboxView *mailbox,
struct AliasView *aview,

struct menu_context *page));
***************
*** 853,861 ****
extern void quit P_((int prompt, struct MailboxView **mailbox,
struct AliasView **aview, int *header_page,
struct menu_context *page));
! extern int resync P_((struct MailboxView **mailbox, int *header_page,
struct menu_context *page));
! extern int change_file P_((struct MailboxView **mailbox,
struct AliasView *aview,
int *header_page,
struct menu_context *page));
--- 862,870 ----
extern void quit P_((int prompt, struct MailboxView **mailbox,
struct AliasView **aview, int *header_page,
struct menu_context *page));
! extern void resync P_((struct MailboxView **mailbox, int *header_page,
struct menu_context *page));
! extern void change_file P_((struct MailboxView **mailbox,
struct AliasView *aview,
int *header_page,
struct menu_context *page));
***************
*** 904,910 ****

/* edit.c */

! extern void edit_mailbox P_((struct MailboxView *mailbox,
int *header_mailbox,
struct menu_context *page));
extern int edit_a_file P_((const char *editfile,
--- 913,919 ----

/* edit.c */

! extern void edit_mailbox P_((struct MailboxView **mailbox,
int *header_mailbox,
struct menu_context *page));
extern int edit_a_file P_((const char *editfile,
***************
*** 920,926 ****

extern int visible_to_index P_((int message,
struct menu_common *mc));
! extern int limit P_((struct menu_common *mc,
struct menu_context *page));
extern void ClearSelection P_((struct MailboxView *mailbox));

--- 929,935 ----

extern int visible_to_index P_((int message,
struct menu_common *mc));
! extern void limit P_((struct menu_common *mc,
struct menu_context *page));
extern void ClearSelection P_((struct MailboxView *mailbox));

***************
*** 1013,1026 ****
long content_start,
header_list_ptr parsed_headers));

- extern struct MailboxView * current_mailbox;
-

/* Better handling of current mailbox:

idx == 0 first
*/

extern struct MailboxView * give_next_open_mailbox P_((int *idx,


int signal));

/* Joins storage to new view */
extern struct MailboxView * malloc_mailbox_view P_((struct current_storage *

--- 1022,1034 ----
long content_start,
header_list_ptr parsed_headers));



/* Better handling of current mailbox:

idx == 0 first
*/

extern struct MailboxView * give_next_open_mailbox P_((int *idx,
int signal));
+ extern void free_all_mailboxes P_((void));



/* Joins storage to new view */
extern struct MailboxView * malloc_mailbox_view P_((struct current_storage *
***************

*** 1133,1147 ****



extern int have_partial P_((struct MailboxView *parent_mailbox));

! /* screen/screen.c */



extern int InitScreen P_((struct menu_context **page));

extern void ScreenSize P_((int *lines, int *columns));

/* -1 == no changes */
extern void set_root_menu(int lines, int columns);

- /* ------------------------------------------------------- */


extern struct menu_context * default_context;

extern struct menu_context * new_menu_context P_((void));
--- 1141,1173 ----



extern int have_partial P_((struct MailboxView *parent_mailbox));

! /* messages/canceled_mail.c */
!
! extern struct MailboxView *give_canceled_mail P_((void));
! extern void close_canceled_mail P_((void));
! extern FILE * add_canceled_mail P_((char **outfile,
! struct mailing_headers * headers,
! struct MailboxView *view,
! time_t X,
! int lines,
! header_list_ptr h,
! long body_offset));
! extern void delete_marked_canceled_mails P_((struct MailboxView *view));
! extern void sync_canceled_mails P_((struct MailboxView *view));
! extern int cancel_set_current P_((struct MailboxView * cancel_view,
! char *last_canceled_mail));
! extern void delete_current_cancel P_((struct MailboxView * cancel_view,
! FILE *ref_file));
! /* src/screen/screen.c */



extern int InitScreen P_((struct menu_context **page));

extern void ScreenSize P_((int *lines, int *columns));

+ /* src/screen/context.c */


+
/* -1 == no changes */
extern void set_root_menu(int lines, int columns);

extern struct menu_context * default_context;

extern struct menu_context * new_menu_context P_((void));
***************
*** 1151,1156 ****
--- 1177,1184 ----
extern void menu_get_sizes P_((struct menu_context *ptr,
int *lines, int *columns));

+ extern void menu_trigger_redraw P_((struct menu_context *ptr));
+
/* called from signal handler */
extern void menu_context_resize P_((void));
extern void menu_context_redraw P_((void));
***************
*** 1237,1250 ****
extern void alias_free P_((struct alias_rec **h)); /* Free's record */


!
! extern struct AliasView * current_aliaslist;

extern struct AliasView * new_aliasview P_((void));
extern void free_aliasview P_((struct AliasView **x));
extern struct alias_rec * give_alias P_((struct AliasView *aview,
int index));

extern int get_alias_count P_((struct AliasView *aview));

extern int get_total_alias_count P_((struct AliasView *aview));
--- 1265,1280 ----
extern void alias_free P_((struct alias_rec **h)); /* Free's record */


! /* src/aliases/aliases.c */

extern struct AliasView * new_aliasview P_((void));
extern void free_aliasview P_((struct AliasView **x));
extern struct alias_rec * give_alias P_((struct AliasView *aview,
int index));

+ extern void free_all_aliasviews P_((void));
+
+
extern int get_alias_count P_((struct AliasView *aview));

extern int get_total_alias_count P_((struct AliasView *aview));
Index: elm2.4.ME+.119-cvs/hdrs/melib.h
*** elm2.4.ME+.118/hdrs/melib.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/hdrs/melib.h 2004-07-27 23:25:01.000000000 +0300
***************
*** 1,7 ****


! /* $Id: melib.h,v 1.44 2004/07/20 18:33:02 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: melib.h,v 1.45 2004/07/27 20:25:01 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 130,135 ****
--- 130,138 ----

extern int mime_notplain P_((mime_t *p));

+ /* 0: failure, 1: succeed */
+ extern int run_cte_decoder P_((mime_t *, in_state_t *, out_state_t *));
+

/* mime_parse.c */

Index: elm2.4.ME+.119-cvs/hdrs/save_opts.h
*** elm2.4.ME+.118/hdrs/save_opts.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/hdrs/save_opts.h 2004-07-27 23:25:02.000000000 +0300
***************
*** 1,7 ****
! /* @(#)$Id: save_opts.h,v 1.87 2004/06/27 15:18:05 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* @(#)$Id: save_opts.h,v 1.88 2004/07/27 20:25:02 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.88 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 301,306 ****
--- 301,307 ----


{"convert-comment-to-fullname",-1L,ZZZ_DT_BOL(&convert_comment), 0, NULL},
{"convert-utf-header",-1L,ZZZ_DT_BOL(&convert_utf_header), 0, NULL},
{"copy", -1L,ZZZ_DT_BOL(&auto_copy_sent), 0, NULL},

+ {"dead-letter-dir", -1L,ZZZ_DT_ESTR(&dead_letter_dir_e), 0, NULL},
{"default-folder-status", -1L,ZZZ_DT_NUM(&def_folder_status),
sizeof def_folder_status, &DEF_FOLDER_STATUS},
{"default-mime-text-charset",-1L,ZZZ_DT_STR(raw_default_mimetext_charset),
Index: elm2.4.ME+.119-cvs/hdrs/s_elm.h
*** elm2.4.ME+.118/hdrs/s_elm.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/hdrs/s_elm.h 2004-07-27 23:25:02.000000000 +0300
***************
*** 359,366 ****
#define ElmSendingMail 0x18f
#define ElmMailerReturnedError 0x190
#define ElmMailSent 0x191
- #define ElmRecallLastInstead 0x192
- #define ElmRecallLastKept 0x193
#define ElmErrorTryingToWrite 0x19a
#define ElmNoEncryptInBatch 0x19b
#define ElmWriteFailedCopyAcross 0x19c
--- 359,364 ----
***************
*** 726,732 ****
#define ElmVfyMenuIspell 0x34c
#define ElmVfyMenuShell 0x34d
#define ElmVfyMenuSndFgt 0x34e
- #define ElmVfyMessageKept 0x34f
#define ElmVfyNoFieldsInForm 0x350
#define ElmHelpViewAttach 0x351
#define ElmBadModeInElmrc 0x352
--- 724,729 ----
***************
*** 1098,1100 ****
--- 1095,1110 ----
#define ElmNoDSN 0x86a
#define ElmMailerDisconnected 0x86b
#define ElmMimeFWMessageYN 0x86c
+ #define ElmBadDeadLetterDir 0x86d
+ #define ElmDeadLetterDirCreated 0x86e
+ #define ElmCanceledMailsOn 0x86f
+ #define ElmCanceledMails 0x870
+ #define ElmMDirectoryOn 0x871
+ #define ElmMDirectory 0x872
+ #define ElmIsCanceledX 0x873
+ #define ElmIsCanceled1 0x874
+ #define ElmSelectCanMessage 0x875
+ #define ElmCancelMenuLine1 0x876
+ #define ElmCancelMenuLine2 0x877
+ #define ElmCancelMenuLine3 0x878
+ #define ElmVfyMessageKept1 0x879
Index: elm2.4.ME+.119-cvs/lib/cancel.c
*** elm2.4.ME+.118/lib/cancel.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/lib/cancel.c 2004-07-27 23:25:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cancel.c,v 1.2 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cancel.c,v 1.3 2004/07/27 20:25:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
Index: elm2.4.ME+.119-cvs/lib/outheaders.c
*** elm2.4.ME+.118/lib/outheaders.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/lib/outheaders.c 2004-07-28 11:55:59.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.20 2004/06/21 18:28:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.22 2004/07/28 08:55:59 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 212,223 ****
panic("HEADERS PANIC",__FILE__,__LINE__,"free_expanded_address",
"Bad magic number",0);

! if (x->addrs_len)
free_addr_items(x->addrs);
! x->addrs = NULL;
x->addrs_len = 0;

! if (x->surface_len) {
for (i = 0; i < x->surface_len; i++) {
if (x->surface[i].Textual) {
free_string (&(x->surface[i].Textual));
--- 212,224 ----
panic("HEADERS PANIC",__FILE__,__LINE__,"free_expanded_address",
"Bad magic number",0);

! if (x->addrs) {
free_addr_items(x->addrs);
! x->addrs = NULL;
! }
x->addrs_len = 0;

! if (x->surface) {
for (i = 0; i < x->surface_len; i++) {
if (x->surface[i].Textual) {
free_string (&(x->surface[i].Textual));
***************
*** 225,232 ****
}
free(x->surface);
x->surface = NULL;
- x->surface_len = 0;
}
}

struct string * make_surface_addr(ITEM)
--- 226,233 ----
}
free(x->surface);
x->surface = NULL;
}
+ x->surface_len = 0;
}

struct string * make_surface_addr(ITEM)
***************
*** 371,376 ****
--- 372,380 ----
{
int j;

+ if (!TMP)
+ return;


+
for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {

int pos = add_expanded_addr_(result,
TMP[j].addr,
Index: elm2.4.ME+.119-cvs/lib/read_rc.c
*** elm2.4.ME+.118/lib/read_rc.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/lib/read_rc.c 2004-07-27 23:25:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.141 2004/06/27 15:18:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.141 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.142 2004/07/27 20:25:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.142 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 121,126 ****
--- 121,132 ----
NULL
};

+ ESTR dead_letter_dir_e = {


+ 0,
+ NULL,
+ NULL
+ };

+

int clear_pages = 0; /* flag: act like "page" (more -c)? */
int title_messages = 1; /* flag: title message display? */

***************

*** 1257,1262 ****
--- 1263,1270 ----
calendar_file_e.unexpanded =
elm_message(FRM("~/%s"), dflt_calendar_file);

+ dead_letter_dir_e.unexpanded = safe_strdup("~/Canceled.mail.dir");
+

strfcpy(e_editor, emacs_editor, sizeof e_editor);
strfcpy(v_editor, default_editor, sizeof v_editor);

***************

*** 1491,1496 ****
--- 1499,1506 ----
}

void post_init_check(int flag) {
+
+ struct stat st_buffer;


char *t;

do_expand_env("folders", folders, raw_folders, sizeof(folders));

***************
*** 1506,1511 ****
--- 1516,1540 ----
raw_extra_mailbox_dir[0] = '\0';
}

+ t = give_dt_estr_as_str(&dead_letter_dir_e,"dead-letter-dir");
+
+ /* dead-letter-dir is create automatically, if it does not exists */
+ if (t &&
+ 0 == stat(t,&st_buffer) &&
+ #ifdef S_ISDIR
+ !S_ISDIR(st_buffer.st_mode)
+ #else
+ S_IFDIR != (st_buffer.st_mode & S_IFMT)
+ #endif
+ ) {
+ errors++;
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadDeadLetterDir,
+ "\"dead-letter-dir\" should be directory."));
+
+ free(dead_letter_dir_e.unexpanded);
+ dead_letter_dir_e.unexpanded = NULL;
+ }
+
if (!raw_attachment_dir[0]) {
char * tmp = elm_message(FRM("%s/Documents"),home);

Index: elm2.4.ME+.119-cvs/MANIFEST
*** elm2.4.ME+.118/MANIFEST 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/MANIFEST 2004-07-27 23:25:01.000000000 +0300
***************
*** 128,134 ****
nls/C/C/C/s_readmsg.m
nls/Install
nls/LANGS
! nls/Makefile
nls/gencat/Copyright
nls/gencat/Makefile
nls/gencat/README
--- 128,134 ----
nls/C/C/C/s_readmsg.m
nls/Install
nls/LANGS
! nls/Makefile.SH
nls/gencat/Copyright
nls/gencat/Makefile
nls/gencat/README
***************
*** 421,423 ****
--- 421,425 ----
lib/shared_all.c
src/screen/init.c
lib/cancel.c
+ src/messages/canceled_mail.c
+ src/canceled.c
Index: elm2.4.ME+.119-cvs/melib/mime_decode.c
*** elm2.4.ME+.118/melib/mime_decode.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/melib/mime_decode.c 2004-07-27 23:25:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.66 2004/07/20 18:33:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.67 2004/07/27 20:25:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1633,1642 ****
return;
}

! /* Prototype */
! static int run_decoder P_((mime_t *, in_state_t *, out_state_t *));
!
! static int run_decoder (ptr, state_in, state_out)
mime_t *ptr;
in_state_t *state_in;
out_state_t *state_out;
--- 1633,1639 ----
return;
}

! int run_cte_decoder (ptr, state_in, state_out)
mime_t *ptr;
in_state_t *state_in;
out_state_t *state_out;
***************
*** 1644,1654 ****
int is_text;

DPRINT(Debug,11,(&Debug,
! "run_decoder -> state: offset=%ld, length=%ld\n",
(long) ptr -> offset, (long) ptr -> length));



if (ptr->magic != MIME_magic)

! mime_panic(__FILE__,__LINE__,"run_decoder",
"Bad magic number");


--- 1641,1651 ----
int is_text;

DPRINT(Debug,11,(&Debug,
! "run_cte_decoder -> state: offset=%ld, length=%ld\n",
(long) ptr -> offset, (long) ptr -> length));



if (ptr->magic != MIME_magic)

! mime_panic(__FILE__,__LINE__,"run_cte_decoder",
"Bad magic number");


***************
*** 1668,1681 ****
ptr->encoding == ENCODING_7BIT ||
ptr->encoding == ENCODING_8BIT) {
DPRINT(Debug,11,(&Debug,
! "run_decoder: textual encoding (%s)\n",
ENCODING(ptr->encoding)));
is_text = 1;
} else
is_text = give_text_type_code(ptr->TYPE);

DPRINT(Debug,11,(&Debug,
! "run_decoder: is_text=%d; type=%p (%s/%s); encoding =%s (%d)\n",
is_text,
ptr->TYPE,
get_major_type_name(ptr->TYPE),
--- 1665,1678 ----
ptr->encoding == ENCODING_7BIT ||
ptr->encoding == ENCODING_8BIT) {
DPRINT(Debug,11,(&Debug,
! "run_cte_decoder: textual encoding (%s)\n",
ENCODING(ptr->encoding)));
is_text = 1;
} else
is_text = give_text_type_code(ptr->TYPE);

DPRINT(Debug,11,(&Debug,
! "run_cte_decoder: is_text=%d; type=%p (%s/%s); encoding =%s (%d)\n",
is_text,
ptr->TYPE,
get_major_type_name(ptr->TYPE),
***************
*** 1695,1701 ****
ptr->encoding != ENCODING_BINARY) {

DPRINT(Debug,11,(&Debug,
! "run_decoder=0 <- END; \n"));
if (in_state_seekable(state_in)) {
DPRINT(Debug,11,(&Debug,
" (file); ftell=%ld\n",
--- 1692,1698 ----
ptr->encoding != ENCODING_BINARY) {

DPRINT(Debug,11,(&Debug,
! "run_cte_decoder=0 <- END; \n"));
if (in_state_seekable(state_in)) {
DPRINT(Debug,11,(&Debug,
" (file); ftell=%ld\n",
***************
*** 1707,1713 ****
Xbit_decode (state_in, state_out, ptr->length, is_text);

DPRINT(Debug,11,(&Debug,
! "run_decoder=1 <- END; \n"));
if (in_state_seekable(state_in)) {
DPRINT(Debug,11,(&Debug,
" (file); ftell=%ld\n",
--- 1704,1710 ----
Xbit_decode (state_in, state_out, ptr->length, is_text);

DPRINT(Debug,11,(&Debug,
! "run_cte_decoder=1 <- END; \n"));
if (in_state_seekable(state_in)) {
DPRINT(Debug,11,(&Debug,
" (file); ftell=%ld\n",
***************
*** 1953,1959 ****

if (set_filter(ptr,state_out,default_mimetext_charset,


mss ? mss->override_charset : NULL)) {

! if (!run_decoder(ptr,state_in, state_out)) {
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeEncodingSkipping,
"[ Unsupported encoding, skipping... ]\n"));
--- 1950,1956 ----

if (set_filter(ptr,state_out,default_mimetext_charset,


mss ? mss->override_charset : NULL)) {

! if (!run_cte_decoder(ptr,state_in, state_out)) {
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeEncodingSkipping,
"[ Unsupported encoding, skipping... ]\n"));
***************
*** 2136,2142 ****
newstate.display_charset = default_vector;
}

! if (run_decoder(ptr,state_in,&newstate)) {

if (EOF == fflush(tmpfp)) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
--- 2133,2139 ----
newstate.display_charset = default_vector;
}

! if (run_cte_decoder(ptr,state_in,&newstate)) {

if (EOF == fflush(tmpfp)) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
Index: elm2.4.ME+.119-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.118/nls/C/C/C/s_elm.m 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/nls/C/C/C/s_elm.m 2004-07-30 01:07:13.000000000 +0300
***************
*** 743,752 ****
400 mailer returned error status %d
$ #MailSent
401 Mail sent!
- $ #RecallLastInstead
- 402 "Recall last kept message instead? (%c/%c) "
- $ #RecallLastKept
- 403 "Recall last kept message? (%c/%c) "
$ #ErrorTryingToWrite
410 Error %s encountered trying to write to %s.
$quote
--- 743,748 ----
***************
*** 1536,1543 ****
$quote
$ #VfyMenuSndFgt
846 s)end, or f)orget
- $ #VfyMessageKept
- 847 Message kept. Can be restored at next f)orward, m)ail or r)eply.
$ #VfyNoFieldsInForm
848 No fields in form!\007
$ #HelpViewAttach
--- 1532,1537 ----
***************
*** 2304,2306 ****
--- 2298,2328 ----


2155 "Mailer disconnected! Can't send message. Use f)orget !"
$ #MimeFWMessageYN

2156 "Forward message as separate part? (%c/%c) "
+ $quote '
+ $ #BadDeadLetterDir
+ 2157 '"dead-letter-dir" should be directory.'
+ $ #DeadLetterDirCreated
+ 2158 '"dead-letter-dir" %s created.'
+ $ #CanceledMailsOn
+ 2159 'Canceled mails on %s'
+ $ #CanceledMails
+ 2160 'Canceled mails'
+ $ #MDirectoryOn
+ 2161 'Message directory %s on %s'
+ $ #MDirectory
+ 2162 'Message directory %s'
+ $ #IsCanceledX
+ 2163 '%d canceled mails. Use / to select one of them.'
+ $ #IsCanceled1
+ 2164 '1 canceled mail. Use / to select it.'
+ $ #SelectCanMessage
+ 2165 'Select Canceled message'
+ $ #CancelMenuLine1
+ 2166 'To select canceled message for mailing, press <return>.'
+ $ #CancelMenuLine2
+ 2167 'To read message, press space. j = move down, k = move up'
+ $ #CancelMenuLine3
+ 2168 'Also available: d)elete, u)ndelete, i)ndex'
+ $ #VfyMessageKept1
+ 2169 'Message kept. Can be restored at next m)ail command.'
+
Index: elm2.4.ME+.119-cvs/nls/Makefile
*** elm2.4.ME+.118/nls/Makefile 2002-03-20 09:04:46.000000000 +0200
--- /tmp/21867-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-04 20:00:20.000000000 +0300
***************
*** 1,55 ****
- #
- # $Id: Makefile,v 1.4 2002/03/06 15:05:12 hurtta Exp $
- #
- LANGFILE=LANGS
- CATNAME=elm2.4me+.cat
- GENCAT= nls/gencat
-
- HDIR= ../hdrs
- SDIR= C/C/C
- MSGCAT= elm2.4me+.cat
- HFILES= $(HDIR)/s_aliases.h \
- $(HDIR)/s_answer.h \
- $(HDIR)/s_elm.h \
- $(HDIR)/s_me.h \
- $(HDIR)/s_elmalias.h \
- $(HDIR)/s_elmrc.h \
- $(HDIR)/s_error.h \
- $(HDIR)/s_fastmail.h \
- $(HDIR)/s_from.h \
- $(HDIR)/s_newalias.h \
- $(HDIR)/s_newmail.h \
- $(HDIR)/s_readmsg.h
-
- MFILES= $(SDIR)/s_aliases.m \
- $(SDIR)/s_answer.m \
- $(SDIR)/s_elm.m \
- $(SDIR)/s_me.m \
- $(SDIR)/s_elmalias.m \
- $(SDIR)/s_elmrc.m \
- $(SDIR)/s_error.m \
- $(SDIR)/s_fastmail.m \
- $(SDIR)/s_from.m \
- $(SDIR)/s_newalias.m \
- $(SDIR)/s_newmail.m \
- $(SDIR)/s_readmsg.m
-
- nls-headers: clean $(HFILES)
-
- # Nothing to do here. The message catalogs all have the
- # same basename, so wait until install to put them somewhere.
- all:
-
- install:
- ./Install $(LANGFILE) $(GENCAT) $(CATNAME)
-
- $(HFILES): $(MFILES) gencat/gencat
- gencat/gencat $(MSGCAT) "$(SDIR)/`basename $@ .h`".m -h $@
-
- clean: FRC
- /bin/rm -f $(MSGCAT)
-
- FRC:
-
- gencat/gencat:
- ( cd gencat; make )
--- 0 ----
Index: elm2.4.ME+.119-cvs/nls/Makefile.SH
*** /tmp/21867-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-04 20:00:20.000000000 +0300
--- elm2.4.ME+.119-cvs/nls/Makefile.SH 2004-07-22 14:40:22.000000000 +0300
***************
*** 0 ****
--- 1,83 ----
+ case $CONFIG in
+ '')
+ if test ! -f config.sh; then
+ ln ../config.sh . || \
+ ln ../../config.sh . || \
+ ln ../../../config.sh . || \
+ (echo "Can't find config.sh."; exit 1)
+ fi
+ . ./config.sh
+ ;;
+ esac
+ case "$0" in
+ */*) cd `expr X$0 : 'X\(.*\)/'` ;;
+ esac
+
+ case "$d_msgcat" in
+ define) installgencat="$gencat" ;;
+ *) installgencat="gencat/gencat"
+ ;;
+ esac
+
+ echo "Extracting nls/Makefile (with variable substitutions)"
+ cat >Makefile <<!GROK!THIS!
+ #!$make
+ # $Id: Makefile.SH,v 1.1 2004/07/22 11:40:22 hurtta Exp $
+
+ LANGFILE=LANGS
+ CATNAME=elm2.4me+.cat
+ GGENCAT=gencat/gencat
+ IGENCAT=$installgencat
+
+ !GROK!THIS!
+
+ cat >>Makefile <<'!NO!SUBS!'
+ HDIR= ../hdrs
+ SDIR= C/C/C
+ MSGCAT= elm2.4me+.cat
+ HFILES= $(HDIR)/s_aliases.h \
+ $(HDIR)/s_answer.h \
+ $(HDIR)/s_elm.h \
+ $(HDIR)/s_me.h \
+ $(HDIR)/s_elmalias.h \
+ $(HDIR)/s_elmrc.h \
+ $(HDIR)/s_error.h \
+ $(HDIR)/s_fastmail.h \
+ $(HDIR)/s_from.h \
+ $(HDIR)/s_newalias.h \
+ $(HDIR)/s_newmail.h \
+ $(HDIR)/s_readmsg.h
+
+ MFILES= $(SDIR)/s_aliases.m \
+ $(SDIR)/s_answer.m \
+ $(SDIR)/s_elm.m \
+ $(SDIR)/s_me.m \
+ $(SDIR)/s_elmalias.m \
+ $(SDIR)/s_elmrc.m \
+ $(SDIR)/s_error.m \
+ $(SDIR)/s_fastmail.m \
+ $(SDIR)/s_from.m \
+ $(SDIR)/s_newalias.m \
+ $(SDIR)/s_newmail.m \
+ $(SDIR)/s_readmsg.m
+
+ nls-headers: clean $(HFILES)
+
+ # Nothing to do here. The message catalogs all have the
+ # same basename, so wait until install to put them somewhere.
+ all:
+
+ install:
+ ./Install $(LANGFILE) $(IGENCAT) $(CATNAME)
+
+ $(HFILES): $(MFILES) $(GGENCAT)
+ $(GGENCAT) $(MSGCAT) "$(SDIR)/`basename $@ .h`".m -h $@
+
+ clean: FRC
+ /bin/rm -f $(MSGCAT)
+
+ FRC:
+
+ gencat/gencat:
+ ( cd gencat; make )
+ !NO!SUBS!
Index: elm2.4.ME+.119-cvs/src/alias.c
*** elm2.4.ME+.118/src/alias.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/alias.c 2004-07-26 15:41:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.39 2004/07/21 10:04:32 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias.c,v 1.41 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 82,88 ****
struct AliasView *avies,
int headerPage,
struct menu_context *page));
! static int alias_help P_((struct menu_context *page));


extern int is_system; /* system file updating? */
--- 82,88 ----
struct AliasView *avies,
int headerPage,
struct menu_context *page));
! static void alias_help P_((struct menu_context *page));


extern int is_system; /* system file updating? */
***************
*** 1023,1029 ****
redraw++;
}
else
! redraw = menu_need_redraw(page);

nucurr = 0;
nufoot = 0;
--- 1023,1029 ----
redraw++;
}
else
! redraw += menu_need_redraw(page);

nucurr = 0;
nufoot = 0;
***************
*** 1055,1061 ****
goto resize_mark;

case HELP_MARK:
! case '?': redraw += alias_help(page); break;

case REDRAW_MARK:
case 'L'&31: redraw++; break;
--- 1055,1064 ----
goto resize_mark;

case HELP_MARK:
! case '?':
! alias_help(page);
! redraw += menu_need_redraw(page);
! break;

case REDRAW_MARK:
case 'L'&31: redraw++; break;
***************
*** 1140,1148 ****
"Mail..."));
FlushBuffer();

! redraw += a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,
! page);
}
else {
lib_error(CATGETS(elm_msg_cat,
--- 1143,1153 ----
"Mail..."));
FlushBuffer();

! a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,
! page);
! redraw += menu_need_redraw(page);
!
}
else {
lib_error(CATGETS(elm_msg_cat,
***************
*** 1387,1404 ****
* it must be a "motion" command (or an error).
*/
default :
! ch = motion(ch,&MENU,&redraw,&nufoot, &header_page,
page);
switch (ch) {
case 0: /* OK */
break;

! case EOF: leave(0,
! &current_mailbox,
! &current_aliaslist); /* Read failed, control tty died? */
!
! /* ?? global reference */
break;
default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmUnknownCommand,
--- 1392,1409 ----
* it must be a "motion" command (or an error).
*/
default :
! ch = motion(ch,&MENU,&nufoot, &header_page,
page);
+
+ redraw += menu_need_redraw(page);
+
switch (ch) {
case 0: /* OK */
break;

! case EOF: leave(0); /* Read failed, control tty died? */
break;
+
default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmUnknownCommand,
***************
*** 1407,1412 ****
--- 1412,1419 ----
}

if (redraw) { /* Redraw screen if necessary */
+ DPRINT(Debug,7, (&Debug,
+ "alias: pending redraw\n"));
alias_screen(newaliases, aview, &header_page, page);
nutitle = 0;
}
***************
*** 1485,1497 ****
}
}

! static int alias_help(page)
struct menu_context *page;
{
/*
* Help section for the alias menu...
*
! * Return non-0 if main part of screen overwritten, else 0
*/

int ch;
--- 1492,1504 ----
}
}

! static void alias_help(page)
struct menu_context *page;
{
/*
* Help section for the alias menu...
*
! * If redraw is needed use menu_trigger_redraw(page)
*/

int ch;
***************
*** 1528,1540 ****
break;
switch(ch) {
case EOF :
! leave(0, &current_mailbox, &current_aliaslist);
! /* ?? global reference */
break;
case HELP_MARK:
! case '?' : display_helpfile(ALIAS_HELP);
redraw++;
! return(redraw);

case '$': lib_transient(CATGETS(elm_msg_cat, AliasesSet,
AliasesHelpDollar,
--- 1535,1548 ----
break;
switch(ch) {
case EOF :
! leave(0);
break;
case HELP_MARK:
! case '?' :
! display_helpfile(ALIAS_HELP);
redraw++;
! menu_trigger_redraw(page);
! return;

case '$': lib_transient(CATGETS(elm_msg_cat, AliasesSet,
AliasesHelpDollar,
***************
*** 1645,1651 ****

/* Remove help lines */
MoveCursor(LINES-4, 0); CleartoEOS();
! return(redraw);
}

void main_state()
--- 1653,1663 ----

/* Remove help lines */
MoveCursor(LINES-4, 0); CleartoEOS();
!
! if (redraw)
! menu_trigger_redraw(page);
!
! return;
}

void main_state()
Index: elm2.4.ME+.119-cvs/src/aliases/aliases.c
*** elm2.4.ME+.118/src/aliases/aliases.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.119-cvs/src/aliases/aliases.c 2004-07-24 22:50:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: aliases.c,v 1.6 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: aliases.c,v 1.7 2004/07/24 19:50:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 10,24 ****

DEBUG_VAR(Debug,__FILE__,"alias");

- struct AliasView * current_aliaslist = NULL;
-
struct alias_view {
int classnum;
int index;
};

! struct AliasView * new_aliasview() {

struct AliasView *r = safe_malloc(sizeof (*r));



/* bzero is defined hdrs/defs.h */

--- 10,27 ----

DEBUG_VAR(Debug,__FILE__,"alias");

struct alias_view {
int classnum;
int index;
};

! static struct AliasView ** aliasview_list = NULL;
! static int aliasview_list_len = 0;

+ struct AliasView * new_aliasview()
+ {
+ int idx;
+ struct AliasView **X;
struct AliasView *r = safe_malloc(sizeof (*r));



/* bzero is defined hdrs/defs.h */

***************
*** 33,38 ****
--- 36,62 ----

r->normal_alias_len = 0;

+ for (idx = 0; idx < aliasview_list_len; idx++)
+ if (!aliasview_list[idx]) {
+ DPRINT(Debug,7,(&Debug,
+ "malloc_view: Re-using aliasview index %d\n",
+ idx));
+ goto found;
+ }
+
+ X = safe_realloc(aliasview_list,(aliasview_list_len+1)* sizeof (*X));
+ X[aliasview_list_len] = NULL;
+ aliasview_list = X;
+ idx = aliasview_list_len++;
+
+ DPRINT(Debug,7,(&Debug,
+ "malloc_view: Allocing new aliasview index %d\n",
+ idx));
+
+
+ found:
+ aliasview_list[idx] = r;
+
return r;
}

***************
*** 50,65 ****

}

!
! void free_aliasview(x)
struct AliasView **x;
{
struct AliasView *r = *x;
-
- if (r->magic != ALIASVIEW_magic)
- panic("ALIAS VIEW PANIC",__FILE__,__LINE__,"free_aliasview",
- "bad aliasview magic",0);
-
if (r->aliasclass) {
int i;

--- 74,84 ----

}

! static void free_aliasview1 P_((struct AliasView **x));
! static void free_aliasview1(x)
struct AliasView **x;
{
struct AliasView *r = *x;
if (r->aliasclass) {
int i;

***************
*** 81,89 ****
--- 100,165 ----

r->magic = 0; /* Invalidate */
free(r); r = NULL;
+
*x = r;
}

+ void free_aliasview(x)
+ struct AliasView **x;
+ {
+ int i;
+ struct AliasView *r = *x;
+
+ if (r->magic != ALIASVIEW_magic)
+ panic("ALIAS VIEW PANIC",__FILE__,__LINE__,"free_aliasview",
+ "bad aliasview magic",0);
+
+ for ( i = 0; i < aliasview_list_len; i++) {
+ if (aliasview_list[i] == r) {
+
+ SIGDPRINT(Debug,7,(&Debug,
+ "free_aliasview: Aliasview index %d goes free\n",
+ i));
+
+ aliasview_list[i] = NULL;


+ goto okei;
+ }
+ }
+

+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_aliasview",
+ "aliasview not found from list",0);
+
+ okei:
+ free_aliasview1(&r);
+
+ *x = r;
+ }
+
+ void free_all_aliasviews()
+ {
+ if (aliasview_list) {
+ int i;
+
+ for ( i = 0; i < aliasview_list_len; i++) {
+ if (aliasview_list[i]) {
+
+ SIGDPRINT(Debug,7,(&Debug,"free_all_aliasviews: [%d]\n",
+ i));
+
+ if (aliasview_list[i]->magic != ALIASVIEW_magic)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_all_aliasviews",
+ "Bad magic number",0);
+
+ free_aliasview1(& (aliasview_list[i]));
+ }
+ }
+
+ free(aliasview_list);
+ aliasview_list = NULL;
+ }
+ aliasview_list_len = 0;
+ }
+
struct aliasclass * add_aliasclass(x,t)
struct AliasView *x;
struct alias_type *t;
Index: elm2.4.ME+.119-cvs/src/attach_menu.c
*** elm2.4.ME+.118/src/attach_menu.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/attach_menu.c 2004-07-26 15:41:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.67 2004/07/14 07:38:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.68 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.68 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 2595,2601 ****
break;
#ifdef ALLOW_SUBSHELL
case '!':
! if (subshell(NULL,page) != 0) {
menu_ClearScreen(page);
update = TRUE;
}
--- 2595,2604 ----
break;
#ifdef ALLOW_SUBSHELL
case '!':
!
! subshell(NULL,page);
!
! if (menu_need_redraw(page)) {
menu_ClearScreen(page);
update = TRUE;
}
Index: elm2.4.ME+.119-cvs/src/canceled.c
*** /tmp/21867-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-04 20:00:20.000000000 +0300
--- elm2.4.ME+.119-cvs/src/canceled.c 2004-07-28 21:00:56.000000000 +0300
***************
*** 0 ****
--- 1,409 ----
+ static char rcsid[] = "@(#)$Id: canceled.c,v 1.5 2004/07/28 18:00:56 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ ****************************************************************************
+ * Some code copiend from src/elm.c and src/leavembox.c.
+ * On these are following copyright:


+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1992 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************/
+

+ #include "def_elm.h"
+ #include "s_elm.h"
+
+ DEBUG_VAR(Debug,__FILE__,"ELM");
+
+ static void cancel_menu P_((struct menu_context *page));
+ static void cancel_menu(page)
+ struct menu_context *page;
+ {
+ /** write main system menu... **/


+ int LINES, COLUMNS;
+
+ menu_get_sizes(default_context,&LINES, &COLUMNS);
+

+ print_format_center(LINES-8,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmCancelMenuLine1,
+ "To select canceled message for mailing, press <return>."));
+ print_format_center(LINES-7,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmCancelMenuLine2,
+ "To read message, press space. j = move down, k = move up"));
+ print_format_center(LINES-6,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmCancelMenuLine3,
+ "Also available: d)elete, u)ndelete, i)ndex"));
+
+ }
+
+
+ static int showmsg_cancel_cmd P_(( struct MailboxView *mailbox,
+ int cmd, int *screen_mangled,
+ struct menu_context *page));
+ static int showmsg_cancel_cmd(mailbox,cmd,screen_mangled, page)
+ struct MailboxView *mailbox;
+ int cmd;
+ int *screen_mangled;
+ struct menu_context *page;
+ {
+
+
+ return cmd;
+ }
+
+ /* This leaks on exit */
+ char * last_canceled_mail = NULL;
+
+ int view_canceled_mails(cancel_view,cancel_selection,aview)
+ struct MailboxView * cancel_view;
+ int *cancel_selection;
+ struct AliasView *aview;
+ {
+
+ int leave = 0;
+ int redraw = 0, nufoot = 0;
+ int can_flag = 0;
+ int i;
+
+ struct menu_context *page = new_menu_context();
+
+ struct menu_common MENU;


+ int LINES, COLUMNS;
+

+ int header_page = 0;
+ if (get_message_count(cancel_view) > 0) {
+
+ if (! last_canceled_mail ||
+ ! cancel_set_current(cancel_view,last_canceled_mail))
+ set_current(cancel_view,1); /* Set current to first message */
+
+ update_view(cancel_view);
+ resort_mailbox(cancel_view,1, &header_page);
+ }
+
+ start_again:
+ leave = 0;


+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ set_mcommon_from_mbxview(&MENU,cancel_view);
+
+ showscreen(cancel_view,
+ cancel_menu,&header_page, page);
+
+ while (!leave) {
+ int ch;
+
+ if (menu_resized(page)) {


+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ #undef max
+ #define max(a,b) ((a) < (b) ? (b) : (a))
+ if (mini_menu)
+ headers_per_page = max (LINES - 14, 1);
+ else
+ headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
+ #undef max
+ redraw++;
+ } else
+ redraw = menu_need_redraw(page);
+
+ nufoot = 0;
+ nucurr = 0;
+
+ new_mail_check(cancel_view, &header_page, page);
+ redraw += menu_need_redraw(page);
+
+ if (update_view(cancel_view)) {
+ resort_mailbox(cancel_view,1, &header_page);
+
+ redraw++;
+ }
+
+ if (redraw) {
+ redraw = 0;
+ showscreen(cancel_view,
+ cancel_menu,&header_page, page);
+ show_last_error();
+ }
+
+
+ {
+ int lin,col;
+ prompt_s(mcommon_give_item(&MENU,m_Prompt));
+ GetXYLocation(&lin,&col);
+
+ CleartoEOLN();
+ ch = GetPrompt(page);
+
+ CleartoEOS();
+
+ if (isascii(ch) && isprint(ch)) {
+ DPRINT(Debug,4,(&Debug,
+ "\nCommand: %c [%d]\n\n", ch, ch));
+ } else {
+ DPRINT(Debug,4,(&Debug,
+ "\nCommand: %d\n\n", ch));
+ }
+
+ set_error(""); /* clear error buffer */
+
+ MoveCursor(lin,col);
+ }
+
+ ch = motion(ch,&MENU,&nufoot, &header_page,
+ page);
+ redraw += menu_need_redraw(page);
+
+ switch (ch) {
+ case 0: /* OK */
+ break;
+
+ quit_mark:
+ case ctrl('Q') :
+
+ case 'Q':
+ case 'X':
+
+ leave = -2;
+ break;
+ case 'q':
+ case 'i':
+
+ leave = 1;
+
+ break;
+
+ case '$':
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
+ ElmResyncFolder,
+ "Resynchronize folder"));
+ FlushBuffer();
+ leave = -1;
+ break;
+
+ case ' ': /* Copied from mailbox_command */ {
+ int current = get_current(cancel_view);
+
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
+ ElmDisplayMessage,
+ "Display message"));
+ FlushBuffer();
+
+ if (current < 1)
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmNoMailToRead,
+ "No mail to read!"));
+ else {
+ struct header_rec *hdr;
+ FILE *F;
+ int i = 0;
+
+ /* define_softkeys(READ); */
+
+
+ if (give_message_data(cancel_view,current-1,
+ &hdr,&F,NULL,
+ mime_parse_routine))
+ i = show_msg(hdr,F,current,
+ get_message_count(cancel_view),
+ page);
+ else {
+ DPRINT(Debug,3,(&Debug,
+ "give_message_data [%d] fails",current-1));
+ }
+
+ while (i > 0) {
+ i = process_showmsg_cmd(i, cancel_view,
+ showmsg_cancel_cmd,
+ aview, &header_page,
+ page);
+
+ switch (i) {
+ case EOF:
+ goto eof_mark;
+
+ case 'X': /* Quick Exit */
+
+ goto quit_mark;
+ case 0:


+ break;
+
+ default:

+ DPRINT(Debug,3,(&Debug,
+ "Looping showmsg command %d (%c)\n",
+ i,i));
+ }
+ }
+
+ current = get_current(cancel_view);
+
+ redraw++;
+ (void)get_page(current, &MENU, &header_page);
+ }
+ }
+ break;
+
+ case ctrl('J'):
+ case ctrl('M'): {
+ int current = get_current(cancel_view);
+
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
+ ElmSelectCanMessage,
+ "Select Canceled message"));
+
+ FlushBuffer();
+ if (current > 0) {
+ *cancel_selection = current -1;
+ leave = 1;
+ can_flag = 1;
+ }
+ }
+ break;
+
+ eof_mark:
+ case EOF:
+
+ goto OUT;
+
+ default:
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmUnknownCommand2,
+ "Unknown command."));
+
+ }
+
+ if (redraw)
+ showscreen(cancel_view,
+ cancel_menu,&header_page, page);
+
+ check_range(&MENU);
+
+
+ if (nucurr == NEW_PAGE) {
+ DPRINT(Debug,5,(&Debug, " nucurr == NEW_PAGE\n"));
+ show_headers(&MENU,&header_page, page);
+ } else if (nucurr == SAME_PAGE) {
+ DPRINT(Debug,5,(&Debug, " nucurr == SAME_PAGE\n"));
+ show_current(&MENU,&header_page, page);
+ } else if (nufoot) {
+ if (mini_menu) {
+ MoveCursor(LINES-8, 0);
+ CleartoEOS();
+ cancel_menu(page);
+ }
+ else {
+ MoveCursor(LINES-5, 0);
+ CleartoEOS();
+ }
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.
+ */
+ }
+
+ } /* the BIG while loop! */
+
+
+ if (leave != -2) {
+ int marked_deleted = 0;
+
+ for (i = 0; i < get_message_count(cancel_view); i++) {
+ if (mcommon_ison_status(&MENU,i,DELETED))
+ marked_deleted++;
+ }
+
+ if (marked_deleted > 0) {
+ int answer = (always_del ?
+ *def_ans_yes : *def_ans_no); /* default answer */
+
+ if(question_me) {
+ int def = answer;
+

+ /* NOTICE: prompt_letter may return EOF */

+ if (marked_deleted == 1)
+ answer = prompt_letter(LINES-4,"",def,
+ PROMPT_yesno|PROMPT_cancel|
+ PROMPT_redraw_mark|PROMPT_ctrlL,
+ page,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmLeaveDeleteMessage,
+ "Delete message? (%c/%c) "),
+ *def_ans_yes, *def_ans_no);
+ else
+ answer = prompt_letter(LINES-4,"",def,
+ PROMPT_yesno|PROMPT_cancel|
+ PROMPT_redraw_mark|PROMPT_ctrlL,
+ page,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmLeaveDeleteMessages,
+ "Delete messages? (%c/%c) "),
+ *def_ans_yes, *def_ans_no);
+
+ if (TERMCH_interrupt_char == answer) {
+ leave = 0;
+ can_flag = 0;
+ goto start_again;
+ }
+
+ if (answer == ('L'&31) || answer == REDRAW_MARK) {
+ menu_ClearScreen(page);
+ goto start_again;
+ }
+
+ if (answer == EOF) {
+ can_flag = 0;
+ goto OUT;
+ }
+ }
+
+ if (answer == *def_ans_yes) {
+ /* NOTICE: This does not update index so
+ *cancel_selection is still valid */
+
+ delete_marked_canceled_mails(cancel_view);
+ }
+
+ }
+ }
+
+ if (leave == -1) {
+ int n;
+
+ *cancel_selection = -1;
+ can_flag = 0;
+
+ sync_canceled_mails(cancel_view) ;
+
+ if (get_current(cancel_view) > (n = get_message_count(cancel_view)))
+ set_current(cancel_view,n);
+
+ resort_mailbox(cancel_view,1, &header_page);
+
+ goto start_again;
+ }
+
+ OUT:
+ erase_menu_context(&page);
+
+ DPRINT(Debug,4,(&Debug, "view_canceled_mails=%d *cancel_selection=%d\n",
+ can_flag,*cancel_selection));
+ return can_flag;
+ }
+

+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.119-cvs/src/digest.c
*** elm2.4.ME+.118/src/digest.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.119-cvs/src/digest.c 2004-07-26 15:41:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.10 2004/03/27 18:31:44 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: digest.c,v 1.11 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************

*** 162,171 ****
MoveCursor(lin,col);
}

! ch = mailbox_command(mailbox,ch, &redraw, &nufoot,
showmsg_digest_cmd, aview,
&header_page,page);

switch (ch) {
case 0: /* OK */
break;
--- 162,173 ----
MoveCursor(lin,col);
}

! ch = mailbox_command(mailbox,ch, &nufoot,
showmsg_digest_cmd, aview,
&header_page,page);

+ redraw += menu_need_redraw(page);
+
switch (ch) {
case 0: /* OK */
break;
Index: elm2.4.ME+.119-cvs/src/edit.c
*** elm2.4.ME+.118/src/edit.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/edit.c 2004-07-24 22:50:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: edit.c,v 1.20 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: edit.c,v 1.21 2004/07/24 19:50:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 31,37 ****
#ifdef ALLOW_MAILBOX_EDITING

void edit_mailbox(mailbox, header_page, page)
! struct MailboxView *mailbox;
int *header_page;
struct menu_context *page;
{
--- 31,37 ----
#ifdef ALLOW_MAILBOX_EDITING

void edit_mailbox(mailbox, header_page, page)
! struct MailboxView **mailbox;
int *header_page;
struct menu_context *page;
{
***************
*** 49,55 ****
**/

CONST char *edited_file = NULL;
! struct folder_info * f = get_main_folder(mailbox);

if (!f)
return;
--- 49,55 ----
**/

CONST char *edited_file = NULL;
! struct folder_info * f = get_main_folder(*mailbox);

if (!f)
return;
***************
*** 73,86 ****
}

menu_ClearScreen(page);
! newmbox_1(f, FALSE, &current_mailbox, FALSE, header_page,
! page); /* !!!! */

- #if 0 /* FIXME */
- mailbox = current_mailbox; /* FIX ... */
- #endif

! showscreen(mailbox, show_menu, header_page, page);
return;
}

--- 73,83 ----
}

menu_ClearScreen(page);
! newmbox_1(f, FALSE, mailbox, FALSE, header_page,
! page);


! showscreen(*mailbox, show_menu, header_page, page);
return;
}

Index: elm2.4.ME+.119-cvs/src/elm.c
*** elm2.4.ME+.118/src/elm.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/elm.c 2004-07-27 23:25:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.71 2004/07/11 11:36:08 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.71 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.74 2004/07/27 20:25:02 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.74 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 107,123 ****
extern int errno;
#endif

! int mailbox_command(mailbox, ch, redraw, nufoot, cmdX, aview, header_page,
page)
struct MailboxView *mailbox;
! int ch;
! int *redraw;
int *nufoot;
showmsg_cmd cmdX;
struct AliasView *aview;
int *header_page;
struct menu_context *page;
{
struct menu_common MENU;
int LINES, COLUMNS;

--- 107,123 ----
extern int errno;
#endif

! int mailbox_command(mailbox, ch, nufoot, cmdX, aview, header_page,
page)
struct MailboxView *mailbox;
! int ch;
int *nufoot;
showmsg_cmd cmdX;
struct AliasView *aview;
int *header_page;
struct menu_context *page;
{
+ int redraw = 0;
struct menu_common MENU;
int LINES, COLUMNS;

***************
*** 130,136 ****

#ifdef ALLOW_SUBSHELL
case '!' : Writechar('!');
! *redraw += subshell(mailbox, page);
break;
#endif

--- 130,138 ----

#ifdef ALLOW_SUBSHELL
case '!' : Writechar('!');
! subshell(mailbox, page);
! redraw += menu_need_redraw(page);
!
break;
#endif

***************
*** 167,174 ****
}
break;

! case 'a' : alias(mailbox, aview);
! (*redraw)++;
/* define_softkeys(MAIN); */
break;

--- 169,177 ----
}
break;

! case 'a' :
! alias(mailbox, aview);
! redraw++;


/* define_softkeys(MAIN); */
break;

***************

*** 190,195 ****
--- 193,200 ----
&hdr,&F,NULL,
NO_mime_parse)) {
(*nufoot) = remail(hdr,F, aview, page);
+
+ redraw += menu_need_redraw(page);
} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************
*** 213,222 ****
else if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,NO_mime_parse)) {

! if (hdr->pgp & PGP_PUBLIC_KEY)
/* FIX: mime structure is not currently used */
! *redraw = pgp_extract_public_key(hdr,F);
! else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoPgpPublicKeys,
"This message does not contain PGP public keys!"));
--- 218,228 ----
else if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,NO_mime_parse)) {

! if (hdr->pgp & PGP_PUBLIC_KEY) {
/* FIX: mime structure is not currently used */
! pgp_extract_public_key(hdr,F,page);
! redraw += menu_need_redraw(page);
! } else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoPgpPublicKeys,
"This message does not contain PGP public keys!"));
***************
*** 254,262 ****


"No mail to forward!"));

else {
!

! if (forward(current-1,mailbox, aview, page))

! (*redraw)++;
else {
(*nufoot)++;
show_msg_status(current-1,&MENU, *header_page);
--- 260,269 ----


"No mail to forward!"));

else {
! forward(current-1,mailbox, aview, page);
!
! if (menu_need_redraw(page))
! redraw++;
else {
(*nufoot)++;
show_msg_status(current-1,&MENU, *header_page);
***************
*** 293,305 ****
} else {
/* define_softkeys(YESNO); */

! (*redraw) += reply_to_everyone(current-1,
! mailbox,
! aview,
! page);
/* define_softkeys(MAIN); */

! if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
}
} else {
--- 300,311 ----
} else {
/* define_softkeys(YESNO); */

! reply_to_everyone(current-1, mailbox,
! aview,page);
! redraw += menu_need_redraw(page);
/* define_softkeys(MAIN); */

! if (!redraw)
show_msg_status(current-1,&MENU, *header_page);
}
} else {
***************
*** 376,382 ****
current = get_current(mailbox);

elm_filter = j;
! (*redraw)++;
(void)get_page(current, &MENU, header_page);
}
}
--- 382,388 ----
current = get_current(mailbox);

elm_filter = j;
! redraw++;
(void)get_page(current, &MENU, header_page);
}
}
***************
*** 389,395 ****
"Mail PGP public key"));
FlushBuffer();

! *redraw = pgp_mail_public_key(mailbox, aview, page);
break;
#endif

--- 395,403 ----
"Mail PGP public key"));
FlushBuffer();

! pgp_mail_public_key(mailbox, aview, page);
! redraw += menu_need_redraw(page);
!
break;
#endif

***************
*** 397,405 ****
ElmMail,
"Mail"));
FlushBuffer();
! (*redraw) += send_msg_l(-1, NULL, NULL, NULL,
MAIL_EDIT_MSG,allow_forms,
mailbox, aview,page);
break;

case ' ' :
--- 405,416 ----
ElmMail,
"Mail"));
FlushBuffer();
! send_msg_l(-1, NULL, NULL, NULL,
MAIL_EDIT_MSG,allow_forms,
mailbox, aview,page);
+
+ redraw += menu_need_redraw(page);
+
break;

case ' ' :
***************
*** 459,465 ****

current = get_current(mailbox);

! (*redraw)++;
(void)get_page(current, &MENU, header_page);
}
}
--- 470,476 ----

current = get_current(mailbox);

! redraw++;
(void)get_page(current, &MENU, header_page);
}
}
***************
*** 521,527 ****

current = get_current(mailbox);

! (*redraw)++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);
--- 532,538 ----

current = get_current(mailbox);

! redraw++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);
***************
*** 594,600 ****

current = get_current(mailbox);

! (*redraw)++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);
--- 605,611 ----

current = get_current(mailbox);

! redraw++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);
***************
*** 637,644 ****
} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! if (print_text(TRUE, mailbox, *header_page, page) != 0)
! (*redraw)++;
else
show_msg_status(current-1,&MENU, *header_page);
} else {
--- 648,656 ----
} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! print_text(TRUE, mailbox, *header_page, page);
! if (menu_need_redraw(page))
! redraw++;
else
show_msg_status(current-1,&MENU, *header_page);
} else {
***************
*** 664,672 ****


"No mail to reply to!"));

else {

! (*redraw) += reply(current-1,mailbox, aview, page);

! if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
}
/* softkeys_on(); */
--- 676,685 ----


"No mail to reply to!"));

else {

! reply(current-1,mailbox, aview, page);
! redraw += menu_need_redraw(page);

! if (!redraw)
show_msg_status(current-1,&MENU, *header_page);
}
/* softkeys_on(); */
***************
*** 702,708 ****
} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

! if (save(redraw, FALSE, (ch != 'C'), 0,mailbox, aview,
*header_page, page)
&& resolve_mode && ch != 'C') {
int i;
--- 715,721 ----
} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

! if (save(FALSE, (ch != 'C'), 0,mailbox, aview,
*header_page, page)
&& resolve_mode && ch != 'C') {
int i;
***************
*** 717,722 ****
--- 730,737 ----

}
}
+
+ redraw += menu_need_redraw(page);
} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************
*** 741,750 ****
} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! save(redraw, FALSE, 0, 1, mailbox, aview, *header_page,
page);

! if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
} else {
DPRINT(Debug,3,(&Debug,
--- 756,767 ----
} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! save(FALSE, 0, 1, mailbox, aview, *header_page,
page);

! redraw += menu_need_redraw(page);
!
! if (!redraw)
show_msg_status(current-1,&MENU, *header_page);
} else {
DPRINT(Debug,3,(&Debug,
***************
*** 794,800 ****
hdr,
aview
);
! (*redraw)++;
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMIMEMessage,
--- 811,817 ----
hdr,
aview
);
! redraw++;
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMIMEMessage,
***************
*** 828,834 ****

current = get_current(mailbox);
(void)get_page(current, &MENU, header_page);
! (*redraw)++;

} else {
DPRINT(Debug,3,(&Debug,
--- 845,851 ----

current = get_current(mailbox);
(void)get_page(current, &MENU, header_page);
! redraw++;

} else {
DPRINT(Debug,3,(&Debug,
***************
*** 843,849 ****

case '@' :
debug_screen(mailbox, *header_page);
! (*redraw)++;
break;

case '#' : {
--- 860,866 ----

case '@' :
debug_screen(mailbox, *header_page);
! redraw++;
break;

case '#' : {
***************
*** 867,873 ****
&index);

debug_message(hdr, current, &index);
! (*redraw)++;
}
}
}
--- 884,890 ----
&index);

debug_message(hdr, current, &index);
! redraw++;
}
}
}
***************
*** 876,899 ****
default:
/* Maybe motion command */

! ch = motion(ch,&MENU,redraw,nufoot, header_page,
page);

return ch;

}
return 0; /* Command OK */
}

! void new_mail_check (mailbox, redraw, header_page, page)
struct MailboxView *mailbox;
- int *redraw;
int *header_page;
struct menu_context *page;
{
int idx, mbxcount;
struct menu_common MENU;


int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

--- 893,924 ----
default:
/* Maybe motion command */

! ch = motion(ch,&MENU,nufoot, header_page,
page);

+ /* motion() may already set, menu_trigger_redraw(page),
+ we do not examine it */
+ if (redraw)
+ menu_trigger_redraw(page);
+
return ch;

}
+
+ if (redraw)
+ menu_trigger_redraw(page);
return 0; /* Command OK */
}

! void new_mail_check (mailbox, header_page, page)
struct MailboxView *mailbox;
int *header_page;
struct menu_context *page;
{
int idx, mbxcount;
struct menu_common MENU;
int LINES, COLUMNS;
+ int redraw = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 943,949 ****

if (on_page(current, &MENU, *header_page) ||
was_on_page || !ok) /* do we REALLY have to rewrite? */
! (*redraw)++;

ClearLine(LINES-2); /* remove reading message... */

--- 968,974 ----

if (on_page(current, &MENU, *header_page) ||
was_on_page || !ok) /* do we REALLY have to rewrite? */
! redraw++;

ClearLine(LINES-2); /* remove reading message... */

***************
*** 971,976 ****
--- 996,1004 ----
}
}

+ if (redraw)
+ menu_trigger_redraw(page);
+
}


***************
*** 990,997 ****
int header_page = 0; /* current header page */



struct menu_context *page = NULL;

-
set_panic_prepare(elm_panic_prepare);
set_panic_exit(elm_panic_exit);

--- 1018,1026 ----
int header_page = 0; /* current header page */



struct menu_context *page = NULL;

+ struct MailboxView * cur_mailbox = NULL;
+ struct AliasView * cur_aliaslist = NULL;

set_panic_prepare(elm_panic_prepare);
set_panic_exit(elm_panic_exit);

***************
*** 1017,1023 ****
locale_init();

req_mfile_vector = parse_arguments(argc, argv, &to_whom);
! initialize(req_mfile_vector, &current_mailbox, &current_aliaslist,
&header_page, &page);
if (req_mfile_vector) {
int i;
--- 1046,1052 ----
locale_init();

req_mfile_vector = parse_arguments(argc, argv, &to_whom);
! initialize(req_mfile_vector, &cur_mailbox, &cur_aliaslist,
&header_page, &page);
if (req_mfile_vector) {
int i;
***************
*** 1044,1059 ****
version_buff);
}
send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
! (batch_only ? NO : allow_forms), current_mailbox,
! current_aliaslist, page);

! leave(0, &current_mailbox, &current_aliaslist);
} else if (check_only) {
! do_check_only(to_whom, current_aliaslist);
! leave(0, &current_mailbox, &current_aliaslist);
}

! showscreen(current_mailbox,
show_menu, &header_page, page);

while (1) {
--- 1073,1088 ----
version_buff);
}
send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
! (batch_only ? NO : allow_forms), cur_mailbox,
! cur_aliaslist, page);

! leave(0);
} else if (check_only) {
! do_check_only(to_whom, cur_aliaslist);
! leave(0);
}

! showscreen(cur_mailbox,
show_menu, &header_page, page);

while (1) {
***************
*** 1063,1069 ****

menu_get_sizes(page,&LINES, &COLUMNS);

! set_mcommon_from_mbxview(&MENU,current_mailbox);

if (menu_resized(page)) {

--- 1092,1098 ----

menu_get_sizes(page,&LINES, &COLUMNS);

! set_mcommon_from_mbxview(&MENU,cur_mailbox);

if (menu_resized(page)) {

***************
*** 1079,1085 ****
redraw++;
}
else
! redraw = menu_need_redraw(page);

nufoot = 0;
nucurr = 0;
--- 1108,1114 ----
redraw++;
}
else
! redraw += menu_need_redraw(page);

nufoot = 0;
nucurr = 0;
***************
*** 1089,1107 ****
sigchld_handler();
#endif

! new_mail_check(current_mailbox,&redraw, &header_page,
page);

/* ??? FIX Is this correct ?? */
! if (update_view(current_mailbox)) {
! resort_mailbox(current_mailbox,1,&header_page);

redraw++;
}

if (redraw) {
redraw = 0;
! showscreen(current_mailbox,
show_menu, &header_page, page);
show_last_error();
}
--- 1118,1141 ----
sigchld_handler();
#endif

! new_mail_check(cur_mailbox,&header_page,
page);
+ redraw += menu_need_redraw(page);
+

/* ??? FIX Is this correct ?? */
! if (update_view(cur_mailbox)) {
! resort_mailbox(cur_mailbox,1,&header_page);

redraw++;
}

if (redraw) {
+ DPRINT(Debug,7, (&Debug,
+ "main: pending redraw\n"));
+
redraw = 0;
! showscreen(cur_mailbox,
show_menu, &header_page, page);
show_last_error();
}
***************
*** 1123,1129 ****


if (auto_assemble && 2 == fragment_handling &&
! have_partial(current_mailbox)) {
ch = 'A';
auto_assemble = 0;

--- 1157,1163 ----


if (auto_assemble && 2 == fragment_handling &&
! have_partial(cur_mailbox)) {
ch = 'A';
auto_assemble = 0;

***************
*** 1148,1165 ****
MoveCursor(lin,col);
}

! ch = mailbox_command(current_mailbox,ch, &redraw, &nufoot,
showmsg_main_cmd,
! current_aliaslist,
&header_page,page);

switch (ch) {
case 0: /* OK */
break;

case HELP_MARK:
case '?' :
! if (help(FALSE, page))
redraw++;
else
nufoot++;
--- 1182,1203 ----
MoveCursor(lin,col);
}

! ch = mailbox_command(cur_mailbox,ch, &nufoot,
showmsg_main_cmd,
! cur_aliaslist,
&header_page,page);

+ redraw += menu_need_redraw(page);
+
switch (ch) {
case 0: /* OK */
break;

case HELP_MARK:
case '?' :
! help(FALSE, page);
!
! if (menu_need_redraw(page))
redraw++;
else
nufoot++;
***************
*** 1171,1188 ****
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmResyncFolder,
"Resynchronize folder"));
! redraw += resync(& current_mailbox, &header_page, page);

/* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,current_mailbox);

! current = get_current(current_mailbox);
nucurr = get_page(current, &MENU, &header_page);
}
break;

case '|' : {
! int current = get_current(current_mailbox);

Writechar('|');

--- 1209,1229 ----
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmResyncFolder,
"Resynchronize folder"));
! FlushBuffer();
!
! resync(& cur_mailbox, &header_page, page);
! redraw += menu_need_redraw(page);

/* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,cur_mailbox);

! current = get_current(cur_mailbox);
nucurr = get_page(current, &MENU, &header_page);
}
break;

case '|' : {
! int current = get_current(cur_mailbox);

Writechar('|');

***************
*** 1191,1202 ****
ElmNoMailToPipe,
"No mail to pipe!"));

! } else if (give_message_data(current_mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

/* softkeys_off(); */

! redraw += do_pipe(current_mailbox, page);
/* softkeys_on(); */
} else {
DPRINT(Debug,3,(&Debug,
--- 1232,1245 ----
ElmNoMailToPipe,
"No mail to pipe!"));

! } else if (give_message_data(cur_mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

/* softkeys_off(); */

! do_pipe(cur_mailbox, page);
! redraw += menu_need_redraw(page);
!
/* softkeys_on(); */
} else {
DPRINT(Debug,3,(&Debug,
***************
*** 1206,1212 ****
break;

case 'A': {
! int current = get_current(current_mailbox);

Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmAssemble,
--- 1249,1255 ----
break;

case 'A': {
! int current = get_current(cur_mailbox);

Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmAssemble,
***************
*** 1214,1222 ****
FlushBuffer();
sleep_message();

! ViewPartial(current_mailbox, current_aliaslist);

! current = get_current(current_mailbox);
(void)get_page(current, &MENU, &header_page);
redraw++;

--- 1257,1265 ----
FlushBuffer();
sleep_message();

! ViewPartial(cur_mailbox, cur_aliaslist);

! current = get_current(cur_mailbox);
(void)get_page(current, &MENU, &header_page);
redraw++;

***************
*** 1227,1244 ****
ElmSet, ElmChangeFolder,
"Change folder"));
/* define_softkeys(CHANGE); */
! redraw += change_file(& current_mailbox, current_aliaslist,
&header_page, page);
!
/* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,current_mailbox);

/* define_softkeys(MAIN); */
break;

#ifdef ALLOW_MAILBOX_EDITING
case 'e' : {
! int current = get_current(current_mailbox);

Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmEditFolder,
--- 1270,1289 ----
ElmSet, ElmChangeFolder,
"Change folder"));
/* define_softkeys(CHANGE); */
! change_file(& cur_mailbox, cur_aliaslist,
&header_page, page);
! redraw += menu_need_redraw(page);
!
!
/* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,cur_mailbox);

/* define_softkeys(MAIN); */
break;

#ifdef ALLOW_MAILBOX_EDITING
case 'e' : {
! int current = get_current(cur_mailbox);

Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmEditFolder,
***************
*** 1257,1263 ****
ElmFolderIsEmpty,
"Folder is empty!"));
else
! edit_mailbox(current_mailbox, &header_page,
page);

}
--- 1302,1308 ----
ElmFolderIsEmpty,
"Folder is empty!"));
else
! edit_mailbox(&cur_mailbox, &header_page,
page);

}
***************
*** 1271,1292 ****
#endif

case 'o' : {
! int current = get_current(current_mailbox);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmOptions,
"Options"));
! if((i=options(current_mailbox, current_aliaslist)) > 0) {
! current = get_current(current_mailbox);
get_page(current, &MENU, &header_page);
} else if(i < 0)
! leave(0, &current_mailbox, &current_aliaslist);
redraw++; /* always fix da screen... */
}
break;

case 'p' : {
! int current = get_current(current_mailbox);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmPrintMail,
--- 1316,1337 ----
#endif

case 'o' : {
! int current = get_current(cur_mailbox);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmOptions,
"Options"));
! if((i=options(cur_mailbox, cur_aliaslist)) > 0) {
! current = get_current(cur_mailbox);
get_page(current, &MENU, &header_page);
} else if(i < 0)
! leave(0);
redraw++; /* always fix da screen... */
}
break;

case 'p' : {
! int current = get_current(cur_mailbox);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmPrintMail,
***************
*** 1301,1314 ****
ElmNoMailToPrint,
"No mail to print!"));

! } else if (give_message_data(current_mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

/* FIX: mime structure is not currenty
used
*/
! if (print_msg(TRUE,current_mailbox, page) != 0)
! redraw++;
} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
--- 1346,1361 ----
ElmNoMailToPrint,
"No mail to print!"));

! } else if (give_message_data(cur_mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

/* FIX: mime structure is not currenty
used
*/
! print_msg(TRUE,cur_mailbox, page);
!
! redraw += menu_need_redraw(page);
!
} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************
*** 1326,1338 ****
"Quit"));
FlushBuffer();

! mbxcount = get_storage_count(current_mailbox);

for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;

struct current_storage * storage =
! get_storage(current_mailbox,idx);

if (!storage->current_folder)
continue;
--- 1373,1385 ----
"Quit"));
FlushBuffer();

! mbxcount = get_storage_count(cur_mailbox);

for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;

struct current_storage * storage =
! get_storage(cur_mailbox,idx);

if (!storage->current_folder)
continue;
***************
*** 1347,1353 ****
}

if (!found)
! quit(TRUE, &current_mailbox,&current_aliaslist,
&header_page, page);
}
break;
--- 1394,1400 ----
}

if (!found)
! quit(TRUE, &cur_mailbox,&cur_aliaslist,
&header_page, page);
}
break;
***************
*** 1360,1372 ****
"Quick quit"));
FlushBuffer();

! mbxcount = get_storage_count(current_mailbox);

for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;

struct current_storage * storage =
! get_storage(current_mailbox,idx);

if (!storage->current_folder)
continue;
--- 1407,1419 ----
"Quick quit"));
FlushBuffer();

! mbxcount = get_storage_count(cur_mailbox);

for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;

struct current_storage * storage =
! get_storage(cur_mailbox,idx);

if (!storage->current_folder)
continue;
***************
*** 1380,1386 ****
}

if (!found)
! quit(FALSE, &current_mailbox,&current_aliaslist,
&header_page, page);
}
break;
--- 1427,1433 ----
}

if (!found)
! quit(FALSE, &cur_mailbox,&cur_aliaslist,
&header_page, page);
}
break;
***************
*** 1393,1399 ****
ElmQuickExit,
"Quick Exit"));
FlushBuffer();
! leave(0, &current_mailbox, &current_aliaslist);
break;

case ctrl('Q') :
--- 1440,1446 ----
ElmQuickExit,
"Quick Exit"));
FlushBuffer();
! leave(0);
break;

case ctrl('Q') :
***************
*** 1402,1414 ****
"Exit"));
FlushBuffer();

! exit_prog(&current_mailbox,&current_aliaslist,
&page);
break;

! case EOF : leave(0, &current_mailbox, &current_aliaslist);
! /* Read failed, control tty died? */
! break;


default:
--- 1449,1462 ----
"Exit"));
FlushBuffer();

! exit_prog(&cur_mailbox,&cur_aliaslist,
&page);
break;

! case EOF :
! leave(0);
! /* Read failed, control tty died? */
! break;


default:
***************
*** 1418,1424 ****
}

if (redraw)
! showscreen(current_mailbox,
show_menu, &header_page, page);

check_range(&MENU);
--- 1466,1472 ----
}

if (redraw)
! showscreen(cur_mailbox,
show_menu, &header_page, page);

check_range(&MENU);
***************
*** 1767,1776 ****
static char *no_aliases = NULL;

/* Return key if unknown */
! int motion(ch,mc, redraw, nufoot, header_page, page)
int ch;
! struct menu_common *mc;
! int *redraw;
int *nufoot;
int *header_page;
struct menu_context *page;
--- 1815,1823 ----
static char *no_aliases = NULL;

/* Return key if unknown */
! int motion(ch,mc, nufoot, header_page, page)
int ch;
! struct menu_common *mc;
int *nufoot;
int *header_page;
struct menu_context *page;
***************
*** 1779,1784 ****
--- 1826,1832 ----
* commands to a function. */

int i;
+ int redraw = 0;

int current = mcommon_get_current(mc);

***************
*** 1794,1802 ****

}
else {
! int x = pattern_match(mc, redraw, *header_page,
page);

if (EOF == x) {
return EOF; /* ERROR */

--- 1842,1853 ----

}
else {
! int x = pattern_match(mc, *header_page,
page);

+ redraw += menu_need_redraw(page);
+
+
if (EOF == x) {
return EOF; /* ERROR */

***************
*** 2044,2053 ****
"Limit displayed %S by..."),
mcommon_give_item(mc,m_items));
clear_error();
! if (limit(mc, page) != 0) {
current = mcommon_get_current(mc);
get_page(current, mc, header_page);
! (*redraw)++;
} else {
(*nufoot)++;
}
--- 2095,2105 ----
"Limit displayed %S by..."),
mcommon_give_item(mc,m_items));
clear_error();
! limit(mc, page);
! if (menu_need_redraw(page)) {
current = mcommon_get_current(mc);
get_page(current, mc, header_page);
! redraw++;
} else {
(*nufoot)++;
}
***************
*** 2117,2123 ****
page);
break;

! case ctrl('L') : (*redraw)++; break;

case NO_OP_COMMAND : break; /* noop for timeout loop */

--- 2169,2175 ----
page);
break;

! case ctrl('L') : redraw++; break;

case NO_OP_COMMAND : break; /* noop for timeout loop */

***************
*** 2131,2137 ****

i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, redraw, page);

DPRINT(Debug,5,(&Debug,
" current %d => %d (?)\n",
--- 2183,2189 ----

i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, page);

DPRINT(Debug,5,(&Debug,
" current %d => %d (?)\n",
***************
*** 2156,2166 ****
--- 2208,2222 ----
}
}
else {
+ if (redraw)
+ menu_trigger_redraw(page);
return ch; /* UNKNOWN command */

}
}

+ if (redraw)
+ menu_trigger_redraw(page);
return 0; /* COmmand OK */
}

Index: elm2.4.ME+.119-cvs/src/exitprog.c
*** elm2.4.ME+.118/src/exitprog.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/exitprog.c 2004-07-24 22:50:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: exitprog.c,v 1.14 2004/07/18 20:55:15 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: exitprog.c,v 1.15 2004/07/24 19:50:45 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 90,96 ****
FlushBuffer();

erase_menu_context(page);
! leave(0, mailbox, aview);
return 0;
}

--- 90,96 ----
FlushBuffer();

erase_menu_context(page);
! leave(0);
return 0;
}

Index: elm2.4.ME+.119-cvs/src/file.c
*** elm2.4.ME+.118/src/file.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/file.c 2004-07-26 15:41:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file.c,v 1.37 2004/07/11 17:44:51 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file.c,v 1.38 2004/07/26 12:41:46 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 47,55 ****

struct string * prev_fold = NULL; /* name of previous folder */

! int save(redraw, silently, delete, text_only, mailbox, aview, header_page,
page)
! int *redraw, silently, delete, text_only;


struct MailboxView *mailbox;
struct AliasView *aview;

int header_page;
--- 47,55 ----

struct string * prev_fold = NULL; /* name of previous folder */

! int save(silently, delete, text_only, mailbox, aview, header_page,
page)
! int silently, delete, text_only;


struct MailboxView *mailbox;
struct AliasView *aview;

int header_page;
***************
*** 58,70 ****
/** Save all tagged messages + current in a folder. If no messages
are tagged, save the current message instead! This routine
will return ZERO if the operation failed.
! 'redraw' is set to TRUE iff we use the '?' and mess up
! the screen. Pretty reasonable, eh? If "silently" is set,
then don't output the "D" character upon marking for
deletion...
If delete is set, then delete the saved messages, else
we are just copying the messages without deletion.


If text_only is text, message is decoded.
**/

int tagged = 0, i, oldstat = 0, appending = 0,

--- 58,73 ----
/** Save all tagged messages + current in a folder. If no messages
are tagged, save the current message instead! This routine
will return ZERO if the operation failed.
!
! Pretty reasonable, eh? If "silently" is set,
then don't output the "D" character upon marking for
deletion...
If delete is set, then delete the saved messages, else
we are just copying the messages without deletion.
If text_only is text, message is decoded.
+
+ If redraw is needed use
+ menu_trigger_redraw(page)
**/



int tagged = 0, i, oldstat = 0, appending = 0,

***************
*** 73,78 ****
--- 76,82 ----
char
answer;

+ int redraw = 0;
struct folder_browser * XXX;


struct string * buffer = NULL;

WRITE_STATE write_ptr = NULL;
***************
*** 87,94 ****



if (chdr)
oldstat = chdr->status; /* remember */

! *redraw = FALSE;
!

mc = get_message_count(mailbox);
for (i=0; i < mc; i++) {

struct header_rec * hdr = give_header(mailbox,i);
--- 91,97 ----



if (chdr)
oldstat = chdr->status; /* remember */

!

mc = get_message_count(mailbox);
for (i=0; i < mc; i++) {

struct header_rec * hdr = give_header(mailbox,i);
***************
*** 141,147 ****


if (text_only > 0) {
if (tagged == 1)

r = gen_browser(page,
! XXX,&buffer,redraw,


delete ? word_save : word_copy,
prev_fold,

aview,
--- 144,150 ----


if (text_only > 0) {
if (tagged == 1)

r = gen_browser(page,
! XXX,&buffer,&redraw,


delete ? word_save : word_copy,
prev_fold,

aview,
***************
*** 150,156 ****


(delete ? cap_save_word : cap_copy_word));
else

r = gen_browser(page,
! XXX,&buffer,redraw,


delete ? word_save : word_copy,
prev_fold,

aview,
--- 153,159 ----


(delete ? cap_save_word : cap_copy_word));
else

r = gen_browser(page,
! XXX,&buffer,&redraw,


delete ? word_save : word_copy,
prev_fold,

aview,
***************
*** 160,166 ****


} else {
if (tagged == 1)

r = gen_browser(page,
! XXX,&buffer,redraw,


delete ? word_save : word_copy,
prev_fold,

aview,
--- 163,169 ----


} else {
if (tagged == 1)

r = gen_browser(page,
! XXX,&buffer,&redraw,


delete ? word_save : word_copy,
prev_fold,

aview,
***************
*** 169,175 ****


(delete ? cap_save_word : cap_copy_word));
else

r = gen_browser(page,
! XXX,&buffer,redraw,


delete ? word_save : word_copy,
prev_fold,

aview,
--- 172,178 ----


(delete ? cap_save_word : cap_copy_word));
else

r = gen_browser(page,
! XXX,&buffer,&redraw,


delete ? word_save : word_copy,
prev_fold,

aview,
***************
*** 315,321 ****
* so whatever silently was, now it's true - we can't show those
* delete markings.
*/
! if(*redraw) silently = TRUE;



mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */

--- 318,325 ----
* so whatever silently was, now it's true - we can't show those
* delete markings.
*/
! if(redraw)
! silently = TRUE;



mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */

***************
*** 325,334 ****



if (!save_message(i, XXX, buffer, write_ptr,

(tagged > 1), appending++,
! silently, delete, text_only, redraw,
mailbox, aview, header_page))
fail++;
! if(*redraw) silently = TRUE;
scount++;

}
--- 329,339 ----



if (!save_message(i, XXX, buffer, write_ptr,

(tagged > 1), appending++,
! silently, delete, text_only, &redraw,
mailbox, aview, header_page))
fail++;
! if(redraw)
! silently = TRUE;
scount++;

}
***************
*** 377,384 ****
free_string(&buffer);

DPRINT(Debug,8,(&Debug,
! "save=%d *redraw=%d\n",
! retval,*redraw));
return retval;
}

--- 382,393 ----
free_string(&buffer);

DPRINT(Debug,8,(&Debug,
! "save=%d redraw=%d\n",
! retval,redraw));
!
! if (redraw)
! menu_trigger_redraw(page);
!
return retval;
}

Index: elm2.4.ME+.119-cvs/src/file_util.c
*** elm2.4.ME+.118/src/file_util.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.119-cvs/src/file_util.c 2004-07-24 22:50:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.24 2004/03/27 18:31:45 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.25 2004/07/24 19:50:45 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 94,100 ****
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWriteFailedAppend,
"\nWrite failed to temp file in append\n"));
perror(filename);
! rm_temps_exit(&current_mailbox,&current_aliaslist); /* ??? global reference */
}

while (0 < (len =
--- 94,100 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWriteFailedAppend,
"\nWrite failed to temp file in append\n"));
perror(filename);
! rm_temps_exit();
}

while (0 < (len =
***************
*** 105,111 ****
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWriteFailedAppend,
"\nWrite failed to temp file in append\n"));
perror(filename);
! rm_temps_exit(&current_mailbox,&current_aliaslist); /* ??? global reference */
}

if (fclose(my_fd) == EOF) {
--- 105,111 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWriteFailedAppend,
"\nWrite failed to temp file in append\n"));
perror(filename);
! rm_temps_exit();
}

if (fclose(my_fd) == EOF) {
***************
*** 114,120 ****
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCloseFailedAppend,
"\nClose failed on temp file in append\n"));
perror(filename);
! rm_temps_exit(&current_mailbox,&current_aliaslist); /* ??? global reference */
}

return(0);
--- 114,120 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCloseFailedAppend,
"\nClose failed on temp file in append\n"));
perror(filename);
! rm_temps_exit(); /* ??? global reference */
}

return(0);
Index: elm2.4.ME+.119-cvs/src/forms.c
*** elm2.4.ME+.118/src/forms.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/forms.c 2004-07-26 15:41:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forms.c,v 1.24 2004/06/18 20:40:56 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forms.c,v 1.25 2004/07/26 12:41:46 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 347,353 ****



mail_form(mail_index,address, subject,
mailbox /* for save_copy */,

! aview);

erase_menu_context(&page);

--- 347,353 ----



mail_form(mail_index,address, subject,
mailbox /* for save_copy */,

! aview, page);

erase_menu_context(&page);

Index: elm2.4.ME+.119-cvs/src/hdrconfg.c
*** elm2.4.ME+.118/src/hdrconfg.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/hdrconfg.c 2004-07-26 15:41:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.43 2004/07/14 07:54:05 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.44 2004/07/26 12:41:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 895,901 ****

#ifdef ALLOW_SUBSHELL
case '!':
! if (subshell(NULL, page))
do_redraw = TRUE;
break;
#endif
--- 895,903 ----

#ifdef ALLOW_SUBSHELL
case '!':
!
! subshell(NULL, page);
! if (menu_need_redraw(page))
do_redraw = TRUE;
break;
#endif
Index: elm2.4.ME+.119-cvs/src/help.c
*** elm2.4.ME+.118/src/help.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/help.c 2004-07-26 15:41:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.20 2004/07/14 12:07:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.22 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 24,37 ****

static int display_file P_((char *file));

!
! int help(pager_help,page)
int pager_help;
struct menu_context *page;
{
/** Process the request for help [section] from the user.
If pager_help is TRUE, then act a little differently from
if pager_help is FALSE (index screen)
**/

int ch; /* character buffer for input */
--- 24,38 ----

static int display_file P_((char *file));

! void help(pager_help,page)
int pager_help;
struct menu_context *page;
{
/** Process the request for help [section] from the user.
If pager_help is TRUE, then act a little differently from
if pager_help is FALSE (index screen)
+
+ If redraw is needed use menu_trigger_redraw()
**/

int ch; /* character buffer for input */
***************
*** 79,95 ****
ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR
|READCH_sig_char);

! if (ch == REDRAW_MARK) return 1;
! if (ch == '.') return(0); /* zero means footer rewrite only */
! if (ch == TERMCH_interrupt_char) return 0;

s = unknown_command;

switch (ch) {

case HELP_MARK:
! case '?': display_helpfile(pager_help? PAGER_HELP : MAIN_HELP);
! return(1);

case '$': if(!pager_help) s = catgets(elm_msg_cat, ElmSet, ElmHelpDollar,
"$ = Force resynchronization of the current folder. This will purge deleted mail.");
--- 80,104 ----
ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR
|READCH_sig_char);

! if (ch == REDRAW_MARK) {
! menu_trigger_redraw(page);
! return;
! }
! if (ch == '.')
! return;


!
! if (ch == TERMCH_interrupt_char)

! return;

s = unknown_command;

switch (ch) {

case HELP_MARK:
! case '?':
! display_helpfile(pager_help? PAGER_HELP : MAIN_HELP);
! menu_trigger_redraw(page);
! return;

case '$': if(!pager_help) s = catgets(elm_msg_cat, ElmSet, ElmHelpDollar,
"$ = Force resynchronization of the current folder. This will purge deleted mail.");
***************
*** 354,361 ****
"Exit the mail system quickly.");
break;

! case EOF: leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
! break;

default : if (isdigit(ch) && !pager_help)
s = catgets(elm_msg_cat, ElmSet, ElmHelpMakeMessageCurrent,
--- 363,370 ----
"Exit the mail system quickly.");
break;

! case EOF: leave(0); /* ???? global reference */
! break;

default : if (isdigit(ch) && !pager_help)
s = catgets(elm_msg_cat, ElmSet, ElmHelpMakeMessageCurrent,
***************
*** 367,375 ****

} while (ch != '.');

! /** we'll never actually get here, but that's okay... **/
!
! return(0);
}

int display_helpfile(section)
--- 376,382 ----

} while (ch != '.');

! return;
}

int display_helpfile(section)
Index: elm2.4.ME+.119-cvs/src/in_utils.c
*** elm2.4.ME+.118/src/in_utils.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/in_utils.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.39 2004/07/11 17:44:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.41 2004/07/26 12:41:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 225,231 ****


if (ch == REDRAW_MARK)
goto redraw;
if (ch == EOF) {

! leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
}

ch = tolower(ch);

--- 225,231 ----


if (ch == REDRAW_MARK)
goto redraw;
if (ch == EOF) {

! leave(0);
}
ch = tolower(ch);

***************
*** 234,240 ****


if (ch == REDRAW_MARK)
goto redraw;
if (ch == EOF) {

! leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
}
#ifdef ASCII_CTYPE
if (isascii(ch))
--- 234,240 ----


if (ch == REDRAW_MARK)
goto redraw;
if (ch == EOF) {

! leave(0); /* ???? global reference */
}
#ifdef ASCII_CTYPE
if (isascii(ch))
***************
*** 267,282 ****
return(ch);
}

! int read_number(ch, item, current, redraw, page)
int ch;
CONST struct string *item;
int current;
- int *redraw;
struct menu_context *page;
{
! /** Read a number, where 'ch' is the leading digit! **/

struct string * buff = new_string(display_charset);
int num, status;
int bad;
int LINES, COLUMNS;
--- 267,287 ----
return(ch);
}

! int read_number(ch, item, current, page)
int ch;
CONST struct string *item;
int current;
struct menu_context *page;
{
! /** Read a number, where 'ch' is the leading digit! **/

+ /* If redraw is used use
+ menu_trigger_redraw(page)
+ */
+
struct string * buff = new_string(display_charset);
+
+ int need_redraw = 0;
int num, status;
int bad;
int LINES, COLUMNS;
***************
*** 296,313 ****


if (status == -1) /* Ctrl-C */
return(current);
if (status == REDRAW_MARK) {

! *redraw = 1;
goto redraw;
}

if (0 == string_len(buff))
return current;

num = string_to_long(buff,&bad);

if (bad >= 0)
return current;

return(num);
}

--- 301,327 ----


if (status == -1) /* Ctrl-C */
return(current);
if (status == REDRAW_MARK) {

! /* Can not set menu_trigger_redraw here or causes
! redraw loop ... */
! need_redraw = 1;
goto redraw;
}

+ if (need_redraw)
+ menu_trigger_redraw(page);
+
if (0 == string_len(buff))
return current;

num = string_to_long(buff,&bad);

+
+
if (bad >= 0)
return current;

+
+
return(num);
}

Index: elm2.4.ME+.119-cvs/src/leavembox.c
*** elm2.4.ME+.118/src/leavembox.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/leavembox.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.48 2004/07/11 17:44:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.49 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 649,655 ****
if (marked_deleted == 1)
answer = prompt_letter(LINES-4,"",def,


PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet,

ElmLeaveDeleteMessage,
--- 649,655 ----
if (marked_deleted == 1)
answer = prompt_letter(LINES-4,"",def,


PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet,

ElmLeaveDeleteMessage,
***************
*** 658,664 ****
else
answer = prompt_letter(LINES-4,"",def,


PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet,

ElmLeaveDeleteMessages,
--- 658,664 ----
else
answer = prompt_letter(LINES-4,"",def,


PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet,

ElmLeaveDeleteMessages,
***************
*** 679,685 ****
emergency_exit(0);
}

! if(answer == *def_ans_yes) {

sc = get_storage_count(mailbox);
for (i = 0; i < sc; i++) {
--- 679,685 ----
emergency_exit(0);
}

! if (answer == *def_ans_yes) {

sc = get_storage_count(mailbox);
for (i = 0; i < sc; i++) {
Index: elm2.4.ME+.119-cvs/src/limit.c
*** elm2.4.ME+.118/src/limit.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/limit.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: limit.c,v 1.33 2004/07/11 11:36:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: limit.c,v 1.34 2004/07/26 12:41:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 57,67 ****
}


! int limit(menu, page)
struct menu_common *menu;
struct menu_context *page;
{
! /** returns non-zero if we changed selection criteria = need redraw **/

int last_selected, all;
struct string *criteria = NULL;
--- 57,69 ----
}


! void limit(menu, page)
struct menu_common *menu;
struct menu_context *page;
{
! /** if we changed selection criteria = need redraw
! use menu_trigger_redraw(page)
! */

int last_selected, all;
struct string *criteria = NULL;
***************
*** 116,122 ****

if (criteria)
free_string(& criteria);
! return TRUE;

}

--- 118,126 ----

if (criteria)
free_string(& criteria);
!
! menu_trigger_redraw(page);
! return;

}

***************
*** 131,137 ****

mcommon_set_selected(menu,last_selected);

! return(FALSE);
}

if (string_matches_ascii(criteria,s2us("all"))) {
--- 135,141 ----

mcommon_set_selected(menu,last_selected);

! return;
}

if (string_matches_ascii(criteria,s2us("all"))) {
***************
*** 276,285 ****
current = visible_to_index(1,menu)+1;
mcommon_set_current(menu,current);
}
!
! return(TRUE);
} else {
! return(FALSE);
}
}
}
--- 280,290 ----
current = visible_to_index(1,menu)+1;
mcommon_set_current(menu,current);
}
!
! menu_trigger_redraw(page);
! return;
} else {
! return;
}
}
}
Index: elm2.4.ME+.119-cvs/src/lock.c
*** elm2.4.ME+.118/src/lock.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.119-cvs/src/lock.c 2004-07-24 22:50:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: lock.c,v 1.18 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: lock.c,v 1.19 2004/07/24 19:50:45 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 77,87 ****
}
}

- /* ?? global reference */
if (direction == INCOMING)
! leave_locked(&current_mailbox,&current_aliaslist); /* ?? global reference */
else
! emergency_exit(0);
}

return(0);
--- 77,86 ----
}
}

if (direction == INCOMING)
! leave_locked();
else
! emergency_exit(0);
}

return(0);
Index: elm2.4.ME+.119-cvs/src/mailmsg1.c
*** elm2.4.ME+.118/src/mailmsg1.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/mailmsg1.c 2004-07-30 14:24:45.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.43 2004/07/18 20:55:15 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.50 2004/07/30 11:24:45 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 156,220 ****
free_string(&addr_string);
}

! int get_to(to,mailer_info,aview, page)
struct expanded_address *to;
struct mailer_info *mailer_info;
! struct AliasView *aview;
! struct menu_context *page;
{
struct string * buffer = NULL;
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

/** prompt for the "To:" field, expanding into address if possible.
This routine returns ZERO if errored, or non-zero if okay **/




expanded_to_edit_buffer(&buffer, *to);

if (to->surface_len == 0) {

int code;


! if (user_level < 2) {

code = optionally_enter2(page,

! &buffer, LINES-3, 0,
! OE_REDRAW_MARK|


OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));

!
!

while (REDRAW_MARK == code) {
code = optionally_enter2(page,

! &buffer, LINES-3, 0,

OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));

! }
}
else {
code = optionally_enter2(page,
! &buffer, LINES-3, 0,
! OE_REDRAW_MARK|


OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));
while (code == REDRAW_MARK) {
code = optionally_enter2(page,

! &buffer, LINES-3, 0,

OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));
}
}

! if (0 != code) {



if (-1 == code) { /* Ctrl-C */

MoveCursor(LINES-3,0);
--- 156,275 ----
free_string(&addr_string);
}

! int get_to(to,mailer_info,aview, page, cancel_view, cancel_selection)
struct expanded_address *to;
struct mailer_info *mailer_info;
! struct AliasView *aview;
! struct menu_context *page;

Kari E. Hurtta

unread,
Aug 5, 2004, 12:06:49 PM8/5/04
to
Archive-name: elm2.4ME+/PL119.2

Before applying patch catenate parts 1 - 3 first.

This patch is agaist Elm 2.4ME+ PL118 (25) part 2/3
==============================================================================
! struct MailboxView *cancel_view;
! int *cancel_selection;
{
+

struct string * buffer = NULL;

int LINES, COLUMNS;
+ int redraw = 0;


+ int can_flag = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

+ if (cancel_selection)


+ *cancel_selection = -1;
+

/** prompt for the "To:" field, expanding into address if possible.
This routine returns ZERO if errored, or non-zero if okay **/


expanded_to_edit_buffer(&buffer, *to);

+

if (to->surface_len == 0) {

+ int canceled_count = 0;
+ int flag = 0;
+ int line = LINES-3;
int code;

! if (cancel_view)
! canceled_count = get_message_count(cancel_view);
!
! DPRINT(Debug,7,(&Debug,
! "canceled_count=%d\n",
! canceled_count));
!
! if (canceled_count > 1 && cancel_selection) {
! print_format_center(line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceledX,
! "%d canceled mails. Use / to select one of them."),
! canceled_count);
! line++;
! flag |= OE_ALT_SOLIDUS;
! } else if (1 == canceled_count && cancel_selection) {
! print_format_center(line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceled1,
! "1 canceled mail. Use / to select it."));
! line++;
! flag |= OE_ALT_SOLIDUS;
! }

+
+ if (user_level < 2) {
code = optionally_enter2(page,
! &buffer, line, 0,
! OE_REDRAW_MARK|flag|


OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));

!
!
while (REDRAW_MARK == code) {

+ menu_get_sizes(page,&LINES, &COLUMNS);
+
code = optionally_enter2(page,
! &buffer, line, 0,
OE_REDRAW_MARK|OE_APPEND_CURRENT|
! flag|OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));

! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! redraw = 1;


! }
}
else {
code = optionally_enter2(page,

! &buffer, line, 0,
! OE_REDRAW_MARK|flag|


OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));

+
while (code == REDRAW_MARK) {
+ menu_get_sizes(page,&LINES, &COLUMNS);
+
code = optionally_enter2(page,
! &buffer, line, 0,
OE_REDRAW_MARK|OE_APPEND_CURRENT|
! flag|OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));

+ /* NOTICE: using menu_trigger_redraw(page) on here
+ may cause redraw loop!
+ */
+ redraw = 1;
}
}

! if (OE_ALT_SOLIDUS == code) {
! can_flag = view_canceled_mails(cancel_view,
! cancel_selection,aview);
! redraw = 1;
! }
!
! if (0 != code || can_flag) {



if (-1 == code) { /* Ctrl-C */

MoveCursor(LINES-3,0);
***************
*** 225,230 ****
--- 280,293 ----

if (buffer)
free_string(&buffer);


+
+ if (redraw)
+ menu_trigger_redraw(page);

+
+ if (can_flag > 0) {
+ DPRINT(Debug,4,(&Debug, "get_to: Canceled mail selected\n"));
+ return 1; /* Canceled mail selected */
+ }
return 0;
}

***************
*** 234,239 ****
--- 297,305 ----
ClearLine(LINES-3);

free_string(&buffer);


+
+ if (redraw)
+ menu_trigger_redraw(page);
return 0;
}

update_expanded_from_edit_buffer(to,buffer,mailer_info,
***************
*** 246,255 ****
--- 312,327 ----
ClearLine(LINES-3);

free_string(&buffer);


+
+ if (redraw)
+ menu_trigger_redraw(page);
return 0;
}

free_string(&buffer);


+
+ if (redraw)
+ menu_trigger_redraw(page);

return 1; /* everything is okay... */
}

***************
*** 261,267 ****
static int get_subject P_((struct string **field,
struct menu_context *page));

! static int send_msg_middle P_((


int index,
struct expanded_address *given_to,
struct expanded_address *given_cc,

--- 333,339 ----
static int get_subject P_((struct string **field,
struct menu_context *page));

! static void send_msg_middle P_((


int index,
struct expanded_address *given_to,
struct expanded_address *given_cc,

***************
*** 273,279 ****


struct menu_context *page
));

! static int send_msg_middle(index,
given_to, given_cc, given_subject, options,

form_letter,mailer_info,
mailbox,aview, page)
--- 345,351 ----
struct menu_context *page
));

! static void send_msg_middle(index,
given_to, given_cc, given_subject, options,
form_letter,mailer_info,
mailbox,aview, page)
***************
*** 286,295 ****


struct AliasView *aview;
struct menu_context *page;
{

- int res;


enum copy_msg_mode copy_msg = cm_no_copy;
char *p;
struct mailing_headers headers;
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);
--- 358,373 ----


struct AliasView *aview;
struct menu_context *page;
{

enum copy_msg_mode copy_msg = cm_no_copy;
char *p;
struct mailing_headers headers;

+ struct MailboxView *cancel_view = NULL;
+ int cancel_selection = -1;
+
+ int forwarding = 0 != (options & MAIL_FORWARDING);


+ int replying = 0 != (options & MAIL_REPLYING);

+
+
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);
***************
*** 297,303 ****
zero_mailing_headers(&headers);

if (!mailer_info)
! return 0;

if (given_subject)
headers.subject = new_string2(display_charset,s2us(given_subject));
--- 375,381 ----
zero_mailing_headers(&headers);

if (!mailer_info)
! return;

if (given_subject)
headers.subject = new_string2(display_charset,s2us(given_subject));
***************
*** 333,340 ****
options, page);

switch (copy_msg) {
! case cm_CANCEL:
! res = 0;
goto free_it;

case cm_get_copy:
--- 411,417 ----
options, page);

switch (copy_msg) {
! case cm_CANCEL:
goto free_it;

case cm_get_copy:
***************
*** 344,357 ****
options |= MAIL_MIME_ATTCH;
options |= MAIL_COPY_MSG;
break;
! }



/* get the To: address and expand --
*/
! if (! get_to(&headers.to,mailer_info,aview, page)) {
! res = 0;

goto free_it;


}

/* expand the Cc: address */
if (&headers.cc.surface_len)

--- 421,463 ----
options |= MAIL_MIME_ATTCH;
options |= MAIL_COPY_MSG;
break;
! default:

+ if (!forwarding &&
+ !replying)
+ cancel_view = give_canceled_mail();
+ break;
+ }
+

/* get the To: address and expand --
*/

! if (! get_to(&headers.to,mailer_info,aview, page,cancel_view,
! &cancel_selection)) {
goto free_it;
}
+
+ if (cancel_selection >= 0) {
+ struct header_rec * H = give_header(cancel_view,cancel_selection);
+
+ if (H) {
+ options |= MAIL_COPY_SELECTION | MAIL_DELETE_CANCEL;
+
+ /* Copy some addresses from header struct
+ *
+ * Actually these addresses will be overwritten whan
+ * canceled mail is readed and parsed
+ */
+
+ if (!headers.subject && H->subject)
+ headers.subject = dup_string(H->subject);
+
+ expanded_address_from_items (&headers.from, H->from);
+ expanded_address_from_items (&headers.to, H->to);
+ expanded_address_from_items (&headers.cc, H->cc);
+
+ }
+ }
+


/* expand the Cc: address */
if (&headers.cc.surface_len)
***************

*** 365,390 ****
if (&headers.bcc.surface_len)
build_address_l(&headers.bcc,mailer_info,aview);

! /** if we're batchmailing, let's send it and GET OUTTA HERE! **/

! if (batch_only) {
! /** if we're batchmailing, let's send it and GET OUTTA HERE! **/


! res = mail(-1, 0, form_letter,&headers,mailer_info,
! mailbox, aview);
} else {
display_to(headers.to, page);

/* get the Subject: field */

! if (get_subject(&headers.subject, page) == 0) {
! res = 0;
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, copy_msg, mailer_info,
! aview, page) == 0) {
! res = 0;
goto free_it;
}
}
--- 471,520 ----
if (&headers.bcc.surface_len)
build_address_l(&headers.bcc,mailer_info,aview);

! DPRINT(Debug,4,(&Debug, "send_msg_middle -- options (%d): %s%s%s%s%s%s%s%s\n",
! options,
! options & MAIL_COPY_MSG ? " MAIL_COPY_MSG" : "",
! options & MAIL_EDIT_MSG ? " MAIL_EDIT_MSG" : "",
! options & MAIL_ISFORM ? " MAIL_ISFORM" : "",
! options & MAIL_REPLYING ? " MAIL_REPLYING" : "",
! options & MAIL_FORWARDING ? " MAIL_FORWARDING" : "",
! options & MAIL_MIME_ATTCH ? " MAIL_MIME_ATTCH" : "",
! options & MAIL_COPY_SELECTION ? " MAIL_COPY_SELECTION" : "",
! options & MAIL_DELETE_CANCEL ? " MAIL_DELETE_CANCEL" : ""));
!
! /** if we're batchmailing, let's send it and GET OUTTA HERE!
! **
! ** If MAIL_COPY_SELECTION is set data for headers will be readed
! ** from canceled mail, do not prompt anything
! **/
!
! dump_expanded_address(4,"send_msg_middle -- from ",headers.from);
! dump_expanded_address(4,"send_msg_middle -- to ",headers.to);
! dump_expanded_address(4,"send_msg_middle -- cc ",headers.cc);
!

! if (batch_only ||
! (options & MAIL_COPY_SELECTION)) {
!
!
! mail(index, options, form_letter,&headers,mailer_info,
! mailbox, aview, page,
! cancel_view,cancel_selection);
!
! /* mail does menu_trigger_redraw(), not need to be examine */
!
} else {
display_to(headers.to, page);

/* get the Subject: field */

! if (get_subject(&headers.subject, page) == 0) {
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, copy_msg, mailer_info,
! aview, page) == 0) {
goto free_it;
}
}
***************
*** 414,432 ****


dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

! res=mail(index,options, form_letter,&headers,
! mailer_info,
! mailbox, aview);
}

free_it:

free_mailing_headers(&headers);
!
! return res;


}

! int send_msg_l(index,
given_to, given_cc, given_subject, options, form_letter,

mailbox, aview, page
)
--- 544,570 ----


dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

! mail(index,options, form_letter,&headers,
! mailer_info,
! mailbox, aview, page,
! cancel_view,cancel_selection);
!
! /* mail does menu_trigger_redraw(), not need to be examine */
!
}

free_it:

+ if (cancel_view)
+ sync_canceled_mails(cancel_view);
+
+
free_mailing_headers(&headers);
!
! return;
}

! void send_msg_l(index,


given_to, given_cc, given_subject, options, form_letter,

mailbox, aview, page
)
***************
*** 438,449 ****


struct AliasView *aview;
struct menu_context *page;
{

! int ret;
struct expanded_address A, B;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return 0;

zero_expanded_address(&A);
zero_expanded_address(&B);
--- 576,589 ----


struct AliasView *aview;
struct menu_context *page;
{

! /* If redraw is needed use
! menu_trigger_redraw(page)
! */
struct expanded_address A, B;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return ;

zero_expanded_address(&A);
zero_expanded_address(&B);
***************
*** 451,470 ****
addr_to_expanded(&A,given_to,mailer_info,aview);
addr_to_expanded(&B,given_cc,mailer_info,aview);

! ret = send_msg_middle(index,&A,&B,
given_subject,options,form_letter,
mailer_info,

mailbox, aview, page);
free_expanded_address(&A);
free_expanded_address(&B);


free_mailer_info(&mailer_info);
!
! return ret;
}

! int send_msg_argv(argv, given_subject, options, form, mailbox, aview,
page)
char *argv[];
char *given_subject;
--- 591,614 ----
addr_to_expanded(&A,given_to,mailer_info,aview);
addr_to_expanded(&B,given_cc,mailer_info,aview);

! send_msg_middle(index,&A,&B,
given_subject,options,form_letter,
mailer_info,
mailbox, aview, page);
+
+ /* send_msg_middle does menu_trigger_redraw(page),
+ do not need examine */
+
free_expanded_address(&A);
free_expanded_address(&B);


free_mailer_info(&mailer_info);
!
! return;
}

! void send_msg_argv(argv, given_subject, options, form, mailbox, aview,
page)
char *argv[];
char *given_subject;
***************
*** 474,501 ****


struct AliasView *aview;
struct menu_context *page;
{

- int ret;
struct expanded_address A, B;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return 0;

zero_expanded_address(&A);
zero_expanded_address(&B);



argv_to_expanded(&A,argv,mailer_info,aview);

! ret = send_msg_middle(-1,&A,&B,

! given_subject,options,form,mailer_info,


! mailbox, aview, page);

free_expanded_address(&A);
free_expanded_address(&B);

free_mailer_info(&mailer_info);

! return ret;
}

static int get_subject(subject_field, page)
--- 618,648 ----


struct AliasView *aview;
struct menu_context *page;
{

struct expanded_address A, B;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return;

zero_expanded_address(&A);
zero_expanded_address(&B);

argv_to_expanded(&A,argv,mailer_info,aview);

! send_msg_middle(-1,&A,&B,
! given_subject,options,form,mailer_info,
! mailbox, aview, page);
!
! /* send_msg_middle uses menu_trigger_redraw(),
! need not examine
! */

free_expanded_address(&A);
free_expanded_address(&B);

free_mailer_info(&mailer_info);

! return;
}

static int get_subject(subject_field, page)
***************
*** 507,512 ****
--- 654,660 ----
charset_t utf7;
int LINES, COLUMNS;
int prompt_line;


+ int redraw = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

***************

*** 536,543 ****


CATGETS(elm_msg_cat, ElmSet, ElmSubject,
"Subject: "));

! if (REDRAW_MARK == code)

goto redraw;

if(code==-1){


/** User hit Ctrl-C key! **/

--- 684,697 ----


CATGETS(elm_msg_cat, ElmSet, ElmSubject,
"Subject: "));

! if (REDRAW_MARK == code) {

! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! redraw = 1;
!
goto redraw;
+ }

if(code==-1){


/** User hit Ctrl-C key! **/

***************
*** 545,550 ****
--- 699,707 ----
CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,

"Mail not sent."));
+

+ if (redraw)
+ menu_trigger_redraw(page);
return(0);
}

***************
*** 562,567 ****
--- 719,727 ----
ClearLine(prompt_line);
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSend,

"Mail not sent."));
+

+ if (redraw)
+ menu_trigger_redraw(page);
return(0);
}
else {
***************
*** 587,592 ****
--- 747,754 ----
*subject_field = XX;


}

+ if (redraw)
+ menu_trigger_redraw(page);

return(1); /** everything is cruising along okay **/
}

***************
*** 615,620 ****
--- 777,783 ----
int code;
struct string *buffer = NULL;
int LINES, COLUMNS;


+ int redraw = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

***************

*** 637,644 ****


OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));
!
}
if (code == -1) { /* Ctrl-C */
ClearLine(prompt_line-1);
ClearLine(prompt_line);

--- 800,812 ----


OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));
!

! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! redraw = 1;
}
+

if (code == -1) { /* Ctrl-C */
ClearLine(prompt_line-1);
ClearLine(prompt_line);
***************

*** 650,655 ****
--- 818,825 ----
if (buffer)
buffer_to_header(cc,&buffer,TRUE,mailer_info,aview);


+ if (redraw)
+ menu_trigger_redraw(page);

return(0);
}

***************
*** 678,684 ****
free_string(&B);
}
}
!

return(1); /* everything looks okay! */
}

--- 848,856 ----
free_string(&B);


}
}
!
! if (redraw)
! menu_trigger_redraw(page);

return(1); /* everything looks okay! */
}

***************
*** 696,705 ****


replied to into the edit buffer before invoking the editor!

**/

! char msg[SLEN];


! static enum copy_msg_mode answer = cm_no_copy;

! menu_get_sizes(page,&LINES, &COLUMNS);

if (forwarding) {
int X = mimeforward;
--- 868,879 ----


replied to into the edit buffer before invoking the editor!

**/

! char msg[SLEN];
! enum copy_msg_mode answer = cm_no_copy;
! int redraw = 0;

! again:
! menu_get_sizes(page,&LINES, &COLUMNS);

if (forwarding) {
int X = mimeforward;
***************
*** 711,717 ****


/* NOTICE: prompt_letter may return EOF */

X1 = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel,page,
CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,
"Forward message as separate part? (%c/%c) "),
*def_ans_yes, *def_ans_no);

--- 885,893 ----


/* NOTICE: prompt_letter may return EOF */

X1 = prompt_letter(LINES-4,"",def,


! PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,
! page,

CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,
"Forward message as separate part? (%c/%c) "),
*def_ans_yes, *def_ans_no);

***************
*** 724,729 ****
--- 900,914 ----
if (EOF == X1)
goto out;

+ if (X1 == ('L'&31) || X1 == REDRAW_MARK) {
+
+ /* NOTICE: using menu_trigger_redraw(page) on here
+ may cause redraw loop!
+ */
+ redraw = 1;
+ goto again;


+ }
+

X = (X1 == *def_ans_yes);
}
***************

*** 740,746 ****


/* NOTICE: prompt_letter may return EOF */

X1 = prompt_letter(LINES-4,"",*def_ans_no,
! PROMPT_yesno|PROMPT_cancel,page,

CATGETS(elm_msg_cat, ElmSet, ElmCopyMessageYN,
"Copy message? (%c/%c) "),
*def_ans_yes, *def_ans_no);


--- 925,932 ----
/* NOTICE: prompt_letter may return EOF */

X1 = prompt_letter(LINES-4,"",*def_ans_no,
! PROMPT_yesno|PROMPT_cancel|

! PROMPT_redraw_mark|PROMPT_ctrlL,page,
CATGETS(elm_msg_cat, ElmSet, ElmCopyMessageYN,
"Copy message? (%c/%c) "),
*def_ans_yes, *def_ans_no);
***************
*** 753,758 ****
--- 939,953 ----
if (EOF == X1)
goto out;

+ if (X1 == ('L'&31) || X1 == REDRAW_MARK) {
+
+ /* NOTICE: using menu_trigger_redraw(page) on here
+ may cause redraw loop!
+ */
+ redraw = 1;
+ goto again;


+ }
+
X = (X1 == *def_ans_yes);

answer = X ? cm_get_copy : cm_no_copy;

***************
*** 760,769 ****
}

out:
return(answer);
}

! int a_sendmsg(edit_message, form_letter, mailbox, aview, header_page,
page)
int edit_message, form_letter;
struct MailboxView *mailbox;
--- 955,966 ----
}

out:


+ if (redraw)
+ menu_trigger_redraw(page);

return(answer);
}

! void a_sendmsg(edit_message, form_letter, mailbox, aview, header_page,
page)
int edit_message, form_letter;
struct MailboxView *mailbox;
***************
*** 777,789 ****
if YES, then add the header. If MAYBE, then add the M)ake form
option to the last question (see mailsg2.c) etc. etc.

! Return TRUE if the main part of the screen has been changed
! (useful for knowing whether a redraw is needed.
**/

register int tagged = 0, i;
! int ret;
!
struct mailing_headers headers;
struct mailer_info *mailer_info = get_mailer_info();
int LINES, COLUMNS;
--- 974,984 ----
if YES, then add the header. If MAYBE, then add the M)ake form
option to the last question (see mailsg2.c) etc. etc.

! If redraw is needed use menu_trigger_redraw(page)
**/

register int tagged = 0, i;
!
struct mailing_headers headers;
struct mailer_info *mailer_info = get_mailer_info();
int LINES, COLUMNS;
***************
*** 802,822 ****
/* build the To: address and expand */
if (build_address_l(&headers.to,mailer_info, aview) == 0) {
free_mailer_info(&mailer_info);
! return(0);
}
display_to(headers.to,page); /* display the To: field on screen... */

/* get the Subject: field */

! if (get_subject(&headers.subject,page) == 0) {
! ret = 0;
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, FALSE,mailer_info, aview,
! page) == 0) {
! ret = 0;
goto free_it;
}
}
--- 997,1015 ----
/* build the To: address and expand */
if (build_address_l(&headers.to,mailer_info, aview) == 0) {
free_mailer_info(&mailer_info);
! return;
}
display_to(headers.to,page); /* display the To: field on screen... */

/* get the Subject: field */

! if (get_subject(&headers.subject,page) == 0) {
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, FALSE,mailer_info, aview,
! page) == 0) {
goto free_it;
}
}
***************
*** 838,846 ****
dump_expanded_address(5,"bcc",headers.bcc);

main_state();


! ret = mail(-1, edit_message ? MAIL_EDIT_MSG : 0, form_letter,
! &headers,mailer_info,
! mailbox, aview);
main_state();

/*

--- 1031,1040 ----
dump_expanded_address(5,"bcc",headers.bcc);

main_state();
! mail(-1, edit_message ? MAIL_EDIT_MSG : 0, form_letter,
! &headers,mailer_info,
! mailbox, aview, page,
! NULL,-1);
main_state();

/*
***************
*** 868,874 ****
free_it:
free_mailing_headers(&headers);
free_mailer_info(&mailer_info);
! return ret;
}

/*
--- 1062,1072 ----
free_it:
free_mailing_headers(&headers);
free_mailer_info(&mailer_info);
!
!
! /* mail() uses menu_trigger_redraw(page), do not need examine */
!
! return;
}

/*
Index: elm2.4.ME+.119-cvs/src/mailmsg2.c
*** elm2.4.ME+.118/src/mailmsg2.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/mailmsg2.c 2004-07-28 20:10:12.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.89 2004/07/14 11:17:24 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.89 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.96 2004/07/28 17:10:12 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.96 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 16,21 ****
--- 16,22 ----

#include "def_elm.h"
#include "s_elm.h"
+ #include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"mail");

***************
*** 76,84 ****


static int append_sig P_((FILE *file,struct mailing_headers *headers,
struct menu_context *page));

- static int recall_last_msg P_((char *filename, int copy_msg,
- int *cancelled_msg, int *already_has_text,
- struct menu_context *page));

static void mailing_message P_((int background));
static void mailing_message(background)
--- 77,82 ----
***************
*** 183,201 ****


}
}

! int mail(mail_index,options,form, headers,mailer_info,
! mailbox,aview)

int mail_index;
int options,form;
struct mailing_headers * headers;
struct mailer_info *mailer_info;

struct MailboxView *mailbox /* for mail_index */;
struct AliasView *aview;
{

int copy_msg = 0 != (options & MAIL_COPY_MSG);

int edit_message = 0 != (options & MAIL_EDIT_MSG);

int forwarding = 0 != (options & MAIL_FORWARDING);

int mime_attach = 0 != (options & MAIL_MIME_ATTCH);

struct Attachments attachments = NULL_Attachments;

--- 181,285 ----
}
}

! static char * mmsg_copy_part P_((FILE * mailbox_file,mime_t *mime_rec,
! FILE *outfile,int quote_l));
!
! static char * mmsg_copy_part(mailbox_file,mime_rec,outfile,quote_l)
! FILE * mailbox_file;
! mime_t *mime_rec;
! FILE *outfile; /* MAY be NULL */
! int quote_l;
! {
! FILE *F;
! static int PART_COUNT = 0;
! out_state_t state_out;
! in_state_t state_in;
! char *fname;
!
! if (0 != fseek(mailbox_file,mime_rec->offset,SEEK_SET)) {
! DPRINT(Debug,3,(&Debug,
! "mmsg_copy_part: Seek failed to %ld\n",
! mime_rec->offset));
! return NULL;
! }
!
!
! out_state_clear(&state_out, STATE_out_file);
! in_state_clear(&state_in, STATE_in_file);
!
! fname = elm_message(FRM("%smsgpart.%d-%d"),
! temp_dir, getpid (),
! PART_COUNT++);
!
! F = safeopen_rdwr(fname);
! if (!F) {
! DPRINT(Debug,3,(&Debug,"Can't create: %s\n",
! fname));
!
! lib_error(CATGETS(elm_msg_cat, MeSet, MeDecodeFailedCreate,
! "Failed to create file for decoding."));
! free(fname);
! return NULL;
! }
!
! set_out_state_file(F,&state_out);
! set_in_state_file(mailbox_file,&state_in);
!
! if (run_cte_decoder(mime_rec,&state_in,&state_out)) {
!
! if (outfile) {
! int ch;
! int nl = 1;
!
! rewind(F);
!
! while (EOF != (ch = getc(F))) {
!
! if (nl && '[' == ch && quote_l)
! putc('[',outfile);
!
! putc(ch,outfile);
! nl = '\n' == ch;
! }


! }
!
! } else {
!

! /* FAILURE */
! unlink(fname);
! free(fname);
! fname = NULL;
! }
!
! out_state_destroy(&state_out);
! in_state_destroy(&state_in);
!
!
! fclose(F);
!
! return fname;
! }
!
! void mail(mail_index,options,form, headers,mailer_info,
! mailbox,aview, parent_page,
! selection_view,selection_idx)


int mail_index;
int options,form;
struct mailing_headers * headers;
struct mailer_info *mailer_info;

struct MailboxView *mailbox /* for mail_index */;
struct AliasView *aview;

+ struct menu_context *parent_page;
+ struct MailboxView *selection_view;
+ int selection_idx;
{
+

int copy_msg = 0 != (options & MAIL_COPY_MSG);

int edit_message = 0 != (options & MAIL_EDIT_MSG);

int forwarding = 0 != (options & MAIL_FORWARDING);

int mime_attach = 0 != (options & MAIL_MIME_ATTCH);

+ int copy_selection = 0 != (options & MAIL_COPY_SELECTION);
+ int delete_cancel = 0 != (options & MAIL_DELETE_CANCEL);



struct Attachments attachments = NULL_Attachments;

***************

*** 208,222 ****
M)ake form option to last question, and NO=don't worry about it!
Also, if 'copy_msg' = FORM, then grab the form temp file and use
that...
! Return TRUE if the main part of the screen has been changed
! (useful for knowing whether a redraw is needed.
**/

FILE *reply = NULL;


char fname[SLEN], very_long_buffer[VERY_LONG_STRING];

int ch, line_len;
! int retransmit = FALSE;
int already_has_text = FALSE; /* we need an ADDRESS */
int signature_done = FALSE;
int need_redraw = 0;

--- 292,307 ----
M)ake form option to last question, and NO=don't worry about it!
Also, if 'copy_msg' = FORM, then grab the form temp file and use
that...
!
! In redraw is needed use
! use menu_trigger_redraw(parent_page)
**/

FILE *reply = NULL;


char fname[SLEN], very_long_buffer[VERY_LONG_STRING];

int ch, line_len;
!

int already_has_text = FALSE; /* we need an ADDRESS */
int signature_done = FALSE;
int need_redraw = 0;
***************

*** 233,239 ****


static int conv_count = 0;

char * temp1 = NULL;

- static int cancelled_msg = 0;
char title[80];
int code = 0;
struct copy_file COPY_FILE;
--- 318,323 ----
***************
*** 245,251 ****

/* Fail if no mailer available */
if (!mailer_info)
! return 0;

/* free_mailing_headers will free this */
if (!headers->env_from)
--- 329,335 ----

/* Fail if no mailer available */
if (!mailer_info)
! return;

/* free_mailing_headers will free this */
if (!headers->env_from)
***************
*** 277,300 ****
if (! batch_only)
menu_ClearScreen(page);

- /** if possible, let's try to recall the last message? **/
-
- if (! batch_only && copy_msg != FORM && user_level != 0) {
- DPRINT(Debug,8,(&Debug,
- "Checking if there is cancelled message for name %s (cancelled_msg is%s set)\n",
- cur_editfile,
- cancelled_msg ? "" : " not"
- ));
- retransmit = recall_last_msg(cur_editfile, copy_msg, &cancelled_msg,
- &already_has_text,
- page);
- if (retransmit)
- cur_editcharset = display_charset; /* ???? FIXME */
- }
-

/** if we're not retransmitting, create the file.. **/

- if (! retransmit) {
if ((reply = safeopen_rdwr(cur_editfile)) == NULL) {
err = errno;
DPRINT(Debug,1,(&Debug,
--- 361,368 ----
***************
*** 307,313 ****
goto fail_label;

}
- }

(void) elm_chown(cur_editfile, userid, groupid);

--- 375,380 ----
***************
*** 345,351 ****
"Could not open file %s."),
included_file);

! return(need_redraw);
}

cur_editcharset = system_charset; /* Is correct? */
--- 412,420 ----
"Could not open file %s."),
included_file);

! if (need_redraw)
! menu_trigger_redraw(parent_page);
! return;
}

cur_editcharset = system_charset; /* Is correct? */
***************
*** 356,383 ****
fclose(input);
already_has_text = TRUE;
}
!
! /* Initialize structure -- XXX KESKEN */
clear_mime_send_info(&MIME_info);
handle_mailer_options(mailer_info,&MIME_info,&dsn,
&attachments, NULL);




if (mailbox && mail_index >= 0 &&

! (copy_msg || forwarding)) {


struct header_rec * hdr = NULL;

FILE * mailbox_file = NULL;


! if (!give_message_data(mailbox,mail_index,
&hdr,&mailbox_file,NULL,
mime_parse_routine)) {

DPRINT(Debug,4,(&Debug,
! "Failed to retrieve original mail for replying/forwarding\n"));
!

! fclose(reply); reply = NULL;

goto fail_label;
}

--- 425,462 ----
fclose(input);
already_has_text = TRUE;
}
!
! /* Initialize structure */
!
clear_mime_send_info(&MIME_info);
handle_mailer_options(mailer_info,&MIME_info,&dsn,

&attachments, NULL);


+
if (mailbox && mail_index >= 0 &&

! (copy_msg || forwarding) ||
! copy_selection) {


struct header_rec * hdr = NULL;

FILE * mailbox_file = NULL;

+ struct MailboxView * W = mailbox;
+ int Wi = mail_index;
+
+ if (copy_selection) {
+ W = selection_view;
+ Wi = selection_idx;
+ }

! if (!give_message_data(W,Wi,
&hdr,&mailbox_file,NULL,
mime_parse_routine)) {

DPRINT(Debug,4,(&Debug,
! "Failed to retrieve original mail for replying/forwarding/canceled mail\n"));



+ fclose(reply); reply = NULL;
+
goto fail_label;
}

***************
*** 404,410 ****
rename(fname, cur_editfile);

cur_editcharset = system_charset; /* FIXME: Is correct? */

! } else if (! retransmit) { /* if retransmit we have it! */

struct string * From_buffer = NULL;

struct addr_item *p;

--- 483,490 ----
rename(fname, cur_editfile);

cur_editcharset = system_charset; /* FIXME: Is correct? */

! } else if (

! (forwarding || mime_attach || copy_msg)) {

struct string * From_buffer = NULL;

struct addr_item *p;

***************
*** 425,431 ****
}
}

-

if (!cur_editcharset)
cur_editcharset = display_charset;

--- 505,510 ----
***************
*** 539,550 ****
add_Attachments(&attachments,&attach);
}
}
if (From_buffer)
free_string(&From_buffer);
- }



! }

if (!cur_editcharset)
cur_editcharset = display_charset;

--- 618,896 ----
add_Attachments(&attachments,&attach);
}
}
+
if (From_buffer)
free_string(&From_buffer);

! } else {
! /* make referenced message as edited message */
! header_list_ptr all_headers,walk;
! int Flags, major;
! CONST char *subtype;
! char buffer[80];
!
! DPRINT(Debug,4, (&Debug,
! "Not forwarding, copying message normally or mime attaching, making message as edited -- copy_selection=%d\n",
! copy_selection));
!
! if (skip_envelope(hdr,mailbox_file) == -1) {
! DPRINT(Debug,4, (&Debug, "Can't skip envelope of message -- will not pick message for sending\n"));
! goto fail0;
! }
!
! all_headers = file_read_headers(mailbox_file,RHL_CHECK_HEADER);
!
!
! for (walk = all_headers; walk; walk = walk -> next_header) {
! CONST char * hdr_name = give_header_name(walk->header_name);
!
! if (0 == strincmp(hdr_name,"Content-",8) ||
! 0 == istrcmp(hdr_name,"MIME-Version") ||
! 0 == istrcmp(hdr_name,"Received") ||
! 0 == istrcmp(hdr_name,"Sender"))
! continue;
!
! if (!add_to_mailing_header(headers,walk->header_name,
! walk->body,
! !(hdr->status & NOHDRENCODING),
! hdr->header_charset,1)) {
! DPRINT(Debug,4, (&Debug, "Header %s not copied\n",
! hdr_name));
! }
! }
!
! dump_expanded_address(4,"after copy -- from ",headers->from);
! dump_expanded_address(4,"after copy -- to ",headers->to);
! dump_expanded_address(4,"after copy -- cc ",headers->cc);
!
!
! if (! hdr->mime_rec.TYPE) {
! DPRINT(Debug,4, (&Debug, "no mime type -- will not pick message for sending\n"));
! goto fail1;
! }
!
! Flags = get_type_flags(hdr->mime_rec.TYPE);
! major = get_major_type_code(hdr->mime_rec.TYPE);
! subtype = get_subtype_name(hdr->mime_rec.TYPE);
!
! /* 1) Includes only one text part -- put it to edit buffer */
! if (MIME_TYPE_TEXT == major && 0 == istrcmp(subtype,"Plain") &&
! DISP_INLINE == hdr->mime_rec.disposition) {
!
! char * filename =
! mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
! reply,mime_body_keywords);
!
! if (filename) {
! unlink(filename);
! free(filename);
! }
!
!
! if (!mime_get_param("charset",buffer,hdr->mime_rec.type_opts,sizeof buffer)) {
! DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
! goto fail1;
! }
!
! cur_editcharset = MIME_name_to_charset(buffer,0);
! if (!cur_editcharset) {
! DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! buffer));
! goto fail1;
! }
!
! if (charset_superset_of(display_charset,cur_editcharset)) {
! DPRINT(Debug,4, (&Debug,
! "charset parameter %s (%s) is subset of display charset %s\n",
! cur_editcharset->MIME_name ?
! cur_editcharset->MIME_name :
! "<no MIME name>",
! buffer,
! display_charset->MIME_name ?
! display_charset->MIME_name :


! "<no MIME name>"));

! cur_editcharset = display_charset;
! }

!
! DPRINT(Debug,4, (&Debug, "Added whole mail to editing buffer\n"));
!
! /* 2) multipart MIXED */
! } else if ((Flags & MIME_MIXED) &&
! DISP_INLINE == hdr->mime_rec.disposition &&
! hdr->mime_rec.parser_data) {
!
! int s = 0;
! int c = mime_parser_subparts(hdr->mime_rec.parser_data);
! mime_t *z = NULL;
! int x;
!
! /* Pick first parts to editing buffer */
! if (c > 0 &&
! (z = mime_parser_index(hdr->mime_rec.parser_data,0)) &&
! z->TYPE) {
! int major = get_major_type_code(z->TYPE);
! CONST char *subtype = get_subtype_name(z->TYPE);
!
! if (MIME_TYPE_TEXT == major && 0 == istrcmp(subtype,"Plain") &&
! DISP_INLINE == z->disposition) {
!
! char * filename =
! mmsg_copy_part(mailbox_file,z,reply,mime_body_keywords);
!
! if (filename) {
! unlink(filename);
! free(filename);
! }
!
!
! if (!mime_get_param("charset",buffer,z->type_opts,sizeof buffer)) {
! DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
! goto fail2;
! }
!
! cur_editcharset = MIME_name_to_charset(buffer,0);
! if (!cur_editcharset) {
! DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! buffer));
! goto fail2;
! }
!
! if (charset_superset_of(display_charset,cur_editcharset)) {
! DPRINT(Debug,4, (&Debug,
! "charset parameter %s (%s) is subset of display charset %s\n",
! cur_editcharset->MIME_name ?
! cur_editcharset->MIME_name :
! "<no MIME name>",
! buffer,
! display_charset->MIME_name ?
! display_charset->MIME_name :


! "<no MIME name>"));

! cur_editcharset = display_charset;
! }

!
! DPRINT(Debug,4, (&Debug,
! "Added first part of mail to editing buffer\n"));
!
! fail2:
!
! /* Start attachments from second part */
! s = 1;
!
! }
!
! }
!
! for (x = s; x < c; x++) {
! mime_t attach;
!
! z = mime_parser_index(hdr->mime_rec.parser_data,x);
! if (!z) {
! DPRINT(Debug,4, (&Debug,
! "Failed to get part %d/%d\n",
! x,c));
! continue;
! }
!
! if (!z->TYPE) {
! DPRINT(Debug,4, (&Debug,
! "No type on part %d/%d\n",
! x,c));
! continue;
! }
!
! mime_t_zero(&attach);
!
! attach.pathname = mmsg_copy_part(mailbox_file,z,
! NULL,0);
! if (!attach.pathname) {
! DPRINT(Debug,4, (&Debug,
! "Failed to copy part %d/%d\n",
! x,c));
! continue;
! }
!

! attach.unlink = 1; /* mark for later deletion */

! attach.TYPE = z->TYPE;
! attach.encoding = z->encoding;
! attach.disposition = z->disposition;
!
! if (z->description) {
! attach.description = dup_string(z->description);
! }
!
! if (z->type_opts) {
! attach.type_opts = safe_strdup(z->type_opts);
! }
!
! if (z->disposition_opts) {
! attach.disposition_opts = safe_strdup(z->disposition_opts);
! }
!
! add_Attachments(&attachments,&attach);
!
! DPRINT(Debug,4, (&Debug,
! "Added part %d/%d\n",
! x,c));


!
!
! }
!
!

! /* 3) Add just whole mail as attachment */
! } else {
!

! mime_t attach;
!
! mime_t_zero(&attach);
!

! attach.pathname = mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
! NULL,0);
! if (!attach.pathname) {
! DPRINT(Debug,4, (&Debug,
! "Failed to copy messge \n"));
! goto fail1;
! }
!

! attach.unlink = 1; /* mark for later deletion */

! attach.TYPE = hdr->mime_rec.TYPE;
! attach.encoding = hdr->mime_rec.encoding;
! attach.disposition = hdr->mime_rec.disposition;
!
! if (hdr->mime_rec.description) {
! attach.description =
! dup_string(hdr->mime_rec.description);
! }
!
! if (hdr->mime_rec.type_opts) {
! attach.type_opts = safe_strdup(hdr->mime_rec.type_opts);
! }
!
! if (hdr->mime_rec.disposition_opts) {
! attach.disposition_opts =
! safe_strdup(hdr->mime_rec.disposition_opts);
! }
!
! add_Attachments(&attachments,&attach);
!
! DPRINT(Debug,4, (&Debug,
! "Added message\n"));
!
! }
!
! if (delete_cancel)
! delete_current_cancel(selection_view,mailbox_file);
!
! fail1:
! if (all_headers)
! delete_headers(&all_headers);
!
! }
!
! }

+
+ fail0:
+

if (!cur_editcharset)
cur_editcharset = display_charset;

***************

*** 553,559 ****
int i;

for (i = 0; i < attach_files.attachment_count; i++) {
! add_Attachments(&attachments,&attach_files.attach_files[i]);
/* add_Attachments zeros attach_files.attach_files[i],
so array can be fre'ed later
*/
--- 899,905 ----
int i;

for (i = 0; i < attach_files.attachment_count; i++) {
! add_Attachments(& attachments,&attach_files.attach_files[i]);
/* add_Attachments zeros attach_files.attach_files[i],
so array can be fre'ed later
*/
***************
*** 572,578 ****


strcmp(editor_val,"builtin") != 0 &&

strcmp(editor_val,"none") != 0)) {

signature_done = TRUE;
! if (!retransmit && copy_msg != FORM)

already_has_text |= append_sig(reply, headers, page);
}
}

--- 918,924 ----


strcmp(editor_val,"builtin") != 0 &&

strcmp(editor_val,"none") != 0)) {

signature_done = TRUE;
! if (copy_msg != FORM)

already_has_text |= append_sig(reply, headers, page);
}
}

***************
*** 616,622 ****


#endif

/* Now .mailheaders is read before mail is composed! */

! import_mailheaders(headers);

do { /* So we can return here if check_for_multipart() fails
* - K E H <hurtt...@ozone.FMI.FI> */
--- 962,969 ----


#endif

/* Now .mailheaders is read before mail is composed! */

! if (!copy_selection)
! import_mailheaders(headers);

do { /* So we can return here if check_for_multipart() fails
* - K E H <hurtt...@ozone.FMI.FI> */
***************
*** 644,654 ****
if (-2 == code && !attachments.attachment_count) {
goto fail_label;
}
- if (form == YES && format_form(cur_editfile) < 1) {
- cancelled_msg = (bytes(cur_editfile) > 0);
-
- goto fail_label;
- }


/* so we can mark the reply flag */

if (0 == code)
me_retcode = 1;
--- 991,996 ----
***************
*** 682,688 ****
* takes account of 8-bit data on signature
*/

! if (!signature_done && !retransmit && copy_msg != FORM) {
/* Go to the end of the file! */
fseek (reply, 0, 2);
append_sig(reply, headers, page);
--- 1024,1030 ----
* takes account of 8-bit data on signature
*/

! if (!signature_done && copy_msg != FORM) {
/* Go to the end of the file! */
fseek (reply, 0, 2);
append_sig(reply, headers, page);
***************
*** 713,726 ****
MIME_info.need_enc |= check_8bit_string (headers->subject);
#endif

- if (code < 0) {
- cancelled_msg = (bytes(cur_editfile) > 0);
- DPRINT(Debug,8,(&Debug,
- "Message %s was%s cancelled ...\n",
- cur_editfile, cancelled_msg ? "": " not"));
-
- } else
- cancelled_msg = FALSE; /* it ain't cancelled, is it? */

if (check_for_multipart(reply, &MIME_info,mailer_info) < 0) {
/* Error in [include ...] */
--- 1055,1060 ----
***************
*** 750,756 ****
if (code < 0)
goto fail_label;
if (batch_only)


! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */

edit_message = FALSE;


reask_verify = TRUE; /* Go to verify_transmission again. */

continue;
--- 1084,1090 ----
if (code < 0)
goto fail_label;
if (batch_only)
! leave(0);
edit_message = FALSE;


reask_verify = TRUE; /* Go to verify_transmission again. */

continue;
***************
*** 774,780 ****
if (code < 0)
goto fail_label;
if (batch_only)


! leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedConvertMessage,
"Failed convert message, fix errors and retry or f)orget it"));


reask_verify = TRUE; /* Go to verify_transmission again. */

--- 1108,1114 ----
if (code < 0)
goto fail_label;
if (batch_only)
! leave(0);
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedConvertMessage,
"Failed convert message, fix errors and retry or f)orget it"));


reask_verify = TRUE; /* Go to verify_transmission again. */

***************
*** 817,854 ****
headers->sender));
}

! if (code < 0) {
! char * lbuf = elm_message(FRM("%s/%s"),
! home, dead_letter);
int i;
out_state_t fp_copy;
! FILE *F;

- for (i = 1; i < 100; i++) {
- if (0 == access(lbuf,ACCESS_EXISTS)) {
- char *lbuf1 = elm_message(FRM("%s/%02d.%s"),
- home,i,dead_letter);
-
- /* link() will fail if target file exists
- NOTE: We can't use rename() because it will replace
- target file
- */
- int r = link(lbuf,lbuf1);
-
- if (0 == r) {
- DPRINT(Debug,1,(&Debug, "File %s renamed to %s\n",
- lbuf,lbuf1));
- unlink (lbuf);
- }
- free(lbuf1);
- if (0 == r)
- break;
- }
- }

out_state_clear(&fp_copy,STATE_out_file);

! if (NULL != (F = safeopen_rdwr(lbuf))) {
set_out_state_file(F,&fp_copy);
write_header_info(&fp_copy,headers,(form == YES),TRUE,
&MIME_info);
--- 1151,1191 ----
headers->sender));
}

! if (code == -1 /* Forget */ ||
! code < 0 && MIME_info.msg_is_multipart) {
!
! struct MailboxView *cm = give_canceled_mail();
!
! char * lbuf = NULL;
int i;
out_state_t fp_copy;


! FILE *F = NULL;

! time_t now = time(NULL);


out_state_clear(&fp_copy,STATE_out_file);

! if (cm)
! F = add_canceled_mail(&lbuf,headers,cm,now,-1,NULL,
! -1L);
!
! if (!F) {
! if (lbuf)
! free(lbuf);
!
! lbuf = elm_message(FRM("%s/%s"),
! home, dead_letter);
!
! F = safeopen_rdwr(lbuf);
! } else {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmVfyMessageKept1,
! "Message kept. Can be restored at next m)ail command."));
! }
!
! DPRINT(Debug,4,(&Debug, "Writing canceled mail to %s\n",
! lbuf));
!
! if (NULL != F) {
set_out_state_file(F,&fp_copy);
write_header_info(&fp_copy,headers,(form == YES),TRUE,
&MIME_info);
***************
*** 860,865 ****
--- 1197,1208 ----
if (F)
fclose(F);

+ if (lbuf) {
+
+ if (last_canceled_mail)
+ free(last_canceled_mail);
+ last_canceled_mail = lbuf;
+ }
} else {
struct mail_send_state * mailer = NULL;

***************
*** 932,937 ****
--- 1275,1281 ----
MIME_info.encoding_top, title,mailing_message);



/* NOTE: succees failure, backgrouded status currently ignored */

+
}

fclose(reply);
***************
*** 939,944 ****
--- 1283,1291 ----

fail_label:

+ if (delete_cancel)
+ sync_canceled_mails(selection_view);
+
free_Attachments(&attachments);

if (converted_buffer)
***************
*** 953,963 ****
* file just hang after we're finished with it.
*/

! if (cancelled_msg) {
! DPRINT(Debug,8,(&Debug,"Keeping %s (was cancelled)\n",
! cur_editfile));
! } else if (0 ==unlink (cur_editfile)) {
! DPRINT(Debug,8,(&Debug,"Removing %s (was not cancelled)\n",
cur_editfile));
}

--- 1300,1307 ----
* file just hang after we're finished with it.
*/

! if (0 ==unlink (cur_editfile)) {
! DPRINT(Debug,8,(&Debug,"Removing %s\n",
cur_editfile));
}

***************
*** 971,977 ****
if (page)
erase_menu_context(&page);

! return(1);
}

static void mail_sent (fd,title,rs,ret,exit_code)
--- 1315,1322 ----
if (page)
erase_menu_context(&page);

! menu_trigger_redraw(parent_page);
! return;
}

static void mail_sent (fd,title,rs,ret,exit_code)
***************
*** 1009,1029 ****


}
}

! int mail_form(mail_index, address, subj, mailbox, aview)

int mail_index;
struct addr_item *address;
char *subj;
struct MailboxView *mailbox;
struct AliasView *aview;
{

- int res;
-
struct mailing_headers headers;
struct expanded_address A;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return 0;

zero_mailing_headers(&headers);
zero_expanded_address(&A);
--- 1354,1373 ----
}
}

! void mail_form(mail_index, address, subj, mailbox, aview, page)


int mail_index;
struct addr_item *address;
char *subj;
struct MailboxView *mailbox;
struct AliasView *aview;

+ struct menu_context *page;
{
struct mailing_headers headers;
struct expanded_address A;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return;

zero_mailing_headers(&headers);
zero_expanded_address(&A);
***************
*** 1033,1103 ****
addr_to_expanded(&A,address,mailer_info,aview);
copy_expanded_address(&headers.to, A);


! res = mail(mail_index,MAIL_ISFORM,NO, &headers,mailer_info,
! mailbox /* save_copy needs */,

! aview);
!
free_expanded_address(&A);
free_mailing_headers(&headers);
free_mailer_info(&mailer_info);

! return res;
}

- static int recall_last_msg(filename, copy_msg, cancelled_msg, already_has_text,
- page)
- char *filename;
- int copy_msg, *cancelled_msg, *already_has_text;
- struct menu_context *page;
- {
- char ch;
- char msg[SLEN];
-
- /** If filename exists and we've recently cancelled a message,
- the ask if the user wants to use that message instead! This
- routine returns TRUE if the user wants to retransmit the last
- message, FALSE otherwise...
- **/
-
- int retransmit = FALSE;
- int LINES, COLUMNS;
-
- menu_get_sizes(page,&LINES, &COLUMNS);
-
-
- if (access(filename, EDIT_ACCESS) == 0 && *cancelled_msg) {
- Raw(ON);
- CleartoEOLN();
- if (copy_msg)
- elm_sfprintf(msg, sizeof msg,
- CATGETS(elm_msg_cat, ElmSet, ElmRecallLastInstead,
- "Recall last kept message instead? (%c/%c) "),
- *def_ans_yes, *def_ans_no);
- else
- elm_sfprintf(msg, sizeof msg,
- CATGETS(elm_msg_cat, ElmSet, ElmRecallLastKept,
- "Recall last kept message? (%c/%c) "),
- *def_ans_yes, *def_ans_no);
- do {
- ch = want_to(msg, '\0', LINES-2, 0, page);
- if (ch == *def_ans_yes) {
- retransmit++;
- *already_has_text = TRUE;
- } else if (ch != *def_ans_no) {
- Write_to_screen(FRM("%c??"), 07); /* BEEP */
- if (sleepmsg > 0)
- error_sleep((sleepmsg + 1) / 2);
- ch = 0;
- }
- } while (ch == 0);
-
- FlushBuffer();
-
- *cancelled_msg = 0;
- }
-
- return(retransmit);
- }

void dsn_menu P_((int *));
void dsn_menu(dsn)
--- 1377,1396 ----
addr_to_expanded(&A,address,mailer_info,aview);
copy_expanded_address(&headers.to, A);

! mail(mail_index,MAIL_ISFORM,NO, &headers,mailer_info,


! mailbox /* save_copy needs */,

! aview, page,
! NULL, -1);
!
! /* mail() does menu_trigger_redraw() do not need to reexamine */
!
free_expanded_address(&A);
free_mailing_headers(&headers);
free_mailer_info(&mailer_info);

! return;
}


void dsn_menu P_((int *));
void dsn_menu(dsn)
***************
*** 1473,1479 ****
}

if (cmd == EOF)


! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */
#ifdef ASCII_CTYPE

if (isascii(cmd))
#endif
--- 1766,1772 ----
}

if (cmd == EOF)
! leave(0);
#ifdef ASCII_CTYPE
if (isascii(cmd))
#endif
***************
*** 1572,1587 ****
if (bytes(filename) <= 0) {
; /* forget about empty files */
return -2;
! } else if (mail_only) {
!
! } else if (user_level > 0) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmVfyMessageKept,
! "Message kept. Can be restored at next f)orward, m)ail or r)eply."));
! DPRINT(Debug,8,(&Debug,
! "Cancelled message stored with name %s\n",
! filename));
!
! }
return -1;
/*NOTREACHED*/

--- 1865,1871 ----
if (bytes(filename) <= 0) {
; /* forget about empty files */
return -2;
! }
return -1;
/*NOTREACHED*/

***************
*** 1681,1687 ****

#ifdef ALLOW_SUBSHELL
case '!':
! if (subshell(NULL, page) != 0) {
menu_ClearScreen(page);
*need_redraw_p = TRUE;
do_redraw = 1;
--- 1965,1972 ----



#ifdef ALLOW_SUBSHELL
case '!':
! subshell(NULL, page);

! if (menu_need_redraw(page)) {
menu_ClearScreen(page);
*need_redraw_p = TRUE;
do_redraw = 1;
Index: elm2.4.ME+.119-cvs/src/Makefile.SH
*** elm2.4.ME+.118/src/Makefile.SH 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/Makefile.SH 2004-07-27 23:25:02.000000000 +0300
***************
*** 31,37 ****

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.51 2004/06/18 20:40:56 hurtta Exp $
#


# Makefile for the ELM mail program.
#

--- 31,37 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.52 2004/07/27 20:25:02 hurtta Exp $
#


# Makefile for the ELM mail program.
#

***************
*** 112,117 ****
--- 112,118 ----
browser.c \
builtin++.c \
calendar.c \
+ canceled.c \
date.c \
delete.c \
digest.c \
***************
*** 173,178 ****
--- 174,180 ----
browser.o \
builtin++.o \
calendar.o \
+ canceled.o \
date.o \
delete.o \
digest.o \
***************
*** 332,337 ****
--- 334,340 ----
browser.o: def_elm.h $(INCLDIR)/s_elm.h
builtin++.o: def_elm.h
calendar.o: def_elm.h
+ canceled.o: def_elm.h $(INCLDIR)/s_elm.h
date.o: def_elm.h
delete.o: def_elm.h $(INCLDIR)/s_elm.h
digest.o: def_elm.h $(INCLDIR)/s_elm.h
***************
*** 352,358 ****
limit.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_aliases.h
lock.o: def_elm.h $(INCLDIR)/s_elm.h
mailmsg1.o: def_elm.h $(INCLDIR)/s_elm.h
! mailmsg2.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/menu2.h
menu2.o: def_elm.h $(INCLDIR)/menu2.h
menu.o: def_elm.h $(INCLDIR)/menu.h
metapager.o: def_elm.h $(INCLDIR)/s_elm.h
--- 355,361 ----
limit.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_aliases.h
lock.o: def_elm.h $(INCLDIR)/s_elm.h
mailmsg1.o: def_elm.h $(INCLDIR)/s_elm.h
! mailmsg2.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/menu2.h $(INCLDIR)/s_me.h
menu2.o: def_elm.h $(INCLDIR)/menu2.h
menu.o: def_elm.h $(INCLDIR)/menu.h
metapager.o: def_elm.h $(INCLDIR)/s_elm.h
Index: elm2.4.ME+.119-cvs/src/messages/canceled_mail.c


*** /tmp/21867-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-04 20:00:20.000000000 +0300

--- elm2.4.ME+.119-cvs/src/messages/canceled_mail.c 2004-08-03 18:20:26.000000000 +0300
***************
*** 0 ****
--- 1,1955 ----
+ static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.8 2004/08/03 15:20:26 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+
+ #include "def_messages.h"
+ #include "s_elm.h"
+ #include "s_me.h"
+
+ DEBUG_VAR(Debug,__FILE__,"messages");
+
+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif


+
+ #include <errno.h>
+ #ifndef ANSI_C
+ extern int errno;

+ #endif
+
+ static struct MailboxView *canceled_mail_view = NULL;
+
+ struct mv_canceldir {
+ char * dirname;
+ char * indexname;
+
+ FILE * index_F;
+ charset_t cs;
+
+ time_t last_scan;
+ time_t last_mtime;
+
+ struct message_list {
+ char * filename;
+ struct header_rec REC;
+ } * message_list;
+ int message_list_len;
+
+ int last_open_index;
+ FILE * last_open_file;
+ };
+
+ S_(mt_init_mailbox mt_init_canceldir)
+ static void mt_init_canceldir P_((struct MailboxView *mbx));
+
+ static void mt_init_canceldir(mbx)
+ struct MailboxView *mbx;
+ {
+ mbx->u.canceldir = safe_malloc(sizeof (* (mbx->u.canceldir)));
+
+ /* bzero is defined hdrs/defs.h */
+ bzero((void *)mbx->u.canceldir, sizeof (* (mbx->u.canceldir)));
+
+ mbx->u.canceldir->dirname = NULL;
+ mbx->u.canceldir->indexname = NULL;
+ mbx->u.canceldir->index_F = NULL;
+ mbx->u.canceldir->cs = NULL;
+
+ mbx->u.canceldir->last_scan = 0;
+ mbx->u.canceldir->last_mtime = 0;
+
+ mbx->u.canceldir->message_list = NULL;
+ mbx->u.canceldir->message_list_len = 0;
+
+ mbx->u.canceldir->last_open_index = -1;
+ mbx->u.canceldir->last_open_file = NULL;
+
+ }
+
+ S_(mt_free_mailbox mt_free_canceldir)
+ static void mt_free_canceldir P_((struct MailboxView *mbx));
+ static void mt_free_canceldir(mbx)
+ struct MailboxView *mbx;
+ {
+
+ if (mbx->u.canceldir->dirname) {
+ free(mbx->u.canceldir->dirname);
+ mbx->u.canceldir->dirname = NULL;
+ }
+
+ if (mbx->u.canceldir->indexname) {
+ free(mbx->u.canceldir->indexname);
+ mbx->u.canceldir->indexname = NULL;
+ }
+
+ if (mbx->u.canceldir->index_F) {
+
+ fflush(mbx->u.canceldir->index_F);
+
+ Release_the_file(fileno(mbx->u.canceldir->index_F));
+
+ fclose(mbx->u.canceldir->index_F);
+ mbx->u.canceldir->index_F = NULL;
+ }
+
+ mbx->u.canceldir->cs = NULL;
+
+ if (mbx->u.canceldir->message_list) {
+ int i;
+
+ for (i = 0; i < mbx->u.canceldir->message_list_len; i++) {
+ if (mbx->u.canceldir->message_list[i].filename) {
+ free (mbx->u.canceldir->message_list[i].filename);
+ mbx->u.canceldir->message_list[i].filename = NULL;
+ }
+
+ header_clear ( & ( mbx->u.canceldir->message_list[i].REC) );
+ }
+ }
+ mbx->u.canceldir->message_list_len = 0;
+
+
+ mbx->u.canceldir->last_open_index = -1;
+ if (mbx->u.canceldir->last_open_file) {
+ fclose(mbx->u.canceldir->last_open_file);
+ mbx->u.canceldir->last_open_file = NULL;
+ }
+
+ free(mbx->u.canceldir);
+ mbx->u.canceldir = NULL;
+
+ /* Reset canceled_mail_view -pointer if we are going erase it */
+ if (canceled_mail_view == mbx)
+ canceled_mail_view = NULL;
+ }
+
+ static void mt_make_canceldir_view P_((struct MailboxView *mailbox));
+
+
+ S_(mt_add_mailbox_storage mt_add_canceldir_storage)
+ static void mt_add_canceldir_storage P_((struct MailboxView *mailbox,
+ struct current_storage *storage));
+ static void mt_add_canceldir_storage(mailbox,storage)
+ struct MailboxView *mailbox;
+ struct current_storage *storage;
+ {
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"mt_add_canceldir_storage",
+ "mt_add_canceldir_storage called",0);
+ }
+
+ static int process_index P_((struct MailboxView *view));
+
+ static void unlock_index P_((struct MailboxView *view));
+ static void unlock_index(view)
+ struct MailboxView *view;
+ {
+
+ if (!view->u.canceldir->index_F)
+ return;
+
+ fflush(view->u.canceldir->index_F);
+
+ Release_the_file(fileno(view->u.canceldir->index_F));
+
+ fclose(view->u.canceldir->index_F);
+ view->u.canceldir->index_F = NULL; /* Mark -- no locked */
+ }
+
+ static void update_index P_((struct MailboxView *v));
+ static void add_canceled_mail1 P_((char *filename,


+ struct mailing_headers * headers,

+ struct MailboxView *view,
+ time_t X,
+ int lines,
+ header_list_ptr h,
+ long body_offset));
+
+ static void move_olds P_((struct MailboxView *v));
+
+ #ifdef DIROPS
+
+ #if DIROPS == USE_DIRENT
+ #include <dirent.h>
+ #endif /* DIROPS == USE_DIRENT */
+ #if DIROPS == USE_SYSDIR
+ #include <sys/dir.h>
+ #endif /* DIROPS == USE_SYSDIR */
+
+ static void update_index(v)
+ struct MailboxView *v;
+ {
+ DIR * handle;
+ struct stat dstat;
+ time_t now = time(NULL);
+
+ int unlock_it = 0;
+
+ #if DIROPS == USE_DIRENT
+ struct dirent * Xptr;
+ #endif /* DIROPS == USE_DIRENT */
+ #if DIROPS == USE_SYSDIR
+ struct direct * Xptr;
+ #endif /* DIROPS == USE_SYSDIR */
+
+ if (0 != stat(v->u.canceldir->dirname,&dstat)) {
+ DPRINT(Debug,1,(&Debug,"stat %s failed!\n",
+ v->u.canceldir->dirname));
+ dstat.st_mtime = now;
+ }
+
+ if (dstat.st_mtime == v->u.canceldir->last_mtime &&
+ now < v->u.canceldir->last_scan + 60) {
+ DPRINT(Debug,7,(&Debug,"scan %s skipped\n",
+ v->u.canceldir->dirname));
+ return;
+ }
+
+ if (!v->u.canceldir->index_F) {
+ if (! process_index(v))
+ return;
+
+ unlock_it++;
+ }
+
+ v->u.canceldir->last_mtime = dstat.st_mtime;
+ v->u.canceldir->last_scan = now;
+
+ handle = opendir(v->u.canceldir->dirname);
+ if (!handle)
+ goto fail2;
+
+ while (NULL != (Xptr = readdir(handle))) {
+ if ('.' != Xptr->d_name[0]) {
+ struct stat X;
+ char *fullname;
+ int fd;
+ FILE *f1 = NULL;
+ header_list_ptr h = NULL;
+ long b;
+ int lines = 0;
+ int i,c;
+
+ #if DIROPS == USE_DIRENT
+ char * entryname = safe_strdup(Xptr->d_name);
+
+ #endif /* DIROPS == USE_DIRENT */
+ #if DIROPS == USE_SYSDIR
+ char * entryname = safe_malloc(Xptr->d_namlen+1);
+
+
+ strncpy(entryname,Xptr->d_name,Xptr->d_namlen);
+ entryname[Xptr->d_namlen] = '\0';
+ #endif /* DIROPS == USE_SYSDIR */
+
+ fullname = safe_strdup(v->u.canceldir->dirname);
+ fullname = strmcat(fullname,"/");
+ fullname = strmcat(fullname,entryname);
+
+ for (i = 0; i < v->u.canceldir->message_list_len; i++)
+ if ( 0 == strcmp(entryname,
+ v->u.canceldir->message_list[i].filename))
+ goto found;
+
+ fd = open(fullname,O_RDONLY);
+ if (fd < 0)
+ goto fail1;
+
+
+ if (-1 == fstat(fd,&X)) {
+ close(fd);
+ goto fail1;
+ }
+
+ if (X.st_uid != userid) {
+ /* Wrong owner */
+ close(fd);
+ goto fail1;
+ }
+
+ f1 = fdopen(fd,"r");
+ if (!f1) {
+ close(fd);
+ goto fail1;
+ }
+
+
+ h = file_read_headers(f1,RHL_CHECK_HEADER);
+ b = ftell(f1);
+
+ while (EOF != (c = getc(f1))) {
+ if ('\n' == c)
+ lines++;
+ }
+
+ add_canceled_mail1(entryname,
+ NULL,v,X.st_mtime,lines,h,b);
+
+
+ fail1:
+ if (h)
+ delete_headers(&h);
+
+ if (f1)
+ fclose(f1);;
+
+
+ found:
+ free(entryname);
+ free(fullname);
+ }
+ }
+
+ closedir(handle);
+
+ if (v == canceled_mail_view)
+ move_olds(v);
+
+ fail2:
+ if (unlock_it)
+ unlock_index(v);
+ }
+
+
+ #else
+ static void update_index(v)
+ struct MailboxView *v;
+ {
+ /* EMPTY */
+ }
+ #endif
+
+ /* Return 1 if redraw required */
+ S_(mt_update_view_mailbox mt_update_view_canceldir)
+ /* Return 1 if redraw required */
+ static int mt_update_view_canceldir P_((struct MailboxView *mailbox));
+ static int mt_update_view_canceldir(mailbox)
+ struct MailboxView *mailbox;
+ {
+ int count;
+ int i,x;
+
+ update_index(mailbox);
+
+ count = mailbox->u.canceldir->message_list_len;
+
+ if (count != mailbox->view_len) {
+
+ mt_make_canceldir_view(mailbox);
+
+ DPRINT(Debug,7,(&Debug,
+ "mt_update_view_canceldir=1 (%d messages)\n",
+ mailbox->view_len));


+
+ return 1;
+ }
+

+ DPRINT(Debug,7,(&Debug,
+ "mt_update_view_canceldir=0\n"));


+ return 0;
+ }
+

+ S_(mt_get_main_mailbox_folder mt_get_main_canceldir_folder)
+ static struct folder_info * mt_get_main_canceldir_folder P_((struct MailboxView *mailbox));
+ static struct folder_info * mt_get_main_canceldir_folder(mailbox)
+ struct MailboxView *mailbox;
+ {


+ return NULL;
+ }
+

+ /* Can be called from signal handler */
+ S_(mt_get_mailbox_storage mt_get_canceldir_storage)
+ /* Can be called from signal handler */
+ static struct current_storage * mt_get_canceldir_storage P_((struct MailboxView *mailbox,
+ int i));
+ /* Can be called from signal handler */
+ static struct current_storage * mt_get_canceldir_storage(mailbox,i)
+ struct MailboxView *mailbox;
+ int i;
+ {
+

+ return NULL;
+ }
+

+ /* Can be called from signal handler */
+ S_(mt_get_mailbox_storage_count mt_get_canceldir_storage_count)
+ /* Can be called from signal handler */
+ static int mt_get_canceldir_storage_count P_((struct MailboxView *mailbox));
+
+ /* Can be called from signal handler */
+ static int mt_get_canceldir_storage_count(mailbox)
+ struct MailboxView *mailbox;


+ {
+ return 1;
+ }
+

+ static int update_open P_((struct mv_canceldir *d, int idx));
+ static int update_open(d,idx)
+ struct mv_canceldir *d;
+ int idx;
+ {
+ if (d->last_open_index != idx &&
+ d->last_open_file) {
+
+ fclose(d->last_open_file);
+ d->last_open_file = NULL;
+ }
+
+ if (!d->last_open_file) {
+ char * filename = elm_message(FRM("%s/%s"),
+ d->dirname,
+ d->message_list[idx].
+ filename);
+
+ int err = can_open(filename,"r");
+ if (err) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantOpenFile,
+ "Can't open %s!"),
+ filename);
+ free(filename);


+ return 0;
+ }
+

+ d->last_open_file = fopen(filename,"r");
+ if (!d->last_open_file) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantOpenFile,
+ "Can't open %s!"),
+ filename);
+ free(filename);
+ return 0;
+ }
+ d->last_open_index = idx;
+ free(filename);
+
+ } else
+ rewind(d->last_open_file);


+
+ return 1;
+ }
+

+ static int update_header P_((struct mv_canceldir *d, int idx));
+ static int update_header(d,idx)
+ struct mv_canceldir *d;
+ int idx;
+ {
+ struct header_rec *hdr = & (d->message_list[idx].REC);
+
+ if (!update_open(d,idx)) {
+ DPRINT(Debug,10,(&Debug,"update_header: %d -- failed\n",
+ idx));


+
+ return 0;
+ }

+ if (! hdr->body_parsed) {
+ header_list_ptr parsed_headers =
+ file_read_headers(d->last_open_file,0);
+ long content_start;
+
+
+ if (!parsed_headers) {
+ DPRINT(Debug,3,(&Debug,
+ "update_header: No headers parsed! \n"));
+ }
+
+ read_folder_headers_helper(hdr,parsed_headers);
+ header_parse_helper(hdr,parsed_headers);
+
+ content_start = ftell(d->last_open_file);
+ start_body_helper(hdr,
+ content_start,parsed_headers);
+
+ delete_headers(&parsed_headers);
+
+ /* start_body_helper is called */
+ hdr->body_parsed = 1;
+
+ }
+
+ DPRINT(Debug,10,(&Debug,"update_header: %d -- OK\n",
+ idx));
+

+
+ return 1;
+ }
+
+

+ S_(mt_give_header_mailbox mt_give_header_canceldir)
+ static struct header_rec * mt_give_header_canceldir P_((struct MailboxView *mailbox,
+ int index,
+ struct folder_view *v));
+ static struct header_rec * mt_give_header_canceldir(mailbox,index,v)
+ struct MailboxView *mailbox;
+ int index;
+ struct folder_view *v;
+ {
+ int mbx,idx;
+
+ mbx = v->mailbox_number;
+ if (mbx != 0)


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "mt_give_header_canceldir",
+ "Bad mailbox number",0);
+
+ idx = v->index;
+ if (idx < 0 || idx >= mailbox->u.canceldir->message_list_len)


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "mt_give_header_canceldir",
+ "Bad internal index",0);
+
+
+ if (-1 == mailbox->u.canceldir->message_list[idx].
+ REC.mime_rec.begin_offset)
+ update_header(mailbox->u.canceldir,idx);
+
+ return & (mailbox->u.canceldir->message_list[idx].REC);
+
+ }
+
+ S_(sdt_give_header_s sdt_give_header_cm)
+ static struct header_rec * sdt_give_header_cm P_((struct sort_data *s,
+ struct folder_view *v));
+ static struct header_rec * sdt_give_header_cm(s,v)
+ struct sort_data *s;
+ struct folder_view *v;
+ {
+ return & (s->u.canceldir->message_list[v->index].REC);
+ }
+
+ static struct sort_data_type cm_sort = {
+ SORTDATATYPE_magic,
+ sdt_give_header_cm
+ };
+
+
+ S_(mt_sort_mailbox_view mt_sort_canceldir_view)
+ static void mt_sort_canceldir_view P_((struct MailboxView *mailbox,
+ hdr_compare_func *func));
+ static void mt_sort_canceldir_view(mailbox,func)
+ struct MailboxView *mailbox;
+ hdr_compare_func *func;
+ {
+ int i;
+ struct sort_data * array;
+
+ /* Little dirty ... */
+ typedef int (*compar) P_((const void *, const void *));
+ compar X = (compar) func;
+
+ array = safe_malloc(mailbox->view_len * sizeof (array[0]));
+
+ for (i = 0; i < mailbox->view_len; i++) {
+ int mbx = mailbox->view[i].mailbox_number;
+
+ array[i].w = mailbox->view[i];
+ array[i].sort_data_type = &cm_sort;
+ array[i].u.canceldir = mailbox->u.canceldir;
+
+ }
+
+ qsort(array,mailbox->view_len,sizeof (array[0]), X);
+
+ for (i = 0; i < mailbox->view_len; i++) {
+ mailbox->view[i] = array[i].w;
+ }
+
+ free(array);
+ }
+
+ /* XXX not good .... */
+
+ S_(mt_give_message_data_mailbox mt_give_message_data_canceldir)
+ static int mt_give_message_data_canceldir P_((struct MailboxView *mailbox,
+ int index,
+ struct header_rec **ret_header,
+ FILE **ret_F,
+ struct counter_data *counter,
+ parse_mime_callback *parse_mime,
+ struct folder_view *v));
+ static int mt_give_message_data_canceldir(mailbox,index,ret_header,ret_F,
+ counter,parse_mime,v)
+ struct MailboxView *mailbox;
+ int index;
+ struct header_rec **ret_header;
+ FILE **ret_F;
+ struct counter_data *counter;
+ parse_mime_callback *parse_mime;
+ struct folder_view *v;
+ {


+ struct header_rec *hdr;
+

+ int mbx,idx;
+
+ mbx = v->mailbox_number;
+ if (mbx != 0) {


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "mt_give_message_data_canceldir",
+ "Bad mailbox number",0);


+ return 0;
+ }
+

+ idx = v->index;
+ if (idx < 0 || idx >= mailbox->u.canceldir->message_list_len) {


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "mt_give_message_data_canceldir",
+ "Bad internal index",0);


+ return 0;
+ }
+

+ hdr = & (mailbox->u.canceldir->message_list[idx].REC);
+
+ /* hdr is also needed on error messages ... */
+ if (ret_header) {
+
+ if (-1 == hdr->mime_rec.begin_offset)
+ update_header(mailbox->u.canceldir,idx);
+ *ret_header = hdr;
+
+ DPRINT(Debug,10,(&Debug,"mt_give_message_data_canceldir: %d -- giving header\n",
+ idx));
+
+ }
+
+ if (ret_F) {
+
+ if (!update_header(mailbox->u.canceldir,idx)) {
+ DPRINT(Debug,6,(&Debug,"mt_give_message_data_canceldir: %d failed\n",
+ idx));


+ return 0;
+ }
+
+

+ /* Simulate prepare_message_access */
+
+ if (! hdr->mime_parsed &&
+ parse_mime == NO_mime_parse) {
+ DPRINT(Debug,10,(&Debug,
+ "mt_give_message_data_canceldir: mime structure not needed\n"));
+ } else if (! hdr->mime_parsed) {
+
+ int status;
+
+
+ DPRINT(Debug,10,(&Debug,
+ "mt_give_message_data_canceldir: Need parsing of mime structure (offset %ld)\n",
+ hdr->offset
+ ));
+
+ if (0 != fseek(mailbox->u.canceldir->last_open_file,
+ hdr->offset,
+ SEEK_SET)) {
+
+ DPRINT(Debug,10,(&Debug,
+ "mt_give_message_data_canceldir: seek to %ld failed\n",
+ hdr->offset));


+ return 0;
+ }
+

+ status = parse_mime(NULL,hdr,
+ mailbox->u.canceldir->last_open_file);
+ if (status <= 0) {
+ DPRINT(Debug,10,(&Debug,
+ "mt_give_message_data_canceldir: parse_mime callback failed (%d)\n",
+ status));


+ }
+
+
+
+ }

+
+ rewind(mailbox->u.canceldir->last_open_file);
+ *ret_F = mailbox->u.canceldir->last_open_file;
+
+ DPRINT(Debug,10,(&Debug,"mt_give_message_data_canceldir: %d -- giving file\n",


+ idx));
+
+ }
+

+ DPRINT(Debug,10,(&Debug,"mt_give_message_data_canceldir: %d -- succeed\n",
+ idx));


+
+ return 1;
+ }
+
+

+
+ S_(mt_write_mailbox_info mt_write_canceldir_info)
+ static void mt_write_canceldir_info P_((FILE *fp, struct MailboxView *mailbox,
+ int s, int cur_idx));
+ static void mt_write_canceldir_info(fp,mailbox,s, cur_idx)
+ FILE *fp;
+ struct MailboxView *mailbox;
+ int s;
+ int cur_idx;
+ {
+ /* EMPTY */
+ }
+
+ S_(mt_mailbox_title mt_canceldir_title)
+ static struct string * mt_canceldir_title P_((struct MailboxView *mailbox));
+ static struct string * mt_canceldir_title(mailbox)
+ struct MailboxView *mailbox;
+ {
+
+ if (canceled_mail_view == mailbox) {
+ if (*hostname && menu_display_host)
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmCanceledMailsOn,
+ "Canceled mails on %s"),
+ hostname);
+
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmCanceledMails,
+ "Canceled mails"));
+
+ }
+
+ /* These two should not really be used ... */
+
+ if (*hostname && menu_display_host)
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmMDirectoryOn,
+ "Message directory %s on %s"),
+ mailbox->u.canceldir->dirname,
+ hostname);
+
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmMDirectory,
+ "Message directory %s"),
+ mailbox->u.canceldir->dirname);
+
+ }
+
+ S_(mt_make_mailbox_view mt_make_canceldir_view)
+ static void mt_make_canceldir_view (mailbox)
+ struct MailboxView *mailbox;
+ {
+ int count = mailbox->u.canceldir->message_list_len;
+ int i,x;
+
+
+ if (count < 1) {
+ if (mailbox->view)
+ free(mailbox->view);
+ mailbox->view = NULL;
+ mailbox->view_len = 0;
+
+ return;
+ }
+
+ mailbox->view =
+ safe_realloc(mailbox->view,
+ count * (sizeof ( mailbox->view[0])));
+
+
+ for (x = 0; x < count; x++) {
+ mailbox->view[x].mailbox_number = 0;
+ mailbox->view[x].index = x;
+ }
+ mailbox->view_len = count;
+ }
+
+
+ S_(mt_add_mailbox_digest mt_add_canceldir_digest)
+ static void mt_add_canceldir_digest P_((struct MailboxView *mailbox,
+ mime_t *list,
+ time_t received_time,
+ char *env_from,
+ FILE *F,
+ charset_t defcharset
+ ));
+ static void mt_add_canceldir_digest(mailbox, list, received_time, env_from, F,
+ defcharset
+ )
+ struct MailboxView *mailbox;
+ mime_t *list;
+ time_t received_time;
+ char *env_from;
+ FILE *F;
+ charset_t defcharset;
+ {
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"mt_add_canceldir_digest",
+ "mt_add_canceldir_digest called",0);
+ }
+
+ struct mailbox_type mt_canceldir = {
+ MAILBOXTYPE_magic,
+ mt_init_canceldir,
+ mt_free_canceldir,
+ mt_add_canceldir_storage,
+ mt_update_view_canceldir,
+ mt_get_main_canceldir_folder,
+ mt_get_canceldir_storage,
+ mt_get_canceldir_storage_count,
+ mt_give_header_canceldir,
+ mt_sort_canceldir_view,
+ mt_give_message_data_canceldir,
+ mt_write_canceldir_info,
+ mt_canceldir_title,
+ mt_make_canceldir_view,
+ mt_add_canceldir_digest
+ };
+
+ /* ------------------------------------------------------------------------ */
+
+ static void index_initialize P_((struct MailboxView *view));
+
+ /* 1 == readed and locked, 0 = failure */
+ static int process_index(view)
+ struct MailboxView *view;
+ {
+
+ int count = 0;
+
+ int err = can_open(view->u.canceldir->indexname, "a");
+ int ret;
+ char buffer[20];
+
+ if (err) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantOpenFile,
+ "Can't open %s!"),
+ view->u.canceldir->indexname);


+ return 0;
+ }
+

+ view->u.canceldir->index_F =
+ open_or_create(view->u.canceldir->indexname);
+ if (!view->u.canceldir->index_F) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantOpenFile,
+ "Can't open %s!"),
+ view->u.canceldir->indexname);


+ return 0;
+ }
+
+

+ ret = Grab_the_file(fileno(view->u.canceldir->index_F));
+ if (FLOCKING_RETRY == ret) {
+ lib_transient(CATGETS(elm_msg_cat, MeSet, MeLockingFile,
+ "Locking %s..."),
+ view->u.canceldir->indexname);
+ while (FLOCKING_RETRY == ret && count++ < 3) {


+ #if POLL_METHOD
+ wait_for_timeout(1);
+ #else
+ sleep(1);
+ #endif

+ ret = Grab_the_file(fileno(view->u.canceldir->index_F));
+ }
+
+ if (FLOCKING_OK == ret)
+ lib_transient(CATGETS(elm_msg_cat, MeSet, MeLockingFileOK,
+ "Locking %s... OK."),
+ view->u.canceldir->indexname);
+
+ if (FLOCKING_RETRY == ret) {
+ fclose(view->u.canceldir->index_F);
+ view->u.canceldir->index_F = NULL;


+ return 0;
+ }
+ }
+

+ if (FLOCKING_FAIL == ret) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeLockingFileFAIL,
+ "Locking %s... Failed."),
+ view->u.canceldir->indexname);
+
+ fclose(view->u.canceldir->index_F);
+ view->u.canceldir->index_F = NULL;


+ return 0;
+ }
+

+ if ((ret = mail_gets(buffer, sizeof buffer,
+ view->u.canceldir->index_F)) > 0) {
+
+ struct message_list * current = NULL; /* current index */
+
+ if (ret != 12 || 0 != memcmp(buffer,"ELMME+ MIDX\n",12)) {
+
+ DPRINT(Debug,7,(&Debug,
+ "process_index: Bad bagic (len %d): %.*s\n",
+ ret,ret,buffer));
+
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileCorrupted,
+ "File %s is corrupted."),
+ view->u.canceldir->indexname);
+
+ Release_the_file(fileno(view->u.canceldir->index_F));
+
+ fclose(view->u.canceldir->index_F);
+ view->u.canceldir->index_F = NULL;


+
+ return 0;
+ }
+

+ /* malloc_gets reallocates buffer1 and do not return \n.
+ It returns -1 if line is longer than given limit (32000)
+ and -2 is returned on error (buffer may still be alloced)
+ */
+ while (!feof(view->u.canceldir->index_F) &&
+ !ferror(view->u.canceldir->index_F) &&
+ ret >= 0) {
+ char * buffer1 = NULL;
+
+ ret = malloc_gets(&buffer1, 32000, view->u.canceldir->index_F);
+ if (ret < 0 || !buffer1)
+ goto fail;
+
+ if (ret >= 2) {
+
+ if (strcmp("--END",buffer1) == 0) {
+ /* Temporary terminator */
+
+ ret = -2;
+ goto fail;
+ }
+
+
+ if (0 == strncmp(buffer1,"C ",2)) {
+ view->u.canceldir->cs =
+ MIME_name_to_charset(buffer1+2,0);
+ goto next_line;
+ }
+
+ if (!view->u.canceldir->cs ||
+ ' ' != buffer1[1]) {
+
+ DPRINT(Debug,7,(&Debug,
+ "process_index: Bad line (len %d): %.*s\n",
+ ret,ret,buffer1));
+
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileCorrupted,
+ "File %s is corrupted."),
+ view->u.canceldir->indexname);
+ ret = -1;
+ goto fail;
+ }
+
+ switch (buffer1[0]) {
+ case 'F': {
+ char * fname = buffer1+2;
+ int i;
+
+ current = NULL;
+
+ for (i = 0; i < view->u.canceldir->message_list_len; i++)
+ if (0 == strcmp(view->u.canceldir->message_list[i].
+ filename,fname)) {
+ current = & (view->u.canceldir->
+ message_list[i]);
+ DPRINT(Debug,7,(&Debug,
+ "process_index: File %s already on index (%d)\n",
+ fname,i));
+ }
+
+ if (!current) {
+ DPRINT(Debug,7,(&Debug,
+ "process_index: Adding file %s to index\n",
+ fname));
+
+ view->u.canceldir->message_list =
+ safe_realloc(view->u.canceldir->message_list,
+ (view->u.canceldir->message_list_len+1) *
+ sizeof (view->u.canceldir->message_list[0]));
+
+ current = & (view->u.canceldir->
+ message_list[view->u.canceldir->message_list_len++]);
+
+ header_zero( & (current->REC));
+
+ current->filename = safe_strdup(buffer1+2);
+
+
+ /* Charset used by index writing code... */
+ current->REC.header_charset = view->u.canceldir->cs;
+
+ current->REC.offset = 0;
+ }
+ }
+ break;
+
+ case 'L':
+ if (!current) goto bad0;
+ current->REC.lines = atoi(buffer1+2);
+ break;
+
+ case 'T':
+ if (!current) goto bad0;
+ current->REC.received_time = atol(buffer1+2);
+ break;
+
+ case 'E':
+ if (!current) goto bad0;
+ strfcpy(current->REC.env_from,buffer1+2,
+ sizeof (current->REC.env_from));
+ break;
+
+ case 'f':
+ if (!current) goto bad0;
+ if (current->REC.from)
+ break;
+ current->REC.from = break_down_address(buffer1+2,0,view->u.canceldir->cs);
+ break;
+
+ case 't':
+ if (!current) goto bad0;
+ if (current->REC.to)
+ break;
+ current->REC.to = break_down_address(buffer1+2,0,view->u.canceldir->cs);
+ break;
+
+ case 'c':
+ if (!current) goto bad0;
+ if (current->REC.cc)
+ break;
+ current->REC.cc = break_down_address(buffer1+2,0,view->u.canceldir->cs);
+ break;
+
+ case 'M':
+ if (!current) goto bad0;
+ strfcpy(current->REC.messageid,buffer1+2,
+ sizeof (current->REC.messageid));
+ break;
+
+ case 'd':
+ if (!current) goto bad0;
+ current->REC.time_sent = atol(buffer1+2);
+ break;
+
+ case 'S':
+ if (!current) goto bad0;
+ if (current->REC.subject)
+ break;
+ current->REC.subject = hdr_to_string(HDR_TEXT,
+ buffer1+2,
+ view->u.canceldir->cs,
+ 0);


+ break;
+
+ default:

+ bad0:
+
+ DPRINT(Debug,7,(&Debug,
+ "process_index: Bad line or token (len %d): %.*s\n",
+ ret,ret,buffer1));
+
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileCorrupted,
+ "File %s is corrupted."),
+ view->u.canceldir->indexname);
+ ret = -1;
+ goto fail;
+
+ }
+
+ } else if (0 != ret) {
+
+ DPRINT(Debug,7,(&Debug,
+ "process_index: short line (len %d): %.*s\n",
+ ret,ret,buffer1));
+
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileCorrupted,
+ "File %s is corrupted."),
+ view->u.canceldir->indexname);
+ ret = -1;
+ } else
+ current = NULL;
+
+
+ next_line:
+ fail:
+
+ if (buffer1) {
+ free(buffer1);
+ buffer1 = NULL;
+ }
+
+ }
+
+
+
+ } else {
+ /* Initialize file */
+
+ index_initialize(view);
+ }


+
+ return 1;
+
+ }
+

+
+ static void setup_canceldir P_((struct MailboxView *view, char *dir));
+ static void setup_canceldir(view,dir)
+ struct MailboxView *view;
+ char *dir;
+ {
+ if (&mt_canceldir!= view->mailbox_type)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"setup_canceldir",
+ "Bad type for canceldir view",0);
+
+ if (view->u.canceldir->dirname ||
+ view->u.canceldir->indexname ||
+ view->u.canceldir->index_F)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"setup_canceldir",
+ "canceldir view already set up",0);
+
+ DPRINT(Debug,8,(&Debug,
+ "setup_canceldir(view=%p,dir=%s)\n",
+ view,dir));
+
+ if (dir[0]) {
+ int err,ret;
+ char buffer[30];
+
+ view->u.canceldir->dirname = safe_strdup(dir);
+
+ view->u.canceldir->indexname =
+ elm_message(FRM("%s/.index"),dir);
+
+ /* Is directory created yet ? */
+ if (access(dir, WRITE_ACCESS) < 0) {


+ int err = errno;
+

+ if (ENOENT == err)
+ return;
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmErrorAccess,
+ "%.45s: %.33s"),
+ dir,error_description(err));
+
+ return;
+ }
+
+ process_index(view);
+ }
+ }
+
+ static struct addr_item *dup_addr_list P_((struct addr_item *list));
+ static struct addr_item *dup_addr_list(list)
+ struct addr_item *list;
+ {
+ int L = 0;
+ struct addr_item *ptr;
+ int i;
+
+ for (ptr=list; ptr->addr && ptr->fullname; ptr++)
+ L++;
+
+
+ ptr = safe_malloc((L+1) * sizeof (ptr[0]));
+
+ for (i = 0; i < L; i++) {
+ ptr[i].addr = safe_strdup(list[i].addr);
+ ptr[i].fullname = dup_string(list[i].fullname);
+ ptr[i].comment = NULL;
+ if (list[i].comment)
+ ptr[i].comment = dup_string(list[i].comment);
+ }
+
+ ptr[i].addr = NULL;
+ ptr[i].fullname = NULL;
+ ptr[i].comment = NULL;
+
+ return ptr;
+ }
+
+ static void write_addr_list P_((FILE *F, struct addr_item *list,
+ charset_t cs, int letter));
+ static void write_addr_list(F,list,cs,letter)
+ FILE *F;
+ struct addr_item *list;
+ charset_t cs;
+ int letter;
+ {
+ struct addr_item *ptr;
+
+ putc(letter,F);
+ putc(' ',F);
+
+ for (ptr=list; ptr->addr && ptr->fullname; ptr++) {
+ char * buffer;
+
+ if (ptr != list) {
+ putc(',',F);
+ putc(' ',F);
+ }
+
+ buffer = string_to_hdr(HDR_PHRASE, ptr->fullname,
+ cs, 0);
+
+ if (buffer) {
+ fputs(buffer,F);
+ putc(' ',F);
+ free(buffer);
+ }
+
+ putc('<',F);
+ fputs(ptr->addr,F);
+ putc('>',F);
+
+ if (ptr->comment) {
+ buffer = string_to_hdr(HDR_COMMENT, ptr->comment,
+ cs, 0);
+
+ if (buffer) {
+ putc(' ',F);
+ putc('(',F);
+ fputs(buffer,F);
+ putc(')',F);
+
+ free(buffer);
+ }
+ }
+ }
+ putc('\n',F);
+ }
+
+ static void write_index_rec P_((struct MailboxView *view,
+ struct message_list * current));
+
+ static void write_index_rec(view,current)
+ struct MailboxView *view;
+ struct message_list * current;
+ {
+ fprintf(view->u.canceldir->index_F,
+ "F %s\n",
+ current->filename);
+
+ if (current->REC.lines >= 0) {
+ fprintf(view->u.canceldir->index_F,"L %d\n",
+ current->REC.lines);
+ }
+
+ fprintf(view->u.canceldir->index_F,
+ "T %d\n",
+ current->REC.received_time);
+
+ fprintf(view->u.canceldir->index_F,
+ "d %d\n",
+ current->REC.time_sent);
+
+ if (current->REC.env_from[0]) {
+ fprintf(view->u.canceldir->index_F,
+ "E %s\n",
+ current->REC.env_from);
+ }
+
+ if (current->REC.from) {
+ write_addr_list(view->u.canceldir->index_F,
+ current->REC.from,
+ view->u.canceldir->cs,'f');
+ }
+
+ if (current->REC.to) {
+ write_addr_list(view->u.canceldir->index_F,
+ current->REC.to,
+ view->u.canceldir->cs,'t');
+ }
+
+ if (current->REC.cc) {
+ write_addr_list(view->u.canceldir->index_F,
+ current->REC.cc,
+ view->u.canceldir->cs,'c');
+ }
+
+ if (current->REC.messageid[0]) {
+ fprintf(view->u.canceldir->index_F,
+ "M %s\n",
+ current->REC.messageid);
+ }
+
+ if (current->REC.subject) {
+ char * s = string_to_hdr(HDR_TEXT,current->REC.subject,
+ view->u.canceldir->cs,0);
+ fprintf(view->u.canceldir->index_F,
+ "S %s\n",
+ s);
+ free(s);
+ }
+ }
+
+ static void add_canceled_mail1(filename,headers,view,X,lines,h,
+ body_offset)
+ char *filename;
+ struct mailing_headers * headers;
+ struct MailboxView *view;
+ time_t X;
+ int lines;
+ header_list_ptr h;
+ long body_offset;
+ {
+ struct message_list * current = NULL; /* current index */
+
+ view->u.canceldir->message_list =
+ safe_realloc(view->u.canceldir->message_list,
+ (view->u.canceldir->message_list_len+1) *
+ sizeof (view->u.canceldir->message_list[0]));
+
+ current = & (view->u.canceldir->
+ message_list[view->u.canceldir->message_list_len++]);
+
+
+ current->filename = safe_strdup(filename);
+ header_zero( & (current->REC));
+
+ /* Dummy default ... */
+ current->REC.header_charset = view->u.canceldir->cs;
+ /* read_folder_headers_helper() will re-set header_charset
+ if it sees X-ELM-OSV header with parameter
+ hdr-charset
+ */
+
+ /* Start of headers */
+ current->REC.offset = 0;
+ current->REC.mime_rec.begin_offset = 0;
+
+ /* Start of body */
+ if (body_offset >= 0L)
+ current->REC.mime_rec.begin_offset = body_offset;
+
+ if (lines >= 0)
+ current->REC.lines = lines;
+ current->REC.received_time = X;
+ current->REC.time_sent = X;
+
+ if (h) {
+
+ /* Parses Return-Path, Message-Id, Content-Length,
+ Date, MIME-Version, X-ELM-OSV
+ */
+ read_folder_headers_helper(& (current->REC), h);
+
+ /* Parses Sensitivity, Importance, Priority,
+ Action, Content-Type, Status,
+ Subject, From, To, Cc
+
+ And X-IMAP is used on message-hide-hack
+ */
+ header_parse_helper(& (current->REC), h);
+ }
+
+ if (headers && headers->env_from &&
+ ! current->REC.env_from[0]) {
+ int x;
+ CONST char * t = mailer_env_from_value(headers->env_from,&x);
+ strfcpy(current->REC.env_from,t,
+ sizeof (current->REC.env_from));
+ }
+
+ if (headers && headers->from.addrs &&
+ ! current->REC.from) {
+ current->REC.from = dup_addr_list(headers->from.addrs);
+ }
+
+ if (headers && headers->to.addrs &&
+ ! current->REC.to) {
+ current->REC.to = dup_addr_list(headers->to.addrs);
+ }
+
+ if (headers && headers->cc.addrs &&
+ ! current->REC.cc) {
+ current->REC.cc = dup_addr_list(headers->cc.addrs);
+ }
+
+ if (headers && headers->subject &&
+ ! current->REC.subject)
+ current->REC.subject = dup_string(headers->subject);
+
+ write_index_rec(view,current);
+ }
+
+ void delete_marked_canceled_mails(view)
+ struct MailboxView *view;
+ {
+ int i;
+ struct mv_canceldir *d;
+
+ if (&mt_canceldir!= view->mailbox_type)


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "delete_marked_canceled_mails",
+ "Bad type for canceldir view",0);
+
+ d = view->u.canceldir;
+
+ /* DO not remove data from index on here!
+ because it confuses canceled mail selection
+ */
+
+ if (! d->dirname)
+ return;
+
+ for (i = 0; i < d->message_list_len; i++) {
+ if (ison(d->message_list[i].REC.status,
+ DELETED)) {
+ char * filename = elm_message(FRM("%s/%s"),
+ d->dirname,
+ d->message_list[i].
+ filename);
+
+
+ if (0 == unlink(filename)) {
+ DPRINT(Debug,7,(&Debug,
+ "Removed canceled mail [%d]: %s\n",
+ i,filename));
+
+ }
+
+ free(filename);
+ }
+ }
+ }
+
+ static void index_initialize(view)
+ struct MailboxView *view;
+ {
+ /* Initialize file */
+
+ rewind(view->u.canceldir->index_F);
+
+ #ifdef FTRUNCATE
+ ftruncate(fileno(view->u.canceldir->index_F),0);
+ #endif
+
+ fprintf(view->u.canceldir->index_F,
+ "ELMME+ MIDX\n");
+
+ view->u.canceldir->cs =
+ MIME_name_to_charset("UTF-8",0);
+ if (view->u.canceldir->cs &&
+ view->u.canceldir->cs->MIME_name)
+ fprintf(view->u.canceldir->index_F,
+ "C %s\n",
+ view->u.canceldir->cs->MIME_name);
+
+ fflush(view->u.canceldir->index_F);
+ }
+
+
+
+ void sync_canceled_mails(view)
+ struct MailboxView *view;
+ {
+ /* Rewrites index if needed */
+
+ int i,X;
+ int unlock_it = 0;
+ struct mv_canceldir *d;
+
+
+ if (&mt_canceldir!= view->mailbox_type)


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "sync_canceled_mails",
+ "Bad type for canceldir view",0);
+
+ d = view->u.canceldir;
+
+ if (! d->dirname ||
+ ! d->indexname) {
+ return;
+ }
+
+ if (!view->u.canceldir->index_F) {
+ if (! process_index(view))
+ return;
+
+ unlock_it++;
+ }
+
+
+ for (i = 0, X=0; i < d->message_list_len; i++) {
+
+ char * filename = elm_message(FRM("%s/%s"),
+ d->dirname,
+ d->message_list[i].
+ filename);
+
+ if (0 != access(filename,ACCESS_EXISTS)) {
+ DPRINT(Debug,7,(&Debug,
+ "[%d] not exists, removing from index: %s\n",
+ i,filename));
+
+
+ header_clear(& (d->message_list[i].REC));
+ free(d->message_list[i].filename);
+ d->message_list[i].filename = NULL;
+
+ } else {
+ if (X < i) {
+ d->message_list[X] = d->message_list[i];
+
+ /* Avoid double pintters */
+ header_zero(& (d->message_list[i].REC));
+ d->message_list[i].filename = NULL;
+ }
+ X++;
+ }
+
+ free(filename);
+ }
+
+ if (X < d->message_list_len) {
+
+ long pos;
+
+
+ DPRINT(Debug,7,(&Debug,
+ "Canceled mails reduced %d => %d\n",
+ d->message_list_len,X));
+
+ d->message_list_len = X;
+
+ index_initialize(view);
+
+ /* Write records */
+
+ for (i = 0; i < d->message_list_len; i++) {
+
+ write_index_rec(view,& (d->message_list[i]));
+
+ }
+
+ mt_make_canceldir_view(view);
+
+ pos = ftell(view->u.canceldir->index_F);
+
+ /* Temporary terminator */
+ fprintf(view->u.canceldir->index_F,"--END\n");
+
+ /* Set position so that next appended index overwrites this */
+ fseek(view->u.canceldir->index_F,pos,SEEK_SET);
+
+ }
+
+ if (unlock_it)
+ unlock_index(view);
+ }
+
+
+ FILE * add_canceled_mail P_((char **outfile,


+ struct mailing_headers * headers,

+ struct MailboxView *view,
+ time_t X,
+ int lines,
+ header_list_ptr h,
+ long body_offset));
+ FILE * add_canceled_mail(outfile,headers,view, X, lines,h,body_offset)
+ char **outfile;
+ struct mailing_headers * headers;
+ struct MailboxView *view;
+ time_t X;
+ int lines;
+ long body_offset;
+ header_list_ptr h;
+ {
+ int i;
+ FILE *ret = NULL;
+
+ int unlock_it = 0;
+
+ if (&mt_canceldir!= view->mailbox_type)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"add_canceled_mail",
+ "Bad type for canceldir view",0);
+
+
+ if (!view->u.canceldir->dirname ||
+ !view->u.canceldir->indexname ||
+ !view->u.canceldir->cs){
+
+ DPRINT(Debug,7,(&Debug,
+ "add_canceled_mail=NULL -- not setup\n"));
+
+ return NULL;
+ }
+
+ if (!view->u.canceldir->index_F) {
+ if (! process_index(view))
+ return NULL;
+
+ unlock_it++;
+ }
+
+ for (i = view->u.canceldir->message_list_len;
+ i < view->u.canceldir->message_list_len+100;
+ i++) {
+ int fd;
+
+ if (*outfile)
+ free(*outfile);
+
+ *outfile = elm_message(FRM("%s/%05d-%02d.%s"),
+ view->u.canceldir->dirname,
+ (int)(X/(24*60*60)),
+ i,
+ dead_letter);;
+
+ fd = open(*outfile, O_WRONLY | O_CREAT | O_EXCL, 0600);
+ if (fd < 0) {
+ DPRINT(Debug,7,(&Debug,
+ "add_canceled_mail: %d -- %s creation failed\n",
+ i,*outfile));
+ continue;
+ }
+ ret = fdopen(fd, "w");
+
+ if (!ret) {
+
+ close(fd);
+ goto fail;
+ }
+ DPRINT(Debug,7,(&Debug,
+ "add_canceled_mail: Created %s\n",
+ *outfile));
+ break;
+ }
+
+ if (ret) {
+ char *x = strrchr(*outfile,'/');
+
+ if (!x)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"add_canceled_mail",
+ "NO / on generated name",0);
+
+ add_canceled_mail1(x+1,headers,view,X,lines,h,body_offset);
+
+ } else {
+ DPRINT(Debug,7,(&Debug,
+ "add_canceled_mail: failed to create mail\n"));
+
+ }
+
+ fail:
+ if (!ret) {
+ if (*outfile)
+ free(*outfile);
+ *outfile = NULL;
+ }
+
+ if (unlock_it)
+ unlock_index(view);
+
+
+ DPRINT(Debug,7,(&Debug,
+ "add_canceled_mail=%p\n",ret));
+
+ return ret;
+ }
+
+ static void move_olds(view)
+ struct MailboxView *view;


+ {
+ int i;
+

+ for (i = 0; i < 100; i++) {
+ char *lbuf1;
+ long b;
+ int fd;
+ struct stat stat_buf;
+ FILE *f1,*f2;
+ header_list_ptr h = NULL;
+ int lines = 0,c;
+ char *newname = NULL;
+
+ if (0 == i)
+ lbuf1 = elm_message(FRM("%s/%s"),
+ home,dead_letter);
+ else
+ lbuf1 = elm_message(FRM("%s/%02d.%s"),
+ home,i,dead_letter);
+
+
+ fd = open(lbuf1,O_RDONLY);
+
+ if (fd < 0) {
+ DPRINT(Debug,7,(&Debug,
+ "move_olds - copy %d: no file %s\n",
+ i,lbuf1));
+
+ free(lbuf1);
+ if (i > 1)
+ break;
+ continue;
+ }
+
+ if (-1 == fstat(fd,&stat_buf)) {
+ close(fd);
+ free(lbuf1);
+ continue;
+
+ }
+
+ if (stat_buf.st_uid != userid) {
+ /* Wrong owner */
+ close(fd);
+ free(lbuf1);


+ continue;
+ }
+
+ if (

+ #ifdef S_ISREG
+ ! S_ISREG(stat_buf.st_mode)
+ #else
+ S_IFREG != (stat_buf.st_mode & S_IFMT)
+ #endif
+ ) {
+ /* Wrong type */
+ close(fd);
+ free(lbuf1);
+ continue;
+ }
+
+ f1 = fdopen(fd,"r");
+ if (!f1) {
+ close(fd);
+ free(lbuf1);
+ continue;
+ }
+
+ h = file_read_headers(f1,RHL_CHECK_HEADER);
+
+ b = ftell(f1);
+
+ while (EOF != (c = getc(f1))) {
+ if ('\n' == c)
+ lines++;
+ }
+
+ f2 = add_canceled_mail(&newname,NULL,
+ view,
+ stat_buf.st_mtime,lines,h,b);
+ if (f2) {
+
+ rewind(f1);
+
+ if (0 != rename(lbuf1,newname)) {
+ while (EOF != (c = getc(f1))) {
+ putc(c,f2);
+ }
+
+ if (0 == fflush(f2) &&
+ !ferror(f1) &&
+ !ferror(f1)) {
+
+ DPRINT(Debug,7,(&Debug,
+ "give_canceled_mail - copy %d: copied %s to %s\n",
+ i,lbuf1,newname));
+
+
+ unlink(lbuf1);
+ }
+ } else {
+ DPRINT(Debug,7,(&Debug,
+ "give_canceled_mail - copy %d: renamed %s to %s\n",
+ i,lbuf1,newname));
+ }
+ fclose(f2);
+ }
+
+ if (h)
+ delete_headers(&h);
+
+ if (newname)
+ free(newname);
+
+
+ fclose(f1);
+ free(lbuf1);


+
+ }
+
+ }
+

+
+ struct MailboxView *give_canceled_mail()
+ {
+
+ char *t = give_dt_estr_as_str(&dead_letter_dir_e,"dead-letter-dir");
+
+ if (!canceled_mail_view) {
+
+ if (!t) {
+ DPRINT(Debug,7,(&Debug,
+ "give_canceled_mail=NULL: no dead-letter-dir\n"));
+ return NULL;
+ }
+ canceled_mail_view = give_canceldir();
+
+ setup_canceldir(canceled_mail_view,t);
+ }
+
+ if (&mt_canceldir!= canceled_mail_view->mailbox_type)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"give_canceled_mail",
+ "Bad type for canceled_mail_view",0);
+
+
+
+ if (t && 0 == mkdir(t,0700)) {
+ int i;
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmDeadLetterDirCreated,
+ "\"dead-letter-dir\" %s created."),
+ t);
+
+ /* Try again create index file .... */
+ if (canceled_mail_view->u.canceldir->indexname &&
+ ! canceled_mail_view->u.canceldir->index_F) {
+ if (!process_index(canceled_mail_view))
+ goto XX;
+ }
+
+ move_olds(canceled_mail_view);
+
+ } else if (EEXIST == errno) {
+ DPRINT(Debug,7,(&Debug,
+ "give_canceled_mail: %s exists already\n",
+ t));
+
+ move_olds(canceled_mail_view);
+ }
+
+ update_index(canceled_mail_view);
+
+ XX:
+
+ mt_make_canceldir_view(canceled_mail_view);
+
+ unlock_index(canceled_mail_view);
+
+ DPRINT(Debug,7,(&Debug,
+ "give_canceled_mail=%p\n",
+ canceled_mail_view));
+
+ return canceled_mail_view;
+ }
+
+ void close_canceled_mail()
+ {
+
+ if (canceled_mail_view) {
+ /* NOTE: Can not call
+ free_mailbox(& (canceled_mail_view)));
+ because
+ mt_free_canceldir
+ will reset canceled_mail_view
+ */
+
+ struct MailboxView *a = canceled_mail_view;
+
+ sync_canceled_mails(a);
+
+ free_mailbox (&a);
+
+ if (canceled_mail_view)


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "close_canceled_mail",
+ "canceled_mail_view not resetted",0);
+
+ }
+ }
+
+ /* HACK -- return 1 on succeed, 0 on failure */
+ int cancel_set_current(cancel_view,last_canceled_mail)


+ struct MailboxView * cancel_view;

+ char *last_canceled_mail;
+ {
+ int x;
+ char * D = last_canceled_mail;
+
+ if (&mt_canceldir!= cancel_view->mailbox_type)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"cancel_set_current",
+ "Bad type for cancel_view",0);
+
+ if (cancel_view->u.canceldir->dirname) {
+ int L = strlen(cancel_view->u.canceldir->dirname);
+
+ if (0 == strncmp(D,cancel_view->u.canceldir->dirname,L) &&
+ '/' == D[L]) {
+
+ DPRINT(Debug,7,(&Debug,
+ "cancel_set_current: Filename %s have dirname as prefix, good ",
+ D));
+
+ D += L+1;
+ DPRINT(Debug,7,(&Debug,"=> %s\n",
+ D));
+ }
+
+ }
+
+ for (x = 0; x < cancel_view->view_len; x++) {
+ int n;
+
+ if (0 != cancel_view->view[x].mailbox_number)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"cancel_set_current",
+ "Bad internal mailbox number",0);
+ n = cancel_view->view[x].index;
+ if (n < 0 || n >= cancel_view->u.canceldir->message_list_len)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"cancel_set_current",
+ "Bad internal index",0);
+
+ if (0 == strcmp(cancel_view->u.canceldir->message_list[n].filename,
+ D)) {
+ DPRINT(Debug,7,(&Debug," Found filename %s internal index %d view index %d\n",
+ D,n,x));
+
+ /* NOTE: Caller uses current == view_index +1 */
+ cancel_view->current = x+1;


+ return 1;
+ }
+
+ }

+
+
+ DPRINT(Debug,7,(&Debug,"cancel_set_current: Filename %s not found\n",
+ D));


+ return 0;
+ }
+

+ /* HACK -- delete curently open file */
+
+ void delete_current_cancel(cancel_view,ref_file)


+ struct MailboxView * cancel_view;

+ FILE *ref_file;
+ {
+ int idx;
+ char *filename = NULL;
+
+ if (&mt_canceldir!= cancel_view->mailbox_type)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"cancel_set_current",
+ "delete_current_cancel",0);
+
+ if (! cancel_view->u.canceldir->last_open_file
+ || ref_file != cancel_view->u.canceldir->last_open_file) {
+ DPRINT(Debug,3,(&Debug,
+ "delete_current_cancel: referenced file not currently open\n"));
+ return;
+ }
+ idx = cancel_view->u.canceldir->last_open_index;
+
+ if (idx < 0 || idx >= cancel_view->u.canceldir->message_list_len)


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "delete_current_cancel",
+ "Bad internal index",0);
+
+ filename = elm_message(FRM("%s/%s"),
+ cancel_view->u.canceldir->dirname,
+ cancel_view->u.canceldir->message_list[idx].
+ filename);
+ if (0 == unlink(filename)) {
+ DPRINT(Debug,3,(&Debug,
+ "delete_current_cancel: [%d] %s deleted\n",
+ idx,filename));
+ }
+ free(filename);
+ }


+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.119-cvs/src/messages/def_messages.h
*** elm2.4.ME+.118/src/messages/def_messages.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/messages/def_messages.h 2004-07-27 23:25:03.000000000 +0300
***************
*** 1,4 ****
! /* $Id: def_messages.h,v 1.7 2004/06/18 20:40:56 hurtta Exp $ */

#include "headers.h"
#include "me.h"
--- 1,10 ----
! /* $Id: def_messages.h,v 1.8 2004/07/27 20:25:03 hurtta Exp $ */
!
! /******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $

! *
! * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
! *****************************************************************************/



#include "headers.h"
#include "me.h"
***************

*** 43,56 ****
struct folder_view *v));


- /* This is not good ... */
- typedef int mt_give_message_folder_mailbox P_((struct MailboxView *mailbox,
- int index,
- struct header_rec **ret_header,
- struct folder_info **ret_folder,
- struct counter_data *counter,
- parse_mime_callback *parse_mime,
- struct folder_view *v));
typedef void mt_write_mailbox_info P_((FILE *fp, struct MailboxView *mailbox,
int s, int cur_idx));
typedef struct string * mt_mailbox_title P_((struct MailboxView *mailbox));
--- 49,54 ----
***************
*** 76,87 ****
mt_give_header_mailbox * mt_give_header_it;
mt_sort_mailbox_view * mt_sort_it_view;
mt_give_message_data_mailbox * mt_give_message_data_it;
- mt_give_message_folder_mailbox * mt_give_message_folder_it;
mt_write_mailbox_info * mt_write_it_info;
mt_mailbox_title * mt_it_title;
mt_make_mailbox_view * mt_make_it_view;
mt_add_mailbox_digest * mt_add_it_digest;
! } mt_storage, mt_digest, mt_partial;

#define MAILBOXTYPE_magic 0xF502

--- 74,84 ----
mt_give_header_mailbox * mt_give_header_it;
mt_sort_mailbox_view * mt_sort_it_view;
mt_give_message_data_mailbox * mt_give_message_data_it;
mt_write_mailbox_info * mt_write_it_info;
mt_mailbox_title * mt_it_title;
mt_make_mailbox_view * mt_make_it_view;
mt_add_mailbox_digest * mt_add_it_digest;
! } mt_storage, mt_digest, mt_partial, mt_canceldir;

#define MAILBOXTYPE_magic 0xF502

***************
*** 107,112 ****
--- 104,111 ----

} * partial;

+ struct mv_canceldir * canceldir;
+
void * dummy;
} u;

***************
*** 141,150 ****
--- 140,152 ----
struct current_storage *mbx;
struct current_digest *dgt;
struct partial_sort *part;
+ struct mv_canceldir *canceldir;
void *dummy;
} u;
};

+ extern struct MailboxView *give_canceldir P_((void));


+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.119-cvs/src/messages/digest.c
*** elm2.4.ME+.118/src/messages/digest.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/messages/digest.c 2004-07-27 23:25:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.11 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: digest.c,v 1.12 2004/07/27 20:25:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 304,372 ****
return 1;
}

- /* This is not good ... */
- S_(mt_give_message_folder_mailbox mt_give_message_folder_digest)
- /* This is not good ... */
- static int mt_give_message_folder_digest P_((struct MailboxView *mailbox,
- int index,
- struct header_rec **ret_header,
- struct folder_info **ret_folder,
- struct counter_data *counter,
- parse_mime_callback *parse_mime,
- struct folder_view *v));
- /* This is not good ... */
- static int mt_give_message_folder_digest(mailbox,index,ret_header,ret_folder,
- counter,parse_mime,v)
- struct MailboxView *mailbox;
- int index;
- struct header_rec **ret_header;
- struct folder_info **ret_folder;
- struct counter_data *counter;
- parse_mime_callback *parse_mime;
- struct folder_view *v;
- {
- struct header_rec *hdr;
-
- int mbx,idx;
-
- mbx = v->mailbox_number;
-
- if (mbx < 0 || mbx >= mailbox->u.digest->digest_count ||
- ! mailbox->u.digest->the_digest ||
- ! mailbox->u.digest->the_digest[mbx]) {
- panic("MBX VIEW PANIC",__FILE__,__LINE__,
- "mt_give_message_folder_digest",
- "bad mailbox number",0);
- return 0;
- }
- idx = v->index;
-
- if (idx < 0 ||
- idx >= mailbox->u.digest->the_digest[mbx]->message_count ||
- ! mailbox->u.digest->the_digest[mbx]->headers ||
- ! mailbox->u.digest->the_digest[mbx]->headers[idx]) {
- panic("MBX VIEW PANIC",__FILE__,__LINE__,
- "mt_give_message_folder_digest",
- "bad internal index",0);


- return 0;
- }
-

- hdr = mailbox->u.digest->the_digest[mbx]->headers[idx];
-
- /* hdr is also needed on error messages ... */
- if (ret_header)
- *ret_header = hdr;
-
- if (ret_folder) { /* NOT supported */
-
- DPRINT(Debug,10,(&Debug,
- "mt_give_message_folder_digest: not supported\n"));


-
- return 0;
- }
-

- return 1;
- }

S_(mt_write_mailbox_info mt_write_digest_info)
static void mt_write_digest_info P_((FILE *fp, struct MailboxView *mailbox,
--- 304,309 ----
***************
*** 764,770 ****
mt_give_header_digest,
mt_sort_digest_view,
mt_give_message_data_digest,
- mt_give_message_folder_digest,
mt_write_digest_info,
mt_digest_title,
mt_make_digest_view,
--- 701,706 ----
Index: elm2.4.ME+.119-cvs/src/messages/Makefile.SH
*** elm2.4.ME+.118/src/messages/Makefile.SH 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/messages/Makefile.SH 2004-07-27 23:25:03.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.6 2004/06/18 20:40:56 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----

echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.7 2004/07/27 20:25:03 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************
*** 43,49 ****
SHELL = /bin/sh

OBJ = messages.o header_alloc.o storage.o digest.o \
! partial.o

all: Makefile libmessages.a

--- 43,49 ----
SHELL = /bin/sh

OBJ = messages.o header_alloc.o storage.o digest.o \

! partial.o canceled_mail.o

all: Makefile libmessages.a

***************
*** 81,86 ****
--- 81,87 ----

messages.o: def_messages.h
header_alloc.o: def_messages.h
+ canceled_mail.o: def_messages.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h
storage.o: def_messages.h $(INCLDIR)/s_elm.h
digest.o: def_messages.h $(INCLDIR)/s_elm.h
partial.o: def_messages.h $(INCLDIR)/s_me.h
Index: elm2.4.ME+.119-cvs/src/messages/messages.c
*** elm2.4.ME+.118/src/messages/messages.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/messages/messages.c 2004-07-27 23:25:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: messages.c,v 1.14 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: messages.c,v 1.16 2004/07/27 20:25:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 10,17 ****

DEBUG_VAR(Debug,__FILE__,"messages");

- struct MailboxView * current_mailbox = NULL;
-
#define MAILBOXVIEW_magic 0xF500

static struct MailboxView ** mailbox_list = NULL;
--- 10,15 ----
***************
*** 58,63 ****
--- 56,63 ----


static struct MailboxView * malloc_view(t)
struct mailbox_type *t;
{

+ int idx;
+

struct MailboxView *ret, **X;

ret = safe_malloc(sizeof (*ret));
***************

*** 82,91 ****

ret->mailbox_type->mt_init_it(ret);



X = safe_realloc(mailbox_list,(mailbox_list_len+1)* sizeof (*X));

! X[mailbox_list_len] = ret;
mailbox_list = X;
! mailbox_list_len++;

return ret;
}
--- 82,107 ----

ret->mailbox_type->mt_init_it(ret);

+ for (idx = 0; idx < mailbox_list_len; idx++)
+ if (!mailbox_list[idx]) {
+ DPRINT(Debug,7,(&Debug,
+ "malloc_view: Re-using mailbox index %d\n",


+ idx));
+ goto found;
+ }

+
X = safe_realloc(mailbox_list,(mailbox_list_len+1)* sizeof (*X));

! X[mailbox_list_len] = NULL;
mailbox_list = X;
! idx = mailbox_list_len++;
!
! DPRINT(Debug,7,(&Debug,
! "malloc_view: Allocing new mailbox index %d\n",
! idx));
!
!
! found:
! mailbox_list[idx] = ret;

return ret;
}
***************
*** 103,108 ****
--- 119,131 ----
return ret;
}

+ struct MailboxView *give_canceldir()
+ {
+ struct MailboxView *ret = malloc_view(&mt_canceldir);


+
+ return ret;
+ }
+

struct MailboxView * digest_to_mailbox_view(list,received_time,env_from,F,
defcharset)
mime_t *list;
***************
*** 185,191 ****
--- 208,237 ----
env_from,F, defcharset);
}

+ static void free_mailbox1 P_((struct MailboxView **mailbox));
+
+ static void free_mailbox1(mailbox)
+ struct MailboxView **mailbox;
+ {
+ if ((*mailbox)->mailbox_type->magic != MAILBOXTYPE_magic)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox1",
+ "Bad type magic number",0);
+
+ (*mailbox)->mailbox_type->mt_free_it(*mailbox);
+
+ if ((*mailbox)->mailbox_title)
+ free_string (& ((*mailbox)->mailbox_title));

+ if ((*mailbox)->view) {
+ free((*mailbox)->view);
+ (*mailbox)->view = NULL;
+ }
+ (*mailbox)->view_len = 0;
+
+ (*mailbox)->magic = 0; /* Invalidate */
+ free(*mailbox);
+ *mailbox = NULL;


+ }

void free_mailbox(mailbox)
struct MailboxView **mailbox;

***************
*** 196,207 ****


panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox",
"Bad magic number",0);

- if ((*mailbox)->mailbox_type->magic != MAILBOXTYPE_magic)
- panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox",
- "Bad type magic number",0);
-

for ( i = 0; i < mailbox_list_len; i++) {

if (mailbox_list[i] == *mailbox) {

mailbox_list[i] = NULL;
goto okei;
}
--- 242,254 ----


panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox",

"Bad magic number",0);



for ( i = 0; i < mailbox_list_len; i++) {

if (mailbox_list[i] == *mailbox) {
+

+ SIGDPRINT(Debug,7,(&Debug,
+ "free_mailbox: Mailbox index %d goes free\n",
+ i));


+
mailbox_list[i] = NULL;

goto okei;
}
***************
*** 211,236 ****


"mailbox not found from list",0);

okei:
! (*mailbox)->mailbox_type->mt_free_it(*mailbox);
!
! if ((*mailbox)->mailbox_title)
! free_string (& ((*mailbox)->mailbox_title));
!
! if ((*mailbox)->view) {
! free((*mailbox)->view);
! (*mailbox)->view = NULL;
! }
! (*mailbox)->view_len = 0;
!
! (*mailbox)->magic = 0; /* Invalidate */
! free(*mailbox);
! *mailbox = NULL;

! for ( ; i < mailbox_list_len-1; i++) {
! mailbox_list[i] = mailbox_list[i+1];
}
! mailbox_list[i] = NULL;
! mailbox_list_len--;


}

/* Return 1 if redraw required */

--- 258,289 ----


"mailbox not found from list",0);

okei:
! free_mailbox1(mailbox);
! }

! void free_all_mailboxes()
! {
! if (mailbox_list) {
! int i;
!
! for ( i = 0; i < mailbox_list_len; i++) {
! if (mailbox_list[i]) {
!
! SIGDPRINT(Debug,7,(&Debug,"free_all_mailboxes: [%d]\n",
! i));
!
! if (mailbox_list[i]->magic != MAILBOXVIEW_magic)
! panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_all_mailboxes",
! "Bad magic number",0);
!
! free_mailbox1(& (mailbox_list[i]));
! }
! }
!
! free(mailbox_list);
! mailbox_list = NULL;
}
! mailbox_list_len = 0;


}

/* Return 1 if redraw required */

***************
*** 463,505 ****
& mailbox->view[index]);
}

- #if 0 /* NOT USED */
-
- /* This is not good ... */
- int give_message_folder(mailbox,index,ret_header,ret_folder,counter,
- parse_mime)
- struct MailboxView *mailbox;
- int index;
- struct header_rec **ret_header;
- struct folder_info **ret_folder;
- struct counter_data *counter;
- parse_mime_callback *parse_mime;
- {
- if (mailbox->magic != MAILBOXVIEW_magic)
- panic("MBX VIEW PANIC",__FILE__,__LINE__,"give_message_folder",
- "Bad magic number",0);
-
- if (mailbox->mailbox_type->magic != MAILBOXTYPE_magic)
- panic("MBX VIEW PANIC",__FILE__,__LINE__,"give_message_folder",
- "Bad type magic number",0);
-
- if (ret_header)
- *ret_header = NULL;
- if (ret_folder)
- *ret_folder = NULL;
-
-
- if (index < 0 || index >= mailbox->view_len)
- return 0;
-
- return mailbox->mailbox_type->
- mt_give_message_folder_it(mailbox,index,ret_header,
- ret_folder,counter,parse_mime,
- & mailbox->view[index]);
-
- }
-
- #endif /* NOT USED */

void write_mailbox_info(fp,mailbox)
FILE *fp;
--- 516,521 ----
Index: elm2.4.ME+.119-cvs/src/messages/partial.c
*** elm2.4.ME+.118/src/messages/partial.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.119-cvs/src/messages/partial.c 2004-07-27 23:25:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.15 2004/04/24 12:30:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: partial.c,v 1.16 2004/07/27 20:25:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 497,559 ****

}

- /* This is not good ... */
- S_(mt_give_message_folder_mailbox mt_give_message_folder_partial)
- /* This is not good ... */
- static int mt_give_message_folder_partial P_((struct MailboxView *mailbox,
- int index,
- struct header_rec **ret_header,
- struct folder_info **ret_folder,
- struct counter_data *counter,
- parse_mime_callback *parse_mime,
- struct folder_view *v));
- /* This is not good ... */
- static int mt_give_message_folder_partial(mailbox,index,ret_header,ret_folder,
- counter,parse_mime,v)
- struct MailboxView *mailbox;
- int index;
- struct header_rec **ret_header;
- struct folder_info **ret_folder;
- struct counter_data *counter;
- parse_mime_callback *parse_mime;
- struct folder_view *v;
- {
- struct header_rec *hdr;
-
- if (0 == v->mailbox_number) { /* Number 0 is internal */
-
- if (v->index < 0 || v->index >= mailbox->u.partial->composite_len)
- return 0;
-
- if (! mailbox->u.partial->composite[v->index].mss)
- generate_mail_header(mailbox,v->index);
-
- if (! mailbox->u.partial->composite[v->index].mss)
- return 0;
-
- if (ret_header)
- *ret_header = mailbox->u.partial->composite[v->index].mss;
-
- if (ret_folder)
- return 0;
-
- return 1;
- } else {
- struct folder_view V;
- struct MailboxView *Z = mailbox->u.partial->parent_mailbox;
-
- /* Shift by one */
- V.mailbox_number = v->mailbox_number-1;
- V.index = v->index;
-
- return Z->mailbox_type->mt_give_message_folder_it(Z,index,
- ret_header,ret_folder,
- counter,parse_mime,
- & V);
- }
-
-
- }

static int check_tempfile P_((struct MailboxView *mailbox));
static int check_tempfile(mailbox)
--- 497,502 ----
***************
*** 879,885 ****
mt_give_header_partial,
mt_sort_partial_view,
mt_give_message_data_partial,
- mt_give_message_folder_partial,
mt_write_partial_info,
mt_partial_title,
mt_make_partial_view,
--- 822,827 ----
Index: elm2.4.ME+.119-cvs/src/messages/storage.c
*** elm2.4.ME+.118/src/messages/storage.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/messages/storage.c 2004-07-27 23:25:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: storage.c,v 1.8 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: storage.c,v 1.9 2004/07/27 20:25:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 335,410 ****
return 1;
}

- /* This is not good ... */
- S_(mt_give_message_folder_mailbox mt_give_message_folder_storage)
- /* This is not good ... */
- static int mt_give_message_folder_storage P_((struct MailboxView *mailbox,
- int index,
- struct header_rec **ret_header,
- struct folder_info **ret_folder,
- struct counter_data *counter,
- parse_mime_callback *parse_mime,
- struct folder_view *v));
- /* This is not good ... */
- static int mt_give_message_folder_storage(mailbox,index,ret_header,ret_folder,
- counter,parse_mime,v)
- struct MailboxView *mailbox;
- int index;
- struct header_rec **ret_header;
- struct folder_info **ret_folder;
- struct counter_data *counter;
- parse_mime_callback *parse_mime;
- struct folder_view *v;
- {
- struct header_rec *hdr;
-
- int mbx,idx;
-
- mbx = v->mailbox_number;
-
- if (mbx < 0 || mbx >= mailbox->u.storage->mailbox_count ||
- ! mailbox->u.storage->the_mailbox ||
- ! mailbox->u.storage->the_mailbox[mbx]) {
- panic("MBX VIEW PANIC",__FILE__,__LINE__,
- "mt_give_message_folder_storage",
- "bad mailbox number",0);
- return 0;
- }
- idx = v->index;
-
- if (idx < 0 ||
- idx >= mailbox->u.storage->the_mailbox[mbx]->message_count ||
- ! mailbox->u.storage->the_mailbox[mbx]->headers ||
- ! mailbox->u.storage->the_mailbox[mbx]->headers[idx]) {
- panic("MBX VIEW PANIC",__FILE__,__LINE__,
- "mt_give_message_folder_storage",
- "bad internal index",0);


- return 0;
- }
-

- hdr = mailbox->u.storage->the_mailbox[mbx]->headers[idx];
-
- /* hdr is also needed on error messages ... */
- if (ret_header)
- *ret_header = hdr;
-
- if (ret_folder)
- *ret_folder = mailbox->u.storage->the_mailbox[mbx]->current_folder;
-
- if (! mailbox->u.storage->the_mailbox[mbx]->current_folder)
- return 0;
-
- if (!prepare_message_access(mailbox->u.storage->the_mailbox[mbx]->
- current_folder,
- hdr,parse_header_routine,parse_body_routine,
- counter,parse_mime))
- return 0;
-

- return 1;
-
-
- }

-
S_(mt_write_mailbox_info mt_write_storage_info)
static void mt_write_storage_info P_((FILE *fp, struct MailboxView *mailbox,
int s, int cur_idx));
--- 335,340 ----
***************
*** 610,616 ****
mt_give_header_storage,
mt_sort_storage_view,
mt_give_message_data_storage,
- mt_give_message_folder_storage,
mt_write_storage_info,
mt_storage_title,
mt_make_storage_view,
--- 540,545 ----
Index: elm2.4.ME+.119-cvs/src/newmbox.c
*** elm2.4.ME+.118/src/newmbox.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.119-cvs/src/newmbox.c 2004-07-24 22:50:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.85 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.85 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.86 2004/07/24 19:50:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.86 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 138,144 ****
if (!same_file)
free_storage(&storage);

! silently_exit(mailbox,&current_aliaslist); /* ???? TODO -- is needed? */

}

--- 138,144 ----
if (!same_file)
free_storage(&storage);

! silently_exit(); /* ???? TODO -- is needed? */

}

***************
*** 181,188 ****
if (!same_file)
free_storage(&storage);

! rm_temps_exit(mailbox,&current_aliaslist); /* ???? TODO -- is needed? */


! /* ?? global reference */
}


--- 181,187 ----
if (!same_file)
free_storage(&storage);

! rm_temps_exit(); /* ???? TODO -- is needed? */
}


Index: elm2.4.ME+.119-cvs/src/options.c
*** elm2.4.ME+.118/src/options.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/options.c 2004-07-24 22:50:45.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: options.c,v 1.30 2004/07/13 19:38:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.31 2004/07/24 19:50:45 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 326,333 ****



while ((c = menu_ReadCh(page,0|READCH_sig_char|READCH_CURSOR)) != '.') {

if (c == EOF)
! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */
!

if (c == TERMCH_interrupt_char)
break;

--- 326,333 ----



while ((c = menu_ReadCh(page,0|READCH_sig_char|READCH_CURSOR)) != '.') {

if (c == EOF)
! leave(0);


!
if (c == TERMCH_interrupt_char)

break;

***************
*** 462,468 ****


goto redraw;
if (ch == EOF) {

erase_menu_context(&page);


! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */
}

if (ch == RESIZE_MARK) {
--- 462,468 ----


goto redraw;
if (ch == EOF) {

erase_menu_context(&page);
! leave(0);
}

if (ch == RESIZE_MARK) {
Index: elm2.4.ME+.119-cvs/src/partial.c
*** elm2.4.ME+.118/src/partial.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.119-cvs/src/partial.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.9 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.10 2004/07/26 12:41:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
***************
*** 142,148 ****


nufoot = 0;
nucurr = 0;

! new_mail_check(mailbox,&redraw, &header_page, page);

if (update_view(mailbox)) {
resort_mailbox(mailbox,1, &header_page);

Kari E. Hurtta

unread,
Aug 5, 2004, 12:07:20 PM8/5/04
to
Archive-name: elm2.4ME+/PL119.3

Before applying patch catenate parts 1 - 3 first.

This patch is agaist Elm 2.4ME+ PL118 (25) part 3/3
=============================================================================
--- 142,149 ----


nufoot = 0;
nucurr = 0;

! new_mail_check(mailbox, &header_page, page);
! redraw += menu_need_redraw(page);

if (update_view(mailbox)) {
resort_mailbox(mailbox,1, &header_page);
***************
*** 181,190 ****


MoveCursor(lin,col);
}

! ch = mailbox_command(mailbox,ch, &redraw, &nufoot,

showmsg_partial_cmd, aview, &header_page,


page);

switch (ch) {
case 0: /* OK */
break;

--- 182,193 ----


MoveCursor(lin,col);
}

! ch = mailbox_command(mailbox,ch, &nufoot,

showmsg_partial_cmd, aview, &header_page,


page);

+ redraw += menu_need_redraw(page);
+

switch (ch) {
case 0: /* OK */
break;

***************
*** 204,210 ****

/* softkeys_off(); */

! redraw += do_pipe(mailbox, page);

/* softkeys_on(); */
} else {
DPRINT(Debug,3,(&Debug,

--- 207,215 ----

/* softkeys_off(); */

! do_pipe(mailbox, page);

! redraw += menu_need_redraw(page);
!
/* softkeys_on(); */
} else {
DPRINT(Debug,3,(&Debug,

Index: elm2.4.ME+.119-cvs/src/pattern.c
*** elm2.4.ME+.118/src/pattern.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/pattern.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: pattern.c,v 1.35 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pattern.c,v 1.36 2004/07/26 12:41:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 238,246 ****
return(curtag);
}

! int pattern_match(menu, redraw, header_page, page)
struct menu_common *menu;
- int *redraw;
int header_page;
struct menu_context *page;
{
--- 238,245 ----
return(curtag);
}

! int pattern_match(menu, header_page, page)
struct menu_common *menu;
int header_page;
struct menu_context *page;
{
***************
*** 249,254 ****
--- 248,257 ----
case), move current message pointer to that message, if
not, error and return ZERO **/

+ /* If redraw is needed use

+ menu_trigger_redraw(page)
+ */
+

int i;

/* Elm 2.4 remembers old entered patterns, so we need to keep
***************
*** 258,263 ****
--- 261,267 ----
static struct string * alt_pattern = NULL;
int ret = 0 ;



+ int redraw = 0;

int anywhere = FALSE;
int matched;


struct string * buffer = NULL;

***************
*** 286,292 ****


val = pattern_enter(&pattern, &alt_pattern, LINES-2,0,
! buffer, buffer1, redraw, page);

/* 0 == pattern given
1 == alt_pattern given
--- 290,296 ----


val = pattern_enter(&pattern, &alt_pattern, LINES-2,0,
! buffer, buffer1, &redraw, page);

/* 0 == pattern given
1 == alt_pattern given
***************
*** 362,367 ****
--- 366,373 ----
if (buffer1)
free_string(&buffer1);



+ if (redraw)
+ menu_trigger_redraw(page);

return(ret);
}
Index: elm2.4.ME+.119-cvs/src/pgp.c
*** elm2.4.ME+.118/src/pgp.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/pgp.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: pgp.c,v 1.44 2004/07/21 09:00:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp.c,v 1.45 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 899,909 ****
/* not reached */
}

! int pgp_mail_public_key (mailbox, aview, page)


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{

int ret;
struct run_state RS;
CONST char * argv[20];
--- 899,913 ----
/* not reached */
}

! void pgp_mail_public_key (mailbox, aview, page)


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{

+ /* If redraw is needed use


+ menu_trigger_redraw(page)
+ */
+

int ret;
struct run_state RS;
CONST char * argv[20];
***************
*** 921,927 ****
pgpkey[0] = '\0';

if (!(version = have_pgp(v)))
! return FALSE;

PutLineX(LINES-3, 0,
CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,
--- 925,931 ----
pgpkey[0] = '\0';

if (!(version = have_pgp(v)))
! return;

PutLineX(LINES-3, 0,
CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,
***************
*** 940,954 ****
need_redraw = TRUE;
}

! if ( status != 0)
! return(need_redraw);
!
if (GetPGPKey(userid, pgpkey, sizeof pgpkey, version) < 0) {
print_format_center(LINES-1,
CATGETS(elm_msg_cat, ElmSet, ElmPgpSorryUserId,
"Sorry, couldn't find that userid."));
ClearLine(LINES-3);
! return(TRUE);
}
elm_sfprintf(tmpfil, sizeof tmpfil,
FRM("%selm.%d.asc"), temp_dir, getpid());
--- 944,963 ----
need_redraw = TRUE;
}

! if ( status != 0) {
! if (need_redraw)
! menu_trigger_redraw(page);
! return;
! }
!
if (GetPGPKey(userid, pgpkey, sizeof pgpkey, version) < 0) {
print_format_center(LINES-1,
CATGETS(elm_msg_cat, ElmSet, ElmPgpSorryUserId,
"Sorry, couldn't find that userid."));
ClearLine(LINES-3);


!
! menu_trigger_redraw(page);
! return;
}

elm_sfprintf(tmpfil, sizeof tmpfil,
FRM("%selm.%d.asc"), temp_dir, getpid());
***************
*** 1000,1017 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailSignal,
"%.30s fail: Signal?"),
argv[0]);
! return TRUE;
} else if (ret > 0) {
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),
argv[0],error_description(RS.save_errno));
! return TRUE;
} else if (exit_code) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpErrorStatus,
"Pgp returned error status %d"),
exit_code);
! return TRUE;
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpDone,
"Running PGP... Done."));
--- 1009,1030 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailSignal,
"%.30s fail: Signal?"),
argv[0]);
! menu_trigger_redraw(page);
! return;
} else if (ret > 0) {
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),
argv[0],error_description(RS.save_errno));


!
! menu_trigger_redraw(page);
! return;

} else if (exit_code) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpErrorStatus,
"Pgp returned error status %d"),
exit_code);


! menu_trigger_redraw(page);
! return;
} else {

lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpDone,
"Running PGP... Done."));
***************
*** 1021,1027 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmLostErrno,
"%.30s lost: %.40s"),
argv[0],error_description(RS.save_errno));
! return TRUE;
}
} else {
if (RS.save_errno)
--- 1034,1041 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmLostErrno,
"%.30s lost: %.40s"),
argv[0],error_description(RS.save_errno));


! menu_trigger_redraw(page);
! return;
}
} else {

if (RS.save_errno)
***************
*** 1032,1038 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantStart,
"Can't start %.30s"),
argv[0]);
! return TRUE;
}

/* set the default subject for this message */
--- 1046,1053 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantStart,
"Can't start %.30s"),
argv[0]);
! menu_trigger_redraw(page);
! return;
}

/* set the default subject for this message */
***************
*** 1050,1062 ****


unlink (included_file); /* make sure to clean up. */

included_file[0] = '\0';
pgp_status = 0; /* reset */
! return(TRUE);
}

! int pgp_extract_public_key (hdr, infile)
struct header_rec *hdr;
FILE *infile;
{
char tempfile[STRING];
struct run_state RS;
CONST char *argv[20];
--- 1065,1084 ----


unlink (included_file); /* make sure to clean up. */

included_file[0] = '\0';
pgp_status = 0; /* reset */


!
! menu_trigger_redraw(page);
! return;
}

! void pgp_extract_public_key (hdr, infile, page)
struct header_rec *hdr;
FILE *infile;
+ struct menu_context *page;
{
+ /* If redraw is needed, use


+ menu_trigger_redraw(page)
+ */
+

char tempfile[STRING];
struct run_state RS;
CONST char *argv[20];
***************
*** 1067,1076 ****
enum pgp_version version;

if (!hdr)
! return FALSE;

if (!(version = have_pgp(v)))
! return FALSE;

elm_sfprintf(tempfile,sizeof tempfile,
FRM("%selm.%d"),temp_dir,getpid());
--- 1089,1098 ----
enum pgp_version version;

if (!hdr)
! return;

if (!(version = have_pgp(v)))
! return;

elm_sfprintf(tempfile,sizeof tempfile,
FRM("%selm.%d"),temp_dir,getpid());
***************
*** 1079,1090 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmOpenTmpWriting,
"Could not open temp file %.30s for writing!"),
tempfile);
! return FALSE;
}
if (!copy_message_f(infile,hdr,
"",fpout,0,NULL)) {
fclose(fpout);
! return FALSE;
}
fclose(fpout);

--- 1101,1112 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmOpenTmpWriting,
"Could not open temp file %.30s for writing!"),
tempfile);
! return;
}
if (!copy_message_f(infile,hdr,
"",fpout,0,NULL)) {
fclose(fpout);
! return;
}
fclose(fpout);

***************
*** 1118,1124 ****
wait_end(&RS,&exit_code);
}
unlink(tempfile);
! return TRUE;
}

#endif /* USE_PGP */
--- 1140,1148 ----
wait_end(&RS,&exit_code);
}
unlink(tempfile);


!
! menu_trigger_redraw(page);
! return;
}

#endif /* USE_PGP */
Index: elm2.4.ME+.119-cvs/src/quit.c
*** elm2.4.ME+.118/src/quit.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/quit.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: quit.c,v 1.41 2004/07/11 17:44:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: quit.c,v 1.43 2004/07/26 12:41:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 93,108 ****
return;
}
}
! leave(0, mailbox,aview);
}

! int resync(mailbox, header_page, page)


struct MailboxView **mailbox;
int *header_page;
struct menu_context *page;
{

/** Resync on the current folder. Leave current and read it back in.
! Return indicates whether a redraw of the screen is needed.
**/
int err;

--- 93,111 ----
return;
}
}
! leave(0);
}

! void resync(mailbox, header_page, page)


struct MailboxView **mailbox;
int *header_page;
struct menu_context *page;
{

/** Resync on the current folder. Leave current and read it back in.
!
! If redraw is required, uses
! menu_trigger_redraw(page)
!
**/
int err;

***************
*** 118,130 ****
* of calling newmbox to add in the new messages to the current
* file and fix the sorting sequence that leave_mbox may have
* changed for its own purposes */
! return(FALSE);

if (result < 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedResyncFolder,
"Failed to resync folder!"));
sleep_message();
! return FALSE;
}

sc = get_storage_count(*mailbox);
--- 121,135 ----
* of calling newmbox to add in the new messages to the current
* file and fix the sorting sequence that leave_mbox may have
* changed for its own purposes */
!
! return;

if (result < 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedResyncFolder,
"Failed to resync folder!"));
sleep_message();
!
! return;
}

sc = get_storage_count(*mailbox);
***************
*** 151,168 ****

Raw_OFF(1); /* Will reprint error */

! leave(0, mailbox, &current_aliaslist);


! /* ?? global reference */
}

newmbox_1(storage->current_folder, FALSE, mailbox,1, header_page,
page);
}
}
! return(TRUE);
}

! int change_file(mailbox, aview, header_page, page)
struct MailboxView **mailbox;


struct AliasView *aview;
int *header_page;

--- 156,174 ----

Raw_OFF(1); /* Will reprint error */

! leave(0);
}

newmbox_1(storage->current_folder, FALSE, mailbox,1, header_page,
page);


}
}
!
! menu_trigger_redraw(page);
! return;
}

! void change_file(mailbox, aview, header_page, page)
struct MailboxView **mailbox;


struct AliasView *aview;
int *header_page;

***************
*** 173,179 ****
* If leave goes okay (i.e. no new messages in current folder),
* change to the folder that the user specified.
*
! * Return value indicates whether a redraw is needed.
*/

int redraw = FALSE;
--- 179,185 ----
* If leave goes okay (i.e. no new messages in current folder),
* change to the folder that the user specified.
*
! * If redraw is needed use menu_trigger_redraw(page)
*/

int redraw = FALSE;
***************
*** 362,368 ****

free_dir(&XXX);

! return redraw;
}

/*
--- 368,376 ----

free_dir(&XXX);



! if (redraw)
! menu_trigger_redraw(page);

! return;
}

/*
Index: elm2.4.ME+.119-cvs/src/remail.c
*** elm2.4.ME+.118/src/remail.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.119-cvs/src/remail.c 2004-07-27 23:25:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remail.c,v 1.35 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: remail.c,v 1.36 2004/07/27 20:25:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 60,66 ****
/** remail a message... returns TRUE if new foot needed ... **/



struct mail_send_state * mailer = NULL;

!
char buffer[VERY_LONG_STRING], ch;

int encoding = ENCODING_NONE;
--- 60,67 ----
/** remail a message... returns TRUE if new foot needed ... **/



struct mail_send_state * mailer = NULL;

! int redraw = 0;
!

char buffer[VERY_LONG_STRING], ch;

int encoding = ENCODING_NONE;
***************
*** 94,100 ****
import_mailheaders(&mailing_headers);
}

! if (! get_to(&mailing_headers.to,mailer_info, aview, page))
goto free_it;

display_to(mailing_headers.to, page);
--- 95,102 ----
import_mailheaders(&mailing_headers);
}

! if (! get_to(&mailing_headers.to,mailer_info, aview, page,
! NULL, NULL))
goto free_it;

display_to(mailing_headers.to, page);
***************
*** 141,147 ****
"Bounce of message canceled."));
goto free_it;
}
!
if (current_header -> status & MIME_MESSAGE) {
encoding = current_header->mime_rec.encoding;

--- 143,150 ----
"Bounce of message canceled."));
goto free_it;


}
! redraw += menu_need_redraw(page);
!

if (current_header -> status & MIME_MESSAGE) {
encoding = current_header->mime_rec.encoding;

***************
*** 166,172 ****
if(mailer)
free_mail_send_state(&mailer);

!
free_mailing_headers(&mailing_headers);

free_mailer_info(&mailer_info);
--- 169,177 ----
if(mailer)
free_mail_send_state(&mailer);



! if (redraw)
! menu_trigger_redraw(page);

!
free_mailing_headers(&mailing_headers);

free_mailer_info(&mailer_info);
Index: elm2.4.ME+.119-cvs/src/reply.c
*** elm2.4.ME+.118/src/reply.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/reply.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: reply.c,v 1.38 2004/07/18 20:55:15 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: reply.c,v 1.39 2004/07/26 12:41:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 307,323 ****
return result;
}

! int reply(index, mailbox, aview, page)


int index;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

{
! /** Reply to the current message. Returns non-zero iff
! the screen has to be rewritten. **/

char subject[SLEN];
! int return_value, form_letter;


struct addr_item * rt = NULL;
struct string * temp1 = NULL;
char * temp2 = NULL;

--- 307,326 ----
return result;
}

! void reply(index, mailbox, aview, page)


int index;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

{
! /** Reply to the current message.
!
! If screen nedd to redraw, use menu_trigger_redraw(page)
! **/

char subject[SLEN];


! int redraw = 0;

! int form_letter;


struct addr_item * rt = NULL;
struct string * temp1 = NULL;
char * temp2 = NULL;

***************
*** 328,337 ****
if (!give_message_data(mailbox,index,
&current_header,&F,NULL,
NO_mime_parse))
! return 0;



if (! current_header || !F)
! return 0;

rt = handle_reply_to(current_header,F);

--- 331,340 ----
if (!give_message_data(mailbox,index,
&current_header,&F,NULL,
NO_mime_parse))
! return;

if (! current_header || !F)
! return;

rt = handle_reply_to(current_header,F);

***************
*** 354,366 ****


sizeof subject);

if (form_letter)
! return_value = mail_filled_in_form(index,rt, subject,

mailbox, aview);
else {
! return_value = send_msg_l(index,rt, NULL, subject,

! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);


if (me_retcode) {
current_header->status |= REPLIED;

current_header->status_chgd = TRUE;
--- 357,372 ----
sizeof subject);

if (form_letter)
! redraw = mail_filled_in_form(index,rt, subject,
mailbox, aview);
else {
! send_msg_l(index,rt, NULL, subject,
! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);


!
! redraw += menu_need_redraw(page);
!

if (me_retcode) {
current_header->status |= REPLIED;

current_header->status_chgd = TRUE;
***************
*** 373,382 ****
free_string(&temp1);
free(temp2);

! return(return_value);


}

! int reply_to_everyone(index,mailbox, aview, page)

int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;

--- 379,391 ----
free_string(&temp1);
free(temp2);


! if (redraw)
! menu_trigger_redraw(page);

!
! return;
}

! void reply_to_everyone(index,mailbox, aview, page)


int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;

***************
*** 388,394 ****
has to be rewritten. **/

char subject[SLEN];
! int return_value;
struct addr_item * rt;
struct addr_item * cc;

--- 397,403 ----
has to be rewritten. **/

char subject[SLEN];


! int redraw = 0;

struct addr_item * rt;
struct addr_item * cc;

***************
*** 403,412 ****
if (!give_message_data(mailbox,index,
&current_header,&F,NULL,
NO_mime_parse))
! return 0;



if (! current_header || !F)
! return 0;

rt = handle_reply_to(current_header,F);
cc = get_and_expand_everyone(current_header,rt);

--- 412,421 ----
if (!give_message_data(mailbox,index,
&current_header,&F,NULL,
NO_mime_parse))
! return;

if (! current_header || !F)
! return;



rt = handle_reply_to(current_header,F);
cc = get_and_expand_everyone(current_header,rt);

***************
*** 423,432 ****


"Re: your mail"),
sizeof subject);

! return_value = send_msg_l(index,rt, cc, subject,
! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);


if (me_retcode) {
current_header->status |= REPLIED;

current_header->status_chgd = TRUE;
--- 432,444 ----


"Re: your mail"),
sizeof subject);

! send_msg_l(index,rt, cc, subject,
! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);


!
! redraw += menu_need_redraw(page);
!

if (me_retcode) {
current_header->status |= REPLIED;

current_header->status_chgd = TRUE;
***************
*** 439,448 ****
free_string(&temp1);
free(temp2);

! return(return_value);
}

! int forward(index,mailbox,aview, page)


int index;
struct MailboxView *mailbox;
struct AliasView *aview;

--- 451,463 ----
free_string(&temp1);
free(temp2);


! if (redraw)
! menu_trigger_redraw(page);

!
! return;
}

! void forward(index,mailbox,aview, page)


int index;
struct MailboxView *mailbox;
struct AliasView *aview;

***************
*** 453,470 ****
get the address and route the mail. Modified to also set
'noheader' to FALSE also, so that the original headers
of the message sent are included in the message body also.


! Return TRUE if the main part of the screen has been changed

! (useful for knowing whether a redraw is needed.
**/

char subject[SLEN];
! int results, edit_msg = FALSE;
int LINES, COLUMNS;


struct header_rec *current_header = give_header(mailbox,index);

menu_get_sizes(page, &LINES, &COLUMNS);

! if (! current_header) return 0;

if (current_header->status & FORM_LETTER)
PutLineX(LINES-4,COLUMNS-40,
--- 468,487 ----
get the address and route the mail. Modified to also set
'noheader' to FALSE also, so that the original headers
of the message sent are included in the message body also.
!
! if the main part of the screen has been changed
! use menu_trigger_redraw()
**/

char subject[SLEN];
! int edit_msg = FALSE;
int LINES, COLUMNS;


struct header_rec *current_header = give_header(mailbox,index);

menu_get_sizes(page, &LINES, &COLUMNS);

! if (! current_header)
! return;

if (current_header->status & FORM_LETTER)
PutLineX(LINES-4,COLUMNS-40,
***************
*** 484,494 ****
*def_ans_yes, *def_ans_no);



if (TERMCH_interrupt_char == X1) {
! return 0;
}

if (EOF == X1)
! return 0;

edit_msg = (X1 != *def_ans_no);
}

--- 501,511 ----
*def_ans_yes, *def_ans_no);

if (TERMCH_interrupt_char == X1) {
! return;
}

if (EOF == X1)
! return;



edit_msg = (X1 != *def_ans_no);
}

***************
*** 515,535 ****


"(fwd)") != 0))
strfcat(subject, " (fwd)", sizeof subject);

! results = send_msg_l(index,
NULL, NULL, subject,
(edit_msg ? MAIL_EDIT_MSG : 0 ) |
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,

mailbox, aview,
! page);

free_string(&temp1);
free(temp2);


}
else
! results = send_msg_l(index,
NULL, NULL,
/* TODO: Fix this mess... */
catgets(elm_msg_cat, ElmSet, ElmForwardedMail,

--- 532,552 ----


"(fwd)") != 0))
strfcat(subject, " (fwd)", sizeof subject);

! send_msg_l(index,


NULL, NULL, subject,
(edit_msg ? MAIL_EDIT_MSG : 0 ) |
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,

mailbox, aview,
! page);

free_string(&temp1);
free(temp2);

}
else
! send_msg_l(index,


NULL, NULL,
/* TODO: Fix this mess... */
catgets(elm_msg_cat, ElmSet, ElmForwardedMail,
***************

*** 540,546 ****
PREFORMATTED : allow_forms,
mailbox, aview,
page);
! return(results);
}

void get_return_name(address, name, trans_to_lowercase, size)
--- 557,564 ----
PREFORMATTED : allow_forms,
mailbox, aview,
page);
!
! return;
}

void get_return_name(address, name, trans_to_lowercase, size)
Index: elm2.4.ME+.119-cvs/src/screen/context.c
*** elm2.4.ME+.118/src/screen/context.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.119-cvs/src/screen/context.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: context.c,v 1.4 2004/04/24 12:30:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: context.c,v 1.5 2004/07/26 12:41:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 146,159 ****
--- 146,178 ----

if (ptr->redraw) {

+ /* Reset ptr->redraw .... */
+
ptr->redraw = ROOT_MENU.redraw; /* ? ? ? ? */

+ DPRINT(Debug,7, (&Debug,
+ "menu_need_redraw(%p): returning redraw\n",
+ ptr));
+
return 1;
}

return 0;
}

+ void menu_trigger_redraw(ptr)
+ struct menu_context *ptr;
+ {
+ if (ptr->magic != MENU_CONTEXT_magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_trigger_redraw",
+ "Bad type magic number",0);
+ DPRINT(Debug,7, (&Debug,
+ "menu_trigger_redraw(%p): triggering redraw\n",
+ ptr));
+ ptr->redraw = 1;
+ }
+
+
static VOLATILE int resize_screen = 0; /** SIGWINCH occured? **/
static VOLATILE int redraw_screen = 0; /** Elm suspended? **/

Index: elm2.4.ME+.119-cvs/src/screen/init.c
*** elm2.4.ME+.118/src/screen/init.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/screen/init.c 2004-07-27 23:25:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: init.c,v 1.3 2004/07/11 11:36:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: init.c,v 1.4 2004/07/27 20:25:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

Index: elm2.4.ME+.119-cvs/src/showmsg_c.c
*** elm2.4.ME+.118/src/showmsg_c.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/showmsg_c.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.36 2004/06/18 20:40:56 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.37 2004/07/26 12:41:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 72,78 ****

switch (cmd) {
case '?' :
! if (help(TRUE, page)) {
menu_ClearScreen(page);
build_bottom(&MENU,page);
} else
--- 72,81 ----

switch (cmd) {
case '?' :
!
! help(TRUE, page);
!
! if (menu_need_redraw(page)) {
menu_ClearScreen(page);
build_bottom(&MENU,page);
} else
***************
*** 88,94 ****
if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))
! (void) do_pipe(mailbox, page); /* do pipe - ignore return val */


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 91,97 ----
if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))
! do_pipe(mailbox, page);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 223,232 ****
&hdr,&F,NULL,
/* !!! */
NO_mime_parse)) {

! if (hdr->pgp & PGP_PUBLIC_KEY)
/* FIX: mime structure is not currently used */

! pgp_extract_public_key (hdr,F);
! else
store_msg("This message does not contain any keys!");
} else {
DPRINT(Debug,3,(&Debug,
--- 226,239 ----
&hdr,&F,NULL,
/* !!! */
NO_mime_parse)) {

! if (hdr->pgp & PGP_PUBLIC_KEY) {
/* FIX: mime structure is not currently used */

! pgp_extract_public_key (hdr,F, page);
!
! if (menu_need_redraw(page)) /* ? ? ? Is this correct */
! put_border(page);
!
! } else
store_msg("This message does not contain any keys!");
} else {
DPRINT(Debug,3,(&Debug,
***************
*** 252,259 ****
put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmForwardMessage,


"Forward message"), TRUE, &MENU,
page);
!

! if (forward(current-1,mailbox, aview, page))

put_border(page);

}
--- 259,268 ----
put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmForwardMessage,


"Forward message"), TRUE, &MENU,
page);
!

! forward(current-1,mailbox, aview, page);
!

! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
put_border(page);

}
***************
*** 458,468 ****


"Mail message"), TRUE, &MENU,
page);

! if (send_msg_l(current-1,
! NULL,NULL,NULL, MAIL_EDIT_MSG,
! allow_forms,
! mailbox, aview,
! page))

put_border(page);
}
break;
--- 467,479 ----


"Mail message"), TRUE, &MENU,
page);

! send_msg_l(current-1,


! NULL,NULL,NULL, MAIL_EDIT_MSG,
! allow_forms,
! mailbox, aview,

! page);
!
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
put_border(page);


}
break;
***************
*** 519,526 ****

put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmReplyToMessage,
"Reply to message"), TRUE, &MENU,
page);
! if (reply(current-1,mailbox, aview, page))

put_border(page);
}
break;

--- 530,541 ----


put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmReplyToMessage,
"Reply to message"), TRUE, &MENU,
page);
!

! reply(current-1,mailbox, aview, page);
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
put_border(page);
+
+
}
break;

***************
*** 535,545 ****

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
! NO_mime_parse))
! (void) save(&intbuf, TRUE, (command != 'C'),0,
! mailbox, aview, *header_page,
! page);


! else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 550,565 ----

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
! NO_mime_parse)) {
!
! save(TRUE, (command != 'C'),0,
! mailbox, aview, *header_page,
! page);
!
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
! put_border(page);
!

! } else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************

*** 558,568 ****

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
! mime_parse_routine))
! (void) save(&intbuf, TRUE, 0,1, mailbox, aview,
! *header_page,
! page);


! else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 578,592 ----

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
! mime_parse_routine)) {
! save(TRUE, 0,1, mailbox, aview,
! *header_page,
! page);
!
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
! put_border(page);
!

! } else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

Index: elm2.4.ME+.119-cvs/src/signals.c
*** elm2.4.ME+.118/src/signals.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/signals.c 2004-07-24 22:50:46.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: signals.c,v 1.25 2004/07/11 11:36:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: signals.c,v 1.26 2004/07/24 19:50:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 30,36 ****

{
SIGDPRINT(Debug,1, (&Debug,
"\n\n** Received SIGQUIT **\n\n\n\n"));
! leave(!wait_can_signal, &current_mailbox, &current_aliaslist);
}

SIGHAND_TYPE
--- 30,36 ----
{
SIGDPRINT(Debug,1, (&Debug,
"\n\n** Received SIGQUIT **\n\n\n\n"));
! leave(!wait_can_signal);
}

SIGHAND_TYPE
***************
*** 38,44 ****
{
SIGDPRINT(Debug,1, (&Debug,
"\n\n** Received SIGHUP **\n\n\n\n"));
! leave(!wait_can_signal, &current_mailbox, &current_aliaslist);
}

SIGHAND_TYPE
--- 38,44 ----
{
SIGDPRINT(Debug,1, (&Debug,
"\n\n** Received SIGHUP **\n\n\n\n"));
! leave(!wait_can_signal);
}

SIGHAND_TYPE
***************
*** 46,52 ****
{
SIGDPRINT(Debug,1, (&Debug,
"\n\n** Received SIGTERM **\n\n\n\n"));
! leave(!wait_can_signal, &current_mailbox,&current_aliaslist);
}

char * Ill_Text = "\n\nIllegal Instruction signal!\n\n";
--- 46,52 ----
{
SIGDPRINT(Debug,1, (&Debug,
"\n\n** Received SIGTERM **\n\n\n\n"));
! leave(!wait_can_signal);
}

char * Ill_Text = "\n\nIllegal Instruction signal!\n\n";
***************
*** 211,216 ****
--- 211,218 ----
{
int result = 0;
int dummy = 0;
+ struct MailboxView *m;
+ int idx2 = 0;

SIGDPRINT(Debug,1, (&Debug, "\n\n** Received SIGUSR1 **\n\n\n\n"));
if (!InGetPrompt || !wait_can_signal) {
***************
*** 219,246 ****
}

question_me = FALSE;
- while (current_mailbox &&
- (result = leave_mbox(TRUE, FALSE, TRUE, NULL, current_mailbox,
- &dummy, default_context))
- == -1) {
- int idx;
- int mbxcount = get_storage_count(current_mailbox);

! for (idx = 0 ; idx < mbxcount; idx++) {

! struct current_storage * storage = get_storage(current_mailbox,
! idx);

! if (!storage ||
! !storage->current_folder)
! continue;
!
! read_new_mails(storage, default_context);
! }
}

if (result >= 0)
! leave(!InGetPrompt, &current_mailbox, &current_aliaslist);
}

SIGHAND_TYPE
--- 221,254 ----
}

question_me = FALSE;

!
! while (NULL != (m = give_next_open_mailbox(&idx2,!InGetPrompt))) {
!
! while (m &&
! (result = leave_mbox(TRUE, FALSE, TRUE, NULL, m,
! &dummy, default_context))
! == -1) {
! int idx;
! int mbxcount = get_storage_count(m);

! for (idx = 0 ; idx < mbxcount; idx++) {
!
! struct current_storage * storage = get_storage(m,idx);

! if (!storage ||
! !storage->current_folder)
! continue;
!
! read_new_mails(storage, default_context);
! }
! }
! if (result < 0)
! break;
}

if (result >= 0)
! leave(!InGetPrompt);
}

SIGHAND_TYPE
***************
*** 248,253 ****
--- 256,263 ----
{
int result = 0;
int dummy = 0;
+ struct MailboxView *m;
+ int idx2 = 0;

SIGDPRINT(Debug,1, (&Debug, "\n\n** Received SIGUSR2 **\n\n\n\n"));

***************
*** 255,283 ****
SIGDPRINT(Debug,1, (&Debug, "-- can't leave folder\n"));
return;
}
-
- while (current_mailbox &&
- (result = leave_mbox(FALSE, TRUE, FALSE, NULL,
- current_mailbox, &dummy,
- default_context)) == -1) {
- int idx;
- int mbxcount = get_storage_count(current_mailbox);

! for (idx = 0 ; idx < mbxcount; idx++) {
!
! struct current_storage * storage = get_storage(current_mailbox,
! idx);

! if (!storage ||
! !storage->current_folder)
! continue;
!
! read_new_mails(storage, default_context);
! }
}
-
if (result >= 0)
! leave(!InGetPrompt, &current_mailbox, &current_aliaslist);
}

void init_signals()
--- 265,296 ----
SIGDPRINT(Debug,1, (&Debug, "-- can't leave folder\n"));
return;
}

! while (NULL != (m = give_next_open_mailbox(&idx2,!InGetPrompt))) {
!
! while (m &&
! (result = leave_mbox(FALSE, TRUE, FALSE, NULL,
! m, &dummy,
! default_context)) == -1) {
! int idx;
! int mbxcount = get_storage_count(m);

! for (idx = 0 ; idx < mbxcount; idx++) {
!
! struct current_storage * storage = get_storage(m,idx);
!
! if (!storage ||
! !storage->current_folder)
! continue;
!
! read_new_mails(storage, default_context);
! }
! }
! if (result < 0)
! break;
}
if (result >= 0)
! leave(!InGetPrompt);
}

void init_signals()
Index: elm2.4.ME+.119-cvs/src/syscall.c
*** elm2.4.ME+.118/src/syscall.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.119-cvs/src/syscall.c 2004-07-26 15:41:47.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: syscall.c,v 1.34 2004/07/11 11:36:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.35 2004/07/26 12:41:47 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 35,46 ****

#ifdef ALLOW_SUBSHELL

! int subshell(mailbox, page)


struct MailboxView *mailbox;
struct menu_context *page;
{

/** spawn a subshell with either the specified command
! returns non-zero if screen rewrite needed
**/

char command[SLEN];
--- 35,47 ----

#ifdef ALLOW_SUBSHELL

! void subshell(mailbox, page)


struct MailboxView *mailbox;
struct menu_context *page;
{

/** spawn a subshell with either the specified command
!
! If redraw is needes use menu_trigger_redraw()
**/

char command[SLEN];
***************
*** 85,91 ****
else
MoveCursor(LINES-3,0);
CleartoEOS();
! return redraw;
}

MoveCursor(LINES-1,0);
--- 86,96 ----
else
MoveCursor(LINES-3,0);
CleartoEOS();


!
! if (redraw)
! menu_trigger_redraw(page);

!
! return;
}

MoveCursor(LINES-1,0);
***************
*** 126,132 ****
"Return code was %d."),
ret);

! return 1;
}

#endif /* ALLOW_SUBSHELL */
--- 131,139 ----
"Return code was %d."),
ret);



! menu_trigger_redraw(page);
!
! return;
}

#endif /* ALLOW_SUBSHELL */
***************
*** 339,350 ****
return(stat);
}

! int do_pipe(mailbox, page)


struct MailboxView *mailbox;
struct menu_context *page;
{

/** pipe the current message or tagged messages to
! the specified sequence.. **/

char command[SLEN], buffer[SLEN], *prompt;
register int ret;
--- 346,360 ----
return(stat);
}

! void do_pipe(mailbox, page)


struct MailboxView *mailbox;
struct menu_context *page;
{

/** pipe the current message or tagged messages to
! the specified sequence..
!
! if redraw is needed use menu_trigger_redraw()
! **/

char command[SLEN], buffer[SLEN], *prompt;
register int ret;
***************
*** 376,382 ****
if (0 != status || command[0] == '\0') {
MoveCursor(LINES-3,0);
CleartoEOLN();
! return(redraw);
}

MoveCursor(LINES-1,0);
--- 386,395 ----
if (0 != status || command[0] == '\0') {
MoveCursor(LINES-3,0);
CleartoEOLN();


!
! if (redraw)
! menu_trigger_redraw(page);

! return;
}

MoveCursor(LINES-1,0);
***************
*** 412,418 ****
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReturnCodeWas,
"Return code was %d."),
ret);
! return(1);
}

int have_printout() {
--- 425,434 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReturnCodeWas,
"Return code was %d."),
ret);
!

!
! menu_trigger_redraw(page);
! return;
}

int have_printout() {
***************
*** 456,467 ****
return return_value;
}

! int print_text(pause_on_scroll, mailbox, header_page, page)
int pause_on_scroll;
struct MailboxView *mailbox;
int header_page;
struct menu_context *page;
{
int tagged = 0, i, old_raw;
int redraw_it = 0;
char *fname = NULL;
--- 472,487 ----
return return_value;
}

! void print_text(pause_on_scroll, mailbox, header_page, page)
int pause_on_scroll;
struct MailboxView *mailbox;
int header_page;
struct menu_context *page;
{
+ /* If redraw is needed use


+ menu_trigger_redraw(page)
+ */
+

int tagged = 0, i, old_raw;
int redraw_it = 0;
char *fname = NULL;
***************
*** 487,493 ****
* Make sure we know how to print.
*/
if (!have_printout() || !mailbox)
! return 0;

fname = elm_message(FRM("%sprintdecode-%d"),
temp_dir, getpid ());
--- 507,513 ----
* Make sure we know how to print.
*/
if (!have_printout() || !mailbox)
! return;

fname = elm_message(FRM("%sprintdecode-%d"),
temp_dir, getpid ());
***************
*** 658,669 ****
clean:
if (fname)
free(fname);
- return redraw_it;
- }
-


! int print_msg(pause_on_scroll, mailbox, page)
int pause_on_scroll;


struct MailboxView *mailbox;
struct menu_context *page;

--- 678,690 ----
clean:
if (fname)
free(fname);

+ if (redraw_it)
+ menu_trigger_redraw(page);
+ return;
+ }

! void print_msg(pause_on_scroll, mailbox, page)
int pause_on_scroll;


struct MailboxView *mailbox;
struct menu_context *page;

***************
*** 676,685 ****
* Printing will be done through a pipe so we can print the number
* of lines output. This is used to determine whether the screen
* got trashed by the print command. One limitation is that only
! * stdout lines are counted, not stderr output. A nonzero result
! * is returned if we think enough output was generated to trash
! * the display, a zero result indicates the display is probably
! * alright. Further, if the display is trashed and "pause_on_scroll"
* is true then we'll give a "hit any key" prompt before returning.
*
* This routine has two modes of behavior, depending upon whether
--- 697,708 ----
* Printing will be done through a pipe so we can print the number
* of lines output. This is used to determine whether the screen
* got trashed by the print command. One limitation is that only
! * stdout lines are counted, not stderr output.
! *
! * If redraw is needed use
! * menu_trigger_redraw(page)
! *
! * Further, if the display is trashed and "pause_on_scroll"
* is true then we'll give a "hit any key" prompt before returning.
*
* This routine has two modes of behavior, depending upon whether
***************
*** 717,723 ****
* Make sure we know how to print.
*/
if (!have_printout())
! return 0;



/*
* Setup print command. Select old or new behavior based

--- 740,746 ----
* Make sure we know how to print.
*/
if (!have_printout())
! return;



/*
* Setup print command. Select old or new behavior based

***************
*** 798,803 ****
--- 821,827 ----

if (ReadCh(REDRAW_MARK) == REDRAW_MARK) {

+ menu_trigger_redraw(page);
nlines = 2;
goto redraw;
}
***************
*** 837,846 ****
free(filename);
}
(void) remove_folder_state_file();
! res = nlines > 1;

free_it:
! return res;
}

static char folder_state_env_param[SLEN], *folder_state_fname;
--- 861,871 ----
free(filename);
}
(void) remove_folder_state_file();
! if (nlines > 1)
! menu_trigger_redraw(page);

free_it:
! return;
}

static char folder_state_env_param[SLEN], *folder_state_fname;
Index: elm2.4.ME+.119-cvs/src/utils.c
*** elm2.4.ME+.118/src/utils.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.119-cvs/src/utils.c 2004-07-24 22:50:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: utils.c,v 1.33 2004/03/27 18:31:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: utils.c,v 1.34 2004/07/24 19:50:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 112,117 ****
--- 112,120 ----
void emergency_exit(interrupt)
int interrupt;
{
+ struct MailboxView *m;
+ int idx = 0;
+
/* if interrupt is true we can't call anything which
* is not reentrant
*/
***************
*** 145,156 ****
SIGDPRINT(Debug,1, (&Debug,
" possibly leaving behind the following files;\n"));

! if (current_mailbox) {
! int mc = get_storage_count(current_mailbox);
int i;

for (i = 0; i < mc; i++) {
! struct current_storage * storage = get_storage(current_mailbox,i);

if (storage && storage->current_folder) {
SIGDPRINT(Debug,1, (&Debug,
--- 148,159 ----
SIGDPRINT(Debug,1, (&Debug,
" possibly leaving behind the following files;\n"));

! while (NULL != (m = give_next_open_mailbox(&idx,interrupt))) {
! int mc = get_storage_count(m);
int i;

for (i = 0; i < mc; i++) {
! struct current_storage * storage = get_storage(m,i);

if (storage && storage->current_folder) {
SIGDPRINT(Debug,1, (&Debug,
***************
*** 194,202 ****
exit(127);
}

! void rm_temps_exit(mailbox,aview)
! struct MailboxView **mailbox;
! struct AliasView **aview;
{
int do_cursor = RawState();
int LINES, COLUMNS;
--- 197,203 ----
exit(127);
}

! void rm_temps_exit()
{
int do_cursor = RawState();
int LINES, COLUMNS;
***************
*** 229,241 ****
if (cur_editfile[0])
unlink(cur_editfile); /* editor buffer */

! if (*mailbox) {
! free_mailbox(mailbox);
! }
!
! if (*aview) {
! free_aliasview(aview);
! }

#ifdef REMOTE_MBX
close_cached_connections();
--- 230,237 ----
if (cur_editfile[0])
unlink(cur_editfile); /* editor buffer */

! free_all_mailboxes();
! free_all_aliasviews();

#ifdef REMOTE_MBX
close_cached_connections();
***************
*** 251,263 ****
/*ARGSUSED*/
/*VARARGS0*/

! void leave(interrupt, mailbox, aview)
int interrupt;
- struct MailboxView **mailbox;
- struct AliasView **aview;
{
int do_cursor = RawState();
-
/* if interrupt is true do not call anything which is not re-entrant */

/*
--- 247,292 ----
/*ARGSUSED*/
/*VARARGS0*/

! static void mailbox_unlock P_((int interrupt));
! static void mailbox_unlock(interrupt)
! int interrupt;
! {
! struct MailboxView *m;
! int idx = 0;
!
! while (NULL != (m = give_next_open_mailbox(&idx,interrupt))) {
! int mc = get_storage_count(m);


! int i;
!
!

! for (i = 0; i < mc; i++) {
! struct current_storage * storage = get_storage(m,i);
! if (storage) {
! if (storage->current_folder) {
! unlock(interrupt, storage->current_folder); /* remove lock file if any */
!
! }
! }
! }
! }
! }
!
! static void mailbox_close P_((int interrupt));
! static void mailbox_close(interrupt)
! int interrupt;
! {
!
! mailbox_unlock(interrupt);
!
! if (!interrupt)
! free_all_mailboxes();
! }
!
!
! void leave(interrupt)
int interrupt;
{
int do_cursor = RawState();
/* if interrupt is true do not call anything which is not re-entrant */

/*
***************
*** 289,319 ****

if (cur_editfile[0])
unlink(cur_editfile); /* editor buffer */
!
! if (*mailbox) {
! int mc = get_storage_count(*mailbox);
! int i;
!

! for (i = 0; i < mc; i++) {
! struct current_storage * storage = get_storage(*mailbox,i);
! if (storage) {
! if (storage->current_folder) {
! unlock(interrupt, storage->current_folder); /* remove lock file if any */
!
! }
! }
! }
!
! if (!interrupt)
! free_mailbox(mailbox);
!
! }
!
! if (*aview) {
! if (!interrupt)
! free_aliasview(aview);
! }

#ifdef REMOTE_MBX
if (!interrupt)
--- 318,330 ----

if (cur_editfile[0])
unlink(cur_editfile); /* editor buffer */
!
! mailbox_close(interrupt);

!
! if (!interrupt)
! free_all_aliasviews();
!

#ifdef REMOTE_MBX
if (!interrupt)
***************
*** 329,337 ****
_exit(0);
}

! void silently_exit(mailbox, aview)
! struct MailboxView **mailbox;
! struct AliasView **aview;
{
/** This is the same as 'leave', but it doesn't remove any non-pid
files. It's used when we notice that we're trying to create a
--- 340,346 ----
_exit(0);
}

! void silently_exit()
{
/** This is the same as 'leave', but it doesn't remove any non-pid
files. It's used when we notice that we're trying to create a
***************
*** 364,385 ****
Raw_OFF(1);
}

! if (*mailbox) {
! int mc = get_storage_count(*mailbox);


! int i;
!
!

! for (i = 0; i < mc; i++) {
! struct current_storage * storage = get_storage(*mailbox,i);
!
! if (storage && storage->current_folder)
! unlock (0,storage->current_folder);
! }
! }

! if (*aview) {
! free_aliasview(aview);
! }

#ifdef REMOTE_MBX
close_cached_connections();
--- 373,381 ----
Raw_OFF(1);
}

! mailbox_unlock(0);

! free_all_aliasviews();

#ifdef REMOTE_MBX
close_cached_connections();
***************
*** 391,400 ****
/*ARGSUSED0*/

#ifndef REMOVE_AT_LAST
! void leave_locked(mailbox, aview)
! struct MailboxView **mailbox;
! struct AliasView **aview;
{
/** same as leave routine, but don't disturb lock file **/

int do_cursor = RawState();
--- 387,397 ----
/*ARGSUSED0*/

#ifndef REMOVE_AT_LAST
! void leave_locked()
{
+ struct MailboxView *m;
+ int idx = 0;
+
/** same as leave routine, but don't disturb lock file **/

int do_cursor = RawState();
***************
*** 421,434 ****
if (cur_editfile[0])
unlink(cur_editfile); /* editor buffer */

!
! if (*mailbox) {
! int mc = get_storage_count(*mailbox);
int i;


for (i = 0; i < mc; i++) {
! struct current_storage * storage = get_storage(*mailbox,i);

if (storage && storage->current_folder) {
leave_old_folder(& storage->current_folder,CLOSE_LEAVE_LOCKED);
--- 418,430 ----
if (cur_editfile[0])
unlink(cur_editfile); /* editor buffer */



! while (NULL != (m = give_next_open_mailbox(&idx,0))) {

! int mc = get_storage_count(m);
int i;


for (i = 0; i < mc; i++) {
! struct current_storage * storage = get_storage(m,i);

if (storage && storage->current_folder) {
leave_old_folder(& storage->current_folder,CLOSE_LEAVE_LOCKED);
***************
*** 436,444 ****
}
}

! if (*aview) {
! free_aliasview(aview);
! }

#ifdef REMOTE_MBX
close_cached_connections();
--- 432,438 ----
}
}

! free_all_aliasviews();

#ifdef REMOTE_MBX
close_cached_connections();
Index: elm2.4.ME+.119-cvs/utils/elmregister.c
*** elm2.4.ME+.118/utils/elmregister.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.119-cvs/utils/elmregister.c 2004-07-27 23:25:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.18 2004/05/02 17:16:48 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.19 2004/07/27 20:25:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1459,1465 ****



#endif /* DIROPS == USE_DIRENT */

#if DIROPS == USE_SYSDIR
! char * entryname = safe_malloc(Xptr->d_namlen+1);

if (!entryname) {


fprintf(stderr,"%s: malloc %d bytes failed\n",

--- 1459,1465 ----



#endif /* DIROPS == USE_DIRENT */

#if DIROPS == USE_SYSDIR
! char * entryname = malloc(Xptr->d_namlen+1);

if (!entryname) {

Kari E. Hurtta

unread,
Aug 20, 2004, 1:28:10 PM8/20/04
to
Archive-name: elmME+2.5/PLalpha2.0

Elm ME+ 2.5 PLalpha2

- Is available on ftp.funet.fi

via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/

file elm-ME+2.5.PLalpha2.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-ME+2.5/elm-ME+2.5.PLalpha2.patch.gz >


- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha2.patch.gz >
via WWW (1).


1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

Before applying patch catenate parts 1 - 5 first.


That part (part 0) do not include patch. Patch

is on part 1 - 5.

This patch (Elm ME+ 2.5 PLalpha2) is agaist Elm ME+ 2.5 PLalpha1.
After that patch apply also Elm ME+ 2.5 PLalpha3 patch.

To apply this patch use

patch -p1 < catenated_file


on directory where Configure is located.

You can remove empty
nls/Makefile

after applying this patch.


Changes on Elm ME+ 2.5 PLalpha3 compared with Elm2.4ME+ PLalpha2 (25)
---------------------------------------------------------------------

- Fix crash on startup if .elm directory do not exists
- Fix crash on startup if DEBUG is not defined
- Deleting of messages marked for deletion was not working
(same incorrect condition worked on Elm 2.4ME+ because
of different ison -macro)
- Errors on [tags] was not caused sending to go back to
pre-send menu.
- "save-by-alias" was truncating alias to 3 letters.

Changes on Elm ME+ 2.5 PLalpha2 compared with Elm2.4ME+ PLalpha1 (25)
---------------------------------------------------------------------

SUMMARY: This release collects changes of Elm2.4ME+ PL117
and PL118. This release incorporates new command
line options from Elm 2.5. New elmrc option is
dead-letter-dir.

* Collected ELM 2.4ME+ PL118 (15) changes:

- Interrupt signal (Ctrl-C) was ignored only,

if Elm ME+ was compiled with -DDEBUG option.

Problem noted by: Laura Kataja

- Moved get_term_chars() from src/init.c to
src/screen/init.c

- ELM 2.4ME+ PL108 added 'invoke e)ditor' command to
header editing screen. That conflicts with 'E)xpires'
command. Changed command to 'invoke e(d)itor'.

- Allow canceling of following prompts

with Ctrl-C (interrupt character) on systems

which supports POSIX termios:
Set current XXX to :
Description: (Attachment Configuration)
Content-Type: (Attachment Configuration)
Content-Disposition: (Attachment Configuration)
Search: (builtin pager)

From: (Message Header Edit Screen)

To: (Message Header Edit Screen)

Cc: (Message Header Edit Screen)

Bcc: (Message Header Edit Screen)

Subject: (Message Header Edit Screen)

Reply-to: (Message Header Edit Screen)

Action: (Message Header Edit Screen)

Priority: (Message Header Edit Screen)

Precedence: (Message Header Edit Screen)

In-reply-to: (Message Header Edit Screen)

user defined header on Message Header Edit Screen

Enter criteria or '?' for help:

Send the message to: (prompt of m)ail command)

To: (prompt of m)ail command)

Subject: (prompt of m)ail command)

Copies to: (prompt of m)ail command)

Return-path: (Mail Pre-Send Screen)


E)ditor (primary) : (ELM Options Editor)

D)isplay mail using : (ELM Options Editor)

C)alendar file : (ELM Options Editor)

O)utbound mail saved : (ELM Options Editor)

P)rint mail using : (ELM Options Editor)

Y)our full name : (ELM Options Editor)

V)isual Editor (~v) : (ELM Options Editor)

E)xpires: (ELM Options Editor)
Precede(n)ce: (ELM Options Editor)
Enter pattern:

To: (when encrypting message (pgp))

From: (when signing message (pgp))

Enter userid of public key: (prompt of Ctrl-K command)
Override charset:
Shell command:
Pipe to:

Enter alias name: (Alias mode)

Current message address aliased to:
Enter address for XXX: (Alias mode)


Fully expand alias: (Alias mode)

Enter last name for XXX:

Enter first name for XXX:
Enter optional comment for XXX:


Forward message as separate part?

Copy message? (prompt of m)ail command)

Edit outgoing message? (prompt of f)orward command)

- Treate Ctrl-C (interrupt character) as No on following

prompts (on systems which support POSIX termios):

Abandon change to mailbox?
Abandon changes to mailbox?

- Handling interrupt (Ctrl-C) on builtin editor without


signals on systems which support POSIX termios

(that edit_interrupt signal handler is not safe!)

- GetPGPKey() did not always re-enabled raw-mode

- Allow canceling of following (folder browser) prompts


with Ctrl-C (interrupt character) on systems

which supports POSIX termios:
Change to which folder:

Save text of message to:

Copy text of message to:

Save text messages to:
Copy text messages to:
Save message to:
Copy message to:
Save messages to:
Copy messages to:

Save copy in (use '?' for help):

- Allow canceling of following (file browser) prompts


with Ctrl-C (interrupt character) on systems

which supports POSIX termios:


To file: (MIME structure Menu)

Filename: (Attachment Configuration)

- Allow canceling leaving of folder on following

prompts with Ctrl-C (interrupt character) on systems

which supports POSIX termios:
Delete message?
Delete messages?

Move read message to \"received\" folder?

Move read messages to \"received\" folder?

Keep unread message in incoming mailbox?

Keep unread messages in incoming mailbox?

- Now on address prompts also works \ quotation


of interrupt character (for example @, if set that way)

on systems which supports POSIX termios.

- Allow canceling of password prompt of IMAP/POP


with Ctrl-C (interrupt character) on systems

which supports POSIX termios:
Password for XXX@YYY:

- Allow canceling of IMAP/POP connection attempt

with Ctrl-C (interrupt character) on systems

which supports POSIX sigaction:
Connecting to XXX

- Allow canceling alias menu help prompt


with Ctrl-C (interrupt character) on systems

which supports POSIX termios


- Allow canceling messages/mailbox menu help

prompt with Ctrl-C (interrupt character) on systems

which supports POSIX termios


- Allow canceling options menu help prompt

with Ctrl-C (interrupt character) on systems

which supports POSIX termios

- Add READCH_CURSOR to ReadCh options so
so that escape sequences from cursor keys
do not cause misinterpration of selected option.

- Allow folowing ON/OFF prompts to be canceled

on options menu with Ctrl-C (interrupt character)

on systems which supports POSIX termios:

A)rrow cursor :
M)enu display :


- Allow options menu sorting criteria prompt

to be canceled with Ctrl-C (interrupt character)

on systems which supports POSIX termios:

S)orting criteria :

- Allow canceling DSN menu with Ctrl-C (interrupt character)


on systems which supports POSIX termios

(but not yet allow canceling of individual prompts.)

- Allow quiting Attachment Configuration menu

with Ctrl-C (interrupt character) on systems which supports

POSIX termios (this not necessary forget/undo made changes

however.)


- Allow canceling encoding prompt on Configuration menu

with Ctrl-C (interrupt character) on systems which supports

POSIX termios:
Content-Transfer-Encoding:


- Allow quiting Attachment Menu with Ctrl-C (interrupt

character) on systems which supports POSIX termios (this not

necessary forget/undo made changes however.)

- Redraw Mail Pre-Send Screen when quiting Attachment Menu
or DSN menu.

- Allow quiting Message Header Edit Screen with Ctrl-C

(interrupt character) on systems which supports POSIX

termios (this not necessary forget/undo made changes

however.)



- Allow quiting help text viewer with Ctrl-C (interrupt

character) on systems which supports POSIX

termios:


Press <space> to continue, 'q' to return.

- Allow quiting of builtin pager with Ctrl-C (interrupt

character) on systems which supports POSIX termios

* Collected ELM 2.4ME+ PL119 (15) changes:


- Configure now locates system gencat command

- Added file nls/Makefile.SH


- File nls/Makefile is removed. Now it is

generated by Configure

- Made leave() to use give_next_open_mailbox()

- Added free_all_mailboxes() to src/messages/messages.c

- Made leave() to use free_all_mailboxes()

- Made rm_temps_exit() to use free_all_mailboxes()

- Made silently_exit() to use give_next_open_mailbox()

- Made emergency_exit() to use give_next_open_mailbox()

- Made leave_locked() to use give_next_open_mailbox()

- Made usr1_signal() to use give_next_open_mailbox()

- Made usr2_signal() to use give_next_open_mailbox()

- Removed current_mailbox global variable

- Added free_all_aliasviews() to src/aliases/aliases.c


- Made leave() to use free_all_aliasviews()

- Made silently_exit() to use free_all_aliasviews()

- Made rm_temps_exit() to use free_all_aliasviews()

- Made leave_locked() to use free_all_aliasviews()

- Removed current_aliaslist global variable

- Added menu_trigger_redraw() to src/screen/context.c


- Changed resync() to use menu_trigger_redraw()

- Changed help() to use menu_trigger_redraw()

- Changed do_pipe() to use menu_trigger_redraw()

- Changed change_file() to use menu_trigger_redraw()

- Changed print_msg() to use menu_trigger_redraw()

- Changed subshell() to use menu_trigger_redraw()

- Changed pgp_extract_public_key() to use menu_trigger_redraw()

- Changed forward() to use menu_trigger_redraw()

- Changed reply_to_everyone() to use menu_trigger_redraw()

- Changed pgp_mail_public_key() to use menu_trigger_redraw()

- Changed send_msg_l() to use menu_trigger_redraw()

- Changed print_text() to use menu_trigger_redraw()

- Changed reply() to use menu_trigger_redraw()

- Changed save() to use menu_trigger_redraw()

- Changed pattern_match() to use menu_trigger_redraw()


- Changed limit() to use menu_trigger_redraw()

- Changed read_number to use menu_trigger_redraw()

- Changed alias_help() to use menu_trigger_redraw()


- Changed a_sendmsg() to use menu_trigger_redraw()

- Changed mailbox_command() to use menu_trigger_redraw()


- Changed motion() to use menu_trigger_redraw()

- Changed new_mail_check() to use menu_trigger_redraw()

- Changed mail() to use menu_trigger_redraw()

- Changed send_msg_middle() to use menu_trigger_redraw()

- Changed send_form() to use menu_trigger_redraw()

- Added menu_trigger_redraw() to get_copies()

- Added menu_trigger_redraw() to get_to()

- Added menu_trigger_redraw() to copy_the_msg()

- Added menu_trigger_redraw() to get_subject()

- Changed send_msg_argv() to use menu_trigger_redraw()

- Moved *.Canceled.mail to own directory
Canceled.mail.dir

- Editor buffer for f)orget messages is not kept.

Instead cancele mails are picked from

Canceled.mail.dir on m)ail -command ('/' on


To: prompt gives menu of cancelled messages.)

- Canceled.mail.dir is not available as folder

(it can not given for c)hange folder commmand

or -f option of Elm.)

- When canceled mail is picked from re-sending,

is is also deleted from Canceled.mail.dir

(f)orget command will re-add it to Canceled.mail.dir.)

- Name of Canceled.mail.dir can be changed with elmrc

option dead-letter-dir.

- Removed give_message_folder()

- Added -g option to Configure

- Change from Elm 2.5:
Added option -r to specify elmrc file [C1]
Added option -S to specify send only mode
Added option -M to force all local folders as
mailboxes [C3]

- Change from Elm 2.5:

Added variable "opmode" [C2]
Added -M option to frm [C3]
Added '&' command to toggle option -M status
(force all local folders as mailbox) [C3]

- Added -M option to newmail
- Added -r option to frm,nfrm
- Added -r option to newmail
- Added -r option to answer
- Added -r option to elmcharset
- Added -r option to elmlibregister
- Added -r option to elmrc-write
- Added -r option to elmstringconvert
- Added -r option to elmterminal
- Added -r option to elmunidata
- If -M option is active, command 'c' prints
'Change mailbox' instead of 'Change folder'

- Allow canceling of following prompts

with Ctrl-C (interrupt character) on systems

which supports POSIX termios:
Save marked messages?

New elmrc options:
dead-letter-dir

New file:
src/screen/init.c
lib/cancel.c
src/messages/canceled_mail.c
src/canceled.c
nls/Makefile.SH

Removed file:


nls/Makefile (this is now generated by Configure)

Correspond quotes from Elm 2.5 PL7 Changes file:

[C1] Actually show the -r option in the usage
[C2] New "opmode" parameter indicates Elm
operating mode (OPMODE_READ, OPMODE_SEND, etc.).
[C3] Added the changes that allow other folders to be treated
as spool folders (the "Magic Mode" change). Hitting '&'
toggles this as well as the use of the command line
option -M. The -M option also works on frm/nfrm.

Kari E. Hurtta

unread,
Aug 20, 2004, 1:28:49 PM8/20/04
to
Archive-name: elmME+2.5/PLalpha2.1

Elm ME+ 2.5 PLalpha2

- Is available on ftp.funet.fi

via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha2.patch.gz >
via WWW (1).


1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

Before applying patch catenate parts 1 - 5 first.

This patch (Elm ME+ 2.5 PLalpha2) is agaist Elm ME+ 2.5 PLalpha1.
After that patch apply also Elm ME+ 2.5 PLalpha3 patch.

================================================ ( part 1/5 ) ===============

To apply this patch use

patch -p1 < this_file


on directory where Configure is located.

You can remove empty
nls/Makefile
after applying this patch.

Index: elmME+.2.5.alpha2-cvs/hdrs/patchlevel.h
Prereq: 1120400000
*** elmME+.2.5.alpha1/hdrs/patchlevel.h 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/patchlevel.h 2004-08-15 20:16:13.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "alpha1"
/* Used by Configure:
! SHAREDTAG: .1.1.1
*/
! #define LAST_REPORT_TIME 1120400000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "Jul, 2004" /* for elm -v option */
#define WHAT_STRING \

! "@(#) Version ME+ 2.5, USENET supported version"



/*
* Local Variables:
--- 1,12 ----

! #define PATCHLEVEL "alpha2"
/* Used by Configure:
! SHAREDTAG: .1.1.2
*/
! #define LAST_REPORT_TIME 1124000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Aug 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version ME+ 2.5, USENET supported version, released Aug 2004"

/*
* Local Variables:
Index: elmME+.2.5.alpha2-cvs/README.ME+
*** elmME+.2.5.alpha1/README.ME+ 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/README.ME+ 2004-08-15 20:16:11.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.736.4.41 2004/07/04 10:45:04 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.736.4.56 2004/08/15 17:16:11 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 19,24 ****
--- 19,339 ----


===================================================================
* Changelog of ElmME+ 2.5

+ Changes on Elm ME+ 2.5 PLalpha2 compared with Elm2.4ME+ PLalpha1 (25)
+ ---------------------------------------------------------------------
+
+ SUMMARY: This release collects changes of Elm2.4ME+ PL117
+ and PL118. This release incorporates new command
+ line options from Elm 2.5. New elmrc option is
+ dead-letter-dir.
+
+ * Collected ELM 2.4ME+ PL118 (15) changes:
+
+ - Interrupt signal (Ctrl-C) was ignored only,
+ if Elm ME+ was compiled with -DDEBUG option.
+ Problem noted by: Laura Kataja
+
+ - Moved get_term_chars() from src/init.c to
+ src/screen/init.c
+
+ - ELM 2.4ME+ PL108 added 'invoke e)ditor' command to
+ header editing screen. That conflicts with 'E)xpires'
+ command. Changed command to 'invoke e(d)itor'.

+ Enter alias name: (Alias mode)
+ Current message address aliased to:
+ Enter address for XXX: (Alias mode)
+ Fully expand alias: (Alias mode)
+ Enter last name for XXX:
+ Enter first name for XXX:
+ Enter optional comment for XXX:
+ Forward message as separate part?
+ Copy message? (prompt of m)ail command)
+ Edit outgoing message? (prompt of f)orward command)


+
+ - Treate Ctrl-C (interrupt character) as No on following
+ prompts (on systems which support POSIX termios):
+ Abandon change to mailbox?
+ Abandon changes to mailbox?
+
+ - Handling interrupt (Ctrl-C) on builtin editor without
+ signals on systems which support POSIX termios
+ (that edit_interrupt signal handler is not safe!)
+
+ - GetPGPKey() did not always re-enabled raw-mode
+
+ - Allow canceling of following (folder browser) prompts
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:
+ Change to which folder:
+ Save text of message to:
+ Copy text of message to:
+ Save text messages to:
+ Copy text messages to:
+ Save message to:
+ Copy message to:
+ Save messages to:
+ Copy messages to:

+ Save copy in (use '?' for help):
+
+ - Allow canceling of following (file browser) prompts


+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:

+ - Allow canceling alias menu help prompt


+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios

+ - Allow canceling messages/mailbox menu help
+ prompt with Ctrl-C (interrupt character) on systems


+ which supports POSIX termios

+ - Allow canceling options menu help prompt
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios
+

+ - Add READCH_CURSOR to ReadCh options so
+ so that escape sequences from cursor keys
+ do not cause misinterpration of selected option.


+
+ - Allow folowing ON/OFF prompts to be canceled
+ on options menu with Ctrl-C (interrupt character)
+ on systems which supports POSIX termios:
+ A)rrow cursor :
+ M)enu display :
+ - Allow options menu sorting criteria prompt
+ to be canceled with Ctrl-C (interrupt character)
+ on systems which supports POSIX termios:
+ S)orting criteria :
+

+ - Allow canceling DSN menu with Ctrl-C (interrupt character)
+ on systems which supports POSIX termios
+ (but not yet allow canceling of individual prompts.)


+
+ - Allow quiting Attachment Configuration menu
+ with Ctrl-C (interrupt character) on systems which supports
+ POSIX termios (this not necessary forget/undo made changes
+ however.)
+ - Allow canceling encoding prompt on Configuration menu
+ with Ctrl-C (interrupt character) on systems which supports
+ POSIX termios:
+ Content-Transfer-Encoding:
+ - Allow quiting Attachment Menu with Ctrl-C (interrupt
+ character) on systems which supports POSIX termios (this not
+ necessary forget/undo made changes however.)
+
+ - Redraw Mail Pre-Send Screen when quiting Attachment Menu
+ or DSN menu.
+

+ - Allow quiting Message Header Edit Screen with Ctrl-C
+ (interrupt character) on systems which supports POSIX
+ termios (this not necessary forget/undo made changes
+ however.)
+
+ - Allow quiting help text viewer with Ctrl-C (interrupt
+ character) on systems which supports POSIX
+ termios:
+ Press <space> to continue, 'q' to return.
+
+ - Allow quiting of builtin pager with Ctrl-C (interrupt
+ character) on systems which supports POSIX termios
+
+ * Collected ELM 2.4ME+ PL119 (15) changes:

+ - Added -g option to Configure
+
+ - Change from Elm 2.5:
+ Added option -r to specify elmrc file [C1]
+ Added option -S to specify send only mode
+ Added option -M to force all local folders as
+ mailboxes [C3]
+
+ - Change from Elm 2.5:
+ Added variable "opmode" [C2]
+ Added -M option to frm [C3]
+ Added '&' command to toggle option -M status
+ (force all local folders as mailbox) [C3]
+
+ - Added -M option to newmail
+ - Added -r option to frm,nfrm
+ - Added -r option to newmail
+ - Added -r option to answer
+ - Added -r option to elmcharset
+ - Added -r option to elmlibregister
+ - Added -r option to elmrc-write
+ - Added -r option to elmstringconvert
+ - Added -r option to elmterminal
+ - Added -r option to elmunidata
+ - If -M option is active, command 'c' prints
+ 'Change mailbox' instead of 'Change folder'


+
+ - Allow canceling of following prompts
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:

+ Save marked messages?


+
+ New elmrc options:

+ dead-letter-dir
+
+ New file:

+ src/screen/init.c
+ lib/cancel.c
+ src/messages/canceled_mail.c
+ src/canceled.c


+ nls/Makefile.SH
+
+ Removed file:

+ nls/Makefile (this is now generated by Configure)
+
+ Correspond quotes from Elm 2.5 PL7 Changes file:
+
+ [C1] Actually show the -r option in the usage
+ [C2] New "opmode" parameter indicates Elm
+ operating mode (OPMODE_READ, OPMODE_SEND, etc.).
+ [C3] Added the changes that allow other folders to be treated
+ as spool folders (the "Magic Mode" change). Hitting '&'
+ toggles this as well as the use of the command line
+ option -M. The -M option also works on frm/nfrm.
+

Changes on Elm ME+ 2.5 PLalpha1 compared with Elm2.4ME+ PLalpha0 (25)

---------------------------------------------------------------------

***************
*** 439,447 ****
--- 754,1070 ----
===================================================================


* Changelog of Elm 2.4ME+

+ Changes of Elm 2.4ME+ PL119 (25) compared with Elm 2.4ME+ PL118 (25)
+ --------------------------------------------------------------------

+

+ - Added -g option to Configure


+
+ New elmrc options:

+ dead-letter-dir
+
+ New file:
+ src/messages/canceled_mail.c
+ src/canceled.c
+ nls/Makefile.SH
+
+ Removed file:

+ nls/Makefile (this is now generated by Configure)
+

+ Changes of Elm 2.4ME+ PL118 (25) compared with Elm 2.4ME+ PL117 (25)

+ --------------------------------------------------------------------
+
+ Undo Elm 2.4ME+ PL117a (25) and Elm 2.4ME+ PL117b (25)
+ patches before applying this patch.
+

+ - Interrupt signal (Ctrl-C) was ignored only,
+ if Elm ME+ was compiled with -DDEBUG option.
+ Problem noted by: Laura Kataja
+
+ - Fix bug where Elm2.4ME+ PL117 was acting always as
+ dsn-success was set.
+

+ - Message/check
+ "signature" used in obsolete way in .elm/elmrc file.
+ removed.

+ Enter alias name: (Alias mode)
+ Current message address aliased to:
+ Enter address for XXX: (Alias mode)
+ Fully expand alias: (Alias mode)
+ Enter last name for XXX:
+ Enter first name for XXX:
+ Enter optional comment for XXX:
+ Forward message as separate part?
+ Copy message? (prompt of m)ail command)
+ Edit outgoing message? (prompt of f)orward command)


+
+ - Treate Ctrl-C (interrupt character) as No on following
+ prompts (on systems which support POSIX termios):
+ Abandon change to mailbox?
+ Abandon changes to mailbox?
+
+ - Handling interrupt (Ctrl-C) on builtin editor without
+ signals on systems which support POSIX termios
+ (that edit_interrupt signal handler is not safe!)
+
+ - GetPGPKey() did not always re-enabled raw-mode
+
+ - Allow canceling of following (folder browser) prompts
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:
+ Change to which folder:
+ Save text of message to:
+ Copy text of message to:
+ Save text messages to:
+ Copy text messages to:
+ Save message to:
+ Copy message to:
+ Save messages to:
+ Copy messages to:

+ Save copy in (use '?' for help):
+
+ - Allow canceling of following (file browser) prompts


+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios:

+ - Allow canceling alias menu help prompt


+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios

+ - Allow canceling messages/mailbox menu help
+ prompt with Ctrl-C (interrupt character) on systems


+ which supports POSIX termios

+ - Allow canceling options menu help prompt
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios
+

+ - Add READCH_CURSOR to ReadCh options so
+ so that escape sequences from cursor keys
+ do not cause misinterpration of selected option.


+
+ - Allow folowing ON/OFF prompts to be canceled
+ on options menu with Ctrl-C (interrupt character)
+ on systems which supports POSIX termios:
+ A)rrow cursor :
+ M)enu display :
+ - Allow options menu sorting criteria prompt
+ to be canceled with Ctrl-C (interrupt character)
+ on systems which supports POSIX termios:
+ S)orting criteria :
+

+ - Allow canceling DSN menu with Ctrl-C (interrupt character)
+ on systems which supports POSIX termios
+ (but not yet allow canceling of individual prompts.)


+
+ - Allow quiting Attachment Configuration menu
+ with Ctrl-C (interrupt character) on systems which supports
+ POSIX termios (this not necessary forget/undo made changes
+ however.)
+ - Allow canceling encoding prompt on Configuration menu
+ with Ctrl-C (interrupt character) on systems which supports
+ POSIX termios:
+ Content-Transfer-Encoding:
+ - Allow quiting Attachment Menu with Ctrl-C (interrupt
+ character) on systems which supports POSIX termios (this not
+ necessary forget/undo made changes however.)
+
+ - Redraw Mail Pre-Send Screen when quiting Attachment Menu
+ or DSN menu.
+

+ - Allow quiting Message Header Edit Screen with Ctrl-C
+ (interrupt character) on systems which supports POSIX
+ termios (this not necessary forget/undo made changes
+ however.)
+
+ - Allow quiting help text viewer with Ctrl-C (interrupt
+ character) on systems which supports POSIX
+ termios:
+ Press <space> to continue, 'q' to return.
+
+ - Allow quiting of builtin pager with Ctrl-C (interrupt
+ character) on systems which supports POSIX termios
+
+ New file:
+ src/screen/init.c
+ lib/cancel.c
+
+ Changes of Elm2.4ME+ PL117b (25) compared with Elm2.4ME+ PL117a (25)
+ --------------------------------------------------------------------
+

+ [ This patch is branch from the main line. ]
+

+ - Interrupt signal (Ctrl-C) was ignored only,
+ if Elm ME+ was compiled with -DDEBUG option.
+ Problem noted by: Laura Kataja
+
+ Changes of Elm2.4ME+ PL117a (25) compared with Elm2.4ME+ PL117 (25)
+ -------------------------------------------------------------------
+

+ [ This patch is branch from the main line. ]
+

+ - Fix bug where Elm2.4ME+ PL117 was acting always as
+ dsn-success was set.


+
Changes of Elm2.4ME+ PL117 (25) compared with Elm2.4ME+ PL116 (25)

-------------------------------------------------------------------

+ Undo Elm 2.4ME+ PL116a (25) patch before applying this patch.

+
SUMMARY: This release collects patch Elm2.4ME+ PL116a,

implements reconnection to mailer=submission, adds

pgp-interactive and askmimeforward elmrc options

***************
*** 503,509 ****


and reply() to use index, mailbox instead of

current_header, infile, mailbox.



! - Added give_next_open_mailbox() or src/messages.c and

made save_copy() to use it.

- Moved defination of struct mv_storage and

--- 1126,1132 ----


and reply() to use index, mailbox instead of

current_header, infile, mailbox.

! - Added give_next_open_mailbox() to src/messages.c and

made save_copy() to use it.

- Moved defination of struct mv_storage and

***************
*** 527,532 ****
--- 1150,1157 ----


Changes of Elm2.4ME+ PL116a (25) compared with Elm2.4ME+ PL116 (25)

-------------------------------------------------------------------

+ [ This patch is branch from the main line. ]

+
- Alternatives and weedout and list was replaced with Q letters

Problem noted by: Cyrille Lefevre <cyrille...@laposte.net>

Index: elmME+.2.5.alpha2-cvs/Configure
*** elmME+.2.5.alpha1/Configure 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/Configure 2004-08-07 21:07:13.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150.8.7 2004/07/03 17:46:52 hurtta Exp $


#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150.8.8 2004/08/07 18:07:13 hurtta Exp $
#

: sanity checks
***************


*** 45,50 ****
--- 45,51 ----
batchmode=''

newmimecharsets='n'
config=''

*** 978,984 ****


diff
emacs
execmail
! finger
gpg
ispell
line

--- 997,1003 ----


diff
emacs
execmail
! gencat
gpg
ispell
line
***************

*** 1374,1380 ****
EOSS
chmod +x filexp

! : ############### >>>>>>>>>>>>>>> Commented out ROFF section
if true
then
roff=none
--- 1393,1399 ----
EOSS
chmod +x filexp

! : ############### >>> ================== Commented out ROFF section
if true
then
roff=none
***************
*** 1467,1473 ****
fi

fi
! : ############### <<<<<<<<<<<<<<<<<<<< Commented out ROFF section



: default clear to no extra flags
xencf=

--- 1486,1492 ----
fi

fi
! : ############### <<< ==================== Commented out ROFF section



: default clear to no extra flags
xencf=

***************
*** 1503,1513 ****



: determine optimize, if desired, or use for debug flag also
case "$optimize" in
! ' ') dflt="none"
;;
! '') dflt="-O";
;;
! *) dflt="$optimize"
;;
esac
cat <<EOH

--- 1522,1540 ----



: determine optimize, if desired, or use for debug flag also
case "$optimize" in
! ' ') case "$addg" in
! '') dflt="none"
! ;;
! *) dflt="$addg"
! ;;
! esac
;;
! '') dflt="-O $addg";
! ;;
! *$addg*)
! dflt="$optimize"
;;
! *) dflt="$optimize $addg"
;;
esac
cat <<EOH
***************

*** 1625,1637 ****
$echo ""
fi


case "$ldflags" in
! '') if venix; then
! dflt='-i -z'
! else
! dflt='none'
! fi
;;
! *) dflt="$ldflags";;
esac
cat <<EOH

--- 1652,1672 ----


$echo ""
fi
case "$ldflags" in
! '') case "$addg" in
! '')
! if venix; then
! dflt='-i -z'
! else
! dflt='none'
! fi
! ;;
! *)
! dflt="$addg"
! ;;
! esac
;;
! *$addg*) dflt="$ldflags";;
! *) dflt="$ldflags $addg";;
esac
cat <<EOH

***************

*** 2319,2325 ****


echo "Found shlib directory"
fi

! $echo "Trying create chared library"

LibLoc=`cd ..; pwd`/shlib

--- 2354,2360 ----


echo "Found shlib directory"
fi

! $echo "Trying create shared library"

LibLoc=`cd ..; pwd`/shlib

***************

*** 3760,3765 ****
--- 3795,3809 ----


if $test "$d_msgcat" = "$define" -a ! -z "$dflt" ; then
echo "Message catalog routines and nl_types.h found"
d_nl_types="$define"
+
+ if $test -f "$gencat" ; then
+ echo "System gencat command $gencat found"
+ else
+ echo "WARNING: System gencat command not found!"
+ echo
+ sleep 1
+ fi
+
else
echo "Message catalog routines or nl_types.h not found, $package will use its own"
d_msgcat="$undef"
***************

*** 6641,6646 ****
--- 6685,6691 ----


pack='$pack'
compress='$compress'
execmail='$execmail'
+ gencat='$gencat'
libswanted='$libswanted'
noaddlib='$noaddlib'
c_date='$c_date'

Index: elmME+.2.5.alpha2-cvs/doc/answer.1
*** elmME+.2.5.alpha1/doc/answer.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/answer.1 2004-08-15 11:28:33.000000000 +0300
***************
*** 14,19 ****
--- 14,21 ----
] [
.B \-d
.I "\fIclass\fR=\fIdebugfile\fR:\fIlevel\fR"
+ .B \-r
+ .I "\fIelmrc\fR"
]
.PP
.SH DESCRIPTION
***************
*** 59,64 ****
--- 61,69 ----
is not given. Has no effect unless
.I answer
was compiled with debugging enabled.
+ .TP
+ .B " -r \fIelmrc\fR "
+ Specify alternative elmrc file.
.PP
Interface-wise, the program is a breeze to use - type 'answer'
to start it up and then merely type a user name at the
***************
*** 106,112 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2002 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
--- 111,117 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
Index: elmME+.2.5.alpha2-cvs/doc/elm.1
*** elmME+.2.5.alpha1/doc/elm.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/elm.1 2004-08-15 08:36:23.000000000 +0300
***************
*** 10,16 ****
.SH SYNOPSIS
.B elm
[
! .B \-achkKmrtwz
] [
.B \-f
.I "alternate-folder"
--- 10,16 ----
.SH SYNOPSIS
.B elm
[
! .B \-achkKMSmrtwz
] [
.B \-f
.I "alternate-folder"
***************
*** 18,23 ****
--- 18,27 ----
.B \-d
.I "\fIclass\fR=\fIdebugfile\fR:\fIlevel\fR"
]
+ ] [
+ .B \-r
+ .I "alternate-config"
+ ] [
.br
.B elm
[
***************
*** 154,162 ****
--- 158,175 ----

( Keypad + softkeys - enable use of softkeys on HP terminals only. )
.TP
+ .B " -M"
+ Magic mode - treat all folders as if they were the spool folder.
+ .TP
.B " -m"
Menu off - Use the extra lines for more message headers.
.TP
+ .B " -r \fIelmrc\fR "
+ Rcfile - use file specified rather than the default elmrc.
+ .TP
+ .B " -S"
+ Send-only mode
+ .TP
.B " -s \fIsubj\fR "
Subject - specify subject for message to mail.
.TP
***************
*** 192,207 ****
.SH AUTHOR
Elm Development Group, Kari Hurtta
.SH SEE ALSO
- The Elm documentation package, including:
- .I
- The Elm Users Guide,
- The Elm Reference Guide,
- The Elm Alias System Users Guide,
- The Elm Forms Mode Guide,
- The Elm Filter Guide,
- The Elm Configuration Guide\fR
- .sp
- .br
checkalias(1L), frm(1L), mail(1), mailx(1), newalias(1L), printmail(1L), readmsg(1L), elmcharset(1L)
.SH FILES
#ETC#/elm.rc customized mailer parameters
--- 205,210 ----
Index: elmME+.2.5.alpha2-cvs/doc/elmcharset.1
*** elmME+.2.5.alpha1/doc/elmcharset.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/elmcharset.1 2004-08-15 15:28:48.000000000 +0300
***************
*** 15,20 ****
--- 15,22 ----
.I "\fIclass\fR=\fIdebugfile\fR:\fIlevel\fR
.B \-I
ignore-file
+ .B \-r
+ elmrc
.B \-w
target-file
.B \-S
***************
*** 51,56 ****
--- 53,61 ----
.I ignore-list
file.
.TP
+ .B " -r" elmrc
+ Specify alternative elmrc file.
+ .TP
.B " -S" map-source-directory
Specifies directory from where missing map files are directory
to elm.map.txt directory (actually given on map-text-dir elm.rc
***************
*** 75,78 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1999-2003 by Kari Hurtta
--- 80,83 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1999-2004 by Kari Hurtta
Index: elmME+.2.5.alpha2-cvs/doc/elmlibregister.1
*** elmME+.2.5.alpha1/doc/elmlibregister.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/elmlibregister.1 2004-08-15 15:28:48.000000000 +0300
***************
*** 44,49 ****
--- 44,53 ----
.I elmrc-write
was compiled with debugging enabled.
.TP
+ .B " -r" elmrc
+ Changes elmrc file (but you probably should use
+ target-file option instead.)
+ .TP
.B " -w" target-file
Gives file for output.
.TP
***************
*** 60,63 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 2003 by Kari Hurtta

--- 64,67 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 2003,2004 by Kari Hurtta

Index: elmME+.2.5.alpha2-cvs/doc/elmrc-write.1
*** elmME+.2.5.alpha1/doc/elmrc-write.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/elmrc-write.1 2004-08-15 15:28:48.000000000 +0300
***************
*** 40,45 ****
--- 40,49 ----
.I elmrc-write
was compiled with debugging enabled.
.TP
+ .B " -r" elmrc
+ Changes elmrc file (but you probably should use
+ target-file option instead.)
+ .TP
.B " -w" target-file
Gives file for output.
.TP
***************
*** 56,60 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2001,2002 by Kari Hurtta

--- 60,64 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2001-2004 by Kari Hurtta

Index: elmME+.2.5.alpha2-cvs/doc/elmstringconvert.1
*** elmME+.2.5.alpha1/doc/elmstringconvert.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/elmstringconvert.1 2004-08-15 15:28:48.000000000 +0300
***************
*** 53,58 ****
--- 53,61 ----
.I elmcharset
was compiled with debugging enabled.
.TP
+ .B " -r " elmrc
+ Specifies alternate elmrc file.
+ .TP
.B " -S" source-charset
Specifies MIME charset used on source files. Files are read
one line at time. And conversion for lines are done independently
***************
*** 77,80 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2002,2003 by Kari Hurtta
--- 80,83 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2002-2004 by Kari Hurtta
Index: elmME+.2.5.alpha2-cvs/doc/elmterminal.1
*** elmME+.2.5.alpha1/doc/elmterminal.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/elmterminal.1 2004-08-15 15:28:48.000000000 +0300
***************
*** 40,45 ****
--- 40,48 ----
.I elmterminal
was compiled with debugging enabled.
.TP
+ .B " -r" elmrc
+ Specifies alternate elmrc file.
+ .TP
.B " -w" target-file
Gives file for output.
.SH AUTHOR
***************
*** 56,59 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2000-2002 by Kari Hurtta
--- 59,62 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2000-2004 by Kari Hurtta
Index: elmME+.2.5.alpha2-cvs/doc/elmunidata.1
*** elmME+.2.5.alpha1/doc/elmunidata.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/elmunidata.1 2004-08-15 15:39:29.000000000 +0300
***************
*** 49,54 ****
--- 49,57 ----
.B " -T" text-target-file
Gives file for output of textual (un)dump of unicode data.
.TP
+ .B " -r" elmrc
+ Species alternate elmrc file.
+ .TP
.B " -I"
Use system unidata file as target file.
.TP
***************
*** 69,72 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2001,2002 by Kari Hurtta
--- 72,75 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2001-2004 by Kari Hurtta
Index: elmME+.2.5.alpha2-cvs/doc/frm.1
*** elmME+.2.5.alpha1/doc/frm.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/frm.1 2004-08-15 09:30:00.000000000 +0300
***************
*** 10,16 ****
.SH SYNOPSIS
.B frm
.RB [ \-d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR ]
! .RB [ \-hnQqStv ]
.RB [ \-s\ \fIstatus\fP ]
[folder | username] ...
.br
--- 10,16 ----
.SH SYNOPSIS
.B frm
.RB [ \-d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR ]
! .RB [ \-hnMQqStv ]
.RB [ \-s\ \fIstatus\fP ]
[folder | username] ...
.br
***************
*** 53,58 ****
--- 53,61 ----
.B \-h
Print a brief help message summarizing the options.
.TP
+ .B \-M
+ Magic mode - treat all folders as if they were the spool folder
+ .TP
.B \-n
Number the messages using the same numbering scheme that, for
example, \fIreadmsg\fR will understand.
***************
*** 66,71 ****
--- 69,77 ----
Quiet mode. Output only a one-line summary for each mailbox or folder
specified.
.TP
+ .B \-r \fIelmrc
+ Rcfile - use file specified rather than the default elmrc.
+ .TP
.B \-S
Summarize the number of messages by message status in each mailbox or
folder. If you want just a summary line, use this in conjunction with the
***************
*** 145,151 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2002 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
--- 151,159 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
! .br

! Based on Elm 2.5, \fB\*(ct\fRCopyright 1988-1995 by The USENET Community Trust
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
Index: elmME+.2.5.alpha2-cvs/doc/newmail.1
*** elmME+.2.5.alpha1/doc/newmail.1 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/doc/newmail.1 2004-08-15 09:37:44.000000000 +0300
***************
*** 11,17 ****
.B newmail
.B [-d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR]
.B [-i \fIinterval\fB]
! .B [-w]
\fIfile-spec\fR {\fIfile-spec\fR...}
.br
.B wnewmail
--- 11,17 ----
.B newmail
.B [-d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR]
.B [-i \fIinterval\fB]
! .B [-wM]
\fIfile-spec\fR {\fIfile-spec\fR...}
.br
.B wnewmail
***************
*** 85,90 ****
--- 85,96 ----
to less than 10 seconds, the program will warn you that it isn't
recommended.\fR
.TP
+ .B "-M"
+ Magic mode - treat all folders as if they were the spool folder.
+ .TP
+ .B "-r \Fielmrc\fR"
+ Specifies alternate elmrc file.
+ .TP
.B "-w"
Use of the ``-w'' flag will simulate having the program run
from within a window (e.g. the more succinct output format,
***************
*** 155,161 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2001 by Kari Hurtta
.br

Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
--- 161,167 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
Index: elmME+.2.5.alpha2-cvs/hdrs/elm_globals.h
*** elmME+.2.5.alpha1/hdrs/elm_globals.h 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/elm_globals.h 2004-08-15 20:26:27.000000000 +0300
***************
*** 1,7 ****


! /* $Id: elm_globals.h,v 1.1.2.3 2004/07/03 15:23:03 hurtta Exp $ */

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.1.2.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! /* $Id: elm_globals.h,v 1.1.2.6 2004/08/15 17:26:27 hurtta Exp $ */

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.1.2.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 182,189 ****


#define MAIL_HAVE_ATTACHMENTS (1<<5) /* Flag for verify transmission */

#define MAIL_HAVE_PGP_ENCODED (1<<6) /* Flag for verify transmission */

#define MAIL_MIME_ATTCH (1<<7) /* mimeforward */

- #if 0 /* XXXX not used */

/*


* "opmode" global - current operation mode settings.

--- 182,190 ----


#define MAIL_HAVE_ATTACHMENTS (1<<5) /* Flag for verify transmission */

#define MAIL_HAVE_PGP_ENCODED (1<<6) /* Flag for verify transmission */

#define MAIL_MIME_ATTCH (1<<7) /* mimeforward */

+ #define MAIL_COPY_SELECTION (1<<8) /* canceled mail */

+ #define MAIL_DELETE_CANCEL (1<<9) /* And delete canceled_view mail also */


/*


* "opmode" global - current operation mode settings.

***************
*** 193,223 ****


#define OPMODE_READ_NONEMPTY 011 /* ...only read if non-empty */

#define OPMODE_SEND 020 /* running in send-only mode */

#define OPMODE_SEND_BATCH 021 /* ...performing batch send */

#define OPMODE_IS_READMODE(op) (((op) & OPMODE_READ) != 0)

#define OPMODE_IS_SENDMODE(op) (((op) & OPMODE_SEND) != 0)

! #define OPMODE_IS_INTERACTIVE(op) ((op) != OPMODE_SEND_BATCH)
! /*
! * "opmode" global - current operation mode settings.
! */
!
! #define OPMODE_READ 010 /* running in folder read mode */
! #define OPMODE_READ_NONEMPTY 011 /* ...only read if non-empty */
! #define OPMODE_SEND 020 /* running in send-only mode */
! #define OPMODE_SEND_BATCH 021 /* ...performing batch send */
!
! #define OPMODE_IS_READMODE(op) (((op) & OPMODE_READ) != 0)
! #define OPMODE_IS_SENDMODE(op) (((op) & OPMODE_SEND) != 0)
! #define OPMODE_IS_INTERACTIVE(op) ((op) != OPMODE_SEND_BATCH)
!
!
! #endif
!



/******** global variables accessable by all pieces of the program *******/

- EXTERN int check_size; /* don't start mailer if no mail */
EXTERN int inalias; /* TRUE if in the alias menu */


EXTERN int last_current INIT(-1); /* previous current message */

EXTERN int last_header_page INIT(-1); /* last header page */

--- 194,209 ----


#define OPMODE_READ_NONEMPTY 011 /* ...only read if non-empty */

#define OPMODE_SEND 020 /* running in send-only mode */

#define OPMODE_SEND_BATCH 021 /* ...performing batch send */

+ #define OPMODE_CHECK_ONLY 040 /* check_only ... not on Elm 2.5 */



#define OPMODE_IS_READMODE(op) (((op) & OPMODE_READ) != 0)

#define OPMODE_IS_SENDMODE(op) (((op) & OPMODE_SEND) != 0)

! #define OPMODE_IS_INTERACTIVE(op) ((op) != OPMODE_SEND_BATCH && \
! (op) != OPMODE_CHECK_ONLY)




/******** global variables accessable by all pieces of the program *******/

EXTERN int inalias; /* TRUE if in the alias menu */


EXTERN int last_current INIT(-1); /* previous current message */

EXTERN int last_header_page INIT(-1); /* last header page */

***************
*** 250,259 ****

EXTERN int write_elmrc; /* flag: write elmrc in starting */

- EXTERN int mail_only; /* flag: send mail then leave? */
- EXTERN int check_only; /* flag: check aliases and leave? */
- EXTERN int batch_only; /* flag: send without prompting? */
-
EXTERN long size_of_pathfd; /** size of pathfile, 0 if none **/

EXTERN FILE *pathfd; /* path alias file */
--- 236,241 ----
***************
*** 267,273 ****

#ifdef USE_PGP
EXTERN int pgp_status;
- EXTERN int pgp_keeppassfor; /* how long to keep it before expiring */
#endif

EXTERN int me_retcode;
--- 249,254 ----
Index: elmME+.2.5.alpha2-cvs/hdrs/elmlib.h
*** elmME+.2.5.alpha1/hdrs/elmlib.h 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/elmlib.h 2004-08-14 15:06:08.000000000 +0300
***************
*** 1,7 ****


! /* $Id: elmlib.h,v 1.207.4.16 2004/07/03 15:23:03 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207.4.16 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.207.4.20 2004/08/14 12:06:08 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207.4.20 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 678,683 ****
--- 678,685 ----
extern struct terminal_map_item * system_terminal_map;
extern struct terminal_map_item * user_terminal_map;

+ extern void set_user_rc_location P_((char *p));
+
extern void locale_init P_((void)); /* sets locale and elm_msg_cat */
extern void user_init P_((void)); /* get username and home directory */
extern int init_defaults P_((void));
***************
*** 789,794 ****
--- 791,797 ----


extern int charset_convert_ok; /* flag: no warning about conversion? */
extern char raw_text_charset[SLEN]; /* name of character set */
extern charset_t text_charset; /* pointer to character set */
+ extern ESTR dead_letter_dir_e; /* Canceled.mail.dir */
extern char raw_default_mimetext_charset[SLEN]; /* name of character set */
extern charset_t default_mimetext_charset; /* pointer to character set */

extern char raw_default_nomime_charset[SLEN]; /* name of character set */
***************
*** 1118,1124 ****

extern int give_dir_flags P_((struct folder_browser *dir));
extern struct folder_info *
! folder_from_dir_item P_((struct folder_browser *dir));

extern int create_selection_dir P_((struct folder_browser *dir));

--- 1121,1127 ----

extern int give_dir_flags P_((struct folder_browser *dir));
extern struct folder_info *
! folder_from_dir_item P_((struct folder_browser *dir, int treat_as_spool));

extern int create_selection_dir P_((struct folder_browser *dir));

***************
*** 1209,1215 ****
enum close_mode mode));
extern void flush_folder P_((struct folder_info *folder));

! extern struct folder_info *enter_new_folder P_((char *new_file)); /* create */
extern void leave_old_folder P_((struct folder_info **folder,
enum close_mode mode)); /* free */

--- 1212,1219 ----
enum close_mode mode));
extern void flush_folder P_((struct folder_info *folder));

! extern struct folder_info *enter_new_folder P_((char *new_file,
! int treat_as_spooled)); /* create */
extern void leave_old_folder P_((struct folder_info **folder,
enum close_mode mode)); /* free */

***************
*** 2301,2306 ****
--- 2305,2329 ----



extern char *pmalloc P_((int size));

+ /* cancel.c */
+
+ typedef void cancel_set_ttysig_f P_(());
+ typedef void cancel_reset_ttysig_f P_(());
+ typedef void cancel_transient_f P_((struct string *x));
+ typedef void cancel_clear_f P_((void));
+
+ extern void setup_cancel_cb P_((cancel_set_ttysig_f *cancel_set_ttysig,
+ cancel_reset_ttysig_f *cancel_reset_ttysig,
+ cancel_transient_f *cancel_transient,
+ cancel_clear_f *cancel_clear));
+
+ extern struct chancel_data * new_cancel P_((const char * format,
+ const char *msg, ...));
+
+
+ extern int is_canceled P_((struct chancel_data *cd));
+
+ extern void free_cancel P_((struct chancel_data **cd));

/*
* Local Variables:
Index: elmME+.2.5.alpha2-cvs/hdrs/mbx_imp.h
*** elmME+.2.5.alpha1/hdrs/mbx_imp.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/mbx_imp.h 2004-08-14 15:06:08.000000000 +0300
***************
*** 1,7 ****
! /* $Id: mbx_imp.h,v 1.66.4.1 2004/04/25 14:52:37 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66.4.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: mbx_imp.h,v 1.66.4.2 2004/08/14 12:06:08 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.66.4.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 471,477 ****
struct string * item));

typedef struct folder_info *
! browser_folder_from_dir P_((struct folder_browser *dir));

typedef int browser_create_selection_dir P_((struct folder_browser *dir));

--- 471,478 ----
struct string * item));

typedef struct folder_info *
! browser_folder_from_dir P_((struct folder_browser *dir,
! int treat_as_spooled));

typedef int browser_create_selection_dir P_((struct folder_browser *dir));

***************
*** 651,657 ****

extern struct folder_info *mbx_new_folder P_((void));
extern folder_type_p get_folder_type P_((CONST char *filename,
! enum folder_place *in_mail));

extern int in_directory P_((struct stat *buf1, const char *name,
const char * dir));
--- 652,659 ----

extern struct folder_info *mbx_new_folder P_((void));
extern folder_type_p get_folder_type P_((CONST char *filename,
! enum folder_place *in_mail,
! int treat_as_spooled));

extern int in_directory P_((struct stat *buf1, const char *name,
const char * dir));
***************
*** 696,702 ****
int sep,
charset_t default_charset));
extern struct folder_info * real_folder_from_local
! P_((struct folder_browser *dir));
extern int real_selection_is_local P_((struct folder_browser *dir,
struct folder_info *folder));

--- 698,705 ----
int sep,
charset_t default_charset));
extern struct folder_info * real_folder_from_local
! P_((struct folder_browser *dir,
! int treat_as_spooled));
extern int real_selection_is_local P_((struct folder_browser *dir,
struct folder_info *folder));

Index: elmME+.2.5.alpha2-cvs/hdrs/me.h
*** elmME+.2.5.alpha1/hdrs/me.h 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/me.h 2004-08-14 15:06:09.000000000 +0300
***************
*** 1,7 ****


! /* $Id: me.h,v 1.87.8.10 2004/07/03 15:23:03 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87.8.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.87.8.14 2004/08/14 12:06:09 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87.8.14 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 22,27 ****
--- 22,29 ----

extern char * wanted_icon_string;
extern char * with_title;
extern char * wanted_mailbox_title;
+ extern int opmode;
+ extern int TreatAsSpooled;

extern struct Attachments {
mime_t *attach_files; /* prepare attachments for sending */


***************
*** 87,114 ****

/* Return key if unknown */
extern int motion P_((int ch, struct menu_common *mc,
! int *redraw, int *nufoot,
int *header_page,
struct menu_context *page));
extern void check_range P_((struct menu_common *mc));
extern void forget_passphrase P_((void) );

extern int mailbox_command P_((struct MailboxView *mailbox, int ch,
! int *redraw, int *nufoot,
showmsg_cmd cmdX,
struct AliasView *aview,
int *header_page,
struct menu_context *page
));
extern void new_mail_check P_((struct MailboxView *mailbox,
! int *redraw, int *header_page,
struct menu_context *page));


/* help.c */

extern int display_helpfile P_((int section));
! extern int help P_((int pager_help, struct menu_context *page));

/* in_utils.c */

--- 89,116 ----



/* Return key if unknown */
extern int motion P_((int ch, struct menu_common *mc,
! int *nufoot,
int *header_page,
struct menu_context *page));
extern void check_range P_((struct menu_common *mc));
extern void forget_passphrase P_((void) );

extern int mailbox_command P_((struct MailboxView *mailbox, int ch,
! int *nufoot,
showmsg_cmd cmdX,
struct AliasView *aview,
int *header_page,
struct menu_context *page
));
extern void new_mail_check P_((struct MailboxView *mailbox,
! int *header_page,
struct menu_context *page));


/* help.c */

extern int display_helpfile P_((int section));
! extern void help P_((int pager_help, struct menu_context *page));

/* in_utils.c */

***************

*** 116,128 ****
int clear_and_center,
struct menu_context *page));


extern int read_number P_((int ch, const struct string *item, int current,
- int *redraw,
struct menu_context *page));

#define PROMPT_center 1

#define PROMPT_yesno 2
#define PROMPT_redraw_mark 4
! #define PROMTP_ctrlL 8

extern int prompt_letter P_((int line, char *letters, int def,
int flags,

--- 118,130 ----
int clear_and_center,
struct menu_context *page));


extern int read_number P_((int ch, const struct string *item, int current,

struct menu_context *page));

#define PROMPT_center 1

#define PROMPT_yesno 2
#define PROMPT_redraw_mark 4
! #define PROMPT_ctrlL 8
! #define PROMPT_cancel 16

extern int prompt_letter P_((int line, char *letters, int def,
int flags,

***************
*** 138,143 ****
--- 140,146 ----


#define OE_ALLOW_MIMEENC (1<<5)
#define OE_EDITOR_ESCAPE (1<<6)
#define OE_TABACTION (1<<7)
+ #define OE_SIG_CHAR (1<<8)

extern int optionally_enter2 P_((struct menu_context *page,
struct string **buffer,
***************

*** 224,230 ****


extern int match_in_message P_((struct string *pat,

struct MailboxView *mailbox,


struct AliasView *aview));
! extern int pattern_match P_((struct menu_common *mc, int *redraw,

int header_page, struct menu_context *page));

extern int meta_match P_((int function, struct menu_common *mc,
int meta_match, struct menu_context *page));

--- 227,233 ----


extern int match_in_message P_((struct string *pat,

struct MailboxView *mailbox,


struct AliasView *aview));
! extern int pattern_match P_((struct menu_common *mc,

int header_page, struct menu_context *page));

extern int meta_match P_((int function, struct menu_common *mc,

int meta_match, struct menu_context *page));
***************
*** 322,328 ****



extern int expand_filename P_((char *, int, int));
extern void init_helpmsg P_(( char *, char *, int, int ));
! extern int save P_((int *redraw, int silently, int delete, int text_only,

struct MailboxView *mailbox,


struct AliasView *aview, int header_page,
struct menu_context *page));

--- 325,331 ----

extern int expand_filename P_((char *, int, int));
extern void init_helpmsg P_(( char *, char *, int, int ));
! extern int save P_((int silently, int delete, int text_only,

struct MailboxView *mailbox,
struct AliasView *aview, int header_page,
struct menu_context *page));
***************
*** 336,344 ****


extern int pgp_menu P_((char *filename,

struct mailing_headers *headers,
struct menu_context *page));

! extern int pgp_extract_public_key P_((struct header_rec *hdr,
! FILE *infile));

! extern int pgp_mail_public_key P_((struct MailboxView *mailbox,
struct AliasView *aview,


struct menu_context *page));
#endif
--- 339,348 ----
extern int pgp_menu P_((char *filename,

struct mailing_headers *headers,
struct menu_context *page));

! extern void pgp_extract_public_key P_((struct header_rec *hdr,
! FILE *infile,
! struct menu_context *page));
! extern void pgp_mail_public_key P_((struct MailboxView *mailbox,


struct AliasView *aview,
struct menu_context *page));

#endif
***************
*** 490,506 ****
/* mailmsg1.c */


! extern int a_sendmsg P_((int edit_message, int form_letter,
struct MailboxView *mailbox,


struct AliasView *aview, int header_page,
struct menu_context *page));

! extern int send_msg_argv P_((char *argv[],
char *given_subject,int options, int form,
struct MailboxView *mailbox /* null ?? */,

struct AliasView *aview,


struct menu_context *page));

! extern int send_msg_l P_((int index,
struct addr_item *given_to,
struct addr_item *given_cc,
char *given_subject,

--- 494,510 ----
/* mailmsg1.c */


! extern void a_sendmsg P_((int edit_message, int form_letter,
struct MailboxView *mailbox,


struct AliasView *aview, int header_page,
struct menu_context *page));

! extern void send_msg_argv P_((char *argv[],
char *given_subject,int options, int form,
struct MailboxView *mailbox /* null ?? */,

struct AliasView *aview,
struct menu_context *page));

! extern void send_msg_l P_((int index,


struct addr_item *given_to,
struct addr_item *given_cc,
char *given_subject,

***************
*** 512,520 ****


extern void display_to P_((struct expanded_address address,

struct menu_context *page));


extern int get_to P_((struct expanded_address *to,
! struct mailer_info *mailer_info,
! struct AliasView *aview,
! struct menu_context *page));


/* mailmsg2.c */

--- 516,526 ----


extern void display_to P_((struct expanded_address address,

struct menu_context *page));


extern int get_to P_((struct expanded_address *to,

! struct mailer_info *mailer_info,
! struct AliasView *aview,
! struct menu_context *page,
! struct MailboxView *cancel_view,
! int *cancel_selection));


/* mailmsg2.c */
***************

*** 525,541 ****



extern struct string * gen_From_buffer P_((const struct header_rec * current_header));

! extern int mail P_((int idx,
! int options, int form,
! struct mailing_headers *headers,
! struct mailer_info *mailer_info,

! struct MailboxView *mailbox /* system_call() */,
! struct AliasView *aview));


! extern int mail_form P_((int mail_index,
struct addr_item *address,
char *subj,
struct MailboxView *mailbox,

! struct AliasView *aview));

/* id_phrase.c */

--- 531,559 ----



extern struct string * gen_From_buffer P_((const struct header_rec * current_header));

! extern void mail P_((int idx,
! int options, int form,
! struct mailing_headers *headers,
! struct mailer_info *mailer_info,
! struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *parent_page,
! struct MailboxView *selection_view,
! int selection_idx));
!

! extern void mail_form P_((int mail_index,


struct addr_item *address,
char *subj,
struct MailboxView *mailbox,

! struct AliasView *aview,
! struct menu_context *page));
!
! /* canceled.c */
!
! extern char * last_canceled_mail;
! extern int view_canceled_mails P_((struct MailboxView * cancel_view,
! int *cancel_selection,
! struct AliasView *aview));

/* id_phrase.c */

***************

*** 565,580 ****


extern int system_call P_((char *, VOLATILE int,
struct MailboxView *mailbox));
#ifdef ALLOW_SUBSHELL
! extern int subshell P_((struct MailboxView *mailbox,
struct menu_context *page));
#endif
! extern int do_pipe P_((struct MailboxView *mailbox,

struct menu_context *page));


extern int have_printout P_((void));
! extern int print_msg P_((int pause_on_scroll,

struct MailboxView *mailbox,


struct menu_context *page));
! extern int print_text P_((int pause_on_scroll,
struct MailboxView *mailbox,

int header_page,
struct menu_context *page));

--- 583,598 ----


extern int system_call P_((char *, VOLATILE int,
struct MailboxView *mailbox));
#ifdef ALLOW_SUBSHELL
! extern void subshell P_((struct MailboxView *mailbox,
struct menu_context *page));
#endif
! extern void do_pipe P_((struct MailboxView *mailbox,

struct menu_context *page));


extern int have_printout P_((void));
! extern void print_msg P_((int pause_on_scroll,

struct MailboxView *mailbox,


struct menu_context *page));
! extern void print_text P_((int pause_on_scroll,
struct MailboxView *mailbox,
int header_page,

struct menu_context *page));
***************


*** 686,702 ****
/* utils.c */

extern void emergency_exit P_((int interrupt));
! extern void leave P_((int interrupt,
! struct MailboxView **mailbox,
! struct AliasView **aview));
extern void create_new_folders P_((void));
extern void create_new_elmdir P_((void));
! extern void rm_temps_exit P_((struct MailboxView **mailbox,
! struct AliasView **aview));
! extern void silently_exit P_((struct MailboxView **mailbox,
! struct AliasView **aview));
! extern void leave_locked P_((struct MailboxView **mailbox,
! struct AliasView **aview));
extern int get_page P_((int msg_pointer, struct menu_common *mc,
int *header_page));

--- 704,715 ----


/* utils.c */

extern void emergency_exit P_((int interrupt));
! extern void leave P_((int interrupt));
extern void create_new_folders P_((void));
extern void create_new_elmdir P_((void));
! extern void rm_temps_exit P_((void));
! extern void silently_exit P_((void));
! extern void leave_locked P_((void));
extern int get_page P_((int msg_pointer, struct menu_common *mc,
int *header_page));

***************

*** 717,731 ****


extern void get_return_name P_((char *address, char *name,
int trans_to_lowercase,
int size));

! extern int forward P_((int index,


struct MailboxView *mailbox,
struct AliasView *aview,

struct menu_context *page));
! extern int reply_to_everyone P_((int index,

struct MailboxView *mailbox,
struct AliasView *aview,

struct menu_context *page));
! extern int reply P_((int index,

struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));

--- 730,744 ----


extern void get_return_name P_((char *address, char *name,
int trans_to_lowercase,
int size));

! extern void forward P_((int index,


struct MailboxView *mailbox,
struct AliasView *aview,

struct menu_context *page));
! extern void reply_to_everyone P_((int index,

struct MailboxView *mailbox,
struct AliasView *aview,

struct menu_context *page));
! extern void reply P_((int index,

struct MailboxView *mailbox,
struct AliasView *aview,
struct menu_context *page));

***************
*** 852,860 ****


extern void quit P_((int prompt, struct MailboxView **mailbox,
struct AliasView **aview, int *header_page,

struct menu_context *page));


! extern int resync P_((struct MailboxView **mailbox, int *header_page,

struct menu_context *page));


! extern int change_file P_((struct MailboxView **mailbox,
struct AliasView *aview,
int *header_page,
struct menu_context *page));

--- 865,873 ----


extern void quit P_((int prompt, struct MailboxView **mailbox,
struct AliasView **aview, int *header_page,

struct menu_context *page));


! extern void resync P_((struct MailboxView **mailbox, int *header_page,

struct menu_context *page));


! extern void change_file P_((struct MailboxView **mailbox,
struct AliasView *aview,
int *header_page,

struct menu_context *page));
***************
*** 903,909 ****



/* edit.c */

! extern void edit_mailbox P_((struct MailboxView *mailbox,
int *header_mailbox,

struct menu_context *page));


extern int edit_a_file P_((const char *editfile,

--- 916,922 ----



/* edit.c */

! extern void edit_mailbox P_((struct MailboxView **mailbox,
int *header_mailbox,

struct menu_context *page));


extern int edit_a_file P_((const char *editfile,
***************

*** 919,925 ****



extern int visible_to_index P_((int message,
struct menu_common *mc));
! extern int limit P_((struct menu_common *mc,
struct menu_context *page));
extern void ClearSelection P_((struct MailboxView *mailbox));

--- 932,938 ----



extern int visible_to_index P_((int message,
struct menu_common *mc));
! extern void limit P_((struct menu_common *mc,
struct menu_context *page));
extern void ClearSelection P_((struct MailboxView *mailbox));

***************

*** 943,949 ****


enum word_sel { word_change, word_save, word_copy, word_save_copy,
word_read };

! extern void gen_browser P_((struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
int *redraw,

--- 956,962 ----


enum word_sel { word_change, word_save, word_copy, word_save_copy,
word_read };

! extern int gen_browser P_((struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
int *redraw,
***************

*** 1012,1025 ****
long content_start,
header_list_ptr parsed_headers));

- extern struct MailboxView * current_mailbox;
-

/* Better handling of current mailbox:

idx == 0 first
*/

extern struct MailboxView * give_next_open_mailbox P_((int *idx,


int signal));

/* Joins storage to new view */
extern struct MailboxView * malloc_mailbox_view P_((struct current_storage *

--- 1025,1037 ----
long content_start,
header_list_ptr parsed_headers));


/* Better handling of current mailbox:

idx == 0 first
*/


extern struct MailboxView * give_next_open_mailbox P_((int *idx,
int signal));
+ extern void free_all_mailboxes P_((void));

/* Joins storage to new view */
extern struct MailboxView * malloc_mailbox_view P_((struct current_storage *
***************

*** 1132,1152 ****



extern int have_partial P_((struct MailboxView *parent_mailbox));

! /* screen/screen.c */



extern int InitScreen P_((struct menu_context **page));

extern void ScreenSize P_((int *lines, int *columns));

extern int has_highlighting; /* highlighting available? */

- /* -1 == no changes */
- extern void set_root_menu(int lines, int columns);
-

#define READCH_MASK 0x0FFF /* Mask flags off */

#define READCH_CURSOR 0x1000 /* Return cursor keys */

#define READCH_NOCURSOR 0x2000 /* Disable cursor keys */
#define READCH_term_char 0x4000 /* Return term chars */
#define READCH_resize 0x8000 /* Check resize .... */

#define REDRAW_MARK 257 /* Artificial "char" for redrawing */
#define UP_MARK 258 /* Artificial UP key */

--- 1144,1181 ----



extern int have_partial P_((struct MailboxView *parent_mailbox));

! /* messages/canceled_mail.c */
!
! extern struct MailboxView *give_canceled_mail P_((void));
! extern void close_canceled_mail P_((void));
! extern FILE * add_canceled_mail P_((char **outfile,
! struct mailing_headers * headers,
! struct MailboxView *view,
! time_t X,
! int lines,
! header_list_ptr h,
! long body_offset));
! extern void delete_marked_canceled_mails P_((struct MailboxView *view));
! extern void sync_canceled_mails P_((struct MailboxView *view));
! extern int cancel_set_current P_((struct MailboxView * cancel_view,
! char *last_canceled_mail));
! extern void delete_current_cancel P_((struct MailboxView * cancel_view,
! FILE *ref_file));
!

! /* src/screen/screen.c */



extern int InitScreen P_((struct menu_context **page));

extern void ScreenSize P_((int *lines, int *columns));

extern int has_highlighting; /* highlighting available? */

#define READCH_MASK 0x0FFF /* Mask flags off */

#define READCH_CURSOR 0x1000 /* Return cursor keys */

#define READCH_NOCURSOR 0x2000 /* Disable cursor keys */
#define READCH_term_char 0x4000 /* Return term chars */
#define READCH_resize 0x8000 /* Check resize .... */
+ #define READCH_sig_char 0x10000 /* Return sig chars */
+ #define READCH_quote 0x20000 /* Try quote next control character */

#define REDRAW_MARK 257 /* Artificial "char" for redrawing */
#define UP_MARK 258 /* Artificial UP key */

***************
*** 1177,1182 ****
--- 1206,1216 ----


eof_char; /* the current end-of-file char */

/* ------------------------------------------------------- */


+ /* src/screen/context.c */
+
+ /* -1 == no changes */

+ extern void set_root_menu(int lines, int columns);
+

extern struct menu_context * default_context;

extern struct menu_context * new_menu_context P_((void));
***************

*** 1186,1191 ****
--- 1220,1227 ----


extern void menu_get_sizes P_((struct menu_context *ptr,
int *lines, int *columns));

+ extern void menu_trigger_redraw P_((struct menu_context *ptr));
+
/* called from signal handler */
extern void menu_context_resize P_((void));
extern void menu_context_redraw P_((void));
***************

*** 1196,1201 ****
--- 1232,1241 ----


int flags));


+ extern void cancel_set_ttysig_X P_(());
+ extern void cancel_reset_ttysig_X P_(());
+
+
/* ------------------------------------------------------- */

extern void Writechar P_((int ch));

***************
*** 1269,1282 ****


extern void alias_free P_((struct alias_rec **h)); /* Free's record */


!
! extern struct AliasView * current_aliaslist;

extern struct AliasView * new_aliasview P_((void));
extern void free_aliasview P_((struct AliasView **x));
extern struct alias_rec * give_alias P_((struct AliasView *aview,
int index));

extern int get_alias_count P_((struct AliasView *aview));

extern int get_total_alias_count P_((struct AliasView *aview));

--- 1309,1324 ----


extern void alias_free P_((struct alias_rec **h)); /* Free's record */


! /* src/aliases/aliases.c */

extern struct AliasView * new_aliasview P_((void));
extern void free_aliasview P_((struct AliasView **x));
extern struct alias_rec * give_alias P_((struct AliasView *aview,
int index));

+ extern void free_all_aliasviews P_((void));
+
+
extern int get_alias_count P_((struct AliasView *aview));

extern int get_total_alias_count P_((struct AliasView *aview));

Index: elmME+.2.5.alpha2-cvs/hdrs/melib.h
*** elmME+.2.5.alpha1/hdrs/melib.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/melib.h 2004-08-07 21:07:15.000000000 +0300
***************
*** 1,7 ****
! /* $Id: melib.h,v 1.43.8.1 2004/04/18 16:55:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: melib.h,v 1.43.8.2 2004/08/07 18:07:15 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 130,135 ****
--- 130,138 ----

extern int mime_notplain P_((mime_t *p));

+ /* 0: failure, 1: succeed */
+ extern int run_cte_decoder P_((mime_t *, in_state_t *, out_state_t *));
+

/* mime_parse.c */

Index: elmME+.2.5.alpha2-cvs/hdrs/menu2.h
*** elmME+.2.5.alpha1/hdrs/menu2.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/menu2.h 2004-07-19 12:19:59.000000000 +0300
***************
*** 1,7 ****
! /* $Id: menu2.h,v 1.5 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: menu2.h,v 1.5.8.1 2004/07/19 09:19:59 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,27 ****
int size;
};

! extern void generic_menu P_((struct menu_item items[], int max,
char *prompt, char *title));


--- 21,27 ----
int size;
};

! extern int generic_menu P_((struct menu_item items[], int max,
char *prompt, char *title));


Index: elmME+.2.5.alpha2-cvs/hdrs/save_opts.h
*** elmME+.2.5.alpha1/hdrs/save_opts.h 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/save_opts.h 2004-08-07 21:07:16.000000000 +0300
***************
*** 1,7 ****


! /* @(#)$Id: save_opts.h,v 1.82.2.15 2004/07/03 15:23:04 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.82.2.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* @(#)$Id: save_opts.h,v 1.82.2.16 2004/08/07 18:07:16 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.82.2.16 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 321,326 ****
--- 321,327 ----


{"convert-comment-to-fullname",-1L,ZZZ_DT_BOL(&convert_comment), 0, NULL},
{"convert-utf-header",-1L,ZZZ_DT_BOL(&convert_utf_header), 0, NULL},
{"copy", -1L,ZZZ_DT_BOL(&auto_copy_sent), 0, NULL},
+ {"dead-letter-dir", -1L,ZZZ_DT_ESTR(&dead_letter_dir_e), 0, NULL},
{"default-folder-status", -1L,ZZZ_DT_NUM(&def_folder_status),
sizeof def_folder_status, &DEF_FOLDER_STATUS},
{"default-mime-text-charset",-1L,ZZZ_DT_STR(raw_default_mimetext_charset),

Index: elmME+.2.5.alpha2-cvs/hdrs/s_elm.h
*** elmME+.2.5.alpha1/hdrs/s_elm.h 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/s_elm.h 2004-08-14 15:06:09.000000000 +0300


***************
*** 359,366 ****
#define ElmSendingMail 0x18f
#define ElmMailerReturnedError 0x190
#define ElmMailSent 0x191
- #define ElmRecallLastInstead 0x192
- #define ElmRecallLastKept 0x193
#define ElmErrorTryingToWrite 0x19a
#define ElmNoEncryptInBatch 0x19b
#define ElmWriteFailedCopyAcross 0x19c
--- 359,364 ----
***************

*** 466,472 ****
#define ElmDirNoticeQuit 0x225
#define ElmArgsIngoringDebug 0x226
#define ElmArgsTooManyAddresses 0x227
- #define ElmArgsSubjectNotSend 0x228


#define ElmCouldNotOpenNewElmrc 0x22a
#define ElmBadSortKeyInElmrc 0x22b
#define ElmBadAliasSortInElmrc 0x22c

--- 464,469 ----
***************
*** 645,651 ****
#define ElmCantStatIncludedFile 0x2ed
#define ElmCantOpenIncludedFile 0x2ee
#define ElmPressAnyKeyIndex 0x2ef
- #define ElmArgsInclFileNotSend 0x2f0
#define ElmArgsInclFileBatch 0x2f1
#define ElmOptionArrowMenu 0x2f8
#define ElmOptionArrowHelp 0x2f9
--- 642,647 ----


***************
*** 726,732 ****
#define ElmVfyMenuIspell 0x34c
#define ElmVfyMenuShell 0x34d
#define ElmVfyMenuSndFgt 0x34e
- #define ElmVfyMessageKept 0x34f
#define ElmVfyNoFieldsInForm 0x350
#define ElmHelpViewAttach 0x351
#define ElmBadModeInElmrc 0x352

--- 722,727 ----
***************
*** 888,894 ****
#define ElmReadDataIncrement 0x3fd
#define ElmLeaveErrorLockFolder 0x3fe
#define ElmSorryCantReopenTemp 0x3ff
- #define ElmArgsAttachFileNotSend 0x400
#define ElmPadRevThread 0x401
#define ElmAbrRevThread 0x402
#define ElmLongRevThread 0x403
--- 883,888 ----
***************
*** 1106,1108 ****
--- 1100,1120 ----
#define ElmNoRecipientsKeptMessage 0x872
#define ElmNoRecipients 0x873
#define ElmMimeFWMessageYN 0x874
+ #define ElmBadDeadLetterDir 0x875
+ #define ElmDeadLetterDirCreated 0x876
+ #define ElmCanceledMailsOn 0x877
+ #define ElmCanceledMails 0x878
+ #define ElmMDirectoryOn 0x879
+ #define ElmMDirectory 0x87a
+ #define ElmIsCanceledX 0x87b
+ #define ElmIsCanceled1 0x87c
+ #define ElmSelectCanMessage 0x87d
+ #define ElmCancelMenuLine1 0x87e
+ #define ElmCancelMenuLine2 0x87f
+ #define ElmCancelMenuLine3 0x880
+ #define ElmVfyMessageKept1 0x881
+ #define ElmFailedUserRC 0x882
+ #define ElmArgsNoFileBatch 0x883
+ #define ElmMagicOn 0x884
+ #define ElmMagicOff 0x88f
+ #define ElmChangeMailbox 0x890
Index: elmME+.2.5.alpha2-cvs/hdrs/s_me.h
*** elmME+.2.5.alpha1/hdrs/s_me.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha2-cvs/hdrs/s_me.h 2004-07-19 12:19:59.000000000 +0300


***************
*** 331,333 ****
--- 331,335 ----
#define MeDecodeUseOtoOverride 0x15f
#define MeSuboptimalInElmrc 0x160
#define MeUUDECODECorrupt 0x161
+ #define MeCanceled 0x162
+ #define MeConnectCanceled 0x163

Index: elmME+.2.5.alpha2-cvs/lib/cancel.c
*** /tmp/29622-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-15 20:45:40.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/cancel.c 2004-07-19 12:19:59.000000000 +0300
***************
*** 0 ****
--- 1,253 ----
+ static char rcsid[] = "@(#)$Id: cancel.c,v 1.2.8.1 2004/07/19 09:19:59 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2.8.1 $ $State: Exp $
+ *


+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+
+

+ #include "elm_defs.h"
+ #include "s_me.h"
+
+ DEBUG_VAR(Debug,__FILE__,"ui");
+

+ static void cancel_set_ttysig_d()
+ {

+ /* NULL */
+ }
+

+ static cancel_set_ttysig_f * SET_TTYSIG = &cancel_set_ttysig_d;
+
+ static void cancel_reset_ttysig_d()
+ {

+ /* NULL */
+ }
+

+ static cancel_reset_ttysig_f * RESET_TTYSIG = &cancel_reset_ttysig_d;
+
+ static void cancel_transient_d(x)

+ struct string *x;
+ {

+ static struct chancel_data * VOLATILE current = NULL;
+

+ #ifdef POSIX_SIGNALS
+ static struct sigaction saved_state;
+ static int state_set = 0;
+
+ static void SA_HANDLER P_((int sig));
+ static void SA_HANDLER(sig)
+ int sig;
+ {

+ SIGDPRINT(Debug,1,(&Debug,"Got SIGINT ...\n"));
+

+ if (!current) {
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "SA_HANDLER",
+ "current pointer is not set",1);

+ return;
+ }
+

+ if (CANCEL_magic != current->magic)
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "SA_HANDLER",
+ "Bad current pointer",1);
+

+ current->is_canceled = 1;
+ }
+

+ #endif
+
+ struct chancel_data * new_cancel (
+ #if ANSI_C
+ const char * format,
+ const char *msg,
+ ...
+ #else
+ format,msg, va_alist

+ #endif
+ )

+ ret->previous = NULL;
+

+ if (current) {
+ if (CANCEL_magic != current->magic)
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "new_cancel",
+ "Bad current pointer",0);
+
+ ret->previous = current;
+ } else {
+ #ifdef POSIX_SIGNALS
+ struct sigaction act;
+
+ bzero((void *)&act,sizeof (act));
+
+ act.sa_handler = &SA_HANDLER;
+ sigemptyset(&(act.sa_mask)); /* No signal to mask while in handler */
+ act.sa_flags = 0;
+ #ifdef SA_INTERRUPT

+ act.sa_flags |= SA_INTERRUPT; /* SunOS */
+ #endif
+

+ state_set = 0;
+ bzero((void *)&saved_state,sizeof (saved_state));
+
+ current = ret;

+

+ if (0 == sigaction(SIGINT,&act,&saved_state)) {
+ DPRINT(Debug,10,(&Debug,"SIGINT handler installed\n"));
+ state_set = 1;
+ } else {

+ DPRINT(Debug,10,(&Debug,"Failed to set SIGINT handler\n"));
+ }
+

+ #endif
+ SET_TTYSIG();
+ }
+ current = ret;

+
+ return ret;
+ }
+

+
+ int is_canceled(cd)
+ struct chancel_data *cd;

+ {
+ int ret;


+ if (CANCEL_magic != cd->magic)
+ panic("CANCEL PANIC",__FILE__,__LINE__,
+ "is_canceled",
+ "Bad pointer (magic)",0);
+
+ ret = cd->is_canceled;
+ if (ret) {
+ struct string * X =
+ format_string(CATGETS(elm_msg_cat, MeSet, MeCanceled,
+ "%S canceled"),
+ cd->msg);
+ TRANSIENT(X);
+ free_string(&X);

+ }
+ return ret;
+ }
+

+ }
+

+ current = x->previous;
+
+ free_string (& (x->msg) );
+ x->magic = 0;
+ free(x);
+ x = NULL;
+
+ *cd = x;

+ }
+
+
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha2-cvs/lib/imap.c
*** elmME+.2.5.alpha1/lib/imap.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/imap.c 2004-08-14 15:06:09.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: imap.c,v 1.104.4.2 2004/05/01 07:41:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.104.4.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: imap.c,v 1.104.4.3 2004/08/14 12:06:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.104.4.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 4176,4185 ****


static struct folder_info *
! browser_folder_from_imap P_((struct folder_browser *dir));

! static struct folder_info * browser_folder_from_imap(dir)
struct folder_browser *dir;
{
struct folder_info * res = NULL;
struct string * Lstr = NULL;
--- 4176,4187 ----


static struct folder_info *
! browser_folder_from_imap P_((struct folder_browser *dir,
! int treat_as_spooled));

! static struct folder_info * browser_folder_from_imap(dir,treat_as_spooled)
struct folder_browser *dir;
+ int treat_as_spooled;
{
struct folder_info * res = NULL;
struct string * Lstr = NULL;
Index: elmME+.2.5.alpha2-cvs/lib/localmbx.c
*** elmME+.2.5.alpha1/lib/localmbx.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/localmbx.c 2004-08-14 15:06:09.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.64.4.3 2004/05/01 07:41:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64.4.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.64.4.4 2004/08/14 12:06:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64.4.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 1042,1058 ****
}

static struct folder_info *
! browser_folder_from_local P_((struct folder_browser *dir));

! static struct folder_info * browser_folder_from_local(dir)
struct folder_browser *dir;
{
struct folder_info * res = NULL;

DPRINT(Debug,11,(&Debug,"browser_folder_from_local: dir=%p\n",
dir));

! res = real_folder_from_local(dir);

if (res) {
DPRINT(Debug,11,(&Debug,"browser_folder_from_local=%p\n",res));
--- 1042,1060 ----
}

static struct folder_info *
! browser_folder_from_local P_((struct folder_browser *dir,
! int treat_as_spooled));

! static struct folder_info * browser_folder_from_local(dir,treat_as_spooled)
struct folder_browser *dir;
+ int treat_as_spooled;
{
struct folder_info * res = NULL;

DPRINT(Debug,11,(&Debug,"browser_folder_from_local: dir=%p\n",
dir));

! res = real_folder_from_local(dir,treat_as_spooled);

if (res) {
DPRINT(Debug,11,(&Debug,"browser_folder_from_local=%p\n",res));
Index: elmME+.2.5.alpha2-cvs/lib/MAGIC
*** elmME+.2.5.alpha1/lib/MAGIC 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/MAGIC 2004-07-19 12:19:59.000000000 +0300


***************
*** 23,28 ****
--- 23,29 ----
#define SHARED_LOADER_magic 0xF900
#define SHARED_CONNECT_magic 0xF901
#define SHARED_BASE_magic 0xF902
+ #define CANCEL_magic 0xF903
#define RF_magic 0xFA00
#define UNIDATA_magic 0xFB00
#define BINDATA_magic 0xFB01

Index: elmME+.2.5.alpha2-cvs/lib/Makefile.SH
*** elmME+.2.5.alpha1/lib/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/Makefile.SH 2004-07-19 12:19:59.000000000 +0300
***************
*** 46,52 ****
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.89.8.1 2004/04/18 16:55:36 hurtta Exp $
#


# Makefile for the ELM mail program.
#

--- 46,52 ----
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.89.8.2 2004/07/19 09:19:59 hurtta Exp $
#


# Makefile for the ELM mail program.
#

***************
*** 147,152 ****
--- 147,153 ----
mk_lockname.c \
can_access.c \
can_open.c \
+ cancel.c \
chloc.c \
charset.c \
precompiled_sets.c \
***************
*** 245,250 ****
--- 246,252 ----
mk_lockname.o \
can_access.o \
can_open.o \
+ cancel.o \
chloc.o \
charset.o \
precompiled_sets.o \
***************

*** 397,402 ****
--- 399,405 ----
atonum.o: $(INCLDIR)/elm_defs.h


bindata.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/mmaputil.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/s_me.h $(INCLDIR)/bindata.h

+
mmaputil.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/mmaputil.h
dynarray.o: $(INCLDIR)/elm_defs.h
mk_aliases.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_newalias.h
***************
*** 404,409 ****
--- 407,413 ----
mk_lockname.o: $(INCLDIR)/elm_defs.h
can_access.o: $(INCLDIR)/elm_defs.h
can_open.o: $(INCLDIR)/elm_defs.h
+ cancel.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
chloc.o: $(INCLDIR)/elm_defs.h


charset.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/shared_imp.h

Index: elmME+.2.5.alpha2-cvs/lib/mbox.c
*** elmME+.2.5.alpha1/lib/mbox.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/mbox.c 2004-08-14 15:06:09.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51.8.5 2004/07/03 15:23:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51.8.6 2004/08/14 12:06:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.8.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 17,23 ****
* Incorparated Elm 2.5 code from src/screen.c (show_message_status()):
* That code was following copyright:
*

! * The Elm Mail System - $Revision: 1.51.8.5 $ $State: Exp $
*


* Copyright (c) 1988-1995 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 17,23 ----
* Incorparated Elm 2.5 code from src/screen.c (show_message_status()):
* That code was following copyright:
*

! * The Elm Mail System - $Revision: 1.51.8.6 $ $State: Exp $
*


* Copyright (c) 1988-1995 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************

*** 600,608 ****

/* General routines -------------------------------------------------------- */

! folder_type_p get_folder_type(filename, in_mail)
CONST char *filename;
enum folder_place *in_mail;
{
/** returns the type of mailfile filename is
NO_NAME = no name
--- 600,609 ----

/* General routines -------------------------------------------------------- */

! folder_type_p get_folder_type(filename, in_mail,treat_as_spooled)
CONST char *filename;
enum folder_place *in_mail;
+ int treat_as_spooled;
{
/** returns the type of mailfile filename is
NO_NAME = no name
***************
*** 733,738 ****
--- 734,746 ----
return(READ_ONLY);
}

+ if (treat_as_spooled) {
+ DPRINT(Debug,8,(&Debug,
+ "get_folder_type=SPOOL; treat_as_spooled=%d\n",
+ treat_as_spooled));
+ return(SPOOL);
+ }
+
DPRINT(Debug,8,(&Debug,
"get_folder_type=NON_SPOOL\n"));
return(NON_SPOOL);
***************
*** 884,891 ****
}


! struct folder_info *enter_new_folder(new_file)
char *new_file;
{
struct folder_info *new_folder = NULL;

--- 892,900 ----
}


! struct folder_info *enter_new_folder(new_file, treat_as_spooled)
char *new_file;
+ int treat_as_spooled;
{
struct folder_info *new_folder = NULL;

***************
*** 903,909 ****
succees
*/
if (!remote_folder_type(new_folder)) {
! new_folder -> folder_type = get_folder_type(new_file,NULL);
new_folder -> folder_type->init_it(new_folder);
}

--- 912,919 ----
succees
*/
if (!remote_folder_type(new_folder)) {
! new_folder -> folder_type = get_folder_type(new_file,NULL,
! treat_as_spooled);
new_folder -> folder_type->init_it(new_folder);
}

Index: elmME+.2.5.alpha2-cvs/lib/outheaders.c
*** elmME+.2.5.alpha1/lib/outheaders.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/outheaders.c 2004-08-07 21:07:16.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14.8.5 2004/07/03 15:23:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14.8.6 2004/08/07 18:07:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 212,223 ****
panic("HEADERS PANIC",__FILE__,__LINE__,"free_expanded_address",
"Bad magic number",0);


! if (x->addrs_len)
free_addr_items(x->addrs);
! x->addrs = NULL;
x->addrs_len = 0;

! if (x->surface_len) {
for (i = 0; i < x->surface_len; i++) {
if (x->surface[i].Textual) {
free_string (&(x->surface[i].Textual));
--- 212,224 ----

panic("HEADERS PANIC",__FILE__,__LINE__,"free_expanded_address",
"Bad magic number",0);

+
for (j = 0; TMP[j].addr && TMP[j].fullname; j++) {

int pos = add_expanded_addr_(result,
TMP[j].addr,

Index: elmME+.2.5.alpha2-cvs/lib/output.c
*** elmME+.2.5.alpha1/lib/output.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/output.c 2004-07-19 12:20:00.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: output.c,v 1.32.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: output.c,v 1.32.8.2 2004/07/19 09:20:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1352,1363 ****
}


! int lib_transient P_((CONST char * format, CONST char *msg, ...));

int lib_transient (
#if ANSI_C
! CONST char * format,
! CONST char *msg, ...
#else
format, msg, va_alist
#endif
--- 1352,1363 ----
}


! int lib_transient P_((const char * format, const char *msg, ...));

int lib_transient (
#if ANSI_C
! const char * format,
! const char *msg, ...
#else
format, msg, va_alist
#endif

Index: elmME+.2.5.alpha2-cvs/lib/read_rc.c
*** elmME+.2.5.alpha1/lib/read_rc.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/read_rc.c 2004-08-15 11:28:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133.4.18 2004/07/03 15:23:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133.4.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133.4.22 2004/08/15 08:28:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133.4.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 109,118 ****


char user_terminal_info[SLEN] = USER_TERMINAL_INFO; /* user_init fixes */
char user_mail_services[SLEN] = USER_MAIL_SERVICES; /* user_init fixes */

! ESTR defaultfile_e; /* name of default folder */
! ESTR calendar_file_e; /* name of file for clndr */

! int clear_pages; /* flag: act like "page" (more -c)? */
!

int title_messages = 1; /* flag: title message display? */

nl_catd elm_msg_cat; /* message catalog */
--- 109,118 ----
char user_terminal_info[SLEN] = USER_TERMINAL_INFO; /* user_init fixes */
char user_mail_services[SLEN] = USER_MAIL_SERVICES; /* user_init fixes */

! ESTR defaultfile_e; /* name of default folder */
! ESTR calendar_file_e; /* name of file for clndr */

! ESTR dead_letter_dir_e;
! int clear_pages ; /* flag: act like "page" (more -c)? */


int title_messages = 1; /* flag: title message display? */

nl_catd elm_msg_cat; /* message catalog */

***************
*** 526,532 ****


if (0 == elm_msg_cat ||
(nl_catd) -1 == elm_msg_cat) {
DPRINT(Debug,9,(&Debug,

! "locale_init: catopen elm2.4me+ failed\n"));
}
/* NOTE: elm_msg_cat 'leaks' on end of program ... */

--- 526,532 ----


if (0 == elm_msg_cat ||
(nl_catd) -1 == elm_msg_cat) {
DPRINT(Debug,9,(&Debug,

! "locale_init: catopen elmme+2.5 failed\n"));
}
/* NOTE: elm_msg_cat 'leaks' on end of program ... */

***************
*** 857,862 ****
--- 857,864 ----
}
}

+ static int user_rc_set = 0;
+
void user_init()
{
char *cp;
***************
*** 929,936 ****
strfcpy(full_username, username, sizeof full_username);
/* fall back on logname */

! elm_sfprintf(user_rc_file, sizeof user_rc_file,
! FRM("%s/%s"), home, ELMRCFILE);
elm_sfprintf(user_text_file, sizeof user_text_file,
FRM("%s/%s"), home, USER_ALIAS_TEXT);
elm_sfprintf(user_data_file, sizeof user_data_file,
--- 931,940 ----
strfcpy(full_username, username, sizeof full_username);
/* fall back on logname */

! if (!user_rc_set)
! elm_sfprintf(user_rc_file, sizeof user_rc_file,
! FRM("%s/%s"), home, ELMRCFILE);
!
elm_sfprintf(user_text_file, sizeof user_text_file,
FRM("%s/%s"), home, USER_ALIAS_TEXT);
elm_sfprintf(user_data_file, sizeof user_data_file,
***************
*** 954,959 ****
--- 958,971 ----
#endif
}

+ void set_user_rc_location(p)
+ char *p;
+ {
+ strfcpy(user_rc_file, p, sizeof user_rc_file);
+ user_rc_set = 1;
+ }
+
+
#ifdef I_NETDB
/* Seems that h_errno is macro on AIX */
#ifndef h_errno
***************
*** 1248,1253 ****
--- 1260,1267 ----


calendar_file_e.unexpanded =
elm_message(FRM("~/%s"), dflt_calendar_file);

+ dead_letter_dir_e.unexpanded = safe_strdup("~/Canceled.mail.dir");
+

strfcpy(e_editor, emacs_editor, sizeof e_editor);
strfcpy(v_editor, default_editor, sizeof v_editor);

***************

*** 1433,1438 ****
--- 1447,1458 ----
/* Look for the elmrc file */
err = can_open(user_rc_file, "r");
if (err) {
+
+ if (user_rc_set)
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedUserRC,
+ "Failed to open RC file %s: %s"),
+ user_rc_file,error_description(err));
+
DPRINT(Debug,2,(&Debug,
"Warning:User has no \"%s\" file (can_open)\n\n",
user_rc_file));
***************
*** 1448,1454 ****
}

if (file != NULL) {
! do_rc(file, LOCAL_RC, ELMRCFILE);
fclose(file);
}
}
--- 1468,1475 ----
}

if (file != NULL) {
! do_rc(file, LOCAL_RC,
! user_rc_set ? user_rc_file: ELMRCFILE);
fclose(file);
}
}
***************
*** 1482,1487 ****
--- 1503,1510 ----
}

void post_init_check(int flag) {
+
+ struct stat st_buffer;


char *t;

do_expand_env("folders", folders, raw_folders, sizeof(folders));

***************
*** 1497,1502 ****
--- 1520,1544 ----
raw_extra_mailbox_dir[0] = '\0';
}

+ t = give_dt_estr_as_str(&dead_letter_dir_e,"dead-letter-dir");
+

+ /* dead-letter-dir is create automatically, if it does not exists */
+ if (t &&
+ 0 == stat(t,&st_buffer) &&
+ #ifdef S_ISDIR
+ !S_ISDIR(st_buffer.st_mode)
+ #else

+ S_IFDIR != (st_buffer.st_mode & S_IFMT)
+ #endif
+ ) {


+ errors++;
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadDeadLetterDir,
+ "\"dead-letter-dir\" should be directory."));
+
+ free(dead_letter_dir_e.unexpanded);

+ dead_letter_dir_e.unexpanded = NULL;
+ }
+

if (!raw_attachment_dir[0]) {
char * tmp = elm_message(FRM("%s/Documents"),home);

Index: elmME+.2.5.alpha2-cvs/lib/remote_mbx.c
*** elmME+.2.5.alpha1/lib/remote_mbx.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/remote_mbx.c 2004-07-19 12:20:00.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.49.4.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.4.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.49.4.3 2004/07/19 09:20:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.4.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

***************
*** 351,356 ****


--- 355,372 ----
} else
r = 1;
}

+
+ if (0 == r && EINTR == errno) {
+

+ if (is_canceled(can)) {
+ DPRINT(Debug,12,(&Debug,"connect canceled...\n"));

+ r = -1;
+ } else {


+ DPRINT(Debug,12,(&Debug,"Retrying connect...\n"));

+ goto retry;
+ }
+

Index: elmME+.2.5.alpha2-cvs/lib/savefolder.c
*** elmME+.2.5.alpha1/lib/savefolder.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/savefolder.c 2004-08-14 15:06:09.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75.8.3 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75.8.4 2004/08/14 12:06:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 986,993 ****
return ret;
}

! struct folder_info * real_folder_from_local(dir)
struct folder_browser *dir;
{
struct folder_info *res = NULL;

--- 986,994 ----
return ret;
}

! struct folder_info * real_folder_from_local(dir, treat_as_spooled)
struct folder_browser *dir;
+ int treat_as_spooled;
{
struct folder_info *res = NULL;

***************
*** 1009,1015 ****
res -> cur_folder_sys = safe_strdup(dir->selection->sys_name);
res -> cur_folder_disp = dup_string(dir->selection->disp_name);
}
! res-> folder_type = get_folder_type(res -> cur_folder_sys,&place);

switch (place) {
case in_home:
--- 1010,1017 ----
res -> cur_folder_sys = safe_strdup(dir->selection->sys_name);
res -> cur_folder_disp = dup_string(dir->selection->disp_name);
}
! res-> folder_type = get_folder_type(res -> cur_folder_sys,&place,
! treat_as_spooled);

switch (place) {
case in_home:
***************
*** 1037,1046 ****
}

static struct folder_info *
! browser_folder_from_dummy P_((struct folder_browser *dir));

! static struct folder_info * browser_folder_from_dummy(dir)
struct folder_browser *dir;
{
struct folder_info * res = NULL;

--- 1039,1050 ----
}

static struct folder_info *
! browser_folder_from_dummy P_((struct folder_browser *dir,
! int treat_as_spooled));

! static struct folder_info * browser_folder_from_dummy(dir, treat_as_spooled)
struct folder_browser *dir;
+ int treat_as_spooled;
{
struct folder_info * res = NULL;

***************
*** 1058,1064 ****
if (dir->selection->sys_name) {
/* Must have IMAP folder !! */
if (dummy_to_imap(dir)) {
! res = dir->type->browser_folder_from_it(dir);
goto clean;
}
} else {
--- 1062,1069 ----
if (dir->selection->sys_name) {
/* Must have IMAP folder !! */
if (dummy_to_imap(dir)) {
! res = dir->type->browser_folder_from_it(dir,
! treat_as_spooled);
goto clean;
}
} else {
***************
*** 1109,1115 ****
dir->a.dummy_browser.remote);

} else
! res = real_folder_from_local(dir);

clean:

--- 1114,1120 ----
dir->a.dummy_browser.remote);

} else
! res = real_folder_from_local(dir, treat_as_spooled);

clean:

***************
*** 3712,3719 ****
}


! struct folder_info * folder_from_dir_item(dir)
struct folder_browser *dir;
{
struct folder_info * res = NULL;

--- 3717,3725 ----
}


! struct folder_info * folder_from_dir_item(dir, treat_as_spooled)
struct folder_browser *dir;
+ int treat_as_spooled;
{
struct folder_info * res = NULL;

***************
*** 3730,3736 ****
panic("BROWSER PANIC",__FILE__,__LINE__,"folder_from_dir_item",
"No selection",0);

! res = dir->type->browser_folder_from_it(dir);

if (res) {
DPRINT(Debug,10,(&Debug,
--- 3736,3742 ----
panic("BROWSER PANIC",__FILE__,__LINE__,"folder_from_dir_item",
"No selection",0);

! res = dir->type->browser_folder_from_it(dir, treat_as_spooled);

if (res) {
DPRINT(Debug,10,(&Debug,
Index: elmME+.2.5.alpha2-cvs/lib/syscall.c
*** elmME+.2.5.alpha1/lib/syscall.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/lib/syscall.c 2004-07-19 12:20:00.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.12.8.1 2004/04/18 16:55:42 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.12.8.2 2004/07/19 09:20:00 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 18,24 ****
#include "elm_defs.h"


#include "s_elm.h"

! DEBUG_VAR(Debug,__FILE__,"mailer");

#include <errno.h>

--- 18,24 ----

#include "elm_defs.h"
#include "s_elm.h"



! DEBUG_VAR(Debug,__FILE__,"system");

#include <errno.h>

Index: elmME+.2.5.alpha2-cvs/MANIFEST
*** elmME+.2.5.alpha1/MANIFEST 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/MANIFEST 2004-08-07 21:07:13.000000000 +0300
***************
*** 126,132 ****


nls/C/C/C/s_readmsg.m
nls/Install
nls/LANGS
! nls/Makefile
nls/gencat/Copyright
nls/gencat/Makefile
nls/gencat/README

--- 126,132 ----


nls/C/C/C/s_readmsg.m
nls/Install
nls/LANGS
! nls/Makefile.SH
nls/gencat/Copyright
nls/gencat/Makefile
nls/gencat/README
***************

*** 419,421 ****
--- 419,425 ----
lib/shared_all.c
hdrs/elm_defs.h
hdrs/elm_globals.h
+ src/screen/init.c
+ lib/cancel.c
+ src/messages/canceled_mail.c
+ src/canceled.c
Index: elmME+.2.5.alpha2-cvs/melib/mime_decode.c
*** elmME+.2.5.alpha1/melib/mime_decode.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/melib/mime_decode.c 2004-08-07 21:07:16.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.64 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.64.8.1 2004/08/07 18:07:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1633,1642 ****
return;
}

! /* Prototype */
! static int run_decoder P_((mime_t *, in_state_t *, out_state_t *));
!
! static int run_decoder (ptr, state_in, state_out)
mime_t *ptr;
in_state_t *state_in;
out_state_t *state_out;
--- 1633,1639 ----
return;
}

! int run_cte_decoder (ptr, state_in, state_out)
mime_t *ptr;
in_state_t *state_in;
out_state_t *state_out;
***************
*** 1644,1654 ****
int is_text;

DPRINT(Debug,11,(&Debug,
! "run_decoder -> state: offset=%ld, length=%ld\n",

(long) ptr -> offset, (long) ptr -> length));



if (ptr->magic != MIME_magic)

! mime_panic(__FILE__,__LINE__,"run_decoder",
"Bad magic number");


--- 1641,1651 ----
int is_text;

DPRINT(Debug,11,(&Debug,
! "run_cte_decoder -> state: offset=%ld, length=%ld\n",

(long) ptr -> offset, (long) ptr -> length));



if (ptr->magic != MIME_magic)

Index: elmME+.2.5.alpha2-cvs/nls/C/C/C/s_elm.m
*** elmME+.2.5.alpha1/nls/C/C/C/s_elm.m 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/nls/C/C/C/s_elm.m 2004-08-14 15:06:09.000000000 +0300


***************
*** 743,752 ****
400 mailer returned error status %d
$ #MailSent
401 Mail sent!
- $ #RecallLastInstead
- 402 "Recall last kept message instead? (%c/%c) "
- $ #RecallLastKept
- 403 "Recall last kept message? (%c/%c) "
$ #ErrorTryingToWrite
410 Error %s encountered trying to write to %s.
$quote
--- 743,748 ----
***************

*** 954,960 ****
\t -h \t\tHelp - give this list of options\n\r\
\t -ix\t\tInclude prepared file 'x' in edit buffer for send\n\r
$ #ArgsHelp2
! 536 \t -m \t\tMenu - Turn off menu, using more of the screen\n\r\
\t -sx\t\tSubject 'x' - for batch mailing\n\r\
\t -t \t\tTiTe - don't use termcap/terminfo ti/te entries.\n\r\
\t -V \t\tEnable sendmail voyeur mode.\n\r\
--- 950,959 ----
\t -h \t\tHelp - give this list of options\n\r\
\t -ix\t\tInclude prepared file 'x' in edit buffer for send\n\r
$ #ArgsHelp2
! 536 \t -M \t\tMagic mode - treat all folders as spool files.\n\r\
! \t -m \t\tMenu - Turn off menu, using more of the screen\n\r\
! \t -rx \t\tRcfile - Use 'x' as the elmrc instead of the default\n\r\
! \t -S \t\tSend-only mode\n\r\
\t -sx\t\tSubject 'x' - for batch mailing\n\r\
\t -t \t\tTiTe - don't use termcap/terminfo ti/te entries.\n\r\
\t -V \t\tEnable sendmail voyeur mode.\n\r\
***************
*** 987,994 ****
550 Warning: system created without debugging enabled - request ignored\n
$ #ArgsTooManyAddresses
551 \n\rToo many addresses, or addresses too long!\n\r
- $ #ArgsSubjectNotSend
- 552 \n\rDon't understand specifying a subject and no-one to send to!\n\r
$ #CouldNotOpenNewElmrc
554 Warning: could not open new ".elm/elmrc" file! Using default parameters.\n\r
$ #BadSortKeyInElmrc
--- 986,991 ----
***************
*** 1370,1377 ****
750 Can't open included File
$ #PressAnyKeyIndex
751 Press any key to return to index.
- $ #ArgsInclFileNotSend
- 752 Can't specify an included file with no-one to send to!
$ #ArgsInclFileBatch
753 Can't specify an included file in batch mode!
$ #OptionArrowMenu
--- 1367,1372 ----


***************
*** 1536,1543 ****
$quote
$ #VfyMenuSndFgt
846 s)end, or f)orget
- $ #VfyMessageKept
- 847 Message kept. Can be restored at next f)orward, m)ail or r)eply.
$ #VfyNoFieldsInForm
848 No fields in form!\007
$ #HelpViewAttach

--- 1531,1536 ----
***************
*** 1862,1869 ****
1022 Error encountered while attempting to lock folder %S: %s
$ #SorryCantReopenTemp
1023 Sorry, can't reopen the temp file %s [%s]!
- $ #ArgsAttachFileNotSend
- 1024 Can't specify an attached files with no-one to send to!
$ #PadRevThread
1025 "Reverse Thread "
$ #AbrRevThread
--- 1855,1860 ----


***************
*** 2253,2261 ****
$ #SearchingInMessageDone
2131 "Searching %d. Done "
$ #HdrmenuInstruct1
! 2132 "Choose header, u)ser defined header, !)shell, invoke e)ditor, or <return>."
$ #HdrmenuInstruct1NoShell
! 2133 "Choose header, u)ser defined header, invoke e)ditor, or <return>."
$ #HdrEditComment
2134 "# Headers are automatically converted from %s charset and not need encoded\n"
$ #HdrEditCommentEnc

--- 2244,2252 ----


$ #SearchingInMessageDone
2131 "Searching %d. Done "
$ #HdrmenuInstruct1
! 2132 "Choose header, u)ser defined header, !)shell, invoke e(d)itor, or <return>."
$ #HdrmenuInstruct1NoShell
! 2133 "Choose header, u)ser defined header, invoke e(d)itor, or <return>."
$ #HdrEditComment
2134 "# Headers are automatically converted from %s charset and not need encoded\n"
$ #HdrEditCommentEnc
***************

*** 2301,2308 ****
2153 \n\


This version of Elm has been installed setuid=%d. This is dangerous!\n\

Elm is NOT designed to run in this mode, and to do so can introduce\n\

! grave security hazards. See the description of "allow_setuid" in the\n\
! Elm Reference Guide for further information.\n\n
$quote "
$ #CopyMessageIntoReplyYN
2154 "Copy message into reply? (%c/%c) "
--- 2292,2298 ----
2153 \n\


This version of Elm has been installed setuid=%d. This is dangerous!\n\

Elm is NOT designed to run in this mode, and to do so can introduce\n\

! grave security hazards. \n\n
$quote "
$ #CopyMessageIntoReplyYN
2154 "Copy message into reply? (%c/%c) "
***************
*** 2326,2329 ****
2163 "No recipients specified!"
$ #MimeFWMessageYN
2164 "Forward message as separate part? (%c/%c) "
!
--- 2316,2355 ----
2163 "No recipients specified!"
$ #MimeFWMessageYN
2164 "Forward message as separate part? (%c/%c) "
! $quote '
! $ #BadDeadLetterDir
! 2165 '"dead-letter-dir" should be directory.'
! $ #DeadLetterDirCreated
! 2166 '"dead-letter-dir" %s created.'
! $ #CanceledMailsOn
! 2167 'Canceled mails on %s'
! $ #CanceledMails
! 2168 'Canceled mails'
! $ #MDirectoryOn
! 2169 'Message directory %s on %s'
! $ #MDirectory
! 2170 'Message directory %s'
! $ #IsCanceledX
! 2171 '%d canceled mails. Use / to select one of them.'
! $ #IsCanceled1
! 2172 '1 canceled mail. Use / to select it.'
! $ #SelectCanMessage
! 2173 'Select Canceled message'
! $ #CancelMenuLine1
! 2174 'To select canceled message for mailing, press <return>.'
! $ #CancelMenuLine2
! 2175 'To read message, press space. j = move down, k = move up'
! $ #CancelMenuLine3
! 2176 'Also available: d)elete, u)ndelete, i)ndex'
! $ #VfyMessageKept1
! 2177 'Message kept. Can be restored at next m)ail command.'
! $ #FailedUserRC
! 2178 'Failed to open RC file %s: %s'
! $ #ArgsNoFileBatch
! 2179 'Must specify a recipient in batch mode.'
! $ #MagicOn
! 2180 '[Magic On]'
! $ #MagicOff
! 2191 '[Magic Off]'
! $ #ChangeMailbox
! 2192 'Change mailbox'
Index: elmME+.2.5.alpha2-cvs/nls/C/C/C/s_me.m
*** elmME+.2.5.alpha1/nls/C/C/C/s_me.m 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/nls/C/C/C/s_me.m 2004-07-19 12:20:00.000000000 +0300


***************
*** 667,669 ****
--- 667,673 ----
352 Setting "%s" on line %d in "%s" file is suboptimal.\nUse file %.100s or %.100s instead.
$ #UUDECODECorrupt
353 UUENCODED data was corrupt!
+ $ #Canceled
+ 354 %S canceled
+ $ #ConnectCanceled
+ 355 Connect %s canceled.

Index: elmME+.2.5.alpha2-cvs/nls/Makefile
*** elmME+.2.5.alpha1/nls/Makefile 2004-07-04 14:36:51.000000000 +0300
--- /tmp/29622-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-15 20:45:40.000000000 +0300


***************
*** 1,55 ****
- #

- # $Id: Makefile,v 1.4.86.1 2004/05/23 16:24:48 hurtta Exp $
- #
- LANGFILE=LANGS
- CATNAME=elmme+2.5.cat

Index: elmME+.2.5.alpha2-cvs/nls/Makefile.SH
*** /tmp/29622-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-15 20:45:40.000000000 +0300
--- elmME+.2.5.alpha2-cvs/nls/Makefile.SH 2004-08-07 21:07:16.000000000 +0300
***************
*** 0 ****

+ # $Id: Makefile.SH,v 1.1.10.1 2004/08/07 18:07:16 hurtta Exp $
+
+ LANGFILE=LANGS
+ CATNAME=elmme+2.5

Index: elmME+.2.5.alpha2-cvs/src/addr_util.c
*** elmME+.2.5.alpha1/src/addr_util.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/addr_util.c 2004-08-14 09:40:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.42.8.1 2004/05/22 20:18:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.42.8.2 2004/08/14 06:40:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 843,849 ****
}
ADD_TEXTUAL(result,ptr->Textual,pos,1);

! if (check_only)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmAliasUnknown,
"(alias \"%S\" is unknown)"),
ptr->Textual);
--- 843,849 ----
}
ADD_TEXTUAL(result,ptr->Textual,pos,1);

! if (OPMODE_CHECK_ONLY == opmode)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmAliasUnknown,
"(alias \"%S\" is unknown)"),
ptr->Textual);
Index: elmME+.2.5.alpha2-cvs/src/alias.c
*** elmME+.2.5.alpha1/src/alias.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/alias.c 2004-08-14 09:40:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.35.2.2 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.2.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.35.2.5 2004/08/14 06:40:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.2.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 66,72 ****


extern char *alias_type();
char *error_description(), *get_parens();

! static void get_realnames P_((char *aliasname,
char *firstname,
char *lastname,
char *comment,

--- 66,72 ----


extern char *alias_type();
char *error_description(), *get_parens();

! static int get_realnames P_((char *aliasname,
char *firstname,
char *lastname,
char *comment,
***************

*** 92,98 ****


struct AliasView *avies,
int headerPage,

struct menu_context *page));


! static int alias_help P_((struct menu_context *page));


extern int is_system; /* system file updating? */

--- 92,98 ----


struct AliasView *avies,
int headerPage,

struct menu_context *page));


! static void alias_help P_((struct menu_context *page));


extern int is_system; /* system file updating? */

***************
*** 177,183 ****
}

if (update_aview(aview)) {
! if (!mail_only && !check_only) {
int tac = get_total_alias_count(aview);

set_alias_current(aview,0);
--- 177,183 ----
}

if (update_aview(aview)) {
! if (OPMODE_IS_READMODE(opmode)) {
int tac = get_total_alias_count(aview);

set_alias_current(aview,0);
***************
*** 460,466 ****


do {
int status =
optionally_enter(address1, LINES-3, strlen(buffer),
! OE_REDRAW_MARK, sizeof address1,

page);

while (REDRAW_MARK == status) {

--- 460,467 ----


do {
int status =
optionally_enter(address1, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|

! OE_SIG_CHAR /* Ctrl-C */, sizeof address1,


page);

while (REDRAW_MARK == status) {
***************

*** 472,478 ****


PutLine0(LINES-3,0, buffer);
status =
optionally_enter(address1, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
sizeof address1,
page);
}

--- 473,480 ----


PutLine0(LINES-3,0, buffer);
status =
optionally_enter(address1, LINES-3, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof address1,
page);
}
***************
*** 492,500 ****


if (!is_group && strchr(address1,',') != NULL)
is_group = 1;

! get_realnames(aliasname, firstname, lastname, comment, bufferA,
! sizeof firstname, sizeof lastname, sizeof comment,
! sizeof bufferA, is_group, page);


if(ask_accept(aliasname, firstname, lastname, comment, address1,

--- 494,503 ----


if (!is_group && strchr(address1,',') != NULL)
is_group = 1;

! if (!get_realnames(aliasname, firstname, lastname, comment, bufferA,
! sizeof firstname, sizeof lastname, sizeof comment,
! sizeof bufferA, is_group, page))
! return 0;


if(ask_accept(aliasname, firstname, lastname, comment, address1,
***************

*** 712,720 ****


}
}

! get_realnames(aliasname, firstname, lastname, comment, buffer,
! sizeof firstname, sizeof lastname, sizeof comment,
! sizeof buffer, 0, page);

/* grab the return address of this message */
strfcpy(address1,current_header->from[0].addr,sizeof address1);

--- 715,724 ----


}
}

! if (!get_realnames(aliasname, firstname, lastname, comment, buffer,
! sizeof firstname, sizeof lastname, sizeof comment,
! sizeof buffer, 0, page))
! return 0;

/* grab the return address of this message */
strfcpy(address1,current_header->from[0].addr,sizeof address1);
***************

*** 1029,1035 ****


redraw++;
}
else
! redraw = menu_need_redraw(page);

nucurr = 0;
nufoot = 0;

--- 1033,1039 ----


redraw++;
}
else
! redraw += menu_need_redraw(page);

nucurr = 0;
nufoot = 0;
***************

*** 1061,1067 ****


goto resize_mark;

case HELP_MARK:
! case '?': redraw += alias_help(page); break;

case REDRAW_MARK:
case 'L'&31: redraw++; break;

--- 1065,1074 ----


goto resize_mark;

case HELP_MARK:
! case '?':
! alias_help(page);

! redraw += menu_need_redraw(page);


! break;

case REDRAW_MARK:
case 'L'&31: redraw++; break;
***************

*** 1146,1154 ****
"Mail..."));
FlushBuffer();

! redraw += a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,
! page);
}
else {
lib_error(CATGETS(elm_msg_cat,
--- 1153,1163 ----
"Mail..."));
FlushBuffer();

! a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,
! page);


! redraw += menu_need_redraw(page);
!
}

else {
lib_error(CATGETS(elm_msg_cat,
***************
*** 1288,1294 ****



status = optionally_enter(name, LINES-3,
strlen(buffer),
! OE_REDRAW_MARK,
sizeof name,

page);
while (REDRAW_MARK == status) {

--- 1297,1304 ----

status = optionally_enter(name, LINES-3,
strlen(buffer),

! OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof name,


page);
while (REDRAW_MARK == status) {
***************

*** 1296,1302 ****


status = optionally_enter(name, LINES-3,
strlen(buffer),
OE_REDRAW_MARK|
! OE_APPEND_CURRENT,
sizeof name,
page);
redraw++;

--- 1306,1313 ----


status = optionally_enter(name, LINES-3,
strlen(buffer),
OE_REDRAW_MARK|

! OE_APPEND_CURRENT|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof name,
page);
redraw++;
***************

*** 1385,1402 ****


* it must be a "motion" command (or an error).
*/
default :

! ch = motion(ch,&MENU,&redraw,&nufoot, &header_page,


page);
switch (ch) {
case 0: /* OK */
break;

! case EOF: leave(0,
! &current_mailbox,
! &current_aliaslist); /* Read failed, control tty died? */
!

! /* ?? global reference */

break;
default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmUnknownCommand,

--- 1396,1413 ----


* it must be a "motion" command (or an error).
*/
default :
! ch = motion(ch,&MENU,&nufoot, &header_page,
page);
+

+ redraw += menu_need_redraw(page);
+
switch (ch) {
case 0: /* OK */
break;

! case EOF: leave(0); /* Read failed, control tty died? */
break;
+
default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmUnknownCommand,

***************
*** 1405,1410 ****
--- 1416,1423 ----
}

if (redraw) { /* Redraw screen if necessary */
+ DPRINT(Debug,7, (&Debug,

+ "alias: pending redraw\n"));
alias_screen(newaliases, aview, &header_page, page);
nutitle = 0;
}
***************

*** 1483,1495 ****


}
}

! static int alias_help(page)
struct menu_context *page;
{
/*
* Help section for the alias menu...
*
! * Return non-0 if main part of screen overwritten, else 0
*/

int ch;

--- 1496,1508 ----


}
}

! static void alias_help(page)
struct menu_context *page;
{
/*
* Help section for the alias menu...

*
! * If redraw is needed use menu_trigger_redraw(page)
*/

int ch;
***************
*** 1519,1534 ****



lower_prompt(alias_prompt);

! while ((ch = menu_ReadCh(page,0|READCH_CURSOR)) != '.') {

switch(ch) {
case EOF :
! leave(0, &current_mailbox, &current_aliaslist);

! /* ?? global reference */

break;
case HELP_MARK:
! case '?' : display_helpfile(ALIAS_HELP);
redraw++;
! return(redraw);

case '$': lib_transient(CATGETS(elm_msg_cat, AliasesSet,
AliasesHelpDollar,

--- 1532,1552 ----



lower_prompt(alias_prompt);

! while ((ch = menu_ReadCh(page,0|READCH_CURSOR|READCH_sig_char)) != '.') {

!
! if (ch == TERMCH_interrupt_char)
!

! break;


switch(ch) {
case EOF :
! leave(0);
break;
case HELP_MARK:
! case '?' :
! display_helpfile(ALIAS_HELP);
redraw++;
! menu_trigger_redraw(page);
! return;

case '$': lib_transient(CATGETS(elm_msg_cat, AliasesSet,
AliasesHelpDollar,
***************

*** 1639,1645 ****



/* Remove help lines */
MoveCursor(LINES-4, 0); CleartoEOS();
! return(redraw);
}

void main_state()

--- 1657,1667 ----



/* Remove help lines */

MoveCursor(LINES-4, 0); CleartoEOS();


!
! if (redraw)
! menu_trigger_redraw(page);
!
! return;
}

void main_state()
***************
*** 1771,1777 ****


do {
int status =
optionally_enter(aliasname, LINES-3, strlen(buffer),

! OE_REDRAW_MARK, size, page);

if (REDRAW_MARK == status)
return REDRAW_MARK;
--- 1793,1799 ----


do {
int status =
optionally_enter(aliasname, LINES-3, strlen(buffer),

! OE_REDRAW_MARK|OE_SIG_CHAR, size, page);

if (REDRAW_MARK == status)
return REDRAW_MARK;
***************
*** 1889,1895 ****



}

! static void get_realnames(aliasname, firstname, lastname, comment, buffer,
size_first, size_last, size_comment, size_buffer,
is_group, page)
char *aliasname, *firstname, *lastname, *comment, *buffer;

--- 1911,1917 ----



}

! static int get_realnames(aliasname, firstname, lastname, comment, buffer,
size_first, size_last, size_comment, size_buffer,
is_group, page)
char *aliasname, *firstname, *lastname, *comment, *buffer;
***************

*** 1908,1941 ****


lastname[0] = '\0';
firstname[0] = '\0';
} else {
! elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterLastName,
"Enter last name for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
CleartoEOLN();
status = optionally_enter(lastname, LINES-3, strlen(buffer),

! OE_REDRAW_MARK, size_last, page);
while (REDRAW_MARK == status) {


PutLine0(LINES-3,0, buffer);
status = optionally_enter(lastname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
size_last, page);
}

elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterFirstName,
"Enter first name for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
CleartoEOLN();
status = optionally_enter(firstname, LINES-3, strlen(buffer),

! OE_REDRAW_MARK, size_first, page);
while (REDRAW_MARK == status) {


PutLine0(LINES-3,0, buffer);
status = optionally_enter(firstname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
size_first, page);
}

if (strlen(lastname) == 0) {
strfcpy(lastname, firstname, size_last);
*firstname = '\0';

--- 1930,1973 ----


lastname[0] = '\0';
firstname[0] = '\0';
} else {
! elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterLastName,
"Enter last name for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
CleartoEOLN();
status = optionally_enter(lastname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|

! OE_SIG_CHAR /* Ctrl-C */, size_last, page);
while (REDRAW_MARK == status) {


PutLine0(LINES-3,0, buffer);
status = optionally_enter(lastname, LINES-3, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! OE_SIG_CHAR /* Ctrl-C */,

size_last, page);
}

+ if (status != 0) /* Error or Ctrl-C */
+ return 0;
+
elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterFirstName,
"Enter first name for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
CleartoEOLN();
status = optionally_enter(firstname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|

! OE_SIG_CHAR /* Ctrl-C */, size_first, page);
while (REDRAW_MARK == status) {


PutLine0(LINES-3,0, buffer);
status = optionally_enter(firstname, LINES-3, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! OE_SIG_CHAR /* Ctrl-C */,

size_first, page);
}

+ if (0 != status) /* Ctrl-C or error */
+ return 0;
+
if (strlen(lastname) == 0) {
strfcpy(lastname, firstname, size_last);
*firstname = '\0';
***************

*** 1947,1959 ****


"Enter optional comment for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
status = optionally_enter(comment, LINES-3, strlen(buffer),

! OE_REDRAW_MARK, size_comment, page);
while (status == REDRAW_MARK) {


PutLine0(LINES-3,0, buffer);
status = optionally_enter(comment, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
size_comment, page);
}
}

static int ask_accept(aliasname, firstname, lastname, comment, address, buffer,

--- 1979,1998 ----


"Enter optional comment for %s: "), aliasname);
PutLine0(LINES-3,0, buffer);
status = optionally_enter(comment, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|

! OE_SIG_CHAR /* Ctrl-C */, size_comment, page);
while (status == REDRAW_MARK) {


PutLine0(LINES-3,0, buffer);
status = optionally_enter(comment, LINES-3, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! OE_SIG_CHAR /* Ctrl-C */,

size_comment, page);
}
+

+ if (0 != status) /* Ctrl-C or error */

+ return 0;
+

+ return 1;
}

static int ask_accept(aliasname, firstname, lastname, comment, address, buffer,

Index: elmME+.2.5.alpha2-cvs/src/aliases/aliases.c
*** elmME+.2.5.alpha1/src/aliases/aliases.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/aliases/aliases.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: aliases.c,v 1.6 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: aliases.c,v 1.6.8.1 2004/08/07 18:07:19 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

***************
*** 10,24 ****

DEBUG_VAR(Debug,__FILE__,"alias");

- struct AliasView * current_aliaslist = NULL;
-
struct alias_view {
int classnum;
int index;
};

! struct AliasView * new_aliasview() {

struct AliasView *r = safe_malloc(sizeof (*r));

/* bzero is defined hdrs/defs.h */

--- 10,27 ----

DEBUG_VAR(Debug,__FILE__,"alias");

struct alias_view {
int classnum;
int index;
};

! static struct AliasView ** aliasview_list = NULL;
! static int aliasview_list_len = 0;

+ struct AliasView * new_aliasview()

+ {
+ int idx;


+ struct AliasView **X;
struct AliasView *r = safe_malloc(sizeof (*r));

/* bzero is defined hdrs/defs.h */

***************
*** 33,38 ****
--- 36,62 ----

r->normal_alias_len = 0;

+ for (idx = 0; idx < aliasview_list_len; idx++)

+ if (!aliasview_list[idx]) {
+ DPRINT(Debug,7,(&Debug,
+ "malloc_view: Re-using aliasview index %d\n",


+ idx));
+ goto found;
+ }
+

+ X = safe_realloc(aliasview_list,(aliasview_list_len+1)* sizeof (*X));
+ X[aliasview_list_len] = NULL;
+ aliasview_list = X;
+ idx = aliasview_list_len++;
+
+ DPRINT(Debug,7,(&Debug,

+ "malloc_view: Allocing new aliasview index %d\n",
+ idx));
+

Kari E. Hurtta

unread,
Aug 20, 2004, 1:29:26 PM8/20/04
to
Archive-name: elmME+2.5/PLalpha2.2

Elm ME+ 2.5 PLalpha2

- Is available on ftp.funet.fi

via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha2.patch.gz >
via WWW (1).


1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

Before applying patch catenate parts 1 - 5 first.

This patch (Elm ME+ 2.5 PLalpha2) is agaist Elm ME+ 2.5 PLalpha1.
After that patch apply also Elm ME+ 2.5 PLalpha3 patch.

================================================ ( part 2/5 ) ===============


*x = r;
}

+ void free_aliasview(x)
+ struct AliasView **x;

+ {
+ int i;


+ struct AliasView *r = *x;
+
+ if (r->magic != ALIASVIEW_magic)
+ panic("ALIAS VIEW PANIC",__FILE__,__LINE__,"free_aliasview",
+ "bad aliasview magic",0);

+

+ for ( i = 0; i < aliasview_list_len; i++) {
+ if (aliasview_list[i] == r) {
+
+ SIGDPRINT(Debug,7,(&Debug,

+ "free_aliasview: Aliasview index %d goes free\n",
+ i));
+
+ aliasview_list[i] = NULL;


+ goto okei;
+ }
+ }
+

+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_aliasview",
+ "aliasview not found from list",0);
+

+ okei:
+ free_aliasview1(&r);
+
+ *x = r;
+ }
+
+ void free_all_aliasviews()
+ {
+ if (aliasview_list) {
+ int i;

+

+ for ( i = 0; i < aliasview_list_len; i++) {
+ if (aliasview_list[i]) {
+

+ SIGDPRINT(Debug,7,(&Debug,"free_all_aliasviews: [%d]\n",
+ i));
+

+ if (aliasview_list[i]->magic != ALIASVIEW_magic)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_all_aliasviews",
+ "Bad magic number",0);
+

+ free_aliasview1(& (aliasview_list[i]));
+ }
+ }
+

+ free(aliasview_list);
+ aliasview_list = NULL;
+ }

+ aliasview_list_len = 0;
+ }
+

struct aliasclass * add_aliasclass(x,t)
struct AliasView *x;
struct alias_type *t;

Index: elmME+.2.5.alpha2-cvs/src/args.c
*** elmME+.2.5.alpha1/src/args.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/args.c 2004-08-14 15:06:10.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: args.c,v 1.61.8.2 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.61.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

! ******************************************************************************


* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** starting argument parsing routines for ELM system...
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: args.c,v 1.61.8.7 2004/08/14 12:06:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

! *****************************************************************************
! * Based on Elm 2.4 src/elm.c. That code was following copyright:
! *


* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/args.c.

+ * That code was following copyright:
+ *

+ * The Elm Mail System - $Revision: 1.61.8.7 $ $State: Exp $


+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** starting argument parsing routines for ELM system...
***************
*** 66,78 ****
static void args_version P_((int i));
static void args_help P_((void));

! char * wanted_charset = NULL;
int wanted_switchmode = -1;

! char * wanted_title_string = NULL;
! char * wanted_icon_string = NULL;
! char * with_title = NULL;
! char * wanted_mailbox_title = NULL;

/* Retuns array of files requested */
char ** parse_arguments(argc, argv, to_whom)
--- 76,90 ----
static void args_version P_((int i));
static void args_help P_((void));

! char * wanted_charset;
int wanted_switchmode = -1;

! char * wanted_title_string;
! char * wanted_icon_string;
! char * with_title;
! char * wanted_mailbox_title;
! int opmode = OPMODE_READ;
! int TreatAsSpooled;

/* Retuns array of files requested */
char ** parse_arguments(argc, argv, to_whom)
***************
*** 95,113 ****
batch_subject[0] = '\0';
included_file[0] = '\0';

! while ((c = getopt(argc, argv, "?aA:cd:D:f:hi:kKms:tVvwX:z-:")) != EOF) {
switch (c) {
case 'a' : arrow_cursor++; break;
case 'A' :
if(!Attach_it(optarg)) exit(1);
break;
! case 'c' : check_only++; use_tite = 0; break;
case 'd' :

#if DEBUG
set_debugging(optarg);
#else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,
! "Warning: system created without debugging enabled - request ignored\n"));
#endif
break;
case 'D' :

--- 107,130 ----
batch_subject[0] = '\0';
included_file[0] = '\0';

! while ((c = getopt(argc, argv, "?aA:cd:D:f:hi:kKms:tVvwX:z-:r:SM")) != EOF) {
switch (c) {
case 'a' : arrow_cursor++; break;
case 'A' :
if(!Attach_it(optarg)) exit(1);
+ opmode = OPMODE_SEND;
break;
! case 'c' :
! opmode = OPMODE_CHECK_ONLY;
! use_tite = 0;
! break;
case 'd' :

#if DEBUG
set_debugging(optarg);
#else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,

! "Warning: system created without debugging enabled - request ignored\n"));
! error_sleep(1);
#endif
break;
case 'D' :

***************
*** 131,144 ****
break;
case '?' :
case 'h' : args_help();
! case 'i' : strfcpy(included_file, optarg, sizeof included_file);
break;
/* case 'k' : hp_terminal++; break;
case 'K' : hp_terminal++; hp_softkeys++; break;
*/
case 'm' : mini_menu = 0; break;
! case 's' : strfcpy(batch_subject, optarg, sizeof batch_subject);
! break;
case 't' : use_tite = 0; break;
case 'V' : sendmail_verbose++; break;
case 'v' : v++; break;
--- 148,169 ----
break;
case '?' :
case 'h' : args_help();
! case 'i' :
! strfcpy(included_file, optarg, sizeof included_file);
! opmode = OPMODE_SEND;
break;
/* case 'k' : hp_terminal++; break;
case 'K' : hp_terminal++; hp_softkeys++; break;
*/
+ case 'M' : TreatAsSpooled = TRUE; break;
case 'm' : mini_menu = 0; break;
! case 'r' : set_user_rc_location(optarg); break;
! case 'S' : opmode = OPMODE_SEND; break;
! case 's' :
! strfcpy(batch_subject, optarg, sizeof batch_subject);
! opmode = OPMODE_SEND;
! break;
!
case 't' : use_tite = 0; break;
case 'V' : sendmail_verbose++; break;
case 'v' : v++; break;
***************
*** 149,155 ****
exit(1);
#endif
break;
! case 'z' : check_size++; use_tite = 0; break;
case '-':

if (0 == strncmp(optarg, "title-name=",11))
--- 174,182 ----
exit(1);
#endif
break;
! case 'z' :
! opmode = OPMODE_READ_NONEMPTY;
! use_tite = 0; break;
case '-':

if (0 == strncmp(optarg, "title-name=",11))
***************
*** 175,229 ****
if (v)
args_version(v);

- #if !defined(DEBUG) && 0
- if (debug)
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsIngoringDebug,
- "Warning: system created without debugging enabled - request ignored\n"));
- debug = 0;
- #endif
-
if (optind < argc) {
! *to_whom = argv + optind;
! if(!check_only)
! mail_only++;
! check_size = 0; /* NEVER do this if we're mailing!! */
! }

! if (strlen(batch_subject) > 0 && ! mail_only) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsSubjectNotSend,
! "\n\rDon't understand specifying a subject and no-one to send to!\n\r"));
!
! exit(1);
! }
!
! if (!isatty(fileno(stdin)) && !check_only) {
! batch_only = ON;
! if(*batch_subject == '\0')
! strfcpy(batch_subject, DEFAULT_BATCH_SUBJECT,
! sizeof batch_subject);
! }

- if (attach_files.attachment_count > 0) {
- if (! mail_only) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsAttachFileNotSend,
- "Can't specify an attached files with no-one to send to!"));
- exit(1);
- }
}

! if (strlen(included_file) > 0
! ) {
! if (! mail_only) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsInclFileNotSend,
! "Can't specify an included file with no-one to send to!"));
! exit(1);
! }
! if (batch_only) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsInclFileBatch,
! "Can't specify an included file in batch mode!"));
! exit(1);
! }
! }

if (wanted_mailbox_title && req_len < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 202,236 ----
if (v)
args_version(v);

if (optind < argc) {
! *to_whom = argv + optind;

! if(opmode != OPMODE_CHECK_ONLY)
! opmode = OPMODE_SEND;

}

!
! if (!isatty(STDIN_FILENO) && opmode != OPMODE_CHECK_ONLY) {
! if (opmode == OPMODE_SEND) {
! opmode = OPMODE_SEND_BATCH;
!
! if(*batch_subject == '\0')
! strfcpy(batch_subject, DEFAULT_BATCH_SUBJECT,
! sizeof batch_subject);
!
! if (included_file[0]) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsInclFileBatch,
! "Can't specify an included file in batch mode!"));
! exit(1);
! }
! } else {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsNoFileBatch,
! "Must specify a recipient in batch mode."));
! exit(1);
! }
!
! }

if (wanted_mailbox_title && req_len < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 251,257 ****


\t -h \t\tHelp - give this list of options\n\r\

\t -ix\t\tInclude prepared file 'x' in edit buffer for send\n\r"));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsHelp2,


! "\t -m \t\tMenu - Turn off menu, using more of the screen\n\r\

\t -sx\t\tSubject 'x' - for batch mailing\n\r\
\t -t \t\tTiTe - don't use termcap/terminfo ti/te entries.\n\r\
\t -V \t\tEnable sendmail voyeur mode.\n\r\

--- 258,267 ----


\t -h \t\tHelp - give this list of options\n\r\

\t -ix\t\tInclude prepared file 'x' in edit buffer for send\n\r"));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsHelp2,
! "\t -M \t\tMagic mode - treat all folders as spool files.\n\r\


! \t -m \t\tMenu - Turn off menu, using more of the screen\n\r\
! \t -rx \t\tRcfile - Use 'x' as the elmrc instead of the default\n\r\
! \t -S \t\tSend-only mode\n\r\
\t -sx\t\tSubject 'x' - for batch mailing\n\r\
\t -t \t\tTiTe - don't use termcap/terminfo ti/te entries.\n\r\
\t -V \t\tEnable sendmail voyeur mode.\n\r\

Index: elmME+.2.5.alpha2-cvs/src/attach_menu.c
*** elmME+.2.5.alpha1/src/attach_menu.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/attach_menu.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.62.8.2 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.62.8.4 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

! OE_APPEND_CURRENT|OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, MeSet,
MeAttachEnterDescription,
"Description: "));
***************
*** 1329,1336 ****
strfcpy (buf + l, att->type_opts, sizeof (buf) - l);
}

! code = optionally_enter (buf, LINES-3, 14, OE_APPEND_CURRENT|
! OE_REDRAW_MARK, sizeof buf, page);
if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
--- 1333,1341 ----
strfcpy (buf + l, att->type_opts, sizeof (buf) - l);
}

! code = optionally_enter(buf, LINES-3, 14, OE_APPEND_CURRENT|

! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,

! sizeof buf, page);
if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
***************
*** 1432,1440 ****
strfcpy (buf + l, att->disposition_opts, sizeof (buf) - l);
}

! code = optionally_enter (buf, LINES-3, 21,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
! sizeof buf, page);
if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
--- 1437,1446 ----
strfcpy (buf + l, att->disposition_opts, sizeof (buf) - l);
}

! code = optionally_enter(buf, LINES-3, 21,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! sizeof buf, page);
if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
***************
*** 1446,1451 ****
--- 1452,1458 ----
update = TRUE;
}
else if (ch == 'e' || ch == 'E') {
+ int oldenc = att->encoding;
prompt = TRUE;
PutLineX (LINES-3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachEnterContentTE,
***************
*** 1541,1550 ****
}

Write_to_screen (FRM("%s"),ENCODING(att->encoding));
! ch = menu_ReadCh(page,REDRAW_MARK);

if (ch == '\n')

break;
! else if (ch == ' ') {
NEXT_ENCODING;
}
else if (ch == REDRAW_MARK) {
--- 1548,1562 ----
}

Write_to_screen (FRM("%s"),ENCODING(att->encoding));
! ch = menu_ReadCh(page,REDRAW_MARK|READCH_sig_char);

if (ch == '\n')

break;
! else if (ch == TERMCH_interrupt_char) {
! att->encoding = oldenc;


! update = TRUE;
!

! break;
! } else if (ch == ' ') {
NEXT_ENCODING;
}
else if (ch == REDRAW_MARK) {
***************
*** 2319,2325 ****
PutLineX (LINES-3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachMenuPrompt,
"Attachments: "));
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize);
clear_error(); /* Clear the error message (from buffer also) */

switch (ch) {
--- 2331,2338 ----
PutLineX (LINES-3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachMenuPrompt,
"Attachments: "));
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);
clear_error(); /* Clear the error message (from buffer also) */

switch (ch) {
***************
*** 2571,2576 ****

--- 2584,2590 ----
case 'i':


case 'q':
case 'x':
+ case TERMCH_interrupt_char:
goto OUT;

case ctrl('F'):

***************
*** 2581,2587 ****
break;
#ifdef ALLOW_SUBSHELL
case '!':


! if (subshell(NULL,page) != 0) {
menu_ClearScreen(page);
update = TRUE;
}
--- 2595,2604 ----
break;

#ifdef ALLOW_SUBSHELL
case '!':
!

! subshell(NULL,page);


!
! if (menu_need_redraw(page)) {
menu_ClearScreen(page);

update = TRUE;
}
Index: elmME+.2.5.alpha2-cvs/src/browser.c
*** elmME+.2.5.alpha1/src/browser.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/browser.c 2004-08-14 15:06:10.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: browser.c,v 1.29.8.2 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: browser.c,v 1.29.8.4 2004/08/14 12:06:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

! if (0 != code) {

! DPRINT(Debug,4, (&Debug, "run_browser: Ctrl-C or error\n"));

! ret = 0;
! } else {

! int flags = give_dir_flags(p);
!
! if (0 != (BROWSER_SELECTED & flags))


! ret = 1;
! }

if (INFO.GB_FLAGS & GB_REDRAW)
*redraw = TRUE;

***************

*** 868,874 ****



Va_start(vl, msg); /* defined in defs.h */

if (run_browser(page,p,buffer,redraw,0,word,NULL,aview,format,msg,vl))
! ret = folder_from_dir_item(p);
va_end(vl);

free_string(&word);
--- 873,879 ----



Va_start(vl, msg); /* defined in defs.h */

if (run_browser(page,p,buffer,redraw,0,word,NULL,aview,format,msg,vl))
! ret = folder_from_dir_item(p,TreatAsSpooled);
va_end(vl);

free_string(&word);


***************
*** 1280,1286 ****
return &(I->pvector[0]);
}

! void gen_browser(
#if ANSI_C

struct menu_context *page,
struct folder_browser *p,

--- 1285,1291 ----
return &(I->pvector[0]);
}

! int gen_browser(
#if ANSI_C

struct menu_context *page,
struct folder_browser *p,

***************
*** 1311,1316 ****
--- 1316,1322 ----
va_list vl;
struct string * word = NULL;
int save_copy = 0;
+ int r;

switch (w) {
case word_change:
***************
*** 1337,1348 ****

Va_start(vl, msg); /* defined in defs.h */

! run_browser(page,p,buffer,redraw,save_copy,word,prev_fold,
! aview,format,msg,vl);
va_end(vl);


free_string(&word);
}

int file_browser(
--- 1343,1359 ----

Va_start(vl, msg); /* defined in defs.h */

! if (0 != code) {

! DPRINT(Debug,4, (&Debug, "file_browser: Ctrl-C or error\n"));

! ret = 0;
! } else {

! int flags = give_dir_flags(p);
!
! if (0 != (BROWSER_SELECTED & flags))


! ret = 1;
! }

if (INFO.GB_FLAGS & GB_REDRAW)
*redraw = TRUE;

Index: elmME+.2.5.alpha2-cvs/src/builtin++.c
*** elmME+.2.5.alpha1/src/builtin++.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/builtin++.c 2004-07-19 12:20:00.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.23.8.1 2004/04/30 16:50:06 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.23.8.2 2004/07/19 09:20:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 398,406 ****
is_end = 0;
}
EndBold();
!

read_key:
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize);

if (ch != '/') {
if (search_pattern) {
--- 398,407 ----
is_end = 0;
}
EndBold();
! CleartoEOS();
read_key:
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);

if (ch != '/') {
if (search_pattern) {

***************
*** 409,414 ****


--- 410,419 ----
}

switch (ch) {
+ case TERMCH_interrupt_char:

+ ret = 0;


+ goto finish;
+
case RESIZE_MARK:
DPRINT(Debug,4, (&Debug, " ... resizing\n"));
idx = idx_top;
***************

*** 446,462 ****
{
int code;


! code = optionally_enter2 (page,
! &search_pattern,
! LINES-1, 0,
! OE_REDRAW_MARK,
! CATGETS(elm_msg_cat, ElmSet,
! ElmBuiltinSearch,
! "Search: "));

if (REDRAW_MARK == code)
goto redraw;

! if (code < 0)
goto quit;
if (search_pattern && string_len(search_pattern)) {
int start_idx;
--- 451,470 ----
{
int code;

! code = optionally_enter2(page,
! &search_pattern,
! LINES-1, 0,

! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet,
! ElmBuiltinSearch,
! "Search: "));

if (REDRAW_MARK == code)
goto redraw;

! if (-1 == code) /* Ctrl-C */
! goto reprompt;


! if (code != 0)

goto quit;
if (search_pattern && string_len(search_pattern)) {
int start_idx;

Index: elmME+.2.5.alpha2-cvs/src/canceled.c


*** /tmp/29622-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-15 20:45:40.000000000 +0300

--- elmME+.2.5.alpha2-cvs/src/canceled.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 0 ****
--- 1,409 ----
+ static char rcsid[] = "@(#)$Id: canceled.c,v 1.5.4.1 2004/08/07 18:07:17 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.5.4.1 $ $State: Exp $
+ *


+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ ****************************************************************************
+ * Some code copiend from src/elm.c and src/leavembox.c.

+ * On these are following copyright:


+ *
+ * The Elm Mail System
+ *

+ * Copyright (c) 1988-1992 USENET Community Trust


+ * Copyright (c) 1986,1987 Dave Taylor

+ *****************************************************************************/
+

+ #include "def_elm.h"
+ #include "s_elm.h"
+

+ DEBUG_VAR(Debug,__FILE__,"ELM");
+

+ static void cancel_menu P_((struct menu_context *page));
+ static void cancel_menu(page)

+ struct menu_context *page;
+ {


+ /** write main system menu... **/
+ int LINES, COLUMNS;
+
+ menu_get_sizes(default_context,&LINES, &COLUMNS);
+
+ print_format_center(LINES-8,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmCancelMenuLine1,
+ "To select canceled message for mailing, press <return>."));
+ print_format_center(LINES-7,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmCancelMenuLine2,
+ "To read message, press space. j = move down, k = move up"));
+ print_format_center(LINES-6,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmCancelMenuLine3,

+ "Also available: d)elete, u)ndelete, i)ndex"));
+
+ }
+
+

+ static int showmsg_cancel_cmd P_(( struct MailboxView *mailbox,
+ int cmd, int *screen_mangled,
+ struct menu_context *page));
+ static int showmsg_cancel_cmd(mailbox,cmd,screen_mangled, page)

+ struct MailboxView *mailbox;


+ int cmd;
+ int *screen_mangled;

+ struct menu_context *page;


+ {
+
+
+ return cmd;
+ }
+
+ /* This leaks on exit */

+ char * last_canceled_mail = NULL;
+
+ int view_canceled_mails(cancel_view,cancel_selection,aview)


+ struct MailboxView * cancel_view;

+ int *cancel_selection;
+ struct AliasView *aview;
+ {
+
+ int leave = 0;
+ int redraw = 0, nufoot = 0;


+ int can_flag = 0;

+ int i;
+

+
+ if (menu_resized(page)) {


+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+
+ #undef max
+ #define max(a,b) ((a) < (b) ? (b) : (a))
+ if (mini_menu)
+ headers_per_page = max (LINES - 14, 1);
+ else
+ headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
+ #undef max
+ redraw++;
+ } else
+ redraw = menu_need_redraw(page);
+
+ nufoot = 0;
+ nucurr = 0;
+
+ new_mail_check(cancel_view, &header_page, page);

+ redraw += menu_need_redraw(page);
+

+ if (update_view(cancel_view)) {
+ resort_mailbox(cancel_view,1, &header_page);
+
+ redraw++;
+ }

+
+ if (redraw) {


+ redraw = 0;
+ showscreen(cancel_view,
+ cancel_menu,&header_page, page);
+ show_last_error();

+ }
+
+
+ {


+ int lin,col;
+ prompt_s(mcommon_give_item(&MENU,m_Prompt));
+ GetXYLocation(&lin,&col);
+
+ CleartoEOLN();
+ ch = GetPrompt(page);
+
+ CleartoEOS();
+
+ if (isascii(ch) && isprint(ch)) {
+ DPRINT(Debug,4,(&Debug,
+ "\nCommand: %c [%d]\n\n", ch, ch));
+ } else {
+ DPRINT(Debug,4,(&Debug,
+ "\nCommand: %d\n\n", ch));
+ }
+
+ set_error(""); /* clear error buffer */
+
+ MoveCursor(lin,col);
+ }
+
+ ch = motion(ch,&MENU,&nufoot, &header_page,
+ page);

+ redraw += menu_need_redraw(page);
+

+ switch (ch) {
+ case 0: /* OK */
+ break;
+
+ quit_mark:
+ case ctrl('Q') :
+
+ case 'Q':
+ case 'X':
+
+ leave = -2;
+ break;
+ case 'q':
+ case 'i':
+
+ leave = 1;
+

+ break;
+

+ case '$':
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
+ ElmResyncFolder,
+ "Resynchronize folder"));
+ FlushBuffer();
+ leave = -1;

+ break;
+

+ case ' ': /* Copied from mailbox_command */ {
+ int current = get_current(cancel_view);
+
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
+ ElmDisplayMessage,
+ "Display message"));
+ FlushBuffer();
+
+ if (current < 1)
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmNoMailToRead,
+ "No mail to read!"));
+ else {

+ struct header_rec *hdr;
+ FILE *F;
+ int i = 0;
+

+ break;
+
+ default:

+ DPRINT(Debug,3,(&Debug,
+ "Looping showmsg command %d (%c)\n",
+ i,i));
+ }

+ }
+

+ current = get_current(cancel_view);
+
+ redraw++;
+ (void)get_page(current, &MENU, &header_page);
+ }
+ }

+ break;
+

+ case ctrl('J'):
+ case ctrl('M'): {
+ int current = get_current(cancel_view);
+
+ Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
+ ElmSelectCanMessage,
+ "Select Canceled message"));
+
+ FlushBuffer();
+ if (current > 0) {
+ *cancel_selection = current -1;
+ leave = 1;

+ can_flag = 1;
+ }
+ }


+ break;
+
+ eof_mark:
+ case EOF:
+
+ goto OUT;
+
+ default:
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmUnknownCommand2,

+ "Unknown command."));
+
+ }
+

+ */
+ }
+

+ } /* the BIG while loop! */
+
+
+ if (leave != -2) {
+ int marked_deleted = 0;
+
+ for (i = 0; i < get_message_count(cancel_view); i++) {
+ if (mcommon_ison_status(&MENU,i,DELETED))
+ marked_deleted++;
+ }
+
+ if (marked_deleted > 0) {
+ int answer = (always_del ?
+ *def_ans_yes : *def_ans_no); /* default answer */
+

+ if(ask_delete) {
+ int def = answer;
+

+ }
+ }
+

+ if (answer == *def_ans_yes) {
+ /* NOTICE: This does not update index so
+ *cancel_selection is still valid */
+
+ delete_marked_canceled_mails(cancel_view);
+ }
+

+ }
+ }
+
+ if (leave == -1) {
+ int n;
+

+ *cancel_selection = -1;
+ can_flag = 0;
+
+ sync_canceled_mails(cancel_view) ;
+
+ if (get_current(cancel_view) > (n = get_message_count(cancel_view)))
+ set_current(cancel_view,n);
+
+ resort_mailbox(cancel_view,1, &header_page);
+
+ goto start_again;
+ }
+
+ OUT:
+ erase_menu_context(&page);
+
+ DPRINT(Debug,4,(&Debug, "view_canceled_mails=%d *cancel_selection=%d\n",
+ can_flag,*cancel_selection));
+ return can_flag;

+ }
+
+
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha2-cvs/src/digest.c
*** elmME+.2.5.alpha1/src/digest.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/digest.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.10 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: digest.c,v 1.10.8.1 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
***************
*** 162,171 ****


MoveCursor(lin,col);
}

! ch = mailbox_command(mailbox,ch, &redraw, &nufoot,

showmsg_digest_cmd, aview,
&header_page,page);



switch (ch) {
case 0: /* OK */
break;

--- 162,173 ----


MoveCursor(lin,col);
}

! ch = mailbox_command(mailbox,ch, &nufoot,

showmsg_digest_cmd, aview,
&header_page,page);



+ redraw += menu_need_redraw(page);
+
switch (ch) {
case 0: /* OK */
break;

Index: elmME+.2.5.alpha2-cvs/src/edit.c
*** elmME+.2.5.alpha1/src/edit.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/edit.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: edit.c,v 1.19.8.1 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: edit.c,v 1.19.8.2 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 31,37 ****
#ifdef ALLOW_MAILBOX_EDITING

void edit_mailbox(mailbox, header_page, page)
! struct MailboxView *mailbox;

int *header_page;
struct menu_context *page;
{

--- 31,37 ----
#ifdef ALLOW_MAILBOX_EDITING

void edit_mailbox(mailbox, header_page, page)

! struct MailboxView **mailbox;
int *header_page;
struct menu_context *page;
{
***************

Index: elmME+.2.5.alpha2-cvs/src/editmsg.c
*** elmME+.2.5.alpha1/src/editmsg.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/editmsg.c 2004-07-19 12:20:00.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.42.8.3 2004/07/03 15:23:06 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.42.8.4 2004/07/19 09:20:00 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 435,440 ****
--- 435,443 ----


signal(SIGINT, edit_interrupt);
signal(SIGQUIT, edit_interrupt);

+ SIGDPRINT(Debug,1,(&Debug,
+ " edit_interrupt() --- DANGER\n"));
+
if (interrupts_while_editing++ == 0)
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmEditmsgOneMoreCancel,
***************

*** 1002,1008 ****


CATGETS(elm_msg_cat, ElmSet,
ElmEnterNameEditor,
"Please enter the name of the editor: "));
! I->flags = OE_REDRAW_MARK;
if (I->pvector[0])
Write_to_screen(FRM("%S"),I->pvector[0]);
CleartoEOS();

--- 1005,1011 ----


CATGETS(elm_msg_cat, ElmSet,
ElmEnterNameEditor,
"Please enter the name of the editor: "));
! I->flags = OE_REDRAW_MARK| OE_SIG_CHAR;
if (I->pvector[0])
Write_to_screen(FRM("%S"),I->pvector[0]);
CleartoEOS();
***************

*** 1037,1043 ****


/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA;
break;
case -3:
PutLineX(LINES-2,0,

--- 1040,1047 ----


/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA
! | OE_SIG_CHAR;
break;
case -3:
PutLineX(LINES-2,0,
***************

*** 1049,1055 ****


/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA;
break;
case -2:
PutLineX(LINES-2,0,

--- 1053,1060 ----


/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA
! | OE_SIG_CHAR;
break;
case -2:
PutLineX(LINES-2,0,
***************

*** 1061,1067 ****


/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA;
break;
case -1:
PutLineX(LINES-2,0,

--- 1066,1073 ----


/* XXXX_edit_buffer (char * -routines) handles mime encoded
words so no OE_ALLOW_MIMEENC here ...
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA
! | OE_SIG_CHAR;
break;
case -1:
PutLineX(LINES-2,0,
***************

*** 1072,1078 ****


/* OE_ALLOW_MIMEENC so that user can paste mime encoded words
to buffer and they are converted
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ALLOW_MIMEENC;
break;
}

--- 1078,1085 ----


/* OE_ALLOW_MIMEENC so that user can paste mime encoded words
to buffer and they are converted
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ALLOW_MIMEENC
! | OE_SIG_CHAR;
break;
}

***************

*** 1087,1093 ****


if (I->pvector[0])
Write_to_screen(FRM("%S"),I->pvector[0]);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK;
return & (I->pvector[0]);
} else { /* Text editor */
int ok = 0;

--- 1094,1100 ----


if (I->pvector[0])
Write_to_screen(FRM("%S"),I->pvector[0]);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK| OE_SIG_CHAR;
return & (I->pvector[0]);
} else { /* Text editor */
int ok = 0;
***************

*** 1189,1195 ****


}
/* handle escape_char */
I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK |
! OE_EDITOR_ESCAPE;

/* Update end of file mark and wrapped lines*/
if (added && line_cordinate+1 < LINES-2) {

--- 1196,1202 ----


}
/* handle escape_char */
I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK |
! OE_EDITOR_ESCAPE| OE_SIG_CHAR;

/* Update end of file mark and wrapped lines*/
if (added && line_cordinate+1 < LINES-2) {
***************

*** 1233,1239 ****


I->pvector[0] = tmp2;
}
free_string(&tmp);
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA;
}

static void start_edit_subject P_((struct enter_info *I));

--- 1240,1247 ----


I->pvector[0] = tmp2;
}
free_string(&tmp);
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ADD_COMMA
! | OE_SIG_CHAR;
}

static void start_edit_subject P_((struct enter_info *I));
***************

*** 1258,1264 ****


/* OE_ALLOW_MIMEENC so that user can paste mime encoded words
to buffer and they are converted
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ALLOW_MIMEENC;
}

static void redraw_editor(I)

--- 1266,1273 ----


/* OE_ALLOW_MIMEENC so that user can paste mime encoded words
to buffer and they are converted
*/
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_ALLOW_MIMEENC
! | OE_SIG_CHAR;
}

static void redraw_editor(I)
***************

*** 1494,1500 ****



free_string(&(I->pvector[0]));
I->py = I->counter-1;
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
return write_edit_line(I);
} else if (0 == (I->flags & OE_EDITOR_ESCAPE)) { /* Command editor */
int buffer_line = I->py+1;

--- 1503,1510 ----



free_string(&(I->pvector[0]));
I->py = I->counter-1;
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
return write_edit_line(I);
} else if (0 == (I->flags & OE_EDITOR_ESCAPE)) { /* Command editor */
int buffer_line = I->py+1;
***************

*** 1504,1510 ****



if (! I->pvector[0] ||
0 == string_len(I->pvector[0])) {
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
return write_edit_line(I);
}

--- 1514,1521 ----



if (! I->pvector[0] ||
0 == string_len(I->pvector[0])) {
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
return write_edit_line(I);
}

***************

*** 1522,1535 ****


tilde_help();
redraw_editor(I);
free_string(&I->pvector[0]);
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
return write_edit_line(I);
case 0x007E: /* '~' */
if (I->pvector[buffer_line])
free_string(&(I->pvector[buffer_line]));
I->pvector[buffer_line] = I->pvector[0];
I->pvector[0] = NULL;
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
I->ch_count = 1;
return write_edit_line(I);
case 0x0074: /* 't' */

--- 1533,1548 ----


tilde_help();
redraw_editor(I);
free_string(&I->pvector[0]);
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
return write_edit_line(I);
case 0x007E: /* '~' */
if (I->pvector[buffer_line])
free_string(&(I->pvector[buffer_line]));
I->pvector[buffer_line] = I->pvector[0];
I->pvector[0] = NULL;
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
I->ch_count = 1;
return write_edit_line(I);
case 0x0074: /* 't' */
***************

*** 1560,1566 ****


case 0x0048: /* 'H' */
/* TODO: Ask To: Cc: Bcc: Subject: */

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);

return write_edit_line(I);

--- 1573,1579 ----


case 0x0048: /* 'H' */
/* TODO: Ask To: Cc: Bcc: Subject: */

! I->flags |= OE_EDITOR_ESCAPE| OE_SIG_CHAR;
free_string(&I->pvector[0]);

return write_edit_line(I);
***************

*** 1574,1580 ****



free_string(&S);
free(s);
! I->flags |= OE_EDITOR_ESCAPE;

free_string(&I->pvector[0]);

--- 1587,1593 ----



free_string(&S);
free(s);
! I->flags |= OE_EDITOR_ESCAPE| OE_SIG_CHAR;

free_string(&I->pvector[0]);

***************

*** 1582,1588 ****


case 0x0065: /* 'e' */
case 0x0045: /* 'E' */

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);

if (strlen(e_editor) > 0 ||

--- 1595,1601 ----


case 0x0065: /* 'e' */
case 0x0045: /* 'E' */

! I->flags |= OE_EDITOR_ESCAPE| OE_SIG_CHAR;
free_string(&I->pvector[0]);

if (strlen(e_editor) > 0 ||
***************

*** 1624,1630 ****


case 0x0076: /* 'v' */
case 0x0056: /* 'V' */

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);

if (have_editor(v_editor)) {

--- 1637,1643 ----


case 0x0076: /* 'v' */
case 0x0056: /* 'V' */

! I->flags |= OE_EDITOR_ESCAPE| OE_SIG_CHAR;
free_string(&I->pvector[0]);

if (have_editor(v_editor)) {
***************

*** 1658,1664 ****



X = 1;
S = clip_from_string(I->pvector[0],&X,string_len(I->pvector[0]));
! I->flags = OE_REDRAW_MARK ;
I->ch_count = 0;
free_string(&I->pvector[0]);
I->pvector[0] = S;

--- 1671,1678 ----



X = 1;
S = clip_from_string(I->pvector[0],&X,string_len(I->pvector[0]));
! I->flags = OE_REDRAW_MARK
! | OE_SIG_CHAR;
I->ch_count = 0;
free_string(&I->pvector[0]);
I->pvector[0] = S;
***************

*** 1692,1698 ****


free(s1);
free(s);
}
! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);
return write_edit_line(I);
case 0x0021: /* '!' */

--- 1706,1712 ----


free(s1);
free(s);
}
! I->flags |= OE_EDITOR_ESCAPE | OE_SIG_CHAR;
free_string(&I->pvector[0]);
return write_edit_line(I);
case 0x0021: /* '!' */
***************

*** 1736,1742 ****


ElmSimpleContinue,
"(Continue.)"));
}
! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);
return write_edit_line(I);

--- 1750,1756 ----


ElmSimpleContinue,
"(Continue.)"));
}
! I->flags |= OE_EDITOR_ESCAPE | OE_SIG_CHAR;
free_string(&I->pvector[0]);
return write_edit_line(I);

***************

*** 1751,1757 ****



read_in_messages(I);

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);
return write_edit_line(I);

--- 1765,1771 ----



read_in_messages(I);

! I->flags |= OE_EDITOR_ESCAPE | OE_SIG_CHAR;
free_string(&I->pvector[0]);
return write_edit_line(I);

***************

*** 1760,1766 ****


I->py = 0;
redraw_editor(I);

! I->flags |= OE_EDITOR_ESCAPE;
free_string(&I->pvector[0]);
return write_edit_line(I);

--- 1774,1780 ----


I->py = 0;
redraw_editor(I);

! I->flags |= OE_EDITOR_ESCAPE | OE_SIG_CHAR;
free_string(&I->pvector[0]);
return write_edit_line(I);

***************

*** 1772,1778 ****



sleep_message();
/* reprompt */
! I->flags = OE_REDRAW_MARK;
I->ch_count = 0;
return write_edit_line(I);
}

--- 1786,1792 ----



sleep_message();
/* reprompt */
! I->flags = OE_REDRAW_MARK | OE_SIG_CHAR;
I->ch_count = 0;
return write_edit_line(I);
}
***************

*** 1828,1834 ****


if (0 == (I->flags & OE_EDITOR_ESCAPE)) {
MoveCursor(LINES-2,0);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
}
I->py--;
}

--- 1842,1849 ----


if (0 == (I->flags & OE_EDITOR_ESCAPE)) {
MoveCursor(LINES-2,0);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
}
I->py--;
}
***************

*** 1847,1853 ****


if (0 == (I->flags & OE_EDITOR_ESCAPE)) {
MoveCursor(LINES-2,0);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
}
if (I->py <= I->counter)
I->py++;

--- 1862,1869 ----


if (0 == (I->flags & OE_EDITOR_ESCAPE)) {
MoveCursor(LINES-2,0);
CleartoEOS();
! I->flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE
! | OE_SIG_CHAR;
}
if (I->py <= I->counter)
I->py++;
***************

*** 1932,1938 ****


GetXYLocation(&line, &col);
write_line(I,line);

! I->flags = OE_REDRAW_MARK;
MoveCursor(LINES-2,0);
CleartoEOS();
if (I->pvector[0])

--- 1948,1954 ----


GetXYLocation(&line, &col);
write_line(I,line);

! I->flags = OE_REDRAW_MARK| OE_SIG_CHAR;
MoveCursor(LINES-2,0);
CleartoEOS();
if (I->pvector[0])
***************

*** 1997,2002 ****
--- 2013,2019 ----

struct menu_context * page = NULL;
int LINES, COLUMNS;


+ int code1;

/* The built-in editor is not re-entrant! */
if (builtin_editor_active) {
***************

*** 2023,2029 ****


INFO.px = -1;
INFO.py = 0;
INFO.give_buffer = gb_editmsg;
! INFO.flags = OE_APPEND_CURRENT | OE_REDRAW_MARK | OE_EDITOR_ESCAPE;
INFO.ch_count = 0;
INFO.builtin = &INFO_1;
INFO.dir_p = NULL;

--- 2040,2047 ----


INFO.px = -1;
INFO.py = 0;
INFO.give_buffer = gb_editmsg;
! INFO.flags = OE_APPEND_CURRENT | OE_REDRAW_MARK |
! OE_EDITOR_ESCAPE | OE_SIG_CHAR;
INFO.ch_count = 0;
INFO.builtin = &INFO_1;
INFO.dir_p = NULL;

***************
*** 2054,2059 ****
--- 2072,2078 ----


interrupts_while_editing = 0;

if (SETJMP(edit_location) != 0) {
+ restart_sig:
if (interrupts_while_editing > 1) {
(void) signal(SIGINT, oldint);
(void) signal(SIGQUIT, oldquit);
***************

*** 2064,2070 ****


}

more_input:
! while (REDRAW_MARK == enter_helper(&INFO, page)) {

if (menu_resized(page))
menu_get_sizes(page, &LINES, &COLUMNS);

--- 2083,2089 ----


}

more_input:
! while (REDRAW_MARK == (code1 = enter_helper(&INFO, page))) {

if (menu_resized(page))

menu_get_sizes(page, &LINES, &COLUMNS);
***************
*** 2076,2081 ****
--- 2095,2114 ----



}

+ if (-1 == code1) {

+ DPRINT(Debug,1,(&Debug,"interrupt char given (no signal)\n"));
+
+ if (interrupts_while_editing++ == 0)
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmEditmsgOneMoreCancel,
+ "(Interrupt. One more to cancel this letter.)"));
+ else


+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEditmsgCancelled,
+ "(Interrupt. Letter canceled.)"));
+
+ goto restart_sig;
+ }
+
(void) signal(SIGINT, oldint);
(void) signal(SIGQUIT, oldquit);

Index: elmME+.2.5.alpha2-cvs/src/elm.c
*** elmME+.2.5.alpha1/src/elm.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/elm.c 2004-08-14 15:06:10.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elm.c,v 1.69.8.4 2004/07/03 15:23:06 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69.8.4 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.69.8.8 2004/08/14 12:06:10 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 117,133 ****
extern int errno;
#endif

! int mailbox_command(mailbox, ch, redraw, nufoot, cmdX, aview, header_page,
page)
struct MailboxView *mailbox;
! int ch;


! int *redraw;
int *nufoot;
showmsg_cmd cmdX;

struct AliasView *aview;
int *header_page;

struct menu_context *page;
{
struct menu_common MENU;
int LINES, COLUMNS;

--- 117,133 ----
extern int errno;
#endif

! int mailbox_command(mailbox, ch, nufoot, cmdX, aview, header_page,
page)


struct MailboxView *mailbox;
! int ch;
int *nufoot;
showmsg_cmd cmdX;

struct AliasView *aview;
int *header_page;

struct menu_context *page;
{


+ int redraw = 0;

struct menu_common MENU;
int LINES, COLUMNS;

***************
*** 140,146 ****

#ifdef ALLOW_SUBSHELL


case '!' : Writechar('!');
! *redraw += subshell(mailbox, page);
break;
#endif

--- 140,148 ----

#ifdef ALLOW_SUBSHELL


case '!' : Writechar('!');

! subshell(mailbox, page);

! redraw += menu_need_redraw(page);
!

break;
#endif

***************
*** 177,184 ****


}
break;

! case 'a' : alias(mailbox, aview);
! (*redraw)++;

/* define_softkeys(MAIN); */
break;

--- 179,187 ----


}
break;

! case 'a' :
! alias(mailbox, aview);
! redraw++;

/* define_softkeys(MAIN); */
break;

***************

*** 200,205 ****
--- 203,210 ----
&hdr,&F,NULL,
NO_mime_parse)) {
(*nufoot) = remail(hdr,F, aview, page);


+
+ redraw += menu_need_redraw(page);

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************
*** 223,232 ****

else if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,NO_mime_parse)) {



! if (hdr->pgp & PGP_PUBLIC_KEY)
/* FIX: mime structure is not currently used */

! *redraw = pgp_extract_public_key(hdr,F);
! else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoPgpPublicKeys,
"This message does not contain PGP public keys!"));

--- 228,238 ----
else if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,NO_mime_parse)) {


! if (hdr->pgp & PGP_PUBLIC_KEY) {
/* FIX: mime structure is not currently used */

! pgp_extract_public_key(hdr,F,page);


! redraw += menu_need_redraw(page);
! } else

lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoPgpPublicKeys,
"This message does not contain PGP public keys!"));
***************

*** 264,272 ****


"No mail to forward!"));

else {
!

! if (forward(current-1,mailbox, aview, page))

! (*redraw)++;
else {
(*nufoot)++;
show_msg_status(current-1,&MENU, *header_page);
--- 270,279 ----


"No mail to forward!"));

else {


! forward(current-1,mailbox, aview, page);
!
! if (menu_need_redraw(page))

! redraw++;
else {
(*nufoot)++;
show_msg_status(current-1,&MENU, *header_page);
***************

*** 303,315 ****
} else {
/* define_softkeys(YESNO); */


! (*redraw) += reply_to_everyone(current-1,
! mailbox,
! aview,
! page);
/* define_softkeys(MAIN); */

! if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
}
} else {

--- 310,321 ----
} else {
/* define_softkeys(YESNO); */


! reply_to_everyone(current-1, mailbox,
! aview,page);
! redraw += menu_need_redraw(page);
/* define_softkeys(MAIN); */

! if (!redraw)
show_msg_status(current-1,&MENU, *header_page);
}
} else {
***************

*** 386,392 ****


current = get_current(mailbox);

elm_filter = j;
! (*redraw)++;
(void)get_page(current, &MENU, header_page);
}
}

--- 392,398 ----


current = get_current(mailbox);

elm_filter = j;
! redraw++;
(void)get_page(current, &MENU, header_page);
}
}
***************

*** 399,405 ****


"Mail PGP public key"));
FlushBuffer();

! *redraw = pgp_mail_public_key(mailbox, aview, page);
break;
#endif

--- 405,413 ----


"Mail PGP public key"));
FlushBuffer();

! pgp_mail_public_key(mailbox, aview, page);


! redraw += menu_need_redraw(page);
!

break;
#endif

***************
*** 418,424 ****

show_mlists = 1;
}
! (*redraw) = 1; /* force redraw */

break;

--- 426,432 ----

show_mlists = 1;
}
! redraw = 1; /* force redraw */

break;

***************
*** 426,434 ****
ElmMail,
"Mail"));
FlushBuffer();


! (*redraw) += send_msg_l(-1, NULL, NULL, NULL,
MAIL_EDIT_MSG,allow_forms,
mailbox, aview,page);
break;

case ' ' :

--- 434,445 ----
ElmMail,
"Mail"));
FlushBuffer();
! send_msg_l(-1, NULL, NULL, NULL,
MAIL_EDIT_MSG,allow_forms,
mailbox, aview,page);


+
+ redraw += menu_need_redraw(page);
+

break;

case ' ' :
***************
*** 488,494 ****



current = get_current(mailbox);

! (*redraw)++;
(void)get_page(current, &MENU, header_page);
}
}

--- 499,505 ----



current = get_current(mailbox);

! redraw++;
(void)get_page(current, &MENU, header_page);
}
}
***************

*** 550,556 ****



current = get_current(mailbox);

! (*redraw)++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

--- 561,567 ----



current = get_current(mailbox);

! redraw++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);
***************

*** 623,629 ****



current = get_current(mailbox);

! (*redraw)++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

--- 634,640 ----



current = get_current(mailbox);

! redraw++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);
***************

*** 666,673 ****


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! if (print_text(TRUE, mailbox, *header_page, page) != 0)
! (*redraw)++;
else
show_msg_status(current-1,&MENU, *header_page);
} else {

--- 677,685 ----


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! print_text(TRUE, mailbox, *header_page, page);
! if (menu_need_redraw(page))
! redraw++;
else
show_msg_status(current-1,&MENU, *header_page);
} else {
***************

*** 693,701 ****


"No mail to reply to!"));

else {

! (*redraw) += reply(current-1,mailbox, aview, page);

! if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
}
/* softkeys_on(); */

--- 705,714 ----


"No mail to reply to!"));

else {

! reply(current-1,mailbox, aview, page);
! redraw += menu_need_redraw(page);


! if (!redraw)
show_msg_status(current-1,&MENU, *header_page);
}
/* softkeys_on(); */
***************

*** 731,737 ****


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

! if (save(redraw, FALSE, (ch != 'C'), 0,mailbox, aview,
*header_page, page)
&& resolve_mode && ch != 'C') {
int i;

--- 744,750 ----


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

! if (save(FALSE, (ch != 'C'), 0,mailbox, aview,
*header_page, page)
&& resolve_mode && ch != 'C') {
int i;
***************

*** 746,751 ****
--- 759,766 ----



}
}
+
+ redraw += menu_need_redraw(page);

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 770,779 ****


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! save(redraw, FALSE, 0, 1, mailbox, aview, *header_page,
page);

! if (!*redraw)
show_msg_status(current-1,&MENU, *header_page);
} else {
DPRINT(Debug,3,(&Debug,

--- 785,796 ----


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! save(FALSE, 0, 1, mailbox, aview, *header_page,

page);

! redraw += menu_need_redraw(page);
!

! if (!redraw)
show_msg_status(current-1,&MENU, *header_page);
} else {
DPRINT(Debug,3,(&Debug,
***************

*** 823,829 ****


hdr,
aview
);
! (*redraw)++;
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMIMEMessage,

--- 840,846 ----


hdr,
aview
);
! redraw++;
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMIMEMessage,
***************

*** 857,863 ****



current = get_current(mailbox);
(void)get_page(current, &MENU, header_page);
! (*redraw)++;

} else {
DPRINT(Debug,3,(&Debug,

--- 874,880 ----



current = get_current(mailbox);
(void)get_page(current, &MENU, header_page);
! redraw++;

} else {
DPRINT(Debug,3,(&Debug,
***************

*** 872,878 ****



case '@' :
debug_screen(mailbox, *header_page);
! (*redraw)++;
break;

case '#' : {

--- 889,895 ----



case '@' :
debug_screen(mailbox, *header_page);
! redraw++;
break;

case '#' : {
***************

*** 896,902 ****


&index);

debug_message(hdr, current, &index);
! (*redraw)++;
}
}
}

--- 913,919 ----


&index);

debug_message(hdr, current, &index);
! redraw++;
}
}
}
***************

*** 905,928 ****


default:
/* Maybe motion command */

! ch = motion(ch,&MENU,redraw,nufoot, header_page,
page);

return ch;

}
return 0; /* Command OK */
}

! void new_mail_check (mailbox, redraw, header_page, page)

struct MailboxView *mailbox;
- int *redraw;


int *header_page;
struct menu_context *page;
{

int idx, mbxcount;
struct menu_common MENU;

int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

--- 922,953 ----


default:
/* Maybe motion command */

! ch = motion(ch,&MENU,nufoot, header_page,
page);

+ /* motion() may already set, menu_trigger_redraw(page),
+ we do not examine it */

+ if (redraw)
+ menu_trigger_redraw(page);

+
return ch;

}
+

+ if (redraw)
+ menu_trigger_redraw(page);

return 0; /* Command OK */
}

! void new_mail_check (mailbox, header_page, page)
struct MailboxView *mailbox;

int *header_page;
struct menu_context *page;
{

int idx, mbxcount;
struct menu_common MENU;
int LINES, COLUMNS;

+ int redraw = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 972,978 ****



if (on_page(current, &MENU, *header_page) ||
was_on_page || !ok) /* do we REALLY have to rewrite? */
! (*redraw)++;

ClearLine(LINES-2); /* remove reading message... */

--- 997,1003 ----



if (on_page(current, &MENU, *header_page) ||
was_on_page || !ok) /* do we REALLY have to rewrite? */
! redraw++;

ClearLine(LINES-2); /* remove reading message... */

***************

*** 1000,1005 ****
--- 1025,1033 ----


}
}

+ if (redraw)
+ menu_trigger_redraw(page);

+
}


***************
*** 1019,1026 ****


int header_page = 0; /* current header page */

struct menu_context *page = NULL;

-
set_panic_prepare(elm_panic_prepare);
set_panic_exit(elm_panic_exit);

--- 1047,1055 ----


int header_page = 0; /* current header page */

struct menu_context *page = NULL;

+ struct MailboxView * cur_mailbox = NULL;
+ struct AliasView * cur_aliaslist = NULL;

set_panic_prepare(elm_panic_prepare);
set_panic_exit(elm_panic_exit);

***************

*** 1046,1053 ****


locale_init();

req_mfile_vector = parse_arguments(argc, argv, &to_whom);
! initialize(req_mfile_vector, &current_mailbox, &current_aliaslist,
&header_page, &page);
if (req_mfile_vector) {
int i;

--- 1075,1083 ----


locale_init();

req_mfile_vector = parse_arguments(argc, argv, &to_whom);
! initialize(req_mfile_vector, &cur_mailbox, &cur_aliaslist,
&header_page, &page);

+

if (req_mfile_vector) {
int i;

***************

*** 1060,1088 ****
req_mfile_vector = NULL;
}

!
!
! if (mail_only) {
DPRINT(Debug,2,(&Debug,
"Mail-only: mailing to\n"));

! if(!batch_only) {
print_format_center(1,
CATGETS(elm_msg_cat, ElmSet, ElmSendOnlyMode,
"Send only mode [ELM %s]"),
version_buff);
}
- send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
- (batch_only ? NO : allow_forms), current_mailbox,
- current_aliaslist, page);

! leave(0, &current_mailbox, &current_aliaslist);
! } else if (check_only) {
! do_check_only(to_whom, current_aliaslist);
! leave(0, &current_mailbox, &current_aliaslist);
}


! showscreen(current_mailbox,
show_menu, &header_page, page);

while (1) {

--- 1090,1125 ----
req_mfile_vector = NULL;
}

! if (OPMODE_IS_SENDMODE(opmode)) {
DPRINT(Debug,2,(&Debug,
"Mail-only: mailing to\n"));

! if (OPMODE_IS_INTERACTIVE(opmode)) {
print_format_center(1,
CATGETS(elm_msg_cat, ElmSet, ElmSendOnlyMode,
"Send only mode [ELM %s]"),
version_buff);
}

! if (to_whom)
! send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
! (OPMODE_SEND_BATCH == opmode ? NO : allow_forms),
! cur_mailbox,
! cur_aliaslist, page);
! else
! send_msg_l(-1, NULL, NULL, batch_subject, MAIL_EDIT_MSG,
! (OPMODE_SEND_BATCH == opmode ? NO : allow_forms),
! cur_mailbox,
! cur_aliaslist, page);
!
!
! leave(0);
! } else if (OPMODE_CHECK_ONLY == opmode) {


! do_check_only(to_whom, cur_aliaslist);
! leave(0);
}

! showscreen(cur_mailbox,
show_menu, &header_page, page);

while (1) {
***************

*** 1092,1098 ****



menu_get_sizes(page,&LINES, &COLUMNS);

! set_mcommon_from_mbxview(&MENU,current_mailbox);

if (menu_resized(page)) {

--- 1129,1135 ----



menu_get_sizes(page,&LINES, &COLUMNS);

! set_mcommon_from_mbxview(&MENU,cur_mailbox);

if (menu_resized(page)) {

***************

*** 1108,1114 ****


redraw++;
}
else
! redraw = menu_need_redraw(page);

nufoot = 0;
nucurr = 0;

--- 1145,1151 ----


redraw++;
}
else
! redraw += menu_need_redraw(page);

nufoot = 0;
nucurr = 0;

***************
*** 1118,1136 ****


sigchld_handler();
#endif

! new_mail_check(current_mailbox,&redraw, &header_page,
page);

/* ??? FIX Is this correct ?? */
! if (update_view(current_mailbox)) {
! resort_mailbox(current_mailbox,1,&header_page);

redraw++;
}

if (redraw) {
redraw = 0;
! showscreen(current_mailbox,
show_menu, &header_page, page);
show_last_error();
}

--- 1155,1178 ----


sigchld_handler();
#endif

! new_mail_check(cur_mailbox,&header_page,
page);

+ redraw += menu_need_redraw(page);
+

/* ??? FIX Is this correct ?? */
! if (update_view(cur_mailbox)) {
! resort_mailbox(cur_mailbox,1,&header_page);

redraw++;
}

if (redraw) {
+ DPRINT(Debug,7, (&Debug,
+ "main: pending redraw\n"));
+
redraw = 0;
! showscreen(cur_mailbox,
show_menu, &header_page, page);
show_last_error();
}
***************

*** 1142,1148 ****


prompt_s(mcommon_give_item(&MENU, m_Prompt));
GetXYLocation(&lin,&col);

! CleartoEOLN();

/* fragment_handling: 0 == none,
1 == manual,

--- 1184,1192 ----


prompt_s(mcommon_give_item(&MENU, m_Prompt));
GetXYLocation(&lin,&col);

! CleartoEOS();
! show_last_error();
! MoveCursor(lin,col);

/* fragment_handling: 0 == none,
1 == manual,

***************
*** 1150,1156 ****




if (auto_assemble && 2 == fragment_handling &&
! have_partial(current_mailbox)) {
ch = 'A';
auto_assemble = 0;

--- 1194,1200 ----




if (auto_assemble && 2 == fragment_handling &&
! have_partial(cur_mailbox)) {
ch = 'A';
auto_assemble = 0;

***************

*** 1175,1192 ****
MoveCursor(lin,col);
}


! ch = mailbox_command(current_mailbox,ch, &redraw, &nufoot,
showmsg_main_cmd,
! current_aliaslist,
&header_page,page);

switch (ch) {
case 0: /* OK */
break;

case HELP_MARK:
case '?' :
! if (help(FALSE, page))
redraw++;
else
nufoot++;

--- 1219,1240 ----
MoveCursor(lin,col);
}


! ch = mailbox_command(cur_mailbox,ch, &nufoot,
showmsg_main_cmd,
! cur_aliaslist,
&header_page,page);

+ redraw += menu_need_redraw(page);
+
switch (ch) {
case 0: /* OK */
break;

case HELP_MARK:
case '?' :
! help(FALSE, page);
!
! if (menu_need_redraw(page))
redraw++;
else
nufoot++;
***************
*** 1198,1215 ****


Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmResyncFolder,
"Resynchronize folder"));
! redraw += resync(& current_mailbox, &header_page, page);

/* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,current_mailbox);

! current = get_current(current_mailbox);
nucurr = get_page(current, &MENU, &header_page);
}
break;

case '|' : {
! int current = get_current(current_mailbox);

Writechar('|');

--- 1246,1266 ----


Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmResyncFolder,
"Resynchronize folder"));
! FlushBuffer();
!

! resync(& cur_mailbox, &header_page, page);
! redraw += menu_need_redraw(page);


/* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,cur_mailbox);

! current = get_current(cur_mailbox);
nucurr = get_page(current, &MENU, &header_page);
}
break;

case '|' : {
! int current = get_current(cur_mailbox);

Writechar('|');

***************

*** 1218,1229 ****


ElmNoMailToPipe,
"No mail to pipe!"));

! } else if (give_message_data(current_mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

/* softkeys_off(); */

! redraw += do_pipe(current_mailbox, page);

/* softkeys_on(); */
} else {
DPRINT(Debug,3,(&Debug,

--- 1269,1282 ----


ElmNoMailToPipe,
"No mail to pipe!"));

! } else if (give_message_data(cur_mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

/* softkeys_off(); */

! do_pipe(cur_mailbox, page);

! redraw += menu_need_redraw(page);
!

/* softkeys_on(); */
} else {
DPRINT(Debug,3,(&Debug,

***************
*** 1232,1239 ****


}
break;

case 'A': {
! int current = get_current(current_mailbox);

Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmAssemble,

--- 1285,1307 ----
}
break;

+ case '&' : {
+ TreatAsSpooled = !TreatAsSpooled;
+ if (TreatAsSpooled) {
+ /* !!! Message should be better!
+ */
+ lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmMagicOn,
+ "[Magic On]"));
+ } else {
+ lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmMagicOff,
+ "[Magic Off]"));
+ }
+ }
+ break;
+
+

case 'A': {
! int current = get_current(cur_mailbox);

Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmAssemble,
***************

*** 1241,1271 ****


FlushBuffer();
sleep_message();

! ViewPartial(current_mailbox, current_aliaslist);

! current = get_current(current_mailbox);
(void)get_page(current, &MENU, &header_page);
redraw++;

}

break;

! case 'c' : Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmChangeFolder,


"Change folder"));
/* define_softkeys(CHANGE); */
! redraw += change_file(& current_mailbox, current_aliaslist,
&header_page, page);
!
/* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,current_mailbox);

/* define_softkeys(MAIN); */
break;

#ifdef ALLOW_MAILBOX_EDITING
case 'e' : {
! int current = get_current(current_mailbox);

Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmEditFolder,

--- 1309,1349 ----


FlushBuffer();
sleep_message();

! ViewPartial(cur_mailbox, cur_aliaslist);

! current = get_current(cur_mailbox);
(void)get_page(current, &MENU, &header_page);
redraw++;

}

break;

! case 'c' :
! if (TreatAsSpooled)
! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmChangeMailbox,
! "Change mailbox"));
! else
! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmChangeFolder,
"Change folder"));
+ FlushBuffer();
+

/* define_softkeys(CHANGE); */
! change_file(& cur_mailbox, cur_aliaslist,

&header_page, page);


! redraw += menu_need_redraw(page);
!

!
/* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,cur_mailbox);

/* define_softkeys(MAIN); */
break;

#ifdef ALLOW_MAILBOX_EDITING
case 'e' : {
! int current = get_current(cur_mailbox);

Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmEditFolder,
***************

*** 1284,1290 ****


ElmFolderIsEmpty,
"Folder is empty!"));
else
! edit_mailbox(current_mailbox, &header_page,
page);

}

--- 1362,1368 ----


ElmFolderIsEmpty,
"Folder is empty!"));
else
! edit_mailbox(&cur_mailbox, &header_page,
page);

}
***************

*** 1298,1319 ****


#endif

case 'o' : {
! int current = get_current(current_mailbox);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmOptions,
"Options"));
! if((i=options(current_mailbox, current_aliaslist)) > 0) {
! current = get_current(current_mailbox);
get_page(current, &MENU, &header_page);
} else if(i < 0)
! leave(0, &current_mailbox, &current_aliaslist);
redraw++; /* always fix da screen... */
}
break;

case 'p' : {
! int current = get_current(current_mailbox);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmPrintMail,

--- 1376,1397 ----


#endif

case 'o' : {
! int current = get_current(cur_mailbox);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmOptions,
"Options"));
! if((i=options(cur_mailbox, cur_aliaslist)) > 0) {
! current = get_current(cur_mailbox);
get_page(current, &MENU, &header_page);
} else if(i < 0)
! leave(0);
redraw++; /* always fix da screen... */
}
break;

case 'p' : {
! int current = get_current(cur_mailbox);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmPrintMail,
***************

*** 1328,1341 ****
ElmNoMailToPrint,
"No mail to print!"));



! } else if (give_message_data(current_mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

/* FIX: mime structure is not currenty
used
*/
! if (print_msg(TRUE,current_mailbox, page) != 0)
! redraw++;

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 1406,1421 ----
ElmNoMailToPrint,
"No mail to print!"));



! } else if (give_message_data(cur_mailbox,current-1,
NULL,NULL,NULL,NO_mime_parse)) {

/* FIX: mime structure is not currenty
used
*/
! print_msg(TRUE,cur_mailbox, page);
!

! redraw += menu_need_redraw(page);
!
} else {

DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 1353,1365 ****


"Quit"));
FlushBuffer();

! mbxcount = get_storage_count(current_mailbox);

for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;



struct current_storage * storage =

! get_storage(current_mailbox,idx);

if (!storage->current_folder)
continue;

--- 1433,1445 ----


"Quit"));
FlushBuffer();

! mbxcount = get_storage_count(cur_mailbox);

for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;



struct current_storage * storage =

! get_storage(cur_mailbox,idx);

if (!storage->current_folder)
continue;
***************

*** 1374,1380 ****


}

if (!found)
! quit(TRUE, &current_mailbox,&current_aliaslist,
&header_page, page);
}
break;

--- 1454,1460 ----


}

if (!found)
! quit(TRUE, &cur_mailbox,&cur_aliaslist,
&header_page, page);
}
break;
***************

*** 1387,1399 ****


"Quick quit"));
FlushBuffer();

! mbxcount = get_storage_count(current_mailbox);

for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;



struct current_storage * storage =

! get_storage(current_mailbox,idx);

if (!storage->current_folder)
continue;

--- 1467,1479 ----


"Quick quit"));
FlushBuffer();

! mbxcount = get_storage_count(cur_mailbox);

for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;



struct current_storage * storage =

! get_storage(cur_mailbox,idx);

if (!storage->current_folder)
continue;
***************

*** 1407,1413 ****


}

if (!found)
! quit(FALSE, &current_mailbox,&current_aliaslist,
&header_page, page);
}
break;

--- 1487,1493 ----


}

if (!found)
! quit(FALSE, &cur_mailbox,&cur_aliaslist,
&header_page, page);
}
break;
***************

*** 1420,1426 ****


ElmQuickExit,
"Quick Exit"));
FlushBuffer();
! leave(0, &current_mailbox, &current_aliaslist);
break;

case ctrl('Q') :

--- 1500,1506 ----


ElmQuickExit,
"Quick Exit"));
FlushBuffer();
! leave(0);
break;

case ctrl('Q') :
***************

*** 1429,1441 ****


"Exit"));
FlushBuffer();

! exit_prog(&current_mailbox,&current_aliaslist,
&page);

break;

! case EOF : leave(0, &current_mailbox, &current_aliaslist);
! /* Read failed, control tty died? */
! break;


default:
--- 1509,1522 ----


"Exit"));
FlushBuffer();

! exit_prog(&cur_mailbox,&cur_aliaslist,
&page);
break;

! case EOF :
! leave(0);

! /* Read failed, control tty died? */
! break;


default:
***************
*** 1445,1451 ****


}

if (redraw)
! showscreen(current_mailbox,
show_menu, &header_page, page);

check_range(&MENU);

--- 1526,1532 ----


}

if (redraw)
! showscreen(cur_mailbox,
show_menu, &header_page, page);

check_range(&MENU);
***************

*** 1794,1803 ****


static char *no_aliases = NULL;

/* Return key if unknown */

! int motion(ch,mc, redraw, nufoot, header_page, page)
int ch;
! struct menu_common *mc;
! int *redraw;
int *nufoot;

int *header_page;
struct menu_context *page;

--- 1875,1883 ----


static char *no_aliases = NULL;

/* Return key if unknown */

! int motion(ch,mc, nufoot, header_page, page)
int ch;
! struct menu_common *mc;
int *nufoot;
int *header_page;

struct menu_context *page;
***************
*** 1806,1811 ****
--- 1886,1892 ----


* commands to a function. */

int i;

+ int redraw = 0;

int current = mcommon_get_current(mc);

***************

*** 1821,1829 ****



}
else {
! int x = pattern_match(mc, redraw, *header_page,
page);

if (EOF == x) {
return EOF; /* ERROR */

--- 1902,1913 ----



}
else {
! int x = pattern_match(mc, *header_page,

page);

+ redraw += menu_need_redraw(page);

+
+

if (EOF == x) {
return EOF; /* ERROR */

***************

*** 2071,2080 ****


"Limit displayed %S by..."),
mcommon_give_item(mc,m_items));
clear_error();
! if (limit(mc, page) != 0) {
current = mcommon_get_current(mc);
get_page(current, mc, header_page);
! (*redraw)++;
} else {
(*nufoot)++;
}

--- 2155,2165 ----


"Limit displayed %S by..."),
mcommon_give_item(mc,m_items));
clear_error();
! limit(mc, page);
! if (menu_need_redraw(page)) {
current = mcommon_get_current(mc);
get_page(current, mc, header_page);
! redraw++;
} else {
(*nufoot)++;
}
***************

*** 2144,2150 ****


page);
break;

! case ctrl('L') : (*redraw)++; break;

case NO_OP_COMMAND : break; /* noop for timeout loop */

--- 2229,2235 ----


page);
break;

! case ctrl('L') : redraw++; break;

case NO_OP_COMMAND : break; /* noop for timeout loop */

***************

*** 2158,2164 ****



i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, redraw, page);

DPRINT(Debug,5,(&Debug,
" current %d => %d (?)\n",

--- 2243,2249 ----



i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, page);

DPRINT(Debug,5,(&Debug,
" current %d => %d (?)\n",
***************

*** 2183,2193 ****
--- 2268,2282 ----
}
}
else {


+ if (redraw)
+ menu_trigger_redraw(page);

return ch; /* UNKNOWN command */

}
}

+ if (redraw)
+ menu_trigger_redraw(page);

return 0; /* COmmand OK */
}

Index: elmME+.2.5.alpha2-cvs/src/exitprog.c
*** elmME+.2.5.alpha1/src/exitprog.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/exitprog.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: exitprog.c,v 1.12 2004/03/27 18:31:45 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: exitprog.c,v 1.12.8.2 2004/08/07 18:07:17 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 26,32 ****
any, and if the user say's it's ok)

**/


! char msg[SLEN], answer;
int i, changes = 0;
int mc;
int LINES, COLUMNS;
--- 26,32 ----
any, and if the user say's it's ok)

**/

! char msg[SLEN];

int i, changes = 0;
int mc;

int LINES, COLUMNS;
***************


*** 50,55 ****
--- 50,57 ----


if (changes) {
+
+ int X1;
/* YES or NO on softkeys */
/*
if (hp_softkeys) {
***************

*** 57,83 ****


softkeys_on();
}
*/
if (changes == 1)
! elm_sfprintf(msg, sizeof msg,
! CATGETS(elm_msg_cat, ElmSet, ElmAbandonChange,

! "Abandon change to mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


else
! elm_sfprintf(msg, sizeof msg,
! CATGETS(elm_msg_cat, ElmSet, ElmAbandonChangePlural,

! "Abandon changes to mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


! answer = want_to(msg, *def_ans_no, LINES-4, 0,
! *page);
!
! if(answer != *def_ans_yes) return -1;
}

FlushBuffer();


erase_menu_context(page);
! leave(0, mailbox, aview);
return 0;
}

--- 59,92 ----


softkeys_on();
}
*/
+
+ /* Ctrl-C is equivalent of NO here*/
+

if (changes == 1)


! X1 = prompt_letter(LINES-4,"",*def_ans_no,
! PROMPT_yesno|PROMPT_cancel,*page,
!
! CATGETS(elm_msg_cat, ElmSet, ElmAbandonChange,

! "Abandon change to mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


else
! X1 = prompt_letter(LINES-4,"",*def_ans_no,
! PROMPT_yesno|PROMPT_cancel,*page,
!
! CATGETS(elm_msg_cat, ElmSet, ElmAbandonChangePlural,

! "Abandon changes to mailbox? (%c/%c) "),

! *def_ans_yes, *def_ans_no);
!
!

! if(X1 != *def_ans_yes)
! return -1;
}

FlushBuffer();


erase_menu_context(page);
! leave(0);
return 0;
}

Index: elmME+.2.5.alpha2-cvs/src/file.c
*** elmME+.2.5.alpha1/src/file.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/file.c 2004-08-14 18:04:10.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file.c,v 1.36.8.2 2004/05/15 10:52:16 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file.c,v 1.36.8.5 2004/08/14 15:04:10 hurtta Exp $";

/****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.36.8.5 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 57,65 ****



struct string * prev_fold = NULL; /* name of previous folder */

! int save(redraw, silently, delete, text_only, mailbox, aview, header_page,
page)
! int *redraw, silently, delete, text_only;

struct MailboxView *mailbox;
struct AliasView *aview;

int header_page;
--- 57,65 ----



struct string * prev_fold = NULL; /* name of previous folder */

! int save(silently, delete, text_only, mailbox, aview, header_page,
page)
! int silently, delete, text_only;

struct MailboxView *mailbox;
struct AliasView *aview;

int header_page;
***************
*** 68,80 ****


/** Save all tagged messages + current in a folder. If no messages
are tagged, save the current message instead! This routine
will return ZERO if the operation failed.
! 'redraw' is set to TRUE iff we use the '?' and mess up
! the screen. Pretty reasonable, eh? If "silently" is set,
then don't output the "D" character upon marking for
deletion...
If delete is set, then delete the saved messages, else
we are just copying the messages without deletion.
If text_only is text, message is decoded.
**/

int num_tagged = 0, i, oldstat = 0, appending = 0,
--- 68,83 ----


/** Save all tagged messages + current in a folder. If no messages
are tagged, save the current message instead! This routine
will return ZERO if the operation failed.
!
! Pretty reasonable, eh? If "silently" is set,
then don't output the "D" character upon marking for
deletion...
If delete is set, then delete the saved messages, else
we are just copying the messages without deletion.

If text_only is text, message is decoded.
+
+ If redraw is needed use
+ menu_trigger_redraw(page)
**/

int num_tagged = 0, i, oldstat = 0, appending = 0,
***************
*** 84,89 ****
--- 87,93 ----
char
answer;



+ int redraw = 0;

struct folder_browser * XXX;


struct string * buffer = NULL;

WRITE_STATE write_ptr = NULL;
***************

*** 100,106 ****


oldstat = chdr->status; /* remember */

current_is_tagged = ison(chdr->status, TAGGED);
}

- *redraw = FALSE;



mc = get_message_count(mailbox);
for (i=0; i < mc; i++) {

--- 104,109 ----
***************
*** 126,142 ****
menu_get_sizes(page, &LINES, &COLUMNS);

ret = prompt_letter(LINES-4,"",*def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark,page,
CATGETS(elm_msg_cat, ElmSet,
ElmSavecmdSaveMarked,

"Save marked messages? (%c/%c) "),

*def_ans_yes, *def_ans_no);



! if (REDRAW_MARK == ret) {

! *redraw = 1;


goto again;
}

if (EOF == ret)
return 0;

--- 129,152 ----
menu_get_sizes(page, &LINES, &COLUMNS);

ret = prompt_letter(LINES-4,"",*def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark|PROMPT_ctrlL|
! PROMPT_cancel,
! page,
CATGETS(elm_msg_cat, ElmSet,
ElmSavecmdSaveMarked,
"Save marked messages? (%c/%c) "),
*def_ans_yes, *def_ans_no);

! if (ret == ('L'&31) || REDRAW_MARK == ret) {
! redraw = 1;
goto again;
}

+ if (TERMCH_interrupt_char == ret) {


+ return 0;
+ }
+

+

if (EOF == ret)
return 0;

***************
*** 165,170 ****
--- 175,181 ----


struct header_rec * mhdr = give_header(mailbox,mesgnum);

int LINES, COLUMNS;
+ int r = 0;

menu_get_sizes(page, &LINES, &COLUMNS);

***************
*** 191,198 ****


/* 2 == text_only -- Not envelope information */
if (text_only > 0) {

if (num_tagged == 1)
! gen_browser(page,
! XXX,&buffer,redraw,
delete ? word_save : word_copy,
prev_fold,
aview,
--- 202,209 ----


/* 2 == text_only -- Not envelope information */
if (text_only > 0) {

if (num_tagged == 1)
! r = gen_browser(page,
! XXX,&buffer,&redraw,
delete ? word_save : word_copy,
prev_fold,
aview,
***************
*** 200,207 ****


"%s text of message to: "),

(delete ? cap_save_word : cap_copy_word));
else

! gen_browser(page,
! XXX,&buffer,redraw,
delete ? word_save : word_copy,
prev_fold,
aview,
--- 211,218 ----


"%s text of message to: "),

(delete ? cap_save_word : cap_copy_word));
else

! r = gen_browser(page,
! XXX,&buffer,&redraw,
delete ? word_save : word_copy,
prev_fold,
aview,
***************
*** 210,217 ****
(delete ? cap_save_word : cap_copy_word));
} else {
if (num_tagged == 1)
! gen_browser(page,
! XXX,&buffer,redraw,
delete ? word_save : word_copy,
prev_fold,
aview,
--- 221,228 ----
(delete ? cap_save_word : cap_copy_word));
} else {
if (num_tagged == 1)
! r = gen_browser(page,
! XXX,&buffer,&redraw,
delete ? word_save : word_copy,
prev_fold,
aview,
***************
*** 219,226 ****
"%s message to: "),

(delete ? cap_save_word : cap_copy_word));
else

! gen_browser(page,
! XXX,&buffer,redraw,
delete ? word_save : word_copy,
prev_fold,
aview,
--- 230,237 ----
"%s message to: "),

(delete ? cap_save_word : cap_copy_word));
else

! r = gen_browser(page,
! XXX,&buffer,&redraw,
delete ? word_save : word_copy,
prev_fold,
aview,
***************
*** 228,235 ****
--- 239,257 ----


"%s messages to: "),
(delete ? cap_save_word : cap_copy_word));
}
+
GetXYLocation(&X,&Y);

+
+ if (!r) {
+ DPRINT(Debug,4,(&Debug, "Canceled...\n"));
+ if (chdr)
+ chdr->status = oldstat; /* BACK! */
+
+ retval = 0;

+ goto clean;
+ }
+

code = give_dir_flags(XXX);

DPRINT(Debug,4,(&Debug,
***************
*** 355,361 ****


* so whatever silently was, now it's true - we can't show those
* delete markings.
*/
! if(*redraw) silently = TRUE;

mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */

--- 377,384 ----


* so whatever silently was, now it's true - we can't show those
* delete markings.
*/
! if(redraw)
! silently = TRUE;

mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */
***************

*** 366,375 ****



if (!save_message(i, XXX, buffer, write_ptr,

(num_tagged > 1), appending++,

! silently, delete, text_only, redraw,
mailbox, aview, header_page))
fail++;
! if(*redraw) silently = TRUE;
scount++;

}

--- 389,399 ----



if (!save_message(i, XXX, buffer, write_ptr,

(num_tagged > 1), appending++,

! silently, delete, text_only, &redraw,
mailbox, aview, header_page))
fail++;
! if(redraw)
! silently = TRUE;
scount++;

}
***************

*** 418,425 ****


free_string(&buffer);

DPRINT(Debug,8,(&Debug,
! "save=%d *redraw=%d\n",
! retval,*redraw));
return retval;
}

--- 442,453 ----


free_string(&buffer);

DPRINT(Debug,8,(&Debug,
! "save=%d redraw=%d\n",
! retval,redraw));

!
! if (redraw)
! menu_trigger_redraw(page);
!

return retval;
}

Index: elmME+.2.5.alpha2-cvs/src/file_util.c
*** elmME+.2.5.alpha1/src/file_util.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/file_util.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.24 2004/03/27 18:31:45 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.24.8.1 2004/08/07 18:07:17 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

! rm_temps_exit(); /* ??? global reference */
}

return(0);
Index: elmME+.2.5.alpha2-cvs/src/forms.c
*** elmME+.2.5.alpha1/src/forms.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/forms.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: forms.c,v 1.23.8.1 2004/07/03 15:23:06 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forms.c,v 1.23.8.2 2004/08/07 18:07:17 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 347,353 ****



mail_form(mail_index,address, subject,
mailbox /* for save_copy */,

! aview);

erase_menu_context(&page);

--- 347,353 ----

mail_form(mail_index,address, subject,
mailbox /* for save_copy */,

! aview, page);

erase_menu_context(&page);

Index: elmME+.2.5.alpha2-cvs/src/hdrconfg.c
*** elmME+.2.5.alpha1/src/hdrconfg.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/hdrconfg.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.39.8.1 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.39.8.3 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 831,842 ****
print_format_center(INSTRUCT_LINE,
CATGETS(elm_msg_cat, ElmSet,
ElmHdrmenuInstruct1,
! "Choose header, u)ser defined header, !)shell, invoke e)ditor, or <return>."));
#else
print_format_center(INSTRUCT_LINE,
CATGETS(elm_msg_cat, ElmSet,
ElmHdrmenuInstruct1NoShell,
! "Choose header, u)ser defined header, invoke e)ditor, or <return>."));
#endif

} else {
--- 831,842 ----
print_format_center(INSTRUCT_LINE,
CATGETS(elm_msg_cat, ElmSet,
ElmHdrmenuInstruct1,

! "Choose header, u)ser defined header, !)shell, invoke e(d)itor, or <return>."));


#else
print_format_center(INSTRUCT_LINE,
CATGETS(elm_msg_cat, ElmSet,
ElmHdrmenuInstruct1NoShell,

! "Choose header, u)ser defined header, invoke e(d)itor, or <return>."));
#endif

} else {
***************
*** 862,873 ****

c = precmd;
precmd = 0;
} else {


! c = menu_ReadCh(page,REDRAW_MARK|READCH_resize);
if (c == REDRAW_MARK) {
do_redraw = TRUE;
continue;
}

if (c == RESIZE_MARK) {

DPRINT(Debug,4, (&Debug, " ... resizing\n"));
goto resize_mark;
--- 862,876 ----
c = precmd;
precmd = 0;
} else {


! c = menu_ReadCh(page,REDRAW_MARK|READCH_resize|READCH_sig_char);
if (c == REDRAW_MARK) {
do_redraw = TRUE;
continue;
}

+ if (c == TERMCH_interrupt_char)
+ goto OUT;
+
if (c == RESIZE_MARK) {

DPRINT(Debug,4, (&Debug, " ... resizing\n"));
goto resize_mark;
***************
*** 892,898 ****

#ifdef ALLOW_SUBSHELL
case '!':


! if (subshell(NULL, page))
do_redraw = TRUE;
break;
#endif

--- 895,903 ----



#ifdef ALLOW_SUBSHELL
case '!':
!
! subshell(NULL, page);
! if (menu_need_redraw(page))

do_redraw = TRUE;
break;
#endif

***************
*** 901,907 ****
do_redraw = TRUE;
break;

! case 'e':
if (editor_val) {
editor_available &= have_editor(editor_val);

--- 906,912 ----


do_redraw = TRUE;
break;

! case 'd':
if (editor_val) {
editor_available &= have_editor(editor_val);

***************
*** 1039,1045 ****
ret = optionally_enter2(page, &buffer, INPUT_LINE, 0,
(do_append ? OE_APPEND_CURRENT : 0) |
(do_comma ? OE_ADD_COMMA : 0) |
! OE_REDRAW_MARK,
FRM("%s"),header_name);
if (ret == REDRAW_MARK) {
h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page);

--- 1044,1050 ----


ret = optionally_enter2(page, &buffer, INPUT_LINE, 0,
(do_append ? OE_APPEND_CURRENT : 0) |
(do_comma ? OE_ADD_COMMA : 0) |

! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,

FRM("%s"),header_name);
if (ret == REDRAW_MARK) {
h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page);
***************
*** 1049,1056 ****
hdrmenu_clear_promptarea(page);

/* bail out on error */
! if (ret < 0) {
! h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page);
return -1;
}
/* see if there is some processing required on this value */

--- 1054,1063 ----


hdrmenu_clear_promptarea(page);

/* bail out on error */
! if (ret != 0) {
! if (buffer)
! h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,
! page);
return -1;
}
/* see if there is some processing required on this value */

Index: elmME+.2.5.alpha2-cvs/src/help.c
*** elmME+.2.5.alpha1/src/help.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/help.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.18.8.2 2004/05/16 07:27:22 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.18.8.4 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 35,47 ****


static int display_file P_((char *file));


! int help(pager_help,page)
int pager_help;
struct menu_context *page;
{
/** Process the request for help [section] from the user.
If pager_help is TRUE, then act a little differently from
if pager_help is FALSE (index screen)
**/

int ch; /* character buffer for input */
--- 35,49 ----


static int display_file P_((char *file));


! void help(pager_help,page)
int pager_help;
struct menu_context *page;
{
/** Process the request for help [section] from the user.
If pager_help is TRUE, then act a little differently from
if pager_help is FALSE (index screen)
+
+ If redraw is needed use menu_trigger_redraw()
**/

int ch; /* character buffer for input */
***************

*** 86,103 ****


CATGETS(elm_msg_cat, ElmSet, ElmHelpPrompt,
"Help for key: "));

! ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR);



! if (ch == REDRAW_MARK) return 1;
! if (ch == '.') return(0); /* zero means footer rewrite only */

s = unknown_command;

switch (ch) {

case HELP_MARK:


! case '?': display_helpfile(pager_help? PAGER_HELP : MAIN_HELP);
! return(1);

case '$': if(!pager_help) s = catgets(elm_msg_cat, ElmSet, ElmHelpDollar,
"$ = Force resynchronization of the current folder. This will purge deleted mail.");

--- 88,115 ----


CATGETS(elm_msg_cat, ElmSet, ElmHelpPrompt,
"Help for key: "));

! ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR

! |READCH_sig_char);



! if (ch == REDRAW_MARK) {
! menu_trigger_redraw(page);
! return;

! }
! if (ch == '.')
! return;


!
! if (ch == TERMCH_interrupt_char)

! return;

s = unknown_command;

switch (ch) {

case HELP_MARK:
! case '?':

! display_helpfile(pager_help? PAGER_HELP : MAIN_HELP);
! menu_trigger_redraw(page);
! return;


case '$': if(!pager_help) s = catgets(elm_msg_cat, ElmSet, ElmHelpDollar,
"$ = Force resynchronization of the current folder. This will purge deleted mail.");
***************

*** 366,373 ****


"Exit the mail system quickly.");

break;


! case EOF: leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
! break;

default : if (isdigit(ch) && !pager_help)
s = catgets(elm_msg_cat, ElmSet, ElmHelpMakeMessageCurrent,

--- 378,385 ----


"Exit the mail system quickly.");

break;


! case EOF: leave(0); /* ???? global reference */
! break;

default : if (isdigit(ch) && !pager_help)
s = catgets(elm_msg_cat, ElmSet, ElmHelpMakeMessageCurrent,
***************

*** 379,387 ****



} while (ch != '.');

! /** we'll never actually get here, but that's okay... **/
!
! return(0);
}

int display_helpfile(section)

--- 391,397 ----



} while (ch != '.');

! return;
}

int display_helpfile(section)

***************
*** 438,463 ****



while (fgets(buffer, SLEN, fileptr) != NULL) {
if (lines > LINES-4) {
PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHelpPressSpaceToContinue,
! "Press <space> to continue, 'q' to return."));
! if(menu_ReadCh(page,0) == 'q') {
! clear_error();
! fclose(fileptr);
!
! goto OUT;
}
! lines = 0;
! menu_ClearScreen(page);
! Write_to_screen(FRM("%s\r"), buffer);
! }
! else
! Write_to_screen(FRM("%s\r"), buffer);
!
lines += strlen(buffer)/COLUMNS + 1;
}
!
PutLineX(LINES-1, 0,
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressAnyKeyToReturn,

--- 448,476 ----

Index: elmME+.2.5.alpha2-cvs/src/init.c
*** elmME+.2.5.alpha1/src/init.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/init.c 2004-08-14 15:06:10.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: init.c,v 1.49.8.4 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.8.4 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: init.c,v 1.49.8.7 2004/08/14 12:06:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 40,68 ****

--- 40,45 ----
***************
*** 142,148 ****
goto cleanup;

}
! folder = folder_from_dir_item(XXX);
if (!folder)
goto cleanup;

--- 119,125 ----
goto cleanup;

}
! folder = folder_from_dir_item(XXX, TreatAsSpooled);
if (!folder)
goto cleanup;

***************
*** 172,184 ****
struct AliasView **main_aliases;
int *header_page;
struct menu_context **page;
! {
! int init_scr_return;
struct folder_info *folder = NULL;
int several_folders = 0;

char buffer[SLEN], *cp;

elm_sfprintf(version_buff, sizeof version_buff,
FRM("%s PL%s"), VERSION, PATCHLEVEL);
def_ans_yes = catgets(elm_msg_cat, ElmSet, ElmYes, "y");
--- 149,161 ----
struct AliasView **main_aliases;
int *header_page;
struct menu_context **page;
! {
struct folder_info *folder = NULL;
int several_folders = 0;

char buffer[SLEN], *cp;

+
elm_sfprintf(version_buff, sizeof version_buff,
FRM("%s PL%s"), VERSION, PATCHLEVEL);
def_ans_yes = catgets(elm_msg_cat, ElmSet, ElmYes, "y");
***************
*** 214,228 ****
*/
safe_malloc_fail_handler = malloc_failed_exit;

! init_opts_menu();
! init_scr_return = InitScreen(page);
!
! out_util_setup();
!
! /* make all newly created files private */
! original_umask = umask(077);
!
! /* get username and home directory */
user_init();

/* user_init sets have_saved_ids, mailgroupid, userid and groupid */
--- 191,199 ----
*/
safe_malloc_fail_handler = malloc_failed_exit;

! /* get username and home directory
! save original user and group ids
! */
user_init();

/* user_init sets have_saved_ids, mailgroupid, userid and groupid */
***************
*** 238,243 ****
--- 209,217 ----
}
}

+ /* make all newly created files private */
+ original_umask = umask(077);
+
#ifdef DEBUG
{
int d = panic_dprint("\n\
***************
*** 253,302 ****


}
}

/*
* If debug level is fairly low, ignore keyboard signals
- * until the screen is set up.
*/

/* FIXME -- Probably wrong variable ... */

if (Debug.active < 5) {
signal(SIGINT, SIG_IGN);
- signal(SIGQUIT, SIG_IGN);
}
#endif
!
! if(!check_only && !batch_only) {
! if (init_scr_return < 0) {
! if (init_scr_return == -1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoTerm,
! "Sorry, but you must specify what type of terminal you're on if you want to\n\
! run the \"elm\" program. (You need your environment variable \"TERM\" set.)\n"));
! DPRINT(Debug,1,
! (&Debug,
! "No $TERM variable in environment!\n"));
! }
! else if (init_scr_return == -2) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadTerm,
! "You need a cursor-addressable terminal to run \"elm\" and I can't find any\n\
! kind of termcap entry for \"%s\" - check your \"TERM\" setting...\n"),
! getenv("TERM"));
! DPRINT(Debug,1,
! (&Debug,
! "$TERM variable is an unknown terminal type!\n"));
! } else {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTermInitFailed,
! "Failed trying to initialize your terminal entry: unknown return code %d\n"),
! init_scr_return);
! DPRINT(Debug,1,
! (&Debug,
! "Initscreen returned unknown code: %d\n",
! init_scr_return));
! }
! error_wait(); /* Be sure that we do not exit before error is shown */
! exit(1); /* all the errors share this exit statement */
! }
! }
!
#ifdef DEBUG


/* FIXME -- Probably wrong variable ... */

if (Debug.active < 5) { /* otherwise let the system trap 'em! */
--- 227,294 ----
}
}

+
+ /* Determine options that might be set in the global elmrc */
+ if (init_defaults() != 0) {
+ sleep(1);
+ }
+
+ /* Determine options that might be set in the .elm/elmrc */
+ if (read_rc_file(0) != 0) {
+ sleep(1);
+ if (OPMODE_SEND_BATCH != opmode && !write_elmrc) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmFixElmrc,
+ "Fix %s, %s, %s, %s and/or %s or let elm rebuild them with option '-w'."),
+ ELMRCFILE, USER_MIME_CHARSETS,
+ USER_TERMINAL_INFO, USER_MAIL_SERVICES,
+ USER_ISO2022_SETS);
+
+ error_wait(); /* Be sure that we do not exit before error is shown */


+ exit(1);
+ }
+ }
+

+ /* Check if .elm and Mail directories exists */
+ directory_check();
+
+ /*


+ * Locking problems are common when Elm is misconfigured/misinstalled.
+ * Sometimes, rather than fixing the problem, people will set
+ * Elm setuid=root. This is *extremely* dangerous. Make sure
+ * this isn't happening. This test needed to be deferred until
+ * after the system rcfile was read in.
+ */
+ if (getuid() != geteuid() && !allow_setuid) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmInstalledSetuid,
+ "\n\

+ This version of Elm has been installed setuid=%d. This is dangerous!\n\
+ Elm is NOT designed to run in this mode, and to do so can introduce\n\
+ grave security hazards. \n\n"),
+ geteuid());
+
+ error_wait();/* Be sure that we do not exit before error is shown */ exit(1);
+ }
+
+
+ /*
+ * Now that we are about to muck with the tty and mail folder,
+ * it's a good time to get the signal handlers installed.


+ */
+
+
/*

* If debug level is fairly low, ignore keyboard signals

*/

/* FIXME -- Probably wrong variable ... */

if (Debug.active < 5) {
signal(SIGINT, SIG_IGN);


}
+ #else
+ signal(SIGINT, SIG_IGN);

#endif
!
#ifdef DEBUG


/* FIXME -- Probably wrong variable ... */

if (Debug.active < 5) { /* otherwise let the system trap 'em! */
***************
*** 318,387 ****
init_backgroud_handling();
#endif

! /* ? ? ? ? */
! get_term_chars();
!
! /* Determine options that might be set in the global elmrc */
! if (init_defaults() != 0) {
! sleep(1);
! }
!
! /* Determine options that might be set in the .elm/elmrc */
! if (read_rc_file(0) != 0) {
! sleep(1);
! if (!batch_only && !write_elmrc) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmFixElmrc,
! "Fix %s, %s, %s, %s and/or %s or let elm rebuild them with option '-w'."),
! ELMRCFILE, USER_MIME_CHARSETS,
! USER_TERMINAL_INFO, USER_MAIL_SERVICES,
! USER_ISO2022_SETS
! );
!
! error_wait(); /* Be sure that we do not exit before error is shown */
! exit(1);


! }
! }
!
! /*

! * Locking problems are common when Elm is misconfigured/misinstalled.
! * Sometimes, rather than fixing the problem, people will set
! * Elm setuid=root. This is *extremely* dangerous. Make sure
! * this isn't happening. This test needed to be deferred until
! * after the system rcfile was read in.
! */
! if (getuid() != geteuid() && !allow_setuid) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmInstalledSetuid,
! "\n\
! This version of Elm has been installed setuid=%d. This is dangerous!\n\
! Elm is NOT designed to run in this mode, and to do so can introduce\n\


! grave security hazards. See the description of \"allow_setuid\" in the\n\

! Elm Reference Guide for further information.\n\n"),
! geteuid());
!
! error_wait();/* Be sure that we do not exit before error is shown */ exit(1);
! }
!
!
! *main_aliases = new_aliasview();
! add_files_to_aview(*main_aliases);

- if (check_only) {
- DPRINT(Debug,5,
- (&Debug,
- "initialize: check_only (-c) -- skipping rest of initialize.\n"));
- return;
- }

! if (!Check_attachments()) {
! error_wait(); /* Be sure that we do not exit before error is shown */
! exit(1);
! }
!
! /* Check if .elm and Mail directories exists */
! directory_check();
!
! if (write_elmrc) {
int err;
FILE *f = NULL;
char *tmp;
--- 310,321 ----
init_backgroud_handling();
#endif

!
! *main_aliases = new_aliasview();
! add_files_to_aview(*main_aliases);


! if (write_elmrc) {
int err;
FILE *f = NULL;
char *tmp;
***************
*** 532,574 ****
#endif

error_sleep(1);
! }


/** check to see if the user has defined a LINES or COLUMNS
value different to that in the termcap entry (for
windowing systems, of course!) **/

- {
- int lines = -1;
- int columns = -1;

! if ((cp = getenv("LINES")) != NULL && isdigit(*cp)) {
! sscanf(cp, "%d", &lines);
! }

! if ((cp = getenv("COLUMNS")) != NULL && isdigit(*cp))
! sscanf(cp, "%d", &columns);

! set_root_menu(lines,columns);


! /* And read changes what just implied */
! menu_resized(*page);
! }

/* Now that we've read the rc file we can enter RAW mode */
! if (!batch_only) {
! Raw(ON);
! /** clear the screen **/
! menu_ClearScreen(*page);
! }

if (-1 != wanted_switchmode)
allow_charset_switching = wanted_switchmode;

! if (init_scr_return >= 0) {
! if (wanted_charset) {
charset_t X = MIME_name_to_charset(wanted_charset,0);
if (!X) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsCharsetUnknown,
--- 466,557 ----
#endif

error_sleep(1);
! }

+ if (OPMODE_CHECK_ONLY == opmode) {
+ DPRINT(Debug,5,
+ (&Debug,
+ "initialize: check_only (-c) -- skipping rest of initialize.\n"));
+ return;
+ }
+
+ if (!Check_attachments()) {
+ error_wait(); /* Be sure that we do not exit before error is shown */


+ exit(1);
+ }
+
+

+ if (OPMODE_IS_INTERACTIVE(opmode)) {
+ int init_scr_return = -1;
+ int lines = -1;
+ int columns = -1;
+
+ init_opts_menu();
+ init_scr_return = InitScreen(page);
+
+ out_util_setup();
+
+
+ if (init_scr_return < 0) {
+ if (init_scr_return == -1) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoTerm,
+ "Sorry, but you must specify what type of terminal you're on if you want to\n\
+ run the \"elm\" program. (You need your environment variable \"TERM\" set.)\n"));
+ DPRINT(Debug,1,
+ (&Debug,
+ "No $TERM variable in environment!\n"));
+ }
+ else if (init_scr_return == -2) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadTerm,
+ "You need a cursor-addressable terminal to run \"elm\" and I can't find any\n\
+ kind of termcap entry for \"%s\" - check your \"TERM\" setting...\n"),
+ getenv("TERM"));
+ DPRINT(Debug,1,
+ (&Debug,
+ "$TERM variable is an unknown terminal type!\n"));
+ } else {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTermInitFailed,
+ "Failed trying to initialize your terminal entry: unknown return code %d\n"),
+ init_scr_return);
+ DPRINT(Debug,1,
+ (&Debug,
+ "Initscreen returned unknown code: %d\n",
+ init_scr_return));
+ }
+ error_wait(); /* Be sure that we do not exit before error is shown */
+ exit(1); /* all the errors share this exit statement */
+ }

/** check to see if the user has defined a LINES or COLUMNS
value different to that in the termcap entry (for
windowing systems, of course!) **/


!
! if ((cp = getenv("LINES")) != NULL && isdigit(*cp)) {
! sscanf(cp, "%d", &lines);
! }

! if ((cp = getenv("COLUMNS")) != NULL && isdigit(*cp))
! sscanf(cp, "%d", &columns);

! set_root_menu(lines,columns);


! /* And read changes what just implied */
! menu_resized(*page);
!

/* Now that we've read the rc file we can enter RAW mode */
! Raw(ON);
! /** clear the screen **/
! menu_ClearScreen(*page);
!

if (-1 != wanted_switchmode)
allow_charset_switching = wanted_switchmode;

! if (wanted_charset) {
charset_t X = MIME_name_to_charset(wanted_charset,0);
if (!X) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsCharsetUnknown,
***************
*** 587,593 ****
"No way to set terminal to charset %s (-D option)\n",
wanted_charset));
}
! } else if (wanted_display_charset &&
wanted_display_charset != system_charset) {
if (set_display_charset(wanted_display_charset,1)) {
CarriageReturn();
--- 570,576 ----
"No way to set terminal to charset %s (-D option)\n",
wanted_charset));
}
! } else if (wanted_display_charset &&
wanted_display_charset != system_charset) {
if (set_display_charset(wanted_display_charset,1)) {
CarriageReturn();
***************
*** 599,627 ****
"<no MIME name>");
CarriageReturn();
}
! }
!
! if (wanted_title_string || wanted_icon_string) {
if (! set_terminal_titles(wanted_title_string,
wanted_icon_string)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsTitleNoSet,
"Title (or icon) name for terminal can not set"));
}
! }

! if (with_title && with_title[0]) {
if (! set_terminal_titles(with_title,NULL)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsTitleNoSet1,
"Title name for terminal can not set"));
}
-
- }
-
}

post_process_charset_options();

! if (! mail_only) {
int LINES, COLUMNS;

menu_get_sizes(*page,&LINES, &COLUMNS);
--- 582,613 ----
"<no MIME name>");
CarriageReturn();
}
! }
!
! if (wanted_title_string || wanted_icon_string) {
if (! set_terminal_titles(wanted_title_string,
wanted_icon_string)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsTitleNoSet,
"Title (or icon) name for terminal can not set"));
}
! }

! if (with_title && with_title[0]) {
if (! set_terminal_titles(with_title,NULL)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsTitleNoSet1,
"Title name for terminal can not set"));
}
}
+
+

post_process_charset_options();

! /* headers_per_page is needed also on send_only mode
! and not on only READMODE, because on sendmode
! '/' can be used for view canceled mails
! */
! {
int LINES, COLUMNS;

menu_get_sizes(*page,&LINES, &COLUMNS);
***************
*** 643,655 ****

exit(1);


}

/* Determine the mail file to read */

if (!requestedmfiles || ! requestedmfiles[0]) {


char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");

if (default_val)
! folder = enter_new_folder(default_val);

else
folder = NULL;
} else {
--- 629,646 ----

exit(1);
}
+ }
+
+ if (OPMODE_IS_READMODE(opmode)) {
+ /* figure out what folder we are reading and verify access */



/* Determine the mail file to read */

if (!requestedmfiles || ! requestedmfiles[0]) {


char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");

if (default_val)
! folder = enter_new_folder(default_val,
! TreatAsSpooled);
else
folder = NULL;
} else {
***************
*** 673,679 ****
exit(0);
}

! if (check_size)
if(check_mailfile_size(folder) != 0) {
erase_menu_context(page);

--- 664,672 ----
exit(0);
}

!
! /* if "check_size" is set then we don't want to read empty mbox */
! if (opmode == OPMODE_READ_NONEMPTY) {
if(check_mailfile_size(folder) != 0) {
erase_menu_context(page);

***************
*** 686,691 ****
--- 679,685 ----

exit(0);
}
+ }

if (with_title)
set_folder_window_title(folder,
***************
*** 729,747 ****


}

! /** fix the shell if needed **/

! if (shell[0] != '/') {
elm_sfprintf(buffer, sizeof buffer,
FRM("/bin/%s"),
shell);
strfcpy(shell, buffer, sizeof shell);
! }


#ifdef DEBUG
! if (Debug.active >= 2 && Debug.active < 10) {
debug_action_call(&Debug,


"hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
hostname, username, full_username);

--- 723,742 ----


}
+ }

! /** fix the shell if needed **/

! if (shell[0] != '/') {
elm_sfprintf(buffer, sizeof buffer,
FRM("/bin/%s"),
shell);
strfcpy(shell, buffer, sizeof shell);
! }


#ifdef DEBUG
! if (Debug.active >= 2 && Debug.active < 10) {
debug_action_call(&Debug,


"hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
hostname, username, full_username);

***************
*** 756,837 ****
debug_action_call(&Debug,


" \tprefix = %-20s \tshell = %-20s\n\n",

prefixchars, shell);
- }

- tcgetattr(fd, buf)
- int fd;


- term_buff *buf;
- {
- if (ioctl(fd, TIOCGETP, &buf->sgttyb) < 0)
- return(-1);
- if (ioctl(fd, TIOCGETC, &buf->tchars) < 0)
- return(-1);
- #ifdef TIOCLGET
- if (ioctl(fd, TIOCLGET, &buf->ltchars) < 0)
- return(-1);

#endif
- return(0);
}
! #endif

/*
* Local Variables:
--- 751,760 ----
debug_action_call(&Debug,


" \tprefix = %-20s \tshell = %-20s\n\n",

prefixchars, shell);
}

Kari E. Hurtta

unread,
Aug 20, 2004, 1:29:48 PM8/20/04
to
Archive-name: elmME+2.5/PLalpha2.3

Elm ME+ 2.5 PLalpha2

- Is available on ftp.funet.fi

via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha2.patch.gz >
via WWW (1).


1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

Before applying patch catenate parts 1 - 5 first.


That part (part 0) do not include patch. Patch

is on part 1 - 5.

This patch (Elm ME+ 2.5 PLalpha2) is agaist Elm ME+ 2.5 PLalpha1.
After that patch apply also Elm ME+ 2.5 PLalpha3 patch.

================================================ ( part 3/5 ) ===============
#endif
}
!

/*
* Local Variables:
Index: elmME+.2.5.alpha2-cvs/src/in_utils.c
*** elmME+.2.5.alpha1/src/in_utils.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/in_utils.c 2004-08-07 21:07:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35.8.2 2004/05/02 11:05:48 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35.8.4 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 73,79 ****
int center = flags & PROMPT_center;
int yesno = flags & PROMPT_yesno;
int mark = flags & PROMPT_redraw_mark;
! int ctrlL = flags & PROMTP_ctrlL;
int cols = 0;


--- 73,80 ----
int center = flags & PROMPT_center;
int yesno = flags & PROMPT_yesno;
int mark = flags & PROMPT_redraw_mark;
! int ctrlL = flags & PROMPT_ctrlL;
! int cancel = flags & PROMPT_cancel;
int cols = 0;


***************

*** 112,128 ****


FRM("%S%c%c"), question, def, BACKSPACE);
FlushBuffer();

! ch = menu_ReadCh(page, REDRAW_MARK);
if (ch == REDRAW_MARK) {
if (mark)
break;
continue;
}

! if (PROMTP_ctrlL && ch == ('L'&31)) {
break;
}

if (ch == EOF)
break;

--- 113,133 ----


FRM("%S%c%c"), question, def, BACKSPACE);
FlushBuffer();

! ch = menu_ReadCh(page, REDRAW_MARK
! | ( cancel ? READCH_sig_char : 0 ));
if (ch == REDRAW_MARK) {
if (mark)
break;
continue;
}

! if (ctrlL && ch == ('L'&31)) {
break;
}

+ if (cancel && ch == TERMCH_interrupt_char)
+ break;
+
if (ch == EOF)
break;

***************

*** 174,180 ****


out:
FlushBuffer();

! if (EOF != ch && REDRAW_MARK != ch && ('L'&31) != ch) {
if (sleepmsg > 0) {
#if POLL_METHOD
wait_for_timeout((sleepmsg + 1) / 2);

--- 179,186 ----


out:
FlushBuffer();

! if (EOF != ch && REDRAW_MARK != ch && ('L'&31) != ch &&
! TERMCH_interrupt_char != ch) {
if (sleepmsg > 0) {
#if POLL_METHOD
wait_for_timeout((sleepmsg + 1) / 2);
***************

*** 226,232 ****
if (ch == REDRAW_MARK)


goto redraw;
if (ch == EOF) {

! leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
}
ch = tolower(ch);

--- 232,238 ----
if (ch == REDRAW_MARK)


goto redraw;
if (ch == EOF) {

! leave(0);
}
ch = tolower(ch);

***************

*** 235,241 ****
if (ch == REDRAW_MARK)


goto redraw;
if (ch == EOF) {

! leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
}
#ifdef ASCII_CTYPE
if (isascii(ch))

--- 241,247 ----
if (ch == REDRAW_MARK)


goto redraw;
if (ch == EOF) {

! leave(0); /* ???? global reference */
}
#ifdef ASCII_CTYPE
if (isascii(ch))
***************

*** 268,283 ****


return(ch);
}

! int read_number(ch, item, current, redraw, page)
int ch;
CONST struct string *item;
int current;
- int *redraw;

struct menu_context *page;
{


! /** Read a number, where 'ch' is the leading digit! **/

struct string * buff = new_string(display_charset);
int num, status;
int bad;
int LINES, COLUMNS;

--- 274,294 ----


return(ch);
}

! int read_number(ch, item, current, page)
int ch;
CONST struct string *item;
int current;

struct menu_context *page;
{
! /** Read a number, where 'ch' is the leading digit! **/

+ /* If redraw is used use


+ menu_trigger_redraw(page)
+ */
+

struct string * buff = new_string(display_charset);
+
+ int need_redraw = 0;
int num, status;
int bad;

int LINES, COLUMNS;
***************
*** 288,313 ****



status = optionally_enter2(page,
&buff, LINES-4, COLUMNS-40,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
CATGETS(elm_msg_cat, ElmSet,
ElmSetCurrentTo,
"Set current %S to :"), item);

! if (status == -1)

return(current);
if (status == REDRAW_MARK) {

! *redraw = 1;


goto redraw;
}

if (0 == string_len(buff))
return current;

num = string_to_long(buff,&bad);

if (bad >= 0)
return current;

return(num);
}

--- 299,334 ----



status = optionally_enter2(page,
&buff, LINES-4, COLUMNS-40,

! OE_APPEND_CURRENT|OE_REDRAW_MARK|


! OE_SIG_CHAR /* allow Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
ElmSetCurrentTo,
"Set current %S to :"), item);

! if (status == -1) /* Ctrl-C */


return(current);
if (status == REDRAW_MARK) {
! /* Can not set menu_trigger_redraw here or causes
! redraw loop ... */
! need_redraw = 1;
goto redraw;
}

+ if (need_redraw)
+ menu_trigger_redraw(page);
+
if (0 == string_len(buff))
return current;

num = string_to_long(buff,&bad);

+
+
if (bad >= 0)
return current;

+
+
return(num);
}

***************
*** 317,323 ****


{
int append_current, passwd, allowmime,
redraw, alt_solidus, allowtab, use_editor_escape,
! tabaction;
struct string **buffer;
int ret = 0;

--- 338,344 ----


{
int append_current, passwd, allowmime,
redraw, alt_solidus, allowtab, use_editor_escape,
! tabaction, sig_char;
struct string **buffer;
int ret = 0;

***************

*** 337,346 ****


use_editor_escape = 0 != (info -> flags & OE_EDITOR_ESCAPE);
tabaction = 0 != (info -> flags & OE_TABACTION);
allowtab = !tabaction;

DPRINT(Debug,4,
(&Debug,
! "== enter_helper: ch_count=%d %s%s%s%s%s%s%s%s%s\n",
info->ch_count,
append_current ? "append_current " : "",
add_comma ? "add_comma " : "",

--- 358,368 ----


use_editor_escape = 0 != (info -> flags & OE_EDITOR_ESCAPE);
tabaction = 0 != (info -> flags & OE_TABACTION);
allowtab = !tabaction;
+ sig_char = 0 != (info -> flags & OE_SIG_CHAR) ? READCH_sig_char : 0;

DPRINT(Debug,4,
(&Debug,
! "== enter_helper: ch_count=%d %s%s%s%s%s%s%s%s%s%s\n",
info->ch_count,
append_current ? "append_current " : "",
add_comma ? "add_comma " : "",
***************

*** 350,356 ****


alt_solidus ? "alt_solidus " : "",
use_editor_escape ? "use_editor_escape " : "",
allowtab ? "allowtab " : "",
! tabaction ? "tabaction " : ""));

while(buffer) {
int escaped = OFF;

--- 372,379 ----


alt_solidus ? "alt_solidus " : "",
use_editor_escape ? "use_editor_escape " : "",
allowtab ? "allowtab " : "",
! tabaction ? "tabaction " : "",
! sig_char ? "sig_char " : ""));

while(buffer) {
int escaped = OFF;
***************

*** 400,406 ****


wrap_column = COLUMNS -5;
ch = menu_ReadCh2(info->current_page,
redraw|READCH_CURSOR|resize|
! (escaped ? 0 : READCH_term_char));

reprocess_key:
if (!ch) {

--- 423,431 ----


wrap_column = COLUMNS -5;
ch = menu_ReadCh2(info->current_page,
redraw|READCH_CURSOR|resize|
! (escaped ? 0 :
! READCH_term_char|sig_char)|
! (escaped ? READCH_quote : 0));

reprocess_key:
if (!ch) {

Index: elmME+.2.5.alpha2-cvs/src/leavembox.c
*** elmME+.2.5.alpha1/src/leavembox.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/leavembox.c 2004-08-07 21:07:18.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.5 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.5 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.7 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 649,675 ****


/* ============================================================== */

if(marked_deleted) {
! char answer = (always_del ?

*def_ans_yes : *def_ans_no); /* default answer */

if(l_ask_delete) {


! char * buffer = NULL;

if (marked_deleted == 1)
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveDeleteMessage,

! "Delete message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


else
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveDeleteMessages,

! "Delete messages? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


! answer = want_to(buffer, answer, LINES-4, 0, page);
! free(buffer);
}

! if(answer == *def_ans_yes) {

sc = get_storage_count(mailbox);

for (i = 0; i < sc; i++) {
--- 649,698 ----
/* ============================================================== */

if(marked_deleted) {
! int answer = (always_del ?

*def_ans_yes : *def_ans_no); /* default answer */

if(l_ask_delete) {
! int def = answer;


+ againD:
+ menu_get_sizes(page, &LINES, &COLUMNS);

+
+ /* NOTICE: prompt_letter may return EOF */

if (marked_deleted == 1)
! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,


! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLeaveDeleteMessage,
! "Delete message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
else
! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,

! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLeaveDeleteMessages,
! "Delete messages? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!

! if (TERMCH_interrupt_char == answer) {
! return_value = -1; /* failure */
! goto cleanup;
! }
!
! if (answer == ('L'&31) || answer == REDRAW_MARK) {
! menu_ClearScreen(page);
! goto againD;
! }
!
! if (answer == EOF)

! emergency_exit(0);

}

! if (answer == *def_ans_yes) {

sc = get_storage_count(mailbox);

for (i = 0; i < sc; i++) {
***************
*** 753,760 ****



/* NOTICE: prompt_letter may return EOF */

answer = prompt_letter(LINES-4,"P",*def_ans_yes,
! PROMPT_center|PROMPT_yesno|
! PROMPT_redraw_mark|PROMTP_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet,
ElmNoReceived,

--- 776,783 ----



/* NOTICE: prompt_letter may return EOF */

answer = prompt_letter(LINES-4,"P",*def_ans_yes,

! PROMPT_center|PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,


page,
CATGETS(elm_msg_cat, ElmSet,
ElmNoReceived,
***************

*** 769,775 ****



if (answer == 'P' || answer == EOF)
emergency_exit(0);
!
if (answer != *def_ans_yes) {
return_value = -2; /* failure */
goto cleanup;

--- 792,803 ----



if (answer == 'P' || answer == EOF)
emergency_exit(0);
!
! if (TERMCH_interrupt_char == answer) {
! return_value = -1; /* failure */
! goto cleanup;
! }
!
if (answer != *def_ans_yes) {
return_value = -2; /* failure */
goto cleanup;
***************

*** 798,804 ****


to_keep));

} else {
! char answer = '\0';
int marked_read=0;

/* Let's first see if user wants to store read messages

--- 826,832 ----


to_keep));

} else {
! int answer = '\0';
int marked_read=0;

/* Let's first see if user wants to store read messages
***************

*** 835,856 ****


*def_ans_yes : *def_ans_no); /* default answer */

if(l_ask_store) {


! char * buffer = NULL;

if (marked_read == 1)
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveMoveMessage,

! "Move read message to \"received\" folder? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


else
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveMoveMessages,

! "Move read messages to \"received\" folder? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


! answer = want_to(buffer, answer, LINES-4, 0,
! page);
! asked_storage_q = TRUE;
! free(buffer);
}

sc = get_storage_count(mailbox);

--- 863,909 ----


*def_ans_yes : *def_ans_no); /* default answer */

if(l_ask_store) {


! int def = answer;
!
! againR:
! menu_get_sizes(page, &LINES, &COLUMNS);
!
! /* NOTICE: prompt_letter may return EOF */

if (marked_read == 1)

! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,

! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLeaveMoveMessage,
! "Move read message to \"received\" folder? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
else
! answer = prompt_letter(LINES-4,"",def,


! PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,
! page,

!
! CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveMoveMessages,

! "Move read messages to \"received\" folder? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!

! if (TERMCH_interrupt_char == answer) {
! return_value = -1; /* failure */
! goto cleanup;
! }
!

! if (answer == ('L'&31) || answer == REDRAW_MARK) {
! menu_ClearScreen(page);
! goto againR;
! }
!
! if (answer == EOF)
! emergency_exit(0);
!
! asked_storage_q = TRUE;
}

sc = get_storage_count(mailbox);
***************

*** 958,977 ****
answer = (always_keep ?

*def_ans_yes : *def_ans_no); /* default answer */

if(l_ask_keep) {


! char * buffer = NULL;

if (marked_unread == 1)
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmLeaveKeepMessage,
"Keep unread message in incoming mailbox? (%c/%c) "),
*def_ans_yes, *def_ans_no);
else
! buffer = elm_message(CATGETS(elm_msg_cat, ElmSet, ElmLeaveKeepMessages,

! "Keep unread messages in incoming mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


! answer = want_to(buffer, answer, LINES-4, 0,
! page);
! free(buffer);
}


--- 1011,1054 ----
answer = (always_keep ?

*def_ans_yes : *def_ans_no); /* default answer */

if(l_ask_keep) {


! int def = answer;
!
! againK:
! menu_get_sizes(page, &LINES, &COLUMNS);
!
! /* NOTICE: prompt_letter may return EOF */

if (marked_unread == 1)

! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,

! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLeaveKeepMessage,
"Keep unread message in incoming mailbox? (%c/%c) "),
*def_ans_yes, *def_ans_no);
else

! answer = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,
! page,
! CATGETS(elm_msg_cat, ElmSet, ElmLeaveKeepMessages,
! "Keep unread messages in incoming mailbox? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!

! if (TERMCH_interrupt_char == answer) {
! return_value = -1; /* failure */
! goto cleanup;
! }
!

! if (answer == ('L'&31) || answer == REDRAW_MARK) {
! menu_ClearScreen(page);
! goto againK;
! }
!
! if (answer == EOF)
! emergency_exit(0);
!
}


Index: elmME+.2.5.alpha2-cvs/src/limit.c
*** elmME+.2.5.alpha1/src/limit.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/limit.c 2004-08-07 21:07:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: limit.c,v 1.32 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: limit.c,v 1.32.8.2 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 57,67 ****
}


! int limit(menu, page)
struct menu_common *menu;

struct menu_context *page;
{


! /** returns non-zero if we changed selection criteria = need redraw **/

int last_selected, all;
struct string *criteria = NULL;
--- 57,69 ----
}


! void limit(menu, page)
struct menu_common *menu;

struct menu_context *page;
{


! /** if we changed selection criteria = need redraw
! use menu_trigger_redraw(page)
! */

int last_selected, all;
struct string *criteria = NULL;
***************

*** 107,113 ****

if (0 != optionally_enter2(page,
&criteria,LINES-3,0,
! OE_ALLOW_MIMEENC,
CATGETS(elm_msg_cat, ElmSet,
ElmLimitEnterCriteria,

"Enter criteria or '?' for help: "))
--- 109,116 ----

if (0 != optionally_enter2(page,
&criteria,LINES-3,0,
! OE_ALLOW_MIMEENC|


! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmLimitEnterCriteria,
"Enter criteria or '?' for help: "))
***************
*** 115,121 ****



if (criteria)
free_string(& criteria);
! return TRUE;

}

--- 118,126 ----

if (criteria)
free_string(& criteria);

!
! menu_trigger_redraw(page);
! return;

}

***************
*** 130,136 ****



mcommon_set_selected(menu,last_selected);

! return(FALSE);
}

if (string_matches_ascii(criteria,s2us("all"))) {
--- 135,141 ----

mcommon_set_selected(menu,last_selected);

! return;
}

if (string_matches_ascii(criteria,s2us("all"))) {
***************

*** 275,284 ****


current = visible_to_index(1,menu)+1;
mcommon_set_current(menu,current);
}
!
! return(TRUE);
} else {
! return(FALSE);
}
}
}
--- 280,290 ----
current = visible_to_index(1,menu)+1;
mcommon_set_current(menu,current);
}

!
! menu_trigger_redraw(page);
! return;

} else {
! return;
}
}
}
Index: elmME+.2.5.alpha2-cvs/src/lock.c
*** elmME+.2.5.alpha1/src/lock.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/lock.c 2004-08-07 21:07:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: lock.c,v 1.18 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: lock.c,v 1.18.8.1 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 77,87 ****
}
}

- /* ?? global reference */
if (direction == INCOMING)
! leave_locked(&current_mailbox,&current_aliaslist); /* ?? global reference */
else
! emergency_exit(0);
}

return(0);
--- 77,86 ----
}
}

if (direction == INCOMING)
! leave_locked();
else
! emergency_exit(0);
}

return(0);

Index: elmME+.2.5.alpha2-cvs/src/mailmsg1.c
*** elmME+.2.5.alpha1/src/mailmsg1.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/mailmsg1.c 2004-08-14 09:40:48.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.36.8.5 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.5 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.36.8.8 2004/08/14 06:40:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 41,47 ****
static int to_line, to_col;


static enum copy_msg_mode { cm_no_copy = 0, cm_get_copy, cm_canceled_mail,
! cm_mimeforward

} copy_the_msg P_((struct mailing_headers *headers,
int options,
struct menu_context *page));

--- 41,47 ----
static int to_line, to_col;


static enum copy_msg_mode { cm_no_copy = 0, cm_get_copy, cm_canceled_mail,

! cm_mimeforward, cm_CANCEL
} copy_the_msg P_((struct mailing_headers *headers,
int options,

struct menu_context *page));
***************
*** 83,89 ****
if (!newaddress)
return;

! if (mail_only)
if (string_len(newaddress) > 80)
PutLineX(to_line, to_col,
CATGETS(elm_msg_cat, ElmSet, ElmToParen,
--- 83,89 ----
if (!newaddress)
return;

! if (OPMODE_IS_SENDMODE(opmode))
if (string_len(newaddress) > 80)
PutLineX(to_line, to_col,
CATGETS(elm_msg_cat, ElmSet, ElmToParen,
***************
*** 126,133 ****

menu_get_sizes(page,&LINES, &COLUMNS);

! to_line = mail_only ? 3 : LINES - 4;
! to_col = mail_only ? 0 : COLUMNS - 50;

if (names_only) {
output_abbreviated_to(address.addrs);
--- 126,133 ----

menu_get_sizes(page,&LINES, &COLUMNS);

! to_line = OPMODE_IS_SENDMODE(opmode) ? 3 : LINES - 4;
! to_col = OPMODE_IS_SENDMODE(opmode) ? 0 : COLUMNS - 50;

if (names_only) {
output_abbreviated_to(address.addrs);
***************
*** 138,144 ****
if (!addr_string)
return;

! if(mail_only)
if(string_len(addr_string) > 80)
PutLineX(to_line, to_col,
CATGETS(elm_msg_cat, ElmSet, ElmToParen,
--- 138,144 ----
if (!addr_string)
return;

! if (OPMODE_IS_SENDMODE(opmode))
if(string_len(addr_string) > 80)
PutLineX(to_line, to_col,
CATGETS(elm_msg_cat, ElmSet, ElmToParen,
***************
*** 167,239 ****


free_string(&addr_string);
}

! int get_to(to,mailer_info,aview, page)
struct expanded_address *to;

struct mailer_info *mailer_info;


! struct AliasView *aview;
! struct menu_context *page;
{

struct string * buffer = NULL;

int LINES, COLUMNS;
!
menu_get_sizes(page,&LINES, &COLUMNS);

/** prompt for the "To:" field, expanding into address if possible.
This routine returns ZERO if errored, or non-zero if okay **/


expanded_to_edit_buffer(&buffer, *to);

if (to->surface_len == 0) {

! if (user_level < 2) {
! int code;

code = optionally_enter2(page,
! &buffer, LINES-3, 0,
! OE_REDRAW_MARK,

CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));
!
!
while (REDRAW_MARK == code) {

code = optionally_enter2(page,
! &buffer, LINES-3, 0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,


CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));

! }


! if (0 != code) {
! free_string(&buffer);

! return 0;
! }
}
else {
- int code;
code = optionally_enter2(page,
! &buffer, LINES-3, 0,
! OE_REDRAW_MARK,


CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));

while (code == REDRAW_MARK) {
code = optionally_enter2(page,
! &buffer, LINES-3, 0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,


CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));
}

! if (0 != code) {

free_string(&buffer);
! return 0;
}
}
if (string_len(buffer) == 0) {
free_expanded_address(to);

! ClearLine(LINES-3);

free_string(&buffer);
return 0;
}
update_expanded_from_edit_buffer(to,buffer,mailer_info,
--- 167,326 ----


free_string(&addr_string);
}

! int get_to(to,mailer_info,aview, page, cancel_view, cancel_selection)
struct expanded_address *to;

struct mailer_info *mailer_info;


! struct AliasView *aview;
! struct menu_context *page;

! struct MailboxView *cancel_view;
! int *cancel_selection;
{
+

struct string * buffer = NULL;

int LINES, COLUMNS;
! int redraw = 0;
! int can_flag = 0;
! int line;
!
menu_get_sizes(page,&LINES, &COLUMNS);
+ line = OPMODE_IS_SENDMODE(opmode) ? 3 : LINES-3;

+ if (cancel_selection)


+ *cancel_selection = -1;
+

/** prompt for the "To:" field, expanding into address if possible.
This routine returns ZERO if errored, or non-zero if okay **/


expanded_to_edit_buffer(&buffer, *to);

+
if (to->surface_len == 0) {
+ int canceled_count = 0;
+ int flag = 0;

+ int oline = -1;
+ int code;
+
+ if (cancel_view)
+ canceled_count = get_message_count(cancel_view);



! DPRINT(Debug,7,(&Debug,
! "canceled_count=%d\n",
! canceled_count));
!
! if (canceled_count > 1 && cancel_selection) {
! print_format_center(line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceledX,
! "%d canceled mails. Use / to select one of them."),
! canceled_count);

! oline = line++;


! flag |= OE_ALT_SOLIDUS;
! } else if (1 == canceled_count && cancel_selection) {
! print_format_center(line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceled1,

! "1 canceled mail. Use / to select it."));
! oline = line++;


! flag |= OE_ALT_SOLIDUS;
! }

+
+ if (user_level < 2) {
code = optionally_enter2(page,
! &buffer, line, 0,
! OE_REDRAW_MARK|flag|

! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));
!
!
while (REDRAW_MARK == code) {
+ menu_get_sizes(page,&LINES, &COLUMNS);
+
code = optionally_enter2(page,
! &buffer, line, 0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! flag|OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
ElmSendTheMessageTo,
"Send the message to: "));
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! redraw = 1;
! }
}
else {
code = optionally_enter2(page,
! &buffer, line, 0,
! OE_REDRAW_MARK|flag|

! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));
+

while (code == REDRAW_MARK) {
+ menu_get_sizes(page,&LINES, &COLUMNS);
+
code = optionally_enter2(page,
! &buffer, line, 0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! flag|OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));
+ /* NOTICE: using menu_trigger_redraw(page) on here
+ may cause redraw loop!
+ */

+ redraw = 1;
}
!
! }
!
! if (oline >= 0) {
! MoveCursor(oline,0);
! CleartoEOLN();
!
! }
!
!

! if (OE_ALT_SOLIDUS == code) {
! can_flag = view_canceled_mails(cancel_view,
! cancel_selection,aview);

! redraw = 1;
! }
!

! if (0 != code || can_flag) {

!

! if (-1 == code) { /* Ctrl-C */

! MoveCursor(line,0);

! CleartoEOLN();
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
! "Mail not sent."));

! }
!
! if (buffer)
free_string(&buffer);


!
! if (redraw)
! menu_trigger_redraw(page);
!

! if (can_flag > 0) {
! DPRINT(Debug,4,(&Debug, "get_to: Canceled mail selected\n"));
! return 1; /* Canceled mail selected */


}
+ return 0;
}
+
+

if (string_len(buffer) == 0) {
free_expanded_address(to);

! ClearLine(line);

free_string(&buffer);


+
+ if (redraw)
+ menu_trigger_redraw(page);
return 0;
}

update_expanded_from_edit_buffer(to,buffer,mailer_info,


***************
*** 246,255 ****
--- 333,348 ----

ClearLine(LINES-3);

free_string(&buffer);


+
+ if (redraw)
+ menu_trigger_redraw(page);
return 0;
}

free_string(&buffer);


+
+ if (redraw)
+ menu_trigger_redraw(page);

return 1; /* everything is okay... */
}

***************
*** 261,267 ****
static int get_subject P_((struct string **field,

struct menu_context *page));

! static int send_msg_middle P_((


int index,
struct expanded_address *given_to,
struct expanded_address *given_cc,

--- 354,360 ----


static int get_subject P_((struct string **field,

struct menu_context *page));

! static void send_msg_middle P_((


int index,
struct expanded_address *given_to,
struct expanded_address *given_cc,

***************
*** 273,279 ****


struct menu_context *page
));

! static int send_msg_middle(index,
given_to, given_cc, given_subject, options,

form_letter,mailer_info,
mailbox,aview, page)
--- 366,372 ----
struct menu_context *page
));

! static void send_msg_middle(index,
given_to, given_cc, given_subject, options,
form_letter,mailer_info,
mailbox,aview, page)
***************
*** 285,303 ****


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

! {
! int res;


! enum copy_msg_mode copy_msg = cm_no_copy;
char *p;
struct mailing_headers headers;

! int LINES, COLUMNS;

- menu_get_sizes(page,&LINES, &COLUMNS);



zero_mailing_headers(&headers);

if (!mailer_info)
! return 0;

if (given_subject)
headers.subject = new_string2(display_charset,s2us(given_subject));

--- 378,397 ----


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

! {

char *p;
struct mailing_headers headers;

! struct MailboxView *cancel_view = NULL;
! int cancel_selection = -1;
!

! int forwarding = 0 != (options & MAIL_FORWARDING);

! int replying = 0 != (options & MAIL_REPLYING);


zero_mailing_headers(&headers);

if (!mailer_info)
! return;

if (given_subject)
headers.subject = new_string2(display_charset,s2us(given_subject));
***************

*** 328,351 ****
}


! /* copy msg into edit buffer? */
! copy_msg = copy_the_msg(&headers,


! options, page);
!
! switch (copy_msg) {
! case cm_get_copy:
! options |= MAIL_COPY_MSG;
! break;
! case cm_mimeforward:
! options |= MAIL_MIME_ATTCH;
! options |= MAIL_COPY_MSG;
! break;
}

- /* get the To: address and expand --
- */
- if (! get_to(&headers.to,mailer_info,aview, page))
- return(0);



/* expand the Cc: address */
if (&headers.cc.surface_len)
--- 422,507 ----
}


! if (OPMODE_IS_INTERACTIVE(opmode)) {
!
! /* copy msg into edit buffer? */
! enum copy_msg_mode copy_msg = copy_the_msg(&headers,


! options, page);
!
! switch (copy_msg) {

! case cm_CANCEL:
! goto free_it;
!

! case cm_get_copy:
! options |= MAIL_COPY_MSG;
! break;
! case cm_mimeforward:
! options |= MAIL_MIME_ATTCH;
! options |= MAIL_COPY_MSG;
! break;

! default:
!
! if (!forwarding &&
! !replying)
! cancel_view = give_canceled_mail();


! break;
! }
!
!
! /* get the To: address and expand --
! */

! if (! get_to(&headers.to,mailer_info,aview, page,cancel_view,
! &cancel_selection)) {

! goto free_it;
! }
!
! display_to(headers.to, page);
!
! /* get the Subject: field */
!
! if (get_subject(&headers.subject, page) == 0) {
! goto free_it;
! }
!
! if (prompt_for_cc) {
! if (get_copies(&headers.cc, copy_msg, mailer_info,
! aview, page) == 0) {
! goto free_it;
! }
! }
!
! {
! int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES, &COLUMNS);
!
! MoveCursor(LINES-1,0); /* so you know you've hit <return> ! */
! FlushBuffer();
! }
! }
!
! if (cancel_selection >= 0) {
! struct header_rec * H = give_header(cancel_view,cancel_selection);
!
! if (H) {
! options |= MAIL_COPY_SELECTION | MAIL_DELETE_CANCEL;
!
! /* Copy some addresses from header struct
! *
! * Actually these addresses will be overwritten whan
! * canceled mail is readed and parsed
! */
!
! if (!headers.subject && H->subject)
! headers.subject = dup_string(H->subject);
!
! expanded_address_from_items (&headers.from, H->from);
! expanded_address_from_items (&headers.to, H->to);
! expanded_address_from_items (&headers.cc, H->cc);
!
! }


}


/* expand the Cc: address */
if (&headers.cc.surface_len)
***************

*** 359,390 ****
if (&headers.bcc.surface_len)
build_address_l(&headers.bcc,mailer_info,aview);

! /** if we're batchmailing, let's send it and GET OUTTA HERE! **/
!
! if (batch_only) {
! /** if we're batchmailing, let's send it and GET OUTTA HERE! **/


! res = mail(-1, 0, form_letter,&headers,mailer_info,
! mailbox, aview);

! } else {
! display_to(headers.to, page);
!
! /* get the Subject: field */



! if (get_subject(&headers.subject, page) == 0) {
! res = 0;

! goto free_it;
! }

! if (prompt_for_cc) {
! if (get_copies(&headers.cc, copy_msg, mailer_info,

! aview, page) == 0) {
! res = 0;

! goto free_it;
! }
! }
!
! MoveCursor(LINES-1,0); /* so you know you've hit <return> ! */
! FlushBuffer();



/** generate the In-Reply-To: header... **/

--- 515,553 ----


if (&headers.bcc.surface_len)
build_address_l(&headers.bcc,mailer_info,aview);

! DPRINT(Debug,4,(&Debug, "send_msg_middle -- options (%d): %s%s%s%s%s%s%s%s\n",
! options,
! options & MAIL_COPY_MSG ? " MAIL_COPY_MSG" : "",
! options & MAIL_EDIT_MSG ? " MAIL_EDIT_MSG" : "",
! options & MAIL_ISFORM ? " MAIL_ISFORM" : "",
! options & MAIL_REPLYING ? " MAIL_REPLYING" : "",
! options & MAIL_FORWARDING ? " MAIL_FORWARDING" : "",
! options & MAIL_MIME_ATTCH ? " MAIL_MIME_ATTCH" : "",
! options & MAIL_COPY_SELECTION ? " MAIL_COPY_SELECTION" : "",
! options & MAIL_DELETE_CANCEL ? " MAIL_DELETE_CANCEL" : ""));
!
! /** if we're batchmailing, let's send it and GET OUTTA HERE!
! **
! ** If MAIL_COPY_SELECTION is set data for headers will be readed
! ** from canceled mail, do not prompt anything
! **/
!
! dump_expanded_address(4,"send_msg_middle -- from ",headers.from);
! dump_expanded_address(4,"send_msg_middle -- to ",headers.to);
! dump_expanded_address(4,"send_msg_middle -- cc ",headers.cc);
!
!

! if (! OPMODE_IS_INTERACTIVE(opmode) ||

! (options & MAIL_COPY_SELECTION)) {
!
!
! mail(index, options, form_letter,&headers,mailer_info,
! mailbox, aview, page,
! cancel_view,cancel_selection);

! /* mail does menu_trigger_redraw(), not need to be examine */

! } else {

/** generate the In-Reply-To: header... **/

***************
*** 408,426 ****


dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

! res=mail(index,options, form_letter,&headers,
! mailer_info,
! mailbox, aview);
}

free_it:

free_mailing_headers(&headers);
!
! return res;


}

! int send_msg_l(index,
given_to, given_cc, given_subject, options, form_letter,

mailbox, aview, page
)
--- 571,597 ----


dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

! mail(index,options, form_letter,&headers,
! mailer_info,

! mailbox, aview, page,
! cancel_view,cancel_selection);
!
! /* mail does menu_trigger_redraw(), not need to be examine */
!
}

free_it:

+ if (cancel_view)
+ sync_canceled_mails(cancel_view);
+
+
free_mailing_headers(&headers);

!
! return;
}

! void send_msg_l(index,


given_to, given_cc, given_subject, options, form_letter,

mailbox, aview, page
)
***************

*** 432,443 ****


struct AliasView *aview;
struct menu_context *page;
{

! int ret;
struct expanded_address A, B;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return 0;

zero_expanded_address(&A);
zero_expanded_address(&B);

--- 603,616 ----


struct AliasView *aview;
struct menu_context *page;
{

! /* If redraw is needed use
! menu_trigger_redraw(page)
! */
struct expanded_address A, B;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return ;

zero_expanded_address(&A);
zero_expanded_address(&B);
***************

*** 445,464 ****
addr_to_expanded(&A,given_to,mailer_info,aview);
addr_to_expanded(&B,given_cc,mailer_info,aview);

! ret = send_msg_middle(index,&A,&B,
given_subject,options,form_letter,
mailer_info,

mailbox, aview, page);
free_expanded_address(&A);
free_expanded_address(&B);


free_mailer_info(&mailer_info);
!
! return ret;
}

! int send_msg_argv(argv, given_subject, options, form, mailbox, aview,
page)
char *argv[];
char *given_subject;

--- 618,641 ----


addr_to_expanded(&A,given_to,mailer_info,aview);
addr_to_expanded(&B,given_cc,mailer_info,aview);

! send_msg_middle(index,&A,&B,
given_subject,options,form_letter,
mailer_info,
mailbox, aview, page);
+
+ /* send_msg_middle does menu_trigger_redraw(page),
+ do not need examine */
+
free_expanded_address(&A);
free_expanded_address(&B);


free_mailer_info(&mailer_info);

!
! return;
}


! void send_msg_argv(argv, given_subject, options, form, mailbox, aview,
page)
char *argv[];
char *given_subject;
***************

*** 468,495 ****


struct AliasView *aview;
struct menu_context *page;
{

- int ret;
struct expanded_address A, B;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return 0;

zero_expanded_address(&A);
zero_expanded_address(&B);

argv_to_expanded(&A,argv,mailer_info,aview);

! ret = send_msg_middle(-1,&A,&B,

! given_subject,options,form,mailer_info,


! mailbox, aview, page);

free_expanded_address(&A);
free_expanded_address(&B);

free_mailer_info(&mailer_info);

! return ret;
}

static int get_subject(subject_field, page)

--- 645,675 ----


struct AliasView *aview;
struct menu_context *page;
{

struct expanded_address A, B;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return;

zero_expanded_address(&A);
zero_expanded_address(&B);

argv_to_expanded(&A,argv,mailer_info,aview);

! send_msg_middle(-1,&A,&B,

! given_subject,options,form,mailer_info,
! mailbox, aview, page);


!
! /* send_msg_middle uses menu_trigger_redraw(),
! need not examine
! */

free_expanded_address(&A);
free_expanded_address(&B);

free_mailer_info(&mailer_info);

! return;
}

static int get_subject(subject_field, page)
***************

*** 501,511 ****


charset_t utf7;
int LINES, COLUMNS;
int prompt_line;

menu_get_sizes(page,&LINES, &COLUMNS);

/** get the subject and return non-zero if all okay... **/
! prompt_line = mail_only ? 4 : LINES-3;

redraw:
if (user_level == 0) {
--- 681,692 ----


charset_t utf7;
int LINES, COLUMNS;

int prompt_line;
+ int redraw = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

/** get the subject and return non-zero if all okay... **/
! prompt_line = OPMODE_IS_SENDMODE(opmode) ? 4 : LINES-3;

redraw:
if (user_level == 0) {
***************
*** 514,520 ****


OE_APPEND_CURRENT|OE_REDRAW_MARK
/* Allow user paste mime encoded
words to buffer */
! |OE_ALLOW_MIMEENC,
CATGETS(elm_msg_cat, ElmSet,
ElmSubjectOfMessage,
"Subject of message: "));

--- 695,702 ----
OE_APPEND_CURRENT|OE_REDRAW_MARK
/* Allow user paste mime encoded
words to buffer */
! |OE_ALLOW_MIMEENC


! |OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmSubjectOfMessage,
"Subject of message: "));
***************

*** 524,542 ****
OE_APPEND_CURRENT|OE_REDRAW_MARK
/* Allow user paste mime encoded
words to buffer */
! |OE_ALLOW_MIMEENC,


CATGETS(elm_msg_cat, ElmSet, ElmSubject,
"Subject: "));

! if (REDRAW_MARK == code)
goto redraw;


if(code==-1){
! /** User hit the BREAK key! **/
MoveCursor(prompt_line,0);

CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));

return(0);
}

--- 706,734 ----
OE_APPEND_CURRENT|OE_REDRAW_MARK
/* Allow user paste mime encoded
words to buffer */
! |OE_ALLOW_MIMEENC


! |OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmSubject,
"Subject: "));

! if (REDRAW_MARK == code) {
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! redraw = 1;
!
goto redraw;
+ }

if(code==-1){

! /** User hit Ctrl-C key! **/
MoveCursor(prompt_line,0);

CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));

+
+ if (redraw)
+ menu_trigger_redraw(page);

return(0);
}

***************
*** 554,559 ****
--- 746,754 ----


ClearLine(prompt_line);
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSend,
"Mail not sent."));

+
+ if (redraw)
+ menu_trigger_redraw(page);

return(0);
}
else {
***************
*** 579,584 ****
--- 774,781 ----
*subject_field = XX;


}

+ if (redraw)
+ menu_trigger_redraw(page);

return(1); /** everything is cruising along okay **/
}

***************

*** 607,616 ****


int code;
struct string *buffer = NULL;

int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

! prompt_line = mail_only ? 5 : LINES - 2;

FlushBuffer();

--- 804,814 ----
int code;
struct string *buffer = NULL;
int LINES, COLUMNS;


+ int redraw = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

! prompt_line = OPMODE_IS_SENDMODE(opmode) ? 5 : LINES - 2;

FlushBuffer();

***************
*** 618,635 ****



code = optionally_enter2(page,
&buffer, prompt_line,0,
! OE_REDRAW_MARK,

CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));

while (REDRAW_MARK == code) {
code = optionally_enter2(page,

&buffer, prompt_line,0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,

CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));
!
}

! if (code == -1) {
ClearLine(prompt_line-1);
ClearLine(prompt_line);

--- 816,840 ----



code = optionally_enter2(page,
&buffer, prompt_line,0,

! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));

while (REDRAW_MARK == code) {
code = optionally_enter2(page,

&buffer, prompt_line,0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));
!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! redraw = 1;
}

!

! if (code == -1) { /* Ctrl-C */
ClearLine(prompt_line-1);
ClearLine(prompt_line);

***************
*** 637,644 ****


"Mail not sent."));

/* Free it */
! buffer_to_header(cc,&buffer,TRUE,mailer_info,aview);

return(0);
}

--- 842,852 ----


"Mail not sent."));

/* Free it */
! if (buffer)
! buffer_to_header(cc,&buffer,TRUE,mailer_info,aview);

+ if (redraw)
+ menu_trigger_redraw(page);

return(0);
}

***************
*** 667,673 ****
free_string(&B);
}
}
!

return(1); /* everything looks okay! */
}

--- 875,883 ----
free_string(&B);


}
}
!
! if (redraw)
! menu_trigger_redraw(page);

return(1); /* everything looks okay! */
}

***************
*** 685,691 ****


replied to into the edit buffer before invoking the editor!
**/

! static enum copy_msg_mode answer = cm_no_copy;

again:
menu_get_sizes(page,&LINES, &COLUMNS);
--- 895,902 ----


replied to into the edit buffer before invoking the editor!
**/

! enum copy_msg_mode answer = cm_no_copy;
! int redraw = 0;

again:
menu_get_sizes(page,&LINES, &COLUMNS);
***************
*** 696,715 ****
if (askmimeforward) {

int def = mimeforward ? *def_ans_yes : *def_ans_no;

int ret;



ret = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_redraw_mark,

page,
CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,


"Forward message as separate part? (%c/%c) "),

*def_ans_yes, *def_ans_no);



! if (REDRAW_MARK == ret)

goto again;
if (EOF == ret)

! return 0;


!

X = (ret == *def_ans_yes);
}

--- 907,940 ----
if (askmimeforward) {

int def = mimeforward ? *def_ans_yes : *def_ans_no;

int ret;


+
+ /* NOTICE: prompt_letter may return EOF */

ret = prompt_letter(LINES-4,"",def,
! PROMPT_yesno|PROMPT_redraw_mark|PROMPT_cancel|
! PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,


"Forward message as separate part? (%c/%c) "),

*def_ans_yes, *def_ans_no);

! if (ret == ('L'&31) || REDRAW_MARK == ret) {
!

! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */

! redraw = 1;
goto again;
+ }

+
if (EOF == ret)
! goto out;



+ if (TERMCH_interrupt_char == ret) {

+ answer = cm_CANCEL;
+ goto out;
+ }
+

X = (ret == *def_ans_yes);
}

***************
*** 724,733 ****

int ret;

if (user_level < 2)
ret = prompt_letter(LINES-4,"",


reply_copy ? *def_ans_yes : *def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark,

page,
CATGETS(elm_msg_cat, ElmSet,
ElmCopyMessageIntoReplyYN,
--- 949,961 ----

int ret;



+ /* NOTICE: prompt_letter may return EOF */
+

if (user_level < 2)
ret = prompt_letter(LINES-4,"",


reply_copy ? *def_ans_yes : *def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark

! |PROMPT_cancel|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet,
ElmCopyMessageIntoReplyYN,
***************
*** 736,752 ****
else
ret = prompt_letter(LINES-4,"",


reply_copy ? *def_ans_yes : *def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark,

page,


CATGETS(elm_msg_cat, ElmSet,
ElmCopyMessageYN,
"Copy message? (%c/%c) "),
*def_ans_yes, *def_ans_no);

! if (REDRAW_MARK == ret)

goto again;
if (EOF == ret)

! return 0;



X = (ret == *def_ans_yes);

--- 964,993 ----
else
ret = prompt_letter(LINES-4,"",


reply_copy ? *def_ans_yes : *def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark

! |PROMPT_cancel|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet,
ElmCopyMessageYN,
"Copy message? (%c/%c) "),

*def_ans_yes, *def_ans_no);

! if (ret == ('L'&31) || REDRAW_MARK == ret) {
!

! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */

! redraw = 1;
goto again;
+ }

+
if (EOF == ret)
! goto out;
!
! if (TERMCH_interrupt_char == ret) {


! answer = cm_CANCEL;
! goto out;

! }

X = (ret == *def_ans_yes);

***************
*** 755,764 ****
answer = X ? cm_get_copy : cm_no_copy;
}

! return(answer);


}

! int a_sendmsg(edit_message, form_letter, mailbox, aview, header_page,
page)
int edit_message, form_letter;
struct MailboxView *mailbox;

--- 996,1008 ----


answer = X ? cm_get_copy : cm_no_copy;
}

! out:


! if (redraw)
! menu_trigger_redraw(page);

! return(answer);


}

! void a_sendmsg(edit_message, form_letter, mailbox, aview, header_page,
page)
int edit_message, form_letter;
struct MailboxView *mailbox;
***************

*** 772,784 ****


if YES, then add the header. If MAYBE, then add the M)ake form
option to the last question (see mailsg2.c) etc. etc.

! Return TRUE if the main part of the screen has been changed

! (useful for knowing whether a redraw is needed.
**/

register int tagged = 0, i;
! int ret;
!
struct mailing_headers headers;
struct mailer_info *mailer_info = get_mailer_info();
int LINES, COLUMNS;

--- 1016,1026 ----


if YES, then add the header. If MAYBE, then add the M)ake form
option to the last question (see mailsg2.c) etc. etc.

! If redraw is needed use menu_trigger_redraw(page)
**/

register int tagged = 0, i;
!
struct mailing_headers headers;
struct mailer_info *mailer_info = get_mailer_info();

int LINES, COLUMNS;
***************
*** 797,817 ****


/* build the To: address and expand */
if (build_address_l(&headers.to,mailer_info, aview) == 0) {
free_mailer_info(&mailer_info);
! return(0);
}
display_to(headers.to,page); /* display the To: field on screen... */

/* get the Subject: field */

! if (get_subject(&headers.subject,page) == 0) {
! ret = 0;
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, FALSE,mailer_info, aview,
! page) == 0) {
! ret = 0;
goto free_it;
}
}

--- 1039,1057 ----


/* build the To: address and expand */
if (build_address_l(&headers.to,mailer_info, aview) == 0) {
free_mailer_info(&mailer_info);
! return;
}
display_to(headers.to,page); /* display the To: field on screen... */

/* get the Subject: field */

! if (get_subject(&headers.subject,page) == 0) {
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, FALSE,mailer_info, aview,
! page) == 0) {
goto free_it;
}
}
***************

*** 833,841 ****
dump_expanded_address(5,"bcc",headers.bcc);

main_state();


! ret = mail(-1, edit_message ? MAIL_EDIT_MSG : 0, form_letter,
! &headers,mailer_info,
! mailbox, aview);
main_state();

/*

--- 1073,1082 ----
dump_expanded_address(5,"bcc",headers.bcc);

main_state();
! mail(-1, edit_message ? MAIL_EDIT_MSG : 0, form_letter,
! &headers,mailer_info,

! mailbox, aview, page,
! NULL,-1);
main_state();

/*
***************

*** 863,869 ****


free_it:
free_mailing_headers(&headers);
free_mailer_info(&mailer_info);
! return ret;
}

/*

--- 1104,1114 ----


free_it:
free_mailing_headers(&headers);
free_mailer_info(&mailer_info);
!
!
! /* mail() uses menu_trigger_redraw(page), do not need examine */
!
! return;
}

/*

Index: elmME+.2.5.alpha2-cvs/src/mailmsg2.c
*** elmME+.2.5.alpha1/src/mailmsg2.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/mailmsg2.c 2004-08-14 09:40:48.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.8.12 2004/07/03 16:03:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.12 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.8.15 2004/08/14 06:40:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,32 ****
--- 27,33 ----



#include "def_elm.h"
#include "s_elm.h"
+ #include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"mail");

***************

*** 87,95 ****


static int append_sig P_((FILE *file,struct mailing_headers *headers,
struct menu_context *page));

- static int recall_last_msg P_((char *filename, int copy_msg,
- int *cancelled_msg, int *already_has_text,
- struct menu_context *page));

static void mailing_message P_((int background));
static void mailing_message(background)

--- 88,93 ----
***************
*** 221,241 ****


}
}


! int mail(mail_index,options,form, headers,mailer_info,
! mailbox,aview)

int mail_index;
int options,form;
struct mailing_headers * headers;
struct mailer_info *mailer_info;

struct MailboxView *mailbox /* for mail_index */;
struct AliasView *aview;
{

int replying = 0 != (options & MAIL_REPLYING);

int copy_msg = 0 != (options & MAIL_COPY_MSG);

int edit_message = 0 != (options & MAIL_EDIT_MSG);

int forwarding = 0 != (options & MAIL_FORWARDING);

int mime_attach = 0 != (options & MAIL_MIME_ATTCH);

struct Attachments attachments = NULL_Attachments;

--- 219,323 ----
}
}

+ static char * mmsg_copy_part P_((FILE * mailbox_file,mime_t *mime_rec,
+ FILE *outfile,int quote_l));



! static char * mmsg_copy_part(mailbox_file,mime_rec,outfile,quote_l)
! FILE * mailbox_file;
! mime_t *mime_rec;
! FILE *outfile; /* MAY be NULL */
! int quote_l;
! {
! FILE *F;
! static int PART_COUNT = 0;
! out_state_t state_out;
! in_state_t state_in;
! char *fname;

!

! int ch;


! int nl = 1;
!
! rewind(F);
!
! while (EOF != (ch = getc(F))) {
!
! if (nl && '[' == ch && quote_l)
! putc('[',outfile);
!
! putc(ch,outfile);
! nl = '\n' == ch;
! }

! }
!
! } else {
!

! /* FAILURE */
! unlink(fname);
! free(fname);

! fname = NULL;
! }
!

! out_state_destroy(&state_out);
! in_state_destroy(&state_in);
!
!
! fclose(F);
!
! return fname;
! }
!
! void mail(mail_index,options,form, headers,mailer_info,
! mailbox,aview, parent_page,
! selection_view,selection_idx)

int mail_index;
int options,form;
struct mailing_headers * headers;
struct mailer_info *mailer_info;

struct MailboxView *mailbox /* for mail_index */;
struct AliasView *aview;

+ struct menu_context *parent_page;
+ struct MailboxView *selection_view;
+ int selection_idx;
{

int replying = 0 != (options & MAIL_REPLYING);

int copy_msg = 0 != (options & MAIL_COPY_MSG);

int edit_message = 0 != (options & MAIL_EDIT_MSG);

int forwarding = 0 != (options & MAIL_FORWARDING);

int mime_attach = 0 != (options & MAIL_MIME_ATTCH);

+ int copy_selection = 0 != (options & MAIL_COPY_SELECTION);
+ int delete_cancel = 0 != (options & MAIL_DELETE_CANCEL);



struct Attachments attachments = NULL_Attachments;

***************

*** 248,262 ****


M)ake form option to last question, and NO=don't worry about it!
Also, if 'copy_msg' = FORM, then grab the form temp file and use
that...

! Return TRUE if the main part of the screen has been changed

! (useful for knowing whether a redraw is needed.
**/

FILE *reply = NULL;

char fname[SLEN], very_long_buffer[VERY_LONG_STRING];

int ch, line_len;
! int retransmit = FALSE;
int already_has_text = FALSE; /* we need an ADDRESS */
int signature_done = FALSE;
int need_redraw = 0;

--- 330,345 ----


M)ake form option to last question, and NO=don't worry about it!
Also, if 'copy_msg' = FORM, then grab the form temp file and use
that...
!
! In redraw is needed use
! use menu_trigger_redraw(parent_page)
**/

FILE *reply = NULL;

char fname[SLEN], very_long_buffer[VERY_LONG_STRING];

int ch, line_len;
!

int already_has_text = FALSE; /* we need an ADDRESS */
int signature_done = FALSE;
int need_redraw = 0;
***************

*** 272,278 ****


static int conv_count = 0;

char * temp1 = NULL;

- static int cancelled_msg = 0;
char title[80];
int code = 0;
struct copy_file COPY_FILE;

--- 355,360 ----
***************
*** 284,290 ****



/* Fail if no mailer available */
if (!mailer_info)
! return 0;

/* free_mailing_headers will free this */
if (!headers->env_from)

--- 366,372 ----



/* Fail if no mailer available */
if (!mailer_info)
! return;

/* free_mailing_headers will free this */
if (!headers->env_from)
***************

*** 312,339 ****
*/

page = new_menu_context();
! if (! batch_only)


menu_ClearScreen(page);

- /** if possible, let's try to recall the last message? **/
-
- if (! batch_only && copy_msg != FORM && user_level != 0) {
- DPRINT(Debug,8,(&Debug,
- "Checking if there is cancelled message for name %s (cancelled_msg is%s set)\n",
- cur_editfile,
- cancelled_msg ? "" : " not"
- ));
- retransmit = recall_last_msg(cur_editfile, copy_msg, &cancelled_msg,
- &already_has_text,
- page);
- if (retransmit)

- cur_editcharset = display_charset; /* ???? FIXME */
- }
-
-

/** if we're not retransmitting, create the file.. **/

- if (! retransmit) {
if ((reply = safeopen_rdwr(cur_editfile)) == NULL) {
err = errno;
DPRINT(Debug,1,(&Debug,
--- 394,404 ----
*/

page = new_menu_context();
! if (OPMODE_IS_INTERACTIVE(opmode))
menu_ClearScreen(page);



/** if we're not retransmitting, create the file.. **/

if ((reply = safeopen_rdwr(cur_editfile)) == NULL) {
err = errno;
DPRINT(Debug,1,(&Debug,
***************
*** 346,357 ****


goto fail_label;

}
- }

(void) elm_chown(cur_editfile, userid, groupid);

/* copy the message from standard input */
! if (batch_only) {

cur_editcharset = system_charset;
while (0 < (line_len = fread(very_long_buffer, 1,
--- 411,421 ----
goto fail_label;

}

(void) elm_chown(cur_editfile, userid, groupid);

/* copy the message from standard input */
! if (OPMODE_SEND_BATCH == opmode) {

cur_editcharset = system_charset;
while (0 < (line_len = fread(very_long_buffer, 1,
***************
*** 384,390 ****


"Could not open file %s."),
included_file);

! return(need_redraw);
}

cur_editcharset = system_charset; /* Is correct? */

--- 448,456 ----


"Could not open file %s."),
included_file);

! if (need_redraw)
! menu_trigger_redraw(parent_page);
! return;
}

cur_editcharset = system_charset; /* Is correct? */
***************

*** 402,421 ****
&attachments, NULL);



if (mailbox && mail_index >= 0 &&

! (copy_msg || forwarding)) {


struct header_rec * hdr = NULL;

FILE * mailbox_file = NULL;


! if (!give_message_data(mailbox,mail_index,
&hdr,&mailbox_file,NULL,
mime_parse_routine)) {

DPRINT(Debug,4,(&Debug,
! "Failed to retrieve original mail for replying/forwarding\n"));

!

! fclose(reply); reply = NULL;

goto fail_label;
}

--- 468,495 ----
&attachments, NULL);



if (mailbox && mail_index >= 0 &&

! (copy_msg || forwarding) ||
! copy_selection) {

struct header_rec * hdr = NULL;

FILE * mailbox_file = NULL;

+ struct MailboxView * W = mailbox;
+ int Wi = mail_index;
+
+ if (copy_selection) {
+ W = selection_view;
+ Wi = selection_idx;
+ }

! if (!give_message_data(W,Wi,
&hdr,&mailbox_file,NULL,
mime_parse_routine)) {

DPRINT(Debug,4,(&Debug,
! "Failed to retrieve original mail for replying/forwarding/canceled mail\n"));



+ fclose(reply); reply = NULL;
+
goto fail_label;
}

***************
*** 445,456 ****
rename(fname, cur_editfile);

cur_editcharset = system_charset; /* FIXME: Is correct? */

! } else if (! retransmit) { /* if retransmit we have it! */

struct string * From_buffer = gen_From_buffer(hdr);

if (!cur_editcharset)
cur_editcharset = display_charset;

-

if (!mime_attach) {

if (edit_message && mailbox_file) {
--- 519,531 ----
rename(fname, cur_editfile);

cur_editcharset = system_charset; /* FIXME: Is correct? */

! } else if (
! (forwarding || mime_attach || copy_msg)) {

struct string * From_buffer = gen_From_buffer(hdr);

+

if (!cur_editcharset)
cur_editcharset = display_charset;

if (!mime_attach) {

if (edit_message && mailbox_file) {
***************
*** 536,547 ****


add_Attachments(&attachments,&attach);
}
}
if (From_buffer)
free_string(&From_buffer);
- }

! }

if (!cur_editcharset)
cur_editcharset = display_charset;

--- 611,889 ----

!

! }
!
!

! if (!mime_get_param("charset",buffer,hdr->mime_rec.type_opts,sizeof buffer)) {
! DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
! goto fail1;
! }
!
! cur_editcharset = MIME_name_to_charset(buffer,0);
! if (!cur_editcharset) {
! DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! buffer));
! goto fail1;
! }
!
! if (charset_superset_of(display_charset,cur_editcharset)) {
! DPRINT(Debug,4, (&Debug,
! "charset parameter %s (%s) is subset of display charset %s\n",
! cur_editcharset->MIME_name ?
! cur_editcharset->MIME_name :
! "<no MIME name>",
! buffer,
! display_charset->MIME_name ?

! display_charset->MIME_name :


! "<no MIME name>"));

! cur_editcharset = display_charset;
! }
!

! }
!
!

! if (!mime_get_param("charset",buffer,z->type_opts,sizeof buffer)) {
! DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
! goto fail2;
! }
!
! cur_editcharset = MIME_name_to_charset(buffer,0);
! if (!cur_editcharset) {
! DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! buffer));
! goto fail2;
! }
!
! if (charset_superset_of(display_charset,cur_editcharset)) {
! DPRINT(Debug,4, (&Debug,
! "charset parameter %s (%s) is subset of display charset %s\n",
! cur_editcharset->MIME_name ?

! cur_editcharset->MIME_name :
! "<no MIME name>",
! buffer,
! display_charset->MIME_name ?

! display_charset->MIME_name :


! "<no MIME name>"));

! cur_editcharset = display_charset;
! }
!

! DPRINT(Debug,4, (&Debug,
! "Added first part of mail to editing buffer\n"));
!
! fail2:
!
! /* Start attachments from second part */

! s = 1;


!
! }
!
! }
!

! for (x = s; x < c; x++) {

! mime_t attach;
!

! z = mime_parser_index(hdr->mime_rec.parser_data,x);
! if (!z) {
! DPRINT(Debug,4, (&Debug,
! "Failed to get part %d/%d\n",
! x,c));
! continue;
! }
!
! if (!z->TYPE) {
! DPRINT(Debug,4, (&Debug,
! "No type on part %d/%d\n",
! x,c));
! continue;
! }

!
! mime_t_zero(&attach);
!

! attach.pathname = mmsg_copy_part(mailbox_file,z,
! NULL,0);
! if (!attach.pathname) {
! DPRINT(Debug,4, (&Debug,
! "Failed to copy part %d/%d\n",
! x,c));
! continue;
! }
!

! attach.unlink = 1; /* mark for later deletion */

! attach.TYPE = z->TYPE;
! attach.encoding = z->encoding;
! attach.disposition = z->disposition;
!
! if (z->description) {
! attach.description = dup_string(z->description);
! }
!
! if (z->type_opts) {
! attach.type_opts = safe_strdup(z->type_opts);
! }
!
! if (z->disposition_opts) {
! attach.disposition_opts = safe_strdup(z->disposition_opts);
! }
!
! add_Attachments(&attachments,&attach);
!
! DPRINT(Debug,4, (&Debug,
! "Added part %d/%d\n",
! x,c));

!
!
! }
!
!

! /* 3) Add just whole mail as attachment */
! } else {
!

! mime_t attach;
!
! mime_t_zero(&attach);
!

! attach.pathname = mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
! NULL,0);
! if (!attach.pathname) {
! DPRINT(Debug,4, (&Debug,
! "Failed to copy messge \n"));
! goto fail1;
! }
!

! attach.unlink = 1; /* mark for later deletion */

! attach.TYPE = hdr->mime_rec.TYPE;
! attach.encoding = hdr->mime_rec.encoding;
! attach.disposition = hdr->mime_rec.disposition;
!
! if (hdr->mime_rec.description) {
! attach.description =
! dup_string(hdr->mime_rec.description);
! }
!
! if (hdr->mime_rec.type_opts) {
! attach.type_opts = safe_strdup(hdr->mime_rec.type_opts);
! }
!
! if (hdr->mime_rec.disposition_opts) {
! attach.disposition_opts =
! safe_strdup(hdr->mime_rec.disposition_opts);
! }
!
! add_Attachments(&attachments,&attach);
!
! DPRINT(Debug,4, (&Debug,

! "Added message\n"));
!
! }


!
! if (delete_cancel)
! delete_current_cancel(selection_view,mailbox_file);
!
! fail1:
! if (all_headers)
! delete_headers(&all_headers);

!
! }
!
! }
!

+ fail0:
+

if (!cur_editcharset)
cur_editcharset = display_charset;

***************

*** 550,556 ****


int i;

for (i = 0; i < attach_files.attachment_count; i++) {
! add_Attachments(&attachments,&attach_files.attach_files[i]);
/* add_Attachments zeros attach_files.attach_files[i],
so array can be fre'ed later
*/

--- 892,898 ----


int i;

for (i = 0; i < attach_files.attachment_count; i++) {
! add_Attachments(& attachments,&attach_files.attach_files[i]);
/* add_Attachments zeros attach_files.attach_files[i],
so array can be fre'ed later
*/
***************

*** 569,575 ****


strcmp(editor_val,"builtin") != 0 &&

strcmp(editor_val,"none") != 0)) {

signature_done = TRUE;
! if (!retransmit && copy_msg != FORM)

already_has_text |= append_sig(reply, headers, page);
}
}

--- 911,917 ----


strcmp(editor_val,"builtin") != 0 &&

strcmp(editor_val,"none") != 0)) {

signature_done = TRUE;
! if (copy_msg != FORM)

already_has_text |= append_sig(reply, headers, page);
}
}

***************
*** 613,619 ****


#endif

/* Now .mailheaders is read before mail is composed! */

! import_mailheaders(headers);

do { /* So we can return here if check_for_multipart() fails
* - K E H <hurtt...@ozone.FMI.FI> */

--- 955,962 ----


#endif

/* Now .mailheaders is read before mail is composed! */

! if (!copy_selection)
! import_mailheaders(headers);

do { /* So we can return here if check_for_multipart() fails
* - K E H <hurtt...@ozone.FMI.FI> */
***************

*** 622,628 ****
reask_verify = 0;

/* ask the user to confirm transmission of the message */
! if (!batch_only) {
fatal_label:
ch = (edit_message? 'e' : '\0');
code = verify_transmission(cur_editfile, &form, &need_redraw,
--- 965,971 ----
reask_verify = 0;

/* ask the user to confirm transmission of the message */
! if (OPMODE_IS_INTERACTIVE(opmode)) {
fatal_label:
ch = (edit_message? 'e' : '\0');
code = verify_transmission(cur_editfile, &form, &need_redraw,
***************
*** 641,652 ****


if (-2 == code && !attachments.attachment_count) {
goto fail_label;
}
- if (form == YES && format_form(cur_editfile) < 1) {
- cancelled_msg = (bytes(cur_editfile) > 0);
-
- goto fail_label;
- }

-

}

err = can_open(cur_editfile,"r+");

--- 984,989 ----
***************
*** 677,683 ****


* takes account of 8-bit data on signature
*/

! if (!signature_done && !retransmit && copy_msg != FORM) {
/* Go to the end of the file! */
fseek (reply, 0, 2);
append_sig(reply, headers, page);

--- 1014,1020 ----


* takes account of 8-bit data on signature
*/

! if (!signature_done && copy_msg != FORM) {
/* Go to the end of the file! */
fseek (reply, 0, 2);
append_sig(reply, headers, page);
***************

*** 707,743 ****
if (allow_no_hdrencoding && headers->subject)


MIME_info.need_enc |= check_8bit_string (headers->subject);
#endif
-
- if (code < 0) {
- cancelled_msg = (bytes(cur_editfile) > 0);
- DPRINT(Debug,8,(&Debug,

- "Message %s was%s cancelled ...\n",
- cur_editfile, cancelled_msg ? "": " not"));
-
- } else if (headers->to.addrs_len < 1 &&
- headers->cc.addrs_len < 1 &&
- headers->bcc.addrs_len < 1) {
-

- cancelled_msg = (bytes(cur_editfile) > 0);
-

- if (cancelled_msg)
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoRecipientsKeptMessage,
- "No recipients specified! Message kept."));
- else
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoRecipients,
- "No recipients specified!"));
-
- code = -1;


-
- } else
- cancelled_msg = FALSE; /* it ain't cancelled, is it? */

if (check_for_multipart(reply, &MIME_info,mailer_info) < 0) {
/* Error in [include ...] */

if (code < 0)
goto fail_label;

! if (!batch_only) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFixInclude,
"Please fix [include ...] lines!"));
edit_message = FALSE;
--- 1044,1056 ----
if (allow_no_hdrencoding && headers->subject)


MIME_info.need_enc |= check_8bit_string (headers->subject);
#endif

if (check_for_multipart(reply, &MIME_info,mailer_info) < 0) {
/* Error in [include ...] */

if (code < 0)
goto fail_label;

! if (OPMODE_IS_INTERACTIVE(opmode)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFixInclude,
"Please fix [include ...] lines!"));
edit_message = FALSE;
***************
*** 759,766 ****
temp1 = NULL;


if (code < 0)
goto fail_label;

! if (batch_only)
! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */
edit_message = FALSE;


reask_verify = TRUE; /* Go to verify_transmission again. */

continue;
--- 1072,1079 ----
temp1 = NULL;


if (code < 0)
goto fail_label;

! if (! OPMODE_IS_INTERACTIVE(opmode))


! leave(0);
edit_message = FALSE;

reask_verify = TRUE; /* Go to verify_transmission again. */

continue;
***************
*** 783,790 ****
page)) {


if (code < 0)
goto fail_label;

! if (batch_only)


! leave(0, &current_mailbox,&current_aliaslist); /* ???? global reference */
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedConvertMessage,
"Failed convert message, fix errors and retry or f)orget it"));

reask_verify = TRUE; /* Go to verify_transmission again. */

--- 1096,1103 ----
page)) {


if (code < 0)
goto fail_label;

! if (! OPMODE_IS_INTERACTIVE(opmode))


! leave(0);
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedConvertMessage,
"Failed convert message, fix errors and retry or f)orget it"));

reask_verify = TRUE; /* Go to verify_transmission again. */

***************
*** 793,799 ****
MIME_info.msg_is_multipart = MIME_info.top_parts_count > 1;

/* End of check_for_multipart failure loop */
! } while (!batch_only && reask_verify);

if (MIME_info.msg_is_multipart) {
(void) mime_generate_boundary (MIME_info.mime_boundary,
--- 1106,1112 ----
MIME_info.msg_is_multipart = MIME_info.top_parts_count > 1;

/* End of check_for_multipart failure loop */
! } while (OPMODE_IS_INTERACTIVE(opmode) && reask_verify);

if (MIME_info.msg_is_multipart) {
(void) mime_generate_boundary (MIME_info.mime_boundary,
***************
*** 827,864 ****

--- 1140,1180 ----


headers->sender));
}

! if (code == -1 /* Forget */ ||
! code < 0 && MIME_info.msg_is_multipart) {
!
! struct MailboxView *cm = give_canceled_mail();
!
! char * lbuf = NULL;
int i;
out_state_t fp_copy;

! FILE *F = NULL;

! time_t now = time(NULL);


out_state_clear(&fp_copy,STATE_out_file);

! if (cm)
! F = add_canceled_mail(&lbuf,headers,cm,now,-1,NULL,
! -1L);
!
! if (!F) {
! if (lbuf)
! free(lbuf);
!
! lbuf = elm_message(FRM("%s/%s"),
! home, dead_letter);
!
! F = safeopen_rdwr(lbuf);

! } else {


! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmVfyMessageKept1,
! "Message kept. Can be restored at next m)ail command."));
! }
!
! DPRINT(Debug,4,(&Debug, "Writing canceled mail to %s\n",
! lbuf));
!
! if (NULL != F) {
set_out_state_file(F,&fp_copy);
write_header_info(&fp_copy,headers,(form == YES),TRUE,
&MIME_info);
***************

*** 870,875 ****
--- 1186,1197 ----


if (F)
fclose(F);

+ if (lbuf) {
+
+ if (last_canceled_mail)
+ free(last_canceled_mail);
+ last_canceled_mail = lbuf;
+ }
} else {

struct mail_send_state * mailer = NULL;

***************
*** 904,910 ****
fclose(reply);
reply = NULL;

! if (!batch_only)
goto fatal_label;

goto fail_label;
--- 1226,1232 ----
fclose(reply);
reply = NULL;

! if (OPMODE_IS_INTERACTIVE(opmode))
goto fatal_label;

goto fail_label;
***************
*** 925,931 ****
fclose(reply);
reply = NULL;

! if (!batch_only)
goto fatal_label;

goto fail_label;
--- 1247,1253 ----
fclose(reply);
reply = NULL;

! if (OPMODE_IS_INTERACTIVE(opmode))
goto fatal_label;

goto fail_label;
***************
*** 955,961 ****
hdr->status_chgd = TRUE;
} else {
DPRINT(Debug,8,(&Debug,


! "Not adding replied mark -- getiing header failed\n"));
}

} else {
--- 1277,1283 ----
hdr->status_chgd = TRUE;
} else {
DPRINT(Debug,8,(&Debug,
! "Not adding replied mark -- getting header failed\n"));
}

} else {
***************
*** 970,975 ****
--- 1292,1300 ----



fail_label:

+ if (delete_cancel)
+ sync_canceled_mails(selection_view);
+
free_Attachments(&attachments);

if (converted_buffer)
***************

*** 984,996 ****


* file just hang after we're finished with it.
*/

! if (cancelled_msg) {
! DPRINT(Debug,8,(&Debug,"Keeping %s (was cancelled)\n",
! cur_editfile));
! } else if (0 ==unlink (cur_editfile)) {
! DPRINT(Debug,8,(&Debug,"Removing %s (was not cancelled)\n",
cur_editfile));

! }

#ifdef USE_PGP
pgp_status=0;
--- 1309,1318 ----


* file just hang after we're finished with it.
*/

! if (0 ==unlink (cur_editfile)) {
! DPRINT(Debug,8,(&Debug,"Removing %s\n",
cur_editfile));

! }

#ifdef USE_PGP
pgp_status=0;
***************
*** 1002,1008 ****


if (page)
erase_menu_context(&page);

! return(1);
}

static void mail_sent (fd,title,rs,ret,exit_code)

--- 1324,1332 ----
if (page)
erase_menu_context(&page);

! if (parent_page)


! menu_trigger_redraw(parent_page);
! return;
}

static void mail_sent (fd,title,rs,ret,exit_code)
***************

*** 1040,1060 ****


}
}

! int mail_form(mail_index, address, subj, mailbox, aview)

int mail_index;
struct addr_item *address;
char *subj;
struct MailboxView *mailbox;
struct AliasView *aview;
{

- int res;
-
struct mailing_headers headers;
struct expanded_address A;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return 0;

zero_mailing_headers(&headers);
zero_expanded_address(&A);

--- 1364,1383 ----


}
}

! void mail_form(mail_index, address, subj, mailbox, aview, page)

int mail_index;
struct addr_item *address;
char *subj;
struct MailboxView *mailbox;
struct AliasView *aview;

+ struct menu_context *page;
{
struct mailing_headers headers;
struct expanded_address A;
struct mailer_info *mailer_info = get_mailer_info();

if (!mailer_info)
! return;

zero_mailing_headers(&headers);
zero_expanded_address(&A);
***************

*** 1064,1134 ****
addr_to_expanded(&A,address,mailer_info,aview);
copy_expanded_address(&headers.to, A);


! res = mail(mail_index,MAIL_ISFORM,NO, &headers,mailer_info,
! mailbox /* save_copy needs */,

- sleep((sleepmsg + 1) / 2);


- ch = 0;
- }
- } while (ch == 0);
-
- FlushBuffer();
-
- *cancelled_msg = 0;
- }
-
- return(retransmit);
- }

void dsn_menu P_((int *));
void dsn_menu(dsn)

--- 1387,1406 ----
addr_to_expanded(&A,address,mailer_info,aview);
copy_expanded_address(&headers.to, A);

! mail(mail_index,MAIL_ISFORM,NO, &headers,mailer_info,


! mailbox /* save_copy needs */,

! aview, page,
! NULL, -1);
!
! /* mail() does menu_trigger_redraw() do not need to reexamine */
!
free_expanded_address(&A);
free_mailing_headers(&headers);
free_mailer_info(&mailer_info);

! return;
}


void dsn_menu P_((int *));
void dsn_menu(dsn)
***************

*** 1165,1185 ****


if (DSN_NEVER & *dsn) { success = 0; failure = 0; delay = 0; }
}

! generic_menu(dsn_items,sizeof dsn_items / sizeof (struct menu_item),
"DSN (Delivery Status Notification) Configuration",
! "DSN: ");

! if (DSN_off) *dsn = 0;
! else if (!success && !failure && !delay) *dsn = DSN_NEVER;
! else {
! int val = 0;
! if (hdr_only) val |= DSN_HDRS;
! else val |= DSN_FULL;

! if (success) val |= DSN_SUCCESS;
! if (failure) val |= DSN_FAILURE;
! if (delay) val |= DSN_DELAY;
!
! *dsn = val;
}
}

--- 1437,1458 ----


if (DSN_NEVER & *dsn) { success = 0; failure = 0; delay = 0; }
}

! if (generic_menu(dsn_items,sizeof dsn_items / sizeof (struct menu_item),
"DSN (Delivery Status Notification) Configuration",
! "DSN: ")) {

! if (DSN_off) *dsn = 0;

! else if (!success && !failure && !delay) *dsn = DSN_NEVER;
! else {
! int val = 0;
! if (hdr_only) val |= DSN_HDRS;
! else val |= DSN_FULL;

! if (success) val |= DSN_SUCCESS;
! if (failure) val |= DSN_FAILURE;
! if (delay) val |= DSN_DELAY;
!
! *dsn = val;
! }
}
}

***************

*** 1217,1223 ****


/* NOTE: Currently alias expansion is not possble */

ret = optionally_enter2(page,
! &buffer,LINES-2, 0, OE_REDRAW_MARK,
CATGETS(elm_msg_cat, ElmSet,
ElmPreSEnvFromPrompt,
"Return-path: "));

--- 1490,1498 ----


/* NOTE: Currently alias expansion is not possble */

ret = optionally_enter2(page,

! &buffer,LINES-2, 0,

! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet,
ElmPreSEnvFromPrompt,
"Return-path: "));
***************

*** 1230,1238 ****
--- 1505,1519 ----


free(s);
}

+ if (buffer)
+ free_string(&buffer);
+
if (ret == REDRAW_MARK)
return REDRAW_MARK;

+ if (0 != ret) /* Error or Ctrl-C */
+ return 1;
+
ClearLine(5);

t = mailer_env_from_value(headers->env_from,&can_edit);
***************

*** 1459,1465 ****


if (bad_cmd) {
Write_to_screen(FRM("%c??"), 07);
if (sleepmsg > 0)
! sleep((sleepmsg + 1) / 2);
bad_cmd = FALSE;
}

--- 1740,1746 ----


if (bad_cmd) {
Write_to_screen(FRM("%c??"), 07);
if (sleepmsg > 0)
! error_sleep((sleepmsg + 1) / 2);
bad_cmd = FALSE;
}

***************

*** 1495,1506 ****


}

if (cmd == EOF)
! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */
#ifdef ASCII_CTYPE
if (isascii(cmd))
#endif

cmd = tolower((unsigned char)cmd);
did_prompt = TRUE;
}

switch (cmd) {
--- 1776,1791 ----


}

if (cmd == EOF)
! leave(0);
#ifdef ASCII_CTYPE
if (isascii(cmd))
#endif

cmd = tolower((unsigned char)cmd);
did_prompt = TRUE;
+ clear_error();
+
+ /* Put cursor pack to correct place */
+ MoveCursor(x_coord, y_coord);
}

switch (cmd) {
***************

*** 1519,1524 ****
--- 1804,1810 ----



attach_menu(NULL,NULL,attachments,display_charset,mailer_info,
NULL, aview);
+ do_redraw = 1;
break;

case 'd':
***************

*** 1528,1534 ****


if (did_prompt)
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuDsn,
"Dsn"));
! if (dsn) dsn_menu(dsn);
}
break;

--- 1814,1823 ----


if (did_prompt)
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuDsn,
"Dsn"));
! if (dsn) {
! dsn_menu(dsn);

! do_redraw = 1;
! }
}

break;

***************
*** 1586,1601 ****


if (bytes(filename) <= 0) {
; /* forget about empty files */
return -2;
! } else if (mail_only) {
!
! } else if (user_level > 0) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmVfyMessageKept,
! "Message kept. Can be restored at next f)orward, m)ail or r)eply."));
! DPRINT(Debug,8,(&Debug,
! "Cancelled message stored with name %s\n",
! filename));
!
! }
return -1;
/*NOTREACHED*/

--- 1875,1881 ----


if (bytes(filename) <= 0) {
; /* forget about empty files */
return -2;
! }
return -1;
/*NOTREACHED*/

***************

*** 1661,1668 ****


Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmVfyNoFieldsInForm,
"No fields in form!\007"));
! if (sleepmsg > 0)
! sleep(sleepmsg);
break;
default:
/* looks like a good form */

--- 1941,1947 ----


Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmVfyNoFieldsInForm,
"No fields in form!\007"));
! sleep_message();
break;
default:
/* looks like a good form */
***************

*** 1696,1702 ****

#ifdef ALLOW_SUBSHELL
case '!':


! if (subshell(NULL, page) != 0) {
menu_ClearScreen(page);
*need_redraw_p = TRUE;
do_redraw = 1;

--- 1975,1982 ----



#ifdef ALLOW_SUBSHELL
case '!':
! subshell(NULL, page);

! if (menu_need_redraw(page)) {


menu_ClearScreen(page);
*need_redraw_p = TRUE;
do_redraw = 1;

***************
*** 1776,1782 ****


assumes that anything the user sends is part of the
message body unless either:
1. the "-s" flag is used (although it doesn't seem
! to be supported on all implementations?? )
2. the first line is "Subject:". If so, then it'll
read until a blank line and assume all are meant
to be headers.

--- 2056,2062 ----


assumes that anything the user sends is part of the
message body unless either:
1. the "-s" flag is used (although it doesn't seem
! to be supported on all implementations? )
2. the first line is "Subject:". If so, then it'll
read until a blank line and assume all are meant
to be headers.

***************
*** 2120,2126 ****
if (!lsig || !rsig)
error_wait();



! if (!batch_only && (lsig || rsig)) {

char filename2[SLEN];
char *sig = "";

--- 2400,2406 ----
if (!lsig || !rsig)
error_wait();

! if (OPMODE_SEND_BATCH != opmode && (lsig || rsig)) {



char filename2[SLEN];
char *sig = "";

Index: elmME+.2.5.alpha2-cvs/src/Makefile.SH
*** elmME+.2.5.alpha1/src/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/Makefile.SH 2004-08-07 21:07:17.000000000 +0300
***************
*** 31,37 ****

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.50.20.1 2004/04/18 16:55:42 hurtta Exp $
#


# Makefile for the ELM mail program.
#

--- 31,37 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.50.20.2 2004/08/07 18:07:17 hurtta Exp $
#


# Makefile for the ELM mail program.
#

***************
*** 112,117 ****


--- 112,118 ----
browser.c \
builtin++.c \
calendar.c \
+ canceled.c \
date.c \
delete.c \
digest.c \
***************
*** 173,178 ****
--- 174,180 ----
browser.o \
builtin++.o \
calendar.o \
+ canceled.o \
date.o \
delete.o \
digest.o \
***************

*** 331,336 ****
--- 333,339 ----


browser.o: def_elm.h $(INCLDIR)/s_elm.h
builtin++.o: def_elm.h
calendar.o: def_elm.h
+ canceled.o: def_elm.h $(INCLDIR)/s_elm.h
date.o: def_elm.h
delete.o: def_elm.h $(INCLDIR)/s_elm.h
digest.o: def_elm.h $(INCLDIR)/s_elm.h
***************

*** 351,357 ****


limit.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_aliases.h
lock.o: def_elm.h $(INCLDIR)/s_elm.h
mailmsg1.o: def_elm.h $(INCLDIR)/s_elm.h
! mailmsg2.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/menu2.h
menu2.o: def_elm.h $(INCLDIR)/menu2.h
menu.o: def_elm.h $(INCLDIR)/menu.h
metapager.o: def_elm.h $(INCLDIR)/s_elm.h

--- 354,360 ----


limit.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_aliases.h
lock.o: def_elm.h $(INCLDIR)/s_elm.h
mailmsg1.o: def_elm.h $(INCLDIR)/s_elm.h
! mailmsg2.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/menu2.h $(INCLDIR)/s_me.h
menu2.o: def_elm.h $(INCLDIR)/menu2.h
menu.o: def_elm.h $(INCLDIR)/menu.h
metapager.o: def_elm.h $(INCLDIR)/s_elm.h

Index: elmME+.2.5.alpha2-cvs/src/menu2.c
*** elmME+.2.5.alpha1/src/menu2.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/menu2.c 2004-07-19 12:20:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: menu2.c,v 1.10 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: menu2.c,v 1.10.8.1 2004/07/19 09:20:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 73,84 ****


return 0;
}

! void generic_menu (items, max, title, prompt)
struct menu_item items[];
int max;
char *prompt, *title;
{
! short i = 0;
char buf[STRING], buf2[STRING];
int ch;
short update = TRUE;

--- 73,85 ----


return 0;
}

! int generic_menu (items, max, title, prompt)
struct menu_item items[];
int max;
char *prompt, *title;
{
! int ret = 1;
! short i = 0;
char buf[STRING], buf2[STRING];
int ch;
short update = TRUE;
***************
*** 133,149 ****

ch = precmd;
precmd = 0;
} else


! ch = menu_ReadCh (page, REDRAW_MARK|READCH_resize);

! if (EOF == ch)
! return;
switch (ch) {
case RESIZE_MARK:

DPRINT(Debug,4, (&Debug, " .... resizing\n"));
goto resize_mark;


case '\n':
! return;
case REDRAW_MARK:
update = TRUE;
break;

--- 134,158 ----
ch = precmd;
precmd = 0;
} else
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_resize|READCH_sig_char);

! if (ch == TERMCH_interrupt_char) {
! ret = 0;
! goto OUT;
! }
!
! if (EOF == ch) {
! ret = 0;


! goto OUT;
! }
switch (ch) {
case RESIZE_MARK:

DPRINT(Debug,4, (&Debug, " .... resizing\n"));
goto resize_mark;

case '\n':
! ret = 1;


! goto OUT;
case REDRAW_MARK:
update = TRUE;
break;
***************

*** 153,160 ****
int code = do_item (&items[i], page);
if (REDRAW_MARK == code)
precmd = ch;


! if (-1 == code)

! return;
update = TRUE;
break;
}

--- 162,170 ----
int code = do_item (&items[i], page);
if (REDRAW_MARK == code)


precmd = ch;
! if (-1 == code) {
! goto OUT;
! }
update = TRUE;
break;
}

***************
*** 166,173 ****
int code = do_item (&items[i], page);
if (REDRAW_MARK == code)
precmd = ch;


! if (-1 == code)

! return;
update = TRUE;
break;
}

--- 176,184 ----
int code = do_item (&items[i], page);
if (REDRAW_MARK == code)


precmd = ch;
! if (-1 == code) {
! goto OUT;
! }
update = TRUE;

break;
}
***************
*** 178,183 ****

--- 189,195 ----



OUT:
erase_menu_context(&page);
+ return ret;
}

/*

Index: elmME+.2.5.alpha2-cvs/src/messages/canceled_mail.c


*** /tmp/29622-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-15 20:45:40.000000000 +0300

--- elmME+.2.5.alpha2-cvs/src/messages/canceled_mail.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 0 ****
--- 1,1955 ----
+ static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.8.2.1 2004/08/07 18:07:19 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.8.2.1 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+
+ #include "def_messages.h"
+ #include "s_elm.h"
+ #include "s_me.h"
+
+ DEBUG_VAR(Debug,__FILE__,"messages");
+
+ #if ANSI_C


+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+
+ #include <errno.h>
+ #ifndef ANSI_C
+ extern int errno;
+ #endif

+

+ mbx->u.canceldir->last_open_file = NULL;
+
+ }
+

+ S_(mt_free_mailbox mt_free_canceldir)
+ static void mt_free_canceldir P_((struct MailboxView *mbx));
+ static void mt_free_canceldir(mbx)
+ struct MailboxView *mbx;
+ {
+
+ if (mbx->u.canceldir->dirname) {
+ free(mbx->u.canceldir->dirname);

+ mbx->u.canceldir->dirname = NULL;
+ }
+

+ if (mbx->u.canceldir->indexname) {
+ free(mbx->u.canceldir->indexname);

+ mbx->u.canceldir->indexname = NULL;
+ }
+

+ if (mbx->u.canceldir->index_F) {
+
+ fflush(mbx->u.canceldir->index_F);
+
+ Release_the_file(fileno(mbx->u.canceldir->index_F));
+
+ fclose(mbx->u.canceldir->index_F);

+ mbx->u.canceldir->index_F = NULL;
+ }
+
+ mbx->u.canceldir->cs = NULL;
+

+ if (mbx->u.canceldir->message_list) {
+ int i;
+
+ for (i = 0; i < mbx->u.canceldir->message_list_len; i++) {
+ if (mbx->u.canceldir->message_list[i].filename) {
+ free (mbx->u.canceldir->message_list[i].filename);

+ mbx->u.canceldir->message_list[i].filename = NULL;
+ }
+

+ header_clear ( & ( mbx->u.canceldir->message_list[i].REC) );
+ }
+ }

+ mbx->u.canceldir->message_list_len = 0;
+
+

+ mbx->u.canceldir->last_open_index = -1;
+ if (mbx->u.canceldir->last_open_file) {
+ fclose(mbx->u.canceldir->last_open_file);

+ mbx->u.canceldir->last_open_file = NULL;
+ }
+

+ free(mbx->u.canceldir);
+ mbx->u.canceldir = NULL;
+
+ /* Reset canceled_mail_view -pointer if we are going erase it */
+ if (canceled_mail_view == mbx)
+ canceled_mail_view = NULL;

+ }
+

+ static void mt_make_canceldir_view P_((struct MailboxView *mailbox));
+
+
+ S_(mt_add_mailbox_storage mt_add_canceldir_storage)
+ static void mt_add_canceldir_storage P_((struct MailboxView *mailbox,
+ struct current_storage *storage));
+ static void mt_add_canceldir_storage(mailbox,storage)

+ struct MailboxView *mailbox;
+ struct current_storage *storage;
+ {


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"mt_add_canceldir_storage",
+ "mt_add_canceldir_storage called",0);

+ }
+

+ static int process_index P_((struct MailboxView *view));
+
+ static void unlock_index P_((struct MailboxView *view));
+ static void unlock_index(view)
+ struct MailboxView *view;
+ {
+
+ if (!view->u.canceldir->index_F)
+ return;
+
+ fflush(view->u.canceldir->index_F);
+
+ Release_the_file(fileno(view->u.canceldir->index_F));
+
+ fclose(view->u.canceldir->index_F);

+ view->u.canceldir->index_F = NULL; /* Mark -- no locked */
+ }
+

+ static void update_index P_((struct MailboxView *v));

+ static void add_canceled_mail1 P_((char *filename,


+ struct mailing_headers * headers,

+

+ if (0 != stat(v->u.canceldir->dirname,&dstat)) {
+ DPRINT(Debug,1,(&Debug,"stat %s failed!\n",
+ v->u.canceldir->dirname));
+ dstat.st_mtime = now;
+ }
+
+ if (dstat.st_mtime == v->u.canceldir->last_mtime &&
+ now < v->u.canceldir->last_scan + 60) {
+ DPRINT(Debug,7,(&Debug,"scan %s skipped\n",
+ v->u.canceldir->dirname));

+ return;
+ }
+

+ #endif /* DIROPS == USE_DIRENT */
+ #if DIROPS == USE_SYSDIR

+ char * entryname = safe_malloc(Xptr->d_namlen+1);
+
+
+ strncpy(entryname,Xptr->d_name,Xptr->d_namlen);
+ entryname[Xptr->d_namlen] = '\0';
+ #endif /* DIROPS == USE_SYSDIR */
+
+ fullname = safe_strdup(v->u.canceldir->dirname);
+ fullname = strmcat(fullname,"/");
+ fullname = strmcat(fullname,entryname);
+
+ for (i = 0; i < v->u.canceldir->message_list_len; i++)
+ if ( 0 == strcmp(entryname,
+ v->u.canceldir->message_list[i].filename))

+ goto found;
+

+
+
+ found:


+ free(entryname);
+ free(fullname);
+ }
+ }
+
+ closedir(handle);
+
+ if (v == canceled_mail_view)
+ move_olds(v);
+
+ fail2:
+ if (unlock_it)
+ unlock_index(v);
+ }
+
+
+ #else
+ static void update_index(v)
+ struct MailboxView *v;
+ {
+ /* EMPTY */

+ }
+ #endif
+

+ /* Return 1 if redraw required */
+ S_(mt_update_view_mailbox mt_update_view_canceldir)
+ /* Return 1 if redraw required */
+ static int mt_update_view_canceldir P_((struct MailboxView *mailbox));
+ static int mt_update_view_canceldir(mailbox)

+ struct MailboxView *mailbox;


+ {
+ int count;
+ int i,x;
+
+ update_index(mailbox);
+
+ count = mailbox->u.canceldir->message_list_len;
+
+ if (count != mailbox->view_len) {

+
+ mt_make_canceldir_view(mailbox);
+

+ DPRINT(Debug,7,(&Debug,
+ "mt_update_view_canceldir=1 (%d messages)\n",
+ mailbox->view_len));

+
+ return 1;
+ }
+

+ DPRINT(Debug,7,(&Debug,
+ "mt_update_view_canceldir=0\n"));

+ return 0;
+ }
+

+ S_(mt_get_main_mailbox_folder mt_get_main_canceldir_folder)
+ static struct folder_info * mt_get_main_canceldir_folder P_((struct MailboxView *mailbox));
+ static struct folder_info * mt_get_main_canceldir_folder(mailbox)

+ struct MailboxView *mailbox;
+ {


+ return NULL;
+ }
+

+ /* Can be called from signal handler */
+ S_(mt_get_mailbox_storage mt_get_canceldir_storage)
+ /* Can be called from signal handler */
+ static struct current_storage * mt_get_canceldir_storage P_((struct MailboxView *mailbox,
+ int i));
+ /* Can be called from signal handler */
+ static struct current_storage * mt_get_canceldir_storage(mailbox,i)

+ struct MailboxView *mailbox;
+ int i;
+ {
+

+ return NULL;
+ }
+

+ /* Can be called from signal handler */
+ S_(mt_get_mailbox_storage_count mt_get_canceldir_storage_count)
+ /* Can be called from signal handler */
+ static int mt_get_canceldir_storage_count P_((struct MailboxView *mailbox));
+

+ /* Can be called from signal handler */
+ static int mt_get_canceldir_storage_count(mailbox)
+ struct MailboxView *mailbox;
+ {


+ return 1;
+ }
+

+ static int update_open P_((struct mv_canceldir *d, int idx));
+ static int update_open(d,idx)
+ struct mv_canceldir *d;
+ int idx;
+ {
+ if (d->last_open_index != idx &&

+ d->last_open_file) {
+
+ fclose(d->last_open_file);
+ d->last_open_file = NULL;
+ }
+

+ if (!d->last_open_file) {
+ char * filename = elm_message(FRM("%s/%s"),
+ d->dirname,
+ d->message_list[idx].
+ filename);
+
+ int err = can_open(filename,"r");
+ if (err) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantOpenFile,
+ "Can't open %s!"),
+ filename);
+ free(filename);

+ return 0;
+ }
+

+ d->last_open_file = fopen(filename,"r");
+ if (!d->last_open_file) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantOpenFile,
+ "Can't open %s!"),
+ filename);
+ free(filename);

+ return 0;
+ }


+ d->last_open_index = idx;
+ free(filename);
+
+ } else
+ rewind(d->last_open_file);

+
+ return 1;
+ }
+

+ static int update_header P_((struct mv_canceldir *d, int idx));
+ static int update_header(d,idx)
+ struct mv_canceldir *d;
+ int idx;
+ {
+ struct header_rec *hdr = & (d->message_list[idx].REC);
+
+ if (!update_open(d,idx)) {

+ DPRINT(Debug,10,(&Debug,"update_header: %d -- failed\n",
+ idx));
+
+ return 0;
+ }


+ if (! hdr->body_parsed) {
+ header_list_ptr parsed_headers =
+ file_read_headers(d->last_open_file,0);
+ long content_start;
+
+
+ if (!parsed_headers) {
+ DPRINT(Debug,3,(&Debug,

+ "update_header: No headers parsed! \n"));
+ }
+

+ read_folder_headers_helper(hdr,parsed_headers);
+ header_parse_helper(hdr,parsed_headers);
+
+ content_start = ftell(d->last_open_file);
+ start_body_helper(hdr,
+ content_start,parsed_headers);
+
+ delete_headers(&parsed_headers);
+
+ /* start_body_helper is called */

+ hdr->body_parsed = 1;
+
+ }
+

+ DPRINT(Debug,10,(&Debug,"update_header: %d -- OK\n",
+ idx));

+
+
+ return 1;
+ }
+
+

+ S_(mt_give_header_mailbox mt_give_header_canceldir)
+ static struct header_rec * mt_give_header_canceldir P_((struct MailboxView *mailbox,
+ int index,
+ struct folder_view *v));
+ static struct header_rec * mt_give_header_canceldir(mailbox,index,v)

+ struct MailboxView *mailbox;


+ int index;
+ struct folder_view *v;
+ {
+ int mbx,idx;
+
+ mbx = v->mailbox_number;
+ if (mbx != 0)

+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "mt_give_header_canceldir",
+ "Bad mailbox number",0);
+
+ idx = v->index;
+ if (idx < 0 || idx >= mailbox->u.canceldir->message_list_len)

+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ struct MailboxView *mailbox;
+ hdr_compare_func *func;
+ {
+ int i;

+ struct MailboxView *mailbox;


+ int index;
+ struct header_rec **ret_header;
+ FILE **ret_F;
+ struct counter_data *counter;
+ parse_mime_callback *parse_mime;
+ struct folder_view *v;
+ {

+ struct header_rec *hdr;
+

+ int mbx,idx;
+
+ mbx = v->mailbox_number;

+ if (mbx != 0) {


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "mt_give_message_data_canceldir",
+ "Bad mailbox number",0);

+ return 0;
+ }
+

+ idx = v->index;

+ if (idx < 0 || idx >= mailbox->u.canceldir->message_list_len) {


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "mt_give_message_data_canceldir",
+ "Bad internal index",0);

+ return 0;
+ }
+

+ hdr = & (mailbox->u.canceldir->message_list[idx].REC);
+
+ /* hdr is also needed on error messages ... */
+ if (ret_header) {
+
+ if (-1 == hdr->mime_rec.begin_offset)
+ update_header(mailbox->u.canceldir,idx);
+ *ret_header = hdr;
+
+ DPRINT(Debug,10,(&Debug,"mt_give_message_data_canceldir: %d -- giving header\n",
+ idx));

+
+ }
+

+ if (ret_F) {
+
+ if (!update_header(mailbox->u.canceldir,idx)) {
+ DPRINT(Debug,6,(&Debug,"mt_give_message_data_canceldir: %d failed\n",
+ idx));

+ return 0;
+ }
+

+
+ /* Simulate prepare_message_access */
+
+ if (! hdr->mime_parsed &&
+ parse_mime == NO_mime_parse) {
+ DPRINT(Debug,10,(&Debug,
+ "mt_give_message_data_canceldir: mime structure not needed\n"));
+ } else if (! hdr->mime_parsed) {
+
+ int status;
+
+
+ DPRINT(Debug,10,(&Debug,
+ "mt_give_message_data_canceldir: Need parsing of mime structure (offset %ld)\n",
+ hdr->offset

+ ));
+

+ if (0 != fseek(mailbox->u.canceldir->last_open_file,
+ hdr->offset,
+ SEEK_SET)) {
+
+ DPRINT(Debug,10,(&Debug,
+ "mt_give_message_data_canceldir: seek to %ld failed\n",
+ hdr->offset));

+ return 0;
+ }
+

+ status = parse_mime(NULL,hdr,
+ mailbox->u.canceldir->last_open_file);
+ if (status <= 0) {
+ DPRINT(Debug,10,(&Debug,
+ "mt_give_message_data_canceldir: parse_mime callback failed (%d)\n",
+ status));

+ }
+
+
+
+ }

+
+ rewind(mailbox->u.canceldir->last_open_file);
+ *ret_F = mailbox->u.canceldir->last_open_file;
+

+ DPRINT(Debug,10,(&Debug,"mt_give_message_data_canceldir: %d -- giving file\n",


+ idx));
+
+ }
+

+ DPRINT(Debug,10,(&Debug,"mt_give_message_data_canceldir: %d -- succeed\n",
+ idx));

+
+ return 1;
+ }
+
+

+
+ S_(mt_write_mailbox_info mt_write_canceldir_info)
+ static void mt_write_canceldir_info P_((FILE *fp, struct MailboxView *mailbox,
+ int s, int cur_idx));
+ static void mt_write_canceldir_info(fp,mailbox,s, cur_idx)
+ FILE *fp;

+ struct MailboxView *mailbox;


+ int s;
+ int cur_idx;
+ {
+ /* EMPTY */
+ }
+
+ S_(mt_mailbox_title mt_canceldir_title)
+ static struct string * mt_canceldir_title P_((struct MailboxView *mailbox));
+ static struct string * mt_canceldir_title(mailbox)

+ struct MailboxView *mailbox;


+ {
+
+ if (canceled_mail_view == mailbox) {
+ if (*hostname && menu_display_host)
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmCanceledMailsOn,
+ "Canceled mails on %s"),
+ hostname);
+
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmCanceledMails,

+ "Canceled mails"));
+
+ }
+

+ /* These two should not really be used ... */
+
+ if (*hostname && menu_display_host)
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmMDirectoryOn,
+ "Message directory %s on %s"),
+ mailbox->u.canceldir->dirname,
+ hostname);
+
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmMDirectory,
+ "Message directory %s"),
+ mailbox->u.canceldir->dirname);
+
+ }
+
+ S_(mt_make_mailbox_view mt_make_canceldir_view)
+ static void mt_make_canceldir_view (mailbox)

+ struct MailboxView *mailbox;


+ {
+ int count = mailbox->u.canceldir->message_list_len;
+ int i,x;
+
+
+ if (count < 1) {
+ if (mailbox->view)
+ free(mailbox->view);
+ mailbox->view = NULL;
+ mailbox->view_len = 0;
+

+ return;
+ }
+

+ mailbox->view =
+ safe_realloc(mailbox->view,
+ count * (sizeof ( mailbox->view[0])));
+
+
+ for (x = 0; x < count; x++) {
+ mailbox->view[x].mailbox_number = 0;
+ mailbox->view[x].index = x;
+ }
+ mailbox->view_len = count;
+ }
+
+
+ S_(mt_add_mailbox_digest mt_add_canceldir_digest)
+ static void mt_add_canceldir_digest P_((struct MailboxView *mailbox,
+ mime_t *list,
+ time_t received_time,
+ char *env_from,
+ FILE *F,
+ charset_t defcharset
+ ));
+ static void mt_add_canceldir_digest(mailbox, list, received_time, env_from, F,
+ defcharset
+ )

+ struct MailboxView *mailbox;


+ mime_t *list;
+ time_t received_time;
+ char *env_from;
+ FILE *F;
+ charset_t defcharset;

+ {

+ return 0;
+ }
+

+ view->u.canceldir->index_F =
+ open_or_create(view->u.canceldir->indexname);
+ if (!view->u.canceldir->index_F) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantOpenFile,
+ "Can't open %s!"),
+ view->u.canceldir->indexname);

+ return 0;
+ }
+

+
+ ret = Grab_the_file(fileno(view->u.canceldir->index_F));
+ if (FLOCKING_RETRY == ret) {
+ lib_transient(CATGETS(elm_msg_cat, MeSet, MeLockingFile,
+ "Locking %s..."),
+ view->u.canceldir->indexname);
+ while (FLOCKING_RETRY == ret && count++ < 3) {
+ #if POLL_METHOD
+ wait_for_timeout(1);
+ #else
+ sleep(1);
+ #endif
+ ret = Grab_the_file(fileno(view->u.canceldir->index_F));
+ }
+
+ if (FLOCKING_OK == ret)
+ lib_transient(CATGETS(elm_msg_cat, MeSet, MeLockingFileOK,
+ "Locking %s... OK."),
+ view->u.canceldir->indexname);
+
+ if (FLOCKING_RETRY == ret) {
+ fclose(view->u.canceldir->index_F);
+ view->u.canceldir->index_F = NULL;

+ return 0;
+ }
+ }

+
+ if (FLOCKING_FAIL == ret) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeLockingFileFAIL,
+ "Locking %s... Failed."),
+ view->u.canceldir->indexname);
+
+ fclose(view->u.canceldir->index_F);
+ view->u.canceldir->index_F = NULL;

+ return 0;
+ }
+

+ if ((ret = mail_gets(buffer, sizeof buffer,
+ view->u.canceldir->index_F)) > 0) {
+
+ struct message_list * current = NULL; /* current index */
+
+ if (ret != 12 || 0 != memcmp(buffer,"ELMME+ MIDX\n",12)) {
+
+ DPRINT(Debug,7,(&Debug,
+ "process_index: Bad bagic (len %d): %.*s\n",
+ ret,ret,buffer));
+
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileCorrupted,
+ "File %s is corrupted."),
+ view->u.canceldir->indexname);
+
+ Release_the_file(fileno(view->u.canceldir->index_F));
+
+ fclose(view->u.canceldir->index_F);
+ view->u.canceldir->index_F = NULL;
+

+ return 0;
+ }
+

+ /* malloc_gets reallocates buffer1 and do not return \n.
+ It returns -1 if line is longer than given limit (32000)
+ and -2 is returned on error (buffer may still be alloced)
+ */
+ while (!feof(view->u.canceldir->index_F) &&
+ !ferror(view->u.canceldir->index_F) &&
+ ret >= 0) {
+ char * buffer1 = NULL;
+
+ ret = malloc_gets(&buffer1, 32000, view->u.canceldir->index_F);
+ if (ret < 0 || !buffer1)
+ goto fail;
+
+ if (ret >= 2) {
+
+ if (strcmp("--END",buffer1) == 0) {
+ /* Temporary terminator */
+
+ ret = -2;
+ goto fail;

+ }
+
+

+ if (0 == strncmp(buffer1,"C ",2)) {
+ view->u.canceldir->cs =
+ MIME_name_to_charset(buffer1+2,0);
+ goto next_line;
+ }
+
+ if (!view->u.canceldir->cs ||
+ ' ' != buffer1[1]) {
+
+ DPRINT(Debug,7,(&Debug,
+ "process_index: Bad line (len %d): %.*s\n",
+ ret,ret,buffer1));
+
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileCorrupted,
+ "File %s is corrupted."),
+ view->u.canceldir->indexname);
+ ret = -1;
+ goto fail;
+ }
+
+ switch (buffer1[0]) {
+ case 'F': {
+ char * fname = buffer1+2;

+ int i;
+
+ current = NULL;
+

+ for (i = 0; i < view->u.canceldir->message_list_len; i++)
+ if (0 == strcmp(view->u.canceldir->message_list[i].
+ filename,fname)) {
+ current = & (view->u.canceldir->
+ message_list[i]);
+ DPRINT(Debug,7,(&Debug,
+ "process_index: File %s already on index (%d)\n",
+ fname,i));
+ }

+
+ if (!current) {

+ DPRINT(Debug,7,(&Debug,
+ "process_index: Adding file %s to index\n",
+ fname));
+
+ view->u.canceldir->message_list =
+ safe_realloc(view->u.canceldir->message_list,
+ (view->u.canceldir->message_list_len+1) *
+ sizeof (view->u.canceldir->message_list[0]));
+
+ current = & (view->u.canceldir->
+ message_list[view->u.canceldir->message_list_len++]);
+
+ header_zero( & (current->REC));
+
+ current->filename = safe_strdup(buffer1+2);
+
+
+ /* Charset used by index writing code... */
+ current->REC.header_charset = view->u.canceldir->cs;
+

+ current->REC.offset = 0;
+ }
+ }


+ break;
+
+ case 'L':
+ if (!current) goto bad0;
+ current->REC.lines = atoi(buffer1+2);

+ break;
+

+ case 'T':
+ if (!current) goto bad0;
+ current->REC.received_time = atol(buffer1+2);

+ break;
+

+ case 'E':
+ if (!current) goto bad0;
+ strfcpy(current->REC.env_from,buffer1+2,
+ sizeof (current->REC.env_from));

+ break;
+

+ case 'f':
+ if (!current) goto bad0;
+ if (current->REC.from)
+ break;
+ current->REC.from = break_down_address(buffer1+2,0,view->u.canceldir->cs);

+ break;
+

+ case 't':
+ if (!current) goto bad0;
+ if (current->REC.to)
+ break;
+ current->REC.to = break_down_address(buffer1+2,0,view->u.canceldir->cs);

+ break;
+

+ case 'c':
+ if (!current) goto bad0;
+ if (current->REC.cc)
+ break;
+ current->REC.cc = break_down_address(buffer1+2,0,view->u.canceldir->cs);

+ break;
+

+ case 'M':
+ if (!current) goto bad0;
+ strfcpy(current->REC.messageid,buffer1+2,
+ sizeof (current->REC.messageid));

+ break;
+

+ case 'd':
+ if (!current) goto bad0;
+ current->REC.time_sent = atol(buffer1+2);

+ break;
+

+ case 'S':
+ if (!current) goto bad0;
+ if (current->REC.subject)
+ break;
+ current->REC.subject = hdr_to_string(HDR_TEXT,
+ buffer1+2,
+ view->u.canceldir->cs,
+ 0);

+ break;
+
+ default:

+ bad0:
+
+ DPRINT(Debug,7,(&Debug,
+ "process_index: Bad line or token (len %d): %.*s\n",
+ ret,ret,buffer1));
+
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileCorrupted,
+ "File %s is corrupted."),
+ view->u.canceldir->indexname);
+ ret = -1;
+ goto fail;
+
+ }
+
+ } else if (0 != ret) {
+
+ DPRINT(Debug,7,(&Debug,
+ "process_index: short line (len %d): %.*s\n",
+ ret,ret,buffer1));
+
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileCorrupted,
+ "File %s is corrupted."),
+ view->u.canceldir->indexname);

+ ret = -1;
+ } else
+ current = NULL;
+
+

+ next_line:
+ fail:
+
+ if (buffer1) {
+ free(buffer1);

+ buffer1 = NULL;


+ }
+
+ }
+
+

+
+ } else {
+ /* Initialize file */
+
+ index_initialize(view);

+ }
+
+ return 1;
+
+ }

+
+

+ int err = errno;
+

+ if (ENOENT == err)
+ return;
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet,ElmErrorAccess,
+ "%.45s: %.33s"),
+ dir,error_description(err));
+

+ return;
+ }
+
+ process_index(view);
+ }
+ }
+

+ static struct addr_item *dup_addr_list P_((struct addr_item *list));
+ static struct addr_item *dup_addr_list(list)
+ struct addr_item *list;
+ {
+ int L = 0;
+ struct addr_item *ptr;

+ int i;
+

+ for (ptr=list; ptr->addr && ptr->fullname; ptr++)
+ L++;
+
+
+ ptr = safe_malloc((L+1) * sizeof (ptr[0]));
+
+ for (i = 0; i < L; i++) {
+ ptr[i].addr = safe_strdup(list[i].addr);
+ ptr[i].fullname = dup_string(list[i].fullname);
+ ptr[i].comment = NULL;
+ if (list[i].comment)
+ ptr[i].comment = dup_string(list[i].comment);
+ }
+
+ ptr[i].addr = NULL;
+ ptr[i].fullname = NULL;
+ ptr[i].comment = NULL;
+
+ return ptr;

+ }
+

+ static void write_addr_list P_((FILE *F, struct addr_item *list,
+ charset_t cs, int letter));
+ static void write_addr_list(F,list,cs,letter)

+ FILE *F;

Kari E. Hurtta

unread,
Aug 20, 2004, 1:31:18 PM8/20/04
to
Archive-name: elmME+2.5/PLalpha2.4

Elm ME+ 2.5 PLalpha2

- Is available on ftp.funet.fi

via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha2.patch.gz >
via WWW (1).


1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

Before applying patch catenate parts 1 - 5 first.

This patch (Elm ME+ 2.5 PLalpha2) is agaist Elm ME+ 2.5 PLalpha1.
After that patch apply also Elm ME+ 2.5 PLalpha3 patch.

================================================ ( part 4/5 ) ===============


+ fputs(buffer,F);
+ putc(' ',F);
+ free(buffer);
+ }
+
+ putc('<',F);
+ fputs(ptr->addr,F);

+ putc('>',F);
+

+ if (ptr->comment) {
+ buffer = string_to_hdr(HDR_COMMENT, ptr->comment,

+ cs, 0);
+
+ if (buffer) {

+ putc(' ',F);
+ putc('(',F);
+ fputs(buffer,F);
+ putc(')',F);
+
+ free(buffer);
+ }
+ }
+ }
+ putc('\n',F);

+ }
+

+ static void write_index_rec P_((struct MailboxView *view,
+ struct message_list * current));
+
+ static void write_index_rec(view,current)

+ struct MailboxView *view;

+ if (current->REC.from) {


+ write_addr_list(view->u.canceldir->index_F,
+ current->REC.from,

+ view->u.canceldir->cs,'f');
+ }
+

+ if (current->REC.to) {
+ write_addr_list(view->u.canceldir->index_F,
+ current->REC.to,

+ view->u.canceldir->cs,'t');
+ }
+

+ if (current->REC.cc) {
+ write_addr_list(view->u.canceldir->index_F,
+ current->REC.cc,

+ view->u.canceldir->cs,'c');
+ }
+

+ if (current->REC.messageid[0]) {
+ fprintf(view->u.canceldir->index_F,
+ "M %s\n",
+ current->REC.messageid);
+ }
+

+ if (current->REC.subject) {


+ char * s = string_to_hdr(HDR_TEXT,current->REC.subject,
+ view->u.canceldir->cs,0);
+ fprintf(view->u.canceldir->index_F,

+ "S %s\n",
+ s);
+ free(s);
+ }
+ }
+

+ static void add_canceled_mail1(filename,headers,view,X,lines,h,
+ body_offset)
+ char *filename;
+ struct mailing_headers * headers;

+ struct MailboxView *view;


+ time_t X;
+ int lines;
+ header_list_ptr h;
+ long body_offset;

+ {
+ struct message_list * current = NULL; /* current index */
+

+ view->u.canceldir->message_list =
+ safe_realloc(view->u.canceldir->message_list,
+ (view->u.canceldir->message_list_len+1) *
+ sizeof (view->u.canceldir->message_list[0]));
+
+ current = & (view->u.canceldir->
+ message_list[view->u.canceldir->message_list_len++]);
+
+

+ current->filename = safe_strdup(filename);

+ header_zero( & (current->REC));
+

+ /* Dummy default ... */


+ current->REC.header_charset = view->u.canceldir->cs;

+ /* read_folder_headers_helper() will re-set header_charset
+ if it sees X-ELM-OSV header with parameter
+ hdr-charset

+ */
+
+ /* Start of headers */


+ current->REC.offset = 0;

+ current->REC.mime_rec.begin_offset = 0;
+

+ sizeof (current->REC.env_from));
+ }

+
+ if (headers && headers->from.addrs &&
+ ! current->REC.from) {
+ current->REC.from = dup_addr_list(headers->from.addrs);
+ }
+
+ if (headers && headers->to.addrs &&
+ ! current->REC.to) {
+ current->REC.to = dup_addr_list(headers->to.addrs);
+ }
+
+ if (headers && headers->cc.addrs &&
+ ! current->REC.cc) {
+ current->REC.cc = dup_addr_list(headers->cc.addrs);
+ }
+
+ if (headers && headers->subject &&
+ ! current->REC.subject)
+ current->REC.subject = dup_string(headers->subject);
+
+ write_index_rec(view,current);
+ }
+
+ void delete_marked_canceled_mails(view)

+ struct MailboxView *view;
+ {

+ int i;


+ struct mv_canceldir *d;
+

+ if (&mt_canceldir!= view->mailbox_type)

+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "delete_marked_canceled_mails",


+ "Bad type for canceldir view",0);
+

+ d = view->u.canceldir;
+
+ /* DO not remove data from index on here!
+ because it confuses canceled mail selection

+ */
+

+ if (! d->dirname)
+ return;
+
+ for (i = 0; i < d->message_list_len; i++) {
+ if (ison(d->message_list[i].REC.status,
+ DELETED)) {

+ char * filename = elm_message(FRM("%s/%s"),

+ d->dirname,
+ d->message_list[i].
+ filename);
+
+

+ if (0 == unlink(filename)) {
+ DPRINT(Debug,7,(&Debug,
+ "Removed canceled mail [%d]: %s\n",
+ i,filename));
+
+ }
+
+ free(filename);
+ }
+ }

+ }
+
+ static void index_initialize(view)


+ struct MailboxView *view;
+ {

+ /* Initialize file */
+

+ rewind(view->u.canceldir->index_F);
+
+ #ifdef FTRUNCATE
+ ftruncate(fileno(view->u.canceldir->index_F),0);
+ #endif
+
+ fprintf(view->u.canceldir->index_F,
+ "ELMME+ MIDX\n");
+

+ view->u.canceldir->cs =

+ MIME_name_to_charset("UTF-8",0);
+ if (view->u.canceldir->cs &&
+ view->u.canceldir->cs->MIME_name)
+ fprintf(view->u.canceldir->index_F,
+ "C %s\n",
+ view->u.canceldir->cs->MIME_name);

+
+ fflush(view->u.canceldir->index_F);

+ }
+
+
+
+ void sync_canceled_mails(view)

+ struct MailboxView *view;
+ {

+ /* Rewrites index if needed */
+
+ int i,X;

+ int unlock_it = 0;

+ struct mv_canceldir *d;
+

+
+ if (&mt_canceldir!= view->mailbox_type)

+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "sync_canceled_mails",


+ "Bad type for canceldir view",0);
+

+ d = view->u.canceldir;
+
+ if (! d->dirname ||
+ ! d->indexname) {

+ return;
+ }
+
+ if (!view->u.canceldir->index_F) {
+ if (! process_index(view))


+ return;
+
+ unlock_it++;
+ }
+
+

+ for (i = 0, X=0; i < d->message_list_len; i++) {
+

+ char * filename = elm_message(FRM("%s/%s"),

+ d->dirname,
+ d->message_list[i].
+ filename);
+

+ if (0 != access(filename,ACCESS_EXISTS)) {
+ DPRINT(Debug,7,(&Debug,
+ "[%d] not exists, removing from index: %s\n",
+ i,filename));
+
+
+ header_clear(& (d->message_list[i].REC));
+ free(d->message_list[i].filename);

+ d->message_list[i].filename = NULL;
+

+ } else {
+ if (X < i) {
+ d->message_list[X] = d->message_list[i];
+
+ /* Avoid double pintters */
+ header_zero(& (d->message_list[i].REC));

+ d->message_list[i].filename = NULL;
+ }


+ X++;
+ }
+
+ free(filename);
+ }
+
+ if (X < d->message_list_len) {
+
+ long pos;

+
+
+ DPRINT(Debug,7,(&Debug,


+ "Canceled mails reduced %d => %d\n",
+ d->message_list_len,X));
+
+ d->message_list_len = X;

+
+ index_initialize(view);
+

+ /* Write records */
+
+ for (i = 0; i < d->message_list_len; i++) {
+

+ write_index_rec(view,& (d->message_list[i]));
+
+ }
+

+ mt_make_canceldir_view(view);
+
+ pos = ftell(view->u.canceldir->index_F);
+

+ /* Temporary terminator */

+ fprintf(view->u.canceldir->index_F,"--END\n");
+
+ /* Set position so that next appended index overwrites this */
+ fseek(view->u.canceldir->index_F,pos,SEEK_SET);

+
+ }
+

+ if (unlock_it)
+ unlock_index(view);
+ }
+
+

+ FILE * add_canceled_mail P_((char **outfile,


+ struct mailing_headers * headers,

+ struct MailboxView *view,
+ time_t X,
+ int lines,
+ header_list_ptr h,
+ long body_offset));

+ FILE * add_canceled_mail(outfile,headers,view, X, lines,h,body_offset)
+ char **outfile;
+ struct mailing_headers * headers;

+ struct MailboxView *view;


+ time_t X;
+ int lines;
+ long body_offset;
+ header_list_ptr h;

+ {
+ int i;
+ FILE *ret = NULL;
+
+ int unlock_it = 0;
+
+ if (&mt_canceldir!= view->mailbox_type)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"add_canceled_mail",


+ "Bad type for canceldir view",0);
+
+

+ if (!view->u.canceldir->dirname ||
+ !view->u.canceldir->indexname ||
+ !view->u.canceldir->cs){
+
+ DPRINT(Debug,7,(&Debug,
+ "add_canceled_mail=NULL -- not setup\n"));
+

+ return NULL;
+ }
+

+ if (!view->u.canceldir->index_F) {
+ if (! process_index(view))
+ return NULL;
+
+ unlock_it++;
+ }
+

+ for (i = view->u.canceldir->message_list_len;
+ i < view->u.canceldir->message_list_len+100;
+ i++) {
+ int fd;
+
+ if (*outfile)
+ free(*outfile);
+
+ *outfile = elm_message(FRM("%s/%05d-%02d.%s"),
+ view->u.canceldir->dirname,
+ (int)(X/(24*60*60)),
+ i,
+ dead_letter);;
+
+ fd = open(*outfile, O_WRONLY | O_CREAT | O_EXCL, 0600);

+ if (fd < 0) {


+ DPRINT(Debug,7,(&Debug,
+ "add_canceled_mail: %d -- %s creation failed\n",
+ i,*outfile));
+ continue;
+ }
+ ret = fdopen(fd, "w");
+
+ if (!ret) {
+
+ close(fd);

+ goto fail;
+ }


+ DPRINT(Debug,7,(&Debug,
+ "add_canceled_mail: Created %s\n",
+ *outfile));
+ break;
+ }
+
+ if (ret) {
+ char *x = strrchr(*outfile,'/');
+
+ if (!x)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"add_canceled_mail",
+ "NO / on generated name",0);
+
+ add_canceled_mail1(x+1,headers,view,X,lines,h,body_offset);
+
+ } else {
+ DPRINT(Debug,7,(&Debug,

+ "add_canceled_mail: failed to create mail\n"));
+
+ }
+

+ fail:
+ if (!ret) {
+ if (*outfile)
+ free(*outfile);

+ *outfile = NULL;
+ }
+
+ if (unlock_it)
+ unlock_index(view);
+
+
+ DPRINT(Debug,7,(&Debug,
+ "add_canceled_mail=%p\n",ret));


+
+ return ret;
+ }
+

+ static void move_olds(view)


+ struct MailboxView *view;
+ {

+ int i;
+
+ for (i = 0; i < 100; i++) {
+ char *lbuf1;

+ long b;


+ int fd;
+ struct stat stat_buf;
+ FILE *f1,*f2;

+ header_list_ptr h = NULL;

+ int lines = 0,c;
+ char *newname = NULL;

+

+ if (0 == i)
+ lbuf1 = elm_message(FRM("%s/%s"),
+ home,dead_letter);
+ else
+ lbuf1 = elm_message(FRM("%s/%02d.%s"),
+ home,i,dead_letter);
+
+
+ fd = open(lbuf1,O_RDONLY);
+

+ if (fd < 0) {


+ DPRINT(Debug,7,(&Debug,
+ "move_olds - copy %d: no file %s\n",
+ i,lbuf1));
+
+ free(lbuf1);

+ if (i > 1)
+ break;
+ continue;
+ }
+

+ if (-1 == fstat(fd,&stat_buf)) {
+ close(fd);
+ free(lbuf1);
+ continue;

+
+ }
+
+ if (stat_buf.st_uid != userid) {


+ /* Wrong owner */
+ close(fd);

+ free(lbuf1);
+ continue;
+ }
+
+ if (
+ #ifdef S_ISREG
+ ! S_ISREG(stat_buf.st_mode)
+ #else

+ S_IFREG != (stat_buf.st_mode & S_IFMT)
+ #endif
+ ) {


+ /* Wrong type */
+ close(fd);
+ free(lbuf1);
+ continue;

+ }
+
+ f1 = fdopen(fd,"r");
+ if (!f1) {
+ close(fd);

+ free(lbuf1);
+ continue;


+ }
+
+ h = file_read_headers(f1,RHL_CHECK_HEADER);
+
+ b = ftell(f1);
+
+ while (EOF != (c = getc(f1))) {
+ if ('\n' == c)
+ lines++;
+ }
+

+ f2 = add_canceled_mail(&newname,NULL,
+ view,
+ stat_buf.st_mtime,lines,h,b);
+ if (f2) {
+
+ rewind(f1);

+
+ if (0 != rename(lbuf1,newname)) {


+ while (EOF != (c = getc(f1))) {

+ putc(c,f2);
+ }
+

+ if (0 == fflush(f2) &&
+ !ferror(f1) &&
+ !ferror(f1)) {
+
+ DPRINT(Debug,7,(&Debug,
+ "give_canceled_mail - copy %d: copied %s to %s\n",
+ i,lbuf1,newname));
+
+
+ unlink(lbuf1);
+ }
+ } else {
+ DPRINT(Debug,7,(&Debug,
+ "give_canceled_mail - copy %d: renamed %s to %s\n",
+ i,lbuf1,newname));
+ }
+ fclose(f2);
+ }
+

+ if (h)
+ delete_headers(&h);
+

+ if (newname)
+ free(newname);
+
+
+ fclose(f1);
+ free(lbuf1);

+
+ }
+
+ }
+

+
+ struct MailboxView *give_canceled_mail()
+ {
+

+ char *t = give_dt_estr_as_str(&dead_letter_dir_e,"dead-letter-dir");
+

+ if (!canceled_mail_view) {
+
+ if (!t) {
+ DPRINT(Debug,7,(&Debug,
+ "give_canceled_mail=NULL: no dead-letter-dir\n"));

+ return NULL;
+ }


+ canceled_mail_view = give_canceldir();
+
+ setup_canceldir(canceled_mail_view,t);
+ }
+
+ if (&mt_canceldir!= canceled_mail_view->mailbox_type)

+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"give_canceled_mail",
+ "Bad type for canceled_mail_view",0);
+
+
+

+ if (t && 0 == mkdir(t,0700)) {

+ int i;
+

+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "close_canceled_mail",
+ "canceled_mail_view not resetted",0);

+
+ }
+ }
+

+ /* HACK -- return 1 on succeed, 0 on failure */
+ int cancel_set_current(cancel_view,last_canceled_mail)

+ struct MailboxView * cancel_view;

+ char *last_canceled_mail;
+ {
+ int x;


+ char * D = last_canceled_mail;
+
+ if (&mt_canceldir!= cancel_view->mailbox_type)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"cancel_set_current",
+ "Bad type for cancel_view",0);
+
+ if (cancel_view->u.canceldir->dirname) {
+ int L = strlen(cancel_view->u.canceldir->dirname);

+

+ if (0 == strncmp(D,cancel_view->u.canceldir->dirname,L) &&

+ '/' == D[L]) {
+
+ DPRINT(Debug,7,(&Debug,


+ "cancel_set_current: Filename %s have dirname as prefix, good ",
+ D));
+
+ D += L+1;
+ DPRINT(Debug,7,(&Debug,"=> %s\n",
+ D));

+ }
+
+ }
+

+ for (x = 0; x < cancel_view->view_len; x++) {
+ int n;

+

+ if (0 != cancel_view->view[x].mailbox_number)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"cancel_set_current",
+ "Bad internal mailbox number",0);
+ n = cancel_view->view[x].index;
+ if (n < 0 || n >= cancel_view->u.canceldir->message_list_len)

+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"cancel_set_current",


+ "Bad internal index",0);

+

+ if (0 == strcmp(cancel_view->u.canceldir->message_list[n].filename,
+ D)) {
+ DPRINT(Debug,7,(&Debug," Found filename %s internal index %d view index %d\n",
+ D,n,x));
+
+ /* NOTE: Caller uses current == view_index +1 */
+ cancel_view->current = x+1;

+ return 1;
+ }
+
+ }

+
+
+ DPRINT(Debug,7,(&Debug,"cancel_set_current: Filename %s not found\n",
+ D));

+ return 0;
+ }
+

+ /* HACK -- delete curently open file */
+
+ void delete_current_cancel(cancel_view,ref_file)

+ struct MailboxView * cancel_view;

+ FILE *ref_file;
+ {
+ int idx;
+ char *filename = NULL;
+

+ if (&mt_canceldir!= cancel_view->mailbox_type)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"cancel_set_current",
+ "delete_current_cancel",0);
+
+ if (! cancel_view->u.canceldir->last_open_file
+ || ref_file != cancel_view->u.canceldir->last_open_file) {
+ DPRINT(Debug,3,(&Debug,

+ "delete_current_cancel: referenced file not currently open\n"));
+ return;
+ }


+ idx = cancel_view->u.canceldir->last_open_index;
+

+ if (idx < 0 || idx >= cancel_view->u.canceldir->message_list_len)


+ panic("MBX VIEW PANIC",__FILE__,__LINE__,

+ "delete_current_cancel",


+ "Bad internal index",0);
+

+ filename = elm_message(FRM("%s/%s"),
+ cancel_view->u.canceldir->dirname,
+ cancel_view->u.canceldir->message_list[idx].
+ filename);
+ if (0 == unlink(filename)) {
+ DPRINT(Debug,3,(&Debug,
+ "delete_current_cancel: [%d] %s deleted\n",
+ idx,filename));
+ }
+ free(filename);

+ }
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha2-cvs/src/messages/def_messages.h
*** elmME+.2.5.alpha1/src/messages/def_messages.h 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/messages/def_messages.h 2004-08-07 21:07:20.000000000 +0300
***************
*** 1,4 ****


! /* $Id: def_messages.h,v 1.6.8.2 2004/07/03 15:23:07 hurtta Exp $ */

#include "elm_defs.h"
#include "mime.h"

--- 1,10 ----
! /* $Id: def_messages.h,v 1.6.8.3 2004/08/07 18:07:20 hurtta Exp $ */
!
! /******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $
! *
! * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
! *****************************************************************************/



#include "elm_defs.h"
#include "mime.h"
***************

*** 44,57 ****


struct folder_view *v));


- /* This is not good ... */
- typedef int mt_give_message_folder_mailbox P_((struct MailboxView *mailbox,
- int index,
- struct header_rec **ret_header,
- struct folder_info **ret_folder,
- struct counter_data *counter,
- parse_mime_callback *parse_mime,
- struct folder_view *v));
typedef void mt_write_mailbox_info P_((FILE *fp, struct MailboxView *mailbox,
int s, int cur_idx));
typedef struct string * mt_mailbox_title P_((struct MailboxView *mailbox));

--- 50,55 ----
***************
*** 77,88 ****


mt_give_header_mailbox * mt_give_header_it;
mt_sort_mailbox_view * mt_sort_it_view;
mt_give_message_data_mailbox * mt_give_message_data_it;
- mt_give_message_folder_mailbox * mt_give_message_folder_it;
mt_write_mailbox_info * mt_write_it_info;
mt_mailbox_title * mt_it_title;
mt_make_mailbox_view * mt_make_it_view;
mt_add_mailbox_digest * mt_add_it_digest;
! } mt_storage, mt_digest, mt_partial;

#define MAILBOXTYPE_magic 0xF502

--- 75,85 ----


mt_give_header_mailbox * mt_give_header_it;
mt_sort_mailbox_view * mt_sort_it_view;
mt_give_message_data_mailbox * mt_give_message_data_it;
mt_write_mailbox_info * mt_write_it_info;
mt_mailbox_title * mt_it_title;
mt_make_mailbox_view * mt_make_it_view;
mt_add_mailbox_digest * mt_add_it_digest;
! } mt_storage, mt_digest, mt_partial, mt_canceldir;

#define MAILBOXTYPE_magic 0xF502

***************

*** 108,113 ****
--- 105,112 ----



} * partial;

+ struct mv_canceldir * canceldir;
+
void * dummy;
} u;

***************

*** 142,151 ****
--- 141,153 ----


struct current_storage *mbx;
struct current_digest *dgt;
struct partial_sort *part;
+ struct mv_canceldir *canceldir;
void *dummy;
} u;
};

+ extern struct MailboxView *give_canceldir P_((void));

+
/*
* Local Variables:
* mode:c

Index: elmME+.2.5.alpha2-cvs/src/messages/digest.c
*** elmME+.2.5.alpha1/src/messages/digest.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/messages/digest.c 2004-08-07 21:07:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: digest.c,v 1.9.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: digest.c,v 1.9.8.3 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 304,372 ****
return 1;
}

- /* This is not good ... */
- S_(mt_give_message_folder_mailbox mt_give_message_folder_digest)
- /* This is not good ... */
- static int mt_give_message_folder_digest P_((struct MailboxView *mailbox,
- int index,
- struct header_rec **ret_header,
- struct folder_info **ret_folder,
- struct counter_data *counter,
- parse_mime_callback *parse_mime,
- struct folder_view *v));
- /* This is not good ... */
- static int mt_give_message_folder_digest(mailbox,index,ret_header,ret_folder,
- counter,parse_mime,v)

- struct MailboxView *mailbox;


- int index;
- struct header_rec **ret_header;
- struct folder_info **ret_folder;
- struct counter_data *counter;
- parse_mime_callback *parse_mime;
- struct folder_view *v;
- {
- struct header_rec *hdr;
-
- int mbx,idx;
-
- mbx = v->mailbox_number;
-
- if (mbx < 0 || mbx >= mailbox->u.digest->digest_count ||
- ! mailbox->u.digest->the_digest ||
- ! mailbox->u.digest->the_digest[mbx]) {
- panic("MBX VIEW PANIC",__FILE__,__LINE__,
- "mt_give_message_folder_digest",
- "bad mailbox number",0);

- return 0;
- }


- idx = v->index;
-
- if (idx < 0 ||
- idx >= mailbox->u.digest->the_digest[mbx]->message_count ||
- ! mailbox->u.digest->the_digest[mbx]->headers ||
- ! mailbox->u.digest->the_digest[mbx]->headers[idx]) {
- panic("MBX VIEW PANIC",__FILE__,__LINE__,
- "mt_give_message_folder_digest",
- "bad internal index",0);

- return 0;
- }
-

- hdr = mailbox->u.digest->the_digest[mbx]->headers[idx];
-
- /* hdr is also needed on error messages ... */
- if (ret_header)
- *ret_header = hdr;
-
- if (ret_folder) { /* NOT supported */
-
- DPRINT(Debug,10,(&Debug,
- "mt_give_message_folder_digest: not supported\n"));

-
- return 0;
- }

-
- return 1;
- }

S_(mt_write_mailbox_info mt_write_digest_info)
static void mt_write_digest_info P_((FILE *fp, struct MailboxView *mailbox,
--- 304,309 ----
***************
*** 764,770 ****
mt_give_header_digest,
mt_sort_digest_view,
mt_give_message_data_digest,
- mt_give_message_folder_digest,
mt_write_digest_info,
mt_digest_title,
mt_make_digest_view,
--- 701,706 ----

Index: elmME+.2.5.alpha2-cvs/src/messages/Makefile.SH
*** elmME+.2.5.alpha1/src/messages/Makefile.SH 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/messages/Makefile.SH 2004-08-07 21:07:19.000000000 +0300


***************
*** 17,23 ****
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.5.44.2 2004/07/03 15:23:07 hurtta Exp $
# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.5.44.3 2004/08/07 18:07:19 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************
*** 43,49 ****
SHELL = /bin/sh

OBJ = messages.o header_alloc.o storage.o digest.o \
! partial.o

all: Makefile libmessages.a

--- 43,49 ----
SHELL = /bin/sh

OBJ = messages.o header_alloc.o storage.o digest.o \

! partial.o canceled_mail.o

all: Makefile libmessages.a

***************

*** 87,92 ****
--- 87,93 ----



messages.o: def_messages.h
header_alloc.o: def_messages.h
+ canceled_mail.o: def_messages.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h
storage.o: def_messages.h $(INCLDIR)/s_elm.h
digest.o: def_messages.h $(INCLDIR)/s_elm.h
partial.o: def_messages.h $(INCLDIR)/s_me.h

Index: elmME+.2.5.alpha2-cvs/src/messages/messages.c
*** elmME+.2.5.alpha1/src/messages/messages.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/messages/messages.c 2004-08-07 21:07:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: messages.c,v 1.12.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: messages.c,v 1.12.8.3 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 10,17 ****

DEBUG_VAR(Debug,__FILE__,"messages");

- struct MailboxView * current_mailbox = NULL;
-

#define MAILBOXVIEW_magic 0xF500


static struct MailboxView ** mailbox_list = NULL;
--- 10,15 ----
***************
*** 58,63 ****
--- 56,63 ----

static struct MailboxView * malloc_view(t)
struct mailbox_type *t;
{

+ int idx;
+

struct MailboxView *ret, **X;

ret = safe_malloc(sizeof (*ret));
***************

*** 82,91 ****

ret->mailbox_type->mt_init_it(ret);

X = safe_realloc(mailbox_list,(mailbox_list_len+1)* sizeof (*X));

! X[mailbox_list_len] = ret;
mailbox_list = X;
! mailbox_list_len++;

return ret;
}

--- 82,107 ----

ret->mailbox_type->mt_init_it(ret);


+ for (idx = 0; idx < mailbox_list_len; idx++)

+ if (!mailbox_list[idx]) {
+ DPRINT(Debug,7,(&Debug,
+ "malloc_view: Re-using mailbox index %d\n",
+ idx));
+ goto found;
+ }


+
X = safe_realloc(mailbox_list,(mailbox_list_len+1)* sizeof (*X));

! X[mailbox_list_len] = NULL;
mailbox_list = X;
! idx = mailbox_list_len++;
!
! DPRINT(Debug,7,(&Debug,
! "malloc_view: Allocing new mailbox index %d\n",
! idx));
!
!
! found:
! mailbox_list[idx] = ret;

return ret;
}
***************
*** 103,108 ****
--- 119,131 ----
return ret;
}

+ struct MailboxView *give_canceldir()

+ {
+ struct MailboxView *ret = malloc_view(&mt_canceldir);


+
+ return ret;
+ }
+

struct MailboxView * digest_to_mailbox_view(list,received_time,env_from,F,
defcharset)
mime_t *list;

***************
*** 185,191 ****


--- 208,237 ----
env_from,F, defcharset);
}

+ static void free_mailbox1 P_((struct MailboxView **mailbox));
+
+ static void free_mailbox1(mailbox)
+ struct MailboxView **mailbox;
+ {
+ if ((*mailbox)->mailbox_type->magic != MAILBOXTYPE_magic)
+ panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox1",
+ "Bad type magic number",0);
+
+ (*mailbox)->mailbox_type->mt_free_it(*mailbox);
+
+ if ((*mailbox)->mailbox_title)
+ free_string (& ((*mailbox)->mailbox_title));

+ if ((*mailbox)->view) {
+ free((*mailbox)->view);
+ (*mailbox)->view = NULL;
+ }

+ (*mailbox)->view_len = 0;
+

+ (*mailbox)->magic = 0; /* Invalidate */
+ free(*mailbox);
+ *mailbox = NULL;

+ }

void free_mailbox(mailbox)
struct MailboxView **mailbox;

***************
*** 196,207 ****


panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox",
"Bad magic number",0);

- if ((*mailbox)->mailbox_type->magic != MAILBOXTYPE_magic)

- panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox",
- "Bad type magic number",0);
-

for ( i = 0; i < mailbox_list_len; i++) {

if (mailbox_list[i] == *mailbox) {

mailbox_list[i] = NULL;
goto okei;
}

--- 242,254 ----


panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_mailbox",

"Bad magic number",0);



for ( i = 0; i < mailbox_list_len; i++) {

if (mailbox_list[i] == *mailbox) {
+

+ SIGDPRINT(Debug,7,(&Debug,
+ "free_mailbox: Mailbox index %d goes free\n",
+ i));


+
mailbox_list[i] = NULL;

goto okei;
}
***************
*** 211,236 ****

"mailbox not found from list",0);

okei:
! (*mailbox)->mailbox_type->mt_free_it(*mailbox);
!
! if ((*mailbox)->mailbox_title)
! free_string (& ((*mailbox)->mailbox_title));
!
! if ((*mailbox)->view) {
! free((*mailbox)->view);
! (*mailbox)->view = NULL;
! }
! (*mailbox)->view_len = 0;
!
! (*mailbox)->magic = 0; /* Invalidate */
! free(*mailbox);
! *mailbox = NULL;

! for ( ; i < mailbox_list_len-1; i++) {
! mailbox_list[i] = mailbox_list[i+1];
}
! mailbox_list[i] = NULL;

! mailbox_list_len--;


}

/* Return 1 if redraw required */

--- 258,289 ----


"mailbox not found from list",0);

okei:
! free_mailbox1(mailbox);
! }

! void free_all_mailboxes()
! {
! if (mailbox_list) {

! int i;
!

! for ( i = 0; i < mailbox_list_len; i++) {
! if (mailbox_list[i]) {
!
! SIGDPRINT(Debug,7,(&Debug,"free_all_mailboxes: [%d]\n",
! i));
!
! if (mailbox_list[i]->magic != MAILBOXVIEW_magic)

! panic("MBX VIEW PANIC",__FILE__,__LINE__,"free_all_mailboxes",
! "Bad magic number",0);
!
! free_mailbox1(& (mailbox_list[i]));
! }
! }
!

! free(mailbox_list);
! mailbox_list = NULL;
}
! mailbox_list_len = 0;
}

/* Return 1 if redraw required */

***************
*** 463,505 ****
& mailbox->view[index]);
}

- #if 0 /* NOT USED */
-
- /* This is not good ... */
- int give_message_folder(mailbox,index,ret_header,ret_folder,counter,
- parse_mime)

- struct MailboxView *mailbox;


- int index;
- struct header_rec **ret_header;
- struct folder_info **ret_folder;
- struct counter_data *counter;
- parse_mime_callback *parse_mime;
- {
- if (mailbox->magic != MAILBOXVIEW_magic)
- panic("MBX VIEW PANIC",__FILE__,__LINE__,"give_message_folder",
- "Bad magic number",0);
-
- if (mailbox->mailbox_type->magic != MAILBOXTYPE_magic)
- panic("MBX VIEW PANIC",__FILE__,__LINE__,"give_message_folder",
- "Bad type magic number",0);
-
- if (ret_header)
- *ret_header = NULL;
- if (ret_folder)
- *ret_folder = NULL;
-
-
- if (index < 0 || index >= mailbox->view_len)

- return 0;
-

- return mailbox->mailbox_type->
- mt_give_message_folder_it(mailbox,index,ret_header,
- ret_folder,counter,parse_mime,
- & mailbox->view[index]);
-
- }
-
- #endif /* NOT USED */

void write_mailbox_info(fp,mailbox)
FILE *fp;
--- 516,521 ----

Index: elmME+.2.5.alpha2-cvs/src/messages/partial.c
*** elmME+.2.5.alpha1/src/messages/partial.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/messages/partial.c 2004-08-07 21:07:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.14.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.14.8.2 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 497,559 ****

}

- /* This is not good ... */
- S_(mt_give_message_folder_mailbox mt_give_message_folder_partial)
- /* This is not good ... */
- static int mt_give_message_folder_partial P_((struct MailboxView *mailbox,
- int index,
- struct header_rec **ret_header,
- struct folder_info **ret_folder,
- struct counter_data *counter,
- parse_mime_callback *parse_mime,
- struct folder_view *v));
- /* This is not good ... */
- static int mt_give_message_folder_partial(mailbox,index,ret_header,ret_folder,
- counter,parse_mime,v)

- struct MailboxView *mailbox;


- int index;
- struct header_rec **ret_header;
- struct folder_info **ret_folder;
- struct counter_data *counter;
- parse_mime_callback *parse_mime;
- struct folder_view *v;
- {
- struct header_rec *hdr;

-

- if (0 == v->mailbox_number) { /* Number 0 is internal */
-
- if (v->index < 0 || v->index >= mailbox->u.partial->composite_len)

- return 0;
-

- if (! mailbox->u.partial->composite[v->index].mss)
- generate_mail_header(mailbox,v->index);
-
- if (! mailbox->u.partial->composite[v->index].mss)

- return 0;
-

- if (ret_header)
- *ret_header = mailbox->u.partial->composite[v->index].mss;
-
- if (ret_folder)

- return 0;
-

Index: elmME+.2.5.alpha2-cvs/src/messages/storage.c
*** elmME+.2.5.alpha1/src/messages/storage.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/messages/storage.c 2004-08-07 21:07:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: storage.c,v 1.6.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: storage.c,v 1.6.8.3 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 335,410 ****
return 1;
}

- /* This is not good ... */
- S_(mt_give_message_folder_mailbox mt_give_message_folder_storage)
- /* This is not good ... */
- static int mt_give_message_folder_storage P_((struct MailboxView *mailbox,
- int index,
- struct header_rec **ret_header,
- struct folder_info **ret_folder,
- struct counter_data *counter,
- parse_mime_callback *parse_mime,
- struct folder_view *v));
- /* This is not good ... */
- static int mt_give_message_folder_storage(mailbox,index,ret_header,ret_folder,
- counter,parse_mime,v)

- struct MailboxView *mailbox;


- int index;
- struct header_rec **ret_header;
- struct folder_info **ret_folder;
- struct counter_data *counter;
- parse_mime_callback *parse_mime;
- struct folder_view *v;
- {
- struct header_rec *hdr;
-
- int mbx,idx;
-
- mbx = v->mailbox_number;
-
- if (mbx < 0 || mbx >= mailbox->u.storage->mailbox_count ||
- ! mailbox->u.storage->the_mailbox ||
- ! mailbox->u.storage->the_mailbox[mbx]) {
- panic("MBX VIEW PANIC",__FILE__,__LINE__,
- "mt_give_message_folder_storage",
- "bad mailbox number",0);

- return 0;
- }


- idx = v->index;
-
- if (idx < 0 ||
- idx >= mailbox->u.storage->the_mailbox[mbx]->message_count ||
- ! mailbox->u.storage->the_mailbox[mbx]->headers ||
- ! mailbox->u.storage->the_mailbox[mbx]->headers[idx]) {
- panic("MBX VIEW PANIC",__FILE__,__LINE__,
- "mt_give_message_folder_storage",
- "bad internal index",0);

- return 0;
- }
-

- hdr = mailbox->u.storage->the_mailbox[mbx]->headers[idx];
-
- /* hdr is also needed on error messages ... */
- if (ret_header)
- *ret_header = hdr;
-
- if (ret_folder)
- *ret_folder = mailbox->u.storage->the_mailbox[mbx]->current_folder;
-
- if (! mailbox->u.storage->the_mailbox[mbx]->current_folder)

- return 0;
-

- if (!prepare_message_access(mailbox->u.storage->the_mailbox[mbx]->
- current_folder,
- hdr,parse_header_routine,parse_body_routine,
- counter,parse_mime))

- return 0;
-

- return 1;
-
-
- }

-
S_(mt_write_mailbox_info mt_write_storage_info)
static void mt_write_storage_info P_((FILE *fp, struct MailboxView *mailbox,
int s, int cur_idx));
--- 335,340 ----
***************
*** 610,616 ****
mt_give_header_storage,
mt_sort_storage_view,
mt_give_message_data_storage,
- mt_give_message_folder_storage,
mt_write_storage_info,
mt_storage_title,
mt_make_storage_view,
--- 540,545 ----

Index: elmME+.2.5.alpha2-cvs/src/mime.c
*** elmME+.2.5.alpha1/src/mime.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/mime.c 2004-08-14 09:40:48.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: mime.c,v 1.31.8.1 2004/05/23 16:24:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime.c,v 1.31.8.2 2004/08/14 06:40:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 231,237 ****
* HAVE_BINARY takes care really severe stuff */
if ((need_enc & HAVE_CTRL) &&
X->encoding_part != ENCODING_QUOTED) {
! if (batch_only)

X->encoding_part = ENCODING_QUOTED;
else {

int ch;
--- 231,237 ----
* HAVE_BINARY takes care really severe stuff */
if ((need_enc & HAVE_CTRL) &&
X->encoding_part != ENCODING_QUOTED) {
! if (! OPMODE_IS_INTERACTIVE(opmode))

X->encoding_part = ENCODING_QUOTED;
else {

int ch;
***************
*** 509,515 ****
ElmBadKeyword,
"Bad keyword on text: %.50s"),
buffer);
! if (!batch_only)
ok = 0;
}
}
--- 509,515 ----
ElmBadKeyword,
"Bad keyword on text: %.50s"),
buffer);
! if (! OPMODE_IS_INTERACTIVE(opmode))
ok = 0;
}
}
***************
*** 562,568 ****


continue;
} else if (strncmp(buffer, START_ENCODE,
strlen(START_ENCODE))==0) {

! if (batch_only) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoEncryptInBatch,
"Sorry. Cannot send encrypted mail in \"batch mode\".\n"));
ok = 0;
--- 562,568 ----


continue;
} else if (strncmp(buffer, START_ENCODE,
strlen(START_ENCODE))==0) {

! if ( ! OPMODE_IS_INTERACTIVE(opmode)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoEncryptInBatch,
"Sorry. Cannot send encrypted mail in \"batch mode\".\n"));
ok = 0;
Index: elmME+.2.5.alpha2-cvs/src/newmbox.c
*** elmME+.2.5.alpha1/src/newmbox.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/newmbox.c 2004-08-07 21:07:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.85 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.85 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.85.8.1 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.85.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 138,144 ****
if (!same_file)
free_storage(&storage);

! silently_exit(mailbox,&current_aliaslist); /* ???? TODO -- is needed? */

}

--- 138,144 ----
if (!same_file)
free_storage(&storage);

! silently_exit(); /* ???? TODO -- is needed? */

}

***************
*** 181,188 ****
if (!same_file)
free_storage(&storage);

! rm_temps_exit(mailbox,&current_aliaslist); /* ???? TODO -- is needed? */
! /* ?? global reference */
}


--- 181,187 ----
if (!same_file)
free_storage(&storage);

! rm_temps_exit(); /* ???? TODO -- is needed? */
}


Index: elmME+.2.5.alpha2-cvs/src/options.c
*** elmME+.2.5.alpha1/src/options.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/options.c 2004-08-07 21:07:18.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: options.c,v 1.24.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.24.8.4 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 322,330 ****



lower_prompt(prompt = catgets(elm_msg_cat, ElmSet, ElmKeyPrompt, "Key : "));

! while ((c = menu_ReadCh(page,0)) != '.') {

! if (c == EOF)


! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */

#ifdef ASCII_CTYPE

if (isascii(c))
--- 322,332 ----



lower_prompt(prompt = catgets(elm_msg_cat, ElmSet, ElmKeyPrompt, "Key : "));

! while ((c = menu_ReadCh(page,0|READCH_sig_char|READCH_CURSOR)) != '.') {
! if (c == EOF)


! leave(0);
! if (c == TERMCH_interrupt_char)

! break;

#ifdef ASCII_CTYPE
if (isascii(c))
***************

*** 450,461 ****


PutLineX(LINES-3, 0,
CATGETS(elm_msg_cat, ElmSet, ElmPrompt, "Command: "));

! ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize);


if (ch == REDRAW_MARK)
goto redraw;
if (ch == EOF) {

erase_menu_context(&page);


! leave(0, &current_mailbox,&current_aliaslist); /* ??? global reference */
}

if (ch == RESIZE_MARK) {
--- 452,463 ----


PutLineX(LINES-3, 0,
CATGETS(elm_msg_cat, ElmSet, ElmPrompt, "Command: "));

! ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize|READCH_CURSOR);


if (ch == REDRAW_MARK)
goto redraw;
if (ch == EOF) {

erase_menu_context(&page);
! leave(0);
}

if (ch == RESIZE_MARK) {

***************
*** 479,484 ****
--- 481,492 ----


page);
if (o->post)
(o->post)(y);
+
+ if (!y) { /* FAILED -- REDRAW */
+ goto redraw;
+ }
+
+
} else
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCommandUnknown,
"Command unknown!"));
***************

*** 519,525 ****


{
/** 'var' field at x.y toggles between on and off... **/

! char ch;

PutLineX(x, y+6,
CATGETS(elm_msg_cat, ElmSet, ElmUseSpaceToToggle,

--- 527,534 ----


{
/** 'var' field at x.y toggles between on and off... **/

! int ch;


! int oldvar = *var;

PutLineX(x, y+6,
CATGETS(elm_msg_cat, ElmSet, ElmUseSpaceToToggle,
***************

*** 528,538 ****


MoveCursor(x,y+3); /* at end of value... */

do {
! ch = menu_ReadCh(page,0);

! if (ch == SPACE) {
! *var = ! *var;
! PutLine0(x,y, onoff(*var));
}
} while (ch == SPACE);

--- 537,552 ----


MoveCursor(x,y+3); /* at end of value... */

do {
! ch = menu_ReadCh(page,READCH_sig_char|READCH_CURSOR);
!

! if (ch == TERMCH_interrupt_char) {

! *var = oldvar;
! break;

! }


! if (ch == SPACE) {
! *var = ! *var;
! PutLine0(x,y, onoff(*var));
}
} while (ch == SPACE);

***************

*** 589,595 ****


MoveCursor(x, y);

do {
! ch = menu_ReadCh(page, 0);
#ifdef ASCII_CTYPE
if (isascii(ch))
#endif

--- 603,615 ----


MoveCursor(x, y);

do {
! ch = menu_ReadCh(page, READCH_sig_char|READCH_CURSOR);
!

! if (ch == TERMCH_interrupt_char) {

! sortby = last_sortby;
! break;
! }
!
#ifdef ASCII_CTYPE
if (isascii(ch))
#endif
***************

*** 925,930 ****
--- 945,951 ----


}

} else { /* Hopefully generic routine ... */

+ int code;
char * s;

if (RCTYPE_magic != save_info[x].dt_type->magic)

***************
*** 938,948 ****


else
buffer[0] = '\0';

! optionally_enter(buffer, ypos, xpos,
! (append_current ? OE_APPEND_CURRENT : 0) |
! (passwd ? OE_PASSWD : 0),

sizeof buffer,page);
!
if (!s || !equal(buffer,s)) {

if (save_info[x].dt_type->parse_line(& save_info[x],

--- 959,973 ----


else
buffer[0] = '\0';

! code = optionally_enter(buffer, ypos, xpos,

! (append_current ? OE_APPEND_CURRENT : 0) |
! (passwd ? OE_PASSWD : 0) |

! OE_SIG_CHAR|OE_REDRAW_MARK,
sizeof buffer,page);
!

! if (0 != code) /* Ctrl-C, error or REDRAW_MARK*/
! return 0;
!
if (!s || !equal(buffer,s)) {

if (save_info[x].dt_type->parse_line(& save_info[x],

Index: elmME+.2.5.alpha2-cvs/src/out_utils.c
*** elmME+.2.5.alpha1/src/out_utils.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/out_utils.c 2004-07-19 12:20:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.23.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.23.8.2 2004/07/19 09:20:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 187,196 ****
DPRINT(Debug,1,(&Debug,
"TRANSIENT message: %s\n",
s));
! LAST_ERROR = 0; /* NO SLEEP */
! error_middle(s);
! strfcpy(err_buffer, s, sizeof err_buffer); /* save it too! */
! return 0;
}

static char * prompt_it P_((CONST char *str, int pass));

--- 187,196 ----


DPRINT(Debug,1,(&Debug,
"TRANSIENT message: %s\n",
s));
! LAST_ERROR = 0; /* NO SLEEP */
! error_middle(s);
! strfcpy(err_buffer, s, sizeof err_buffer); /* save it too! */
! return 0;
}

static char * prompt_it P_((CONST char *str, int pass));
***************
*** 215,221 ****
CleartoEOS();
show_last_error();
status = optionally_enter(buffer,LINES-1-2, len+1,
! (pass ? OE_PASSWD : 0) |OE_REDRAW_MARK,
sizeof buffer,
cpage);
if (REDRAW_MARK == status)

--- 215,222 ----


CleartoEOS();
show_last_error();
status = optionally_enter(buffer,LINES-1-2, len+1,

! (pass ? OE_PASSWD : 0) |OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof buffer,
cpage);
if (REDRAW_MARK == status)
***************
*** 232,241 ****
--- 233,294 ----


return safe_strdup(buffer);
}

+ static void cancel_transient_X P_((struct string *x));
+ static void cancel_transient_X(x)

+ struct string *x;
+ {

+ int LINES, COLUMNS;
+ int pos = 0;
+ int vlen;
+ struct string *Y;
+ int s = 0;

+
+ menu_get_sizes(default_context,&LINES, &COLUMNS);
+

+ DPRINT(Debug,1,(&Debug,
+ "CANCEL TRANSIENT message: %S\n",
+ x));

+

+ while (NULL != (Y = curses_printable_clip(x,&pos,99,&vlen,COLUMNS-1))) {
+
+ if (vlen > 0) {
+ if (s)
+ error_sleep(1);
+ s = 1;
+
+ MoveCursor(LINES-1,0);
+ CleartoEOLN();
+ PutLineX(LINES-1,(COLUMNS-vlen)/2,FRM("%S"),Y);
+ FlushBuffer();
+
+ }
+ free_string(&Y);
+
+ if (!vlen)
+ break;
+ }

+ }
+

+ static void cancel_clear_X P_((void));
+ static void cancel_clear_X()
+ {

+ int LINES, COLUMNS;
+
+ menu_get_sizes(default_context,&LINES, &COLUMNS);
+

+ MoveCursor(LINES-1,0);
+ CleartoEOLN();


+ }
+
void out_util_setup() {
set_error_handler(error);
set_transient_handler(transient);
set_prompt_handler(prompt_it);
+
+ setup_cancel_cb(cancel_set_ttysig_X,
+ cancel_reset_ttysig_X,
+ cancel_transient_X,
+ cancel_clear_X);
}

void lower_prompt(s)
Index: elmME+.2.5.alpha2-cvs/src/partial.c
*** elmME+.2.5.alpha1/src/partial.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/partial.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.9 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.9.8.1 2004/08/07 18:07:19 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
***************
*** 142,148 ****


nufoot = 0;
nucurr = 0;

! new_mail_check(mailbox,&redraw, &header_page, page);

if (update_view(mailbox)) {
resort_mailbox(mailbox,1, &header_page);

--- 142,149 ----


nufoot = 0;
nucurr = 0;

! new_mail_check(mailbox, &header_page, page);
! redraw += menu_need_redraw(page);


if (update_view(mailbox)) {
resort_mailbox(mailbox,1, &header_page);
***************

*** 181,190 ****


MoveCursor(lin,col);
}

! ch = mailbox_command(mailbox,ch, &redraw, &nufoot,

showmsg_partial_cmd, aview, &header_page,


page);

switch (ch) {
case 0: /* OK */
break;

--- 182,193 ----


MoveCursor(lin,col);
}

! ch = mailbox_command(mailbox,ch, &nufoot,

showmsg_partial_cmd, aview, &header_page,


page);

+ redraw += menu_need_redraw(page);
+

switch (ch) {
case 0: /* OK */
break;

***************
*** 204,210 ****

/* softkeys_off(); */

! redraw += do_pipe(mailbox, page);

/* softkeys_on(); */
} else {
DPRINT(Debug,3,(&Debug,

--- 207,215 ----

/* softkeys_off(); */

! do_pipe(mailbox, page);

! redraw += menu_need_redraw(page);
!
/* softkeys_on(); */
} else {
DPRINT(Debug,3,(&Debug,

Index: elmME+.2.5.alpha2-cvs/src/pattern.c
*** elmME+.2.5.alpha1/src/pattern.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/pattern.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pattern.c,v 1.33 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pattern.c,v 1.33.8.2 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 33,39 ****


return (CONST unsigned char *)str;
}

-

#include <errno.h>
#ifndef ANSI_C
extern int errno;
--- 33,38 ----
***************
*** 144,157 ****

status = optionally_enter2(page,

&meta_pattern, LINES-1-2, 0,
! OE_REDRAW_MARK,

CATGETS(elm_msg_cat, ElmSet, ElmEnterPattern,
"Enter pattern: "));

while (status == REDRAW_MARK) {
status = optionally_enter2(page,

&meta_pattern, LINES-1-2, 0,


! OE_REDRAW_MARK|OE_APPEND_CURRENT,
CATGETS(elm_msg_cat, ElmSet,

ElmEnterPattern,
"Enter pattern: "));
--- 143,158 ----

status = optionally_enter2(page,

&meta_pattern, LINES-1-2, 0,


! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmEnterPattern,
"Enter pattern: "));

while (status == REDRAW_MARK) {
status = optionally_enter2(page,

&meta_pattern, LINES-1-2, 0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,

ElmEnterPattern,
"Enter pattern: "));
***************
*** 237,245 ****


return(curtag);
}

! int pattern_match(menu, redraw, header_page, page)
struct menu_common *menu;
- int *redraw;
int header_page;
struct menu_context *page;
{
--- 238,245 ----
return(curtag);
}

! int pattern_match(menu, header_page, page)
struct menu_common *menu;
int header_page;

struct menu_context *page;
{
***************
*** 248,253 ****


--- 248,257 ----
case), move current message pointer to that message, if

not, error and return ZERO **/

+ /* If redraw is needed use

+ menu_trigger_redraw(page)
+ */
+

int i;

/* Elm 2.4 remembers old entered patterns, so we need to keep
***************

*** 257,262 ****


--- 261,267 ----
static struct string * alt_pattern = NULL;
int ret = 0 ;

+ int redraw = 0;

int anywhere = FALSE;
int matched;

struct string * buffer = NULL;

***************
*** 285,291 ****




val = pattern_enter(&pattern, &alt_pattern, LINES-2,0,
! buffer, buffer1, redraw, page);

/* 0 == pattern given
1 == alt_pattern given
--- 290,296 ----


val = pattern_enter(&pattern, &alt_pattern, LINES-2,0,
! buffer, buffer1, &redraw, page);

/* 0 == pattern given
1 == alt_pattern given
***************

*** 361,366 ****


--- 366,373 ----
if (buffer1)
free_string(&buffer1);

+ if (redraw)
+ menu_trigger_redraw(page);

return(ret);
}
Index: elmME+.2.5.alpha2-cvs/src/pgp.c
*** elmME+.2.5.alpha1/src/pgp.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/pgp.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38.8.4 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 222,227 ****
--- 222,233 ----
return -1;
}

+ code = run_already_done(&RS,&stat);
+ if (0 != code) {
+ DPRINT(Debug,5,(&Debug,

+ "now pgp/gpg is ALREADY completing\n"));
+ }
+

retry:
while (fgets(buf, STRING, p) != NULL) {
DPRINT(Debug,10,(&Debug,

***************
*** 413,425 ****
redraw:
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpTo,
"To: "));
! status = optionally_enter (tobuf, LINES-1-2, 4,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! sizeof tobuf,

! page);
if (REDRAW_MARK == status)


goto redraw;
! if (status < 0 || tobuf[0] == '\0')
return FALSE;
}

--- 419,432 ----
redraw:
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpTo,
"To: "));
! status = optionally_enter(tobuf, LINES-1-2, 4,

! OE_APPEND_CURRENT|OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,
! sizeof tobuf,

! page);
if (REDRAW_MARK == status)


goto redraw;
! if (status != 0 || tobuf[0] == '\0')
return FALSE;
}

***************
*** 431,443 ****
redraw2:
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpFrom,
"From: "));
! status = optionally_enter (frombuf, LINES-1-2, 6,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! sizeof frombuf,

! page);
if (REDRAW_MARK == status)


goto redraw2;
! if (status < 0 || frombuf[0] == '\0')
return FALSE;
}
r = pgp_encrypt (filename, tobuf, frombuf, opts, auto_copy_sent, v,
--- 438,451 ----
redraw2:
PutLineX (LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpFrom,
"From: "));
! status = optionally_enter(frombuf, LINES-1-2, 6,

! OE_APPEND_CURRENT|OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,
! sizeof frombuf,

! page);
if (REDRAW_MARK == status)


goto redraw2;
! if (status != 0 || frombuf[0] == '\0')
return FALSE;
}
r = pgp_encrypt (filename, tobuf, frombuf, opts, auto_copy_sent, v,
***************

*** 888,898 ****


/* not reached */
}

! int pgp_mail_public_key (mailbox, aview, page)

struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{

int ret;
struct run_state RS;
CONST char * argv[20];

--- 896,910 ----
/* not reached */
}


! void pgp_mail_public_key (mailbox, aview, page)

struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{

+ /* If redraw is needed use


+ menu_trigger_redraw(page)
+ */
+

int ret;
struct run_state RS;
CONST char * argv[20];
***************

*** 910,940 ****


pgpkey[0] = '\0';

if (!(version = have_pgp(v)))
! return FALSE;

PutLineX(LINES-3, 0,
CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,

"Enter userid of public key: "));
CleartoEOS ();
! status = optionally_enter(userid, LINES-3, 28, OE_REDRAW_MARK,
sizeof userid, page);
while(REDRAW_MARK == status) {
PutLineX(LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,
"Enter userid of public key: "));
status = optionally_enter(userid, LINES-3, 28,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
sizeof userid, page);

need_redraw = TRUE;
}
! if ( status != 0)
! return(need_redraw);
!
if (GetPGPKey(userid, pgpkey, sizeof pgpkey, version) < 0) {
print_format_center(LINES-1,
CATGETS(elm_msg_cat, ElmSet, ElmPgpSorryUserId,
"Sorry, couldn't find that userid."));
ClearLine(LINES-3);
! return(TRUE);
}
elm_sfprintf(tmpfil, sizeof tmpfil,
FRM("%selm.%d.asc"), temp_dir, getpid());

--- 922,960 ----


pgpkey[0] = '\0';

if (!(version = have_pgp(v)))
! return;

PutLineX(LINES-3, 0,
CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,

"Enter userid of public key: "));
CleartoEOS ();

! status = optionally_enter(userid, LINES-3, 28, OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof userid, page);
while(REDRAW_MARK == status) {
PutLineX(LINES-1-2, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpEntUser,
"Enter userid of public key: "));
status = optionally_enter(userid, LINES-3, 28,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

sizeof userid, page);
need_redraw = TRUE;
}

!

! if ( status != 0) {
! if (need_redraw)

! menu_trigger_redraw(page);
! return;
! }
!

if (GetPGPKey(userid, pgpkey, sizeof pgpkey, version) < 0) {
print_format_center(LINES-1,
CATGETS(elm_msg_cat, ElmSet, ElmPgpSorryUserId,
"Sorry, couldn't find that userid."));
ClearLine(LINES-3);

!
! menu_trigger_redraw(page);
! return;
}

elm_sfprintf(tmpfil, sizeof tmpfil,
FRM("%selm.%d.asc"), temp_dir, getpid());
***************

*** 986,1003 ****


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailSignal,
"%.30s fail: Signal?"),
argv[0]);
! return TRUE;
} else if (ret > 0) {
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),
argv[0],error_description(RS.save_errno));
! return TRUE;
} else if (exit_code) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpErrorStatus,
"Pgp returned error status %d"),
exit_code);
! return TRUE;
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpDone,
"Running PGP... Done."));

--- 1006,1027 ----


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailSignal,
"%.30s fail: Signal?"),
argv[0]);

! menu_trigger_redraw(page);
! return;


} else if (ret > 0) {
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),
argv[0],error_description(RS.save_errno));

!
! menu_trigger_redraw(page);
! return;

} else if (exit_code) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpErrorStatus,
"Pgp returned error status %d"),
exit_code);

! menu_trigger_redraw(page);
! return;
} else {

lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpDone,
"Running PGP... Done."));
***************

*** 1007,1013 ****


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmLostErrno,
"%.30s lost: %.40s"),
argv[0],error_description(RS.save_errno));
! return TRUE;
}
} else {
if (RS.save_errno)

--- 1031,1038 ----


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmLostErrno,
"%.30s lost: %.40s"),
argv[0],error_description(RS.save_errno));

! menu_trigger_redraw(page);
! return;
}
} else {

if (RS.save_errno)
***************
*** 1018,1024 ****


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantStart,
"Can't start %.30s"),
argv[0]);
! return TRUE;
}

/* set the default subject for this message */

--- 1043,1050 ----


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantStart,
"Can't start %.30s"),
argv[0]);
! menu_trigger_redraw(page);
! return;
}

/* set the default subject for this message */
***************

*** 1036,1048 ****


unlink (included_file); /* make sure to clean up. */

included_file[0] = '\0';
pgp_status = 0; /* reset */
! return(TRUE);
}

! int pgp_extract_public_key (hdr, infile)
struct header_rec *hdr;
FILE *infile;
{
char tempfile[STRING];
struct run_state RS;
CONST char *argv[20];

--- 1062,1081 ----


unlink (included_file); /* make sure to clean up. */

included_file[0] = '\0';
pgp_status = 0; /* reset */

!
! menu_trigger_redraw(page);
! return;
}

! void pgp_extract_public_key (hdr, infile, page)
struct header_rec *hdr;
FILE *infile;
+ struct menu_context *page;
{

+ /* If redraw is needed, use


+ menu_trigger_redraw(page)
+ */
+

char tempfile[STRING];
struct run_state RS;
CONST char *argv[20];
***************

*** 1053,1062 ****


enum pgp_version version;

if (!hdr)
! return FALSE;

if (!(version = have_pgp(v)))
! return FALSE;

elm_sfprintf(tempfile,sizeof tempfile,
FRM("%selm.%d"),temp_dir,getpid());

--- 1086,1095 ----


enum pgp_version version;

if (!hdr)
! return;

if (!(version = have_pgp(v)))
! return;

elm_sfprintf(tempfile,sizeof tempfile,
FRM("%selm.%d"),temp_dir,getpid());
***************

*** 1065,1076 ****


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmOpenTmpWriting,
"Could not open temp file %.30s for writing!"),
tempfile);
! return FALSE;
}
if (!copy_message_f(infile,hdr,
"",fpout,0,NULL)) {
fclose(fpout);
! return FALSE;
}
fclose(fpout);

--- 1098,1109 ----


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmOpenTmpWriting,
"Could not open temp file %.30s for writing!"),
tempfile);
! return;
}
if (!copy_message_f(infile,hdr,
"",fpout,0,NULL)) {
fclose(fpout);
! return;
}
fclose(fpout);

***************

*** 1104,1110 ****


wait_end(&RS,&exit_code);
}
unlink(tempfile);
! return TRUE;
}

#endif /* USE_PGP */

--- 1137,1145 ----
wait_end(&RS,&exit_code);
}
unlink(tempfile);


!
! menu_trigger_redraw(page);
! return;
}

#endif /* USE_PGP */
Index: elmME+.2.5.alpha2-cvs/src/quit.c
*** elmME+.2.5.alpha1/src/quit.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/quit.c 2004-08-14 15:06:11.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: quit.c,v 1.36.8.2 2004/05/02 11:05:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: quit.c,v 1.36.8.5 2004/08/14 12:06:11 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.5 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 68,74 ****


/* NOTICE: prompt_letter may return EOF */

ans = prompt_letter(LINES-1,"P",*def_ans_no,

PROMPT_center|PROMPT_yesno|
! PROMPT_redraw_mark|PROMTP_ctrlL,
page,

CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveFolderQuit,
"Failed to leave folder: Try to quit again ? ([P]anic/%c/%c) "),

--- 68,74 ----


/* NOTICE: prompt_letter may return EOF */

ans = prompt_letter(LINES-1,"P",*def_ans_no,
PROMPT_center|PROMPT_yesno|

! PROMPT_redraw_mark|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveFolderQuit,
"Failed to leave folder: Try to quit again ? ([P]anic/%c/%c) "),


***************
*** 93,108 ****
return;
}
}
! leave(0, mailbox,aview);
}

! int resync(mailbox, header_page, page)

struct MailboxView **mailbox;
int *header_page;
struct menu_context *page;
{

/** Resync on the current folder. Leave current and read it back in.
! Return indicates whether a redraw of the screen is needed.
**/
int err;

--- 93,111 ----
return;
}
}
! leave(0);
}

! void resync(mailbox, header_page, page)

struct MailboxView **mailbox;
int *header_page;
struct menu_context *page;
{

! int change_file(mailbox, aview, header_page, page)
struct MailboxView **mailbox;


struct AliasView *aview;
int *header_page;

--- 156,174 ----

Raw_OFF(1); /* Will reprint error */

! leave(0);
}

newmbox_1(storage->current_folder, FALSE, mailbox,1, header_page,
page);
}
}

!
! menu_trigger_redraw(page);
! return;
}

! void change_file(mailbox, aview, header_page, page)
struct MailboxView **mailbox;


struct AliasView *aview;
int *header_page;

***************
*** 173,179 ****
* If leave goes okay (i.e. no new messages in current folder),
* change to the folder that the user specified.
*
! * Return value indicates whether a redraw is needed.
*/

int redraw = FALSE;
--- 179,185 ----
* If leave goes okay (i.e. no new messages in current folder),
* change to the folder that the user specified.
*

! * If redraw is needed use menu_trigger_redraw(page)
*/

int redraw = FALSE;
***************

*** 297,303 ****


/* NOTICE: prompt_letter may return EOF */

ans = prompt_letter(LINES-1,"P",*def_ans_no,

PROMPT_center|PROMPT_yesno|
! PROMPT_redraw_mark|PROMTP_ctrlL,
page,

CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveChange,
"Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "),
--- 303,309 ----


/* NOTICE: prompt_letter may return EOF */

ans = prompt_letter(LINES-1,"P",*def_ans_no,
PROMPT_center|PROMPT_yesno|

! PROMPT_redraw_mark|PROMPT_ctrlL,
page,
CATGETS(elm_msg_cat, ElmSet, ElmFailedLeaveChange,
"Failed to leave folder: Try to change again ? ([P]anic/%c/%c) "),
***************
*** 334,340 ****
DPRINT(Debug,3,(&Debug,
"--> Need reopen new folder...\n"));

! new_folder = folder_from_dir_item(XXX);

if (!new_folder ||
!sessionlock_folder(new_folder,SESSIONLOCK_NORMAL)) {
--- 340,346 ----
DPRINT(Debug,3,(&Debug,
"--> Need reopen new folder...\n"));

! new_folder = folder_from_dir_item(XXX,TreatAsSpooled);

if (!new_folder ||
!sessionlock_folder(new_folder,SESSIONLOCK_NORMAL)) {


***************
*** 362,368 ****

free_dir(&XXX);

! return redraw;
}

/*
--- 368,376 ----

free_dir(&XXX);

! if (redraw)
! menu_trigger_redraw(page);

! return;
}

/*
Index: elmME+.2.5.alpha2-cvs/src/read_rc.c
*** elmME+.2.5.alpha1/src/read_rc.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/read_rc.c 2004-08-14 09:40:48.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.24.8.3 2004/05/22 14:50:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.3 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.24.8.4 2004/08/14 06:40:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 124,130 ****
if (access(filename, 00) == -1) {
struct menu_context *cpage;

! if(batch_only) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBatchDirNotice,
"\nNotice:\
\nThis version of ELM requires the use of a .elm directory to store your\
--- 124,130 ----
if (access(filename, 00) == -1) {
struct menu_context *cpage;

! if(!OPMODE_IS_INTERACTIVE(opmode)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBatchDirNotice,
"\nNotice:\
\nThis version of ELM requires the use of a .elm directory to store your\
***************
*** 188,194 ****
if (access(folders, 00) == -1) {
struct menu_context *cpage;

! if(batch_only) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBatchNoticeFoldersDir,
"\n\
Notice:\n\
--- 188,194 ----
if (access(folders, 00) == -1) {
struct menu_context *cpage;

! if( ! OPMODE_IS_INTERACTIVE(opmode)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBatchNoticeFoldersDir,
"\n\
Notice:\n\
Index: elmME+.2.5.alpha2-cvs/src/remail.c
*** elmME+.2.5.alpha1/src/remail.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/remail.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remail.c,v 1.35 2004/03/27 18:31:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remail.c,v 1.35.8.1 2004/08/07 18:07:19 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 60,66 ****
/** remail a message... returns TRUE if new foot needed ... **/

struct mail_send_state * mailer = NULL;

!
char buffer[VERY_LONG_STRING], ch;

int encoding = ENCODING_NONE;
--- 60,67 ----
/** remail a message... returns TRUE if new foot needed ... **/

struct mail_send_state * mailer = NULL;

! redraw += menu_need_redraw(page);
!

if (current_header -> status & MIME_MESSAGE) {
encoding = current_header->mime_rec.encoding;

***************
*** 166,172 ****
if(mailer)
free_mail_send_state(&mailer);

!
free_mailing_headers(&mailing_headers);

free_mailer_info(&mailer_info);
--- 169,177 ----
if(mailer)
free_mail_send_state(&mailer);

! if (redraw)
! menu_trigger_redraw(page);
!

free_mailing_headers(&mailing_headers);

free_mailer_info(&mailer_info);
Index: elmME+.2.5.alpha2-cvs/src/reply.c
*** elmME+.2.5.alpha1/src/reply.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/reply.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: reply.c,v 1.35.8.3 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.3 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: reply.c,v 1.35.8.5 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 307,323 ****
return result;
}

! int reply(index, mailbox, aview, page)


int index;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

{
! /** Reply to the current message. Returns non-zero iff
! the screen has to be rewritten. **/

char subject[SLEN];
! int return_value, form_letter;

struct addr_item * rt = NULL;
struct string * temp1 = NULL;
char * temp2 = NULL;

--- 307,326 ----
return result;
}

! void reply(index, mailbox, aview, page)

int index;
struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

{
! /** Reply to the current message.
!
! If screen nedd to redraw, use menu_trigger_redraw(page)
! **/

char subject[SLEN];

! int redraw = 0;
! int form_letter;


struct addr_item * rt = NULL;
struct string * temp1 = NULL;
char * temp2 = NULL;

***************
*** 328,337 ****
if (!give_message_data(mailbox,index,
&current_header,&F,NULL,
NO_mime_parse))
! return 0;

if (! current_header || !F)
! return 0;

rt = handle_reply_to(current_header,F);

--- 331,340 ----
if (!give_message_data(mailbox,index,
&current_header,&F,NULL,
NO_mime_parse))
! return;

if (! current_header || !F)

! return;

rt = handle_reply_to(current_header,F);

***************
*** 354,366 ****

sizeof subject);

if (form_letter)
! return_value = mail_filled_in_form(index,rt, subject,

mailbox, aview);
else {
! return_value = send_msg_l(index,rt, NULL, subject,

! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);
}

if (rt)
--- 357,371 ----
sizeof subject);

if (form_letter)


! redraw = mail_filled_in_form(index,rt, subject,
mailbox, aview);
else {
! send_msg_l(index,rt, NULL, subject,

! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);


!
! redraw += menu_need_redraw(page);
}

if (rt)
***************
*** 369,378 ****
free_string(&temp1);
free(temp2);

! return(return_value);


}

! int reply_to_everyone(index,mailbox, aview, page)

int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;

--- 374,386 ----
free_string(&temp1);
free(temp2);


! if (redraw)
! menu_trigger_redraw(page);
!

! return;
}

! void reply_to_everyone(index,mailbox, aview, page)

int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;

***************
*** 384,390 ****


has to be rewritten. **/

char subject[SLEN];
! int return_value;

struct addr_item * rt;
struct addr_item * cc;

--- 392,398 ----
has to be rewritten. **/

char subject[SLEN];


! int redraw = 0;

struct addr_item * rt;


struct addr_item * cc;

***************

*** 399,408 ****


if (!give_message_data(mailbox,index,
&current_header,&F,NULL,
NO_mime_parse))
! return 0;

if (! current_header || !F)
! return 0;

rt = handle_reply_to(current_header,F);
cc = get_and_expand_everyone(current_header,rt);

--- 407,416 ----


if (!give_message_data(mailbox,index,
&current_header,&F,NULL,
NO_mime_parse))
! return;

if (! current_header || !F)
! return;



rt = handle_reply_to(current_header,F);
cc = get_and_expand_everyone(current_header,rt);

***************
*** 419,428 ****


"Re: your mail"),
sizeof subject);

! return_value = send_msg_l(index,rt, cc, subject,
! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);


if (rt)
free_addr_items(rt);
if (cc)

--- 427,439 ----


"Re: your mail"),
sizeof subject);

! send_msg_l(index,rt, cc, subject,
! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);


!
! redraw += menu_need_redraw(page);
!

if (rt)
free_addr_items(rt);
if (cc)

***************
*** 431,440 ****
free_string(&temp1);
free(temp2);

! return(return_value);
}

! int forward(index,mailbox,aview, page)


int index;
struct MailboxView *mailbox;
struct AliasView *aview;

--- 442,454 ----
free_string(&temp1);
free(temp2);


! if (redraw)
! menu_trigger_redraw(page);
!

! return;
}

! void forward(index,mailbox,aview, page)

int index;
struct MailboxView *mailbox;
struct AliasView *aview;

***************
*** 445,462 ****


get the address and route the mail. Modified to also set
'noheader' to FALSE also, so that the original headers
of the message sent are included in the message body also.

! Return TRUE if the main part of the screen has been changed

! (useful for knowing whether a redraw is needed.
**/

char subject[SLEN];
! int results, edit_msg = FALSE;
int LINES, COLUMNS;


struct header_rec *current_header = give_header(mailbox,index);

menu_get_sizes(page, &LINES, &COLUMNS);

! if (! current_header) return 0;

if (current_header->status & FORM_LETTER)
PutLineX(LINES-4,COLUMNS-40,

--- 459,478 ----


get the address and route the mail. Modified to also set
'noheader' to FALSE also, so that the original headers
of the message sent are included in the message body also.
!
! if the main part of the screen has been changed
! use menu_trigger_redraw()
**/

char subject[SLEN];

! int edit_msg = FALSE;
int LINES, COLUMNS;


struct header_rec *current_header = give_header(mailbox,index);

menu_get_sizes(page, &LINES, &COLUMNS);

! if (! current_header)
! return;

if (current_header->status & FORM_LETTER)
PutLineX(LINES-4,COLUMNS-40,
***************

*** 464,476 ****


ElmNoEditingAllowed,
"<No editing allowed.>"));
else {
! elm_sfprintf(subject, sizeof subject,
! CATGETS(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,

! "Edit outgoing message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


! edit_msg = (want_to(subject,
! *def_ans_yes, LINES-4, 0,page
! ) != *def_ans_no);
}

if (current_header-> subject &&

--- 480,500 ----


ElmNoEditingAllowed,
"<No editing allowed.>"));
else {

! int X1 = prompt_letter(LINES-4,"",*def_ans_yes,
! PROMPT_yesno|PROMPT_cancel,page,
!
! CATGETS(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,

! "Edit outgoing message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
! if (TERMCH_interrupt_char == X1) {
! return;
! }
!
! if (EOF == X1)
! return;
!
! edit_msg = (X1 != *def_ans_no);
}

if (current_header-> subject &&
***************
*** 495,515 ****


"(fwd)") != 0))
strfcat(subject, " (fwd)", sizeof subject);

! results = send_msg_l(index,
NULL, NULL, subject,
(edit_msg ? MAIL_EDIT_MSG : 0 ) |
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,

mailbox, aview,
! page);

free_string(&temp1);
free(temp2);

}

else
! results = send_msg_l(index,
NULL, NULL,
/* TODO: Fix this mess... */
catgets(elm_msg_cat, ElmSet, ElmForwardedMail,

--- 519,539 ----


"(fwd)") != 0))
strfcat(subject, " (fwd)", sizeof subject);

! send_msg_l(index,


NULL, NULL, subject,
(edit_msg ? MAIL_EDIT_MSG : 0 ) |
MAIL_FORWARDING,
current_header->status & FORM_LETTER ?
PREFORMATTED : allow_forms,

mailbox, aview,
! page);

free_string(&temp1);
free(temp2);

}
else

! send_msg_l(index,


NULL, NULL,
/* TODO: Fix this mess... */
catgets(elm_msg_cat, ElmSet, ElmForwardedMail,
***************

*** 520,526 ****


PREFORMATTED : allow_forms,
mailbox, aview,
page);
! return(results);
}

void get_return_name(address, name, trans_to_lowercase, size)

--- 544,551 ----
PREFORMATTED : allow_forms,
mailbox, aview,
page);
!

! return;
}

void get_return_name(address, name, trans_to_lowercase, size)

Index: elmME+.2.5.alpha2-cvs/src/savecopy.c
*** elmME+.2.5.alpha1/src/savecopy.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/savecopy.c 2004-08-14 09:40:48.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44.8.2 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44.8.3 2004/08/14 06:40:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 290,296 ****
* to ask the user to confirm. So we have
* to use sent_mail anyway.
*/
! if (batch_only)
goto use_sent_mail2;
else {
char * msg_buffer = NULL;
--- 290,296 ----
* to ask the user to confirm. So we have
* to use sent_mail anyway.
*/
! if (!OPMODE_IS_INTERACTIVE(opmode))
goto use_sent_mail2;
else {
char * msg_buffer = NULL;
***************
*** 340,346 ****
* to ask the user to confirm. So we have
* to use sent_mail anyway.
*/
! if (batch_only)
goto use_sent_mail2;
else {
char * msg_buffer = NULL;
--- 340,346 ----
* to ask the user to confirm. So we have
* to use sent_mail anyway.
*/
! if (! OPMODE_IS_INTERACTIVE(opmode))
goto use_sent_mail2;
else {
char * msg_buffer = NULL;
Index: elmME+.2.5.alpha2-cvs/src/screen/context.c
*** elmME+.2.5.alpha1/src/screen/context.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/screen/context.c 2004-08-07 21:07:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: context.c,v 1.3.8.1 2004/04/25 14:52:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: context.c,v 1.3.8.2 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 146,159 ****
--- 146,178 ----

if (ptr->redraw) {

+ /* Reset ptr->redraw .... */
+
ptr->redraw = ROOT_MENU.redraw; /* ? ? ? ? */

+ DPRINT(Debug,7, (&Debug,
+ "menu_need_redraw(%p): returning redraw\n",
+ ptr));
+
return 1;
}

return 0;
}

+ void menu_trigger_redraw(ptr)
+ struct menu_context *ptr;
+ {
+ if (ptr->magic != MENU_CONTEXT_magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_trigger_redraw",
+ "Bad type magic number",0);
+ DPRINT(Debug,7, (&Debug,
+ "menu_trigger_redraw(%p): triggering redraw\n",
+ ptr));

+ ptr->redraw = 1;
+ }
+
+

static VOLATILE int resize_screen = 0; /** SIGWINCH occured? **/
static VOLATILE int redraw_screen = 0; /** Elm suspended? **/

Index: elmME+.2.5.alpha2-cvs/src/screen/curses.c
*** elmME+.2.5.alpha1/src/screen/curses.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/screen/curses.c 2004-07-19 12:20:02.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curses.c,v 1.7.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curses.c,v 1.7.8.2 2004/07/19 09:20:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 30,36 ****


#undef columns /* ... But undefine columns macro */

#ifdef TERMIOS
- # include <termios.h>

# ifndef sun
# include <sys/ioctl.h> /* for TIOCGWINSZ */
# endif

--- 30,35 ----
***************
*** 180,185 ****
--- 179,185 ----


"/dev/tty is fd %d\n",terminal_fd));
}

+ get_term_chars(terminal_fd);

/* load in all those pesky values */
_clearscreen = tgetstr("cl", &ptr); /* Clear screen and cursor home */
***************

*** 1247,1252 ****
--- 1247,1310 ----


}
}

+ #ifdef TERMIOS
+
+ int toggle_lflag(T,enab,disab)
+ struct tf_state *T;
+ int enab,disab;
+ {

+ T->old_raw_ok = 0;
+

+ if (! _inraw) {
+ DPRINT(Debug,1,(&Debug,"toggle_lflag: _in_raw not set!\n"));

+ return 0;
+ }
+

+ if (tcgetattr(terminal_fd,&_raw_tty) < 0) {
+ DPRINT(Debug,1,(&Debug,"toggle_lflag: tcgetattr failed\n"));
+ return 0;
+ }
+ T->old_raw = _raw_tty;
+ T->old_raw_ok = 1;
+
+ DPRINT(Debug,10,(&Debug,
+ "toggle_lflag: enable 0x%04x disable 0x%04x old: 0x%04x\n",
+ enab,disab,_raw_tty.c_lflag));
+
+ _raw_tty.c_lflag |= enab;
+ _raw_tty.c_lflag &= ~disab;
+
+ if (tcsetattr(terminal_fd,TCSANOW,&_raw_tty) < 0) {
+ DPRINT(Debug,1,(&Debug,"reset_lfalg: tcsetattr failed\n"));
+ return 0;
+ }
+
+ DPRINT(Debug,10,(&Debug,"toggle_lflag: set: 0x%04x\n",_raw_tty.c_lflag));

+
+ return 1;
+ }
+

+ void reset_lfag(T)
+ struct tf_state *T;
+ {
+ if (!T->old_raw_ok) {
+ DPRINT(Debug,1,(&Debug,"reset_lfalg: old_raw not ok\n"));

+ return;
+ }
+

+ if (! _inraw) {
+ DPRINT(Debug,1,(&Debug,"reset_lflag: _inraw not set!\n"));

+ return;
+ }
+

+ if (tcsetattr(terminal_fd,TCSANOW,& (T->old_raw)) < 0) {
+ DPRINT(Debug,1,(&Debug,"toggle_lflag: tcsetattr failed\n"));
+ return;
+ }
+
+ DPRINT(Debug,10,(&Debug,"reset_lflag: set: 0x%04x\n",T->old_raw.c_lflag));
+ }
+ #endif

/* NOTE: Is called from signal handler! */
void transmit_functions(newstate)

Index: elmME+.2.5.alpha2-cvs/src/screen/curs_input.c
*** elmME+.2.5.alpha1/src/screen/curs_input.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/screen/curs_input.c 2004-08-15 20:22:35.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.6.8.2 2004/05/04 18:39:33 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6.8.2 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.6.8.4 2004/08/15 17:22:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 31,42 ****

#include <errno.h>

- char backspace, /* the current backspace char */


- kill_line, /* the current kill_line char */

- word_erase, /* the current word-erase char */
- interrupt_char, /* the current interrupt char */
- reprint_char, /* the current reprint-line char */
- eof_char; /* the current end-of-file char */



#if POLL_METHOD
static unsigned char *read_buffer = NULL;

--- 31,36 ----
***************
*** 114,119 ****
--- 108,115 ----


seconds));
return 1;
}
+ FlushBuffer();
+
SIGDPRINT(Debug,5,(&Debug,
"error_sleep(%d) ...\n",seconds));
ret = wait_for_action_or_timeout(background_read,seconds);
***************

*** 126,131 ****
--- 122,129 ----


int error_sleep(seconds)
int seconds;
{
+ FlushBuffer();
+
return sleep(seconds);
}
#endif
***************

*** 156,176 ****


if (!ch) {
ret = EOF;
DPRINT(Debug,4,(&Debug,
! "ReadCh=EOF (errno=%d)\n",errno));
} else if (ch -> caller_flags) {
ret = ch -> caller_flags;
DPRINT(Debug,4,(&Debug,
! "ReadCh=%d (flags)\n",ret));
} else
ret = state_is_onebyte(ch);
if (!ret) {
DPRINT(Debug,4,(&Debug,
! "ReadCh: Not a one byte character or zero byte!"));
/* Ring a bell */
Writechar('\007');
} else {
DPRINT(Debug,4,(&Debug,
! "ReadCh=%d (one byte character)\n",
ret));
}
} while (0 == ret);

--- 154,174 ----


if (!ch) {
ret = EOF;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh=EOF (errno=%d)\n",errno));
} else if (ch -> caller_flags) {
ret = ch -> caller_flags;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh=%d (flags)\n",ret));
} else
ret = state_is_onebyte(ch);
if (!ret) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh: Not a one byte character or zero byte!"));
/* Ring a bell */
Writechar('\007');
} else {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh=%d (one byte character)\n",
ret));
}
} while (0 == ret);

***************
*** 178,183 ****
--- 176,185 ----


}


+ #ifdef TERMIOS
+ #include <termios.h>
+ #endif
+
struct charset_state * cur_ReadCh2(flags,break_flag,
mc)
int flags;
***************

*** 188,195 ****


int cursorkeys = (flags & READCH_CURSOR) != 0;
int nocursor = (flags & READCH_NOCURSOR) != 0 && cursor_control;
int term_char = (flags & READCH_term_char) != 0;
! int resize_flag = (flags & READCH_resize) != 0;
! int x,y;

unsigned char input_buffer[20];

--- 190,199 ----


int cursorkeys = (flags & READCH_CURSOR) != 0;
int nocursor = (flags & READCH_NOCURSOR) != 0 && cursor_control;
int term_char = (flags & READCH_term_char) != 0;
! int resize_flag = (flags & READCH_resize) != 0;
! int sig_char = (flags & READCH_sig_char) != 0;
! int quote_char = (flags & READCH_quote) != 0;
! int line,col;

unsigned char input_buffer[20];

***************

*** 223,235 ****



int read_p,found_key;

#if POLL_METHOD
change_action(terminal_fd,0,background_read,no_action_routine,
no_action_routine,
NULL);
#endif

! cur_GetXYLocation(&x,&y); /* Background actions may print error messages .. */

if (!last_state) {
last_state = new_state(system_charset);

--- 227,247 ----



int read_p,found_key;

+ #ifdef TERMIOS
+ struct tf_state T;
+
+ bzero((void *)&T,sizeof T);
+ #endif
+
#if POLL_METHOD
change_action(terminal_fd,0,background_read,no_action_routine,
no_action_routine,
NULL);
#endif

! cur_GetXYLocation(&line,&col); /* Background actions may print error messages .. */
! DPRINT(Debug,4,(&Debug,"cur_ReadCH2: line=%d col=%d\n",
! line,col));

if (!last_state) {
last_state = new_state(system_charset);
***************

*** 242,248 ****



if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: starting reading new character (set %s)\n",
last_state->charset->MIME_name ?
last_state->charset->MIME_name :
"<no MIME name>"));

--- 254,260 ----



if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: starting reading new character (set %s)\n",
last_state->charset->MIME_name ?
last_state->charset->MIME_name :
"<no MIME name>"));
***************

*** 250,312 ****

--- 262,346 ----


}
last_state->caller_flags = 0;

+ #ifdef TERMIOS
+ if (sig_char || quote_char) {
+ if (toggle_lflag(&T,0,ISIG)) {
+ DPRINT(Debug,4,(&Debug,

+ "cur_ReadCh2: Disabled generation of signals\n"));
+
+ }
+ } else {
+ toggle_lflag(&T,0,0); /* Just read values */
+ }
+ #endif
+

*** 328,334 ****


if(!wait_for_action(background_read)) {
if (errno != 0) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: wait_for_action got error %d (%s)\n",
errno, error_description(errno)));

check_changes();

--- 362,368 ----


if(!wait_for_action(background_read)) {
if (errno != 0) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: wait_for_action got error %d (%s)\n",
errno, error_description(errno)));

check_changes();
***************

*** 367,373 ****


continue;
}
DPRINT(Debug,4,(&Debug,
! "ReadCh2: interrupted (ignored)\n"));
continue;
}
}

--- 401,407 ----


continue;
}
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: interrupted (ignored)\n"));
continue;
}
}
***************

*** 378,384 ****


} else if (last_read_error != 0) {
if (-1 == last_read_error) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: background_read got zero bytes...\n"));
found_key = -1;
continue;
}

--- 412,418 ----


} else if (last_read_error != 0) {
if (-1 == last_read_error) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: background_read got zero bytes...\n"));
found_key = -1;
continue;
}
***************

*** 404,410 ****


if (last_read_error != 0) {
errno = last_read_error;
DPRINT(Debug,4,(&Debug,
! "ReadCh2: background_read got error %d (%s)\n",
last_read_error,
error_description(last_read_error)));
found_key = -1;

--- 438,444 ----


if (last_read_error != 0) {
errno = last_read_error;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: background_read got error %d (%s)\n",
last_read_error,
error_description(last_read_error)));
found_key = -1;
***************

*** 412,418 ****


continue; /* continue or quit */
} else {
DPRINT(Debug,1,(&Debug,
! "ReadCh2: SOFTWARE ERROR !!\n"));
break;
}
#else

--- 446,452 ----


continue; /* continue or quit */
} else {
DPRINT(Debug,1,(&Debug,
! "cur_ReadCh2: SOFTWARE ERROR !!\n"));
break;
}
#else
***************

*** 423,429 ****


if (result < 0) {
int err = errno;
DPRINT(Debug,4,(&Debug,
! "ReadCh2: errno = %d [%s]\n",err,
error_description(err)));

check_changes();

--- 457,463 ----


if (result < 0) {
int err = errno;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: errno = %d [%s]\n",err,
error_description(err)));

check_changes();
***************

*** 458,464 ****


}
if (0 == result) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Got zero bytes...\n"));
found_key = -1;
continue;
}

--- 492,498 ----


}
if (0 == result) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Got zero bytes...\n"));
found_key = -1;
continue;
}
***************

*** 480,486 ****




DPRINT(Debug,50,(&Debug,
! "ReadCh2: Looking char %d (read_p=%d)\n",ch,read_p));

if (term_char) {
if (backspace == ch)

--- 514,526 ----




DPRINT(Debug,50,(&Debug,
! "cur_ReadCh2: Looking char %d (read_p=%d)\n",ch,read_p));
!
! if (quote_char) {
! DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Quoting current character %0xd\n",ch));
! found_key = ch;
! }

if (term_char) {
if (backspace == ch)
***************

*** 489,503 ****


found_key = TERMCH_kill_line;
if (word_erase == ch)
found_key = TERMCH_word_erase;
- if (interrupt_char == ch)
- found_key = TERMCH_interrupt_char;
if (reprint_char == ch)
found_key = TERMCH_reprint_char;
if (eof_char == ch)
found_key = TERMCH_eof_char;
if (found_key) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: found termchar = %d (char=%02X)\n",
found_key,ch));
/* Soft reset state */
reset_state(last_state,0);

--- 529,596 ----


found_key = TERMCH_kill_line;
if (word_erase == ch)
found_key = TERMCH_word_erase;
if (reprint_char == ch)
found_key = TERMCH_reprint_char;
if (eof_char == ch)
found_key = TERMCH_eof_char;
+

if (found_key) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: found termchar = %d (char=%02X)\n",
! found_key,ch));
! /* Soft reset state */
! reset_state(last_state,0);

! break;
! }
! }
!

! if (sig_char) {
! if (interrupt_char == ch)
! found_key = TERMCH_interrupt_char;
! if (VQUIT_char == ch)
! found_key = TERMCH_interrupt_char;
! if (VSUSP_char == ch) {
! SIGHAND_TYPE (*sig1)(), (*sig2)();
!
! DPRINT(Debug,1,(&Debug,
! "cur_ReadCh2: Found suspend character!\n"));
!
! #ifdef SIGTSTP
! menu_context_redraw();
! switch_title(0);
! CarriageReturn();
!
! Raw(OFF);
! sig1 = signal(SIGTSTP, SIG_DFL);
! sig2 = signal(SIGCONT, SIG_DFL);
!
! WriteRaw(Stopped_Text);
!
! kill(getpid(), SIGSTOP);
!
! CarriageReturn();
!
! WriteRaw(Back_Text);
!
! Raw(ON);
!
! signal(SIGTSTP, sig1);
! signal(SIGCONT, sig2);
!
! reset_state(last_state,1);
! if (redraw) {
! DPRINT(Debug,1,(&Debug,
! "cur_ReadCh2: returning redraw because of suspend\n"));
! cur_ClearScreen(mc);
! found_key = redraw;
! } else
! goto reinit_ReadChar;
! #endif
! }
!
! if (found_key) {
! DPRINT(Debug,4,(&Debug,


! "cur_ReadCh2: found sigchar = %d (char=%02X)\n",
found_key,ch));
/* Soft reset state */
reset_state(last_state,0);
***************

*** 517,523 ****


if (str[read_p+1] == '\0') {
found_key = keytable[i].result;
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Found function key = %d (keytable = %d, read_p =%d)\n",
found_key,i,read_p));

/* Soft reset state */

--- 610,616 ----


if (str[read_p+1] == '\0') {
found_key = keytable[i].result;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Found function key = %d (keytable = %d, read_p =%d)\n",
found_key,i,read_p));

/* Soft reset state */
***************

*** 548,554 ****



if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Unsupporting -- function keys and state change sequences overlap? (OR BAD SEQUENCE) \n"));
goto BAD_sequence;
}

--- 641,647 ----



if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Unsupporting -- function keys and state change sequences overlap? (OR BAD SEQUENCE) \n"));
goto BAD_sequence;
}

***************

*** 561,567 ****


if (state_ready(last_state))
goto got_key;
DPRINT(Debug,4,(&Debug,
! "ReadCh2: need more bytes for character...\n"));
goto reinit_ReadChar;


--- 654,660 ----


if (state_ready(last_state))
goto got_key;
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: need more bytes for character...\n"));
goto reinit_ReadChar;


***************

*** 571,581 ****


reset_state(last_state,0);

DPRINT(Debug,4,(&Debug,
! "ReadCh2: Bad escape sequence; ch = %d, read_p = %d\n",
ch,read_p));
#ifdef DEBUG
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Sequence was:"));
for (i = 0; i <= read_p && i < sizeof input_buffer -1; i++) {
if (isascii(input_buffer[i]) && isprint(input_buffer[i])) {
DPRINT(Debug,4,(&Debug," %c (0x%02X)",

--- 664,674 ----


reset_state(last_state,0);

DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Bad escape sequence; ch = %d, read_p = %d\n",
ch,read_p));
#ifdef DEBUG
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Sequence was:"));
for (i = 0; i <= read_p && i < sizeof input_buffer -1; i++) {
if (isascii(input_buffer[i]) && isprint(input_buffer[i])) {
DPRINT(Debug,4,(&Debug," %c (0x%02X)",
***************

*** 599,611 ****


found_key = ch;

}
!
if (found_key <= 0 && redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Redraw...\n"));
if(!cur_RawState()) { /* Check that we have in 'raw' mode */
DPRINT(Debug,4,(&Debug,
! "ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
}
cur_ClearScreen(mc);

--- 692,704 ----


found_key = ch;

}
!
if (found_key <= 0 && redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Redraw...\n"));
if(!cur_RawState()) { /* Check that we have in 'raw' mode */
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
}
cur_ClearScreen(mc);
***************

*** 613,629 ****


reset_state(last_state,1);
last_state->caller_flags = redraw;

return last_state;
}

! cur_MoveCursor(x,y);
DPRINT(Debug,50,(&Debug,
! "ReadCh2: found_key=%d\n",found_key));

if (found_key < 0) {
reset_state(last_state,1);
DPRINT(Debug,4,(&Debug,
! "ReadCh2=NULL (state)\n"));
return NULL;
} else {
if (found_key >= 256) {

--- 706,732 ----


reset_state(last_state,1);
last_state->caller_flags = redraw;

+ #ifdef TERMIOS
+ reset_lfag(&T);
+ #endif
+
return last_state;
}

! cur_MoveCursor(line,col);
DPRINT(Debug,50,(&Debug,
! "cur_ReadCh2: found_key=%d (line=%d col=%d)\n",
! found_key, line,col));

if (found_key < 0) {
reset_state(last_state,1);
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2=NULL (state)\n"));
!
! #ifdef TERMIOS
! reset_lfag(&T);
! #endif
!
return NULL;
} else {
if (found_key >= 256) {
***************

*** 635,641 ****


/* Ring a bell */
Writechar('\007');
DPRINT(Debug,4,(&Debug,
! "ReadCh2: bad sequence...\n"));
reset_state(last_state,1);
}
}

--- 738,744 ----


/* Ring a bell */
Writechar('\007');
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: bad sequence...\n"));
reset_state(last_state,1);
}
}
***************

*** 644,658 ****


if (!state_ready(last_state) &&
!last_state->caller_flags) {
DPRINT(Debug,4,(&Debug,
! "ReadCh2: need more bytes for character...\n"));
goto reinit_ReadChar;
}

got_key:
DPRINT(Debug,4,(&Debug,
! "ReadCh2=%p (state): caller_flags=%d, ready=%d\n",
last_state,last_state->caller_flags,
state_ready(last_state)));
return last_state;
}

--- 747,766 ----


if (!state_ready(last_state) &&
!last_state->caller_flags) {
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2: need more bytes for character...\n"));
goto reinit_ReadChar;
}

got_key:
DPRINT(Debug,4,(&Debug,
! "cur_ReadCh2=%p (state): caller_flags=%d, ready=%d\n",
last_state,last_state->caller_flags,
state_ready(last_state)));
+
+ #ifdef TERMIOS
+ reset_lfag(&T);
+ #endif
+
return last_state;
}

Index: elmME+.2.5.alpha2-cvs/src/screen/def_screen.h
*** elmME+.2.5.alpha1/src/screen/def_screen.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/screen/def_screen.h 2004-07-19 12:20:02.000000000 +0300
***************
*** 1,8 ****
! /* $Id: def_screen.h,v 1.4.8.2 2004/05/04 18:39:33 hurtta Exp $ */

#include "elm_defs.h"
#include "mime.h"


#include "me.h"

extern int InGetPrompt; /* set if in GetPrompt() in read() */
/* HACK */

--- 1,9 ----
! /* $Id: def_screen.h,v 1.4.8.3 2004/07/19 09:20:02 hurtta Exp $ */

#include "elm_defs.h"
#include "mime.h"


#include "me.h"
+ #include "elm_globals.h"

extern int InGetPrompt; /* set if in GetPrompt() in read() */
/* HACK */
***************

*** 84,91 ****


*_key_help, *_key_find;
extern char *_transmit_on, *_transmit_off;

! /* cur_process.c */


extern void print_status P_((struct run_state *rs,int sig,int exit_code));
extern void start_run_tty_init P_((void));

--- 85,103 ----


*_key_help, *_key_find;
extern char *_transmit_on, *_transmit_off;

! #ifdef TERMIOS
! # include <termios.h>
!
! struct tf_state {
! struct termios old_raw;
! int old_raw_ok;
! };

+ extern int toggle_lflag P_((struct tf_state *T,int enab,int disab) );
+ extern void reset_lfag P_((struct tf_state *T));

+ #endif
+

+ /* cur_process.c */

extern void print_status P_((struct run_state *rs,int sig,int exit_code));
extern void start_run_tty_init P_((void));
***************

*** 109,114 ****
--- 121,140 ----



extern void check_changes P_((void));

+ /* init.c */
+
+ extern void get_term_chars P_((int fd));
+
+ extern char backspace, /* the current backspace char */
+ kill_line, /* the current kill-line char */
+ word_erase, /* the current word-erase char */
+ interrupt_char, /* the current interrupt char */
+ reprint_char, /* the current reprint-line char */
+ eof_char; /* the current end-of-file char */
+
+ extern char VQUIT_char, /* the current quit char */
+ VSUSP_char; /* the current suspend char */

+
/*
* Local Variables:
* mode:c

Index: elmME+.2.5.alpha2-cvs/src/screen/init.c


*** /tmp/29622-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-08-15 20:45:40.000000000 +0300

--- elmME+.2.5.alpha2-cvs/src/screen/init.c 2004-07-19 12:20:03.000000000 +0300
***************
*** 0 ****
--- 1,168 ----
+ static char rcsid[] = "@(#)$Id: init.c,v 1.3.8.1 2004/07/19 09:20:03 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3.8.1 $ $State: Exp $
+ *


+ * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
+ * (was hurtt...@ozone.FMI.FI)
+ ******************************************************************************

+ * Most of code copied from src/init.c. It have following copyright:


+ *
+ * The Elm Mail System
+ *

+ * Copyright (c) 1988-1992 USENET Community Trust


+ * Copyright (c) 1986,1987 Dave Taylor

+ *****************************************************************************/
+

+ #include "def_screen.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");

+
+ #include <errno.h>
+ #ifndef ANSI_C

+ extern int errno; /* system error number on failure */
+ #endif
+
+

+ int fd;
+ {


+ /** This routine sucks out the special terminal characters
+ ERASE and KILL for use in the input routine. The meaning
+ of the characters are (dare I say it?) fairly obvious... **/
+
+ term_buff term_buffer;
+
+ if (tcgetattr(fd,&term_buffer) == -1) {

+ int err = errno;
+

+ DPRINT(Debug,3,
+ (&Debug,
+ "Error: %s encountered on ioctl call (get_term_chars, fd=%d)\n",
+ error_description(err), fd));
+

+ /* set to defaults for terminal driver */
+ backspace = 010; /* backspace */

+ #endif
+ }
+

+ }
+ #endif
+
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha2-cvs/src/screen/Makefile.SH
*** elmME+.2.5.alpha1/src/screen/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/screen/Makefile.SH 2004-07-19 12:20:02.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.3.12.1 2004/04/18 16:55:43 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----

echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.3.12.2 2004/07/19 09:20:02 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************
*** 43,49 ****
SHELL = /bin/sh

OBJ = screen.o curses.o curs_input.o termbuffer.o \
! termtitle.o termcharset.o cur_process.o context.o

all: Makefile libscreen.a

--- 43,49 ----
SHELL = /bin/sh

OBJ = screen.o curses.o curs_input.o termbuffer.o \
! termtitle.o termcharset.o cur_process.o context.o init.o

all: Makefile libscreen.a

***************

*** 69,79 ****


$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/mime.h $(INCLDIR)/me.h $(INCLDIR)/elmlib.h
$(CHMOD) u+w $@
$(TOUCH) $@

! def_screen.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/me.h $(INCLDIR)/mime.h

$(CHMOD) u+w $@
$(TOUCH) $@

--- 69,81 ----


$(CHMOD) u+w $@
$(TOUCH) $@

! $(INCLDIR)/headers.h: $(INCLDIR)/defs.h $(INCLDIR)/mime.h \
! $(INCLDIR)/me.h $(INCLDIR)/elmlib.h


$(CHMOD) u+w $@
$(TOUCH) $@

! def_screen.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/me.h \
! $(INCLDIR)/mime.h $(INCLDIR)/elm_globals.h
$(CHMOD) u+w $@
$(TOUCH) $@

***************
*** 91,94 ****
--- 93,97 ----


termcharset.o: def_screen.h
cur_process.o: def_screen.h $(INCLDIR)/s_elm.h
context.o: def_screen.h
+ init.o: def_screen.h
!NO!SUBS!

Index: elmME+.2.5.alpha2-cvs/src/screen/screen.c
*** elmME+.2.5.alpha1/src/screen/screen.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/screen/screen.c 2004-07-19 12:20:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: screen.c,v 1.7.8.1 2004/05/04 18:39:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: screen.c,v 1.7.8.2 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
***************
*** 188,194 ****
int on_cooked = default_context == &COOKED_MENU;

SIGDPRINT(Debug,4, (&Debug, "Raw(%d): sig = %d tite=%d on_cooked=%d\n",
! state,sig,tite));

cur_Raw(state);

--- 188,194 ----
int on_cooked = default_context == &COOKED_MENU;

SIGDPRINT(Debug,4, (&Debug, "Raw(%d): sig = %d tite=%d on_cooked=%d\n",
! state,sig,tite,on_cooked));

cur_Raw(state);

***************
*** 266,271 ****
--- 266,273 ----

c = cur_ReadCh(flags,InGetPrompt,default_context);

+ DPRINT(Debug,50, (&Debug, "ReadCh=0x%02x\n",c));
+
return c;
}

***************
*** 290,295 ****
--- 292,299 ----



c = cur_ReadCh(flags,InGetPrompt,ptr);

+ DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x\n",c));
+
return c;
}

***************

*** 448,453 ****
--- 452,479 ----


return cur_tabspacing;
}

+ #ifdef TERMIOS
+ static struct tf_state ttysig_state;

+
+ #endif
+

+ void cancel_set_ttysig_X()
+ {
+ DPRINT(Debug,49, (&Debug, "cancel_set_ttysig_X()\n"));
+
+ #ifdef TERMIOS
+ toggle_lflag(&ttysig_state,ISIG,0);

+ #endif
+ }
+

+ void cancel_reset_ttysig_X()
+ {
+ DPRINT(Debug,49, (&Debug, "cancel_reset_ttysig_X()\n"));
+ #ifdef TERMIOS
+ reset_lfag(&ttysig_state);
+ #endif

+ }
+
/*
* Local Variables:
* mode:c

Index: elmME+.2.5.alpha2-cvs/src/showmsg.c
*** elmME+.2.5.alpha1/src/showmsg.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/showmsg.c 2004-07-19 12:20:02.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.36.8.1 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.36.8.2 2004/07/19 09:20:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 94,100 ****
PutLineX(LINES-2,0,CATGETS(elm_msg_cat, ElmSet, ElmOverrideCSprompt,
"Override charset: "));

! code = optionally_enter(override_charset,-1,-1,OE_REDRAW_MARK,
sizeof override_charset, page);

switch(code) {
--- 94,101 ----
PutLineX(LINES-2,0,CATGETS(elm_msg_cat, ElmSet, ElmOverrideCSprompt,
"Override charset: "));

! code = optionally_enter(override_charset,-1,-1,OE_REDRAW_MARK|

! OE_SIG_CHAR /* Ctrl-C */,

sizeof override_charset, page);

switch(code) {
Index: elmME+.2.5.alpha2-cvs/src/showmsg_c.c
*** elmME+.2.5.alpha1/src/showmsg_c.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/showmsg_c.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.35.8.1 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.35.8.2 2004/08/07 18:07:19 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 72,78 ****

switch (cmd) {
case '?' :
! if (help(TRUE, page)) {
menu_ClearScreen(page);
build_bottom(&MENU,page);
} else
--- 72,81 ----

switch (cmd) {
case '?' :
!

! help(TRUE, page);
!

! if (menu_need_redraw(page)) {
menu_ClearScreen(page);
build_bottom(&MENU,page);
} else
***************
*** 88,94 ****
if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))

! (void) do_pipe(mailbox, page); /* do pipe - ignore return val */


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 91,97 ----
if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))
! do_pipe(mailbox, page);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************
*** 223,232 ****

&hdr,&F,NULL,
/* !!! */
NO_mime_parse)) {

! if (hdr->pgp & PGP_PUBLIC_KEY)
/* FIX: mime structure is not currently used */

! pgp_extract_public_key (hdr,F);
! else
store_msg("This message does not contain any keys!");
} else {
DPRINT(Debug,3,(&Debug,
--- 226,239 ----
&hdr,&F,NULL,
/* !!! */
NO_mime_parse)) {

! if (hdr->pgp & PGP_PUBLIC_KEY) {
/* FIX: mime structure is not currently used */

! pgp_extract_public_key (hdr,F, page);
!

! if (menu_need_redraw(page)) /* ? ? ? Is this correct */
! put_border(page);
!
! } else
store_msg("This message does not contain any keys!");
} else {
DPRINT(Debug,3,(&Debug,
***************
*** 252,259 ****
put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmForwardMessage,

"Forward message"), TRUE, &MENU,
page);
!

! if (forward(current-1,mailbox, aview, page))

put_border(page);

}
--- 259,268 ----
put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmForwardMessage,

"Forward message"), TRUE, &MENU,
page);
!

! forward(current-1,mailbox, aview, page);
!

! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
put_border(page);

}
***************

*** 458,468 ****


"Mail message"), TRUE, &MENU,
page);

! if (send_msg_l(current-1,
! NULL,NULL,NULL, MAIL_EDIT_MSG,
! allow_forms,
! mailbox, aview,
! page))

put_border(page);
}
break;
--- 467,479 ----


"Mail message"), TRUE, &MENU,
page);

! send_msg_l(current-1,


! NULL,NULL,NULL, MAIL_EDIT_MSG,
! allow_forms,
! mailbox, aview,

! page);
!

! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
put_border(page);
}
break;
***************

*** 519,526 ****


put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmReplyToMessage,
"Reply to message"), TRUE, &MENU,
page);

! if (reply(current-1,mailbox, aview, page))
put_border(page);
}
break;

--- 530,541 ----


put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmReplyToMessage,
"Reply to message"), TRUE, &MENU,
page);
!

! reply(current-1,mailbox, aview, page);


! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
put_border(page);
+
+
}
break;

***************
*** 535,545 ****


if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
! NO_mime_parse))
! (void) save(&intbuf, TRUE, (command != 'C'),0,
! mailbox, aview, *header_page,
! page);

! else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 550,565 ----

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
! NO_mime_parse)) {
!
! save(TRUE, (command != 'C'),0,
! mailbox, aview, *header_page,

! page);
!

! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
! put_border(page);
!

! } else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************

*** 558,568 ****

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
! mime_parse_routine))
! (void) save(&intbuf, TRUE, 0,1, mailbox, aview,
! *header_page,
! page);

! else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 578,592 ----

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
! mime_parse_routine)) {
! save(TRUE, 0,1, mailbox, aview,
! *header_page,

! page);
!

! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
! put_border(page);
!

! } else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

Index: elmME+.2.5.alpha2-cvs/src/signals.c
*** elmME+.2.5.alpha1/src/signals.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/signals.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: signals.c,v 1.24.8.1 2004/04/25 16:59:27 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: signals.c,v 1.24.8.3 2004/08/07 18:07:19 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.3 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Kari E. Hurtta

unread,
Aug 20, 2004, 1:31:57 PM8/20/04
to
Archive-name: elmME+2.5/PLalpha2.5

Elm ME+ 2.5 PLalpha2

- Is available on ftp.funet.fi

via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha2.patch.gz >
via WWW (1).


1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

Before applying patch catenate parts 1 - 5 first.

This patch (Elm ME+ 2.5 PLalpha2) is agaist Elm ME+ 2.5 PLalpha1.
After that patch apply also Elm ME+ 2.5 PLalpha3 patch.

================================================ ( part 5/5 ) ===============
--- 147,153 ----
***************
*** 213,218 ****


--- 211,218 ----
{
int result = 0;
int dummy = 0;
+ struct MailboxView *m;
+ int idx2 = 0;

SIGDPRINT(Debug,1, (&Debug, "\n\n** Received SIGUSR1 **\n\n\n\n"));
if (!InGetPrompt || !wait_can_signal) {
***************

*** 220,248 ****
return;
}

- /* !! FIXME?? Differs from Elm 2.5 */
- while (current_mailbox &&
- (result = leave_mbox(TRUE, FALSE, FALSE, NULL, current_mailbox,


- &dummy, default_context))
- == -1) {
- int idx;
- int mbxcount = get_storage_count(current_mailbox);

! for (idx = 0 ; idx < mbxcount; idx++) {

! struct current_storage * storage = get_storage(current_mailbox,
! idx);

! if (!storage ||
! !storage->current_folder)
! continue;
!
! read_new_mails(storage, default_context);
! }
}

if (result >= 0)
! leave(!InGetPrompt, &current_mailbox, &current_aliaslist);
}

SIGHAND_TYPE

--- 220,253 ----
return;
}


! while (NULL != (m = give_next_open_mailbox(&idx2,!InGetPrompt))) {
!

! /* !! FIXME?? Differs from Elm 2.5 */

! while (m &&
! (result = leave_mbox(TRUE, FALSE, FALSE, NULL, m,


! &dummy, default_context))
! == -1) {
! int idx;
! int mbxcount = get_storage_count(m);

! for (idx = 0 ; idx < mbxcount; idx++) {
!
! struct current_storage * storage = get_storage(m,idx);

! if (!storage ||
! !storage->current_folder)
! continue;
!
! read_new_mails(storage, default_context);
! }
! }
! if (result < 0)
! break;
}

if (result >= 0)
! leave(!InGetPrompt);
}

SIGHAND_TYPE

***************
*** 250,255 ****
--- 255,262 ----


{
int result = 0;
int dummy = 0;
+ struct MailboxView *m;
+ int idx2 = 0;

SIGDPRINT(Debug,1, (&Debug, "\n\n** Received SIGUSR2 **\n\n\n\n"));

***************
*** 257,285 ****


SIGDPRINT(Debug,1, (&Debug, "-- can't leave folder\n"));
return;
}
-
- while (current_mailbox &&
- (result = leave_mbox(FALSE, TRUE, FALSE, NULL,
- current_mailbox, &dummy,
- default_context)) == -1) {
- int idx;
- int mbxcount = get_storage_count(current_mailbox);

! for (idx = 0 ; idx < mbxcount; idx++) {
!
! struct current_storage * storage = get_storage(current_mailbox,
! idx);

! if (!storage ||
! !storage->current_folder)
! continue;
!
! read_new_mails(storage, default_context);
! }
}
-
if (result >= 0)
! leave(!InGetPrompt, &current_mailbox, &current_aliaslist);
}

void init_signals()

--- 264,295 ----

Index: elmME+.2.5.alpha2-cvs/src/syscall.c
*** elmME+.2.5.alpha1/src/syscall.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/syscall.c 2004-08-14 09:40:49.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33.2.1 2004/05/14 19:48:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.2.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** These routines are used for user-level system calls, including the
--- 1,26 ----
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33.2.4 2004/08/14 06:40:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.2.4 $ $State: Exp $
!

*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/syscall.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from src/syscall.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** These routines are used for user-level system calls, including the


***************
*** 21,27 ****
#include "s_elm.h"
#include "s_me.h"

! DEBUG_VAR(Debug,__FILE__,"misc");


#include <errno.h>

--- 32,38 ----
#include "s_elm.h"
#include "s_me.h"


! DEBUG_VAR(Debug,__FILE__,"system");


#include <errno.h>

***************
*** 35,46 ****

#ifdef ALLOW_SUBSHELL

! int subshell(mailbox, page)

struct MailboxView *mailbox;
struct menu_context *page;

{
/** spawn a subshell with either the specified command
! returns non-zero if screen rewrite needed
**/

char command[SLEN];

--- 46,58 ----



#ifdef ALLOW_SUBSHELL

! void subshell(mailbox, page)

struct MailboxView *mailbox;
struct menu_context *page;

{
/** spawn a subshell with either the specified command

!

! If redraw is needes use menu_trigger_redraw()
**/

char command[SLEN];
***************

*** 63,69 ****
"Shell command: "));
CleartoEOS();
command[0] = '\0';
! status = optionally_enter(command, LINES-3, 15, OE_REDRAW_MARK,

sizeof command, page);

while (REDRAW_MARK == status) {
--- 75,82 ----


"Shell command: "));
CleartoEOS();
command[0] = '\0';

! status = optionally_enter(command, LINES-3, 15, OE_REDRAW_MARK|


! OE_SIG_CHAR /* Ctrl-C */,

sizeof command, page);

while (REDRAW_MARK == status) {
***************
*** 72,88 ****


CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
"Shell command: "));
status = optionally_enter(command, LINES-3, 15,
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
sizeof command, page);

}
! if (0 != status && command[0] == 0) {
if (helpful)
MoveCursor(LINES-4,COLUMNS-40);

else
MoveCursor(LINES-3,0);
CleartoEOS();
! return redraw;
}

MoveCursor(LINES-1,0);

--- 85,107 ----


CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
"Shell command: "));
status = optionally_enter(command, LINES-3, 15,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

sizeof command, page);

}
!

! if (0 != status || command[0] == 0) {
if (helpful)
MoveCursor(LINES-4,COLUMNS-40);
else

MoveCursor(LINES-3,0);
CleartoEOS();
!

! if (redraw)
! menu_trigger_redraw(page);
!
! return;
}

MoveCursor(LINES-1,0);
***************
*** 123,129 ****


"Return code was %d."),
ret);

! return 1;
}

#endif /* ALLOW_SUBSHELL */

--- 142,150 ----


"Return code was %d."),
ret);

! menu_trigger_redraw(page);
!
! return;
}

#endif /* ALLOW_SUBSHELL */
***************

*** 193,199 ****
}

/* if we aren't reading a folder then a state dump is meaningless */
! if (mail_only)
options &= ~SY_DUMPSTATE;

/* see if we need to dump out the folder state */
--- 214,220 ----
}

/* if we aren't reading a folder then a state dump is meaningless */
! if (!OPMODE_IS_READMODE(opmode))
options &= ~SY_DUMPSTATE;

/* see if we need to dump out the folder state */
***************
*** 336,347 ****


return(stat);
}

! int do_pipe(mailbox, page)

struct MailboxView *mailbox;
struct menu_context *page;

{
/** pipe the current message or tagged messages to
! the specified sequence.. **/

char command[SLEN], buffer[SLEN], *prompt;
register int ret;

--- 357,371 ----


return(stat);
}

! void do_pipe(mailbox, page)

struct MailboxView *mailbox;
struct menu_context *page;

{
/** pipe the current message or tagged messages to
! the specified sequence..
!
! if redraw is needed use menu_trigger_redraw()
! **/

char command[SLEN], buffer[SLEN], *prompt;
register int ret;
***************

*** 358,377 ****


PutLine0(LINES-3, 0, prompt);
command[0] = '\0';
status = optionally_enter(command, LINES-3, strlen(prompt),
! OE_REDRAW_MARK, sizeof command,

page);
while (status == REDRAW_MARK) {

redraw = TRUE;
PutLine0(LINES-1-2, 0, prompt);
status = optionally_enter(command, LINES-3, strlen(prompt),
! OE_REDRAW_MARK|OE_APPEND_CURRENT,
sizeof command, page);

}

if (0 != status || command[0] == '\0') {
MoveCursor(LINES-3,0);
CleartoEOLN();
! return(redraw);
}

MoveCursor(LINES-1,0);

--- 382,406 ----


PutLine0(LINES-3, 0, prompt);
command[0] = '\0';
status = optionally_enter(command, LINES-3, strlen(prompt),

! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, sizeof command,


page);
while (status == REDRAW_MARK) {

redraw = TRUE;
PutLine0(LINES-1-2, 0, prompt);
status = optionally_enter(command, LINES-3, strlen(prompt),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

sizeof command, page);



}
if (0 != status || command[0] == '\0') {
MoveCursor(LINES-3,0);
CleartoEOLN();
!

! if (redraw)
! menu_trigger_redraw(page);
! return;
}

MoveCursor(LINES-1,0);
***************
*** 407,413 ****


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReturnCodeWas,
"Return code was %d."),
ret);
! return(1);
}

int have_printout() {

--- 436,445 ----


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReturnCodeWas,
"Return code was %d."),
ret);
!

!
! menu_trigger_redraw(page);
! return;
}

int have_printout() {
***************
*** 451,462 ****


return return_value;
}

! int print_text(pause_on_scroll, mailbox, header_page, page)
int pause_on_scroll;
struct MailboxView *mailbox;

int header_page;
struct menu_context *page;
{

int tagged = 0, i, old_raw;
int redraw_it = 0;
char *fname = NULL;

--- 483,498 ----


return return_value;
}

! void print_text(pause_on_scroll, mailbox, header_page, page)
int pause_on_scroll;
struct MailboxView *mailbox;

int header_page;
struct menu_context *page;
{

+ /* If redraw is needed use
+ menu_trigger_redraw(page)
+ */
+

int tagged = 0, i, old_raw;
int redraw_it = 0;
char *fname = NULL;
***************

*** 482,488 ****


* Make sure we know how to print.
*/
if (!have_printout() || !mailbox)
! return 0;

fname = elm_message(FRM("%sprintdecode-%d"),
temp_dir, getpid ());

--- 518,524 ----


* Make sure we know how to print.
*/
if (!have_printout() || !mailbox)
! return;

fname = elm_message(FRM("%sprintdecode-%d"),
temp_dir, getpid ());
***************

*** 653,664 ****


clean:
if (fname)
free(fname);
- return redraw_it;
- }
-


! int print_msg(pause_on_scroll, mailbox, page)
int pause_on_scroll;

struct MailboxView *mailbox;
struct menu_context *page;

--- 689,701 ----


clean:
if (fname)
free(fname);

+ if (redraw_it)
+ menu_trigger_redraw(page);
+ return;
+ }

! void print_msg(pause_on_scroll, mailbox, page)
int pause_on_scroll;

struct MailboxView *mailbox;
struct menu_context *page;

***************
*** 671,680 ****


* Printing will be done through a pipe so we can print the number
* of lines output. This is used to determine whether the screen
* got trashed by the print command. One limitation is that only
! * stdout lines are counted, not stderr output. A nonzero result
! * is returned if we think enough output was generated to trash
! * the display, a zero result indicates the display is probably
! * alright. Further, if the display is trashed and "pause_on_scroll"
* is true then we'll give a "hit any key" prompt before returning.
*
* This routine has two modes of behavior, depending upon whether

--- 708,719 ----


* Printing will be done through a pipe so we can print the number
* of lines output. This is used to determine whether the screen
* got trashed by the print command. One limitation is that only
! * stdout lines are counted, not stderr output.

! *


! * If redraw is needed use

! * menu_trigger_redraw(page)
! *
! * Further, if the display is trashed and "pause_on_scroll"
* is true then we'll give a "hit any key" prompt before returning.
*
* This routine has two modes of behavior, depending upon whether
***************

*** 713,719 ****


* Make sure we know how to print.
*/
if (!have_printout())
! return 0;

XX[0] = '\0';

--- 752,758 ----


* Make sure we know how to print.
*/
if (!have_printout())
! return;

XX[0] = '\0';

***************
*** 804,809 ****
--- 843,849 ----



if (ReadCh(REDRAW_MARK) == REDRAW_MARK) {

+ menu_trigger_redraw(page);
nlines = 2;
goto redraw;
}
***************

*** 843,852 ****


free(filename);
}
(void) remove_folder_state_file();
! res = nlines > 1;

free_it:
! return res;
}

static char folder_state_env_param[SLEN], *folder_state_fname;

--- 883,893 ----


free(filename);
}
(void) remove_folder_state_file();
! if (nlines > 1)
! menu_trigger_redraw(page);

free_it:
! return;
}

static char folder_state_env_param[SLEN], *folder_state_fname;

Index: elmME+.2.5.alpha2-cvs/src/utils.c
*** elmME+.2.5.alpha1/src/utils.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/src/utils.c 2004-08-07 21:07:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: utils.c,v 1.33 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: utils.c,v 1.33.8.1 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

! struct current_storage * storage = get_storage(m,i);

if (storage && storage->current_folder) {
SIGDPRINT(Debug,1, (&Debug,
***************
*** 194,202 ****
exit(127);
}

! void rm_temps_exit(mailbox,aview)
! struct MailboxView **mailbox;
! struct AliasView **aview;
{
int do_cursor = RawState();
int LINES, COLUMNS;
--- 197,203 ----
exit(127);
}

! void rm_temps_exit()
{
int do_cursor = RawState();

int LINES, COLUMNS;
***************

! struct MailboxView *m;


! int idx = 0;
!
! while (NULL != (m = give_next_open_mailbox(&idx,interrupt))) {
! int mc = get_storage_count(m);
! int i;
!

!

! for (i = 0; i < mc; i++) {
! struct current_storage * storage = get_storage(m,i);
! if (storage) {
! if (storage->current_folder) {
! unlock(interrupt, storage->current_folder); /* remove lock file if any */

!
! }
! }
! }
! }

!


! for (i = 0; i < mc; i++) {
! struct current_storage * storage = get_storage(*mailbox,i);
! if (storage) {
! if (storage->current_folder) {
! unlock(interrupt, storage->current_folder); /* remove lock file if any */

!
! }
! }
! }
!

! if (!interrupt)
! free_mailbox(mailbox);

!
! }
!

!

! while (NULL != (m = give_next_open_mailbox(&idx,0))) {

! int mc = get_storage_count(m);
int i;


for (i = 0; i < mc; i++) {

! struct current_storage * storage = get_storage(m,i);

if (storage && storage->current_folder) {
leave_old_folder(& storage->current_folder,CLOSE_LEAVE_LOCKED);
***************
*** 436,444 ****
}
}

! if (*aview) {
! free_aliasview(aview);
! }

#ifdef REMOTE_MBX
close_cached_connections();
--- 432,438 ----
}
}

! free_all_aliasviews();

#ifdef REMOTE_MBX
close_cached_connections();

Index: elmME+.2.5.alpha2-cvs/utils/answer.c
*** elmME+.2.5.alpha1/utils/answer.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/answer.c 2004-08-15 10:34:25.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: answer.c,v 1.16 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: answer.c,v 1.16.8.2 2004/08/15 07:34:25 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 49,54 ****
--- 49,59 ----
char name[SLEN], user_name[SLEN], in_line[SLEN];
int msgnum = 0, eof, allow_name = 0, phone_slip = 0;
int ans_pid = getpid();
+ int c;
+
+ extern int optind;
+ extern char *optarg;
+

#if DEBUG
init_debugfile("ANSWER");
***************
*** 60,92 ****
exit_word = catgets(elm_msg_cat, AnswerSet, AnswerExitWord, "exit");
done_word = catgets(elm_msg_cat, AnswerSet, AnswerDoneWord, "done");
bye_word = catgets(elm_msg_cat, AnswerSet, AnswerByeWord, "bye");
/*
- * simplistic crack arguments, looking for -u/-p
* -u = allow user names not in alias table
* -p = prompt for phone slip messages
*/
! for (msgnum = 1; msgnum < argc; msgnum++) {
! if (istrcmp(argv[msgnum], "-u") == 0)
! allow_name = 1;
! if (istrcmp(argv[msgnum], "-p") == 0)
! phone_slip = 1;
! if (istrcmp(argv[msgnum], "-pu") == 0) {
! allow_name = 1;
! phone_slip = 1;
! }
! if (istrcmp(argv[msgnum], "-up") == 0) {
! allow_name = 1;
! phone_slip = 1;
! }
! if (strncmp(argv[msgnum], "-d",2) == 0) {
#if DEBUG
! set_debugging(argv[msgnum]+2);
#endif
}
}

- user_init();
- init_defaults();
read_rc_file(0);

elm_sfprintf(version_buff, sizeof version_buff,
--- 65,97 ----
exit_word = catgets(elm_msg_cat, AnswerSet, AnswerExitWord, "exit");
done_word = catgets(elm_msg_cat, AnswerSet, AnswerDoneWord, "done");
bye_word = catgets(elm_msg_cat, AnswerSet, AnswerByeWord, "bye");
+
+ user_init();
+ init_defaults();
+
/*
* -u = allow user names not in alias table
* -p = prompt for phone slip messages
*/
! while ((c = getopt(argc, argv, "upd:r:")) != EOF) {
! switch (c) {
! case 'u':
! allow_name = 1;
! break;
! case 'p':
! phone_slip = 1;


! break;
! case 'd':

#if DEBUG
! set_debugging(optarg);
#endif
+ break;
+ case 'r':
+ set_user_rc_location(optarg);
+ break;
}
}

read_rc_file(0);

elm_sfprintf(version_buff, sizeof version_buff,


***************
*** 105,111 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}

--- 110,116 ----


panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/elmalias.c
*** elmME+.2.5.alpha1/utils/elmalias.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/elmalias.c 2004-07-19 12:20:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.16 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.16.8.1 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 239,245 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 239,245 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/elmbindata.c
*** elmME+.2.5.alpha1/utils/elmbindata.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/elmbindata.c 2004-07-19 12:20:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.5 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.5.8.1 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 133,139 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 133,139 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/elmcharset.c
*** elmME+.2.5.alpha1/utils/elmcharset.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/elmcharset.c 2004-08-15 11:28:34.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.29 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.29.8.2 2004/08/15 08:28:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 44,50 ****
user_init();
init_defaults();

! while ((c = getopt(argc, argv, "Gd:w:I:S:M")) != EOF) {
FILE *X;
char buf[LONG_STRING];

--- 44,50 ----
user_init();
init_defaults();

! while ((c = getopt(argc, argv, "Gd:w:I:S:Mr:")) != EOF) {
FILE *X;
char buf[LONG_STRING];

***************
*** 67,72 ****
--- 67,75 ----


"Warning: system created without debugging enabled - request ignored\n"));
#endif
break;

+ case 'r':
+ set_user_rc_location(optarg);
+ break;
case 'w' :
targetfile = optarg;
if (0 != access(targetfile,WRITE_ACCESS)) {


***************
*** 163,169 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}

--- 166,172 ----


panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/elmlibregister.c
*** elmME+.2.5.alpha1/utils/elmlibregister.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/elmlibregister.c 2004-08-15 13:51:08.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.6.8.1 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.6.8.3 2004/08/15 10:51:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 52,58 ****

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:")) != EOF) {

switch(c) {
case 'G':
--- 52,58 ----

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:r:")) != EOF) {

switch(c) {
case 'G':
***************
*** 72,77 ****
--- 72,81 ----
#endif
break;

+ case 'r':
+ set_user_rc_location(optarg);
+ break;
+
case 'w' :
targetfile = optarg;
if (0 != access(targetfile,WRITE_ACCESS)) {


***************
*** 135,141 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}

--- 139,145 ----


panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/elmrc-write.c
*** elmME+.2.5.alpha1/utils/elmrc-write.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/elmrc-write.c 2004-08-15 13:51:08.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.13.8.1 2004/07/03 15:23:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.13.8.3 2004/08/15 10:51:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 32,38 ****
int register_fd = -1;
char * program_name = "elmrc-write";

-
int main(argc, argv)
int argc;
char *argv[];
--- 32,37 ----
***************
*** 51,57 ****

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:")) != EOF) {

switch(c) {
case 'G':
--- 50,56 ----

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:r:")) != EOF) {

switch(c) {
case 'G':
***************
*** 71,76 ****
--- 70,79 ----
#endif
break;

+ case 'r':
+ set_user_rc_location(optarg);
+ break;
+
case 'w' :
targetfile = optarg;
if (0 != access(targetfile,WRITE_ACCESS)) {


***************
*** 133,139 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}

--- 136,142 ----


panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/elmregister.c
*** elmME+.2.5.alpha1/utils/elmregister.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/elmregister.c 2004-08-07 21:07:20.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.15.8.1 2004/05/22 14:50:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.15.8.2 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1459,1465 ****



#endif /* DIROPS == USE_DIRENT */

#if DIROPS == USE_SYSDIR
! char * entryname = safe_malloc(Xptr->d_namlen+1);

if (!entryname) {


fprintf(stderr,"%s: malloc %d bytes failed\n",

--- 1459,1465 ----



#endif /* DIROPS == USE_DIRENT */

#if DIROPS == USE_SYSDIR
! char * entryname = malloc(Xptr->d_namlen+1);

if (!entryname) {

fprintf(stderr,"%s: malloc %d bytes failed\n",

Index: elmME+.2.5.alpha2-cvs/utils/elmstringconvert.c
*** elmME+.2.5.alpha1/utils/elmstringconvert.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/elmstringconvert.c 2004-08-15 15:21:35.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.8 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.8.8.2 2004/08/15 12:21:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 165,171 ****
user_init();
init_defaults();

! while ((c = getopt(argc, argv, "Gd:w:S:T:")) != EOF) {
charset_t wanted_charset;

switch(c) {
--- 165,171 ----
user_init();
init_defaults();

! while ((c = getopt(argc, argv, "Gd:w:S:T:r:")) != EOF) {
charset_t wanted_charset;

switch(c) {


***************
*** 216,221 ****
--- 216,224 ----

"Warning: system created without debugging enabled - request ignored\n"));
#endif
break;

+ case 'r':
+ set_user_rc_location(optarg);
+ break;
case 'w' :
targetfile = optarg;
if (0 != access(targetfile,WRITE_ACCESS)) {


***************
*** 252,258 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}

--- 255,261 ----


panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/elmterminal.c
*** elmME+.2.5.alpha1/utils/elmterminal.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/elmterminal.c 2004-08-15 15:28:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.13 2004/03/27 18:31:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.13.8.2 2004/08/15 12:28:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 39,45 ****
user_init();
init_defaults();

! while ((c = getopt(argc, argv, "Gd:w:")) != EOF) {
switch(c) {
case 'G':
global++;
--- 39,45 ----
user_init();
init_defaults();

! while ((c = getopt(argc, argv, "Gd:w:r:")) != EOF) {
switch(c) {
case 'G':
global++;
***************
*** 52,57 ****
--- 52,60 ----


"Warning: system created without debugging enabled - request ignored\n"));
#endif
break;

+ case 'r':
+ set_user_rc_location(optarg);
+ break;
case 'w' :
targetfile = optarg;
if (0 != access(targetfile,WRITE_ACCESS)) {


***************
*** 88,94 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
}
#endif
}

--- 91,97 ----


panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
}
#endif
}

Index: elmME+.2.5.alpha2-cvs/utils/elmunidata.c
*** elmME+.2.5.alpha1/utils/elmunidata.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/elmunidata.c 2004-08-15 15:39:29.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.18 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.18.8.2 2004/08/15 12:39:29 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.2 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 30,35 ****
--- 30,36 ----
FILE * logfile = NULL;
int err = 0;
int silent_gaps = 0;
+ int rc_readed = 0;

int c;

***************
*** 42,55 ****

user_init();
init_defaults();
- read_rc_file(READ_FLAG_UNIDATA_INIT);

! while ((c = getopt(argc, argv, "w:l:sd:b:BIT:")) != EOF) {
switch(c) {
case 'w':
target_file = optarg;
break;
case 'I':
target_file = unidata_path;
break;
case 'l':
--- 43,58 ----

user_init();
init_defaults();

! while ((c = getopt(argc, argv, "w:l:sd:b:BIT:r:")) != EOF) {
switch(c) {
case 'w':
target_file = optarg;
break;
case 'I':
+ if (!rc_readed++)
+ read_rc_file(READ_FLAG_UNIDATA_INIT);
+
target_file = unidata_path;
break;
case 'l':
***************
*** 66,72 ****
--- 69,81 ----


"Warning: system created without debugging enabled - request ignored\n"));
#endif
break;

+ case 'r':
+ set_user_rc_location(optarg);
+ break;
case 'B':
+ if (!rc_readed++)
+ read_rc_file(READ_FLAG_UNIDATA_INIT);
+
unidata = default_unidata();
if (!unidata) {
err = 1;
***************
*** 95,100 ****
--- 104,111 ----
}
}

+ if (!rc_readed++)
+ read_rc_file(READ_FLAG_UNIDATA_INIT);



elm_sfprintf(version_buff, sizeof version_buff,
FRM("%s PL%s"), VERSION, PATCHLEVEL);

***************
*** 111,117 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}

--- 122,128 ----


panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/fastmail.c
*** elmME+.2.5.alpha1/utils/fastmail.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/fastmail.c 2004-07-19 12:20:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.30 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.30.8.1 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 406,412 ****
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 406,412 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/from.c
*** elmME+.2.5.alpha1/utils/from.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/from.c 2004-08-15 09:30:00.000000000 +0300
***************
*** 1,15 ****


! static char rcsid[] = "@(#)$Id: from.c,v 1.48.8.2 2004/07/03 15:23:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** print out whom each message is from in the pending folder or specified
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: from.c,v 1.48.8.4 2004/08/15 06:30:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 utils/from.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************

+ * Incorparated Elm 2.5 code from utils/from.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** print out whom each message is from in the pending folder or specified
***************
*** 104,109 ****
--- 114,120 ----
int no_files, c;
int total_msgs = 0, selected_msgs = 0;
char realname[SLEN];
+ int TreatAsSpool = 0;

extern int optind;
extern char *optarg;
***************
*** 115,121 ****
user_init();
strfcpy(realname,username,sizeof realname);
init_defaults();
- read_rc_file(0);

/*
* check the first character of the command basename to
--- 126,131 ----
***************
*** 131,137 ****
case 'r': selct |= READ_MSG; break;
}

! while ((c = getopt(argc, argv, "hnQqSs:tvd:X:")) != EOF)
switch (c) {
case 'd' :
#if DEBUG
--- 141,147 ----
case 'r': selct |= READ_MSG; break;
}

! while ((c = getopt(argc, argv, "hnQqSs:tvd:X:Mr:")) != EOF) {
switch (c) {
case 'd' :
#if DEBUG
***************
*** 142,149 ****
--- 152,161 ----
#endif
break;
case 'n': number++; break;
+ case 'M': TreatAsSpool++;break;
case 'Q': veryquiet++; break;
case 'q': quiet++; break;
+ case 'r' : set_user_rc_location(optarg); break;
case 'S': summarize++; break;
case 't': tidy++; break;
case 'v': verbose++; break;
***************
*** 188,193 ****
--- 200,208 ----
argv[0]);
exit(EXIT_ERROR);
}
+ }
+ read_rc_file(0);
+

if (quiet && verbose) {
lib_error(CATGETS(elm_msg_cat,FromSet,FromNoQuietVerbose,
***************
*** 327,333 ****

/* check if this is a mailbox or not, and attempt to open it */

! folder = enter_new_folder(infile);
if (!folder)
continue;

--- 342,348 ----

/* check if this is a mailbox or not, and attempt to open it */

! folder = enter_new_folder(infile,TreatAsSpool);
if (!folder)
continue;

Index: elmME+.2.5.alpha2-cvs/utils/newalias.c
*** elmME+.2.5.alpha1/utils/newalias.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/newalias.c 2004-07-19 12:20:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newalias.c,v 1.15 2004/03/27 18:31:49 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newalias.c,v 1.15.8.1 2004/07/19 09:20:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 87,93 ****

panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}
--- 87,93 ----
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! sleep(5+sleepmsg);
#endif
}
}

Index: elmME+.2.5.alpha2-cvs/utils/newmail.c
*** elmME+.2.5.alpha1/utils/newmail.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/newmail.c 2004-08-15 09:37:44.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35.8.2 2004/07/03 15:23:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35.8.4 2004/08/15 06:37:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 124,130 ****
static void usage P_((char *name));
static void pad_prefixes P_((void));

! int interval_time, /* how long to sleep between checks */
in_window = 0, /* are we running as 'wnewmail'? */
total_folders = 0, /* # of folders we're monitoring */
print_prefix = 0, /* force printing of prefix */
--- 124,131 ----
static void usage P_((char *name));
static void pad_prefixes P_((void));

! static int TreatAsSpool;
! static int interval_time, /* how long to sleep between checks */
in_window = 0, /* are we running as 'wnewmail'? */
total_folders = 0, /* # of folders we're monitoring */
print_prefix = 0, /* force printing of prefix */
***************
*** 180,186 ****
#endif
user_init();
init_defaults();
- read_rc_file(0);

/* Get the No subject string */

--- 181,186 ----
***************
*** 216,222 ****
if (ptr == argv[0] && i == 0 && argv[0][0] == 'w')
in_window = 1;

! while ((c = getopt(argc, argv, "d:i:wX:")) != EOF) {
switch (c) {
case 'd' :
#if DEBUG
--- 216,222 ----
if (ptr == argv[0] && i == 0 && argv[0][0] == 'w')
in_window = 1;

! while ((c = getopt(argc, argv, "d:i:wX:Mr:")) != EOF) {
switch (c) {
case 'd' :
#if DEBUG
***************
*** 228,233 ****
--- 228,235 ----
#endif
break;
case 'i' : interval_time = atoi(optarg); break;
+ case 'M' : TreatAsSpool++; break;
+ case 'r' : set_user_rc_location(optarg); break;
case 'w' : in_window = 1; break;
case 'X' :
#ifdef REMOTE_MBX
***************
*** 240,245 ****
--- 242,249 ----
}
}

+ read_rc_file(0);


+
elm_sfprintf(version_buff, sizeof version_buff,
FRM("%s PL%s"), VERSION, PATCHLEVEL);

***************
*** 658,664 ****

if (metachar(name[0])) {
expand_filename(name, buf, sizeof buf);
! folder_list[current_folder].F = enter_new_folder(buf);
}
else if (access(name, ACCESS_EXISTS) == -1) {
/* let's try it in the mail home directory */
--- 662,669 ----

if (metachar(name[0])) {
expand_filename(name, buf, sizeof buf);
! folder_list[current_folder].F = enter_new_folder(buf,
! TreatAsSpool);
}
else if (access(name, ACCESS_EXISTS) == -1) {
/* let's try it in the mail home directory */
***************
*** 666,677 ****
FRM("%s%s"),
mailhome, name);
if (access(buf,ACCESS_EXISTS) != -1) /* aha! */
! folder_list[current_folder].F = enter_new_folder(buf);
else
! folder_list[current_folder].F = enter_new_folder(name);
}
else
! folder_list[current_folder].F = enter_new_folder(name);

if (!folder_list[current_folder].F) {
DPRINT(Debug,1,(&Debug,
--- 671,684 ----
FRM("%s%s"),
mailhome, name);
if (access(buf,ACCESS_EXISTS) != -1) /* aha! */
! folder_list[current_folder].F = enter_new_folder(buf,
! TreatAsSpool);
else
! folder_list[current_folder].F = enter_new_folder(name,
! TreatAsSpool);
}
else
! folder_list[current_folder].F = enter_new_folder(name,TreatAsSpool);

if (!folder_list[current_folder].F) {
DPRINT(Debug,1,(&Debug,
***************
*** 720,726 ****
if (!default_val)
return;



! folder_list[0].F = enter_new_folder(default_val);

if (!folder_list[0].F) {
DPRINT(Debug,1,(&Debug,

--- 727,733 ----
if (!default_val)
return;

! folder_list[0].F = enter_new_folder(default_val,TreatAsSpool);



if (!folder_list[0].F) {
DPRINT(Debug,1,(&Debug,

Index: elmME+.2.5.alpha2-cvs/utils/prlong.c
*** elmME+.2.5.alpha1/utils/prlong.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha2-cvs/utils/prlong.c 2004-07-19 12:20:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11.8.2 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 134,140 ****


panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

lower_prompt("WARNING: Debug file may include passwords -- edit it!");
! error_sleep(5+sleepmsg);
#endif
}
}

--- 134,140 ----

Kari E. Hurtta

unread,
Aug 20, 2004, 1:40:34 PM8/20/04
to
Archive-name: elmME+2.5/PLalpha3

Elm ME+ 2.5 PLalpha3

- Is available on ftp.funet.fi
via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/

files elm-ME+2.5.PLalpha3.patch.gz
and elm-ME+2.5.alpha3.tar.gz

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha3.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.alpha3.tar.gz >
via WWW.

This patch is agaist Elm ME+ 2.5 PLalpha2
=========================================================================

To apply this patch use
patch -p1 < this_file
on directory where Configure is located.

Index: elmME+.2.5.alpha3-cvs/hdrs/patchlevel.h
Prereq: 1124000000
*** elmME+.2.5.alpha2/hdrs/patchlevel.h 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/hdrs/patchlevel.h 2004-08-16 08:12:48.000000000 +0300
***************
*** 1,8 ****


! #define PATCHLEVEL "alpha2"
/* Used by Configure:
! SHAREDTAG: .1.1.2
*/
! #define LAST_REPORT_TIME 1124000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Aug 2004" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "alpha3"
/* Used by Configure:
! SHAREDTAG: .1.1.3
*/
! #define LAST_REPORT_TIME 1124100000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Aug 2004" /* for elm -v option */
#define WHAT_STRING \

Index: elmME+.2.5.alpha3-cvs/README.ME+
*** elmME+.2.5.alpha2/README.ME+ 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/README.ME+ 2004-08-18 09:27:32.000000000 +0300
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.736.4.56 2004/08/15 17:16:11 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.736.4.63 2004/08/18 06:27:32 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 19,24 ****

--- 19,36 ----


===================================================================
* Changelog of ElmME+ 2.5

+ Changes on Elm ME+ 2.5 PLalpha3 compared with Elm2.4ME+ PLalpha2 (25)
+ ---------------------------------------------------------------------
+
+ - Fix crash on startup if .elm directory do not exists
+ - Fix crash on startup if DEBUG is not defined
+ - Deleting of messages marked for deletion was not working
+ (same incorrect condition worked on Elm 2.4ME+ because
+ of different ison -macro)
+ - Errors on [tags] was not caused sending to go back to
+ pre-send menu.
+ - "save-by-alias" was truncating alias to 3 letters.


+
Changes on Elm ME+ 2.5 PLalpha2 compared with Elm2.4ME+ PLalpha1 (25)

---------------------------------------------------------------------

Index: elmME+.2.5.alpha3-cvs/src/file.c
*** elmME+.2.5.alpha2/src/file.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/src/file.c 2004-08-18 09:27:33.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: file.c,v 1.36.8.5 2004/08/14 15:04:10 hurtta Exp $";

/****************************************************************************

! * The Elm (ME+) Mail System - $Revision: 1.36.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file.c,v 1.36.8.6 2004/08/18 06:27:33 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 190,196 ****
if (save_by_alias &&

(return_alias = address_to_alias(mhdr->from[0].addr,

aview)) != NULL)
! strfcpy(buffer1, return_alias, sizeof buffer);

else
get_return_name(mhdr->from[0].addr,
--- 190,196 ----
if (save_by_alias &&

(return_alias = address_to_alias(mhdr->from[0].addr,

aview)) != NULL)
! strfcpy(buffer1, return_alias, sizeof buffer1);

else
get_return_name(mhdr->from[0].addr,
Index: elmME+.2.5.alpha3-cvs/src/init.c
*** elmME+.2.5.alpha2/src/init.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/src/init.c 2004-08-16 08:12:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: init.c,v 1.49.8.7 2004/08/14 12:06:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: init.c,v 1.49.8.9 2004/08/16 05:12:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 226,231 ****
--- 226,232 ----
error_sleep(5+sleepmsg);
}
}
+ #endif




/* Determine options that might be set in the global elmrc */

***************
*** 249,254 ****
--- 250,317 ----
}
}

+ /* directory_check() requires terminal */

+
+ /** check to see if the user has defined a LINES or COLUMNS
+ value different to that in the termcap entry (for
+ windowing systems, of course!) **/
+
+
+
+ if ((cp = getenv("LINES")) != NULL && isdigit(*cp)) {
+ sscanf(cp, "%d", &lines);
+ }
+
+ if ((cp = getenv("COLUMNS")) != NULL && isdigit(*cp))
+ sscanf(cp, "%d", &columns);
+
+ set_root_menu(lines,columns);
+
+
+ /* And read changes what just implied */
+ menu_resized(*page);


+ }
+
/* Check if .elm and Mail directories exists */

directory_check();

***************
*** 281,294 ****


* If debug level is fairly low, ignore keyboard signals
*/

- /* FIXME -- Probably wrong variable ... */
- if (Debug.active < 5) {
- signal(SIGINT, SIG_IGN);
- }
- #else
- signal(SIGINT, SIG_IGN);
- #endif
-

#ifdef DEBUG
/* FIXME -- Probably wrong variable ... */
if (Debug.active < 5) { /* otherwise let the system trap 'em! */

--- 344,349 ----
***************
*** 480,547 ****
exit(1);
}

-
if (OPMODE_IS_INTERACTIVE(opmode)) {
- int init_scr_return = -1;


- int lines = -1;
- int columns = -1;

-
- init_opts_menu();
- init_scr_return = InitScreen(page);
-
- out_util_setup();
-
-
- if (init_scr_return < 0) {
- if (init_scr_return == -1) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoTerm,
- "Sorry, but you must specify what type of terminal you're on if you want to\n\
- run the \"elm\" program. (You need your environment variable \"TERM\" set.)\n"));
- DPRINT(Debug,1,
- (&Debug,
- "No $TERM variable in environment!\n"));
- }
- else if (init_scr_return == -2) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadTerm,
- "You need a cursor-addressable terminal to run \"elm\" and I can't find any\n\
- kind of termcap entry for \"%s\" - check your \"TERM\" setting...\n"),
- getenv("TERM"));
- DPRINT(Debug,1,
- (&Debug,
- "$TERM variable is an unknown terminal type!\n"));
- } else {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTermInitFailed,
- "Failed trying to initialize your terminal entry: unknown return code %d\n"),
- init_scr_return);
- DPRINT(Debug,1,
- (&Debug,
- "Initscreen returned unknown code: %d\n",
- init_scr_return));
- }
- error_wait(); /* Be sure that we do not exit before error is shown */
- exit(1); /* all the errors share this exit statement */
- }
-
- /** check to see if the user has defined a LINES or COLUMNS
- value different to that in the termcap entry (for
- windowing systems, of course!) **/
-
-
-
- if ((cp = getenv("LINES")) != NULL && isdigit(*cp)) {
- sscanf(cp, "%d", &lines);
- }
-
- if ((cp = getenv("COLUMNS")) != NULL && isdigit(*cp))
- sscanf(cp, "%d", &columns);
-
- set_root_menu(lines,columns);
-
-
- /* And read changes what just implied */
- menu_resized(*page);
-
-

/* Now that we've read the rc file we can enter RAW mode */

Raw(ON);


/** clear the screen **/

--- 535,541 ----
Index: elmME+.2.5.alpha3-cvs/src/leavembox.c
*** elmME+.2.5.alpha2/src/leavembox.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/src/leavembox.c 2004-08-16 13:37:29.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.7 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.8 2004/08/16 10:37:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 648,653 ****
--- 648,655 ----

/* ============================================================== */

+ DPRINT(Debug,4,(&Debug, "Messages marked deleted: %d (at least)\n", marked_deleted));
+
if(marked_deleted) {


int answer = (always_del ?
*def_ans_yes : *def_ans_no); /* default answer */

***************
*** 692,697 ****
--- 694,701 ----
emergency_exit(0);
}

+ DPRINT(Debug,4,(&Debug, " delete? %c\n", answer));
+

if (answer == *def_ans_yes) {

sc = get_storage_count(mailbox);

***************
*** 716,729 ****
if (storage->headers[j]->exit_disposition != UNSET)
continue;

! if (ison(storage->headers[j] &&
! storage->headers[j]->status, DELETED)) {
storage->headers[j]->exit_disposition = DELETE;
to_delete++;
}
}
}

}
}
DPRINT(Debug,3,(&Debug, "Messages to delete: %d\n", to_delete));
--- 720,734 ----
if (storage->headers[j]->exit_disposition != UNSET)
continue;

! if (ison(storage->headers[j]->status, DELETED)) {
storage->headers[j]->exit_disposition = DELETE;
to_delete++;
}
}
}

+ DPRINT(Debug,9,(&Debug, " %d mailboxes examined, found %d messages to delete\n",
+ i,to_delete));
}
}
DPRINT(Debug,3,(&Debug, "Messages to delete: %d\n", to_delete));
Index: elmME+.2.5.alpha3-cvs/src/mime.c
*** elmME+.2.5.alpha2/src/mime.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/src/mime.c 2004-08-17 21:18:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime.c,v 1.31.8.2 2004/08/14 06:40:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime.c,v 1.31.8.3 2004/08/17 18:18:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 509,515 ****
ElmBadKeyword,
"Bad keyword on text: %.50s"),
buffer);

! if (! OPMODE_IS_INTERACTIVE(opmode))
ok = 0;
}
}
--- 509,515 ----
ElmBadKeyword,
"Bad keyword on text: %.50s"),
buffer);

! if (OPMODE_IS_INTERACTIVE(opmode))
ok = 0;
}
}
Index: elmME+.2.5.alpha3-cvs/src/screen/context.c
*** elmME+.2.5.alpha2/src/screen/context.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/src/screen/context.c 2004-08-15 22:56:29.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: context.c,v 1.3.8.2 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: context.c,v 1.3.8.3 2004/08/15 19:56:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 13,19 ****
struct menu_context ROOT_MENU = {
MENU_CONTEXT_magic,

! 0,0, /* lines, columns */
0,0, /* changed, redraw */


--- 13,19 ----
struct menu_context ROOT_MENU = {
MENU_CONTEXT_magic,

! DEFAULT_LINES_ON_TERMINAL,DEFAULT_COLUMNS_ON_TERMINAL, /* lines, columns */
0,0, /* changed, redraw */


***************
*** 25,31 ****
struct menu_context COOKED_MENU = {
MENU_CONTEXT_magic,

! 0,0, /* lines, columns */
0,0, /* changed, redraw */


--- 25,31 ----
struct menu_context COOKED_MENU = {
MENU_CONTEXT_magic,

! DEFAULT_LINES_ON_TERMINAL,DEFAULT_COLUMNS_ON_TERMINAL, /* lines, columns */
0,0, /* changed, redraw */


Index: elmME+.2.5.alpha3-cvs/src/screen/curses.c
*** elmME+.2.5.alpha2/src/screen/curses.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/src/screen/curses.c 2004-08-15 22:56:29.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curses.c,v 1.7.8.2 2004/07/19 09:20:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curses.c,v 1.7.8.3 2004/08/15 19:56:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 96,103 ****



int has_highlighting; /* highlighting available? */

-

-

/* Some additional capacities not used in ../src/curses.c */

static
--- 96,101 ----
***************
*** 111,117 ****
static char *_scroll_up = NULL, *_scroll_up_many = NULL;
#endif

! static int _lines, _columns, _automargin, _eatnewlineglitch;

int _intransmit = -1; /* are we transmitting keys? */

--- 109,119 ----
static char *_scroll_up = NULL, *_scroll_up_many = NULL;
#endif

! /* SO that early writes do not scrach */
! static int _lines = DEFAULT_LINES_ON_TERMINAL;
! static int _columns = DEFAULT_COLUMNS_ON_TERMINAL;
!
! static int _automargin, _eatnewlineglitch;

int _intransmit = -1; /* are we transmitting keys? */

***************
*** 134,143 ****
#define next_tab(a) (((((a-1)/cur_tabspacing)+1)*cur_tabspacing)+1)


- #define DEFAULT_LINES_ON_TERMINAL 24
- #define DEFAULT_COLUMNS_ON_TERMINAL 80
-
-
static char *us2s P_((unsigned char *str));
static char *us2s(str)
unsigned char *str;
--- 136,141 ----
Index: elmME+.2.5.alpha3-cvs/src/screen/def_screen.h
*** elmME+.2.5.alpha2/src/screen/def_screen.h 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/src/screen/def_screen.h 2004-08-15 22:56:29.000000000 +0300
***************
*** 1,10 ****


! /* $Id: def_screen.h,v 1.4.8.3 2004/07/19 09:20:02 hurtta Exp $ */

#include "elm_defs.h"
#include "mime.h"
#include "me.h"

#include "elm_globals.h"

extern int InGetPrompt; /* set if in GetPrompt() in read() */
/* HACK */

--- 1,13 ----
! /* $Id: def_screen.h,v 1.4.8.4 2004/08/15 19:56:29 hurtta Exp $ */



#include "elm_defs.h"
#include "mime.h"
#include "me.h"

#include "elm_globals.h"

+ #define DEFAULT_LINES_ON_TERMINAL 24
+ #define DEFAULT_COLUMNS_ON_TERMINAL 80
+

extern int InGetPrompt; /* set if in GetPrompt() in read() */
/* HACK */

Index: elmME+.2.5.alpha3-cvs/src/signals.c
*** elmME+.2.5.alpha2/src/signals.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha3-cvs/src/signals.c 2004-08-16 08:12:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: signals.c,v 1.24.8.3 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: signals.c,v 1.24.8.4 2004/08/16 05:12:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 297,302 ****
--- 297,303 ----

DPRINT(Debug,4, (&Debug, "Initializing terminating signals\n"));

+ signal(SIGINT, SIG_IGN);
signal(SIGQUIT, quit_signal); /* Quit signal */
signal(SIGTERM, term_signal); /* Terminate signal */
signal(SIGILL, ill_signal); /* Illegal instruction */

Kari E. Hurtta

unread,
Aug 31, 2004, 12:04:48 PM8/31/04
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL120

Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

files elm-2.4ME+PL120.patch.gz
and elm-2.4ME+120.tar.gz
for a moment.

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL120.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+120.tar.gz >
or
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL120.patch.gz >
and <URL: http://www.elmme-mailer.org/elm-2.4ME+120.tar.gz >
via WWW.

Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL120.patch.gz >
and <URL: http://koti.welho.com/khurtta/elm-2.4ME+120.tar.gz >
via WWW.

Is available on ftp.funet.fi (or ftp.ipv6.funet.fi)
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+
files elm-2.4ME+PL120.patch.gz
and elm-2.4ME+120.tar.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL120.patch.gz >
and <URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+120.tar.gz >
via WWW.


(1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.


Changes of Elm 2.4ME+ PL120 (25) compared with Elm 2.4ME+ PL119 (25)
--------------------------------------------------------------------

SUMMARY: This release fixes handling of multiple To:
headers, refines "showto" semantic and fixes
envelope sender of "Canceled mail" -view.

- Fix incorrect condition for deleting of messages marked for
deletion (actually condition worked on Elm 2.4ME+ and
did not worked on Elm ME+ 2.5 because different ison -macro)

- Group reply did not worked correctly when on mail
there was several To: -headers.

- Refine "showto" semantic. If that elmrc variable is
set and mail is not addressed to user, then To: address
is shown.

- Remove < > from address on real_from parsing.

- Set envelope from address to username when reading
Canceled mail special 'folder'. That way To:
-address should be displayed when viewing that 'folder'.

This patch is agaist Elm 2.4ME+ PL119 (25) --------------------------------

To apply this patch use
patch -p1 < this_file
on directory where Configure is located.

Index: elm2.4.ME+.120-cvs/hdrs/patchlevel.h
Prereq: 1123000000
*** elm2.4.ME+.119/hdrs/patchlevel.h 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.120-cvs/hdrs/patchlevel.h 2004-08-30 19:38:10.000000000 +0300
***************
*** 1,8 ****


! #define PATCHLEVEL "119 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.119
*/
! #define LAST_REPORT_TIME 1123000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Aug, 2004" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "120 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.120
*/
! #define LAST_REPORT_TIME 1125000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Aug, 2004" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.120-cvs/README.ME+
*** elm2.4.ME+.119/README.ME+ 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.120-cvs/README.ME+ 2004-08-30 19:38:09.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.828 2004/08/04 16:29:11 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.834 2004/08/30 16:38:09 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,42 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL120 (25) compared with Elm 2.4ME+ PL119 (25)
+ --------------------------------------------------------------------
+
+ SUMMARY: This release fixes handling of multiple To:
+ headers, refines "showto" semantic and fixes
+ envelope sender of "Canceled mail" -view.
+
+ - Fix incorrect condition for deleting of messages marked for
+ deletion (actually condition worked on Elm 2.4ME+ and
+ did not worked on Elm ME+ 2.5 because different ison -macro)
+
+ - Group reply did not worked correctly when on mail
+ there was several To: -headers.
+
+ - Refine "showto" semantic. If that elmrc variable is
+ set and mail is not addressed to user, then To: address
+ is shown.
+
+ - Remove < > from address on real_from parsing.
+
+ - Set envelope from address to username when reading
+ Canceled mail special 'folder'. That way To:
+ -address should be displayed when viewing that 'folder'.


+
Changes of Elm 2.4ME+ PL119 (25) compared with Elm 2.4ME+ PL118 (25)

--------------------------------------------------------------------

Index: elm2.4.ME+.120-cvs/doc/elmrc-info
*** elm2.4.ME+.119/doc/elmrc-info 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.120-cvs/doc/elmrc-info 2004-08-28 12:03:37.000000000 +0300
***************
*** 1,4 ****
! #@(#)$Id: elmrc-info,v 1.65 2004/07/20 15:35:30 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.66 2004/08/28 09:03:37 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.

***************
*** 329,334 ****
--- 329,336 ----


alternatives
# alternative addresses that I could receive mail from (usually a
# forwarding mailbox) and don't want to have listed...

+ #
+ # See also: showto

forms


# do we want to be able to mail out AT&T Mail Forms?

***************
*** 569,575 ****

showto
# if this variable is ON, Elm will show who the message is to rather than
! # who it is from in the headers display.

usepgppass


# If ON, Elm will prompt you for your PGP passphrase and use it whenever

--- 571,580 ----

showto
# if this variable is ON, Elm will show who the message is to rather than
! # who it is from in the headers display if the message is not
! # addressed to user.
! #
! # See also: alternatives

usepgppass


# If ON, Elm will prompt you for your PGP passphrase and use it whenever

Index: elm2.4.ME+.120-cvs/hdrs/elmlib.h
*** elm2.4.ME+.119/hdrs/elmlib.h 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.120-cvs/hdrs/elmlib.h 2004-08-24 16:06:10.000000000 +0300
***************
*** 1,7 ****


! /* $Id: elmlib.h,v 1.217 2004/07/27 20:25:01 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.217 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.218 2004/08/24 13:06:10 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.218 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 157,162 ****
--- 157,163 ----
charset_t defcharset));

extern void free_addr_items P_((struct addr_item *list));
+ extern void append_addr_items P_((struct addr_item **list, struct addr_item *list1));

/* getaddrfrm.c */

Index: elm2.4.ME+.120-cvs/lib/dispaddr.c
*** elm2.4.ME+.119/lib/dispaddr.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.120-cvs/lib/dispaddr.c 2004-08-28 12:03:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.17 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.18 2004/08/28 09:03:37 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 20,25 ****
--- 20,56 ----
return (unsigned char *)str;
}

+ static void add_to_string P_((struct string ** f1,
+ struct addr_item * ptr));
+ static void add_to_string(f1,ptr)
+ struct string ** f1;
+ struct addr_item * ptr;
+ {
+ struct string * f = *f1;
+
+ struct string * t = ptr->fullname;
+ struct string * t1 = new_string2(display_charset,s2us(ptr->addr));
+
+ if (!string_len(t))
+ t = t1;
+ if (!f)
+ f = dup_string(t);
+ else {
+ struct string * t2 = dup_string(f);
+ struct string * t3;
+
+ add_ascii_to_string(t2,s2us(", "));
+ t3 = cat_strings(t2,t,0);
+ free_string(&f);
+ f = t3;
+
+ free_string(&t2);
+ }
+ free_string(&t1);
+
+ *f1 = f;
+ }
+
static struct string * addr_to_str P_((struct addr_item *addr));
static struct string * addr_to_str(addr)
struct addr_item *addr;
***************
*** 27,52 ****
struct string * f = NULL;
struct addr_item * ptr;

! for (ptr=addr; ptr && ptr->addr; ptr++) {
! struct string * t = ptr->fullname;
! struct string * t1 = new_string2(display_charset,s2us(ptr->addr));
! if (!string_len(t))
! t = t1;
! if (!f)
! f = dup_string(t);
! else {
! struct string * t2 = dup_string(f);
! struct string * t3;
!
! add_ascii_to_string(t2,s2us(", "));
! t3 = cat_strings(t2,t,0);
! free_string(&f);
! f = t3;

- free_string(&t2);
- }
- free_string(&t1);
- }
return f;
}

--- 58,66 ----
struct string * f = NULL;
struct addr_item * ptr;

! for (ptr=addr; ptr && ptr->addr; ptr++)
! add_to_string(&f,ptr);

return f;
}

***************
*** 56,65 ****
{
int using_to = 0;
struct addr_item *p,*ptr;
! int okay_to = 1, okay_cc = 1;

DPRINT(Debug,9,(&Debug,
! "DisplayAddress: h (header_rec)=%p\n",h));

*f = NULL;

--- 70,81 ----
{
int using_to = 0;
struct addr_item *p,*ptr;
! int user_is_recipient = 0;
! struct string *to_addr = NULL;

DPRINT(Debug,9,(&Debug,
! "DisplayAddress: h (header_rec)=%p env_from=%s\n",
! h,h->env_from));

*f = NULL;

***************
*** 75,100 ****
if (!okay_address_l(p,NULL))
break;

! for (ptr = h->to; ptr && ptr->addr && ptr->fullname; ptr++)
! if (!okay_address_l(ptr, h->from)) {
DPRINT(Debug,6,(&Debug,
! "DisplayAddress: Sender is recipient (To): %s\n",
ptr->addr));

! okay_to = 0;
}

! for (ptr = h->cc; ptr && ptr->addr && ptr->fullname; ptr++)
! if (!okay_address_l(ptr, h->from)) {
DPRINT(Debug,6,(&Debug,
! "DisplayAddress: Sender is recipient (Cc): %s\n",
ptr->addr));
! okay_cc = 0;
}

DPRINT(Debug,6,(&Debug,
! "DisplayAddress: okay_to=%d, okay_cc=%d, I have sender=%s (%s)\n",
! okay_to,okay_cc,
p && p->addr ? "Yes" : "No",
p && p->addr ? p->addr : ""
));
--- 91,126 ----
if (!okay_address_l(p,NULL))
break;

! for (ptr = h->to; ptr && ptr->addr && ptr->fullname; ptr++) {
! if (!okay_address_l(ptr, NULL)) {
DPRINT(Debug,6,(&Debug,
! "DisplayAddress: Mail as addressed to user (TO): %s\n",
ptr->addr));

! user_is_recipient = 1;
!
! } else if (okay_address_l(ptr, h->from)) {
!
! DPRINT(Debug,6,(&Debug,
! "DisplayAddress: Picking up address %s\n",
! ptr->addr));
!
! add_to_string(&to_addr,ptr);
}
+ }

! for (ptr = h->cc; ptr && ptr->addr && ptr->fullname; ptr++) {
! if (!okay_address_l(ptr, NULL)) {
DPRINT(Debug,6,(&Debug,
! "DisplayAddress: Mail is addressed to user (CC): %s\n",
ptr->addr));
! user_is_recipient = 1;
}
+ }

DPRINT(Debug,6,(&Debug,
! "DisplayAddress: user_is_recipient=%d, I have sender=%s (%s)\n",
! user_is_recipient,
p && p->addr ? "Yes" : "No",
p && p->addr ? p->addr : ""
));
***************
*** 106,127 ****
* (perhaps I have also receiver... hmm.)
*/

! *f = addr_to_str(h->to);
if (*f)
using_to = TRUE;
! } else if (okay_to && okay_cc) {

! /* This message is not addressed to me. */

! if (showto) {
! *f = addr_to_str(h->to);
! if (*f)
! using_to = TRUE;
! else
! goto was_from;
! } else
! goto was_from;
!
} else { /* This message is addressed to me (or sender of mail). */
was_from:

--- 132,162 ----
* (perhaps I have also receiver... hmm.)
*/

! DPRINT(Debug,6,(&Debug,
! "DisplayAddress: User sent this message: %s\n",
! h->env_from));
!
! if (to_addr) {
! *f = to_addr;
! to_addr = NULL;
! } else
! *f = addr_to_str(h->to);
!
if (*f)
using_to = TRUE;
! else
! goto was_from;

! } else if (!user_is_recipient && to_addr && showto) {

! /* This message is not addressed to user and
! showto is set.
! */
!
! *f = to_addr;
! to_addr = NULL;
! using_to = TRUE;
!
} else { /* This message is addressed to me (or sender of mail). */
was_from:

***************
*** 137,142 ****
--- 172,180 ----
}
}

+ if (to_addr)
+ free_string(&to_addr);
+
/* This does not work correctly with unknown character
sets... */
remove_control(*f);
Index: elm2.4.ME+.120-cvs/lib/getaddr.c
*** elm2.4.ME+.119/lib/getaddr.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.120-cvs/lib/getaddr.c 2004-08-24 16:06:10.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.22 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.23 2004/08/24 13:06:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 679,684 ****
--- 679,722 ----
free(list);
}

+
+ void append_addr_items (list, list1)
+ struct addr_item **list, *list1;


+ {
+ int count = 0;

+ int n = 0;


+ struct addr_item *ptr;
+

+ struct addr_item *ret = *list;
+
+ for (ptr=ret; ptr->addr && ptr->fullname; ptr++)
+ n++;
+
+ count = n;
+ for (ptr=list1; ptr->addr && ptr->fullname; ptr++)
+ count++;
+
+
+ ret = safe_realloc(ret, (count + 1) * sizeof (*ret));
+
+ for (ptr=list1; ptr->addr && ptr->fullname && n < count; ptr++) {
+
+ ret[n].addr = safe_strdup(ptr->addr);
+ ret[n].fullname = dup_string (ptr->fullname);
+ ret[n].comment = NULL;
+ if (ptr->comment)
+ ret[n].comment = dup_string(ptr->comment);
+ n++;
+ }
+
+ ret[n].addr = NULL;
+ ret[n].fullname = NULL;
+ ret[n].comment = NULL;
+
+ *list = ret;
+ }
+

+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.120-cvs/lib/realfrom.c
*** elm2.4.ME+.119/lib/realfrom.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.120-cvs/lib/realfrom.c 2004-08-28 12:03:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.12 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.13 2004/08/28 09:03:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 113,123 ****
else {

if (env_from_source < 2) {
! /* <user> */
! if (entry != NULL)
! strfcpy(entry->env_from, field, sizeof(entry->env_from));
DPRINT(Debug,7,(&Debug,
! " user=%s\n", field));
}

/* <day> */
--- 113,135 ----
else {

if (env_from_source < 2) {
! char *X = field;
! int l;
!
! if (0 != strcmp(field,"<>") &&
! '<' == field[0] &&
! (l = strlen(field)) &&
! '>' == field[l-1]) {
! X = field+1;
! field[l-1] = '\0';
! }
!
! /* <user> */
! if (entry != NULL)
! strfcpy(entry->env_from, X, sizeof(entry->env_from));
DPRINT(Debug,7,(&Debug,
! " user=%s\n", X));
!
}

/* <day> */
Index: elm2.4.ME+.120-cvs/src/leavembox.c
*** elm2.4.ME+.119/src/leavembox.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.120-cvs/src/leavembox.c 2004-08-16 13:40:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.49 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.50 2004/08/16 10:40:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 703,710 ****


if (storage->headers[j]->exit_disposition != UNSET)
continue;

! if (ison(storage->headers[j] &&
! storage->headers[j]->status, DELETED)) {
storage->headers[j]->exit_disposition = DELETE;
to_delete++;
}

--- 703,709 ----


if (storage->headers[j]->exit_disposition != UNSET)
continue;

! if (ison(storage->headers[j]->status, DELETED)) {
storage->headers[j]->exit_disposition = DELETE;
to_delete++;
}

Index: elm2.4.ME+.120-cvs/src/messages/canceled_mail.c
*** elm2.4.ME+.119/src/messages/canceled_mail.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.120-cvs/src/messages/canceled_mail.c 2004-08-28 12:26:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.8 2004/08/03 15:20:26 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.9 2004/08/28 09:26:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/
***************

*** 967,972 ****
--- 967,977 ----


current->REC.header_charset = view->u.canceldir->cs;

current->REC.offset = 0;
+

+ /* Default envelope sender */
+ if (view == canceled_mail_view)
+ strfcpy(current->REC.env_from,username,
+ sizeof (current->REC.env_from));
}
}
break;
***************
*** 1339,1344 ****
--- 1344,1357 ----
sizeof (current->REC.env_from));
}

+ /* Adds env_from, if not set */
+ if (view == canceled_mail_view &&
+ !current->REC.env_from[0]) {
+
+ strfcpy(current->REC.env_from,username,


+ sizeof (current->REC.env_from));
+ }
+

if (headers && headers->from.addrs &&

! current->REC.from) {


current->REC.from = dup_addr_list(headers->from.addrs);

Index: elm2.4.ME+.120-cvs/src/messages/header_alloc.c
*** elm2.4.ME+.119/src/messages/header_alloc.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.120-cvs/src/messages/header_alloc.c 2004-08-24 16:06:10.000000000 +0300
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.10 2004/03/27 18:31:48 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,8 ----
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.11 2004/08/24 13:06:10 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 271,278 ****
current_header->subject = new_string(display_charset);


! if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
! "From"))) {
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &
--- 271,281 ----
current_header->subject = new_string(display_charset);


! for (tmphdr = locate_header_by_name(parsed_headers,
! "From");
! tmphdr;
! tmphdr = tmphdr -> next_this_header) {
!
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &
***************
*** 280,309 ****
is_rfc1522(tmphdr->body),
current_header->header_charset);

! if (addrs) {
! if (current_header->from)
! free_addr_items(current_header->from);
! current_header->from = addrs;

! #if DEBUG
! if (Debug.active > 10) {
! struct addr_item * p;
! for (p = current_header->from; p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- from[%d] addr='%s' comment='%S' fullname='%S'\n",
! p - current_header->from,
! p->addr,
! p->comment,
! p->fullname));
!
! }
! }
! #endif
}
}

! if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
! "To"))) {
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &
--- 283,305 ----
is_rfc1522(tmphdr->body),
current_header->header_charset);

! if (addrs) {
!
! if (current_header->from) {
! append_addr_items(& (current_header->from), addrs);
! free_addr_items(addrs);

! } else
! current_header->from = addrs;
!
}
}

! for (tmphdr = locate_header_by_name(parsed_headers,
! "To");
! tmphdr;
! tmphdr = tmphdr -> next_this_header) {
!
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &
***************
*** 312,339 ****
current_header->header_charset);

if (addrs) {
! if (current_header->to)
! free_addr_items(current_header->to);
! current_header->to = addrs;
!
! #if DEBUG
! if (Debug.active > 10) {
! struct addr_item * p;
! for (p = current_header->to; p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- to[%d] addr='%s' comment='%S' fullname='%S'\n",
! p - current_header->to,
! p->addr,
! p->comment,
! p->fullname));
! }
! }
! #endif
}
}

! if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
! "Cc"))) {
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &
--- 308,327 ----
current_header->header_charset);

if (addrs) {
!
! if (current_header->to) {
! append_addr_items(& (current_header->to), addrs);
! free_addr_items(addrs);
! } else
! current_header->to = addrs;
}
}

! for (tmphdr = locate_header_by_name(parsed_headers,
! "Cc");
! tmphdr;
! tmphdr = tmphdr -> next_this_header) {
!
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &
***************
*** 342,365 ****
current_header->header_charset);

if (addrs) {
! if (current_header->cc)
! free_addr_items(current_header->cc);
! current_header->cc = addrs;
!
! #if DEBUG
! if (Debug.active > 10) {
! struct addr_item * p;
! for (p = current_header->cc; p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- cc[%d] addr='%s' comment='%S' fullname='%S'\n",
! p - current_header->cc,
! p->addr,
! p->comment,
! p->fullname));
!
! }
! }
! #endif
}
}

--- 330,340 ----
current_header->header_charset);

if (addrs) {
! if (current_header->cc) {
! append_addr_items(& (current_header->cc), addrs);
! free_addr_items(addrs);
! } else
! current_header->cc = addrs;
}
}

Kari E. Hurtta

unread,
Sep 27, 2004, 9:46:38 AM9/27/04
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL121

Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

files elm-2.4ME+PL121.patch.gz
and elm-2.4ME+121.tar.gz
for a moment.

Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL121.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+121.tar.gz >

Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL121.patch.gz >
and <URL: http://koti.welho.com/khurtta/elm-2.4ME+121.tar.gz >
via WWW.

Is available on ftp.funet.fi (or ftp.ipv6.funet.fi)
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+

files elm-2.4ME+PL121.patch.gz
and elm-2.4ME+121.tar.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL121.patch.gz >
and <URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+121.tar.gz >
via WWW.


(1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.


Changes of Elm 2.4ME+ PL121 (25) compared with Elm 2.4ME+ PL120 (25)
--------------------------------------------------------------------

SUMMARY: This release changes handling of
shared libraries and includes some
other minor changes or fixes.

- Better rpath test on Configure
- Better soname test on Configure
- Some fixes about soname_include_path
- Change soname_include_path values
define/undef to y/n. It is not used
for #define.

- Allow setting soname_include_path=n
always if rpath works

- Add extra libraries needed by shared libraries
(shared_libs/*/) to rpath of executable.

- Effectively local-fast-lookup = ON is now
always used when ASCII filenames are looked.

- Removed Configure warning:
"(I see you are using the Korn shell. Some ksh's
blow up on Configure, especially on exotic machines.
If yours does, try the Bourne shell instead.)"

- Let builtin pager show also address and not only
name of sender!

- Fix error
RC PANIC in rc_handle.c:1226:expand_dt_path
>>>Bad state on end
when incorrect elmrc is read
weedout = *clear-weed-list*"

This patch is agaist Elm 2.4ME+ PL120 (25) --------------------------------

To apply this patch use
patch -p1 < this_file
on directory where Configure is located.

Index: elm2.4.ME+.121-cvs/hdrs/patchlevel.h
Prereq: 1125000000
*** elm2.4.ME+.120/hdrs/patchlevel.h 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.121-cvs/hdrs/patchlevel.h 2004-09-22 20:37:09.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "120 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.120
*/
! #define LAST_REPORT_TIME 1125000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Aug, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Aug, 2004"



/*
* Local Variables:
--- 1,12 ----

! #define PATCHLEVEL "121 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1127000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Sep, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Sep, 2004"

/*
* Local Variables:
Index: elm2.4.ME+.121-cvs/README.ME+
*** elm2.4.ME+.120/README.ME+ 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.121-cvs/README.ME+ 2004-09-22 20:37:08.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.834 2004/08/30 16:38:09 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.844 2004/09/22 17:37:08 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,56 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL121 (25) compared with Elm 2.4ME+ PL120 (25)
+ --------------------------------------------------------------------
+
+ SUMMARY: This release changes handling of
+ shared libraries and includes some
+ other minor changes or fixes.
+
+ - Better rpath test on Configure
+ - Better soname test on Configure
+ - Some fixes about soname_include_path
+ - Change soname_include_path values
+ define/undef to y/n. It is not used
+ for #define.
+
+ - Allow setting soname_include_path=n
+ always if rpath works
+
+ - Add extra libraries needed by shared libraries
+ (shared_libs/*/) to rpath of executable.
+
+ - Effectively local-fast-lookup = ON is now
+ always used when ASCII filenames are looked.
+
+ - Removed Configure warning:
+ "(I see you are using the Korn shell. Some ksh's
+ blow up on Configure, especially on exotic machines.
+ If yours does, try the Bourne shell instead.)"
+
+ - Let builtin pager show also address and not only
+ name of sender!
+
+ - Fix error
+ RC PANIC in rc_handle.c:1226:expand_dt_path
+ >>>Bad state on end
+ when incorrect elmrc is read
+ weedout = *clear-weed-list*"
+

+
Changes of Elm 2.4ME+ PL120 (25) compared with Elm 2.4ME+ PL119 (25)

--------------------------------------------------------------------

Index: elm2.4.ME+.121-cvs/Configure
*** elm2.4.ME+.120/Configure 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.121-cvs/Configure 2004-09-23 21:47:19.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.155 2004/07/27 20:25:01 hurtta Exp $


#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.161 2004/09/23 18:47:19 hurtta Exp $
#

: sanity checks
***************
*** 16,25 ****
PATH=".:$PATH:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin"
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)

- (alias) >/dev/null 2>&1 && \
- echo "(I see you are using the Korn shell. Some ksh's blow up on Configure," && \
- echo "especially on exotic machines. If yours does, try the Bourne shell instead.)"
-
X="`dirname $0`"
case "$X" in
'')
--- 16,21 ----
***************
*** 336,345 ****
d_dlopen_libs=''
shared_list=''
shared_register=''
! dlopen_lib='';
rpath_opt=''
soname_opt=''
soname_include_path=''
dynamic_opt=''
d_dynamic_main=''
have_codeset=''
--- 332,343 ----
d_dlopen_libs=''
shared_list=''
shared_register=''
! dlopen_lib=''
rpath_opt=''
+ rpath_ok=''
soname_opt=''
soname_include_path=''
+ soname_ok=''
dynamic_opt=''
d_dynamic_main=''
have_codeset=''
***************
*** 2384,2409 ****
'-shared -soname='; do
case "$soname_opt" in
'')
! echo " Trying creation with ${A}DIR/name.so"
! if $cc $ccflags $picflag ${A}$LibLoc/testshared.so -o ../shlib/testshared.so try_sh.c > try.log 2>&1
then
soname_opt="$A"
! echo "Succeed with ${soname_opt}directory/name.so"
fi
;;
esac
done

-
if $test "X$soname_opt" != X
then

rpath_opt=''
for A in '-rpath ' '-Xlinker -rpath -Xlinker ' '-R'; do
case "$rpath_opt" in
'')
echo " Trying link with ${A}DIR"
! if $cc $ccflags $picflag -o try $A$LibLoc try.c ../shlib/testshared.so $libs > try.log 2>&1
then
rpath_opt="$A"
echo "Succeed with ${rpath_opt}directory"
--- 2382,2416 ----
'-shared -soname='; do
case "$soname_opt" in
'')
! echo " Trying creation with ${A}name.so"
! if $cc $ccflags $picflag ${A}testshared.so -o ../shlib/testshared-dummy.so try_sh.c > try.log 2>&1
then
soname_opt="$A"
! echo "Succeed with ${soname_opt}name.so"
! mv ../shlib/testshared-dummy.so ../shlib/testshared.so || exit 1
fi
;;
esac
done

if $test "X$soname_opt" != X
then

+ echo
+ echo "1) Testing shared library usage with RPATH ... "
+
+ rpath_ok=''
rpath_opt=''
+
+ XX=testshared-$$.so
+ cp ../shlib/testshared.so $XX || exit 1
+
+
for A in '-rpath ' '-Xlinker -rpath -Xlinker ' '-R'; do
case "$rpath_opt" in
'')
echo " Trying link with ${A}DIR"
! if $cc $ccflags $picflag -o try $A$LibLoc try.c $XX $libs > try.log 2>&1
then
rpath_opt="$A"
echo "Succeed with ${rpath_opt}directory"
***************
*** 2411,2432 ****
;;
esac
done

if $test "X$rpath_opt" != X
then

if ./try ; then
! echo "Shared libraries seems work"
! d_shared="$define"
else
! echo "Unable to figure out how support shared libraries"
! d_shared="$undef"
fi

else
! echo "Compiling or linking with test shared library failed"
! d_shared="$undef"
fi

if $test "$d_shared" = "$define" ; then
$cat > dltry.c <<'EOF'
--- 2418,2495 ----
;;
esac
done
+ rm $XX
+

if $test "X$rpath_opt" != X
then

if ./try ; then
! echo "Shared libraries (with RPATH) seems work"
! rpath_ok='OK'
else
! echo "Runtime linking with test shared library failed (RPATH)"
fi

else
! echo "Compiling or linking with test shared library failed (RPATH)"
fi
+ rm -f try
+
+ echo
+ echo "2) Testing shared library usage with absolute SONAME ... "
+
+ soname_ok=''
+
+ echo "Creating library with ${soname_opt}dirname/name.so"
+
+ if $cc $ccflags $picflag ${soname_opt}$LibLoc/testshared-ab.so -o ../shlib/testshared-dummy2.so try_sh.c > try.log 2>&1
+ then
+ mv ../shlib/testshared-dummy2.so ../shlib/testshared-ab.so || exit 1
+
+
+ XX=testshared-$$.so
+ cp ../shlib/testshared-ab.so $XX || exit 1
+
+ echo "Linking with created library"
+ if $cc $ccflags $picflag -o try try.c $XX $libs > try.log 2>&1
+ then
+ rm $XX
+
+
+ if ./try ; then
+ echo "Shared libraries (with absolute SONAME) seems work"
+ soname_ok='OK'
+
+ else
+ echo "Runtime linking with test shared library failed (with absolute SONAME)"
+ fi
+
+ else
+ echo "linking with test shared library failed (with absolute SONAME)"
+ fi
+ rm -f $XX
+ fi
+
+
+ echo
+ case "$rpath_ok$soname_ok" in
+ OKOK)
+ echo "Shared libraries seems work (both methods works)"
+ d_shared="$define"
+ ;;
+
+ *OK*)
+ echo "Shared libraries seems work (one method works)"
+ d_shared="$define"
+ ;;
+ *)
+ echo "Shared libraries seems NOT work"
+ d_shared="$undef"


+ ;;
+ esac
+
+

if $test "$d_shared" = "$define" ; then
$cat > dltry.c <<'EOF'
***************
*** 2581,2587 ****

fi

! $rm -f try_sh.c try.c dltry.c ./try try.log dltry.log ../shlib/testshared.so dltry try_dyn.c ../shlib/testdynshared.so dltry2.c dltry2

else
echo "dlfcn.h not found (no shared librariers)"
--- 2644,2650 ----

fi

! $rm -f try_sh.c try.c dltry.c ./try try.log dltry.log ../shlib/testshared.so ./shlib/testshared-ab.so dltry try_dyn.c ../shlib/testdynshared.so dltry2.c dltry2

else
echo "dlfcn.h not found (no shared librariers)"
***************
*** 5743,5766 ****
done
fi

! soname_include_path="$undef"
if $test "$d_shared" = "$define" ; then
if $test -n "$install_prefix" ; then
shlib="$install_prefix/$libdirname"
echo "Will install $package shared libraries to $shlib"

! if $test -f /etc/ld.so.conf ; then
if $grep "^$shlib" < /etc/ld.so.conf >/dev/null; then
echo "WARNING: Directory $shlib is listed on file /etc/ld.so.conf"
echo " Linux ldconfig gives errors when soname include pathnames"
echo " therefore disabling generating of pathnames to soname"
! soname_include_path="$undef"
! else
! soname_include_path="$define"
! fi
!
! else
! soname_include_path="$define"
fi


--- 5806,5839 ----
done
fi

! : Translate old value
! case "$soname_include_path" in
! "$define")
! soname_include_path=y
! ;;
! "$undef")
! soname_include_path=n
! ;;
! esac
!
! soname_force='n'
if $test "$d_shared" = "$define" ; then
+
if $test -n "$install_prefix" ; then
shlib="$install_prefix/$libdirname"
echo "Will install $package shared libraries to $shlib"

! if $test "X$soname_ok" != XOK ; then
! soname_include_path=n
!
! elif $test -f /etc/ld.so.conf ; then
if $grep "^$shlib" < /etc/ld.so.conf >/dev/null; then
echo "WARNING: Directory $shlib is listed on file /etc/ld.so.conf"
echo " Linux ldconfig gives errors when soname include pathnames"
echo " therefore disabling generating of pathnames to soname"
! soname_include_path=n
! soname_force='y'
! fi
fi


***************
*** 5780,5786 ****
to smaller. Shared library directory does not need to be one of default
directories used by run time linker. To disabled Elm ME+'s shared library
support you can give "none" as shared library directory.
-
EOM

cont=true
--- 5853,5858 ----
***************
*** 5804,5810 ****
if $test -d "$shlib"; then
cont=''

! if $test -f /etc/ld.so.conf ; then
if $grep "^$shlib" < /etc/ld.so.conf >/dev/null; then
$cat <<EOF
WARNING: Directory $shlib is listed on file /etc/ld.so.conf
--- 5876,5885 ----
if $test -d "$shlib"; then
cont=''

! if $test "X$soname_ok" != XOK ; then
! soname_include_path=n
!
! elif $test -f /etc/ld.so.conf ; then
if $grep "^$shlib" < /etc/ld.so.conf >/dev/null; then
$cat <<EOF
WARNING: Directory $shlib is listed on file /etc/ld.so.conf
***************
*** 5814,5820 ****
o) Omit pathname from soname
i) ignore ldconfig warnings and include path on soname
EOF
! if $test "$soname_include_path" = "$undef"; then
dflt=i
else
dflt=o
--- 5889,5895 ----
o) Omit pathname from soname
i) ignore ldconfig warnings and include path on soname
EOF
! if $test "$soname_include_path" = y; then
dflt=i
else
dflt=o
***************
*** 5824,5838 ****
. myread
case "$ans" in
c*) cont=true;;
! o*) soname_include_path="$undef" ;;
! *) soname_include_path="$define"
esac
- else
- soname_include_path="$define"
fi

- else
- soname_include_path="$define"
fi
else
case "$fastread" in
--- 5899,5912 ----
. myread
case "$ans" in
c*) cont=true;;
! o*) soname_include_path=n
! soname_force='y'
! ;;
! *) soname_include_path=y
! ;;
esac
fi

fi
else
case "$fastread" in
***************
*** 5846,5859 ****
case "$ans" in
y*)
cont=''
! soname_include_path="$define"
;;
esac
fi
fi
done
fi

fi

if $test "$d_shared" = "$define" ; then
--- 5920,5977 ----
case "$ans" in
y*)
cont=''
!
;;
esac
fi
fi
done
fi
+ fi

+ if $test "$d_shared" = "$define" ; then
+
+ if $test "$soname_force" != y ; then
+
+ if $test "X$soname_ok" != XOK ; then
+ soname_include_path=n
+ elif $test "X$rpath_ok" != XOK ; then
+ soname_include_path=y
+
+ else
+ $cat <<EOF
+
+ Setting rpath pointing to $shlib on executable seems work.
+ This can be used to locate shared library. Also putting
+ full path to soname of linked shared libraty, may be used
+ to locate shared library.
+
+ EOF
+ case "$soname_include_path" in
+ ''|y)
+ dflt=n
+ ;;
+ *)
+ dflt=y
+ ;;
+ esac
+
+ rp="Omit pathname from soname (as duplicate effort)? [$dflt]"
+ $echo $n "$rp $c"
+ . myread
+ dflt=''
+ case "$ans" in
+ 'y')
+ soname_include_path=n
+ ;;
+ *)
+ soname_include_path=y
+ ;;
+ esac
+ fi
+ fi
+ else
+ soname_include_path=''
fi

if $test "$d_shared" = "$define" ; then
***************
*** 6765,6772 ****
--- 6883,6892 ----
dynamic_opt='$dynamic_opt'
dlopen_lib="$dlopen_lib"
rpath_opt='$rpath_opt'
+ rpath_ok='$rpath_ok'
soname_opt='$soname_opt'
soname_include_path="$soname_include_path"
+ soname_ok='$soname_ok'
tempnamo='$tempnamo'
tempnamc='$tempnamc'
d_termio='$d_termio'
Index: elm2.4.ME+.121-cvs/doc/elmrc-info
*** elm2.4.ME+.120/doc/elmrc-info 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.121-cvs/doc/elmrc-info 2004-09-11 13:42:07.000000000 +0300
***************
*** 1,4 ****


! #@(#)$Id: elmrc-info,v 1.66 2004/08/28 09:03:37 hurtta Exp $
# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.67 2004/09/11 10:42:07 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************

*** 440,445 ****
--- 440,447 ----


# Need to be unset, if same character on local-fs-charset has several

# repesentations (or encodings).
#
+ # This is implicty set always when ASCII filenames are looked.
+ #


# See also: local-fs-charset, imap-fast-lookup

local-fs-charset
Index: elm2.4.ME+.121-cvs/lib/localmbx.c
*** elm2.4.ME+.120/lib/localmbx.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.121-cvs/lib/localmbx.c 2004-09-13 11:00:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.65 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.65 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.67 2004/09/13 08:00:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 383,405 ****

/* Returns name relative to directory of browser */
static struct string * browser_descend_local P_((struct folder_browser *dir,
! struct string *rel_name));
! static struct string * browser_descend_local(dir,rel_name)
struct folder_browser *dir;
! struct string *rel_name;
{
int L, idx;
static struct string * ret = NULL;

int last_idx_ok = -1;

DPRINT(Debug,12,(&Debug,"browser_descend_local: dir=%p\n", dir));

! if (!rel_name) {
DPRINT(Debug,12,(&Debug,"browser_descend_local=NULL\n"));
return NULL;
}
!
L = string_len(rel_name);

/* Do not remove plain / */
--- 383,410 ----

/* Returns name relative to directory of browser */
static struct string * browser_descend_local P_((struct folder_browser *dir,
! struct string *rel_name1));
! static struct string * browser_descend_local(dir,rel_name1)
struct folder_browser *dir;
! struct string *rel_name1;
{
int L, idx;
static struct string * ret = NULL;
+ struct string *rel_name = NULL;
+ int is_ascii = 0;

int last_idx_ok = -1;

DPRINT(Debug,12,(&Debug,"browser_descend_local: dir=%p\n", dir));

! if (!rel_name1) {
DPRINT(Debug,12,(&Debug,"browser_descend_local=NULL\n"));
return NULL;
}
!
! rel_name = ascify_string(rel_name1);
! DPRINT(Debug,12,(&Debug,"browser_descend_local: rel_name=%S\n",rel_name));
!
L = string_len(rel_name);

/* Do not remove plain / */
***************
*** 410,415 ****
--- 415,428 ----
L));
}

+ if (rel_name->string_type->MIME_name &&
+ 0 == istrcmp(rel_name->string_type->MIME_name,"US-ASCII")) {
+ is_ascii++;
+
+ DPRINT(Debug,12,(&Debug,
+ "browser_descend_local: relname is ASCII only...\n"));
+ }
+
for (idx = 0; idx < L ; idx++) {
uint16 code = give_unicode_from_string(rel_name,idx);

***************
*** 417,426 ****
int X1 = 0;
struct string * A1 = NULL;

! if (local_fast_lookup) {
int idx2;
DPRINT(Debug,12,(&Debug,
! "browser_descend_local: local_fast_lookup: Going to last directory on path\n"));

for (idx2 = idx+1; idx2 < L; idx2++) {
uint16 code2 = give_unicode_from_string(rel_name,idx2);
--- 430,441 ----
int X1 = 0;
struct string * A1 = NULL;

! if (local_fast_lookup || is_ascii) {
int idx2;
DPRINT(Debug,12,(&Debug,
! "browser_descend_local:%s%s: Going to last directory on path\n",
! local_fast_lookup ? " local_fast_lookup" : "",
! is_ascii ? " is_ascii" : ""));

for (idx2 = idx+1; idx2 < L; idx2++) {
uint16 code2 = give_unicode_from_string(rel_name,idx2);
***************
*** 683,688 ****
--- 698,705 ----
last_idx_ok++;

ret = clip_from_string(rel_name,&last_idx_ok,string_len(rel_name));
+
+ free_string(&rel_name);

if (dir->dirname)
DPRINT(Debug,12,(&Debug,"*** %S as relative to %S is %S\n",
Index: elm2.4.ME+.121-cvs/lib/Makefile.SH
*** elm2.4.ME+.120/lib/Makefile.SH 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121-cvs/lib/Makefile.SH 2004-09-05 11:17:07.000000000 +0300
***************
*** 46,52 ****
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.90 2004/07/12 17:48:39 hurtta Exp $


#
# Makefile for the ELM mail program.
#

--- 46,52 ----
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.91 2004/09/05 08:17:07 hurtta Exp $


#
# Makefile for the ELM mail program.
#

***************
*** 106,112 ****
if $test "$d_shared" = "$define" ; then

A=
! if $test "$soname_include_path" = "$define" ; then
A="$shlib/"
fi

--- 106,112 ----
if $test "$d_shared" = "$define" ; then

A=
! if $test "$soname_include_path" = y ; then
A="$shlib/"
fi

Index: elm2.4.ME+.121-cvs/lib/rc_handle.c
*** elm2.4.ME+.120/lib/rc_handle.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121-cvs/lib/rc_handle.c 2004-09-13 14:44:23.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.29 2004/07/20 15:35:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.30 2004/09/13 11:44:23 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

***************
*** 1219,1224 ****
--- 1219,1230 ----
ptr->list = safe_realloc(ptr->list,
(ptr->nlen+1)* sizeof (ptr->list[0]));
ptr->list[ptr->nlen++] = value;
+
+ if (q) {
+ DPRINT(Debug,9,(&Debug,
+ "expand_dt_path : Starting next quoted value...\n"));
+ start_val = p+1;
+ }
}
}

Index: elm2.4.ME+.121-cvs/shared_libs/iconv/Makefile.SH
*** elm2.4.ME+.120/shared_libs/iconv/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.121-cvs/shared_libs/iconv/Makefile.SH 2004-09-05 11:17:07.000000000 +0300
***************
*** 17,23 ****
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.8 2004/01/24 11:06:02 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.9 2004/09/05 08:17:07 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 40,46 ****
!GROK!THIS!

A=
! if $test "$soname_include_path" = "$define" ; then
A="$shlib/"
fi

--- 40,46 ----
!GROK!THIS!

A=
! if $test "$soname_include_path" = y ; then
A="$shlib/"
fi

Index: elm2.4.ME+.121-cvs/shared_libs/smtp/Makefile.SH
*** elm2.4.ME+.120/shared_libs/smtp/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.121-cvs/shared_libs/smtp/Makefile.SH 2004-09-05 11:17:07.000000000 +0300
***************
*** 17,23 ****
echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.12 2004/01/24 11:06:02 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.13 2004/09/05 08:17:07 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 40,46 ****
!GROK!THIS!

A=
! if $test "$soname_include_path" = "$define" ; then
A="$shlib/"
fi

--- 40,46 ----
!GROK!THIS!

A=
! if $test "$soname_include_path" = y ; then
A="$shlib/"
fi

Index: elm2.4.ME+.121-cvs/shared_libs/tls/Makefile.SH
*** elm2.4.ME+.120/shared_libs/tls/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.121-cvs/shared_libs/tls/Makefile.SH 2004-09-05 11:17:07.000000000 +0300
***************
*** 17,23 ****
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.16 2004/01/24 11:06:02 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17 2004/09/05 08:17:07 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 40,46 ****
!GROK!THIS!

A=
! if $test "$soname_include_path" = "$define" ; then
A="$shlib/"
fi

--- 40,46 ----
!GROK!THIS!

A=
! if $test "$soname_include_path" = y ; then
A="$shlib/"
fi

Index: elm2.4.ME+.121-cvs/src/Makefile.SH
*** elm2.4.ME+.120/src/Makefile.SH 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.121-cvs/src/Makefile.SH 2004-09-11 10:31:19.000000000 +0300


***************
*** 31,37 ****

cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.52 2004/07/27 20:25:02 hurtta Exp $


#
# Makefile for the ELM mail program.
#
--- 31,37 ----

cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.54 2004/09/11 07:31:19 hurtta Exp $


#
# Makefile for the ELM mail program.
#

***************
*** 63,72 ****
TAGS = ctags

LOCALETARG = $localetarget
- RPATH = $rpath_opt$shlib

!GROK!THIS!



if $test "$make_sets_make" != "$define" ; then

cat >>Makefile <<!GROK!THIS!
--- 63,98 ----
TAGS = ctags

LOCALETARG = $localetarget

!GROK!THIS!

+ if $test "X$rpath_ok" = XOK ; then
+
+ # Use -rpath for directories need by shared_libs
+ # It is is possbile to also use -rpath-link on Linux and SunOS
+ # but it may require extra Configure test....
+
+ rlink=
+ for domake in $shared_list ; do
+ dir=
+ varname="\$${domake}_lib_dir"
+ eval "dir=$varname"
+ if $test "X$dir" != X ; then
+ rlink="$rlink $rpath_opt$dir"
+ fi
+ done
+
+ cat >>Makefile <<!GROK!THIS!
+ RPATH = $rpath_opt$shlib $rlink
+ !GROK!THIS!
+
+ else
+ cat >>Makefile <<!GROK!THIS!
+ RPATH =
+ !GROK!THIS!
+
+ fi
+

if $test "$make_sets_make" != "$define" ; then

cat >>Makefile <<!GROK!THIS!
Index: elm2.4.ME+.121-cvs/src/metapager.c
*** elm2.4.ME+.120/src/metapager.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.121-cvs/src/metapager.c 2004-09-17 10:37:02.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: metapager.c,v 1.39 2004/06/18 09:29:51 hurtta Exp $";

/*****************************************************************************

! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: metapager.c,v 1.43 2004/09/17 07:37:02 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 208,261 ****
int buf4_visible_len = 0;
int filllen;



for (p = hdr->from; p->addr && p->fullname; p++) {

int left = len- buf4_visible_len -4;
- struct string * s = NULL;
- struct string * s1 = NULL;
- int X = 0;
int total;
! int visible_len;
!
! if (0 < (total = string_len(p->fullname))) {
! /* Use convert_string instead of dup_string so
! * that text with unknown charset is printed
! * as [?charset?]
! */
! s = convert_string(buffer.display_charset[0],
! p->fullname,1);
! } else
! s = new_string2(buffer.display_charset[0],
! s2us(p->addr));
!
if (left < 4) {
- free_string(&s);
break;
}
if (string_len(buf4) > 0) {
add_ascii_to_string(buf4,s2us(", "));
buf4_visible_len += 2;

! left = len - buf4_visible_len -4;
}


- s1 = curses_printable_clip(s,&X,len+total,&visible_len,left);

! free_string(&s);
! if (s1) {
! s = cat_strings(buf4,s1,1);

! buf4_visible_len += visible_len; /* Assumed */

- free_string(&buf4);
- buf4 = s;
- free_string(&s1);
- }

! if (buf4_visible_len >= len-4) {
add_ascii_to_string(buf4,s2us("..."));
buf4_visible_len += 3;
! break;
}
}

--- 208,343 ----
int buf4_visible_len = 0;
int filllen;

+ #define ADDRLEN 15
+

for (p = hdr->from; p->addr && p->fullname; p++) {

int left = len- buf4_visible_len -4;
int total;
! int reserve = strlen(p->addr);
!
! if (reserve > ADDRLEN)
! reserve = ADDRLEN;
!
if (left < 4) {
break;
}
+
if (string_len(buf4) > 0) {
add_ascii_to_string(buf4,s2us(", "));
buf4_visible_len += 2;

! left = len - buf4_visible_len-4;
}

+ if (reserve > left) {
+ add_ascii_to_string(buf4,s2us("..."));
+ buf4_visible_len += 3;
+ break;
+ }


! if (left > reserve+8 &&
! (0 < (total = string_len(p->fullname)))) {
! struct string * Sbase;
! struct string * s1 = NULL;
! int X = 0;
! int visible_len;
! int Old;

! /* Use convert_string instead of dup_string so
! * that text with unknown charset is printed
! * as [?charset?]
! */
! Sbase = convert_string(buffer.display_charset[0],
! p->fullname,1);
!
! Old = string_len(Sbase);
!
! s1 = curses_printable_clip(Sbase,&X,len+total,&visible_len,
! left-reserve-8);
!
! if (s1) {
! struct string * s = cat_strings(buf4,s1,1);
!
! buf4_visible_len += visible_len; /* Assumed */
!
! free_string(&buf4);
! buf4 = s;
! free_string(&s1);
! }
!
! if (X < Old) {
! /* Look if rest of name fits on place of '...' */
!
! left = len - buf4_visible_len-4;
!
! s1 = curses_printable_clip(Sbase,&X,len+total,&visible_len,
! left-reserve-4);
!
! if (X == Old && s1) {
!
! struct string * s = cat_strings(buf4,s1,1);
!
! buf4_visible_len += visible_len; /* Assumed */
!
! free_string(&buf4);
! buf4 = s;
! free_string(&s1);
!
! } else {
!
! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! }
! if (s1)
! free_string(&s1);
! }
!
! free_string(&Sbase);


! } else if (total > 0) {
add_ascii_to_string(buf4,s2us("..."));
buf4_visible_len += 3;
! }
!
! /* And include address */
! left = len - buf4_visible_len -4;
! if (left > 4) {
! char *T;
!
! struct string * s0 = NULL;
! struct string * s2 = NULL;
! int X = 0;
! int visible_len;
!
! T = p->addr;
! if ((total=strlen(p->addr)) > left-3) {
! int clip = total-left +6;
!
! if (clip > total)
! clip=total;
!
! T = p->addr + clip;
! }
!
! s0 = format_string(FRM(" <%s%s>"),
! T > p->addr ? "..." : "",
! T);
!
! s2 = curses_printable_clip(s0,&X,len+total,&visible_len,
! left);
!
! free_string(&s0);
! if (s2) {
! s0 = cat_strings(buf4,s2,1);
!
! buf4_visible_len += visible_len; /* Assumed */
!
! free_string(&buf4);
! buf4 = s0;
! free_string(&s2);
! }
}
}

Index: elm2.4.ME+.121-cvs/utils/Makefile.SH
*** elm2.4.ME+.120/utils/Makefile.SH 2003-11-15 18:19:06.000000000 +0200
--- elm2.4.ME+.121-cvs/utils/Makefile.SH 2004-09-11 10:31:19.000000000 +0300
***************
*** 16,22 ****
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.34 2003/11/15 15:50:22 hurtta Exp $
#
# Makefile for the Elm system utilities
#
--- 16,22 ----
echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.36 2004/09/11 07:31:19 hurtta Exp $
#
# Makefile for the Elm system utilities
#
***************
*** 43,51 ****
RM = $rm -f
TOUCH = $touch

- RPATH = $rpath_opt$shlib
!GROK!THIS!



if $test "$make_sets_make" != "$define" ; then

cat >>Makefile <<!GROK!THIS!
--- 43,77 ----
RM = $rm -f
TOUCH = $touch

!GROK!THIS!

+ if $test "X$rpath_ok" = XOK ; then
+
+ # Use -rpath for directories need by shared_libs
+ # It is is possbile to also use -rpath-link on Linux and SunOS
+ # but it may require extra Configure test....
+
+ rlink=
+ for domake in $shared_list ; do
+ dir=
+ varname="\$${domake}_lib_dir"
+ eval "dir=$varname"
+ if $test "X$dir" != X ; then
+ rlink="$rlink $rpath_opt$dir"
+ fi
+ done
+
+ cat >>Makefile <<!GROK!THIS!
+ RPATH = $rpath_opt$shlib $rlink
+ !GROK!THIS!
+
+ else
+ cat >>Makefile <<!GROK!THIS!
+ RPATH =
+ !GROK!THIS!
+
+ fi
+

if $test "$make_sets_make" != "$define" ; then

cat >>Makefile <<!GROK!THIS!

Kari E. Hurtta

unread,
Nov 8, 2004, 2:19:15 PM11/8/04
to @posti.fmi.fi Archive
Archive-name: elmME+2.5/PLalpha4.0

Elm ME+ 2.5 PLalpha4

- Is available on ftp.funet.fi (or ftp.ipv6.funet.fi)


via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/

files elm-ME+2.5.PLalpha4.patch.gz
and elm-ME+2.5.alpha4.tar.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-ME+2.5/elm-ME+2.5.PLalpha4.patch.gz >
and <URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-ME+2.5/elm-ME+2.5.alpha4.tar.gz >
via WWW.

- Is available with (1)
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha4.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.alpha.tar.gz >
via WWW.


(1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.


Before applying patch catenate parts 1 - 2 first.


That part (part 0) do not include patch. Patch

is on part 1 - 2.

This patch (Elm ME+ 2.5 PLalpha4) is agaist Elm ME+ 2.5 PLalpha3.


For applying thich patch use (on directory where Configure is)

patch -p1 < catenated_file

Then check that removed files do not exists or are empty

ls -la `cat OBSOLETE `

If that lists non-empty files, patch failed.

Then remove empty files with command

rm `cat OBSOLETE `


Changes on Elm ME+ 2.5 PLalpha4 compared with Elm2.4ME+ PLalpha3
----------------------------------------------------------------

SUMMARY: This release collects changes of Elm2.4ME+ PL120
and PL121. This release incorporates some new
commands and other changes from Elm 2.5 PL7.
Also crash on List-ID parsing is fixed.

* Collected ELM 2.4ME+ PL120 (25) changes:


- Group reply did not worked correctly when on mail
there was several To: -headers.
- Refine "showto" semantic. If that elmrc variable is
set and mail is not addressed to user, then To: address
is shown.
- Remove < > from address on real_from parsing.
- Set envelope from address to username when reading
Canceled mail special 'folder'. That way To:
-address should be displayed when viewing that 'folder'.

* Collected ELM 2.4ME+ PL121 (25) changes:


- Better rpath test on Configure
- Better soname test on Configure
- Some fixes about soname_include_path
- Change soname_include_path values
define/undef to y/n. It is not used
for #define.
- Allow setting soname_include_path=n
always if rpath works
- Add extra libraries needed by shared libraries
(shared_libs/*/) to rpath of executable.
- Effectively local-fast-lookup = ON is now
always used when ASCII filenames are looked.
- Removed Configure warning:
"(I see you are using the Korn shell. Some ksh's
blow up on Configure, especially on exotic machines.
If yours does, try the Bourne shell instead.)"
- Let builtin pager show also address and not only
name of sender!
- Fix error
RC PANIC in rc_handle.c:1226:expand_dt_path
>>>Bad state on end
when incorrect elmrc is read
weedout = *clear-weed-list*"

- Change from Elm 2.5:
- Pass topic only to display_helpfile()
instead of help section number. [D1] [D2] [D3]
- Removed 'prefix' argument from
copy_message*() functions. [D6]
- Added line argument to read_number() [D7]
- Added wait_time pararmeter to GetPrompt() [D8]
- Added '!' command to alias menu [D9]
- Added environment variables to elm
manual page [D10]
- Command 'u' works as command 'U' (Unread)
to messages which are not deleted. [D11]
- Allow both mansrc and catmansrc to be "none" [D12]

- If 'M' command is going to display To -address inside of ( )
and there is displaying of "To " address on place of from
address, do not display To -address inside of ( ).
- Minor change to output of 'M' command.

- Fix crash on List-ID parsing.


Renamed files:
doc/elm-help.0 => doc/help-main [D4]
doc/elm-help.1 => doc/help-options
doc/elm-help.2 => doc/help-alias
doc/elm-help.3 => doc/help-pager

Removed files:
hdrs/elmutil.h [D5]

New files:
utils/def_utils.h

Correspond quotes from Elm 2.5 PL7 Changes file:

[D1] The display_helpfile() program is now passed a just a
topic (say "options") instead of a full pathname
("/usr/local/lib/elm/help-options").

[D2] Calling semantics to display_helpfile() [file src/help.c]
changed. Before, it used to take an integer to select a
helpfile. Now, it takes a helpfile pathname. (These
pathnames are now defined in sysdefs.h.)

[D3] sysdefs.h no longer defines individual help files, but
rather a single "system_help_dir".

[D4] Renamed all help files from stuff like "elm-help.0" to
"help-main".

[D5] Reorganization of main header files. The elmutil.h
header is now obsolete. All portions of the Elm package
include elm_defs.h, and the main Elm program (but not
utilities) include elm_globals.h. Moved many definitions
specific to Elm (and not used by the utilities) from
elm_defs.h to elm_globals.h. Placed declaration
of the dozen-or-so widely used globals in elm_defs.h.

[D6] The calling semantics to copy_message() have changed.
It no longer accepts a "prefix" argument. New usage is:

copy_message(FILE *dest_file, int cm_options);

The following new options have been added:

CM_PREFIX - Add "prefixchars" to each line.
CM_FORWARDING - Replaces the (now removed) "forwarding" global.
CM_ATTRIBUTION - Add an attribution line.

[D7] Calling semantics to read_number() [file src/in_utils.c]
changed. It used to have a hardwired screen line number
and got its default response from a magic global
variable. Now you have to pass both of these as arguments.

[D8] Calling semantics to GetPrompt() [file src/in_utils.c]
changed. Now you need to pass the timeout as a parameter,
rather than using the global "timeout". Say "0" for
infinite timeout.

[D9] Allow a shell escape from the alias screen (just like from
the index screen). It does not put the shell escape onto the alias
screen menu. (from Keith Neufeld <neu...@pvi.org>)

[D10] Added docs for environment variables to the man page (from Eric
Haszlakiewicz <nime...@uaccess.net>)

[D11] Press u on a message that is read but not deleted
will mark the message as unread (from Larry Schwimmer
<ros...@cyclone.Stanford.EDU>).

[D12] Eliminate complaints in doc/Makefile about duplicate
makefile entries if mansrc and catmansrc are both "none"
(from Keith Neufeld<neu...@pvi.org>)

Kari E. Hurtta

unread,
Nov 8, 2004, 2:21:08 PM11/8/04
to @posti.fmi.fi Archive
Archive-name: elmME+2.5/PLalpha4.2

Elm ME+ 2.5 PLalpha4

- Is available on ftp.funet.fi (or ftp.ipv6.funet.fi)


via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


(1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.


Before applying patch catenate parts 1 - 2 first.

This patch (Elm ME+ 2.5 PLalpha4) is agaist Elm ME+ 2.5 PLalpha3.

===================================================== ( part 2/2 ) =====
*** 709,715 ****
* CM_LF: Metamail can not cope with CRLF
*/
if (!copy_message_f(infile,current_header,
! "", fpout, CM_LF, NULL)) {
/* FAIL */
fclose (fpout);
unlink (fname);
--- 709,715 ----
* CM_LF: Metamail can not cope with CRLF
*/
if (!copy_message_f(infile,current_header,
! fpout, CM_LF, NULL)) {
/* FAIL */
fclose (fpout);
unlink (fname);
Index: elmME+.2.5.alpha4-cvs/src/syscall.c
*** elmME+.2.5.alpha3/src/syscall.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/syscall.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33.2.4 2004/08/14 06:40:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.2.4 $ $State: Exp $



*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33.2.5 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.2.5 $ $State: Exp $



*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>

***************
*** 559,565 ****
mime_parse_routine)) {

if (!copy_message_f(F,hdr,
! "", tmpfp,
CM_DECODE | CM_FILT_HDR |
CM_REMOVE_ENVELOPE,
system_charset)) {
--- 559,565 ----
mime_parse_routine)) {

if (!copy_message_f(F,hdr,
! tmpfp,
CM_DECODE | CM_FILT_HDR |
CM_REMOVE_ENVELOPE,
system_charset)) {
Index: elmME+.2.5.alpha4-cvs/utils/answer.c
*** elmME+.2.5.alpha3/utils/answer.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/answer.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: answer.c,v 1.16.8.2 2004/08/15 07:34:25 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: answer.c,v 1.16.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 20,26 ****
even read in the system alias file at all.

**/
! #include "elmutil.h"
#include "ndbz.h"
#include "s_answer.h"
#include "sysdefs.h"
--- 20,26 ----
even read in the system alias file at all.

**/
! #include "def_utils.h"
#include "ndbz.h"
#include "s_answer.h"
#include "sysdefs.h"
***************
*** 40,45 ****
--- 40,47 ----

static void open_alias_file P_((void));

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/def_utils.h
*** /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200
--- elmME+.2.5.alpha4-cvs/utils/def_utils.h 2004-09-26 18:18:32.000000000 +0300
***************
*** 0 ****
--- 1,24 ----
+ /* $Id: def_utils.h,v 1.1.2.1 2004/09/26 15:18:32 hurtta Exp $ */
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.1.2.1 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+
+ /* Included on most src files on utils
+ */
+
+ #include "patchlevel.h"
+ #include "elm_defs.h"


+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

+
+
Index: elmME+.2.5.alpha4-cvs/utils/elmalias.c
*** elmME+.2.5.alpha3/utils/elmalias.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/elmalias.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.16.8.1 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.16.8.2 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 66,72 ****
* both alias files.
*/

! #include "elmutil.h"
#include "ndbz.h"
#include "s_elmalias.h"
#include <pwd.h>
--- 66,72 ----
* both alias files.
*/

! #include "def_utils.h"
#include "ndbz.h"
#include "s_elmalias.h"
#include <pwd.h>
***************
*** 131,136 ****
--- 131,138 ----
/*NOTREACHED*/
}

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/elmbindata.c
*** elmME+.2.5.alpha3/utils/elmbindata.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/elmbindata.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.5.8.1 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elmutil.h"
#include "s_me.h"
#include "s_elm.h"
#include "cs_imp.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.5.8.2 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "def_utils.h"
#include "s_me.h"
#include "s_elm.h"
#include "cs_imp.h"
***************
*** 25,30 ****
--- 25,31 ----
extern char *optarg;
extern int optind;

+ static char version_buff[NLEN];



int main(argc, argv)
int argc;

Index: elmME+.2.5.alpha4-cvs/utils/elmcharset.c
*** elmME+.2.5.alpha3/utils/elmcharset.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/elmcharset.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.29.8.2 2004/08/15 08:28:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elmutil.h"
#include "s_me.h"
#include "s_elm.h"
#include "cs_imp.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.29.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.3 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "def_utils.h"
#include "s_me.h"
#include "s_elm.h"
#include "cs_imp.h"
***************
*** 23,28 ****
--- 23,30 ----

#include "charmapcopy.h"

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/elmlibregister.c
*** elmME+.2.5.alpha3/utils/elmlibregister.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/elmlibregister.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.6.8.3 2004/08/15 10:51:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.6.8.4 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.4 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 14,20 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elmutil.h"
#include "s_me.h"
#include "s_elm.h"
#include "s_elmrc.h"
--- 14,20 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "def_utils.h"
#include "s_me.h"
#include "s_elm.h"
#include "s_elmrc.h"
***************
*** 32,37 ****
--- 32,39 ----


int register_fd = -1;
char * program_name = "elmrc-write";

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/elmrc-write.c
*** elmME+.2.5.alpha3/utils/elmrc-write.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/elmrc-write.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.13.8.3 2004/08/15 10:51:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.3 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.13.8.4 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.4 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 14,20 ****


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "elmutil.h"
#include "s_me.h"
#include "s_elm.h"
#include "s_elmrc.h"
--- 14,20 ----


* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

! #include "def_utils.h"
#include "s_me.h"
#include "s_elm.h"
#include "s_elmrc.h"
***************
*** 32,37 ****
--- 32,39 ----


int register_fd = -1;
char * program_name = "elmrc-write";

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/elmstringconvert.c
*** elmME+.2.5.alpha3/utils/elmstringconvert.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/elmstringconvert.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.8.8.2 2004/08/15 12:21:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elmutil.h"
#include "s_me.h"
#include "s_elm.h"
#include "cs_imp.h"
--- 1,12 ----
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.8.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.3 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "def_utils.h"
#include "s_me.h"
#include "s_elm.h"
#include "cs_imp.h"
***************
*** 149,154 ****
--- 149,156 ----
return 1;
}

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/elmterminal.c
*** elmME+.2.5.alpha3/utils/elmterminal.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/elmterminal.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.13.8.2 2004/08/15 12:28:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elmutil.h"
#include "s_me.h"
#include "s_elm.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.13.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.3 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "def_utils.h"
#include "s_me.h"
#include "s_elm.h"

***************
*** 19,24 ****
--- 19,26 ----
char * program_name = "elmterminal";
int register_fd = -1;

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/elmunidata.c
*** elmME+.2.5.alpha3/utils/elmunidata.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/elmunidata.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.18.8.2 2004/08/15 12:39:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "elmutil.h"
#include "s_me.h"
#include "s_elm.h"

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.18.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.3 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

! #include "def_utils.h"
#include "s_me.h"
#include "s_elm.h"

***************
*** 20,25 ****
--- 20,27 ----
extern char *optarg;
extern int optind;

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/fastmail.c
*** elmME+.2.5.alpha3/utils/fastmail.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/fastmail.c 2004-09-26 18:18:32.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.30.8.1 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.30.8.2 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 43,49 ****
-s subject (subject of message)
**/

! #include "elmutil.h"
#include "s_fastmail.h"

#if 0
--- 43,49 ----
-s subject (subject of message)
**/

! #include "def_utils.h"
#include "s_fastmail.h"

#if 0
***************
*** 155,160 ****
--- 155,162 ----
}


+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/from.c
*** elmME+.2.5.alpha3/utils/from.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/from.c 2004-09-26 18:18:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: from.c,v 1.48.8.4 2004/08/15 06:30:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: from.c,v 1.48.8.5 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,33 ****

**/

! #include "elmutil.h"
#include "s_from.h"
#include "s_elm.h"

--- 27,33 ----

**/

! #include "def_utils.h"
#include "s_from.h"
#include "s_elm.h"

***************
*** 105,110 ****
--- 105,112 ----
struct passwd *getpwuid();
#endif

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/Makefile.SH
*** elmME+.2.5.alpha3/utils/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/Makefile.SH 2004-11-02 21:36:17.000000000 +0200
***************
*** 16,28 ****


echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.34.38.1 2004/04/18 16:55:43 hurtta Exp $


#
# Makefile for the Elm system utilities
#

# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! #
#
# Variables
# Variables established by Configure
--- 16,32 ----


echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.34.38.4 2004/11/02 19:36:17 hurtta Exp $


#
# Makefile for the Elm system utilities
#

+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ########################################################################
+ # Based on Elm 2.4 utils/Makefile.SH. That code was following copyright:
+ #
# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! ########################################################################
#
# Variables
# Variables established by Configure


***************
*** 43,51 ****
RM = $rm -f
TOUCH = $touch

- RPATH = $rpath_opt$shlib
!GROK!THIS!

if $test "$make_sets_make" != "$define" ; then

cat >>Makefile <<!GROK!THIS!

--- 47,81 ----

***************
*** 249,255 ****

# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
! .PRECIOUS: $(INCLDIR)/elm_defs.h $(INCLDIR)/defs_major.h ../lib/libutil.a

checkalias: checkalias.SH ; sh $?
listalias: listalias.SH ; sh $?
--- 279,285 ----

# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
! .PRECIOUS: def_utils.h $(INCLDIR)/elm_defs.h $(INCLDIR)/defs_major.h ../lib/libutil.a

checkalias: checkalias.SH ; sh $?
listalias: listalias.SH ; sh $?
***************
*** 364,401 ****
$(TOUCH) $@


! $(INCLDIR)/elmutil.h: $(INCLDIR)/elm_defs.h


$(CHMOD) u+w $@
$(TOUCH) $@

-
# Dependencies of C object files
! prlong.o: $(INCLDIR)/elmutil.h
! answer.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_answer.h $(INCLDIR)/sysdefs.h
! elmalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_elmalias.h
! fastmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_fastmail.h
! from.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_from.h $(INCLDIR)/s_elm.h
! newalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newalias.h
! newmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newmail.h
! readmsg.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_readmsg.h
! elmcharset.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h charmapcopy.h
! elmrc-write.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
$(INCLDIR)/reghelper.h
! elmterminal.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/reghelper.h
! elmunidata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/unidata.h $(INCLDIR)/reghelper.h
! elmbindata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/bindata.h $(INCLDIR)/reghelper.h $(INCLDIR)/cs_imp.h \
charmapcopy.o
! elmstringconvert.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h
reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
$(INCLDIR)/reghelper.h
charmapcopy.o: charmapcopy.h $(INCLDIR)/s_elm.h $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/reghelper.h
! elmlibregister.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
$(INCLDIR)/reghelper.h

--- 394,430 ----
$(TOUCH) $@


! def_utils.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/patchlevel.h


$(CHMOD) u+w $@
$(TOUCH) $@

# Dependencies of C object files
! prlong.o: def_utils.h
! answer.o: def_utils.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_answer.h $(INCLDIR)/sysdefs.h
! elmalias.o: def_utils.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_elmalias.h
! fastmail.o: def_utils.h $(INCLDIR)/s_fastmail.h
! from.o: def_utils.h $(INCLDIR)/s_from.h $(INCLDIR)/s_elm.h
! newalias.o: def_utils.h $(INCLDIR)/s_newalias.h
! newmail.o: def_utils.h $(INCLDIR)/s_newmail.h
! readmsg.o: def_utils.h $(INCLDIR)/s_readmsg.h
! elmcharset.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h charmapcopy.h
! elmrc-write.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
$(INCLDIR)/reghelper.h
! elmterminal.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/reghelper.h
! elmunidata.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/unidata.h $(INCLDIR)/reghelper.h
! elmbindata.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/bindata.h $(INCLDIR)/reghelper.h $(INCLDIR)/cs_imp.h \
charmapcopy.o
! elmstringconvert.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h
reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
$(INCLDIR)/reghelper.h
charmapcopy.o: charmapcopy.h $(INCLDIR)/s_elm.h $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/reghelper.h
! elmlibregister.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
$(INCLDIR)/reghelper.h

Index: elmME+.2.5.alpha4-cvs/utils/newalias.c
*** elmME+.2.5.alpha3/utils/newalias.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/newalias.c 2004-09-26 18:18:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newalias.c,v 1.15.8.1 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newalias.c,v 1.15.8.2 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 30,42 ****

**/

! #include "elmutil.h"
#include "s_newalias.h"

void error();



extern int is_system; /* system file updating? */

int main(argc, argv)
int argc;
char *argv[];

--- 30,44 ----

**/

! #include "def_utils.h"
#include "s_newalias.h"

void error();



extern int is_system; /* system file updating? */

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/newmail.c
*** elmME+.2.5.alpha3/utils/newmail.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/newmail.c 2004-09-26 18:18:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35.8.4 2004/08/15 06:37:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35.8.5 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 57,63 ****

**/

! #include "elmutil.h"
#include "s_newmail.h"

DEBUG_VAR(Debug,__FILE__,"util");
--- 57,63 ----

**/

! #include "def_utils.h"
#include "s_newmail.h"

DEBUG_VAR(Debug,__FILE__,"util");
***************
*** 163,168 ****
--- 163,169 ----

static void save_acc P_((char *name));

+ static char version_buff[NLEN];



int main(argc, argv)
int argc;

Index: elmME+.2.5.alpha4-cvs/utils/prlong.c
*** elmME+.2.5.alpha3/utils/prlong.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/prlong.c 2004-09-26 18:18:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11.8.2 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11.8.3 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 47,53 ****
* ha...@grumpy.acme.com
*/

! # include "elmutil.h"

#define MAXWID 78 /* default maximum line width */
#define ONE_LDR "" /* default leader for first line */
--- 47,53 ----
* ha...@grumpy.acme.com
*/

! # include "def_utils.h"

#define MAXWID 78 /* default maximum line width */
#define ONE_LDR "" /* default leader for first line */
***************
*** 68,73 ****
--- 68,75 ----
exit(1);
}

+ static char version_buff[NLEN];
+

int main(argc, argv)
int argc;
char *argv[];

Index: elmME+.2.5.alpha4-cvs/utils/readmsg.c
*** elmME+.2.5.alpha3/utils/readmsg.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha4-cvs/utils/readmsg.c 2004-09-26 18:18:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.18.8.3 2004/07/03 15:23:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.18.8.4 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 75,81 ****

**/

! #include "elmutil.h"
#include "s_readmsg.h"

/** three defines for what level of headers to display **/
--- 75,81 ----

**/

! #include "def_utils.h"
#include "s_readmsg.h"

/** three defines for what level of headers to display **/
***************
*** 222,227 ****
--- 222,229 ----
return mssg_num_to_index_st(i+1,& (fstate->storage[mb]));

}
+
+ static char version_buff[NLEN];

Kari E. Hurtta

unread,
Nov 8, 2004, 2:20:22 PM11/8/04
to @posti.fmi.fi Archive
Archive-name: elmME+2.5/PLalpha4.1

Elm ME+ 2.5 PLalpha4

- Is available on ftp.funet.fi (or ftp.ipv6.funet.fi)


via anonymous ftp
directory pub/unix/mail/elm/elm-ME+2.5/


(1) NOTE:

It is currently unknown what will be done for ftp.ozone.fmi.fi
www.ozone.fmi.fi. Also ozone.fmi.fi will retire.


Before applying patch catenate parts 1 - 2 first.

This patch (Elm ME+ 2.5 PLalpha4) is agaist Elm ME+ 2.5 PLalpha3.

===================================================== ( part 1/2 ) =====


For applying thich patch use (on directory where Configure is)

patch -p1 < {this-file}

Then check that removed files do not exists or are empty

ls -la `cat OBSOLETE `

If that lists non-empty files, patch failed.

Then remove emty files with command

rm `cat OBSOLETE `


Index: elmME+.2.5.alpha4-cvs/hdrs/patchlevel.h
Prereq: 1124100000
*** elmME+.2.5.alpha3/hdrs/patchlevel.h 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha4-cvs/hdrs/patchlevel.h 2004-11-06 11:50:22.000000000 +0200
***************
*** 1,12 ****


! #define PATCHLEVEL "alpha3"
/* Used by Configure:
! SHAREDTAG: .1.1.3
*/
! #define LAST_REPORT_TIME 1124100000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Aug 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version ME+ 2.5, USENET supported version, released Aug 2004"



/*
* Local Variables:
--- 1,12 ----

! #define PATCHLEVEL "alpha4"
/* Used by Configure:
! SHAREDTAG: .1.1.4
*/
! #define LAST_REPORT_TIME 1130000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Nov 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version ME+ 2.5, USENET supported version, released Nov 2004"

/*
* Local Variables:
Index: elmME+.2.5.alpha4-cvs/README.ME+
*** elmME+.2.5.alpha3/README.ME+ 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha4-cvs/README.ME+ 2004-11-06 11:50:20.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.736.4.63 2004/08/18 06:27:32 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.736.4.81 2004/11/06 09:50:20 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 19,41 ****


===================================================================
* Changelog of ElmME+ 2.5

! Changes on Elm ME+ 2.5 PLalpha3 compared with Elm2.4ME+ PLalpha2 (25)
! ---------------------------------------------------------------------



- Fix crash on startup if .elm directory do not exists

- Fix crash on startup if DEBUG is not defined

- Deleting of messages marked for deletion was not working

! (same incorrect condition worked on Elm 2.4ME+ because
! of different ison -macro)


- Errors on [tags] was not caused sending to go back to

pre-send menu.


- "save-by-alias" was truncating alias to 3 letters.

! Changes on Elm ME+ 2.5 PLalpha2 compared with Elm2.4ME+ PLalpha1 (25)
! ---------------------------------------------------------------------

! SUMMARY: This release collects changes of Elm2.4ME+ PL117
! and PL118. This release incorporates new command


line options from Elm 2.5. New elmrc option is
dead-letter-dir.

--- 19,183 ----


===================================================================
* Changelog of ElmME+ 2.5

! Changes on Elm ME+ 2.5 PLalpha4 compared with Elm2.4ME+ PLalpha3
! ----------------------------------------------------------------
!
! SUMMARY: This release collects changes of Elm2.4ME+ PL120
! and PL121. This release incorporates some new
! commands and other changes from Elm 2.5 PL7.
! Also crash on List-ID parsing is fixed.
!
! * Collected ELM 2.4ME+ PL120 (25) changes:
! - Fix incorrect condition for deleting of messages marked for
! deletion (actually condition worked on Elm 2.4ME+ and
! did not worked on Elm ME+ 2.5 because different ison -macro)
! - Group reply did not worked correctly when on mail
! there was several To: -headers.
! - Refine "showto" semantic. If that elmrc variable is
! set and mail is not addressed to user, then To: address
! is shown.
! - Remove < > from address on real_from parsing.
! - Set envelope from address to username when reading
! Canceled mail special 'folder'. That way To:
! -address should be displayed when viewing that 'folder'.
!
! * Collected ELM 2.4ME+ PL121 (25) changes:
! - Better rpath test on Configure
! - Better soname test on Configure
! - Some fixes about soname_include_path
! - Change soname_include_path values
! define/undef to y/n. It is not used
! for #define.
! - Allow setting soname_include_path=n
! always if rpath works
! - Add extra libraries needed by shared libraries
! (shared_libs/*/) to rpath of executable.
! - Effectively local-fast-lookup = ON is now
! always used when ASCII filenames are looked.
! - Removed Configure warning:
! "(I see you are using the Korn shell. Some ksh's
! blow up on Configure, especially on exotic machines.
! If yours does, try the Bourne shell instead.)"
! - Let builtin pager show also address and not only
! name of sender!
! - Fix error
! RC PANIC in rc_handle.c:1226:expand_dt_path
! >>>Bad state on end
! when incorrect elmrc is read
! weedout = *clear-weed-list*"
!
! - Change from Elm 2.5:
! - Pass topic only to display_helpfile()
! instead of help section number. [D1] [D2] [D3]
! - Removed 'prefix' argument from
! copy_message*() functions. [D6]
! - Added line argument to read_number() [D7]
! - Added wait_time pararmeter to GetPrompt() [D8]
! - Added '!' command to alias menu [D9]
! - Added environment variables to elm
! manual page [D10]
! - Command 'u' works as command 'U' (Unread)
! to messages which are not deleted. [D11]
! - Allow both mansrc and catmansrc to be "none" [D12] KESKEN
!
! - If 'M' command is going to display To -address inside of ( )
! and there is displaying of "To " address on place of from
! address, do not display To -address inside of ( ).
! - Minor change to output of 'M' command.
!
! - Fix crash on List-ID parsing.
!
!
! Renamed files:
! doc/elm-help.0 => doc/help-main [D4]
! doc/elm-help.1 => doc/help-options
! doc/elm-help.2 => doc/help-alias
! doc/elm-help.3 => doc/help-pager
!
! Removed files:
! hdrs/elmutil.h [D5]
!
! New files:
! utils/def_utils.h
!
! Correspond quotes from Elm 2.5 PL7 Changes file:
!
! [D1] The display_helpfile() program is now passed a just a
! topic (say "options") instead of a full pathname
! ("/usr/local/lib/elm/help-options").
!
! [D2] Calling semantics to display_helpfile() [file src/help.c]
! changed. Before, it used to take an integer to select a
! helpfile. Now, it takes a helpfile pathname. (These
! pathnames are now defined in sysdefs.h.)
!
! [D3] sysdefs.h no longer defines individual help files, but
! rather a single "system_help_dir".
!
! [D4] Renamed all help files from stuff like "elm-help.0" to
! "help-main".
!
! [D5] Reorganization of main header files. The elmutil.h
! header is now obsolete. All portions of the Elm package
! include elm_defs.h, and the main Elm program (but not
! utilities) include elm_globals.h. Moved many definitions
! specific to Elm (and not used by the utilities) from
! elm_defs.h to elm_globals.h. Placed declaration
! of the dozen-or-so widely used globals in elm_defs.h.
!
! [D6] The calling semantics to copy_message() have changed.
! It no longer accepts a "prefix" argument. New usage is:
!
! copy_message(FILE *dest_file, int cm_options);
!
! The following new options have been added:
!
! CM_PREFIX - Add "prefixchars" to each line.
! CM_FORWARDING - Replaces the (now removed) "forwarding" global.
! CM_ATTRIBUTION - Add an attribution line.
!
! [D7] Calling semantics to read_number() [file src/in_utils.c]
! changed. It used to have a hardwired screen line number
! and got its default response from a magic global
! variable. Now you have to pass both of these as arguments.
!
! [D8] Calling semantics to GetPrompt() [file src/in_utils.c]
! changed. Now you need to pass the timeout as a parameter,
! rather than using the global "timeout". Say "0" for
! infinite timeout.
!
! [D9] Allow a shell escape from the alias screen (just like from
! the index screen). It does not put the shell escape onto the alias
! screen menu. (from Keith Neufeld <neu...@pvi.org>)
!
! [D10] Added docs for environment variables to the man page (from Eric
! Haszlakiewicz <nime...@uaccess.net>)
!
! [D11] Press u on a message that is read but not deleted
! will mark the message as unread (from Larry Schwimmer
! <ros...@cyclone.Stanford.EDU>).
!
! [D12] Eliminate complaints in doc/Makefile about duplicate
! makefile entries if mansrc and catmansrc are both "none"
! (from Keith Neufeld<neu...@pvi.org>)
!
! Changes on Elm ME+ 2.5 PLalpha3 compared with Elm2.4ME+ PLalpha2
! ----------------------------------------------------------------



- Fix crash on startup if .elm directory do not exists

- Fix crash on startup if DEBUG is not defined

- Deleting of messages marked for deletion was not working

! (same incorrect condition worked on Elm 2.4ME+ because
! of different ison -macro)


- Errors on [tags] was not caused sending to go back to

pre-send menu.


- "save-by-alias" was truncating alias to 3 letters.

! Changes on Elm ME+ 2.5 PLalpha2 compared with Elm2.4ME+ PLalpha1
! ----------------------------------------------------------------

! SUMMARY: This release collects changes of Elm2.4ME+ PL118
! and PL119. This release incorporates new command


line options from Elm 2.5. New elmrc option is
dead-letter-dir.

***************
*** 346,353 ****


toggles this as well as the use of the command line
option -M. The -M option also works on frm/nfrm.

! Changes on Elm ME+ 2.5 PLalpha1 compared with Elm2.4ME+ PLalpha0 (25)
! ---------------------------------------------------------------------



Note: You must create directory
2.4/doc

--- 488,495 ----


toggles this as well as the use of the command line
option -M. The -M option also works on frm/nfrm.

! Changes on Elm ME+ 2.5 PLalpha1 compared with Elm2.4ME+ PLalpha0
! ----------------------------------------------------------------



Note: You must create directory
2.4/doc

***************
*** 507,513 ****


<r...@elt.com> and Keith Neufeld <neu...@pvi.org>

Changes on Elm ME+ 2.5 PLalpha0 compared with Elm2.4ME+ PL115 (25)

! -------------------------------------------------------------



Note: You must create directory
2.4

--- 649,655 ----


<r...@elt.com> and Keith Neufeld <neu...@pvi.org>

Changes on Elm ME+ 2.5 PLalpha0 compared with Elm2.4ME+ PL115 (25)

! ------------------------------------------------------------------



Note: You must create directory
2.4

***************
*** 766,771 ****
--- 908,975 ----
===================================================================
* Changelog of Elm 2.4ME+

+ SUMMARY: This release fixes handling of multiple To:
+ headers, refines "showto" semantic and fixes
+ envelope sender of "Canceled mail" -view.
+
+ - Fix incorrect condition for deleting of messages marked for
+ deletion (actually condition worked on Elm 2.4ME+ and
+ did not worked on Elm ME+ 2.5 because different ison -macro)
+
+ - Group reply did not worked correctly when on mail
+ there was several To: -headers.
+
+ - Refine "showto" semantic. If that elmrc variable is
+ set and mail is not addressed to user, then To: address
+ is shown.
+

+ - Remove < > from address on real_from parsing.
+
+ - Set envelope from address to username when reading
+ Canceled mail special 'folder'. That way To:
+ -address should be displayed when viewing that 'folder'.
+
Changes of Elm 2.4ME+ PL119 (25) compared with Elm 2.4ME+ PL118 (25)
--------------------------------------------------------------------

Index: elmME+.2.5.alpha4-cvs/Configure
*** elmME+.2.5.alpha3/Configure 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/Configure 2004-09-25 13:14:30.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150.8.8 2004/08/07 18:07:13 hurtta Exp $


#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150.8.9 2004/09/25 10:14:30 hurtta Exp $


#

: sanity checks
***************
*** 16,25 ****
PATH=".:$PATH:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin"
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)

- (alias) >/dev/null 2>&1 && \

- echo "(I see you are using the Korn shell. Some ksh's blow up on Configure," && \
- echo "especially on exotic machines. If yours does, try the Bourne shell instead.)"
-

*** 2392,2417 ****


'-shared -soname='; do
case "$soname_opt" in
'')
! echo " Trying creation with ${A}DIR/name.so"
! if $cc $ccflags $picflag ${A}$LibLoc/testshared.so -o ../shlib/testshared.so try_sh.c > try.log 2>&1
then
soname_opt="$A"
! echo "Succeed with ${soname_opt}directory/name.so"
fi
;;
esac
done

-
if $test "X$soname_opt" != X
then

rpath_opt=''
for A in '-rpath ' '-Xlinker -rpath -Xlinker ' '-R'; do
case "$rpath_opt" in
'')
echo " Trying link with ${A}DIR"
! if $cc $ccflags $picflag -o try $A$LibLoc try.c ../shlib/testshared.so $libs > try.log 2>&1
then
rpath_opt="$A"
echo "Succeed with ${rpath_opt}directory"

--- 2390,2424 ----

*** 2419,2440 ****


;;
esac
done

if $test "X$rpath_opt" != X
then

if ./try ; then
! echo "Shared libraries seems work"
! d_shared="$define"
else
! echo "Unable to figure out how support shared libraries"
! d_shared="$undef"
fi

else
! echo "Compiling or linking with test shared library failed"
! d_shared="$undef"
fi

if $test "$d_shared" = "$define" ; then
$cat > dltry.c <<'EOF'

--- 2426,2503 ----

*** 2589,2595 ****



fi

! $rm -f try_sh.c try.c dltry.c ./try try.log dltry.log ../shlib/testshared.so dltry try_dyn.c ../shlib/testdynshared.so dltry2.c dltry2

else
echo "dlfcn.h not found (no shared librariers)"

--- 2652,2658 ----



fi

! $rm -f try_sh.c try.c dltry.c ./try try.log dltry.log ../shlib/testshared.so ./shlib/testshared-ab.so dltry try_dyn.c ../shlib/testdynshared.so dltry2.c dltry2

else
echo "dlfcn.h not found (no shared librariers)"
***************

*** 5751,5774 ****


done
fi

! soname_include_path="$undef"
if $test "$d_shared" = "$define" ; then
if $test -n "$install_prefix" ; then
shlib="$install_prefix/$libdirname"
echo "Will install $package shared libraries to $shlib"

! if $test -f /etc/ld.so.conf ; then
if $grep "^$shlib" < /etc/ld.so.conf >/dev/null; then
echo "WARNING: Directory $shlib is listed on file /etc/ld.so.conf"
echo " Linux ldconfig gives errors when soname include pathnames"
echo " therefore disabling generating of pathnames to soname"
! soname_include_path="$undef"
! else
! soname_include_path="$define"
! fi
!
! else
! soname_include_path="$define"
fi


--- 5814,5847 ----

*** 5788,5794 ****


to smaller. Shared library directory does not need to be one of default
directories used by run time linker. To disabled Elm ME+'s shared library
support you can give "none" as shared library directory.
-
EOM

cont=true

--- 5861,5866 ----
***************
*** 5812,5818 ****


if $test -d "$shlib"; then
cont=''

! if $test -f /etc/ld.so.conf ; then
if $grep "^$shlib" < /etc/ld.so.conf >/dev/null; then
$cat <<EOF
WARNING: Directory $shlib is listed on file /etc/ld.so.conf

--- 5884,5893 ----


if $test -d "$shlib"; then
cont=''

! if $test "X$soname_ok" != XOK ; then
! soname_include_path=n
!
! elif $test -f /etc/ld.so.conf ; then
if $grep "^$shlib" < /etc/ld.so.conf >/dev/null; then
$cat <<EOF
WARNING: Directory $shlib is listed on file /etc/ld.so.conf
***************

*** 5822,5828 ****


o) Omit pathname from soname
i) ignore ldconfig warnings and include path on soname
EOF
! if $test "$soname_include_path" = "$undef"; then
dflt=i
else
dflt=o

--- 5897,5903 ----


o) Omit pathname from soname
i) ignore ldconfig warnings and include path on soname
EOF
! if $test "$soname_include_path" = y; then
dflt=i
else
dflt=o
***************

*** 5832,5846 ****


. myread
case "$ans" in
c*) cont=true;;
! o*) soname_include_path="$undef" ;;
! *) soname_include_path="$define"
esac
- else
- soname_include_path="$define"
fi

- else
- soname_include_path="$define"
fi
else
case "$fastread" in

--- 5907,5920 ----


. myread
case "$ans" in
c*) cont=true;;
! o*) soname_include_path=n
! soname_force='y'
! ;;
! *) soname_include_path=y
! ;;
esac
fi

fi
else
case "$fastread" in
***************

*** 5854,5867 ****


case "$ans" in
y*)
cont=''
! soname_include_path="$define"
;;
esac
fi
fi
done
fi

fi

if $test "$d_shared" = "$define" ; then

--- 5928,5985 ----


case "$ans" in
y*)
cont=''
!
;;
esac
fi
fi
done
fi

+ fi

*** 6773,6780 ****
--- 6891,6900 ----


dynamic_opt='$dynamic_opt'
dlopen_lib="$dlopen_lib"
rpath_opt='$rpath_opt'
+ rpath_ok='$rpath_ok'
soname_opt='$soname_opt'
soname_include_path="$soname_include_path"
+ soname_ok='$soname_ok'
tempnamo='$tempnamo'
tempnamc='$tempnamc'
d_termio='$d_termio'

Index: elmME+.2.5.alpha4-cvs/doc/elm.1
*** elmME+.2.5.alpha3/doc/elm.1 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/doc/elm.1 2004-10-30 20:09:54.000000000 +0300
***************
*** 206,211 ****
--- 206,253 ----


Elm Development Group, Kari Hurtta
.SH SEE ALSO

checkalias(1L), frm(1L), mail(1), mailx(1), newalias(1L), printmail(1L), readmsg(1L), elmcharset(1L)

+ .SH ENVIRONMENT VARIABLES
+ .TP 1.0i
+ .B BCC
+ Default bcc addresses.
+ .TP
+ .B REPLYTO
+ Default replyto address.
+ .TP
+ .B TERM
+ The user's terminal type.
+ .TP
+ .B LOGNAME
+ User login name.
+ .TP
+ .B USER
+ Altername user login name.
+ .TP
+ .B MAIL
+ Location of mail file (also incoming-mailbox elmrc variable.)
+ .TP
+ .B LINES
+ Number of row on the screen (may be overrided by tty device data.)
+ .TP
+ .B COLUMNS
+ Number of columns on the screen (may be overrided by tty device data.)
+ .TP
+ .B SHELL
+ The user's shell of choice (also shell elmrc variable.)
+ .TP
+ .B PAGER
+ Command to use for displaying multiple page mails (also pager elmrc variable.) May be ignored.
+ .TP
+ .B TMPDIR
+ Directory to place temporary files (also tmpdir elmrc variable.)
+ .TP
+ .B EDITOR
+ Editor to use (also
+ editor elmrc variable.)
+ .TP
+ .B NOMETAMAIL
+ If set, do not use metamail (also
+ metamail elmrc variable.)


.SH FILES
#ETC#/elm.rc customized mailer parameters

.br
Index: elmME+.2.5.alpha4-cvs/doc/elm-help.0
*** elmME+.2.5.alpha3/doc/elm-help.0 2004-05-16 17:43:45.000000000 +0300
--- /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200
***************
*** 1,70 ****
-
- Command Elm ME+ 2.5 Action
-
- <RETURN>,<SPACE> Display current message
- | Pipe current message or tagged messages to
- a system command
- ! Shell escape
- $ Resynchronize folder
- ? This screen of information
- +, <RIGHT> Display next index page
- -, <LEFT> Display previous index page
- = Set current message to first message
- * Set current message to last message
- <NUMBER><RETURN> Set current message to <NUMBER>
- / Search from/subjects for pattern
- // Search entire message texts for pattern
- > Save current message or tagged messages
- to a folder
- < Scan current message for calendar entries
- a Alias, change to 'alias' mode
- b Bounce (remail) current message
- C Copy current message or tagged messages
- to a folder
- c Change to another folder
- d Delete current message
- ^D Delete messages with a specified pattern
- ^E Extract PGP public keys from current message
- e Edit current folder
- f Forward current message
- ^F Forget passphrase
- g Group (all recipients) reply to current message
- h Headers displayed with message
- J Increment current message by one
- j, <DOWN> Advance to next undeleted message
- ^K Mail PGP public key(s)
- K Decrement current message by one
- k, <UP> Advance to previous undeleted message
- l Limit messages by specified criteria
- ^L Redraw screen
- M Toggle the display of mailing list info
- m Mail a message
- n Next message, displaying current,
- then increment
- ^N Next unread message, displaying current
- if unread, then increment
- o Change ELM options
- O Override charset of current message or
- tagged messages
- p Print current message or tagged messages
- P Print text of current message or
- tagged messages
- q Quit, maybe prompting for deleting, storing,
- and keeping messages
- Q Quick quit - no prompting
- r Reply to current message
- s Save current message or tagged messages
- to a folder
- S Save (copy) text of current message to file
- or text of tagged messages to a folder
- t Tag current message for further operations
- T Tag current message and go to next message
- ^T Tag messages with a specified pattern
- u Undelete current message
- U Unread message (change status from read
- to unread)
- ^U Undelete messages with a specified pattern
- v View attachments in current message.
- x, ^Q Exit leaving folder untouched, ask permission
- if folder changed
- X Exit leaving folder untouched, unconditionally
--- 0 ----
Index: elmME+.2.5.alpha4-cvs/doc/elm-help.1
*** elmME+.2.5.alpha3/doc/elm-help.1 2002-01-26 13:14:45.000000000 +0200
--- /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200
***************
*** 1,62 ****
-
- Commands available from the Options Menu in Elm 2.4
-
- Key Meaning
- --- -------
- > Save current options to elmrc file.
-
- a Arrow cursor. Changes from "->" to inverse bar and back for
- indicating the current message. Change with <space>.
-
- b Border on copy. Sets the prefix for copied lines of forward and reply.
-
- c Calendar file. See '<' at top level menu for more information on this.
-
- d Display pager. "builtin" and "builtin+" will use the built-in pager,
- or enter the name of an external pager, like "more".
-
- e Editor to use when composing messages.
-
- f Folder directory. This is what '=', '+', or '%' on the front of a
- folder name expands to.
-
- h Hold sent message. This enables automatically saving a copy of
- outgoing messages.
-
- i,q Return to the index screen.
-
- j Reply editor. Replacement for builtin editor when replying.
-
- k Pause after pager or always return to index screen.
-
- ^L Redraw screen.
-
- l Alias sorting criteria. Step through with <space>, <return> selects.
-
- m Mini-menu displayed on index screen or not. Change with <space>.
-
- n Names only or names and address displayed. Change with <space>.
-
- o Outbound mail file. Where to save copies of outbound mail when not
- saved by the recipient's name.
-
- p Print messages with this command. '%s' can be used in the command
- as a filename holder.
-
- r Reply copies message. Automatically copy message into reply.
-
- s Sorting criteria. Step through with <space>, <return> selects.
-
- t Text editor. Editor selected by '~e' builtin editor command.
-
- u User's expertise level. Change with <space>.
-
- v Visual editor. Editor selected by '~v' builtin editor command.
-
- w Want Cc: prompt. Ask for Cc: recipients when mailing and replying.
-
- x Exit leaving folder untouched unconditionally.
-
- y Your full name to be used in outbound mail.
-
- z Insert dashes before signature.
--- 0 ----
Index: elmME+.2.5.alpha4-cvs/doc/elm-help.2
*** elmME+.2.5.alpha3/doc/elm-help.2 2002-01-26 13:14:45.000000000 +0200
--- /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200
***************
*** 1,81 ****
-
- Commands available from the Alias Menu in Elm 2.4
-
- Key Meaning
- --- -------
-
- ? Help on a specific key, or this summary of commands.
-
- $ Resynchronize the alias display, processing deletions and
- additions to the alias database.
-
- / Search for specified name or alias in list.
-
- <SPACE>, <RETURN>, v
- View the address of the current alias.
-
- a Add the return address of current message to alias database, (or
- the regular address if current message is copy of a message sent).
-
- c Change (modify) the current alias. Changes are effective upon the
- next alias resync. (Changed aliases are marked with 'N'.)
-
- d Delete current user alias.
-
- ^D Delete user aliases with a specified search pattern.
-
- e Edit the alias text file directly and rebuild database when done.
-
- f Display fully expanded alias for the current selection.
-
- ^L Redraw screen.
-
- l Limit alias list by specified criteria.
-
- m Mail a message to the address of the current alias or the
- currently tagged aliases.
-
- n Make a new user alias. It is added to alias database upon the
- next alias resync.
-
- r,q,i Return to index screen, possibly prompting concerning deletions.
-
- R,Q,I Return to index screen immediately, no prompting.
-
- t Tag current alias for further operations.
-
- T Tag current alias and go to next alias
-
- ^T Tag aliases with a specified search pattern.
-
- u Undelete current user alias.
-
- ^U Undelete user aliases with a specified search pattern.
-
- x Exit from the alias system without updating the alias database.
-
- Display Navigation Commands
-
- +, <RIGHT>
- Display next index page.
-
- -, <LEFT>
- Display previous index page.
-
- = Set current alias to first alias.
-
- * Set current alias to last alias.
-
- <NUMBER><RETURN>
- Set current alias to <NUMBER>.
-
- J Increment current alias by one.
-
- j, <DOWN>
- Advance to next undeleted alias.
-
- K Decrement current alias by one.
-
- k, <UP>
- Advance to previous undeleted alias.
-
--- 0 ----
Index: elmME+.2.5.alpha4-cvs/doc/elm-help.3
*** elmME+.2.5.alpha3/doc/elm-help.3 2002-01-26 13:15:57.000000000 +0200
--- /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200
***************
*** 1,45 ****
-
- Command Elm 2.4ME+ Action
-
-
- <RETURN> Display the current message,
- or (builtin pager only) scroll
- current message forward one line
- <SPACE> Display the next screen of the current
- message (builtin pager only),
- or if at the end of a message,
- the first screen of the next message
- | Pipe current message or tagged messages to
- a system command
- ! Shell escape
- ? This screen of information
- > Save current message or tagged messages
- to a folder
- < Scan current message for calendar entries
- b Bounce (remail) current message
- C Copy current message or tagged messages
- to a folder
- d Delete current message
- f Forward current message
- g Group (all recipients) reply to current message
- h Headers displayed with message
- i Return to index screen
- J Increment current message by one
- j, <DOWN> Advance to next undeleted message
- K Decrement current message by one
- k, <UP> Advance to previous undeleted message
- m Mail a message
- n Display next message
- ^N Display next unread message
- p Print current message or tagged messages
- q Quit pager mode and return to index screen
- r Reply to current message
- s Save current message or tagged messages
- to a folder
- t Tag current message for further operations
- T Tag current message and go to next message
- u Undelete current message
- v View attachments in current message.
- x Exit leaving folder untouched, ask permission
- if folder changed
- X Exit leaving folder untouched, unconditionally
--- 0 ----
Index: elmME+.2.5.alpha4-cvs/doc/elmrc-info
*** elmME+.2.5.alpha3/doc/elmrc-info 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha4-cvs/doc/elmrc-info 2004-09-25 13:14:32.000000000 +0300
***************
*** 1,4 ****
! #@(#)$Id: elmrc-info,v 1.61.2.13 2004/07/03 15:23:02 hurtta Exp $
# Elm Version ME+ 2.5


#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.61.2.14 2004/09/25 10:14:32 hurtta Exp $
# Elm Version ME+ 2.5


#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************

*** 393,398 ****
--- 393,400 ----


alternatives
# alternative addresses that I could receive mail from (usually a
# forwarding mailbox) and don't want to have listed...
+ #
+ # See also: showto

forms
# do we want to be able to mail out AT&T Mail Forms?
***************

*** 517,522 ****
--- 519,526 ----


# Need to be unset, if same character on local-fs-charset has several
# repesentations (or encodings).
#
+ # This is implicty set always when ASCII filenames are looked.
+ #
# See also: local-fs-charset, imap-fast-lookup

local-fs-charset

***************
*** 660,666 ****



showto
# if this variable is ON, Elm will show who the message is to rather than
! # who it is from in the headers display.

usepgppass
# If ON, Elm will prompt you for your PGP passphrase and use it whenever

--- 664,673 ----



showto
# if this variable is ON, Elm will show who the message is to rather than
! # who it is from in the headers display if the message is not
! # addressed to user.
! #
! # See also: alternatives

usepgppass
# If ON, Elm will prompt you for your PGP passphrase and use it whenever

Index: elmME+.2.5.alpha4-cvs/doc/help-alias


*** /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200

--- elmME+.2.5.alpha4-cvs/doc/help-alias 2004-09-25 18:55:46.000000000 +0300
***************
*** 0 ****
--- 1,81 ----
+
+ Commands available from the Alias Menu in Elm 2.4
+
+ Key Meaning
+ --- -------
+
+ ? Help on a specific key, or this summary of commands.
+
+ $ Resynchronize the alias display, processing deletions and
+ additions to the alias database.
+
+ / Search for specified name or alias in list.
+
+ <SPACE>, <RETURN>, v
+ View the address of the current alias.
+
+ a Add the return address of current message to alias database, (or
+ the regular address if current message is copy of a message sent).
+
+ c Change (modify) the current alias. Changes are effective upon the
+ next alias resync. (Changed aliases are marked with 'N'.)
+
+ d Delete current user alias.
+
+ ^D Delete user aliases with a specified search pattern.
+
+ e Edit the alias text file directly and rebuild database when done.
+
+ f Display fully expanded alias for the current selection.
+
+ ^L Redraw screen.
+
+ l Limit alias list by specified criteria.
+
+ m Mail a message to the address of the current alias or the
+ currently tagged aliases.
+
+ n Make a new user alias. It is added to alias database upon the
+ next alias resync.
+
+ r,q,i Return to index screen, possibly prompting concerning deletions.
+
+ R,Q,I Return to index screen immediately, no prompting.
+
+ t Tag current alias for further operations.
+
+ T Tag current alias and go to next alias
+
+ ^T Tag aliases with a specified search pattern.
+
+ u Undelete current user alias.
+
+ ^U Undelete user aliases with a specified search pattern.
+
+ x Exit from the alias system without updating the alias database.
+
+ Display Navigation Commands
+
+ +, <RIGHT>
+ Display next index page.
+
+ -, <LEFT>
+ Display previous index page.
+
+ = Set current alias to first alias.
+
+ * Set current alias to last alias.
+
+ <NUMBER><RETURN>
+ Set current alias to <NUMBER>.
+
+ J Increment current alias by one.
+
+ j, <DOWN>
+ Advance to next undeleted alias.
+
+ K Decrement current alias by one.
+
+ k, <UP>
+ Advance to previous undeleted alias.
+
Index: elmME+.2.5.alpha4-cvs/doc/help-main


*** /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200

--- elmME+.2.5.alpha4-cvs/doc/help-main 2004-09-25 18:55:46.000000000 +0300
***************
*** 0 ****
--- 1,70 ----
+
+ Command Elm ME+ 2.5 Action
+
+ <RETURN>,<SPACE> Display current message
+ | Pipe current message or tagged messages to
+ a system command
+ ! Shell escape
+ $ Resynchronize folder
+ ? This screen of information
+ +, <RIGHT> Display next index page
+ -, <LEFT> Display previous index page
+ = Set current message to first message
+ * Set current message to last message
+ <NUMBER><RETURN> Set current message to <NUMBER>
+ / Search from/subjects for pattern
+ // Search entire message texts for pattern
+ > Save current message or tagged messages
+ to a folder
+ < Scan current message for calendar entries
+ a Alias, change to 'alias' mode
+ b Bounce (remail) current message
+ C Copy current message or tagged messages
+ to a folder
+ c Change to another folder
+ d Delete current message
+ ^D Delete messages with a specified pattern
+ ^E Extract PGP public keys from current message
+ e Edit current folder
+ f Forward current message
+ ^F Forget passphrase
+ g Group (all recipients) reply to current message
+ h Headers displayed with message
+ J Increment current message by one
+ j, <DOWN> Advance to next undeleted message
+ ^K Mail PGP public key(s)
+ K Decrement current message by one
+ k, <UP> Advance to previous undeleted message
+ l Limit messages by specified criteria
+ ^L Redraw screen
+ M Toggle the display of mailing list info
+ m Mail a message
+ n Next message, displaying current,
+ then increment
+ ^N Next unread message, displaying current
+ if unread, then increment
+ o Change ELM options
+ O Override charset of current message or
+ tagged messages
+ p Print current message or tagged messages
+ P Print text of current message or
+ tagged messages
+ q Quit, maybe prompting for deleting, storing,
+ and keeping messages
+ Q Quick quit - no prompting
+ r Reply to current message
+ s Save current message or tagged messages
+ to a folder
+ S Save (copy) text of current message to file
+ or text of tagged messages to a folder
+ t Tag current message for further operations
+ T Tag current message and go to next message
+ ^T Tag messages with a specified pattern
+ u Undelete current message
+ U Unread message (change status from read
+ to unread)
+ ^U Undelete messages with a specified pattern
+ v View attachments in current message.
+ x, ^Q Exit leaving folder untouched, ask permission
+ if folder changed
+ X Exit leaving folder untouched, unconditionally
Index: elmME+.2.5.alpha4-cvs/doc/help-options


*** /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200

--- elmME+.2.5.alpha4-cvs/doc/help-options 2004-09-25 18:55:46.000000000 +0300
***************
*** 0 ****
--- 1,62 ----
+
+ Commands available from the Options Menu in Elm 2.4
+
+ Key Meaning
+ --- -------
+ > Save current options to elmrc file.
+
+ a Arrow cursor. Changes from "->" to inverse bar and back for
+ indicating the current message. Change with <space>.
+
+ b Border on copy. Sets the prefix for copied lines of forward and reply.
+
+ c Calendar file. See '<' at top level menu for more information on this.
+
+ d Display pager. "builtin" and "builtin+" will use the built-in pager,
+ or enter the name of an external pager, like "more".
+
+ e Editor to use when composing messages.
+
+ f Folder directory. This is what '=', '+', or '%' on the front of a
+ folder name expands to.
+
+ h Hold sent message. This enables automatically saving a copy of
+ outgoing messages.
+
+ i,q Return to the index screen.
+
+ j Reply editor. Replacement for builtin editor when replying.
+
+ k Pause after pager or always return to index screen.
+
+ ^L Redraw screen.
+
+ l Alias sorting criteria. Step through with <space>, <return> selects.
+
+ m Mini-menu displayed on index screen or not. Change with <space>.
+
+ n Names only or names and address displayed. Change with <space>.
+
+ o Outbound mail file. Where to save copies of outbound mail when not
+ saved by the recipient's name.
+
+ p Print messages with this command. '%s' can be used in the command
+ as a filename holder.
+
+ r Reply copies message. Automatically copy message into reply.
+
+ s Sorting criteria. Step through with <space>, <return> selects.
+
+ t Text editor. Editor selected by '~e' builtin editor command.
+
+ u User's expertise level. Change with <space>.
+
+ v Visual editor. Editor selected by '~v' builtin editor command.
+
+ w Want Cc: prompt. Ask for Cc: recipients when mailing and replying.
+
+ x Exit leaving folder untouched unconditionally.
+
+ y Your full name to be used in outbound mail.
+
+ z Insert dashes before signature.
Index: elmME+.2.5.alpha4-cvs/doc/help-pager


*** /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200

--- elmME+.2.5.alpha4-cvs/doc/help-pager 2004-09-25 18:55:46.000000000 +0300
***************
*** 0 ****
--- 1,45 ----
+
+ Command Elm 2.4ME+ Action
+
+
+ <RETURN> Display the current message,
+ or (builtin pager only) scroll
+ current message forward one line
+ <SPACE> Display the next screen of the current
+ message (builtin pager only),
+ or if at the end of a message,
+ the first screen of the next message
+ | Pipe current message or tagged messages to
+ a system command
+ ! Shell escape
+ ? This screen of information
+ > Save current message or tagged messages
+ to a folder
+ < Scan current message for calendar entries
+ b Bounce (remail) current message
+ C Copy current message or tagged messages
+ to a folder
+ d Delete current message
+ f Forward current message
+ g Group (all recipients) reply to current message
+ h Headers displayed with message
+ i Return to index screen
+ J Increment current message by one
+ j, <DOWN> Advance to next undeleted message
+ K Decrement current message by one
+ k, <UP> Advance to previous undeleted message
+ m Mail a message
+ n Display next message
+ ^N Display next unread message
+ p Print current message or tagged messages
+ q Quit pager mode and return to index screen
+ r Reply to current message
+ s Save current message or tagged messages
+ to a folder
+ t Tag current message for further operations
+ T Tag current message and go to next message
+ u Undelete current message
+ v View attachments in current message.
+ x Exit leaving folder untouched, ask permission
+ if folder changed
+ X Exit leaving folder untouched, unconditionally
Index: elmME+.2.5.alpha4-cvs/doc/Makefile.SH
*** elmME+.2.5.alpha3/doc/Makefile.SH 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha4-cvs/doc/Makefile.SH 2004-11-02 20:54:06.000000000 +0200
***************
*** 13,29 ****


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;

esac

echo "Extracting doc/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.30.26.2 2004/07/03 17:46:54 hurtta Exp $
#
# Makefile for the documentation of the ELM mail system
#


# (C) Copyright 1988-1992, USENET Community Trust

#
#
# Variables
# Variables established by Configure

CHMOD = $chmod
--- 13,45 ----


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;

esac

+ # Eliminate complaints about duplicate makefile entries if mansrc and
+ # catmansrc are both "none".
+ if [ $mansrc = "none" ]; then mansrc="man-none"; fi
+ if [ $catmansrc = "none" ]; then catmansrc="catman-none"; fi
+
echo "Extracting doc/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.30.26.5 2004/11/02 18:54:06 hurtta Exp $
! #
! # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
! ####################################################################
! # Based on Elm 2.4 doc/Makefile.SH. That code was following copyright:
#
# Makefile for the documentation of the ELM mail system
#


# (C) Copyright 1988-1992, USENET Community Trust

+ #####################################################################
+ # Incorparated Elm 2.5 code from doc/Makefile.SH.
+ # That code was following copyright:
#
+ # Makefile for the documentation of the ELM mail system
+ #
+ # (C) Copyright 1988-1992, USENET Community Trust
#
+ #####################################################################


# Variables
# Variables established by Configure

CHMOD = $chmod
***************
*** 160,169 ****
$(REGCATMAN)

# List of files installed in LIB directory
! LIB_LIST = $(LIB)/elm-help.0 \
! $(LIB)/elm-help.1 \
! $(LIB)/elm-help.2 \
! $(LIB)/elm-help.3 \
$(LIB)/elmrc-info


--- 176,185 ----
$(REGCATMAN)

# List of files installed in LIB directory
! LIB_LIST = $(LIB)/help-main \
! $(LIB)/help-options \
! $(LIB)/help-alias \
! $(LIB)/help-pager \
$(LIB)/elmrc-info


***************
*** 173,192 ****

cat >>Makefile <<!GROK!THIS!
all:
! @if \$(TEST) $catmansrc != none; then \$(MAKE) formatted_pages ; else true ; fi

install_s: \$(LIB_LIST)
! @if \$(TEST) $mansrc != none; then \$(MAKE) install_man ; else true ; fi
! @if \$(TEST) $catmansrc != none; then \$(MAKE) install_catman ; else true ; fi

uninstall_s:
\$(REG) rm \$(LIB_LIST)
! @if \$(TEST) $mansrc != none; then \
\$(REG) rm \$(MAN_LIST) \$(MAN)/wnewmail\$(MANEXT) \$(MAN)/nfrm\$(MANEXT) \$(MAN)/elmuninstall\$(MANEXT); \
else \
true ; \
fi
! @if \$(TEST) $catmansrc != none; then \
\$(REG) rm \$(CATMAN_LIST) \$(CATMAN)/wnewmail\$(CATMANEXT)\$(SUFFIX) \$(CATMAN)/nfrm\$(CATMANEXT)\$(SUFFIX) \$(CATMAN)/elmuninstall\$(CATMANEXT)\$(SUFFIX); \
else \
true ; \
--- 189,208 ----

cat >>Makefile <<!GROK!THIS!
all:
! @if \$(TEST) $catmansrc != catman-none; then \$(MAKE) formatted_pages ; else true ; fi

install_s: \$(LIB_LIST)
! @if \$(TEST) $mansrc != man-none; then \$(MAKE) install_man ; else true ; fi
! @if \$(TEST) $catmansrc != catman-none; then \$(MAKE) install_catman ; else true ; fi

uninstall_s:
\$(REG) rm \$(LIB_LIST)
! @if \$(TEST) $mansrc != man-none; then \
\$(REG) rm \$(MAN_LIST) \$(MAN)/wnewmail\$(MANEXT) \$(MAN)/nfrm\$(MANEXT) \$(MAN)/elmuninstall\$(MANEXT); \
else \
true ; \
fi
! @if \$(TEST) $catmansrc != catman-none; then \
\$(REG) rm \$(CATMAN_LIST) \$(CATMAN)/wnewmail\$(CATMANEXT)\$(SUFFIX) \$(CATMAN)/nfrm\$(CATMANEXT)\$(SUFFIX) \$(CATMAN)/elmuninstall\$(CATMANEXT)\$(SUFFIX); \
else \
true ; \
***************
*** 354,370 ****
$(MAN)/wnewmail$(MANEXT): $(MAN)/newmail$(MANEXT)
$(REG) link $? $@

! $(LIB)/elm-help.0: elm-help.0


$(REG) copy -m 444 $? $@

! $(LIB)/elm-help.1: elm-help.1


$(REG) copy -m 444 $? $@

! $(LIB)/elm-help.2: elm-help.2


$(REG) copy -m 444 $? $@

! $(LIB)/elm-help.3: elm-help.3


$(REG) copy -m 444 $? $@

$(LIB)/elmrc-info: elmrc-info


$(REG) copy -m 444 $? $@

--- 370,390 ----
$(MAN)/wnewmail$(MANEXT): $(MAN)/newmail$(MANEXT)
$(REG) link $? $@

! $(LIB)/help-main: help-main


$(REG) copy -m 444 $? $@

+ $(REG) rm $(LIB)/elm-help.0

! $(LIB)/help-options: help-options


$(REG) copy -m 444 $? $@

+ $(REG) rm $(LIB)/elm-help.1

! $(LIB)/help-alias: help-alias


$(REG) copy -m 444 $? $@

+ $(REG) rm $(LIB)/elm-help.2

! $(LIB)/help-pager: help-pager


$(REG) copy -m 444 $? $@

+ $(REG) rm $(LIB)/elm-help.3

$(LIB)/elmrc-info: elmrc-info


$(REG) copy -m 444 $? $@

Index: elmME+.2.5.alpha4-cvs/hdrs/elm_globals.h
*** elmME+.2.5.alpha3/hdrs/elm_globals.h 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/hdrs/elm_globals.h 2004-10-09 15:26:47.000000000 +0300
***************
*** 1,7 ****


! /* $Id: elm_globals.h,v 1.1.2.6 2004/08/15 17:26:27 hurtta Exp $ */

/*****************************************************************************

! * The Elm (ME+) Mail System - $Revision: 1.1.2.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! /* $Id: elm_globals.h,v 1.1.2.8 2004/10/09 12:26:47 hurtta Exp $ */

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.1.2.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 69,74 ****
--- 69,75 ----
/* options to the copy_message() procedure */
#define CM_REMOVE_HEADER (1<<0) /* skip header of message */
#define CM_UPDATE_STATUS (1<<2) /* Update Status: Header */
+ #define CM_PREFIX (1<<3) /* Add prefix (">", etc.) to lines */
#define CM_REMAIL (1<<4) /* Add Sender: and Orig-To: headers */
#define CM_DECODE (1<<5) /* Decode MIME, PGP and elm */
#define CM_FILT_HDR (1<<6) /* Filter headers (for forwarding) */
***************
*** 82,96 ****
/* format this as an included mssg */


#if 0 /* NOT USED -- */
#define CM_REMOTE (1<<1) /* append remote from hostname to */
/* first line */
! #define CM_MMDF_HEAD (1<<3) /* strip mmdf message seperator */

- #define CM_FORWARDING (1<<XX) /* text is a message that we are */
- /* forwarding */
- #define CM_ATTRIBUTION (1<<XX) /* add attribution strings that */
- /* format this as an included mssg */

#endif

--- 83,94 ----
/* format this as an included mssg */


+
#if 0 /* NOT USED -- */
#define CM_REMOTE (1<<1) /* append remote from hostname to */
/* first line */
! #define CM_MMDF_HEAD (1<<XX) /* strip mmdf message seperator */


#endif

***************
*** 128,138 ****
#define tabstop(col) (((col) & ~07) + 010)
#endif

! /* FIXME: .... remove these ... */
#define MAIN_HELP 0
#define OPTIONS_HELP 1
#define ALIAS_HELP 2
#define PAGER_HELP 3

#if 0 /* softkeys not used */
#define MAIN 0
--- 126,137 ----
#define tabstop(col) (((col) & ~07) + 010)
#endif

! /* FIXME: .... remove these ...
#define MAIN_HELP 0
#define OPTIONS_HELP 1
#define ALIAS_HELP 2
#define PAGER_HELP 3
+ */

#if 0 /* softkeys not used */
#define MAIN 0
Index: elmME+.2.5.alpha4-cvs/hdrs/elmlib.h
*** elmME+.2.5.alpha3/hdrs/elmlib.h 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/hdrs/elmlib.h 2004-09-25 13:14:32.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmlib.h,v 1.207.4.20 2004/08/14 12:06:08 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207.4.20 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----
! /* $Id: elmlib.h,v 1.207.4.21 2004/09/25 10:14:32 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.207.4.21 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************
*** 157,162 ****
--- 157,163 ----
charset_t defcharset));

extern void free_addr_items P_((struct addr_item *list));
+ extern void append_addr_items P_((struct addr_item **list, struct addr_item *list1));

/* getaddrfrm.c */

Index: elmME+.2.5.alpha4-cvs/hdrs/elmutil.h
*** elmME+.2.5.alpha3/hdrs/elmutil.h 2004-05-16 17:43:45.000000000 +0300
--- /tmp/4716-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2004-11-06 12:42:37.000000000 +0200
***************
*** 1,36 ****
- /* $Id: elmutil.h,v 1.13.8.1 2004/04/18 16:55:36 hurtta Exp $ */
-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $
- *
- * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
- * (was hurtt...@ozone.FMI.FI)
- ******************************************************************************
- * The Elm Mail System
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- *****************************************************************************/
-
- /** Main header file for ELM utilities. **/
-
- #include "patchlevel.h"
- #define INTERN
- #include "elm_defs.h"
-
-
-
- /******** global variables accessable by all pieces of the program *******/
-
- char version_buff[NLEN] = {0}; /* version buffer */
-
- extern char *gcos_name();
- extern char *get_full_name();
-
- /*
- * Local Variables:
- * mode:c
- * c-basic-offset:4
- * buffer-file-coding-system: iso-8859-1
- * End:
- */
--- 0 ----
Index: elmME+.2.5.alpha4-cvs/hdrs/me.h
*** elmME+.2.5.alpha3/hdrs/me.h 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/hdrs/me.h 2004-10-09 20:25:34.000000000 +0300
***************
*** 1,7 ****


! /* $Id: me.h,v 1.87.8.14 2004/08/14 12:06:09 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87.8.14 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.87.8.18 2004/10/09 17:25:34 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.87.8.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 109,115 ****

/* help.c */

! extern int display_helpfile P_((int section));


extern void help P_((int pager_help, struct menu_context *page));

/* in_utils.c */

--- 109,115 ----

/* help.c */

! extern int display_helpfile P_((char *topic));


extern void help P_((int pager_help, struct menu_context *page));

/* in_utils.c */
***************
*** 117,124 ****
extern int want_to P_((char *question, int dflt, int where,

int clear_and_center,
struct menu_context *page));

! extern int read_number P_((int ch, const struct string *item, int current,
! struct menu_context *page));



#define PROMPT_center 1
#define PROMPT_yesno 2

--- 117,125 ----
extern int want_to P_((char *question, int dflt, int where,

int clear_and_center,
struct menu_context *page));

! extern int read_number P_((int ch, const struct string *item,
! int defval, struct menu_context *page,
! int line));



#define PROMPT_center 1
#define PROMPT_yesno 2

***************
*** 156,162 ****
struct string *prompt,


int *redraw,
struct menu_context *page));

! extern int GetPrompt P_((struct menu_context *page));


#if ANSI_C
--- 157,164 ----
struct string *prompt,


int *redraw,
struct menu_context *page));

! extern int GetPrompt P_((struct menu_context *page,
! int wait_time));


#if ANSI_C
***************
*** 411,428 ****
extern int copy_message P_((struct folder_info *, struct header_rec *,
char *, FILE *, int, charset_t));
extern int copy_message_f P_((FILE *infile, struct header_rec *current_header,
! char *prefix, FILE *dest_file,
int cm_options, charset_t file_set));

extern int copy_message_d P_((struct folder_info *infolder,
struct header_rec *current_header,
- char * prefix,
struct folder_browser *dir,
WRITE_STATE dest, int cm_options,
charset_t file_set));
extern int copy_message_df P_((FILE *infile,
struct header_rec *current_header,
- char * prefix,
struct folder_browser *dir,
WRITE_STATE dest,
int cm_options,
--- 413,428 ----
extern int copy_message P_((struct folder_info *, struct header_rec *,
char *, FILE *, int, charset_t));
extern int copy_message_f P_((FILE *infile, struct header_rec *current_header,
! FILE *dest_file,
int cm_options, charset_t file_set));

extern int copy_message_d P_((struct folder_info *infolder,
struct header_rec *current_header,
struct folder_browser *dir,
WRITE_STATE dest, int cm_options,
charset_t file_set));
extern int copy_message_df P_((FILE *infile,
struct header_rec *current_header,
struct folder_browser *dir,
WRITE_STATE dest,
int cm_options,
***************
*** 430,452 ****

extern int copy_message_2 P_((FILE *infile,
struct header_rec *current_header,
- char *prefix,
out_state_t *dest_file,
int cm_options,
int env_flags));

extern int copy_body P_((FILE *infile,
struct header_rec *current_header,
- char *prefix,
out_state_t *dest_file,
int cm_options));

! extern int copy_plain P_((char *,out_state_t *,int, struct header_rec *,
FILE *));
! extern int copy_mime P_((char *,out_state_t *,int, struct header_rec *,
FILE *));

! typedef int copy_decoder P_((char *,out_state_t *,int, struct header_rec *,
FILE *));
typedef copy_decoder *copy_decoder_t;
extern copy_decoder_t select_copy_decoder P_((struct header_rec *));
--- 430,450 ----

extern int copy_message_2 P_((FILE *infile,
struct header_rec *current_header,
out_state_t *dest_file,
int cm_options,
int env_flags));

extern int copy_body P_((FILE *infile,
struct header_rec *current_header,
out_state_t *dest_file,
int cm_options));

! extern int copy_plain P_((out_state_t *,int, struct header_rec *,
FILE *));
! extern int copy_mime P_((out_state_t *,int, struct header_rec *,
FILE *));

! typedef int copy_decoder P_((out_state_t *,int, struct header_rec *,
FILE *));
typedef copy_decoder *copy_decoder_t;
extern copy_decoder_t select_copy_decoder P_((struct header_rec *));
Index: elmME+.2.5.alpha4-cvs/hdrs/sysdefs.SH
*** elmME+.2.5.alpha3/hdrs/sysdefs.SH 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha4-cvs/hdrs/sysdefs.SH 2004-09-25 16:29:39.000000000 +0300
***************
*** 22,38 ****


echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'

! /* $Id: sysdefs.SH,v 1.23.4.2 2004/07/03 15:23:04 hurtta Exp $ */
! /******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.4.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

! ******************************************************************************


* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** System level, configurable, defines for the ELM mail system. **/
--- 22,48 ----



echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'

! /* $Id: sysdefs.SH,v 1.23.4.3 2004/09/25 13:29:39 hurtta Exp $ */
! /*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.4.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

! *****************************************************************************
! * Based on Elm 2.4 hdrs/sysdefs.SH. That code was following copyright:
! *


* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor

+ *****************************************************************************
+ * Incorparated Elm 2.5 code from hdrs/sysdefs.SH.


+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *

+ * Copyright (c) 1988-1992 USENET Community Trust

+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** System level, configurable, defines for the ELM mail system. **/
***************
*** 52,57 ****
--- 62,69 ----
#define ETCHOME "$etc"
#define SYSTEM_DEFAULT_FILELIST "$etc/elm.filelist"
#define LIBHOME "$lib"
+ #define SYSTEM_HELP_DIR "$lib"
+

/* DIrectory for post-install files */
#define STAGE_DIR "$stage_dir"
***************
*** 95,104 ****
#define EXECMAIL_MAILER_PATH "$execmail"


-
- #define helphome "$lib"
- #define helpfile "elm-help"
-
#define ELMRC_INFO "$lib/elmrc-info"

#ifdef SHARED_LIBS
--- 107,112 ----
Index: elmME+.2.5.alpha4-cvs/lib/dispaddr.c
*** elmME+.2.5.alpha3/lib/dispaddr.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/lib/dispaddr.c 2004-09-25 13:14:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.17.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: dispaddr.c,v 1.17.8.2 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Index: elmME+.2.5.alpha4-cvs/lib/getaddr.c
*** elmME+.2.5.alpha3/lib/getaddr.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/lib/getaddr.c 2004-09-25 13:14:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.22.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.22.8.2 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.8.2 $ $State: Exp $
*

Index: elmME+.2.5.alpha4-cvs/lib/localmbx.c
*** elmME+.2.5.alpha3/lib/localmbx.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/lib/localmbx.c 2004-09-25 13:14:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.64.4.4 2004/08/14 12:06:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64.4.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.64.4.5 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64.4.5 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

Index: elmME+.2.5.alpha4-cvs/lib/Makefile.SH
*** elmME+.2.5.alpha3/lib/Makefile.SH 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/lib/Makefile.SH 2004-11-02 21:36:17.000000000 +0200
***************
*** 46,58 ****
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.89.8.2 2004/07/19 09:19:59 hurtta Exp $
#


# Makefile for the ELM mail program.
#

# Copyright (c) 1986,1987 Dave Taylor
# Copyright (c) 1988-1992 USENET Community Trust
! #
#
#
# Variables
--- 46,62 ----
echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.89.8.4 2004/11/02 19:36:17 hurtta Exp $
#
# Makefile for the ELM mail program.


#
+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on Elm 2.4 lib/Makefile.SH. That code was following copyright:
+ #
# Copyright (c) 1986,1987 Dave Taylor
# Copyright (c) 1988-1992 USENET Community Trust
! ######################################################################
#
#
# Variables


***************
*** 106,112 ****
if $test "$d_shared" = "$define" ; then

A=
! if $test "$soname_include_path" = "$define" ; then
A="$shlib/"
fi

--- 110,116 ----


if $test "$d_shared" = "$define" ; then

A=
! if $test "$soname_include_path" = y ; then
A="$shlib/"
fi

Index: elmME+.2.5.alpha4-cvs/lib/rc_handle.c
*** elmME+.2.5.alpha3/lib/rc_handle.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha4-cvs/lib/rc_handle.c 2004-09-25 13:14:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17.8.8 2004/07/03 15:23:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.8 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17.8.9 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.9 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************
***************

*** 1241,1246 ****
--- 1241,1252 ----


ptr->list = safe_realloc(ptr->list,
(ptr->nlen+1)* sizeof (ptr->list[0]));
ptr->list[ptr->nlen++] = value;
+
+ if (q) {
+ DPRINT(Debug,9,(&Debug,
+ "expand_dt_path : Starting next quoted value...\n"));
+ start_val = p+1;
+ }
}
}

Index: elmME+.2.5.alpha4-cvs/lib/realfrom.c
*** elmME+.2.5.alpha3/lib/realfrom.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/lib/realfrom.c 2004-09-25 13:14:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.12.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.12.8.2 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

Index: elmME+.2.5.alpha4-cvs/Makefile.SH
*** elmME+.2.5.alpha3/Makefile.SH 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha4-cvs/Makefile.SH 2004-11-02 21:39:21.000000000 +0200
***************
*** 21,35 ****
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.20 2004/02/20 19:38:07 hurtta Exp $
#
# Makefile for the entire ELM mail system


#
# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! #
#

-

# Variables established by Configure

CAT = $cat
GREP = $grep
--- 21,38 ----
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.20.20.1 2004/11/02 19:39:21 hurtta Exp $
#
# Makefile for the entire ELM mail system


#
+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on Elm 2.4 Makefile.SH. That code was following copyright:


+ #
# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! ######################################################################
#

# Variables established by Configure

CAT = $cat
GREP = $grep
Index: elmME+.2.5.alpha4-cvs/MANIFEST
*** elmME+.2.5.alpha3/MANIFEST 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/MANIFEST 2004-09-26 18:18:29.000000000 +0300
***************
*** 23,32 ****
2.4/doc/Users.guide
doc/answer.1
doc/chkalias.1
! doc/elm-help.0
! doc/elm-help.1
! doc/elm-help.2
! doc/elm-help.3
doc/elm.1
doc/elmalias.1
doc/elmrc-info
--- 23,32 ----
2.4/doc/Users.guide
doc/answer.1
doc/chkalias.1
! doc/help-main
! doc/help-options
! doc/help-alias
! doc/help-pager
doc/elm.1
doc/elmalias.1
doc/elmrc-info
***************
*** 42,48 ****
doc/printmail.1
doc/readmsg.1
doc/tmac.n
- hdrs/elmutil.h
hdrs/me.h
hdrs/menu.h
hdrs/menu2.h
--- 42,47 ----
***************
*** 423,425 ****
--- 422,425 ----
lib/cancel.c
src/messages/canceled_mail.c
src/canceled.c
+ utils/def_utils.h
Index: elmME+.2.5.alpha4-cvs/melib/Makefile.SH
*** elmME+.2.5.alpha3/melib/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/melib/Makefile.SH 2004-11-02 21:37:14.000000000 +0200
***************
*** 16,24 ****
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17.44.1 2004/04/18 16:55:42 hurtta Exp $


# Makefile for the ELM mail program.

#
# Variables
# Variables established by Configure

AR = ar
--- 16,27 ----
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17.44.2 2004/11/02 19:37:14 hurtta Exp $


# Makefile for the ELM mail program.

#
+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ####################################################################

+ #


# Variables
# Variables established by Configure

AR = ar
Index: elmME+.2.5.alpha4-cvs/OBSOLETE
*** elmME+.2.5.alpha3/OBSOLETE 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha4-cvs/OBSOLETE 2004-09-26 18:18:29.000000000 +0300
***************
*** 51,53 ****
--- 51,58 ----
doc/Users.guide
doc/Config.guid
doc/Elm.cover
+ doc/elm-help.0
+ doc/elm-help.1
+ doc/elm-help.2
+ doc/elm-help.3
+ hdrs/elmutil.h
Index: elmME+.2.5.alpha4-cvs/shared_libs/iconv/Makefile.SH
*** elmME+.2.5.alpha3/shared_libs/iconv/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/shared_libs/iconv/Makefile.SH 2004-09-25 13:14:33.000000000 +0300


***************
*** 17,23 ****
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.8.22.1 2004/04/18 16:55:42 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.8.22.2 2004/09/25 10:14:33 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************
*** 40,46 ****
!GROK!THIS!

A=
! if $test "$soname_include_path" = "$define" ; then
A="$shlib/"
fi

--- 40,46 ----
!GROK!THIS!

A=
! if $test "$soname_include_path" = y ; then
A="$shlib/"
fi

Index: elmME+.2.5.alpha4-cvs/shared_libs/smtp/Makefile.SH
*** elmME+.2.5.alpha3/shared_libs/smtp/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/shared_libs/smtp/Makefile.SH 2004-09-25 13:14:33.000000000 +0300


***************
*** 17,23 ****
echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.12.22.1 2004/04/18 16:55:42 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.12.22.2 2004/09/25 10:14:33 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************
*** 40,46 ****
!GROK!THIS!

A=
! if $test "$soname_include_path" = "$define" ; then
A="$shlib/"
fi

--- 40,46 ----
!GROK!THIS!

A=
! if $test "$soname_include_path" = y ; then
A="$shlib/"
fi

Index: elmME+.2.5.alpha4-cvs/shared_libs/tls/Makefile.SH
*** elmME+.2.5.alpha3/shared_libs/tls/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/shared_libs/tls/Makefile.SH 2004-09-25 13:14:33.000000000 +0300


***************
*** 17,23 ****
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.16.22.1 2004/04/18 16:55:42 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.16.22.2 2004/09/25 10:14:33 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************
*** 40,46 ****
!GROK!THIS!

A=
! if $test "$soname_include_path" = "$define" ; then
A="$shlib/"
fi

--- 40,46 ----
!GROK!THIS!

A=
! if $test "$soname_include_path" = y ; then
A="$shlib/"
fi

Index: elmME+.2.5.alpha4-cvs/src/alias.c
*** elmME+.2.5.alpha3/src/alias.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/alias.c 2004-10-22 22:34:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.35.2.5 2004/08/14 06:40:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.2.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.35.2.7 2004/10/22 19:34:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.2.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1073,1078 ****
--- 1073,1086 ----


case REDRAW_MARK:
case 'L'&31: redraw++; break;

+ #ifdef ALLOW_SUBSHELL
+ case '!' : Writechar('!');
+ main_state(); /** reload index screen vars **/
+ subshell(mailbox,page);
+ redraw += menu_need_redraw(page);
+ main_state(); /** reload alias screen vars **/
+ break;
+ #endif /* ALLOW_SUBSHELL */

case '$':
Write_to_screen(CATGETS(elm_msg_cat, AliasesSet, AliasesResync,
***************
*** 1543,1549 ****


break;
case HELP_MARK:
case '?' :

! display_helpfile(ALIAS_HELP);
redraw++;
menu_trigger_redraw(page);
return;
--- 1551,1557 ----


break;
case HELP_MARK:
case '?' :

! display_helpfile("alias");
redraw++;
menu_trigger_redraw(page);
return;
Index: elmME+.2.5.alpha4-cvs/src/canceled.c
*** elmME+.2.5.alpha3/src/canceled.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/canceled.c 2004-10-09 20:25:35.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: canceled.c,v 1.5.4.1 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.4.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: canceled.c,v 1.5.4.2 2004/10/09 17:25:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.4.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
****************************************************************************

***************
*** 142,148 ****
GetXYLocation(&lin,&col);

CleartoEOLN();
! ch = GetPrompt(page);

CleartoEOS();

--- 142,148 ----
GetXYLocation(&lin,&col);

CleartoEOLN();
! ch = GetPrompt(page, elm_timeout);

CleartoEOS();

Index: elmME+.2.5.alpha4-cvs/src/digest.c
*** elmME+.2.5.alpha3/src/digest.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/digest.c 2004-10-09 20:25:35.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.10.8.1 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: digest.c,v 1.10.8.2 2004/10/09 17:25:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.2 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************

*** 145,151 ****

DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else
! ch = GetPrompt(page);

CleartoEOS();

--- 145,151 ----

DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else
! ch = GetPrompt(page, elm_timeout);

CleartoEOS();

Index: elmME+.2.5.alpha4-cvs/src/elm.c
*** elmME+.2.5.alpha3/src/elm.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/elm.c 2004-11-01 10:03:06.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.69.8.8 2004/08/14 12:06:10 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.69.8.12 2004/11/01 08:03:06 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69.8.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 801,806 ****
--- 801,825 ----
}
break;

+ case 'u' : /* Unread or undelete */
+ if (get_message_count(mailbox) < 1)
+ goto try_motion;
+ else {
+ int current = get_current(mailbox);
+ struct header_rec * hdr = give_header(mailbox,current-1);
+
+ /* Overload u to have it mark unread a read
+ * message which is not deleted.
+ */
+
+
+ if (!hdr)
+ goto try_motion;
+ if (ison(hdr->status,DELETED))
+ goto try_motion;
+ }
+
+ /* FALL THROUGH */
case 'U' : {
if (get_message_count(mailbox) < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 919,925 ****
}
break;

! default:

/* Maybe motion command */

ch = motion(ch,&MENU,nufoot, header_page,
--- 938,945 ----
}
break;

! default:
! try_motion:

/* Maybe motion command */

ch = motion(ch,&MENU,nufoot, header_page,
***************
*** 1200,1206 ****

DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else
! ch = GetPrompt(page);

/* ? ? ? resize again? */

--- 1220,1226 ----

DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else
! ch = GetPrompt(page, elm_timeout);

/* ? ? ? resize again? */

***************
*** 2234,2240 ****
--- 2254,2264 ----


case NO_OP_COMMAND : break; /* noop for timeout loop */

default : if (ch > '0' && ch <= '9') {


+ int LINES, COLUMNS;
+

int selected = mcommon_get_selected(mc);
+
+ menu_get_sizes(page,&LINES, &COLUMNS);

Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmNewCurrentItem,
***************
*** 2243,2249 ****

i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, page);



DPRINT(Debug,5,(&Debug,
" current %d => %d (?)\n",

--- 2267,2273 ----

i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, page, LINES-4);



DPRINT(Debug,5,(&Debug,
" current %d => %d (?)\n",

Index: elmME+.2.5.alpha4-cvs/src/file.c
*** elmME+.2.5.alpha3/src/file.c 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/file.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: file.c,v 1.36.8.6 2004/08/18 06:27:33 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.6 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file.c,v 1.36.8.7 2004/10/09 12:26:48 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 513,530 ****

switch(text_only) {
case 2:
! ret = copy_message_df(infile,hdr,"",
XXX, ptr,
CM_DECODE | CM_FILT_HDR | CM_REMOVE_ENVELOPE,
system_charset);
break;
case 1:
! ret = copy_message_df(infile,hdr,"",
XXX, ptr, CM_DECODE | CM_FILT_HDR,
system_charset);
break;
case 0: default:
! ret = copy_message_df(infile,hdr,"",
XXX,ptr, CM_UPDATE_STATUS,
NULL);
break;
--- 513,530 ----

switch(text_only) {
case 2:
! ret = copy_message_df(infile,hdr,
XXX, ptr,
CM_DECODE | CM_FILT_HDR | CM_REMOVE_ENVELOPE,
system_charset);
break;
case 1:
! ret = copy_message_df(infile,hdr,
XXX, ptr, CM_DECODE | CM_FILT_HDR,
system_charset);
break;
case 0: default:
! ret = copy_message_df(infile,hdr,
XXX,ptr, CM_UPDATE_STATUS,
NULL);
break;
Index: elmME+.2.5.alpha4-cvs/src/fileio.c
*** elmME+.2.5.alpha3/src/fileio.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/fileio.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.56.8.6 2004/07/04 10:45:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fileio.c,v 1.56.8.7 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 65,75 ****

#ifdef USE_PGP
/* Prototype */
! static int copy_pgp P_((char *,out_state_t *,int, struct header_rec *,
FILE *));

! static int copy_pgp(prefix,dest_file,cm_options,current_header, infile)
! char *prefix;
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
--- 65,74 ----

#ifdef USE_PGP
/* Prototype */
! static int copy_pgp P_((out_state_t *,int, struct header_rec *,
FILE *));

! static int copy_pgp(dest_file,cm_options,current_header, infile)
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
***************
*** 87,92 ****
--- 86,93 ----
int armor_header = 0;
int ret = 1;

+ char * prefix = ((cm_options & CM_PREFIX) ? prefixchars : "");
+
int raw = sr_call_RawState ();

DPRINT(PgpDebug,5,(&PgpDebug,
***************
*** 405,420 ****
#endif /* USE_PGP */

/* Prototype */
! int copy_mime P_((char *,out_state_t *,int, struct header_rec *, FILE *));

! int copy_mime(prefix,dest_file,cm_options,current_header, infile)
! char *prefix;
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
FILE *infile;
{
in_state_t state_in;
in_state_clear(&state_in, STATE_in_file);

DPRINT(MimeDebug,5,(&MimeDebug,
--- 406,423 ----
#endif /* USE_PGP */

/* Prototype */
! int copy_mime P_((out_state_t *,int, struct header_rec *, FILE *));

! int copy_mime(dest_file,cm_options,current_header, infile)
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
FILE *infile;
{
in_state_t state_in;
+
+ char * prefix = ((cm_options & CM_PREFIX) ? prefixchars : "");
+
in_state_clear(&state_in, STATE_in_file);

DPRINT(MimeDebug,5,(&MimeDebug,
***************
*** 445,455 ****
}

/* Prototype */
! static int copy_encrypted P_((char *,out_state_t *,int, struct header_rec *,
FILE *));

! static int copy_encrypted(prefix,dest_file,cm_options,current_header,infile)
! char *prefix;
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
--- 448,457 ----
}

/* Prototype */
! static int copy_encrypted P_((out_state_t *,int, struct header_rec *,
FILE *));

! static int copy_encrypted(dest_file,cm_options,current_header,infile)
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
***************
*** 460,465 ****
--- 462,470 ----


int crypted = OFF;
int buf_len;

+ char * prefix = ((cm_options & CM_PREFIX) ? prefixchars : "");
+
+

DPRINT(Debug,5,(&Debug,
"copy_encrypted called: Need read %d bytes\n",
current_header->content_length));

***************
*** 530,539 ****
}

/* Prototype */
! int copy_plain P_((char *,out_state_t *,int, struct header_rec *, FILE *));

! int copy_plain(prefix,dest_file,cm_options,current_header, infile)
! char *prefix;
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
--- 535,543 ----
}

/* Prototype */
! int copy_plain P_((out_state_t *,int, struct header_rec *, FILE *));

! int copy_plain(dest_file,cm_options,current_header, infile)
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
***************
*** 543,551 ****
int body_bytes = 0;
int buf_len, err;

! DPRINT(Debug,5, (&Debug,
! "copy_plain called: Need read %d bytes\n",
! current_header->content_length));;



/* default-nomime-charset gives assumed charset */
dest_file -> filter = default_nomime_charset;

--- 547,558 ----
int body_bytes = 0;
int buf_len, err;

! char * prefix = ((cm_options & CM_PREFIX) ? prefixchars : "");
!
!
! DPRINT(Debug,5, (&Debug,
! "copy_plain called: Need read %d bytes\n",
! current_header->content_length));;



/* default-nomime-charset gives assumed charset */
dest_file -> filter = default_nomime_charset;
***************

*** 589,598 ****
}

/* Prototype */
! int copy_binary P_((char *,out_state_t *,int, struct header_rec *, FILE *));

! int copy_binary(prefix,dest_file,cm_options,current_header, infile)
! char *prefix;
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
--- 596,604 ----
}

/* Prototype */
! int copy_binary P_((out_state_t *,int, struct header_rec *, FILE *));

! int copy_binary(dest_file,cm_options,current_header, infile)
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
***************
*** 602,607 ****
--- 608,615 ----
int body_bytes = 0;
int buf_len, err;

+ char * prefix = ((cm_options & CM_PREFIX) ? prefixchars : "");
+
DPRINT(Debug,5, (&Debug,
"copy_binary called: Need read %d bytes\n",
current_header->content_length));;
***************
*** 652,661 ****


/* Prototype */
! int copy_cooked P_((char *,out_state_t *,int, struct header_rec *, FILE *));

! int copy_cooked(prefix,dest_file,cm_options,current_header, infile)
! char *prefix;
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
--- 660,668 ----


/* Prototype */
! int copy_cooked P_((out_state_t *,int, struct header_rec *, FILE *));

! int copy_cooked(dest_file,cm_options,current_header, infile)
out_state_t *dest_file;
int cm_options;
struct header_rec *current_header;
***************
*** 664,670 ****
char buffer[VERY_LONG_STRING];
int body_bytes = 0;
int buf_len, err;
!
DPRINT(Debug,5, (&Debug,
"copy_cooked called: Need read %d bytes\n",
current_header->content_length));;
--- 671,679 ----
char buffer[VERY_LONG_STRING];
int body_bytes = 0;
int buf_len, err;
!
! char * prefix = ((cm_options & CM_PREFIX) ? prefixchars : "");
!
DPRINT(Debug,5, (&Debug,
"copy_cooked called: Need read %d bytes\n",
current_header->content_length));;
***************
*** 732,742 ****
return copy_plain;
}

! int copy_message_d(infolder,current_header,prefix,dir,dest,cm_options,
file_set)
struct folder_info *infolder;
struct header_rec *current_header;
- char * prefix;
struct folder_browser *dir;
WRITE_STATE dest;
int cm_options;
--- 741,750 ----
return copy_plain;
}

! int copy_message_d(infolder,current_header,dir,dest,cm_options,
file_set)
struct folder_info *infolder;
struct header_rec *current_header;
struct folder_browser *dir;
WRITE_STATE dest;
int cm_options;
***************
*** 801,807 ****
buffer.display_charset = charset_vector;
set_out_state_dir(dir,dest,&buffer);

! ret = copy_message_2(infile,current_header,prefix,&buffer,cm_options,
env_flags);
out_state_destroy(&buffer);

--- 809,815 ----
buffer.display_charset = charset_vector;
set_out_state_dir(dir,dest,&buffer);

! ret = copy_message_2(infile,current_header,&buffer,cm_options,
env_flags);
out_state_destroy(&buffer);

***************
*** 817,827 ****
return ret;
}

! int copy_message_df(infile,current_header,prefix,dir,dest,cm_options,
file_set)
FILE *infile;
struct header_rec *current_header;
- char * prefix;
struct folder_browser *dir;
WRITE_STATE dest;
int cm_options;
--- 825,834 ----
return ret;
}

! int copy_message_df(infile,current_header,dir,dest,cm_options,
file_set)
FILE *infile;
struct header_rec *current_header;
struct folder_browser *dir;
WRITE_STATE dest;
int cm_options;
***************
*** 870,876 ****
buffer.display_charset = charset_vector;
set_out_state_dir(dir,dest,&buffer);

! ret = copy_message_2(infile,current_header,prefix,&buffer,cm_options,
env_flags);
out_state_destroy(&buffer);

--- 877,883 ----
buffer.display_charset = charset_vector;
set_out_state_dir(dir,dest,&buffer);

! ret = copy_message_2(infile,current_header,&buffer,cm_options,
env_flags);
out_state_destroy(&buffer);

***************
*** 888,900 ****

int copy_message_f(infile,
current_header,
- prefix,
dest_file,
cm_options,
file_set)
FILE *infile;
struct header_rec *current_header;
- char *prefix;
FILE *dest_file;
int cm_options;
charset_t file_set;
--- 895,905 ----
***************
*** 908,914 ****

start_fd_write_state(dest_file,&dir,&dest);

! ret = copy_message_df(infile,current_header,prefix,dir,dest,cm_options,
file_set);

fail2:
--- 913,919 ----

start_fd_write_state(dest_file,&dir,&dest);

! ret = copy_message_df(infile,current_header,dir,dest,cm_options,
file_set);

fail2:
***************
*** 935,985 ****
return ret;


}

- #if 0 /* NOT USED */
-

- int copy_message(infolder,
- current_header,
- prefix,
- dest_file,
- cm_options,
- file_set)
- struct folder_info *infolder;
- struct header_rec *current_header;
- char *prefix;
- FILE *dest_file;
- int cm_options;
- charset_t file_set;
- {


- int ret = 0;

- struct folder_browser *dir = NULL;
- WRITE_STATE dest = NULL;
-
- start_fd_write_state(dest_file,&dir,&dest);
- ret = copy_message_d(infolder,current_header,prefix,
- dir, dest, cm_options, file_set);
- end_fd_write_state(&dir,&dest);
-
- /* Since fprintf is buffered, its return value is only useful for
- * writes which exceed the blocksize. Do a fflush to ensure that
- * the message has, in fact, been written.
- */
-
- if (fflush(dest_file) == EOF) {
- DPRINT(Debug,1, (&Debug,
- "copy_message: Final fflush failed!\n"));
- ret = 0;
- }
-
- return ret;
- }
-
- #endif
-
/* Assumes that headers are already copied ------------------- */
! int copy_body(infile,current_header,prefix,dest_file,cm_options)
FILE *infile;
struct header_rec *current_header;
- char *prefix;
out_state_t *dest_file;
int cm_options;
{
--- 940,949 ----
return ret;
}

/* Assumes that headers are already copied ------------------- */
! int copy_body(infile,current_header,dest_file,cm_options)
FILE *infile;
struct header_rec *current_header;
out_state_t *dest_file;
int cm_options;
{
***************
*** 1000,1013 ****

if (decode) {
copy_decoder_t decoder = select_copy_decoder(current_header);
! ret = decoder(prefix,dest_file,cm_options,current_header,infile);

dest_file -> filter = NULL;
} else if (cm_options & CM_CRLF ||
cm_options & CM_LF) {
! ret = copy_cooked(prefix,dest_file,cm_options,current_header,infile);
} else
! ret = copy_binary(prefix,dest_file,cm_options,current_header,infile);

if (!ret) {
DPRINT(Debug,1,(&Debug,
--- 964,977 ----

if (decode) {
copy_decoder_t decoder = select_copy_decoder(current_header);
! ret = decoder(dest_file,cm_options,current_header,infile);

dest_file -> filter = NULL;
} else if (cm_options & CM_CRLF ||
cm_options & CM_LF) {
! ret = copy_cooked(dest_file,cm_options,current_header,infile);
} else
! ret = copy_binary(dest_file,cm_options,current_header,infile);

if (!ret) {
DPRINT(Debug,1,(&Debug,
***************
*** 1257,1267 ****
}


! int copy_message_2(infile,current_header,prefix,dest_file,cm_options,
env_flags)
FILE *infile;
struct header_rec *current_header;
- char *prefix;
out_state_t *dest_file;
int cm_options;
int env_flags;
--- 1221,1230 ----
}


! int copy_message_2(infile,current_header,dest_file,cm_options,
env_flags)
FILE *infile;
struct header_rec *current_header;
out_state_t *dest_file;
int cm_options;
int env_flags;
***************
*** 1307,1313 ****
int i;

DPRINT(Debug,5, (&Debug,
! "copy_message_2: cm_options=(%d)%s%s%s%s%s%s%s%s%s \n",
cm_options,
remove_header ? " CM_REMOVE_HEADER" : "",
remove_envelope ? " CM_REMOVE_ENVELOPE" : "",
--- 1270,1276 ----
int i;

DPRINT(Debug,5, (&Debug,
! "copy_message_2: cm_options=(%d)%s%s%s%s%s%s%s%s%s%s \n",
cm_options,
remove_header ? " CM_REMOVE_HEADER" : "",
remove_envelope ? " CM_REMOVE_ENVELOPE" : "",
***************
*** 1317,1323 ****
filter_headers ? " CM_FILT_HDR" : "",
(cm_options & CM_DISPLAYING) ? " CM_DISPLAYING" : "",
(cm_options & CM_CRLF) ? " CM_CRLF" : "",
! (cm_options & CM_LF) ? " CM_LF" : ""));

DPRINT(Debug,5, (&Debug,
"copy_message_2: env_flags=(%d)%s%s\n",
--- 1280,1287 ----
filter_headers ? " CM_FILT_HDR" : "",
(cm_options & CM_DISPLAYING) ? " CM_DISPLAYING" : "",
(cm_options & CM_CRLF) ? " CM_CRLF" : "",
! (cm_options & CM_LF) ? " CM_LF" : "",
! (cm_options & CM_PREFIX) ? " CM_PREFIX" : ""));

DPRINT(Debug,5, (&Debug,
"copy_message_2: env_flags=(%d)%s%s\n",
***************
*** 1511,1516 ****
--- 1475,1482 ----

if (!remove_header) {

+ char * prefix = ((cm_options & CM_PREFIX) ? prefixchars : "");
+
for (next_hdr = all_headers;
next_hdr;
next_hdr = next_hdr -> next_header) {
***************
*** 1741,1747 ****
"copy_message> output offset=[%ld]\n",BODY_pos));
}

! if (!copy_body(infile,current_header,prefix,dest_file,cm_options)) {
DPRINT(Debug,1,(&Debug, "copy_message_2 fails (copy_body fails)\n"));
goto fail;
}
--- 1707,1713 ----
"copy_message> output offset=[%ld]\n",BODY_pos));
}

! if (!copy_body(infile,current_header,dest_file,cm_options)) {
DPRINT(Debug,1,(&Debug, "copy_message_2 fails (copy_body fails)\n"));
goto fail;
}
Index: elmME+.2.5.alpha4-cvs/src/help.c
*** elmME+.2.5.alpha3/src/help.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/help.c 2004-09-25 16:29:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.18.8.4 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.18.8.5 2004/09/25 13:29:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 107,113 ****

case HELP_MARK:
case '?':
! display_helpfile(pager_help? PAGER_HELP : MAIN_HELP);
menu_trigger_redraw(page);
return;

--- 107,113 ----

case HELP_MARK:
case '?':
! display_helpfile(pager_help? "pager" : "main");
menu_trigger_redraw(page);
return;

***************
*** 394,408 ****
return;
}

! int display_helpfile(section)
! int section;
{
/*** Help me! Read file 'helpfile.<section>' and echo to screen ***/

char buffer[SLEN];

elm_sfprintf(buffer, sizeof buffer,
! FRM("%s/%s.%d"), helphome, helpfile, section);
return(display_file(buffer));
}

--- 394,408 ----
return;
}

! int display_helpfile(topic)
! char *topic;
{
/*** Help me! Read file 'helpfile.<section>' and echo to screen ***/

char buffer[SLEN];

elm_sfprintf(buffer, sizeof buffer,
! FRM("%s/help-%s"), SYSTEM_HELP_DIR, topic);
return(display_file(buffer));
}

Index: elmME+.2.5.alpha4-cvs/src/in_utils.c
*** elmME+.2.5.alpha3/src/in_utils.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/in_utils.c 2004-10-09 20:25:35.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35.8.4 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** Mindless I/O routines for ELM
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35.8.6 2004/10/09 17:25:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/in_utils.c. That code was following copyright:


+ *
* The Elm Mail System
*
* Copyright (c) 1988-1992 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor

+ *****************************************************************************
+ * Incorparated Elm 2.5 code from src/in_utils.c.


+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1995 USENET Community Trust

+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** Mindless I/O routines for ELM
***************
*** 274,284 ****
return(ch);
}

! int read_number(ch, item, current, page)


int ch;
CONST struct string *item;

! int current;
struct menu_context *page;
{


/** Read a number, where 'ch' is the leading digit! **/

--- 284,295 ----
return(ch);
}

! int read_number(ch, item, dfltval, page, line)


int ch;
CONST struct string *item;

! int dfltval;
struct menu_context *page;
+ int line;
{


/** Read a number, where 'ch' is the leading digit! **/

***************
*** 297,304 ****
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

status = optionally_enter2(page,
! &buff, LINES-4, COLUMNS-40,
OE_APPEND_CURRENT|OE_REDRAW_MARK|


OE_SIG_CHAR /* allow Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,

--- 308,318 ----
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

+ if (line >= LINES && LINES > 0)
+ line = LINES-1;
+
status = optionally_enter2(page,
! &buff, line, COLUMNS-40,
OE_APPEND_CURRENT|OE_REDRAW_MARK|


OE_SIG_CHAR /* allow Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,

***************
*** 306,312 ****


"Set current %S to :"), item);

if (status == -1) /* Ctrl-C */

! return(current);
if (status == REDRAW_MARK) {


/* Can not set menu_trigger_redraw here or causes

redraw loop ... */
--- 320,326 ----


"Set current %S to :"), item);

if (status == -1) /* Ctrl-C */

! return(dfltval);
if (status == REDRAW_MARK) {


/* Can not set menu_trigger_redraw here or causes

redraw loop ... */
***************
*** 318,333 ****
menu_trigger_redraw(page);

if (0 == string_len(buff))
! return current;

num = string_to_long(buff,&bad);

-
-
if (bad >= 0)
! return current;
!
!

return(num);
}
--- 332,343 ----
menu_trigger_redraw(page);

if (0 == string_len(buff))
! return dfltval;



num = string_to_long(buff,&bad);

if (bad >= 0)

! return dfltval;

return(num);
}
***************
*** 1271,1278 ****
return -1;
}

! int GetPrompt(page)
struct menu_context *page;
{
/** This routine does a read/timeout for a single character.
The way that this was determined is that the routine to
--- 1281,1289 ----
return -1;
}

! int GetPrompt(page, wait_time)
struct menu_context *page;
+ int wait_time;
{
/** This routine does a read/timeout for a single character.
The way that this was determined is that the routine to
***************
*** 1285,1292 ****

int ch;

! if (elm_timeout > 0) {
! alarm((unsigned) elm_timeout);
}
if (SETJMP(GetPromptBuf)) {
InGetPrompt = 0;
--- 1296,1303 ----

int ch;

! if (wait_time > 0) {
! alarm((unsigned) wait_time);
}
if (SETJMP(GetPromptBuf)) {
InGetPrompt = 0;
Index: elmME+.2.5.alpha4-cvs/src/leavembox.c
*** elmME+.2.5.alpha3/src/leavembox.c 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/leavembox.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.8 2004/08/16 10:37:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.8 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.9 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 221,227 ****

if (!copy_message_d(storage->current_folder,
storage->headers[i],
! "",recv_browser,recv_writeptr
, CM_UPDATE_STATUS,NULL)) {

lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 221,227 ----

if (!copy_message_d(storage->current_folder,
storage->headers[i],
! recv_browser,recv_writeptr
, CM_UPDATE_STATUS,NULL)) {

lib_error(CATGETS(elm_msg_cat, ElmSet,
Index: elmME+.2.5.alpha4-cvs/src/mailmsg2.c
*** elmME+.2.5.alpha3/src/mailmsg2.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/mailmsg2.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.8.15 2004/08/14 06:40:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.8.16 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.16 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 534,540 ****
int FORW = forwarding;



copy_message_f(mailbox_file,hdr,
! NOQUOTE ? "" : prefixchars, reply,

( NOHDR ? CM_REMOVE_HEADER : 0 ) |

CM_REMOVE_ENVELOPE | CM_DECODE |


( FORW ? CM_FORWARDING : 0 ) |

--- 534,541 ----
int FORW = forwarding;

copy_message_f(mailbox_file,hdr,
! reply,
! ( NOQUOTE ? 0 : CM_PREFIX ) |


( NOHDR ? CM_REMOVE_HEADER : 0 ) |

CM_REMOVE_ENVELOPE | CM_DECODE |


( FORW ? CM_FORWARDING : 0 ) |

***************
*** 549,555 ****
int FORW = forwarding;

copy_message_f(mailbox_file,hdr,
! "", reply,


( NOHDR ? CM_REMOVE_HEADER : 0 ) |

CM_REMOVE_ENVELOPE |


( FORW ? CM_FORWARDING : 0 ) |

--- 550,556 ----
int FORW = forwarding;

copy_message_f(mailbox_file,hdr,
! reply,


( NOHDR ? CM_REMOVE_HEADER : 0 ) |

CM_REMOVE_ENVELOPE |


( FORW ? CM_FORWARDING : 0 ) |

***************
*** 577,583 ****



attach.pathname = safe_strdup(very_long_buffer);

! copy_message_f(mailbox_file,hdr,"",tmpfp,

CM_REMOVE_ENVELOPE,NULL);

attach.length = fsize(tmpfp);
--- 578,584 ----

attach.pathname = safe_strdup(very_long_buffer);

! copy_message_f(mailbox_file,hdr,tmpfp,
CM_REMOVE_ENVELOPE,NULL);

attach.length = fsize(tmpfp);
Index: elmME+.2.5.alpha4-cvs/src/Makefile.SH
*** elmME+.2.5.alpha3/src/Makefile.SH 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/Makefile.SH 2004-11-02 21:36:17.000000000 +0200
***************
*** 31,43 ****

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.50.20.2 2004/08/07 18:07:17 hurtta Exp $
#


# Makefile for the ELM mail program.
#

# Copyright (c) 1988-1992 USENET Community Trust
# Copyright (c) 1986,1987 Dave Taylor


! #
#
# Variables
# Variables established by Configure

--- 31,47 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.50.20.4 2004/11/02 19:36:17 hurtta Exp $
#
# Makefile for the ELM mail program.


#
+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on Elm 2.4 src/Makefile.SH. That code was following copyright:
+ #
# Copyright (c) 1988-1992 USENET Community Trust
# Copyright (c) 1986,1987 Dave Taylor
! ######################################################################


#
# Variables
# Variables established by Configure
***************

*** 63,72 ****
TAGS = ctags

LOCALETARG = $localetarget

- RPATH = $rpath_opt$shlib

!GROK!THIS!

if $test "$make_sets_make" != "$define" ; then

cat >>Makefile <<!GROK!THIS!

--- 67,102 ----


TAGS = ctags

LOCALETARG = $localetarget

Index: elmME+.2.5.alpha4-cvs/src/menu_common/message_screen.c
*** elmME+.2.5.alpha3/src/menu_common/message_screen.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/menu_common/message_screen.c 2004-11-01 10:40:31.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: message_screen.c,v 1.4.8.1 2004/05/15 20:11:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: message_screen.c,v 1.4.8.3 2004/11/01 08:40:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 205,232 ****

/* 5) Show To: -header */

} else if (entry->to && entry->to->fullname) {
!
if (string_len(entry->to->fullname) > 0) {
int X = 0,len1;
struct string * N =
curses_printable_clip(entry->to->fullname,
! &X,MLIST_LEN-1,&len1,MLIST_LEN-1);

! int fill_len = MLIST_LEN - len1 -1;

! list_buffer = format_string(FRM(" (%S%*s)"),
N,fill_len,"");

free_string(&N);
} else {
/* FIXME? DO not take account header charset */
! list_buffer = format_string(FRM(" (%*.*s)"),
! -MLIST_LEN+1,
! MLIST_LEN-1,
! entry->to->addr);
! }
!
}

/* 6) No To: -header */
--- 205,240 ----

/* 5) Show To: -header */

+ } else if (really_to) {
+ /* If we are idplaying anyway To -address, do not display
+ it twice
+ */
+
+ list_buffer = new_string(display_charset);
+ who_width += MLIST_LEN +2;
+
+
} else if (entry->to && entry->to->fullname) {
!
if (string_len(entry->to->fullname) > 0) {
int X = 0,len1;
struct string * N =
curses_printable_clip(entry->to->fullname,
! &X,MLIST_LEN-2,&len1,MLIST_LEN-2);

! int fill_len = MLIST_LEN - len1 -2;

! list_buffer = format_string(FRM(" (%S%*s)/"),
N,fill_len,"");

free_string(&N);
} else {
/* FIXME? DO not take account header charset */
! list_buffer = format_string(FRM(" (%*.*s)/"),
! -MLIST_LEN+2,
! MLIST_LEN-2,
! entry->to->addr);
! }
}

/* 6) No To: -header */
Index: elmME+.2.5.alpha4-cvs/src/messages/canceled_mail.c
*** elmME+.2.5.alpha3/src/messages/canceled_mail.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/messages/canceled_mail.c 2004-09-25 13:14:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.8.2.1 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.2.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.8.2.2 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.2.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/
***************

Index: elmME+.2.5.alpha4-cvs/src/messages/header_alloc.c
*** elmME+.2.5.alpha3/src/messages/header_alloc.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/messages/header_alloc.c 2004-11-03 14:24:50.000000000 +0200
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.10.8.4 2004/05/16 10:25:33 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.4 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,8 ----
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.10.8.6 2004/11/03 12:24:50 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.6 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 198,204 ****
phrase = strmcat(phrase,tokens[i]);
}

! if ('<' != tokens[i][0])
goto error;

if (current_header->list_phrase ||
--- 198,204 ----
phrase = strmcat(phrase,tokens[i]);
}

! if (!tokens[i] || '<' != tokens[i][0])
goto error;

if (current_header->list_phrase ||
***************
*** 234,240 ****
id = strmcat(id,tokens[i]);
}

! if ('>' != tokens[i][0])
goto error;

current_header->list_id = id;
--- 234,240 ----
id = strmcat(id,tokens[i]);
}

! if (!tokens[i] || '>' != tokens[i][0])
goto error;

current_header->list_id = id;
***************
*** 367,374 ****
parse_list_id(current_header,tmphdr);


}

! if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
! "From"))) {
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &

--- 367,377 ----
parse_list_id(current_header,tmphdr);


}

! for (tmphdr = locate_header_by_name(parsed_headers,
! "From");
! tmphdr;
! tmphdr = tmphdr -> next_this_header) {
!
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &
***************

*** 376,405 ****

--- 379,401 ----


is_rfc1522(tmphdr->body),
current_header->header_charset);

! if (addrs) {
!
! if (current_header->from) {
! append_addr_items(& (current_header->from), addrs);
! free_addr_items(addrs);

! } else
! current_header->from = addrs;
!
}
}

! for (tmphdr = locate_header_by_name(parsed_headers,
! "To");
! tmphdr;
! tmphdr = tmphdr -> next_this_header) {
!
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &
***************

*** 408,435 ****


current_header->header_charset);

if (addrs) {
! if (current_header->to)
! free_addr_items(current_header->to);
! current_header->to = addrs;
!
! #if DEBUG
! if (Debug.active > 10) {
! struct addr_item * p;
! for (p = current_header->to; p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- to[%d] addr='%s' comment='%S' fullname='%S'\n",
! p - current_header->to,
! p->addr,
! p->comment,
! p->fullname));
! }
! }
! #endif
}
}

! if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
! "Cc"))) {
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &

--- 404,423 ----


current_header->header_charset);

if (addrs) {
!
! if (current_header->to) {
! append_addr_items(& (current_header->to), addrs);
! free_addr_items(addrs);
! } else
! current_header->to = addrs;
}
}

! for (tmphdr = locate_header_by_name(parsed_headers,
! "Cc");
! tmphdr;
! tmphdr = tmphdr -> next_this_header) {
!
struct addr_item * addrs =
break_down_address(tmphdr->body,
!(current_header -> status &
***************

*** 438,461 ****


current_header->header_charset);

if (addrs) {
! if (current_header->cc)
! free_addr_items(current_header->cc);
! current_header->cc = addrs;
!
! #if DEBUG
! if (Debug.active > 10) {
! struct addr_item * p;
! for (p = current_header->cc; p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- cc[%d] addr='%s' comment='%S' fullname='%S'\n",
! p - current_header->cc,
! p->addr,
! p->comment,
! p->fullname));
!
! }
! }
! #endif
}
}

--- 426,436 ----


current_header->header_charset);

if (addrs) {
! if (current_header->cc) {
! append_addr_items(& (current_header->cc), addrs);
! free_addr_items(addrs);
! } else
! current_header->cc = addrs;
}
}

Index: elmME+.2.5.alpha4-cvs/src/metapager.c
*** elmME+.2.5.alpha3/src/metapager.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/metapager.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: metapager.c,v 1.38.8.1 2004/07/03 15:23:07 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: metapager.c,v 1.38.8.3 2004/10/09 12:26:48 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

***************
*** 428,434 ****
copy_body assumes that headers are already read
*/
copy_body(fp,hdr,
! "",&buffer,CM_REMOVE_HEADER|CM_DECODE|CM_DISPLAYING);

out_state_destroy(&buffer);
if (!builtin)
--- 510,516 ----
copy_body assumes that headers are already read
*/
copy_body(fp,hdr,
! &buffer,CM_REMOVE_HEADER|CM_DECODE|CM_DISPLAYING);

out_state_destroy(&buffer);
if (!builtin)
Index: elmME+.2.5.alpha4-cvs/src/options.c
*** elmME+.2.5.alpha3/src/options.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/options.c 2004-09-25 16:29:39.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: options.c,v 1.24.8.4 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24.8.4 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
* The Elm Mail System
*

* Copyright (c) 1986,1987 Dave Taylor

* Copyright (c) 1988-1992 USENET Community Trust

****************************************************************************/

/** This set of routines allows the alteration of a number of paramaters
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: options.c,v 1.24.8.5 2004/09/25 13:29:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/options.c. That code was following copyright:


+ *
* The Elm Mail System
*

* Copyright (c) 1986,1987 Dave Taylor

* Copyright (c) 1988-1992 USENET Community Trust

+ *****************************************************************************
+ * Incorparated Elm 2.5 code from src/options.c.

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *

+ * Copyright (c) 1986,1987 Dave Taylor


+ * Copyright (c) 1988-1995 USENET Community Trust

****************************************************************************/

/** This set of routines allows the alteration of a number of paramaters
***************
*** 334,340 ****
c = tolower(c);

if (c == '?') {
! display_helpfile(OPTIONS_HELP);
display_options(page);
return;
}
--- 344,350 ----
c = tolower(c);

if (c == '?') {
! display_helpfile("options");
display_options(page);
return;
}
Index: elmME+.2.5.alpha4-cvs/src/partial.c
*** elmME+.2.5.alpha3/src/partial.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/partial.c 2004-10-09 20:25:35.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.9.8.1 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.9.8.2 2004/10/09 17:25:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
***************
*** 165,171 ****
GetXYLocation(&lin,&col);

CleartoEOLN();
! ch = GetPrompt(page);

CleartoEOS();

--- 165,171 ----
GetXYLocation(&lin,&col);

CleartoEOLN();
! ch = GetPrompt(page, elm_timeout);

CleartoEOS();

Index: elmME+.2.5.alpha4-cvs/src/pgp.c
*** elmME+.2.5.alpha3/src/pgp.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/pgp.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38.8.4 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38.8.5 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1101,1107 ****
return;
}
if (!copy_message_f(infile,hdr,
! "",fpout,0,NULL)) {
fclose(fpout);
return;
}
--- 1101,1107 ----
return;
}
if (!copy_message_f(infile,hdr,
! fpout,0,NULL)) {
fclose(fpout);
return;
}
Index: elmME+.2.5.alpha4-cvs/src/remail.c
*** elmME+.2.5.alpha3/src/remail.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/remail.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remail.c,v 1.35.8.1 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remail.c,v 1.35.8.2 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 117,124 ****

/* !! */
if (!copy_message_2(F1,
! current_header,
! "",
get_mail_outfd(mailer),
CM_REMOVE_ENVELOPE | CM_REMAIL,
0)) {
--- 117,123 ----

/* !! */
if (!copy_message_2(F1,
! current_header,
get_mail_outfd(mailer),
CM_REMOVE_ENVELOPE | CM_REMAIL,
0)) {
Index: elmME+.2.5.alpha4-cvs/src/savecopy.c
*** elmME+.2.5.alpha3/src/savecopy.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/savecopy.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44.8.3 2004/08/14 06:40:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44.8.4 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 595,601 ****
goto fail;
}

! if (!copy_message_2(F,&X, "",&buffer,0,env_flag)) {
DPRINT(Debug,5,(&Debug,
"append_copy_to_file: copy_message_2 failed!\n"));
err = -1;
--- 595,601 ----
goto fail;
}

! if (!copy_message_2(F,&X, &buffer,0,env_flag)) {
DPRINT(Debug,5,(&Debug,
"append_copy_to_file: copy_message_2 failed!\n"));
err = -1;
Index: elmME+.2.5.alpha4-cvs/src/showmsg.c
*** elmME+.2.5.alpha3/src/showmsg.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha4-cvs/src/showmsg.c 2004-10-09 15:26:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.36.8.2 2004/07/19 09:20:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.36.8.3 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.3 $ $State: Exp $

Kari E. Hurtta

unread,
Dec 8, 2004, 5:40:30 AM12/8/04
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL121a

Elm 2.4ME+ PL121a (25)

- Is available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/
file elm-2.4ME+PL121a.patch.gz

- Is available on ozone.FMI.FI (1)


via anonymous ftp
directory KEH/

file elm-2.4ME+PL121a.patch.gz
for a moment.

- Is available with
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL121a.patch.gz >
via WWW (3).

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL121a.patch.gz >
via WWW (1)

- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL121a.patch.gz >
via WWW.

- Is available on ftp.funet.fi (or ftp.ipv6.funet.fi)
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/
file elm-2.4ME+PL121a.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL121a.patch.gz >
via WWW.


NOTES:
(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)
are now on new site hosted by Kapsi Internet-käyttäjät ry.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.

Changes of Elm 2.4ME+ PL121a (25) compared with Elm 2.4ME+ PL121 (25)
---------------------------------------------------------------------

- Fix error message
Path component "none" not absolute on key
"internal-mailcaps" value "none"
when on elmrc have line
internal-mailcaps = none


This patch is agaist Elm 2.4ME+ PL121 (25) --------------------------------
Index: elm2.4.ME+.121a-cvs/hdrs/patchlevel.h
Prereq: 1127000000
*** elm2.4.ME+.121/hdrs/patchlevel.h 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121a-cvs/hdrs/patchlevel.h 2004-12-07 11:36:26.000000000 +0200
***************
*** 1,12 ****


! #define PATCHLEVEL "121 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1127000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "Sep, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Sep, 2004"

/*
* Local Variables:

--- 1,12 ----
! #define PATCHLEVEL "121a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1130000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Dec, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Dec, 2004"

/*
* Local Variables:
Index: elm2.4.ME+.121a-cvs/README.ME+
*** elm2.4.ME+.121/README.ME+ 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121a-cvs/README.ME+ 2004-12-07 11:36:26.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.844 2004/09/22 17:37:08 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.847 2004/12/07 09:36:26 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,27 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL121a (25) compared with Elm 2.4ME+ PL121 (25)
+ ---------------------------------------------------------------------
+
+ - Fix error message
+ Path component "none" not absolute on key
+ "internal-mailcaps" value "none"
+ when on elmrc have line
+ internal-mailcaps = none


+
Changes of Elm 2.4ME+ PL121 (25) compared with Elm 2.4ME+ PL120 (25)

--------------------------------------------------------------------

***************
*** 9139,9145 ****
was allocated but the actual string was never built.
From: Mark Johnson <Mark.J...@ustc.vlsi.COM>

! - At the end of a message with the buildin pager I
sometimes get the prompt "MORE (you've seen 101%):"
and I can not read the next message with
pressing the space bar.
--- 9148,9154 ----
was allocated but the actual string was never built.
From: Mark Johnson <Mark.J...@ustc.vlsi.COM>

! - At the end of a message with the builtin pager I
sometimes get the prompt "MORE (you've seen 101%):"
and I can not read the next message with
pressing the space bar.
Index: elm2.4.ME+.121a-cvs/doc/elmrc-info
*** elm2.4.ME+.121/doc/elmrc-info 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121a-cvs/doc/elmrc-info 2004-12-07 11:20:11.000000000 +0200
***************
*** 1,4 ****


! #@(#)$Id: elmrc-info,v 1.67 2004/09/11 10:42:07 hurtta Exp $
# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.68 2004/12/07 09:20:11 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************

*** 841,847 ****
internal-mailcaps


# List of mailcaps for internal mailcap support (without metmail).

# List may be space or ':' seperated. Separate values may be quoted.
! # Set value to "none" to disable internal mailcap support.

# See also: metamail-mailcaps, internal-mailcap-trusted-programs

internal-mailcap-trusted-programs
--- 841,847 ----
internal-mailcaps


# List of mailcaps for internal mailcap support (without metmail).

# List may be space or ':' seperated. Separate values may be quoted.

! # Set value to "none" (without quotes) to disable internal mailcap support.


# See also: metamail-mailcaps, internal-mailcap-trusted-programs

internal-mailcap-trusted-programs
Index: elm2.4.ME+.121a-cvs/doc/Makefile.SH
*** elm2.4.ME+.121/doc/Makefile.SH 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.121a-cvs/doc/Makefile.SH 2004-11-02 21:44:39.000000000 +0200
***************
*** 17,28 ****
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.31 2004/05/02 12:38:13 hurtta Exp $
#


# Makefile for the documentation of the ELM mail system
#
# (C) Copyright 1988-1992, USENET Community Trust

! #
#
# Variables
# Variables established by Configure

--- 17,32 ----
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.32 2004/11/02 19:44:39 hurtta Exp $


! #
! # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>

! ######################################################################
! # Based on doc/Makefile.SH. That code was following copyright:
#


# Makefile for the documentation of the ELM mail system
#
# (C) Copyright 1988-1992, USENET Community Trust

! ######################################################################
#
# Variables
# Variables established by Configure

Index: elm2.4.ME+.121a-cvs/lib/Makefile.SH
*** elm2.4.ME+.121/lib/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121a-cvs/lib/Makefile.SH 2004-11-02 21:44:39.000000000 +0200
***************
*** 46,58 ****


echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.91 2004/09/05 08:17:07 hurtta Exp $
#
# Makefile for the ELM mail program.
#

# Copyright (c) 1986,1987 Dave Taylor
# Copyright (c) 1988-1992 USENET Community Trust
! #
#
#
# Variables

--- 46,62 ----


echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.92 2004/11/02 19:44:39 hurtta Exp $


#
# Makefile for the ELM mail program.
#

+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on lib/Makefile.SH. That code was following copyright:


+ #
# Copyright (c) 1986,1987 Dave Taylor
# Copyright (c) 1988-1992 USENET Community Trust
! ######################################################################
#
#
# Variables

Index: elm2.4.ME+.121a-cvs/lib/rc_handle.c
*** elm2.4.ME+.121/lib/rc_handle.c 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121a-cvs/lib/rc_handle.c 2004-12-07 11:20:11.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.30 2004/09/13 11:44:23 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.31 2004/12/07 09:20:11 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************
***************

*** 929,934 ****
--- 929,946 ----
if (!recursive) {
DPRINT(Debug,8,(&Debug, "expand_dt_path: %s: %s\n",
fieldname,val));
+
+ if (0 == strcmp(val,"none") && 0 == ptr->nlen) {
+
+ /* Set dummy value indicating none ... */
+ ptr->list = safe_realloc(ptr->list,sizeof (ptr->list[0]));
+ ptr->list[0] = NULL;
+ ptr->nlen = 0;


+
+ return ret;
+ }
+
+

} else {
DPRINT(Debug,11,(&Debug, "expand_dt_path: %s: %s (recursive=%d)\n",
fieldname,val,recursive));
***************
*** 1277,1282 ****
--- 1289,1304 ----
if (!ptr->list)
return NULL;

+ if (ptr->list && 0 == ptr->nlen) {
+ res = safe_strdup("none");
+
+ DPRINT(Debug,9,(&Debug,
+ "give_dt_path_as_str=%s\n",res));
+
+ return res;
+ }
+
+
for (i = 0; i < ptr->nlen; i++)
L += strlen(ptr->list[i]) +1;

***************
*** 1422,1427 ****
--- 1444,1453 ----



fprintf(F, "%s = ",r->name);

+ if (r->val.path->list && 0 == r->val.path->nlen) {
+ fprintf(F, "none");
+ }
+
for (i = 0; i < r->val.path->nlen; i++) {


/* NOTE: space is always valid separator even when

PATH_sep_comma or PATH_sep_colon is set */

***************
*** 1447,1452 ****
--- 1473,1479 ----


fputs(r->val.path->list[i],F);

len += strlen(r->val.path->list[i]) + 1;
}
+
fprintf(F, "\n");
}
}
Index: elm2.4.ME+.121a-cvs/Makefile.SH
*** elm2.4.ME+.121/Makefile.SH 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.121a-cvs/Makefile.SH 2004-11-02 21:44:39.000000000 +0200
***************
*** 21,33 ****
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.20 2004/02/20 19:38:07 hurtta Exp $
#


# Makefile for the entire ELM mail system
#
# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! #
#

# Variables established by Configure

--- 21,37 ----
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.21 2004/11/02 19:44:39 hurtta Exp $
#


# Makefile for the entire ELM mail system
#
+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on Makefile.SH. That code was following copyright:


+ #
# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! ######################################################################
#

# Variables established by Configure

Index: elm2.4.ME+.121a-cvs/src/Makefile.SH
*** elm2.4.ME+.121/src/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121a-cvs/src/Makefile.SH 2004-11-02 21:44:39.000000000 +0200
***************
*** 31,43 ****

cat >Makefile <<!GROK!THIS!
#!$make


! # $Id: Makefile.SH,v 1.54 2004/09/11 07:31:19 hurtta Exp $
#
# Makefile for the ELM mail program.
#

# Copyright (c) 1988-1992 USENET Community Trust
# Copyright (c) 1986,1987 Dave Taylor
! #
#
# Variables
# Variables established by Configure

--- 31,47 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.55 2004/11/02 19:44:39 hurtta Exp $


#
# Makefile for the ELM mail program.
#

+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on src/Makefile.SH. That code was following copyright:


+ #
# Copyright (c) 1988-1992 USENET Community Trust
# Copyright (c) 1986,1987 Dave Taylor
! ######################################################################
#
# Variables
# Variables established by Configure

Index: elm2.4.ME+.121a-cvs/utils/Makefile.SH
*** elm2.4.ME+.121/utils/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121a-cvs/utils/Makefile.SH 2004-11-02 21:44:39.000000000 +0200
***************
*** 16,28 ****


echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.36 2004/09/11 07:31:19 hurtta Exp $
#
# Makefile for the Elm system utilities
#

# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! #
#

# Variables
# Variables established by Configure

--- 16,32 ----


echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.37 2004/11/02 19:44:39 hurtta Exp $


#
# Makefile for the Elm system utilities
#

+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on utils/Makefile.SH. That code was following copyright:


+ #
# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! ######################################################################
#
# Variables

Kari E. Hurtta

unread,
Dec 13, 2004, 12:14:40 PM12/13/04
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL121b

Elm 2.4ME+ PL121b (25)

- Is available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

file elm-2.4ME+PL121b.patch.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+PL121b.patch.gz >
via WWW.

- Is available on ozone.FMI.FI (1)


via anonymous ftp
directory KEH/

file elm-2.4ME+PL121b.patch.gz
for a moment.

- Is available with
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL121b.patch.gz >
via WWW (3).

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL121b.patch.gz >
via WWW (1)

- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL121b.patch.gz >
via WWW.

- Is available on ftp.funet.fi (or ftp.ipv6.funet.fi)
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL121b.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL121b.patch.gz >
via WWW.


NOTES:
(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)

are now on new site hosted by Kapsi Internet-k=E4ytt=E4j=E4t ry.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.

Changes of Elm 2.4ME+ PL121b (25) compared with Elm 2.4ME+ PL121a (25)
----------------------------------------------------------------------

- "If you had no aliases yet, and pushed j or k in the
aliases menu (or the down or up arrows), you had a
"bad item" "common menu panic". The reason was a
missing "break" statement in alias_item.c, which was
present in the approprite place in mailbox_item.c"
From: Kovacs Baldvin <bal...@cs.elte.hu>
( Patch was agaist Elm ME+ 2.5 but applies also to Elm
2.4ME+ )


This patch is agaist Elm 2.4ME+ PL121a (25) --------------------------------
Index: elm2.4.ME+.121b-cvs/hdrs/patchlevel.h
Prereq: 1130000000
*** elm2.4.ME+.121a/hdrs/patchlevel.h 2004-12-11 12:33:31.000000000 +0200
--- elm2.4.ME+.121b-cvs/hdrs/patchlevel.h 2004-12-10 20:46:20.000000000 +0200
***************
*** 1,8 ****


! #define PATCHLEVEL "121a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1130000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Dec, 2004" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "121b (25)"


/* Used by Configure:
SHAREDTAG: .1.0.121
*/

! #define LAST_REPORT_TIME 1134000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Dec, 2004" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.121b-cvs/README.ME+
*** elm2.4.ME+.121a/README.ME+ 2004-12-11 12:33:32.000000000 +0200
--- elm2.4.ME+.121b-cvs/README.ME+ 2004-12-10 20:46:20.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.847 2004/12/07 09:36:26 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849 2004/12/10 18:46:20 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,30 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL121b (25) compared with Elm 2.4ME+ PL121a (25)
+ ----------------------------------------------------------------------
+
+ - "If you had no aliases yet, and pushed j or k in the
+ aliases menu (or the down or up arrows), you had a
+ "bad item" "common menu panic". The reason was a
+ missing "break" statement in alias_item.c, which was
+ present in the approprite place in mailbox_item.c"
+ From: Kovacs Baldvin <bal...@cs.elte.hu>
+ ( Patch was agaist Elm ME+ 2.5 but applies also to Elm
+ 2.4ME+ )


+
Changes of Elm 2.4ME+ PL121a (25) compared with Elm 2.4ME+ PL121 (25)

---------------------------------------------------------------------

Index: elm2.4.ME+.121b-cvs/src/menu_common/alias_item.c
*** elm2.4.ME+.121a/src/menu_common/alias_item.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.121b-cvs/src/menu_common/alias_item.c 2004-12-09 20:55:34.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias_item.c,v 1.3 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias_item.c,v 1.4 2004/12/09 18:55:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************
***************
*** 63,68 ****
--- 63,69 ----
if (! storage[I])
storage[I] = format_string(CATGETS(elm_msg_cat, ElmSet, ElmNoAliases,
"No aliases!"));
+ break;

default:
panic("MENU COMMON PANIC",__FILE__,__LINE__,"mc_give_item_alias",

Kari E. Hurtta

unread,
Dec 29, 2004, 2:14:02 PM12/29/04
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL121c

Elm 2.4ME+ PL121c (25)

- Is available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

file elm-2.4ME+PL121c.patch.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+PL121c.patch.gz >
via WWW.

- Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

file elm-2.4ME+PL121c.patch.gz
for a moment.

- Is available with
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL121c.patch.gz >
via WWW (3).

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL121c.patch.gz >
via WWW (1)

- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL121c.patch.gz >
via WWW.

- Will be available on ftp.funet.fi (4) (or ftp.ipv6.funet.fi)


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL121c.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL121c.patch.gz >
via WWW.


NOTES:
(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire.

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)

are now on new site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.

(4) Is submitted to pub/unix/incoming/ on ftp.funet.fi
( http://www.nic.funet.fi/pub/unix/incoming/elm-2.4ME+/ )

Changes of Elm 2.4ME+ PL121c (25) compared with Elm 2.4ME+ PL121b (25)
----------------------------------------------------------------------

- Fix incorrect drawing of "MIME structure Menu" when arrow
cursor was used.


This patch is agaist Elm 2.4ME+ PL121b (25) --------------------------------
Index: elm2.4.ME+.121c-cvs/hdrs/patchlevel.h
Prereq: 1134000000
*** elm2.4.ME+.121b/hdrs/patchlevel.h 2004-12-27 19:09:45.000000000 +0200
--- elm2.4.ME+.121c-cvs/hdrs/patchlevel.h 2004-12-27 16:46:00.000000000 +0200
***************
*** 1,8 ****


! #define PATCHLEVEL "121b (25)"
/* Used by Configure:
SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1134000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
#define VERS_DATE "Dec, 2004" /* for elm -v option */
#define WHAT_STRING \
--- 1,8 ----

! #define PATCHLEVEL "121c (25)"


/* Used by Configure:
SHAREDTAG: .1.0.121
*/

! #define LAST_REPORT_TIME 1135000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
#define VERS_DATE "Dec, 2004" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.121c-cvs/README.ME+
*** elm2.4.ME+.121b/README.ME+ 2004-12-27 19:09:45.000000000 +0200
--- elm2.4.ME+.121c-cvs/README.ME+ 2004-12-27 18:10:26.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849 2004/12/10 18:46:20 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.2 2004/12/27 16:10:26 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.

***************
*** 13,18 ****
--- 13,24 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL121c (25) compared with Elm 2.4ME+ PL121b (25)
+ ----------------------------------------------------------------------
+
+ - Fix incorrect drawing of "MIME structure Menu" when arrow
+ cursor was used.


+
Changes of Elm 2.4ME+ PL121b (25) compared with Elm 2.4ME+ PL121a (25)

----------------------------------------------------------------------

Index: elm2.4.ME+.121c-cvs/src/attach_menu.c
*** elm2.4.ME+.121b/src/attach_menu.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.121c-cvs/src/attach_menu.c 2004-12-26 19:22:38.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.68 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.68 $ $State: Exp $
*


* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.68.10.1 2004/12/26 17:22:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.68.10.1 $ $State: Exp $
*


* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1896,1902 ****
if (is_cur && arrow_cursor) {
PutLine0 (offset, 0, "->");
} else
! MoveCursor(offset, 0);
CleartoEOLN();

if (x < 0)
--- 1896,1902 ----
if (is_cur && arrow_cursor) {
PutLine0 (offset, 0, "->");
} else
! PutLine0 (offset, 0, " ");
CleartoEOLN();

if (x < 0)
***************
*** 2535,2541 ****
break;
}
if (arrow_cursor)
! write_num(cur+1,FALSE,offset + cur - top);
else if (current)
attach_header (current, FALSE,
current->attachments_index == -1,
--- 2535,2541 ----
break;
}
if (arrow_cursor)
! write_num(cur,FALSE,offset + cur - top);
else if (current)
attach_header (current, FALSE,
current->attachments_index == -1,
***************
*** 2545,2551 ****
current = NULL;
if (cur < top + LINES -4 - offset) {
if (arrow_cursor)
! write_num(cur+1,TRUE,offset + cur - top);
else
current = draw_loc(top_structure,top_len,cur,
top,top + LINES -5 - offset,
--- 2545,2551 ----
current = NULL;
if (cur < top + LINES -4 - offset) {
if (arrow_cursor)
! write_num(cur,TRUE,offset + cur - top);
else
current = draw_loc(top_structure,top_len,cur,
top,top + LINES -5 - offset,
***************
*** 2563,2569 ****
break;
}
if (arrow_cursor)
! write_num(cur+1,FALSE,offset + cur - top);
else if (current)
attach_header (current, FALSE,
current->attachments_index == -1,
--- 2563,2569 ----
break;
}
if (arrow_cursor)
! write_num(cur,FALSE,offset + cur - top);
else if (current)
attach_header (current, FALSE,
current->attachments_index == -1,
***************
*** 2574,2580 ****

if (cur >= top) {
if (arrow_cursor)
! write_num(cur+1,TRUE,offset + cur - top);
else
current = draw_loc(top_structure,top_len,cur,
top,top + LINES -5 - offset,
--- 2574,2580 ----

if (cur >= top) {
if (arrow_cursor)
! write_num(cur,TRUE,offset + cur - top);
else
current = draw_loc(top_structure,top_len,cur,
top,top + LINES -5 - offset,

Kari E. Hurtta

unread,
Feb 9, 2005, 3:53:57 PM2/9/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL121d

Elm 2.4ME+ PL121d (25)

- Is available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

file elm-2.4ME+PL121d.patch.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+PL121d.patch.gz >
via WWW.

- Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

file elm-2.4ME+PL121d.patch.gz
for a moment.

- Is available with
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL121d.patch.gz >
via WWW (3).

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL121d.patch.gz >
via WWW (1)

- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL121d.patch.gz >
via WWW.

- Is be available on ftp.funet.fi (or ftp.ipv6.funet.fi)


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL121d.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL121d.patch.gz >
via WWW.


NOTES:
(1) It is currently unknown what will be done for ftp.ozone.fmi.fi

and www.ozone.fmi.fi. Also ozone.fmi.fi will retire. Actually
ozone.fmi.fi was scheduled to retire one year ago...

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)

are now on site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.


Changes of Elm 2.4ME+ PL121d (25) compared with Elm 2.4ME+ PL121c (25)
----------------------------------------------------------------------

- Fix "Reverse Thread" sorting order.

- Fix valgrind reported memory leak:
24 bytes in 1 blocks are definitely lost in loss record 4 of 28
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x8147EF3: safe_malloc (safemalloc.c:47)
by 0x8068ACA: attach_menu (attach_menu.c:2253)
by 0x80784E5: mailbox_command (elm.c:808)
by 0x807920D: main (elm.c:1185)

- Add redraw handling to display_file()

- Fix valgrind reported memory leak:
56 bytes in 5 blocks are definitely lost in loss record 9 of 28
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x8147F8F: safe_malloc (safemalloc.c:47)
by 0x80E9095: new_state_1 (charset_input.c:18)
by 0x80F9FFC: cs_add_streambyte_to_utf8 (cs_utf.c:348)

- Fix valgrind reported memory leak:
16 bytes in 2 blocks are definitely lost in loss record 3 of 28
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x8147F8F: safe_malloc (safemalloc.c:47)
by 0x8163E41: malloc_string (string.c:116)
by 0x8163FBC: new_string (string.c:153)
by 0x80876EA: read_number (in_utils.c:282)

- Fix valgrind reported memory leak:
30 bytes in 1 blocks are definitely lost in loss record 7 of 29
at 0x4002668F: realloc (vg_replace_malloc.c:310)
by 0x8148225: safe_realloc (safemalloc.c:63)
by 0x8133394: elm_vmessage (output.c:1281)
by 0x8133A5E: elm_message (output.c:1460)
by 0x80FD9DA: init_debug (debug.c:58)

- Fix valgrind reported memory leak:
8 bytes in 1 blocks are definitely lost in loss record 1 of 31
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x8148173: safe_malloc (safemalloc.c:47)
by 0x8145BA9: split_remote_name (remote_mbx.c:620)
by 0x814ADA3: browser_folder_from_dummy (savefolder.c:1076)
- Fix valgrind reported memory leak:
14 bytes in 1 blocks are definitely lost in loss record 3 of 31
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x8148349: safe_strdup (safemalloc.c:79)
by 0x8145B8E: split_remote_name (remote_mbx.c:618)
by 0x814ADA3: browser_folder_from_dummy (savefolder.c:1076)

- Fix valgrind reported memory leak:
8 bytes in 1 blocks are definitely lost in loss record 1 of 30
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x8148237: safe_malloc (safemalloc.c:47)
by 0x8164109: malloc_string (string.c:116)
by 0x8164FDC: cat_strings (string.c:449)
by 0x81307E5: elm_smessage (output.c:857)
by 0x8087063: prompt_letter (in_utils.c:84)

- Fix valgrind reported memory leak:
29 bytes in 5 blocks are definitely lost in loss record 7 of 30
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x8148243: safe_malloc (safemalloc.c:47)
by 0x8105414: rfc822_tokenize (getaddr.c:37)
by 0x8061333: do_expand_group_l (aliaslib.c:88)

- Fix valgrind reported memory leak:
7104 bytes in 1 blocks are definitely lost in loss record 27 of 29
at 0x4002668F: realloc (vg_replace_malloc.c:310)
by 0x8148339: safe_realloc (safemalloc.c:63)
by 0x80BFA69: add_canceled_mail1 (canceled_mail.c:1291)

- Fix valgrind reported memory leak:
8 bytes in 1 blocks are definitely lost in loss record 2 of 29
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x814826B: safe_malloc (safemalloc.c:47)
by 0x816413D: malloc_string (string.c:116)
by 0x81642B8: new_string (string.c:153)
by 0x80885D9: enter_helper (in_utils.c:656)
by 0x8089324: optionally_enter2 (in_utils.c:1115)
by 0x808E52B: limit (limit.c:110)


This patch is agaist Elm 2.4ME+ PL121c (25) --------------------------------
Index: elm2.4.ME+.121d-cvs/hdrs/patchlevel.h
Prereq: 1135000000
*** elm2.4.ME+.121c/hdrs/patchlevel.h 2005-02-07 20:37:29.000000000 +0200
--- elm2.4.ME+.121d-cvs/hdrs/patchlevel.h 2005-02-04 21:40:04.000000000 +0200
***************
*** 1,12 ****


! #define PATCHLEVEL "121c (25)"
/* Used by Configure:
SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1135000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Dec, 2004" /* for elm -v option */
#define WHAT_STRING \


! "@(#) Version 2.4(ME+), USENET supported version, released Dec, 2004"

/*
* Local Variables:

--- 1,12 ----
! #define PATCHLEVEL "121d (25)"


/* Used by Configure:
SHAREDTAG: .1.0.121
*/

! #define LAST_REPORT_TIME 1139000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Feb, 2005" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Feb, 2005"

/*
* Local Variables:
Index: elm2.4.ME+.121d-cvs/README.ME+
*** elm2.4.ME+.121c/README.ME+ 2005-02-07 20:37:29.000000000 +0200
--- elm2.4.ME+.121d-cvs/README.ME+ 2005-02-05 20:34:13.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.2 2004/12/27 16:10:26 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.14 2005/02/05 18:34:13 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,22 ****


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

Changes of Elm 2.4ME+ PL121c (25) compared with Elm 2.4ME+ PL121b (25)
----------------------------------------------------------------------

! - Fix incorrect drawing of "MIME structure Menu" when arrow
cursor was used.


Changes of Elm 2.4ME+ PL121b (25) compared with Elm 2.4ME+ PL121a (25)

--- 13,106 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+

+ Changes of Elm 2.4ME+ PL121d (25) compared with Elm 2.4ME+ PL121c (25)
+ ----------------------------------------------------------------------
+
+ - Fix "Reverse Thread" sorting order.
+
+ - Fix valgrind reported memory leak:
+ 24 bytes in 1 blocks are definitely lost in loss record 4 of 28
+ at 0x400260DC: malloc (vg_replace_malloc.c:153)
+ by 0x8147EF3: safe_malloc (safemalloc.c:47)
+ by 0x8068ACA: attach_menu (attach_menu.c:2253)
+ by 0x80784E5: mailbox_command (elm.c:808)
+ by 0x807920D: main (elm.c:1185)
+
+ - Add redraw handling to display_file()
+
+ - Fix valgrind reported memory leak:
+ 56 bytes in 5 blocks are definitely lost in loss record 9 of 28
+ at 0x400260DC: malloc (vg_replace_malloc.c:153)
+ by 0x8147F8F: safe_malloc (safemalloc.c:47)
+ by 0x80E9095: new_state_1 (charset_input.c:18)
+ by 0x80F9FFC: cs_add_streambyte_to_utf8 (cs_utf.c:348)
+
+ - Fix valgrind reported memory leak:
+ 16 bytes in 2 blocks are definitely lost in loss record 3 of 28
+ at 0x400260DC: malloc (vg_replace_malloc.c:153)
+ by 0x8147F8F: safe_malloc (safemalloc.c:47)
+ by 0x8163E41: malloc_string (string.c:116)
+ by 0x8163FBC: new_string (string.c:153)
+ by 0x80876EA: read_number (in_utils.c:282)
+
+ - Fix valgrind reported memory leak:
+ 30 bytes in 1 blocks are definitely lost in loss record 7 of 29
+ at 0x4002668F: realloc (vg_replace_malloc.c:310)
+ by 0x8148225: safe_realloc (safemalloc.c:63)
+ by 0x8133394: elm_vmessage (output.c:1281)
+ by 0x8133A5E: elm_message (output.c:1460)
+ by 0x80FD9DA: init_debug (debug.c:58)
+
+ - Fix valgrind reported memory leak:
+ 8 bytes in 1 blocks are definitely lost in loss record 1 of 31
+ at 0x400260DC: malloc (vg_replace_malloc.c:153)
+ by 0x8148173: safe_malloc (safemalloc.c:47)
+ by 0x8145BA9: split_remote_name (remote_mbx.c:620)
+ by 0x814ADA3: browser_folder_from_dummy (savefolder.c:1076)
+ - Fix valgrind reported memory leak:
+ 14 bytes in 1 blocks are definitely lost in loss record 3 of 31
+ at 0x400260DC: malloc (vg_replace_malloc.c:153)
+ by 0x8148349: safe_strdup (safemalloc.c:79)
+ by 0x8145B8E: split_remote_name (remote_mbx.c:618)
+ by 0x814ADA3: browser_folder_from_dummy (savefolder.c:1076)
+
+ - Fix valgrind reported memory leak:
+ 8 bytes in 1 blocks are definitely lost in loss record 1 of 30
+ at 0x400260DC: malloc (vg_replace_malloc.c:153)
+ by 0x8148237: safe_malloc (safemalloc.c:47)
+ by 0x8164109: malloc_string (string.c:116)
+ by 0x8164FDC: cat_strings (string.c:449)
+ by 0x81307E5: elm_smessage (output.c:857)
+ by 0x8087063: prompt_letter (in_utils.c:84)
+
+ - Fix valgrind reported memory leak:
+ 29 bytes in 5 blocks are definitely lost in loss record 7 of 30
+ at 0x400260DC: malloc (vg_replace_malloc.c:153)
+ by 0x8148243: safe_malloc (safemalloc.c:47)
+ by 0x8105414: rfc822_tokenize (getaddr.c:37)
+ by 0x8061333: do_expand_group_l (aliaslib.c:88)
+
+ - Fix valgrind reported memory leak:
+ 7104 bytes in 1 blocks are definitely lost in loss record 27 of 29
+ at 0x4002668F: realloc (vg_replace_malloc.c:310)
+ by 0x8148339: safe_realloc (safemalloc.c:63)
+ by 0x80BFA69: add_canceled_mail1 (canceled_mail.c:1291)
+
+ - Fix valgrind reported memory leak:
+ 8 bytes in 1 blocks are definitely lost in loss record 2 of 29
+ at 0x400260DC: malloc (vg_replace_malloc.c:153)
+ by 0x814826B: safe_malloc (safemalloc.c:47)
+ by 0x816413D: malloc_string (string.c:116)
+ by 0x81642B8: new_string (string.c:153)
+ by 0x80885D9: enter_helper (in_utils.c:656)
+ by 0x8089324: optionally_enter2 (in_utils.c:1115)
+ by 0x808E52B: limit (limit.c:110)


+
Changes of Elm 2.4ME+ PL121c (25) compared with Elm 2.4ME+ PL121b (25)

----------------------------------------------------------------------

! - Fix incorrect drawing of "MIME structure Menu" when arrow
cursor was used.


Changes of Elm 2.4ME+ PL121b (25) compared with Elm 2.4ME+ PL121a (25)

***************
*** 34,40 ****
Changes of Elm 2.4ME+ PL121a (25) compared with Elm 2.4ME+ PL121 (25)
---------------------------------------------------------------------

! - Fix error message


Path component "none" not absolute on key
"internal-mailcaps" value "none"
when on elmrc have line

--- 118,124 ----
Changes of Elm 2.4ME+ PL121a (25) compared with Elm 2.4ME+ PL121 (25)
---------------------------------------------------------------------

! - Fix error message


Path component "none" not absolute on key
"internal-mailcaps" value "none"
when on elmrc have line

Index: elm2.4.ME+.121d-cvs/doc/elm.1
*** elm2.4.ME+.121c/doc/elm.1 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.121d-cvs/doc/elm.1 2005-02-04 21:40:04.000000000 +0200
***************
*** 258,264 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

--- 258,264 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2005 by Kari Hurtta


.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

Index: elm2.4.ME+.121d-cvs/hdrs/elm.h
*** elm2.4.ME+.121c/hdrs/elm.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121d-cvs/hdrs/elm.h 2005-02-04 21:40:04.000000000 +0200
***************
*** 1,7 ****
! /* $Id: elm.h,v 1.23 2004/07/11 11:36:07 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: elm.h,v 1.23.18.1 2005/02/04 19:40:04 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.18.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 37,43 ****
static char copyright[] = {
"@(#) (C) Copyright 1986,1987, Dave Taylor\n\
@(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
! @(#) (C) Copyright 1996-2004, Kari Hurtta\n" };



/******** global variables accessable by all pieces of the program *******/

--- 37,43 ----
static char copyright[] = {
"@(#) (C) Copyright 1986,1987, Dave Taylor\n\
@(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
! @(#) (C) Copyright 1996-2005, Kari Hurtta\n" };



/******** global variables accessable by all pieces of the program *******/

Index: elm2.4.ME+.121d-cvs/hdrs/elmutil.h
*** elm2.4.ME+.121c/hdrs/elmutil.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.121d-cvs/hdrs/elmutil.h 2005-02-04 21:40:04.000000000 +0200
***************
*** 1,7 ****
! /* $Id: elmutil.h,v 1.13 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: elmutil.h,v 1.13.40.1 2005/02/04 19:40:04 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.40.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 34,40 ****
static char copyright[] = {
"@(#) (C) Copyright 1986,1987, Dave Taylor\n@(#)\n\
@(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
! @(#) (C) Copyright 1996-2003, Kari Hurtta\n" };



/******** global variables accessable by all pieces of the program *******/

--- 34,40 ----
static char copyright[] = {
"@(#) (C) Copyright 1986,1987, Dave Taylor\n@(#)\n\
@(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
! @(#) (C) Copyright 1996-2005, Kari Hurtta\n" };



/******** global variables accessable by all pieces of the program *******/

Index: elm2.4.ME+.121d-cvs/hdrs/mbx_imp.h
*** elm2.4.ME+.121c/hdrs/mbx_imp.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.121d-cvs/hdrs/mbx_imp.h 2005-02-05 17:01:30.000000000 +0200
***************
*** 1,7 ****
! /* $Id: mbx_imp.h,v 1.67 2004/04/24 12:30:02 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! /* $Id: mbx_imp.h,v 1.67.30.2 2005/02/05 15:01:30 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67.30.2 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 212,217 ****
--- 212,218 ----
POP_not_logged } pop_states;

struct remote_account {
+ unsigned short magic; /* REMOTE_ACCOUNT_magic */
SOCKADDR hostaddr;

struct streamsched *stream;
Index: elm2.4.ME+.121d-cvs/lib/debug.c
*** elm2.4.ME+.121c/lib/debug.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.121d-cvs/lib/debug.c 2005-02-05 11:37:26.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: debug.c,v 1.21 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: debug.c,v 1.21.40.1 2005/02/05 09:37:26 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21.40.1 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 87,93 ****
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenDebugFile,
"Could not open file %s for debug output!\n"),
filename);
! return;
}

if (-1 != A->debug_fd)
--- 87,94 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenDebugFile,
"Could not open file %s for debug output!\n"),
filename);
!
! goto out;
}

if (-1 != A->debug_fd)
***************
*** 104,110 ****
"Debug output of the ELM library. Version %s PL%s\n\n",
VERSION,PATCHLEVEL);

!
}

static void close_all(void);
--- 105,112 ----
"Debug output of the ELM library. Version %s PL%s\n\n",
VERSION,PATCHLEVEL);

! out:
! free(filename);
}

static void close_all(void);
Index: elm2.4.ME+.121d-cvs/lib/getaddr.c
*** elm2.4.ME+.121c/lib/getaddr.c 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.121d-cvs/lib/getaddr.c 2005-02-05 16:57:01.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.23 2004/08/24 13:06:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.23.6.1 2005/02/05 14:57:01 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.6.1 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 40,48 ****
DPRINT(Debug,25,(&Debug,
" : [%i]=\"%s\"\n",i,res[i]));
}
! res[count] = NULL;
DPRINT(Debug,25,(&Debug,
! " : [%i]=NULL\n",count));
return res;
}

--- 40,48 ----
DPRINT(Debug,25,(&Debug,
" : [%i]=\"%s\"\n",i,res[i]));
}
! res[i] = NULL;
DPRINT(Debug,25,(&Debug,
! " : [%i]=NULL\n",i));
return res;
}

Index: elm2.4.ME+.121d-cvs/lib/MAGIC
*** elm2.4.ME+.121c/lib/MAGIC 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121d-cvs/lib/MAGIC 2005-02-05 13:32:06.000000000 +0200
***************
*** 15,20 ****
--- 15,21 ----


#define LDSTATE_magic 0xF501
#define MAILBOXTYPE_magic 0xF502

#define SORTDATATYPE_magic 0xF503
+ #define REMOTE_ACCOUNT_magic 0xF504
#define ALIASVIEW_magic 0xF600
#define ALIASTYPE_magic 0xF601
#define MENU_COMMON_magic 0xF700
Index: elm2.4.ME+.121d-cvs/lib/remote_mbx.c
*** elm2.4.ME+.121c/lib/remote_mbx.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121d-cvs/lib/remote_mbx.c 2005-02-05 13:32:06.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.51 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.51.18.1 2005/02/05 11:32:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.18.1 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 177,188 ****
--- 177,192 ----
extern int errno;
#endif

+ #define REMOTE_ACCOUNT_magic 0xF504
+
void zero_remote_account(ra)
struct remote_account *ra;
{


/* bzero is defined hdrs/defs.h */

bzero ((void *)ra, sizeof (struct remote_account));

+ ra->magic = REMOTE_ACCOUNT_magic;
+
ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = 0;
ra->stream = NULL;


***************
*** 258,263 ****
--- 262,272 ----

void free_remote_account(ra)
struct remote_account *ra;
{
+ if (ra->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,
+ "free_remote_account",


+ "Bad magic number",0);
+

ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = -1;

***************
*** 397,402 ****
--- 406,416 ----

int idx;

+ if (ra->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,
+ "connect_remote_account",


+ "Bad magic number",0);
+

if(ra->stream) {
DPRINT(Debug,12,(&Debug,
"connect_remote_account: Closing for reopening\n"));
***************
*** 670,675 ****
--- 684,695 ----
* that file does not act as session lock ...
*/

+
+ if (X->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,
+ "set_remote_tempmbox",


+ "Bad magic number",0);
+

if (imap_folder)

elm_sfprintf(fh-> cur_tempfolder,
***************
*** 690,696 ****
fh-> cur_tempfolder));
}

! /* May free X (if succeed) or copy */
int make_remote_mbox(fh,X,se,rest,rewrite)
struct folder_info *fh;
struct remote_account *X;
--- 710,718 ----
fh-> cur_tempfolder));
}

! /* May free X (if succeed) or copy
! If make copy of X, then X is zeroed
! */
int make_remote_mbox(fh,X,se,rest,rewrite)
struct folder_info *fh;
struct remote_account *X;
***************
*** 704,709 ****
--- 726,736 ----
int got;
static struct connection_cache *CX;

+ if (X->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,
+ "make_remote_mbox",


+ "Bad magic number",0);
+

DPRINT(Debug,10,(&Debug,
"make_remote_mbox: fh=%X, rest=%s, rewrite=%d\n",
fh,rest ? rest : "<NULL>", rewrite));
***************
*** 764,770 ****
else
fh->p->a.imap_mbx.folder = safe_strdup(imap_only);

- free_remote_account(X);
} else {
PORTS ports[] = { PORT_imap4, PORT_pop3, PORT_end };
PORTS ports_imaponly[] = { PORT_imap4, PORT_end };
--- 791,796 ----
***************
*** 789,794 ****
--- 815,822 ----
fh->folder_type->init_it(fh);
free_remote_account(&(fh->p->a.pop_mbx.C));
fh->p->a.pop_mbx.C = *X;
+ zero_remote_account(X); /* Avoid double free */
+
status = &(fh->p->a.pop_mbx.C);

break;
***************
*** 845,850 ****
--- 873,880 ----

fail:

+ free_remote_account(X);
+
if (imap_only)
free(imap_only);

Index: elm2.4.ME+.121d-cvs/lib/savefolder.c
*** elm2.4.ME+.121c/lib/savefolder.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.121d-cvs/lib/savefolder.c 2005-02-05 13:32:07.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.77 2004/06/18 09:29:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.77 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.77.24.1 2005/02/05 11:32:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.77.24.1 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************
***************
*** 1075,1081 ****
*/
if (0 <= (code = split_remote_name(dir->a.dummy_browser.remote,
&X,&se,&rest,
! 0 /* Both POP adn IMAP are OK */
))) {

if (code == 0 || rest)
--- 1075,1081 ----
*/
if (0 <= (code = split_remote_name(dir->a.dummy_browser.remote,
&X,&se,&rest,
! 0 /* Both POP and IMAP are OK */
))) {

if (code == 0 || rest)
***************
*** 1091,1107 ****
new_string2(display_charset,
s2us(dir->a.dummy_browser.remote));

! /* May free X (if succeed) or copy */
if (!make_remote_mbox(res,&X,se,NULL,1)) {
- free_remote_account(&X);

res -> folder_type = NO_NAME;
res->folder_type->init_it(res);
}
free_temporary_service_entry(&se);
goto clean;
}
free_temporary_service_entry(&se);
}
#endif
lib_error(CATGETS(elm_msg_cat, MeSet, MeRemoteFolderNotAvail,
--- 1091,1111 ----
new_string2(display_charset,
s2us(dir->a.dummy_browser.remote));

! /* May free X (if succeed) or copy
! If make copy of X, then X is zeroed
! */
if (!make_remote_mbox(res,&X,se,NULL,1)) {

res -> folder_type = NO_NAME;
res->folder_type->init_it(res);
}
free_temporary_service_entry(&se);
+ free_remote_account(&X);
+
goto clean;
}
free_temporary_service_entry(&se);
+ free_remote_account(&X);
}
#endif
lib_error(CATGETS(elm_msg_cat, MeSet, MeRemoteFolderNotAvail,
Index: elm2.4.ME+.121d-cvs/lib/string.c
*** elm2.4.ME+.121c/lib/string.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.121d-cvs/lib/string.c 2005-02-05 00:25:30.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: string.c,v 1.39 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: string.c,v 1.39.30.1 2005/02/04 22:25:30 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39.30.1 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 218,223 ****
--- 218,227 ----

(*str)->string_type->charset_type->cs_free_it(*str);

+ if ((*str)->p->state) {
+ free_state_internal(&((*str)->p->state));
+ }
+
free((*str)->p);
(*str)->p = NULL;
(*str)->string_type = NULL;
Index: elm2.4.ME+.121d-cvs/src/aliaslib.c
*** elm2.4.ME+.121c/src/aliaslib.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.121d-cvs/src/aliaslib.c 2005-02-05 16:57:01.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: aliaslib.c,v 1.27 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: aliaslib.c,v 1.27.40.1 2005/02/05 14:57:01 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27.40.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 87,93 ****
{
char ** tokenized = rfc822_tokenize(group);
char **ptr, **next = NULL;
!
remove_space_tokenized(tokenized); /* removes spaces and comments */

for (ptr = tokenized; *ptr; ptr = next) {
--- 87,94 ----
{
char ** tokenized = rfc822_tokenize(group);
char **ptr, **next = NULL;
! int result = 0;
!
remove_space_tokenized(tokenized); /* removes spaces and comments */

for (ptr = tokenized; *ptr; ptr = next) {
***************
*** 113,121 ****
mailer_info, aview))
continue;

! if ( *too_longp )
! return FALSE;
!
/* verify it is a valid address */
if (mailer_info &&
verify_mailer_addr(mailer_info,name,
--- 114,124 ----
mailer_info, aview))
continue;

! if ( *too_longp ) {
! result = 0;
! goto fail;
! }
!
/* verify it is a valid address */
if (mailer_info &&
verify_mailer_addr(mailer_info,name,
***************
*** 199,208 ****
next++;
}

if (tokenized)
! free(tokenized);

! return TRUE;
}


--- 202,214 ----
next++;
}

+ result = 1;
+ fail:
+
if (tokenized)
! free_rfc822tokenized(tokenized);

! return result;
}


Index: elm2.4.ME+.121d-cvs/src/args.c
*** elm2.4.ME+.121c/src/args.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121d-cvs/src/args.c 2005-02-04 21:40:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: args.c,v 1.63 2004/07/10 08:08:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.63 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.63.20.1 2005/02/04 19:40:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.63.20.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 297,303 ****
printf("\n\tBased on Elm 2.4 PL24 - PL25\n\n");

if (i < 3) {
! printf("\t(C) Copyright 1996-2004 Kari Hurtta\n");
printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");
printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}
--- 297,303 ----
printf("\n\tBased on Elm 2.4 PL24 - PL25\n\n");

if (i < 3) {
! printf("\t(C) Copyright 1996-2005 Kari Hurtta\n");
printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");
printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}
Index: elm2.4.ME+.121d-cvs/src/attach_menu.c
*** elm2.4.ME+.121c/src/attach_menu.c 2005-02-07 20:37:29.000000000 +0200
--- elm2.4.ME+.121d-cvs/src/attach_menu.c 2005-02-04 22:04:40.000000000 +0200
***************
*** 1,7 ****


! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.68.10.1 2004/12/26 17:22:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.68.10.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.68.10.2 2005/02/04 20:04:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.68.10.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 2613,2618 ****
--- 2613,2621 ----
}

OUT:
+ if (top_structure)
+ free_structure(&top_structure,&top_len);
+
erase_menu_context(&page);
return;
}
Index: elm2.4.ME+.121d-cvs/src/help.c
*** elm2.4.ME+.121c/src/help.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.121d-cvs/src/help.c 2005-02-04 22:11:34.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.22 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.22.10.1 2005/02/04 20:11:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.10.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 407,412 ****
--- 407,413 ----

struct menu_context *page = NULL;
int LINES, COLUMNS;
+ long oldpos = 0;

if (err) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmHelpCouldntOpenFile,
***************
*** 427,432 ****
--- 428,434 ----

page = new_menu_context();

+ redraw:
menu_ClearScreen(page);

menu_get_sizes(page,&LINES, &COLUMNS);
***************
*** 438,444 ****
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressSpaceToContinue,


"Press <space> to continue, 'q' to return."));
! X = menu_ReadCh(page,READCH_sig_char);

if(X == 'q' || X == 'Q' ||

X == TERMCH_interrupt_char) {
clear_error();
--- 440,446 ----
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressSpaceToContinue,
"Press <space> to continue, 'q' to return."));
! X = menu_ReadCh(page,READCH_sig_char|REDRAW_MARK);


if(X == 'q' || X == 'Q' ||

X == TERMCH_interrupt_char) {
clear_error();
***************
*** 446,453 ****
--- 448,463 ----

goto OUT;
}
+
+ if (REDRAW_MARK == X) {
+ fseek(fileptr,oldpos,SEEK_SET);
+ lines = 0;


+ goto redraw;
+ }
+

lines = 0;
menu_ClearScreen(page);
+ oldpos = ftell(fileptr);


Write_to_screen(FRM("%s\r"), buffer);
}

else
***************
*** 460,467 ****
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressAnyKeyToReturn,
"Press any key to return."));

! (void) menu_ReadCh(page,0);
clear_error();

fclose(fileptr);
--- 470,484 ----
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressAnyKeyToReturn,
"Press any key to return."));
+ {
+ int X = menu_ReadCh(page,REDRAW_MARK);
+ if (X == REDRAW_MARK) {
+ fseek(fileptr,oldpos,SEEK_SET);
+ lines = 0;
+ goto redraw;
+ }

! }
clear_error();

fclose(fileptr);
Index: elm2.4.ME+.121d-cvs/src/in_utils.c
*** elm2.4.ME+.121c/src/in_utils.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.121d-cvs/src/in_utils.c 2005-02-05 13:45:16.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.41 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.41.10.2 2005/02/05 11:45:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41.10.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 171,176 ****
--- 171,178 ----

out:
FlushBuffer();
+ free_string(&question);
+


if (EOF != ch && REDRAW_MARK != ch && ('L'&31) != ch &&

TERMCH_interrupt_char != ch) {
***************
*** 285,290 ****
--- 287,293 ----


int num, status;
int bad;
int LINES, COLUMNS;

+
fill_ascii_to_string(buff,1,ch);

redraw:
***************
*** 310,327 ****
if (need_redraw)
menu_trigger_redraw(page);

! if (0 == string_len(buff))


return current;

num = string_to_long(buff,&bad);



if (bad >= 0)
return current;

-
-
-
return(num);
}

--- 313,330 ----
if (need_redraw)
menu_trigger_redraw(page);

! if (0 == string_len(buff)) {
! free_string(&buff);
return current;
+ }

num = string_to_long(buff,&bad);


+ free_string(&buff);



if (bad >= 0)
return current;
return(num);
}

Index: elm2.4.ME+.121d-cvs/src/limit.c
*** elm2.4.ME+.121c/src/limit.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.121d-cvs/src/limit.c 2005-02-05 20:34:13.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: limit.c,v 1.34 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: limit.c,v 1.34.10.1 2005/02/05 18:34:13 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34.10.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 280,289 ****
--- 280,295 ----
current = visible_to_index(1,menu)+1;
mcommon_set_current(menu,current);
}
+
+ if (criteria)
+ free_string(& criteria);

menu_trigger_redraw(page);
return;
} else {
+
+ if (criteria)
+ free_string(& criteria);
return;
}
}
Index: elm2.4.ME+.121d-cvs/src/messages/canceled_mail.c
*** elm2.4.ME+.121c/src/messages/canceled_mail.c 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.121d-cvs/src/messages/canceled_mail.c 2005-02-05 17:16:30.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.9 2004/08/28 09:26:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.9.6.1 2005/02/05 15:16:30 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.6.1 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/
***************

*** 111,116 ****
--- 111,118 ----



header_clear ( & ( mbx->u.canceldir->message_list[i].REC) );
}

+ free(mbx->u.canceldir->message_list);


+ mbx->u.canceldir->message_list = NULL;
}

mbx->u.canceldir->message_list_len = 0;

Index: elm2.4.ME+.121d-cvs/src/sort.c
*** elm2.4.ME+.121c/src/sort.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.121d-cvs/src/sort.c 2005-02-04 21:35:52.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: sort.c,v 1.22 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: sort.c,v 1.22.40.1 2005/02/04 19:35:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.40.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 109,121 ****
/* Don't get last_index if no entries or no current. */
/* There would be no current if we are sorting a new mail file. */

- /* FIXME: last_index does not work when there is mor ethan one storage...
- * (in other words several mails with same index)
- */

if (entries > 0 && current > 0) {
give_index_number(mailbox,current-1, &last_index);
-
}

if (entries > 30 && visible)
--- 109,117 ----
***************
*** 168,174 ****

for (i=entries-2; i >= 0; i--) {
struct header_rec * hdr0 = hdr; /* 'previous' header */
! if (subject_compare_1(hdr,hdr0)==0) {

if (hdr->time_sent > hdr0->time_sent +
(long) sort_thread_max_time * 24 * 60 * 60 ||
--- 164,173 ----

for (i=entries-2; i >= 0; i--) {
struct header_rec * hdr0 = hdr; /* 'previous' header */
!
! hdr = give_header(mailbox,i);
!
! if (subject_compare_1(hdr,hdr0)==0) {

if (hdr->time_sent > hdr0->time_sent +
(long) sort_thread_max_time * 24 * 60 * 60 ||

Kari E. Hurtta

unread,
Mar 2, 2005, 1:40:34 PM3/2/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL121e

Elm 2.4ME+ PL121e (25)

- Is be available on ftp.elmme-mailer.org (or ftp.kapsi.fi)


via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

file elm-2.4ME+PL121e.patch.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+PL121e.patch.gz >
via WWW.

- Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

file elm-2.4ME+PL121e.patch.gz
for a moment.

- Is available with
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL121e.patch.gz >
via WWW (3).

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL121e.patch.gz >
via WWW (1)

- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL121e.patch.gz >
via WWW.

- Will be (4) available on ftp.funet.fi (or ftp.ipv6.funet.fi)


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL121e.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL121e.patch.gz >
via WWW.


NOTES:
(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire. Actually
ozone.fmi.fi was scheduled to retire one year ago...

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)
are now on site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.

(4) Is submitted to pub/unix/incoming/ on ftp.funet.fi
( http://www.nic.funet.fi/pub/unix/incoming/elm-2.4ME+/ )


Changes of Elm 2.4ME+ PL121e (25) compared with Elm 2.4ME+ PL121d (25)
----------------------------------------------------------------------

- Set close-on-exec flag for opened local mailbox.

- Fix "Append to mail folder " -question.

- "I am seeing two exit messages if I start elm and exit right away
using ELM 2.4ME+ PL121"
Problem noted by: Bruce Momjian <ro...@candle.pha.pa.us>
- "On a Solaris 8 machine, if I enter ELM and don't make
any changes it now says "Folder unchanged." twice.
Not a big deal, but I thought I should report it. :-)"
Problem noted by: James Corey <plov...@yahoo.com>
> Make sure that first message is erased on exit (often
ti/te erases screen or changes buffers, but that
problem apply to "elm -t" also.)

- Fix case whare ascii only mail was sent with headers
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=ISO-8859-1
instead of
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

- Added mlterm to terminal.info without charset UTF-8.
To actually use that terminal defination you need also
doc/term/mlterm.ti from mlterm distribution. Install it
with 'tic' command. Then you need start start mlterm with
'mlterm -y mlterm' option, otherwise mlterm sets $TERM to
xterm.
- Seems that mlterm do not handle return to ISO 2022 code
( ESC % @ ) or switch to UTF-8 code ( ESC % G ) ?
- Also Elm ME+ do not handle double wide UTF-8 characters
- Fixed case where switch to UTF-8 code ( ESC % G )
was given on several times. However after ESC % G
only ESC % @ is valid.

- Now ConfTool/GenCharmap adds mapping from ConfTool/mapfiles
to bin/elm.mimecharsets even when elm.mimecharsets have
already alias defination for charset.


This patch is agaist Elm 2.4ME+ PL121d (25) --------------------------------
Index: elm2.4.ME+.121e-cvs/hdrs/patchlevel.h
Prereq: 1139000000
*** elm2.4.ME+.121d/hdrs/patchlevel.h 2005-02-28 22:11:17.000000000 +0200
--- elm2.4.ME+.121e-cvs/hdrs/patchlevel.h 2005-02-28 21:04:19.000000000 +0200
***************
*** 1,12 ****


! #define PATCHLEVEL "121d (25)"
/* Used by Configure:
SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1139000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "Feb, 2005" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Feb, 2005"

/*
* Local Variables:
--- 1,12 ----

! #define PATCHLEVEL "121e (25)"


/* Used by Configure:
SHAREDTAG: .1.0.121
*/

! #define LAST_REPORT_TIME 1141000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Mar, 2005" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Mar, 2005"

/*
* Local Variables:
Index: elm2.4.ME+.121e-cvs/README.ME+
*** elm2.4.ME+.121d/README.ME+ 2005-02-28 22:11:17.000000000 +0200
--- elm2.4.ME+.121e-cvs/README.ME+ 2005-02-28 21:04:18.000000000 +0200
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.14 2005/02/05 18:34:13 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.23 2005/02/28 19:04:18 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************

*** 13,18 ****
--- 13,59 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL121e (25) compared with Elm 2.4ME+ PL121d (25)
+ ----------------------------------------------------------------------
+
+ - Set close-on-exec flag for opened local mailbox.
+
+ - Fix "Append to mail folder " -question.
+
+ - "I am seeing two exit messages if I start elm and exit right away
+ using ELM 2.4ME+ PL121"
+ Problem noted by: Bruce Momjian <ro...@candle.pha.pa.us>
+ - "On a Solaris 8 machine, if I enter ELM and don't make
+ any changes it now says "Folder unchanged." twice.
+ Not a big deal, but I thought I should report it. :-)"
+ Problem noted by: James Corey <plov...@yahoo.com>
+ > Make sure that first message is erased on exit (often
+ ti/te erases screen or changes buffers, but that
+ problem apply to "elm -t" also.)
+
+ - Fix case whare ascii only mail was sent with headers
+ Content-Transfer-Encoding: 7bit
+ Content-Type: text/plain; charset=ISO-8859-1
+ instead of
+ Content-Transfer-Encoding: 7bit
+ Content-Type: text/plain; charset=US-ASCII
+
+ - Added mlterm to terminal.info without charset UTF-8.
+ To actually use that terminal defination you need also
+ doc/term/mlterm.ti from mlterm distribution. Install it
+ with 'tic' command. Then you need start start mlterm with
+ 'mlterm -y mlterm' option, otherwise mlterm sets $TERM to
+ xterm.
+ - Seems that mlterm do not handle return to ISO 2022 code
+ ( ESC % @ ) or switch to UTF-8 code ( ESC % G ) ?
+ - Also Elm ME+ do not handle double wide UTF-8 characters
+ - Fixed case where switch to UTF-8 code ( ESC % G )
+ was given on several times. However after ESC % G
+ only ESC % @ is valid.
+
+ - Now ConfTool/GenCharmap adds mapping from ConfTool/mapfiles
+ to bin/elm.mimecharsets even when elm.mimecharsets have
+ already alias defination for charset.


Changes of Elm 2.4ME+ PL121d (25) compared with Elm 2.4ME+ PL121c (25)
----------------------------------------------------------------------

***************
*** 58,64 ****


by 0x8148173: safe_malloc (safemalloc.c:47)
by 0x8145BA9: split_remote_name (remote_mbx.c:620)
by 0x814ADA3: browser_folder_from_dummy (savefolder.c:1076)

! - Fix valgrind reported memory leak:

14 bytes in 1 blocks are definitely lost in loss record 3 of 31
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x8148349: safe_strdup (safemalloc.c:79)

--- 99,105 ----


by 0x8148173: safe_malloc (safemalloc.c:47)
by 0x8145BA9: split_remote_name (remote_mbx.c:620)
by 0x814ADA3: browser_folder_from_dummy (savefolder.c:1076)

! - Fix valgrind reported memory leak:

14 bytes in 1 blocks are definitely lost in loss record 3 of 31
at 0x400260DC: malloc (vg_replace_malloc.c:153)
by 0x8148349: safe_strdup (safemalloc.c:79)

Index: elm2.4.ME+.121e-cvs/ConfTool/GenCharmap
*** elm2.4.ME+.121d/ConfTool/GenCharmap 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.121e-cvs/ConfTool/GenCharmap 2005-02-27 22:08:35.000000000 +0200
***************
*** 1,4 ****
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenCharmap,v 1.17 2003/08/26 17:07:29 hurtta Exp $

is_validcharset=
if (CC="$cc"; export CC; cd ConfTool; $make validcharset); then
--- 1,4 ----
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenCharmap,v 1.17.78.1 2005/02/27 20:08:35 hurtta Exp $

is_validcharset=
if (CC="$cc"; export CC; cd ConfTool; $make validcharset); then
***************
*** 52,58 ****
-f charset/MAPPINGS/$file -o \
-f charset/MAPPINGS/MICSFT/$file ; then
eval "$printit"
! if $egrep "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add map=$file"
else
echo "- $set$rest;map=$file" >> bin/elm.mimecharsets
--- 52,62 ----
-f charset/MAPPINGS/$file -o \
-f charset/MAPPINGS/MICSFT/$file ; then
eval "$printit"
! if $egrep "^-.*$set;alias=[^;]+\$" bin/elm.mimecharsets > /dev/null; then
! $echo " Charset $set alias already set"
! echo "- $set$rest;map=$file" >> bin/elm.mimecharsets
! echo " Adding map=$file for $set"
! elif $egrep "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add map=$file"
else
echo "- $set$rest;map=$file" >> bin/elm.mimecharsets
Index: elm2.4.ME+.121e-cvs/doc/terminal.info
*** elm2.4.ME+.121d/doc/terminal.info 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121e-cvs/doc/terminal.info 2005-02-27 18:52:21.000000000 +0200
***************
*** 78,80 ****
--- 78,120 ----
# Only same are listed than on /etc/profile.d/lang.sh
linux PRIVATE ISO-8859-2 [ $SYSFONTACM="iso02" ] 1/11 2/8 4/11 0/15
linux PRIVATE ISO-8859-15 [ $SYSFONTACM="iso15" ] 1/11 2/8 4/11 0/15
+
+ # To use mlterm terminal, you need doc/term/mlterm.ti from mlterm
+ # distribution. Install it with 'tic' command.
+ # Also you need start mlterm with 'mlterm -y mlterm' option,
+ # otherwise mlterm sets $TERM to xterm
+ #
+ mlterm ISO-2022 US-ASCII
+ mlterm ISO-2022 ISO-8859-1
+ mlterm ISO-2022 ISO-8859-2
+ mlterm ISO-2022 ISO-8859-3
+ mlterm ISO-2022 ISO-8859-4
+ mlterm ISO-2022 ISO-8859-5
+ mlterm ISO-2022 ISO-8859-6
+ mlterm ISO-2022 ISO-8859-7
+ mlterm ISO-2022 ISO-8859-8
+ mlterm ISO-2022 ISO-8859-9
+ mlterm ISO-2022 ISO-8859-10
+ mlterm ISO-2022 ISO-8859-11
+ mlterm ISO-2022 ISO-8859-13
+ mlterm ISO-2022 ISO-8859-14
+ mlterm ISO-2022 ISO-8859-15
+ mlterm ISO-2022 ISO-8859-16
+ mlterm ISO-2022/DW EUC-JP
+ # EUCJISX0213
+ mlterm ISO-2022/DW ISO-2022-JP
+ mlterm ISO-2022/DW ISO-2022-JP-2
+ # ISO2022JP3
+ mlterm ISO-2022/DW EUC-KR
+ mlterm ISO-2022/DW ISO-2022-KR
+ # EUCTW
+ # EUCCN = GB2312
+ mlterm ISO-2022/DW GB2312
+ mlterm ISO-2022/DW ISO-2022-CN
+ #
+ # UTF-8 on mlterm may be double wide?
+ #
+ # Following do not work on mlterm
+ ### mlterm ISO-2022 UTF-8
+ #
+ mlterm FLAG xterm-title
Index: elm2.4.ME+.121e-cvs/lib/charset.c
*** elm2.4.ME+.121d/lib/charset.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.121e-cvs/lib/charset.c 2005-02-27 10:03:23.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: charset.c,v 1.76 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: charset.c,v 1.76.40.1 2005/02/27 08:03:23 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.40.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
***************
*** 1397,1408 ****
int charset_ok_p(ptr)
charset_t ptr;
{
charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);

if (!ascii_ptr)
panic("CHARSET PANIC",__FILE__,__LINE__,"charset_ok_p",
"US-ASCII not found",0);
! return charset_superset_of(ptr,ascii_ptr);
}

struct locale_map_item * load_locale_map(filename,errors)
--- 1397,1431 ----
int charset_ok_p(ptr)
charset_t ptr;
{
+ int r;
charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);

if (!ascii_ptr)
panic("CHARSET PANIC",__FILE__,__LINE__,"charset_ok_p",
"US-ASCII not found",0);
! r = charset_superset_of(ptr,ascii_ptr);
!
! if (r && &cs_ascii != ptr->charset_type) {
! DPRINT(Debug,6,(&Debug,
! "charset_ok_p: charset %p (%s) is superset of ascii %p (%s) but is not type cs_ascii (type = %p)\n",
! ptr,
! ptr->MIME_name ? ptr->MIME_name :"<no MIME name>",
! ascii_ptr,
! ascii_ptr->MIME_name ? ascii_ptr->MIME_name :"<no MIME name>",
! ptr->charset_type));
! }
!
! if (!r && &cs_ascii == ptr->charset_type) { /* Hack !! */
! DPRINT(Debug,6,(&Debug,
! "charset_ok_p: charset %p (%s) is not superset of ascii %p (%s) but is type cs_ascii (type = %p), returning OK\n",
! ptr,
! ptr->MIME_name ? ptr->MIME_name :"<no MIME name>",
! ascii_ptr,
! ascii_ptr->MIME_name ? ascii_ptr->MIME_name :"<no MIME name>"));
! r = 1;
! }
!
! return r;
}

struct locale_map_item * load_locale_map(filename,errors)
Index: elm2.4.ME+.121e-cvs/lib/localmbx.c
*** elm2.4.ME+.121d/lib/localmbx.c 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121e-cvs/lib/localmbx.c 2005-02-15 21:11:17.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.67 2004/09/13 08:00:18 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.67.6.1 2005/02/15 19:11:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67.6.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 2415,2420 ****
--- 2415,2447 ----
return status;
}

+ static void set_closeonexec_folder P_((struct folder_info *folder));
+ static void set_closeonexec_folder(folder)
+ struct folder_info *folder;
+ {
+ int r;
+
+ #ifdef FD_CLOEXEC
+ r = fcntl(fileno(folder -> p->fh_folder), F_SETFD, FD_CLOEXEC);
+ #else
+ r = fcntl(fileno(folder -> p->fh_folder), F_SETFD, 1);
+ #endif
+
+ if (-1 == r) {


+ int err = errno;
+

+ DPRINT(Debug,1,(&Debug,
+ "Failed to set close-on-exec flag for %s: %s\n",
+ folder->cur_folder_sys,
+ error_description(err)));
+ } else {
+ DPRINT(Debug,11,(&Debug,
+ "Set close-on-exec flag for %s\n",
+ folder->cur_folder_sys));
+ }
+ }
+
+
static int mbx_sessionlock_non_spool P_((struct folder_info *folder,
enum sessionlock_mode mode));

***************
*** 2458,2463 ****
--- 2485,2491 ----
DPRINT(Debug,10,(&Debug,
"Mailfile (folder) opened: %s\n",
folder->cur_folder_sys));
+ set_closeonexec_folder(folder);
} else
rewind(folder->p->fh_folder);

***************
*** 2541,2546 ****
--- 2569,2576 ----
"Mailfile (folder) opened: %s %s\n",
folder->cur_folder_sys,
folder->p->fh_folder ? "" : " (non existant)"));
+ if (folder->p->fh_folder)
+ set_closeonexec_folder(folder);
} else {
rewind(folder->p->fh_folder);
}
Index: elm2.4.ME+.121e-cvs/lib/syscall.c
*** elm2.4.ME+.121d/lib/syscall.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121e-cvs/lib/syscall.c 2005-02-15 21:11:17.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.13 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.13.18.1 2005/02/15 19:11:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.18.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 602,610 ****
raw_exit(rs);
return 0;
}
fcntl(pfd[0], F_SETFD, 1);
fcntl(pfd[1], F_SETFD, 1);
!
rs->pid = fork();

if (rs->pid == -1) {
--- 602,616 ----
raw_exit(rs);
return 0;
}
+
+ #ifdef FD_CLOEXEC
+ fcntl(pfd[0], F_SETFD, FD_CLOEXEC);
+ fcntl(pfd[1], F_SETFD, FD_CLOEXEC);
+ #else
fcntl(pfd[0], F_SETFD, 1);
fcntl(pfd[1], F_SETFD, 1);
! #endif
!
rs->pid = fork();

if (rs->pid == -1) {
Index: elm2.4.ME+.121e-cvs/lib/terminal.c
*** elm2.4.ME+.121d/lib/terminal.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.121e-cvs/lib/terminal.c 2005-02-28 19:10:58.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.40 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: terminal.c,v 1.40.40.3 2005/02/28 17:10:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40.40.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 953,959 ****
return terminal_bad_flag;
}

!

/* Hopefully quite safe to be called from signal handler */
static struct terminal_map_item * loc_info P_((const char *terminal,
--- 953,981 ----
return terminal_bad_flag;
}

! static int match_charset P_((charset_t cs1, charset_t cs2));
! static int match_charset(cs1,cs2)
! charset_t cs1;
! charset_t cs2;
! {
!
! if (cs1 == cs2)
! return 1;
!
! if (!cs1 || !cs2)
! return 0;
!
! if (cs1->MIME_name && cs2->MIME_name &&
! 0 == istrcmp(cs1->MIME_name,cs2->MIME_name)) {
!
! SIGDPRINT(Debug,9,(&Debug,
! "** Matched charset by name %s (%p) == %s (%p)\n",
! cs1->MIME_name,cs1,
! cs2->MIME_name,cs2));
! return 1;


! }
! return 0;
! }

/* Hopefully quite safe to be called from signal handler */
static struct terminal_map_item * loc_info P_((const char *terminal,
***************
*** 984,990 ****
0 == strncmp(ptr->match,terminal,c - ptr->match))) {

if (ptr->keyword == terminal_iso2022 &&
! ptr->value.iso2022.charset == set) {
SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 match %s\n",
ptr->match));

--- 1006,1012 ----
0 == strncmp(ptr->match,terminal,c - ptr->match))) {

if (ptr->keyword == terminal_iso2022 &&
! match_charset(ptr->value.iso2022.charset,set)) {
SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 match %s\n",
ptr->match));

***************
*** 992,998 ****
}

if (ptr->keyword == terminal_iso2022_mb &&
! ptr->value.iso2022.charset == set) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 MB match %s\n",
ptr->match));
--- 1014,1020 ----
}

if (ptr->keyword == terminal_iso2022_mb &&
! match_charset(ptr->value.iso2022.charset,set)) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 MB match %s\n",
ptr->match));
***************
*** 1001,1007 ****
}

if (ptr->keyword == terminal_iso2022_like &&
! ptr->value.iso2022_like.charset == set) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022-LIKE match %s\n",
ptr->match));
--- 1023,1029 ----
}

if (ptr->keyword == terminal_iso2022_like &&
! match_charset(ptr->value.iso2022_like.charset,set)) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022-LIKE match %s\n",
ptr->match));
***************
*** 1010,1016 ****
}

if (ptr->keyword == terminal_private &&
! ptr->value.private.charset == set) {
if (ptr->value.private.condition) {
if (!eval_condition(ptr->value.private.condition)) {
goto no_this;
--- 1032,1038 ----
}

if (ptr->keyword == terminal_private &&
! match_charset(ptr->value.private.charset, set)) {
if (ptr->value.private.condition) {
if (!eval_condition(ptr->value.private.condition)) {
goto no_this;
***************
*** 1554,1559 ****
--- 1576,1607 ----
LAST_COMPLAIN = NULL;
LAST_COMPLAIN_b = NULL;

+ if (terminal_info->set_count > 0 &&
+ terminal_info->sets[0].type == iso2022_other) {
+
+ if (same_setid(terminal_info->sets[0],
+ *(iso2022_info->sets[0]))) {
+
+ DPRINT(Debug,8,(&Debug,
+ "terminal_charset_post_init: Terminal was on no ISO2022 mode ... NO change\n"));


+
+ return NULL;
+

+ } else {
+
+ char *c;
+
+ DPRINT(Debug,8,(&Debug,
+ "terminal_charset_post_init: Terminal was on no ISO2022 mode ... returning to ISO2022\n"));
+
+ c = iso2022_setid_stream(return_to_iso2022,NULL,0);
+ ret = strmcat(ret,c);
+ free(c);
+
+ reset_display_settings(terminal_info);
+ }
+ }
+
/* Remove assignments which does not belong to iso2022_info */
for (k = 0; k < 4; k++) {
if (terminal_info->bank[k] >= max) {
***************
*** 1565,1570 ****
--- 1613,1620 ----
}
}

+
+
if (bank_unspecified != iso2022_info->initial_L &&
terminal_info->current_L != iso2022_info->initial_L) {
char *c = lock_shift(0,terminal_info->current_L,NULL,0);
Index: elm2.4.ME+.121e-cvs/src/file.c
*** elm2.4.ME+.121d/src/file.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.121e-cvs/src/file.c 2005-02-15 21:51:09.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file.c,v 1.38 2004/07/26 12:41:46 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file.c,v 1.38.10.1 2005/02/15 19:51:09 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.10.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 241,247 ****
else
msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
ElmConfirmFolderAppend,
! "Append to mail folder `%s'? (%c/%c) "),
buffer,
*def_ans_yes,
*def_ans_no);
--- 241,247 ----
else
msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
ElmConfirmFolderAppend,
! "Append to mail folder `%S'? (%c/%c) "),
buffer,
*def_ans_yes,
*def_ans_no);
Index: elm2.4.ME+.121e-cvs/src/utils.c
*** elm2.4.ME+.121d/src/utils.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.121e-cvs/src/utils.c 2005-02-26 23:16:20.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: utils.c,v 1.34 2004/07/24 19:50:46 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: utils.c,v 1.34.12.1 2005/02/26 21:16:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34.12.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 95,107 ****
ClearScreen();
Raw(OFF|RAW_FROM_SIGNAL);
} else {


- int LINES, COLUMNS;
-

- menu_get_sizes(default_context, &LINES, &COLUMNS);
-
-
- MoveCursor(LINES-1,0);
- NewLine();

Raw_OFF(0);
}
--- 95,100 ----

Kari E. Hurtta

unread,
Mar 29, 2005, 10:46:41 AM3/29/05
to @elmme-mailer.org Archive
Archive-name: elm2.4ME+/PL121f

Elm 2.4ME+ PL121f (25)

- Is be available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

file elm-2.4ME+PL121f.patch.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+PL121f.patch.gz >
via WWW.

- Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

file elm-2.4ME+PL121f.patch.gz
for a moment.

- Is available with
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL121f.patch.gz >
via WWW (3).

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL121f.patch.gz >
via WWW (1)

- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL121f.patch.gz >
via WWW.

- Is available on ftp.funet.fi (or ftp.ipv6.funet.fi)


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL121f.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL121f.patch.gz >
via WWW.


NOTES:
(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire. Actually
ozone.fmi.fi was scheduled to retire one year ago...

Finnish Meteorological Institute will move in September 2005 to
new house. These machines ozone2.fmi.fi (www.ozone.fmi.fi)
and ozone.fmi.fi (ftp.ozone.fmi.fi) are most likely not moved...

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)
are now on site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.


Changes of Elm 2.4ME+ PL121f (25) compared with Elm 2.4ME+ PL121e (25)
----------------------------------------------------------------------

- Fix another "Append to mail folder " -question.

- Configure was incorrectly made conlusion that
nl_langinfo(CODESET)
do not work on IRIX 6.5

- If given folder name 'aaa@bbb@ccc' for split_remote_name(),
do not split is as user='aaa', host='bbb@ccc', but use
user='aaa@bbb', host='ccc'
Problem noted by: admin <ad...@unixdemon.com>

- Remove duplicates from bin/elm.mimecharsets
during Configure
- Compare charset names in case insensitive way on
ConfTool/GenCharmap


This patch is agaist Elm 2.4ME+ PL121d (25) --------------------------------

Index: elm2.4.ME+.121f-cvs/hdrs/patchlevel.h
Prereq: 1141000000
*** elm2.4.ME+.121e/hdrs/patchlevel.h 2005-03-28 09:59:48.000000000 +0300
--- elm2.4.ME+.121f-cvs/hdrs/patchlevel.h 2005-03-28 09:08:59.000000000 +0300
***************
*** 1,8 ****


! #define PATCHLEVEL "121e (25)"
/* Used by Configure:
SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1141000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Mar, 2005" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "121f (25)"


/* Used by Configure:
SHAREDTAG: .1.0.121
*/

! #define LAST_REPORT_TIME 1143000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Mar, 2005" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.121f-cvs/README.ME+
*** elm2.4.ME+.121e/README.ME+ 2005-03-28 09:59:48.000000000 +0300
--- elm2.4.ME+.121f-cvs/README.ME+ 2005-03-28 11:11:33.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.23 2005/02/28 19:04:18 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.29 2005/03/28 08:11:33 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,37 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL121f (25) compared with Elm 2.4ME+ PL121e (25)
+ ----------------------------------------------------------------------
+
+ - Fix another "Append to mail folder " -question.
+
+ - Configure was incorrectly made conlusion that
+ nl_langinfo(CODESET)
+ do not work on IRIX 6.5
+
+ - If given folder name 'aaa@bbb@ccc' for split_remote_name(),
+ do not split is as user='aaa', host='bbb@ccc', but use
+ user='aaa@bbb', host='ccc'
+ Problem noted by: admin <ad...@unixdemon.com>
+
+ - Remove duplicates from bin/elm.mimecharsets
+ during Configure
+ - Compare charset names in case insensitive way on
+ ConfTool/GenCharmap


+
Changes of Elm 2.4ME+ PL121e (25) compared with Elm 2.4ME+ PL121d (25)

----------------------------------------------------------------------

Index: elm2.4.ME+.121f-cvs/Configure
*** elm2.4.ME+.121e/Configure 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121f-cvs/Configure 2005-03-27 21:25:02.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.161 2004/09/23 18:47:19 hurtta Exp $


#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.161.6.1 2005/03/27 18:25:02 hurtta Exp $
#

: sanity checks
***************
*** 3747,3753 ****

EOF

! if $cc $ccflags -o try_langinfo try_langinfo.c $A $libs > try.log 2>&1 &&
./try_langinfo > result_charset 2> try2.log
then
cs="`cat result_charset`"
--- 3747,3753 ----

EOF

! if $cc $ccflags -o try_langinfo try_langinfo.c $libs > try.log 2>&1 &&
./try_langinfo > result_charset 2> try2.log
then
cs="`cat result_charset`"
Index: elm2.4.ME+.121f-cvs/ConfTool/GenCharmap
*** elm2.4.ME+.121e/ConfTool/GenCharmap 2005-03-28 09:59:48.000000000 +0300
--- elm2.4.ME+.121f-cvs/ConfTool/GenCharmap 2005-03-28 11:04:56.000000000 +0300
***************
*** 1,17 ****


! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenCharmap,v 1.17.78.1 2005/02/27 20:08:35 hurtta Exp $

! is_validcharset=
! if (CC="$cc"; export CC; cd ConfTool; $make validcharset); then
! is_validcharset=y
! $echo "ConfTool/validcharset compiled"
! else
! $echo "Failed to generate ConfTool/validcharset ..."
! $echo "bin/elm.mimecharsets will be incorrent or incomplete"
! sleep 20
! is_validcharset=n
! fi
!
! if $test $new = y ; then
cat >bin/elm.mimecharsets <<'EOM'
# Mapping from LC_CTYPE locale to MIME's charset values
# Format is:
--- 1,6 ----
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenCharmap,v 1.17.78.2 2005/03/28 08:04:56 hurtta Exp $

! write_header() {
cat >bin/elm.mimecharsets <<'EOM'
# Mapping from LC_CTYPE locale to MIME's charset values
# Format is:
***************
*** 31,45 ****
# - charset;type=xxx;MIME-subset=some-subset-name
# - charset;alias=alias-name
EOM
else
printit='$echo "* Removing obsolete names from bin/elm.mimecharsets"; printit='
while read killset ; do

! if $egrep "^[^;]+$killset(;|\$)" bin/elm.mimecharsets > /dev/null;
then
eval "$printit"
$echo " Removing $killset"
! $egrep -v "^[^;]+$killset(;|\$)" bin/elm.mimecharsets > tmp-$$
mv -f tmp-$$ bin/elm.mimecharsets
fi
done < ConfTool/killsets
--- 20,64 ----
# - charset;type=xxx;MIME-subset=some-subset-name
# - charset;alias=alias-name
EOM
+ }
+
+ is_validcharset=
+ if (CC="$cc"; export CC; cd ConfTool; $make validcharset); then
+ is_validcharset=y
+ $echo "ConfTool/validcharset compiled"
else
+ $echo "Failed to generate ConfTool/validcharset ..."
+ $echo "bin/elm.mimecharsets will be incorrent or incomplete"
+ sleep 20
+ is_validcharset=n
+ fi
+
+ if $test $new = y ; then
+ write_header
+ else
+
+ $fgrep -v '#' bin/elm.mimecharsets | $sort > tmp-$$-body
+ $uniq tmp-$$-body > tmp-$$-uniq
+ if cmp -s tmp-$$-uniq tmp-$$-body
+ then
+ rm tmp-$$-uniq tmp-$$-body
+ else
+ $echo "* Removing duplicate names from bin/elm.mimecharsets"
+
+ write_header
+ cat tmp-$$-uniq >> bin/elm.mimecharsets
+
+ rm tmp-$$-uniq tmp-$$-body
+ fi
+
printit='$echo "* Removing obsolete names from bin/elm.mimecharsets"; printit='
while read killset ; do

! if $egrep -i "^[^;]+$killset(;|\$)" bin/elm.mimecharsets > /dev/null;
then
eval "$printit"
$echo " Removing $killset"
! $egrep -i -v "^[^;]+$killset(;|\$)" bin/elm.mimecharsets > tmp-$$
mv -f tmp-$$ bin/elm.mimecharsets
fi
done < ConfTool/killsets
***************
*** 52,62 ****


-f charset/MAPPINGS/$file -o \
-f charset/MAPPINGS/MICSFT/$file ; then
eval "$printit"

! if $egrep "^-.*$set;alias=[^;]+\$" bin/elm.mimecharsets > /dev/null; then

$echo " Charset $set alias already set"

echo "- $set$rest;map=$file" >> bin/elm.mimecharsets

echo " Adding map=$file for $set"
! elif $egrep "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add map=$file"
else
echo "- $set$rest;map=$file" >> bin/elm.mimecharsets

--- 71,81 ----


-f charset/MAPPINGS/$file -o \
-f charset/MAPPINGS/MICSFT/$file ; then
eval "$printit"

! if $egrep -i "^-.*$set;alias=[^;]+\$" bin/elm.mimecharsets > /dev/null; then


$echo " Charset $set alias already set"

echo "- $set$rest;map=$file" >> bin/elm.mimecharsets

echo " Adding map=$file for $set"

! elif $egrep -i "^-.*$set;" bin/elm.mimecharsets > /dev/null; then


$echo " Charset $set already set, will not add map=$file"
else
echo "- $set$rest;map=$file" >> bin/elm.mimecharsets

***************
*** 69,75 ****
printit='$echo "* Adding iso646 definations from ConfTool/iso646maps"; printit='
while read set map ; do


eval "$printit"
! if $egrep "^-.*$set;" bin/elm.mimecharsets > /dev/null; then

$echo " Charset $set already set, will not add \"$map\""
else
echo "- $set;MIME-subset=INVARIANT;type=iso646-set;map=\"$map\"" >> bin/elm.mimecharsets
--- 88,94 ----
printit='$echo "* Adding iso646 definations from ConfTool/iso646maps"; printit='
while read set map ; do
eval "$printit"
! if $egrep -i "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add \"$map\""
else
echo "- $set;MIME-subset=INVARIANT;type=iso646-set;map=\"$map\"" >> bin/elm.mimecharsets
***************
*** 85,91 ****
case "$loc" in
"-")


eval "$printit"
! if $egrep "^-.*$set;" bin/elm.mimecharsets > /dev/null; then

$echo " Charset $set already set, will not add $rest"
else
echo "- $set;$rest" >> bin/elm.mimecharsets
--- 104,110 ----
case "$loc" in
"-")
eval "$printit"
! if $egrep -i "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add $rest"
else
echo "- $set;$rest" >> bin/elm.mimecharsets
***************
*** 100,106 ****
case "$loc" in
"-")
eval "$printit"
! if $egrep "^-.*$set;.*alias=" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add $rest"
else
echo "- $set;$rest" >> bin/elm.mimecharsets
--- 119,125 ----
case "$loc" in
"-")
eval "$printit"
! if $egrep -i "^-.*$set;.*alias=" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add $rest"
else
echo "- $set;$rest" >> bin/elm.mimecharsets
Index: elm2.4.ME+.121f-cvs/lib/remote_mbx.c
*** elm2.4.ME+.121e/lib/remote_mbx.c 2005-02-28 22:11:17.000000000 +0200
--- elm2.4.ME+.121f-cvs/lib/remote_mbx.c 2005-03-27 23:00:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.51.18.1 2005/02/05 11:32:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.18.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.51.18.2 2005/03/27 20:00:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.18.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 614,619 ****
--- 614,621 ----
sep = strchr(name,'@');

if (sep && (!*rest || *rest > sep)) {
+ char * sep2;
+
if (sep == name || sep[1] == '\0' ||
*rest == sep+1) {
lib_error(CATGETS(elm_msg_cat, MeSet,MeBadRemoteMailbox,
***************
*** 622,627 ****
--- 624,639 ----
ret = -1;
goto clean;
}
+
+ /* Test for '@' on hostname -- if there is, then
+ assume that first '@' was on username
+ */
+ sep2 = strchr(sep+1,'@');
+ if (sep2 && (!*rest || *rest > sep2+1)) {
+ DPRINT(Debug,12,(&Debug,
+ "split_remote_name: Found second '@' from hostname, Assuming that first '@' was on username\n"));
+ sep = sep2;
+ }

if (*rest) {
CONST char * START = sep+1;
Index: elm2.4.ME+.121f-cvs/src/savecopy.c
*** elm2.4.ME+.121e/src/savecopy.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.121f-cvs/src/savecopy.c 2005-03-25 22:23:14.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.46 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.46.22.1 2005/03/25 20:23:14 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46.22.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 286,292 ****


else
msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
ElmConfirmFolderAppend,
! "Append to mail folder `%s'? (%c/%c) "),

cf->copy_file,
*def_ans_yes, *def_ans_no);

--- 286,292 ----


else
msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
ElmConfirmFolderAppend,
! "Append to mail folder `%S'? (%c/%c) "),

cf->copy_file,
*def_ans_yes, *def_ans_no);

Kari E. Hurtta

unread,
Apr 20, 2005, 12:27:01 PM4/20/05
to @elmme-mailer.org Archive
Archive-name: elm2.4ME+/PL121g

Elm 2.4ME+ PL121g (25)

- Is be available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

file elm-2.4ME+PL121g.patch.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+PL121g.patch.gz >
via WWW.

- Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

file elm-2.4ME+PL121g.patch.gz
for a moment.

- Is available with
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL121g.patch.gz >
via WWW (3).

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL121g.patch.gz >
via WWW (1)

- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL121g.patch.gz >
via WWW.

- Is available on ftp.funet.fi (or ftp.ipv6.funet.fi)
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL121g.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL121g.patch.gz >
via WWW.


NOTES:
(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire. Actually
ozone.fmi.fi was scheduled to retire one year ago...

Finnish Meteorological Institute will move in September 2005 to
new house. These machines ozone2.fmi.fi (www.ozone.fmi.fi)
and ozone.fmi.fi (ftp.ozone.fmi.fi) are most likely not moved...

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)
are now on site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.


Changes of Elm 2.4ME+ PL121g (25) compared with Elm 2.4ME+ PL121f (25)
----------------------------------------------------------------------

- get_type_flags() was called with NULL-pointer
argument from start_body_helper() line 381.
Problem noted by: Vesa-Matti J Kari <vesa-ma...@helsinki.fi>
> Return something 'intelligent' (instead of
crashing) in functions of lib/mediatype.c,
if them is called with NULL argument.

- Do not give NULL pointer for
Content-Type: *unknown*/MIXED
In other words do not return NULL pointer
if give_media_type() is asked to create
major media type '*unknown*' ('*unknown*'
matched MIME_TYPE_UNKNOWN signaling unknown
media type.)

- Fixed Makefile error on
make package ROOT=/tmp/test-install
case

- Sorting orders 'mailbox order' and
'reverse mailbox order' was giving same order.
Fixed reverse sorting order.
- Little change for sorting.

- Ignore command letter 'm' on elm.filelist
(used on Elm 2.4ME+ PL122).


This patch is agaist Elm 2.4ME+ PL121f (25) --------------------------------
Index: elm2.4.ME+.121g-cvs/hdrs/patchlevel.h
Prereq: 1143000000
*** elm2.4.ME+.121f/hdrs/patchlevel.h 2005-04-19 19:38:28.000000000 +0300
--- elm2.4.ME+.121g-cvs/hdrs/patchlevel.h 2005-04-19 19:27:00.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "121f (25)"
/* Used by Configure:
SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1143000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Mar, 2005" /* for elm -v option */
#define WHAT_STRING \


! "@(#) Version 2.4(ME+), USENET supported version, released Mar, 2005"

/*
* Local Variables:

--- 1,12 ----
! #define PATCHLEVEL "121g (25)"


/* Used by Configure:
SHAREDTAG: .1.0.121
*/

! #define LAST_REPORT_TIME 1145000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Apr, 2005" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Apr, 2005"

/*
* Local Variables:
Index: elm2.4.ME+.121g-cvs/README.ME+
*** elm2.4.ME+.121f/README.ME+ 2005-04-19 19:38:28.000000000 +0300
--- elm2.4.ME+.121g-cvs/README.ME+ 2005-04-19 19:27:55.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.29 2005/03/28 08:11:33 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.36 2005/04/19 16:27:55 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,49 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL121g (25) compared with Elm 2.4ME+ PL121f (25)
+ ----------------------------------------------------------------------
+
+ - get_type_flags() was called with NULL-pointer
+ argument from start_body_helper() line 381.
+ Problem noted by: Vesa-Matti J Kari <vesa-ma...@helsinki.fi>
+ > Return something 'intelligent' (instead of
+ crashing) in functions of lib/mediatype.c,
+ if them is called with NULL argument.
+
+ - Do not give NULL pointer for
+ Content-Type: *unknown*/MIXED
+ In other words do not return NULL pointer
+ if give_media_type() is asked to create
+ major media type '*unknown*' ('*unknown*'
+ matched MIME_TYPE_UNKNOWN signaling unknown
+ media type.)
+
+ - Fixed Makefile error on
+ make package ROOT=/tmp/test-install
+ case
+
+ - Sorting orders 'mailbox order' and
+ 'reverse mailbox order' was giving same order.
+ Fixed reverse sorting order.
+ - Little change for sorting.
+
+ - Ignore command letter 'm' on elm.filelist
+ (used on Elm 2.4ME+ PL122).
+

+
Changes of Elm 2.4ME+ PL121f (25) compared with Elm 2.4ME+ PL121e (25)

----------------------------------------------------------------------

Index: elm2.4.ME+.121g-cvs/lib/Makefile.SH
*** elm2.4.ME+.121f/lib/Makefile.SH 2004-12-11 12:33:32.000000000 +0200
--- elm2.4.ME+.121g-cvs/lib/Makefile.SH 2005-04-13 21:36:44.000000000 +0300
***************
*** 46,52 ****


echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.92 2004/11/02 19:44:39 hurtta Exp $


#
# Makefile for the ELM mail program.
#

--- 46,52 ----


echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.92.4.1 2005/04/13 18:36:44 hurtta Exp $


#
# Makefile for the ELM mail program.
#

***************
*** 116,122 ****

cat >>Makefile <<SUBSTITUTE
SHLIST = ../shlib/libelmme-base.so
! INSTLIB = $shlib/libelmme-base.so$d_shared_rev
SONAME = ${soname_opt}${A}libelmme-base.so$d_shared_rev
SHLIB = $shlib
SUBSTITUTE
--- 116,122 ----

cat >>Makefile <<SUBSTITUTE
SHLIST = ../shlib/libelmme-base.so
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-base.so$d_shared_rev
SONAME = ${soname_opt}${A}libelmme-base.so$d_shared_rev
SHLIB = $shlib
SUBSTITUTE
Index: elm2.4.ME+.121g-cvs/lib/mediatype.c
*** elm2.4.ME+.121f/lib/mediatype.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121g-cvs/lib/mediatype.c 2005-04-09 09:33:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.14 2004/07/19 19:39:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.14.14.2 2005/04/09 06:33:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.14.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 109,114 ****
--- 109,117 ----
enum mime_major_type get_major_type_code(T)
media_type_t T;
{
+ if (!T)
+ return MIME_TYPE_UNKNOWN;
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_major_type_code",
"Bad magic number",0);
***************
*** 124,129 ****
--- 127,135 ----
CONST char * get_major_type_name(T)
media_type_t T;
{
+ if (!T)
+ return "?unknown?";
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_major_type_name",
"Bad magic number",0);
***************
*** 152,157 ****
--- 158,167 ----
media_type_t T;
{
int ret;
+
+ if (!T)
+ return 0;
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_type_flags",
"Bad magic number",0);
***************
*** 175,184 ****
--- 185,200 ----
CONST char * get_subtype_name(T)
media_type_t T;
{
+
+ if (!T)
+ return "?unknown?";
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_subtype_name",
"Bad magic number",0);

+ if (! T->subtype)
+ return "?unknown?";

return T->subtype;
}
***************
*** 236,242 ****

enum mime_major_type I1 = give_major_type(major,create);

! if (MIME_TYPE_UNKNOWN == I1)
return NULL;

return give_media_type2(I1,minor,create);
--- 252,258 ----

enum mime_major_type I1 = give_major_type(major,create);

! if (MIME_TYPE_UNKNOWN == I1 && !create)
return NULL;

return give_media_type2(I1,minor,create);
***************
*** 301,306 ****
--- 317,325 ----
int give_text_type_code(T)
media_type_t T;
{
+ if (!T)
+ return -1;
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"give_text_type_code",
"Bad magic number",0);
***************
*** 398,403 ****
--- 417,428 ----
int *is_default;
enum mt_handle_type kind;
{
+ if (!T) {
+ *H = NULL;


+ return 0;
+ }
+
+

if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"walk_mt_handler",
"Bad magic number",0);
***************
*** 426,432 ****
}
if (i >= T->handle_count) {
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"walk_mt_handler",
! "previous non defualt handler not found",0);
return 0; /* NOT REACHED */
}

--- 451,457 ----
}
if (i >= T->handle_count) {
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"walk_mt_handler",
! "previous non-default handler not found",0);
return 0; /* NOT REACHED */
}

Index: elm2.4.ME+.121g-cvs/shared_libs/iconv/Makefile.SH
*** elm2.4.ME+.121f/shared_libs/iconv/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121g-cvs/shared_libs/iconv/Makefile.SH 2005-04-13 21:36:44.000000000 +0300


***************
*** 17,23 ****
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.9 2004/09/05 08:17:07 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.9.6.1 2005/04/13 18:36:44 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 25,31 ****
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = $shlib/libelmme-iconv.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf
--- 25,31 ----
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-iconv.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf
Index: elm2.4.ME+.121g-cvs/shared_libs/smtp/Makefile.SH
*** elm2.4.ME+.121f/shared_libs/smtp/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121g-cvs/shared_libs/smtp/Makefile.SH 2005-04-13 21:36:44.000000000 +0300


***************
*** 17,23 ****
echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.13 2004/09/05 08:17:07 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.13.6.1 2005/04/13 18:36:44 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 25,31 ****
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = $shlib/libelmme-smtp.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf
--- 25,31 ----
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-smtp.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf
Index: elm2.4.ME+.121g-cvs/shared_libs/tls/Makefile.SH
*** elm2.4.ME+.121f/shared_libs/tls/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.121g-cvs/shared_libs/tls/Makefile.SH 2005-04-13 21:36:44.000000000 +0300


***************
*** 17,23 ****
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17 2004/09/05 08:17:07 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17.6.1 2005/04/13 18:36:44 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

*** 25,31 ****
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = $shlib/libelmme-tls.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf
--- 25,31 ----
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-tls.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf
Index: elm2.4.ME+.121g-cvs/src/sort.c
*** elm2.4.ME+.121f/src/sort.c 2005-02-28 22:11:17.000000000 +0200
--- elm2.4.ME+.121g-cvs/src/sort.c 2005-04-17 17:20:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: sort.c,v 1.22.40.1 2005/02/04 19:35:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.40.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: sort.c,v 1.22.40.3 2005/04/17 14:20:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.40.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 353,365 ****
struct sort_data *p1;
struct sort_data *p2;
{
struct header_rec *h1 = give_header_s(p1);
struct header_rec *h2 = give_header_s(p2);

switch (abs(sortby)) {
- int ret;
struct folder_view i1,i2;

case MAILBOX_ORDER:
give_index_number_s(p1,&i1);
give_index_number_s(p2,&i2);
--- 353,377 ----
struct sort_data *p1;
struct sort_data *p2;
{
+ int ret = 0;
struct header_rec *h1 = give_header_s(p1);
struct header_rec *h2 = give_header_s(p2);

switch (abs(sortby)) {
struct folder_view i1,i2;

+ default:
+ ret = compare_headers_1(h1,h2);
+
+ /* NOTE: compare_headers already reserves return for
+ reverse sorting orders
+ */
+
+
+ /* Is compare result is same, then use mailbox order */

+ if (0 != ret)

+ break;
+
case MAILBOX_ORDER:
give_index_number_s(p1,&i1);
give_index_number_s(p2,&i2);
***************
*** 367,377 ****
ret = i1.mailbox_number - i2.mailbox_number;
if (0 == ret)
ret = i1.index - i2.index;
- return ret;

! default:
! return compare_headers_1(h1,h2);
}
}


--- 379,394 ----
ret = i1.mailbox_number - i2.mailbox_number;
if (0 == ret)
ret = i1.index - i2.index;

! if (sortby < 0)
! ret = -ret;
!
! break;
!
}
+
+
+ return ret;
}


Index: elm2.4.ME+.121g-cvs/utils/elmregister.c
*** elm2.4.ME+.121f/utils/elmregister.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.121g-cvs/utils/elmregister.c 2005-04-17 17:20:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.19 2004/07/27 20:25:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.19.8.1 2005/04/17 14:20:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 18,23 ****
--- 18,25 ----
*
* filenames are relative to $ELM_ROOT
*
+ * -- module (not used)
+ * 'm' module {rest of line}
*
* -- copy file
*
***************
*** 320,325 ****
--- 322,338 ----
exit(1);
}

+ if ('m' == c) { /* Ignore command letter */
+ int i;
+
+ add_bytes(F,buffer1,&ptr); /* module */
+ i = ptr; add_bytes(F,buffer1,&ptr); /* command */
+ c = buffer1[i];


+
+ }
+
+
+

l->command_letter = c;

switch (c) {

Kari E. Hurtta

unread,
Jul 6, 2005, 3:06:57 PM7/6/05
to @elmme-mailer.org Archive
Archive-name: elm2.4ME+/PL121h

Elm 2.4ME+ PL121h (25)

- Is be available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

file elm-2.4ME+PL121h.patch.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+PL121h.patch.gz >
via WWW.

- Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

file elm-2.4ME+PL121h.patch.gz
for a moment.

- Is available with
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL121h.patch.gz >
via WWW (3).

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL121h.patch.gz >
via WWW (1)

- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL121h.patch.gz >
via WWW.

- Will be available on ftp.funet.fi (or ftp.ipv6.funet.fi) (4)


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+/

file elm-2.4ME+PL121h.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL121h.patch.gz >
via WWW.


NOTES:
(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire. Actually
ozone.fmi.fi was scheduled to retire one year ago...

Finnish Meteorological Institute will move in September 2005 to
new house. These machines ozone2.fmi.fi (www.ozone.fmi.fi)
and ozone.fmi.fi (ftp.ozone.fmi.fi) are most likely not moved...

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)
are now on site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.

(4) Is submitted to ftp.funet.fi, directory pub/unix/incoming/elm-2.4ME+/


Changes of Elm 2.4ME+ PL121h (25) compared with Elm 2.4ME+ PL121g (25)
----------------------------------------------------------------------

- On 21 lines window browser help (Folder selection)
was not fitting to screen.

- f)orget command on "Mail Pre-Send Screen" incorrectly
sent mail when editor buffer was empty and on mail
there was on attachment.

This patch is agaist Elm 2.4ME+ PL121g (25) --------------------------------
Index: elm2.4.ME+.121h-cvs/hdrs/patchlevel.h
Prereq: 1145000000
*** elm2.4.ME+.121g/hdrs/patchlevel.h 2005-07-05 09:52:16.000000000 +0300
--- elm2.4.ME+.121h-cvs/hdrs/patchlevel.h 2005-07-05 09:42:47.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "121g (25)"
/* Used by Configure:
SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1145000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "Apr, 2005" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Apr, 2005"

/*
* Local Variables:
--- 1,12 ----

! #define PATCHLEVEL "121h (25)"


/* Used by Configure:
SHAREDTAG: .1.0.121
*/

! #define LAST_REPORT_TIME 1150000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Jul, 2005" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jul, 2005"

/*
* Local Variables:
Index: elm2.4.ME+.121h-cvs/README.ME+
*** elm2.4.ME+.121g/README.ME+ 2005-07-05 09:52:16.000000000 +0300
--- elm2.4.ME+.121h-cvs/README.ME+ 2005-07-05 09:42:46.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.36 2005/04/19 16:27:55 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.849.4.39 2005/07/05 06:42:46 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,29 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+

+ Changes of Elm 2.4ME+ PL121h (25) compared with Elm 2.4ME+ PL121g (25)
+ ----------------------------------------------------------------------
+
+ - On 21 lines window browser help (Folder selection)
+ was not fitting to screen.
+
+ - f)orget command on "Mail Pre-Send Screen" incorrectly
+ sent mail when editor buffer was empty and on mail
+ there was on attachment.


+
Changes of Elm 2.4ME+ PL121g (25) compared with Elm 2.4ME+ PL121f (25)

----------------------------------------------------------------------

Index: elm2.4.ME+.121h-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.121g/nls/C/C/C/s_elm.m 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.121h-cvs/nls/C/C/C/s_elm.m 2005-05-11 07:06:38.000000000 +0300
***************
*** 321,327 ****
$ #NoMailToCheck
167 No mail to check.
$ #FileHelpmsg1
! 168 "\n\n\rYou must specify a file or folder to "
$quote
$ #FileHelpmsg2
169 to. Several options\n\rare available:\n\r\
--- 321,327 ----
$ #NoMailToCheck
167 No mail to check.
$ #FileHelpmsg1
! 168 "You must specify a file or folder to "
$quote
$ #FileHelpmsg2
169 to. Several options\n\rare available:\n\r\
Index: elm2.4.ME+.121h-cvs/src/browser.c
*** elm2.4.ME+.121g/src/browser.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.121h-cvs/src/browser.c 2005-05-11 07:06:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: browser.c,v 1.32 2004/07/11 17:44:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: browser.c,v 1.32.18.1 2005/05/11 04:06:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.18.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 23,28 ****
--- 23,30 ----

#define GB_FILL 4
#define GB_HELP 8
#define GB_SAVE_COPY 16
+ #define GB_HELP2 32
+
#define GB_FLAGS py
#define GB_PAGE counter
#define GB_LINE px
***************
*** 367,373 ****
free_string(&buffer);
}

! if (0 != (I->GB_FLAGS & GB_HELP)) {
MoveCursor(3,0); CleartoEOS();

if (0 != (GB_SAVE_COPY & I->GB_FLAGS)) {
--- 369,386 ----
free_string(&buffer);
}

! if (0 != (I->GB_FLAGS & GB_HELP2) &&
! 0 != (I->GB_FLAGS & GB_HELP)) {
!
! MoveCursor(3,0); CleartoEOS();
!
! browser_help();
!
! I->GB_FLAGS &= ~GB_HELP2;
!
! } else if (0 != (I->GB_FLAGS & GB_HELP)) {
! int line,col;
!
MoveCursor(3,0); CleartoEOS();

if (0 != (GB_SAVE_COPY & I->GB_FLAGS)) {
***************
*** 392,398 ****
));
} else {
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg1,
! "\n\r\n\rYou must specify a file or folder to "));


Write_to_screen(FRM("%S"),I->pvector[2]);
--- 405,411 ----
));
} else {
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg1,
! "You must specify a file or folder to "));


Write_to_screen(FRM("%S"),I->pvector[2]);
***************
*** 443,449 ****
}
}

! browser_help();
}

if (0 != (I->GB_FLAGS & GB_MENU)) {
--- 456,469 ----
}
}

! GetXYLocation(&line,&col);
!
! if (line < (LINES-3) - 4)
! browser_help();
! else
! I->GB_FLAGS |= GB_HELP2;
!
!
}

if (0 != (I->GB_FLAGS & GB_MENU)) {
Index: elm2.4.ME+.121h-cvs/src/mailmsg2.c
*** elm2.4.ME+.121g/src/mailmsg2.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.121h-cvs/src/mailmsg2.c 2005-07-04 22:07:30.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.96 2004/07/28 17:10:12 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.96 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.96.8.1 2005/07/04 19:07:30 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.96.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 987,992 ****
--- 987,998 ----
MIME_info.encode_hdr,
aview,
page);
+
+
+ DPRINT(Debug,8,(&Debug,
+ " ... virify_transmission result = %d, attachment_count=%d\n",
+ code,attachments.attachment_count));
+
/* Empty ... */


if (-2 == code && !attachments.attachment_count) {
goto fail_label;

***************
*** 1116,1121 ****
--- 1122,1134 ----
} else
MIME_info.msg_is_multipart = MIME_info.top_parts_count > 1;

+
+ DPRINT(Debug,8,(&Debug,
+ " ... top_parts_count=%d, msg_is_multipart=%d\n",
+ MIME_info.top_parts_count,
+ MIME_info.msg_is_multipart));
+
+

/* End of check_for_multipart failure loop */

} while (!batch_only && reask_verify);

***************
*** 1151,1158 ****
headers->sender));
}


! if (code == -1 /* Forget */ ||
! code < 0 && MIME_info.msg_is_multipart) {

struct MailboxView *cm = give_canceled_mail();

--- 1164,1170 ----
headers->sender));
}

! if (code < 0 /* Forget */) {



struct MailboxView *cm = give_canceled_mail();

***************
*** 1529,1534 ****
--- 1541,1547 ----
/*
* verify_transmission() - Ask the user to confirm transmission of the
* message. Returns 0 to send it, -1 to forget it.
+ * -2 to forget empty file
*/
static int verify_transmission(filename, form_p, need_redraw_p,
already_has_text, copy_file, force_cmd, options,

Kari E. Hurtta

unread,
Jul 13, 2005, 5:50:41 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.13

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 13/18
=========================================================================
*** elm2.4.ME+.121/src/limit.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/limit.c 2005-06-18 00:02:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: limit.c,v 1.34 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: limit.c,v 1.42 2005/06/17 21:02:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 35,43 ****
}


- char *shift_lower();
- void ClearSelection();
-
static int SelectTaggedMessages P_((struct menu_common *menu,
int *vector));
static int SelectTaggedMessages(menu, vector)
--- 35,40 ----
***************
*** 49,65 ****


for (iindex = 0; iindex < mc; iindex++) {
! if (mcommon_ison_status(menu,iindex, TAGGED)) {
vector[count++] = iindex;
}
}
return(count);


}


! void limit(menu, page)
struct menu_common *menu;
struct menu_context *page;
{

/** if we changed selection criteria = need redraw

use menu_trigger_redraw(page)
--- 46,80 ----


for (iindex = 0; iindex < mc; iindex++) {
! if (mcommon_ison_status(menu,iindex, status_basic,TAGGED)) {
vector[count++] = iindex;
}
}
return(count);
}

+ static int SelectFlaggedMessages P_((struct menu_common *menu,
+ int *vector));
+ static int SelectFlaggedMessages(menu, vector)
+ struct menu_common *menu;
+ int *vector;
+ {
+ int iindex, count = 0;
+ int mc = mcommon_get_count(menu);
+
+
+ for (iindex = 0; iindex < mc; iindex++) {
+ if (mcommon_ison_status(menu,iindex, status_1,S1_FLAGGED)) {
+ vector[count++] = iindex;
+ }
+ }
+ return(count);
+ }

! void limit(menu, page,LOC)


struct menu_common *menu;
struct menu_context *page;

+ struct screen_parts *LOC;
{


/** if we changed selection criteria = need redraw

use menu_trigger_redraw(page)
***************
*** 67,125 ****



int last_selected, all;
struct string *criteria = NULL;

! int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES, &COLUMNS);

last_selected = mcommon_get_selected(menu);

all = 0;

if (mcommon_get_selected(menu)) {
int c;
! PutLineX(LINES-3, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitAlreadyHave,
! "Already have selection criteria - add more? (%c/%c) %c%c"),
! *def_ans_yes, *def_ans_no, *def_ans_no, BACKSPACE);
! c = menu_ReadCh(page,0);
! if (
#ifdef ASCII_CTYPE
! isascii(c) &&
#endif
! tolower((unsigned char)c) == *def_ans_yes) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
! PutLineX(LINES-4, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitAdding,
! "Adding criteria..."));
} else {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
! PutLineX(LINES-4, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitChanging,
! "Change criteria..."));

mcommon_set_selected(menu,0);
}
}



while(1) {
/* CLear previous prompt */
! MoveCursor(LINES-3,0); CleartoEOLN();

! if (0 != optionally_enter2(page,
! &criteria,LINES-3,0,
! OE_ALLOW_MIMEENC|


! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLimitEnterCriteria,
! "Enter criteria or '?' for help: "))
! ) {

if (criteria)
free_string(& criteria);

! menu_trigger_redraw(page);
return;

}
--- 82,200 ----



int last_selected, all;
struct string *criteria = NULL;

! int li,co;
! int delay_redraw = 0;

+ menu_get_sizes(LOC->prompt_page,&li,&co);
+
last_selected = mcommon_get_selected(menu);

all = 0;

if (mcommon_get_selected(menu)) {
int c;
!
! redraw0:
! menu_PutLineX(LOC->prompt_page,
! 1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitAlreadyHave,
! "Already have selection criteria - add more? (%c/%c) %c%c"),
! *def_ans_yes, *def_ans_no, *def_ans_no, BACKSPACE);
! c = menu_ReadCh(LOC->prompt_page,REDRAW_MARK);
!
! if (REDRAW_MARK == c) {
! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/


!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */

! delay_redraw++;
! goto redraw0;
! }
!
! if (
#ifdef ASCII_CTYPE
! isascii(c) &&
#endif
! tolower((unsigned char)c) == *def_ans_yes) {
!
! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
!
! menu_PutLineX(LOC->prompt_page,
! 0, co-30,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitAdding,
! "Adding criteria..."));
} else {
! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
!
! menu_PutLineX(LOC->prompt_page,
! 0, co-30,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitChanging,
! "Change criteria..."));

mcommon_set_selected(menu,0);
+
+ menu_trigger_redraw(LOC->title_page);
+ menu_trigger_redraw(LOC->header_page);
}
}



while(1) {
+ int line;
+ int code;
+ int f = 0;
+
/* CLear previous prompt */
! menu_MoveCursor(LOC->prompt_page,1,0);
! menu_CleartoEOLN(LOC->prompt_page);
!
!
! redraw:
! /* FIXME --optionally_enter* should use prompt_area */
! line = menu_GetAbsLine(LOC->prompt_page,1);

! code = optionally_enter2(page,
! &criteria,line,0,
! OE_REDRAW_MARK|OE_ALLOW_MIMEENC|f|


! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLimitEnterCriteria,
! "Enter criteria or '?' for help: "));


! if (REDRAW_MARK == code) {

! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/


!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */

! delay_redraw++;
! goto redraw;
! }
!
! if (0 != code) {

if (criteria)
free_string(& criteria);

! menu_trigger_redraw(LOC->title_page);
! menu_trigger_redraw(LOC->header_page);
!
! if (delay_redraw)


! menu_trigger_redraw(page);
!
return;

}
***************

*** 134,140 ****
free_string(& criteria);

mcommon_set_selected(menu,last_selected);
!
return;
}

--- 209,225 ----
free_string(& criteria);

mcommon_set_selected(menu,last_selected);
! menu_trigger_redraw(LOC->title_page);
! menu_trigger_redraw(LOC->header_page);
!
! if (last_selected)
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmLimitReturnToLastSelection,
! "Returned to last selection."));
!
!
! if (delay_redraw)
! menu_trigger_redraw(page);
return;
}

***************
*** 143,149 ****

mcommon_set_selected(menu,0);
} else if (string_matches_ascii(criteria,s2us("?"))) {
! mcommon_limit_print_help(menu,last_selected);
continue;
} else {
int X = 0;
--- 228,234 ----

mcommon_set_selected(menu,0);
} else if (string_matches_ascii(criteria,s2us("?"))) {
! mcommon_limit_print_help(menu,last_selected);
continue;
} else {
int X = 0;
***************
*** 177,182 ****
--- 262,275 ----

selarr = safe_malloc(n * sizeof(selarr[0]));
reslen = SelectTaggedMessages(menu,selarr);
+ } else if (string_matches_ascii(part, s2us("flagged"))) {
+ int n = mcommon_get_count(menu);
+
+ if (n < 1)
+ goto fail;
+
+ selarr = safe_malloc(n * sizeof(selarr[0]));
+ reslen = SelectFlaggedMessages(menu,selarr);

} else
reslen = mcommon_limit_helper(menu,part,&selarr,
***************
*** 192,198 ****
c = mcommon_get_count(menu);

for (i = 0; i < c; i++)
! mcommon_clearf_status(menu,i,VISIBLE);
goto action_or;
}
goto action_and;
--- 285,291 ----
c = mcommon_get_count(menu);

for (i = 0; i < c; i++)
! mcommon_clearf_status(menu,i,status_basic,VISIBLE);
goto action_or;
}
goto action_and;
***************
*** 214,220 ****
}

if (!match)
! mcommon_clearf_status(menu,i,VISIBLE);
}

break;
--- 307,313 ----
}

if (!match)
! mcommon_clearf_status(menu,i,status_basic,VISIBLE);
}

break;
***************
*** 227,233 ****
for (i = 0; i < reslen; i++) {
int x = selarr[i];

! mcommon_setf_status(menu,x,VISIBLE);
}

break;
--- 320,326 ----
for (i = 0; i < reslen; i++) {
int x = selarr[i];

! mcommon_setf_status(menu,x,status_basic,VISIBLE);
}

break;
***************
*** 251,265 ****
c = mcommon_get_count(menu);

for (i = 0; i < c; i++)
! if (mcommon_ison_status(menu,i,VISIBLE))
count++;

mcommon_set_selected(menu,count);
}

if (all && last_selected)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmLimitReturnToUnlimited,
! "Returned to unlimited display."));
else {

mcommon_limit_print_result(menu);
--- 344,358 ----
c = mcommon_get_count(menu);

for (i = 0; i < c; i++)
! if (mcommon_ison_status(menu,i,status_basic,VISIBLE))
count++;

mcommon_set_selected(menu,count);
}

if (all && last_selected)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmLimitReturnToUnlimited,
! "Returned to unlimited display."));
else {

mcommon_limit_print_result(menu);
***************
*** 275,292 ****
int current = mcommon_get_current(menu);

if (mcommon_get_selected(menu) &&
! mcommon_isoff_status(menu,current-1,VISIBLE)) {

current = visible_to_index(1,menu)+1;
mcommon_set_current(menu,current);


}
!
! menu_trigger_redraw(page);
! return;

! } else {
! return;
! }
}
}


--- 368,395 ----
int current = mcommon_get_current(menu);

if (mcommon_get_selected(menu) &&
! mcommon_isoff_status(menu,current-1,status_basic,
! VISIBLE)) {

current = visible_to_index(1,menu)+1;
mcommon_set_current(menu,current);
+ copy_current(menu,LOC->header_page);
}
! get_page(menu, LOC->header_page);
!
! menu_trigger_redraw(LOC->title_page);
! menu_trigger_redraw(LOC->header_page);
! }
! break;
}
+
+ if (delay_redraw)
+ menu_trigger_redraw(page);
+ else
+ menu_trigger_redraw(LOC->prompt_page);


+
+ if (criteria)
+ free_string(& criteria);
}


***************
*** 313,320 ****

for(iindex++; iindex < mc; iindex++) {

! if ((mcommon_ison_status(menu,iindex,VISIBLE) || !selected)
! && (mcommon_isoff_status(menu,iindex,DELETED) || (!skipdel))) {
DPRINT(Debug,9,(&Debug,
"[Next%s%s: given %d returning %d]\n",
(skipdel ? " undeleted" : ""),
--- 416,425 ----

for(iindex++; iindex < mc; iindex++) {

! if ((mcommon_ison_status(menu,iindex,
! status_basic,VISIBLE) || !selected)
! && (mcommon_isoff_status(menu,iindex,
! status_basic,DELETED) || (!skipdel))) {
DPRINT(Debug,9,(&Debug,
"[Next%s%s: given %d returning %d]\n",
(skipdel ? " undeleted" : ""),
***************
*** 343,351 ****

for(iindex--; iindex >= 0; iindex--) {

! if ((mcommon_ison_status(menu,iindex,VISIBLE)
! || (!selected))
! && (mcommon_isoff_status(menu,iindex,DELETED) || (!skipdel))) {
DPRINT(Debug,4,(&Debug,
"[Previous%s%s: given %d returning %d]\n",
(skipdel ? " undeleted" : ""),
--- 448,457 ----

for(iindex--; iindex >= 0; iindex--) {

! if ((mcommon_ison_status(menu,iindex,
! status_basic,VISIBLE) || (!selected))
! && (mcommon_isoff_status(menu,iindex,
! status_basic,DELETED) || (!skipdel))) {
DPRINT(Debug,4,(&Debug,
"[Previous%s%s: given %d returning %d]\n",
(skipdel ? " undeleted" : ""),
***************
*** 381,387 ****
"[compute-visible: displayed message %d is actually %d]\n",
count, message));

! if (mcommon_ison_status(menu,iindex,VISIBLE))
count++;
}

--- 487,493 ----
"[compute-visible: displayed message %d is actually %d]\n",
count, message));

! if (mcommon_ison_status(menu,iindex,status_basic,VISIBLE))
count++;
}

***************
*** 406,412 ****

for (iindex = 0; iindex < mc; iindex++) {

! if (mcommon_ison_status(menu,iindex,VISIBLE))
count++;
if (count == message) {
DPRINT(Debug,4,(&Debug,
--- 512,518 ----

for (iindex = 0; iindex < mc; iindex++) {

! if (mcommon_ison_status(menu,iindex,status_basic,VISIBLE))
count++;
if (count == message) {
DPRINT(Debug,4,(&Debug,
***************
*** 418,424 ****

DPRINT(Debug,4,(&Debug, "index %d is NOT displayed!\n", message));

! return mc+1;
}

/*
--- 524,530 ----

DPRINT(Debug,4,(&Debug, "index %d is NOT displayed!\n", message));

! return mc+1;
}

/*
Index: elm2.4.ME+.122-cvs/src/lock.c
*** elm2.4.ME+.121/src/lock.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/lock.c 2005-06-18 00:02:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: lock.c,v 1.19 2004/07/24 19:50:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: lock.c,v 1.20 2005/06/17 21:02:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 31,41 ****
extern int errno;
#endif

- char *error_description();
-
- extern char *mk_lockname();
-
-
int lock(direction, folder)
int direction;
struct folder_info *folder;
--- 31,36 ----
Index: elm2.4.ME+.122-cvs/src/mailmsg1.c
*** elm2.4.ME+.121/src/mailmsg1.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/mailmsg1.c 2005-05-21 20:58:32.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.50 2004/07/30 11:24:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.64 2005/05/21 17:58:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 33,39 ****


cm_mimeforward, cm_CANCEL
} copy_the_msg P_((struct mailing_headers *headers,
int options,

! struct menu_context *page));

static CONST unsigned char * csUs P_((const char *str));
static CONST unsigned char * csUs(str)
--- 33,40 ----


cm_mimeforward, cm_CANCEL
} copy_the_msg P_((struct mailing_headers *headers,
int options,

! struct menu_context *page,
! struct menu_context *prompt_area));

static CONST unsigned char * csUs P_((const char *str));
static CONST unsigned char * csUs(str)
***************
*** 156,176 ****
free_string(&addr_string);
}


! int get_to(to,mailer_info,aview, page, cancel_view, cancel_selection)
struct expanded_address *to;
struct mailer_info *mailer_info;

struct AliasView *aview;
struct menu_context *page;

struct MailboxView *cancel_view;
int *cancel_selection;
{



struct string * buffer = NULL;

! int LINES, COLUMNS;


! int redraw = 0;

int can_flag = 0;

! menu_get_sizes(page,&LINES, &COLUMNS);

if (cancel_selection)
*cancel_selection = -1;
--- 157,179 ----
free_string(&addr_string);
}

! int get_to(to,mailer_info,aview, page, cancel_view, cancel_selection,
! prompt_area)


struct expanded_address *to;
struct mailer_info *mailer_info;

struct AliasView *aview;
struct menu_context *page;

struct MailboxView *cancel_view;
int *cancel_selection;
+ struct menu_context *prompt_area;
{



struct string * buffer = NULL;

! int li, co;
! int delay_redraw = 0;
int can_flag = 0;

! menu_get_sizes(prompt_area,&li, &co);

if (cancel_selection)
*cancel_selection = -1;
***************
*** 185,192 ****


if (to->surface_len == 0) {

int canceled_count = 0;
int flag = 0;
! int line = LINES-3;
int code;

if (cancel_view)
canceled_count = get_message_count(cancel_view);
--- 188,197 ----


if (to->surface_len == 0) {

int canceled_count = 0;
int flag = 0;
! int line;
!
int code;
+ int ul = give_dt_enumerate_as_int(&user_level);

if (cancel_view)
canceled_count = get_message_count(cancel_view);
***************
*** 195,221 ****
"canceled_count=%d\n",
canceled_count));



if (canceled_count > 1 && cancel_selection) {
! print_format_center(line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceledX,
! "%d canceled mails. Use / to select one of them."),
! canceled_count);

line++;
flag |= OE_ALT_SOLIDUS;


} else if (1 == canceled_count && cancel_selection) {
! print_format_center(line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceled1,
! "1 canceled mail. Use / to select it."));

line++;
flag |= OE_ALT_SOLIDUS;
}


! if (user_level < 2) {


code = optionally_enter2(page,
! &buffer, line, 0,

OE_REDRAW_MARK|flag|
OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
--- 200,236 ----
"canceled_count=%d\n",
canceled_count));

+ redraw:
+ line = 1;


if (canceled_count > 1 && cancel_selection) {

! menu_print_format_center(prompt_area,line,


! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceledX,
! "%d canceled mails. Use / to select one of them."),
! canceled_count);

line++;
flag |= OE_ALT_SOLIDUS;


} else if (1 == canceled_count && cancel_selection) {

! menu_print_format_center(prompt_area,line,


! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceled1,
! "1 canceled mail. Use / to select it."));

line++;
flag |= OE_ALT_SOLIDUS;
}

+ /* On redrawing / sould not go to cancel view */
+
+ if (delay_redraw && buffer && string_len(buffer) > 0)
+ flag = OE_APPEND_CURRENT;
+

! if (ul < 2) {
! /* FIXME --optionally_enter* should use prompt_area */
! int line1 = menu_GetAbsLine(prompt_area,line);
!
code = optionally_enter2(page,
! &buffer, line1, 0,
OE_REDRAW_MARK|flag|
OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
***************
*** 223,279 ****


"Send the message to: "));


! while (REDRAW_MARK == code) {
! menu_get_sizes(page,&LINES, &COLUMNS);

- code = optionally_enter2(page,
- &buffer, line, 0,
- OE_REDRAW_MARK|OE_APPEND_CURRENT|
- flag|OE_SIG_CHAR /* Ctrl-C */,
- CATGETS(elm_msg_cat, ElmSet,
- ElmSendTheMessageTo,
- "Send the message to: "));


/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
! redraw = 1;
}
! }
! else {


code = optionally_enter2(page,
! &buffer, line, 0,

OE_REDRAW_MARK|flag|
OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));

! while (code == REDRAW_MARK) {
! menu_get_sizes(page,&LINES, &COLUMNS);

! code = optionally_enter2(page,
! &buffer, line, 0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! flag|OE_SIG_CHAR /* Ctrl-C */,
! CATGETS(elm_msg_cat, ElmSet, ElmTo,
! "To: "));


/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!


*/
! redraw = 1;
}
}

if (OE_ALT_SOLIDUS == code) {
can_flag = view_canceled_mails(cancel_view,


cancel_selection,aview);
! redraw = 1;
}

if (0 != code || can_flag) {

if (-1 == code) { /* Ctrl-C */

! MoveCursor(LINES-3,0);
! CleartoEOLN();


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));
}

--- 238,303 ----


"Send the message to: "));


! if (REDRAW_MARK == code) {

! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/



/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
! delay_redraw++;
! goto redraw;
}
!
! } else {
! /* FIXME --optionally_enter* should use prompt_area */
! int line1 = menu_GetAbsLine(prompt_area,line);
!
code = optionally_enter2(page,
! &buffer, line1, 0,
OE_REDRAW_MARK|flag|
OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));

! if (code == REDRAW_MARK) {
! menu_ClearScreen(page); /* Clear possible redraw mark */

! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/


!
/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
! delay_redraw++;
! goto redraw;
}
}

if (OE_ALT_SOLIDUS == code) {
can_flag = view_canceled_mails(cancel_view,
cancel_selection,aview);
!
! menu_ClearScreen(page);
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/
!
! delay_redraw = 1;


}

if (0 != code || can_flag) {

if (-1 == code) { /* Ctrl-C */

! menu_ClearLine(prompt_area,1);
!

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));
}

***************
*** 281,287 ****
if (buffer)
free_string(&buffer);

! if (redraw)
menu_trigger_redraw(page);

if (can_flag > 0) {
--- 305,311 ----
if (buffer)
free_string(&buffer);

! if (delay_redraw)
menu_trigger_redraw(page);

if (can_flag > 0) {
***************
*** 294,304 ****



if (string_len(buffer) == 0) {
free_expanded_address(to);
! ClearLine(LINES-3);

free_string(&buffer);

! if (redraw)
menu_trigger_redraw(page);
return 0;
}
--- 318,329 ----



if (string_len(buffer) == 0) {
free_expanded_address(to);
!

! menu_ClearLine(prompt_area,1);

free_string(&buffer);

! if (delay_redraw)
menu_trigger_redraw(page);
return 0;
}
***************
*** 309,326 ****
build_address_l(to,mailer_info,aview);

if (to->addrs_len == 0) { /* bad address! Removed!! */
! ClearLine(LINES-3);

free_string(&buffer);

! if (redraw)
menu_trigger_redraw(page);
return 0;
}

free_string(&buffer);

! if (redraw)


menu_trigger_redraw(page);
return 1; /* everything is okay... */
}

--- 334,351 ----
build_address_l(to,mailer_info,aview);

if (to->addrs_len == 0) { /* bad address! Removed!! */
! menu_ClearLine(prompt_area,1);

free_string(&buffer);

! if (delay_redraw)
menu_trigger_redraw(page);
return 0;
}

free_string(&buffer);

! if (delay_redraw)


menu_trigger_redraw(page);
return 1; /* everything is okay... */
}
***************

*** 329,337 ****
int copy_message,
struct mailer_info *mailer_info,


struct AliasView *aview,
! struct menu_context *page));

static int get_subject P_((struct string **field,

! struct menu_context *page));

static void send_msg_middle P_((
int index,
--- 354,364 ----
int copy_message,
struct mailer_info *mailer_info,


struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));


static int get_subject P_((struct string **field,

! struct menu_context *page,
! struct menu_context *prompt_area));



static void send_msg_middle P_((
int index,

***************
*** 342,354 ****
struct mailer_info *mailer_info,


struct MailboxView *mailbox,
struct AliasView *aview,

! struct menu_context *page
! ));

static void send_msg_middle(index,
! given_to, given_cc, given_subject, options,
! form_letter,mailer_info,
! mailbox,aview, page)
int index;
struct expanded_address *given_to, *given_cc;
char *given_subject;
--- 369,381 ----
struct mailer_info *mailer_info,


struct MailboxView *mailbox,
struct AliasView *aview,

! struct menu_context *page,
! struct menu_context *prompt_area));

static void send_msg_middle(index,
! given_to, given_cc, given_subject, options,
! form_letter,mailer_info,
! mailbox,aview, page, prompt_area)
int index;
struct expanded_address *given_to, *given_cc;
char *given_subject;
***************
*** 357,362 ****
--- 384,390 ----


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NULL in patch mode */
{


enum copy_msg_mode copy_msg = cm_no_copy;
char *p;

***************
*** 367,377 ****


int forwarding = 0 != (options & MAIL_FORWARDING);

int replying = 0 != (options & MAIL_REPLYING);

-

- int LINES, COLUMNS;
-

- menu_get_sizes(page,&LINES, &COLUMNS);
-
zero_mailing_headers(&headers);

if (!mailer_info)
--- 395,400 ----
***************
*** 404,463 ****

free_string(&X);


}


! /* copy msg into edit buffer? */
! copy_msg = copy_the_msg(&headers,
! options, page);

! switch (copy_msg) {
! case cm_CANCEL:
! goto free_it;

! case cm_get_copy:
! options |= MAIL_COPY_MSG;
! break;
! case cm_mimeforward:
! options |= MAIL_MIME_ATTCH;
! options |= MAIL_COPY_MSG;
! break;
! default:
!
! if (!forwarding &&
! !replying)
! cancel_view = give_canceled_mail();

! break;
! }


! /* get the To: address and expand --
! */
! if (! get_to(&headers.to,mailer_info,aview, page,cancel_view,
! &cancel_selection)) {
! goto free_it;
! }

! if (cancel_selection >= 0) {
! struct header_rec * H = give_header(cancel_view,cancel_selection);

! if (H) {
! options |= MAIL_COPY_SELECTION | MAIL_DELETE_CANCEL;

! /* Copy some addresses from header struct
! *
! * Actually these addresses will be overwritten whan
! * canceled mail is readed and parsed
! */

! if (!headers.subject && H->subject)
! headers.subject = dup_string(H->subject);
!
! expanded_address_from_items (&headers.from, H->from);
! expanded_address_from_items (&headers.to, H->to);
! expanded_address_from_items (&headers.cc, H->cc);

- }
- }




/* expand the Cc: address */
if (&headers.cc.surface_len)

--- 427,504 ----

free_string(&X);
}
+
+ if (prompt_area) { /* Not a batch mode */
+
+ DPRINT(Debug,7,(&Debug,
+ "prompt_area=%p prompt questions -- not in batch mode\n",
+ prompt_area));

+ /* copy msg into edit buffer? */
+ copy_msg = copy_the_msg(&headers,
+ options, page, prompt_area);



! switch (copy_msg) {
! case cm_CANCEL:
! goto free_it;

! case cm_get_copy:
! options |= MAIL_COPY_MSG;
! break;
! case cm_mimeforward:
! options |= MAIL_MIME_ATTCH;
! options |= MAIL_COPY_MSG;
! break;
! default:
!
! if (!forwarding &&
! !replying)
! cancel_view = give_canceled_mail();
!

! DPRINT(Debug,7,(&Debug,"cancel_view=%p%s\n",
! cancel_view,
! cancel_view ? "" : " (NULL)"));

! break;
! }


! /* get the To: address and expand --
! */
! if (! get_to(&headers.to,mailer_info,aview, page,cancel_view,

! &cancel_selection,prompt_area)) {
! goto free_it;
! }


! if (cancel_selection >= 0) {
! struct header_rec * H = give_header(cancel_view,cancel_selection);

! if (H) {
! options |= MAIL_COPY_SELECTION | MAIL_DELETE_CANCEL;

! /* Copy some addresses from header struct
! *
! * Actually these addresses will be overwritten whan
! * canceled mail is readed and parsed
! */
!
! if (!headers.subject && H->subject)
! headers.subject = dup_string(H->subject);
!
! expanded_address_from_items (&headers.from, H->from);
! expanded_address_from_items (&headers.to, H->to);
! expanded_address_from_items (&headers.cc, H->cc);

!
! }
! }
!
! } else { /* batch mode */



! /* expand the Cc: address */

! if (&headers.to.surface_len)
! build_address_l(&headers.to,mailer_info,aview);


+ }



/* expand the Cc: address */
if (&headers.cc.surface_len)
***************

*** 491,499 ****


dump_expanded_address(4,"send_msg_middle -- from ",headers.from);

dump_expanded_address(4,"send_msg_middle -- to ",headers.to);

dump_expanded_address(4,"send_msg_middle -- cc ",headers.cc);

-

! if (batch_only ||
(options & MAIL_COPY_SELECTION)) {


--- 532,539 ----


dump_expanded_address(4,"send_msg_middle -- from ",headers.from);

dump_expanded_address(4,"send_msg_middle -- to ",headers.to);

dump_expanded_address(4,"send_msg_middle -- cc ",headers.cc);

! if (!prompt_area ||
(options & MAIL_COPY_SELECTION)) {


***************
*** 508,525 ****



/* get the Subject: field */

! if (get_subject(&headers.subject, page) == 0) {

goto free_it;
}

if (prompt_for_cc) {


if (get_copies(&headers.cc, copy_msg, mailer_info,
! aview, page) == 0) {

goto free_it;


}
}

! MoveCursor(LINES-1,0); /* so you know you've hit <return> ! */

FlushBuffer();

/** generate the In-Reply-To: header... **/

--- 548,567 ----



/* get the Subject: field */

! if (get_subject(&headers.subject, page,
! mail_only ? NULL : prompt_area) == 0) {
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, copy_msg, mailer_info,
! aview, page,
! mail_only ? NULL : prompt_area) == 0) {
goto free_it;
}
}

! menu_MoveCursor(prompt_area,3,0); /* so you know you've hit <return> ! */


FlushBuffer();

/** generate the In-Reply-To: header... **/

***************
*** 560,573 ****


free_mailing_headers(&headers);
!
return;
}

void send_msg_l(index,
! given_to, given_cc, given_subject, options, form_letter,
! mailbox, aview, page
! )
int index;
struct addr_item *given_to, *given_cc;
char *given_subject;
--- 602,618 ----


free_mailing_headers(&headers);
!
! if (prompt_area)
! menu_trigger_redraw(prompt_area);
!
return;
}

void send_msg_l(index,
! given_to, given_cc, given_subject, options, form_letter,
! mailbox, aview, page, prompt_area
! )
int index;
struct addr_item *given_to, *given_cc;
char *given_subject;
***************
*** 575,580 ****
--- 620,626 ----


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{


/* If redraw is needed use

menu_trigger_redraw(page)
***************
*** 592,600 ****
addr_to_expanded(&B,given_cc,mailer_info,aview);

send_msg_middle(index,&A,&B,
! given_subject,options,form_letter,
! mailer_info,
! mailbox, aview, page);

/* send_msg_middle does menu_trigger_redraw(page),


do not need examine */

--- 638,647 ----
addr_to_expanded(&B,given_cc,mailer_info,aview);

send_msg_middle(index,&A,&B,
! given_subject,options,form_letter,


! mailer_info,
! mailbox, aview, page,

! prompt_area);

/* send_msg_middle does menu_trigger_redraw(page),


do not need examine */

***************
*** 609,615 ****


}

void send_msg_argv(argv, given_subject, options, form, mailbox, aview,

! page)
char *argv[];
char *given_subject;
int options;
--- 656,662 ----


}

void send_msg_argv(argv, given_subject, options, form, mailbox, aview,

! page, prompt_area)
char *argv[];
char *given_subject;
int options;
***************
*** 617,622 ****
--- 664,670 ----


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NULL in patch mode */


{
struct expanded_address A, B;
struct mailer_info *mailer_info = get_mailer_info();

***************
*** 631,637 ****

send_msg_middle(-1,&A,&B,


given_subject,options,form,mailer_info,
! mailbox, aview, page);

/* send_msg_middle uses menu_trigger_redraw(),
need not examine
--- 679,685 ----

send_msg_middle(-1,&A,&B,
given_subject,options,form,mailer_info,
! mailbox, aview, page, prompt_area);

/* send_msg_middle uses menu_trigger_redraw(),
need not examine
***************
*** 645,668 ****
return;
}

! static int get_subject(subject_field, page)
struct string **subject_field;
struct menu_context *page;
{
char ch, msgbuf[SLEN];
int code;
charset_t utf7;
- int LINES, COLUMNS;
int prompt_line;


! int redraw = 0;
!

! menu_get_sizes(page,&LINES, &COLUMNS);
!
! /** get the subject and return non-zero if all okay... **/


! prompt_line = mail_only ? 4 : LINES-3;

redraw:

! if (user_level == 0) {
code = optionally_enter2(page,
subject_field, prompt_line, 0,
OE_APPEND_CURRENT|OE_REDRAW_MARK
--- 693,723 ----
return;
}

! static int get_subject(subject_field, page, prompt_area)
struct string **subject_field;
struct menu_context *page;
+ struct menu_context *prompt_area; /* NULL if mail only mode */
{
char ch, msgbuf[SLEN];
int code;
charset_t utf7;
int prompt_line;
! int delay_redraw = 0;
! struct menu_context *p;
! int flag = 0;
! int ul = give_dt_enumerate_as_int(&user_level);

redraw:
! if (!prompt_area) { /* Mail only */
! p = page;
! prompt_line = 4;
! } else {
! /* FIXME --optionally_enter* should use prompt_area */
! p = prompt_area;
! prompt_line = menu_GetAbsLine(prompt_area,1);
! }
!
! if (ul == 0) {
code = optionally_enter2(page,
subject_field, prompt_line, 0,
OE_APPEND_CURRENT|OE_REDRAW_MARK
***************
*** 688,730 ****


/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
- redraw = 1;

goto redraw;
}

if(code==-1){


/** User hit Ctrl-C key! **/
MoveCursor(prompt_line,0);
CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));

! if (redraw)
menu_trigger_redraw(page);
return(0);
}

if (!*subject_field ||
string_len(*subject_field) == 0) { /* zero length subject?? */
! elm_sfprintf(msgbuf, sizeof msgbuf,
! CATGETS(elm_msg_cat, ElmSet, ElmNoSubjectContinue,
! "No subject - Continue with message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);

! ch = want_to(msgbuf, *def_ans_no, prompt_line, 0, page);
! if (ch != *def_ans_yes) { /* user says no! */
if (sleepmsg > 0)


sleep((sleepmsg + 1) / 2);

ClearLine(prompt_line);
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSend,
"Mail not sent."));

!
! if (redraw)
menu_trigger_redraw(page);
return(0);
! }
! else {
PutLineX(prompt_line,0,
CATGETS(elm_msg_cat, ElmSet,
ElmSubjectNone,
--- 743,830 ----


/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/

+ menu_ClearScreen(page); /* Clear possible redraw mark */
+
+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+
+ delay_redraw++;
+ if (prompt_area)
+ menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area */
goto redraw;
}

if(code==-1){
+ cancel:


/** User hit Ctrl-C key! **/
MoveCursor(prompt_line,0);
CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));

! if (delay_redraw)
menu_trigger_redraw(page);
return(0);
}

if (!*subject_field ||
string_len(*subject_field) == 0) { /* zero length subject?? */
!
! int answer;
!
! redraw2:
! if (prompt_area)
! answer = prompt_letter(1,"",*def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel,
! prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmNoSubjectContinue,
! "No subject - Continue with message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! else
! answer = prompt_letter(4,"",*def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel,


! page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmNoSubjectContinue,
! "No subject - Continue with message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
!
!
! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {
! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! if (prompt_area)
! menu_ClearScreen(prompt_area);
!
! delay_redraw++; /* Can't trigger redraw yet... */
! goto redraw2;
! }

! if (TERMCH_interrupt_char == answer ||
! EOF == answer)
! goto cancel;
!
! if (answer != *def_ans_yes) { /* user says no! */
if (sleepmsg > 0)


sleep((sleepmsg + 1) / 2);

ClearLine(prompt_line);
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSend,
"Mail not sent."));

!
! if (delay_redraw)
menu_trigger_redraw(page);
return(0);
!
! } else {
PutLineX(prompt_line,0,
CATGETS(elm_msg_cat, ElmSet,
ElmSubjectNone,
***************
*** 747,753 ****
*subject_field = XX;
}

! if (redraw)


menu_trigger_redraw(page);
return(1); /** everything is cruising along okay **/
}

--- 847,853 ----
*subject_field = XX;
}

! if (delay_redraw)


menu_trigger_redraw(page);
return(1); /** everything is cruising along okay **/
}
***************

*** 756,769 ****
int copy_message,
struct mailer_info *mailer_info,
struct AliasView *aview,
! struct menu_context *page));

! static int get_copies(cc,copy_message,mailer_info,aview, page)
struct expanded_address * cc;
int copy_message;
struct mailer_info *mailer_info;


struct AliasView *aview;
struct menu_context *page;
{

/* Get the list of people that should be cc'd, returning ZERO if
* any problems arise.
--- 856,872 ----
int copy_message,
struct mailer_info *mailer_info,


struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

! static int get_copies(cc,copy_message,mailer_info,aview, page,
! prompt_area)
struct expanded_address * cc;
int copy_message;
struct mailer_info *mailer_info;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NULL if mail only */
{
/* Get the list of people that should be cc'd, returning ZERO if
* any problems arise.
***************
*** 776,810 ****
int prompt_line;


int code;
struct string *buffer = NULL;

! int LINES, COLUMNS;


! int redraw = 0;

! menu_get_sizes(page,&LINES, &COLUMNS);



! prompt_line = mail_only ? 5 : LINES - 2;

- FlushBuffer();

! hdr_to_buffer(*cc,&buffer);



code = optionally_enter2(page,
&buffer, prompt_line,0,
! OE_REDRAW_MARK|

OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));

! while (REDRAW_MARK == code) {
! code = optionally_enter2(page,
! &buffer, prompt_line,0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
! "Copies to: "));


!
/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!


*/
! redraw = 1;
}

if (code == -1) { /* Ctrl-C */
--- 879,929 ----
int prompt_line;


int code;
struct string *buffer = NULL;

! int delay_redraw = 0;
! struct menu_context *p;
! int flag = 0;

! hdr_to_buffer(*cc,&buffer);

! redraw:
! if (!prompt_area) { /* Mail only */
! p = page;
! prompt_line = 5;
! } else {
! /* FIXME --optionally_enter* should use prompt_area */
! p = prompt_area;
! prompt_line = menu_GetAbsLine(prompt_area,2);
! }


! FlushBuffer();

+ if (delay_redraw && buffer &&
+ string_len(buffer) >0 )
+ flag = OE_APPEND_CURRENT;
+
+

code = optionally_enter2(page,
&buffer, prompt_line,0,

! OE_REDRAW_MARK|flag|
OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));

! if (REDRAW_MARK == code) {


/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
!
! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! delay_redraw++;
! if (prompt_area)
! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area */
! goto redraw;
!
}

if (code == -1) { /* Ctrl-C */
***************
*** 818,824 ****
if (buffer)
buffer_to_header(cc,&buffer,TRUE,mailer_info,aview);

! if (redraw)
menu_trigger_redraw(page);
return(0);
}
--- 937,943 ----
if (buffer)
buffer_to_header(cc,&buffer,TRUE,mailer_info,aview);

! if (delay_redraw)
menu_trigger_redraw(page);
return(0);
}
***************
*** 849,869 ****
}
}

! if (redraw)


menu_trigger_redraw(page);
return(1); /* everything looks okay! */
}

! static enum copy_msg_mode copy_the_msg(headers, options, page)
struct mailing_headers *headers;
int options;
struct menu_context *page;
{


int forwarding = 0 != (options & MAIL_FORWARDING);

int replying = 0 != (options & MAIL_REPLYING);

- int LINES, COLUMNS;
-

/** Returns True iff the user wants to copy the message being


replied to into the edit buffer before invoking the editor!
**/

--- 968,987 ----
}
}

! if (delay_redraw)


menu_trigger_redraw(page);
return(1); /* everything looks okay! */
}

! static enum copy_msg_mode copy_the_msg(headers, options, page, prompt_area)
struct mailing_headers *headers;
int options;
struct menu_context *page;
+ struct menu_context *prompt_area;
{


int forwarding = 0 != (options & MAIL_FORWARDING);

int replying = 0 != (options & MAIL_REPLYING);

/** Returns True iff the user wants to copy the message being


replied to into the edit buffer before invoking the editor!
**/

***************
*** 873,879 ****


int redraw = 0;

again:

- menu_get_sizes(page,&LINES, &COLUMNS);



if (forwarding) {
int X = mimeforward;

--- 991,996 ----
***************
*** 884,897 ****



/* NOTICE: prompt_letter may return EOF */

! X1 = prompt_letter(LINES-4,"",def,
PROMPT_yesno|PROMPT_cancel|
PROMPT_redraw_mark|PROMPT_ctrlL,
! page,
! CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,
! "Forward message as separate part? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
if (TERMCH_interrupt_char == X1) {
answer = cm_CANCEL;
goto out;
--- 1001,1014 ----



/* NOTICE: prompt_letter may return EOF */

! X1 = prompt_letter(0,"",def,
PROMPT_yesno|PROMPT_cancel|
PROMPT_redraw_mark|PROMPT_ctrlL,
! prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,
! "Forward message as separate part? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
if (TERMCH_interrupt_char == X1) {
answer = cm_CANCEL;
goto out;
***************
*** 901,907 ****
--- 1018,1031 ----
goto out;



if (X1 == ('L'&31) || X1 == REDRAW_MARK) {

+ menu_ClearScreen(page); /* Clear possible redraw mark */

+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+
+ menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/
+

+
/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
***************
*** 910,916 ****
}


! X = (X1 == *def_ans_yes);
}

answer = X ? cm_mimeforward : cm_get_copy;
--- 1034,1040 ----
}


! X = (X1 == *def_ans_yes);
}

answer = X ? cm_mimeforward : cm_get_copy;
***************
*** 924,932 ****



/* NOTICE: prompt_letter may return EOF */

! X1 = prompt_letter(LINES-4,"",*def_ans_no,

PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,page,

CATGETS(elm_msg_cat, ElmSet, ElmCopyMessageYN,
"Copy message? (%c/%c) "),
*def_ans_yes, *def_ans_no);

--- 1048,1057 ----



/* NOTICE: prompt_letter may return EOF */

! X1 = prompt_letter(0,"",*def_ans_no,


PROMPT_yesno|PROMPT_cancel|
! PROMPT_redraw_mark|PROMPT_ctrlL,

! prompt_area,


CATGETS(elm_msg_cat, ElmSet, ElmCopyMessageYN,
"Copy message? (%c/%c) "),
*def_ans_yes, *def_ans_no);

***************
*** 940,945 ****
--- 1065,1076 ----
goto out;



if (X1 == ('L'&31) || X1 == REDRAW_MARK) {

+ menu_ClearScreen(page); /* Clear possible redraw mark */
+
+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+
+ menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/



/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
***************
*** 957,972 ****
out:
if (redraw)
menu_trigger_redraw(page);

return(answer);
}

! void a_sendmsg(edit_message, form_letter, mailbox, aview, header_page,

! page)
int edit_message, form_letter;


struct MailboxView *mailbox;
struct AliasView *aview;

- int header_page;
struct menu_context *page;
{
/** Prompt for fields and then call mail() to send the specified
message. If 'edit_message' is true then by defualt go to
--- 1088,1105 ----
out:
if (redraw)
menu_trigger_redraw(page);
+
+ DPRINT(Debug,7,(&Debug,"copy_the_msg=%d\n",answer));


return(answer);
}

! void a_sendmsg(edit_message, form_letter, mailbox, aview,

! page, LOC)
int edit_message, form_letter;


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

+ struct screen_parts *LOC;
{
/** Prompt for fields and then call mail() to send the specified
message. If 'edit_message' is true then by defualt go to
***************
*** 981,989 ****



struct mailing_headers headers;
struct mailer_info *mailer_info = get_mailer_info();

- int LINES, COLUMNS;
-

- menu_get_sizes(page,&LINES, &COLUMNS);

zero_mailing_headers(&headers);

--- 1114,1119 ----
***************
*** 1003,1020 ****



/* get the Subject: field */

! if (get_subject(&headers.subject,page) == 0) {
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, FALSE,mailer_info, aview,
! page) == 0) {
goto free_it;
}
}

! MoveCursor(LINES-1,0); /* so you know you've hit <return> ! */

FlushBuffer();

/* and mail that puppy outta here! */
--- 1133,1151 ----



/* get the Subject: field */

! if (get_subject(&headers.subject,page,
! LOC->prompt_page) == 0) {

goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, FALSE,mailer_info, aview,

! page, LOC->prompt_page) == 0) {
goto free_it;
}
}

! menu_MoveCursor(LOC->prompt_page,3,0); /* so you know you've hit <return> ! */
FlushBuffer();

/* and mail that puppy outta here! */
***************
*** 1030,1041 ****


dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

- main_state();


mail(-1, edit_message ? MAIL_EDIT_MSG : 0, form_letter,

&headers,mailer_info,
mailbox, aview, page,
NULL,-1);
- main_state();

/*
* Since we got this far, it must be okay to clear the tags.
--- 1161,1170 ----
***************
*** 1045,1059 ****
struct alias_rec * a = give_alias(aview,i);

if (a &&
! ison(a->status, TAGGED)) {
!
struct menu_common MENU;

clearit(a->status, TAGGED);
!
set_mcommon_from_aliasview(&MENU,aview);
!
! show_msg_tag(i,&MENU, header_page);
tagged--;
}
i++;
--- 1174,1190 ----
struct alias_rec * a = give_alias(aview,i);

if (a &&
! ison(a->status, TAGGED)) {
struct menu_common MENU;
+ int vis;

clearit(a->status, TAGGED);
!
set_mcommon_from_aliasview(&MENU,aview);
!
! vis = compute_visible(i+1, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);
!
tagged--;
}
i++;
Index: elm2.4.ME+.122-cvs/src/mailmsg2.c
*** elm2.4.ME+.121/src/mailmsg2.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/mailmsg2.c 2005-07-05 23:44:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.96 2004/07/28 17:10:12 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.96 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.107 2005/07/05 20:44:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.107 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 50,57 ****

extern char version_buff[];

! char *error_description();
! long ftell();


int gotten_key;
--- 50,56 ----

extern char version_buff[];

!


int gotten_key;
***************
*** 116,121 ****
--- 115,121 ----
{
int i;
int changed = 0;
+ int an = give_dt_enumerate_as_int(&allow_no_encoding);



if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));

***************
*** 147,156 ****
}
}

! if (allow_no_encoding >= 2)
/* Just send BINARY anyway */
mime_info->raw_level = mailer_binary;
! else if (allow_no_encoding >= 1 &&
mime_info->raw_level < mailer_8bit)
/* Just send 8BIT anyway */
mime_info->raw_level = mailer_8bit;
--- 147,156 ----
}
}

! if (an >= 2)
/* Just send BINARY anyway */
mime_info->raw_level = mailer_binary;
! else if (an >= 1 &&
mime_info->raw_level < mailer_8bit)
/* Just send 8BIT anyway */
mime_info->raw_level = mailer_8bit;
***************
*** 195,200 ****
--- 195,201 ----
out_state_t state_out;
in_state_t state_in;
char *fname;
+ char *tmp;



if (0 != fseek(mailbox_file,mime_rec->offset,SEEK_SET)) {

DPRINT(Debug,3,(&Debug,
***************
*** 203,214 ****
return NULL;
}


out_state_clear(&state_out, STATE_out_file);
in_state_clear(&state_in, STATE_in_file);



fname = elm_message(FRM("%smsgpart.%d-%d"),
! temp_dir, getpid (),

PART_COUNT++);

F = safeopen_rdwr(fname);
--- 204,218 ----
return NULL;
}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ return NULL;

out_state_clear(&state_out, STATE_out_file);
in_state_clear(&state_in, STATE_in_file);



fname = elm_message(FRM("%smsgpart.%d-%d"),

! tmp, getpid (),
PART_COUNT++);

F = safeopen_rdwr(fname);
***************
*** 326,336 ****
charset_t cur_editcharset = NULL;



struct menu_context *page = NULL;

!

/* Fail if no mailer available */
if (!mailer_info)

return;

/* free_mailing_headers will free this */
if (!headers->env_from)

headers->env_from = mailer_get_env_from(mailer_info);
--- 330,346 ----
charset_t cur_editcharset = NULL;



struct menu_context *page = NULL;

! char *tmp;
!
! tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
! if (!tmp)
! return;
!

/* Fail if no mailer available */
if (!mailer_info)

return;

+

/* free_mailing_headers will free this */
if (!headers->env_from)

headers->env_from = mailer_get_env_from(mailer_info);
***************
*** 347,356 ****
gotten_key = 0; /* ignore previously gotten encryption key */

/** first generate the temporary filename **/

elm_sfprintf(cur_editfile,sizeof cur_editfile,
FRM("%s%s%d"),
! temp_dir, temp_file, getpid());


/* verify_transmission() displays new screen,
--- 357,367 ----
gotten_key = 0; /* ignore previously gotten encryption key */

/** first generate the temporary filename **/
+

elm_sfprintf(cur_editfile,sizeof cur_editfile,
FRM("%s%s%d"),
! tmp, temp_file, getpid());


/* verify_transmission() displays new screen,
***************
*** 465,471 ****

if (copy_msg == FORM) {
elm_sfprintf(fname, sizeof fname,
! FRM("%s%s%d"), temp_dir, temp_form_file, getpid());

/* we can't retransmit a form! */
fclose(reply); reply = NULL;
--- 476,482 ----

if (copy_msg == FORM) {
elm_sfprintf(fname, sizeof fname,
! FRM("%s%s%d"), tmp, temp_form_file, getpid());

/* we can't retransmit a form! */
fclose(reply); reply = NULL;
***************
*** 573,579 ****

elm_sfprintf (very_long_buffer, sizeof very_long_buffer,
FRM("%selmfwd.%d"),
! temp_dir, getpid ());
if (! (tmpfp = safeopen_rdwr (very_long_buffer))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailFileForward,
"Failed to create file for forwarding"));
--- 584,590 ----

elm_sfprintf (very_long_buffer, sizeof very_long_buffer,
FRM("%selmfwd.%d"),
! tmp, getpid ());
if (! (tmpfp = safeopen_rdwr (very_long_buffer))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailFileForward,
"Failed to create file for forwarding"));
***************
*** 582,596 ****

mime_t_zero(&attach);

! attach.pathname = safe_strdup(very_long_buffer);


!
copy_message_f(mailbox_file,hdr,"",tmpfp,
CM_REMOVE_ENVELOPE,NULL);

attach.length = fsize(tmpfp);

fclose (tmpfp);



! attach.unlink = 1; /* mark for later deletion */

attach.TYPE = give_media_type2(MIME_TYPE_MESSAGE,"rfc822", 0);
if (!attach.TYPE)
mime_panic(__FILE__,__LINE__,"mail",
--- 593,609 ----

mime_t_zero(&attach);

! attach.pathname0 = safe_strdup(very_long_buffer);
! attach.dispname = new_string2(system_charset,
! s2us(very_long_buffer));


!
copy_message_f(mailbox_file,hdr,"",tmpfp,
CM_REMOVE_ENVELOPE,NULL);

attach.length = fsize(tmpfp);

fclose (tmpfp);

! attach.unlink = 2; /* mark for later deletion */
attach.TYPE = give_media_type2(MIME_TYPE_MESSAGE,"rfc822", 0);
if (!attach.TYPE)
mime_panic(__FILE__,__LINE__,"mail",
***************
*** 627,634 ****
header_list_ptr all_headers,walk;
int Flags, major;


CONST char *subtype;
! char buffer[80];
!

DPRINT(Debug,4, (&Debug,


"Not forwarding, copying message normally or mime attaching, making message as edited -- copy_selection=%d\n",

copy_selection));
--- 640,646 ----
header_list_ptr all_headers,walk;
int Flags, major;
CONST char *subtype;
!
DPRINT(Debug,4, (&Debug,


"Not forwarding, copying message normally or mime attaching, making message as edited -- copy_selection=%d\n",

copy_selection));
***************
*** 665,701 ****




if (! hdr->mime_rec.TYPE) {
! DPRINT(Debug,4, (&Debug, "no mime type -- will not pick message for sending\n"));
! goto fail1;
! }

! Flags = get_type_flags(hdr->mime_rec.TYPE);
! major = get_major_type_code(hdr->mime_rec.TYPE);
! subtype = get_subtype_name(hdr->mime_rec.TYPE);
!
! /* 1) Includes only one text part -- put it to edit buffer */
! if (MIME_TYPE_TEXT == major && 0 == istrcmp(subtype,"Plain") &&
! DISP_INLINE == hdr->mime_rec.disposition) {
!
! char * filename =
! mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
! reply,mime_body_keywords);
!
! if (filename) {
! unlink(filename);
! free(filename);
! }


! if (!mime_get_param("charset",buffer,hdr->mime_rec.type_opts,sizeof buffer)) {
! DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
! goto fail1;
! }

! cur_editcharset = MIME_name_to_charset(buffer,0);
if (!cur_editcharset) {


DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! buffer));

goto fail1;
}

--- 677,716 ----




if (! hdr->mime_rec.TYPE) {
! DPRINT(Debug,4, (&Debug, "no mime type -- will not pick message for sending\n"));
! goto fail1;
! }
!
! Flags = get_type_flags(hdr->mime_rec.TYPE);
! major = get_major_type_code(hdr->mime_rec.TYPE);
! subtype = get_subtype_name(hdr->mime_rec.TYPE);
!
! /* 1) Includes only one text part -- put it to edit buffer */
! if (MIME_TYPE_TEXT == major && 0 == istrcmp(subtype,"Plain") &&
! DISP_INLINE == hdr->mime_rec.disposition) {

! CONST char *cs = NULL;



+ char * filename =

+ mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
+ reply,mime_body_keywords);
+
+ if (filename) {
+ unlink(filename);
+ free(filename);
+ }

! cs = get_mime_param_compat(hdr->mime_rec.TYPE_opts,
! "charset");
! if (!cs) {


! DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
! goto fail1;
! }

! cur_editcharset = MIME_name_to_charset(cs,0);
if (!cur_editcharset) {


DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",

! cs));
goto fail1;
}

***************
*** 705,711 ****
cur_editcharset->MIME_name ?
cur_editcharset->MIME_name :
"<no MIME name>",
! buffer,
display_charset->MIME_name ?
display_charset->MIME_name :
"<no MIME name>"));
--- 720,726 ----
cur_editcharset->MIME_name ?
cur_editcharset->MIME_name :
"<no MIME name>",
! cs,
display_charset->MIME_name ?
display_charset->MIME_name :
"<no MIME name>"));
***************
*** 731,736 ****
--- 746,753 ----


int major = get_major_type_code(z->TYPE);

CONST char *subtype = get_subtype_name(z->TYPE);

+ CONST char *cs = NULL;
+

if (MIME_TYPE_TEXT == major && 0 == istrcmp(subtype,"Plain") &&

DISP_INLINE == z->disposition) {

***************
*** 742,757 ****
free(filename);


}

!
! if (!mime_get_param("charset",buffer,z->type_opts,sizeof buffer)) {

DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));

goto fail2;
}

! cur_editcharset = MIME_name_to_charset(buffer,0);
if (!cur_editcharset) {


DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! buffer));

goto fail2;
}

--- 759,775 ----
free(filename);
}

! cs = get_mime_param_compat(z->TYPE_opts,
! "charset");
! if (!cs) {


DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));

goto fail2;
}

! cur_editcharset = MIME_name_to_charset(cs,0);
if (!cur_editcharset) {


DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",

! cs));
goto fail2;
}

***************
*** 761,767 ****
cur_editcharset->MIME_name ?
cur_editcharset->MIME_name :
"<no MIME name>",
! buffer,
display_charset->MIME_name ?
display_charset->MIME_name :
"<no MIME name>"));
--- 779,785 ----
cur_editcharset->MIME_name ?
cur_editcharset->MIME_name :
"<no MIME name>",
! cs,
display_charset->MIME_name ?
display_charset->MIME_name :
"<no MIME name>"));
***************
*** 800,815 ****

mime_t_zero(&attach);

! attach.pathname = mmsg_copy_part(mailbox_file,z,
NULL,0);
! if (!attach.pathname) {
DPRINT(Debug,4, (&Debug,

"Failed to copy part %d/%d\n",

x,c));
continue;


}

! attach.unlink = 1; /* mark for later deletion */

attach.TYPE = z->TYPE;
attach.encoding = z->encoding;
attach.disposition = z->disposition;
--- 818,836 ----

mime_t_zero(&attach);

! attach.pathname0 = mmsg_copy_part(mailbox_file,z,
NULL,0);
! if (!attach.pathname0) {
DPRINT(Debug,4, (&Debug,

"Failed to copy part %d/%d\n",

x,c));
continue;
}
+ attach.dispname = new_string2(display_charset,
+ s2us(attach.pathname0));
+

! attach.unlink = 2; /* mark for later deletion */
attach.TYPE = z->TYPE;
attach.encoding = z->encoding;
attach.disposition = z->disposition;
***************
*** 818,829 ****
attach.description = dup_string(z->description);
}


! if (z->type_opts) {
! attach.type_opts = safe_strdup(z->type_opts);
}

! if (z->disposition_opts) {
! attach.disposition_opts = safe_strdup(z->disposition_opts);
}

add_Attachments(&attachments,&attach);
--- 839,851 ----
attach.description = dup_string(z->description);
}

! if (z->TYPE_opts) {
! attach.TYPE_opts = copy_mime_param(z->TYPE_opts);
}

! if (z->DISPOSITION_opts) {
! attach.DISPOSITION_opts =
! copy_mime_param(z->DISPOSITION_opts);
}

add_Attachments(&attachments,&attach);
***************
*** 843,857 ****

mime_t_zero(&attach);



! attach.pathname = mmsg_copy_part(mailbox_file,& (hdr->mime_rec),

NULL,0);
! if (!attach.pathname) {
DPRINT(Debug,4, (&Debug,

"Failed to copy messge \n"));

goto fail1;


}

! attach.unlink = 1; /* mark for later deletion */

attach.TYPE = hdr->mime_rec.TYPE;
attach.encoding = hdr->mime_rec.encoding;
attach.disposition = hdr->mime_rec.disposition;
--- 865,882 ----

mime_t_zero(&attach);

! attach.pathname0 = mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
NULL,0);
! if (!attach.pathname0) {
DPRINT(Debug,4, (&Debug,

"Failed to copy messge \n"));

goto fail1;
}

! attach.dispname = new_string2(display_charset,
! s2us(attach.pathname0));
!
! attach.unlink = 2; /* mark for later deletion */
attach.TYPE = hdr->mime_rec.TYPE;
attach.encoding = hdr->mime_rec.encoding;
attach.disposition = hdr->mime_rec.disposition;
***************
*** 861,873 ****
dup_string(hdr->mime_rec.description);


}

! if (hdr->mime_rec.type_opts) {
! attach.type_opts = safe_strdup(hdr->mime_rec.type_opts);
}

! if (hdr->mime_rec.disposition_opts) {
! attach.disposition_opts =
! safe_strdup(hdr->mime_rec.disposition_opts);
}

add_Attachments(&attachments,&attach);
--- 886,899 ----
dup_string(hdr->mime_rec.description);
}

! if (hdr->mime_rec.TYPE_opts) {
! attach.TYPE_opts =
! copy_mime_param(hdr->mime_rec.TYPE_opts);
}

! if (hdr->mime_rec.DISPOSITION_opts) {
! attach.DISPOSITION_opts =
! copy_mime_param(hdr->mime_rec.DISPOSITION_opts);
}

add_Attachments(&attachments,&attach);
***************
*** 987,992 ****
--- 1013,1024 ----


MIME_info.encode_hdr,
aview,
page);
+
+
+ DPRINT(Debug,8,(&Debug,
+ " ... virify_transmission result = %d, attachment_count=%d\n",
+ code,attachments.attachment_count));
+
/* Empty ... */
if (-2 == code && !attachments.attachment_count) {
goto fail_label;
***************

*** 1056,1062 ****
#endif


! if (check_for_multipart(reply, &MIME_info,mailer_info) < 0) {

/* Error in [include ...] */
if (code < 0)
goto fail_label;

--- 1088,1095 ----
#endif


! if (check_for_multipart(reply, &MIME_info,mailer_info,
! cur_editcharset) < 0) {

/* Error in [include ...] */
if (code < 0)
goto fail_label;

***************
*** 1073,1079 ****
if (converted_buffer)
fclose(converted_buffer);
temp1 = elm_message(FRM("%selmcv-%d-%d"),
! temp_dir, getpid (),
conv_count++);
converted_buffer = safeopen_rdwr(temp1);
if (!converted_buffer) {
--- 1106,1112 ----
if (converted_buffer)
fclose(converted_buffer);
temp1 = elm_message(FRM("%selmcv-%d-%d"),
! tmp, getpid (),
conv_count++);
converted_buffer = safeopen_rdwr(temp1);
if (!converted_buffer) {
***************
*** 1116,1130 ****


} else
MIME_info.msg_is_multipart = MIME_info.top_parts_count > 1;

/* End of check_for_multipart failure loop */
} while (!batch_only && reask_verify);

if (MIME_info.msg_is_multipart) {
(void) mime_generate_boundary (MIME_info.mime_boundary,

sizeof MIME_info.mime_boundary);
! add_parameter_1(&(MIME_info.type_opts_top), "boundary",
! MIME_info.mime_boundary,
! FALSE);
}

if (headers->from.addrs_len > 0) {
--- 1149,1170 ----


} else
MIME_info.msg_is_multipart = MIME_info.top_parts_count > 1;

+
+ DPRINT(Debug,8,(&Debug,
+ " ... top_parts_count=%d, msg_is_multipart=%d\n",
+ MIME_info.top_parts_count,
+ MIME_info.msg_is_multipart));
+
+
/* End of check_for_multipart failure loop */
} while (!batch_only && reask_verify);

if (MIME_info.msg_is_multipart) {
(void) mime_generate_boundary (MIME_info.mime_boundary,

sizeof MIME_info.mime_boundary);
! mime_params_add_compat(&(MIME_info.TYPE_opts_top),
! "boundary",
! MIME_info.mime_boundary);
}

if (headers->from.addrs_len > 0) {


***************
*** 1151,1158 ****
headers->sender));
}

! if (code == -1 /* Forget */ ||
! code < 0 && MIME_info.msg_is_multipart) {

struct MailboxView *cm = give_canceled_mail();

--- 1191,1197 ----


headers->sender));
}

! if (code < 0 /* Forget */) {

struct MailboxView *cm = give_canceled_mail();

***************
*** 1529,1534 ****

--- 1568,1574 ----


/*
* verify_transmission() - Ask the user to confirm transmission of the
* message. Returns 0 to send it, -1 to forget it.
+ * -2 to forget empty file
*/
static int verify_transmission(filename, form_p, need_redraw_p,
already_has_text, copy_file, force_cmd, options,

***************
*** 1574,1582 ****
--- 1614,1630 ----
int def_cmd = 's';
int do_redraw = 1;
int LINES, COLUMNS;
+ int ul = give_dt_enumerate_as_int(&user_level);
+ struct menu_context *prompt_area = NULL;
+ int ret = -1;
+

menu_get_sizes(page,&LINES, &COLUMNS);

+ prompt_area =
+ new_menu_subpage(page,LINES-4,4,
+ subpage_simple_noredraw,NULL);
+
#ifdef USE_PGP
if (replying && was_pgp_encoded &&
! (pgp_status & PGP_MESSAGE))
***************
*** 1587,1592 ****
--- 1635,1641 ----
bad_cmd = FALSE; /* nothing to complain about yet */

for (;;) {
+ menu_set_default(page);

if (0) {
redraw:
***************
*** 1597,1608 ****
--- 1646,1661 ----
if (menu_resized(page)) {

menu_get_sizes(page,&LINES, &COLUMNS);
+
+ menu_subpage_relocate(prompt_area,page,LINES-4,4);
+
do_redraw = 1;

} else if (menu_need_redraw(page))
do_redraw = 1;

if (do_redraw) {
+
do_redraw = 0;
*need_redraw_p = TRUE;

***************
*** 1616,1622 ****

show_presend_headers(headers,hdr_charset, page);

! if (headers->env_from && user_level > 0) {
int can_edit;
CONST char *t = mailer_env_from_value(headers->env_from,&can_edit);

--- 1669,1675 ----

show_presend_headers(headers,hdr_charset, page);

! if (headers->env_from && ul > 0) {
int can_edit;
CONST char *t = mailer_env_from_value(headers->env_from,&can_edit);

***************
*** 1633,1644 ****
"Return-path: %s"),
t);
}
}

/* build up prompt and menu strings */
if (prev_form == *form_p) {
; /* not changed - no need to rebuild the strings */
! } else if (user_level == 0) {
prompt_mssg = catgets(elm_msg_cat, ElmSet, ElmVfyPromptPleaseChoose,
"Please choose one of the following options by parenthesized letter: s");
strfcpy(prompt_menu,
--- 1686,1700 ----
"Return-path: %s"),
t);
}
+
+ menu_redraw_children(page);
+
}

/* build up prompt and menu strings */
if (prev_form == *form_p) {
; /* not changed - no need to rebuild the strings */
! } else if (ul == 0) {
prompt_mssg = catgets(elm_msg_cat, ElmSet, ElmVfyPromptPleaseChoose,
"Please choose one of the following options by parenthesized letter: s");
strfcpy(prompt_menu,
***************
*** 1734,1739 ****
--- 1790,1808 ----
bad_cmd = FALSE;
}

+ if (menu_resized(prompt_area) ||
+ menu_need_redraw(prompt_area)) {
+
+ menu_ClearScreen(prompt_area);
+
+ menu_PutLine0(prompt_area,
+ 0, 0, prompt_mssg);
+
+ Centerline(1, prompt_menu,prompt_area);
+ Centerline(2, prompt_menu2,prompt_area);
+
+ }
+
/* if we don't have a cmd, display prompt and get response from user */
if (force_cmd != '\0' &&
isascii(force_cmd)) {
***************
*** 1741,1763 ****
force_cmd = '\0';
did_prompt = FALSE;
} else {
! ClearLine(LINES-4);
! PutLine0(LINES-4, 0, prompt_mssg);

! GetXYLocation(&x_coord, &y_coord);
y_coord--; /* backspace over default answer */

! PutLineX(LINES-4, y_coord, FRM("%c"),def_cmd);
! ClearLine(LINES-3);
! Centerline(LINES-3, prompt_menu,page);
! ClearLine(LINES-2);
! Centerline(LINES-2, prompt_menu2,page);
FlushBuffer();

! MoveCursor(x_coord, y_coord);
! cmd = menu_ReadCh(page,REDRAW_MARK|READCH_resize);
! if (cmd == REDRAW_MARK)
goto redraw;

if (cmd == RESIZE_MARK) {

--- 1810,1842 ----
force_cmd = '\0';
did_prompt = FALSE;
} else {
! menu_PutLine0(prompt_area,
! 0, 0, prompt_mssg);

! menu_GetXYLocation(prompt_area,
! &x_coord, &y_coord);
y_coord--; /* backspace over default answer */

! menu_CleartoEOLN(prompt_area);
!
! menu_PutLineX(prompt_area,
! 0, y_coord, FRM("%c"),def_cmd);
FlushBuffer();

! menu_MoveCursor(prompt_area,
! x_coord, y_coord);
! cmd = menu_ReadCh(prompt_area,REDRAW_MARK|READCH_resize);
!
! if (cmd == REDRAW_MARK) {
! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/
!
goto redraw;
+ }

if (cmd == RESIZE_MARK) {

***************
*** 1775,1781 ****
clear_error();



/* Put cursor pack to correct place */

! MoveCursor(x_coord, y_coord);
}

switch (cmd) {
--- 1854,1861 ----
clear_error();



/* Put cursor pack to correct place */

! menu_MoveCursor(prompt_area,
! x_coord, y_coord);
}

switch (cmd) {
***************
*** 1789,1796 ****

case 'a':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuAtttach,
! "Attachments"));

attach_menu(NULL,NULL,attachments,display_charset,mailer_info,
NULL, aview);
--- 1869,1877 ----

case 'a':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuAtttach,
! "Attachments"));

attach_menu(NULL,NULL,attachments,display_charset,mailer_info,
NULL, aview);
***************
*** 1802,1809 ****


DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));

if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuDsn,
! "Dsn"));
if (dsn) {
dsn_menu(dsn);
do_redraw = 1;
--- 1883,1891 ----


DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));

if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuDsn,
! "Dsn"));
if (dsn) {
dsn_menu(dsn);
do_redraw = 1;
***************
*** 1813,1820 ****

case 's':
if (did_prompt) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuSend,
! "Send"));
/* Call FlushBuffer() after writing of "Send" so that
* user get immediately feedback (it may take time
* to encode big attachments)
--- 1895,1903 ----

case 's':
if (did_prompt) {
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuSend,
! "Send"));
/* Call FlushBuffer() after writing of "Send" so that
* user get immediately feedback (it may take time
* to encode big attachments)
***************
*** 1824,1889 ****
#ifdef USE_PGP
if (replying && was_pgp_encoded &&
! (pgp_status & PGP_MESSAGE)) {
! ClearLine(LINES-3);
! PutLineX(LINES-3, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpRcvSure,
! "The recv'd message was PGP encoded, are you sure? "));
! for (;;) {
! cmd = menu_ReadCh(page,0);
! if (cmd == *def_ans_yes) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
! "Yes."));
! return(0);
! }
! if (cmd == *def_ans_no) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
break;
- }
}
- break;
- }
#endif /* USE_PGP */
! return 0;
! /*NOTREACHED*/

case ctrl('F'):
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmPassphraseForget,
! "Forget passphrase"));
forget_passphrase();
break;

case 'f':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuForget,
! "Forget"));
#ifdef USE_PGP
pgp_status = 0; /* make sure to reset! */
#endif


if (bytes(filename) <= 0) {
; /* forget about empty files */

! return -2;
}
! return -1;
/*NOTREACHED*/

case 'c':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuCopyFile,
! "Copy file"));
! if (name_copy_file(copy_file, aview, page) != 0) {
! *need_redraw_p = TRUE;


! do_redraw = 1;
! }
break;

case 'e':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuEdit, "Edit"));
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
--- 1907,1981 ----
#ifdef USE_PGP
if (replying && was_pgp_encoded &&
! (pgp_status & PGP_MESSAGE)) {
!
! menu_ClearLine(prompt_area,1);
! menu_PutLineX(prompt_area,1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpRcvSure,
! "The recv'd message was PGP encoded, are you sure? "));
! for (;;) {
! cmd = menu_ReadCh(prompt_area,0);
! if (cmd == *def_ans_yes) {
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
! "Yes."));
! ret = 0;
! goto out;
! }
! if (cmd == *def_ans_no) {
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
! break;
! }
! }
break;
}
#endif /* USE_PGP */
! ret = 0;
! goto out;
! /*NOTREACHED*/

case ctrl('F'):
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPassphraseForget,
! "Forget passphrase"));
forget_passphrase();
break;

case 'f':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuForget,
! "Forget"));
#ifdef USE_PGP
pgp_status = 0; /* make sure to reset! */
#endif


if (bytes(filename) <= 0) {
; /* forget about empty files */

! ret = -2;
! goto out;
}
! ret = -1;
! goto out;
/*NOTREACHED*/

case 'c':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuCopyFile,
! "Copy file"));
! name_copy_file(copy_file, aview, page);
!
break;

case 'e':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuEdit, "Edit"));
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
***************
*** 1898,1918 ****
if (edit_the_message(filename, already_has_text,
headers,editor_val,file_set,
mailer_info, mailbox,
! aview, page) != 0)
! return -1;
} else {
sleep_message();
if (no_editor_edit_the_message(filename,headers,file_set,
! mailer_info,mailbox,aview))
! return -1;
}
}
break;

case 'h':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuHeaders,"Headers"));
edit_headers(headers,mailer_info,hdr_charset,encode_hdr,
aview);
*need_redraw_p = TRUE;
--- 1990,2015 ----
if (edit_the_message(filename, already_has_text,
headers,editor_val,file_set,
mailer_info, mailbox,
! aview, page) != 0) {
! ret = -1;
! goto out;
! }
} else {
sleep_message();
if (no_editor_edit_the_message(filename,headers,file_set,
! mailer_info,mailbox,aview)) {
! ret = -1;
! goto out;
! }
}
}
break;

case 'h':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuHeaders,"Headers"));
edit_headers(headers,mailer_info,hdr_charset,encode_hdr,
aview);
*need_redraw_p = TRUE;
***************
*** 1926,1936 ****
switch (check_form_file(filename)) {
case -1:
/* couldn't open file??? */
! return -1;
case 0:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyNoFieldsInForm,
! "No fields in form!\007"));
sleep_message();
break;
default:
--- 2023,2035 ----
switch (check_form_file(filename)) {
case -1:
/* couldn't open file??? */
! ret = -1;
! goto out;
case 0:
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyNoFieldsInForm,
! "No fields in form!\007"));
sleep_message();
break;
default:
***************
*** 1944,1951 ****
#ifdef ISPELL
case 'i':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuIspell2,"Ispell"));
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
--- 2043,2051 ----
#ifdef ISPELL
case 'i':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuIspell2,"Ispell"));
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
***************
*** 1965,1971 ****

#ifdef ALLOW_SUBSHELL
case '!':
! subshell(NULL, page);


if (menu_need_redraw(page)) {
menu_ClearScreen(page);
*need_redraw_p = TRUE;

--- 2065,2073 ----

#ifdef ALLOW_SUBSHELL
case '!':
! menu_ClearLine(prompt_area,0);
! subshell(NULL, page, prompt_area);


!
if (menu_need_redraw(page)) {
menu_ClearScreen(page);
*need_redraw_p = TRUE;

***************
*** 1976,1983 ****
#ifdef USE_PGP
case 'p':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuPgp,"Pgp"));
if (!pgp_status) {
pgp_status = pgp_menu (filename,headers, page);
if (pgp_status)
--- 2078,2086 ----
#ifdef USE_PGP
case 'p':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuPgp,"Pgp"));
if (!pgp_status) {
pgp_status = pgp_menu (filename,headers, page);
if (pgp_status)
***************
*** 2006,2012 ****

{
int c = presend_action(headers,mailer_info,cmd,hdr_charset,
! aview, page);

if (0 == c)
bad_cmd = TRUE;
--- 2109,2115 ----

{
int c = presend_action(headers,mailer_info,cmd,hdr_charset,
! aview, page, prompt_area);

if (0 == c)
bad_cmd = TRUE;
***************
*** 2017,2022 ****
--- 2120,2130 ----
break;
}
}
+
+ out:
+ erase_menu_context(&prompt_area);
+
+ return ret;
}

void write_header_info(mailer, headers,
***************
*** 2034,2043 ****
mail.
**/

- time_t time();
- char *ctime();
-
- char *get_arpa_date();

mime_info -> encode_hdr = !form && !allow_no_hdrencoding;

--- 2142,2147 ----
Index: elm2.4.ME+.122-cvs/src/Makefile.SH
*** elm2.4.ME+.121/src/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/src/Makefile.SH 2005-05-21 20:58:32.000000000 +0300
***************
*** 13,18 ****
--- 13,21 ----


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac

+ libx="../libs/libelmme-base.a ../libs/libelmme-mailer.a"
+ libxs="../shlib/libelmme-base.so ../shlib/libelmme-mailer.so"
+
echo "Extracting src/Makefile (with variable substitutions)"
: if mailermode is not 2755 then we dont need the chgrp
: set chgrp to a null command in this case
***************
*** 31,43 ****

cat >Makefile <<!GROK!THIS!
#!$make


! # $Id: Makefile.SH,v 1.54 2004/09/11 07:31:19 hurtta Exp $
#
# Makefile for the ELM mail program.
#

# Copyright (c) 1988-1992 USENET Community Trust
# Copyright (c) 1986,1987 Dave Taylor
! #
#
# Variables
# Variables established by Configure

--- 34,50 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.59 2005/05/21 17:58:32 hurtta Exp $


#
# Makefile for the ELM mail program.
#

+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################
+ # Based on src/Makefile.SH. That code was following copyright:
+ #
# Copyright (c) 1988-1992 USENET Community Trust
# Copyright (c) 1986,1987 Dave Taylor
! ######################################################################
#
# Variables
# Variables established by Configure

***************
*** 61,66 ****
--- 68,74 ----


RM = $rm -f
TOUCH = $touch

TAGS = ctags
+ LIBX = $libx

LOCALETARG = $localetarget

***************
*** 106,111 ****
--- 114,122 ----
cat >>Makefile <<'!NO!SUBS!'
SHLIST = $(BIN)/elm-shared
!NO!SUBS!
+ cat >>Makefile <<!SUBS!
+ LIBXS = $libxs
+ !SUBS!

else

***************
*** 343,354 ****


$(CHMOD) u+w $@
$(TOUCH) $@

! def_elm.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h


$(CHMOD) u+w $@
$(TOUCH) $@

# Dependencies of C object files

! addr_util.o: def_elm.h $(INCLDIR)/s_elm.h
alias.o: def_elm.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_aliases.h $(INCLDIR)/s_elm.h
aliaslib.o: def_elm.h $(INCLDIR)/s_elm.h
args.o: def_elm.h $(INCLDIR)/patchlevel.h $(INCLDIR)/s_elm.h
--- 354,366 ----


$(CHMOD) u+w $@
$(TOUCH) $@

! def_elm.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h \
! $(INCLDIR)/mailerlib.h


$(CHMOD) u+w $@
$(TOUCH) $@

# Dependencies of C object files

! addr_util.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h
alias.o: def_elm.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_aliases.h $(INCLDIR)/s_elm.h
aliaslib.o: def_elm.h $(INCLDIR)/s_elm.h
args.o: def_elm.h $(INCLDIR)/patchlevel.h $(INCLDIR)/s_elm.h
***************
*** 366,372 ****
digest.o: def_elm.h $(INCLDIR)/s_elm.h
edit.o: def_elm.h
editmsg.o: def_elm.h $(INCLDIR)/s_elm.h
! elm.o: $(INCLDIR)/elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/me.h $(INCLDIR)/patchlevel.h
encode.o: def_elm.h $(INCLDIR)/s_elm.h
exitprog.o: def_elm.h $(INCLDIR)/s_elm.h
file.o: def_elm.h $(INCLDIR)/s_elm.h
--- 378,385 ----
digest.o: def_elm.h $(INCLDIR)/s_elm.h
edit.o: def_elm.h
editmsg.o: def_elm.h $(INCLDIR)/s_elm.h
! elm.o: $(INCLDIR)/elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/me.h \
! $(INCLDIR)/patchlevel.h $(INCLDIR)/mailerlib.h
encode.o: def_elm.h $(INCLDIR)/s_elm.h
exitprog.o: def_elm.h $(INCLDIR)/s_elm.h
file.o: def_elm.h $(INCLDIR)/s_elm.h
***************
*** 400,407 ****
reply.o: def_elm.h $(INCLDIR)/s_elm.h
save_opts.o: def_elm.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h $(INCLDIR)/rc_imp.h
savecopy.o: def_elm.h $(INCLDIR)/s_elm.h
! screen.o: def_elm.h $(INCLDIR)/s_elm.h
! showmsg.o: def_elm.h $(INCLDIR)/s_elm.h
showmsg_c.o: def_elm.h $(INCLDIR)/s_elm.h
signals.o: def_elm.h $(INCLDIR)/s_elm.h
sort.o: def_elm.h $(INCLDIR)/s_elm.h
--- 413,420 ----
reply.o: def_elm.h $(INCLDIR)/s_elm.h
save_opts.o: def_elm.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h $(INCLDIR)/rc_imp.h
savecopy.o: def_elm.h $(INCLDIR)/s_elm.h
! screen.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_aliases.h
! showmsg.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h
showmsg_c.o: def_elm.h $(INCLDIR)/s_elm.h
signals.o: def_elm.h $(INCLDIR)/s_elm.h
sort.o: def_elm.h $(INCLDIR)/s_elm.h
***************
*** 411,430 ****
utils.o: def_elm.h $(INCLDIR)/s_elm.h

# Dependencies and rules for compiling C programs
! $(BIN)/elm: $& $(ELM_OBJ) ../melib/libme.a ../lib/libutil.a messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a
! $(CC) $(LFLAGS) -o $@ $(ELM_OBJ) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a ../melib/libme.a ../lib/libutil.a $(LIBS) $(LIB2)

# Dependencies and rules for installing C programs


!NO!SUBS!



if $test "$d_shared" = "$define" ; then

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/elm-shared: $& $(ELM_OBJ) ../melib/libme.a ../shlib/libelmme-base.so messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELM_OBJ) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a ../melib/libme.a ../shlib/libelmme-base.so $(LIBS) $(LIB2)


$(DEST)/elm: $(BIN)/elm-shared
--- 424,452 ----
utils.o: def_elm.h $(INCLDIR)/s_elm.h

# Dependencies and rules for compiling C programs
! $(BIN)/elm: $& $(ELM_OBJ) ../melib/libme.a $(LIBX) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a
! $(CC) $(LFLAGS) -o $@ $(ELM_OBJ) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a ../melib/libme.a $(LIBX) $(LIBS) $(LIB2)

# Dependencies and rules for installing C programs


!NO!SUBS!

+ for i in $libx
+ do
+ y="`echo $i|$sed 's%^../%%'`"
+ cat >>Makefile <<!SUBS!
+ $i:
+ cd ..; \$(MAKE) \$(MJ) \$(MFLAGS) $y
+ !SUBS!
+ done


+
if $test "$d_shared" = "$define" ; then

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/elm-shared: $& $(ELM_OBJ) ../melib/libme.a $(LIBXS) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELM_OBJ) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a ../melib/libme.a $(LIBXS) $(LIBS) $(LIB2)


$(DEST)/elm: $(BIN)/elm-shared
***************
*** 432,437 ****
--- 454,469 ----

!NO!SUBS!

+ for i in $libxs
+ do
+ y="`echo $i|$sed 's%^../%%'`"
+ cat >>Makefile <<!SUBS!
+ $i:
+ cd ..; \$(MAKE) \$(MJ) \$(MFLAGS) $y
+ !SUBS!
+ done
+
+
else

cat >>Makefile <<'!NO!SUBS!'
Index: elm2.4.ME+.122-cvs/src/menu2.c
*** elm2.4.ME+.121/src/menu2.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu2.c 2004-12-25 23:35:40.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: menu2.c,v 1.12 2004/07/19 08:48:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: menu2.c,v 1.14 2004/12/25 21:35:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 28,35 ****
char buf[STRING];
int ch;



! ClearLine (it->offset);
! Write_to_screen (FRM("%s"),it->option);

len = strlen (it->option) + 1;

if (it->type == STR)

return
--- 28,37 ----
char buf[STRING];
int ch;

! menu_ClearLine(page,
! it->offset);
! menu_Write_to_screen(page,
! FRM("%s"),it->option);


len = strlen (it->option) + 1;

if (it->type == STR)

return
***************
*** 39,55 ****


else if (it->type == BOL) {

int old_val = *(it->d.i);

for (;;) {
! MoveCursor (it->offset, len);
! CleartoEOLN ();

if (*(it->d.i) == TRUE)
! Write_to_screen (CATGETS(elm_msg_cat, ElmSet,
! ElmMenu2True,
! "TRUE"));

else if (*(it->d.i) == FALSE)
! Write_to_screen (CATGETS(elm_msg_cat, ElmSet,
! ElmMenu2False,

! "FALSE"));
! ch = menu_ReadCh (page,OE_REDRAW_MARK|READCH_sig_char);
if (ch == EOF)
return -1;
if (ch == REDRAW_MARK)
--- 41,59 ----


else if (it->type == BOL) {

int old_val = *(it->d.i);

for (;;) {
! menu_MoveCursor(page,it->offset, len);
! menu_CleartoEOLN(page);


if (*(it->d.i) == TRUE)

! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMenu2True,
! "TRUE"));

else if (*(it->d.i) == FALSE)

! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMenu2False,
! "FALSE"));

! ch = menu_ReadCh(page,OE_REDRAW_MARK|READCH_sig_char);
if (ch == EOF)
return -1;


if (ch == REDRAW_MARK)
***************

*** 98,103 ****
--- 102,109 ----
for (;;) {
int LINES, COLUMNS;

+ menu_set_default(page);
+
resize_mark:
menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 135,147 ****
}
update = FALSE;
}
! ClearLine (LINES-3);
! PutLine0 (LINES-3, 0, prompt);
! if (precmd) {
! ch = precmd;
! precmd = 0;
! } else


! ch = menu_ReadCh (page, REDRAW_MARK|READCH_resize|READCH_sig_char);

if (ch == TERMCH_interrupt_char) {
ret = 0;
--- 141,154 ----
}
update = FALSE;
}
!
! menu_ClearLine(page,LINES-3);
! menu_PutLine0(page,LINES-3, 0, prompt);
! if (precmd) {
! ch = precmd;
! precmd = 0;
! } else
! ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize|READCH_sig_char);

if (ch == TERMCH_interrupt_char) {
ret = 0;
Index: elm2.4.ME+.122-cvs/src/menu.c
*** elm2.4.ME+.121/src/menu.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu.c 2004-12-25 23:35:40.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: menu.c,v 1.8 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: menu.c,v 1.9 2004/12/25 21:35:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 166,172 ****
Centerline(LINES-2, m->help, page);
m->update = 0;
}
! PutLine0(LINES-3, 0, m->prompt);

switch(cmd = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR|READCH_resize)) {
case RESIZE_MARK:
--- 166,174 ----
Centerline(LINES-2, m->help, page);
m->update = 0;
}
!
! menu_PutLine0(page,
! LINES-3, 0, m->prompt);

switch(cmd = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR|READCH_resize)) {
case RESIZE_MARK:
Index: elm2.4.ME+.122-cvs/src/menu_common/alias.c
*** elm2.4.ME+.121/src/menu_common/alias.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/alias.c 2005-02-20 16:16:46.000000000 +0200
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.3 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"

DEBUG_VAR(Debug,__FILE__,"menu");

--- 1,13 ----
! static char rcsid[] = "@(#)$Id: alias.c,v 1.5 2005/02/20 14:16:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"
+ #include "s_aliases.h"

DEBUG_VAR(Debug,__FILE__,"menu");

***************
*** 34,52 ****


S_(mc_setf_status_common mc_setf_status_alias)
! static int mc_setf_status_alias P_((union mcommon_union *u, int idx, int stat));
! static int mc_setf_status_alias(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct AliasView *aview = u->alias.aw;
struct alias_rec *a = give_alias(aview,idx);
int r = 0;

! if (a) {
! setit(a->status,stat);
! r = a->status;
}

return r;
--- 35,62 ----


S_(mc_setf_status_common mc_setf_status_alias)
! static int mc_setf_status_alias P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_setf_status_alias(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct AliasView *aview = u->alias.aw;
struct alias_rec *a = give_alias(aview,idx);
int r = 0;

! if (a) {
! switch (t) {
! case status_basic:
!
! setit(a->status,stat);
! r = a->status;
! break;
!
! /* other status types ignored */
! }
}

return r;
***************
*** 64,73 ****


S_(mc_ison_status_common mc_ison_status_alias)
! static int mc_ison_status_alias P_((union mcommon_union *u, int idx, int stat));
! static int mc_ison_status_alias(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct AliasView *aview = u->alias.aw;
--- 74,85 ----


S_(mc_ison_status_common mc_ison_status_alias)
! static int mc_ison_status_alias P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_ison_status_alias(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct AliasView *aview = u->alias.aw;
***************
*** 75,81 ****
int r = 0;

if (a) {
! r = ison(a->status,stat);
}

return r;
--- 87,100 ----
int r = 0;

if (a) {
! switch (t) {
!
! case status_basic:
! r = ison(a->status,stat);
! break;
!
! /* other status types ignored */
! }
}

return r;
***************
*** 83,92 ****


S_(mc_clearf_status_common mc_clearf_status_alias)
! static int mc_clearf_status_alias P_((union mcommon_union *u, int idx, int stat));
! static int mc_clearf_status_alias(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct AliasView *aview = u->alias.aw;
--- 102,113 ----


S_(mc_clearf_status_common mc_clearf_status_alias)
! static int mc_clearf_status_alias P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_clearf_status_alias(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct AliasView *aview = u->alias.aw;
***************
*** 94,101 ****
int r = 0;

if (a) {
! clearit(a->status,stat);
! r = a->status;
}

return r;
--- 115,129 ----
int r = 0;

if (a) {
! switch (t) {
! case status_basic:
!
! clearit(a->status,stat);
! r = a->status;
! break;
!
! /* other status types ignored */
! }
}

return r;
***************
*** 163,168 ****
--- 191,208 ----
}


+ S_(mc_title_common mc_title_alias)
+ static struct string * mc_title_alias P_((union mcommon_union *u));
+ static struct string * mc_title_alias(u)
+ union mcommon_union *u;
+ {
+ struct AliasView *aview = u->alias.aw;
+
+ return format_string(CATGETS(elm_msg_cat, AliasesSet,
+ AliasesMode,
+ "Alias mode"));
+ }
+
static struct mcommon_type mcommon_alias = {
MCOMMON_TYPE_magic,
mc_get_type_alias,
***************
*** 181,187 ****
mc_limit_print_result_alias,
mc_match_in_text_alias,
mc_screen_print_alias_line,
! mc_give_item_alias
};

void set_mcommon_from_aliasview P_((struct menu_common *m, struct AliasView *aw));
--- 221,228 ----
mc_limit_print_result_alias,
mc_match_in_text_alias,
mc_screen_print_alias_line,
! mc_give_item_alias,
! mc_title_alias
};

void set_mcommon_from_aliasview P_((struct menu_common *m, struct AliasView *aw));
Index: elm2.4.ME+.122-cvs/src/menu_common/alias_item.c
*** elm2.4.ME+.121/src/menu_common/alias_item.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/alias_item.c 2004-12-09 20:55:34.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias_item.c,v 1.3 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias_item.c,v 1.4 2004/12/09 18:55:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************
***************
*** 63,68 ****
--- 63,69 ----
if (! storage[I])
storage[I] = format_string(CATGETS(elm_msg_cat, ElmSet, ElmNoAliases,
"No aliases!"));
+ break;

default:
panic("MENU COMMON PANIC",__FILE__,__LINE__,"mc_give_item_alias",

Index: elm2.4.ME+.122-cvs/src/menu_common/alias_pattern.c
*** elm2.4.ME+.121/src/menu_common/alias_pattern.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/alias_pattern.c 2005-01-08 23:08:05.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias_pattern.c,v 1.4 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias_pattern.c,v 1.5 2005/01/08 21:08:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 152,162 ****
return(res);
}

! int mc_match_in_text_alias(u,meta_pattern, header_page, page)
union mcommon_union *u;
struct string * meta_pattern;
- int header_page;
struct menu_context *page;
{
struct AliasView *aview = u->alias.aw;

--- 152,162 ----
return(res);
}

! int mc_match_in_text_alias(u,meta_pattern, page, LOC)
union mcommon_union *u;
struct string * meta_pattern;
struct menu_context *page;
+ struct screen_parts *LOC;
{
struct AliasView *aview = u->alias.aw;

Index: elm2.4.ME+.122-cvs/src/menu_common/alias_screen.c
*** elm2.4.ME+.121/src/menu_common/alias_screen.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/alias_screen.c 2005-01-08 23:08:05.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias_screen.c,v 1.4 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias_screen.c,v 1.5 2005/01/08 21:08:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 52,62 ****
page);

if (selected && has_highlighting && ! arrow_cursor) {
! StartInverse();
! Write_to_screen(FRM("%S\n\r"), buffer); /* avoid '%' probs */
! EndInverse();
} else
! Write_to_screen(FRM("%S\n\r"), buffer); /* avoid '%' probs */

free_string(&buffer);
}
--- 52,62 ----
page);

if (selected && has_highlighting && ! arrow_cursor) {
! menu_StartXX(page,pg_INVERSE);
! menu_Write_to_screen(page,FRM("%S\n\r"), buffer); /* avoid '%' probs */
! menu_EndXX(page,pg_INVERSE);
} else
! menu_Write_to_screen(page,FRM("%S\n\r"), buffer); /* avoid '%' probs */

free_string(&buffer);
}
Index: elm2.4.ME+.122-cvs/src/menu_common/def_mcommon.h
*** elm2.4.ME+.121/src/menu_common/def_mcommon.h 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/def_mcommon.h 2005-02-20 16:16:46.000000000 +0200
***************
*** 1,4 ****
! /* $Id: def_mcommon.h,v 1.4 2004/03/27 18:31:47 hurtta Exp $ */

#include "headers.h"
#include "me.h"
--- 1,4 ----
! /* $Id: def_mcommon.h,v 1.7 2005/02/20 14:16:46 hurtta Exp $ */

#include "headers.h"
#include "me.h"
***************
*** 26,35 ****
};

typedef int mc_get_type_common P_((union mcommon_union *u, int idx));
! typedef int mc_setf_status_common P_((union mcommon_union *u, int idx, int mask));
typedef int mc_get_current_common P_((union mcommon_union *u));
! typedef int mc_ison_status_common P_((union mcommon_union *u, int idx, int mask));
! typedef int mc_clearf_status_common P_((union mcommon_union *u, int idx, int mask));
typedef char * mc_show_status_common P_((union mcommon_union *u, int idx));
typedef int mc_get_count_common P_((union mcommon_union *u));
typedef int mc_matches_common P_((union mcommon_union *u, int idx, struct string * meta_pattern));
--- 26,38 ----
};

typedef int mc_get_type_common P_((union mcommon_union *u, int idx));
! typedef int mc_setf_status_common P_((union mcommon_union *u, int idx,
! enum status_x t, int mask));
typedef int mc_get_current_common P_((union mcommon_union *u));
! typedef int mc_ison_status_common P_((union mcommon_union *u, int idx,
! enum status_x t, int mask));
! typedef int mc_clearf_status_common P_((union mcommon_union *u, int idx,
! enum status_x t, int mask));
typedef char * mc_show_status_common P_((union mcommon_union *u, int idx));
typedef int mc_get_count_common P_((union mcommon_union *u));
typedef int mc_matches_common P_((union mcommon_union *u, int idx, struct string * meta_pattern));
***************
*** 46,57 ****
typedef void mc_limit_print_result_common P_((union mcommon_union *u));
typedef int mc_match_in_text_common P_((union mcommon_union *u,
struct string * meta_pattern,
! int header_page,
! struct menu_context *page));
typedef void mc_screen_print_common_line P_((union mcommon_union *u,int idx,
struct menu_context *page));
typedef CONST struct string * mc_give_item_common P_((enum mcommon_item I));

struct mcommon_type {
unsigned short magic;

--- 49,62 ----
typedef void mc_limit_print_result_common P_((union mcommon_union *u));
typedef int mc_match_in_text_common P_((union mcommon_union *u,
struct string * meta_pattern,
! struct menu_context *page,
! struct screen_parts *LOC));
typedef void mc_screen_print_common_line P_((union mcommon_union *u,int idx,
struct menu_context *page));
typedef CONST struct string * mc_give_item_common P_((enum mcommon_item I));

+ typedef struct string * mc_title_common P_((union mcommon_union *u));
+
struct mcommon_type {
unsigned short magic;

***************
*** 72,77 ****
--- 77,83 ----
mc_match_in_text_common * mc_match_in_text_it;
mc_screen_print_common_line * mc_screen_print_it_line;
mc_give_item_common * mc_give_item_it;
+ mc_title_common * mc_title_it;
};

#if ANSI_C
***************
*** 113,124 ****
struct string * meta_pattern));
extern int mc_match_in_text_alias P_((union mcommon_union *u,
struct string * meta_pattern,
! int header_page,
! struct menu_context *page));
extern int mc_match_in_text_mbx P_((union mcommon_union *u,
struct string * meta_pattern,
! int header_page,
! struct menu_context *page));

extern void mc_screen_print_alias_line P_((union mcommon_union *u,int idx,
struct menu_context *page));
--- 119,130 ----
struct string * meta_pattern));
extern int mc_match_in_text_alias P_((union mcommon_union *u,
struct string * meta_pattern,
! struct menu_context *page,
! struct screen_parts *LOC));
extern int mc_match_in_text_mbx P_((union mcommon_union *u,
struct string * meta_pattern,
! struct menu_context *page,
! struct screen_parts *LOC));

extern void mc_screen_print_alias_line P_((union mcommon_union *u,int idx,
struct menu_context *page));
Index: elm2.4.ME+.122-cvs/src/menu_common/mailbox.c
*** elm2.4.ME+.121/src/menu_common/mailbox.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/mailbox.c 2005-02-20 16:16:46.000000000 +0200
***************
*** 1,12 ****
! static char rcsid[] = "@(#)$Id: mailbox.c,v 1.3 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"

DEBUG_VAR(Debug,__FILE__,"menu");

--- 1,13 ----
! static char rcsid[] = "@(#)$Id: mailbox.c,v 1.6 2005/02/20 14:16:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"
+ #include "s_elm.h"

DEBUG_VAR(Debug,__FILE__,"menu");

***************
*** 29,52 ****


S_(mc_setf_status_common mc_setf_status_mbx)
! static int mc_setf_status_mbx P_((union mcommon_union *u, int idx, int stat));
! static int mc_setf_status_mbx(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
- struct header_rec *a = give_header(mbxview,idx);
int r = 0;

! if (a) {
! setit(a->status,stat);
! r = a->status;

! /* TODO: What statuses should cause flagging??? */
! a->status_chgd = TRUE;
! }

return r;
}

--- 30,74 ----


S_(mc_setf_status_common mc_setf_status_mbx)
! static int mc_setf_status_mbx P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_setf_status_mbx(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
int r = 0;

! if (mbxview) {

! struct header_rec *a = give_header(mbxview,idx);
!
! if (a) {
! switch (t) {

+ case status_basic:
+ setit(a->status,stat);
+ r = a->status;
+ break;
+
+ case status_1:
+ setit(a->status1,stat);
+ r = a->status1;


+ break;
+
+ default:

+ panic("MENU COMMON PANIC",__FILE__,__LINE__,"mc_setf_status_mbx",
+ "bad status type",0);
+
+ }
+
+ /* TODO: What status codes should cause flagging??? */
+ a->status_chgd = TRUE;
+ }
+
+ }
return r;
}

***************
*** 57,79 ****
{
struct MailboxView *mbxview = u->mbx.mw;

return get_current(mbxview);
}


S_(mc_ison_status_common mc_ison_status_mbx)
! static int mc_ison_status_mbx P_((union mcommon_union *u, int idx, int stat));
! static int mc_ison_status_mbx(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
- struct header_rec *a = give_header(mbxview,idx);
int r = 0;

! if (a) {
! r = ison(a->status,stat);
}

return r;
--- 79,120 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return 0;
+
return get_current(mbxview);
}


S_(mc_ison_status_common mc_ison_status_mbx)
! static int mc_ison_status_mbx P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_ison_status_mbx(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
int r = 0;

! if (mbxview) {
! struct header_rec *a = give_header(mbxview,idx);
!
! if (a) {
! switch (t) {
! case status_basic:
! r = ison(a->status,stat);
! break;
! case status_1:
! r = ison(a->status1,stat);
! break;
! default:
! panic("MENU COMMON PANIC",__FILE__,__LINE__,
! "mc_ison_status_mbx",
! "bad status type",0);
! }
! }
}

return r;
***************
*** 81,102 ****


S_(mc_clearf_status_common mc_clearf_status_mbx)
! static int mc_clearf_status_mbx P_((union mcommon_union *u, int idx, int stat));
! static int mc_clearf_status_mbx(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
- struct header_rec *a = give_header(mbxview,idx);
int r = 0;

! if (a) {
! clearit(a->status,stat);
! r = a->status;
!
! /* TODO: What statuses should cause flagging??? */
! a->status_chgd = TRUE;
}

return r;
--- 122,162 ----


S_(mc_clearf_status_common mc_clearf_status_mbx)
! static int mc_clearf_status_mbx P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_clearf_status_mbx(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
int r = 0;

! if (mbxview) {
! struct header_rec *a = give_header(mbxview,idx);
!
! if (a) {
! switch (t) {
! case status_basic:
! clearit(a->status,stat);
! r = a->status;
! break;
!
! case status_1:
! clearit(a->status1,stat);
! r = a->status1;
! break;
!
! default:
! panic("MENU COMMON PANIC",__FILE__,__LINE__,
! "mc_clearf_status_mbx",
! "bad status type",0);
! }
!
! /* TODO: What statuses should cause flagging??? */
! a->status_chgd = TRUE;
! }
}

return r;
***************
*** 109,119 ****
int idx;
{
struct MailboxView *mbxview = u->mbx.mw;
- struct header_rec *a = give_header(mbxview,idx);
char * r = "";

! if (a) {
! r = show_message_status(a);
}

return r;
--- 169,182 ----
int idx;
{
struct MailboxView *mbxview = u->mbx.mw;
char * r = "";

! if (mbxview) {
! struct header_rec *a = give_header(mbxview,idx);
!
! if (a) {
! r = show_message_status(a);
! }
}

return r;
***************
*** 126,131 ****
--- 189,197 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return 0;
+
return get_message_count(mbxview);
}

***************
*** 136,141 ****
--- 202,210 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return 0;
+
return get_selected(mbxview);
}

***************
*** 147,152 ****
--- 216,224 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return;
+
set_current(mbxview,cur);
}

***************
*** 159,167 ****
--- 231,257 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return;
+
set_selected(mbxview,cur);
}

+ S_(mc_title_common mc_title_mbx)
+ static struct string * mc_title_mbx P_((union mcommon_union *u));
+ static struct string * mc_title_mbx(u)
+ union mcommon_union *u;
+ {
+ struct MailboxView *mbxview = u->mbx.mw;
+
+ if (!mbxview)
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmShownTitleNoMailbox,
+ "No mailbox"));
+
+ return mailbox_title(mbxview);
+ }
+

static struct mcommon_type mcommon_mbx = {
MCOMMON_TYPE_magic,
***************
*** 181,187 ****
mc_limit_print_result_mbx,
mc_match_in_text_mbx,
mc_screen_print_mbx_line,
! mc_give_item_mbx
};

void set_mcommon_from_mbxview P_((struct menu_common *m, struct MailboxView *aw));
--- 271,278 ----
mc_limit_print_result_mbx,
mc_match_in_text_mbx,
mc_screen_print_mbx_line,
! mc_give_item_mbx,
! mc_title_mbx
};

void set_mcommon_from_mbxview P_((struct menu_common *m, struct MailboxView *aw));
Index: elm2.4.ME+.122-cvs/src/menu_common/Makefile.SH
*** elm2.4.ME+.121/src/menu_common/Makefile.SH 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.122-cvs/src/menu_common/Makefile.SH 2005-02-17 11:05:30.000000000 +0200
***************
*** 17,23 ****
echo "Extracting src/menu_common/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.2 2004/02/20 19:38:10 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
--- 17,23 ----
echo "Extracting src/menu_common/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.4 2005/02/17 09:05:30 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
***************
*** 79,87 ****



# Dependencies of C object files

mcommon.o: def_mcommon.h
! alias.o: def_mcommon.h
! mailbox.o: def_mcommon.h
! mailbox.o: def_mcommon.h
alias_limit.o: def_mcommon.h $(INCLDIR)/s_aliases.h $(INCLDIR)/s_elm.h
message_limit.o: def_mcommon.h $(INCLDIR)/s_elm.h
alias_pattern.o: def_mcommon.h
--- 79,86 ----



# Dependencies of C object files

mcommon.o: def_mcommon.h
! alias.o: def_mcommon.h $(INCLDIR)/s_aliases.h
! mailbox.o: def_mcommon.h $(INCLDIR)/s_elm.h
alias_limit.o: def_mcommon.h $(INCLDIR)/s_aliases.h $(INCLDIR)/s_elm.h
message_limit.o: def_mcommon.h $(INCLDIR)/s_elm.h
alias_pattern.o: def_mcommon.h
Index: elm2.4.ME+.122-cvs/src/menu_common/mcommon.c
*** elm2.4.ME+.121/src/menu_common/mcommon.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/mcommon.c 2005-02-20 16:16:46.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mcommon.c,v 1.6 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mcommon.c,v 1.9 2005/02/20 14:16:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 43,58 ****
return u.gen.mtype->mc_get_type_it(&u,idx);
}

! int mcommon_setf_status(m,idx, stat)
struct menu_common *m;
int idx;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_setf_status_it(&u,idx,stat);
}

int mcommon_get_current(m)
--- 43,59 ----
return u.gen.mtype->mc_get_type_it(&u,idx);
}

! int mcommon_setf_status(m,idx, t, stat)
struct menu_common *m;
int idx;
+ enum status_x t;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_setf_status_it(&u,idx,t, stat);
}

int mcommon_get_current(m)
***************
*** 65,93 ****
return u.gen.mtype->mc_get_current_it(&u);
}

! int mcommon_ison_status(m,idx, stat)
struct menu_common *m;
int idx;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_ison_status_it(&u,idx,stat);
}


! int mcommon_clearf_status(m,idx, stat)
struct menu_common *m;
int idx;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_clearf_status_it(&u,idx,stat);
}

char * mcommon_show_status(m,idx)
--- 66,96 ----
return u.gen.mtype->mc_get_current_it(&u);
}

! int mcommon_ison_status(m,idx, t, stat)
struct menu_common *m;
int idx;
+ enum status_x t;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_ison_status_it(&u,idx,t, stat);
}


! int mcommon_clearf_status(m,idx, t, stat)
struct menu_common *m;
int idx;
+ enum status_x t;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_clearf_status_it(&u,idx,t, stat);
}

char * mcommon_show_status(m,idx)
***************
*** 195,212 ****
u.gen.mtype->mc_limit_print_result_it(&u);
}

! int mcommon_match_in_text(m, meta_pattern, header_page, page)
struct menu_common *m;
struct string * meta_pattern;
- int header_page;
struct menu_context *page;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_match_in_text_it(&u, meta_pattern, header_page,
! page);
}

void mcommon_screen_print_menu_line(m,idx,page)
--- 198,215 ----
u.gen.mtype->mc_limit_print_result_it(&u);
}

! int mcommon_match_in_text(m, meta_pattern, page,LOC)
struct menu_common *m;
struct string * meta_pattern;
struct menu_context *page;
+ struct screen_parts *LOC;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_match_in_text_it(&u, meta_pattern,
! page, LOC);
}

void mcommon_screen_print_menu_line(m,idx,page)
***************
*** 236,241 ****
--- 239,262 ----
return m->mtype->mc_give_item_it(I);
}

+ struct string * mcommon_title(m)
+ struct menu_common *m;
+ {
+ union mcommon_union u;
+
+ if (m->magic != MENU_COMMON_magic)
+ panic("MENU COMMON PANIC",__FILE__,__LINE__,"mcommon_title",
+ "bad magic",0);
+
+ if (m->mtype->magic != MCOMMON_TYPE_magic)
+ panic("MENU COMMON PANIC",__FILE__,__LINE__,"mcommon_title",
+ "bad type magic",0);
+
+ mcommon_st_to_union(m,&u);
+
+ return m->mtype->mc_title_it(&u);


+ }
+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.122-cvs/src/menu_common/message_limit.c
*** elm2.4.ME+.121/src/menu_common/message_limit.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/message_limit.c 2005-02-20 16:16:46.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: message_limit.c,v 1.7 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: message_limit.c,v 1.8 2005/02/20 14:16:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 373,382 ****
{
if (last_selected)
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmEnterLastSelected,
! "Enter: {\"subject\",\"to\",\"from\",\"cc\",\"header\"} [pattern] OR {\"thread\",\"tagged\",\"all\"}"));
else
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmEnterSelected,
! "Enter: {\"subject\",\"to\",\"from\",\"header\"} [pattern] OR \"thread\",\"tagged\"}"));

}

--- 373,382 ----
{
if (last_selected)
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmEnterLastSelected,
! "Enter: {\"subject\",\"to\",\"from\",\"cc\",\"header\"} [pattern] OR {\"tagged\",\"all\",...}"));
else
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmEnterSelected,
! "Enter: {\"subject\",\"to\",\"from\",\"header\"} [pattern] OR \"thread\",\"tagged\",...}"));

}

Index: elm2.4.ME+.122-cvs/src/menu_common/message_pattern.c
*** elm2.4.ME+.121/src/menu_common/message_pattern.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/message_pattern.c 2005-07-01 12:15:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: message_pattern.c,v 1.4 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: message_pattern.c,v 1.7 2005/07/01 09:15:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 213,225 ****
hdl->u.search_mes -> pat, ptr->description));
}

! mime_get_charset(&res, ptr->type_opts,NULL,
default_mimetext_charset /* FIXME: No correct */);

while (0 < (l = state_getl(buffer,sizeof buffer,state_in))) {
struct string *x = new_string(res);

! add_streambytes_to_string(x,l,s2us(buffer));

if (find_pattern_from_string(x,hdl->u.search_mes -> pat,1)) {
hdl->u.search_mes -> found = 1;
--- 213,225 ----
hdl->u.search_mes -> pat, ptr->description));
}

! mime_get_charset(&res, ptr->TYPE_opts,NULL,
default_mimetext_charset /* FIXME: No correct */);

while (0 < (l = state_getl(buffer,sizeof buffer,state_in))) {
struct string *x = new_string(res);

! add_streambytes_to_string(x,l,s2us(buffer),NULL);

if (find_pattern_from_string(x,hdl->u.search_mes -> pat,1)) {
hdl->u.search_mes -> found = 1;
***************
*** 241,251 ****
mw_action_search
};

! int mc_match_in_text_mbx(u,meta_pattern, header_page, page)
union mcommon_union *u;
struct string * meta_pattern;
- int header_page;
struct menu_context *page;
{
struct MailboxView *mbxview = u->mbx.mw;
int LINES, COLUMNS;
--- 241,251 ----
mw_action_search
};

! int mc_match_in_text_mbx(u,meta_pattern, page, LOC)
union mcommon_union *u;
struct string * meta_pattern;
struct menu_context *page;
+ struct screen_parts *LOC;
{
struct MailboxView *mbxview = u->mbx.mw;
int LINES, COLUMNS;
***************
*** 344,350 ****
"mime_parse_routine was not called\n"));
mime_parse_routine(NULL,hdr,ZZ);
}
! show_msg_status(message_number, & (u->gen), header_page);

/* Copy some headers from part 1 */
if (skip_envelope(hdr, ZZ) != -1) {
--- 344,361 ----
"mime_parse_routine was not called\n"));
mime_parse_routine(NULL,hdr,ZZ);
}
!
! {
! struct menu_common MENU;
! int vis;
!
! set_mcommon_from_mbxview(&MENU,mbxview);
!
! vis = compute_visible(message_number+1, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);
!
! }
!

/* Copy some headers from part 1 */
if (skip_envelope(hdr, ZZ) != -1) {
Index: elm2.4.ME+.122-cvs/src/menu_common/message_screen.c
*** elm2.4.ME+.121/src/menu_common/message_screen.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/menu_common/message_screen.c 2005-02-20 16:16:46.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: message_screen.c,v 1.4 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: message_screen.c,v 1.6 2005/02/20 14:16:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 64,72 ****

menu_get_sizes(page, &LINES, &COLUMNS);

-
if (selected && has_highlighting && ! arrow_cursor)
! StartInverse();

buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
ElmNotCollected,
--- 64,71 ----

menu_get_sizes(page, &LINES, &COLUMNS);

if (selected && has_highlighting && ! arrow_cursor)
! menu_StartXX(page,pg_INVERSE);

buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
ElmNotCollected,
***************
*** 83,103 ****
free_string(&buffer);

if (buffer1) {
! Write_to_screen(FRM("%S"),buffer1);
free_string(&buffer1);
}

if (selected && !arrow_cursor) {
while (l < COLUMNS) {
! Writechar(' ');
l++;
}
}

if (selected && has_highlighting && ! arrow_cursor)
! EndInverse();

! NewLine();
}

static void print_header_line(entry,message_number,selected,from,really_to,
--- 82,103 ----
free_string(&buffer);

if (buffer1) {
! menu_Write_to_screen(page,FRM("%S"),buffer1);
free_string(&buffer1);
}

if (selected && !arrow_cursor) {
while (l < COLUMNS) {
! menu_Writechar(page,' ');
l++;
}
}

if (selected && has_highlighting && ! arrow_cursor)
! menu_EndXX(page,pg_INVERSE);

! menu_Writechar(page,'\r');
! menu_Writechar(page,'\n');
}

static void print_header_line(entry,message_number,selected,from,really_to,
***************
*** 124,135 ****
--- 124,143 ----
int X,len1,fill_len;
int was_len;
int LINES, COLUMNS;
+ char tagged= ' ';

menu_get_sizes(page, &LINES, &COLUMNS);

/* truncate 'from' to 18 characters -
* this includes the leading "To" if really_to is true.
*/
+
+ if (entry->status & TAGGED)
+ tagged = '+';
+ else if (entry->status1 & S1_FLAGGED)
+ tagged = 'F';
+ else
+ tagged = ' ';

if (*entry->time_menu == '\0')
make_menu_date(entry);
***************
*** 140,146 ****
}

if (selected && has_highlighting && ! arrow_cursor)
! StartInverse();

X = 0;
bufferwho = curses_printable_clip(from,&X,who_width,&len1,who_width);
--- 148,154 ----
}

if (selected && has_highlighting && ! arrow_cursor)
! menu_StartXX(page,pg_INVERSE);

X = 0;
bufferwho = curses_printable_clip(from,&X,who_width,&len1,who_width);
***************
*** 154,164 ****
if (fill_len < 0)
fill_len = 0;

! if (entry->lines < 0)
buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s %.3s%S%*s (?) "),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
! (entry->status & TAGGED? '+' : ' '),
message_number,
entry->time_menu,
(really_to ? "To " : ""),
--- 162,173 ----
if (fill_len < 0)
fill_len = 0;

! if (entry->lines < 0) {
!
buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s %.3s%S%*s (?) "),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
! tagged,
message_number,
entry->time_menu,
(really_to ? "To " : ""),
***************
*** 167,177 ****

fill_len,""
);
! else
buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s %.3s%S%*s (%d) %s"),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
! (entry->status & TAGGED? '+' : ' '),
message_number,
entry->time_menu,
(really_to ? "To " : ""),
--- 176,186 ----

fill_len,""
);
! } else
buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s %.3s%S%*s (%d) %s"),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
! tagged,
message_number,
entry->time_menu,
(really_to ? "To " : ""),
***************
*** 207,213 ****
subj_width = COLUMNS-header_without_subj_width;

if (buffer1) {
! Write_to_screen(FRM("%S"),buffer1);
free_string(&buffer1);
}

--- 216,222 ----
subj_width = COLUMNS-header_without_subj_width;

if (buffer1) {
! menu_Write_to_screen(page,FRM("%S"),buffer1);
free_string(&buffer1);
}

***************
*** 221,227 ****
&was_len,subj_width);

if (buffer2) {
! Write_to_screen(FRM("%S"),buffer2);
free_string(&buffer2);
}
} else
--- 230,236 ----
&was_len,subj_width);

if (buffer2) {
! menu_Write_to_screen(page,FRM("%S"),buffer2);
free_string(&buffer2);
}
} else
***************
*** 233,247 ****
*/
if (selected && !arrow_cursor) {
while (was_len < subj_width) {
! Writechar(' ');
was_len++;
}
}
!
!
if (selected && has_highlighting && ! arrow_cursor)
! EndInverse();

Kari E. Hurtta

unread,
Jul 13, 2005, 5:42:40 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.3

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 3/18
=========================================================================


* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 23,39 ****



/******** global variables accessable by all pieces of the program *******/

-

- extern int check_size; /* don't start mailer if no mail */
-
-
- extern int inalias; /* TRUE if in the alias menu */
- extern int last_current; /* previous current message */
- extern int last_header_page; /* last header page */
- extern int headers_per_page; /* number of headers/page */
extern int original_umask; /* original umask, for restore before subshell */
extern int sendmail_verbose; /* Allow extended debugging on sendmail */
- extern int nucurr; /** change list or just the current pointer **/

extern char cur_editfile[SLEN]; /* editor buffer */
extern char defaultfile[SLEN]; /* name of default folder */
--- 23,30 ----
Index: elm2.4.ME+.122-cvs/hdrs/mailer_imp.h
*** elm2.4.ME+.121/hdrs/mailer_imp.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/mailer_imp.h 2005-05-21 20:58:30.000000000 +0300
***************
*** 1,7 ****
! /* $Id: mailer_imp.h,v 1.8 2004/05/23 12:31:00 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! /* $Id: mailer_imp.h,v 1.9 2005/05/21 17:58:30 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 9,15 ****
#if ANSI_C
struct mailer_config;
struct mailer_option_list;
! struct mailer_config;
#endif


--- 9,15 ----
#if ANSI_C
struct mailer_config;
struct mailer_option_list;
! struct mailer_info;
#endif


Index: elm2.4.ME+.122-cvs/hdrs/mailerlib.h
*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/mailerlib.h 2005-05-21 20:58:30.000000000 +0300
***************
*** 0 ****
--- 1,127 ----
+ /* $Id: mailerlib.h,v 1.2 2005/05/21 17:58:30 hurtta Exp $ */
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ * or Kari Hurtta <e...@elmme-mailer.org>
+ *****************************************************************************/
+

+ /* init.c */
+

+ extern void init_mailerlib P_((void));
+
+
+ /* mailer.c */
+
+ extern int mailerfunc P_((char **value, int enter,
+ int lineno, char *filename));
+
+ typedef void sending_message_func P_((int background));
+
+ extern struct mailer_info *get_mailer_info P_((void));
+ extern void free_mailer_info P_((struct mailer_info **S));
+
+ enum MI_query { MI_HAVE_8BITMIME = 1, MI_HAVE_BINARYMIME = 2,
+ MI_HAVE_DSN = 3, MI_DONT_ADD_FROM = 4,
+ MI_USE_DOMAIN = 5
+ };
+
+
+ extern int query_mailer_info P_((struct mailer_info *I,
+ enum MI_query query));
+
+ /* -1 if connection lost
+ 0 if OK
+ 1 if mailer reinitialized and query_mailer_info()
+ need to be called again
+ */
+ extern int mailer_restarted P_((struct mailer_info *I));
+
+ /* Should return 1 if verify succees and fields of result to be filled
+ -- caller should free fields of result
+ Returns 0 on failure
+ */
+
+ enum mailer_errcode {
+ MAILER_OK = 0, /* Address OK */
+ MAILER_NOT_AVAIL, /* Address verify not available */
+ MAILER_NOT_EXIST /* Address not exists */
+ };
+
+ int verify_mailer_addr P_((struct mailer_info *I,
+ CONST char *text,
+ struct addr_item *result,
+ enum mailer_errcode *errcode));
+ int verify_mailer_domaddr P_((struct mailer_info *I,
+ CONST char *text,
+ struct addr_item *result,
+ enum mailer_errcode *errcode));
+
+
+
+ /* Return NULL if no editor (and no value either) */
+ extern struct mailer_env_from * mailer_get_env_from P_((struct mailer_info *I));
+ extern void mailer_free_env_from P_((struct mailer_env_from **X));
+ extern int env_from_changed P_((struct mailer_env_from *X));
+
+ /* return temporary pointer value -- do not free
+ return NULL if currently no value set (use implicit default)
+ */
+ extern CONST char * mailer_env_from_value P_((struct mailer_env_from *X,
+ int *can_edit));
+
+ extern void mailer_env_from_change P_((struct mailer_env_from *X,
+ const char * value));
+
+ extern struct mail_send_state *mailer_init P_((char **addr_args,
+ int dsn,
+ int verbose,
+ struct mailer_info *info,
+ struct mailer_env_from *env_from));
+
+ /* Note that also mail_backend2 does freeing ... */
+ extern void free_mail_send_state P_((struct mail_send_state **S));
+
+
+ extern out_state_t *get_mail_outfd P_((struct mail_send_state *X));
+
+ /* mail_backend2 may free pointer ... */
+ extern int mail_backend2 P_((struct mail_send_state **mail_fd,
+ end_handler *func,
+ int encoding_top,
+ char * title,
+ sending_message_func *sm));
+
+ /* Return mailer path or type ... */
+ extern CONST char *get_mailer_path P_((struct mail_send_state *mail_fd));
+
+ void init_default_mailer P_((void));
+
+ extern char * kludge_addr P_((char **addr));
+ extern char **argv_from_headers P_((struct mailing_headers * headers));
+
+
+ /* outheaders.c */
+
+ extern void zero_mailing_headers P_((struct mailing_headers *hdrs));
+ extern void free_mailing_headers P_((struct mailing_headers *hdrs));
+
+ extern char * from_addr_literal P_((struct mailer_info *mailer_info));
+
+ extern void make_from_addr P_((struct expanded_address *expanded,
+ struct mailer_info *mailer_info));
+
+ /* shared_mailer.c */
+
+ #ifdef USE_DLOPEN
+ extern SHAREDLIB use_shared_all;
+ #endif


+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/hdrs/mbx_imp.h
*** elm2.4.ME+.121/hdrs/mbx_imp.h 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/mbx_imp.h 2005-05-08 12:24:57.000000000 +0300
***************
*** 1,7 ****


! /* $Id: mbx_imp.h,v 1.67 2004/04/24 12:30:02 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! /* $Id: mbx_imp.h,v 1.69 2005/05/08 09:24:57 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 212,217 ****
--- 212,218 ----
POP_not_logged } pop_states;

struct remote_account {
+ unsigned short magic; /* REMOTE_ACCOUNT_magic */
SOCKADDR hostaddr;

struct streamsched *stream;

***************
*** 518,523 ****
--- 519,526 ----
typedef void browser_do_stat P_((struct folder_browser *dir,
int idx));

+ typedef void browser_folder_sort_dir P_((struct folder_browser *dir,
+ print_sort_message * print));

#define WS_magic 0xFE00

***************
*** 564,569 ****
--- 567,573 ----
browser_update_dir * browser_update_it;
browser_do_stat * browser_stat_routine;
browser_sync_write_dir * browser_sync_write_it;
+ browser_folder_sort_dir * browser_folder_sort_it;
};

#ifdef REMOTE_MBX
***************
*** 600,605 ****
--- 604,610 ----
char * sys_name;
struct string * disp_name;
int flags;
+ time_t mtime; /* modify time for local files */
} * vector, *selection;

struct string * filter; /* name filter */
Index: elm2.4.ME+.122-cvs/hdrs/me.h
*** elm2.4.ME+.121/hdrs/me.h 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/me.h 2005-07-01 19:05:29.000000000 +0300
***************
*** 1,7 ****
! /* $Id: me.h,v 1.102 2004/07/28 17:10:12 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.102 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: me.h,v 1.123 2005/07/01 16:05:29 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.123 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 11,20 ****

#include "melib.h"

/* args.c */

/* Returns array of files requested */
! extern char ** parse_arguments P_((int argc, char *argv[], char ***to_whom));
extern char * wanted_charset;
extern int wanted_switchmode;

--- 11,33 ----

#include "melib.h"

+ enum { elm_mp_menu, elm_mp_modified, elm_mp_COUNT };
+ struct menu_param {
+ enum menu_para_type { mp_integer, mp_menu_common, mp_END } t;
+ union {
+ int i;
+ struct menu_common *c;
+ } u;
+ };
+
+ enum check_mode { chk_none, chk_size, chk_unread } ;
+
+
/* args.c */

/* Returns array of files requested */
! extern char ** parse_arguments P_((int argc, char *argv[], char ***to_whom,
! enum check_mode *chk_mode));
extern char * wanted_charset;
extern int wanted_switchmode;

***************
*** 42,50 ****

#endif

! void initialize P_((char **name_vector, struct MailboxView **main_mailbox,
! struct AliasView **main_alaises, int *header_page,
! struct menu_context **page));

/* file_util.c */

--- 55,75 ----

#endif

! extern void initialize P_((struct AliasView **main_alaises,
! struct menu_context **page));
!
! struct screen_parts {
! struct menu_context *title_page;
! struct menu_context *header_page;
! struct menu_context *menu_page;
! struct menu_context *prompt_page;
! };
!
! struct MailboxView * initialize_mailbox P_((char **requestedmfiles,
! struct menu_context *page,
! struct AliasView *main_aliases,
! enum check_mode check_mode
! ));

/* file_util.c */

***************
*** 63,114 ****

/* showmsg_c.c */

extern int showmsg_main_cmd P_(( struct MailboxView *mailbox,
! int cmd, int *screen_mangled,
! struct menu_context *page));
! extern void put_cmd_name P_((char *command, int will_mangle,
! struct menu_common *menu,
! struct menu_context *page));
extern void put_border P_(( struct menu_context *page));
extern void build_bottom P_((struct menu_common *menu,
struct menu_context *page));

typedef int showmsg_cmd P_(( struct MailboxView *mailbox,
! int cmd, int *screen_mangled,
! struct menu_context *page));

extern int process_showmsg_cmd P_((int command,
struct MailboxView *mailbox,
showmsg_cmd cmd,
struct AliasView *aview,
! int *header_page,
! struct menu_context *page));
/* elm.c */



/* Return key if unknown */

extern int motion P_((int ch, struct menu_common *mc,
! int *nufoot,

! int *header_page,
struct menu_context *page));
! extern void check_range P_((struct menu_common *mc));


extern void forget_passphrase P_((void) );

extern int mailbox_command P_((struct MailboxView *mailbox, int ch,
! int *nufoot,
showmsg_cmd cmdX,
struct AliasView *aview,

- int *header_page,


struct menu_context *page
));
extern void new_mail_check P_((struct MailboxView *mailbox,
! int *header_page,

! struct menu_context *page));


/* help.c */



extern int display_helpfile P_((int section));

! extern void help P_((int pager_help, struct menu_context *page));

/* in_utils.c */

--- 88,154 ----

/* showmsg_c.c */

+ struct pager_page {
+ struct menu_context * root; /* Or parent */
+
+ struct menu_param PARAM[elm_mp_COUNT+1];
+
+ struct menu_context * border_line;
+ struct menu_context * prompt_area; /* on showmsg_c */
+ };
+
extern int showmsg_main_cmd P_(( struct MailboxView *mailbox,
! int cmd,
! struct pager_page *pager_page));
! extern void put_cmd_name P_((struct pager_page *pager_page,
! int will_mangle,
! const char * format, const char *msg, ...));
!
extern void put_border P_(( struct menu_context *page));
extern void build_bottom P_((struct menu_common *menu,
struct menu_context *page));

typedef int showmsg_cmd P_(( struct MailboxView *mailbox,
! int cmd,
! struct pager_page *pager_page));

extern int process_showmsg_cmd P_((int command,
struct MailboxView *mailbox,
showmsg_cmd cmd,
struct AliasView *aview,
! struct pager_page * pager_page));
/* elm.c */

+ extern void mailbox_screen_common P_((struct menu_context *page,
+ struct screen_parts *LOC,
+ struct menu_param *LIST));
+
+ extern void free_mailbox_screen P_((struct screen_parts *LOC));
+

/* Return key if unknown */

extern int motion P_((int ch, struct menu_common *mc,

! struct screen_parts *LOC,
struct menu_context *page));
! extern void check_range P_((struct menu_common *mc,
! struct screen_parts *LOC));


extern void forget_passphrase P_((void) );

extern int mailbox_command P_((struct MailboxView *mailbox, int ch,

! struct screen_parts *LOC,


showmsg_cmd cmdX,
struct AliasView *aview,

struct menu_context *page
));
extern void new_mail_check P_((struct MailboxView *mailbox,

! struct menu_context *page,
! struct screen_parts *LOC));


/* help.c */



extern int display_helpfile P_((int section));

! extern void help P_((int pager_help, struct menu_context *page,
! struct menu_context *prompt_area));

/* in_utils.c */

***************
*** 116,122 ****
int clear_and_center,
struct menu_context *page));


extern int read_number P_((int ch, const struct string *item, int current,
! struct menu_context *page));

#define PROMPT_center 1
#define PROMPT_yesno 2

--- 156,163 ----
int clear_and_center,
struct menu_context *page));


extern int read_number P_((int ch, const struct string *item, int current,

! struct menu_context *page,
! struct menu_context *prompt_area));

#define PROMPT_center 1
#define PROMPT_yesno 2

***************
*** 129,135 ****
struct menu_context *page,


const char * format, const char *msg, ...));

-
#define OE_APPEND_CURRENT (1<<0)
#define OE_PASSWD (1<<1)
#define OE_REDRAW_MARK (1<<2)
--- 170,175 ----
***************
*** 138,144 ****


#define OE_ALLOW_MIMEENC (1<<5)
#define OE_EDITOR_ESCAPE (1<<6)
#define OE_TABACTION (1<<7)

! #define OE_SIG_CHAR (1<<8)



extern int optionally_enter2 P_((struct menu_context *page,
struct string **buffer,

--- 178,184 ----


#define OE_ALLOW_MIMEENC (1<<5)
#define OE_EDITOR_ESCAPE (1<<6)
#define OE_TABACTION (1<<7)

! #define OE_SIG_CHAR (1<<8)



extern int optionally_enter2 P_((struct menu_context *page,
struct string **buffer,
***************

*** 147,159 ****
extern int optionally_enter P_((char *string, int x, int y,
int flags, int size,
struct menu_context *page));
- extern int pattern_enter P_((struct string **string,
- struct string **alt_string,
- int x, int y,
- struct string *alternate_prompt,
- struct string *prompt,
- int *redraw,
- struct menu_context *page));
extern int GetPrompt P_((struct menu_context *page));


--- 187,192 ----
***************
*** 200,214 ****
extern void lower_prompt P_((char *s));

extern void prompt P_((char *s));
! extern void prompt_s P_((const struct string *S));

extern void set_central_message P_((const char *format,
const char *line, ...));
extern void display_central_message P_((void));
extern void clear_central_message P_((void));
extern void print_center P_((int line, struct string * buffer));
extern void print_format_center P_((int lineY,const char *format,
const char *line, ...));

extern void Raw_OFF P_((int exiting)); /* used on init.c for exit */

--- 233,253 ----
extern void lower_prompt P_((char *s));

extern void prompt P_((char *s));
! extern void prompt_s P_((struct menu_context *page,
! const struct string *S));

extern void set_central_message P_((const char *format,
const char *line, ...));
extern void display_central_message P_((void));
extern void clear_central_message P_((void));
extern void print_center P_((int line, struct string * buffer));
+ extern void menu_print_center P_((struct menu_context *ptr,
+ int line, struct string * buffer));
extern void print_format_center P_((int lineY,const char *format,
const char *line, ...));
+ extern void menu_print_format_center P_((struct menu_context *ptr,
+ int lineY,const char *format,
+ const char *line, ...));

extern void Raw_OFF P_((int exiting)); /* used on init.c for exit */

***************
*** 226,234 ****
struct MailboxView *mailbox,
struct AliasView *aview));


extern int pattern_match P_((struct menu_common *mc,

! int header_page, struct menu_context *page));


extern int meta_match P_((int function, struct menu_common *mc,

! int meta_match, struct menu_context *page));


/* addr_util.c */
--- 265,275 ----
struct MailboxView *mailbox,
struct AliasView *aview));


extern int pattern_match P_((struct menu_common *mc,

! struct menu_context *page,
! struct screen_parts *LOC));

extern int meta_match P_((int function, struct menu_common *mc,

! struct menu_context *page,
! struct screen_parts *LOC));


/* addr_util.c */
***************
*** 269,307 ****

extern void alias P_((struct MailboxView *mailbox,
struct AliasView *aview));
! extern void main_state P_((void));
extern void open_alias_files P_((struct AliasView *aview,
! int *alias_header_page));
extern int delete_from_alias_text P_((char **name, int num_to_delete));
extern void install_aliases P_((struct AliasView *aview,
! int *header_page));

/* a_edit.c */

! int edit_aliases_text P_((struct AliasView *aview, int *header_page,
! struct menu_context *page));

/* a_sort.c */

! void sort_aliases P_((int entries, int visible, int are_in_aliases,


! struct AliasView *aview));
!

/* a_screen.c */

extern struct string *build_alias_line P_((struct alias_rec *entry,
int message_number, int highlight,
struct menu_context *page));

! extern void alias_screen P_((int modified, struct AliasView *aview,
! int *header_page, struct menu_context *page));
! extern void alias_title P_((int modified, struct AliasView *aview));
extern void show_alias_menu P_((struct menu_context *page));

extern char *show_alias_status P_((struct alias_rec *entry));
extern void set_folder_window_title P_((struct folder_info *folder,
char *title_s, char *icon_s));

/* a_quit.c */

extern void exit_alias P_((struct AliasView *aview));
--- 310,357 ----

extern void alias P_((struct MailboxView *mailbox,
struct AliasView *aview));
!
extern void open_alias_files P_((struct AliasView *aview,
! struct screen_parts *LOC));
extern int delete_from_alias_text P_((char **name, int num_to_delete));
extern void install_aliases P_((struct AliasView *aview,
! struct screen_parts *LOC));

/* a_edit.c */

! extern int edit_aliases_text P_((struct AliasView *aview,
! struct menu_context *page,
! struct screen_parts *LOC));

/* a_sort.c */

! extern void sort_aliases P_((int entries, int visible, int are_in_aliases,
! struct AliasView *aview));
! extern char *alias_sort_name P_((int type));

/* a_screen.c */

+ #if ANSI_C
+ struct menu_param;
+ #endif
+
extern struct string *build_alias_line P_((struct alias_rec *entry,
int message_number, int highlight,
struct menu_context *page));

! extern void alias_screen P_((struct AliasView *aview,
! struct menu_context *page));
! extern int sb_alias_menu P_((struct menu_context *ptr,
! struct menu_param *list));
!
extern void show_alias_menu P_((struct menu_context *page));

extern char *show_alias_status P_((struct alias_rec *entry));
extern void set_folder_window_title P_((struct folder_info *folder,
char *title_s, char *icon_s));

+ extern char *alias_type P_((int type));
+
/* a_quit.c */

extern void exit_alias P_((struct AliasView *aview));
***************
*** 313,319 ****
*/
extern int delete_aliases P_((int newaliases, int prompt,


struct AliasView *aview,
! struct menu_context * page));

/* exitprog.c */

--- 363,370 ----
*/
extern int delete_aliases P_((int newaliases, int prompt,
struct AliasView *aview,
! struct menu_context * page,
! struct menu_context * prompt_area));

/* exitprog.c */

***************
*** 327,334 ****


extern void init_helpmsg P_(( char *, char *, int, int ));

extern int save P_((int silently, int delete, int text_only,
struct MailboxView *mailbox,

! struct AliasView *aview, int header_page,
! struct menu_context *page));

/* fileutil.c */

--- 378,388 ----


extern void init_helpmsg P_(( char *, char *, int, int ));

extern int save P_((int silently, int delete, int text_only,
struct MailboxView *mailbox,

! struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area,
! struct menu_context *header_area));
!

/* fileutil.c */

***************
*** 343,350 ****
FILE *infile,
struct menu_context *page));
extern void pgp_mail_public_key P_((struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *page));
#endif

/* read_rc.c */
--- 397,405 ----
FILE *infile,
struct menu_context *page));
extern void pgp_mail_public_key P_((struct MailboxView *mailbox,
! struct AliasView *aview,


! struct menu_context *page,
! struct menu_context *prompt_area));

#endif

/* read_rc.c */
***************
*** 352,373 ****
extern void directory_check P_((void));


!
! extern int metapager P_((FILE *fp,
! struct header_rec *hdr,
! int do_headers,
! int current,
! int message_count,
! struct menu_context *page));
! extern int builtinplusplus P_((struct stringbuffer * bout));

/* mime.c */

extern int have_metamail P_((void));
extern void clear_mime_send_info P_((mime_send_t *mime_info));
extern void free_mime_send_info P_((mime_send_t *mime_info));
- extern void add_paramater_1 P_((char **ptr, char *name,
- char *value, int quoted));

/* Returns 1 if OK */
extern int convert_text P_((FILE *source, FILE *dest,
--- 407,421 ----
extern void directory_check P_((void));


! /* builtin++.c */
! extern int builtinplusplus P_((struct stringbuffer * bout,
! struct pager_page * pager_page));

/* mime.c */

extern int have_metamail P_((void));
extern void clear_mime_send_info P_((mime_send_t *mime_info));
extern void free_mime_send_info P_((mime_send_t *mime_info));

/* Returns 1 if OK */
extern int convert_text P_((FILE *source, FILE *dest,
***************
*** 379,387 ****
struct mailer_info *mailer_info,
struct menu_context *page));

- extern void add_parameter_1 P_((char **ptr, char *name, char *value,
- int quoted));


/* strings.c */

--- 427,437 ----
struct mailer_info *mailer_info,
struct menu_context *page));


+ extern void add_parameter_1 P_((char **ptr,
+ char *name,
+ char *value,
+ int quoted));

/* strings.c */

***************
*** 398,405 ****

/* string2.c */

- extern void remove_possible_trailing_spaces P_((char *string));
-
/* NOTE: Must be 'int ch', no 'char ch' so that it matches to default promotion
of arguments
*/
--- 448,453 ----
***************
*** 454,460 ****
extern int open_folder_lock P_((int direction,struct folder_info *folder));
extern int reopen_folder_lock_sessionlock P_((struct folder_info *folder));
extern int is_pre_mime_content_type P_((mime_t *,char *));
- extern int same_file P_((char *,char *));

extern int parse_header_routine P_((struct folder_info *folder,
READ_STATE read_state_ptr,
--- 502,507 ----
***************
*** 474,486 ****
extern void newmbox_1 P_((struct folder_info *new_folder,
int adds_only,
struct MailboxView **mailbox,
! int append, int *header_page,
struct menu_context *page));
extern int read_new_mails P_((struct current_storage *storage,
struct menu_context *page));
extern void resort_mailbox P_((struct MailboxView *mailbox,
! int add_new_only, int *header_page
! ));

/* file_util.c */

--- 521,532 ----
extern void newmbox_1 P_((struct folder_info *new_folder,
int adds_only,
struct MailboxView **mailbox,
! int append,
struct menu_context *page));
extern int read_new_mails P_((struct current_storage *storage,
struct menu_context *page));
extern void resort_mailbox P_((struct MailboxView *mailbox,
! int add_new_only));

/* file_util.c */

***************
*** 493,516 ****




extern void a_sendmsg P_((int edit_message, int form_letter,

! struct MailboxView *mailbox,
! struct AliasView *aview, int header_page,
! struct menu_context *page));
extern void send_msg_argv P_((char *argv[],
! char *given_subject,int options, int form,
! struct MailboxView *mailbox /* null ?? */,
! struct AliasView *aview,
! struct menu_context *page));


extern void send_msg_l P_((int index,

! struct addr_item *given_to,
! struct addr_item *given_cc,
! char *given_subject,
! int options, int form_letter,
! struct MailboxView *mailbox,
! struct AliasView *aview,


! struct menu_context *page
! ));

extern void display_to P_((struct expanded_address address,

struct menu_context *page));
extern int get_to P_((struct expanded_address *to,
--- 539,564 ----




extern void a_sendmsg P_((int edit_message, int form_letter,

! struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *page,
! struct screen_parts *LOC));


extern void send_msg_argv P_((char *argv[],

! char *given_subject,int options, int form,
! struct MailboxView *mailbox /* null ?? */,
! struct AliasView *aview,


! struct menu_context *page,
! struct menu_context *prompt_area));

extern void send_msg_l P_((int index,

! struct addr_item *given_to,
! struct addr_item *given_cc,
! char *given_subject,
! int options, int form_letter,
! struct MailboxView *mailbox,
! struct AliasView *aview,


! struct menu_context *page,
! struct menu_context *prompt_area));

extern void display_to P_((struct expanded_address address,

struct menu_context *page));
extern int get_to P_((struct expanded_address *to,
***************
*** 518,524 ****
struct AliasView *aview,
struct menu_context *page,


struct MailboxView *cancel_view,
! int *cancel_selection));


/* mailmsg2.c */

--- 566,573 ----
struct AliasView *aview,
struct menu_context *page,
struct MailboxView *cancel_view,
! int *cancel_selection,
! struct menu_context *prompt_area));


/* mailmsg2.c */
***************
*** 557,568 ****

/* froms.c */

! extern int mail_filled_in_form P_((int mail_index,
! struct addr_item *address,
! char *subject,
! struct MailboxView *
! mailbox /* for save_copy */,
! struct AliasView *aview));

/* aliaslib.c */

--- 606,618 ----

/* froms.c */

! extern void mail_filled_in_form P_((int mail_index,
! struct addr_item *address,
! char *subject,
! struct MailboxView *
! mailbox /* for save_copy */,
! struct AliasView *aview,
! struct menu_context *parent_page));

/* aliaslib.c */

***************
*** 581,598 ****


struct MailboxView *mailbox));
#ifdef ALLOW_SUBSHELL

extern void subshell P_((struct MailboxView *mailbox,

! struct menu_context *page));
#endif


extern void do_pipe P_((struct MailboxView *mailbox,

! struct menu_context *page));
extern int have_printout P_((void));


extern void print_msg P_((int pause_on_scroll,
struct MailboxView *mailbox,

struct menu_context *page));
extern void print_text P_((int pause_on_scroll,
! struct MailboxView *mailbox,


! int header_page,
! struct menu_context *page));

extern int create_folder_state_file P_((struct MailboxView *mailbox));
extern int remove_folder_state_file P_((void));
--- 631,650 ----


struct MailboxView *mailbox));
#ifdef ALLOW_SUBSHELL

extern void subshell P_((struct MailboxView *mailbox,

! struct menu_context *page,
! struct menu_context *prompt_area));

#endif


extern void do_pipe P_((struct MailboxView *mailbox,

! struct menu_context *page,
! struct menu_context *prompt_area));

extern int have_printout P_((void));


extern void print_msg P_((int pause_on_scroll,
struct MailboxView *mailbox,

struct menu_context *page));
extern void print_text P_((int pause_on_scroll,
! struct MailboxView *mailbox,
! struct menu_context *page,
! struct menu_context *header_area));

extern int create_folder_state_file P_((struct MailboxView *mailbox));
extern int remove_folder_state_file P_((void));
***************
*** 611,619 ****

extern void zero_copy_file P_((struct copy_file *cf));
extern void clear_copy_file P_((struct copy_file *cf));
! extern int name_copy_file P_((struct copy_file *cf,
! struct AliasView *aview,
! struct menu_context *page));

extern int save_copy P_((struct mailing_headers * headers,
struct copy_file *cf,
--- 663,671 ----

extern void zero_copy_file P_((struct copy_file *cf));
extern void clear_copy_file P_((struct copy_file *cf));
! extern void name_copy_file P_((struct copy_file *cf,
! struct AliasView *aview,
! struct menu_context *page));

extern int save_copy P_((struct mailing_headers * headers,
struct copy_file *cf,
***************
*** 640,651 ****

/* mime.c */

! extern int check_for_multipart P_((FILE *, mime_send_t *,
! struct mailer_info *));
extern int needs_encoding P_((FILE *));

/* mime_encode.c */

extern int attach_message P_((mime_t *part, out_state_t *mailer,
mime_send_t *mime_info,
struct mime_send_part * X));
--- 692,707 ----

/* mime.c */

! extern int check_for_multipart P_((FILE *filedesc, mime_send_t *mime_info,
! struct mailer_info *mailer_info,
! charset_t from_charset));
extern int needs_encoding P_((FILE *));

/* mime_encode.c */

+ extern void add_parameter P_((char *opts, char *name, char *value,
+ int size, int quoted));
+
extern int attach_message P_((mime_t *part, out_state_t *mailer,
mime_send_t *mime_info,
struct mime_send_part * X));
***************
*** 659,666 ****
int istext,
mime_send_t *mime_info));
extern char *mime_generate_boundary P_((char *, int));
- extern void add_parameter P_((char *,char *,char *,int, int));
- extern void add_parameter_t P_((mime_t *, char *, char *, int));

extern int update_encoding P_((int *,int));
extern void write_encoded P_((FILE *srcfp, out_state_t *mailer, int encoding,
--- 715,720 ----


***************
*** 685,690 ****
--- 739,748 ----

extern int Attach_it P_((char *));
extern int Check_attachments P_((void));

+ #define MAX_COMPAT_LEN 70
+ extern char * compat_filename P_((char * orig, int *ok));
+ extern struct string * pick_name P_((const struct string *str));
+
/* returnadd.c */
extern void kludge P_((char *buffer, int size));

***************
*** 706,713 ****
extern void rm_temps_exit P_((void));
extern void silently_exit P_((void));
extern void leave_locked P_((void));
! extern int get_page P_((int msg_pointer, struct menu_common *mc,
! int *header_page));

/* date.c */

--- 764,773 ----
extern void rm_temps_exit P_((void));
extern void silently_exit P_((void));
extern void leave_locked P_((void));
! extern void get_page P_((struct menu_common *mc,
! struct menu_context *header_page));
!
! extern void malloc_failed_exit P_((char *proc,unsigned n));

/* date.c */

***************
*** 727,750 ****
int trans_to_lowercase,
int size));


extern void forward P_((int index,

! struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *page));


extern void reply_to_everyone P_((int index,

! struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *page));


extern void reply P_((int index,

! struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *page));

/* leavembox.c */

int leave_mbox P_((int resyncing, int quitting, int prompt,
struct folder_info **new_folder,


struct MailboxView *mailbox,
! int *header_page, struct menu_context *page));

/* mkhdrs.c */

--- 787,816 ----
int trans_to_lowercase,
int size));


extern void forward P_((int index,

! struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area,
! struct menu_context *header_area));


extern void reply_to_everyone P_((int index,

! struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area,
! struct menu_context *header_area));


extern void reply P_((int index,

! struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area,
! struct menu_context *header_area));

/* leavembox.c */

int leave_mbox P_((int resyncing, int quitting, int prompt,
struct folder_info **new_folder,
struct MailboxView *mailbox,
! struct menu_context *page));

/* mkhdrs.c */

***************
*** 755,760 ****
--- 821,831 ----

extern int options P_((struct MailboxView *mailbox,
struct AliasView *aview));
+ extern char * level_name P_((int n));
+ extern void init_opts_menu P_((void));
+
+ struct optsmenu * find_cfg_opts P_((int c));
+

/* hdrconfig.c */

***************
*** 770,776 ****
struct mailer_info *mailer_info, int c,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

extern void edit_headers P_((struct mailing_headers *headers,
struct mailer_info *mailer_info,
charset_t hdr_charset,
--- 841,848 ----
struct mailer_info *mailer_info, int c,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

extern void edit_headers P_((struct mailing_headers *headers,
struct mailer_info *mailer_info,
charset_t hdr_charset,
***************
*** 788,796 ****

/* remail.c */

! extern int remail P_((struct header_rec *hdr,
! FILE *F, struct AliasView *aview,
! struct menu_context *page));
#ifdef MMDF
extern void do_mmdf_addresses P_((FILE *dest_file,
struct mailing_headers * headers));
--- 860,869 ----

/* remail.c */

! extern void remail P_((struct header_rec *hdr,
! FILE *F, struct AliasView *aview,


! struct menu_context *page,
! struct menu_context *prompt_area));

#ifdef MMDF
extern void do_mmdf_addresses P_((FILE *dest_file,
struct mailing_headers * headers));
***************
*** 822,844 ****

/* delete.c */

! extern void delete_msg P_((int real_del, int update_screen,
! struct menu_common *mc, int header_page));
! extern void undelete_msg P_((int update_screen,struct menu_common *mc,
! int header_page));
! extern void show_msg_status P_((int msg,struct menu_common *menu,
! int header_page));
! extern void show_msg_tag P_((int msg,struct menu_common *menu,
! int header_page));
! extern void show_new_status P_((int msg,struct menu_common *menu,
! int header_page));
extern int DeleteTagged P_((struct menu_common *menu,


! int header_page,
! struct menu_context *page));

! extern int tag_message P_((int update_screen, struct menu_common *mc,
! int header_page));
! extern void unread_msg P_((int update_screen, struct MailboxView *mailbox,
! int header_page));

/* encode.c */

--- 895,914 ----

/* delete.c */

! extern void delete_msg P_((int real_del,
! struct menu_common *mc,
! struct screen_parts *LOC));
! extern void undelete_msg P_((struct menu_common *mc,
! struct menu_context *header_area));
extern int DeleteTagged P_((struct menu_common *menu,
! struct menu_context *page,
! struct menu_context *header_area));
! extern int tag_message P_((struct menu_common *mc,
! struct menu_context *header_area));
! extern int flag_message P_((struct menu_common *mc,
! struct menu_context *header_area));
! extern void unread_msg P_((struct MailboxView *mailbox,
! struct menu_context *header_area));

/* encode.c */

***************
*** 860,873 ****
/* quit.c */



extern void quit P_((int prompt, struct MailboxView **mailbox,

! struct AliasView **aview, int *header_page,
struct menu_context *page));


! extern void resync P_((struct MailboxView **mailbox, int *header_page,

! struct menu_context *page));


! extern void change_file P_((struct MailboxView **mailbox,

! struct AliasView *aview,
! int *header_page,
! struct menu_context *page));


/* save_opts.c */
--- 930,943 ----
/* quit.c */



extern void quit P_((int prompt, struct MailboxView **mailbox,

! struct AliasView **aview,
struct menu_context *page));


! extern void resync P_((struct MailboxView **mailbox,

! struct menu_context *page,
! struct screen_parts *LOC));

! extern struct MailboxView * change_file P_((struct MailboxView *mailbox,
! struct AliasView *aview,
! struct menu_context *page));


/* save_opts.c */
***************
*** 880,920 ****

/* screen.c */

! typedef void menu_func P_((struct menu_context *page));
! extern void showscreen P_((struct MailboxView *mailbox,
! menu_func *menu, int *header_page,
! struct menu_context *page));
! extern void update_title P_((struct MailboxView *mailbox,
! struct menu_context *page));
! extern void show_menu P_((struct menu_context *page));
! extern void show_current P_((struct menu_common *menu, int *header_page,
! struct menu_context *page));
! extern int show_headers P_((struct menu_common *menu, int *header_page,
! struct menu_context *page));
! extern int on_page P_((int message, struct menu_common *menu,
! int header_page));

/* showmsg.c */

extern void OverrideCharset P_((struct MailboxView *mailbox,


! int header_page,
! struct menu_context *page));

extern int show_msg P_((struct header_rec *current_header,
FILE *infile, int current, int message_count,
! struct menu_context *page));

! extern int need_meta P_((struct header_rec *hdr));

/* sort.c */

extern void sort_mailbox P_((int entries, int visible,
struct MailboxView *mailbox));

/* edit.c */



extern void edit_mailbox P_((struct MailboxView **mailbox,

- int *header_mailbox,
struct menu_context *page));
extern int edit_a_file P_((const char *editfile,
struct menu_context *page));
--- 950,1005 ----

/* screen.c */

! extern void showscreen P_((struct menu_context *page));
! extern void copy_current P_((struct menu_common *menu,
! struct menu_context *ptr));
! extern int sb_update_title P_((struct menu_context *ptr,
! struct menu_param *list));
!
! extern int sb_show_menu P_((struct menu_context *ptr,
! struct menu_param *list));
! extern void hdr_show_header P_((struct menu_context *ptr,
! struct menu_param *list,
! int line_number,
! int index,
! int is_current));
! extern void hdr_show_current P_((struct menu_context *ptr,
! struct menu_param *list,
! int line_number,
! int index,
! int is_current));
! extern void hdr_show_status P_((struct menu_context *ptr,
! struct menu_param *list,
! int line_number,
! int index,
! int is_current));
!

/* showmsg.c */

+
+
extern void OverrideCharset P_((struct MailboxView *mailbox,
! struct menu_context *page,
! struct menu_context *prompt_area,
! struct menu_context *header_area));

extern int show_msg P_((struct header_rec *current_header,
FILE *infile, int current, int message_count,
! struct pager_page *pager_page));

! extern int need_meta P_((struct header_rec *hdr, int current,
! int message_count));

/* sort.c */

extern void sort_mailbox P_((int entries, int visible,
struct MailboxView *mailbox));
+ extern char *sort_name P_((int type));

/* edit.c */



extern void edit_mailbox P_((struct MailboxView **mailbox,

struct menu_context *page));
extern int edit_a_file P_((const char *editfile,
struct menu_context *page));
***************
*** 930,936 ****


extern int visible_to_index P_((int message,
struct menu_common *mc));

extern void limit P_((struct menu_common *mc,

! struct menu_context *page));


extern void ClearSelection P_((struct MailboxView *mailbox));


--- 1015,1022 ----


extern int visible_to_index P_((int message,
struct menu_common *mc));

extern void limit P_((struct menu_common *mc,

! struct menu_context *page,
! struct screen_parts *LOC));

extern void ClearSelection P_((struct MailboxView *mailbox));


***************

*** 944,950 ****
extern struct folder_info * folder_browser P_((struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
- int *redraw,
struct AliasView *aview,
CONST char *format,
CONST char *msg, ...));
--- 1030,1035 ----
***************
*** 956,962 ****
extern int gen_browser P_((struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
- int *redraw,
enum word_sel w,
struct string * prev_fold,
struct AliasView *aview,
--- 1041,1046 ----
***************
*** 971,983 ****
extern int file_browser P_((struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
! int * redraw, enum word_sel w,
struct AliasView *aview,
const char *format, const char *msg, ...));

/* metapager.c */

extern void PressAnyKeyToContinue P_((void));

/* signals.c */

--- 1055,1079 ----
extern int file_browser P_((struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
! enum word_sel w,
struct AliasView *aview,
const char *format, const char *msg, ...));

/* metapager.c */

+
+ extern struct pager_page * init_pager_page P_((struct menu_common *mptr));
+ extern void exit_pager_page P_((struct pager_page ** pager_page,
+ struct menu_context * other));
+
extern void PressAnyKeyToContinue P_((void));
+ extern struct string * title_text P_((struct header_rec *hdr, int current,
+ int message_count,
+ int width, charset_t cs));
+
+ extern int metapager P_((FILE *fp, struct header_rec *hdr,
+ int do_headers, int current, int message_count,
+ struct pager_page * pager_page));

/* signals.c */

***************
*** 991,996 ****
--- 1087,1122 ----
extern void init_signals P_((void));
extern void init_signals1 P_((void));

+ extern SIGHAND_TYPE quit_signal P_((int));
+ extern SIGHAND_TYPE hup_signal P_((int));
+ extern SIGHAND_TYPE term_signal P_((int));
+ extern SIGHAND_TYPE ill_signal P_((int));
+ extern SIGHAND_TYPE fpe_signal P_((int));
+ #ifdef SIGBUS
+ extern SIGHAND_TYPE bus_signal P_((int));
+ #endif
+ extern SIGHAND_TYPE segv_signal P_((int));
+ extern SIGHAND_TYPE alarm_signal P_((int));
+ extern SIGHAND_TYPE pipe_signal P_((int));
+ #ifdef SIGTSTP
+ extern SIGHAND_TYPE sig_user_stop P_((int));
+ extern SIGHAND_TYPE sig_return_from_user_stop P_((int));
+ #endif
+ #ifdef SIGWINCH
+ extern SIGHAND_TYPE winch_signal P_((int));
+ #endif
+ extern SIGHAND_TYPE usr1_signal P_((int ));
+ extern SIGHAND_TYPE usr2_signal P_((int));


+
+
+
+
+

+
+
+
+
+
/* src/messages/ */

struct current_storage {
***************
*** 1158,1167 ****
char *last_canceled_mail));


extern void delete_current_cancel P_((struct MailboxView * cancel_view,

FILE *ref_file));
- /* src/screen/screen.c */
-
- extern int InitScreen P_((struct menu_context **page));
- extern void ScreenSize P_((int *lines, int *columns));

/* src/screen/context.c */

--- 1284,1289 ----
***************
*** 1179,1225 ****



extern void menu_trigger_redraw P_((struct menu_context *ptr));

/* called from signal handler */
extern void menu_context_resize P_((void));
extern void menu_context_redraw P_((void));

! extern int menu_ReadCh P_((struct menu_context *ptr, int flags));
! extern int menu_ClearScreen P_((struct menu_context *ptr));
! extern struct charset_state * menu_ReadCh2 P_((struct menu_context *ptr,
! int flags));


! extern void cancel_set_ttysig_X P_(());
! extern void cancel_reset_ttysig_X P_(());




/* ------------------------------------------------------- */

extern void Writechar P_((int ch));

extern void Write_to_screen P_((CONST char *format, CONST char *msg, ...));
extern void PutLine0 P_((int x, int y, CONST char *line));
extern void PutLineX P_((int line , int col, CONST char *, CONST char *, ...));
! extern int CleartoEOLN P_((void));
! extern int CleartoEOS P_((void));
extern int RawState P_((void));
extern struct menu_context * Raw P_((int state));
extern struct charset_state * ReadCh2 P_((int flags));
extern int ReadCh P_((int flags));
extern void GetXYLocation P_((int *x,int *y));
! extern int ClearScreen P_((void));
! extern int MoveCursor P_((int row, int col));
extern void CarriageReturn P_((void));
extern void NewLine P_((void));
! extern int StartBold P_((void));
! extern int EndBold P_((void));
! extern int StartInverse P_((void));
! extern int EndInverse P_((void));
! extern int ClearScreen P_((void));
extern int get_tabspacing P_((void));
- extern int StartUnderline P_((void));
- extern int EndUnderline P_((void));
- extern int StartHalfbright P_((void));
- extern int EndHalfbright P_((void));

/* screen/curses.c */

--- 1301,1478 ----



extern void menu_trigger_redraw P_((struct menu_context *ptr));

+ /* Call refresh routines of children */

+ extern void menu_redraw_children P_((struct menu_context *ptr));


+
/* called from signal handler */
extern void menu_context_resize P_((void));
extern void menu_context_redraw P_((void));

! extern void cancel_set_ttysig_X P_((void));
! extern void cancel_reset_ttysig_X P_((void));

+ /* src/screen/subpage.c */

! extern int mp_lookup_integer P_((struct menu_param *list, int idx));
! extern struct menu_common * mp_lookup_mcommon P_((struct menu_param *list,
! int idx));
!
! extern void mp_list_set_integer P_((struct menu_param *list, int idx, int v));
! extern void mp_list_set_mcommon P_((struct menu_param *list,
! int idx,
! struct menu_common *v));
!
!
! /* Returns 1 if redraw not need to be signaled */
! typedef int subpage_simple_redraw P_((struct menu_context *ptr,
! struct menu_param *list));
! extern int subpage_simple_noredraw P_((struct menu_context *ptr,
! struct menu_param *list));
!
! extern struct menu_context * new_menu_subpage P_((struct menu_context *parent,
! int rel_start_line,
! int lines,
! subpage_simple_redraw redraw,
! /* only rerefrence is saved */
! struct menu_param *list));
!
! extern void menu_subpage_relocate P_((struct menu_context *subpage,
! struct menu_context *parent,
! int rel_start_line,
! int lines));
!
! typedef void header_line_redraw P_((struct menu_context *ptr,
! struct menu_param *list,
! int line_number,
! int index,
! int is_current));
! extern void header_line_noredraw P_((struct menu_context *ptr,
! struct menu_param *list,
! int line_number,
! int index,
! int is_current));
!
! typedef void header_param_changed P_((struct menu_context *ptr,
! struct menu_param *list,
! int param_index));
! extern void null_header_param_changed P_((struct menu_context *ptr,
! struct menu_param *list,
! int param_index));
!
!
! extern struct menu_context * new_menu_header P_((struct menu_context *parent,
! int rel_start_line,
! int lines,
! header_line_redraw line_redraw,
! header_line_redraw current_redraw,
! header_param_changed param_change,
! header_line_redraw status_redraw,
! /* only rereference is saved */
! struct menu_param *list));
!
!
! enum header_params { header_top_line, header_current,
! HEADER_PARAMS_COUNT };
!
! extern void menu_header_change P_((struct menu_context *subpage,
! enum header_params param,
! int value));
!
! extern int menu_header_get P_((struct menu_context *subpage,
! enum header_params param));
! extern int menu_header_change_item P_((struct menu_context *subpage,
! int index));
!
! extern void menu_header_relocate P_((struct menu_context *subpage,
! struct menu_context *parent,
! int rel_start_line,
! int lines));

+ extern void menu_header_status_update P_((struct menu_context *subpage,
+ int item));

/* ------------------------------------------------------- */
+ /* src/screen/screen.c */
+
+ #define ClearLine(n) MoveCursor(n,0); CleartoEOLN()
+ #define menu_ClearLine(page,n) menu_MoveCursor(page,n,0); menu_CleartoEOLN(page)
+
+
+ extern int InitScreen P_((struct menu_context **page));
+
+ extern void ScreenSize P_((int *lines, int *columns));
+
+ /* NOTE: menu_ScreenSize DO NOT return lines-1 (as ScreenSize() do */
+ extern void menu_ScreenSize P_((struct menu_context * ctx,
+ int *lines, int *columns));
+
+ extern void menu_set_default P_((struct menu_context *ctx));



extern void Writechar P_((int ch));

+ extern void menu_Writechar P_((struct menu_context * ctx, int ch));
+
extern void Write_to_screen P_((CONST char *format, CONST char *msg, ...));
+ extern void menu_Write_to_screen P_((struct menu_context * ctx,
+ CONST char *format, CONST char *msg, ...));
+
extern void PutLine0 P_((int x, int y, CONST char *line));
+ extern void menu_PutLine0 P_((struct menu_context * ctx,
+ int x, int y, CONST char *line));
+
extern void PutLineX P_((int line , int col, CONST char *, CONST char *, ...));
! extern void menu_PutLineX P_((struct menu_context * ctx,
! int line , int col, CONST char *, CONST char *, ...));
!
! extern void CleartoEOLN P_((void));
! extern void menu_CleartoEOLN P_((struct menu_context * ctx));
!
! extern void CleartoEOS P_((void));
! extern void menu_CleartoEOS P_((struct menu_context * ctx));
!
!
extern int RawState P_((void));
extern struct menu_context * Raw P_((int state));
+
extern struct charset_state * ReadCh2 P_((int flags));
+ extern struct charset_state * menu_ReadCh2 P_((struct menu_context *ptr,
+ int flags));
+
extern int ReadCh P_((int flags));
+ extern int menu_ReadCh P_((struct menu_context *ptr, int flags));
+
extern void GetXYLocation P_((int *x,int *y));
! extern void menu_GetXYLocation P_((struct menu_context *ctx,
! int *x,int *y));
!
! extern void ClearScreen P_((int interrupt));
! extern void menu_ClearScreen P_((struct menu_context *ptr));
!
! extern void MoveCursor P_((int row, int col));
! extern void menu_MoveCursor P_((struct menu_context *ptr,
! int row, int col));
! extern int menu_GetAbsLine P_((struct menu_context *ctx,int row));
!
extern void CarriageReturn P_((void));
extern void NewLine P_((void));
!
! extern void StartBold P_((void));
! extern void EndBold P_((void));
! extern void StartInverse P_((void));
! extern void EndInverse P_((void));
! extern void StartUnderline P_((void));
! extern void EndUnderline P_((void));
! extern void StartHalfbright P_((void));
! extern void EndHalfbright P_((void));
!
! #define pg_BOLD 0x01
! #define pg_UNDERLINE 0x02
! #define pg_HALFBRIGHT 0x04
! #define pg_INVERSE 0x08
!
! extern void menu_StartXX P_((struct menu_context *ctx, int f));
! extern void menu_EndXX P_((struct menu_context *ctx, int f));
!
extern int get_tabspacing P_((void));

/* screen/curses.c */

***************
*** 1244,1250 ****

extern int set_display_charset P_((charset_t set, int silent));
extern void switch_display_charset P_((int to_display));
!

/* screen/termtitle.c */

--- 1497,1503 ----

extern int set_display_charset P_((charset_t set, int silent));
extern void switch_display_charset P_((int to_display));
! extern void init_system_charset P_((void));

/* screen/termtitle.c */

***************
*** 1329,1343 ****
*/
extern int mcommon_get_type P_((struct menu_common *m, int idx));

/* bit field:
ACTION, CONFIDENTIAL, DELETED, EXPIRED, FORM_LETTER, NEW,
PRIVATE_MAIL, TAGGED, URGENT, VISIBLE, UNREAD, REPLIED,
MIME_MESSAGE, PRE_MIME_CONTENT, MIME_UNSUPPORTED, NOHDRENCODING
*/
! extern int mcommon_setf_status P_((struct menu_common *m, int idx, int stat));
! extern int mcommon_ison_status P_((struct menu_common *m, int idx, int stat));
! #define mcommon_isoff_status(m,idx,stat) (!mcommon_ison_status(m,idx,stat))
! extern int mcommon_clearf_status P_((struct menu_common *m, int idx, int stat));
extern char * mcommon_show_status P_((struct menu_common *m, int idx));

/* note that current is index+1 */
--- 1582,1606 ----
*/
extern int mcommon_get_type P_((struct menu_common *m, int idx));

+ enum status_x { status_basic, status_1 };
/* bit field:
+
+ status_basic:
ACTION, CONFIDENTIAL, DELETED, EXPIRED, FORM_LETTER, NEW,
PRIVATE_MAIL, TAGGED, URGENT, VISIBLE, UNREAD, REPLIED,
MIME_MESSAGE, PRE_MIME_CONTENT, MIME_UNSUPPORTED, NOHDRENCODING
+
+ status_1:
+ S1_FLAGGED
*/
! extern int mcommon_setf_status P_((struct menu_common *m, int idx,

! enum status_x t, int stat));

! extern int mcommon_ison_status P_((struct menu_common *m, int idx,

! enum status_x t, int stat));

! #define mcommon_isoff_status(m,idx,t,stat) (!mcommon_ison_status(m,idx,t,stat))
! extern int mcommon_clearf_status P_((struct menu_common *m, int idx,

! enum status_x t, int stat));
!

extern char * mcommon_show_status P_((struct menu_common *m, int idx));

/* note that current is index+1 */
***************
*** 1360,1367 ****
extern void mcommon_limit_print_result P_((struct menu_common *m));
extern int mcommon_match_in_text P_((struct menu_common *m,


struct string * meta_pattern,
! int header_page,
! struct menu_context *page));

extern void mcommon_screen_print_menu_line P_((struct menu_common *m,
int idx,
--- 1623,1630 ----
extern void mcommon_limit_print_result P_((struct menu_common *m));
extern int mcommon_match_in_text P_((struct menu_common *m,


struct string * meta_pattern,
! struct menu_context *page,
! struct screen_parts *LOC));

extern void mcommon_screen_print_menu_line P_((struct menu_common *m,
int idx,
***************
*** 1373,1378 ****
--- 1636,1643 ----

extern CONST struct string * mcommon_give_item P_((struct menu_common *m,
enum mcommon_item I));
+
+ extern struct string * mcommon_title P_((struct menu_common *m));

/*
* Local Variables:
Index: elm2.4.ME+.122-cvs/hdrs/melib.h
*** elm2.4.ME+.121/hdrs/melib.h 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/melib.h 2005-07-01 12:15:03.000000000 +0300
***************
*** 1,7 ****
! /* $Id: melib.h,v 1.45 2004/07/27 20:25:01 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! /* $Id: melib.h,v 1.46 2005/07/01 09:15:03 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 31,37 ****
extern void pgp_SG_decoder P_((mime_t *body, mime_t *sign,
in_state_t *state_in,
out_state_t *state_out,
! char *micalg,
charset_t defcharset,
struct header_rec *mss));
extern void pgp_EC_decoder P_((mime_t *init, mime_t *data,
--- 31,37 ----
extern void pgp_SG_decoder P_((mime_t *body, mime_t *sign,
in_state_t *state_in,
out_state_t *state_out,
! const char *micalg,
charset_t defcharset,
struct header_rec *mss));
extern void pgp_EC_decoder P_((mime_t *init, mime_t *data,
***************
*** 141,151 ****
extern void mime_t_copy P_((mime_t *, mime_t *));
extern void mime_t_zero P_((mime_t *));
extern void mime_destroy P_((mime_t *));
! extern void mime_get_disposition P_((char *, mime_t *));
! extern void mime_get_content P_((char *, mime_t *));
extern int class_charset P_((char *charset_value));
extern int mime_get_charset P_((charset_t *ret,
! const char *buffer,
charset_t * display_charset,
charset_t default_content_charset
));
--- 141,153 ----
extern void mime_t_copy P_((mime_t *, mime_t *));
extern void mime_t_zero P_((mime_t *));
extern void mime_destroy P_((mime_t *));
! extern void mime_get_disposition P_((char *value, mime_t *mt,
! charset_t def_charset));
! extern void mime_get_content P_((char *value, mime_t *mt,
! charset_t def_charset));
extern int class_charset P_((char *charset_value));
extern int mime_get_charset P_((charset_t *ret,
! struct mime_param *buffer,
charset_t * display_charset,
charset_t default_content_charset


));
***************
*** 156,162 ****

char *boundary, int opts,
charset_t defcharset,
int have_boundary));
! extern int mime_get_boundary P_((char *, char *, int));

extern int mime_parse_routine P_((struct folder_info *folder,
struct header_rec *hdr,
--- 158,164 ----
char *boundary, int opts,
charset_t defcharset,
int have_boundary));
! extern CONST char * mime_get_boundary P_((struct mime_param *P));

extern int mime_parse_routine P_((struct folder_info *folder,
struct header_rec *hdr,
***************
*** 247,259 ****
typedef void signed_decoder P_((mime_t *body, mime_t *sign,
in_state_t *state_in,
out_state_t *state_out,
! char *micalg, charset_t defcharset,
struct header_rec *mss));
extern void null_SG_decoder P_((mime_t *body,
mime_t *sign,
in_state_t *state_in,
out_state_t *state_out,
! char *micalg,
charset_t defcharset,
struct header_rec *mss));
typedef signed_decoder * SG_decoder_t;
--- 249,262 ----
typedef void signed_decoder P_((mime_t *body, mime_t *sign,
in_state_t *state_in,
out_state_t *state_out,
! const char *micalg,
! charset_t defcharset,
struct header_rec *mss));
extern void null_SG_decoder P_((mime_t *body,
mime_t *sign,
in_state_t *state_in,
out_state_t *state_out,
! const char *micalg,
charset_t defcharset,
struct header_rec *mss));
typedef signed_decoder * SG_decoder_t;
***************
*** 348,353 ****
--- 351,395 ----
struct header_rec *mss));
extern int partial_selector P_((mime_t *p, struct header_rec * hdr));

+ /* mime_param.c */
+
+ #if ANSI_C
+ struct mime_param;
+ #endif
+
+ extern CONST char * get_mime_param_compat P_((struct mime_param *P, char *name));
+
+ extern CONST char * get_mime_param_ascii P_((struct mime_param *P, char *name));
+ extern CONST struct string * get_mime_param P_((struct mime_param *P, char *name));
+
+ extern void free_mime_param P_((struct mime_param **x));
+
+ extern struct mime_param * parse_mime_param P_((char *headername,
+ char *value,
+ charset_t def));
+
+ extern struct mime_param * parse_mime_param_string P_((struct string *value,
+ int gen_compat_len,
+ int plain_mode));
+
+ extern struct mime_param * copy_mime_param P_((struct mime_param *src));
+ extern struct string * show_mime_params P_((struct mime_param *P));
+ extern char * encode_mime_params P_((struct mime_param *P));
+ extern char ** encode_mime_params_v P_((struct mime_param *P));
+
+ extern char ** split_mime_params P_((struct mime_param **P,
+ struct string *in_buffer,
+ int gen_compat_len,
+ int plain_mode));
+
+
+ extern void mime_params_add_compat P_((struct mime_param **P,
+ char *name,
+ char *value));
+ extern void mime_params_add P_((struct mime_param **P,
+ char *name,
+ struct string *value));
+
/* --------------- */

/* mime_decode.c uses this ... */
Index: elm2.4.ME+.122-cvs/hdrs/mime.h
*** elm2.4.ME+.121/hdrs/mime.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/mime.h 2005-07-01 12:15:03.000000000 +0300
***************
*** 1,5 ****
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,5 ----
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 36,45 ****
char * encoding_part_text; /* [include ..] produces */

media_type_t TYPE;
! char * type_opts_part;

int disposition;
! char * disposition_opts;

struct string * description;

--- 36,45 ----
char * encoding_part_text; /* [include ..] produces */

media_type_t TYPE;
! struct mime_param * TYPE_opts_part;

int disposition;
! struct mime_param * DISPOSITION_opts;

struct string * description;

***************
*** 63,69 ****
* pass -BBINARYMIME to mailer
*/
char mime_boundary[STRING];
! char * type_opts_top;

charset_t hdr_charset; /* to what charset headers should be flagged */
int encode_hdr;
--- 63,69 ----
* pass -BBINARYMIME to mailer
*/
char mime_boundary[STRING];
! struct mime_param * TYPE_opts_top;

charset_t hdr_charset; /* to what charset headers should be flagged */
int encode_hdr;
Index: elm2.4.ME+.122-cvs/hdrs/ndbz.h
*** elm2.4.ME+.121/hdrs/ndbz.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/ndbz.h 2005-06-18 00:02:53.000000000 +0300
***************
*** 1,7 ****
! /* $Id: ndbz.h,v 1.5 2004/03/27 18:31:37 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: ndbz.h,v 1.6 2005/06/17 21:02:53 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 120,128 ****
extern DBZ *dbz_open P_((char *,int, int));
extern datum dbz_fetch P_((DBZ *,datum));
extern int dbz_store P_((DBZ *,datum,datum));
! extern int dbz_delete(); /* not in dbz */
! extern datum dbz_firstkey(); /* not in dbz */
! extern datum dbz_nextkey(); /* not in dbz */
extern int dbz_close P_((DBZ *)); /* in dbz, but not in old dbm */

/* new stuff for dbz */
--- 120,128 ----
extern DBZ *dbz_open P_((char *,int, int));
extern datum dbz_fetch P_((DBZ *,datum));
extern int dbz_store P_((DBZ *,datum,datum));
!
!
!
extern int dbz_close P_((DBZ *)); /* in dbz, but not in old dbm */

/* new stuff for dbz */
***************
*** 131,138 ****
extern int dbz_sync P_((DBZ *));
extern long dbz_size P_((long));
extern int dbz_incore P_((int));
! extern int dbz_cancel();
! extern int dbz_debug();

/*
* In principle we could handle unlimited-length keys by operating a chunk
--- 131,138 ----
extern int dbz_sync P_((DBZ *));
extern long dbz_size P_((long));
extern int dbz_incore P_((int));
! extern int dbz_cancel P_((DBZ *db));
!

/*
* In principle we could handle unlimited-length keys by operating a chunk
Index: elm2.4.ME+.122-cvs/hdrs/rc_imp.h
*** elm2.4.ME+.121/hdrs/rc_imp.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/rc_imp.h 2005-05-21 20:58:30.000000000 +0300
***************
*** 1,7 ****
! /* $Id: rc_imp.h,v 1.13 2004/06/18 09:29:50 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! /* $Id: rc_imp.h,v 1.18 2005/05/21 17:58:30 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 16,22 ****
typedef int rc_parse_line P_((struct rc_save_info_rec *r,
int lcl,
char *value, int lineno, char *filename,
- int e_val,
int negate));
typedef int rc_parse_cline P_((struct rc_save_info_rec *r,
int lcl,
--- 16,21 ----
***************
*** 41,49 ****
rc_get_value * get_value;

} rc_DT_SYN, rc_DT_STR, rc_DT_NUM, rc_DT_BOL,
! rc_DT_CHR, rc_DT_SRT,
! rc_DT_MLT, rc_DT_ASR, rc_DT_PRM, rc_DT_FUNC,
! rc_DT_LONG, rc_DT_PATH, rc_DT_OBS, rc_DT_ESTR;

extern int valid_rc_type P_((struct rc_type *T));

--- 40,49 ----
rc_get_value * get_value;

} rc_DT_SYN, rc_DT_STR, rc_DT_NUM, rc_DT_BOL,
! rc_DT_CHR, rc_DT_SORT,
! rc_DT_MLT, rc_DT_PRM, rc_DT_FUNC,
! rc_DT_LONG, rc_DT_PATH, rc_DT_OBS, rc_DT_ESTR,
! rc_DT_ENUM, rc_DT_DELAY;

extern int valid_rc_type P_((struct rc_type *T));

***************
*** 59,67 ****
#define DT_NUM &rc_DT_NUM /* number */
#define DT_BOL &rc_DT_BOL /* ON/OFF (boolean) */
#define DT_WEE &rc_DT_WEE /* weed list */
- #define DT_SRT &rc_DT_SRT /* sort-by code */
#define DT_MLT &rc_DT_MLT /* multiple destinations for data */
- #define DT_ASR &rc_DT_ASR /* sort-by code */
#define DT_PRM &rc_DT_PRM /* file permissions */
#define DT_FUNC &rc_DT_FUNC /* function to be called for process option */
#define DT_LONG &rc_DT_LONG /* number */
--- 59,65 ----
***************
*** 85,90 ****
--- 83,104 ----
char *fieldname,
char *val));

+
+ extern void mark_XX P_((struct rc_save_info_rec *x));
+
+ #ifdef USE_DLOPEN
+ extern void mark_shared_changed P_((void *A));
+ extern void mark_fshared_changed P_((option_func *A));
+ #endif
+
+ extern void register_delayed P_((struct rc_save_info_rec * rc_options,
+ int rc_option_count));
+ extern int rc_eval_tail P_((struct rc_save_info_rec *ret,int lcl, char *value,
+ int lineno, char *filename, int negate));
+
+ extern void mark_delayed_changed P_((void *A));
+ extern void mark_fdelayed_changed P_((option_func *A));


+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.122-cvs/hdrs/reghelper.h
*** elm2.4.ME+.121/hdrs/reghelper.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/reghelper.h 2005-04-13 23:22:42.000000000 +0300
***************
*** 1,12 ****
extern void log_it P_((char *letter,char * target_r,
! char *user, char *group, int mode));
extern void write_once P_((int fd, char *buffer, int L));

extern void add_to_buffer P_((char *buffer, size_t blen, char **ptr,
char *str, int s_len));

extern char * program_name;
! extern int register_fd;

void reghelper_init P_((void));

--- 1,14 ----
extern void log_it P_((char *letter,char * target_r,
! char *user, char *group, int mode,
! char *module));
extern void write_once P_((int fd, char *buffer, int L));

extern void add_to_buffer P_((char *buffer, size_t blen, char **ptr,
char *str, int s_len));

extern char * program_name;
! extern int register_fd;
! extern char * register_module;

void reghelper_init P_((void));

Index: elm2.4.ME+.122-cvs/hdrs/s_aliases.h
*** elm2.4.ME+.121/hdrs/s_aliases.h 2002-01-26 13:14:45.000000000 +0200
--- elm2.4.ME+.122-cvs/hdrs/s_aliases.h 2005-01-22 11:20:56.000000000 +0200
***************
*** 5,13 ****
#define AliasesKeepDelete 0x3
#define AliasesKeepDeletePlural 0x4
#define AliasesDeleteAll 0x5
- #define AliasesSelect 0x7
- #define AliasesSingle 0x8
- #define AliasesPlural 0x9
#define AliasesRMenuLn1 0xa
#define AliasesRMenuLn2 0xb
#define AliasesRMenuLn3 0xc
--- 5,10 ----
***************
*** 72,78 ****
#define AliasesUpdating 0x5b
#define AliasesReReading 0x5c
#define AliasesUpdatedOK 0x5d
- #define AliasesShortKey 0x5f
#define AliasesLongKey 0x60
#define AliasesKeyMenu 0x61
#define AliasesHelpDollar 0x62
--- 69,74 ----
***************
*** 120,122 ****
--- 116,119 ----
#define AliasesHelpT 0x8f
#define AliasesModified 0x90
#define AliasesAddressAs1 0x91
+ #define AliasesMode 0x92
Index: elm2.4.ME+.122-cvs/hdrs/save_opts.h
*** elm2.4.ME+.121/hdrs/save_opts.h 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/save_opts.h 2005-07-05 20:53:37.000000000 +0300
***************
*** 1,7 ****
! /* @(#)$Id: save_opts.h,v 1.88 2004/07/27 20:25:02 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.88 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* @(#)$Id: save_opts.h,v 1.106 2005/07/05 17:53:37 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.106 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 16,27 ****
* Defines for the storage of options portion of the Elm system.
*/

! typedef struct {
char letter; /* menu letter on options screen */
char *menu; /* menu prompt */
int menu_msg; /* NLS message number of menu prompt */
char *parm; /* parameter to modify */
! int (*post)(); /* post processing function */
char *one_liner; /* one line help message */
int one_liner_msg; /* NLS message number of one line help message */
} opts_menu;
--- 16,27 ----
* Defines for the storage of options portion of the Elm system.
*/

! typedef struct optsmenu {
char letter; /* menu letter on options screen */
char *menu; /* menu prompt */
int menu_msg; /* NLS message number of menu prompt */
char *parm; /* parameter to modify */
! int (*post) P_((int)); /* post processing function */
char *one_liner; /* one line help message */
int one_liner_msg; /* NLS message number of one line help message */
} opts_menu;
***************
*** 35,46 ****
#define FL_SAVED 02000 /* Used by elmrc-write */
#define FL_CHANGED 04000 /* ffal is not compiled in default */

- typedef struct {
- int nlen;
- char **list;
- } enumerate_list;
-
-
#define PATH_file 1
#define PATH_dir 2
#define PATH_quote 4
--- 35,40 ----
***************
*** 58,63 ****
--- 52,59 ----
};

#define ESTR_meta 1
+ #define ESTR_bin 2
+ #define ESTR_slash 4

struct dt_estr_info {
int flags;
***************
*** 78,89 ****

#endif

! typedef int option_func P_((char **value, int enter,
! int lineno, char *filename));

typedef struct rc_save_info_rec {
char name[NLEN]; /* name of instruction */
- long offset; /* offset into elmrc-info file */
struct rc_type * dt_type; /* DT_STR, DT_NUM, DT_BOL, etc */
int flags; /* FL_LOCAL, FL_NOSPC, etc */
union {
--- 74,97 ----

#endif

! struct dt_enumerate_info {
! int val;
!
! int nlen;
! char **list;
! };
!
! struct dt_sort_info {
! int val;
!
! struct sortval {
! char *kw;
! int sv;
! } * sortval;
! };

typedef struct rc_save_info_rec {
char name[NLEN]; /* name of instruction */
struct rc_type * dt_type; /* DT_STR, DT_NUM, DT_BOL, etc */
int flags; /* FL_LOCAL, FL_NOSPC, etc */
union {
***************
*** 92,98 ****
long *l_num;
int *bol;
char *chr;
! int *sort;
struct dt_path_info *path;
char **mlt;
#ifdef USE_PGP
--- 100,106 ----
long *l_num;
int *bol;
char *chr;
! struct dt_sort_info *sort;
struct dt_path_info *path;
char **mlt;
#ifdef USE_PGP
***************
*** 102,127 ****
struct dt_shared_info *shared;
#endif
struct dt_estr_info *estr;
! void *dummy;
} val;
option_func *func_val;
int size_val;
! enumerate_list *e_ptr;
} save_info_recs;

#define SAVE_INFO_STR(x) (save_info[x].val.str)
#define SAVE_INFO_NUM(x) (save_info[x].val.num)
#define SAVE_INFO_BOL(x) (save_info[x].val.bol)
- #define SAVE_INFO_SRT(x) (save_info[x].val.sort)
- #define SAVE_INFO_ASR(x) (save_info[x].val.sort)

extern int null_option_func P_((char **value, int enter,
int lineno, char *filename));

#if __GNUC__
#define ZZZ_SAVE_TYPE save_info_recs
! #define ZZZ_DT_ASR(A) DT_ASR,0, { sort: A }, null_option_func
! #define ZZZ_DT_SRT(A) DT_SRT,0, { sort: A }, null_option_func
#define ZZZ_DT_STR(A) DT_STR,0, { str: A }, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x, { str: A }, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL,0, { bol: A }, null_option_func
--- 110,133 ----
struct dt_shared_info *shared;
#endif
struct dt_estr_info *estr;
! struct dt_enumerate_info *enumerate;
! void *dummy;
} val;
option_func *func_val;
int size_val;
!
} save_info_recs;

#define SAVE_INFO_STR(x) (save_info[x].val.str)
#define SAVE_INFO_NUM(x) (save_info[x].val.num)
#define SAVE_INFO_BOL(x) (save_info[x].val.bol)

extern int null_option_func P_((char **value, int enter,
int lineno, char *filename));

#if __GNUC__
#define ZZZ_SAVE_TYPE save_info_recs
! #define ZZZ_DT_SORT(A) &rc_DT_SORT,0, { sort: A }, null_option_func
#define ZZZ_DT_STR(A) DT_STR,0, { str: A }, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x, { str: A }, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL,0, { bol: A }, null_option_func
***************
*** 142,147 ****
--- 148,158 ----
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, { str: NULL }, null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, { shared: A }, null_option_func
#define ZZZ_DT_ESTR(A) &rc_DT_ESTR,0, { estr: A }, null_option_func
+ #define ZZZ_DT_ESTR_(x,A) &rc_DT_ESTR,x, { estr: A }, null_option_func
+ #define ZZZ_DT_ENUM(A) &rc_DT_ENUM,0, { enumerate: A }, null_option_func
+ #define ZZZ_DT_ENUM_(x,A) &rc_DT_ENUM,x, { enumerate: A }, null_option_func
+ #define ZZZ_DT_DELAY &rc_DT_DELAY,0,{ str: NULL }, null_option_func
+ #define ZZZ_DT_DELAY_(x) &rc_DT_DELAY,x,{ str: NULL }, null_option_func
#else


***************
*** 152,168 ****
*/
typedef struct {
char name[NLEN]; /* name of instruction */
- long offset; /* offset into elmrc-info file */
struct rc_type * dt_type; /* DT_STR, DT_NUM, DT_BOL, etc */
int flags; /* FL_LOCAL, FL_NOSPC, etc */
char *str;
option_func *func;
int size_val;
- enumerate_list *e_ptr;
} ZZZ_SAVE_TYPE;

! #define ZZZ_DT_ASR(A) DT_ASR, 0,(char *)A, null_option_func
! #define ZZZ_DT_SRT(A) DT_SRT, 0,(char *)A, null_option_func
#define ZZZ_DT_STR(A) DT_STR, 0,A, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x,A, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL, 0,(char *)A, null_option_func
--- 163,176 ----
*/
typedef struct {
char name[NLEN]; /* name of instruction */
struct rc_type * dt_type; /* DT_STR, DT_NUM, DT_BOL, etc */
int flags; /* FL_LOCAL, FL_NOSPC, etc */
char *str;
option_func *func;
int size_val;
} ZZZ_SAVE_TYPE;

! #define ZZZ_DT_SORT(A) &rc_DT_SORT, 0,(char *)A, null_option_func
#define ZZZ_DT_STR(A) DT_STR, 0,A, null_option_func
#define ZZZ_DT_STR_(x,A) DT_STR,x,A, null_option_func
#define ZZZ_DT_BOL(A) DT_BOL, 0,(char *)A, null_option_func
***************
*** 183,188 ****
--- 191,201 ----
#define ZZZ_DT_OBS0 &rc_DT_OBS,0, NULL , null_option_func
#define ZZZ_DT_SHARED(A) &rc_DT_SHARED,0, (char *)A, null_option_func
#define ZZZ_DT_ESTR(A) &rc_DT_ESTR,0, (char *)A, null_option_func
+ #define ZZZ_DT_ESTR_(x,A) &rc_DT_ESTR,x, (char *)A, null_option_func
+ #define ZZZ_DT_ENUM(A) &rc_DT_ENUM,0, (char *)A, null_option_func
+ #define ZZZ_DT_ENUM_(x,A) &rc_DT_ENUM,x, (char *)A, null_option_func
+ #define ZZZ_DT_DELAY &rc_DT_DELAY,0, NULL, null_option_func
+ #define ZZZ_DT_DELAY_(x) &rc_DT_DELAY,x, NULL, null_option_func
#endif

/* shared.c */
***************
*** 207,506 ****
static char *PROMPTAFTER[] = { "prompt-after-metamail",
"prompt-after-pager", NULL};

- static char * USERLEVELS[] = { "beginner", "intermediate", "expert", NULL };
- static enumerate_list USERLEVEL = {3, &(USERLEVELS[0]) };
-
- static char * FRAGMENTH_list[] = { "none", "manual", "auto" };
- static enumerate_list FRAGMENTH = {3, &(FRAGMENTH_list[0]) };
-
- static char * NOENCODINGS[] = { "pass-7bit", "pass-8bit", "pass-binary", NULL };
- static enumerate_list NOENCODING = {3, &(NOENCODINGS[0]) };
-
- static char * ENV_FROM_SOURCES[] = { "forward-from", "from", "return-path", NULL };
- static enumerate_list ENV_FROM_SOURCE = {3, &(ENV_FROM_SOURCES[0]) };
-
- static char * HDR_PHRASE_DISPLAY_MODES[] = { "plain", "quoted", NULL };
- static enumerate_list HDR_PHRASE_DISPLAY_MODE =
- {2, &(HDR_PHRASE_DISPLAY_MODES[0]) };
-
- #if defined(USE_PGP)
- static char * PGP_SIGN_TYPES[] = { "application/pgp", "text/plain",
- "text/x-pgp", NULL };
- static enumerate_list PGP_SIGN_TYPE = {3, &(PGP_SIGN_TYPES[0]) };
-
- static char * PGP_VERSIONS[] = { "default", "pgp2", "pgp5", "gpg", NULL };
- static enumerate_list PGP_VERSION = {4, &(PGP_VERSIONS[0]) };
-
- #endif
-
- static char * FOLDER_STATUS[] = { "Read", "Old", "New", NULL };
- static enumerate_list DEF_FOLDER_STATUS = {3, &(FOLDER_STATUS[0]) };
-
- static char * AUTO_ATTACH[] = { "none", "application", "non-text", NULL };
- static enumerate_list AUTO_ATTACH_VALUE = { 3, &(AUTO_ATTACH[0]) };
-
- static char * hide_hacks[] = { "none", "FOLDER INTERNAL DATA", NULL };
- static enumerate_list HIDE_HACK = { 2, &(hide_hacks[0]) };
-
- static char * LSL_list[] = { "never", "spool", "always", "non-spool", NULL };
- static enumerate_list local_sessionlock_list = { 4, &(LSL_list[0]) };
-
-
ZZZ_SAVE_TYPE save_info_data[] = {
! {"add-in-reply-to-phrase", -1L,ZZZ_DT_BOL(&add_irt_phrase), 0, NULL},
! {"add-sender", -1L,ZZZ_DT_BOL_(FL_SYS,&add_sender_header),
! 0,NULL},
! {"aliassortby", -1L,ZZZ_DT_ASR(&alias_sortby), 0, NULL},
! {"allow-charset-switching", -1L,ZZZ_DT_BOL(&allow_charset_switching), 0,
! NULL},
! {"alteditor", -1L,ZZZ_DT_STR(alternative_editor),
! sizeof alternative_editor, NULL},
! {"alternatives", -1L,ZZZ_DT_PATH(&alternative_addresses), 0, NULL},
! {"alwaysdelete", -1L,ZZZ_DT_BOL(&always_del), 0, NULL},
! {"alwayskeep", -1L,ZZZ_DT_BOL(&always_keep), 0, NULL},
! {"alwaysleave", -1L,ZZZ_DT_MLT(ALWAYS), 0, NULL},
! {"alwaysstore", -1L,ZZZ_DT_BOL(&always_store), 0, NULL},
! {"arrow", -1L,ZZZ_DT_BOL_(FL_OR,&arrow_cursor), 0, NULL},
! {"ask", -1L,ZZZ_DT_BOL(&question_me), 0, NULL},
! {"askcc", -1L,ZZZ_DT_BOL(&prompt_for_cc), 0, NULL},
! {"askmimeforward", -1L,ZZZ_DT_BOL(&askmimeforward), 0, NULL},
#ifdef USE_PGP
! {"askpgpsig", -1L,ZZZ_DT_BOL(&pgp_askpgpsig), 0, NULL},
#endif
! {"attachment-dir", -1L,ZZZ_DT_STR(raw_attachment_dir),
! sizeof raw_attachment_dir, NULL},
! {"attribution", -1L,ZZZ_DT_STR(attribution),
! sizeof attribution, NULL},
! {"auto-attachment", -1L,ZZZ_DT_NUM(&auto_attachment),
! sizeof auto_attachment, &AUTO_ATTACH_VALUE},
! {"auto-cc", -1L,ZZZ_DT_SYN("copy"), 0, NULL},
! {"auto-iso-8859", -1L,ZZZ_DT_BOL(&auto_iso_8859), 0, NULL},
! {"autocopy", -1L,ZZZ_DT_BOL(&auto_copy), 0, NULL},
#ifdef BACKGROUD_PROCESSES
! { "background-wait-time",-1L,ZZZ_DT_NUM(&background_wait_time), 0, NULL },
#endif
! {"bindata", -1L,ZZZ_DT_STR(raw_bindata_path),
! sizeof raw_bindata_path, NULL },

! {"bounce", -1L,ZZZ_DT_SYN("bounceback"), 0, NULL},
! {"bounceback", -1L,ZZZ_DT_OBS0, 0, NULL},

! {"browser-wildcard-matching", -1L,ZZZ_DT_BOL(&browser_wildcards), 0, NULL},
! {"builtinlines", -1L,ZZZ_DT_NUM(&builtin_lines), 0, NULL},
! {"calendar", -1L,ZZZ_DT_ESTR(&calendar_file_e), 0, NULL},
! {"cc", -1L,ZZZ_DT_SYN("askcc"), 0, NULL},
! {"charset", -1L,ZZZ_DT_SYN("text-charset"), 0, NULL},
! {"charset-convert-ok", -1L,ZZZ_DT_BOL(&charset_convert_ok), 0, NULL},
! {"compatcharsets", -1L,ZZZ_DT_FUNC(charset_compatfunc),0, NULL},
! {"configoptions", -1L,ZZZ_DT_STR(config_options), sizeof config_options,
! NULL},
! {"confirmappend", -1L,ZZZ_DT_BOL(&confirm_append), 0, NULL},
! {"confirmcreate", -1L,ZZZ_DT_BOL(&confirm_create), 0, NULL},
! {"confirmfiles", -1L,ZZZ_DT_BOL(&confirm_files), 0, NULL},
! {"confirmfolders", -1L,ZZZ_DT_BOL(&confirm_folders), 0, NULL},
! {"convert-comment-to-fullname",-1L,ZZZ_DT_BOL(&convert_comment), 0, NULL},
! {"convert-utf-header",-1L,ZZZ_DT_BOL(&convert_utf_header), 0, NULL},
! {"copy", -1L,ZZZ_DT_BOL(&auto_copy_sent), 0, NULL},
! {"dead-letter-dir", -1L,ZZZ_DT_ESTR(&dead_letter_dir_e), 0, NULL},
! {"default-folder-status", -1L,ZZZ_DT_NUM(&def_folder_status),
! sizeof def_folder_status, &DEF_FOLDER_STATUS},
! {"default-mime-text-charset",-1L,ZZZ_DT_STR(raw_default_mimetext_charset),
! sizeof raw_default_mimetext_charset},
! {"default-nomime-charset", -1L,ZZZ_DT_STR(raw_default_nomime_charset),
! sizeof raw_default_nomime_charset, NULL},
! {"delete", -1L,ZZZ_DT_SYN("alwaysdelete"), 0, NULL},
! {"displaycharset", -1L,ZZZ_DT_STR(raw_display_charset),
! sizeof raw_display_charset, NULL},
! {"dsn-success", -1L,ZZZ_DT_BOL(&DSN_success), 0, NULL },
! {"easyeditor", -1L,ZZZ_DT_STR(e_editor), sizeof e_editor, NULL},
! {"editor", -1L,ZZZ_DT_ESTR(&editor_e), 0, NULL},
! {"env-from-source", -1L,ZZZ_DT_NUM(&env_from_source),
! sizeof env_from_source, &ENV_FROM_SOURCE},
! {"escape", -1L,ZZZ_DT_CHR(&escape_char), 0, NULL},
! {"extra-mailbox-dir", -1L,ZZZ_DT_STR(raw_extra_mailbox_dir),
! sizeof raw_extra_mailbox_dir, NULL},
! {"folders", -1L,ZZZ_DT_SYN("maildir"), 0, NULL},
! {"forcename", -1L,ZZZ_DT_BOL(&force_name), 0, NULL},
! {"form", -1L,ZZZ_DT_SYN("forms"), 0, NULL},
! {"forms", -1L,ZZZ_DT_BOL(&allow_forms), 0, NULL},
! {"fragment-handling", -1L,ZZZ_DT_NUM(&fragment_handling), 0, &FRAGMENTH },
! {"fullname", -1L,ZZZ_DT_STR(full_username),
! sizeof full_username, NULL},
#ifdef USE_PGP
! {"gpg", -1L,ZZZ_DT_STR(raw_gpg_path),
! sizeof raw_gpg_path, NULL},
#endif
! {"header-phrase-display-mode", -1L, ZZZ_DT_NUM(&phrase_display_mode),
! 0, &HDR_PHRASE_DISPLAY_MODE },
! {"hostdomain", -1L,ZZZ_DT_STR_(FL_SYS,hostdomain),
! sizeof hostdomain, NULL},
! {"hostfullname", -1L,ZZZ_DT_STR_(FL_SYS,hostfullname),
! sizeof hostfullname, NULL},
! {"hostname", -1L,ZZZ_DT_STR_(FL_SYS,hostname),
! sizeof hostname, NULL},
! {"hpkeypad", -1L,ZZZ_DT_SYN("keypad"), 0, NULL},
! {"hpsoftkeys", -1L,ZZZ_DT_SYN("softkeys"), 0, NULL},
#ifdef REMOTE_MBX
! {"imap-charset", -1L,ZZZ_DT_STR(raw_imap_charset),
! sizeof raw_imap_charset, NULL},
! {"imap-connection-cache", -1L, ZZZ_DT_BOL(&IMAP_connection_cache), 0, NULL},
! {"imap-fast-lookup", -1L,ZZZ_DT_BOL(&imap_fast_lookup), 0, NULL},
! {"imap-max-download-size", -1L, ZZZ_DT_NUM(&imap_max_dl_size), 0, NULL},
! {"imap-naming-convention",-1L,ZZZ_DT_BOL(&IMAP_name_convention), 0, NULL},
! {"imap-show-error", -1L,ZZZ_DT_BOL(&IMAP_show_error), 0, NULL},
! {"imap-show-greeting", -1L,ZZZ_DT_BOL(&IMAP_show_greeting), 0, NULL},
! {"imap-show-warning", -1L,ZZZ_DT_BOL(&IMAP_show_warning), 0, NULL},
! {"imap-use-examine", -1L,ZZZ_DT_BOL(&IMAP_use_examine), 0, NULL},
! #endif
! {"incoming-mailbox", -1L,ZZZ_DT_ESTR(&defaultfile_e), 0, NULL },
! {"internal-mailcap-prompt-trusted", -1L,
! ZZZ_DT_BOL(&internal_mailcap_t_prompt), 0, NULL },
{"internal-mailcap-trusted-programs",
! -1L,ZZZ_DT_PATH(&internal_mailcap_t_programs), 0, NULL},
! {"internal-mailcaps", -1L,ZZZ_DT_PATH(&internal_mailcaps), 0, NULL},
! {"iso646-charsets", -1L,ZZZ_DT_FUNC(charset_iso646func),0, NULL},
! {"keep", -1L,ZZZ_DT_SYN("keepempty"), 0, NULL},
! {"keepempty", -1L,ZZZ_DT_BOL(&keep_empty_files), 0, NULL},
#ifdef USE_PGP
! {"keeppassfor", -1L,ZZZ_DT_NUM(&pgp_keeppassfor), 0, NULL},
#endif
! {"keypad", -1L,ZZZ_DT_OBS0, 0, NULL},
! {"local-fast-lookup", -1L,ZZZ_DT_BOL(&local_fast_lookup), 0, NULL},
! {"local-fs-charset", -1L,ZZZ_DT_STR(raw_local_fs_charset),
! sizeof raw_local_fs_charset, NULL},
! {"local-sessionlock-dir", -1L, ZZZ_DT_STR_(FL_SYS,local_sessionlock_dir),
! sizeof local_sessionlock_dir, NULL},
! {"local-sessionlock-use-home", -1L, ZZZ_DT_NUM_(FL_SYS,
! &local_sessionlock_use_home),
! 0, &local_sessionlock_list },
! {"localsignature", -1L,ZZZ_DT_ESTR(&local_signature_e), 0, NULL},
#ifdef SYSCALL_LOCKING
! {"lock-folders", -1L,ZZZ_DT_BOL(&lockfolders),0, NULL},
! {"lock-in-copy", -1L,ZZZ_DT_BOL(&lock_in_copy),0, NULL},
#endif
! {"mailbox", -1L,ZZZ_DT_OBS0, 0, NULL},
! {"mailcaps", -1L,ZZZ_DT_MLT(MAILCAPS), 0, NULL},
! {"maildir", -1L,ZZZ_DT_STR(raw_folders), sizeof raw_folders, NULL},
! {"mailedit", -1L,ZZZ_DT_SYN("editor"), 0, NULL},
! {"mailer", -1L,ZZZ_DT_FUNC_(FL_SYS,mailerfunc), 0, NULL},
! {"mailpermissions", -1L,ZZZ_DT_PRM(&mail_permissions), 0, NULL},
! {"map-bin-dir", -1L,ZZZ_DT_STR_(FL_SYS,raw_map_bindir),
! sizeof raw_map_bindir, NULL},
! {"map-text-dir", -1L,ZZZ_DT_STR_(FL_SYS,raw_map_txtdir),
! sizeof raw_map_txtdir, NULL},
! {"menu", -1L,ZZZ_DT_BOL_(FL_AND,&mini_menu), 0, NULL},
! {"menu-display-host", -1L,ZZZ_DT_BOL(&menu_display_host), 0, NULL},
! {"menus", -1L,ZZZ_DT_SYN("menu"), 0, NULL},
! {"message-hide-hack",-1L,ZZZ_DT_NUM(&message_hide_hack),0,&HIDE_HACK},
! {"metamail", -1L,ZZZ_DT_STR(raw_metamail_path),
! sizeof raw_metamail_path, NULL},
! {"metamail-mailcaps", -1L,ZZZ_DT_PATH(&metamail_mailcaps), 0, NULL},
! {"metoo", -1L,ZZZ_DT_BOL(&metoo), 0, NULL},
! {"mimebodykeywords", -1L,ZZZ_DT_BOL(&mime_body_keywords), 0, NULL},
! {"mimeforward", -1L,ZZZ_DT_BOL(&mimeforward), 0, NULL},
! {"movepage", -1L,ZZZ_DT_BOL(&move_when_paged), 0, NULL},
! {"movewhenpaged", -1L,ZZZ_DT_SYN("movepage"), 0, NULL},
! {"name", -1L,ZZZ_DT_SYN("fullname"), 0, NULL},
! {"names", -1L,ZZZ_DT_BOL(&names_only), 0, NULL},
! {"noencoding",-1L,ZZZ_DT_NUM(&allow_no_encoding), 0, &NOENCODING},
! /* 1 (8bit): Allow 8bit without -B8BITMIME
! * 2 (biary): Allow binary without -BBINARYMIME and
! * and 8bit without -B8BITMIME */
! {"nohdrencoding", -1L,ZZZ_DT_BOL(&allow_no_hdrencoding), 0, NULL},
! {"noheader", -1L,ZZZ_DT_BOL(&noheader), 0, NULL},
! {"noheaderfwd", -1L,ZZZ_DT_BOL(&noheaderfwd), 0, NULL},
! {"page", -1L,ZZZ_DT_SYN("pager"), 0, NULL},
! {"page-known-charsets", -1L,ZZZ_DT_BOL(&page_known_charsets), 0, NULL},
! {"pagealternative", -1L,ZZZ_DT_BOL(&pagealternative), 0, NULL},
! {"pagemultipart", -1L,ZZZ_DT_BOL(&pagemultipart), 0, NULL},
! {"pager", -1L,ZZZ_DT_ESTR(&pager_e), 0, NULL},
! {"pagesigned", -1L,ZZZ_DT_BOL(&pagesigned), 0, NULL},
#ifdef USE_PGP
! {"pgp", -1L,ZZZ_DT_SYN("pgp2"), 0, NULL},
! {"pgp-interactive", -1L,ZZZ_DT_BOL(&pgp_interactive), 0, NULL},
! {"pgp-sign-type", -1L,ZZZ_DT_NUM(&pgp_sign_type),
! sizeof pgp_sign_type, &PGP_SIGN_TYPE},
! {"pgp-version", -1L,ZZZ_DT_PGPVER(&send_pgp_version),
! sizeof send_pgp_version, &PGP_VERSION},
! {"pgp2", -1L,ZZZ_DT_STR(raw_pgp2_path),
! sizeof raw_pgp2_path, NULL},
! {"pgp5-dir", -1L,ZZZ_DT_STR(raw_pgp5_dir),
! sizeof raw_pgp5_dir, NULL},
#endif /* USE_PGP */
! {"pointnew", -1L,ZZZ_DT_BOL(&point_to_new), 0, NULL},
! {"pointtonew", -1L,ZZZ_DT_SYN("pointnew"), 0, NULL},
#ifdef REMOTE_MBX
! {"pop-max-download-size", -1L, ZZZ_DT_NUM(&pop_max_dl_size), 0, NULL},
! {"pop-show-greeting", -1L,ZZZ_DT_BOL(&POP_show_greeting), 0, NULL},
#endif
! {"precedences", -1L,ZZZ_DT_STR(allowed_precedences),
! sizeof allowed_precedences, NULL},
! {"prefix", -1L,ZZZ_DT_STR_(FL_NOSPC,prefixchars),
! sizeof prefixchars, NULL},
! {"print", -1L,ZZZ_DT_STR(raw_printout), sizeof raw_printout, NULL},
! {"printmail", -1L,ZZZ_DT_SYN("print"), 0, NULL},
! {"prompt-after-metamail",-1L,ZZZ_DT_BOL(&prompt_after_metamail), 0, NULL},
! {"prompt-after-pager", -1L,ZZZ_DT_BOL(&prompt_after_pager), 0, NULL},
! {"promptafter", -1L,ZZZ_DT_MLT(PROMPTAFTER), 0, NULL },
! {"question", -1L,ZZZ_DT_SYN("ask"), 0, NULL},
! {"quoteforward", -1L,ZZZ_DT_BOL(&quote_forward), 0, NULL},
! {"readdatapercentinc", -1L,ZZZ_DT_NUM(&readdatapercentinc), 0, NULL},
! {"readmsginc", -1L,ZZZ_DT_NUM(&readmsginc), 0, NULL},
! {"receivedmail", -1L,ZZZ_DT_ESTR(&recvd_mail_e), 0, NULL},
! {"remotesignature", -1L,ZZZ_DT_ESTR(&remote_signature_e), 0, NULL},
{"require-mime-version-for-body-encoding",
! -1L,ZZZ_DT_BOL(&req_mime_bodyencoding), 0, NULL},
{"require-mime-version-for-hdr-encoding",
! -1L,ZZZ_DT_BOL(&req_mime_hdrencoding), 0, NULL},
! {"resolve", -1L,ZZZ_DT_BOL(&resolve_mode), 0, NULL},
! {"savebyname", -1L,ZZZ_DT_SYN("savename"), 0, NULL},
! {"savemail", -1L,ZZZ_DT_SYN("sentmail"), 0, NULL},
! {"savename", -1L,ZZZ_DT_BOL(&save_by_name), 0, NULL},
! {"saveto", -1L,ZZZ_DT_SYN("sentmail"), 0, NULL},
! {"send-mime-plain-text", -1L, ZZZ_DT_BOL(&send_mime_plain),
! sizeof send_mime_plain, NULL },
! {"sentmail", -1L,ZZZ_DT_ESTR(&sent_mail_e), 0, NULL},
! {"set-window-title", -1L, ZZZ_DT_BOL(&set_window_title),
! sizeof set_window_title, NULL },
! {"shell", -1L,ZZZ_DT_STR(raw_shell), sizeof raw_shell, NULL},
! {"show-header-errors", -1L,ZZZ_DT_BOL(&show_header_errors), 0, NULL},
#ifdef USE_PGP
! {"showpgppreamble", -1L,ZZZ_DT_BOL(&pgp_noarmor), 0, NULL},
#endif
! {"showto", -1L,ZZZ_DT_BOL(&showto), 0, NULL},
! {"sigdashes", -1L,ZZZ_DT_BOL(&sig_dashes), 0, NULL},
! {"signature", -1L,ZZZ_DT_MLT(SIGS), 0, NULL},
! {"sleepmsg", -1L,ZZZ_DT_NUM(&sleepmsg), 0, NULL},
! {"softkeys", -1L,ZZZ_DT_OBS0, 0, NULL},
! {"sort", -1L,ZZZ_DT_SYN("sortby"), 0, NULL},
! {"sort-thread-max-time", -1L, ZZZ_DT_NUM(&sort_thread_max_time), 0, NULL},
! {"sortby", -1L,ZZZ_DT_SRT(&sortby), 0, NULL},
! {"store", -1L,ZZZ_DT_SYN("alwaysstore"), 0, NULL},
! {"text-charset", -1L,ZZZ_DT_STR(raw_text_charset),
! sizeof raw_text_charset, NULL},
! {"textencoding", -1L,ZZZ_DT_OBS0, 0, NULL},
! {"timeout", -1L,ZZZ_DT_LONG(&elm_timeout), 0, NULL},
! {"titles", -1L,ZZZ_DT_BOL(&title_messages), 0, NULL},
! {"tmpdir", -1L,ZZZ_DT_STR(raw_temp_dir),
! sizeof raw_temp_dir, NULL},
! {"unidata", -1L,ZZZ_DT_STR(raw_unidata_path),
! sizeof raw_unidata_path, NULL },
#ifdef USE_DLOPEN
! {"use-base-library", -1L,ZZZ_DT_SHARED(&use_shared_base), 0, NULL},
! {"use-connect-library", -1L,ZZZ_DT_SHARED(&use_shared_connect), 0, NULL},
! {"use-library", -1L,ZZZ_DT_SHARED(&use_shared_all), 0, NULL},
#endif
#ifdef USE_PGP
! {"usepgppass", -1L,ZZZ_DT_BOL(&pgp_keeppass), 0, NULL},
#endif
! {"userlevel", -1L,ZZZ_DT_NUM(&user_level), 0, &USERLEVEL},
! {"username", -1L,ZZZ_DT_SYN("fullname"), 0, NULL},
! {"usetite", -1L,ZZZ_DT_BOL_(FL_AND,&use_tite), 0, NULL},
! {"utf7-encode-optional", -1L,ZZZ_DT_BOL(&utf7_encode_optional), 0, NULL},
! {"visualeditor", -1L,ZZZ_DT_STR(v_editor), sizeof v_editor, NULL},
! {"weed", -1L,ZZZ_DT_BOL(&elm_filter), 0, NULL},
! {"weedout", -1L,ZZZ_DT_PATH(&weedlist), 0, NULL},
};
int NUMBER_OF_SAVEABLE_OPTIONS=(sizeof(save_info_data)/sizeof(ZZZ_SAVE_TYPE));
save_info_recs *save_info = (save_info_recs *) save_info_data;
#else
--- 220,486 ----
static char *PROMPTAFTER[] = { "prompt-after-metamail",
"prompt-after-pager", NULL};

ZZZ_SAVE_TYPE save_info_data[] = {
! {"add-in-reply-to-phrase", ZZZ_DT_BOL(&add_irt_phrase), 0 },
! {"add-sender", ZZZ_DT_BOL_(FL_SYS,&add_sender_header),
! 0 },
! {"aliassortby", ZZZ_DT_SORT(&alias_sortby), 0 },
! {"allow-charset-switching", ZZZ_DT_BOL(&allow_charset_switching), 0 },
! {"alteditor", ZZZ_DT_STR(alternative_editor),
! sizeof alternative_editor },
! {"alternatives", ZZZ_DT_PATH(&alternative_addresses), 0 },
! {"alwaysdelete", ZZZ_DT_BOL(&always_del), 0 },
! {"alwayskeep", ZZZ_DT_BOL(&always_keep), 0 },
! {"alwaysleave", ZZZ_DT_MLT(ALWAYS), 0 },
! {"alwaysstore", ZZZ_DT_BOL(&always_store), 0 },
! {"arrow", ZZZ_DT_BOL_(FL_OR,&arrow_cursor), 0 },
! {"ask", ZZZ_DT_BOL(&question_me), 0 },
! {"askcc", ZZZ_DT_BOL(&prompt_for_cc), 0 },
! {"askmimeforward", ZZZ_DT_BOL(&askmimeforward), 0 },
#ifdef USE_PGP
! {"askpgpsig", ZZZ_DT_BOL(&pgp_askpgpsig), 0, },
#endif
! {"attachment-dir", ZZZ_DT_STR(raw_attachment_dir),
! sizeof raw_attachment_dir },
! {"attribution", ZZZ_DT_STR(attribution),
! sizeof attribution },
! {"auto-attachment", ZZZ_DT_ENUM(&auto_attachment),
! sizeof auto_attachment},
! {"auto-cc", ZZZ_DT_SYN("copy"), 0 },
! {"auto-iso-8859", ZZZ_DT_BOL(&auto_iso_8859), 0 },
! {"autocopy", ZZZ_DT_BOL(&auto_copy), 0 },
#ifdef BACKGROUD_PROCESSES
! { "background-wait-time", ZZZ_DT_NUM(&background_wait_time), 0 },
#endif
! {"bindata", ZZZ_DT_STR(raw_bindata_path),
! sizeof raw_bindata_path },

! {"bounce", ZZZ_DT_SYN("bounceback"), 0 },
! {"bounceback", ZZZ_DT_OBS0, 0 },

! {"browser-wildcard-matching", ZZZ_DT_BOL(&browser_wildcards), 0 },
! {"builtinlines", ZZZ_DT_NUM(&builtin_lines), 0 },
! {"calendar", ZZZ_DT_ESTR(&calendar_file_e), 0 },
! {"cc", ZZZ_DT_SYN("askcc"), 0 },
! {"charset", ZZZ_DT_SYN("text-charset"), 0 },
! {"charset-convert-ok", ZZZ_DT_BOL(&charset_convert_ok), 0 },
! {"compatcharsets", ZZZ_DT_FUNC(charset_compatfunc),0 },
! {"configoptions", ZZZ_DT_STR(config_options),
! sizeof config_options },
! {"confirmappend", ZZZ_DT_BOL(&confirm_append), 0 },
! {"confirmcreate", ZZZ_DT_BOL(&confirm_create), 0 },
! {"confirmfiles", ZZZ_DT_BOL(&confirm_files), 0 },
! {"confirmfolders", ZZZ_DT_BOL(&confirm_folders), 0 },
! {"convert-comment-to-fullname",ZZZ_DT_BOL(&convert_comment), 0 },
! {"convert-utf-header", ZZZ_DT_BOL(&convert_utf_header), 0 },
! {"copy", ZZZ_DT_BOL(&auto_copy_sent), 0 },
! {"dead-letter-dir", ZZZ_DT_ESTR(&dead_letter_dir_e), 0 },
! {"default-folder-status", ZZZ_DT_ENUM(&def_folder_status),
! sizeof def_folder_status },
! {"default-mime-text-charset",ZZZ_DT_STR(raw_default_mimetext_charset),
! sizeof raw_default_mimetext_charset },
! {"default-nomime-charset", ZZZ_DT_STR(raw_default_nomime_charset),
! sizeof raw_default_nomime_charset },
! {"delete", ZZZ_DT_SYN("alwaysdelete"), 0 },
! {"displaycharset", ZZZ_DT_STR(raw_display_charset),
! sizeof raw_display_charset },
! {"dsn-success", ZZZ_DT_BOL(&DSN_success), 0 },
! {"easyeditor", ZZZ_DT_STR(e_editor), sizeof e_editor },
! {"editor", ZZZ_DT_ESTR(&editor_e), 0 },
! {"env-from-source", ZZZ_DT_ENUM(&env_from_source),
! sizeof env_from_source },
! {"escape", ZZZ_DT_CHR(&escape_char), 0 },
! {"extra-mailbox-dir", ZZZ_DT_STR(raw_extra_mailbox_dir),
! sizeof raw_extra_mailbox_dir },
! {"folders", ZZZ_DT_SYN("maildir"), 0 },
! {"forcename", ZZZ_DT_BOL(&force_name), 0 },
! {"form", ZZZ_DT_SYN("forms"), 0 },
! {"forms", ZZZ_DT_BOL(&allow_forms), 0 },
! {"fragment-handling", ZZZ_DT_ENUM(&fragment_handling), 0 },
! {"fullname", ZZZ_DT_STR(full_username),
! sizeof full_username },
#ifdef USE_PGP
! {"gpg", ZZZ_DT_STR(raw_gpg_path), sizeof raw_gpg_path },
#endif
! {"header-phrase-display-mode", ZZZ_DT_ENUM(&phrase_display_mode), 0 },
! {"hostdomain", ZZZ_DT_STR_(FL_SYS,hostdomain),
! sizeof hostdomain },
! {"hostfullname", ZZZ_DT_STR_(FL_SYS,hostfullname),
! sizeof hostfullname },
! {"hostname", ZZZ_DT_STR_(FL_SYS,hostname),
! sizeof hostname },
! {"hpkeypad", ZZZ_DT_SYN("keypad"), 0 },
! {"hpsoftkeys", ZZZ_DT_SYN("softkeys"), 0 },
#ifdef REMOTE_MBX
! {"imap-charset", ZZZ_DT_STR(raw_imap_charset),
! sizeof raw_imap_charset },
! {"imap-connection-cache", ZZZ_DT_BOL(&IMAP_connection_cache), 0 },
! {"imap-dir-sortby", ZZZ_DT_SORT(&imap_dir_sortby), 0 },
! {"imap-fast-lookup", ZZZ_DT_BOL(&imap_fast_lookup), 0 },
! {"imap-max-download-size", ZZZ_DT_NUM(&imap_max_dl_size), 0 },
! {"imap-naming-convention", ZZZ_DT_BOL(&IMAP_name_convention), 0 },
! {"imap-show-error", ZZZ_DT_BOL(&IMAP_show_error), 0 },
! {"imap-show-greeting", ZZZ_DT_BOL(&IMAP_show_greeting), 0 },
! {"imap-show-warning", ZZZ_DT_BOL(&IMAP_show_warning), 0 },
! {"imap-use-examine", ZZZ_DT_BOL(&IMAP_use_examine), 0 },
! #endif
! {"incoming-mailbox", ZZZ_DT_ESTR(&defaultfile_e), 0 },
! {"internal-mailcap-prompt-trusted",
! ZZZ_DT_BOL(&internal_mailcap_t_prompt), 0 },
{"internal-mailcap-trusted-programs",
! ZZZ_DT_PATH(&internal_mailcap_t_programs), 0 },
! {"internal-mailcaps", ZZZ_DT_PATH(&internal_mailcaps), 0 },
! {"iso646-charsets", ZZZ_DT_FUNC(charset_iso646func),0 },
! {"keep", ZZZ_DT_SYN("keepempty"), 0 },
! {"keepempty", ZZZ_DT_BOL(&keep_empty_files), 0 },
#ifdef USE_PGP
! {"keeppassfor", ZZZ_DT_NUM(&pgp_keeppassfor), 0 },
! #endif
! {"keypad", ZZZ_DT_OBS0, 0 },
! {"local-dir-sortby", ZZZ_DT_SORT(&local_dir_sortby), 0 },
! {"local-fast-lookup", ZZZ_DT_BOL(&local_fast_lookup), 0 },
! {"local-fs-charset", ZZZ_DT_STR(raw_local_fs_charset),
! sizeof raw_local_fs_charset },
! {"local-sessionlock-dir", ZZZ_DT_STR_(FL_SYS,local_sessionlock_dir),
! sizeof local_sessionlock_dir },
! {"local-sessionlock-use-home",
! ZZZ_DT_ENUM_(FL_SYS,&local_sessionlock_use_home), 0 },
! #if defined(WCHAR) && defined(__STDC_ISO_10646__)
! {"locale-charsets", ZZZ_DT_PATH(&locale_charsets), 0 },
#endif
! {"localsignature", ZZZ_DT_ESTR(&local_signature_e), 0 },
#ifdef SYSCALL_LOCKING
! {"lock-folders", ZZZ_DT_BOL(&lockfolders), 0 },
! {"lock-in-copy", ZZZ_DT_BOL(&lock_in_copy), 0 },
#endif
! {"mailbox", ZZZ_DT_OBS0, 0 },
! {"mailcaps", ZZZ_DT_MLT(MAILCAPS), 0 },
! {"maildir", ZZZ_DT_ESTR(&folders_e), 0 },
! {"mailedit", ZZZ_DT_SYN("editor"), 0 },
! {"mailer", ZZZ_DT_DELAY_(FL_SYS), 0 },
! {"mailpermissions", ZZZ_DT_PRM(&mail_permissions), 0 },
! {"map-bin-dir", ZZZ_DT_ESTR_(FL_SYS,&map_bindir_e), 0 },
! {"map-text-dir", ZZZ_DT_ESTR_(FL_SYS,&map_txtdir_e), 0 },
! {"menu", ZZZ_DT_BOL_(FL_AND,&mini_menu), 0 },
! {"menu-display-host", ZZZ_DT_BOL(&menu_display_host), 0 },
! {"menus", ZZZ_DT_SYN("menu"), 0 },
! {"message-hide-hack", ZZZ_DT_ENUM(&message_hide_hack), 0 },
! {"metamail", ZZZ_DT_STR(raw_metamail_path),
! sizeof raw_metamail_path },
! {"metamail-mailcaps", ZZZ_DT_PATH(&metamail_mailcaps), 0 },
! {"metoo", ZZZ_DT_BOL(&metoo), 0 },
! {"mime-parameters", ZZZ_DT_ENUM(&mime_parameters),0 },
! {"mimebodykeywords", ZZZ_DT_BOL(&mime_body_keywords), 0 },
! {"mimeforward", ZZZ_DT_BOL(&mimeforward), 0 },
! {"movepage", ZZZ_DT_BOL(&move_when_paged), 0 },
! {"movewhenpaged", ZZZ_DT_SYN("movepage"), 0 },
! {"name", ZZZ_DT_SYN("fullname"), 0 },
! {"names", ZZZ_DT_BOL(&names_only), 0 },
! {"noencoding", ZZZ_DT_ENUM(&allow_no_encoding), 0 },
! {"nohdrencoding", ZZZ_DT_BOL(&allow_no_hdrencoding), 0 },
! {"noheader", ZZZ_DT_BOL(&noheader), 0 },
! {"noheaderfwd", ZZZ_DT_BOL(&noheaderfwd), 0 },
! {"page", ZZZ_DT_SYN("pager"), 0 },
! {"page-known-charsets", ZZZ_DT_BOL(&page_known_charsets), 0 },
! {"pagealternative", ZZZ_DT_BOL(&pagealternative), 0 },
! {"pagemultipart", ZZZ_DT_BOL(&pagemultipart), 0 },
! {"pager", ZZZ_DT_ESTR(&pager_e), 0 },
! {"pagesigned", ZZZ_DT_BOL(&pagesigned), 0 },
#ifdef USE_PGP
! {"pgp", ZZZ_DT_SYN("pgp2"), 0 },
! {"pgp-encrypt-type", ZZZ_DT_ENUM(&pgp_encrypt_type),
! sizeof pgp_encrypt_type },
! {"pgp-interactive", ZZZ_DT_BOL(&pgp_interactive), 0 },
! {"pgp-sign-type", ZZZ_DT_ENUM(&pgp_sign_type),
! sizeof pgp_sign_type },
! {"pgp-version", ZZZ_DT_ENUM(&send_pgp_version),
! sizeof send_pgp_version },
! {"pgp2", ZZZ_DT_STR(raw_pgp2_path),
! sizeof raw_pgp2_path },
! {"pgp5-dir", ZZZ_DT_STR(raw_pgp5_dir),
! sizeof raw_pgp5_dir },
#endif /* USE_PGP */
! {"pointnew", ZZZ_DT_BOL(&point_to_new), 0 },
! {"pointtonew", ZZZ_DT_SYN("pointnew"), 0 },
#ifdef REMOTE_MBX
! {"pop-max-download-size", ZZZ_DT_NUM(&pop_max_dl_size), 0 },
! {"pop-show-greeting", ZZZ_DT_BOL(&POP_show_greeting), 0 },
#endif
! {"precedences", ZZZ_DT_STR(allowed_precedences),
! sizeof allowed_precedences },
! {"prefix", ZZZ_DT_STR_(FL_NOSPC,prefixchars),
! sizeof prefixchars },
! {"print", ZZZ_DT_STR(raw_printout), sizeof raw_printout },
! {"printmail", ZZZ_DT_SYN("print"), 0 },
! {"prompt-after-metamail", ZZZ_DT_BOL(&prompt_after_metamail), 0 },
! {"prompt-after-pager", ZZZ_DT_BOL(&prompt_after_pager), 0 },
! {"prompt-metamail", ZZZ_DT_BOL(&prompt_metamail), 0 },
! {"promptafter", ZZZ_DT_MLT(PROMPTAFTER), 0 },
! {"question", ZZZ_DT_SYN("ask"), 0 },
! {"quoteforward", ZZZ_DT_BOL(&quote_forward), 0 },
! {"readdatapercentinc", ZZZ_DT_NUM(&readdatapercentinc), 0 },
! {"readmsginc", ZZZ_DT_NUM(&readmsginc), 0 },
! {"receivedmail", ZZZ_DT_ESTR(&recvd_mail_e), 0 },
! {"remotesignature", ZZZ_DT_ESTR(&remote_signature_e), 0 },
{"require-mime-version-for-body-encoding",
! ZZZ_DT_BOL(&req_mime_bodyencoding), 0 },
{"require-mime-version-for-hdr-encoding",
! ZZZ_DT_BOL(&req_mime_hdrencoding), 0 },
! {"resolve", ZZZ_DT_BOL(&resolve_mode), 0 },
! {"savebyname", ZZZ_DT_SYN("savename"), 0 },
! {"savemail", ZZZ_DT_SYN("sentmail"), 0 },
! {"savename", ZZZ_DT_BOL(&save_by_name), 0 },
! {"saveto", ZZZ_DT_SYN("sentmail"), 0 },
! {"send-mime-plain-text", ZZZ_DT_BOL(&send_mime_plain),
! sizeof send_mime_plain },
! {"sentmail", ZZZ_DT_ESTR(&sent_mail_e), 0 },
! {"set-window-title", ZZZ_DT_BOL(&set_window_title),
! sizeof set_window_title },
! {"shell", ZZZ_DT_ESTR(&shell_e), 0 },
! {"show-header-errors", ZZZ_DT_BOL(&show_header_errors), 0 },
#ifdef USE_PGP
! {"showpgppreamble", ZZZ_DT_BOL(&pgp_noarmor), 0 },
#endif
! {"showto", ZZZ_DT_BOL(&showto), 0 },
! {"sigdashes", ZZZ_DT_BOL(&sig_dashes), 0 },
! {"signature", ZZZ_DT_MLT(SIGS), 0 },
! {"sleepmsg", ZZZ_DT_NUM(&sleepmsg), 0 },
! {"softkeys", ZZZ_DT_OBS0, 0 },
! {"sort", ZZZ_DT_SYN("sortby"), 0 },
! {"sort-thread-max-time", ZZZ_DT_NUM(&sort_thread_max_time), 0 },
! {"sortby", ZZZ_DT_SORT(&sortby), 0 },
! {"store", ZZZ_DT_SYN("alwaysstore"), 0 },
! {"text-charset", ZZZ_DT_STR(raw_text_charset),
! sizeof raw_text_charset },
! {"textencoding", ZZZ_DT_OBS0, 0 },
! {"timeout", ZZZ_DT_LONG(&elm_timeout), 0 },
! {"titles", ZZZ_DT_BOL(&title_messages), 0 },
! {"tmpdir", ZZZ_DT_ESTR(&temp_dir_e), 0 },
! {"unidata", ZZZ_DT_STR(raw_unidata_path),
! sizeof raw_unidata_path },
! {"unstable-reverse-thread", ZZZ_DT_BOL(&unstable_reverse_thread), 0 },
#ifdef USE_DLOPEN
! {"use-base-library", ZZZ_DT_SHARED(&use_shared_base), 0 },
! {"use-connect-library", ZZZ_DT_SHARED(&use_shared_connect), 0 },
! {"use-library", ZZZ_DT_SHARED(&use_shared_all), 0 },
! {"use-mailer-library", ZZZ_DT_DELAY, 0 },
#endif
#ifdef USE_PGP
! {"usepgppass", ZZZ_DT_BOL(&pgp_keeppass), 0 },
#endif
! {"userlevel", ZZZ_DT_ENUM(&user_level), 0 },
! {"username", ZZZ_DT_SYN("fullname"), 0 },
! {"usetite", ZZZ_DT_BOL_(FL_AND,&use_tite), 0 },
! {"utf7-encode-optional", ZZZ_DT_BOL(&utf7_encode_optional), 0 },
! #ifdef I_NETDB
! {"verify-domain", ZZZ_DT_BOL(&verify_domain), 0 },
! #endif
! {"verify-local-address", ZZZ_DT_BOL(&verify_local_address), 0 },
! {"visualeditor", ZZZ_DT_STR(v_editor), sizeof v_editor },
! {"weed", ZZZ_DT_BOL(&elm_filter), 0 },
! {"weedout", ZZZ_DT_PATH(&weedlist), 0 },
};
+
int NUMBER_OF_SAVEABLE_OPTIONS=(sizeof(save_info_data)/sizeof(ZZZ_SAVE_TYPE));
save_info_recs *save_info = (save_info_recs *) save_info_data;
#else
Index: elm2.4.ME+.122-cvs/hdrs/s_elm.h
*** elm2.4.ME+.121/hdrs/s_elm.h 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/s_elm.h 2005-07-01 19:05:29.000000000 +0300
***************
*** 500,506 ****
#define ElmListFoldersHelp1 0x24f
#define ElmListFoldersHelp2 0x250
#define ElmShownXWithSelect 0x251
- #define ElmShownXNoSelect 0x252
#define ElmFolderWord 0x253
#define ElmMailboxWord 0x254
#define ElmLevel0MenuLine1 0x255
--- 500,505 ----
***************
*** 543,549 ****
#define ElmSegmentViolationSignal 0x280
#define ElmStoppedUseFGToReturn 0x281
#define ElmBackInElmRedraw 0x282
- #define ElmShownXNoSelectPlural 0x283
#define ElmKeyF1 0x284
#define ElmKeyF2 0x285
#define ElmKeyF3 0x286
--- 542,547 ----
***************
*** 778,787 ****
#define ElmStructuredNoencoding 0x384
#define ElmStructuredLeaf 0x385
#define ElmUnknownCommand2 0x386
! #define ElmFileNotExist 0x387
! #define ElmCantStatFile 0x388
! #define ElmNotReadableByUser 0x389
! #define ElmCheckingEncoding 0x38a
#define ElmCantOpenFile 0x38b
#define ElmNoAttachments 0x38c
#define ElmLastAttachment 0x38d
--- 776,785 ----
#define ElmStructuredNoencoding 0x384
#define ElmStructuredLeaf 0x385
#define ElmUnknownCommand2 0x386
! #define ElmFileNotExistS 0x387
! #define ElmCantStatFileS 0x388
! #define ElmNotReadableByUserS 0x389
! #define ElmCheckingEncodingS 0x38a
#define ElmCantOpenFile 0x38b
#define ElmNoAttachments 0x38c
#define ElmLastAttachment 0x38d
***************
*** 811,817 ****
#define ElmPgpNoMatch 0x3a5
#define ElmHeaderUsingUNKNOWN8BIT 0x3a6
#define ElmHeaderBadCharset 0x3a7
! #define ElmErrorOpeningName 0x3a8
#define ElmErrorWhenReading 0x3a9
#define ElmFailedLeaveFolder 0x3aa
#define ElmFailedResyncFolder 0x3ab
--- 809,815 ----
#define ElmPgpNoMatch 0x3a5
#define ElmHeaderUsingUNKNOWN8BIT 0x3a6
#define ElmHeaderBadCharset 0x3a7
! #define ElmErrorOpeningNameS 0x3a8
#define ElmErrorWhenReading 0x3a9
#define ElmFailedLeaveFolder 0x3aa
#define ElmFailedResyncFolder 0x3ab
***************
*** 867,873 ****
#define ElmPgpP 0x3eb
#define ElmPgpEntUser 0x3ec
#define ElmDbxCurrMsgNum 0x3ed
- #define ElmDbxHdrPage 0x3ee
#define ElmDbxCurrMailFile 0x3ef
#define ElmDbxPressAnyKey 0x3f0
#define ElmTerminatedWithSignal 0x3f1
--- 865,870 ----
***************
*** 1035,1041 ****
#define ElmMailcapMenu 0x82d
#define ElmUseMailcap 0x82e
#define ElmMetamail 0x82f
! #define ElmMailcapQuit 0x830
#define ElmTitleQuit 0x831
#define ElmIconQuit 0x832
#define ElmTitleSusp 0x833
--- 1032,1038 ----
#define ElmMailcapMenu 0x82d
#define ElmUseMailcap 0x82e
#define ElmMetamail 0x82f
! #define ElmMailcapDone 0x830
#define ElmTitleQuit 0x831
#define ElmIconQuit 0x832
#define ElmTitleSusp 0x833
***************
*** 1108,1110 ****
--- 1105,1134 ----
#define ElmCancelMenuLine2 0x877
#define ElmCancelMenuLine3 0x878
#define ElmVfyMessageKept1 0x879
+ #define ElmShownXNoSelectItem 0x87a
+ #define ElmMailcapPage 0x87b
+ #define ElmMetamailMenu1 0x87c
+ #define ElmMetamailMenu2 0x87d
+ #define ElmMetamailMenu 0x87e
+ #define ElmMailcapMenu1 0x87f
+ #define ElmMailcapMenu2 0x880
+ #define ElmDone 0x881
+ #define ElmShownTitleNoMailbox 0x882
+ #define ElmNoItemToFlag 0x883
+ #define ElmLimitReturnToLastSelection 0x884
+ #define ElmReverseUnstable 0x885
+ #define ElmPadUnsThread 0x886
+ #define ElmAbrUnsThread 0x887
+ #define ElmLongUnsThread 0x888
+ #define ElmBadLineInElmrc 0x889
+ #define ElmDomainUnknown 0x88a
+ #define ElmVerifyNot 0x88d
+ #define ElmVerifyBad 0x88e
+ #define ElmVerifyBad1 0x88f
+ #define ElmVerifyNot1 0x890
+ #define ElmErrorReadingS 0x891
+ #define ElmCantOpenFileS 0x892
+ #define ElmFailErrnoS 0x893
+ #define ElmArgsBadZoption 0x894
+ #define ElmArgsBadYoption 0x895
+ #define ElmNoUnreadMail 0x896
Index: elm2.4.ME+.122-cvs/hdrs/s_elmrc.h
*** elm2.4.ME+.121/hdrs/s_elmrc.h 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/s_elmrc.h 2005-07-05 20:53:37.000000000 +0300
***************
*** 7,14 ****
#define ElmrcCantSaveConfig 0x5
#define ElmrcOptionsSavedIn 0x6
#define ElmrcOptionsFile 0x7
- #define ElmrcSavedAutoFor 0x8
- #define ElmrcSavedAuto 0x9
#define ElmrcNoBothwI 0xa
! #define ElmrcSavedAutoWrite 0xb
! #define ElmrcSavedAutoLIB 0xc
--- 7,14 ----
#define ElmrcCantSaveConfig 0x5
#define ElmrcOptionsSavedIn 0x6
#define ElmrcOptionsFile 0x7
#define ElmrcNoBothwI 0xa
! #define ElmrcSavedAutoWrite1 0xd
! #define ElmrcFileNotWriteable 0xe
! #define ElmrcFileNotRenamed 0xf
! #define ElmrcSavedAutoFor1 0x10
Index: elm2.4.ME+.122-cvs/hdrs/shared_imp.h
*** elm2.4.ME+.121/hdrs/shared_imp.h 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/shared_imp.h 2005-05-21 20:58:31.000000000 +0300
***************
*** 1,7 ****
! /* $Id: shared_imp.h,v 1.17 2004/06/18 09:29:50 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! /* $Id: shared_imp.h,v 1.18 2005/05/21 17:58:31 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 70,75 ****
--- 70,76 ----

struct sl_base_data * base;
struct sl_connect_data * connect;
+ struct sl_mailer_data * mailer;
} r;
} * regs;
int regs_count;
***************
*** 114,119 ****
--- 115,121 ----
extern void load_shared_libs P_((void));
extern int tag_ok P_((CONST char *name));
extern void load_code0 P_((struct ImpInfo *I));
+ extern void register_list P_((SHAREDLIB *Z));

/*
* Local Variables:
Index: elm2.4.ME+.122-cvs/hdrs/s_me.h
*** elm2.4.ME+.121/hdrs/s_me.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/s_me.h 2005-07-01 12:15:03.000000000 +0300
***************
*** 208,215 ****
#define MeCouldnWriteFile 0xe0
#define MeUnsafeFile1 0xe1
#define MeUnsafeFile2 0xe2
! #define MeAttachFilename1 0xe3
! #define MeAttachFilename2 0xe4
#define MeAttachDescription 0xe5
#define MeAttachContentType 0xe8
#define MeAttachContentTE 0xe9
--- 208,214 ----
#define MeCouldnWriteFile 0xe0
#define MeUnsafeFile1 0xe1
#define MeUnsafeFile2 0xe2
! #define MeAttachFilenameS 0xe3
#define MeAttachDescription 0xe5
#define MeAttachContentType 0xe8
#define MeAttachContentTE 0xe9
***************
*** 333,335 ****
--- 332,367 ----
#define MeUUDECODECorrupt 0x161
#define MeCanceled 0x162
#define MeConnectCanceled 0x163
+ #define MeParseAmbiguousMultipart 0x164
+ #define MeExecuteMetamail 0x165
+ #define MeSaveToFile 0x166
+ #define MePrintAttach 0x167
+ #define MeViewSubparts 0x168
+ #define MeUnknownUnsupportedKB 0x169
+ #define MeUnsupportedDW 0x16a
+ #define MeLookingUpNotExists 0x16b
+ #define MeLookingUpFailed 0x16c
+ #define MeSortingDirByName 0x16d
+ #define MeSortingDirByRevName 0x16e
+ #define MeSortingDirByMtime 0x16f
+ #define MeSortingDirByRevMtime 0x170
+ #define MeMissingEqual 0x171
+ #define MeMissingName 0x172
+ #define MeTrailingBackslashHeader 0x173
+ #define MeMissingQuote 0x174
+ #define MeEqualOnValue 0x175
+ #define MeSpaceOnValue 0x176
+ #define MeMissingValue 0x177
+ #define MeMissingSemicolonHeader 0x178
+ #define MeAttachFilename0 0x179
+ #define MeAsciiRequiredTok 0x17a
+ #define MeParseErrorNameExpected 0x17b
+ #define MeParseErrorEqualExpectedEOS 0x17c
+ #define MeParseErrorEqualExpected 0x187
+ #define MeParseErrorValueExpectedEOS 0x188
+ #define MeParseErrorValueExpected 0x189
+ #define MeParseErrorSemicolonExpected 0x18a
+ #define MeParseErrorFailed 0x18b
+ #define MeTrailingBackslashOnString 0x18c
+ #define MeMissingEndQuote 0x18d
+ #define MeDecodeDescFilenameA1 0x18e
Index: elm2.4.ME+.122-cvs/lib/add_site.c
*** elm2.4.ME+.121/lib/add_site.c 2004-03-30 19:38:43.000000000 +0300
--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************
*** 1,52 ****
- static char rcsid[] = "@(#)$Id: add_site.c,v 1.5 2004/03/27 18:31:37 hurtta Exp $";
-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


- *
- * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
- * (was hurtt...@ozone.FMI.FI)
- ******************************************************************************
- * The Elm Mail System
- *

- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- *****************************************************************************/
-
- #include "headers.h"
-
- int add_site(buffer, site, lastsite, size)
- char *buffer, *site, *lastsite;
- int size;
- {
- /** add site to buffer, unless site is 'uucp' or site is
- the same as lastsite. If not, set lastsite to site.
- **/
-
- char local_buffer[SLEN], *stripped;
- char *strip_parens();
-
- stripped = strip_parens(site);
-
- if (istrcmp(stripped, "uucp") != 0)
- if (strcmp(stripped, lastsite) != 0) {
- if (buffer[0] == '\0')
- strfcpy(buffer, stripped, size); /* first in list! */
- else {
- elm_sfprintf(local_buffer,sizeof local_buffer,
- FRM("%.*s!%.*s"),
- sizeof local_buffer /2 -2, buffer,
- sizeof local_buffer /2 -2, stripped);
- strfcpy(buffer, local_buffer, size);
- }
- strfcpy(lastsite, stripped, size); /* don't want THIS twice! */


- }
- return 0;
- }

-
- /*
- * Local Variables:
- * mode:c
- * c-basic-offset:4
- * buffer-file-coding-system: iso-8859-1
- * End:
- */
--- 0 ----

Index: elm2.4.ME+.122-cvs/lib/aliasdb.c
*** elm2.4.ME+.121/lib/aliasdb.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/aliasdb.c 2005-06-18 00:02:53.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: aliasdb.c,v 1.8 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: aliasdb.c,v 1.9 2005/06/17 21:02:53 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 32,37 ****
--- 32,42 ----
#define MAPIN(o) ((db->dbz_bytesame) ? (of_t) (o) : bytemap((of_t)(o), db->dbz_conf.bytemap, db->dbz_mybmap))
#define MAPOUT(o) ((db->dbz_bytesame) ? (of_t) (o) : bytemap((of_t)(o), db->dbz_mybmap, db->dbz_conf.bytemap))

+ static of_t bytemap P_((of_t ino,
+ int *map1,
+ int *map2));
+
+
static of_t /* transformed result */
bytemap(ino, map1, map2)
of_t ino;
***************
*** 52,57 ****
--- 57,66 ----
return(out.o);
}

+ int read_one_alias P_((DBZ *db,
+ struct alias_disk_rec *adr));
+
+
int read_one_alias(db, adr)
DBZ *db;
struct alias_disk_rec *adr;
***************
*** 96,101 ****
--- 105,112 ----
* dynamically allocated memory is returned. When the end of file is
* reached, a NULL is returned.
*/
+
+
struct alias_rec *fetch_alias(db, alias)
DBZ *db;
char *alias;
Index: elm2.4.ME+.122-cvs/lib/cancel.c
*** elm2.4.ME+.121/lib/cancel.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/cancel.c 2005-06-18 00:02:53.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cancel.c,v 1.3 2004/07/27 20:25:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cancel.c,v 1.4 2005/06/17 21:02:53 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 12,17 ****
--- 12,18 ----

DEBUG_VAR(Debug,__FILE__,"ui");

+ static void cancel_set_ttysig_d P_((void));
static void cancel_set_ttysig_d()
{
/* NULL */
***************
*** 19,24 ****
--- 20,26 ----



static cancel_set_ttysig_f * SET_TTYSIG = &cancel_set_ttysig_d;

+ static void cancel_reset_ttysig_d P_((void));
static void cancel_reset_ttysig_d()
{
/* NULL */
***************
*** 26,31 ****
--- 28,34 ----



static cancel_reset_ttysig_f * RESET_TTYSIG = &cancel_reset_ttysig_d;

+ static void cancel_transient_d P_((struct string *x));
static void cancel_transient_d(x)
struct string *x;
{
***************
*** 34,39 ****
--- 37,43 ----



static cancel_transient_f * TRANSIENT = &cancel_transient_d;

+ static void cancel_clear_d P_((void));
static void cancel_clear_d()
{
lib_transient(FRM(""));
Index: elm2.4.ME+.122-cvs/lib/charset.c
*** elm2.4.ME+.121/lib/charset.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/charset.c 2005-06-18 00:02:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: charset.c,v 1.76 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: charset.c,v 1.84 2005/06/17 21:02:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.84 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
***************
*** 222,227 ****
--- 222,295 ----
return &(tmp->set);
}

+ #if defined(WCHAR) && defined(__STDC_ISO_10646__)
+
+ void change_system_charset_1 P_((void));
+
+ void change_system_charset()
+ {
+ char ** cs;

+ int i;
+
+

+ if (system_charset->charset_type == &cs_unknown) {
+ DPRINT(Debug,9,(&Debug,"change_system_charset: System charset is already type unknown\n"));
+ return;
+ }
+
+ if (!system_charset->MIME_name) {
+ DPRINT(Debug,9,(&Debug,"change_system_charset: System charset have no MIME name\n"));
+ return;
+ }
+
+ cs = give_dt_path_as_elems(&locale_charsets,"locale-charsets");
+ if (!cs) {
+ DPRINT(Debug,9,(&Debug,
+ "change_system_charset: No change: locale-charsets list empty\n"));
+ return;
+ }
+
+ for (i = 0; cs[i]; i++) {
+ if (0 == istrcmp(cs[i],system_charset->MIME_name)) {
+ DPRINT(Debug,9,(&Debug,
+ "change_system_charset: Found system charset %s from list, item #%d\n",
+ system_charset->MIME_name,i));
+ break;
+ }
+ }
+
+ if (!cs[i]) {
+ DPRINT(Debug,9,(&Debug,
+ "change_system_charset: No change\n"));
+ return;
+ }
+
+ change_system_charset_1();
+ }
+
+ void change_system_charset_1() {
+ struct charcode_info new_vals;
+ charset_t x;
+
+
+ new_vals = *system_charset;
+ new_vals.charset_type = &cs_unknown;
+ new_vals.map_info = NULL;
+ new_vals.flags |= SET_nodata;
+
+ system_charset->flags &= ~SET_valid;
+
+ x = add_set(new_vals);
+
+ DPRINT(Debug,9,(&Debug,
+ "change_system_charset_1: Changed system charset %s (type %s) to type unknown\n",
+ system_charset->MIME_name,
+ system_charset->charset_type->type_name));
+
+ system_charset = x;
+ }
+ #endif
+
static int same_name P_((struct charcode_info *set, union compare_info data));
static int same_name (set,data)
struct charcode_info *set;
***************
*** 312,318 ****
ret = ASCII_SET;
}

! if (ret && &cs_unknown == ret->charset_type) {
DPRINT(Debug,9,(&Debug, "MIME_name_to_charset(%s), found=%p as unknown\n",
name,ret));

--- 380,387 ----
ret = ASCII_SET;
}

! if (ret && &cs_unknown == ret->charset_type &&
! 0 == (charset_properties(ret) & CS_mapping)) {
DPRINT(Debug,9,(&Debug, "MIME_name_to_charset(%s), found=%p as unknown\n",
name,ret));

***************
*** 511,516 ****
--- 580,589 ----
"ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789abcdefghijklmnopqrstuvwxyz");
}

+
+ #ifdef ANSI_C
+ option_func charset_compatfunc;
+ #endif
int charset_compatfunc (value,enter, lineno,filename)
char **value;
int enter;
***************
*** 669,674 ****
--- 742,750 ----
#undef ADD_IT
#undef HANDLE

+ #ifdef ANSI_C
+ option_func charset_iso646func;
+ #endif
int charset_iso646func (value,enter, lineno,filename)
char **value;
int enter;
***************
*** 1222,1231 ****
}
*buffer = add_set(new_vals);
DPRINT(Debug,9,(&Debug,
! "charset: Adding charset %s (type %s)\n",
! (*buffer)->MIME_name ?
! (*buffer)->MIME_name : "<no MIME name>",
! (*buffer)->charset_type->type_name));
}

if (alias_vector) {
--- 1298,1319 ----
}
*buffer = add_set(new_vals);
DPRINT(Debug,9,(&Debug,
! "charset: Adding "));
!
! if ((*buffer)->MIME_name) {
! DPRINT(Debug,9,(&Debug,
! "charset %s ",
! (*buffer)->MIME_name));
! }
! if ((*buffer)->codeset) {
! DPRINT(Debug,9,(&Debug,
! "codeset %s ",
! (*buffer)->codeset));
! }
! DPRINT(Debug,9,(&Debug,
! "(type %s) = %p\n",
! (*buffer)->charset_type->type_name,
! *buffer));
}

if (alias_vector) {
***************
*** 1329,1408 ****
}
}

- int get_charset_map_info (buffer,data,size)
- char *buffer;
- CONST char *data;
- int size;
- {
- charset_t set;

! if (!load_charset_map_info(&set,data) ||
! !set->MIME_name) {
! buffer[0] = '\0';

! DPRINT(Debug,7,(&Debug,
! "get_charset_map_info(\"%s\") = 0 (FAIL)\n",
! data));

! return 0;
! }

! strfcpy(buffer,set->MIME_name,size);

! DPRINT(Debug,11,(&Debug,
! "get_charset_map_info(\"%s\") = 1 (SUCCEED)\n",
! data));
! return 1;
! }

- static int charset_superset_of_p P_((charset_t charset,
- charset_t subset,
- int level));

- static int charset_superset_of_p(charset,subset,level)
- charset_t charset,subset;
- int level;
- {

! if (level > 10) {
! lib_error(CATGETS(elm_msg_cat, MeSet, MeCharsetSubsetLoop,
! "Charset subset defination loop detected for %s"),
! charset->MIME_name ? charset->MIME_name : "<no MIME name>");
! return 0;
}

- if (charset->subtype == subset)
- return 1;
-
- if (charset->subtype &&
- charset_superset_of_p(charset->subtype,subset,level+1))
- return 1;


- return 0;
- }
-

- int charset_superset_of(charset,subset)
- charset_t charset,subset;
- {
- int res = charset_superset_of_p(charset,subset,0);

DPRINT(Debug,6,(&Debug,
! "charset_superset_of(%p (%s),%p (%s))=%d\n",
! charset,
! charset->MIME_name ? charset->MIME_name :"<no MIME name>",
! subset,subset->MIME_name ? subset->MIME_name :"<no MIME name>",
! res));
return res;


}

int charset_ok_p(ptr)
charset_t ptr;
{
charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);

if (!ascii_ptr)
panic("CHARSET PANIC",__FILE__,__LINE__,"charset_ok_p",
"US-ASCII not found",0);
! return charset_superset_of(ptr,ascii_ptr);
}

struct locale_map_item * load_locale_map(filename,errors)

--- 1417,1506 ----
}
}


! int charset_superset_of(charset,subset)
! charset_t charset,subset;
! {
! int res = 0;
! int loop = 0;
! charset_t p;
!
! DPRINT(Debug,6,(&Debug,
! "charset_superset_of(%p (%s),%p (%s))\n",
! charset,
! charset->MIME_name ? charset->MIME_name :"<no MIME name>",
! subset,subset->MIME_name ? subset->MIME_name :"<no MIME name>"));

! for (p = charset; p; p = p->subtype) {
! DPRINT(Debug,6,(&Debug, " subset: %p (%s)\n",
! p,
! p->MIME_name ? p->MIME_name :"<no MIME name>"));
!

! if (p == subset) {
! DPRINT(Debug,6,(&Debug, " subset found\n"));
! res = 1;
! }

! if (p->subtype == charset) {
! DPRINT(Debug,6,(&Debug, " loop found\n"));

! lib_error(CATGETS(elm_msg_cat, MeSet, MeCharsetSubsetLoop,
! "Charset subset defination loop detected for %s"),
! charset->MIME_name ? charset->MIME_name : "<no MIME name>");
! break;
! }



! if (loop++ > 20) {
! /* Catch other loop which do not go tgrough original set */
! lib_error(CATGETS(elm_msg_cat, MeSet, MeCharsetSubsetLoop,
! "Charset subset defination loop detected for %s"),
! p->MIME_name ? p->MIME_name : "<no MIME name>");
! break;
! }
}


DPRINT(Debug,6,(&Debug,
! "charset_superset_of=%d\n",
! res));
return res;

! ascii_ptr->MIME_name ? ascii_ptr->MIME_name :"<no MIME name>"));
! r = 1;
! }
!
! return r;
}

struct locale_map_item * load_locale_map(filename,errors)

Index: elm2.4.ME+.122-cvs/lib/cs_binary.c
*** elm2.4.ME+.121/lib/cs_binary.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/cs_binary.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_binary.c,v 1.42 2004/03/27 18:31:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cs_binary.c,v 1.46 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 37,48 ****
extern int errno;
#endif

- static unsigned char *s2us P_((char *str));
- static unsigned char *s2us(str)
- char *str;
- {
- return (unsigned char *)str;
- }

/* bindata ---------------------------------------------------------------- */

--- 37,42 ----
***************
*** 1144,1149 ****
--- 1138,1144 ----

/* ======================================================================== */

+
static void cs_init_binary P_((struct string *str));
static void cs_init_binary(str)
struct string *str;
***************
*** 1252,1263 ****
/* Returns number of bytes added */
static int cs_add_streambytes_to_binary P_((struct string *str,
int count,
! const unsigned char *data));

! static int cs_add_streambytes_to_binary(str,count,data)
struct string *str;
int count;
CONST unsigned char *data;
{
int i;

--- 1247,1260 ----
/* Returns number of bytes added */
static int cs_add_streambytes_to_binary P_((struct string *str,
int count,
! const unsigned char *data,
! int *errors));

! static int cs_add_streambytes_to_binary(str,count,data, errors)
struct string *str;
int count;
CONST unsigned char *data;
+ int *errors;
{
int i;

***************
*** 1265,1270 ****
--- 1262,1269 ----
panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",
"Negative length",0);

+ *errors = 0;
+
if (count > 0) {
/* realloc with size 0 is equivalent of free and may
corrupt memory ...
***************
*** 1424,1491 ****
return cs_unicode_ascii_helper(ch,st->charset,found);
}

- static uint16 cs_unicode_unknown_helper P_((unsigned int ch,
- charset_t set, int *found));
- static uint16 cs_unicode_unknown_helper(ch,set, found)
- unsigned int ch;
- charset_t set;
- int *found;
- {
- *found = 0;
-
- /* We assume that values < 32 are same control characters
- * on all sets -- after all MIME requires that on all
- * character sets characters CR and LF are on same position
- */
-
- /* If charset is system character set then assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
- if (set == system_charset) {
- uint16 val = map_fallback(ch);
- if (val != MAPPING_NONE) {
- *found = 1;
- return val;
- }
- }
-
- if (ch < 32) {
- *found = 1;
- return ch;
- }
- return 0x003F; /* '?' */
-
- }
-
- static uint16 cs_give_unicode_from_unknown P_((const struct string *str,
- int pos, int *found));
- static uint16 cs_give_unicode_from_unknown(str,pos,found)
- CONST struct string *str;
- int pos;
- int *found;
- {
- unsigned char ch;
-
- if (pos < 0 || pos >= str->p->len)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_give_unicode_from_unknown",
- "Index out of array",0);
-
- ch = str->p->a.bytes[pos];
- return cs_unicode_unknown_helper(ch,str->string_type,found);
- }
-
- static uint16 cs_give_unicode_from_s_unknown P_((struct charset_state *st,
- int *found));
- static uint16 cs_give_unicode_from_s_unknown(st,found)
- struct charset_state *st;
- int *found;
- {
- unsigned char ch;
-
- ch = st->p->a.byte;
- return cs_unicode_unknown_helper(ch,st->charset,found);
- }

static uint16 cs_give_unicode_from_iso646 P_((const struct string *str,
int pos, int *found));
--- 1423,1428 ----
***************
*** 1629,1689 ****
}
}

- static void cs_add_unicodedata_to_unknown P_((struct string *str,
- int len, const uint16 *data));
- static void cs_add_unicodedata_to_unknown(str,len,data)
- struct string *str;
- int len;
- CONST uint16 *data;
- {
- int i;
-
- if (len > 0) {
- /* realloc with size 0 is equivalent of free and may
- corrupt memory ...
- */
-
- /* NOTE: str->p->a.bytes is not NUL terminated */
- str->p->a.bytes = safe_realloc(str->p->a.bytes,len+str->p->len);
-
- for (i = 0; i < len; i++) {
- unsigned char ch = 0;
- int found = 0;
-
- /* If charset is system character set assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
-
- if (str->string_type == system_charset) {
- ch = map_fallback_rev(data[i],&found);
- if (found)
- str->p->a.bytes[str->p->len++] = ch;
- }
-
- /* We assume that values < 32 are same control characters
- * on all sets -- after all MIME requires that on all
- * character sets characters CR and LF are on same position
- */
-
- if (!found && data[i] < 32)
- str->p->a.bytes[str->p->len++] = data[i];
-
- /* Because character set is unknow we do not know any
- * replacement character what we can use, therefore
- * we add nothing.
- *
- * If however map_fallback_rev() is given replacement character
- * we use it.
- */
-
- else if (ch && !found)
- str->p->a.bytes[str->p->len++] = ch;
-
- }
- }
- }
-
static void cs_add_unicodedata_to_iso646 P_((struct string *str,
int len, const uint16 *data));
static void cs_add_unicodedata_to_iso646(str,len,data)
--- 1566,1571 ----
***************
*** 1714,1723 ****
}
}

! static int cs_cmp_binary P_((struct string *str1,struct string *str2));
static int cs_cmp_binary(str1,str2)
! struct string *str1;
! struct string *str2;
{
int i;

--- 1596,1605 ----
}
}

! static int cs_cmp_binary P_((const struct string *str1,const struct string *str2));
static int cs_cmp_binary(str1,str2)
! CONST struct string *str1;
! CONST struct string *str2;
{
int i;

***************
*** 1741,1749 ****
}

#ifndef ASCII_CTYPE
! static unsigned char *cs_stream_from_locale P_((const struct string *str,
! int *reslen));
! static unsigned char *cs_stream_from_locale(str,reslen)
CONST struct string *str;
int *reslen;
{
--- 1623,1631 ----
}

#ifndef ASCII_CTYPE
! unsigned char *cs_stream_from_locale P_((const struct string *str,
! int *reslen));
! unsigned char *cs_stream_from_locale(str,reslen)
CONST struct string *str;
int *reslen;
{
***************
*** 1763,1770 ****
return ret;
}

! static int cs_s_locale_printable P_((struct charset_state *st));
! static int cs_s_locale_printable(st)
struct charset_state *st;
{
unsigned char c1 = st->p->a.byte;
--- 1645,1652 ----
return ret;
}

! int cs_s_locale_printable P_((struct charset_state *st));
! int cs_s_locale_printable(st)
struct charset_state *st;
{
unsigned char c1 = st->p->a.byte;
***************
*** 1936,1944 ****
}

#ifndef ASCII_CTYPE
! static unsigned char *cs_streamclip_from_locale P_((const struct string *str,
! int *pos, int len));
! static unsigned char *cs_streamclip_from_locale(str,pos,len)
CONST struct string *str;
int *pos;
int len;
--- 1818,1824 ----
}

#ifndef ASCII_CTYPE
! unsigned char *cs_streamclip_from_locale(str,pos,len)
CONST struct string *str;
int *pos;
int len;
***************
*** 2067,2197 ****
return ret;
}

- static unsigned char *cs_stream_from_unknown P_((const struct string *str,
- int printable,
- screen_info_p terminal,
- int *reslen));
- static unsigned char *cs_stream_from_unknown(str,printable,terminal,reslen)
- CONST struct string *str;
- int printable;
- screen_info_p terminal; /* NOT USED */
- int *reslen;
- {
- unsigned char * ret;
-
- #ifndef ASCII_CTYPE
- if (printable &&
- str->string_type == system_charset)
- return cs_stream_from_locale(str,reslen);
- #endif
-
- if (!printable) {
- int l = 0,i;
-
- ret = safe_malloc(str->p->len+1);
-
- for (i = 0; i < str->p->len; i++)
- ret[l++] = str->p->a.bytes[i];
- ret[l] = '\0';
- *reslen = l;
-
- } else if (str->string_type == system_charset) {
- int l = 0,i;
- ret = safe_malloc(str->p->len+1);
-
- /* If charset is system character set assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
-
- for (i = 0; i < str->p->len; i++) {
- uint16 val = map_fallback(str->p->a.bytes[i]);
-
- if (val != MAPPING_NONE &&
- val >= 0x0020)
- ret[l++] = str->p->a.bytes[i];
- else
- ret[l++] = '?'; /* See above ... */
- }
- ret[l] = '\0';
- *reslen = l;
-
- } else {
- /* Because charset is unknown we do not have able to print
- * printable characters -- also we do not know replacement
- * characters...
- */
-
- ret = s2us(safe_strdup(""));
- *reslen = 0;


- }
-
- return ret;
- }
-
-

- static unsigned char *cs_streamclip_from_unknown P_((const struct string *str,
- int *pos, int len,
- screen_info_p terminal,
- struct cs_printable_len *printable_len));
- static unsigned char *cs_streamclip_from_unknown(str,pos,len,terminal,printable_len)
- CONST struct string *str;
- int *pos;
- int len;
- screen_info_p terminal; /* NOT USED */
- struct cs_printable_len *printable_len; /* NOT USED */
- {
- unsigned char * ret;
-
- if (*pos < 0)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
- "Index out of array",0);
-
- if (len < 0)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_UNKNOWN",
- "Negative size",0);
-
- #ifndef ASCII_CTYPE
- if (str->string_type == system_charset)
- return cs_streamclip_from_locale(str,pos,len);
- #endif
-
- if (str->string_type == system_charset) {
- int l = 0,i;
- ret = safe_malloc(len+1);
-
- /* If charset is system character set then assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
-
- for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {
- uint16 val = map_fallback(str->p->a.bytes[*pos]);
-
- if (val != MAPPING_NONE &&
- val >= 0x0020)
- ret[l++] = str->p->a.bytes[*pos];
- else
- ret[l++] = '?'; /* See above ... */
- }
- ret[l] = '\0';
-
- } else {
-
- ret = s2us(safe_strdup(""));
- /* Because charset is unknown we do not have able to print
- * printable characters -- also we not know replacement
- * characters...
- */
-
- /* Indicate that we are 'clipped' whole string */
- if (*pos < str->p->len)
- *pos = str->p->len;


-
- }
- return ret;
- }
-

static unsigned char *cs_streamclip_from_iso646 P_((const struct string *str,
int *pos, int len,
screen_info_p terminal,
--- 1947,1952 ----
***************
*** 2319,2347 ****
return 1;
}

- static int cs_can_ascii_unknown P_((const struct string *str));
- static int cs_can_ascii_unknown(str)
- CONST struct string *str;
- {
-
- if (str->string_type == system_charset) {
- int i;
- /* If charset is system character set then assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
-
- for (i = 0; i < str->p->len; i++) {
- uint16 val = map_fallback(str->p->a.bytes[i]);
-
- /* MAPPING_NONE is > 127 */
- if (val > 127)


- return 0;
- }
- return 1;
- } else

- return 0;
- }

static int cs_can_ascii_iso646 P_((const struct string *str));
static int cs_can_ascii_iso646(str)
--- 2074,2079 ----
***************
*** 2362,2371 ****
}

#ifndef ASCII_CTYPE
- static int cs_find_pattern_from_locale P_((const struct string *str,
- const struct string *pattern));

! static int cs_find_pattern_from_locale(str,pattern)
CONST struct string *str;
CONST struct string *pattern;
{
--- 2094,2101 ----
}

#ifndef ASCII_CTYPE

! int cs_find_pattern_from_locale(str,pattern)
CONST struct string *str;
CONST struct string *pattern;
{
***************
*** 2490,2541 ****
}
return ret;
}
-
- static int cs_find_pattern_from_unknown P_((const struct string *str,
- const struct string *pattern,
- int ignore_case));
-
- static int cs_find_pattern_from_unknown(str,pattern,ignore_case)
- CONST struct string *str;
- CONST struct string *pattern;
- int ignore_case;


- {
- int ret = 0;

- int i, j;
-
- if (pattern->string_type->charset_type !=
- str->string_type->charset_type)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_find_pattern_from_unknown",
- "String type mismatch",0);
-
- #ifndef ASCII_CTYPE
- if (ignore_case && str->string_type == system_charset)
- return cs_find_pattern_from_locale(str,pattern);
- #endif
-
- for (i = 0; i < str->p->len; ) {
- CONST int s = i + 1;
-
- for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {
- unsigned char c2 = pattern->p->a.bytes[j];
- unsigned char c1 = str->p->a.bytes[i];
-
- /* We can not convert characters lowercase because
- * charset is unknown
- */
-
- if (c1 != c2)
- break;
- }
- if (j >= pattern->p->len) {
- ret = 1;
- break;
- }
- i = s;


- }
- return ret;
- }
-

static int cs_find_pattern_from_iso646 P_((const struct string *str,
const struct string *pattern,
int ignore_case));
--- 2220,2225 ----
***************
*** 2598,2606 ****
}

#ifndef ASCII_CTYPE
! static void cs_remove_control_locale P_((const struct string *str,
! unsigned int repl));
! static void cs_remove_control_locale(str,repl)
CONST struct string *str;
unsigned int repl;
{
--- 2282,2288 ----
}

#ifndef ASCII_CTYPE
! void cs_remove_control_locale(str,repl)
CONST struct string *str;
unsigned int repl;
{
***************
*** 2614,2655 ****

#endif

- static void cs_remove_control_unknown P_((const struct string *str));
- static void cs_remove_control_unknown(str)
- CONST struct string *str;
- {
- int i;
-
- #ifndef ASCII_CTYPE
- if (str->string_type == system_charset) {
- cs_remove_control_locale(str,' ');
- return;
- }
- #endif
-
- for (i = 0; i < str->p->len; i++) {
- /* We assume that values < 32 are same control characters
- * on all sets -- after all MIME requires that on all
- * character sets characters CR and LF are on same position
- */
-
-
- if (str->p->a.bytes[i] < 32) {
- if (str->string_type == system_charset)
- /* If charset is system character set then assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
- str->p->a.bytes[i] = ' ';
-
- else
- /* We HOPE that 32 is printable character... */
- str->p->a.bytes[i] = 32;
- }
- }
-
- }
-

static void cs_remove_control_ascii P_((const struct string *str));
static void cs_remove_control_ascii(str)
--- 2296,2301 ----
***************
*** 2791,2802 ****
return ret;
}

- static struct map_info * cs_find_unknown P_((const char * map_name));
- static struct map_info * cs_find_unknown(map_name)
- CONST char * map_name;
- {
- return NULL;
- }

static struct map_info * cs_find_iso646 P_((const char * map_name));
static struct map_info * cs_find_iso646(map_name)
--- 2437,2442 ----
***************
*** 3101,3129 ****
return 0;
}

- static int cs_iso2022_info_set_unknown P_((struct charcode_info *new_vals,
- struct setlist *new_setlist,
- int setcount));
- static int cs_iso2022_info_set_unknown(new_vals, new_setlist,setcount)
- struct charcode_info *new_vals;
- struct setlist *new_setlist;
- int setcount;
- {
- int ptr_94 = -1;
- int ptr_96 = -1;
- int banks[ISO2022_BANK_NUM];
-
- if (!cs_info_set_scan(new_vals,new_setlist,setcount,&ptr_94,&ptr_96,
- banks)) {


- return 0;
- }
-

- new_vals->iso2022_info = loc_setlist(*new_setlist);
- new_vals->flags &= ~SET_nodata;


-
- return 1;
- }
-



--- 2741,2746 ----
***************
*** 3225,3262 ****
&cs_onebyte
};

- struct charset_type cs_unknown = { "unknown-charset",
- cs_init_binary,
- cs_free_binary,
- cs_add_streambyte_to_binary,
- cs_add_intdata_to_binary,
- cs_check_length_binary,
- cs_give_unicode_from_unknown,
- cs_add_unicodedata_to_unknown,
- cs_cmp_binary,
- cs_stream_from_unknown,
- cs_can_ascii_unknown,
- cs_streamclip_from_unknown,
- cs_clip_from_binary,
- cs_find_pattern_from_unknown,
- cs_add_streambytes_to_binary,
- cs_find_unknown,
- cs_remove_control_unknown,
- cs_add_state_to_binary,
- cs_init_s_binary,
- cs_free_s_binary,
- cs_add_streambyte_to_s_binary,
- cs_soft_reset_s_binary,
- cs_give_unicode_from_s_unknown,
- cs_s_binary_same_char,
- cs_s_generic_printable,
- cs_s_binary_is_onebyte,
- cs_onebyte_properties,
- cs_estimate_clip_unsupported,
- cs_iso2022_info_set_unknown,
- &cs_ascii
- };
-

/*
* Local Variables:
* mode:c

--- 2842,2847 ----
Index: elm2.4.ME+.122-cvs/lib/cs_fallback.c
*** elm2.4.ME+.121/lib/cs_fallback.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/cs_fallback.c 2005-06-18 00:02:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_fallback.c,v 1.6 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cs_fallback.c,v 1.8 2005/06/17 21:02:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 110,115 ****
--- 110,116 ----
static uint16 from_fallback_cs[256] = { 0 };
static int initialized = 0;

+ static void init_fallback P_((void));
static void init_fallback() {
int i;

Index: elm2.4.ME+.122-cvs/lib/cs_iso2022.c
*** elm2.4.ME+.121/lib/cs_iso2022.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/cs_iso2022.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.36 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.40 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 64,71 ****
break;
}
setlist[count] = find_iso2022_map_spec(X1);
! if (-1 == setlist[count])
return NULL;
count++;
}
free(X);
--- 64,73 ----
break;
}
setlist[count] = find_iso2022_map_spec(X1);
! if (-1 == setlist[count]) {
! free(X);
return NULL;
+ }
count++;
}
free(X);
***************
*** 1010,1017 ****
return 1;
}

- static int cs_add_streambyte_to_s_iso2022 P_((struct charset_state *str,
- int ch));
static void cs_soft_reset_s_iso2022_gen P_((struct charset_state *str));

S_(cs_add_streambyte_to_string cs_add_streambyte_to_iso2022_gen)
--- 1012,1017 ----
***************
*** 1499,1506 ****

S_(cs_cmp_string cs_cmp_iso2022_gen)
static int cs_cmp_iso2022_gen(str1,str2)
! struct string *str1;
! struct string *str2;
{
struct mb_data * X1 = str1->p->a.data;
struct mb_data * X2 = str1->p->a.data;
--- 1499,1506 ----

S_(cs_cmp_string cs_cmp_iso2022_gen)
static int cs_cmp_iso2022_gen(str1,str2)
! CONST struct string *str1;
! CONST struct string *str2;
{
struct mb_data * X1 = str1->p->a.data;
struct mb_data * X2 = str1->p->a.data;
***************
*** 3541,3554 ****

/* Returns number of bytes added */
S_(cs_add_streambytes_to_string cs_add_streambytes_to_iso2022_gen)
! static int cs_add_streambytes_to_iso2022_gen(str,count,data)
struct string *str;
int count;
CONST unsigned char *data;
{
int i = 0;
struct state_iso2022 * X ;

if (!str->p->state)
str->p->state = new_state_1(str->string_type);

--- 3541,3557 ----

/* Returns number of bytes added */
S_(cs_add_streambytes_to_string cs_add_streambytes_to_iso2022_gen)
! static int cs_add_streambytes_to_iso2022_gen(str,count,data,errors)
struct string *str;
int count;
CONST unsigned char *data;
+ int *errors;
{
int i = 0;
struct state_iso2022 * X ;

+ *errors = 0;
+
if (!str->p->state)
str->p->state = new_state_1(str->string_type);

***************
*** 3587,3596 ****
DPRINT(Debug,8,(&Debug,
"cs_add_streambytes_to_iso2022_gen: failed to add code\n"));

! return i; /* Failed to add character */
! } else {
! i++;
}
} else {
break; /* All characters entered */
}
--- 3590,3603 ----
DPRINT(Debug,8,(&Debug,
"cs_add_streambytes_to_iso2022_gen: failed to add code\n"));

! /* Failed to add character */
! (*errors)++;
! cs_soft_reset_s_iso2022_gen(str->p->state);
! X->raw_bytes_count = 0;
}
+
+ i++;
+
} else {
break; /* All characters entered */
}
***************
*** 3599,3605 ****
if (0 == c) {
DPRINT(Debug,8,(&Debug,
"cs_add_streambytes_to_iso2022_gen: bad code\n"));
! return i;
}
}
}
--- 3606,3613 ----
if (0 == c) {
DPRINT(Debug,8,(&Debug,
"cs_add_streambytes_to_iso2022_gen: bad code\n"));
! (*errors)++;
! cs_soft_reset_s_iso2022_gen(str->p->state);
}
}
}
Index: elm2.4.ME+.122-cvs/lib/cs_unknown.c
*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/cs_unknown.c 2005-07-01 12:15:03.000000000 +0300
***************
*** 0 ****
--- 1,2036 ----
+ static char rcsid[] = "@(#)$Id: cs_unknown.c,v 1.13 2005/07/01 09:15:03 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+
+ #include "headers.h"
+ #include "s_me.h"
+ #include "cs_imp.h"
+ #include "cs_terminal.h"


+
+ #include <errno.h>
+ #ifndef ANSI_C
+ extern int errno;

+ #endif
+
+ #ifdef WCWIDTH
+ int wcwidth(wchar_t c);
+ #endif
+
+
+ DEBUG_VAR(Debug,__FILE__,"charset");


+
+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ static unsigned char *s2us P_((char *str));
+ static unsigned char *s2us(str)
+ char *str;
+ {
+ return (unsigned char *)str;
+ }
+
+ /* ---------------------------------------------------------------- */
+
+ #ifdef WCHAR
+ static void convert_to_wchar P_((const struct string *str));
+ static void convert_to_wchar(str)
+ const struct string *str;
+ {
+ unsigned char *bytes;
+ int b_len;
+
+ if (str->p->private_flag)
+ panic("STRING PANIC",__FILE__,__LINE__,"convert_to_wchar",
+ "Not in raw form",0);
+
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"convert_to_wchar",
+ "not a system charset",0);
+
+
+ bytes = str->p->a.bytes;
+ b_len = str->p->len;
+ str->p->a.bytes = NULL;
+
+ str->p->private_flag = 1; /* Indicate wchars */
+ str->p->a.wchars = NULL;
+ str->p->len = 0;
+
+ if (bytes) {
+ int x;
+ mbstate_t State;
+ wchar_t * dest = NULL;
+ int alloced;
+ int l = 0;
+ const char * src, * cbytes;
+
+ DPRINT(Debug,61,(&Debug,
+ "convert_to_wchar: raw="));
+ for (x = 0; x < b_len; x++) {
+ DPRINT(Debug,61,(&Debug," %02X",
+ bytes[x]));
+ }
+ DPRINT(Debug,61,(&Debug," (len=%d)\n",b_len));
+
+ memset(&State, 0, sizeof(State));
+
+ /* NOTE: str->p->a.bytes is not NUL terminated
+ *
+ * ! ! ! NOTE! this do not convert strings including \0
+ * characters
+ */
+
+ /* Add terminating \0 */
+ bytes = safe_realloc(bytes,b_len+1);
+ bytes[b_len] = '\0';
+
+ cbytes = (const char *) bytes;
+
+ alloced = b_len+1;
+ dest = safe_malloc(alloced * sizeof (dest[0]));
+
+ for (src = cbytes; src; ) {
+ int left = alloced-l;
+ size_t r = mbsrtowcs(dest+l,&src,left,&State);
+
+ if ((size_t)(-1) == r) {
+ int pos;
+
+ if ('?' == *src)
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "convert_to_wchar",
+ "? not convertible",0);
+ if ('\0' == *src)
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "convert_to_wchar",
+ "Ooops",0);
+
+ pos = src-cbytes;
+
+ DPRINT(Debug,61,(&Debug,
+ "convert_to_wchar: Failed to convert 0x%02x at %d: errno = %d\n",
+ *src,pos,errno));
+
+ bytes[pos] = '?';
+
+
+ } else {
+
+ if (l >= 0)
+ l += r;
+ else
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "convert_to_wchar",
+ "Unexpected return from mbsrtowcs()",0);
+
+ if (src) {
+ int x;
+
+ DPRINT(Debug,4,(&Debug,
+ "convert_to_wchar: wide character string longer than original???\n"));
+
+
+ x = b_len - (src-cbytes);
+
+ alloced += x + 10;
+
+ dest = safe_realloc(dest,alloced * sizeof (dest[0]));

+ }
+
+
+ }
+

+ }
+
+ if ('\0' != dest[l])
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "convert_to_wchar",
+ "\\0 not written",0);
+
+ free(bytes); bytes = NULL;
+
+ str->p->a.wchars = dest;
+ str->p->len = l;
+ }
+
+ }
+
+ #endif
+ /* ---------------------------------------------------------------- */
+
+ S_(cs_init_string cs_init_unknown)
+ static void cs_init_unknown P_((struct string *str));
+ static void cs_init_unknown(str)
+ struct string *str;
+ {
+ str->p->len = 0;
+ str->p->private_flag = 0;
+ str->p->a.bytes = 0;
+
+ /* private_flag = 0 : Use bytes (raw form)
+ private_flag = 1 : Use wchars (locale)


+ */
+
+
+ }

+
+ S_(cs_free_string cs_free_unknown)
+ static void cs_free_unknown P_((struct string *str));
+ static void cs_free_unknown(str)
+ struct string *str;
+ {
+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_free_unknown",
+ "private_flag set for non-system charset",0);
+
+ #ifdef WCHAR
+ if (str->p->a.wchars) {
+ free(str->p->a.wchars);
+ str->p->a.wchars = NULL;
+ }
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_free_unknown",
+ "No wchar_t support",0);
+ #endif
+ } else {
+ /* Use bytes (raw form) */
+
+ if (str->p->a.bytes) {
+ free(str->p->a.bytes);
+ str->p->a.bytes = NULL;
+ }
+ }
+ str->p->len = 0;
+ str->p->private_flag = 0;
+ }
+
+ S_(cs_init_state cs_init_s_unknown)
+ static void cs_init_s_unknown P_((struct charset_state *st));
+ static void cs_init_s_unknown(st)
+ struct charset_state *st;
+ {
+ st->p->ready = 0;
+
+ #ifdef WCHAR
+ if (st->charset == system_charset) {
+ st->p->a.wchar.magic = STATE_WCHAR_magic;
+
+ memset(&(st->p->a.wchar.s), 0, sizeof(st->p->a.wchar.s));
+ st->p->a.wchar.value = L'\0';
+ }
+ else
+ #endif
+ {
+ st->p->a.byte = 0;


+ }
+
+
+
+ }

+
+ S_(cs_free_state cs_free_s_unknown)
+ static void cs_free_s_unknown P_((struct charset_state *st));
+ static void cs_free_s_unknown(st)
+ struct charset_state *st;
+ {
+ st->p->ready = 0;
+
+ #ifdef WCHAR
+ if (st->charset == system_charset) {
+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_free_s_unknown",
+ "Bad magic number",0);
+
+ memset(&(st->p->a.wchar.s), 0, sizeof(st->p->a.wchar.s));
+ st->p->a.wchar.value = L'\0';
+
+
+ st->p->a.wchar.magic = 0; /* Invalidate magic */
+ }
+ else
+ #endif
+ {
+ st->p->a.byte = 0;
+ }
+ }
+
+ S_(cs_soft_reset_state cs_soft_reset_s_unknown)
+ static void cs_soft_reset_s_unknown P_((struct charset_state *st));
+ static void cs_soft_reset_s_unknown(st)
+ struct charset_state *st;
+ {
+
+ st->p->ready = 0;
+
+ /* soft reset should reset only partially state, so ... */
+
+
+ #ifdef WCHAR
+ if (st->charset == system_charset) {
+ static int warned = 0;
+

Kari E. Hurtta

unread,
Jul 13, 2005, 5:54:34 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.17

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 17/18
=========================================================================


! }
!
!
!
!

! static void set_prompt P_((struct pager_page *pager_page));
! static void set_prompt(pager_page)
! struct pager_page *pager_page;
! {


! int LINES, COLUMNS;
!

! menu_get_sizes(pager_page->root,&LINES, &COLUMNS);
!
! if (! pager_page->prompt_area)
! pager_page->prompt_area = new_menu_subpage(pager_page->root,
! LINES-4,4,sb_update_prompt,
! pager_page->PARAM);
! else
! menu_subpage_relocate(pager_page->prompt_area,pager_page->root,
! LINES-4,4);
! }
!
! void put_cmd_name (
! #if ANSI_C
! struct pager_page *pager_page,


! int will_mangle,
! const char * format, const char *msg, ...

! #else
! pager_page,will_mangle,format,msg, va_alist
! #endif
! )
! #if !ANSI_C
! struct pager_page *pager_page;
! int will_mangle;
! CONST char * format;
! CONST char *msg;
! va_dcl
! #endif
! {
! struct string *cmd;
! int r;
! int r1;
! struct menu_common *mptr = mp_lookup_mcommon(pager_page->PARAM,
! elm_mp_menu);
!
! va_list vl;
!
! Va_start(vl, msg); /* defined in defs.h */
! cmd = elm_smessage(0,format,msg,vl);
! va_end(vl);
!
! r = menu_resized(pager_page->root);
! r1 = menu_need_redraw(pager_page->root);
!
! if (r1) {
! menu_ClearScreen(pager_page->root);
! }
!
! if (r || r1 || will_mangle) {
! set_border(pager_page);
! menu_trigger_redraw(pager_page->border_line);
! }
!
! if (pager_page->border_line &&
! menu_need_redraw(pager_page->border_line)) {
! DPRINT(Debug,1, (&Debug, "border line redraw???\n"));
! sb_update_border(pager_page->border_line, NULL);
! }
!
! if (r || r1 || will_mangle) {
! set_prompt(pager_page);
! menu_trigger_redraw(pager_page->prompt_area);
! }
!
! if (pager_page->border_line &&
! menu_need_redraw(pager_page->border_line)) {
! DPRINT(Debug,1, (&Debug, "prompt area redraw???\n"));
! sb_update_border(pager_page->border_line,
! pager_page->PARAM);
! }
!
! if (pager_page->prompt_area &&
! menu_need_redraw(pager_page->prompt_area)) {
! DPRINT(Debug,1, (&Debug, "prompt area redraw???\n"));
! sb_update_prompt(pager_page->prompt_area,
! pager_page->PARAM);
! }
!
! if (pager_page->prompt_area) {
! menu_PutLineX(pager_page->prompt_area,
! 0,0,
! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
!
! menu_Write_to_screen(pager_page->prompt_area,
! FRM("%S"),cmd);
! }
!
! free_string(&cmd);
! }
!
! int process_showmsg_cmd(command, mailbox, XX, aview, pager_page)
int command;
struct MailboxView *mailbox;
showmsg_cmd XX;
struct AliasView *aview;
! struct pager_page *pager_page;
{
int i, intbuf; /* for dummy parameters...etc */
int istagged; /* for tagging and subsequent msg */

+ int LINES, COLUMNS;

! menu_get_sizes(pager_page->root, &LINES, &COLUMNS);

while (TRUE) {
struct menu_common MENU;

set_mcommon_from_mbxview(&MENU,mailbox);

clear_error();

! command = XX(mailbox,command,pager_page);

switch (command) {

***************
*** 148,159 ****

#ifdef ALLOW_SUBSHELL
case '!' :
! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmSystemCall,
! "System call"), TRUE, &MENU,
! page);
! (void) subshell(mailbox,page);
! menu_ClearScreen(page);
! build_bottom(&MENU, page);
break;
#endif

--- 298,309 ----

#ifdef ALLOW_SUBSHELL
case '!' :
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmSystemCall,
! "System call"));
!
! subshell(mailbox,pager_page->root,pager_page->prompt_area);
!
break;
#endif

***************
*** 161,175 ****
int current = get_current(mailbox);

#ifdef ENABLE_CALENDAR
! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmScanForCalendarCmd,
! "Scan messages for calendar entries"),
! TRUE, &MENU, page);
if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
/* !!! */
NO_mime_parse))


/* FIX: mime structure is not currently used */

! scan_calendar(mailbox);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 311,325 ----
int current = get_current(mailbox);

#ifdef ENABLE_CALENDAR
! put_cmd_name(pager_page,FALSE,
! CATGETS(elm_msg_cat, ElmSet, ElmScanForCalendarCmd,
! "Scan messages for calendar entries"));
if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
/* !!! */
NO_mime_parse))


/* FIX: mime structure is not currently used */

! scan_calendar(mailbox);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 186,217 ****
struct header_rec *hdr;
FILE *F;

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmBounceMessage,
! "Bounce message"), TRUE, &MENU,
! page);
!
if (give_message_data(mailbox,current-1,


&hdr,&F,NULL,
/* !!! */
NO_mime_parse))

! remail(hdr,F, aview, page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}
}

break;

! case 'd' :
! delete_msg(TRUE, FALSE, &MENU, *header_page);
/* really delete it, silent */

! if (! resolve_mode)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageMarkedForDeleteion,
! "Message marked for deletion."));
! else
! goto next_undel_msg;
! break;

#ifdef USE_PGP
case ctrl('E'): {
--- 336,370 ----
struct header_rec *hdr;
FILE *F;

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmBounceMessage,
! "Bounce message"));
!
if (give_message_data(mailbox,current-1,


&hdr,&F,NULL,
/* !!! */
NO_mime_parse))

! remail(hdr,F, aview,
! pager_page->root,
! pager_page->prompt_area);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

+
}
break;

! case 'd' :
! delete_msg(TRUE, &MENU, NULL);
/* really delete it, silent */

! if (! resolve_mode)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageMarkedForDeleteion,
! "Message marked for deletion."));
! else
! goto next_undel_msg;
! break;

#ifdef USE_PGP
case ctrl('E'): {
***************
*** 219,226 ****
struct header_rec *hdr;
FILE *F;

! put_cmd_name("Extract PGP public key", TRUE,&MENU,
! page); /* ??? */

if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
--- 372,380 ----
struct header_rec *hdr;
FILE *F;

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmExtractPGPKey,
! "Extract PGP public key"));

if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
***************
*** 228,238 ****
NO_mime_parse)) {

if (hdr->pgp & PGP_PUBLIC_KEY) {
/* FIX: mime structure is not currently used */

- pgp_extract_public_key (hdr,F, page);
-
- if (menu_need_redraw(page)) /* ? ? ? Is this correct */
- put_border(page);



} else
store_msg("This message does not contain any keys!");
} else {

--- 382,391 ----
NO_mime_parse)) {

if (hdr->pgp & PGP_PUBLIC_KEY) {
/* FIX: mime structure is not currently used */

+ pgp_extract_public_key (hdr,F,
+ pager_page->root);
+

} else
store_msg("This message does not contain any keys!");
} else {

***************
*** 244,253 ****
break;

case ctrl('F'):
! put_cmd_name(catgets(elm_msg_cat, ElmSet,
ElmPassphraseForget,
! "Forget passphrase"),
! TRUE, &MENU, page);
forget_passphrase();
break;
#endif
--- 397,407 ----
break;

case ctrl('F'):
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet,


ElmPassphraseForget,
! "Forget passphrase"));

!
forget_passphrase();
break;
#endif
***************
*** 256,270 ****
struct header_rec *hdr;
FILE *F;

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmForwardMessage,
! "Forward message"), TRUE, &MENU,
! page);


!
! forward(current-1,mailbox, aview, page);
!
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */

! put_border(page);
!
}
break;

--- 410,424 ----
struct header_rec *hdr;
FILE *F;

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmForwardMessage,
! "Forward message"));
!
! forward(current-1,mailbox, aview,
! pager_page->root,
! pager_page->prompt_area,
! NULL);
!
}
break;

***************
*** 273,283 ****
struct header_rec *hdr;
FILE *F;

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmGroupReply,
! "Group reply"), TRUE, &MENU,
! page);
!
! (void) reply_to_everyone(current-1,mailbox, aview, page);
}
break;

--- 427,441 ----
struct header_rec *hdr;
FILE *F;

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmGroupReply,
! "Group reply"));
!
! reply_to_everyone(current-1,mailbox, aview,
! pager_page->root,
! pager_page->prompt_area,
! NULL);
!
}
break;

***************
*** 295,307 ****
elm_filter = 0;
intbuf = show_msg(hdr,F,current,
get_message_count(mailbox),
! page);
elm_filter = 1;
return(intbuf);
} else
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 453,465 ----
elm_filter = 0;
intbuf = show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page);
elm_filter = 1;
return(intbuf);
} else
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 311,321 ****

case 'q' :
case 'i' : {
- int current = get_current(mailbox);
-
- (void) get_page(current, &MENU, header_page);
clear_error(); /* zero out pending msg */
- screen_mangled = 0;
return(0); /* avoid <return> looping */
}

--- 469,475 ----
***************
*** 327,333 ****
case 'n' : {

int current = get_current(mailbox);
! screen_mangled = 0;
if((i=next_message(current-1, TRUE, &MENU)) != -1) {
struct header_rec *hdr;
FILE *F;
--- 481,487 ----
case 'n' : {

int current = get_current(mailbox);
!
if((i=next_message(current-1, TRUE, &MENU)) != -1) {
struct header_rec *hdr;
FILE *F;
***************
*** 340,358 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}
}

- return(0);
}

case ctrl('N'): {
int current = get_current(mailbox);

- screen_mangled = 0;
for (i = next_message(current-1, TRUE, &MENU);
i != -1;
i = next_message(i, TRUE, &MENU)) {
--- 494,525 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}
}
}

+ return(0);
+
+ #ifdef USE_PGP
+ case ctrl('K'):
+ put_cmd_name(pager_page,TRUE,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmMailPGPPublicKey,
+ "Mail PGP public key"));
+
+ pgp_mail_public_key(mailbox, aview,
+ pager_page->root,
+ pager_page->prompt_area);
+ break;
+
+ #endif

case ctrl('N'): {
int current = get_current(mailbox);

for (i = next_message(current-1, TRUE, &MENU);
i != -1;
i = next_message(i, TRUE, &MENU)) {
***************
*** 373,379 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 540,546 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 398,404 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 565,571 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 411,417 ****
case 'k' : {
int current = get_current(mailbox);

- screen_mangled = 0;
if((i=prev_message(current-1, TRUE, &MENU)) != -1) {
struct header_rec *hdr;
FILE *F;
--- 578,583 ----
***************
*** 424,430 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 590,596 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 436,442 ****
case 'K' : {
int current = get_current(mailbox);

- screen_mangled = 0;
if((i=prev_message(current-1, FALSE, &MENU)) != -1) {
struct header_rec *hdr;
FILE *F;
--- 602,607 ----
***************
*** 449,455 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 614,620 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 463,489 ****
struct header_rec *hdr;
FILE *F;

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmMailMessage,
! "Mail message"), TRUE, &MENU,
! page);

send_msg_l(current-1,
NULL,NULL,NULL, MAIL_EDIT_MSG,

allow_forms,
mailbox, aview,
! page);

!
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
! put_border(page);
}

break;

! case 'p' : {
! int current = get_current(mailbox);
!
! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmPrintMessage,
! "Print message"), FALSE, &MENU,
! page);
#if DISABLE_PRINT
lib_error(FRM("p)rint currently disabled, try P)rint text instead"));
#else
--- 628,664 ----
struct header_rec *hdr;
FILE *F;

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmMailMessage,
! "Mail message"));

send_msg_l(current-1,
NULL,NULL,NULL, MAIL_EDIT_MSG,
allow_forms,
mailbox, aview,
! pager_page->root,
! pager_page->prompt_area);
}
break;

! case 'O':
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmOverrideCharset,
! "Override charset"));
!
! OverrideCharset(mailbox,
! pager_page->root,
! pager_page->prompt_area,
! NULL);
! break;
!
! case 'p' : {
! int current = get_current(mailbox);
!
! put_cmd_name(pager_page,FALSE,
! CATGETS(elm_msg_cat, ElmSet, ElmPrintMessage,
! "Print message"));
#if DISABLE_PRINT
lib_error(FRM("p)rint currently disabled, try P)rint text instead"));
#else
***************
*** 492,524 ****
/* !!! */
NO_mime_parse))
/* FIX: mime structure is not used */
! (void) print_msg(FALSE, mailbox, page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

}

#endif
! }
break;

! case 'P' : {
int current = get_current(mailbox);

! put_cmd_name(catgets(elm_msg_cat, ElmSet,
ElmPrintTextMessage,
! "Print text of message"), FALSE, &MENU,
! page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine))
! (void) print_text(FALSE, mailbox, *header_page, page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

}
}

break;

--- 667,703 ----
/* !!! */
NO_mime_parse))
/* FIX: mime structure is not used */
! (void) print_msg(FALSE, mailbox,
! pager_page->root);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

}

#endif
! }
break;

! case 'P' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page,FALSE,
! CATGETS(elm_msg_cat, ElmSet,
ElmPrintTextMessage,
! "Print text of message"));
!

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine))
! print_text(FALSE, mailbox, pager_page->root,
! NULL);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

}

+
}
break;

***************
*** 527,539 ****
struct header_rec *hdr;
FILE *F;

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmReplyToMessage,
! "Reply to message"), TRUE, &MENU,
! page);


!
! reply(current-1,mailbox, aview, page);
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */

! put_border(page);


}
--- 706,719 ----
struct header_rec *hdr;
FILE *F;

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmReplyToMessage,
! "Reply to message"));
!
! reply(current-1,mailbox, aview,
! pager_page->root,
! pager_page->prompt_area,
! NULL);


}
***************
*** 544,564 ****
case 's' : {
int current = get_current(mailbox);

! put_cmd_name((command != 'C' ?
! cap_save_word : cap_copy_word), TRUE, &MENU,
! page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse)) {



save(TRUE, (command != 'C'),0,
! mailbox, aview, *header_page,
! page);
!
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
! put_border(page);

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 724,747 ----
case 's' : {
int current = get_current(mailbox);

! if (command != 'C')
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmCapSave, "Save"));
! else
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmCapCopy, "Copy"));

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse)) {



save(TRUE, (command != 'C'),0,
! mailbox, aview,

! pager_page->root,
! pager_page->prompt_area,
! NULL);

+

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 569,591 ****
goto next_undel_msg;
}
break;
case 'S' : {
int current = get_current(mailbox);

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmSaveText,
! "Save text"), TRUE, &MENU,
! page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
- save(TRUE, 0,1, mailbox, aview,
- *header_page,
- page);
-
- if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
- put_border(page);



} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 752,774 ----
goto next_undel_msg;
}
break;
+
case 'S' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveText,
! "Save text"));

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {

+ save(TRUE, 0,1, mailbox, aview,
+ pager_page->root,
+ pager_page->prompt_area,
+ NULL);
+

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 594,618 ****
}
break;

! case 'T' :
! case 't' :
! istagged=tag_message(FALSE, &MENU, *header_page);
! if(istagged)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageTagged,
! "Message tagged."));
! else
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageUntagged,
! "Message untagged."));
! if (command == 'T')
! goto next_undel_msg;
! break;

case 'u' :
! undelete_msg(FALSE, &MENU, *header_page); /* undelete it, silently */
! if (! resolve_mode)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageUndeleted,
! "Message undeleted."));
! else {
/******************************************************************************
** We're special casing the U)ndelete command here *not* to move to the next
** undeleted message ; instead it'll blindly move to the next message in the
--- 777,803 ----
}
break;

! case 'T' :
! case 't' :
! istagged=tag_message(&MENU, NULL);
!
! if(istagged)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageTagged,
! "Message tagged."));
! else
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageUntagged,
! "Message untagged."));
! if (command == 'T')
! goto next_undel_msg;
! break;

case 'u' :
! undelete_msg(&MENU, NULL); /* undelete it, silently */
!
! if (! resolve_mode)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageUndeleted,
! "Message undeleted."));
! else {
/******************************************************************************
** We're special casing the U)ndelete command here *not* to move to the next
** undeleted message ; instead it'll blindly move to the next message in the
***************
*** 647,785 ****
}
return(0);
}
! case 'X' : put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmQuickExit,
! "Quick Exit"), TRUE, &MENU,
! page);
!
! prompt_s(mcommon_give_item(&MENU,m_Prompt)); /* Command name will be reprinted */
! return 'X'; /* Call caller */
!
!
! case 'x' : put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmExit, "Exit"), TRUE,
! &MENU,
! page);
!
! prompt_s(mcommon_give_item(&MENU,m_Prompt)); /* Command name will be reprinted */
return 'x'; /* Call caller */
!

! case ctrl('J'):
! case ctrl('M'): {
! int current = get_current(mailbox);
! struct header_rec *hdr;
! FILE *F;
!
! screen_mangled = 0;
! if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine))
! return(show_msg(hdr,F,current,
! get_message_count(mailbox),
! page));
! else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
! return 0;
}

! case EOF :
! return EOF; /* FAILURE */
!

! default : putchar((char) 007); /* BEEP! */
! }

- /* display prompt */
- if (screen_mangled) {
- /* clear what was left over from previous command
- * and display last generated message.
- */
- int lin,col;
-
- prompt_s(mcommon_give_item(&MENU,m_Prompt));
- GetXYLocation(&lin,&col);
-
- CleartoEOS();
- PutLineX(LINES-4, 45,
- CATGETS(elm_msg_cat, ElmSet, ElmUseIToReturnIndex,
- "(Use 'i' to return to index.)"));
-
-
- /* TODO: Fix this! */
- Centerline(LINES-1, msg_line, page);
- MoveCursor(lin, col);
- } else {
- /* display bottom line prompt with last generated message */
- MoveCursor(LINES-1, 0);
- CleartoEOS();
- StartBold();
- Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmCommandLine,
- "%s Command ('i' to return to index): "),
- msg_line);
- EndBold();
- }
- *msg_line = '\0'; /* null last generated message */

! command = menu_ReadCh(page,
! 'i'|READCH_CURSOR); /* get next command from user */
! }
! }

- void put_cmd_name(command, will_mangle, menu, page)
- char *command;
- int will_mangle;
- struct menu_common *menu;


- struct menu_context *page;
- {

! /* If screen is or will be mangled display the command name
! * and erase the bottom of the screen.
! * But first if the border line hasn't yet been drawn, draw it.
! */
! if(will_mangle && !screen_mangled) {
! build_bottom(menu,page);
! screen_mangled = TRUE;
! }
! if(screen_mangled) {
! prompt_s(mcommon_give_item(menu, m_Prompt));

- Write_to_screen(FRM("%s"), command);
- CleartoEOS();
- }
- }

! void put_border(page)
! struct menu_context *page;
! {
! int LINES, COLUMNS;

! menu_get_sizes(page, &LINES, &COLUMNS);


- PutLine0(LINES-5, 0,
- "--------------------------------------------------------------------------\n");
- }

! void build_bottom(menu, page)
! struct menu_common *menu;
! struct menu_context *page;
! {
! int LINES, COLUMNS;

! menu_get_sizes(page, &LINES, &COLUMNS);

! MoveCursor(LINES-5, 0);
! CleartoEOS();
! put_border(page);
! prompt_s(mcommon_give_item(menu,m_Prompt));
! PutLineX(LINES-4, 45,
! CATGETS(elm_msg_cat, ElmSet, ElmUseIToReturnIndex,
! "(Use 'i' to return to index.)"));



}


/*
* Local Variables:
* mode:c

--- 832,966 ----
}
return(0);
}
! case 'X' :
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmQuickExit,
! "Quick Exit"));
!
! /* Command name will be reprinted */
! {
! struct menu_common *mptr = mp_lookup_mcommon(pager_page->PARAM,
! elm_mp_menu);
! menu_PutLineX(pager_page->prompt_area,0,0,
! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
! }
! return 'X'; /* Call caller */
!
!
! case 'x' :
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmExit, "Exit"));
!
! /* Command name will be reprinted */
! {
! struct menu_common *mptr = mp_lookup_mcommon(
! pager_page->PARAM,
! elm_mp_menu);
! menu_PutLineX(pager_page->prompt_area,0,0,
! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
! }
return 'x'; /* Call caller */
!

! case ctrl('J'):
! case ctrl('M'): {
! int current = get_current(mailbox);
! struct header_rec *hdr;
! FILE *F;
!
! if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine))
! return(show_msg(hdr,F,current,
! get_message_count(mailbox),
! pager_page));
! else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
! return 0;
}

! case EOF :
! return EOF; /* FAILURE */
!
!
! default :
! putchar((char) 007); /* BEEP! */
! break;
! }

! /* whole screen */
! if (menu_resized(pager_page->root)) {
! menu_get_sizes(pager_page->root, &LINES, &COLUMNS);
! menu_trigger_redraw(pager_page->root);
! }
! if (menu_need_redraw(pager_page->root)) {
! menu_ClearScreen(pager_page->root);
! menu_redraw_children(pager_page->root);
! }


! /* display prompt */
! if (pager_page->prompt_area) {
! /* clear what was left over from previous command
! * and display last generated message.
! */
!
! /* create areas if missing */
! if (!pager_page->border_line)
! sb_update_border(pager_page->border_line,
! pager_page->PARAM);


! if (menu_need_redraw(pager_page->border_line)) {
! DPRINT(Debug,1, (&Debug, "border line redraw???\n"));
! sb_update_border(pager_page->border_line,
! pager_page->PARAM);
! }
! if (menu_need_redraw(pager_page->prompt_area)) {
! DPRINT(Debug,1, (&Debug, "prompt area redraw???\n"));
! sb_update_border(pager_page->prompt_area, NULL);
! }


! Centerline(LINES-1, msg_line, pager_page->root);
!
! {
! struct menu_common *mptr = mp_lookup_mcommon(
! pager_page->PARAM,
! elm_mp_menu);

! menu_PutLineX(pager_page->prompt_area,0,0,
! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
! }

+ command = menu_ReadCh(pager_page->prompt_area,
+ 'i'|READCH_CURSOR); /* get next command from user */


! } else {
! /* display bottom line prompt with last generated message */
! menu_MoveCursor(pager_page->root,LINES-1, 0);
! menu_CleartoEOS(pager_page->root);
! menu_StartXX(pager_page->root,pg_BOLD);
! menu_Write_to_screen(pager_page->root,
! CATGETS(elm_msg_cat, ElmSet, ElmCommandLine,
! "%s Command ('i' to return to index): "),
! msg_line);
! menu_EndXX(pager_page->root,pg_BOLD);

! command = menu_ReadCh(pager_page->root,
! 'i'|READCH_CURSOR); /* get next command from user */

! }
! *msg_line = '\0'; /* null last generated message */
! }



}


+
/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.122-cvs/src/signals.c
*** elm2.4.ME+.121/src/signals.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/signals.c 2005-01-08 23:08:05.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: signals.c,v 1.26 2004/07/24 19:50:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: signals.c,v 1.27 2005/01/08 21:08:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 23,29 ****

DEBUG_VAR(Debug,__FILE__,"signal");

! extern VOLATILE int pipe_abort; /* set to TRUE if receive SIGPIPE */

SIGHAND_TYPE
quit_signal(sig)
--- 23,29 ----

DEBUG_VAR(Debug,__FILE__,"signal");

! VOLATILE int pipe_abort; /* set to TRUE if receive SIGPIPE */

SIGHAND_TYPE
quit_signal(sig)
***************
*** 210,216 ****
usr1_signal(sig)
{
int result = 0;
- int dummy = 0;
struct MailboxView *m;
int idx2 = 0;

--- 210,215 ----
***************
*** 227,233 ****

while (m &&
(result = leave_mbox(TRUE, FALSE, TRUE, NULL, m,
! &dummy, default_context))
== -1) {
int idx;
int mbxcount = get_storage_count(m);
--- 226,232 ----

while (m &&


(result = leave_mbox(TRUE, FALSE, TRUE, NULL, m,

! default_context))
== -1) {
int idx;
int mbxcount = get_storage_count(m);
***************
*** 255,261 ****
usr2_signal(sig)
{
int result = 0;
- int dummy = 0;
struct MailboxView *m;
int idx2 = 0;

--- 254,259 ----
***************
*** 270,276 ****

while (m &&


(result = leave_mbox(FALSE, TRUE, FALSE, NULL,
! m, &dummy,

default_context)) == -1) {
int idx;
int mbxcount = get_storage_count(m);
--- 268,274 ----

while (m &&


(result = leave_mbox(FALSE, TRUE, FALSE, NULL,
! m,

default_context)) == -1) {
int idx;
int mbxcount = get_storage_count(m);
Index: elm2.4.ME+.122-cvs/src/sort.c
*** elm2.4.ME+.121/src/sort.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/sort.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: sort.c,v 1.22 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: sort.c,v 1.31 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 31,38 ****
return (unsigned char *)str;
}

- char *sort_name(), *skip_re();
-
static void find_old_current P_((struct folder_view * iindex,
struct MailboxView *mailbox));

--- 31,36 ----
***************
*** 78,84 ****
}

/* Prototype */
- static int subject_compare P_((struct sort_data *p1, struct sort_data *p2));
static int subject_compare_1 P_((struct header_rec *h1,
struct header_rec *h2));
static int compare_headers P_((struct sort_data *p1, struct sort_data *p2));
--- 76,81 ----
***************
*** 92,98 ****

struct folder_view last_index;

- int compare_headers(); /* for sorting */
int current;

last_index.mailbox_number = 0;
--- 89,94 ----


***************
*** 109,121 ****
/* Don't get last_index if no entries or no current. */
/* There would be no current if we are sorting a new mail file. */

- /* FIXME: last_index does not work when there is mor ethan one storage...
- * (in other words several mails with same index)
- */

if (entries > 0 && current > 0) {
give_index_number(mailbox,current-1, &last_index);
-
}

if (entries > 30 && visible)

--- 105,113 ----
***************
*** 124,135 ****
sort_name(FULL));

if (entries > 1) {
! switch (sortby) {
int i;
struct header_rec * hdr;

! case THREAD:
! sortby = SUBJECT;

sort_mailbox_view(mailbox,compare_headers);

--- 116,127 ----
sort_name(FULL));

if (entries > 1) {
! switch (give_dt_sort_as_int(&sortby)) {
int i;
struct header_rec * hdr;

! case THREAD:
! set_dt_sort_as_int(&sortby,SUBJECT);

sort_mailbox_view(mailbox,compare_headers);

***************
*** 146,188 ****
hdr->time_sent < hdr0->time_sent -
(long) sort_thread_max_time * 24 * 60 * 60)
hdr->thread_time = hdr->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! }
! else {
! hdr->thread_time = hdr->time_sent;
! }
}
! sortby = THREAD;
!
sort_mailbox_view(mailbox,compare_headers);
break;

case REVERSE THREAD:
! sortby = REVERSE SUBJECT;
!
! sort_mailbox_view(mailbox,compare_headers);
!
! hdr = give_header(mailbox,entries-1);
! hdr->thread_time = hdr->time_sent;

! for (i=entries-2; i >= 0; i--) {
! struct header_rec * hdr0 = hdr; /* 'previous' header */
! if (subject_compare_1(hdr,hdr0)==0) {
!
! if (hdr->time_sent > hdr0->time_sent +
! (long) sort_thread_max_time * 24 * 60 * 60 ||
! hdr->time_sent < hdr0->time_sent -
! (long) sort_thread_max_time * 24 * 60 * 60)
! hdr->thread_time = hdr0->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! }
! else {
! hdr->thread_time = hdr->time_sent;
! }
! }
! sortby = REVERSE THREAD;

sort_mailbox_view(mailbox,compare_headers);
break;
--- 138,211 ----
hdr->time_sent < hdr0->time_sent -
(long) sort_thread_max_time * 24 * 60 * 60)
hdr->thread_time = hdr->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! } else {
! hdr->thread_time = hdr->time_sent;
! }
}
! set_dt_sort_as_int(&sortby,THREAD);
!
sort_mailbox_view(mailbox,compare_headers);
break;

case REVERSE THREAD:
! set_dt_sort_as_int(&sortby,REVERSE SUBJECT);
!
! sort_mailbox_view(mailbox,compare_headers);
!
!
! if (unstable_reverse_thread) {
! /* Move thread new location when new mail arrives,
! REVERSE SUBJECT but lastest message (on mailbox
! order) with same subject to first. Therefore
! count from beginning
! */
!
! hdr = give_header(mailbox,0);
! hdr->thread_time = hdr->time_sent;
! for (i=1; i<entries; i++) {
! struct header_rec * hdr0 = hdr; /* previous header */


!
! hdr = give_header(mailbox,i);
!
! if (subject_compare_1(hdr,hdr0)==0) {

! if (hdr->time_sent > hdr0->time_sent +
! (long) sort_thread_max_time * 24 * 60 * 60 ||
! hdr->time_sent < hdr0->time_sent -
! (long) sort_thread_max_time * 24 * 60 * 60)
! hdr->thread_time = hdr->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! } else {
! hdr->thread_time = hdr->time_sent;
! }
! }

! } else {
! hdr = give_header(mailbox,entries-1);
! hdr->thread_time = hdr->time_sent;
!
! for (i=entries-2; i >= 0; i--) {
! struct header_rec * hdr0 = hdr; /* 'previous' header */


!
! hdr = give_header(mailbox,i);
!
! if (subject_compare_1(hdr,hdr0)==0) {

!
! if (hdr->time_sent > hdr0->time_sent +
! (long) sort_thread_max_time * 24 * 60 * 60 ||
! hdr->time_sent < hdr0->time_sent -
! (long) sort_thread_max_time * 24 * 60 * 60)
! hdr->thread_time = hdr->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! } else {
! hdr->thread_time = hdr->time_sent;
! }
! }
! }
! set_dt_sort_as_int(&sortby,REVERSE THREAD);

sort_mailbox_view(mailbox,compare_headers);
break;
***************
*** 228,244 ****
return ret;
}

! static int subject_compare(p1,p2)
! struct sort_data *p1;
! struct sort_data *p2;
! {
! struct header_rec *h1 = give_header_s(p1);
! struct header_rec *h2 = give_header_s(p2);
!
! return subject_compare_1(h1,h2);
! }
!
! int compare_headers_1(first, second)
struct header_rec *first, *second;
{
/** compare two headers according to the sortby value.
--- 251,259 ----
return ret;
}

! static int compare_headers_1 P_((struct header_rec *first,
! struct header_rec *second));
! static int compare_headers_1(first, second)
struct header_rec *first, *second;
{
/** compare two headers according to the sortby value.
***************
*** 259,265 ****
if (!first || !second)
return 0;

! switch (abs(sortby)) {
case SENT_DATE:
diff = first->time_sent - second->time_sent;
if ( diff < 0 ) ret = -1;
--- 274,280 ----
if (!first || !second)
return 0;

! switch (abs(give_dt_sort_as_int(&sortby))) {
case SENT_DATE:
diff = first->time_sent - second->time_sent;
if ( diff < 0 ) ret = -1;
***************
*** 344,350 ****
else ret = 0;
}

! if (sortby < 0)
ret = -ret;

return ret;
--- 359,365 ----
else ret = 0;
}

! if (give_dt_sort_as_int(&sortby) < 0)
ret = -ret;

return ret;
***************
*** 354,366 ****


struct sort_data *p1;
struct sort_data *p2;
{
struct header_rec *h1 = give_header_s(p1);
struct header_rec *h2 = give_header_s(p2);

! switch (abs(sortby)) {
! int ret;


struct folder_view i1,i2;

case MAILBOX_ORDER:
give_index_number_s(p1,&i1);
give_index_number_s(p2,&i2);

--- 369,393 ----


struct sort_data *p1;
struct sort_data *p2;
{
+ int ret = 0;
struct header_rec *h1 = give_header_s(p1);
struct header_rec *h2 = give_header_s(p2);

! switch (abs(give_dt_sort_as_int(&sortby))) {


struct folder_view i1,i2;

+ default:
+ ret = compare_headers_1(h1,h2);
+
+ /* NOTE: compare_headers already reserves return for
+ reverse sorting orders

+ */
+
+

+ /* Is compare result is same, then use mailbox order */
+ if (0 != ret)
+ break;
+
case MAILBOX_ORDER:
give_index_number_s(p1,&i1);
give_index_number_s(p2,&i2);
***************

*** 368,378 ****


ret = i1.mailbox_number - i2.mailbox_number;
if (0 == ret)
ret = i1.index - i2.index;
- return ret;

! default:
! return compare_headers_1(h1,h2);
}
}


--- 395,410 ----


ret = i1.mailbox_number - i2.mailbox_number;
if (0 == ret)
ret = i1.index - i2.index;

! if (give_dt_sort_as_int(&sortby) < 0)


! ret = -ret;
!
! break;
!
}
+
+
+ return ret;
}


***************
*** 387,399 ****
pad = (type == PAD);
abr = (type == SHORT);

! if (sortby < 0) {
! switch (- sortby) {
case SENT_DATE : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadRevDateMailSent, "Reverse Date Mail Sent ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrtRevDateMailSent, "Reverse-Sent") :
catgets(elm_msg_cat, ElmSet, ElmLongRevDateMailSent, "Reverse Date Mail Sent"));
! case THREAD : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadRevThread, "Reverse Thread ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrRevThread, "Reverse-Thread") :
catgets(elm_msg_cat, ElmSet, ElmLongRevThread, "Reverse Thread"));
--- 419,441 ----
pad = (type == PAD);
abr = (type == SHORT);

! if (give_dt_sort_as_int(&sortby) < 0) {
! switch (- give_dt_sort_as_int(&sortby)) {
case SENT_DATE : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadRevDateMailSent, "Reverse Date Mail Sent ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrtRevDateMailSent, "Reverse-Sent") :
catgets(elm_msg_cat, ElmSet, ElmLongRevDateMailSent, "Reverse Date Mail Sent"));
! case THREAD :
!
! if (unstable_reverse_thread) { /* HACK */
! return(
! pad? catgets(elm_msg_cat, ElmSet, ElmPadUnsThread, "Unstable Reverse Thread ") :
! abr? catgets(elm_msg_cat, ElmSet, ElmAbrUnsThread, "(Unstable) Reverse-Thread") :
! catgets(elm_msg_cat, ElmSet, ElmLongUnsThread, "Unstable Reverse Thread"));
!
! }
!
! return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadRevThread, "Reverse Thread ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrRevThread, "Reverse-Thread") :
catgets(elm_msg_cat, ElmSet, ElmLongRevThread, "Reverse Thread"));
***************
*** 426,432 ****
}
}
else {
! switch (sortby) {
case SENT_DATE : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadMailSent, "Date Mail Sent ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrMailSent, "Sent") :
--- 468,474 ----
}
}
else {
! switch (give_dt_sort_as_int(&sortby)) {
case SENT_DATE : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadMailSent, "Date Mail Sent ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrMailSent, "Sent") :
Index: elm2.4.ME+.122-cvs/src/string2.c
*** elm2.4.ME+.121/src/string2.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/string2.c 2005-06-18 00:02:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: string2.c,v 1.8 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: string2.c,v 1.10 2005/06/17 21:02:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 33,78 ****
return(count);
}

- int
- qoccurances_of(ch, string)
- char ch, *string;
- {
- /** returns the number of occurances of 'ch' in string 'string' **/
-
- register int count = 0, len;
-
- while(*string) {
- len = len_next_part(string);
- if (len == 1 && *string == ch) count++;
- string += len;
- }
-
- return(count);
- }
-
- void remove_possible_trailing_spaces(string)
- char *string;
- {
- /** an incredibly simple routine that will read backwards through
- a string and remove all trailing whitespace.
- **/
-

- int i, j;
-

- for ( j = i = strlen(string); --i >= 0 && whitespace(string[i]); )
- /** spin backwards, semicolon intented **/ ;
-
- if (i > 0 && string[i-1] == '\\') /* allow for line to end with \blank */
- i++;
-
- if (i < j)
- string[i+1] = '\0'; /* note that even in the worst case when there
- are no trailing spaces at all, we'll simply
- end up replacing the existing '\0' with
- another one! No worries, as M.G. would say
- */
- }
-

/*
* Local Variables:
* mode:c

--- 33,38 ----
Index: elm2.4.ME+.122-cvs/src/strings.c
*** elm2.4.ME+.121/src/strings.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/strings.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strings.c,v 1.15 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strings.c,v 1.17 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,33 ****

/** forward declarations **/

- char *get_token();

char **argv_from_to(to)
char *to;
--- 27,32 ----
***************
*** 158,178 ****
char *string;
struct menu_context *page;
{
! /** Output 'string' on the given line, centered. **/
!
! int length, col;


! int LINES, COLUMNS;
!

! menu_get_sizes(page, &LINES, &COLUMNS);
!

! length = strlen(string);
!
! if (length > COLUMNS)
! col = 0;
! else
! col = (COLUMNS - length) / 2;
!
! PutLine0(line, col, string);
}

char *argv_zero(string)
--- 157,177 ----
char *string;
struct menu_context *page;
{
! /** Output 'string' on the given line, centered. **/
!
! int length, col;


! int LINES, COLUMNS;
!

! menu_get_sizes(page, &LINES, &COLUMNS);
!

! length = strlen(string);
!
! if (length > COLUMNS)
! col = 0;
! else
! col = (COLUMNS - length) / 2;
!
! menu_PutLine0(page,line, col, string);
}

char *argv_zero(string)
***************
*** 193,249 ****
return( (char *) buffer);
}

- #define MAX_RECURSION 20 /* up to 20 deep recursion */
-
- char *get_token(source, keys, depth)
- char *source, *keys;
- int depth;
- {
- /** This function is similar to strtok() (see "opt_utils")
- but allows nesting of calls via pointers...
- **/
-
- register int last_ch;
- static char *buffers[MAX_RECURSION];
- char *return_value, *sourceptr;
-
- if (depth > MAX_RECURSION) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmGetTokenOverNested,
- "Get_token calls nested greater than %d deep!"),
- MAX_RECURSION);
- emergency_exit(0);
- }
-
- if (source != NULL)
- buffers[depth] = source;
-
- sourceptr = buffers[depth];
-
- if (*sourceptr == '\0')
- return(NULL); /* we hit end-of-string last time!? */
-
- sourceptr += qstrspn(sourceptr, keys); /* skip the bad.. */
-
- if (*sourceptr == '\0') {
- buffers[depth] = sourceptr;
- return(NULL); /* we've hit end-of-string */
- }
-
- last_ch = qstrcspn(sourceptr, keys); /* end of good stuff */
-
- return_value = sourceptr; /* and get the ret */
-
- sourceptr += last_ch; /* ...value */
-
- if (*sourceptr != '\0') /** don't forget if we're at end! **/
- sourceptr++;
-
- return_value[last_ch] = '\0'; /* ..ending right */
-
- buffers[depth] = sourceptr; /* save this, mate! */
-
- return((char *) return_value); /* and we're outta here! */
- }

/*
* Local Variables:
--- 192,197 ----
Index: elm2.4.ME+.122-cvs/src/syscall.c
*** elm2.4.ME+.121/src/syscall.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/syscall.c 2005-07-06 00:40:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.35 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.47 2005/07/05 21:40:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 35,43 ****



#ifdef ALLOW_SUBSHELL

! void subshell(mailbox, page)
struct MailboxView *mailbox;
struct menu_context *page;
{
/** spawn a subshell with either the specified command

--- 35,44 ----

#ifdef ALLOW_SUBSHELL

! void subshell(mailbox, page, prompt_area)
struct MailboxView *mailbox;


struct menu_context *page;
+ struct menu_context *prompt_area;

{
/** spawn a subshell with either the specified command

***************
*** 47,100 ****
char command[SLEN];
int redraw = FALSE;
int old_raw, helpful, ret, status;
- int LINES, COLUMNS;
struct menu_context *cpage;



! menu_get_sizes(page, &LINES, &COLUMNS);
!

! helpful = (user_level == 0);

if (helpful)
! PutLineX(LINES-4, COLUMNS-40,
! CATGETS(elm_msg_cat, ElmSet,
! ElmUseShellName,
! "(Use the shell name for a shell.)"));
! PutLineX(LINES-3, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
! "Shell command: "));
! CleartoEOS();
command[0] = '\0';
! status = optionally_enter(command, LINES-3, 15, OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,


sizeof command, page);

while (REDRAW_MARK == status) {

! redraw = TRUE;
! PutLineX(LINES-1-2, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
! "Shell command: "));


! status = optionally_enter(command, LINES-3, 15,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! sizeof command, page);

- }



if (0 != status || command[0] == 0) {

! if (helpful)
! MoveCursor(LINES-4,COLUMNS-40);
! else
! MoveCursor(LINES-3,0);
! CleartoEOS();


!
! if (redraw)
! menu_trigger_redraw(page);

return;
}

! MoveCursor(LINES-1,0);
! CleartoEOLN();

if ((old_raw = RawState()) == ON)
Raw(OFF);
--- 48,124 ----
char command[SLEN];
int redraw = FALSE;
int old_raw, helpful, ret, status;
struct menu_context *cpage;
+ int li,co;
+ int LINES, COLUMNS;
+ int line;


+ int ul = give_dt_enumerate_as_int(&user_level);
+

+ menu_get_sizes(prompt_area, &li, &co);

! helpful = (ul == 0);

if (helpful)
! menu_PutLineX(prompt_area,0, co-40,
! CATGETS(elm_msg_cat, ElmSet,
! ElmUseShellName,
! "(Use the shell name for a shell.)"));
!
! menu_PutLineX(prompt_area,1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
! "Shell command: "));
!
! menu_CleartoEOS(prompt_area);
!

! /* FIXME --optionally_enter* should use prompt_area */

! line = menu_GetAbsLine(prompt_area,1);
command[0] = '\0';
! status = optionally_enter(command, line, 15, OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,


sizeof command, page);

while (REDRAW_MARK == status) {

! menu_ClearScreen(page); /* Clear possible redraw mark */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/
!

! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */


+ redraw = TRUE;
+ menu_PutLineX(prompt_area,1, 0,
+ CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
+ "Shell command: "));
+ status = optionally_enter(command, line, 15,
+ OE_REDRAW_MARK|OE_APPEND_CURRENT|
+ OE_SIG_CHAR /* Ctrl-C */,
+ sizeof command, page);
+ }
+

if (0 != status || command[0] == 0) {

! if (helpful)
! menu_MoveCursor(prompt_area,0,co-40);
! else
! menu_MoveCursor(prompt_area,1,0);
! menu_CleartoEOS(prompt_area);


!
! if (redraw)
! menu_trigger_redraw(page);

! else
! menu_trigger_redraw(prompt_area);

return;
}

!
! menu_get_sizes(page, &LINES, &COLUMNS);
! menu_MoveCursor(page,LINES-1,0);
! menu_CleartoEOLN(page);

if ((old_raw = RawState()) == ON)
Raw(OFF);
***************
*** 112,125 ****

redraw2:



! PutLineX(LINES-1, 0, CATGETS(elm_msg_cat, ElmSet,

ElmPressAnyKeyToReturn,
"\n\nPress any key to return to ELM: "));

if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {
goto redraw2;
}
! printf("\r\n");
Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
if (old_raw == ON)
Raw(ON);
--- 136,153 ----

redraw2:

! menu_PutLineX(cpage,LINES-1, 0, CATGETS(elm_msg_cat, ElmSet,
ElmPressAnyKeyToReturn,
"\n\nPress any key to return to ELM: "));

if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {
+ menu_ClearScreen(cpage); /* Reset possible redraw flag */
+
goto redraw2;
}
!
! menu_Write_to_screen(cpage, FRM("\r\n"));
!
Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
if (old_raw == ON)
Raw(ON);
***************
*** 186,205 ****
VOLATILE int iteration;
/* figure out what shell we are using here */
S__ status;
! register SIGHAND_TYPE (*istat)(), (*qstat)();
#ifdef SIGTSTP
! register SIGHAND_TYPE (*oldstop)(), (*oldstart)();
#endif
!

/* flush any pending output */
FlushBuffer();

DPRINT(Debug,2, (&Debug,
"System Call: command=%s\n", string));
if (options & SY_USER_SHELL) {
DPRINT(Debug,2, (&Debug,
! " Using user's shell=%s\n", shell));


}

/* if we aren't reading a folder then a state dump is meaningless */

--- 214,238 ----
VOLATILE int iteration;
/* figure out what shell we are using here */
S__ status;
! register SIGHAND_TYPE (*istat) P_((int)), (*qstat) P_((int));
#ifdef SIGTSTP
! register SIGHAND_TYPE (*oldstop) P_((int)), (*oldstart) P_((int));
#endif
! char *sh = "/bin/sh";

/* flush any pending output */
FlushBuffer();

DPRINT(Debug,2, (&Debug,
"System Call: command=%s\n", string));
+
if (options & SY_USER_SHELL) {
+ char * s = give_dt_estr_as_str(&shell_e,"shell");
+ if (s)
+ sh = s;
+
DPRINT(Debug,2, (&Debug,
! " Using user's shell=%s\n", sh));


}

/* if we aren't reading a folder then a state dump is meaningless */

***************
*** 264,270 ****
close(pfd[1]);
}
else if (pid == 0) {
! CONST char *sh = ((options & SY_USER_SHELL) ? shell : "/bin/sh");

/*
* Set group and user back to their original values.
--- 297,303 ----
close(pfd[1]);
}
else if (pid == 0) {
!

/*
* Set group and user back to their original values.
***************
*** 281,287 ****
if (-1 == setuid(userid)) {
int err = errno;
fprintf(stderr,"system_call: setuid(%d) FAILED: %s\n",
! setuid,error_description(err));
fflush(stderr);
write(pfd[1], "", 1);
_exit(127);
--- 314,320 ----
if (-1 == setuid(userid)) {
int err = errno;
fprintf(stderr,"system_call: setuid(%d) FAILED: %s\n",
! userid,error_description(err));
fflush(stderr);
write(pfd[1], "", 1);
_exit(127);
***************
*** 346,354 ****


return(stat);
}

! void do_pipe(mailbox, page)
struct MailboxView *mailbox;
struct menu_context *page;
{

/** pipe the current message or tagged messages to
the specified sequence..
--- 379,388 ----
return(stat);
}

! void do_pipe(mailbox, page, prompt_area)
struct MailboxView *mailbox;


struct menu_context *page;
+ struct menu_context *prompt_area;

{
/** pipe the current message or tagged messages to
the specified sequence..
***************
*** 363,394 ****
int status;
int LINES, COLUMNS;
struct menu_context *cpage;

menu_get_sizes(page, &LINES, &COLUMNS);

/* TODO: Fix this mess ... */
prompt = catgets(elm_msg_cat, ElmSet, ElmPipeTo, "Pipe to: ");
! PutLine0(LINES-3, 0, prompt);
command[0] = '\0';
! status = optionally_enter(command, LINES-3, strlen(prompt),
OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */, sizeof command,


page);
while (status == REDRAW_MARK) {

! redraw = TRUE;
! PutLine0(LINES-1-2, 0, prompt);
! status = optionally_enter(command, LINES-3, strlen(prompt),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! sizeof command, page);



}
if (0 != status || command[0] == '\0') {

! MoveCursor(LINES-3,0);
! CleartoEOLN();

if (redraw)
menu_trigger_redraw(page);
return;
}

--- 397,437 ----
int status;
int LINES, COLUMNS;
struct menu_context *cpage;
+ int line;

menu_get_sizes(page, &LINES, &COLUMNS);

/* TODO: Fix this mess ... */
prompt = catgets(elm_msg_cat, ElmSet, ElmPipeTo, "Pipe to: ");
!
! menu_PutLine0(prompt_area,1, 0, prompt);
command[0] = '\0';
!

! /* FIXME --optionally_enter* should use prompt_area */

! line = menu_GetAbsLine(prompt_area,1);
! status = optionally_enter(command, line, strlen(prompt),
OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */, sizeof command,


page);
while (status == REDRAW_MARK) {

! menu_ClearScreen(prompt_area); /* Reset possible redraw flag */
!
! redraw = TRUE;
! menu_PutLine0(prompt_area,1, 0, prompt);
! status = optionally_enter(command, line, strlen(prompt),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! sizeof command, page);



}
if (0 != status || command[0] == '\0') {

! menu_MoveCursor(prompt_area,1,0);
! menu_CleartoEOLN(prompt_area);

if (redraw)
menu_trigger_redraw(page);
+ else
+ menu_trigger_redraw(prompt_area);
return;
}

***************
*** 407,432 ****
redraw2:
InvalidateLocation();

! PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyToReturn,
! "\n\nPress any key to return to ELM: "));

if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {

! goto redraw2;
}
! printf("\r\n");
Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
if (old_raw == ON)
! Raw(ON);

if (ret != 0)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReturnCodeWas,
! "Return code was %d."),
! ret);
!
!
menu_trigger_redraw(page);
return;
}
--- 450,477 ----
redraw2:
InvalidateLocation();

! menu_PutLineX(cpage,LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyToReturn,
! "\n\nPress any key to return to ELM: "));

if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {
+ menu_ClearScreen(cpage); /* Reset possible redraw flag */

! goto redraw2;
}
! menu_Write_to_screen(cpage,FRM("\r\n"));
!
Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
if (old_raw == ON)
! Raw(ON);

if (ret != 0)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReturnCodeWas,
! "Return code was %d."),
! ret);
!
!
menu_trigger_redraw(page);
return;
}
***************
*** 472,482 ****


return return_value;
}

! void print_text(pause_on_scroll, mailbox, header_page, page)
int pause_on_scroll;
struct MailboxView *mailbox;

- int header_page;
struct menu_context *page;
{

/* If redraw is needed use
menu_trigger_redraw(page)

--- 517,527 ----
return return_value;
}

! void print_text(pause_on_scroll, mailbox, page, header_area)


int pause_on_scroll;
struct MailboxView *mailbox;

struct menu_context *page;
+ struct menu_context *header_area;


{
/* If redraw is needed use
menu_trigger_redraw(page)
***************

*** 498,503 ****
--- 543,549 ----

struct menu_common MENU;
int LINES, COLUMNS;
+ char *tmp;

menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 509,516 ****
if (!have_printout() || !mailbox)
return;

fname = elm_message(FRM("%sprintdecode-%d"),
! temp_dir, getpid ());

if (NULL == (tmpfp = safeopen_rdwr(fname))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeDecodeFailedCreate,
--- 555,566 ----
if (!have_printout() || !mailbox)
return;



+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ return;
+
fname = elm_message(FRM("%sprintdecode-%d"),
! tmp, getpid ());

if (NULL == (tmpfp = safeopen_rdwr(fname))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeDecodeFailedCreate,
***************
*** 562,570 ****
}
clearit(hdr->status, TAGGED); /* not tagged anymore */

! if (!redraw_it && pause_on_scroll)
! show_new_status(i, &MENU, header_page); /* update screen, if needed */
}
}
}
if (EOF == fclose(tmpfp))
--- 612,633 ----
}
clearit(hdr->status, TAGGED); /* not tagged anymore */

! if (!redraw_it) {
!
! if (header_area) {


! struct menu_common MENU;
! int vis;
!

! set_mcommon_from_mbxview(&MENU,mailbox);


!
! vis = compute_visible(i+1, &MENU);

! /* update screen, if needed */
! menu_header_status_update(header_area,vis-1);
! }
!
! }
}
+
}
}
if (EOF == fclose(tmpfp))
***************
*** 628,638 ****
menu_get_sizes(cpage,&LINES, &COLUMNS);

redraw:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPrintPressAKey,
! "\nPress any key to continue:"));
FlushBuffer();

if (menu_ReadCh(cpage,REDRAW_MARK) == REDRAW_MARK) {

redraw_it = TRUE;
goto redraw;
--- 691,703 ----
menu_get_sizes(cpage,&LINES, &COLUMNS);

redraw:
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmPrintPressAKey,
! "\nPress any key to continue:"));
FlushBuffer();

if (menu_ReadCh(cpage,REDRAW_MARK) == REDRAW_MARK) {
+ menu_ClearScreen(cpage); /* Reset possible redraw flag */

redraw_it = TRUE;
goto redraw;
***************
*** 664,670 ****
* above message from being wiped out by the command prompt.
*/
if (!pause_on_scroll)
! putchar('\n');

if (nlines> 1)
redraw_it = 1;
--- 729,735 ----
* above message from being wiped out by the command prompt.
*/
if (!pause_on_scroll)
! menu_Write_to_screen(page,FRM("\n"));

if (nlines> 1)
redraw_it = 1;
***************
*** 679,686 ****
if (fname)
free(fname);

! if (redraw_it)
! menu_trigger_redraw(page);
return;
}

--- 744,750 ----
if (fname)
free(fname);

!
return;
}

***************
*** 748,758 ****
*/
if (in_string(printout, "%s")) {
char * printbuffer;
/*
* Temp file name used by "old style" printing.
*/
filename = elm_message(FRM("%s%s%d"),
! temp_dir, temp_print, getpid());

printbuffer = elm_message(FRM(printout), filename);
elm_sfprintf(buffer,sizeof buffer,
--- 812,827 ----
*/
if (in_string(printout, "%s")) {
char * printbuffer;
+
+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ tmp = "/tmp/";
+
/*
* Temp file name used by "old style" printing.
*/
filename = elm_message(FRM("%s%s%d"),
! tmp, temp_print, getpid());

printbuffer = elm_message(FRM(printout), filename);
elm_sfprintf(buffer,sizeof buffer,
***************
*** 815,827 ****
cpage = Raw(ON | NO_TITE);
menu_get_sizes(cpage, &LINES, &COLUMNS);
redraw:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPrintPressAKey,
! "\nPress any key to continue:"));
FlushBuffer();

if (ReadCh(REDRAW_MARK) == REDRAW_MARK) {

- menu_trigger_redraw(page);


nlines = 2;
goto redraw;
}

--- 884,897 ----
cpage = Raw(ON | NO_TITE);
menu_get_sizes(cpage, &LINES, &COLUMNS);
redraw:
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmPrintPressAKey,
! "\nPress any key to continue:"));
FlushBuffer();

if (ReadCh(REDRAW_MARK) == REDRAW_MARK) {
+ menu_ClearScreen(page); /* Reset possible redraw flag */



nlines = 2;
goto redraw;
}
***************

*** 852,858 ****
* above message from being wiped out by the command prompt.
*/
if (!pause_on_scroll)
! putchar('\n');

done:
/* softkeys_on(); */
--- 922,928 ----
* above message from being wiped out by the command prompt.
*/
if (!pause_on_scroll)
! menu_Write_to_screen(page,FRM("\n"));

done:
/* softkeys_on(); */
Index: elm2.4.ME+.122-cvs/src/utils.c
*** elm2.4.ME+.121/src/utils.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/utils.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: utils.c,v 1.34 2004/07/24 19:50:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: utils.c,v 1.39 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 28,38 ****

void create_new_folders()
{
! /* this creates a new folders directory */

! (void) mkdir(folders, 0700);

! (void) elm_chown(folders, userid, groupid);
}

void create_new_elmdir()
--- 28,41 ----

void create_new_folders()
{
! /* give_dt_estr_as_str adds / to end */
! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");

! /* this creates a new folders directory */

! (void) mkdir(folders_val, 0700);
!
! (void) elm_chown(folders_val, userid, groupid);
}

void create_new_elmdir()
***************
*** 55,60 ****
--- 58,65 ----
*/
/*ARGSUSED*/
void malloc_failed_exit(proc, len)
+ char *proc;
+ unsigned len;
{
int LINES, COLUMNS;

***************
*** 92,107 ****
/* MoveCursor() is not safe on interrupt */

if (interrupt) {
! ClearScreen();
! Raw(OFF|RAW_FROM_SIGNAL);
} else {


- int LINES, COLUMNS;
-

- menu_get_sizes(default_context, &LINES, &COLUMNS);
-
-
- MoveCursor(LINES-1,0);
- NewLine();

Raw_OFF(0);
}

--- 97,105 ----
/* MoveCursor() is not safe on interrupt */

if (interrupt) {
! ClearScreen(0);
! Raw(OFF|RAW_FROM_SIGNAL);
} else {

Raw_OFF(0);
}
***************
*** 446,485 ****
}
#endif

! int get_page(msg_pointer, menu, header_page)
! int msg_pointer;
struct menu_common *menu;
! int *header_page;
{
! /** Ensure that 'current' is on the displayed page,
! returning NEW_PAGE iff the page changed! **/

! int first_on_page, last_on_page;
! int selected = mcommon_get_selected(menu);

- if (headers_per_page == 0)
- return(SAME_PAGE); /* What else can I do ? */

! first_on_page = ((*header_page) * headers_per_page) + 1;
!
! last_on_page = first_on_page + headers_per_page - 1;
!
! if (selected) /* but what is it on the SCREEN??? */
! msg_pointer = compute_visible(msg_pointer, menu);
!
! if (selected && msg_pointer > selected)
! return(SAME_PAGE); /* too far - page can't change! */

! if (msg_pointer > last_on_page) {
! *header_page = (int) (msg_pointer-1)/ headers_per_page;
! return(NEW_PAGE);
}
! else if (msg_pointer < first_on_page) {
! *header_page = (int) (msg_pointer-1) / headers_per_page;
! return(NEW_PAGE);
}
- else
- return(SAME_PAGE);
}

/*
--- 444,503 ----
}
#endif

! void get_page(menu, header_page)
struct menu_common *menu;
! struct menu_context *header_page;
{
! /** Ensure that 'current' is on the displayed page,**/

! int current = mcommon_get_current(menu);
! int top = menu_header_get(header_page,header_top_line);
! int topO = top;
! int j = menu_header_get(header_page,header_current);


! /* but what is it on the SCREEN??? */
! int msg_pointer = compute_visible(current, menu) -1;
!
! int li,co;
!
!
! if (j != msg_pointer) {
! DPRINT(Debug,5,(&Debug,
! "get_page: current %d: header_page current %d => %d\n",
! current,j,msg_pointer));
! menu_header_change(header_page, header_current,msg_pointer);
! }

!
! menu_get_sizes(header_page, &li, &co);
!
! if (msg_pointer >= top+li) {
! top = msg_pointer;
!
! DPRINT(Debug,5,(&Debug,
! "get_page: current %d: header_page top %d => %d\n",
! current,topO,top));
!
! menu_header_change(header_page, header_top_line,top);
}
!
! if (msg_pointer < top) {
!
! top -= li;
!
! if (msg_pointer < top)
! top = msg_pointer -2;
!
! if (top < 0)
! top = 0;
!
! DPRINT(Debug,5,(&Debug,
! "get_page: current %d: header_page top %d => %d\n",
! current,topO,top));
!
! menu_header_change(header_page, header_top_line,top);
}
}

/*
Index: elm2.4.ME+.122-cvs/utils/answer.c
*** elm2.4.ME+.121/utils/answer.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/answer.c 2005-07-08 10:42:00.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: answer.c,v 1.17 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: answer.c,v 1.22 2005/07/08 07:42:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,45 ****

**/


#include "elmutil.h"
#include "ndbz.h"
#include "s_answer.h"
#include "sysdefs.h"

#define ELM "elm" /* where the elm program lives */

- int user_data; /* fileno of user data file */
DBZ *hash; /* dbz file for same */

static int translate P_((char *fullname, char *name, int namesize));
- static void print_long P_((char *buffer,
- int init_len));

! char *get_alias_address(), *get_token(), *strip_parens(), *shift_lower();

static char *quit_word, *exit_word, *done_word, *bye_word;

static void open_alias_file P_((void));



int main(argc, argv)
int argc;
char *argv[];

--- 21,46 ----

**/
#include "elmutil.h"
+ #include "mailerlib.h"


#include "ndbz.h"
#include "s_answer.h"
#include "sysdefs.h"

#define ELM "elm" /* where the elm program lives */

DBZ *hash; /* dbz file for same */

static int translate P_((char *fullname, char *name, int namesize));

! static char *get_alias_address P_((char *name, int mailing, int depth));
! static char *get_token P_((char *string, char *sepset, int depth));
!

static char *quit_word, *exit_word, *done_word, *bye_word;

static void open_alias_file P_((void));

+ int main P_((int argc, char *argv[]));


int main(argc, argv)
int argc;
char *argv[];

***************
*** 85,90 ****
--- 86,93 ----
}
}

+ init_mailerlib();
+
user_init();
init_defaults();
read_rc_file(0);
***************
*** 309,316 ****

if (fullname[i] == ' ')
if (lastname) {
! printf(catgets(elm_msg_cat, AnswerSet, AnswerCannotHaveMoreNames,
! "** Can't have more than 'FirstName LastName' as address!\n"));
return(0);
}
else
--- 312,319 ----

if (fullname[i] == ' ')
if (lastname) {
! lib_error(CATGETS(elm_msg_cat, AnswerSet, AnswerCannotHaveMoreNames,
! "** Can't have more than 'FirstName LastName' as address!\n"));
return(0);
}
else
***************
*** 339,346 ****
if ((hash = dbz_open(fname, O_RDONLY, 0)) == NULL)
exit(printf("** Fatal Error: Could not open %s!\n", fname));

- if ((user_data = open(fname, O_RDONLY)) == -1)
- return;
}

static int expand_group P_((
--- 342,347 ----
***************
*** 350,358 ****
int targetsize));


! char *get_alias_address(name, mailing, depth)
! char *name;
! int mailing, depth;
{
/** return the line from either datafile that corresponds
to the specified name. If 'mailing' specified, then
--- 351,362 ----
int targetsize));


! static char *get_alias_address P_((char *name,
! int mailing, int depth));
!
! static char *get_alias_address(name, mailing, depth)
! char *name;
! int mailing, depth;
{
/** return the line from either datafile that corresponds
to the specified name. If 'mailing' specified, then
***************
*** 360,393 ****
Depth is the nesting depth, and varies according to the
nesting level of the routine. **/

- static char buffer[VERY_LONG_STRING];
static char sprbuffer[VERY_LONG_STRING];
- datum key, value;
int loc;
! struct alias_rec entry;

! name = shift_lower(name);
! key.dptr = name;
! key.dsize = strlen(name);
! value = dbz_fetch(hash, key);
! if (value.dptr == NULL)
! return( (char *) NULL); /* not found */
!
! bcopy(value.dptr, (char *) &loc, sizeof(loc));
! loc -= sizeof(entry);
! lseek(user_data, loc, 0L);
! read(user_data, (char *) &entry, sizeof(entry));
! read(user_data, buffer, entry.length > VERY_LONG_STRING ? VERY_LONG_STRING : entry.length);
! if ((entry.type & GROUP) != 0 && mailing) {
! if (expand_group(sprbuffer, buffer + (int) entry.address,
! depth, sizeof sprbuffer) < 0)
return NULL;
} else {
elm_sfprintf(sprbuffer, sizeof sprbuffer,
FRM("%s (%s)"),
! buffer + (int) entry.address,
! buffer + (int) entry.name);
}
return sprbuffer;
}

--- 364,394 ----
Depth is the nesting depth, and varies according to the
nesting level of the routine. **/

static char sprbuffer[VERY_LONG_STRING];
int loc;
! struct alias_rec *entry1;
!
!
! entry1 = fetch_alias(hash,name);

! if (entry1 == NULL)
! return( NULL); /* not found */
!
! if ((entry1->type & GROUP) != 0 && mailing) {
! if (expand_group(sprbuffer, entry1->address,
! depth, sizeof sprbuffer) < 0) {
!
! free(entry1);
return NULL;
+ }
} else {
elm_sfprintf(sprbuffer, sizeof sprbuffer,
FRM("%s (%s)"),
! entry1->address,
! entry1->name);
}
+
+ free(entry1);
return sprbuffer;
}

***************
*** 438,446 ****
#undef NULL
#define NULL (char *) 0 /* for this routine only */

! char *get_token(string, sepset, depth)
! char *string, *sepset;
! int depth;
{

/** string is the string pointer to break up, sepstr are the
--- 439,447 ----
#undef NULL
#define NULL (char *) 0 /* for this routine only */

! static char *get_token(string, sepset, depth)
! char *string, *sepset;
! int depth;
{

/** string is the string pointer to break up, sepstr are the
Index: elm2.4.ME+.122-cvs/utils/charmapcopy.c
*** elm2.4.ME+.121/utils/charmapcopy.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/charmapcopy.c 2005-07-01 12:15:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: charmapcopy.c,v 1.5 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: charmapcopy.c,v 1.6 2005/07/01 09:15:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 17,24 ****
int copydir_count = 0;

#include <errno.h>
extern int errno;
!
FILE *charmap_copy(name,pathname)
const char *name;
const char *pathname;
--- 17,25 ----
int copydir_count = 0;



#include <errno.h>
+ #ifndef ANSI_C

extern int errno;
! #endif
FILE *charmap_copy(name,pathname)
const char *name;
const char *pathname;
Index: elm2.4.ME+.122-cvs/utils/elmalias.c
*** elm2.4.ME+.121/utils/elmalias.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/elmalias.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.17 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.18 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 71,80 ****
#include "s_elmalias.h"
#include <pwd.h>

- char *getenv();
- #ifndef ANSI_C
- struct passwd *getpwuid();
- #endif

/*
* Maximum number of alias files we can consult.
--- 71,76 ----
***************
*** 90,108 ****
/*
* "aliasdb" library routines.
*/
- extern struct alias_rec *fetch_alias();
- extern char *next_addr_in_list();

/*
* Local procedures.
*/
! DBZ *open_user_aliases(), *open_system_aliases();
! struct alias_rec *make_dummy_rec();
! void exp_print_alias(), print_alias();
! char *sel_alias_mem();
!

! void usage_error()
{
lib_error(CATGETS(elm_msg_cat, ElmaliasSet, ElmaliasUsage,
"usage: %s [-adenrsuvV] [-f format] [alias ...]\n"),
--- 86,106 ----
/*
* "aliasdb" library routines.
*/

/*
* Local procedures.
*/
! static DBZ *open_user_aliases P_((void));
! static DBZ *open_system_aliases P_((void));
! static struct alias_rec *make_dummy_rec P_((char *val));
! static void exp_print_alias P_((DBZ *dblist[], char *fmt,
! struct alias_rec *ar));
! static void print_alias P_((char *fmt, struct alias_rec *ar));
! static char *sel_alias_mem P_((struct alias_rec *ar,
! int sel));

! static void usage_error P_((void));
! static void usage_error()
{
lib_error(CATGETS(elm_msg_cat, ElmaliasSet, ElmaliasUsage,
"usage: %s [-adenrsuvV] [-f format] [alias ...]\n"),
***************
*** 112,119 ****
}


/*ARGSUSED*/
! void malloc_fail_handler(proc, size)
char *proc;
unsigned size;
{
--- 110,120 ----
}


+ static void malloc_fail_handler P_((char *proc, unsigned size));
+
+
/*ARGSUSED*/
! static void malloc_fail_handler(proc, size)
char *proc;
unsigned size;
{
***************
*** 131,136 ****
--- 132,138 ----
/*NOTREACHED*/
}

+ int main P_((int argc, char *argv[]));


int main(argc, argv)
int argc;
char *argv[];

***************
*** 324,336 ****
}


! DBZ *open_system_aliases()
{
return dbz_open(system_data_file, O_RDONLY, 0);
}


! DBZ *open_user_aliases()
{
DBZ *db;
db = dbz_open(user_data_file, O_RDONLY, 0);
--- 326,338 ----
}


! static DBZ *open_system_aliases()
{
return dbz_open(system_data_file, O_RDONLY, 0);
}


! static DBZ *open_user_aliases()
{
DBZ *db;
db = dbz_open(user_data_file, O_RDONLY, 0);
***************
*** 341,347 ****
/*
* Cobble up an alias record structure to hold some address info.
*/
! struct alias_rec *make_dummy_rec(val)
char *val;
{
struct alias_rec *ar;
--- 343,349 ----
/*
* Cobble up an alias record structure to hold some address info.
*/
! static struct alias_rec *make_dummy_rec(val)
char *val;
{
struct alias_rec *ar;
***************
*** 361,370 ****
/*
* Recursively expand out a list of addresses and print the expansions.
*/
! void exp_print_alias(dblist, fmt, ar)
! DBZ *dblist[];
! char *fmt;
! struct alias_rec *ar;
{
char *abuf; /* list of addresses we can scribble upon */
char *acurr; /* pointer to current address within "abuf" */
--- 363,372 ----
/*
* Recursively expand out a list of addresses and print the expansions.
*/
! static void exp_print_alias(dblist, fmt, ar)
! DBZ *dblist[];
! char *fmt;
! struct alias_rec *ar;
{
char *abuf; /* list of addresses we can scribble upon */
char *acurr; /* pointer to current address within "abuf" */
***************
*** 405,412 ****
* Print out alias information according to a format specification.
*/
void print_alias(fmt, ar)
! char *fmt;
! struct alias_rec *ar;
{
char pfmt[64]; /* buffer to hold "%m.ns" formats */
int in_conditional; /* TRUE if in middle of cond expression */
--- 407,414 ----
* Print out alias information according to a format specification.
*/
void print_alias(fmt, ar)
! char *fmt;
! struct alias_rec *ar;
{
char pfmt[64]; /* buffer to hold "%m.ns" formats */
int in_conditional; /* TRUE if in middle of cond expression */


***************
*** 506,514 ****
/*

* Select a member of the alias record structure.
*/
! char *sel_alias_mem(ar, sel)
! struct alias_rec *ar;
! int sel;
{
switch (sel) {
case 'a':
--- 508,516 ----
/*
* Select a member of the alias record structure.
*/
! static char *sel_alias_mem(ar, sel)
! struct alias_rec *ar;
! int sel;
{
switch (sel) {
case 'a':
Index: elm2.4.ME+.122-cvs/utils/elmbindata.c
*** elm2.4.ME+.121/utils/elmbindata.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/elmbindata.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.6 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.8 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 19,31 ****

int register_fd = -1;
char * program_name = "elmbindata";

#include "charmapcopy.h"



extern char *optarg;
extern int optind;

!

int main(argc, argv)
int argc;
char *argv[];

--- 19,32 ----

int register_fd = -1;
char * program_name = "elmbindata";
+ char * register_module = NULL;

#include "charmapcopy.h"



extern char *optarg;
extern int optind;

! int main P_((int argc, char *argv[]));


int main(argc, argv)
int argc;
char *argv[];

***************
*** 100,106 ****
text_target_dir);

if (register_fd != -1)
! log_it("M",text_target_dir,"-","-",0700);

} else if (EEXIST != errno) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeCantCreateDir,
--- 101,107 ----
text_target_dir);

if (register_fd != -1)
! log_it("M",text_target_dir,"-","-",0700,NULL);

} else if (EEXIST != errno) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeCantCreateDir,
Index: elm2.4.ME+.122-cvs/utils/elmcharset.c
*** elm2.4.ME+.121/utils/elmcharset.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/elmcharset.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.30 2004/07/10 08:08:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.32 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 20,28 ****
--- 20,31 ----

char * program_name = "elmcharset";
int register_fd = -1;
+ char * register_module = NULL;

#include "charmapcopy.h"

+
+ int main P_((int argc, char *argv[]));


int main(argc, argv)
int argc;
char *argv[];

Index: elm2.4.ME+.122-cvs/utils/elmlibregister.c
*** elm2.4.ME+.121/utils/elmlibregister.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/elmlibregister.c 2005-07-05 20:53:38.000000000 +0300
***************
*** 1,11 ****
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.8 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Some code based on ../src/save_optc.c
* That code was following copyright:
*


* The Elm Mail System

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.14 2005/07/05 17:53:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Some code based on ../src/save_opts.c (but that code may be moved to
! * lib/write_rc.c)
* That code was following copyright:
*


* The Elm Mail System

***************
*** 15,20 ****
--- 16,22 ----
*****************************************************************************/

#include "elmutil.h"
+ #include "mailerlib.h"


#include "s_me.h"
#include "s_elm.h"
#include "s_elmrc.h"
***************

*** 31,37 ****
--- 33,41 ----



int register_fd = -1;
char * program_name = "elmrc-write";

+ char * register_module = NULL;

+ int main P_((int argc, char *argv[]));


int main(argc, argv)
int argc;
char *argv[];

***************
*** 42,47 ****
--- 46,54 ----
int write_default = 0;
char * targetfile = NULL;
FILE * commentfile = NULL;
+ char * elmrc_changes = NULL;
+ struct elmrc_recorder * recorder = NULL;
+ FILE * elmrc_changes_F = NULL;

int x;



***************
*** 52,58 ****

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:")) != EOF) {

switch(c) {
case 'G':

--- 59,65 ----

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:c:")) != EOF) {

switch(c) {
case 'G':
***************
*** 87,92 ****
--- 94,130 ----


}
break;

+
+ case 'c':

+ elmrc_changes = optarg;
+ if (0 != access(elmrc_changes,WRITE_ACCESS)) {
+ int errcode = errno;
+
+ if (errcode != ENOENT) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ elmrc_changes, error_description(errcode));
+ err++;
+ goto fail;
+ }
+ }
+
+
+ elmrc_changes_F = open_or_create(elmrc_changes);
+ if (!elmrc_changes_F) {
+ int errcode = errno;
+
+ if (errcode != ENOENT) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ elmrc_changes, error_description(errcode));
+ err++;


+ goto fail;
+ }
+ }

+
+ break;
+
case 'C':
if (0 != access(optarg,READ_ACCESS)) {
int errcode = errno;
***************
*** 117,122 ****
--- 155,169 ----
}

user_init();
+
+ if (elmrc_changes_F) {
+ recorder = enable_recorder(global ? SYSTEM_RC : LOCAL_RC);
+
+ seed_history(elmrc_changes_F,elmrc_changes,recorder);
+ }
+
+ init_mailerlib();
+
init_defaults();

elm_sfprintf(version_buff, sizeof version_buff,
***************
*** 155,168 ****
}


- if (!commentfile) {
- commentfile = fopen(ELMRC_INFO,"r");
- if (!commentfile)
- lib_error(CATGETS(elm_msg_cat, ElmrcSet,
- ElmrcSavingWithoutComments,
- "Warning: saving without comments! Can't get to %s."),
- ELMRC_INFO);
- }

if (targetfile && write_default) {
lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcNoBothwI,
--- 202,207 ----
***************
*** 176,388 ****


if (targetfile) {
- char * tmp = elm_message(FRM("%s.N"),targetfile);
- int errcode = can_open(tmp,"w");
- int x;
- FILE *f;

!
! if (errcode) {
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
! err++;
! free(tmp);
! goto fail;
! }
! f = fopen(tmp,"w");
! if (!f) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
err++;
- free(tmp);
goto fail;
}

- elm_fprintf(f,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoLIB,
- "# Saved automatically by ELMLIBREGISTER %s\n#\n\n"),
- version_buff);
-
-
- if (commentfile) {
- char line_buffer[SLEN];
- int x;
- int len;
- int local_value;
- int skip = 1;
-
- while (0 < (len =
- mail_gets(line_buffer, sizeof line_buffer,
- commentfile))) {
-
- int y = 0;
-
-
- if (line_buffer[len-1] != '\n') {
- DPRINT(Debug,1,(&Debug,
- "Too long line (read len=%d): %s\n",
- len,line_buffer));
- break;
- }
- line_buffer[--len] = '\0';
- if (0 == len)
- continue;
-
- if ('#' == line_buffer[0] || whitespace(line_buffer[0])) {
-
- if (strncmp(line_buffer, "#$HDR", 5) == 0) {
- skip = 0;
- continue;
- }
-
- if (skip)
- continue;
-
- /* Copy initial comments */
-
- fprintf(f,"%s\n",line_buffer);
- continue;
- }
- skip = 1;
-
-
- for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
- y = strcmp(line_buffer, save_info[x].name);
- if (y <= 0)
- break;
- }
-
- if (x >= NUMBER_OF_SAVEABLE_OPTIONS || y != 0) {
-
- DPRINT(Debug,15,(&Debug,
- "Skipping option %s ... \n",
- line_buffer));
-
- continue;
- }
-
- if (global &&
- ! (save_info[x].flags & FL_CHANGED) &&
- ! (save_info[x].flags & FL_SYS)) {
- DPRINT(Debug,15,(&Debug,
- "Skipping user option %s ... \n",
- line_buffer));
-
- continue;
- }
-
- if (!global &&
- (save_info[x].flags & FL_SYS)) {
- DPRINT(Debug,15,(&Debug,
- "Skipping system option %s ... \n",
- line_buffer));
-
- continue;
- }
-
- fprintf(f,"\n");
-
- /* Copy comments */
- while (0 < (len =
- mail_gets(line_buffer, sizeof line_buffer,
- commentfile))) {
- if ('#' != line_buffer[0])
- break;
- fputs(line_buffer,f);
- }
-
- if (global)
- local_value = save_info[x].flags & FL_CHANGED;
- else
- local_value = save_info[x].flags & FL_LOCAL;
- if (RCTYPE_magic != save_info[x].dt_type->magic)
- panic("RC PANIC",__FILE__,__LINE__,"main",
- "Bad config item type",0);
-
- save_info[x].dt_type->print_value(f,
- & save_info[x],
- !local_value);
-
-
- save_info[x].flags |= FL_SAVED;
- }
- }
-
- for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
- int local_value;
-
-
- if (save_info[x].flags & FL_SAVED)
- continue;

! if (global &&
! ! (save_info[x].flags & FL_CHANGED) &&
! ! (save_info[x].flags & FL_SYS)) {
! DPRINT(Debug,15,(&Debug,
! "Skipping user option %s ... \n",
! save_info[x].name));
!
! continue;
! }
!
! if (!global &&
! (save_info[x].flags & FL_SYS)) {
! DPRINT(Debug,15,(&Debug,
! "Skipping system option %s ... \n",
! save_info[x].name));
!
! continue;
! }
!
! fprintf(f,"\n");

! if (global)
! local_value = save_info[x].flags & FL_CHANGED;
! else
! local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"main",
! "Bad config item type",0);
!
! save_info[x].dt_type->print_value(f,
! & save_info[x],
! !local_value);
! }

! print_local_shared_options(f,global);

! if (EOF == fclose(f)) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
! err++;
! free(tmp);
! goto fail;
! }
! if (0 != rename(tmp,targetfile)) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
! "Failed to rename temporary file to %.50s: %.30s"),
! targetfile, error_description(errcode));
!
! err++;
! free(tmp);
! goto fail;
! }

! log_config(targetfile);

- free(tmp);
}

fail:
if (commentfile)
fclose(commentfile);

--- 215,251 ----


if (targetfile) {

!
! int r = write_rc(targetfile,commentfile,global,
! "ELMLIBREGISTER",NULL);
!
! if (!r) {
err++;
goto fail;
}


! log_config(targetfile);

! }

! if (elmrc_changes_F) {
! rewind(elmrc_changes_F);

! #ifdef FTRUNCATE
! /* Not really necessary */
! ftruncate(fileno(elmrc_changes_F),0);
! #endif

! print_history_changed(elmrc_changes_F,recorder);

}

fail:
+ if (elmrc_changes_F)
+ fclose(elmrc_changes_F);
+
if (commentfile)
fclose(commentfile);

Index: elm2.4.ME+.122-cvs/utils/elmrc-write.c
*** elm2.4.ME+.121/utils/elmrc-write.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/elmrc-write.c 2005-07-05 20:53:38.000000000 +0300
***************
*** 1,11 ****
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.15 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Some code based on ../src/save_optc.c
* That code was following copyright:
*


* The Elm Mail System

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.20 2005/07/05 17:53:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Some code based on ../src/save_optc.c (but that code may be moved to
! * lib/write_rc.c)
* That code was following copyright:
*


* The Elm Mail System

***************
*** 31,38 ****



int register_fd = -1;
char * program_name = "elmrc-write";

!

int main(argc, argv)
int argc;
char *argv[];

--- 32,40 ----



int register_fd = -1;
char * program_name = "elmrc-write";

+ char * register_module = NULL;

! int main P_((int argc, char *argv[]));


int main(argc, argv)
int argc;
char *argv[];

***************
*** 43,48 ****
--- 45,54 ----
int write_default = 0;
char * targetfile = NULL;
FILE * commentfile = NULL;
+ char * elmrc_changes = NULL;
+ struct elmrc_recorder * recorder = NULL;
+ FILE * elmrc_changes_F = NULL;
+

#if DEBUG
init_debugfile("ELMRC-WRITE");


***************
*** 51,57 ****

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:")) != EOF) {

switch(c) {
case 'G':

--- 57,63 ----

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:c:")) != EOF) {

switch(c) {
case 'G':
***************
*** 86,91 ****
--- 92,129 ----
}
break;

+ case 'c':
+ elmrc_changes = optarg;
+ if (0 != access(elmrc_changes,WRITE_ACCESS)) {
+ int errcode = errno;
+
+ if (errcode != ENOENT) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ elmrc_changes, error_description(errcode));
+ err++;
+ goto fail;
+ }
+ }
+
+
+ elmrc_changes_F = open_or_create(elmrc_changes);
+ if (!elmrc_changes_F) {
+ int errcode = errno;
+
+ if (errcode != ENOENT) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ elmrc_changes, error_description(errcode));
+ err++;


+ goto fail;
+ }
+ }

+

+ break;
+
+
+

case 'C':
if (0 != access(optarg,READ_ACCESS)) {
int errcode = errno;
***************
*** 116,121 ****
--- 154,166 ----
}

user_init();
+
+ if (elmrc_changes_F) {
+ recorder = enable_recorder(global ? SYSTEM_RC : LOCAL_RC);
+
+ seed_history(elmrc_changes_F,elmrc_changes,recorder);
+ }
+
init_defaults();

elm_sfprintf(version_buff, sizeof version_buff,
***************
*** 175,188 ****
goto fail;
}

- if (!commentfile) {
- commentfile = fopen(ELMRC_INFO,"r");
- if (!commentfile)
- lib_error(CATGETS(elm_msg_cat, ElmrcSet,
- ElmrcSavingWithoutComments,
- "Warning: saving without comments! Can't get to %s."),
- ELMRC_INFO);
- }

if (targetfile && write_default) {
lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcNoBothwI,
--- 220,225 ----
***************
*** 194,410 ****
if (write_default)
targetfile = global ? system_rc_file : user_rc_file;


if (targetfile) {
- char * tmp = elm_message(FRM("%s.N"),targetfile);
- int errcode = can_open(tmp,"w");
- int x;
- FILE *f;

!
! if (errcode) {
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
! err++;
! free(tmp);
! goto fail;
! }
! f = fopen(tmp,"w");
! if (!f) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
err++;
- free(tmp);
goto fail;
}

- elm_fprintf(f,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoWrite,
- "# Saved automatically by ELMRC-WRITE %s\n#\n\n"),
- version_buff);
-
-
- if (commentfile) {
- char line_buffer[SLEN];
- int x;
- int len;
- int local_value;
- int skip = 1;
-
- while (0 < (len =
- mail_gets(line_buffer, sizeof line_buffer,
- commentfile))) {
-
- int y = 0;
-
-
- if (line_buffer[len-1] != '\n') {
- DPRINT(Debug,1,(&Debug,
- "Too long line (read len=%d): %s\n",
- len,line_buffer));
- break;
- }
- line_buffer[--len] = '\0';
- if (0 == len)
- continue;
-
- if ('#' == line_buffer[0] || whitespace(line_buffer[0])) {
-
- if (strncmp(line_buffer, "#$HDR", 5) == 0) {
- skip = 0;
- continue;
- }
-
- if (skip)
- continue;
-
- /* Copy initial comments */
-
- fprintf(f,"%s\n",line_buffer);
- continue;
- }
- skip = 1;
-
-
- for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
- y = strcmp(line_buffer, save_info[x].name);
- if (y <= 0)
- break;
- }
-
- if (x >= NUMBER_OF_SAVEABLE_OPTIONS || y != 0) {
-
- DPRINT(Debug,15,(&Debug,
- "Skipping option %s ... \n",
- line_buffer));
-
- continue;
- }
-
- if (global &&
- ! (save_info[x].flags & FL_CHANGED) &&
- ! (save_info[x].flags & FL_SYS)) {
- DPRINT(Debug,15,(&Debug,
- "Skipping user option %s ... \n",
- line_buffer));
-
- continue;
- }
-
- if (!global &&
- (save_info[x].flags & FL_SYS)) {
- DPRINT(Debug,15,(&Debug,
- "Skipping system option %s ... \n",
- line_buffer));
-
- continue;
- }
-
- fprintf(f,"\n");
-
- /* Copy comments */
- while (0 < (len =
- mail_gets(line_buffer, sizeof line_buffer,
- commentfile))) {
- if ('#' != line_buffer[0])
- break;
- fputs(line_buffer,f);
- }
-
- if (global)
- local_value = save_info[x].flags & FL_CHANGED;
- else
- local_value = save_info[x].flags & FL_LOCAL;
- if (RCTYPE_magic != save_info[x].dt_type->magic)
- panic("RC PANIC",__FILE__,__LINE__,"main",
- "Bad config item type",0);
-
- save_info[x].dt_type->print_value(f,
- & save_info[x],
- !local_value);
-
-
- save_info[x].flags |= FL_SAVED;
- }
- }
-
- for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
- int local_value;
-
-
- if (save_info[x].flags & FL_SAVED)
- continue;
-
- if (global &&
- ! (save_info[x].flags & FL_CHANGED) &&
- ! (save_info[x].flags & FL_SYS)) {
- DPRINT(Debug,15,(&Debug,
- "Skipping user option %s ... \n",
- save_info[x].name));

! continue;
! }

! if (!global &&
! (save_info[x].flags & FL_SYS)) {
! DPRINT(Debug,15,(&Debug,
! "Skipping system option %s ... \n",
! save_info[x].name));
!
! continue;
! }

- fprintf(f,"\n");

! if (global)
! local_value = save_info[x].flags & FL_CHANGED;
! else
! local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"main",
! "Bad config item type",0);
!
! save_info[x].dt_type->print_value(f,
! & save_info[x],
! !local_value);
! }

! #ifdef USE_DLOPEN
! print_local_shared_options(f,global);
#endif

! if (EOF == fclose(f)) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
! err++;
! free(tmp);
! goto fail;
! }
! if (0 != rename(tmp,targetfile)) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
! "Failed to rename temporary file to %.50s: %.30s"),
! targetfile, error_description(errcode));
!
! err++;
! free(tmp);
! goto fail;
! }
!
! log_config(targetfile);

- free(tmp);
}

fail:
if (commentfile)
fclose(commentfile);

--- 231,270 ----
if (write_default)
targetfile = global ? system_rc_file : user_rc_file;

+

if (targetfile) {

! int r = write_rc(targetfile,commentfile,global,
! "ELMRCWRITE", NULL);
!
! if (!r) {
err++;
goto fail;
}


! log_config(targetfile);

! }


! if (elmrc_changes_F) {
! rewind(elmrc_changes_F);

! #ifdef FTRUNCATE
! /* Not really necessary */
! ftruncate(fileno(elmrc_changes_F),0);
#endif

! print_history_changed(elmrc_changes_F,recorder);

}

fail:
+ if (elmrc_changes_F)
+ fclose(elmrc_changes_F);
+
if (commentfile)
fclose(commentfile);

Index: elm2.4.ME+.122-cvs/utils/elmregister.c
*** elm2.4.ME+.121/utils/elmregister.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/elmregister.c 2005-07-06 14:20:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.19 2004/07/27 20:25:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.28 2005/07/06 11:20:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 17,23 ****
* installer root given on $ELM_ROOT


*
* filenames are relative to $ELM_ROOT

! *

*
* -- copy file
*

--- 17,25 ----
* installer root given on $ELM_ROOT


*
* filenames are relative to $ELM_ROOT

! *
! * -- module
! * 'm' module {rest of line}


*
* -- copy file
*
***************

*** 51,57 ****

/* putenv.c */
#ifndef PUTENV
! xtern int putenv P_((char *));
#endif

/* strstr.c */
--- 53,59 ----

/* putenv.c */
#ifndef PUTENV
! extern int putenv P_((char *));
#endif

/* strstr.c */
***************
*** 85,99 ****
static char * installer_root = "$ELM_ROOT"; /* To be assigned */

char * program_name = "elmregister"; /* To be assigned */

static int create_pipe P_((int argc, char *argv[], int x, int *PID,
! char *root));
! static int create_pipe(argc,argv,x,PID,root)
int argc;
char *argv[];
int x;
int *PID;
char *root;
{
static char array[] = "ELM_INSTALLER=XXXX";
int filedes[2];
--- 87,103 ----
static char * installer_root = "$ELM_ROOT"; /* To be assigned */

char * program_name = "elmregister"; /* To be assigned */
+ char * register_module = NULL;

static int create_pipe P_((int argc, char *argv[], int x, int *PID,
! char *root, char *module));
! static int create_pipe(argc,argv,x,PID,root,module)
int argc;
char *argv[];
int x;
int *PID;
char *root;
+ char *module;
{
static char array[] = "ELM_INSTALLER=XXXX";
int filedes[2];
***************
*** 120,125 ****
--- 124,130 ----
int l = strlen(root) + 12;
char *array2 = malloc(l);

+
sprintf(array,"ELM_INSTALLER=%d",filedes[1]);

if (!array2) {
***************
*** 138,143 ****
--- 143,161 ----
exit(1);
}

+ if (module) {
+ int l = strlen(root) + 15;
+ char *array3 = malloc(l);
+
+ sprintf(array3,"ELM_MODULE=%s",module);
+
+ if (0 != putenv(array3)) {
+ fprintf(stderr,"%s: putenv() failed\n",program_name);


+ exit(1);
+ }
+
+ }
+

close(filedes[0]); /* read end */

fprintf(stdout,"%s: Running %s ...\n",
***************
*** 206,212 ****
--- 224,233 ----
char * buffer;
int buffer_len;

+ char * module_ptr;
+
int command_letter;
+ char * command_ptr;

/* Following points to space on buffer ... */

***************
*** 275,280 ****
--- 296,317 ----

}

+ static void parse_log_tail P_((
+ struct log_record *l,
+ char buffer1[MAX_PIPE_LOG +10 ],
+
+ int ptr,
+
+ int module_ptr,
+ int command_ptr,
+ int user_ptr,
+ int group_ptr,
+ int mode_ptr,
+
+ int args_ptr[MAX_ARGS],
+ int argnum));
+
+
static void parse_log P_((FILE *F, struct log_record *l));
static void parse_log(F,l)
FILE *F;
***************
*** 287,295 ****

int c = fgetc(F);

! int user_ptr = -1;
! int group_ptr = -1;
! int mode_ptr = -1;

int args_ptr[MAX_ARGS];
int argnum = 0;
--- 324,334 ----

int c = fgetc(F);

! int module_ptr = -1;
! int command_ptr = -1;
! int user_ptr = -1;
! int group_ptr = -1;
! int mode_ptr = -1;

int args_ptr[MAX_ARGS];
int argnum = 0;
***************
*** 297,302 ****
--- 336,344 ----
l->buffer = NULL;
l->buffer_len = 0;

+
+ l->module_ptr = NULL;
+ l->command_ptr = NULL;
l->user_ptr = NULL;
l->group_ptr = NULL;
l->mode_ptr = NULL;
***************
*** 312,318 ****

ungetc(c,F); /* add_bytes reread character */

! add_bytes(F,buffer1,&ptr);

if (buffer1[0] != c) {
fprintf(stderr,"%s: Character %c not buffered (reading from pipe or file)\n",
--- 354,360 ----

ungetc(c,F); /* add_bytes reread character */

! command_ptr = ptr; add_bytes(F,buffer1,&ptr);

if (buffer1[0] != c) {
fprintf(stderr,"%s: Character %c not buffered (reading from pipe or file)\n",
***************
*** 320,325 ****
--- 362,375 ----


exit(1);
}

+ if ('m' == c) {

+
+ module_ptr = ptr; add_bytes(F,buffer1,&ptr); /* module */
+ command_ptr = ptr; add_bytes(F,buffer1,&ptr); /* command */
+ c = buffer1[command_ptr];


+
+ }
+
l->command_letter = c;

switch (c) {

***************
*** 355,361 ****
args_ptr[0] = ptr; add_bytes(F,buffer1,&ptr); /* file1 file */
args_ptr[1] = ptr; add_bytes(F,buffer1,&ptr); /* file2 file */
argnum = 2;
!
case 'R':
case 'E':

--- 405,412 ----
args_ptr[0] = ptr; add_bytes(F,buffer1,&ptr); /* file1 file */
args_ptr[1] = ptr; add_bytes(F,buffer1,&ptr); /* file2 file */
argnum = 2;
! break;
!
case 'R':
case 'E':

***************
*** 419,426 ****
--- 470,506 ----

}

+ parse_log_tail(l,buffer1,ptr,module_ptr,command_ptr,user_ptr,
+ group_ptr,mode_ptr,args_ptr,argnum);
+
+ }
+
+ static void parse_log_tail(l,buffer1,ptr,module_ptr,command_ptr,user_ptr,
+ group_ptr,mode_ptr,args_ptr,argnum)
+ struct log_record *l;
+ char buffer1[MAX_PIPE_LOG +10 ]; /* write routines quarantee that
+ this is enough! */
+
+ int ptr;
+
+ int module_ptr;
+ int command_ptr;
+ int user_ptr;
+ int group_ptr;
+ int mode_ptr;
+
+ int args_ptr[MAX_ARGS];
+ int argnum;
+ {
+
memcpy(l->buffer,buffer1,l->buffer_len);

+ if (module_ptr != -1)
+ l->module_ptr = l->buffer + module_ptr;
+
+ if (command_ptr != -1)
+ l->command_ptr = l->buffer + command_ptr;
+
if (user_ptr != -1)
l->user_ptr = l->buffer + user_ptr;

***************
*** 600,606 ****
if (!last -> version) {
fprintf(stderr,
"%s: Failed to strdup string (%d bytes?): %s\n",
! program_name,ptr-1,my_version);

fclose(LI->file);
exit(1); /* FAILURE */
--- 680,686 ----
if (!last -> version) {
fprintf(stderr,
"%s: Failed to strdup string (%d bytes?): %s\n",
! program_name,ptr-buffer-1,my_version);

fclose(LI->file);
exit(1); /* FAILURE */
***************
*** 985,1002 ****

clear_log_instance(&LI);

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {

! filelist = argv[x+1];
! x += 2;
}

- if (x < argc -1 && 0 == strcmp("-R", argv[x])) {

! installer_root = argv[x+1];
! x += 2;
! } else
! installer_root = "/";

if ('\0' == installer_root[0]) {
fprintf(stderr,"%s: -R '' invalid\n",
--- 1065,1097 ----

clear_log_instance(&LI);

! installer_root = "/";

! while (x < argc && '-' == argv[x][0]) {
!
! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
!
! filelist = argv[x+1];
! x += 2;
! } else if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
!
! installer_root = argv[x+1];
! x += 2;
! } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
!
! register_module = argv[x+1];
! x += 2;
!
! } else {
! fprintf(stderr,
! "%s: Bad option %s\n",
! program_name,argv[x]);
! exit(1);
! }
}


!

if ('\0' == installer_root[0]) {
fprintf(stderr,"%s: -R '' invalid\n",
***************
*** 1025,1033 ****

}

!
!
! read_pipe = create_pipe(argc,argv,x,&PID,installer_root);

fd = fdopen(read_pipe,"r");
if (!fd) {
--- 1120,1126 ----

}

! read_pipe = create_pipe(argc,argv,x,&PID,installer_root,register_module);

fd = fdopen(read_pipe,"r");
if (!fd) {
***************
*** 1385,1391 ****

static void copy_dir P_((char *src,char *trg, char *rel,
struct log_instance *LI,
! struct log_entries * last));

#ifdef DIROPS

--- 1478,1485 ----

static void copy_dir P_((char *src,char *trg, char *rel,
struct log_instance *LI,
! struct log_entries * last,
! char *register_module));

#ifdef DIROPS

***************
*** 1396,1407 ****
#include <sys/dir.h>


#endif /* DIROPS == USE_SYSDIR */

! static void copy_dir(src,trg,rel,LI,last)
char *src;
char *trg;
char *rel;
struct log_instance *LI;
struct log_entries * last;
{
DIR * handle;

--- 1490,1502 ----
#include <sys/dir.h>


#endif /* DIROPS == USE_SYSDIR */

! static void copy_dir(src,trg,rel,LI,last, register_module)
char *src;
char *trg;
char *rel;
struct log_instance *LI;
struct log_entries * last;
+ char *register_module;
{
DIR * handle;

***************
*** 1538,1544 ****
strcat(relname,entryname);

if (!last)
! log_it("s",relname,"-","-", X.st_mode & 0777);
else {
char buffer[ MAX_PIPE_LOG];
char *ptr;
--- 1633,1640 ----
strcat(relname,entryname);

if (!last)
! log_it("s",relname,"-","-", X.st_mode & 0777,
! register_module);
else {
char buffer[ MAX_PIPE_LOG];
char *ptr;
***************
*** 1546,1561 ****
int rname = strlen(relname);
int L;
struct log_record L1;
! int ptrs[4];

sprintf(mode_s,"%05o",X.st_mode & 0777);

ptr = buffer;
! add_to_buffer(buffer, sizeof buffer,&ptr,"s",1);
! ptrs[0] = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"-",1);
! ptrs[1] = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"-",1);
! ptrs[2] = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,mode_s,5);
! ptrs[3] = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,relname,rname);

/* NO terminating NL to buffer */

--- 1642,1677 ----
int rname = strlen(relname);
int L;
struct log_record L1;
!
!
! int module_ptr = -1;
! int command_ptr = -1;
! int user_ptr = -1;
! int group_ptr = -1;
! int mode_ptr = -1;
! int args_ptr[1];
! int argnum = 0;

sprintf(mode_s,"%05o",X.st_mode & 0777);

+
+
+
ptr = buffer;
! if (register_module) {
! int l = strlen(register_module);
! add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);
!
! module_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,
! register_module,l);
! }
!
! command_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"s",1);
! user_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"-",1);
! group_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"-",1);
! mode_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,mode_s,5);
! args_ptr[argnum++] =
! ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,relname,rname);

/* NO terminating NL to buffer */

***************
*** 1566,1592 ****
program_name,L);
exit(1);
}
!
! L1.buffer = malloc(L);
! if (! L1.buffer) {
! fprintf(stderr,"%s: malloc %d bytes failed\n",
! program_name,L);
! exit(1); /* FAILURE */
! }
! L1.buffer_len = L;
! memcpy(L1.buffer,buffer,L);
L1.command_letter = 's';
! L1.user_ptr = L1.buffer + ptrs[0];
! L1.group_ptr = L1.buffer + ptrs[1];
! L1.mode_ptr = L1.buffer + ptrs[2];
! L1.arg_ptrs = malloc(2 * sizeof(L1.arg_ptrs[0]));
! if (! L1.arg_ptrs) {
! fprintf(stderr,"%s: malloc %d items failed\n",
! program_name,2);
! exit(1);
! }
! L1.arg_ptrs[0] = L1.buffer + ptrs[3];
! L1.arg_ptrs[1] = NULL;

last -> log = realloc(last -> log,
(last -> log_count+1) *
--- 1682,1692 ----
program_name,L);
exit(1);
}
!
!
L1.command_letter = 's';
! parse_log_tail(&L1,buffer,L,module_ptr,command_ptr,user_ptr,
! group_ptr,mode_ptr,args_ptr,argnum);

last -> log = realloc(last -> log,
(last -> log_count+1) *
***************
*** 1631,1642 ****

#else

! static void copy_dir(src,trg, char *rel,LI,last)
char *src;
char *trg;
char *rel;
struct log_instance *LI;
struct log_entries * last;
{
char * x = strrchr(trg,'/');
int w;
--- 1731,1743 ----

#else

! static void copy_dir(src,trg, char *rel,LI,last,register_module)
char *src;
char *trg;
char *rel;
struct log_instance *LI;
struct log_entries * last;
+ char *register_module;
{
char * x = strrchr(trg,'/');
int w;
***************
*** 1701,1711 ****

#endif /* DIROPS */

! static void make_argcopy P_((char *arg, int arg_len, char * stage_subdir ));
! static void make_argcopy(arg,arg_len, stage_subdir)
char *arg;
int arg_len;
char * stage_subdir;
{
struct stat X;

--- 1802,1814 ----

#endif /* DIROPS */

! static void make_argcopy P_((char *arg, int arg_len, char * stage_subdir,
! char *register_module));
! static void make_argcopy(arg,arg_len, stage_subdir, register_module)
char *arg;
int arg_len;
char * stage_subdir;
+ char *register_module;
{
struct stat X;

***************
*** 1752,1760 ****


if (0 != R)
! log_it(arg,source_r,"-", "-", 0444);
else
! log_it(arg,source_r,"-", "-", X.st_mode & 0777);

free(source_r);
free(source_f);
--- 1855,1864 ----


if (0 != R)
! log_it(arg,source_r,"-", "-", 0444, register_module);
else
! log_it(arg,source_r,"-", "-", X.st_mode & 0777,
! register_module);

free(source_r);
free(source_f);
***************
*** 1853,1861 ****
#endif
) {

! copy_dir(bufferz,target_f,target_r,NULL,NULL);

! log_it(arg,target_r,"-", "-", X.st_mode & 0777);

}
else {
--- 1957,1966 ----
#endif
) {

! copy_dir(bufferz,target_f,target_r,NULL,NULL,register_module);

! log_it(arg,target_r,"-", "-", X.st_mode & 0777,
! register_module);

}
else {
***************
*** 1870,1876 ****
exit(1); /* FAILURE */
}

! log_it(arg,target_r,"-", "-", X.st_mode & 0777);
}


--- 1975,1982 ----
exit(1); /* FAILURE */
}

! log_it(arg,target_r,"-", "-", X.st_mode & 0777,
! register_module);
}


***************
*** 1882,1888 ****

}

-
static int command P_((int argc, char *argv[], int x));
static int command(argc, argv, x)
int argc;
--- 1988,1993 ----
***************
*** 1948,1980 ****

return 1; /* FAILURE */
}
!
! if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
! int l;
!
! rel_path = argv[x+1];
! x += 2;
!
! l = strlen(rel_path);
!
! if (l > 0 && '/' != rel_path[l-1]) {
! char * X = malloc(l+2);
! if (!X) {
! fprintf(stderr,"%s: malloc %d bytes failed\n",
! argv[0],l+2);
! return 1; /* FAILURE */
}

! strncpy(X,rel_path,l+2);
! X[l] = '/';

! fprintf(stdout,"%s: Adding / to -R %s: %s\n",
! argv[0],rel_path,X);
! rel_path = X;
! }

}

/* COPY mode ?? */


--- 2053,2098 ----

return 1; /* FAILURE */
}
!
! while (x < argc && '-' == argv[x][0]) {
!
! if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
! int l;
!
! rel_path = argv[x+1];
! x += 2;
!
! l = strlen(rel_path);
!
! if (l > 0 && '/' != rel_path[l-1]) {
! char * X = malloc(l+2);
! if (!X) {
! fprintf(stderr,"%s: malloc %d bytes failed\n",
! argv[0],l+2);
! return 1; /* FAILURE */
! }
!
! strncpy(X,rel_path,l+2);
! X[l] = '/';
!
! fprintf(stdout,"%s: Adding / to -R %s: %s\n",
! argv[0],rel_path,X);
! rel_path = X;
}
+
+ } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {

! register_module = argv[x+1];
! x += 2;
!
! } else {

! break;

+ }
}

+
/* COPY mode ?? */


***************
*** 2030,2035 ****
--- 2148,2160 ----
}

ptr = buffer;
+
+ if (register_module) {
+ int l = strlen(register_module);
+ add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);
+ add_to_buffer(buffer, sizeof buffer,&ptr,register_module,l);
+ }
+
add_to_buffer(buffer, sizeof buffer,&ptr,"R",1);
for (j = 0; j < i; j++) {
int l = strlen(relative[j]);
***************
*** 2117,2122 ****
--- 2242,2252 ----


ptr = buffer;
+ if (register_module) {
+ int l = strlen(register_module);
+ add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);
+ add_to_buffer(buffer, sizeof buffer,&ptr,register_module,l);
+ }
add_to_buffer(buffer, sizeof buffer,&ptr,"L",1);
for (j = 0; j < i; j++) {
int l = strlen(relative[j]);
***************
*** 2306,2312 ****
return 1; /* FAILURE */
}

! log_it("M",target_r,s_user, s_group, f_mode);


free(target_r); free(target_f);
--- 2436,2443 ----
return 1; /* FAILURE */
}

! log_it("M",target_r,s_user, s_group, f_mode,
! register_module);


free(target_r); free(target_f);
***************
*** 2388,2396 ****
}

if (0 == strcmp("copydoc",cmd))
! log_it("d",target_r,s_user, s_group, f_mode);
else
! log_it("F",target_r,s_user, s_group, f_mode);

free(source_r); free(source_f);
free(target_r); free(target_f);
--- 2519,2527 ----
}

if (0 == strcmp("copydoc",cmd))
! log_it("d",target_r,s_user, s_group, f_mode, register_module);
else
! log_it("F",target_r,s_user, s_group, f_mode, register_module);

free(source_r); free(source_f);
free(target_r); free(target_f);
***************
*** 2426,2432 ****
int z;
if ('{' == argv[j][0] && (z = strlen(argv[j])) && '}' == argv[j][z-1]) {

! make_argcopy(argv[j],z, stage_subdir);
}

L += strlen(argv[j]) +1;
--- 2557,2563 ----
int z;
if ('{' == argv[j][0] && (z = strlen(argv[j])) && '}' == argv[j][z-1]) {

! make_argcopy(argv[j],z, stage_subdir,register_module);
}

L += strlen(argv[j]) +1;
***************
*** 2439,2444 ****
--- 2570,2580 ----
}

Kari E. Hurtta

unread,
Jul 13, 2005, 5:46:48 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.8

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 8/18
=========================================================================

install_libs_s: config.h config.sh hdrs/sysdefs.h
cd lib; $(MAKE) $(MJ) $(MFLAGS) install_s
cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) install_s

# Targets that are simply executed in each subordinate makefile as is
all install_s uninstall_s lint clean: config.h config.sh hdrs/sysdefs.h Makefile
cd lib; $(MAKE) $(MJ) $(MFLAGS) $@
cd melib; $(MAKE) $(MJ) $(MFLAGS) $@
cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) $@
--- 81,96 ----
# Helper target for testing
install_libs: config.h config.sh hdrs/sysdefs.h Makefile installer all
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) install_libs_s
! bin/elmregister replay -M all

install_libs_s: config.h config.sh hdrs/sysdefs.h
cd lib; $(MAKE) $(MJ) $(MFLAGS) install_s
+ cd lib/mailer; $(MAKE) $(MJ) $(MFLAGS) install_s
cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) install_s

# Targets that are simply executed in each subordinate makefile as is
all install_s uninstall_s lint clean: config.h config.sh hdrs/sysdefs.h Makefile
+ cd lib/mailer; $(MAKE) $(MJ) $(MFLAGS) $@
cd lib; $(MAKE) $(MJ) $(MFLAGS) $@
cd melib; $(MAKE) $(MJ) $(MFLAGS) $@
cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) $@
***************
*** 141,148 ****
--- 149,191 ----
_utils:
cd utils; $(MAKE) $(MJ) $(MFLAGS) all

+
+ libs/libelmme-base.a:
+ cd lib; $(MAKE) $(MJ) $(MFLAGS) ../libs/libelmme-base.a
+
!NO!SUBS!

+ for i in $liblist
+ do
+ cat >>Makefile <<!SUBS!
+ libs/libelmme-$i.a:
+ cd lib/$i; \$(MAKE) \$(MJ) \$(MFLAGS) ../../libs/libelmme-$i.a
+
+ !SUBS!
+ done


+
+ if $test "$d_shared" = "$define" ; then

+
+ cat >>Makefile <<'!NO!SUBS!'
+

+ shlib/libelmme-base.so: libs/libelmme-base.a
+ cd lib; $(MAKE) $(MJ) $(MFLAGS) ../libs/libelmme-base.so
+
+
+ !NO!SUBS!
+
+ for i in $liblist
+ do
+ cat >>Makefile <<!SUBS!
+ shlib/libelmme-$i.so: libs/libelmme-$i.a
+ cd lib/$i; \$(MAKE) \$(MJ) \$(MFLAGS) ../../libs/libelmme-$i.so
+

+ !SUBS!
+ done
+

+ fi
+
+
if $test "$build_package" = "$define" ; then

cat >>Makefile <<!SUBS!
***************
*** 154,161 ****
@echo "# Package $package" >>\$(ROOT)/README.PACKAGE.sh
@echo "# package filelist is on .$etc/elm.filelist" >>\$(ROOT)/README.PACKAGE.sh
@echo "#To move files to final place, use command:" >>\$(ROOT)/README.PACKAGE.sh
! @echo ".$lib/elmregister replay -R \\\`pwd\\\` " >>\$(ROOT)/README.PACKAGE.sh
!
!SUBS!

fi
--- 197,204 ----
@echo "# Package $package" >>\$(ROOT)/README.PACKAGE.sh
@echo "# package filelist is on .$etc/elm.filelist" >>\$(ROOT)/README.PACKAGE.sh
@echo "#To move files to final place, use command:" >>\$(ROOT)/README.PACKAGE.sh
! @echo ".$lib/elmregister replay -M all -R \\\`pwd\\\` " >>\$(ROOT)/README.PACKAGE.sh
!
!SUBS!

fi
Index: elm2.4.ME+.122-cvs/MANIFEST
*** elm2.4.ME+.121/MANIFEST 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/MANIFEST 2005-07-05 20:53:36.000000000 +0300
***************
*** 13,25 ****
Patchlist
README
config.h.SH
- doc/Alias.guide
- doc/Config.guid
- doc/Elm.cover
- doc/Form.guide
doc/Makefile.SH
- doc/Ref.guide
- doc/Users.guide
doc/answer.1
doc/chkalias.1
doc/elm-help.0
--- 13,19 ----
***************
*** 40,46 ****
doc/newmail.1
doc/printmail.1
doc/readmsg.1
- doc/tmac.n
hdrs/defs.h
hdrs/elm.h
hdrs/elmutil.h
--- 34,39 ----
***************
*** 68,74 ****
hdrs/save_opts.h
hdrs/sysdefs.SH
lib/Makefile.SH
- lib/add_site.c
lib/aliasdb.c
lib/atonum.c
lib/can_access.c
--- 61,66 ----
***************
*** 113,119 ****
lib/striparens.c
lib/strmcpy.c
lib/strstr.c
- lib/strtokq.c
lib/safeopen.c
nls/C/C/C/s_aliases.m
nls/C/C/C/s_answer.m
--- 105,110 ----
***************
*** 299,305 ****
shared_libs/iconv/elmiconv.h
shared_libs/iconv/iconv.c
shared_libs/iconv/README.ME+
! lib/mailer.c
lib/MAGIC
hdrs/mailer_imp.h
utils/elmrc-write.c
--- 290,296 ----
shared_libs/iconv/elmiconv.h
shared_libs/iconv/iconv.c
shared_libs/iconv/README.ME+
! lib/mailer/mailer.c
lib/MAGIC
hdrs/mailer_imp.h
utils/elmrc-write.c
***************
*** 423,425 ****
--- 414,434 ----
lib/cancel.c
src/messages/canceled_mail.c
src/canceled.c
+ src/screen/subpage.c
+ src/screen/wrapper.c
+ src/screen/menu_param.c
+ src/screen/def_scommon.h
+ src/screen/scommon.c
+ src/screen/header.c
+ lib/cs_unknown.c
+ lib/cs_wfallback.c
+ charset/MAPPINGS/koi8-e.txt
+ lib/mailer/Makefile.SH
+ hdrs/mailerlib.h
+ lib/mailer/def_mailer.h
+ lib/mailer/shared_mailer.c
+ lib/mailer/init.c
+ lib/mailer/outheaders.c
+ lib/rc_delay.c
+ melib/mime_param.c
+ lib/write_rc.c
Index: elm2.4.ME+.122-cvs/melib/def_melib.h
*** elm2.4.ME+.121/melib/def_melib.h 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/melib/def_melib.h 2005-07-01 12:15:04.000000000 +0300
***************
*** 1,8 ****
! /* $Id: def_melib.h,v 1.3 2004/03/27 18:31:42 hurtta Exp $ */

#include "headers.h"
#include "melib.h"


/*
* Local Variables:
--- 1,37 ----
! /* $Id: def_melib.h,v 1.4 2005/07/01 09:15:04 hurtta Exp $ */

#include "headers.h"
#include "melib.h"

+ #define MIME_PARAM_magic 0xFC04
+
+ struct mime_param {
+ unsigned short magic; /* MIME_PARAM_magic */
+
+ struct mp_pair {
+ char *raw_param;
+ char *raw_value;
+ } * params;
+ int param_count;
+
+ charset_t def;
+
+ struct ascii_pair {
+ int is_compat;
+ char *param;
+ char *value;
+ } * ascii_params;
+ int ascii_param_count;
+
+ struct string_pair {
+ char *param;
+ struct string *value;
+
+ } * string_params;
+ int string_param_count;
+
+ };
+

/*
* Local Variables:
Index: elm2.4.ME+.122-cvs/melib/mailcap.c
*** elm2.4.ME+.121/melib/mailcap.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/melib/mailcap.c 2005-07-01 12:15:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.13 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.14 2005/07/01 09:15:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 1002,1008 ****


for (i = 0; i < len; i++) {

switch(subvector[i].type) {
int tmp,l,l2;
! CONST char *ma, *mi;
char *e;
char buffer[STRING];

--- 1002,1008 ----


for (i = 0; i < len; i++) {

switch(subvector[i].type) {
int tmp,l,l2;
! CONST char *ma, *mi, *pv;
char *e;
char buffer[STRING];

***************
*** 1071,1091 ****
retlen = tmp;
ret[retlen] = '\0';
break;
case mv_parameter:
!
! if (!mime_get_param(subvector[i].arg.arg,buffer,p->type_opts,sizeof buffer)) {
DPRINT(Debug,12,(&Debug,
"make_mailcap_arg: no param %s\n",
subvector[i].arg.arg));

goto fail;
}
! l = strlen(buffer);

tmp = retlen + l;
ret = safe_realloc(ret,tmp+1);

! memcpy(ret+retlen,buffer,l);
retlen = tmp;
ret[retlen] = '\0';
break;
--- 1071,1107 ----
retlen = tmp;
ret[retlen] = '\0';
break;
+
case mv_parameter:
! {
! int mp = give_dt_enumerate_as_int(&mime_parameters);
! CONST struct string *dv;
! CONST char * dva;
!
! /* 0 == plain
! 1 == encoded
! 2 == plain-and-encoded
! */
!
! if (mp)
! pv = get_mime_param_ascii(p->TYPE_opts,subvector[i].arg.arg);
! else
! pv = get_mime_param_compat(p->TYPE_opts,subvector[i].arg.arg);
! }
!
! if (!pv) {
DPRINT(Debug,12,(&Debug,
"make_mailcap_arg: no param %s\n",
subvector[i].arg.arg));

goto fail;
}
! l = strlen(pv);

tmp = retlen + l;
ret = safe_realloc(ret,tmp+1);

! memcpy(ret+retlen,pv,l);
retlen = tmp;
ret[retlen] = '\0';
break;
Index: elm2.4.ME+.122-cvs/melib/Makefile.SH
*** elm2.4.ME+.121/melib/Makefile.SH 2003-10-12 12:48:03.000000000 +0300
--- elm2.4.ME+.122-cvs/melib/Makefile.SH 2005-07-01 12:15:04.000000000 +0300
***************
*** 16,22 ****
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17 2003/10/01 17:34:34 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
--- 16,22 ----
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.18 2005/07/01 09:15:04 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
***************
*** 47,52 ****
--- 47,53 ----
mailcap.c \
mime.c \
mime_decode.c \
+ mime_param.c \
mime_parse.c \
mime_selector.c \
mparser.c \
***************
*** 61,66 ****
--- 62,68 ----
mailcap.o \
mime.o \
mime_decode.o \
+ mime_param.o \
mime_parse.o \
mime_selector.o \
mparser.o \
***************
*** 118,124 ****


# Dependencies of C object files

pgp_decode.o: def_melib.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
parse_util.o: def_melib.h $(INCLDIR)/s_me.h
! mailcap.o: def_melib.h $(INCLDIR)/melib.h
mime_parse.o: def_melib.h $(INCLDIR)/s_me.h
mime_decode.o: def_melib.h $(INCLDIR)/s_me.h
mime_selector.o: def_melib.h $(INCLDIR)/s_me.h
--- 120,127 ----


# Dependencies of C object files

pgp_decode.o: def_melib.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
parse_util.o: def_melib.h $(INCLDIR)/s_me.h
! mailcap.o: def_melib.h
! mime_param.o: def_melib.h $(INCLDIR)/s_me.h
mime_parse.o: def_melib.h $(INCLDIR)/s_me.h
mime_decode.o: def_melib.h $(INCLDIR)/s_me.h
mime_selector.o: def_melib.h $(INCLDIR)/s_me.h
Index: elm2.4.ME+.122-cvs/melib/mime_decode.c
*** elm2.4.ME+.121/melib/mime_decode.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/melib/mime_decode.c 2005-07-06 00:26:24.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.67 2004/07/27 20:25:02 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.72 2005/07/05 21:26:24 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.72 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 210,220 ****
s_out->prefix ? s_out->prefix : "<NULL>",
astext));

! len = state_getl (buffer, sizeof buffer, s_in);

! if (len > 0)
! bytes += len;

if (len < 6 || strncmp(buffer,"begin ",6) != 0) {
DPRINT(Debug,10,(&Debug,
"uudecode: 'begin' was expected\n"));
--- 210,227 ----
s_out->prefix ? s_out->prefix : "<NULL>",
astext));

! do {
! len = state_getl (buffer, sizeof buffer, s_in);

! if (len > 0)
! bytes += len;
!
! if (bytes >= length)
! break;

+ } while (len == 1 && 0 == strcmp(buffer,"\n") ||
+ len == 2 && 0 == strcmp(buffer,"\r\n"));
+
if (len < 6 || strncmp(buffer,"begin ",6) != 0) {
DPRINT(Debug,10,(&Debug,
"uudecode: 'begin' was expected\n"));
***************
*** 368,373 ****
--- 375,387 ----

return;
}
+
+ static unsigned char * us_str P_((char *str));
+ static unsigned char * us_str(str)
+ char *str;
+ {
+ return (unsigned char *)str;
+ }

void quoted_printable_decode (s_in, s_out, length, astext)
in_state_t *s_in;
***************
*** 377,383 ****
{
int bytes = 0; /* number of bytes read */
int nl = TRUE; /* flag to indicate hitting a new line */
! char *p;
int c1, c2;
unsigned char ch, store_ch = 0;
char buf[VERY_LONG_STRING];
--- 391,397 ----
{
int bytes = 0; /* number of bytes read */
int nl = TRUE; /* flag to indicate hitting a new line */
! unsigned char *p;
int c1, c2;
unsigned char ch, store_ch = 0;
char buf[VERY_LONG_STRING];
***************
*** 399,405 ****
break;
bytes += len;

! p = buf;
while (*p) {

/* If there is a prefix and this is the beginning of a new
--- 413,419 ----
break;
bytes += len;

! p = us_str(buf);
while (*p) {

/* If there is a prefix and this is the beginning of a new
***************
*** 418,424 ****
p++;
/* Ignore spaces in end of line -- see MIME */
if (*p == '\r' || *p == ' ' || *p == '\t') {
! char *t = p;
while (*t && (*t == '\r' || *t == ' ' || *t == '\t'))
t++;
if (*t && *t == '\n')
--- 432,438 ----
p++;
/* Ignore spaces in end of line -- see MIME */
if (*p == '\r' || *p == ' ' || *p == '\t') {
! unsigned char *t = p;
while (*t && (*t == '\r' || *t == ' ' || *t == '\t'))
t++;
if (*t && *t == '\n')
***************
*** 426,432 ****
}

if (*p == '\n') { /* soft linebreak */
! if (p >= buf +len)
break;
p++;
} else {
--- 440,446 ----
}

if (*p == '\n') { /* soft linebreak */
! if (p >= us_str(buf) +len)
break;
p++;
} else {
***************
*** 463,469 ****
if (*p == '\n') {
nl = TRUE;
}
! if (p >= buf +len)
break;
p++;
}
--- 477,483 ----
if (*p == '\n') {
nl = TRUE;
}
! if (p >= us_str(buf) +len)
break;
p++;
}
***************
*** 504,510 ****
mime_t *sign;
in_state_t *state_in;
out_state_t *state_out;
! char *micalg;
charset_t defcharset;
struct header_rec *mss;
{
--- 518,524 ----
mime_t *sign;
in_state_t *state_in;
out_state_t *state_out;
! const char *micalg;
charset_t defcharset;
struct header_rec *mss;
{
***************
*** 557,565 ****
}


! static SG_decoder_t select_SG_decoder P_((char *protocol));
static SG_decoder_t select_SG_decoder(protocol)
! char *protocol;
{
#ifdef USE_PGP
if (0 == istrcmp(protocol,"application/pgp-signature")) {
--- 571,579 ----
}


! static SG_decoder_t select_SG_decoder P_((const char *protocol));
static SG_decoder_t select_SG_decoder(protocol)
! CONST char *protocol;
{
#ifdef USE_PGP
if (0 == istrcmp(protocol,"application/pgp-signature")) {
***************
*** 599,622 ****

) {

! char protocol[100];
SG_decoder_t sg_decode;
!
!

! if (!mime_get_param ("protocol", protocol, p->type_opts,
! sizeof protocol)) {
DPRINT(Debug,11,(&Debug,
! "signed_selector(%p) -- type: %p=%s/%s, flags=%d -- no 'protocol'\n",
! p,
! p->TYPE,
! get_major_type_name(p->TYPE),
! get_subtype_name(p->TYPE),
! get_type_flags(p->TYPE)));
flags |= NOTPLAIN_need_metamail;
goto done;
}
! sg_decode = select_SG_decoder(protocol);


if (MIME_selector_magic != p->handler_data->magic)
--- 613,635 ----

) {

! CONST char *pv;
SG_decoder_t sg_decode;
!
! pv = get_mime_param_compat(p->TYPE_opts,"protocol");

! if (! pv) {
DPRINT(Debug,11,(&Debug,
! "signed_selector(%p) -- type: %p=%s/%s, flags=%d -- no 'protocol'\n",
! p,
! p->TYPE,
! get_major_type_name(p->TYPE),
! get_subtype_name(p->TYPE),
! get_type_flags(p->TYPE)));
flags |= NOTPLAIN_need_metamail;
goto done;
}
! sg_decode = select_SG_decoder(pv);


if (MIME_selector_magic != p->handler_data->magic)
***************
*** 636,642 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));
goto done;
} else if (pagesigned) {
DPRINT(Debug,9,(&Debug,
--- 649,655 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));
goto done;
} else if (pagesigned) {
DPRINT(Debug,9,(&Debug,
***************
*** 646,652 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));
goto done;
}

--- 659,665 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));
goto done;
}

***************
*** 658,664 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));
flags |= NOTPLAIN_need_metamail;
}
else
--- 671,677 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));
flags |= NOTPLAIN_need_metamail;
}
else
***************
*** 682,689 ****
charset_t defcharset;
struct header_rec *mss;
{
! char protocol[100];
! char micalg[100];
SG_decoder_t decode;



if (ptr->magic != MIME_magic)

--- 695,702 ----
charset_t defcharset;
struct header_rec *mss;
{
! CONST char *pv;
! CONST char *micalg;
SG_decoder_t decode;



if (ptr->magic != MIME_magic)

***************
*** 726,749 ****
return;
}

! if (!mime_get_param ("protocol", protocol, ptr->type_opts,
! sizeof protocol)) {


/* state_nlputs or state_printf is needed for EOLN_is_CRLF

conversions */

state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeNoProtocol,
! "'protocol' paramater is missing from Multipart/Signed -type!"));
state_nlputs(" ]\n",state_out);
lib_error(CATGETS(elm_msg_cat, MeSet, MeDecodeNoProtocol,
! "'protocol' paramater is missing from Multipart/Signed -type!"));
return;
}

! if (!mime_get_param ("micalg", micalg, ptr->type_opts,
! sizeof micalg)) {
! micalg[0] = '\0';
}

if (MIME_selector_magic != ptr->handler_data->magic)
--- 739,764 ----
return;
}

! pv = get_mime_param_compat(ptr->TYPE_opts,"protocol");
!
! if (!pv) {


/* state_nlputs or state_printf is needed for EOLN_is_CRLF

conversions */

state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeNoProtocol,
! "'protocol' parameter is missing from Multipart/Signed -type!"));
state_nlputs(" ]\n",state_out);
lib_error(CATGETS(elm_msg_cat, MeSet, MeDecodeNoProtocol,
! "'protocol' parameter is missing from Multipart/Signed -type!"));
return;
}

! micalg = get_mime_param_compat(ptr->TYPE_opts,"micalg");
!
! if (!micalg) {
! micalg = "";
}

if (MIME_selector_magic != ptr->handler_data->magic)
***************
*** 759,767 ****
}


! static EC_decoder_t select_EC_decoder P_((char *protocol));
static EC_decoder_t select_EC_decoder(protocol)
! char *protocol;
{
#ifdef USE_PGP
if (0 == istrcmp(protocol,"application/pgp-encrypted")) {
--- 774,782 ----
}


! static EC_decoder_t select_EC_decoder P_((const char *protocol));
static EC_decoder_t select_EC_decoder(protocol)
! CONST char *protocol;
{
#ifdef USE_PGP
if (0 == istrcmp(protocol,"application/pgp-encrypted")) {
***************
*** 793,802 ****
if (p->parser_data &&
mime_parser_subparts(p->parser_data) > 0) {
EC_decoder_t ec_decode;
! char protocol[100];

! if (!mime_get_param ("protocol", protocol, p->type_opts,
! sizeof protocol)) {
DPRINT(Debug,11,(&Debug,
"encrypted_selector(%p) -- type: %p=%s/%s, flags=%d -- no 'protocol'\n",
p,
--- 808,818 ----
if (p->parser_data &&
mime_parser_subparts(p->parser_data) > 0) {
EC_decoder_t ec_decode;
! CONST char *pv;
!
! pv = get_mime_param_compat(p->TYPE_opts,"protocol");

! if (!pv) {
DPRINT(Debug,11,(&Debug,
"encrypted_selector(%p) -- type: %p=%s/%s, flags=%d -- no 'protocol'\n",
p,
***************
*** 807,813 ****
flags |= NOTPLAIN_need_metamail;
goto out;
}
! ec_decode = select_EC_decoder(protocol);

if (MIME_selector_magic != p->handler_data->magic)
mime_panic(__FILE__,__LINE__,"encrypted_selector",
--- 823,829 ----
flags |= NOTPLAIN_need_metamail;
goto out;
}
! ec_decode = select_EC_decoder(pv);

if (MIME_selector_magic != p->handler_data->magic)
mime_panic(__FILE__,__LINE__,"encrypted_selector",
***************
*** 824,830 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));

/* TODO: We really not know on here can be show contents
because we must decode it first to see ....
--- 840,846 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));

/* TODO: We really not know on here can be show contents
because we must decode it first to see ....
***************
*** 842,848 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));
flags |= NOTPLAIN_need_metamail;
} else
flags |= NOTPLAIN_need_metamail;
--- 858,864 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));
flags |= NOTPLAIN_need_metamail;
} else
flags |= NOTPLAIN_need_metamail;
***************
*** 864,870 ****
charset_t defcharset;
struct header_rec *mss;
{
! char protocol[100];
EC_decoder_t decode;



if (ptr->magic != MIME_magic)

--- 880,886 ----
charset_t defcharset;
struct header_rec *mss;
{
! CONST char *pv;
EC_decoder_t decode;



if (ptr->magic != MIME_magic)

***************
*** 904,911 ****
return;
}

! if (!mime_get_param ("protocol", protocol, ptr->type_opts,
! sizeof protocol)) {


/* state_nlputs or state_printf is needed for EOLN_is_CRLF

conversions */

--- 920,928 ----
return;
}

! pv = get_mime_param_compat(ptr->TYPE_opts,"protocol");
!
! if (!pv) {


/* state_nlputs or state_printf is needed for EOLN_is_CRLF

conversions */

***************
*** 1046,1051 ****
--- 1063,1069 ----

if (best) {

+
if (best->magic != MIME_magic)
mime_panic(__FILE__,__LINE__,"alternative_decode",
"Bad magic number (selected alternative)");
***************
*** 1088,1110 ****
}

tmp[0] = '\0';
! if (best->description) {
state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescA,
"\"%.60S\" ]\n"),
best->description);
state_puts("[ ",state_out);
! } else if (best->disposition_opts &&
! mime_get_param ("filename", tmp,
! best->disposition_opts,
! sizeof(tmp))) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
! MeDecodeDescFilenameA,
! "Filename: %.60s ]\n"),
! tmp);
! state_puts("[ ",state_out);
! }
!
Encoding = ENCODING(best->encoding);



/* state_nlputs or state_printf is needed for EOLN_is_CRLF

--- 1106,1149 ----
}

tmp[0] = '\0';
! if (best->description &&
! string_len(best->description) > 0) {
state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescA,
"\"%.60S\" ]\n"),
best->description);
state_puts("[ ",state_out);
! } else {
!
! int mp = give_dt_enumerate_as_int(&mime_parameters);
! CONST struct string *dv;
! CONST char * dva;
!
! /* 0 == plain
! 1 == encoded
! 2 == plain-and-encoded
! */
!
!
!
! if (mp &&
! (dv = get_mime_param(best->DISPOSITION_opts,"filename"))
! ) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
! MeDecodeDescFilenameA,
! "Filename: %.60S ]\n"),
! dv);
! state_puts("[ ",state_out);
! } else if ((dva = get_mime_param_compat(best->DISPOSITION_opts,
! "filename"))) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
! MeDecodeDescFilenameA1,
! "Filename: %.60s ]\n"),
! dva);
! state_puts("[ ",state_out);
! }
! }
!
Encoding = ENCODING(best->encoding);



/* state_nlputs or state_printf is needed for EOLN_is_CRLF

***************
*** 1272,1277 ****
--- 1311,1318 ----
mime_t *att = mime_parser_index(ptr->parser_data,i);
CONST int nattach = i+1;

+ CONST struct string *dv;
+
if (att->magic != MIME_magic)
mime_panic(__FILE__,__LINE__,"multipart_decode_0",
"Bad magic number (subpart)");
***************
*** 1321,1342 ****
}

tmp[0] = '\0';
! if (att->description) {
state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescA,
"\"%.60S\" ]\n"),
att->description);
state_puts("[ ",state_out);
! } else if (att->disposition_opts &&
! mime_get_param ("filename", tmp, att->disposition_opts,
! sizeof(tmp))) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescFilenameA,
! "Filename: %.60s ]\n"),
! tmp);
! state_puts("[ ",state_out);
! }
!
Encoding = ENCODING(att->encoding);



/* state_nlputs or state_printf is needed for EOLN_is_CRLF

--- 1362,1404 ----
}

tmp[0] = '\0';
! if (att->description &&
! string_len(att->description) > 0) {
state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescA,
"\"%.60S\" ]\n"),
att->description);
state_puts("[ ",state_out);
! } else {
!
! int mp = give_dt_enumerate_as_int(&mime_parameters);
! CONST struct string *dv;
! CONST char * dva;
!
! /* 0 == plain
! 1 == encoded
! 2 == plain-and-encoded
! */
!
! if (mp &&
! (dv = get_mime_param(att->DISPOSITION_opts,
! "filename"))
! ) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescFilenameA,
! "Filename: %.60S ]\n"),
! dv);
! state_puts("[ ",state_out);
! } else if ((dva = get_mime_param_compat(att->DISPOSITION_opts,
! "filename"))) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
! MeDecodeDescFilenameA1,
! "Filename: %.60s ]\n"),
! dva);
! state_puts("[ ",state_out);
! }
! }
!
Encoding = ENCODING(att->encoding);



/* state_nlputs or state_printf is needed for EOLN_is_CRLF

***************
*** 1734,1740 ****
state -> filter = NULL; /* So that messages can be printed .. */


! code = mime_get_charset (&tmp, ptr->type_opts,
state->display_charset,
default_content_charset
);
--- 1796,1802 ----
state -> filter = NULL; /* So that messages can be printed .. */


! code = mime_get_charset (&tmp, ptr->TYPE_opts,
state->display_charset,
default_content_charset
);
***************
*** 1867,1873 ****
disp_vector[0] = display_charset;
disp_vector[1] = NULL;

! if ((r=mime_get_charset(&buf1,p->type_opts,disp_vector,NULL)) > 0) {
DPRINT(Debug,11,(&Debug,
"text_selector(%p) -- type: %p=%s/%s; charset=%s\n",
p,
--- 1929,1935 ----
disp_vector[0] = display_charset;
disp_vector[1] = NULL;

! if ((r=mime_get_charset(&buf1,p->TYPE_opts,disp_vector,NULL)) > 0) {
DPRINT(Debug,11,(&Debug,
"text_selector(%p) -- type: %p=%s/%s; charset=%s\n",
p,
***************
*** 1982,1988 ****
{
FILE * tmpfp = NULL;
char *fname = NULL;
!
DPRINT(Debug,11,(&Debug,
"arrange_binary -> state: offset=%ld, length=%ld \n",


(long) ptr -> offset, (long) ptr -> length));

--- 2044,2051 ----
{
FILE * tmpfp = NULL;
char *fname = NULL;
! char *tmp;
!
DPRINT(Debug,11,(&Debug,
"arrange_binary -> state: offset=%ld, length=%ld \n",


(long) ptr -> offset, (long) ptr -> length));

***************
*** 1997,2004 ****
in_state_ftell(state_in)));
}

fname = elm_message(FRM("%selmdecode-%d"),

! temp_dir, getpid ());
if (NULL == (tmpfp = safeopen_rdwr(fname))) {

/* state_nlputs or state_printf is needed for EOLN_is_CRLF

conversions */
--- 2060,2071 ----
in_state_ftell(state_in)));

}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ return NULL;
+
fname = elm_message(FRM("%selmdecode-%d"),

! tmp, getpid ());
if (NULL == (tmpfp = safeopen_rdwr(fname))) {

/* state_nlputs or state_printf is needed for EOLN_is_CRLF

conversions */
***************
*** 2070,2076 ****
int result = 1;
char *fname = NULL;
out_state_t newstate;
!
out_state_clear(&newstate,STATE_out_file);

DPRINT(Debug,11,(&Debug,
--- 2137,2144 ----
int result = 1;
char *fname = NULL;
out_state_t newstate;
! char *tmp;
!
out_state_clear(&newstate,STATE_out_file);

DPRINT(Debug,11,(&Debug,
***************
*** 2087,2094 ****
in_state_ftell(state_in)));
}

fname = elm_message(FRM("%selmdecode.%d"),

! temp_dir, getpid ());
if (NULL == (tmpfp = safeopen_rdwr(fname))) {

/* state_nlputs or state_printf is needed for EOLN_is_CRLF

conversions */
--- 2155,2166 ----
in_state_ftell(state_in)));

}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ return NULL;
+
fname = elm_message(FRM("%selmdecode.%d"),

! tmp, getpid ());
if (NULL == (tmpfp = safeopen_rdwr(fname))) {

/* state_nlputs or state_printf is needed for EOLN_is_CRLF

conversions */
Index: elm2.4.ME+.122-cvs/melib/mime_param.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/melib/mime_param.c 2005-07-06 12:41:48.000000000 +0300
***************
*** 0 ****
--- 1,2429 ----
+ static char rcsid[] = "@(#)$Id: mime_param.c,v 1.11 2005/07/06 09:41:48 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ * or Kari Hurtta <e...@elmme-mailer.org>
+ *****************************************************************************/
+

+ #include "def_melib.h"
+

+ #include "s_me.h"
+
+

+ DEBUG_VAR(Debug,__FILE__,"mime");
+
+
+ static void free_parsed P_((struct mime_param *P));
+ static void free_parsed(P)
+ struct mime_param *P;
+ {
+ if (P->ascii_params) {
+ int i;
+
+ for (i = 0; i < P->ascii_param_count; i++) {
+ if (P->ascii_params[i].param) {
+ free(P->ascii_params[i].param);
+ P->ascii_params[i].param = NULL;
+ }
+
+ if (P->ascii_params[i].value) {
+ free(P->ascii_params[i].value);
+ P->ascii_params[i].value = NULL;
+ }
+ }
+
+ free(P->ascii_params);
+ P->ascii_params = NULL;
+ }
+ P->ascii_param_count =0;
+
+ if (P->string_params) {
+ int i;
+
+ for (i = 0; i < P->string_param_count; i++) {
+ if (P->string_params[i].param) {
+ free(P->string_params[i].param);
+ P->string_params[i].param = NULL;
+ }
+
+ if (P->string_params[i].value) {
+ free_string(& (P->string_params[i].value));
+ }
+ }
+
+ free(P->string_params);
+ P->string_params = NULL;
+ }
+ P->string_param_count =0;
+ }
+
+ static void free_raw P_((struct mime_param *P));
+ static void free_raw(P)
+ struct mime_param *P;
+ {
+ if (P->params) {
+ int i;
+
+ for (i = 0; i < P->param_count; i++) {
+ if (P->params[i].raw_param) {
+ free(P->params[i].raw_param);
+ P->params[i].raw_param = NULL;
+ }
+
+ if (P->params[i].raw_value) {
+ free(P->params[i].raw_value);
+ P->params[i].raw_value = NULL;
+ }
+ }
+
+ free(P->params);
+ P->params = NULL;
+ }
+ P->param_count =0;
+ }
+
+ void free_mime_param(x)
+ struct mime_param **x;
+ {
+ struct mime_param *P = *x;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"free_mime_param",
+ "Bad magic number");
+
+ free_raw(P);
+ free_parsed(P);
+
+
+ free(P);
+ P = NULL;
+
+ *x = P;
+ }
+
+ static struct mime_param * alloc_mime_param P_((void));
+ static struct mime_param * alloc_mime_param()
+ {
+ struct mime_param *P = safe_malloc(sizeof (*P));
+
+ bzero((void *)P, sizeof (*P));
+
+ P->magic = MIME_PARAM_magic;
+
+ P->params = NULL;
+ P->param_count = 0;
+
+ P->def = NULL;
+
+
+ P->ascii_params = NULL;
+ P->ascii_param_count = 0;
+
+ P->string_params = NULL;
+ P->string_param_count = 0;
+
+ return P;
+ }
+
+ struct mime_param * copy_mime_param(src)
+ struct mime_param *src;
+ {
+ struct mime_param *P = alloc_mime_param();
+
+ P->def = src->def;
+
+
+ if (src->params) {
+ int i;
+
+ P->params = safe_malloc(src->param_count * sizeof (P->params[0]));
+
+ for (i = 0; i < src->param_count; i++) {
+ if (src->params[i].raw_param)
+ P->params[i].raw_param = safe_strdup(src->params[i].raw_param);
+ if (src->params[i].raw_value)
+ P->params[i].raw_value = safe_strdup(src->params[i].raw_value);
+ }
+ P->param_count = src->param_count;
+ }
+
+
+ /* These params are rebuild from raw params */
+
+ P->ascii_params = NULL;
+ P->ascii_param_count = 0;
+
+ P->string_params = NULL;
+ P->string_param_count = 0;
+
+ return P;
+ }
+
+ static struct ascii_pair * add_ascii_pair_1 P_((struct ascii_pair **list, int *len));
+ static struct ascii_pair * add_ascii_pair_1(list,len)
+ struct ascii_pair **list;
+ int *len;
+ {
+ struct ascii_pair * ascii_params = *list;
+ int ascii_param_count = *len;
+ struct ascii_pair * ret = NULL;
+
+ ascii_params = safe_realloc(ascii_params,
+ (ascii_param_count+1) *
+ sizeof(ascii_params[0]));
+
+ bzero((void *)& (ascii_params[ascii_param_count]),
+ sizeof ((ascii_params[ascii_param_count])));
+
+ ascii_params[ascii_param_count].is_compat = 0;
+ ascii_params[ascii_param_count].param = NULL;
+ ascii_params[ascii_param_count].value = NULL;
+
+ ret = (&(ascii_params[ascii_param_count++]));
+
+ *list = ascii_params;
+ *len = ascii_param_count;


+
+ return ret;
+ }
+

+ static struct ascii_pair * add_ascii_pair P_((struct mime_param *P));
+ static struct ascii_pair * add_ascii_pair(P)
+ struct mime_param *P;
+ {
+ return add_ascii_pair_1( & (P->ascii_params),
+ & (P->ascii_param_count) );
+
+ }
+
+ static struct string_pair * add_string_pair_1 P_((struct string_pair **list,
+ int *len));
+ static struct string_pair * add_string_pair_1(list,len)
+ struct string_pair **list;
+ int *len;
+ {
+ struct string_pair *ret;
+ struct string_pair * string_params = *list;
+ int string_param_count = *len;
+
+ string_params = safe_realloc(string_params,
+ (string_param_count +1) *
+ sizeof(string_params[0]));
+
+ bzero((void *)& (string_params[string_param_count]),
+ sizeof ((string_params[string_param_count])));
+
+ string_params[string_param_count].param = NULL;
+ string_params[string_param_count].value = NULL;
+
+ ret = (&(string_params[string_param_count++]));
+
+ *list = string_params;
+ *len = string_param_count;


+
+ return ret;
+ }
+

+ static struct string_pair * add_string_pair P_((struct mime_param *P));
+ static struct string_pair * add_string_pair(P)
+ struct mime_param *P;
+ {
+ return add_string_pair_1 (& (P->string_params),
+ & (P->string_param_count));
+
+ }
+
+ static struct mp_pair * add_mp_pair_1 P_((struct mp_pair **list, int *len));
+ static struct mp_pair * add_mp_pair_1(list,len)
+ struct mp_pair **list;
+ int *len;
+ {
+ struct mp_pair *params = *list;
+ int param_count = *len;
+ struct mp_pair *ret = NULL;
+
+ params = safe_realloc(params,
+ (param_count +1) * sizeof (params[0]));
+
+ bzero ((void *) &(params[param_count]), sizeof (params[param_count]));
+
+ params[param_count].raw_param = NULL;
+ params[param_count].raw_value = NULL;
+
+ ret = (& (params[ param_count++]));
+
+ *list = params;
+ *len = param_count;


+
+ return ret;
+ }

+
+ static unsigned char * us_str P_((char *str));
+ static unsigned char * us_str(str)
+ char *str;
+ {
+ return (unsigned char *)str;
+ }
+
+ static struct mp_pair * add_mp_pair P_((struct mime_param *P));
+ static struct mp_pair * add_mp_pair(P)
+ struct mime_param *P;
+ {
+ return add_mp_pair_1(& (P->params), &(P->param_count));
+ }
+
+ static int append_encoded P_((struct string *buffer,char *value));
+ static int append_encoded(buffer,value)
+ struct string *buffer;
+ char *value;
+ {
+ unsigned char *p;
+
+ for (p = us_str(value); *p; p++) {
+ if ('\'' == *p || '"' == *p) {
+ DPRINT(Debug,9,(&Debug,
+ "append_encoded: bad character %c, value=%s\n",
+ *p,value));
+
+ return 0;
+ }
+
+ if ('%' == *p) {
+ int v1, v2;
+ unsigned char v;
+
+ p++;
+ if (! *p) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: short %% sequence, value=%s\n",
+ value));
+
+ return 0;
+ }
+ v1 = hex(*p);
+
+
+ p++;
+ if (! *p) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: short %% sequence, value=%s\n",
+ value));


+ return 0;
+ }
+

+ v2 = hex(*p);
+
+ if (v1 < 0 || v2 < 0) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: bad %% sequence, value=%s\n",
+ value));

+ return 0;
+ }
+

+ v = ( v1 << 4) | v2;
+
+ if (! add_streambyte_to_string(buffer,v)) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: bad character %%%02x, value=%s\n",
+ v,value));
+
+ return 0;
+ }
+
+ } else {
+ if (! add_streambyte_to_string(buffer,(unsigned char)*p)) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: bad character %c, value=%s\n",
+ *p,value));
+ return 0;
+ }
+ }
+ }
+
+ return 1;
+ }
+
+ static struct string * parse_encoded_first P_((char *value));
+ static struct string * parse_encoded_first(value)
+ char *value;
+ {
+ struct string *ret = NULL;
+ int l = strlen(value);
+ char * buffer = safe_malloc(l+1);
+ char * lang = NULL;
+ char * cs = NULL;
+ charset_t cs1 = NULL;


+
+ int count = 0;
+

+ char *p1,*p2;
+
+ /* character set */
+ cs = buffer;
+
+ for (p1 = value, p2 =buffer;
+ *p1 && '\'' != *p1 && p2 <= buffer + l;
+ p1++) {
+
+ *p2++ = *p1;
+ }
+ *p2 = '\0';
+
+ if ('\'' != *p1) {
+ DPRINT(Debug,9,(&Debug, "parse_encoded_first: Missing ': %s\n",value));
+ goto fail;
+ }
+ p1++;
+
+ if (p2 == cs)
+ cs = NULL;
+
+ /* language */
+ p2++;
+ lang = p2;
+
+ for (;
+ *p1 && '\'' != *p1 && p2 <= buffer + l;
+ p1++) {
+
+ *p2++ = *p1;
+ }
+ *p2 = '\0';
+
+ if ('\'' != *p1) {
+ DPRINT(Debug,9,(&Debug, "parse_encoded_first: Missing second ': %s\n",
+ value));
+ goto fail;
+ }
+ p1++;
+
+
+ if (p2 == lang)
+ lang = NULL;
+
+ if (cs) {
+ DPRINT(Debug,9,(&Debug, "parse_encoded_first: cs=%s\n",cs));
+ cs1 = MIME_name_to_charset(cs,CHARSET_create);
+ } else
+ cs1 = RAW_BUFFER; /* charset is not relevant to parameter value! */
+
+
+ if (lang) {
+ DPRINT(Debug,9,(&Debug, "parse_encoded_first: lang=%s\n",lang));
+ ret = new_langstring(cs1,lang);
+ } else
+ ret = new_string(cs1);
+
+ if (!append_encoded(ret,p1)) {
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_encoded_first: parse error .. ignoring result\n"));
+ free_string(&ret);
+ }
+
+ fail:
+ free(buffer);


+
+ return ret;
+ }
+
+

+ #define MAX_POSITIONAL 100
+
+ static void parse_raw_params P_((struct mime_param *P));
+ static void parse_raw_params(P)
+ struct mime_param *P;
+ {
+ struct positional_params {
+ char *name;
+ int bad;
+
+ struct loc_pos {
+ int is_new;
+ int loc;
+ } *locations ;
+ int location_count;
+ } * positional = NULL;
+ int positional_count = 0;
+
+ free_parsed(P);
+
+ /* Pass 1 look item 0 on parameters */
+
+ if (P->params) {
+ int i;
+
+ for (i = 0; i < P->param_count; i++) {
+ char * name = P->params[i].raw_param;
+ char * p;
+
+ if (!name)
+ continue;
+ if (!name[0]) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: parameter without name\n",
+ i));


+ continue;
+ }
+
+

+ for (p = name; *p; p++) {
+ if ('*' == *p)
+ break;
+ }
+
+ if ('\0' == *p) {
+ char *x;
+
+ /* compat parameter */
+
+ /* Check for 8-bit */
+
+ if (! P->params[i].raw_value) {
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: compat parameter without value\n",
+ i,name));
+
+
+ continue;
+ }
+
+ for (x = P->params[i].raw_value; *x; x++) {
+ if (0 != (*x & 0x80))
+ break;
+ }
+
+ if ('\0' == *x) {
+ /* Ascii value -- really compat */
+
+ struct ascii_pair * A = add_ascii_pair(P);
+ int l = x - P->params[i].raw_value;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,name,P->params[i].raw_value));
+
+ A->is_compat = 1;
+
+ A->param = safe_strdup(name);
+
+ A->value = dequote_opt(P->params[i].raw_value,l);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [compat] %s=%s\n",
+ A->param,
+ A->value));
+
+ } else {
+
+ struct string_pair * S = add_string_pair(P);
+ char * val;
+ int l;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: 8-bit data on compat parameter\n",
+ i,name));
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,name,P->params[i].raw_value));
+
+ if (! P->def ) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: NO DEFAULT CHARSET -- parameter ignored\n"));
+ continue;
+ }
+
+ S->param = safe_strdup(name);
+
+ while (*x)
+ x++;
+ l = x - P->params[i].raw_value;
+
+ val = dequote_opt(P->params[i].raw_value,l);
+
+ S->value = new_string2(P->def,us_str(val));
+
+ free(val);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [8-bit] %s=%S\n",
+ S->param,
+ S->value));
+
+ }
+
+
+ } else {
+
+ int is_new = 0;
+ int is_partial = 0;
+ int index = 0;
+ int l = p - name;
+ char * name1 = safe_malloc(l+1);
+
+ strncpy(name1,name,l);
+ name1[l] = '\0';
+
+ p++;
+ if ('\0' == *p ) {
+ /* '*' was last character on name */
+
+ is_new = 1;
+
+ } else if (*p >= '0' && *p <= '9') {
+ char *end = NULL;
+ long x;
+ is_partial = 1;
+
+ x= strtol(p,&end,10);
+
+ if (x > MAX_POSITIONAL) {
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s postion value %ld is too big (max %d)\n",
+ i,name,name1,x,
+ MAX_POSITIONAL));
+
+ goto fail1;
+ }
+ index = x;
+
+ if ('\0' != *end &&
+ '*' != *end) {
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s after position value %ld there is garbage: %s\n",
+ i,name,name1,x,end));
+

+ goto fail1;
+
+ }
+

+ p = end;
+ }
+
+ if ('*' == *p) {
+ is_new = 1;
+
+ p++;
+ }
+
+ if (*p) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s there is garbage after '*': %s\n",
+ i,name,name1,p));


+ goto fail1;
+ }
+

+ if (is_partial) {
+
+ int x;
+
+ for (x = 0; x < positional_count; x++) {
+ if (0 == istrcmp(name1,positional[x].name))
+ break;
+ }
+
+ if (x >= positional_count) {
+ positional = safe_realloc(positional,
+ (x+1) * sizeof(positional[0]));
+ positional[x].name = name1; name1 = NULL;
+ positional[x].bad = 0;
+
+ positional[x].locations = NULL;
+ positional[x].location_count = 0;
+ positional_count = x+1;
+ }
+
+ if (index >= positional[x].location_count) {
+ int y;
+
+ positional[x].locations = safe_realloc(positional[x].locations,
+ (index+1) *
+ sizeof(positional[x].locations[0]));
+ for (y = positional[x].location_count; y <= index; y++) {
+ positional[x].locations[y].is_new = 0;
+ positional[x].locations[y].loc = -1;
+ }
+ positional[x].location_count = index+1;
+ }
+
+ if (index < 0) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s position value %ld is negative\n",
+ i,name,positional[x].name,index));
+ positional[x].bad = 1;


+ goto fail1;
+ }
+

+ if (positional[x].locations[index].loc != -1) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s position value %ld is duplicate\n",
+ i,name,positional[x].name,index));
+ positional[x].bad = 1;


+ goto fail1;
+
+ }
+

+ positional[x].locations[index].loc = i;
+ positional[x].locations[index].is_new = is_new;
+
+ } else {
+ /* Not a partial value */
+ char *value = P->params[i].raw_value;
+ struct string * X;
+ struct string_pair * S;
+
+ if (!is_new)
+ mime_panic(__FILE__,__LINE__,"parse_raw_params",
+ "compat parameters should be handled already");
+
+ if (! value) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: parameter %s without value\n",
+ i,name,name1));
+

+ goto fail1;
+ }
+

+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,name,P->params[i].raw_value));
+
+ X = parse_encoded_first(value);
+
+ if (!X) {


+ goto fail1;
+ }
+

+ S = add_string_pair(P);
+ S->param = name1; name1 = NULL;
+ S->value = X;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [string] %s=%S\n",
+ S->param,
+ S->value));
+
+ }
+
+ fail1:
+ if (name1)
+ free(name1);


+
+ }
+ }
+ }
+

+ /* Pass 2 look positional arguments */
+
+ if (positional) {
+ int x;
+
+ for (x = 0; x < positional_count; x++) {
+ int y;
+ int new_seen = 0;
+
+ for (y = 0; y < positional[x].location_count; y++) {
+
+ if (positional[x].locations[y].loc == -1) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: On paramater %s position value %d is missing\n",
+ positional[x].name,y));
+ positional[x].bad = 1;
+ break;
+ }
+
+ if (positional[x].locations[y].loc < 0 ||
+ positional[x].locations[y].loc >= P->param_count)
+ mime_panic(__FILE__,__LINE__,"parse_raw_params",
+ "Bad location index");
+
+ new_seen |= positional[x].locations[0].is_new;
+ }
+
+ if (positional[x].location_count < 1)
+ mime_panic(__FILE__,__LINE__,"parse_raw_params",
+ "Inbossible location count");
+
+ if (positional[x].bad)
+ continue;
+
+ if (new_seen) {
+ struct string_pair * S = NULL;
+
+ /* Handle first parameter */
+
+ if (positional[x].locations[0].is_new) {
+ int i = positional[x].locations[0].loc;
+ char *value = P->params[i].raw_value;
+ struct string * X;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,
+ P->params[i].raw_param,
+ P->params[i].raw_value));
+
+
+ X = parse_encoded_first(value);
+
+ if (!X) {


+ goto fail2;
+ }
+

+ S = add_string_pair(P);
+ S->param = safe_strdup(positional[x].name);
+ S->value = X;
+
+
+ } else {
+ int i = positional[x].locations[0].loc;
+ char *value = P->params[i].raw_value;
+ int l = strlen(value);
+ char *val;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,
+ P->params[i].raw_param,
+ P->params[i].raw_value));
+
+ val = dequote_opt(value,l);
+
+ S = add_string_pair(P);
+ S->param = safe_strdup(positional[x].name);
+
+ /* FIXME ??? Is this correct ??? */
+ S->value = new_string2(RAW_BUFFER,us_str(val));
+
+ free(val);
+
+ }
+
+ /* Handle rest of parameters */
+
+ for (y = 1; y < positional[x].location_count; y++) {
+
+ int i = positional[x].locations[y].loc;
+ char *value = P->params[i].raw_value;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,
+ P->params[i].raw_param,
+ P->params[i].raw_value));
+
+ if (positional[x].locations[x].is_new) {
+
+ if (!append_encoded(S->value,value))
+ goto failX;
+
+
+ } else {
+ char * val;
+ int l1;
+ int errors = 0;
+
+ int l = strlen(value);
+
+ val = dequote_opt(value,l);
+ l1 = strlen(val);
+
+ if (!add_streambytes_to_string(S->value,l1,us_str(val),&errors)) {
+
+ free(val);
+ goto failX;
+ }
+
+ free(val);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [added %d] %s=%S\n",
+ x,
+ S->param,
+ S->value));


+
+ }
+
+ }
+

+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [splitted string] %s=%S\n",
+ S->param,
+ S->value));
+
+
+ if (0) {
+ failX:
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %s: Failed to parse value\n",
+ S->param));
+
+ free_string(& (S->value));
+ }


+
+
+ } else {
+

+ struct ascii_pair * A = add_ascii_pair(P);
+
+ char *p;
+
+ A->is_compat = 0;
+ A->param = safe_strdup(positional[x].name);
+ A->value = NULL;
+
+
+
+ for (y = 0; y < positional[x].location_count; y++) {
+
+ int i = positional[x].locations[y].loc;
+ char *value = P->params[i].raw_value;
+ int l = strlen(value);
+ char *val;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,
+ P->params[i].raw_param,
+ P->params[i].raw_value));
+
+ if (positional[x].locations[x].is_new)
+ mime_panic(__FILE__,__LINE__,"parse_raw_params",
+ "Inbossible encoding");
+
+
+
+ val = dequote_opt(value,l);
+
+ A->value = strmcat(A->value,val);
+
+ free(val);
+ }
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [splitted ascii] %s=%s\n",
+ A->param,
+ A->value));
+
+
+ for (p = A->value; *p; p++) {
+ if (0 != (*p & 0x80))
+ break;
+ }
+
+ if (*p) {
+ struct string_pair * S;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %s: 8-bit data on parameter\n",
+ A->param));
+
+ if (! P->def ) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: NO DEFAULT CHARSET -- parameter ignored\n"));
+
+ /* Destroy non-ascii value */
+ free(A->value); A->value = NULL;
+
+ continue;
+ }
+
+ S = add_string_pair(P);
+
+ S->param = safe_strdup(A->param);
+ S->value = new_string2(P->def,us_str(A->value));
+
+ /* Destroy non-ascii value */
+ free(A->value); A->value = NULL;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [fixup string] %s=%S\n",
+ S->param,
+ S->value));


+
+ }
+
+ }
+

+ fail2: ;
+
+ }
+ }
+
+ /* Cleanup */
+
+ if (positional) {
+ int i;
+
+ for (i = 0; i < positional_count; i++) {
+ if (positional[i].locations) {
+ free(positional[i].locations);
+ positional[i].locations = NULL;
+ }
+ positional[i].location_count = 0;
+ }
+ free(positional);
+ }
+ }
+
+
+ struct mime_param * parse_mime_param(headername,value,def)
+ char *headername;
+ char *value;
+ charset_t def;
+ {
+ char *ptr;
+
+
+ struct mime_param *P = alloc_mime_param();
+
+ DPRINT(Debug,9,(&Debug,"parse_mime_param: headername=%s value=%s\n",
+ headername ? headername : "<not given>",
+ value));
+
+ P->def = def;
+
+ /* It is assumed that comments are already removed
+ with rfc822_reap_comments()
+ */
+
+ for (ptr = value; *ptr; ) {
+ char * start;
+ char * last;
+ int len;
+ struct mp_pair * mp = NULL;
+
+ while (*ptr && isascii(*ptr) && isspace(*ptr))
+ ptr++;
+
+ if (!*ptr)
+ break ;
+
+ start = ptr;
+ last = NULL;
+
+ /* Get param name */
+
+ while (*ptr) {
+
+ if (isascii(*ptr) && isspace(*ptr)) {
+ if (!last)
+ last = ptr;
+ } else if ('=' == *ptr) {
+ if (!last)
+ last = ptr;
+ break;
+ } else if ('"' == *ptr) {
+ if (!last)
+ last = ptr;
+ break;
+ } else if (';' == *ptr) {
+
+ if (!last)
+ last = ptr;
+ break;
+ } else if (last) {


+
+ break;
+ }
+

+ ptr++;
+ }
+
+ if (!last)
+ last = ptr;
+
+ while (*ptr && isascii(*ptr) && isspace(*ptr))
+ ptr++;
+
+ if ('=' == *ptr)
+ ptr++;
+ else {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingEqual,
+ "PARSE ERROR: Missing = on %s header"),
+ headername);
+ }
+
+ if (last == start) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingName,
+ "PARSE ERROR: Missing name of param on %s header"),
+ headername);
+
+ }
+
+ len = last-start;
+
+ mp = add_mp_pair(P);
+
+ mp->raw_param = safe_malloc(len+1);
+
+ strncpy(mp->raw_param,start,len);
+ mp->raw_param[len] = '\0';
+
+ DPRINT(Debug,9,(&Debug,"parse_mime_param: [%d] param=%s\n",
+ P->param_count-1,mp->raw_param));
+
+
+ while (*ptr && isascii(*ptr) && isspace(*ptr))
+ ptr++;
+
+ start = ptr;
+ last = NULL;
+
+ if ('"' == *ptr) {
+
+ ptr++;
+ while (*ptr && '"' != *ptr) {
+
+ if ('\\' == *ptr) {
+ ptr++;
+
+ if (!*ptr) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeTrailingBackslashHeader,
+ "PARSE ERROR: Trailing \\ on %s header"),
+ headername);


+
+ break;
+ }
+ }

+ ptr++;
+ }
+
+ if ('"' != *ptr) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingQuote,
+ "PARSE ERROR: Missing ending \" on %s header"),
+ headername);
+ } else
+ ptr++;


+
+
+ } else {
+

+ while (*ptr) {
+ if (isascii(*ptr) && isspace(*ptr)) {
+ if (!last)
+ last = ptr;
+ } else if ('=' == *ptr) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeEqualOnValue,
+ "PARSE ERROR: Missing ; or = on param value on %s header"),
+ headername);
+ } else if ('"' == *ptr) {
+ if (!last)
+ last = ptr;
+ break;
+ } else if (';' == *ptr) {
+ if (!last)
+ last = ptr;
+ break;
+ } else if (last) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeSpaceOnValue,
+ "PARSE ERROR: Missing ; or space on param value on %s header"),
+ headername);
+ last = NULL;
+ }
+
+ ptr++;
+ }
+ }
+
+ if (!last)
+ last = ptr;
+
+ while (*ptr && isascii(*ptr) && isspace(*ptr))
+ ptr++;
+
+
+ if (';' == *ptr)
+ ptr++;
+ else if (*ptr) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingSemicolonHeader,
+ "PARSE ERROR: Missing ; on %s header"),
+ headername);
+ }
+
+
+ if (last == start) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingValue,
+ "PARSE ERROR: Missing value of param on %s header"),
+ headername);
+
+ }
+
+ len = last-start;
+
+ mp->raw_value = safe_malloc(len+1);
+
+ strncpy(mp->raw_value,start,len);
+ mp->raw_value[len] = '\0';
+
+ DPRINT(Debug,9,(&Debug,"parse_mime_param: [%d] value=%s\n",
+ P->param_count-1,mp->raw_value));
+
+
+ }
+
+ return P;
+ }
+
+ static CONST char *find_ascii_param P_((struct mime_param *P,
+ char *name,
+ int compat));
+ static CONST char *find_ascii_param(P,name,compat)
+ struct mime_param *P;
+ char *name;
+ int compat;
+ {
+ int i;
+
+ for (i = 0; i < P->ascii_param_count; i++) {
+ if (P->ascii_params[i].is_compat == compat &&
+ P->ascii_params[i].param &&
+ 0 == istrcmp(P->ascii_params[i].param,name))
+ return P->ascii_params[i].value;


+ }
+ return NULL;
+ }
+

+ static CONST struct string *find_string_param P_((struct mime_param *P,
+ char *name));
+ static CONST struct string *find_string_param(P,name)
+ struct mime_param *P;
+ char *name;
+ {
+ int i;
+
+ for (i = 0; i < P->string_param_count; i++) {
+ if (P->string_params[i].param &&
+ 0 == istrcmp(P->string_params[i].param,name))
+ return P->string_params[i].value;


+ }
+ return NULL;
+ }
+

+ CONST char * get_mime_param_compat(P,name)
+ struct mime_param *P;
+ char *name;
+ {
+ if (!P)
+ return NULL;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"get_mime_param_compat",
+ "Bad magic number");
+
+ if (! P->ascii_params && ! P->string_params)
+ parse_raw_params(P);
+
+ if (P->ascii_params)
+ return find_ascii_param(P,name,1);
+
+ DPRINT(Debug,9,(&Debug, "get_mime_param_compat: No parameters\n"));


+
+ return NULL;
+ }
+

+ CONST char * get_mime_param_ascii(P,name)
+ struct mime_param *P;
+ char *name;
+ {
+ int i;
+
+ if (!P)


+ return NULL;
+
+

+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"get_mime_param_ascii",
+ "Bad magic number");
+
+
+ if (! P->ascii_params && ! P->string_params)
+ parse_raw_params(P);
+
+ if (P->ascii_params) {
+ CONST char *found = find_ascii_param(P,name,0);
+
+ if (found)
+ return found;
+
+ return find_ascii_param(P,name,1);
+ }
+
+ DPRINT(Debug,9,(&Debug, "get_mime_param_ascii: No parameters\n"));
+
+ return NULL;
+ }
+
+
+ static CONST unsigned char * cus_str P_((const char *str));
+ static CONST unsigned char * cus_str(str)
+ CONST char *str;
+ {
+ return (CONST unsigned char *)str;
+ }
+
+
+ CONST struct string * get_mime_param(P,name)
+ struct mime_param *P;
+ char *name;
+ {
+ if (!P)
+ return NULL;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"get_mime_param",
+ "Bad magic number");
+
+ if (! P->ascii_params && ! P->string_params)
+ parse_raw_params(P);
+
+ if (P->string_params) {
+ CONST struct string *found = find_string_param(P,name);
+
+ if (found)
+ return found;
+ }
+
+ if (P->ascii_params) {
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+
+ CONST char *found = find_ascii_param(P,name,0);
+ struct string_pair *S;
+
+ if (!found)
+ found = find_ascii_param(P,name,1);
+
+ if (!found)
+ return NULL;
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"get_mime_param",
+ "US-ASCII not found");
+
+ S = add_string_pair(P);
+ S->param = safe_strdup(name);
+ S->value = new_string2(ascii_ptr,cus_str(found));
+
+ return S->value;
+ }
+
+ DPRINT(Debug,9,(&Debug, "get_mime_param: No parameters\n"));


+
+ return NULL;
+ }
+

+ static int ascii_need_quote P_((char *value));
+ static int ascii_need_quote(value)
+ char *value;
+ {
+ char *p;
+
+ if (! value[0])
+ return 1;
+
+ for (p = value; *p; p++) {
+ if (*p <= ' ')
+ return 1;
+
+ if (*p >= '"' &&
+ *p <= '/')
+ return 1;
+
+ if (*p >= ':' &&
+ *p <= '?')
+ return 1;
+
+ if (*p == '\\')


+ return 1;
+ }
+

+ return 0;
+ }
+

+ static int string_is_ascii_control P_((struct string * value));
+ static int string_is_ascii_control(value)
+ struct string * value;
+ {
+ int len = string_len(value);
+ int i;
+
+ for (i = 0; i < len; i++) {
+ uint16 code = give_unicode_from_string(value,i);
+
+ if (code <= 0x0020 /* space */ )
+ return 1;
+
+ if (code >= 0x007F /* DEL */)


+ return 1;
+ }
+

+ return 0;
+ }
+

+ static int string_need_quote P_((struct string * value));
+ static int string_need_quote(value)
+ struct string * value;
+ {
+ int len = string_len(value);
+ int i;
+
+ if (0 == len)
+ return 1;
+
+ for (i = 0; i < len; i++) {
+ uint16 code = give_unicode_from_string(value,i);
+
+ if (code <= 0x0020 /* space */ )
+ return 1;
+
+ if (code >= 0x0022 /* " */ &&
+ code <= 0x002F /* / */)
+ return 1;
+
+ if (code >= 0x003A /* : */ &&
+ code >= 0x003F /* ? */)
+ return 1;
+
+ switch(code) {
+
+ case 0x005C /* \ */:


+ return 1;
+ }
+ }
+

+ return 0;
+ }
+
+ static void append_quoted_to_string P_((struct string ** ret,
+ struct string * value));
+ static void append_quoted_to_string(ret,value)
+ struct string ** ret;
+ struct string * value;
+ {
+ charset_t cs = value->string_type;
+ int len = string_len(value);
+ int i;
+
+ struct string * tmp = new_string(cs);
+
+ add_ascii_to_string(tmp,us_str("\""));
+
+ for (i = 0; i < len; i++) {
+ uint16 code = give_unicode_from_string(value,i);
+
+ if (0x0022 /* " */ == code &&
+ 0x005C /* \ */ == code)
+ add_ascii_to_string(tmp,us_str("\\"));
+
+ add_unicode_to_string(tmp,1,&code);
+ }
+
+ add_ascii_to_string(tmp,us_str("\""));
+
+ append_string(ret,tmp);
+
+ free_string(&tmp);
+ }
+
+ struct string * unquote_string P_((struct string * value));
+ struct string * unquote_string(value)
+ struct string * value;
+ {
+ charset_t cs = value->string_type;
+ int len = string_len(value);
+ int i;
+ int q = 0;
+
+ struct string * ret = new_string(cs);
+
+ for (i = 0; i < len; i++) {
+ uint16 code = give_unicode_from_string(value,i);
+
+ if (0x0022 /* " */ == code) {
+ q = !q;
+ continue;
+ }
+
+ /* Recognize \ escape only in quoted strings */
+ if (0x005C /* \ */ == code && q) {
+ i++;
+
+ if (i < len)
+ code = give_unicode_from_string(value,i);
+ else {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeTrailingBackslashOnString,
+ "Trailing Backslash (\\) on %S"),
+ value);


+ break;
+
+ }
+ }

+
+ add_unicode_to_string(ret,1,&code);
+ }
+
+ if (q)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingEndQuote,
+ "Missing ending quote (\") on %S"),
+ value);
+
+ return ret;
+ }
+
+ static void add_param_string P_((struct string ** ret,
+ char *param,
+ struct string * value));
+ static void add_param_string(ret,param,value)
+ struct string ** ret;
+ char *param;
+ struct string * value;
+ {
+ if (*ret)
+ add_ascii_to_string(*ret,us_str("; "));
+
+ if (!*ret)
+ *ret = new_string(display_charset);
+
+ add_ascii_to_string(*ret,us_str(param));
+ add_ascii_to_string(*ret,us_str("="));
+
+ if (string_need_quote(value))
+ append_quoted_to_string(ret,value);
+ else
+ append_string(ret,value);
+ }
+
+ static void add_param_ascii P_((struct string ** ret,
+ char *param,
+ char * value));
+ static void add_param_ascii(ret,param,value)
+ struct string ** ret;
+ char *param;
+ char * value;
+ {
+ struct string * tmp ;
+
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"add_param_ascii",
+ "US-ASCII not found");
+
+ tmp = new_string2(ascii_ptr,us_str(value));
+ add_param_string(ret,param,tmp);
+ free_string(&tmp);
+ }
+
+ struct string * show_mime_params(P)
+ struct mime_param *P;
+ {
+ struct string * ret = NULL;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"show_mime_params",
+ "Bad magic number");
+
+ if (! P->ascii_params && ! P->string_params)
+ parse_raw_params(P);
+
+
+ if (P->string_params) {
+ int i;
+
+ for (i = 0; i < P->string_param_count; i++) {
+ if (P->string_params[i].param &&
+ P->string_params[i].value)
+ add_param_string(&ret,P->string_params[i].param,
+ P->string_params[i].value);
+ }
+ }
+
+ if (P->ascii_params) {
+ int i;
+
+ for (i = 0; i < P->ascii_param_count; i++) {
+ if (!P->ascii_params[i].param)
+ continue;
+
+ if (find_string_param(P,P->ascii_params[i].param))
+ continue;
+
+ if (P->ascii_params[i].value)
+ add_param_ascii(&ret,P->ascii_params[i].param,
+ P->ascii_params[i].value);
+ }


+ }
+
+ return ret;

+ }
+
+ char * encode_mime_params(P)
+ struct mime_param *P;
+ {
+ char * ret = NULL;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"encode_mime_params",
+ "Bad magic number");
+
+ if (P->params) {
+ int i;
+
+ for (i = 0; i < P->param_count; i++) {
+ if (P->params[i].raw_param &&
+ P->params[i].raw_value) {
+ if (ret)
+ ret = strmcat(ret,"; ");
+
+ ret = strmcat(ret,P->params[i].raw_param);
+ ret = strmcat(ret,"=");
+ ret = strmcat(ret,P->params[i].raw_value);


+ }
+
+ }
+ }
+

+ return ret;
+ }
+
+
+
+ char ** encode_mime_params_v(P)
+ struct mime_param *P;
+ {
+ char ** ret = NULL;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"encode_mime_params",
+ "Bad magic number");
+
+ if (P->params) {
+ int i;
+ int X = 0;
+
+ ret = safe_malloc((P->param_count +1) * sizeof (ret[0]));
+
+ for (i = 0; i < P->param_count; i++) {
+ if (P->params[i].raw_param &&
+ P->params[i].raw_value) {
+
+ ret[X] = safe_strdup(P->params[i].raw_param);
+ ret[X] = strmcat(ret[X],"=");
+ ret[X] = strmcat(ret[X],P->params[i].raw_value);
+ X++;
+ }
+ }
+ ret[X] = NULL;
+ }
+ return ret;
+ }
+
+
+ static void gen_splitted_ascii_param P_((struct mime_param *P, char *name, char *value));
+ static void gen_splitted_ascii_param(P,name,value)
+ struct mime_param *P;
+ char *name;
+ char *value;
+ {
+ char * p, *p1;
+ int counter = 0;
+
+ for (p = value; *p; p = p1) {
+ struct mp_pair * mp = add_mp_pair(P);
+ char * tmp;
+ int len;
+
+ for (p1 = p; *p && p1-p < 70; p++)
+ /* nothing */;
+
+ len = p1-p;
+
+ mp->raw_param = elm_message(FRM("%s*%d"),name,counter++);
+
+ tmp = safe_malloc(len+1);
+ strncpy(tmp,p,len);
+ tmp[len] = '\0';
+
+ if (ascii_need_quote(tmp)) {
+ mp->raw_value = elm_message(FRM("%Q"),tmp);
+ free(tmp);
+ } else {
+ mp->raw_value = tmp;
+ }
+ }
+
+ if (counter == 0) {
+ struct mp_pair * mp = add_mp_pair(P);
+ mp->raw_param = elm_message(FRM("%s*%d"),name,counter++);
+ mp->raw_value = safe_strdup("\"\"");
+ }
+
+ }
+
+ static char * get_encoded P_((struct string *value));
+ static char * get_encoded(value)
+ struct string *value;
+ {
+ char * ret = NULL;
+ int alloclen = 0;
+ int len;
+ char * tmp;
+ int ok = charset_ok_p(value->string_type);
+ int i;


+ int count = 0;

+ CONST char *y = get_string_MIME_name(value);
+
+ if (y && (0 == istrcmp(y,"UTF-8") ||
+ 0 == istrcmp(y,"UTF-7")))
+ ok = 1;
+
+ /* Allow producing \0 values also ... */
+ bytestream_from_string(value,&tmp,&len);
+
+ alloclen = len+10;
+
+ if (!ok)
+ alloclen = len*3+2;
+
+ ret = safe_malloc(alloclen);
+
+ #define ADD(x) { if (count >= alloclen) { \
+ alloclen += 20; ret = safe_realloc(ret,alloclen); } \
+ ret[count++] = (x); }
+
+ for (i = 0; i <len; i++) {
+ unsigned char val =tmp[i];
+
+ if (!ok || val == '%' || !isascii(val) || !isalnum(val)) {
+ ADD('%');
+ ADD(hexchars[val / 16]);
+ ADD(hexchars[val % 16]);
+ } else {
+ ADD(val);
+ }
+ }
+
+ ADD('\0');
+
+ #undef ADD
+
+ free(tmp);


+ return ret;
+ }
+

+ static char * get_first_encoded P_((struct string *value));
+ static char * get_first_encoded(value)
+ struct string *value;
+ {
+ CONST char *cs;
+ CONST char *lang;
+ char *ret;
+ char *tmp;
+
+ if (value->string_type == RAW_BUFFER) /* charset is not relevant to parameter value! */
+ cs = "";
+ else {
+ cs = get_string_MIME_name(value);
+
+ if (!cs || NULL != strpbrk(cs," \t\r\n()\"?*'="))
+ cs = "UNKNOWN-8BIT";
+ }
+
+ lang = get_string_lang(value);
+
+ if (!lang || NULL != strpbrk(lang," \t\r\n()\"?*'="))
+ lang = "";
+
+ tmp = get_encoded(value);
+
+ ret = elm_message(FRM("%s'%s'%s"),cs,lang,tmp);
+
+ free(tmp);
+
+ return ret;
+ }
+
+ static void gen_string_param P_((struct mime_param *P, char *name,
+ struct string *value));
+ static void gen_string_param(P,name,value)
+ struct mime_param *P;
+ char *name;
+ struct string * value;
+ {
+ struct mp_pair * mp = add_mp_pair(P);
+
+ mp->raw_param = elm_message(FRM("%s*"),name);
+ mp->raw_value = get_first_encoded(value);
+
+ DPRINT(Debug,9,(&Debug,
+ "gen_string_param: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+ }
+
+ #define STRING_SPLIT_LEN 15
+
+ static void gen_splitted_string_param P_((struct mime_param *P, char *name,
+ struct string *value));
+ static void gen_splitted_string_param(P,name,value)
+ struct mime_param *P;
+ char *name;
+ struct string * value;
+ {
+ int len = string_len(value);


+ int pos = 0;

+ struct string *buffer;
+ int counter = 0;
+ struct mp_pair * mp = add_mp_pair(P);
+
+ buffer = clip_from_string(value,&pos,STRING_SPLIT_LEN);
+
+ mp->raw_param = elm_message(FRM("%s*%d*"),name,counter++);
+ mp->raw_value = get_first_encoded(buffer);
+
+ DPRINT(Debug,9,(&Debug,
+ "gen_splitted_string_param: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+
+ free_string(&buffer);
+
+ while (pos < len) {
+ buffer = clip_from_string(value,&pos,STRING_SPLIT_LEN);
+
+ mp = add_mp_pair(P);
+ mp->raw_param = elm_message(FRM("%s*%d*"),name,counter++);
+ mp->raw_value = get_encoded(buffer);
+
+ DPRINT(Debug,9,(&Debug,
+ "gen_splitted_string_param: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+
+ free_string(&buffer);
+ }
+ }
+
+ static char *us2s P_((unsigned char *str));
+ static char *us2s(str)
+ unsigned char *str;
+ {
+ return (char *)str;
+ }
+
+
+ static void parse_rest P_((struct mime_param *P, struct string_token *X,

+ int gen_compat_len,
+ int plain_mode));

+ static void parse_rest(P,X, gen_compat_len,plain_mode)
+ struct mime_param *P;
+ struct string_token *X;
+ int gen_compat_len;
+ int plain_mode;
+ {
+
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+

+ int i = 0;
+

+ struct string_pair * tmp_list = NULL;
+
+ int tmp_list_len = 0;
+
+ struct ascii_pair * a_list = NULL;
+ int a_list_len = 0;
+
+ struct mp_pair * mp_list = NULL;
+ int mp_list_len = 0;
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"parse_rest",
+ "US-ASCII not found");
+
+ while (X[i].token) {
+
+ struct string * name = NULL;
+ struct string *Y = NULL;
+ char * ascname = NULL;
+ CONST char *lang = NULL;
+
+ while (X[i].token &&
+ 0x0020 /* SPACE */ == X[i].special ||
+ 0x0028 /* ( */ == X[i].special) {
+ i++;
+ }
+
+ if (! X[i].token)
+ break;
+
+ if (0 == X[i].special)
+ name = X[i].token;
+ else {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorNameExpected,
+ "Parse error on %S -- name expected"),
+ X[i].token);
+ goto recover;
+ }
+
+ if (!can_ascii_string(X[i].token))
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeAsciiRequiredTok,
+ "Ascii required for token %S"),
+ X[i].token);
+
+ i++;
+ while (X[i].token &&
+ 0x0020 /* SPACE */ == X[i].special ||
+ 0x0028 /* ( */ == X[i].special) {
+ i++;
+ }
+
+ if (! X[i].token) {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorEqualExpectedEOS,
+ "Parse error on end of string -- = expected"));


+ break;
+
+ }
+

+ if (0x003D /* = */ != X[i].special) {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorEqualExpected,
+ "Parse error on %S -- = expected"),
+ X[i].token);
+ goto recover;
+ }
+
+ i++;
+ while (X[i].token &&
+ 0x0020 /* SPACE */ == X[i].special ||
+ 0x0028 /* ( */ == X[i].special) {
+ i++;
+ }
+
+ if (! X[i].token) {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorValueExpectedEOS,
+ "Parse error on end of string -- value of param expected"));


+ break;
+
+ }
+

+ if (0x003B /* ';' */ == X[i].special) {
+
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorValueExpected,
+ "Parse error on %S -- value of param expected"),
+ X[i].token);


+ continue;
+ }
+
+

+ Y = convert_string(ascii_ptr,name,0);
+ ascname = us2s(stream_from_string(Y,0,NULL));
+ free_string(&Y);
+
+ if (NULL != strchr(ascname,'*')) {
+ struct mp_pair *mp = add_mp_pair_1(&mp_list,&mp_list_len);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: %s: String as raw parameter: %S\n",
+ ascname,X[i].token));
+
+ if (!can_ascii_string(X[i].token))
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeAsciiRequiredTok,
+ "Ascii required for token %S"),
+ X[i].token);
+
+ Y = convert_string(ascii_ptr,X[i].token,0);
+
+ mp->raw_param = ascname;
+ mp->raw_value = us2s(stream_from_string(Y,0,NULL));
+ free_string(&Y);
+
+ } else {
+ struct string * value1 = NULL;
+ struct string * value0 = NULL;
+
+ if (0x0022 /* " */ == X[i].special)
+ value1 = unquote_string(X[i].token);
+ else
+ value1 = dup_string(X[i].token);
+
+ value0 = value1; /* synonym */
+
+ if (plain_mode) {
+
+ struct ascii_pair *A = NULL;
+ struct string *Y;
+
+ if (!can_ascii_string(value1))
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeAsciiRequiredTok,
+ "Ascii required for token %S"),
+ value1);
+
+ Y = convert_string(ascii_ptr,value1,0);
+
+
+ A = add_ascii_pair_1(&a_list,&a_list_len);
+
+ A->param = ascname;
+ A->value = us2s(stream_from_string(Y,0,NULL));
+ A->is_compat = 1;
+
+ free_string(& Y);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [compat] %s=%s\n",
+ A->param,
+ A->value));
+
+ } else {
+
+ /* Ascii version ... */
+
+ lang = get_string_lang(value1);
+
+ if (plain_mode ||
+ !lang && can_ascii_string(value1) &&
+ !string_is_ascii_control(value1)) {
+ struct ascii_pair *A = NULL;
+
+ struct string *Y = convert_string(ascii_ptr,value1,0);
+ /* Is really ascii */
+
+ A = add_ascii_pair_1(&a_list,&a_list_len);
+
+ A->param = safe_strdup(ascname);
+ A->value = us2s(stream_from_string(Y,0,NULL));
+
+ A->is_compat = string_len(Y) < gen_compat_len;
+
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [%s] %s=%s\n",
+ A->is_compat ? "compat" : "ascii",
+ A->param,
+ A->value));
+
+ if (!A->is_compat)
+ goto gencompat;
+
+ } else {
+
+ CONST struct string * Y1;
+ CONST char * Y2;
+
+ {
+ struct string_pair *S = NULL;
+
+ S = add_string_pair_1(&tmp_list,&tmp_list_len);
+ S->param = ascname;
+ S->value = value1;
+
+ value1 = NULL;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [string] %s=%S\n",
+ S->param,
+ S->value));
+ }
+
+ gencompat:
+
+ Y1 = get_mime_param(P,ascname);
+ Y2 = find_ascii_param(P,ascname,1);
+
+ if (Y1 && 0 == string_cmp(Y1,value0,999) &&
+ Y2) {
+ /* Preserve existing compat parameter */
+
+ struct ascii_pair *A = NULL;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: %s: Preserving existing compat parameter: %s\n",
+ ascname,Y2));
+
+ A = add_ascii_pair_1(&a_list,&a_list_len);
+ A->param = safe_strdup(ascname);
+ A->value = safe_strdup(Y2);
+ A->is_compat = 1;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [compat] %s=%s\n",
+ A->param,
+ A->value));


+
+
+ } else {
+

+ if (Y1) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: old string param was: %S\n",
+ Y1));
+ }
+ if (Y2) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: old compat param was: %s\n",
+ Y2));
+ }
+
+ if (gen_compat_len) {
+
+ struct ascii_pair *A = NULL;
+ struct string *Y = convert_string(ascii_ptr,value0,0);


+ int pos = 0;
+

+ A = add_ascii_pair_1(&a_list,&a_list_len);
+ A->param = safe_strdup(ascname);
+ A->value = us2s(streamclip_from_string(Y,&pos,gen_compat_len,NULL,NULL));
+ A->is_compat = 1;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [compat] %s=%s\n",
+ A->param,
+ A->value));
+ }
+ }
+ }
+
+ if (value1)
+ free_string(& value1);
+ }
+ }
+
+ i++;
+ while (X[i].token &&
+ 0x0020 /* SPACE */ == X[i].special ||
+ 0x0028 /* ( */ == X[i].special) {
+ i++;
+ }
+
+ if (X[i].token &&
+ 0x003B /* ';' */ != X[i].special) {
+
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorSemicolonExpected,
+ "Parse error on %S -- ; or end of string expected"),
+ X[i].token);
+
+ /* syncronize */
+ recover:
+ while (X[i].token &&
+ 0x003B /* ';' */ != X[i].special )
+ i++;
+
+ }
+
+ if (X[i].token &&
+ 0x003B /* ';' */ == X[i].special)
+ i++;
+
+ }
+
+ if (X[i].token)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorFailed,
+ "Parse error on %S -- failed to parse parameters"),
+ X[i].token);
+
+
+ free_parsed(P);
+
+ P->string_params = tmp_list;
+ P->string_param_count = tmp_list_len;
+
+ P->ascii_params = a_list;
+ P->ascii_param_count = a_list_len;
+
+ free_raw(P);
+
+ P->params = mp_list;
+ P->param_count = mp_list_len;
+
+ for (i = 0; i < a_list_len; i++) {
+ if (a_list[i].is_compat) {
+ struct mp_pair * mp = add_mp_pair(P);
+
+ mp->raw_param = safe_strdup(a_list[i].param);
+ if (ascii_need_quote(a_list[i].value))
+ mp->raw_value = elm_message(FRM("%Q"),a_list[i].value);
+ else
+ mp->raw_value = safe_strdup(a_list[i].value);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+
+ } else {
+ gen_splitted_ascii_param(P,a_list[i].param,a_list[i].value);
+ }
+ }
+
+ for (i = 0; i < tmp_list_len; i++) {
+ /* If there exists ascii -- non-compat version of same
+ parameter, do not add this ...
+ */
+
+ if (find_ascii_param(P,tmp_list[i].param,0))
+ continue;
+
+ if (string_len(tmp_list[i].value) > STRING_SPLIT_LEN)
+ gen_splitted_string_param(P,tmp_list[i].param,tmp_list[i].value);
+ else
+ gen_string_param(P,tmp_list[i].param,tmp_list[i].value);
+ }
+ }
+
+ struct mime_param * parse_mime_param_string(value, gen_compat_len,
+ plain_mode)
+ struct string * value;
+ int gen_compat_len;
+ int plain_mode;
+ {
+ struct mime_param *P = alloc_mime_param();
+
+ struct string_token *X = string_tokenize(value,TOK_mime);
+
+ P->def = value->string_type;
+
+ if (X) {
+ parse_rest(P,X,gen_compat_len, plain_mode);
+
+ free_string_tokenized(&X);
+ }
+
+ return P;
+ }
+
+ char ** split_mime_params(P,in_buffer,gen_compat_len,plain_mode)
+ struct mime_param **P;
+ struct string *in_buffer;
+ int gen_compat_len;
+ int plain_mode;
+ {
+ char **ret = NULL;
+ struct string_token *X;
+ int i,count = 0;
+
+
+ if (!*P)
+ *P = alloc_mime_param();
+
+ if (MIME_PARAM_magic != (*P)->magic)
+ mime_panic(__FILE__,__LINE__,"split_mime_params",
+ "Bad magic number");
+
+
+
+ X = string_tokenize(in_buffer,TOK_mime);
+ if (!X)
+ return NULL;
+
+ for (i=0; X[i].token; i++) {
+ if (0x003B /* ';' */ == X[i].special)
+ break;
+ count++;
+ }
+
+ if (count) {
+ int j;
+ int k = 0;
+
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"split_mime_params",
+ "US-ASCII not found");
+
+ ret = safe_malloc((count+1) * sizeof(ret[0]));
+
+ for (j = 0; j < count; j++) {


+ struct string *Y;
+

+ if (0x0020 /* SPACE */ == X[j].special)
+ continue;
+
+ /* Skips comment */
+ if (0x0028 /* ( */ == X[j].special)
+ continue;
+
+ if (!can_ascii_string(X[j].token))
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeAsciiRequiredTok,
+ "Ascii required for token %S"),
+ X[j].token);
+
+ Y = convert_string(ascii_ptr,X[j].token,0);
+
+ ret[k] = us2s(stream_from_string(Y,0,NULL));
+
+ DPRINT(Debug,9,(&Debug,
+ "split_mime_params: ret[%d]=%s\n",
+ k,ret[k]));
+
+ k++;


+
+ free_string(&Y);
+ }
+

+ ret[k] = NULL;
+ }
+
+
+ if (0x003B /* ';' */ == X[i].special) {
+
+ i++;
+
+ parse_rest(*P,X+i,gen_compat_len, plain_mode);
+
+ } else {
+
+ DPRINT(Debug,9,(&Debug,
+ "split_mime_params: Removing all parameters\n"));
+
+ free_raw(*P);
+ free_parsed(*P);
+ }
+
+ free_string_tokenized(&X);


+ return ret;
+ }
+

+ void mime_params_add_compat(P,name,value)
+ struct mime_param **P;
+ char *name;
+ char *value;
+ {
+ struct ascii_pair *A = NULL;
+ struct mp_pair * mp = NULL;
+
+ if (!*P)
+ *P = alloc_mime_param();
+
+ if (MIME_PARAM_magic != (*P)->magic)
+ mime_panic(__FILE__,__LINE__,"mime_params_add_compat",
+ "Bad magic number");
+
+ A = add_ascii_pair(*P);
+
+ A->param = safe_strdup(name);
+ A->value = safe_strdup(value);
+ A->is_compat = 1;
+
+ DPRINT(Debug,9,(&Debug,
+ "mime_params_add_compat: [compat] %s=%s\n",
+ A->param,A->value));
+
+ mp = add_mp_pair(*P);
+ mp->raw_param = safe_strdup(name);
+
+ if (ascii_need_quote(value))
+ mp->raw_value = elm_message(FRM("%Q"),value);
+ else
+ mp->raw_value = safe_strdup(value);
+
+ DPRINT(Debug,9,(&Debug,
+ "mime_params_add_compat: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+
+ }
+
+ void mime_params_add(P,name,value)
+ struct mime_param **P;
+ char *name;
+ struct string *value;
+ {
+ struct string_pair *S = NULL;
+ CONST char *lang;
+
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+
+ if (!*P)
+ *P = alloc_mime_param();
+
+ if (MIME_PARAM_magic != (*P)->magic)
+ mime_panic(__FILE__,__LINE__,"mime_params_add",
+ "Bad magic number");
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"mime_params_add",
+ "US-ASCII not found");
+
+ S = add_string_pair(*P);
+
+ S->param = safe_strdup(name);
+ S->value = dup_string(value);
+
+ DPRINT(Debug,9,(&Debug,
+ "mime_params_add: [string] %s=%S\n",
+ S->param,S->value));
+
+ /* Compat parameter is not generated -- it is asusmed that
+ caller calls mime_params_add_compat instead ...
+ */
+
+ lang = get_string_lang(value);
+
+ if (!lang && can_ascii_string(value) &&
+ !string_is_ascii_control(value)) {
+
+ struct ascii_pair *A = NULL;
+
+ struct string *Y = convert_string(ascii_ptr,value,0);
+ /* Is really ascii */
+
+ A = add_ascii_pair(*P);
+
+ A->param = safe_strdup(name);
+ A->value = us2s(stream_from_string(Y,0,NULL));
+ A->is_compat = 0;
+
+
+ DPRINT(Debug,9,(&Debug,
+ "mime_params_add: [ascii] %s=%s\n",
+ A->param,A->value));
+
+ gen_splitted_ascii_param(*P,A->param,A->value);
+ } else {
+ if (string_len(S->value) > STRING_SPLIT_LEN)
+ gen_splitted_string_param(*P,S->param,S->value);
+ else
+ gen_string_param(*P,S->param,S->value);


+
+ }
+ }
+
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/melib/mime_parse.c
*** elm2.4.ME+.121/melib/mime_parse.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/melib/mime_parse.c 2005-07-01 12:15:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.46 2004/06/27 15:18:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.49 2005/07/01 09:15:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 43,69 ****

if (mt->description)
free_string (&(mt->description));
! if (mt->type_opts)
! free (mt->type_opts);
! mt->type_opts = NULL;
! if (mt->disposition_opts)
! free (mt->disposition_opts);
! mt->disposition_opts = NULL;

! if (mt->pathname) {
if (mt->unlink) {
DPRINT(Debug,15,(&Debug,
"mime_t_clear: %s marked for unlink\n",
! mt->pathname));

! if (0 == unlink(mt->pathname)) {
DPRINT(Debug,14,(&Debug,
"mime_t_clear: %s unlinked\n",
! mt->pathname));
}
}

! free (mt->pathname);

} else {
if (mt->unlink) {
--- 43,67 ----

if (mt->description)
free_string (&(mt->description));
! if (mt->TYPE_opts)
! free_mime_param (&(mt->TYPE_opts));
! if (mt->DISPOSITION_opts)
! free_mime_param (&(mt->DISPOSITION_opts));

! if (mt->pathname0) {
if (mt->unlink) {
DPRINT(Debug,15,(&Debug,
"mime_t_clear: %s marked for unlink\n",
! mt->pathname0));

! if (0 == unlink(mt->pathname0)) {
DPRINT(Debug,14,(&Debug,
"mime_t_clear: %s unlinked\n",
! mt->pathname0));
}
}

! free (mt->pathname0);

} else {
if (mt->unlink) {
***************
*** 72,79 ****
}
}

! mt->pathname = NULL;
!
mt->unlink = 0;

if (mt->dispname)
--- 70,76 ----
}
}

! mt->pathname0 = NULL;
mt->unlink = 0;

if (mt->dispname)
***************
*** 84,93 ****
return;
}

! void
! mime_get_disposition (str, mt)
char *str;
mime_t *mt;
{
char *c, tmp[VERY_LONG_STRING];

--- 81,90 ----
return;
}

! void mime_get_disposition (str, mt, def_charset)
char *str;
mime_t *mt;
+ charset_t def_charset;
{
char *c, tmp[VERY_LONG_STRING];

***************
*** 102,107 ****
--- 99,108 ----
strfcpy (tmp, str, sizeof(tmp));

rfc822_reap_comments (tmp, NULL, 0);
+
+ if (mt->DISPOSITION_opts) {
+ free_mime_param(&(mt->DISPOSITION_opts));
+ }

/* Look for the options field */
if ((c = strchr (tmp, ';')) != NULL) {
***************
*** 112,128 ****
c++;
while (*c && whitespace(*c))
c++;
! mt->disposition_opts = strmcpy (mt->disposition_opts, c);
}
else {
char *d = tmp + strlen(tmp);
while (d > tmp && whitespace(*(d-1)))
d--;
*d = '\0';
- if (mt->disposition_opts) {
- free (mt->disposition_opts);
- mt->disposition_opts = NULL;
- }
}

/* All that's left now is the main disposition */
--- 113,127 ----
c++;
while (*c && whitespace(*c))
c++;
! mt->DISPOSITION_opts = parse_mime_param("Content-Disposition",
! c, def_charset);
!
}
else {
char *d = tmp + strlen(tmp);
while (d > tmp && whitespace(*(d-1)))
d--;
*d = '\0';
}

/* All that's left now is the main disposition */
***************
*** 141,156 ****
mt->disposition = DISP_INLINE;

DPRINT(Debug,9,(&Debug,
! "mime_get_disposition(): disposition=\"%s\" (%d), disposition_opts=\"%s\"\n",
DISPOSITION(mt->disposition),
! mt->disposition,
! NONULL(mt->disposition_opts)));
}

! void
! mime_get_content (str, mt)
char *str;
mime_t *mt;
{
char *c, tmp[VERY_LONG_STRING];

--- 140,154 ----
mt->disposition = DISP_INLINE;

DPRINT(Debug,9,(&Debug,
! "mime_get_disposition(): disposition=\"%s\" (%d)\n",
DISPOSITION(mt->disposition),
! mt->disposition));
}

! void mime_get_content (str, mt, def_charset)
char *str;
mime_t *mt;
+ charset_t def_charset;
{
char *c, tmp[VERY_LONG_STRING];

***************
*** 168,173 ****
--- 166,176 ----

rfc822_reap_comments (tmp, NULL, 0);

+ if (mt->TYPE_opts) {
+ free_mime_param(&(mt->TYPE_opts));
+ }
+
+
/* Look for the options field */
if ((c = strchr (tmp, ';')) != NULL) {
char *d = c;
***************
*** 177,193 ****
c++;
while (*c && whitespace(*c))
c++;
! mt->type_opts = strmcpy (mt->type_opts, c);
}
else {
char *d = tmp + strlen(tmp);
while (d > tmp && whitespace(*(d-1)))
d--;
*d = '\0';
- if (mt->type_opts) {
- free (mt->type_opts);
- mt->type_opts = NULL;
- }
}

/* Get the subtype */
--- 180,194 ----
c++;
while (*c && whitespace(*c))
c++;
! mt->TYPE_opts = parse_mime_param("Content-Type",
! c, def_charset);
!
}
else {
char *d = tmp + strlen(tmp);
while (d > tmp && whitespace(*(d-1)))
d--;
*d = '\0';
}

/* Get the subtype */
***************
*** 217,249 ****
}

DPRINT(Debug,9,(&Debug,
! "mime_get_content(): %p -- type=\"%s\", subtype=\"%s\", opts=\"%s\"\n",
mt->TYPE,
get_major_type_name(mt->TYPE),
! get_subtype_name(mt->TYPE),
! NONULL(mt->type_opts)));

return;
}

! int mime_get_boundary (boundary, opts, size)
! char *opts, *boundary;
! int size;
{
! if (!mime_get_param ("boundary", boundary, opts, size)) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseNoBoundary,
! "'boundary' paramater is missing from Multipart -type!"));
! return 0;
! }

! return 1;
}


int mime_get_charset (charset_value, opts, display_charset,
default_content_charset)
charset_t *charset_value;
! CONST char *opts;
charset_t * display_charset; /* vector */
charset_t default_content_charset;
{
--- 218,253 ----
}

DPRINT(Debug,9,(&Debug,
! "mime_get_content(): %p -- type=\"%s\", subtype=\"%s\"\n",
mt->TYPE,
get_major_type_name(mt->TYPE),
! get_subtype_name(mt->TYPE)));
!

return;
}

! CONST char* mime_get_boundary (opts)
! struct mime_param *opts;
{
!
! CONST char * pv = get_mime_param_compat(opts,"boundary");
!
!
! if (!pv)
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseNoBoundary,
! "'boundary' parameter is missing from Multipart -type!"));

!
!
! return pv;
}


int mime_get_charset (charset_value, opts, display_charset,
default_content_charset)
charset_t *charset_value;
! struct mime_param *opts;
charset_t * display_charset; /* vector */
charset_t default_content_charset;
{
***************
*** 253,261 ****
without loss
*/
int ret = 0,j;
! char buffer[80];

! if (!mime_get_param("charset",buffer,opts,sizeof buffer)) {
if (default_content_charset &&
default_content_charset->MIME_name) {
DPRINT(Debug,9,(&Debug,
--- 257,268 ----
without loss
*/
int ret = 0,j;
! CONST char *pv;

! pv = get_mime_param_compat(opts,"charset");
!
!
! if (!pv) {
if (default_content_charset &&
default_content_charset->MIME_name) {
DPRINT(Debug,9,(&Debug,
***************
*** 265,289 ****
*charset_value = default_content_charset;

/* Charset name is also required on some confitions later */
! strfcpy(buffer,default_content_charset->MIME_name, sizeof buffer);

} else {

! strfcpy(buffer,"US-ASCII", sizeof buffer);
/* Default charset if nothing specified */

! *charset_value = MIME_name_to_charset(buffer,CHARSET_create);
}
} else
! *charset_value = MIME_name_to_charset(buffer,CHARSET_create);

- if (!opts) {
- DPRINT(Debug,9,(&Debug,
- "mime_get_charset: opts=NULL\n"));
- } else {
- DPRINT(Debug,9,(&Debug,
- "mime_get_charset: opts=\"%s\"\n",opts));
- }
DPRINT(Debug,9,(&Debug,
" : charset_value=%p '%s' (type=%p)\n",
*charset_value,
--- 272,289 ----
*charset_value = default_content_charset;

/* Charset name is also required on some confitions later */
! pv = default_content_charset->MIME_name;

} else {

! pv = "US-ASCII";
/* Default charset if nothing specified */

! *charset_value = MIME_name_to_charset(pv,CHARSET_create);
}
} else
! *charset_value = MIME_name_to_charset(pv,CHARSET_create);

DPRINT(Debug,9,(&Debug,
" : charset_value=%p '%s' (type=%p)\n",
*charset_value,
***************
*** 307,319 ****
charset is redefined
*/
display_charset[j]->MIME_name &&
! 0 == istrcmp(buffer,display_charset[j]->MIME_name)) {
ret = 2; /* If display charset */
break;
} else if (charset_superset_of(display_charset[j],*charset_value)) {
ret = 2; /* if charset is subset of display */
break;
! } else if (0 == istrcmp(buffer,"US-ASCII") &&
charset_ok_p(display_charset[j])) {
ret = 2; /* If display_charset can show us-ascii? */
break;
--- 307,319 ----
charset is redefined
*/
display_charset[j]->MIME_name &&
! 0 == istrcmp(pv,display_charset[j]->MIME_name)) {
ret = 2; /* If display charset */
break;
} else if (charset_superset_of(display_charset[j],*charset_value)) {
ret = 2; /* if charset is subset of display */
break;
! } else if (0 == istrcmp(pv,"US-ASCII") &&
charset_ok_p(display_charset[j])) {
ret = 2; /* If display_charset can show us-ascii? */
break;
***************
*** 362,369 ****
ptr->parser_data = NULL;
ptr->handler_data = NULL;

! ptr->type_opts = ptr->disposition_opts =
! ptr->pathname = NULL;
ptr->dispname = NULL;
ptr->description = NULL;

--- 362,369 ----
ptr->parser_data = NULL;
ptr->handler_data = NULL;

! ptr->TYPE_opts = ptr->DISPOSITION_opts = NULL;
! ptr->pathname0 = NULL;
ptr->dispname = NULL;
ptr->description = NULL;

***************
*** 427,439 ****
trg->description = dup_string(src->description);
}

! if (src->type_opts) {
! trg->type_opts = strmcpy(trg->type_opts, src->type_opts);
}

! if (src->disposition_opts) {
! trg->disposition_opts = strmcpy(trg->disposition_opts,
! src->disposition_opts);
}

DPRINT(Debug,15,(&Debug,
--- 427,438 ----
trg->description = dup_string(src->description);
}

! if (src->TYPE_opts) {
! trg->TYPE_opts = copy_mime_param(src->TYPE_opts);
}

! if (src->DISPOSITION_opts) {
! trg->DISPOSITION_opts = copy_mime_param(src->DISPOSITION_opts);
}

DPRINT(Debug,15,(&Debug,
***************
*** 497,503 ****
if (NULL != (this_header =
locate_header_by_name(headers,"Content-Type")) &&
NULL != this_header->body) {
! mime_get_content (this_header->body, ptr);
if (this_header->next_this_header &&
show_header_errors) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseErrorContent,
--- 496,504 ----
if (NULL != (this_header =
locate_header_by_name(headers,"Content-Type")) &&
NULL != this_header->body) {
!
! mime_get_content (this_header->body, ptr, hdr_charset);
!
if (this_header->next_this_header &&
show_header_errors) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseErrorContent,
***************
*** 511,517 ****
if (NULL != (this_header =
locate_header_by_name(headers,"Content-Disposition")) &&
NULL != this_header->body) {
! mime_get_disposition (this_header->body, ptr);
if (this_header->next_this_header &&
show_header_errors) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseErrorDisposition,
--- 512,520 ----
if (NULL != (this_header =
locate_header_by_name(headers,"Content-Disposition")) &&
NULL != this_header->body) {
!
! mime_get_disposition (this_header->body, ptr, hdr_charset);
!
if (this_header->next_this_header &&
show_header_errors) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseErrorDisposition,
***************
*** 578,593 ****
DPRINT(Debug,9,(&Debug,
"parse_mime_headers1: 'Not plain'\n"));
if (no_content_disposition) {
DPRINT(Debug,9,(&Debug,
" : no content-disposition -- auto-attachment = %d\n",
! auto_attachment));
if (get_major_type_code(ptr->TYPE) == MIME_TYPE_APPLICATION &&
! auto_attachment >= 1 ||

get_major_type_code(ptr->TYPE) != MIME_TYPE_TEXT &&
!(get_type_flags(ptr->TYPE) & MIME_RFC822) &&
get_major_type_code(ptr->TYPE) != MIME_TYPE_MULTIPART &&
! auto_attachment >= 2) {
DPRINT(Debug,9,(&Debug,
" : Set disposition = auto attachment\n"));
ptr->disposition = DISP_AUTOATTACH;
--- 581,598 ----
DPRINT(Debug,9,(&Debug,
"parse_mime_headers1: 'Not plain'\n"));
if (no_content_disposition) {
+ int aa = give_dt_enumerate_as_int(&auto_attachment);
+
DPRINT(Debug,9,(&Debug,
" : no content-disposition -- auto-attachment = %d\n",
! aa));
if (get_major_type_code(ptr->TYPE) == MIME_TYPE_APPLICATION &&
! aa >= 1 ||

get_major_type_code(ptr->TYPE) != MIME_TYPE_TEXT &&
!(get_type_flags(ptr->TYPE) & MIME_RFC822) &&
get_major_type_code(ptr->TYPE) != MIME_TYPE_MULTIPART &&
! aa >= 2) {
DPRINT(Debug,9,(&Debug,
" : Set disposition = auto attachment\n"));
ptr->disposition = DISP_AUTOATTACH;
***************
*** 747,753 ****
NOTPLAIN_is_fallback, that may be set on hdr->mime_rec.mime_flags
*/

! if (! (tmp & NOTPLAIN_need_metamail)) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParsingMimeNoMetamail,
"Parsing MIME structure... metamail not needed"));
}
--- 752,759 ----
NOTPLAIN_is_fallback, that may be set on hdr->mime_rec.mime_flags
*/

! if (! (tmp & NOTPLAIN_need_metamail) &&
! ! prompt_metamail) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParsingMimeNoMetamail,
"Parsing MIME structure... metamail not needed"));
}
Index: elm2.4.ME+.122-cvs/melib/mpar_multipart.c
*** elm2.4.ME+.121/melib/mpar_multipart.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/melib/mpar_multipart.c 2005-07-01 12:15:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mpar_multipart.c,v 1.9 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mpar_multipart.c,v 1.11 2005/07/01 09:15:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 89,104 ****
{
int ret = 1; /* Always succeed ... */

! int have_boundary;
! char boundary[STRING];
int opts;
int i;

! int blen, len,last_pos;
long end_offset, debug_pos;
char buf[VERY_LONG_STRING];
char quess_boundary[STRING];
!
if (D->p.multipart->magic != MPAR_multipart_magic)
panic("MIME PARSER PANIC",__FILE__,__LINE__,"mpar_multipart_parse",
"Bad magic number",0);
--- 89,104 ----
{
int ret = 1; /* Always succeed ... */

! CONST char *boundary = NULL;
int opts;
int i;

! int blen = 0, len,last_pos;
long end_offset, debug_pos;
char buf[VERY_LONG_STRING];
char quess_boundary[STRING];
! int ambiguous = 0;
!
if (D->p.multipart->magic != MPAR_multipart_magic)
panic("MIME PARSER PANIC",__FILE__,__LINE__,"mpar_multipart_parse",


"Bad magic number",0);
***************

*** 113,128 ****

fseek (fp, s->offset, SEEK_SET);

! have_boundary = mime_get_boundary (boundary, s->type_opts,
! sizeof (boundary));

opts = get_type_flags(s->TYPE);

DPRINT(Debug,9,(&Debug,
"mpar_multipart_parse- --> length=%d, boundary=%s\n",
! s->length, boundary));

! blen = strlen (boundary);
end_offset = ftell (fp) + s->length;
last_pos = ftell(fp);

--- 113,129 ----

fseek (fp, s->offset, SEEK_SET);

! boundary = mime_get_boundary (s->TYPE_opts);

opts = get_type_flags(s->TYPE);

DPRINT(Debug,9,(&Debug,
"mpar_multipart_parse- --> length=%d, boundary=%s\n",
! s->length,
! boundary ? boundary : "<NONE>"));

! if (boundary)
! blen = strlen (boundary);
end_offset = ftell (fp) + s->length;
last_pos = ftell(fp);

***************
*** 136,149 ****


if (buf[0] == '-' && buf[1] == '-' &&
! strncmp (buf + 2, boundary, blen) == 0) {

header_list_ptr headers = NULL;
long part_offset;
long body_offset;

/* If we matched to null boundary */
! if (!have_boundary && len > 3) {
int x;
strnfcpy(quess_boundary,buf+2,len-2,sizeof quess_boundary,
&x);
--- 137,151 ----


if (buf[0] == '-' && buf[1] == '-' &&
! (!boundary ||
! strncmp (buf + 2, boundary, blen) == 0)) {

header_list_ptr headers = NULL;
long part_offset;
long body_offset;

/* If we matched to null boundary */
! if (!boundary && len > 3) {
int x;
strnfcpy(quess_boundary,buf+2,len-2,sizeof quess_boundary,
&x);
***************
*** 159,174 ****
"mpar_multipart_parse: Quessing boundary: %Q, len=%d\n",
quess_boundary,x));

! strfcpy(boundary,quess_boundary,sizeof boundary);
blen = x;
- have_boundary = 1;

lib_error(CATGETS(elm_msg_cat, MeSet,
MeParseQuessMultipart,
"Quessing multipart boundary"));

}
! }

/* Save the length of the previous part */
if (D->p.multipart->part_count > 0) {
--- 161,189 ----
"mpar_multipart_parse: Quessing boundary: %Q, len=%d\n",
quess_boundary,x));

! boundary = quess_boundary;
blen = x;

lib_error(CATGETS(elm_msg_cat, MeSet,
MeParseQuessMultipart,
"Quessing multipart boundary"));

}
!
! /* handle some ambiguous multipart boundary prefixes */
! } else if (len > blen+2 &&
! ' ' != buf[blen+2] &&
! '-' != buf[blen+2] &&
! '\t' != buf[blen+2] &&
! '\r' != buf[blen+2] &&
! '\n' != buf[blen+2]) {
!
! if (ambiguous++ == 0)
! lib_error(CATGETS(elm_msg_cat, MeSet,
! MeParseAmbiguousMultipart,
! "Ambiguous multipart boundary prefix"));
! goto noboundary;
! }

/* Save the length of the previous part */
if (D->p.multipart->part_count > 0) {
***************
*** 226,231 ****
--- 241,248 ----

}

+ noboundary: ;
+
{ /* mark position before CR LF */
int pos = ftell(fp);
if (len > 1 && buf[len-2] == '\r' && buf[len-1] == '\n')
Index: elm2.4.ME+.122-cvs/melib/parse_util.c
*** elm2.4.ME+.121/melib/parse_util.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/melib/parse_util.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: parse_util.c,v 1.24 2004/03/27 18:31:43 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: parse_util.c,v 1.27 2005/07/06 08:42:42 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 22,35 ****
panic("HEADER PANIC",f,ln,pr,ms,0);
}

- static unsigned char * us_str P_((char *str));
- static unsigned char * us_str(str)
- char *str;
- {
- return (unsigned char *)str;
- }
-
-
long skip_envelope(hdr, fp)
struct header_rec *hdr;
FILE *fp;
--- 22,27 ----
***************
*** 154,175 ****
return 1;
}

- struct string * NULL_header_converter (hdr,demime,defcharset)
- header_list_ptr hdr;
- int demime;
- charset_t defcharset;
- {
- struct string * result = NULL;
-
- if (hdr -> magic != HEADER_magic)
- header_panic(__FILE__,__LINE__,
- "NULL_header_converter","Bad magic number");
-
-
- result = new_string2(defcharset,us_str(hdr->body));
-
- return result;
- }

void state_write_header(s,next,demime,defcharset)
out_state_t * s;
--- 146,151 ----
***************
*** 179,197 ****
{


struct string *buffer = NULL;

int X,L1;

DPRINT(Debug,13,(&Debug,
! "state_write_header: Writing header '%s': demime=%d defcharset=%s (charset filter=%s output charset=%s)",
give_header_name(next->header_name),
demime,
defcharset && defcharset -> MIME_name ?
defcharset -> MIME_name : "<not set>",
s -> filter && s -> filter -> MIME_name ?
! s -> filter -> MIME_name : "<not set>",
! s -> display_charset[0] &&
! s -> display_charset[0] -> MIME_name ?
! s -> display_charset[0] -> MIME_name :
! "<not set>"));

buffer = give_decoded_header(next,demime,defcharset);

--- 155,171 ----
{


struct string *buffer = NULL;

int X,L1;
+ charset_t Y;
+ int j;

DPRINT(Debug,13,(&Debug,
! "state_write_header: Writing header '%s': demime=%d defcharset=%s (charset filter=%s)",
give_header_name(next->header_name),
demime,
defcharset && defcharset -> MIME_name ?
defcharset -> MIME_name : "<not set>",
s -> filter && s -> filter -> MIME_name ?
! s -> filter -> MIME_name : "<not set>"));

buffer = give_decoded_header(next,demime,defcharset);

***************
*** 200,205 ****
--- 174,201 ----
buffer -> string_type -> MIME_name :
"<not set>"));

+ /* Use current header charset as filter .... */
+ Y = s->filter;
+
+ for (j = 0; s->display_charset[j]; j++) {
+
+ DPRINT(Debug,13,(&Debug,
+ " output charset [%d]: %s\n",
+ j,
+ s -> display_charset[j] -> MIME_name ?
+ s -> display_charset[j] -> MIME_name :
+ "<no MIME name>"));
+
+ if (match_charset_name(s->display_charset[j], buffer->string_type)) {
+ s->filter = buffer->string_type;
+
+ DPRINT(Debug,13,(&Debug,
+ "state_write_header: Setting charset filter to %s\n",
+ s -> filter -> MIME_name ?
+ s -> filter -> MIME_name : "<no MIME name>"));
+ }
+ }
+
state_add_prefix(s);
state_puts(give_header_name(next->header_name),s);
state_puts(": ",s);
***************
*** 231,237 ****
state_putc('\t',s);
}

! state_printf(s,FRM("%S\n"),data);
X++;

free_string(&data);
--- 227,234 ----
state_putc('\t',s);
}

! state_printf(s,FRM("%S"),data);
! state_putc('\n',s);
X++;

free_string(&data);
***************
*** 246,251 ****
--- 243,250 ----
state_nlputs("\n",s);
}
free_string(&buffer);
+
+ s->filter = Y;
}

void state_write_headers(s,hdr,filter,flag,demime,defcharset)
Index: elm2.4.ME+.122-cvs/melib/partial.c
*** elm2.4.ME+.121/melib/partial.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/melib/partial.c 2005-07-01 12:15:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.8 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: partial.c,v 1.10 2005/07/01 09:15:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 38,46 ****
mime_t * reference;
{
int i;
! char id[100];
! char number[100];
! char total[100];

/* Already collected? */
for (i = 0; i < mss->partial_len; i++) {
--- 38,47 ----
mime_t * reference;
{
int i;
! CONST char *id;
! CONST char *number;
! CONST char *total;
!

/* Already collected? */
for (i = 0; i < mss->partial_len; i++) {
***************
*** 48,56 ****

return (& (mss->partial_vector[i] ));
}

! if (!mime_get_param ("id", id, reference->type_opts,
! sizeof id)) {

DPRINT(Debug,11,(&Debug,
"reg_partial: No id paramater -- corrupted.\n"));
--- 49,58 ----

return (& (mss->partial_vector[i] ));
}
+
+ id = get_mime_param_compat(reference->TYPE_opts,"id");

! if (!id) {

DPRINT(Debug,11,(&Debug,
"reg_partial: No id paramater -- corrupted.\n"));
***************
*** 58,66 ****
return NULL;
}

!
! if (!mime_get_param ("number", number, reference->type_opts,
! sizeof number)) {

DPRINT(Debug,11,(&Debug,
"reg_partial: No number paramater -- corrupted.\n"));
--- 60,67 ----
return NULL;
}

! number = get_mime_param_compat(reference->TYPE_opts,"number");
! if (!number) {

DPRINT(Debug,11,(&Debug,
"reg_partial: No number paramater -- corrupted.\n"));
***************
*** 77,87 ****
mss->partial_vector[mss->partial_len].number = atoi(number);
mss->partial_vector[mss->partial_len].total = -1;

! if (mime_get_param ("total", total, reference->type_opts,
! sizeof total)) {
!
! mss->partial_vector[mss->partial_len].total = atoi(total);
! }

return & (mss->partial_vector[mss->partial_len++]);
}
--- 78,86 ----
mss->partial_vector[mss->partial_len].number = atoi(number);
mss->partial_vector[mss->partial_len].total = -1;

! total = get_mime_param_compat(reference->TYPE_opts,"total");
! if (total)
! mss->partial_vector[mss->partial_len].total = atoi(total);

return & (mss->partial_vector[mss->partial_len++]);
}
***************
*** 96,108 ****
mime_t *p;
struct header_rec * hdr;
{
! char id[100];
! char number[100];

int ret = 0;

! if (!mime_get_param ("id", id, p->type_opts,
! sizeof id)) {

DPRINT(Debug,11,(&Debug,
"partial_selector: No id parameter -- corrupted.\n"));
--- 95,109 ----
mime_t *p;
struct header_rec * hdr;
{
! CONST char *id;
! CONST char *number;

int ret = 0;
+ int fh = give_dt_enumerate_as_int(&fragment_handling);
+
+ id = get_mime_param_compat(p->TYPE_opts,"id");

! if (!id) {

DPRINT(Debug,11,(&Debug,
"partial_selector: No id parameter -- corrupted.\n"));
***************
*** 110,117 ****
ret |= NOTPLAIN_need_metamail;
}

! if (!mime_get_param ("number", number, p->type_opts,
! sizeof number)) {

DPRINT(Debug,11,(&Debug,
"partial_selector: No number paremater -- corrupted.\n"));
--- 111,118 ----
ret |= NOTPLAIN_need_metamail;
}

! number = get_mime_param_compat(p->TYPE_opts,"number");
! if (!number) {

DPRINT(Debug,11,(&Debug,
"partial_selector: No number paremater -- corrupted.\n"));
***************
*** 123,129 ****
1 == manual,
2 == auto */

! if (0 == fragment_handling)
ret |= NOTPLAIN_need_metamail;

DPRINT(Debug,11,(&Debug,
--- 124,130 ----
1 == manual,
2 == auto */

! if (0 == fh)
ret |= NOTPLAIN_need_metamail;

DPRINT(Debug,11,(&Debug,
***************
*** 142,147 ****
--- 143,149 ----
struct header_rec *mss;
{
int print = 0;
+ int fh = give_dt_enumerate_as_int(&fragment_handling);

state_nlputs("\n[ ",s_out);

***************
*** 172,178 ****
1 == manual,
2 == auto */

! if (1 == fragment_handling && print &&
ptr == & mss->mime_rec && s_out->displaying)
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MeAssembleCommand,
--- 174,180 ----
1 == manual,
2 == auto */

! if (1 == fh && print &&
ptr == & mss->mime_rec && s_out->displaying)
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MeAssembleCommand,
Index: elm2.4.ME+.122-cvs/melib/pgp_decode.c
*** elm2.4.ME+.121/melib/pgp_decode.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/melib/pgp_decode.c 2005-07-05 23:44:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.40 2004/07/21 09:00:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.45 2005/07/05 20:44:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 418,443 ****
return(code);
}

! static int pgp_mime_opts P_((char *));

static int pgp_mime_opts (s)
! char *s;
! {
! char value[STRING];
!
if (s) {
! if (mime_get_param ("format", value, s, sizeof(value))) {
! if (istrcmp (value, "keys-only") == 0)
return PGP_PUBLIC_KEY;
}
! if (mime_get_param ("x-action", value, s, sizeof (value))) {
! if (istrcmp (value, "encryptsign") == 0)
return (PGP_MESSAGE | PGP_SIGNED_MESSAGE);
! else if (istrcmp (value, "encrypt") == 0)
return PGP_MESSAGE;
! else if (istrcmp (value, "sign") == 0)
return PGP_SIGNED_MESSAGE;
! else if (istrcmp (value, "signclear") == 0)
return PGP_SIGNED_MESSAGE;
}
}
--- 418,446 ----
return(code);
}

! static int pgp_mime_opts P_((struct mime_param *s));

static int pgp_mime_opts (s)
! struct mime_param *s;
! {
if (s) {
! CONST char *pv;
!
! pv = get_mime_param_compat(s,"format");
! if (pv) {
! if (istrcmp (pv, "keys-only") == 0)
return PGP_PUBLIC_KEY;
}
!
! pv = get_mime_param_compat(s,"x-action");
! if (pv) {
! if (istrcmp (pv, "encryptsign") == 0)
return (PGP_MESSAGE | PGP_SIGNED_MESSAGE);
! else if (istrcmp (pv, "encrypt") == 0)
return PGP_MESSAGE;
! else if (istrcmp (pv, "sign") == 0)
return PGP_SIGNED_MESSAGE;
! else if (istrcmp (pv, "signclear") == 0)
return PGP_SIGNED_MESSAGE;
}
}
***************
*** 447,452 ****
--- 450,457 ----
enum pgp_version decode_pgp_version(c)
char * c;
{
+ int se = give_dt_enumerate_as_int(&send_pgp_version);
+
if (0 == strncmp(c,"2.",2)) {
DPRINT(Debug,4,(&Debug,
"decode_pgp_version: Version -- PGP 2\n"));
***************
*** 461,467 ****
if ('/' == pgp5_dir[0])
return pgp5;
else
! return send_pgp_version;
}
}

--- 466,472 ----
if ('/' == pgp5_dir[0])
return pgp5;
else
! return (enum pgp_version) se;
}
}

***************
*** 545,559 ****
int was_binary = 0;
in_state_t newstate2;
enum pgp_version version;

in_state_clear(&newstate2,STATE_in_file);

raw = sr_call_RawState ();

! if (mime_get_param ("format", buffer, m->type_opts, sizeof (buffer)) &&
! (istrcmp (buffer, "mime") == 0)) {
char * tempfile = elm_message(FRM("%selmPT%d"),
! temp_dir, getpid ());

nested = TRUE;
DPRINT(Debug,3,(&Debug,
--- 550,572 ----
int was_binary = 0;
in_state_t newstate2;
enum pgp_version version;
+ char *tmp;
+ CONST char *pv;
+

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ return;
+

in_state_clear(&newstate2,STATE_in_file);

raw = sr_call_RawState ();

! if (
! (pv = get_mime_param_compat(m->TYPE_opts,"format")) &&
! (istrcmp (pv, "mime") == 0)) {
char * tempfile = elm_message(FRM("%selmPT%d"),
! tmp, getpid ());

nested = TRUE;
DPRINT(Debug,3,(&Debug,
***************
*** 578,584 ****
else
tmpfp = NULL;

! opts = pgp_mime_opts (m->type_opts);

buffer[0] = '\0';
if (opts & PGP_PUBLIC_KEY) {
--- 591,597 ----
else
tmpfp = NULL;

! opts = pgp_mime_opts(m->TYPE_opts);

buffer[0] = '\0';
if (opts & PGP_PUBLIC_KEY) {
***************
*** 1030,1036 ****
mime_t *sign;
in_state_t *state_in;
out_state_t *state_out;
! char *micalg;
charset_t defcharset;
struct header_rec *mss;
{
--- 1043,1049 ----
mime_t *sign;
in_state_t *state_in;
out_state_t *state_out;
! const char *micalg;
charset_t defcharset;
struct header_rec *mss;
{
***************
*** 1224,1229 ****
--- 1237,1246 ----
FILE *decode_fp;
FILE *tmpfp;
in_state_t newstate2;
+ char *tmp;
+

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+

in_state_clear(&newstate2,STATE_in_file);

***************
*** 1238,1244 ****
}

tempfile = elm_message(FRM("%selmPT%d"),
! temp_dir, getpid ());

if (NULL == (tmpfp = safeopen_rdwr(tempfile))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantCreate,
--- 1255,1261 ----
}

tempfile = elm_message(FRM("%selmPT%d"),
! tmp, getpid ());

if (NULL == (tmpfp = safeopen_rdwr(tempfile))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantCreate,
***************
*** 1386,1392 ****

set_in_state_file(tmpfp,&s2_in);

! /* Pass NULL as message, because this is encryoted section */
mime_decode (tmpmt, &s2_in, state_out, defcharset, NULL);

mime_t_clear(tmpmt);
--- 1403,1409 ----

set_in_state_file(tmpfp,&s2_in);

! /* Pass NULL as message, because this is encrypted section */
mime_decode (tmpmt, &s2_in, state_out, defcharset, NULL);

mime_t_clear(tmpmt);
Index: elm2.4.ME+.122-cvs/nls/C/C/C/s_aliases.m
*** elm2.4.ME+.121/nls/C/C/C/s_aliases.m 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.122-cvs/nls/C/C/C/s_aliases.m 2005-01-22 11:20:56.000000000 +0200
***************
*** 10,21 ****
4 [Keeping %d aliases and deleting %d.]
$ #DeleteAll
5 [Deleting all aliases.]
- $ #Select
- 7 Alias mode: %d shown out of %d %S[ELM %s]
- $ #Single
- 8 Alias mode: 1 alias %S[ELM %s]
- $ #Plural
- 9 Alias mode: %d aliases %S[ELM %s]
$ #RMenuLn1
10 You can use any of the following commands by pressing the first character;
$ #RMenuLn2
--- 10,15 ----
***************
*** 147,154 ****
92 Processed %d aliases. Re-reading the database...
$ #UpdatedOK
93 Aliases updated successfully.
- $ #ShortKey
- 95 "Key: "
$ #LongKey
96 "Key you want help for: "
$ #KeyMenu
--- 141,146 ----
***************
*** 245,247 ****
--- 237,241 ----
144 "(modified, resync needed) "
$ #AddressAs1
145 Messages addressed as: %s
+ $ #Mode
+ 146 Alias mode
Index: elm2.4.ME+.122-cvs/nls/C/C/C/s_elm.m
*** elm2.4.ME+.121/nls/C/C/C/s_elm.m 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/nls/C/C/C/s_elm.m 2005-07-01 19:05:29.000000000 +0300
***************


*** 321,327 ****
$ #NoMailToCheck
167 No mail to check.
$ #FileHelpmsg1
! 168 "\n\n\rYou must specify a file or folder to "
$quote
$ #FileHelpmsg2
169 to. Several options\n\rare available:\n\r\
--- 321,327 ----
$ #NoMailToCheck
167 No mail to check.
$ #FileHelpmsg1
! 168 "You must specify a file or folder to "
$quote
$ #FileHelpmsg2
169 to. Several options\n\rare available:\n\r\

***************
*** 391,397 ****
$ #NoPermRead
213 You have no permission to read %s!\n\r
$ #NoMail
! 214 You have no mail.\n\r
$ #MailBeingForwarded
215 Your mail is being forwarded to %s.\n\r
$ #SeekFailed
--- 391,397 ----
$ #NoPermRead
213 You have no permission to read %s!\n\r
$ #NoMail
! 214 You have no mail.
$ #MailBeingForwarded

Kari E. Hurtta

unread,
Jul 13, 2005, 5:48:23 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.10

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 10/18
=========================================================================

! if (give_dt_sort_as_int(&alias_sortby) < 0) {
! switch (- give_dt_sort_as_int(&alias_sortby)) {
case ALIAS_SORT : return(
pad? "Reverse Alias Name " :
abr? "Reverse-Alias" :
***************
*** 173,179 ****
}
}
else {
! switch (alias_sortby) {
case ALIAS_SORT : return(
pad? "Alias Name " :
abr? "Alias" :
--- 171,177 ----
}
}
else {
! switch (give_dt_sort_as_int(&alias_sortby)) {
case ALIAS_SORT : return(
pad? "Alias Name " :
abr? "Alias" :
Index: elm2.4.ME+.122-cvs/src/attach_menu.c
*** elm2.4.ME+.121/src/attach_menu.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/src/attach_menu.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.68 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.68 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.91 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.91 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,43 ****
return (unsigned char *)str;
}

- static int can_save(filename)
- char *filename;
- {
- if (access(filename,ACCESS_EXISTS) < 0) {
- if (errno == ENOENT)
- return 1; /* File not exists -- can save ! */
- return 0; /* Other error -- don't save with that name ! */
- } else
- return 0; /* File exits -- don't save over ! */
- }
-
static FILE * get_attachment P_((FILE *F,
mime_t *att));

--- 27,32 ----
***************
*** 51,70 ****
mime_panic(__FILE__,__LINE__,"get_attachment",
"Bad magic number");

! if (att->pathname) {
! if (can_open(att->pathname,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadableUser,
! "%.50s isn't readable by user!"),
! att->pathname);
sleep_message();
return NULL;
}

! result = fopen(att->pathname,"r");
if (!result) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenAttach,
! "Can't open attachment: %.50s"),
! att->pathname);
sleep_message();
}
} else {
--- 40,60 ----
mime_panic(__FILE__,__LINE__,"get_attachment",
"Bad magic number");

! if (att->pathname0) {
!
! if (can_open(att->pathname0,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadableUser,
! "%S isn't readable by user!"),
! att->dispname);
sleep_message();
return NULL;
}

! result = fopen(att->pathname0,"r");
if (!result) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenAttach,
! "Can't open attachment: %S"),
! att->dispname);
sleep_message();
}
} else {
***************
*** 105,111 ****
mime_panic(__FILE__,__LINE__,"attachment_copy",
"Bad magic number");

! if (att->pathname) { /* Already decoded */
char buf[VERY_LONG_STRING];
int len;
while (0 < (len = fread(buf,1,sizeof(buf),tmpfd))) {
--- 95,101 ----
mime_panic(__FILE__,__LINE__,"attachment_copy",
"Bad magic number");

! if (att->pathname0) { /* Already decoded */
char buf[VERY_LONG_STRING];
int len;
while (0 < (len = fread(buf,1,sizeof(buf),tmpfd))) {
***************
*** 117,125 ****
}
}
if (ferror(tmpfd)) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReading,
! "Error reading from %.50s"),
! att->pathname);
sleep_message();
}
} else { /* Needs decode */
--- 107,115 ----
}
}
if (ferror(tmpfd)) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadingS,
! "Error reading from %S"),
! att->dispname);
sleep_message();
}
} else { /* Needs decode */
***************
*** 153,167 ****

static void attach_print P_((FILE *F,
mime_t *att,
! charset_t defcharset));
! static void attach_print (F,att, defcharset)
FILE *F;
mime_t *att;
charset_t defcharset;
{
char tempfile[STRING];
char buf1[VERY_LONG_STRING];
!

if (att->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"attach_print",
"Bad magic number");
--- 143,160 ----

static void attach_print P_((FILE *F,
mime_t *att,
! charset_t defcharset,
! struct menu_context *page));
! static void attach_print (F,att, defcharset,page)
FILE *F;
mime_t *att;
charset_t defcharset;
+ struct menu_context *page;
{
char tempfile[STRING];
char buf1[VERY_LONG_STRING];
! char *tmp;
!

if (att->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"attach_print",
"Bad magic number");
***************
*** 169,176 ****
if (!have_printout())
return;

elm_sfprintf(tempfile,sizeof tempfile,
! FRM("%selm.%d"), temp_dir, getpid());

if (get_major_type_code(att->TYPE) == MIME_TYPE_TEXT &&
istrcmp(get_subtype_name(att->TYPE),"plain") == 0) {
--- 162,173 ----
if (!have_printout())
return;



+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ return;
+

elm_sfprintf(tempfile,sizeof tempfile,
! FRM("%selm.%d"), tmp, getpid());

if (get_major_type_code(att->TYPE) == MIME_TYPE_TEXT &&
istrcmp(get_subtype_name(att->TYPE),"plain") == 0) {
***************
*** 215,227 ****
DPRINT(Debug,3,
(&Debug,"attach_print: printing via metamail: %s\n",
metamail_path));
! if (att->pathname)
elm_sfprintf(buf1,sizeof buf1,
FRM("%s -m Elm -h -b -c %s/%s %s"),
metamail_path,
get_major_type_name(att->TYPE),
get_subtype_name(att->TYPE),
! att->pathname);
else {
char copy_buf[VERY_LONG_STRING];
FILE *fpout;
--- 212,224 ----
DPRINT(Debug,3,
(&Debug,"attach_print: printing via metamail: %s\n",
metamail_path));
! if (att->pathname0)
elm_sfprintf(buf1,sizeof buf1,
FRM("%s -m Elm -h -b -c %s/%s %s"),
metamail_path,
get_major_type_name(att->TYPE),
get_subtype_name(att->TYPE),
! att->pathname0);
else {
char copy_buf[VERY_LONG_STRING];
FILE *fpout;
***************
*** 278,283 ****
--- 275,281 ----
PressAnyKeyToContinue();

Raw(ON);
+ menu_trigger_redraw(page);
}
else
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNotKnowPrint,
***************
*** 285,302 ****

}

static void attach_save P_((FILE *F,
! mime_t *a, int *redraw,
struct AliasView *aview,
! struct menu_context *page));
! static void attach_save (F,a,redraw,aview, page)
FILE *F;
mime_t *a;
- int *redraw;


struct AliasView *aview;
struct menu_context *page;

{
! char buf[VERY_LONG_STRING], tmp[STRING];
int bytes=0, err, is_text;
in_state_t state_in;
FILE *f_in = NULL;
--- 283,344 ----

}

+ struct string * pick_name(str)


+ const struct string *str;
+ {

+ int L = string_len(str);


+ struct string *ret = NULL;
+

+ int i;


+ int pos = 0;
+

+ for (i = 0; i < L; i++) {
+ uint16 code = give_unicode_from_string(str,i);
+
+ if (0x002F /* / */ == code ||
+ code < 0x0020 ||


+ 0x005C /* \ */ == code)

+ pos = i+1;
+ }
+
+
+ ret = clip_from_string(str,&pos,L);


+
+ return ret;
+ }
+

+ static CONST char * pick_name_ascii P_((const char *str));
+ static CONST char * pick_name_ascii(str)
+ const char *str;
+ {
+ const char *ret = str;
+ const char *p;
+
+ for (p = str; *p; p++) {
+ if ('/' == *p ||
+ '\\' == *p ||
+ isascii(*p) && iscntrl(*p))
+ ret = p+1;


+ }
+
+ return ret;
+ }
+
+
+

static void attach_save P_((FILE *F,
! mime_t *a,

struct AliasView *aview,
! struct menu_context *page,
! struct screen_parts *LOC));

! static void attach_save (F,a,aview, page, LOC)
FILE *F;
mime_t *a;
struct AliasView *aview;
struct menu_context *page;
+ struct screen_parts *LOC;
{
! char buf[VERY_LONG_STRING];
int bytes=0, err, is_text;
in_state_t state_in;
FILE *f_in = NULL;
***************
*** 329,412 ****

if (get_major_type_code(a->TYPE) == MIME_TYPE_APPLICATION &&
istrcmp (get_subtype_name(a->TYPE), "octet-stream") == 0) {
!
/* See if there is a name=<...> field for the default filename */
! tmp[0] = '\0';
! if (a->type_opts &&
! mime_get_param ("name", tmp, a->type_opts, sizeof(tmp))) {
!
! char *newname = NULL;
!
! char *p = strrchr (tmp, '/');
! if (p)
! p++;
! else
! p = tmp;

! if (use_attachment_dir) {
! char * work = elm_message(FRM("%s/%s"),
! attachment_dir,
! p);

- if (can_save(work)) {
- if (savefile)
- free_string(&savefile);
- savefile = format_string(FRM("{doc}/%s"),s2us(p));
}


! free(work);

} else {
! if (can_save(p)) {
if (savefile)
free_string(&savefile);
! savefile = new_string2(system_charset,s2us(p));
}
}
!
}
}

/* See if there is a filename=<...> field for the default filename */
- tmp[0] = '\0';
- if (a->disposition_opts &&
- mime_get_param ("filename", tmp, a->disposition_opts, sizeof(tmp))) {
- char *p = strrchr (tmp, '/');
- if (p)
- p++;
- else
- p = tmp;

! if (use_attachment_dir) {
! char * work = elm_message(FRM("%s/%s"),
! attachment_dir,
! p);

! if (can_save(work)) {
! if (savefile)
! free_string(&savefile);
! savefile = format_string(FRM("{doc}/%s"),s2us(p));
}


! free(work);
!
! } else {
! if (can_save(p)) {
! if (savefile)
! free_string(&savefile);
! savefile = new_string2(system_charset,s2us(p));
}
}

}
!
!
if (!savefile && use_attachment_dir)
savefile = format_string(FRM("{doc}/"));

! code = file_browser(page,br,&savefile,redraw,word_save,
aview,
CATGETS(elm_msg_cat, MeSet, MeToFile,
"To file: "));
--- 371,506 ----

if (get_major_type_code(a->TYPE) == MIME_TYPE_APPLICATION &&
istrcmp (get_subtype_name(a->TYPE), "octet-stream") == 0) {


!
! int mp = give_dt_enumerate_as_int(&mime_parameters);

! CONST struct string *pv;
! CONST char * pva;
! struct string * testname = NULL;


!
! /* 0 == plain
! 1 == encoded
! 2 == plain-and-encoded
! */
!
!
!

/* See if there is a name=<...> field for the default filename */
!

! if ( mp &&
! (pv = get_mime_param(a->TYPE_opts,"name"))) {
!
! struct string * p = pick_name(pv);
!
! if (p) {
! if (use_attachment_dir) {
! testname = format_string(FRM("{doc}/%S"),p);
!
! } else {
! testname = format_string(FRM("./%S"),p);

}

+ free_string(&p);
+ }
+ } else if ((pva = get_mime_param_compat(a->TYPE_opts,"name"))) {

! CONST char * p = pick_name_ascii(pva);

+ if (use_attachment_dir) {
+ testname = format_string(FRM("{doc}/%s"),p);
+
} else {
! testname = format_string(FRM("./%s"),p);
!
! }
! }
!
! if (testname) {
! int ok = select_dir_item(br,&testname);
!
! if (ok) {
! int flags = give_dir_flags(br);
!
! if (0 == (flags & BROWSER_EXIST)) {
if (savefile)
free_string(&savefile);
! savefile = dup_string(testname);
}
}
!
! free_string(&testname);
}
+
}

+
/* See if there is a filename=<...> field for the default filename */

!
! {
!

! int mp = give_dt_enumerate_as_int(&mime_parameters);

! CONST struct string *pv;
! CONST char * pva;
! struct string * testname = NULL;


!
!
!
! if ( mp &&

! (pv = get_mime_param(a->DISPOSITION_opts,"filename"))) {
!
! struct string * p = pick_name(pv);
!
! if (p) {
! if (use_attachment_dir) {
! testname = format_string(FRM("{doc}/%S"),p);
!
! } else {
! testname = format_string(FRM("./%S"),p);
!
! }

! free_string(&p);
}

+ } else if ( (pva = get_mime_param_compat(a->DISPOSITION_opts,"filename"))) {
+
+ CONST char * p = pick_name_ascii(pva);
+
+ if (p) {
+ if (use_attachment_dir) {
+ testname = format_string(FRM("{doc}/%s"),p);
+
+ } else {
+ testname = format_string(FRM("./%s"),p);


+
+ }
+ }
+ }
+

+ if (testname) {
+ int ok = select_dir_item(br,&testname);

! if (ok) {
! int flags = give_dir_flags(br);
!
! if (0 == (flags & BROWSER_EXIST)) {
! if (savefile)
! free_string(&savefile);
! savefile = dup_string(testname);
! }
}
+
+ free_string(&testname);
}

}
!
if (!savefile && use_attachment_dir)
savefile = format_string(FRM("{doc}/"));

! code = file_browser(page,br,&savefile,word_save,
aview,
CATGETS(elm_msg_cat, MeSet, MeToFile,
"To file: "));
***************
*** 503,519 ****
state_out.prefix = NULL;
state_out.displaying = 0;

! if (a->encoding == ENCODING_BASE64 && !a->pathname)
base64_decode (&state_in, &state_out, a->length, is_text);
! else if (a->encoding == ENCODING_QUOTED && !a->pathname)
quoted_printable_decode (&state_in, &state_out, a->length,
is_text);
! else if (a->encoding == ENCODING_UUENCODED && !a->pathname)
uudecode (&state_in, &state_out, a->length, is_text);
else {
if (a->encoding != ENCODING_NONE && a->encoding != ENCODING_7BIT &&
a->encoding != ENCODING_8BIT && a->encoding != ENCODING_BINARY
! && !a->pathname) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnsupportedEncoding,
"Unsupported encoding! Decode manually!"));
sleep_message();
--- 597,613 ----
state_out.prefix = NULL;
state_out.displaying = 0;

! if (a->encoding == ENCODING_BASE64 && !a->pathname0)
base64_decode (&state_in, &state_out, a->length, is_text);
! else if (a->encoding == ENCODING_QUOTED && !a->pathname0)
quoted_printable_decode (&state_in, &state_out, a->length,
is_text);
! else if (a->encoding == ENCODING_UUENCODED && !a->pathname0)
uudecode (&state_in, &state_out, a->length, is_text);
else {
if (a->encoding != ENCODING_NONE && a->encoding != ENCODING_7BIT &&
a->encoding != ENCODING_8BIT && a->encoding != ENCODING_BINARY
! && !a->pathname0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnsupportedEncoding,
"Unsupported encoding! Decode manually!"));
sleep_message();
***************
*** 560,565 ****
--- 654,664 ----
if (savefile)
free_string(&savefile);
free_dir(&br);
+
+
+ menu_trigger_redraw(LOC->prompt_page);
+ menu_trigger_redraw(LOC->menu_page);
+
return;
}

***************
*** 580,589 ****
mime_panic(__FILE__,__LINE__,"attach_edit",
"Bad magic number");

! if (!ptr->pathname)
return;

! if (-1 == stat (ptr->pathname, &sb)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStat,
"Can't stat file!"));
sleep_message();
--- 679,688 ----
mime_panic(__FILE__,__LINE__,"attach_edit",
"Bad magic number");

! if (!ptr->pathname0)
return;

! if (-1 == stat (ptr->pathname0, &sb)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStat,
"Can't stat file!"));
sleep_message();
***************
*** 594,610 ****


if (!editor_val ||
! strlen(ptr->pathname) + strlen(editor_val) > STRING-5)
return;
savetime = sb.st_mtime;

Raw(OFF);
elm_sfprintf (buf, sizeof buf,
! FRM("%s %s"), editor_val, ptr->pathname);
system_call (buf, 0, NULL);
Raw(ON);

! if (stat (ptr->pathname, &sb) == -1 || sb.st_mtime != savetime)
(void) attach_info (ptr,mailer_info,0); /* update the information on this attachment */
return;
}
--- 693,709 ----


if (!editor_val ||
! strlen(ptr->pathname0) + strlen(editor_val) > STRING-5)
return;
savetime = sb.st_mtime;

Raw(OFF);
elm_sfprintf (buf, sizeof buf,
! FRM("%s %s"), editor_val, ptr->pathname0);
system_call (buf, 0, NULL);
Raw(ON);

! if (stat (ptr->pathname0, &sb) == -1 || sb.st_mtime != savetime)
(void) attach_info (ptr,mailer_info,0); /* update the information on this attachment */
return;
}
***************
*** 650,667 ****
tmp.pgp = 0;
#endif

! if (a->pathname) {
menu_ClearScreen(page); /* Extra clear for mime_parse_routine ... */

! if (can_open(a->pathname,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadableUser,
! "%.50s isn't readable by user!"),
! a->pathname);
sleep_message();
return;
}

! tmpfp = fopen (a->pathname, "r");
if (! tmpfp) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldOpenReading,
"Could not open file for reading!"));
--- 749,766 ----
tmp.pgp = 0;
#endif

! if (a->pathname0) {
menu_ClearScreen(page); /* Extra clear for mime_parse_routine ... */

! if (can_open(a->pathname0,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadableUser,
! "%S isn't readable by user!"),
! a->dispname);
sleep_message();
return;
}

! tmpfp = fopen (a->pathname0, "r");
if (! tmpfp) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldOpenReading,
"Could not open file for reading!"));
***************
*** 670,678 ****
}

tmp.mime_rec.TYPE = a->TYPE;
! if (a->type_opts) {
! tmp.mime_rec.type_opts = strmcpy(tmp.mime_rec.type_opts,
! a->type_opts);
}

tmp.mime_rec.mime_flags = a->mime_flags;
--- 769,776 ----
}

tmp.mime_rec.TYPE = a->TYPE;
! if (a->TYPE_opts) {
! tmp.mime_rec.TYPE_opts = copy_mime_param(a->TYPE_opts);
}

tmp.mime_rec.mime_flags = a->mime_flags;
***************
*** 684,695 ****
tmp.mime_rec.disposition = DISP_INLINE; /* Show it ! */
tmp.offset = tmp.mime_rec.offset = 0;
tmp.mime_rec.encoding = ENCODING_7BIT;
! stat(a->pathname, &sb);
tmp.content_length = tmp.mime_rec.length = sb.st_size;
mime_parse_routine(NULL,&tmp, tmpfp);

! }
! else {

/* Make copy of mime structure: */
mime_t_copy(&(tmp.mime_rec),a);
--- 782,792 ----
tmp.mime_rec.disposition = DISP_INLINE; /* Show it ! */
tmp.offset = tmp.mime_rec.offset = 0;
tmp.mime_rec.encoding = ENCODING_7BIT;
! stat(a->pathname0, &sb);
tmp.content_length = tmp.mime_rec.length = sb.st_size;
mime_parse_routine(NULL,&tmp, tmpfp);

! } else {

/* Make copy of mime structure: */
mime_t_copy(&(tmp.mime_rec),a);
***************
*** 726,754 ****
*/
mime_classify_media(&(tmp.mime_rec),&tmp);

! is_need_meta = need_meta(&tmp);


if (!is_need_meta) {
!
if (tmpfp)
! metapager (tmpfp, &tmp, FALSE, 0,0, page);
else if (F)
! metapager (F, &tmp, FALSE, 0,0, page);
} else {
struct menu_context *cpage;

/* otherwise call metamail */

! if (!a->pathname) {
char tmpfile[STRING];
char copy_buf[VERY_LONG_STRING];
FILE *out;

out_state_t state_out;

elm_sfprintf (tmpfile, sizeof tmpfile,
! FRM("%selm.%d"), temp_dir, getpid());

out = safeopen(tmpfile);

--- 823,862 ----
*/
mime_classify_media(&(tmp.mime_rec),&tmp);

! is_need_meta = need_meta(&tmp,0,0);
! if (is_need_meta < 0) {
! goto fail;
! }


if (!is_need_meta) {
! struct pager_page *PP = init_pager_page(NULL);
!
if (tmpfp)
! metapager (tmpfp, &tmp, FALSE, 0,0, PP);
else if (F)
! metapager (F, &tmp, FALSE, 0,0, PP);
!
! exit_pager_page(&PP,page);
} else {
struct menu_context *cpage;

/* otherwise call metamail */

! if (!a->pathname0) {
char tmpfile[STRING];
char copy_buf[VERY_LONG_STRING];
FILE *out;

out_state_t state_out;


+ char *tmp;
+
+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");

+ if (!tmp)
+ goto fail;

elm_sfprintf (tmpfile, sizeof tmpfile,
! FRM("%selm.%d"), tmp, getpid());

out = safeopen(tmpfile);

***************
*** 796,807 ****
/* This is the case when we are viewing attachments for an outgoing
* message.
*/
elm_sfprintf(buf1,sizeof buf1,
FRM("%s -m Elm -p -b -c %s/%s %s"),
metamail_path,
get_major_type_name(a->TYPE),
get_subtype_name(a->TYPE),
! a->pathname);


/* Option -z causes that metamail deletes input file */
--- 904,916 ----
/* This is the case when we are viewing attachments for an outgoing
* message.
*/
+
elm_sfprintf(buf1,sizeof buf1,
FRM("%s -m Elm -p -b -c %s/%s %s"),
metamail_path,
get_major_type_name(a->TYPE),
get_subtype_name(a->TYPE),
! a->pathname0);


/* Option -z causes that metamail deletes input file */
***************
*** 845,851 ****
for (i = 0; i < attach_files.attachment_count; i++) {
int need_enc;
int is_text;
!
need_enc = attach_info (&(attach_files.attach_files[i]),
mailer_info,1);
if (need_enc < 0) {
--- 954,965 ----
for (i = 0; i < attach_files.attachment_count; i++) {
int need_enc;
int is_text;
!
! if (!attach_files.attach_files[i].dispname)
! attach_files.attach_files[i].dispname =
! new_string2(system_charset,
! s2us(attach_files.attach_files[i].pathname0));
!
need_enc = attach_info (&(attach_files.attach_files[i]),
mailer_info,1);
if (need_enc < 0) {
***************
*** 865,872 ****
attach_files.attach_files[i].encoding ==
ENCODING_BASE64)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmStrucredNoEncoding,
! "%.30s: Structured types don't allow encoding of data."),
! attach_files.attach_files[i].pathname);
sleep_message();

return 0;
--- 979,986 ----
attach_files.attach_files[i].encoding ==
ENCODING_BASE64)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmStrucredNoEncoding,
! "%S: Structured types don't allow encoding of data."),
! attach_files.attach_files[i].dispname);
sleep_message();

return 0;
***************
*** 895,902 ****

mime_t_zero(&tmp);

! tmp.pathname = safe_strdup(pathname);
!
/* Default disposition for attachments: attachment */
tmp.disposition = DISP_ATTACH;

--- 1009,1017 ----

mime_t_zero(&tmp);

! tmp.pathname0 = safe_strdup(pathname);
! tmp.dispname = NULL; /* Filled later */
!
/* Default disposition for attachments: attachment */
tmp.disposition = DISP_ATTACH;

***************
*** 909,928 ****
static void forgot_previous(att)
mime_t *att;
{
! if (att->pathname) {
if (att->unlink) {
! if (unlink(att->pathname) == 0) {
DPRINT(Debug,5, (&Debug,
"attach_modify: Unlinking cache %s\n",
! att->pathname));
}
}

! free (att->pathname);
! att->pathname = NULL;
}
}

static int attach_modify P_((mime_t *att, int new,
struct mailer_info *mailer_info,
struct AliasView *aview));
--- 1024,1047 ----
static void forgot_previous(att)
mime_t *att;
{
! if (att->pathname0) {
if (att->unlink) {
! if (unlink(att->pathname0) == 0) {
DPRINT(Debug,5, (&Debug,
"attach_modify: Unlinking cache %s\n",
! att->pathname0));
}
}

! free (att->pathname0);
! att->pathname0 = NULL;
}
+
+ if (att->dispname)
+ free_string(& (att->dispname));
}

+
static int attach_modify P_((mime_t *att, int new,
struct mailer_info *mailer_info,
struct AliasView *aview));
***************
*** 935,941 ****
{
int ret_value = FALSE;

! char buf[STRING];
int update = TRUE, prompt = TRUE, need_enc = 0;
int is_text = -1, ch = '\0';
struct folder_browser * br = new_browser(selection_file);
--- 1054,1060 ----
{
int ret_value = FALSE;

!
int update = TRUE, prompt = TRUE, need_enc = 0;
int is_text = -1, ch = '\0';
struct folder_browser * br = new_browser(selection_file);
***************
*** 946,953 ****
"Bad magic number");

DPRINT(Debug,6, (&Debug, "attach_modify: att=%p, new=%d\n",att,new));
!
! buf[0] = '\0';

if (new) {
/* Default disposition for attachments: attachment */
--- 1065,1071 ----
"Bad magic number");

DPRINT(Debug,6, (&Debug, "attach_modify: att=%p, new=%d\n",att,new));
!

if (new) {
/* Default disposition for attachments: attachment */
***************
*** 1008,1028 ****
print_center(1,Title);
free_string(&Title);

! if (att->dispname)
PutLineX(3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachFilename3,
"F)ilename : %.*S"),
Width,att->dispname);
- else if (att->unlink)
- PutLineX(3, 0,
- CATGETS(elm_msg_cat, MeSet, MeAttachFilename1,
- "Filename : %.*s"),
- Width,NONULL(att->pathname));
else
PutLineX(3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachFilename2,
! "F)ilename : %.*s"),
! Width,NONULL(att->pathname));

if (!att->description)
att->description = new_string(display_charset);
--- 1126,1146 ----
print_center(1,Title);
free_string(&Title);

! if (att->unlink == 2)
! PutLineX(3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachFilenameS,
! "Filename : %.*S"),
! Width,att->dispname);
! else if (att->dispname)
PutLineX(3, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachFilename3,
"F)ilename : %.*S"),
Width,att->dispname);
else
PutLineX(3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachFilename0,
! "F)ilename : <none>"));
!

if (!att->description)
att->description = new_string(display_charset);
***************
*** 1031,1061 ****
"D)escription : %.*S"),
Width, att->description);

! PutLineX (5, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachContentType,
! "Content-T)ype : %.15s/%.30s%s"),
! get_major_type_name(att->TYPE),
! get_subtype_name(att->TYPE),
! att->type_opts ? ";" : "");
!
! if (att->type_opts) {
! PutLine0 (6+add, 28, att->type_opts);
! add++;
}
PutLineX(6+add, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachContentTE,
"Content-transfer-E)ncoding: %s"),
ENCODING(att->encoding));

! PutLineX (7+add, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachContentTE,
! "Content-disP)osition : %.15s%s"),
! DISPOSITION(att->disposition),
! att->disposition_opts ? ";" : "");
!
! if (att->disposition_opts) {
! PutLine0 (8+add, 28, att->disposition_opts);
! add++;
}

if (is_text < 0)
--- 1149,1192 ----
"D)escription : %.*S"),
Width, att->description);

! PutLineX(5, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachContentType,
! "Content-T)ype : %.15s/%.30s%s"),
! get_major_type_name(att->TYPE),
! get_subtype_name(att->TYPE),
! att->TYPE_opts ? ";" : "");
!
! if (att->TYPE_opts) {
! struct string * X = show_mime_params(att->TYPE_opts);
!
! if (X) {
! PutLineX(6+add, 28, FRM("%S"),X);
! add++;
!
! free_string(&X);
! }
}
+
PutLineX(6+add, 0,
CATGETS(elm_msg_cat, MeSet, MeAttachContentTE,
"Content-transfer-E)ncoding: %s"),
ENCODING(att->encoding));

! PutLineX(7+add, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachContentTE,
! "Content-disP)osition : %.15s%s"),
! DISPOSITION(att->disposition),
! att->DISPOSITION_opts ? ";" : "");
!
! if (att->DISPOSITION_opts) {
! struct string * X = show_mime_params(att->DISPOSITION_opts);
!
! if (X) {
! PutLineX(8+add, 28, FRM("%S"), X);
! add++;
!
! free_string(&X);
! }
}

if (is_text < 0)
***************
*** 1076,1085 ****
}

if (prompt) {
! PutLineX (LINES-3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachEnter1,
! "Enter letter or RETURN to quit: "));
! CleartoEOS();


ch = menu_ReadCh(page,REDRAW_MARK|READCH_resize|READCH_sig_char);
clear_error();
}

--- 1207,1217 ----
}

if (prompt) {
! menu_PutLineX (page,
! LINES-3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachEnter1,
! "Enter letter or RETURN to quit: "));
! menu_CleartoEOS(page);


ch = menu_ReadCh(page,REDRAW_MARK|READCH_resize|READCH_sig_char);
clear_error();
}
***************

*** 1105,1111 ****

int code;

! if (att->unlink && !att->dispname) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCantChangeFilename,
"You can't change filename!"));
--- 1237,1243 ----

int code;

! if (att->unlink == 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCantChangeFilename,
"You can't change filename!"));
***************
*** 1121,1128 ****
}

if (!att->dispname) {
! if (att->pathname)
! tmpname = new_string2(system_charset,s2us(att->pathname));
} else
tmpname = dup_string(att->dispname);

--- 1253,1261 ----
}

if (!att->dispname) {
! DPRINT(Debug,15,(&Debug,
! "attach_modify: No dispname\n"));
!
} else
tmpname = dup_string(att->dispname);

***************
*** 1131,1137 ****

prompt = TRUE;

! code = file_browser(page,br,&tmpname,&update,word_read,
aview,
CATGETS(elm_msg_cat, MeSet,
MeAttachEnterFilename,
--- 1264,1270 ----

prompt = TRUE;

! code = file_browser(page,br,&tmpname,word_read,
aview,
CATGETS(elm_msg_cat, MeSet,
MeAttachEnterFilename,
***************
*** 1145,1153 ****

DPRINT(Debug,5, (&Debug,
"attach_modify: filename not given"));
! if (att->pathname) {
! DPRINT(Debug,5, (&Debug, " pathname=%s",
! att->pathname));
}
if (att->dispname) {
DPRINT(Debug,5, (&Debug, " dispname=%S",
--- 1278,1286 ----

DPRINT(Debug,5, (&Debug,
"attach_modify: filename not given"));
! if (att->pathname0) {
! DPRINT(Debug,5, (&Debug, " pathname0=%s",
! att->pathname0));
}
if (att->dispname) {
DPRINT(Debug,5, (&Debug, " dispname=%S",
***************
*** 1169,1186 ****

update = TRUE;

! if (att->pathname) {
if (att->unlink) {
! if (unlink(att->pathname) == 0) {
DPRINT(Debug,5,
(&Debug,
"attach_modify: Unlinking cache %s\n",
! att->pathname));
}
}

! free (att->pathname);
! att->pathname = NULL;
}
if (new) {
ret_value = FALSE;
--- 1302,1319 ----

update = TRUE;

! if (att->pathname0) {
if (att->unlink) {
! if (unlink(att->pathname0) == 0) {
DPRINT(Debug,5,
(&Debug,
"attach_modify: Unlinking cache %s\n",
! att->pathname0));
}
}

! free (att->pathname0);
! att->pathname0 = NULL;
}
if (new) {
ret_value = FALSE;
***************
*** 1223,1238 ****
goto attach_failure;
}

! /* Now forgot previous file .... */
forgot_previous(att);

- if (att->dispname)
- free_string(&att->dispname);
att->dispname = tmpname;
tmpname = NULL;

iscopy = att->unlink;
! if (!dir_make_ref(br, & (att->pathname), & iscopy,
is_text)) {
att->unlink = iscopy;
goto attach_failure;
--- 1356,1373 ----
goto attach_failure;
}

! /* Now forgot previous file ....
! forgot_previous: clears att->dispname
! and att->pathname0
! */
!
forgot_previous(att);

att->dispname = tmpname;
tmpname = NULL;

iscopy = att->unlink;
! if (!dir_make_ref(br, & (att->pathname0), & iscopy,
is_text)) {
att->unlink = iscopy;
goto attach_failure;
***************
*** 1279,1285 ****
update = TRUE;
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmStructuredNoencoding,
! "Structured types don't allow encoding of data."));
sleep_message();

break;
--- 1414,1421 ----
update = TRUE;
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmStructuredNoencoding,
! "%S: Structured types don't allow encoding of data."),
! att->dispname);
sleep_message();

break;
***************
*** 1316,1355 ****
int old_is_text = is_text;
int loop_count = 0;
int code;
!
prompt = TRUE;
! PutLineX (LINES-3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachEnterContentType,
! "Content-Type: "));
! elm_sfprintf (buf, sizeof buf,
! FRM("%.15s/%.30s"),
! get_major_type_name(att->TYPE),
! get_subtype_name(att->TYPE));
! if (att->type_opts) {
! int l;
!
! strfcat (buf, "; ", sizeof buf);
! l = strlen (buf);
! strfcpy (buf + l, att->type_opts, sizeof (buf) - l);
! }
!

! code = optionally_enter(buf, LINES-3, 14, OE_APPEND_CURRENT|

! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,
! sizeof buf, page);


if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;

continue;


}
! if (0 != code)

continue;
!
! mime_get_content (buf, att);
if (get_major_type_code(att->TYPE) == MIME_TYPE_TEXT &&
(need_enc & HAVE_8BIT) &&
! !mime_get_param("charset",buf,att->type_opts,sizeof (buf)) &&
display_charset->MIME_name)
! add_parameter_t(att, "charset", display_charset->MIME_name,0);

do {
int iscopy;
--- 1452,1552 ----
int old_is_text = is_text;
int loop_count = 0;
int code;
! struct string *buf1 = NULL;
! char **X;
!
prompt = TRUE;
!
! if (att->TYPE_opts) {
! struct string *buf2 = NULL;
!
! buf2 = show_mime_params(att->TYPE_opts);
!
! if (buf2) {
! buf1 = format_string(FRM("%.15s/%.30s; %S"),
! get_major_type_name(att->TYPE),
! get_subtype_name(att->TYPE),
! buf2);
!
! free_string(&buf2);
! } else
! buf1 = format_string(FRM("%.15s/%.30s"),
! get_major_type_name(att->TYPE),
! get_subtype_name(att->TYPE));
! } else
! buf1 = format_string(FRM("%.15s/%.30s"),
! get_major_type_name(att->TYPE),
! get_subtype_name(att->TYPE));
!
!
! code = optionally_enter2(page,&buf1,
! LINES-3, 0,
! OE_APPEND_CURRENT|
! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,
! CATGETS(elm_msg_cat, MeSet,
! MeAttachEnterContentType,
! "Content-Type: "));


!
if (REDRAW_MARK == code) {

update = TRUE;
prompt = FALSE;

+
+ if (buf1)
+ free_string(&buf1);
+
continue;
}
!
! if (0 != code) {
! if (buf1)
! free_string(&buf1);
continue;
! }
!
!

! {
! int mp = give_dt_enumerate_as_int(&mime_parameters);

! /* 0 == plain
! 1 == encoded

! 2 == ascii-and-encoded
! */
!
! switch (mp) {
! case 0:
! X = split_mime_params(& (att->TYPE_opts),buf1,0,1);
! break;
! case 1:
! X = split_mime_params(& (att->TYPE_opts),buf1,0,0);
! break;
! default:
! X = split_mime_params(& (att->TYPE_opts),buf1,
! MAX_COMPAT_LEN,0);


! break;
! }
! }
!

! free_string(&buf1);
! if (X) {
! media_type_t T = NULL;
!
! if (X[0] &&
! X[1] && 0 == strcmp(X[1],"/") &&
! X[2])
! T = give_media_type(X[0],X[2],1);
!
! if (T)
! att->TYPE = T;
!
! free_rfc822tokenized(X);
! }
!
!
if (get_major_type_code(att->TYPE) == MIME_TYPE_TEXT &&
(need_enc & HAVE_8BIT) &&
! !(get_mime_param_compat(att->TYPE_opts,"charset")) &&
display_charset->MIME_name)
! mime_params_add_compat(& (att->TYPE_opts),
! "charset", display_charset->MIME_name);

do {
int iscopy;
***************
*** 1376,1401 ****

/* We reload file if it is user suplied */
if (old_is_text != is_text && att->dispname) {
DPRINT(Debug,1,
(&Debug,
"attach_modify: OPPS! CLRF encoding changed...\n"));
forgot_previous(att);

! if (!select_dir_item(br,&(att->dispname))) {
ch = 'f';
prompt = FALSE;
goto main_loop;
}

iscopy = att->unlink;
! if (!dir_make_ref(br, & (att->pathname), & iscopy,
is_text)) {
ch = 'f';
prompt = FALSE;
att->unlink = iscopy;
goto main_loop;
}
! att->unlink = iscopy;

/* Set some information about this attachment */
need_enc = attach_info (att, mailer_info,0);
--- 1573,1609 ----

/* We reload file if it is user suplied */
if (old_is_text != is_text && att->dispname) {
+
+ struct string *XX = att->dispname;
+
+ /* forgot_previous() frees att->dispname */
+ att->dispname = NULL;
+
DPRINT(Debug,1,
(&Debug,
"attach_modify: OPPS! CLRF encoding changed...\n"));
forgot_previous(att);

! if (!select_dir_item(br,&XX)) {
ch = 'f';
prompt = FALSE;
+
+ free_string(&XX);
goto main_loop;
}

iscopy = att->unlink;
! if (!dir_make_ref(br, & (att->pathname0), & iscopy,
is_text)) {
ch = 'f';
prompt = FALSE;
att->unlink = iscopy;
+
+ free_string(&XX);
goto main_loop;
}
! att->dispname = XX;
! att->unlink = iscopy;

/* Set some information about this attachment */
need_enc = attach_info (att, mailer_info,0);
***************
*** 1417,1454 ****
prompt = FALSE;
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmStructuredNoencoding,
! "Structured types don't allow encoding of data."));
sleep_message();
}
}
else if (ch == 'p' || ch == 'P') {
int code;

prompt = TRUE;
! PutLineX (LINES-3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachEnterContentDisp,
! "Content-Disposition: "));
! strfcpy (buf, DISPOSITION(att->disposition), sizeof buf);
! if (att->disposition_opts) {
! int l;
!
! strfcat (buf,"; ", sizeof buf);
! l = strlen (buf);
! strfcpy (buf + l, att->disposition_opts, sizeof (buf) - l);
! }


! code = optionally_enter(buf, LINES-3, 21,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! sizeof buf, page);


if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;

continue;


}
! if (0 != code)

continue;
! mime_get_disposition (buf, att);


update = TRUE;
}
else if (ch == 'e' || ch == 'E') {

--- 1625,1722 ----
prompt = FALSE;
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmStructuredNoencoding,
! "%S: Structured types don't allow encoding of data."),
! att->dispname);
sleep_message();
}
}
else if (ch == 'p' || ch == 'P') {
int code;
+
+ struct string *buf1 = NULL;
+ char **X;

prompt = TRUE;
!
! if (att->DISPOSITION_opts) {
!
! struct string *buf2 = NULL;
!
! buf2 = show_mime_params(att->DISPOSITION_opts);
!
! if (buf2) {
! buf1 = format_string(FRM("%.30s; %S"),
! DISPOSITION(att->disposition),
! buf2);
!
! free_string(&buf2);
! } else
! buf1 = format_string(FRM("%.30s"),
! DISPOSITION(att->disposition));
! } else
! buf1 = format_string(FRM("%.30s"),
! DISPOSITION(att->disposition));

!
! code = optionally_enter2(page,&buf1,
! LINES-3, 0,
! OE_APPEND_CURRENT|
! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,
! CATGETS(elm_msg_cat, MeSet,
! MeAttachEnterContentDisp,
! "Content-Disposition: "));


!
if (REDRAW_MARK == code) {

update = TRUE;
prompt = FALSE;

+
+ if (buf1)
+ free_string(&buf1);
+
continue;
}
!
! if (0 != code) {
! if (buf1)
! free_string(&buf1);
continue;
! }
!

! {
! int mp = give_dt_enumerate_as_int(&mime_parameters);

! /* 0 == plain
! 1 == encoded

! 2 == ascii-and-encoded
! */
!
! switch (mp) {
! case 0:
! X = split_mime_params(& (att->DISPOSITION_opts),buf1, 0,1);
! break;
! case 1:
! X = split_mime_params(& (att->DISPOSITION_opts),buf1, 0,0);
! break;
! default:
! X = split_mime_params(& (att->DISPOSITION_opts),buf1,
! MAX_COMPAT_LEN,0);
! }
! }
!
! free_string(&buf1);
!
! if (X) {
! media_type_t T = NULL;
!
! if (X[0]) {
! if (istrcmp (X[0], "inline") != 0)
! att->disposition = DISP_ATTACH;
! else
! att->disposition = DISP_INLINE;
! }
!
! free_rfc822tokenized(X);
! }
!
update = TRUE;
}
else if (ch == 'e' || ch == 'E') {
***************
*** 1468,1475 ****
"... changing content-transfer-encoding, need_enc=%d, enc=%s\n",
need_enc,ENCODING(att->encoding)));

! MoveCursor (LINES-3, 27);
! CleartoEOLN ();

#define NEXT_ENCODING { \
att->encoding++; \
--- 1736,1744 ----
"... changing content-transfer-encoding, need_enc=%d, enc=%s\n",
need_enc,ENCODING(att->encoding)));

! menu_MoveCursor (page,
! LINES-3, 27);
! menu_CleartoEOLN(page);

#define NEXT_ENCODING { \
att->encoding++; \
***************
*** 1479,1487 ****

if (!mailer_info ||
!query_mailer_info(mailer_info,MI_HAVE_8BITMIME)) {
DPRINT(Debug,8,(&Debug,
"mailer does not support 8BITMIME\n"));
! if (allow_no_encoding < 1) {
if (att->encoding == ENCODING_8BIT) {
/* Mailer won't support ! */
/* TRY next encosing instead */
--- 1748,1759 ----

if (!mailer_info ||
!query_mailer_info(mailer_info,MI_HAVE_8BITMIME)) {
+

+ int an = give_dt_enumerate_as_int(&allow_no_encoding);

+
DPRINT(Debug,8,(&Debug,
"mailer does not support 8BITMIME\n"));
! if (an < 1) {
if (att->encoding == ENCODING_8BIT) {
/* Mailer won't support ! */
/* TRY next encosing instead */
***************
*** 1492,1501 ****

if (!mailer_info ||
!query_mailer_info(mailer_info,MI_HAVE_BINARYMIME)) {
DPRINT(Debug,8,(&Debug,
"mailer does not support BINARYMIME\n"));

! if (allow_no_encoding < 2) {
if (att->encoding == ENCODING_BINARY) {
/* Mailer won't support ! */
/* TRY next encoding instead */
--- 1764,1776 ----

if (!mailer_info ||
!query_mailer_info(mailer_info,MI_HAVE_BINARYMIME)) {
+

+ int an = give_dt_enumerate_as_int(&allow_no_encoding);

+
DPRINT(Debug,8,(&Debug,
"mailer does not support BINARYMIME\n"));

! if (an < 2) {
if (att->encoding == ENCODING_BINARY) {
/* Mailer won't support ! */
/* TRY next encoding instead */
***************
*** 1547,1553 ****
again = 0;
}

! Write_to_screen (FRM("%s"),ENCODING(att->encoding));


ch = menu_ReadCh(page,REDRAW_MARK|READCH_sig_char);
if (ch == '\n')
break;

--- 1822,1829 ----
again = 0;
}

! menu_Write_to_screen (page,
! FRM("%s"),ENCODING(att->encoding));


ch = menu_ReadCh(page,REDRAW_MARK|READCH_sig_char);
if (ch == '\n')
break;

***************
*** 1605,1610 ****
--- 1881,1917 ----
return ret_value;
}

+
+ char * compat_filename(orig,ok)
+ char * orig;
+ int *ok;
+ {
+ char * buf = safe_malloc(MAX_COMPAT_LEN+2);
+ char *x;
+ char *p;
+
+ *ok = 1;
+ for (p = buf, x=orig; *x; p++, x++) {
+
+ *p = *x;
+
+ if (p-buf > MAX_COMPAT_LEN) {
+ *ok = 0;
+ break;
+ }
+
+ if (!isascii(*p) || iscntrl(*p)) {
+ *ok = 0;
+ *p = '_';
+ }
+ }
+ *p = '\0';
+
+
+ return buf;
+ }
+
+ static void mime_guess_content_type P_((mime_t *ptr));
static void mime_guess_content_type (ptr)
mime_t *ptr;
{
***************
*** 1614,1641 ****
* that, to a small list of builtin definitions.
*/
int i, found = FALSE;
! char *p, *c, buf[LONG_STRING];
FILE *fp = NULL;

DPRINT(Debug,3, (&Debug, "mime_guess_content_type: pathname=%s\n",
! ptr->pathname));



if (ptr->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"mime_guess_content_type",
"Bad magic number");

/* Set the "filename" field for content-disposition */
! p = strrchr (ptr->pathname, '/');
if (p)
p++;
else
! p = ptr->pathname;
! buf[0] = '\0';
! add_parameter (buf, "filename", p, sizeof (buf), 0);
! ptr->disposition_opts = strmcpy (ptr->disposition_opts, buf);
!
/* Try to guess the content type of the data by the filename extension */
! p = strrchr (ptr->pathname, '.');
if (! p)
return;
p++;
--- 1921,1981 ----
* that, to a small list of builtin definitions.
*/
int i, found = FALSE;
! char *p, *c;
FILE *fp = NULL;
+ char * compat = NULL;
+ int was_ok = 1;
+
+ int mp = give_dt_enumerate_as_int(&mime_parameters);
+ /* 0 == plain
+ 1 == encoded
+ 2 == ascii-and-encoded
+ */
+
+ int have_encoded = 0;

DPRINT(Debug,3, (&Debug, "mime_guess_content_type: pathname=%s\n",
! ptr->pathname0));



if (ptr->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"mime_guess_content_type",
"Bad magic number");

/* Set the "filename" field for content-disposition */
! p = strrchr (ptr->pathname0, '/');
if (p)
p++;
else
! p = ptr->pathname0;
!
! compat = compat_filename(p,&was_ok);
!
!
! if (mp > 0 &&
! (!was_ok || !can_ascii_string(ptr->dispname))) {
! struct string *p1 = pick_name(ptr->dispname);
!
! if (p1) {
! mime_params_add(& (ptr->DISPOSITION_opts),"filename", p1);
!
! free_string(&p1);
!
! have_encoded ++;
!
! }
! }
!
! if (0 == mp ||
! 2 == mp ||
! ! have_encoded) {
!
! mime_params_add_compat(& (ptr->DISPOSITION_opts),
! "filename", compat);
! free(compat); compat = NULL;
! }
!
/* Try to guess the content type of the data by the filename extension */
! p = strrchr (ptr->pathname0, '.');
if (! p)
return;
p++;
***************
*** 1676,1693 ****
mime_panic(__FILE__,__LINE__,
"mime_guess_content_type",
"application/postscript is not known");
! if (ptr->type_opts) {
! free (ptr->type_opts);
! ptr->type_opts = NULL;
! }
! }
! else if (istrcmp (p, "gif") == 0 || istrcmp (p, "jpeg") == 0 ||
! istrcmp (p, "tiff") == 0) {
ptr->TYPE = give_media_type2(MIME_TYPE_IMAGE,p,1);
! if (ptr->type_opts) {
! free (ptr->type_opts);
! ptr->type_opts = NULL;
! }
}
DPRINT(Debug,3,
(&Debug,
--- 2016,2030 ----
mime_panic(__FILE__,__LINE__,
"mime_guess_content_type",
"application/postscript is not known");
! if (ptr->TYPE_opts)
! free_mime_param(& (ptr->TYPE_opts));
!
! } else if (istrcmp (p, "gif") == 0 || istrcmp (p, "jpeg") == 0 ||
! istrcmp (p, "tiff") == 0) {
ptr->TYPE = give_media_type2(MIME_TYPE_IMAGE,p,1);
! if (ptr->TYPE_opts)
! free_mime_param(& (ptr->TYPE_opts));
!
}
DPRINT(Debug,3,
(&Debug,
***************
*** 1697,1704 ****
}

if (i < 2) {
int l = strlen(p);
! while (fgets (buf, LONG_STRING, fp) != NULL) {
int l1 = strlen(buf);

if ('\n' == buf[l1 -1])
--- 2034,2043 ----
}

if (i < 2) {
+ char buf[LONG_STRING];
+
int l = strlen(p);
! while (fgets (buf, sizeof buf -1, fp) != NULL) {
int l1 = strlen(buf);

if ('\n' == buf[l1 -1])
***************
*** 1723,1729 ****
continue;
if (strincmp (c, p, l) == 0 &&
whitespace(c[l])) {
! mime_get_content (c + l + 1, ptr);
DPRINT(Debug,3,
(&Debug,
"mime_guess_content_type: user defined \"%s\" as \"%s/%s\"\n",
--- 2062,2068 ----
continue;
if (strincmp (c, p, l) == 0 &&
whitespace(c[l])) {
! mime_get_content (c + l + 1, ptr,system_charset);
DPRINT(Debug,3,
(&Debug,
"mime_guess_content_type: user defined \"%s\" as \"%s/%s\"\n",
***************
*** 1754,1782 ****
mime_panic(__FILE__,__LINE__,"attach_info",
"Bad magic number");

! if (stat (ptr->pathname, &sb) == -1) {
if (errno == ENOENT)
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmFileNotExist,
! "That file %.20s does not exist!"),
! ptr->pathname);
else
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmCantStatFile,
! "Could not stat file %.20s!"),
! ptr->pathname);
sleep_message();
return (-1);
}

ptr->length = sb.st_size;

! if (can_open(ptr->pathname,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotReadableByUser,
! "%.50s isn't readable by user!"),
! ptr->pathname);
! ptr->pathname[0] = '\0';
sleep_message();
return (-1);
}
--- 2093,2120 ----
mime_panic(__FILE__,__LINE__,"attach_info",
"Bad magic number");

! if (stat (ptr->pathname0, &sb) == -1) {
if (errno == ENOENT)
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmFileNotExistS,
! "That file %S does not exist!"),
! ptr->dispname);
else
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmCantStatFileS,
! "Could not stat file %S!"),
! ptr->dispname);
sleep_message();
return (-1);
}

ptr->length = sb.st_size;

! if (can_open(ptr->pathname0,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotReadableByUserS,
! "%S isn't readable by user!"),
! ptr->dispname);
sleep_message();
return (-1);
}
***************
*** 1784,1798 ****
/* Figure out what the default encoding is... */

lib_transient(CATGETS(elm_msg_cat, ElmSet,
! ElmCheckingEncoding,
! "Checking %s..."),
! ptr->pathname);
! fp = fopen (ptr->pathname, "r");
if (!fp) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmCantOpenFile,
! "Can't open %s!"),
! ptr->pathname);
sleep_message();
return -1;
}
--- 2122,2136 ----
/* Figure out what the default encoding is... */

lib_transient(CATGETS(elm_msg_cat, ElmSet,
! ElmCheckingEncodingS,
! "Checking %S..."),
! ptr->dispname);
! fp = fopen (ptr->pathname0, "r");
if (!fp) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmCantOpenFileS,
! "Can't open %S!"),
! ptr->dispname);
sleep_message();
return -1;
}
***************
*** 1837,1852 ****

if (get_major_type_code(ptr->TYPE) == MIME_TYPE_TEXT &&
(need_enc & HAVE_8BIT)) {
! char buf [STRING];
!
! if (!mime_get_param("charset",buf,ptr->type_opts,sizeof (buf)) &&
display_charset && display_charset->MIME_name)
! add_parameter_t(ptr, "charset", display_charset->MIME_name,0);
}
}
DPRINT(Debug,3, (&Debug,
! "attach_info: need_enc=%d, encoding=%d, pathname=%s, type=%s/%s\n",
! need_enc,ptr->encoding,ptr->pathname,
get_major_type_name(ptr->TYPE),
get_subtype_name(ptr->TYPE)));
return (need_enc);
--- 2175,2193 ----

if (get_major_type_code(ptr->TYPE) == MIME_TYPE_TEXT &&
(need_enc & HAVE_8BIT)) {
! CONST char *cs;
!
! cs = get_mime_param_compat(ptr->TYPE_opts,"charset");
! if (!cs &&
display_charset && display_charset->MIME_name)
! mime_params_add_compat(& (ptr->TYPE_opts),
! "charset", display_charset->MIME_name);
}
}
+
DPRINT(Debug,3, (&Debug,
! "attach_info: need_enc=%d, encoding=%d, pathname0=%s, type=%s/%s\n",
! need_enc,ptr->encoding,ptr->pathname0,
get_major_type_name(ptr->TYPE),
get_subtype_name(ptr->TYPE)));
return (need_enc);
***************
*** 1891,1931 ****
Encoding = ENCODING(mt->encoding);

if (is_cur && has_highlighting && ! arrow_cursor)
! StartInverse();
!
if (is_cur && arrow_cursor) {
! PutLine0 (offset, 0, "->");
} else
! MoveCursor(offset, 0);
! CleartoEOLN();

if (x < 0)
goto out;

! Write_to_screen(FRM("%2d"),S->display_index);

/* display the header value */
! GetXYLocation(&row, &col);

if (row != offset)
goto out;

! Writechar(' ');
col++;

for (i = 0; i < x && i < 5; i++) {
if (i < x-1) {
! Writechar(' ');
! Writechar(' ');
col += 2;
} else {
! Writechar('|');
if (0 == S->subnodes_len &&
S->current_node->parser_data &&
mime_parser_subparts(S->current_node->parser_data) > 0)
! Writechar('*');
else
! Writechar('-');
col += 2;
}
}
--- 2232,2272 ----
Encoding = ENCODING(mt->encoding);

if (is_cur && has_highlighting && ! arrow_cursor)
! menu_StartXX(page,pg_INVERSE);
!
if (is_cur && arrow_cursor) {
! menu_PutLine0 (page,offset, 0, "->");
} else
! menu_PutLine0 (page,offset, 0, " ");
! menu_CleartoEOLN(page);

if (x < 0)
goto out;

! menu_Write_to_screen(page,FRM("%2d"),S->display_index);

/* display the header value */
! menu_GetXYLocation(page,&row, &col);

if (row != offset)
goto out;

! menu_Writechar(page,' ');
col++;

for (i = 0; i < x && i < 5; i++) {
if (i < x-1) {
! menu_Writechar(page,' ');
! menu_Writechar(page,' ');
col += 2;
} else {
! menu_Writechar(page,'|');
if (0 == S->subnodes_len &&
S->current_node->parser_data &&
mime_parser_subparts(S->current_node->parser_data) > 0)
! menu_Writechar(page,'*');
else
! menu_Writechar(page,'-');
col += 2;
}
}
***************
*** 1935,1964 ****
goto out;

if (use_desc && mt->description)
! Write_to_screen(FRM("%-*.*S (%d) "),
! x,x,
! mt->description,
! mt->length);
! else
! Write_to_screen(FRM("%-*.*s (%d) "),
! x,x,
! NONULL(mt->pathname),
! mt->length);

! GetXYLocation(&row, &col);
if (row != offset)
goto out;

if (mt->length < 10) {
! Writechar(' ');
col++;
}
if (mt->length < 100) {
! Writechar(' ');
col++;
}
if (mt->length < 1000) {
! Writechar(' ');
col++;
}

--- 2276,2313 ----
goto out;

if (use_desc && mt->description)
! menu_Write_to_screen(page,
! FRM("%-*.*S (%d) "),
! x,x,
! mt->description,
! mt->length);
! else if (mt->dispname)
! menu_Write_to_screen(page,
! FRM("%-*.*S (%d) "),
! x,x,
! mt->dispname,
! mt->length);
! else
! menu_Write_to_screen(page,
! FRM("%-*.*s (%d) "),
! x,x,
! "",
! mt->length);

! menu_GetXYLocation(page,&row, &col);
if (row != offset)
goto out;

if (mt->length < 10) {
! menu_Writechar(page,' ');
col++;
}
if (mt->length < 100) {
! menu_Writechar(page,' ');
col++;
}
if (mt->length < 1000) {
! menu_Writechar(page,' ');
col++;
}

***************
*** 1969,2009 ****
if (x < 1)
goto out;

! Write_to_screen(FRM("%.*s/%.*s"),
! x,
! get_major_type_name(mt->TYPE),
! 2*x,
! get_subtype_name(mt->TYPE));

! GetXYLocation(&row, &col);
if (row != offset)
goto out;

-
if (col + strlen(Encoding) +3 >= Width) {
if (Width-col-7 < 1)
goto out;
! PutLineX(row, col+1, FRM("%.*s..."),
! Width-col-7,Encoding);
} else {
x = Width - strlen(Encoding) -3;
while (col < x) {
! Writechar(' ');
col++;
}

! PutLine0(row, x, Encoding);
}

out:
if (is_cur && has_highlighting && ! arrow_cursor)
! EndInverse();
}

! static void write_num P_((int num, int is_cur, int offset));

! static void write_num(num, is_cur, offset)
int num, is_cur,offset;
{
char buf[10];

--- 2318,2363 ----
if (x < 1)
goto out;

! menu_Write_to_screen(page,
! FRM("%.*s/%.*s"),
! x,
! get_major_type_name(mt->TYPE),
! 2*x,
! get_subtype_name(mt->TYPE));

! menu_GetXYLocation(page,
! &row, &col);
if (row != offset)
goto out;

if (col + strlen(Encoding) +3 >= Width) {
if (Width-col-7 < 1)
goto out;
! menu_PutLineX(page,
! row, col+1, FRM("%.*s..."),
! Width-col-7,Encoding);
} else {
x = Width - strlen(Encoding) -3;
while (col < x) {
! menu_Writechar(page,' ');
col++;
}

! menu_PutLine0(page,
! row, x, Encoding);
}

out:
if (is_cur && has_highlighting && ! arrow_cursor)
! menu_EndXX(page,pg_INVERSE);
}

! static void write_num P_((int num, int is_cur, int offset,
! struct menu_context *page));

! static void write_num(num, is_cur, offset,page)
int num, is_cur,offset;
+ struct menu_context *page;
{
char buf[10];

***************
*** 2014,2046 ****
buf[0] = '-';
buf[1] = '>';
}
! PutLine0 (offset, 0, buf);
! }
!
! static void attach_low_menu P_((int rdonly, struct menu_context *page));
! static void attach_low_menu(rdonly, page)
! int rdonly;
! struct menu_context *page;
! {
! struct string * buf1 = NULL;


! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES,&COLUMNS);
!
! if (rdonly) {
! buf1 =
! format_string(CATGETS(elm_msg_cat, MeSet, MeAttachMenuLowRd,
! "p)rint, s)ave, v)iew subparts, q)uit"));
!
! } else {
! buf1 =
! format_string(CATGETS(elm_msg_cat, MeSet, MeAttachMenuLow,
! "a)dd, e)dit, d)elete, m)odify, p)rint, s)ave, v)iew subparts, q)uit"));
! }
!
! print_center(LINES-2, buf1);
!
! free_string(&buf1);
}

static void free_structure P_((struct attach_structure **structure,
--- 2368,2374 ----
buf[0] = '-';
buf[1] = '>';
}
! menu_PutLine0 (page,offset, 0, buf);
}

static void free_structure P_((struct attach_structure **structure,
***************
*** 2176,2193 ****
int cur,
int start,
int end,
- int offset,
int draw_cursor_only,
struct menu_context *page));

! static struct attach_structure * draw_loc (structure,len,cur,start,end,offset,
draw_cursor_only, page)
struct attach_structure *structure;
int len;
int cur;
int start;
int end;
- int offset;
int draw_cursor_only;
struct menu_context *page;
{
--- 2504,2519 ----
int cur,
int start,
int end,
int draw_cursor_only,
struct menu_context *page));

! static struct attach_structure * draw_loc (structure,len,cur,start,end,
draw_cursor_only, page)
struct attach_structure *structure;
int len;
int cur;
int start;
int end;
int draw_cursor_only;
struct menu_context *page;
{
***************
*** 2198,2204 ****
struct attach_structure * r1 =
draw_loc(structure[i].subnodes,
structure[i].subnodes_len,
! cur,start,end,offset,draw_cursor_only,page);
if (r1)
r = r1;

--- 2524,2530 ----
struct attach_structure * r1 =
draw_loc(structure[i].subnodes,
structure[i].subnodes_len,
! cur,start,end,draw_cursor_only,page);
if (r1)
r = r1;

***************
*** 2208,2214 ****
attach_header(& structure[i],
structure[i].display_index == cur,
structure[i].attachments_index == -1,
! offset + structure[i].display_index - start,
page);
if (structure[i].display_index == cur)
r = & (structure[i]);
--- 2534,2540 ----
attach_header(& structure[i],
structure[i].display_index == cur,
structure[i].attachments_index == -1,
! structure[i].display_index - start,
page);
if (structure[i].display_index == cur)
r = & (structure[i]);
***************
*** 2221,2226 ****
--- 2547,2736 ----
return r;
}

+ enum { attach_mp_rdonly,
+ attach_mp_mime_structure,
+ attach_mp_LENGTH,
+ attach_mp_COUNT };
+
+ #if ANSI_C
+ static subpage_simple_redraw sb_update_attach_menu;
+ #endif
+ static int sb_update_attach_menu(ptr,list)
+ struct menu_context *ptr;
+ struct menu_param *list;
+ {
+ int rdonly = mp_lookup_integer(list,attach_mp_rdonly);
+
+ menu_ClearScreen(ptr);
+
+ if (rdonly)
+ menu_print_format_center(ptr,1,
+ CATGETS(elm_msg_cat, MeSet, MeAttachMenuLowRd,
+ "p)rint, s)ave, v)iew subparts, q)uit"));
+ else
+ menu_print_format_center(ptr,1,
+ CATGETS(elm_msg_cat, MeSet, MeAttachMenuLow,
+ "a)dd, e)dit, d)elete, m)odify, p)rint, s)ave, v)iew subparts, q)uit"));
+
+ return 1; /* menu completed */
+ }
+
+ #if ANSI_C
+ static subpage_simple_redraw sb_update_attach_title;
+ #endif
+ static int sb_update_attach_title(ptr,list)
+ struct menu_context *ptr;
+ struct menu_param *list;
+ {
+ int mime = mp_lookup_integer(list,attach_mp_mime_structure);
+ int LENGTH = mp_lookup_integer(list,attach_mp_LENGTH);
+
+ menu_ClearScreen(ptr);
+
+ if (!mime)
+ menu_print_format_center(ptr,1,
+ CATGETS(elm_msg_cat, ElmSet, ElmAttachMenu,
+ "Attachment Menu (%d attachments)"),
+ LENGTH);
+ else
+ menu_print_format_center(ptr,1,
+ CATGETS(elm_msg_cat, ElmSet, ElmAttachMenu2,
+ "MIME structure Menu (%d visible parts)"),
+ LENGTH);
+ return 1; /* title completed */
+ }
+
+
+ /* FIXME: this should be more close to hadling of main screen ... */
+
+ static void set_attach_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_attach_screen(page,LOC, LIST)
+ struct menu_context *page;
+ struct screen_parts *LOC;
+ struct menu_param *LIST;
+ {

+ int LINES, COLUMNS;
+

+ menu_get_sizes(page,&LINES, &COLUMNS);
+
+ /* Title part */
+
+ if (! LOC->title_page)
+ LOC->title_page = new_menu_subpage(page,0,3,sb_update_attach_title,
+ LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,3);
+
+ /* Attachments part */
+
+ if (! LOC->header_page)
+ LOC->header_page = new_menu_subpage(page,3,LINES-10,
+ subpage_simple_noredraw,LIST);
+ else
+ menu_subpage_relocate(LOC->header_page,page,3,LINES-10);
+
+ /* Menu part */
+
+ if (LOC->menu_page)
+ menu_subpage_relocate(LOC->menu_page,page,LINES-7,3);
+ else
+ LOC->menu_page = new_menu_subpage(page,LINES-7,3,
+ sb_update_attach_menu,LIST);
+
+ /* Prompt part */
+
+ if (LOC->prompt_page)
+ menu_subpage_relocate(LOC->prompt_page,page,LINES-4,4);
+ else
+ LOC->prompt_page = new_menu_subpage(page,LINES-4,4,
+ subpage_simple_noredraw,LIST);
+
+ }
+
+ static void check_attach_screen P_((struct screen_parts *LOC,
+ struct menu_param *list,
+ struct attach_structure **current,
+ struct attach_structure *top_structure,
+ int top_len,
+ int cur,
+ int top));
+ static void check_attach_screen(LOC,list, current,top_structure, top_len,
+ cur, top)
+ struct screen_parts *LOC;
+ struct menu_param *list;
+ struct attach_structure ** current;
+ struct attach_structure *top_structure;
+ int top_len;
+ int cur;
+ int top;
+
+ {
+ /* Title area */
+
+ if (menu_resized(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));
+ sb_update_attach_title(LOC->title_page,list);
+ }
+
+ /* Menu area */
+
+ if (menu_resized(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page redraw\n"));
+ sb_update_attach_menu(LOC->menu_page,list);
+ }
+
+ /* Prompt area */
+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {
+ DPRINT(Debug,7, (&Debug, "prompt page redraw\n"));
+ menu_ClearScreen(LOC->prompt_page);


+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.

+ */
+ }
+
+ /* Attachments part */
+
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "attachment page resized\n"));
+
+ menu_trigger_redraw(LOC->header_page);
+ }
+
+ if (menu_need_redraw(LOC->header_page)) {
+ int li, co;
+
+ menu_ClearScreen(LOC->header_page);
+
+ menu_get_sizes(LOC->header_page,&li, &co);
+
+ DPRINT(Debug,7, (&Debug,
+ "attachment page redraw (li = %d, co = %d, top = %d\n",
+ li, co, top));
+
+
+ *current = draw_loc(top_structure,top_len,cur,
+ top,top + li-1,
+ 0, LOC->header_page);


+
+ }
+
+
+ }
+

void attach_menu (F,T,A,defcharset, mailer_info,hdr, aview)
FILE *F;
mime_t *T;
***************
*** 2239,2251 ****

struct attach_structure * current = NULL;

! int cur = 0, offset = 3, ch;
int update = TRUE;
int top = 0;

int LENGTH = 0;


struct menu_context *page = new_menu_context();


if (A)
feed_attachments(A,&top_structure,&top_len);
--- 2749,2770 ----

struct attach_structure * current = NULL;

! int cur = 0, ch;
int update = TRUE;
int top = 0;

int LENGTH = 0;


struct menu_context *page = new_menu_context();

+ struct screen_parts LOC = { NULL, NULL, NULL, NULL };
+ struct menu_param PARAM[attach_mp_COUNT+1] = {
+ { mp_integer, 0 },
+ { mp_integer, 0 },
+ { mp_integer, 0 },
+ { mp_END,0 }
+ };
+
+ mp_list_set_integer(PARAM,attach_mp_rdonly,T != NULL);

if (A)
feed_attachments(A,&top_structure,&top_len);
***************
*** 2266,2274 ****
--- 2785,2799 ----
&top_structure[0].subnodes,
&top_structure[0].subnodes_len,
defcharset,F);
+
+ mp_list_set_integer(PARAM,attach_mp_mime_structure,1);
}
count_len(top_structure,top_len,&LENGTH,0);

+ mp_list_set_integer(PARAM,attach_mp_LENGTH,LENGTH);
+ set_attach_screen(page,&LOC,PARAM);
+
+
#if 0
if (!mailer_info && !rdonly)
mime_panic(__FILE__,__LINE__,
***************
*** 2277,2339 ****
#endif

for (;;) {


- int LINES, COLUMNS;
-

resize_mark:
! menu_get_sizes(page,&LINES,&COLUMNS);
!
if (menu_resized(page)) {
! menu_get_sizes(page,&LINES,&COLUMNS);
!
update = TRUE;

! } else if (menu_need_redraw(page))
! update = TRUE;

! if (cur < top || cur >= top + LINES-4-offset) {
! if (cur < top)
! top -= LINES-4-offset;
! if (cur >= top + LINES-4-offset)
! top += LINES-4-offset;
! if (top >= LENGTH)
! top = LENGTH - LINES +4 +offset;


! if (top < 0)
! top = 0;

! update = TRUE;
}
! if (update) {
menu_ClearScreen(page);
-
- if (A)
- print_format_center(1,
- CATGETS(elm_msg_cat, ElmSet, ElmAttachMenu,
- "Attachment Menu (%d attachments)"),
- LENGTH);
- else
- print_format_center(1,
- CATGETS(elm_msg_cat, ElmSet, ElmAttachMenu2,
- "MIME structure Menu (%d visible parts)"),
- LENGTH);
-
- attach_low_menu(T != NULL, page);
-
- current = draw_loc(top_structure,top_len,cur,
- top,top + LINES -5 - offset,
- offset,0, page);

update = FALSE;
show_last_error();
! } else if (!current)
! current = draw_loc(top_structure,top_len,cur,-1,-1,offset,0,
! page);
!
! ClearLine (LINES-3);
! PutLineX (LINES-3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachMenuPrompt,
! "Attachments: "));


! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);

! clear_error(); /* Clear the error message (from buffer also) */

switch (ch) {
case RESIZE_MARK:
--- 2802,2874 ----
#endif

for (;;) {
resize_mark:
!
if (menu_resized(page)) {
! set_attach_screen(page,&LOC,PARAM);
!
update = TRUE;
+ }

! {


! int li, co;
!

! menu_get_sizes(LOC.header_page,&li, &co);
!
! if (cur < top || cur >= top + li) {
! if (cur < top)
! top -= li;
! if (cur >= top + li)
! top += li;
! if (top >= LENGTH)
! top = LENGTH - li;


! if (top < 0)
! top = 0;

! update = TRUE;
! menu_trigger_redraw(LOC.header_page);
! }
}
!
! if (!current)
! menu_trigger_redraw(LOC.header_page);
!
! if (update || menu_need_redraw(page)) {
menu_ClearScreen(page);

+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+
update = FALSE;
show_last_error();
! }
!
! check_attach_screen(&LOC,PARAM,&current,top_structure,top_len,
! cur,top);
!
!
! {
! int lin,col;
!
! menu_ClearLine(LOC.prompt_page,0);
!
! menu_PutLineX (LOC.prompt_page,0, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachMenuPrompt,
! "Attachments: "));
! menu_GetXYLocation(LOC.prompt_page,&lin,&col);
!
! menu_CleartoEOS(LOC.prompt_page);
!
! show_last_error();
! menu_MoveCursor(LOC.prompt_page,lin,col);
!
! ch = menu_ReadCh(LOC.prompt_page,
! REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);
!
! menu_CleartoEOS(LOC.prompt_page);
! set_error(""); /* clear error buffer */


! }

switch (ch) {
case RESIZE_MARK:

***************
*** 2344,2355 ****
case '-':
case LEFT_MARK:
case PAGEUP_MARK:
! if ( current ) {

attach_header (current, FALSE,
current->attachments_index == -1,

! offset + cur - top,
! page);
! cur -= LINES -4;
if (cur < 0)
cur = 0;
current = NULL;
--- 2879,2894 ----
case '-':
case LEFT_MARK:
case PAGEUP_MARK:
! if ( current ) {


! int li, co;
!

! menu_get_sizes(LOC.header_page,&li, &co);
!

attach_header (current, FALSE,
current->attachments_index == -1,

! cur - top,
! LOC.header_page);
! cur -= li -4;
if (cur < 0)
cur = 0;
current = NULL;
***************
*** 2363,2373 ****
case RIGHT_MARK:
case PAGEDOWN_MARK:
if ( current ) {


attach_header (current, FALSE,
current->attachments_index == -1,

! offset + cur - top,
! page);
! cur += LINES -4;
if (cur > LENGTH - 1)
cur = LENGTH - 1;
current = NULL;
--- 2902,2916 ----
case RIGHT_MARK:
case PAGEDOWN_MARK:
if ( current ) {
+ int li, co;
+
+ menu_get_sizes(LOC.header_page,&li, &co);
+

attach_header (current, FALSE,
current->attachments_index == -1,

! cur - top,
! LOC.header_page);
! cur += li -4;
if (cur > LENGTH - 1)
cur = LENGTH - 1;
current = NULL;
***************
*** 2378,2387 ****
"There are no attachments!"));
break;
case 's':
if (current) {
! attach_save (F,current->current_node,&update, aview, page);
! if (!update)
! attach_low_menu(T != NULL, page);
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoAttachments,
--- 2921,2935 ----
"There are no attachments!"));
break;
case 's':
+ menu_Write_to_screen(LOC.prompt_page,
+ CATGETS(elm_msg_cat, MeSet,
+ MeSaveToFile,
+ "Save to File"));
+ FlushBuffer();
+
+
if (current) {
! attach_save (F,current->current_node, aview, page, &LOC);
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoAttachments,
***************
*** 2399,2406 ****
"There are no attachments!"));
break;
case 'p':
if (current)
! attach_print(F,current->current_node, defcharset);
else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoAttachments,
--- 2947,2960 ----
"There are no attachments!"));
break;
case 'p':
+ menu_Write_to_screen(LOC.prompt_page,
+ CATGETS(elm_msg_cat, MeSet,
+ MePrintAttach,
+ "Print attachment"));
+ FlushBuffer();
+
if (current)
! attach_print(F,current->current_node, defcharset,page);
else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoAttachments,
***************
*** 2409,2414 ****
--- 2963,2974 ----
break;

case 'v': /* Expand current node */
+ menu_Write_to_screen(LOC.prompt_page,
+ CATGETS(elm_msg_cat, MeSet,
+ MeViewSubparts,
+ "View MIME subparts"));
+ FlushBuffer();
+
if (!current) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoAttachments,
***************
*** 2421,2430 ****
defcharset,
F);
current = NULL;
- update = TRUE;

LENGTH = 0;
count_len(top_structure,top_len,&LENGTH,0);
break;

case 'e':
--- 2981,2994 ----
defcharset,
F);
current = NULL;

LENGTH = 0;
count_len(top_structure,top_len,&LENGTH,0);
+ mp_list_set_integer(PARAM,attach_mp_LENGTH,LENGTH);
+
+ menu_trigger_redraw(LOC.title_page);
+ menu_trigger_redraw(LOC.header_page);
+
break;

case 'e':
***************
*** 2449,2461 ****
}
if (question_me) {
for(;;) {
! PutLine0(LINES-3, 0, "Are you sure? (y/n): y");
! MoveCursor(LINES-3, 21);


! ch = menu_ReadCh(page, 0);

if (ch == 'y' || ch == '\n' || ch == 'n')
break;
}
! ClearLine(LINES-3);


if (ch == 'n')
break;
}

--- 3013,3028 ----
}
if (question_me) {
for(;;) {
! /* FIXME */
! menu_PutLine0(LOC.prompt_page,
! 0, 0, "Are you sure? (y/n): y");
! menu_MoveCursor(LOC.prompt_page,
! 0, 21);
! ch = menu_ReadCh(LOC.prompt_page, 0);
if (ch == 'y' || ch == '\n' || ch == 'n')
break;
}
! menu_ClearLine(LOC.prompt_page,0);


if (ch == 'n')
break;
}

***************
*** 2479,2487 ****

LENGTH = 0;
count_len(top_structure,top_len,&LENGTH,0);
- }



! update = TRUE;
}
break;

case 'a':
--- 3046,3058 ----

LENGTH = 0;
count_len(top_structure,top_len,&LENGTH,0);

! mp_list_set_integer(PARAM,attach_mp_LENGTH,LENGTH);
!
! menu_trigger_redraw(LOC.title_page);
! menu_trigger_redraw(LOC.header_page);
! }
!
}
break;
case 'a':
***************
*** 2498,2508 ****

LENGTH = 0;
count_len(top_structure,top_len,&LENGTH,0);
! }
! else {
mime_t_clear(& attach );
! }


! update = TRUE;
}
break;

case 'm':
--- 3069,3083 ----

LENGTH = 0;
count_len(top_structure,top_len,&LENGTH,0);
!
! mp_list_set_integer(PARAM,attach_mp_LENGTH,LENGTH);
!
! menu_trigger_redraw(LOC.title_page);
! menu_trigger_redraw(LOC.header_page);
!
! } else {
mime_t_clear(& attach );
! }
}
break;
case 'm':
***************
*** 2518,2524 ****
/* If there is not pathname it is otherwise assumed to be
* part from mailfile...!
*/
! if (current->current_node->pathname == NULL)
goto delete_it;
update = TRUE;
}
--- 3093,3099 ----
/* If there is not pathname it is otherwise assumed to be
* part from mailfile...!
*/
! if (current->current_node->pathname0 == NULL)
goto delete_it;
update = TRUE;
}
***************
*** 2535,2555 ****


break;
}
if (arrow_cursor)
! write_num(cur+1,FALSE,offset + cur - top);
else if (current)
attach_header (current, FALSE,
current->attachments_index == -1,

! offset + cur - top,
! page);
cur++;
! current = NULL;
! if (cur < top + LINES -4 - offset) {
! if (arrow_cursor)


! write_num(cur+1,TRUE,offset + cur - top);

! else
! current = draw_loc(top_structure,top_len,cur,
! top,top + LINES -5 - offset,
! offset,1, page);
}
break;
case 'k':
--- 3110,3137 ----
break;
}
if (arrow_cursor)
! write_num(cur,FALSE,cur - top, LOC.header_page);


else if (current)
attach_header (current, FALSE,
current->attachments_index == -1,

! cur - top,
! LOC.header_page);
cur++;
! {


! int li, co;
!

! menu_get_sizes(LOC.header_page,&li, &co);
!
! current = NULL;
! if (cur < top + li) {
! if (arrow_cursor)
! write_num(cur,TRUE,cur - top,
! LOC.header_page);
! else
! current = draw_loc(top_structure,top_len,cur,
! top,top + li-1,
! 1, LOC.header_page);
! }
}
break;
case 'k':
***************
*** 2563,2584 ****


break;
}
if (arrow_cursor)
! write_num(cur+1,FALSE,offset + cur - top);
else if (current)
attach_header (current, FALSE,
current->attachments_index == -1,

! offset + cur - top,
! page);
cur--;
current = NULL;


if (cur >= top) {
if (arrow_cursor)
! write_num(cur+1,TRUE,offset + cur - top);
else
current = draw_loc(top_structure,top_len,cur,

! top,top + LINES -5 - offset,
! offset,1, page);
}
break;
case 'i':
--- 3145,3170 ----
break;
}
if (arrow_cursor)
! write_num(cur,FALSE,cur - top, LOC.header_page);


else if (current)
attach_header (current, FALSE,
current->attachments_index == -1,

! cur - top,
! LOC.header_page);
cur--;
current = NULL;

if (cur >= top) {
+ int li, co;
+
+ menu_get_sizes(LOC.header_page,&li, &co);
+
if (arrow_cursor)
! write_num(cur,TRUE,cur - top, LOC.header_page);
else
current = draw_loc(top_structure,top_len,cur,
! top,top + li-1,
! 1, LOC.header_page);
}
break;
case 'i':
***************
*** 2596,2607 ****
#ifdef ALLOW_SUBSHELL
case '!':

! subshell(NULL,page);

- if (menu_need_redraw(page)) {
- menu_ClearScreen(page);
- update = TRUE;
- }
break;
#endif
default:
--- 3182,3189 ----
#ifdef ALLOW_SUBSHELL
case '!':

! subshell(NULL,page,LOC.prompt_page);

break;
#endif
default:
***************
*** 2613,2619 ****
--- 3195,3207 ----


}

OUT:
+ if (top_structure)
+ free_structure(&top_structure,&top_len);
+

+ free_mailbox_screen(&LOC);
+
erase_menu_context(&page);
+
return;
}

Index: elm2.4.ME+.122-cvs/src/browser.c
*** elm2.4.ME+.121/src/browser.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/browser.c 2005-07-05 12:48:13.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: browser.c,v 1.32 2004/07/11 17:44:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: browser.c,v 1.40 2005/07/05 09:48:13 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 23,28 ****
--- 23,30 ----
#define GB_FILL 4
#define GB_HELP 8
#define GB_SAVE_COPY 16
+ #define GB_HELP2 32
+
#define GB_FLAGS py
#define GB_PAGE counter
#define GB_LINE px
***************

*** 55,68 ****
}

if (current && !arrow_cursor)
! StartInverse();
! PutLineX(5 + i % lines_per_page,0,
! FRM("%.2s%c%c %-*.*S"),
! current && arrow_cursor ? "->" : " ",
! flags & BROWSER_MARKED ? 'N' : ' ',
! c,size,size,buffer);
if (current && !arrow_cursor)
! EndInverse();
}

static void write_prompt P_((struct enter_info *I));
--- 57,70 ----
}

if (current && !arrow_cursor)
! menu_StartXX(I->current_page,pg_INVERSE);
! menu_PutLineX(I->current_page,5 + i % lines_per_page,0,
! FRM("%.2s%c%c %-*.*S"),
! current && arrow_cursor ? "->" : " ",
! flags & BROWSER_MARKED ? 'N' : ' ',
! c,size,size,buffer);
if (current && !arrow_cursor)
! menu_EndXX(I->current_page,pg_INVERSE);
}

static void write_prompt P_((struct enter_info *I));
***************
*** 74,83 ****
menu_get_sizes(I->current_page,&LINES,&COLUMNS);

show_last_error();
! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);


if (I->pvector[0])

! Write_to_screen(FRM("%S"),I->pvector[0]);
! CleartoEOLN();
}

int browser_expand(XXX,name,prev_folder,aview)
--- 76,86 ----
menu_get_sizes(I->current_page,&LINES,&COLUMNS);

show_last_error();
!
! menu_PutLineX(I->current_page,LINES-3,0, FRM("%S"),I->pvector[1]);


if (I->pvector[0])

! menu_Write_to_screen(I->current_page,FRM("%S"),I->pvector[0]);
! menu_CleartoEOLN(I->current_page);
}

int browser_expand(XXX,name,prev_folder,aview)
***************
*** 176,210 ****

if (!I->pvector[0]) {

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoSave, "<no save>"));
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
return 1;

} else if ((s_len=string_len(I->pvector[0])) > 0) {
switch (give_unicode_from_string(I->pvector[0],0)) {
case 0x003D: /* '=' Handle save copy prompt! */
if (1 == s_len) {

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmUncondSaveByName,
! "<unconditionally save by name>"));
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
return 1;

} else if (2 == s_len &&
give_unicode_from_string(I->pvector[0],1)
== 0x003F /* '?' */) {

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmCondSaveByName,
! "<conditionally save by name>"));
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
return 1;

}
--- 179,225 ----

if (!I->pvector[0]) {

! menu_PutLineX(I->current_page,LINES-3,0, FRM("%S"),I->pvector[1]);
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmNoSave,
! "<no save>"));
! menu_CleartoEOLN(I->current_page);
! menu_MoveCursor(I->current_page,
! LINES-3,string_len(I->pvector[1]));
return 1;

} else if ((s_len=string_len(I->pvector[0])) > 0) {
+
switch (give_unicode_from_string(I->pvector[0],0)) {
+
case 0x003D: /* '=' Handle save copy prompt! */
if (1 == s_len) {

! menu_PutLineX(I->current_page,
! LINES-3,0, FRM("%S"),I->pvector[1]);
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmUncondSaveByName,
! "<unconditionally save by name>"));
! menu_CleartoEOLN(I->current_page);
! menu_MoveCursor(I->current_page,
! LINES-3,string_len(I->pvector[1]));
return 1;

} else if (2 == s_len &&
give_unicode_from_string(I->pvector[0],1)
== 0x003F /* '?' */) {

! menu_PutLineX(I->current_page,
! LINES-3,0, FRM("%S"),I->pvector[1]);
!
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCondSaveByName,
! "<conditionally save by name>"));
! menu_CleartoEOLN(I->current_page);
! menu_MoveCursor(I->current_page,
! LINES-3,string_len(I->pvector[1]));
return 1;

}
***************
*** 212,224 ****
case 0x003C: /* '<' */
if (1 == s_len) {

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmSentFolder, "<\"sent\" folder>"));
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
return -1; /* Special prompt but normal expansion */
-
}
break;
}
--- 227,241 ----
case 0x003C: /* '<' */
if (1 == s_len) {

! menu_PutLineX(I->current_page,
! LINES-3,0, FRM("%S"),I->pvector[1]);
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmSentFolder, "<\"sent\" folder>"));
! menu_CleartoEOLN(I->current_page);
! menu_MoveCursor(I->current_page,
! LINES-3,string_len(I->pvector[1]));
return -1; /* Special prompt but normal expansion */

}
break;
}
***************
*** 234,246 ****

menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! MoveCursor(LINES-4, 45);
! CleartoEOS();
show_last_error();

! PutLineX(LINES-4, 50,
! CATGETS(elm_msg_cat, ElmSet, ElmUseForHelp,
! "(Use '?' for help)"));
}

static void gb_initial_non_append P_((struct enter_info *I));
--- 251,266 ----

menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! menu_MoveCursor(I->current_page,
! LINES-4, 45);
! menu_CleartoEOS(I->current_page);
!
show_last_error();

! menu_PutLineX(I->current_page,
! LINES-4, 50,
! CATGETS(elm_msg_cat, ElmSet, ElmUseForHelp,
! "(Use '?' for help)"));
}

static void gb_initial_non_append P_((struct enter_info *I));
***************
*** 251,261 ****

menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
if (I->pvector[0]) {
! Write_to_screen(FRM("%S"),I->pvector[0]);
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
}
}

--- 271,287 ----

menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! menu_PutLineX(I->current_page,
! LINES-3,0, FRM("%S"),I->pvector[1]);
!
if (I->pvector[0]) {
!
! menu_Write_to_screen(I->current_page,
! FRM("%S"),I->pvector[0]);
! menu_CleartoEOLN(I->current_page);
! menu_MoveCursor(I->current_page,
! LINES-3,string_len(I->pvector[1]));
!
}
}

***************
*** 264,285 ****
struct enter_info *I;
struct string * buffer;
{
menu_ClearScreen(I->current_page);
! print_center(1,buffer);
}

! static void browser_help P_((void));
! static void browser_help()
{
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg7N,
! "You may get directory listing by giving directory name and pressing TAB key.\n\r"));

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg8N,
! "Pressing LEFT key fills buffer with current directory name and \n\r"));
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg9N,
! "pressing RIGTH key fills buffer with current selection. \n\r"));
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg10N,
! "UP and DOWN keys changes current selection on directory listing.\n\r"));

}

--- 290,319 ----
struct enter_info *I;
struct string * buffer;
{
+
menu_ClearScreen(I->current_page);
! menu_print_center(I->current_page,1,buffer);
!
}

! static void browser_help P_((struct enter_info *I));
! static void browser_help(I)
! struct enter_info *I;
{
!
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg7N,
! "You may get directory listing by giving directory name and pressing TAB key.\n\r"));

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg8N,
! "Pressing LEFT key fills buffer with current directory name and \n\r"));
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg9N,
! "pressing RIGTH key fills buffer with current selection. \n\r"));
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg10N,
! "UP and DOWN keys changes current selection on directory listing.\n\r"));

}

***************
*** 290,301 ****
{
struct string * buffer = give_title_dir(I->dir_p,entries);

! PutLineX(3,0,FRM("%S"),buffer); CleartoEOLN();
! MoveCursor(4,0); CleartoEOLN();

free_string(&buffer);
}

static struct string **gb_browser P_((struct enter_info *I,
enum enter_mode em,
struct menu_context *base_page));
--- 324,348 ----
{
struct string * buffer = give_title_dir(I->dir_p,entries);

! menu_PutLineX(I->current_page,3,0,FRM("%S"),buffer);
! menu_CleartoEOLN(I->current_page);
!
! menu_MoveCursor(I->current_page,4,0);
! menu_CleartoEOLN(I->current_page);

free_string(&buffer);
}

+ static void sort_message P_((struct string *message));
+ static void sort_message(message)
+ struct string *message;
+ {
+ if (message)
+ lib_transient(FRM("%S"),message);
+ else
+ clear_error();
+ }
+
static struct string **gb_browser P_((struct enter_info *I,
enum enter_mode em,
struct menu_context *base_page));
***************
*** 305,319 ****
enum enter_mode em;
struct menu_context *base_page;
{
!
int append_current = 0 != (I->flags & OE_APPEND_CURRENT);
int LINES,COLUMNS;

menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! /* Clear screen ... */
! if (em_redraw == em)
I->GB_FLAGS |= GB_REDRAW ;

switch(em) {
int s_len;
--- 352,367 ----
enum enter_mode em;
struct menu_context *base_page;
{
! int sort_it = 0;
int append_current = 0 != (I->flags & OE_APPEND_CURRENT);
int LINES,COLUMNS;

menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! switch(em) {
! case em_redraw:
I->GB_FLAGS |= GB_REDRAW ;
+ }

switch(em) {
int s_len;
***************
*** 323,331 ****
so we re-print prompt every time ... */



if (0 != (GB_SAVE_COPY & I->GB_FLAGS)) {

! MoveCursor(LINES-3,0);
! CleartoEOS();
show_last_error();
} else {
gb_initial_text(I);
}
--- 371,381 ----
so we re-print prompt every time ... */



if (0 != (GB_SAVE_COPY & I->GB_FLAGS)) {

! menu_MoveCursor(I->current_page,LINES-3,0);
! menu_CleartoEOS(I->current_page);
!
show_last_error();
+
} else {
gb_initial_text(I);
}
***************
*** 345,351 ****
}
/* FALLTHRU */

! case em_redraw: repage:



if (0 != (I->GB_FLAGS & GB_MENU))

I->GB_FLAGS |= GB_REDRAW;
--- 395,402 ----
}
/* FALLTHRU */

! case em_redraw:
! repage:



if (0 != (I->GB_FLAGS & GB_MENU))

I->GB_FLAGS |= GB_REDRAW;
***************
*** 355,360 ****
--- 406,412 ----


if (0 != (I->GB_FLAGS & GB_REDRAW)) {
+

struct string * buffer =

format_string(CATGETS(elm_msg_cat, ElmSet,
ElmFolderSelection,
***************
*** 367,388 ****


free_string(&buffer);
}

! if (0 != (I->GB_FLAGS & GB_HELP)) {

! MoveCursor(3,0); CleartoEOS();

if (0 != (GB_SAVE_COPY & I->GB_FLAGS)) {

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmListFoldersHelp1,
"Enter: <nothing> to not save a copy of the message,\n\
\r '<' to save in your \"sent\" folder ("));

{
char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");

! Write_to_screen(FRM("%s"), sent_val);
}

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmListFoldersHelp2,
"),\n\
\r '=' to save by name (the folder name depends on whom the\n\
\r message is to, in the end),\n\
--- 419,457 ----


free_string(&buffer);
}

! if (0 != (I->GB_FLAGS & GB_HELP2) &&
! 0 != (I->GB_FLAGS & GB_HELP)) {
!

! menu_MoveCursor(I->current_page,3,0);
! menu_CleartoEOS(I->current_page);
!
! browser_help(I);


!
! I->GB_FLAGS &= ~GB_HELP2;
!
! } else if (0 != (I->GB_FLAGS & GB_HELP)) {
! int line,col;
!

!
! menu_MoveCursor(I->current_page,3,0);
! menu_CleartoEOS(I->current_page);



if (0 != (GB_SAVE_COPY & I->GB_FLAGS)) {

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmListFoldersHelp1,
"Enter: <nothing> to not save a copy of the message,\n\
\r '<' to save in your \"sent\" folder ("));

{
char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");

! menu_Write_to_screen(I->current_page,
! FRM("%s"), sent_val);
}

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmListFoldersHelp2,
"),\n\
\r '=' to save by name (the folder name depends on whom the\n\
\r message is to, in the end),\n\
***************
*** 391,449 ****
\r or a filename (a leading '=' denotes your folder directory).\n\r\n\r"
));
} else {
- Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg1,
- "\n\r\n\rYou must specify a file or folder to "));


! Write_to_screen(FRM("%S"),I->pvector[2]);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg2,
! " to. Several options\n\rare available:\n\r\
\n\r '!' will use your incoming mailbox ("));



{
char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");

if (default_val)

! Write_to_screen(FRM("%s"),default_val);
}

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg3,
! ")\n\r '>' will use your \"received\" folder ("));
{
char * recvd_val = give_dt_estr_as_str(&recvd_mail_e,"receivedmail");
if (recvd_val)
! Write_to_screen(FRM("%s"),recvd_val);
}
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg4,
! ")\n\r '<' will use your \"sent\" folder ("));

{
char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");

if (sent_val)
! Write_to_screen(FRM("%s"), sent_val);
}

if (I->pvector[3]) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg5,
! ")\n\r '.' will use the previous folder ("));
! Write_to_screen(FRM("%S"), I->pvector[3]);
}

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg6,
! ")\n\r '@alias' will use the default folder for \"alias\"\n\r\n\r\
If you enter a filename elm will use that file. If the file name begins\n\r\
with a '=', elm will look for the file in your folder directory\n\r\
(your folder directory is "));
! Write_to_screen(FRM("%s)\r\n\n"),raw_folders);
if (browser_wildcards) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg7,
! "You may use wildcards (*?) in the name, similary as you do in the shell.\n\r"));


}
}

! browser_help();
}

if (0 != (I->GB_FLAGS & GB_MENU)) {

--- 460,545 ----
\r or a filename (a leading '=' denotes your folder directory).\n\r\n\r"
));
} else {

+ menu_Write_to_screen(I->current_page,
+ CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg1,
+ "You must specify a file or folder to "));

! menu_Write_to_screen(I->current_page,
! FRM("%S"),I->pvector[2]);

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg2,
! " to. Several options\n\rare available:\n\r\
\n\r '!' will use your incoming mailbox ("));



{
char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");

if (default_val)

! menu_Write_to_screen(I->current_page,
! FRM("%s"),default_val);
}

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg3,
! ")\n\r '>' will use your \"received\" folder ("));
{
char * recvd_val = give_dt_estr_as_str(&recvd_mail_e,"receivedmail");
if (recvd_val)
! menu_Write_to_screen(I->current_page,
! FRM("%s"),recvd_val);
}
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg4,
! ")\n\r '<' will use your \"sent\" folder ("));

{
char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");

if (sent_val)
! menu_Write_to_screen(I->current_page,
! FRM("%s"), sent_val);
}

if (I->pvector[3]) {
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg5,
! ")\n\r '.' will use the previous folder ("));
! menu_Write_to_screen(I->current_page,
! FRM("%S"), I->pvector[3]);
}

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg6,
! ")\n\r '@alias' will use the default folder for \"alias\"\n\r\n\r\
If you enter a filename elm will use that file. If the file name begins\n\r\
with a '=', elm will look for the file in your folder directory\n\r\
(your folder directory is "));
!
! {


! /* give_dt_estr_as_str adds / to end */
! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
!

! menu_Write_to_screen(I->current_page,
! FRM("%s)\r\n\n"),
! folders_val ? folders_val : "???");
! }
!
if (browser_wildcards) {
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg7,
! "You may use wildcards (*?) in the name, similary as you do in the shell.\n\r"));
}
}

! /* FIXME */
! GetXYLocation(&line,&col);


! if (line < (LINES-3) - 4)

! browser_help(I);


! else
! I->GB_FLAGS |= GB_HELP2;
!
}

if (0 != (I->GB_FLAGS & GB_MENU)) {

***************
*** 453,458 ****
--- 549,559 ----

gb_dir_title(I,&entries);

+ if (sort_it) {
+ sort_it = 0;
+ folder_sort_dir(I->dir_p, sort_message);
+ }
+
if (I->GB_PAGE > entries / lines_per_page)
I->GB_PAGE = entries / lines_per_page;
if (I->GB_LINE > entries-1 && entries > 0)
***************
*** 467,478 ****

for (; i < I->GB_PAGE * lines_per_page + lines_per_page;
i++) {
! MoveCursor(5 + i % lines_per_page,0);
! CleartoEOLN();
}
}

break;
case em_enter:
clear_error();

--- 568,581 ----

for (; i < I->GB_PAGE * lines_per_page + lines_per_page;
i++) {
! menu_MoveCursor(I->current_page,
! 5 + i % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
}

break;
+
case em_enter:
clear_error();

***************
*** 517,525 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
}

goto repage;
}

--- 620,631 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,
! '\007');
}

+ sort_it++;
+
goto repage;
}

***************
*** 532,538 ****
--- 638,646 ----
"-- gb_browser(..,%d)=NULL\n",
em));
return NULL;
+
case em_prev:
+
clear_error();


if (0 != (I->GB_FLAGS & GB_MENU)) {

int lines_per_page = LINES-10;
***************
*** 552,558 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
goto repage;
}

--- 660,666 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}

***************
*** 564,577 ****
if (oldline < entries)
draw_line(I,oldline,lines_per_page);
else {
! MoveCursor(5 + oldline % lines_per_page,0);
! CleartoEOLN();
}
if (I->GB_LINE < entries)
draw_line(I,I->GB_LINE,lines_per_page);
}
break;
case em_next:
clear_error();


if (0 != (I->GB_FLAGS & GB_MENU)) {

int lines_per_page = LINES-10;
--- 672,688 ----
if (oldline < entries)
draw_line(I,oldline,lines_per_page);
else {
! menu_MoveCursor(I->current_page,
! 5 + oldline % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
if (I->GB_LINE < entries)
draw_line(I,I->GB_LINE,lines_per_page);
}
break;
+
case em_next:
+
clear_error();


if (0 != (I->GB_FLAGS & GB_MENU)) {

int lines_per_page = LINES-10;
***************
*** 592,598 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
goto repage;
}
}
--- 703,709 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 605,617 ****
if (oldline < entries)
draw_line(I,oldline,lines_per_page);
else {
! MoveCursor(5 + oldline % lines_per_page,0);
! CleartoEOLN();
}
if (I->GB_LINE < entries)
draw_line(I,I->GB_LINE,lines_per_page);
}
break;
case em_tabaction:
DPRINT(Debug,8, (&Debug,
"-- gb_browser - tabaction: append_current=%d ch_count=%d\n",
--- 716,729 ----
if (oldline < entries)
draw_line(I,oldline,lines_per_page);
else {
! menu_MoveCursor(I->current_page,5 + oldline % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
if (I->GB_LINE < entries)
draw_line(I,I->GB_LINE,lines_per_page);
}
break;
+
case em_tabaction:
DPRINT(Debug,8, (&Debug,
"-- gb_browser - tabaction: append_current=%d ch_count=%d\n",
***************
*** 641,649 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
}

goto repage;
}

--- 753,763 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}

+ sort_it++;
+
goto repage;
}

***************
*** 658,685 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
}
goto repage;
} else {


/* Ring a bell */

! Writechar('\007');
goto repage;
}
/* NOT REACHED */

case em_left:
clear_error();


if (0 != (I->GB_FLAGS & GB_MENU)) {

if (0 == (I->GB_FLAGS & GB_FILL)) {

if (!change_dir_up(I->dir_p,&(I->pvector[0]))) {


/* Ring a bell */

! Writechar('\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
}
goto repage;
} else {
--- 772,805 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}
+
+ sort_it++;
+
goto repage;
} else {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
/* NOT REACHED */

case em_left:
clear_error();
+

if (0 != (I->GB_FLAGS & GB_MENU)) {

if (0 == (I->GB_FLAGS & GB_FILL)) {

if (!change_dir_up(I->dir_p,&(I->pvector[0]))) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
+
+ sort_it++;
}
goto repage;
} else {
***************
*** 689,695 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
goto repage;
}
}
--- 809,815 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 706,715 ****
if (!change_dir_to_entry(I->dir_p,I->GB_LINE,
&(I->pvector[0]))) {


/* Ring a bell */

! Writechar('\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
}

goto repage;
--- 826,837 ----
if (!change_dir_to_entry(I->dir_p,I->GB_LINE,
&(I->pvector[0]))) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
+
+ sort_it++;
}

goto repage;
***************
*** 721,727 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
goto repage;
}
}
--- 843,849 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 742,748 ****
static int run_browser P_((struct menu_context *page,


struct folder_browser *p,
struct string **buffer,
- int * redraw,

int save_copy,
struct string *word,
struct string * prev_fold,
--- 864,869 ----
***************
*** 750,763 ****


const char *format, const char *msg,

va_list args));
static int run_browser(page,
! p,buffer,redraw,save_copy,
word,prev_fold,
aview,
format,msg,args)
struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
- int * redraw;
int save_copy;
struct string *word;
struct string * prev_fold;
--- 871,883 ----


const char *format, const char *msg,

va_list args));
static int run_browser(page,
! p,buffer,save_copy,
word,prev_fold,
aview,
format,msg,args)
struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
int save_copy;
struct string *word;
struct string * prev_fold;
***************
*** 773,779 ****
struct string *vector[4];
struct enter_info INFO;
int LINES,COLUMNS;
!
DPRINT(Debug,4,
(&Debug, "run_browser: Entering [%s]\n",format));

--- 893,900 ----
struct string *vector[4];
struct enter_info INFO;
int LINES,COLUMNS;


! int delay_redraw = 0;
!

DPRINT(Debug,4,
(&Debug, "run_browser: Entering [%s]\n",format));

***************
*** 800,818 ****
INFO.dir_p = p;
INFO.aview = aview;
INFO.current_page = page;
!
if (save_copy)
INFO.GB_FLAGS |= GB_SAVE_COPY;

clear_selection_dir(p);
do {
code = enter_helper(&INFO,page);
} while (code == REDRAW_MARK);

menu_get_sizes(page,&LINES,&COLUMNS);

! MoveCursor(LINES-4,0);
! CleartoEOS();
show_last_error();

if (0 != code) {
--- 921,948 ----
INFO.dir_p = p;
INFO.aview = aview;
INFO.current_page = page;
!
if (save_copy)
INFO.GB_FLAGS |= GB_SAVE_COPY;

clear_selection_dir(p);
do {
code = enter_helper(&INFO,page);
+
+ if (code == REDRAW_MARK) {
+ menu_ClearScreen(page);
+

+ menu_redraw_children(page);
+
+ delay_redraw++;
+ }

+
} while (code == REDRAW_MARK);

menu_get_sizes(page,&LINES,&COLUMNS);

! menu_MoveCursor(page,LINES-4,0);
! menu_CleartoEOS(page);
show_last_error();

if (0 != code) {
***************
*** 825,837 ****


ret = 1;
}

- if (INFO.GB_FLAGS & GB_REDRAW)

- *redraw = TRUE;
-
*buffer = vector[0];

free_string(&text);

DPRINT(Debug,10, (&Debug,
"run_browser=%d\n",ret));

--- 955,969 ----
ret = 1;
}

*buffer = vector[0];

free_string(&text);

+ if (delay_redraw || (INFO.GB_FLAGS & GB_REDRAW)) {
+ DPRINT(Debug,10, (&Debug, "run_browser: redraw set\n"));
+ menu_trigger_redraw(page);
+ }
+
DPRINT(Debug,10, (&Debug,
"run_browser=%d\n",ret));

***************
*** 844,850 ****


struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
- int * redraw,

struct AliasView *aview,
const char *format, const char *msg, ...

#else
--- 976,981 ----
***************
*** 856,862 ****
struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
- int * redraw;
struct AliasView *aview;
CONST char *format;
CONST char *msg;
--- 987,992 ----
***************
*** 872,878 ****
"change"));



Va_start(vl, msg); /* defined in defs.h */

! if (run_browser(page,p,buffer,redraw,0,word,NULL,aview,format,msg,vl))
ret = folder_from_dir_item(p);
va_end(vl);

--- 1002,1008 ----
"change"));



Va_start(vl, msg); /* defined in defs.h */

! if (run_browser(page,p,buffer,0,word,NULL,aview,format,msg,vl))
ret = folder_from_dir_item(p);
va_end(vl);

***************
*** 914,929 ****
c = 'D';

if (current && !arrow_cursor)
! StartInverse();
! PutLineX(5 + i % lines_per_page,0,
! FRM("%.2s%c%c %-*.*S"),
! current && arrow_cursor ? "->" : " ",
! flags & BROWSER_MARKED ? 'N' : ' ',
! c,size,size,buffer);
if (current && !arrow_cursor)
! EndInverse();
}

static struct string **gb_filebrowser P_((struct enter_info *I,
enum enter_mode em,
struct menu_context *base_page));
--- 1044,1062 ----
c = 'D';

if (current && !arrow_cursor)
! menu_StartXX(I->current_page,pg_INVERSE);
!
! menu_PutLineX(I->current_page,
! 5 + i % lines_per_page,0,
! FRM("%.2s%c%c %-*.*S"),
! current && arrow_cursor ? "->" : " ",
! flags & BROWSER_MARKED ? 'N' : ' ',
! c,size,size,buffer);
if (current && !arrow_cursor)
! menu_EndXX(I->current_page,pg_INVERSE);
}

+
static struct string **gb_filebrowser P_((struct enter_info *I,
enum enter_mode em,
struct menu_context *base_page));
***************
*** 932,938 ****
enum enter_mode em;
struct menu_context *base_page;
{
!
int append_current = 0 != (I->flags & OE_APPEND_CURRENT);
int LINES,COLUMNS;

--- 1065,1071 ----
enum enter_mode em;
struct menu_context *base_page;
{
! int sort_it = 0;
int append_current = 0 != (I->flags & OE_APPEND_CURRENT);
int LINES,COLUMNS;

***************
*** 986,1006 ****


}

if (0 != (I->GB_FLAGS & GB_HELP)) {

! MoveCursor(3,0); CleartoEOS();

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileSpecify1,
! "\n\r\n\rYou must specify a file to "));

! Write_to_screen(FRM("%S"),I->pvector[2]);

! Write_to_screen(FRM(".\n\r"));

if (browser_wildcards) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg7,
! "You may use wildcards (*?) in the name, similary as you do in the shell.\n\r"));


}

! browser_help();
}

if (0 != (I->GB_FLAGS & GB_MENU)) {

--- 1119,1144 ----


}

if (0 != (I->GB_FLAGS & GB_HELP)) {

! menu_MoveCursor(I->current_page,3,0);
! menu_CleartoEOS(I->current_page);

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileSpecify1,
! "\n\r\n\rYou must specify a file to "));

! menu_Write_to_screen(I->current_page,
! FRM("%S"),I->pvector[2]);

! menu_Write_to_screen(I->current_page,
! FRM(".\n\r"));

if (browser_wildcards) {
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg7,
! "You may use wildcards (*?) in the name, similary as you do in the shell.\n\r"));
}

! browser_help(I);


}

if (0 != (I->GB_FLAGS & GB_MENU)) {

***************
*** 1010,1015 ****
--- 1148,1158 ----

gb_dir_title(I,&entries);

+ if (sort_it) {
+ sort_it = 0;
+ folder_sort_dir(I->dir_p, sort_message);
+ }
+
if (I->GB_PAGE > entries / lines_per_page)
I->GB_PAGE = entries / lines_per_page;
if (I->GB_LINE > entries-1 && entries > 0)
***************
*** 1024,1031 ****

for (; i < I->GB_PAGE * lines_per_page + lines_per_page;
i++) {
! MoveCursor(5 + i % lines_per_page,0);
! CleartoEOLN();
}
}

--- 1167,1175 ----

for (; i < I->GB_PAGE * lines_per_page + lines_per_page;
i++) {
! menu_MoveCursor(I->current_page,
! 5 + i % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
}

***************
*** 1063,1071 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
}

goto repage;
}

--- 1207,1217 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}

+ sort_it++;
+
goto repage;
}

***************
*** 1098,1104 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
goto repage;
}

--- 1244,1250 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}

***************
*** 1110,1117 ****
if (oldline < entries)
draw_fileline(I,oldline,lines_per_page);
else {
! MoveCursor(5 + oldline % lines_per_page,0);
! CleartoEOLN();
}
if (I->GB_LINE < entries)
draw_fileline(I,I->GB_LINE,lines_per_page);
--- 1256,1264 ----
if (oldline < entries)
draw_fileline(I,oldline,lines_per_page);
else {
! menu_MoveCursor(I->current_page,
! 5 + oldline % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
if (I->GB_LINE < entries)
draw_fileline(I,I->GB_LINE,lines_per_page);
***************
*** 1138,1144 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
goto repage;
}
}
--- 1285,1291 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 1151,1158 ****
if (oldline < entries)
draw_fileline(I,oldline,lines_per_page);
else {
! MoveCursor(5 + oldline % lines_per_page,0);
! CleartoEOLN();
}
if (I->GB_LINE < entries)
draw_fileline(I,I->GB_LINE,lines_per_page);
--- 1298,1306 ----
if (oldline < entries)
draw_fileline(I,oldline,lines_per_page);
else {
! menu_MoveCursor(I->current_page,
! 5 + oldline % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
if (I->GB_LINE < entries)
draw_fileline(I,I->GB_LINE,lines_per_page);
***************
*** 1187,1195 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
}

goto repage;
}

--- 1335,1345 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}

+ sort_it++;
+
goto repage;
}

***************
*** 1204,1222 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
}
goto repage;
} else {


/* Ring a bell */

! Writechar('\007');
goto repage;
}
/* NOT REACHED */

-

! case em_left:
clear_error();


if (0 != (I->GB_FLAGS & GB_MENU)) {

--- 1354,1374 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}
+
+ sort_it++;
+
goto repage;
} else {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
/* NOT REACHED */


! case em_left:
clear_error();
if (0 != (I->GB_FLAGS & GB_MENU)) {

***************
*** 1224,1233 ****

if (!change_dir_up(I->dir_p,&(I->pvector[0]))) {


/* Ring a bell */

! Writechar('\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
}
goto repage;
} else {
--- 1376,1387 ----

if (!change_dir_up(I->dir_p,&(I->pvector[0]))) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
+
+ sort_it++;
}
goto repage;
} else {
***************
*** 1237,1243 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
goto repage;
}
}
--- 1391,1397 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 1254,1263 ****
if (!change_dir_to_entry(I->dir_p,I->GB_LINE,
&(I->pvector[0]))) {


/* Ring a bell */

! Writechar('\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
}

goto repage;
--- 1408,1419 ----
if (!change_dir_to_entry(I->dir_p,I->GB_LINE,
&(I->pvector[0]))) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
+
+ sort_it++;
}

goto repage;
***************
*** 1269,1275 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! Writechar('\007');
goto repage;
}
}
--- 1425,1431 ----
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {


/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 1290,1296 ****


struct menu_context *page,
struct folder_browser *p,
struct string **buffer,

- int * redraw,
enum word_sel w,


struct string * prev_fold,
struct AliasView *aview,

--- 1446,1451 ----
***************
*** 1304,1310 ****
struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
- int * redraw;
enum word_sel w;
struct string * prev_fold;
struct AliasView *aview;
--- 1459,1464 ----
***************
*** 1343,1349 ****



Va_start(vl, msg); /* defined in defs.h */

! r = run_browser(page,p,buffer,redraw,save_copy,word,prev_fold,
aview,format,msg,vl);
va_end(vl);

--- 1497,1503 ----



Va_start(vl, msg); /* defined in defs.h */

! r = run_browser(page,p,buffer,save_copy,word,prev_fold,
aview,format,msg,vl);
va_end(vl);

***************
*** 1361,1367 ****


struct menu_context *page,
struct folder_browser *p,
struct string **buffer,

- int * redraw,


enum word_sel w,
struct AliasView *aview,
const char *format, const char *msg, ...

--- 1515,1520 ----
***************
*** 1374,1380 ****
struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
- int * redraw;
enum word_sel w;
struct AliasView *aview;
CONST char *format;
--- 1527,1532 ----
***************
*** 1392,1397 ****
--- 1544,1551 ----
*/
struct enter_info INFO;


struct string * word = NULL;

+ int delay_redraw = 0;
+
int LINES,COLUMNS;



Va_start(vl, msg); /* defined in defs.h */

***************
*** 1447,1452 ****
--- 1601,1612 ----
clear_selection_dir(p);
do {
code = enter_helper(&INFO,page);
+
+ menu_ClearScreen(page);
+

+ menu_redraw_children(page);
+
+ delay_redraw++;

} while (code == REDRAW_MARK);

menu_get_sizes(page,&LINES,&COLUMNS);
***************
*** 1471,1484 ****


ret = 1;
}

- if (INFO.GB_FLAGS & GB_REDRAW)

- *redraw = TRUE;
-
*buffer = vector[0];

free_string(&text);
free_string(&word);

DPRINT(Debug,10, (&Debug, "file_browser=%d\n",ret));

return ret;
--- 1631,1646 ----
ret = 1;
}

*buffer = vector[0];

free_string(&text);
free_string(&word);

+ if (delay_redraw || (INFO.GB_FLAGS & GB_REDRAW)) {
+ DPRINT(Debug,10, (&Debug, "file_browser: redraw set\n"));
+ menu_trigger_redraw(page);
+ }
+
DPRINT(Debug,10, (&Debug, "file_browser=%d\n",ret));

return ret;
Index: elm2.4.ME+.122-cvs/src/builtin++.c
*** elm2.4.ME+.121/src/builtin++.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/builtin++.c 2005-04-23 23:06:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.25 2004/07/14 12:23:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.29 2005/04/23 20:06:21 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 84,94 ****
Write_to_screen (CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpQuestion,
"?\t\tThis help screen."));
NewLine ();
! PutLineX (LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpPressRet,
! "Press any key to return..."));
! if (REDRAW_MARK == menu_ReadCh (page,REDRAW_MARK))
! goto redraw;


erase_menu_context(&page);
--- 84,96 ----
Write_to_screen (CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpQuestion,
"?\t\tThis help screen."));
NewLine ();
!
! menu_PutLineX (page,
! LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpPressRet,
! "Press any key to return..."));
! if (REDRAW_MARK == menu_ReadCh(page,REDRAW_MARK))
! goto redraw;


erase_menu_context(&page);
***************
*** 123,130 ****
return ret;
}

! int builtinplusplus (bout)
struct stringbuffer * bout;
{
int idx = 0;
int is_end = 0;
--- 125,133 ----
return ret;
}

! int builtinplusplus (bout,pager_page)
struct stringbuffer * bout;
+ struct pager_page * pager_page;
{
int idx = 0;
int is_end = 0;
***************
*** 134,141 ****
int ret = '\0';
int X = 0;
struct string * search_pattern = NULL; /* Last seach string */
-
- struct menu_context *page = new_menu_context();

clear_error();

--- 137,142 ----
***************
*** 155,167 ****
so far */
FF_seen = 0;

! menu_ClearScreen(page);

cr_restart: /* so that we can handle CR specially --
ie. don't reset page variables
*/

! menu_get_sizes(page, &LINES, &COLUMNS);



--- 156,168 ----
so far */
FF_seen = 0;

! menu_ClearScreen(pager_page->root);

cr_restart: /* so that we can handle CR specially --
ie. don't reset page variables
*/



! menu_get_sizes(pager_page->root, &LINES, &COLUMNS);



***************
*** 176,183 ****
int visible_len;


! if (menu_resized(page)) {
! menu_get_sizes(page, &LINES, &COLUMNS);

Kari E. Hurtta

unread,
Jul 13, 2005, 5:44:19 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.5

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 5/18
=========================================================================
if (&cs_onebyte == Mx->builtin_map->map_type)
Index: elm2.4.ME+.122-cvs/lib/ldstate.c
*** elm2.4.ME+.121/lib/ldstate.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/ldstate.c 2005-06-18 00:02:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.11 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ldstate.c,v 1.12 2005/06/17 21:02:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 98,103 ****
--- 98,106 ----

}

+ static char *elm_fgetline P_((char *buf,
+ unsigned buflen,
+ FILE *fp));
static char *elm_fgetline(buf, buflen, fp)
char *buf;
unsigned buflen;
Index: elm2.4.ME+.122-cvs/lib/localmbx.c
*** elm2.4.ME+.121/lib/localmbx.c 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/localmbx.c 2005-06-18 00:02:54.000000000 +0300
***************
*** 1,11 ****


! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.67 2004/09/13 08:00:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.67 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Based on code ../src/newmbox.c and ../src/lock.c.

* That code was following copyright:
*
* The Elm Mail System

--- 1,11 ----
! static char rcsid[] = "@(#)$Id: localmbx.c,v 1.73 2005/06/17 21:02:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.73 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Based on code ../src/newmbox.c, ../src/lock.c and ../src/string2.c.

* That code was following copyright:
*
* The Elm Mail System
***************

*** 22,27 ****
--- 22,33 ----

DEBUG_VAR(Debug,__FILE__,"file");



+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif

+
static unsigned char * s2us P_((char *str));
static unsigned char * s2us(str)
char *str;
***************
*** 228,233 ****
--- 234,240 ----

#ifdef DIROPS

+ static void browser_zero_local P_((struct folder_browser *dir));
static void browser_zero_local(dir)
struct folder_browser *dir;
{
***************
*** 236,241 ****
--- 243,250 ----
dir->a.local_browser.handle = NULL;
}

+ static void browser_free_local P_((struct folder_browser *dir));
+
static void browser_free_local(dir)
struct folder_browser *dir;
{
***************
*** 292,297 ****
--- 301,308 ----
pathname,err,error_description(err)));
flags = BROWSER_NOFOLDER|BROWSER_NODIR;
} else {
+ dir->vector[idx].mtime = buf.st_mtime;
+
if (
#ifdef S_ISDIR
!S_ISDIR(buf.st_mode)
***************
*** 1353,1358 ****
--- 1364,1498 ----
}
}

+ static int sort_by_name P_((const void *A, const void *B));
+ static int sort_by_name(A,B)
+ CONST void *A;
+ CONST void *B;
+ {
+ CONST struct name_vector * A1 = A;
+ CONST struct name_vector * B1 = B;
+
+ int r = string_cmp(A1->disp_name,
+ B1->disp_name,
+ 0 /* compare fialure */);
+
+ if (0 == r)
+ r = strcmp(A1->sys_name,B1->sys_name);
+
+ return r;
+ }
+
+ static int sort_by_revname P_((const void *A, const void *B));
+ static int sort_by_revname(A,B)
+ CONST void *A;
+ CONST void *B;
+ {
+ return -sort_by_name(A,B);
+ }
+
+ static int sort_by_mtime P_((const void *A, const void *B));
+ static int sort_by_mtime(A,B)
+ CONST void *A;
+ CONST void *B;
+ {
+ CONST struct name_vector * A1 = A;
+ CONST struct name_vector * B1 = B;
+
+ int r = A1->mtime - B1->mtime;
+
+ if (0 == r)
+ r = strcmp(A1->sys_name,B1->sys_name);
+
+ return r;
+
+ }
+ static int sort_by_revmtime P_((const void *A, const void *B));
+ static int sort_by_revmtime(A,B)
+ CONST void *A;
+ CONST void *B;
+ {
+ return -sort_by_mtime(A,B);
+ }
+
+
+ S_(browser_folder_sort_dir browser_folder_sort_local)
+ static void browser_folder_sort_local P_((struct folder_browser *dir,
+ print_sort_message * print));
+ static void browser_folder_sort_local(dir,print)
+ struct folder_browser *dir;
+ print_sort_message * print;
+ {
+ struct string * msg = NULL;
+ int i;
+
+ if (dir->vector_len < 2)
+ return;
+
+ switch (give_dt_sort_as_int(&local_dir_sortby)) {
+ case LD_NONE: return;
+ case LD_NAME_SORT:
+
+ if (dir->vector_len < 10) {
+ msg = format_string(CATGETS(elm_msg_cat, MeSet, MeSortingDirByName,
+ "Sorting directory %S by Name"),
+ dir->dirname);
+ print(msg);
+ }
+ qsort(dir->vector,dir->vector_len,sizeof (dir->vector[0]),
+ sort_by_name);
+ break;
+ case REVERSE LD_NAME_SORT:
+
+ if (dir->vector_len > 10) {
+ msg = format_string(CATGETS(elm_msg_cat, MeSet, MeSortingDirByRevName,
+ "Sorting directory %S by Reverse Name"),
+ dir->dirname);
+ print(msg);
+ }
+ qsort(dir->vector,dir->vector_len,sizeof (dir->vector[0]),
+ sort_by_revname);
+ break;
+ case LD_MTIME_SORT:
+
+ if (dir->vector_len < 10) {
+ msg = format_string(CATGETS(elm_msg_cat, MeSet, MeSortingDirByMtime,
+ "Sorting directory %S by Modify Time"),
+ dir->dirname);
+ print(msg);
+ }
+ for (i = 0; i < dir->vector_len; i++)
+ if (dir->vector[i].flags & BROWSER_NEEDSTAT)
+ browser_local_do_stat(dir,i);
+
+
+ qsort(dir->vector,dir->vector_len,sizeof (dir->vector[0]),
+ sort_by_mtime);
+ break;
+ case REVERSE LD_MTIME_SORT:
+
+ if (dir->vector_len > 10) {
+ msg = format_string(CATGETS(elm_msg_cat, MeSet, MeSortingDirByRevMtime,
+ "Sorting directory %S by Reverse Modify Time"),
+ dir->dirname);
+ print(msg);
+ }
+
+ for (i = 0; i < dir->vector_len; i++)
+ if (dir->vector[i].flags & BROWSER_NEEDSTAT)
+ browser_local_do_stat(dir,i);
+
+ qsort(dir->vector,dir->vector_len,sizeof (dir->vector[0]),
+ sort_by_revmtime);


+ break;
+
+ }
+

+ if (msg) {
+ print(NULL);
+ free_string(&msg);
+ }
+ }
+


struct browser_type local_browser = { browser_zero_local,
***************
*** 1380,1386 ****
browser_make_ref_local,
browser_update_local,
browser_local_do_stat,
! browser_sync_write_local
};

#endif /* DIROPS */
--- 1520,1527 ----
browser_make_ref_local,
browser_update_local,
browser_local_do_stat,
! browser_sync_write_local,
! browser_folder_sort_local
};

#endif /* DIROPS */
***************
*** 2127,2135 ****
--- 2268,2279 ----
char *Y = NULL, *Y1 = "";

char * prefix = "mbox.";
+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ int ls = give_dt_enumerate_as_int(&local_sessionlock_use_home);

int L;

+
if (stat(mbox,&buf) < 0) {
DPRINT(Debug,8,(&Debug,
"mk_temp_mail_fn: stat %s failed\n",
***************
*** 2140,2160 ****

DPRINT(Debug,11,(&Debug,
"mk_temp_mail_fn: in_spool=%d, mbox=%s, local_sessionlock_use_home=%d\n",
! in_spool,mbox,local_sessionlock_use_home));

/* We need not use default_temp or local_sessionlock_dir
if file is not on spool area
*/

!
! switch (local_sessionlock_use_home) {
case 0: /* newer */
default:
! Y = in_spool ? local_sessionlock_dir : temp_dir;
break;
case 1: /* spool */
! Y = in_spool ? home : temp_dir;
! prefix = in_spool ? ".mbox." : "mbox.";
break;
case 2: /* always */
Y = home;
--- 2284,2303 ----

DPRINT(Debug,11,(&Debug,
"mk_temp_mail_fn: in_spool=%d, mbox=%s, local_sessionlock_use_home=%d\n",
! in_spool,mbox,ls));

/* We need not use default_temp or local_sessionlock_dir
if file is not on spool area
*/

! switch (ls) {
case 0: /* newer */
default:
! Y = in_spool || !tmp ? local_sessionlock_dir : tmp;
break;
case 1: /* spool */
! Y = in_spool || !tmp ? home : tmp;
! prefix = in_spool || !tmp ? ".mbox." : "mbox.";
break;
case 2: /* always */
Y = home;
***************
*** 2162,2168 ****
break;
case 3: /* non-spool */
Y = in_spool ? local_sessionlock_dir : home;
! prefix = in_spool ? "mbox." : ".mbox.";
break;
}

--- 2305,2311 ----
break;
case 3: /* non-spool */
Y = in_spool ? local_sessionlock_dir : home;
! prefix = in_spool ? "mbox." : ".mbox.";


break;
}

***************
*** 2415,2420 ****

--- 2558,2590 ----


return status;
}

+ static void set_closeonexec_folder P_((struct folder_info *folder));
+ static void set_closeonexec_folder(folder)
+ struct folder_info *folder;
+ {
+ int r;
+
+ #ifdef FD_CLOEXEC
+ r = fcntl(fileno(folder -> p->fh_folder), F_SETFD, FD_CLOEXEC);
+ #else
+ r = fcntl(fileno(folder -> p->fh_folder), F_SETFD, 1);
+ #endif
+
+ if (-1 == r) {
+ int err = errno;
+
+ DPRINT(Debug,1,(&Debug,
+ "Failed to set close-on-exec flag for %s: %s\n",
+ folder->cur_folder_sys,
+ error_description(err)));
+ } else {
+ DPRINT(Debug,11,(&Debug,
+ "Set close-on-exec flag for %s\n",
+ folder->cur_folder_sys));

+ }
+ }
+
+

static int mbx_sessionlock_non_spool P_((struct folder_info *folder,
enum sessionlock_mode mode));

***************
*** 2458,2463 ****

--- 2628,2634 ----


DPRINT(Debug,10,(&Debug,
"Mailfile (folder) opened: %s\n",
folder->cur_folder_sys));
+ set_closeonexec_folder(folder);
} else
rewind(folder->p->fh_folder);

***************
*** 2541,2546 ****

--- 2712,2719 ----


"Mailfile (folder) opened: %s %s\n",
folder->cur_folder_sys,
folder->p->fh_folder ? "" : " (non existant)"));
+ if (folder->p->fh_folder)
+ set_closeonexec_folder(folder);
} else {
rewind(folder->p->fh_folder);
}

***************
*** 3257,3266 ****
entry->status = VISIBLE | NEW | UNREAD; /* Default status of message */

} else {

entry->status = VISIBLE | UNREAD; /* Default status of message */

! switch(def_folder_status) {
case FOLDER_STATUS_READ:
entry->status = VISIBLE;
break;
--- 3430,3440 ----
entry->status = VISIBLE | NEW | UNREAD; /* Default status of message */

} else {
+ int de = give_dt_enumerate_as_int(&def_folder_status);

entry->status = VISIBLE | UNREAD; /* Default status of message */

! switch(de) {
case FOLDER_STATUS_READ:
entry->status = VISIBLE;
break;
***************
*** 3273,3279 ****
default:
DPRINT(Debug,1,(&Debug,
"default-folder-status=%d BAD\n",
! def_folder_status));
}
DPRINT(Debug,11,(&Debug, " status=%x -- def_folder_status=%d\n",
entry->status,entry->status));
--- 3447,3453 ----
default:
DPRINT(Debug,1,(&Debug,
"default-folder-status=%d BAD\n",
! de));
}
DPRINT(Debug,11,(&Debug, " status=%x -- def_folder_status=%d\n",
entry->status,entry->status));
***************
*** 4304,4312 ****
KEEP_STATE keep_state_ptr;
{
int status = 0,err;

keep_state_ptr -> a.file.temp_keep_file =
! elm_message(FRM("%s%s%d"),temp_dir, temp_file, getpid());

if ((err = can_open(keep_state_ptr -> a.file.temp_keep_file, "sw"))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmLeaveTempFileDenied,
--- 4478,4491 ----
KEEP_STATE keep_state_ptr;
{
int status = 0,err;
+ char * tmp;


+
+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ tmp = "/tmp/";

keep_state_ptr -> a.file.temp_keep_file =
! elm_message(FRM("%s%s%d"),tmp, temp_file, getpid());

if ((err = can_open(keep_state_ptr -> a.file.temp_keep_file, "sw"))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmLeaveTempFileDenied,
***************
*** 4901,4937 ****
if ((len == 1 && 0 == memcmp(buffer,"\n",len)) ||
(len == 2 && 0 == memcmp(buffer,"\r\n",len))) {
if (!status_written) {
count += fprintf(keep_state_ptr->a.file.keep_file,
"Status: ");

! if (!ison(entry->status, UNREAD)) {
! putc('R',keep_state_ptr->a.file.keep_file);
! count ++;
! }
! if (ison(entry->status, NEW)) {
! putc('N',keep_state_ptr->a.file.keep_file);
! count ++;
! } else {
! putc('O',keep_state_ptr->a.file.keep_file);
! count ++;
! }
! if (ison(entry->status, REPLIED)) {
! putc('r',keep_state_ptr->a.file.keep_file);
! count ++;
! }
! /* Write unknown flags */
! for (i=0; entry->mailx_status[i] != '\0'; i++)
! switch(entry->mailx_status[i]) {
! case 'R':
! case 'O':
! case 'r':
! case 'N':
! break;
! default:
! putc(entry->mailx_status[i],
! keep_state_ptr->a.file.keep_file);
! count++;
! }
/* Write EOLN */
for (i = 0; i < len; i++) {
putc(buffer[i],keep_state_ptr->a.file.keep_file);
--- 5080,5094 ----
if ((len == 1 && 0 == memcmp(buffer,"\n",len)) ||
(len == 2 && 0 == memcmp(buffer,"\r\n",len))) {
if (!status_written) {
+ char buffer1[WLEN+10]; /* Enough space for status letters */
+
count += fprintf(keep_state_ptr->a.file.keep_file,
"Status: ");

! if (status_2_mailbox(entry,buffer1,sizeof buffer1) > 0)
! count += fprintf(keep_state_ptr->a.file.keep_file,
! "%s",buffer1);
!
/* Write EOLN */
for (i = 0; i < len; i++) {
putc(buffer[i],keep_state_ptr->a.file.keep_file);
***************
*** 5431,5436 ****
--- 5588,5695 ----
mbx_free_ks_fields_file,
mbx_get_spool_mode };

+ void mailbox_2_status(status,entry)
+ char * status;
+ struct header_rec *entry;
+ {
+
+ strfcpy(entry->mailx_status, status, WLEN);
+
+ remove_possible_trailing_spaces(entry->mailx_status);
+
+ /* Okay readjust the status. If there's an 'R', message
+ * is read; if there is no 'R' but there is an 'O', message
+ * is unread. In any case it isn't new because a new
+ * message wouldn't have a Status: header.
+ * -- if message is re$ynced there may now be
+ * Status: -header
+ */
+ if (index(status, 'R') != NULL)
+ entry->status &= ~(NEW | UNREAD);
+
+ else if (index(status,'O') != NULL) {
+ entry->status &= ~NEW;
+ entry->status |= UNREAD;
+ }
+
+ if (index(status, 'r') != NULL)
+ entry->status |= REPLIED;
+ if (index(status, 'F') != NULL)
+ entry->status1 |= S1_FLAGGED;
+
+ }
+
+ int status_2_mailbox(entry,buffer,size)
+ struct header_rec *entry;
+ char *buffer;
+ int size;


+ {
+ int count = 0;

+ int i;
+
+ size--; /* For trailing \0' */
+
+ #define ADD(x) do { if (count < size) { buffer[count++] = (x); } else { goto fail; } } while(0)
+
+ if (!ison(entry->status, UNREAD))
+ ADD('R');
+
+ if (ison(entry->status, NEW))
+ ADD('N');
+ else
+ ADD('O');
+
+ if (ison(entry->status, REPLIED))
+ ADD('r');
+
+
+ if (ison(entry->status1, S1_FLAGGED))
+ ADD('F');
+
+ /* Write unknown flags */
+ for (i=0; entry->mailx_status[i] != '\0'; i++)
+ switch(entry->mailx_status[i]) {
+ case 'R':
+ case 'O':
+ case 'r':
+ case 'N':
+ case 'F':
+ break;
+ default:
+ ADD(entry->mailx_status[i]);
+ }
+
+ fail:
+ buffer[count] = '\0';
+
+ #undef ADD
+
+ return count;
+ }
+
+ void remove_possible_trailing_spaces(string)
+ char *string;
+ {
+ /** an incredibly simple routine that will read backwards through
+ a string and remove all trailing whitespace.
+ **/
+
+ int i, j;
+
+ for ( j = i = strlen(string); --i >= 0 && whitespace(string[i]); )
+ /** spin backwards, semicolon intented **/ ;
+
+ if (i > 0 && string[i-1] == '\\') /* allow for line to end with \blank */
+ i++;
+
+ if (i < j)
+ string[i+1] = '\0'; /* note that even in the worst case when there
+ are no trailing spaces at all, we'll simply
+ end up replacing the existing '\0' with
+ another one! No worries, as M.G. would say
+ */


+ }
+

/*
* Local Variables:

***************
*** 5440,5442 ****
--- 5699,5705 ----
* End:


*/

+
+
+
+

Index: elm2.4.ME+.122-cvs/lib/MAGIC
*** elm2.4.ME+.121/lib/MAGIC 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/MAGIC 2005-07-01 12:15:03.000000000 +0300
***************
*** 8,13 ****
--- 8,14 ----
#define STATE_ISO2022_magic 0xF302
#define ISO2022_MAPINFO_magic 0xF303
#define DISPLAY_STATE_magic 0xF304
+ #define STATE_WCHAR_magic 0xF305
#define MAILCAP_magic 0xF400
#define MAILCAP_PARAM_magic 0xF401
#define RCTYPE_magic 0xF402
***************
*** 15,29 ****
--- 16,37 ----


#define LDSTATE_magic 0xF501
#define MAILBOXTYPE_magic 0xF502
#define SORTDATATYPE_magic 0xF503
+ #define REMOTE_ACCOUNT_magic 0xF504
#define ALIASVIEW_magic 0xF600
#define ALIASTYPE_magic 0xF601
#define MENU_COMMON_magic 0xF700

#define MCOMMON_TYPE_magic 0xF701
#define MENU_CONTEXT_magic 0xF800
+ #define MENU_DRAW_magic 0xF801
+ #define MENU_CONTAINER_magic 0xF802
+ #define MENU_SUBPAGE_magic 0xF803
+ #define MENU_HEADER_magic 0xF804
+ #define MENU_SCOMMON_magic 0xF805


#define SHARED_LOADER_magic 0xF900
#define SHARED_CONNECT_magic 0xF901
#define SHARED_BASE_magic 0xF902

#define CANCEL_magic 0xF903
+ #define SHARED_MAILER_magic 0xF904


#define RF_magic 0xFA00
#define UNIDATA_magic 0xFB00
#define BINDATA_magic 0xFB01

***************
*** 31,36 ****
--- 39,45 ----
#define MAIL_HDR_magic 0xFC01
#define EXP_ADDR_magic 0xFC02
#define MEDIA_TYPE_magic 0xFC03
+ #define MIME_PARAM_magic 0xFC04
#define MIME_magic 0xFD00
#define MPAR_magic 0xFD01
#define MPAR_rfc822_magic 0xFD02
Index: elm2.4.ME+.122-cvs/lib/mailer.c
*** elm2.4.ME+.121/lib/mailer.c 2004-06-27 22:39:33.000000000 +0300
--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************
*** 1,2131 ****
- static char rcsid[] = "@(#)$Id: mailer.c,v 1.47 2004/05/23 12:31:00 hurtta Exp $";
-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $
- *
- * Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)


- *****************************************************************************/
-
- #include "headers.h"

- #include "s_elm.h"
-
- #include "mailer_imp.h"
- #ifdef USE_DLOPEN
- #include "shared_imp.h"
- #endif
-
-
- DEBUG_VAR(Debug,__FILE__,"mailer");
-
- #include <errno.h>
- #ifndef ANSI_C
- extern int errno;
- #endif
-
- static unsigned char *s2us P_((char *str));
- static unsigned char *s2us(str)
- char *str;
- {
- return (unsigned char *)str;
- }
-
- #ifdef BACKGROUD_PROCESSES
- VOLATILE int handle_sigchld = 0; /* got SIGCHLD */
-
- #endif
-
- int MO_default_value (M,L,value,set)
- struct mailer_config *M;
- struct mailer_option_list *L;
- char **value;
- int set;
- {
- if (set) {
- if (!value) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailerOptionValue,
- "Mailer option %s requires value"),
- L->field);
- return 0;
- }
-
- if (L->malloced) {
- free(*(L->value));
- *(L->value) = NULL;
- }
-
- *(L->value) = safe_strdup(*value);
- L->malloced = 1;
- }
- else {
- *value = *(L->value);


- }
- return 1;
- }
-
-

- #if ANSI_C
- #define S_(x) static x;
- #else
- #define S_(x)
- #endif
-
- S_(mailer_set_option default_set_option)
- static int default_set_option(M,X,value)
- struct mailer_config *M;
- struct mailer_option_list *X;
- char *value;
- {
- int r ;
-
- r = X->value_func(M,X,&value,1);
- return r;
- }
-
- S_(mailer_init_hook default_mailer_init)
- static int default_mailer_init();
-
- S_(mailer_init_hook submitmail_mailer_init)
- static int submitmail_mailer_init();
-
-
- S_(mailer_close_hook default_mailer_close)
- static void default_mailer_close();
-
- S_(mailer_info_init_hook default_mailer_info_init)
- static int default_mailer_info_init();
-
- S_(mailer_info_close_hook null_mailer_info_close)
- static void null_mailer_info_close(M,I)
- struct mailer_config *M;
- struct mailer_info *I;
- {
- /* Nothing */
- }
-
- /* Return
- -1 if caller should result with default data (return 1)
- -2 if caller should just test passwd
- 0 if failure
- 1 is succees
- */
- S_(mailer_info_verify_addr default_mailer_info_verify_addr)
- static int default_mailer_info_verify_addr(M,I,text,result)
- struct mailer_config *M;
- struct mailer_info *I;
- CONST char *text;
- struct addr_item *result;
- {
- return -2; /* caller does job */
- }
-
- S_(mailer_info_gen_def_ef default_mailer_info_gen_def_ef)
- static void default_mailer_info_gen_def_ef(M,I,X)
- struct mailer_config *M;
- struct mailer_info *I;
- struct mailer_env_from *X;
- {
- /* Nothing */
- }
-
- S_(mailer_info_set_ef default_mailer_info_set_ef)
- static void default_mailer_info_set_ef(M,I,X,value)
- struct mailer_config *M;
- struct mailer_info *I;
- struct mailer_env_from *X;
- CONST char *value;
- {
- /* Sets env from without checking */
- X->mail_from = strmcpy(X->mail_from,value);
- }
-
- /* Return
- 1 == mailer restarted, reconnect succeed -- reask info
- 0 == mailer not disconnected
- -1 == mailer disconnected, reconnect failed
- */
- S_(mailer_info_restart_hook default_mailer_info_rs_hook)
- static int default_mailer_info_rs_hook P_((struct mailer_config *M,
- struct mailer_info *I));
- static int default_mailer_info_rs_hook(M,I)
- struct mailer_config *M;
- struct mailer_info *I;
- {
- return 0; /* Assume not restarted */
- }
-
- S_(mailer_info_set_ef sendmail_mailer_info_set_ef)
- static void sendmail_mailer_info_set_ef();
-
- S_(mailer_info_verify_addr sendmail_mailer_info_verify_addr)
- static int sendmail_mailer_info_verify_addr();
-
-
- S_(mailer_info_query_hook default_mailer_info_query)
- static int default_mailer_info_query();
-
- S_(mailer_info_query_hook sendmail_mailer_info_query)
- static int sendmail_mailer_info_query();
-
- S_(mailer_backend_hook unknown_mailer_backend)
- static int unknown_mailer_backend();
- S_(mailer_backend_hook sendmail_mailer_backend)
- static int sendmail_mailer_backend();
- S_(mailer_backend_hook submitmail_mailer_backend)
- static int submitmail_mailer_backend();
- S_(mailer_backend_hook execmail_mailer_backend)
- static int execmail_mailer_backend();
-
- static struct mailer_config * selected_mailer = NULL;
-
- static char * unknown_mailer_path = DEFAULT_MAILER_PATH;
- static char * sendmail_mailer_path = SENDMAIL_MAILER_PATH;
- static char * submitmail_mailer_path = SUBMITMAIL_MAILER_PATH;
- static char * execmail_mailer_path = EXECMAIL_MAILER_PATH;
-
- static enum bodytypes {
- have_7bit = 0, have_8bit = 1, have_binary = 2
- } sendmail_supported_bodytype = have_7bit;
- static int sendmail_supports_dsn = 0;
- static int sendmail_verify_address = 0;
-
- static int MO_sendmail_bodytype P_((struct mailer_config * M,
- struct mailer_option_list * L,
- char **value,int set));
- static int MO_sendmail_bodytype (M,L,value,set)
- struct mailer_config *M;
- struct mailer_option_list *L;
- char **value;
- int set;
- {
- static char *sendmail_bodytypes[] = { "7bit", "8bit", "binary" };
- static int value_set = 0;
-
- if (set) {
- int i;
-
- if (!*value) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailerOptionValue,
- "Mailer option %s requires value"),
- L->field);


- return 0;
- }
-

- for (i = 0;
- i < sizeof sendmail_bodytypes / sizeof (sendmail_bodytypes[0]);
- i++) {
- if (0 == strcmp(sendmail_bodytypes[i],*value)) {
- sendmail_supported_bodytype = (enum bodytypes)i;
- value_set = 1;


- return 1;
- }
- }

- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSendmailBadBodytype,
- "Bad supported-bodytype %s for sendmail"),
- *value);
- return 0;
- }
- else {
- if (sendmail_supported_bodytype < have_7bit ||
- sendmail_supported_bodytype > have_binary)
- panic("MAILER PANIC",__FILE__,__LINE__,
- "MO_sendmail_bodytype",
- "Bad supported-bodytype",0);
-
- *value = sendmail_bodytypes[sendmail_supported_bodytype];
- if (sendmail_supported_bodytype > have_7bit)
- return 1; /* Give value always */
- }
- return value_set; /* Return calue only if set at lweast once */
- }
-
- static int MO_sendmail_dsn P_((struct mailer_config * M,
- struct mailer_option_list * L,
- char **value,int set));
- static int MO_sendmail_dsn (M,L,value,set)
- struct mailer_config *M;
- struct mailer_option_list *L;
- char **value;
- int set;
- {
- static char *no_yes[] = { "no", "yes" };
- static int value_set = 0;
-
- if (set) {
- if (!*value)
- sendmail_supports_dsn = 1;
- else if (0 == strcmp(*value,no_yes[0]))
- sendmail_supports_dsn = 0;
- else if (0 == strcmp(*value,no_yes[1]))
- sendmail_supports_dsn = 1;
- else {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSendmailBadDsn,
- "Bad supports-dsn=%s for sendmail"),
- *value);
- return 0;
- }
- value_set = 1;
- } else {
- /* Do not return option if sendmail_supports_dsn is not supported */
-
- if (sendmail_supports_dsn) {
- *value = no_yes[1];
- return 1;
- }
- *value = no_yes[0]; /* Only show if supports-dsn=no or
- supports-dsn=yes is given at least once
- */
- }
- return value_set;
- }
-
- static int MO_sendmail_verify P_((struct mailer_config * M,
- struct mailer_option_list * L,
- char **value,int set));
- static int MO_sendmail_verify (M,L,value,set)
- struct mailer_config *M;
- struct mailer_option_list *L;
- char **value;
- int set;
- {
- static char *no_yes[] = { "no", "yes" };
- static int value_set = 0;
-
- if (set) {
- if (!*value)
- sendmail_verify_address = 1;
- else if (0 == strcmp(*value,no_yes[0]))
- sendmail_verify_address = 0;
- else if (0 == strcmp(*value,no_yes[1]))
- sendmail_verify_address = 1;
- else {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSendmailBadVerify,
- "Bad verify=%s for sendmail"),
- *value);
- return 0;
- }
- value_set = 1;
- } else {
- if (sendmail_verify_address) {
- *value = no_yes[1];
- return 1;
- }
- *value = no_yes[0]; /* Only show if verify=no or
- verify=yes is given at least once
- */
- }
- return value_set;
- }
-
-
- static int MO_dont_add_from P_((struct mailer_config * M,
- struct mailer_option_list * L,
- char **value,int set));
- static int MO_dont_add_from (M,L,value,set)
- struct mailer_config *M;
- struct mailer_option_list *L;
- char **value;
- int set;
- {
- static char *yes_dont[] = { "yes", "dont" };
- static int value_set = 0;
-
- if (set) {
- if (!*value)
- M -> mailer_bits &= ~MB_DONT_ADD_FROM;
- else if (0 == strcmp(*value,yes_dont[0]))
- M -> mailer_bits &= ~MB_DONT_ADD_FROM;
- else if (0 == strcmp(*value,yes_dont[1]))
- M -> mailer_bits |= MB_DONT_ADD_FROM;
- else {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadAddFrom,
- "Bad add-from=%s for %s"),
- *value, M->mailer_type);
- return 0;
- }
- value_set = 1;
- } else {
-
- *value = yes_dont[ (M -> mailer_bits & MB_DONT_ADD_FROM) ?
- 1 : 0 ];
-
- if (M -> mailer_bits & MB_DONT_ADD_FROM)
- return 1;
-
- /* Do not show add-from=yes if it is not set explicity */
- }
-
- return value_set;
- }
-
- static int MO_use_domain P_((struct mailer_config * M,
- struct mailer_option_list * L,
- char **value,int set));
- static int MO_use_domain (M,L,value,set)
- struct mailer_config *M;
- struct mailer_option_list *L;
- char **value;
- int set;
- {
- static char *no_yes[] = { "no", "yes" };
- static int value_set = 0;
-
- if (set) {
- if (!*value)
- M -> mailer_bits |= MB_USE_DOMAIN;
- else if (0 == strcmp(*value,no_yes[0]))
- M -> mailer_bits &= ~MB_USE_DOMAIN;
- else if (0 == strcmp(*value,no_yes[1]))
- M -> mailer_bits |= MB_USE_DOMAIN;
- else {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadUseDomain,
- "Bad use-domain=%s for %s"),
- *value, M->mailer_type);
- return 0;
- }
- value_set = 1;
- } else {
-
- *value = no_yes[ (M -> mailer_bits & MB_USE_DOMAIN) ?
- 1 : 0 ];
-
- if (!(M -> mailer_bits & MB_USE_DOMAIN))
- return 1;
-
- /* Do not show use-domain=yes if it is not set explicity */
- }
-
- return value_set;
- }
-
- int MO_allow_set_sender (M,L,value,set)
- struct mailer_config *M;
- struct mailer_option_list *L;
- char **value;
- int set;
- {
- static char *no_yes[] = { "no", "yes" };
- static int value_set = 0;
-
- if (set) {
- if (!*value)
- M -> mailer_bits |= MB_ALLOW_SET_SENDER;
- else if (0 == strcmp(*value,no_yes[0]))
- M -> mailer_bits &= ~MB_ALLOW_SET_SENDER;
- else if (0 == strcmp(*value,no_yes[1]))
- M -> mailer_bits |= MB_ALLOW_SET_SENDER;
- else {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadAllowSetSender,
- "Bad allow-set-sender=%s for %s"),
- *value, M->mailer_type);
- return 0;
- }
- value_set = 1;
- } else {
-
- *value = no_yes[ (M -> mailer_bits & MB_ALLOW_SET_SENDER) ?
- 1 : 0 ];
-
- if (M -> mailer_bits & MB_ALLOW_SET_SENDER)
- return 1;
-
- /* Do not show use-domain=no if it is not set explicity */
- }
-
- return value_set;
- }
-
-
- static struct mailer_option_list UNKNOWN_options[] = {
- { "path", &unknown_mailer_path, MO_default_value, 0 },
- { "add-from", NULL, MO_dont_add_from, 0 },
- { "use-domain", NULL, MO_use_domain, 0 },
- { NULL, NULL, MO_default_value, 0 }
- };
-
- static struct mailer_option_list SENDMAIL_options[] = {
- { "path", &sendmail_mailer_path, MO_default_value, 0 },
- { "add-from", NULL, MO_dont_add_from, 0 },
- { "use-domain", NULL, MO_use_domain, 0 },
- { "supported-bodytype", NULL, MO_sendmail_bodytype, 0 },
- { "supports-dsn", NULL, MO_sendmail_dsn, 0 },
- { "verify", NULL, MO_sendmail_verify, 0 },
- { "allow-set-sender",NULL, MO_allow_set_sender, 0 },
- { NULL, NULL, MO_default_value, 0 }
- };
-
- static struct mailer_option_list SUBMITMAIL_options[] = {
- { "path", &submitmail_mailer_path, MO_default_value, 0 },
- { "add-from", NULL, MO_dont_add_from, 0 },
- { "use-domain", NULL, MO_use_domain, 0 },
- { NULL, NULL, MO_default_value, 0 }
- };
- static struct mailer_option_list EXECMAIL_options[] = {
- { "path", &execmail_mailer_path, MO_default_value, 0 },
- { "add-from", NULL, MO_dont_add_from, 0 },
- { "use-domain", NULL, MO_use_domain, 0 },
- { NULL, NULL, MO_default_value, 0 }
- };
-
-
- static struct mailer_config MAILERS[] = {
- { "unknown", &(UNKNOWN_options[0]), default_set_option,
- default_mailer_init, default_mailer_close, unknown_mailer_backend,
- &unknown_mailer_path,
- default_mailer_info_init, null_mailer_info_close,
- default_mailer_info_query, default_mailer_info_verify_addr,
- default_mailer_info_gen_def_ef, default_mailer_info_set_ef,
- default_mailer_info_rs_hook,
-
- MB_USE_DOMAIN
- },
- { "sendmail", &(SENDMAIL_options[0]), default_set_option,
- default_mailer_init, default_mailer_close, sendmail_mailer_backend,
- &sendmail_mailer_path,
- default_mailer_info_init, null_mailer_info_close,
- sendmail_mailer_info_query, sendmail_mailer_info_verify_addr,
- default_mailer_info_gen_def_ef, sendmail_mailer_info_set_ef,
- default_mailer_info_rs_hook,
-
- MB_DONT_ADD_FROM
- },
- { "submitmail", &(SUBMITMAIL_options[0]), default_set_option,
- submitmail_mailer_init, default_mailer_close, submitmail_mailer_backend,
- &submitmail_mailer_path,
- default_mailer_info_init, null_mailer_info_close,
- default_mailer_info_query, default_mailer_info_verify_addr,
- default_mailer_info_gen_def_ef, default_mailer_info_set_ef,
- default_mailer_info_rs_hook,
-
- MB_USE_DOMAIN
- },
- { "execmail", &(EXECMAIL_options[0]), default_set_option,
- default_mailer_init, default_mailer_close, execmail_mailer_backend,
- &execmail_mailer_path,
- default_mailer_info_init, null_mailer_info_close,
- default_mailer_info_query, default_mailer_info_verify_addr,
- default_mailer_info_gen_def_ef, default_mailer_info_set_ef,
- default_mailer_info_rs_hook,
-
- MB_DONT_ADD_FROM
- }
- };
-
- static int valid_mailer P_((struct mailer_config *T));
- static int valid_mailer(T)
- struct mailer_config *T;
- {
- int x;
-
- for (x = 0; x < (sizeof MAILERS) / sizeof (MAILERS[0]); x++)
- if (T == &MAILERS[x])
- return 1;
- #ifdef USE_DLOPEN
- for (x = 0; x < shared_MCF_type_count; x++)
- if (T == shared_MCF_types[x].T)
- return 1;
- #endif


- return 0;
- }
-

- static int default_mailer_info_init(M,I)
- struct mailer_config *M;
- struct mailer_info *I;
- {
-
- if (M->mailer_path) {
- /* CHECK that mailer is executable ... */
-
- if (! *(M->mailer_path) ||
- !(*(M->mailer_path))[0] ||
- 0 == strcmp(*(M->mailer_path),"none")
- ) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailerPath,
- "Mailer path for %s not specified"),
- M->mailer_type);
- return 0;
- }
-
- if (0 != access(*(M->mailer_path),EXECUTE_ACCESS)) {


- int err = errno;

- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNotExecutable,
- "%s not executable: %s"),
- *(M->mailer_path),error_description(err));


- return 0;
- }
- }
-

- return 1;
- }
-

-
- static int default_mailer_info_query(M,I,query)
- struct mailer_config *M;
- struct mailer_info *I;
- enum MI_query query;
- {
- /* Answer to universal queries */
-
- switch(query) {
- case MI_DONT_ADD_FROM:
- return (M -> mailer_bits & MB_DONT_ADD_FROM) ? 1 : 0;
- case MI_USE_DOMAIN:
- return (M -> mailer_bits & MB_USE_DOMAIN) ? 1 : 0;
- }
-
- return 0; /* Not available */
- }
-
- static int sendmail_mailer_info_query(M,I,query)
- struct mailer_config *M;
- struct mailer_info *I;
- enum MI_query query;
- {
- switch(query) {
-
- case MI_HAVE_8BITMIME:
- return sendmail_supported_bodytype >= have_8bit;
-
- case MI_HAVE_BINARYMIME:
- return sendmail_supported_bodytype >= have_binary;
-
- case MI_HAVE_DSN:
- return sendmail_supports_dsn;
- }
-
- return default_mailer_info_query(M,I,query);
- }
-
-
- static char * delay_parsing_info = NULL;
-
- static int check_mailer P_((void));
- static int check_mailer()
- {
- if (selected_mailer)
- return 1;
- if (delay_parsing_info) {
- int r = mailerfunc(&delay_parsing_info,-1,0,NULL);
- free(delay_parsing_info); delay_parsing_info = NULL;
- return r;


- }
- return 0;
- }
-

- int mailerfunc(value,enter,lineno,filename)
- char **value;
- int enter;
- int lineno;
- char *filename;
- {
- int ok = 1;
-
- if (enter) {
- int i;
- char * WALK;
-
- char * temp = safe_strdup(*value);
-
- char * f = mime_parse_content_opts(temp, &WALK);
-
- if (!f) {
- free(temp);


- return 0;
- }
-

- for (i = 0; i < (sizeof MAILERS) / sizeof (MAILERS[0]); i++)
- if (0 == strcmp(f,MAILERS[i].mailer_type))
- break;
- if (i >= (sizeof MAILERS) / sizeof (MAILERS[0])) {
-
- #ifdef USE_DLOPEN
- if (enter > 0) {
- DPRINT(Debug,8,(&Debug,"mailerfunc: Parsing delayed\n"));
-
- delay_parsing_info = strmcpy(delay_parsing_info,*value);
- free(temp);


- return 1;
- }
-

- selected_mailer = loc_mailer_type(f);
- if (selected_mailer)
- goto found_shared;
- #endif
-
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnknowMailerType,
- "Unknown mailer type %s"),
- f);
-
- free(temp);
- return 0;
- }
- selected_mailer = &(MAILERS[i]);
-
- found_shared:
-
- while (NULL != (f = mime_parse_content_opts(NULL, &WALK))) {
- char * q = strchr(f,'=');
-
- if (q) {
- char * x = q;
-
- while (x > f && ' ' == *(x-1))
- x--;
- *x = '\0';
-
- q++;
-
- while (' ' == *q)
- q++;
- }
-
- for (i = 0; selected_mailer->list[i].field; i++)
- if ( 0 == strcmp(f,selected_mailer->list[i].field))
- break;
- if (!selected_mailer->list[i].field) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnknowMailerOption,
- "Unknown mailer option %s"),
- f);
- ok = 0;
- continue;
- }
-
- if (q) {
- char * val = dequote_opt(q,strlen(q));
-
- if (!selected_mailer->m_set_option(selected_mailer,
- &(selected_mailer->list[i]),
- val))
- ok = 0;
- free(val);
- } else {
- if (!selected_mailer->m_set_option(selected_mailer,
- &(selected_mailer->list[i]),
- NULL))
- ok = 0;
- }
- }
-
- if (selected_mailer->mailer_path &&
- (!*(selected_mailer -> mailer_path) ||
- !(*(selected_mailer -> mailer_path))[0] ||
- 0 == strcmp(*(selected_mailer -> mailer_path),"none"))) {
-
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailerPath,
- "Mailer path for %s not specified"),
- selected_mailer->mailer_type);
- ok = 0;
- }
-
- free(temp);
- } else {
- /* static pointer to buffer accross invocations */
- static char * return_buffer = NULL;
- int i;
-
- if (!check_mailer())
- selected_mailer = &(MAILERS[0]);
-
- return_buffer = strmcpy(return_buffer,selected_mailer->mailer_type);
-
- for (i = 0; selected_mailer->list[i].field; i++) {
- char * value = NULL;
-
- if (selected_mailer->
- list[i].value_func(selected_mailer,
- & (selected_mailer->list[i]),
- &value,0)) {
-
- return_buffer = strmcat(return_buffer,"; ");
-
- if (value) {
- char *Q = elm_message(FRM("%s=%Q"),
- selected_mailer->list[i].field,
- value);
- return_buffer = strmcat(return_buffer,Q);
- free(Q);
- } else
- return_buffer = strmcat(return_buffer,
- selected_mailer->list[i].field);
- }
- }
- *value = return_buffer;
- }
- return ok;
- }
-
- void init_default_mailer()
- {
- char * p;
- char * type;
-
- /* INIT default mailer if not given on configuration file */
-
- if (check_mailer())
- return;
-
- p = strrchr(DEFAULT_MAILER_PATH,'/');


- if (p)
- p++;
- else {

- DPRINT(Debug,1,(&Debug,
- "On mailer path %s have not / character!!",
- DEFAULT_MAILER_PATH));
- p = DEFAULT_MAILER_PATH;
- }
-
- if (0 == strcmp(p,"sendmail"))
- type = "sendmail";
- else if (0 == strcmp(p,"submit"))
- type = "submitmail";
- else if (0 == strcmp(p,"execmail"))
- type = "execmail";
- else
- type = "unknown";
-
- if (!mailerfunc(&type,1,0,NULL) ||
- !check_mailer()) {
- DPRINT(Debug,1,(&Debug,
- "Calling of mailerfunc for setting of default mailer failed"));
- return;
- }
-
- if (selected_mailer -> mailer_path) {
- *(selected_mailer -> mailer_path) = DEFAULT_MAILER_PATH;
-
- if (!*(selected_mailer -> mailer_path) ||
- !(*(selected_mailer -> mailer_path))[0] ||
- 0 == strcmp(*(selected_mailer -> mailer_path),"none")) {
-
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailerPath1,
- "Give mailer path for mailer = %s on global elm.rc"),
- selected_mailer->mailer_type);
- /* wait that message will be noticed ... */
- #if POLL_METHOD
- wait_for_timeout(2);
- #else
- sleep(2);
- #endif
- }
-
- } else {
- DPRINT(Debug,1,(&Debug,"Mailer type %s do not have mailer path!\n",
- selected_mailer -> mailer_type));
- }
-
- #if defined(DEFAULT_8BITMIME)
- sendmail_supported_bodytype = have_8bit;
- #endif
-
- #if defined(DEFAULT_BINARYMIME)
- sendmail_supported_bodytype = have_binary;
- #endif
-
- #if defined(DEFAULT_DSN)
- sendmail_supports_dsn = 1;
- #endif
-
- #if defined(DEFAULT_DONT_ADD_FROM)
- selected_mailer -> mailer_bits |= MB_DONT_ADD_FROM;
- #else
- selected_mailer -> mailer_bits &= ~MB_DONT_ADD_FROM;
- #endif
-
- #if defined(DEFAULT_USE_DOMAIN)
- selected_mailer -> mailer_bits |= MB_USE_DOMAIN;
- #else
- selected_mailer -> mailer_bits &= ~MB_USE_DOMAIN;
- #endif
-
- }
-
-
- static void delete_mail_info P_((struct mailer_info *S));
-
-
- struct mailer_info *get_mailer_info() {
- struct mailer_info * ret;
-
- if (!check_mailer()) {
- DPRINT(Debug,7,(&Debug,"No mailer available\n"));
- return NULL;
- }
-
-
- ret = safe_malloc (sizeof (*ret));
-
- /* bzero is defined on hdrs/defs.h */
- bzero((void *)ret, sizeof (*ret));
-
- ret->magic = MAILER_INFO_magic;
- ret->mailer_type = selected_mailer;
-
- ret->delete_pending = 0;
- ret->p.ptr = NULL;
- ret->first = NULL;
- ret->first_e = NULL;
-
- DPRINT(Debug,7,(&Debug,
- "Initialising info for %s mailer, info=%p\n",
- ret->mailer_type->mailer_type,ret));
-
- if (! ret->mailer_type->mi_init_hook(ret->mailer_type,ret)) {
- /* FAILURE */
- ret->delete_pending = 1;
-
- delete_mail_info(ret);
- return NULL;


- }
-
- return ret;
- }
-

- static void delete_mail_info(S)
- struct mailer_info *S;
- {
-
- if (S->magic != MAILER_INFO_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"delete_mail_info",
- "Bad magic number (mailer info)",0);
-
- if (S->first)
- panic("MAILER PANIC",__FILE__,__LINE__,"delete_mail_info",
- "mailer send state list not empty",
- 0);
-
- if (S->first_e)
- panic("MAILER PANIC",__FILE__,__LINE__,"delete_mail_info",
- "mailer env from list not empty",
- 0);
-
- if (!valid_mailer(S->mailer_type))
- panic("MAILER PANIC",__FILE__,__LINE__,"delete_mail_info",
- "Bad mailer type",
- 0);
-
- DPRINT(Debug,7,(&Debug,
- "Deleting info for %s mailer, info=%p\n",
- S->mailer_type->mailer_type,S));
-
- S->mailer_type->mi_close_hook(S->mailer_type,S);
-
- if (S->p.ptr) {
- DPRINT(Debug,1,(&Debug,
- "delete_mail_info: WARNING: Private data (S->p.ptr) not free'ed\n"));
- }
-
-
- /* bzero is defined on hdrs/defs.h */
- bzero((void *)S, sizeof (*S));
-
- free(S);
- }
-
- static int can_delete_mailer_info P_((struct mailer_info **S));
- static int can_delete_mailer_info(S)
- struct mailer_info **S;
- {
- if ((*S)->first)
- return 0;
- if ((*S)->first_e)
- return 0;
- delete_mail_info(*S);


-
- return 1;
- }
-

- void free_mailer_info(S)
- struct mailer_info **S;
- {
- if (*S) {
- if ((*S)->magic != MAILER_INFO_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"free_mail_info",
- "Bad magic number (mailer info)",0);
-
- (*S)->delete_pending = 1;
- if (! can_delete_mailer_info(S)) {
- DPRINT(Debug,7,(&Debug,
- "delaying deleting of mail info -> delete_pending, info=%s\n",
- *S));
- }
- *S = NULL;
- }
- }
-
- int query_mailer_info(I,query)
- struct mailer_info *I;
- enum MI_query query;
- {
- int ret;
-
- if (I->magic != MAILER_INFO_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"query_mailer_info",
- "Bad magic number (mailer info)",0);
-
- if (!valid_mailer(I->mailer_type))
- panic("MAILER PANIC",__FILE__,__LINE__,"query_mailer_info",
- "Bad mailer type",
- 0);
-
- ret = I->mailer_type->mi_query_hook(I->mailer_type,I,query);


-
- return ret;
- }
-
-

- /* -1 if connection lost
- 0 if OK
- 1 if mailer reinitialized and query_mailer_info()
- need to be called again
- */
- int mailer_restarted(I)
- struct mailer_info *I;
- {
- int ret;
-
- if (I->magic != MAILER_INFO_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_restarted",
- "Bad magic number (mailer info)",0);
-
- if (!valid_mailer(I->mailer_type))
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_restarted",
- "Bad mailer type",
- 0);
-
- ret = I->mailer_type->mi_restart_hook(I->mailer_type,I);


-
- return ret;
- }
-

- static int default_mailer_init(M,C,I)
- struct mailer_config *M;
- struct mail_send_state *C;
- struct mailer_info *I;
- {
- FILE * F;
-
- if (C->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"default_mailer_init",
- "Bad magic number (mail send state)",0);
-
- C->fname = elm_message(FRM("%selm.snd-%d"),
- temp_dir, getpid ());
-
- if (!C->fname) {
- DPRINT(Debug,1,(&Debug,
- "couldn't make temp file nam! (mail)\n"));
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotMakeTemp,
- "Sorry - couldn't make temp file name."));


- return 0;
- }
-

- F = safeopen_rdwr(C->fname);
-
- if (!F) {


- int err = errno;

- DPRINT(Debug,1, (&Debug,
- "Attempt to open file %s for writing failed! (write_header_info)\n",
- C->fname));
- DPRINT(Debug,1, (&Debug, "** %s **\n\n", error_description(err)));
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorTryingToWrite,
- "Error %s encountered trying to write to %s."),
- error_description(err), C->fname);


-
- return 0;
- }
-

- out_state_clear(& (C->OUT), STATE_out_file);
- set_out_state_file(F,& (C->OUT));
-
- return 1; /* OK */
- }
-
-
- static void default_mailer_close(M,C)
- struct mailer_config *M;
- struct mail_send_state *C;
- {
- /* close assigned FD FD */
-
- if (C->OUT.magic) {
- FILE *F = out_state_FILE(& (C->OUT));
-
- if (F) {
- out_state_destroy(& (C->OUT));
- fclose(F);


- }
- }
- }
-
-

-
- void free_mail_send_state(S)
- struct mail_send_state **S;
- {
- struct mail_send_state *X = *S;
-
- if (X) {
- int i;
-
- if (X->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"free_mail_send_state",
- "Bad magic number (mail send state)",0);
-
- if (!valid_mailer(X->mailer_type))
- panic("MAILER PANIC",__FILE__,__LINE__,"free_mail_send_state",
- "Bad mailer type",
- 0);
-
- X->mailer_type->m_close_hook(X->mailer_type,X);
-
- for (i = 0; i < X->addr_count; i++) {
- if (X->addrs[i]) {
- free(X->addrs[i]);
- X->addrs[i] = NULL;
- }
- }
- if (X->addrs) {
- free(X->addrs);
- X->addrs = NULL;
- X->addr_count = 0;
- }
-
- if (X->fname) {
- unlink(X->fname);
- free(X->fname);
- X->fname = NULL;
- }
-
- if (X->mail_from) {
- free(X->mail_from);
- X->mail_from = NULL;
- }
-
- /* destroy if assigned */
- if (X->OUT.magic) {
- DPRINT(Debug,1,(&Debug,
- "free_mail_send_state: out state is probably leaking\n"));
-
- out_state_destroy(& (X->OUT));
- }
-
- if (X->head) {
- struct mail_send_state * prev = NULL, *walk;
-
- for (walk = X->head->first; walk; walk = walk -> next) {
-
- if (walk == X)
- break;
-
- prev = walk;
- }
- if (walk != X)
- panic("MAILER PANIC",__FILE__,__LINE__,"free_mail_send_state",
- "State not in list of mailer_info",0);
- if (!prev)
- X->head->first = X->next;
- else
- prev->next = X->next;
-
- if (X->head->delete_pending && can_delete_mailer_info(& (X->head))) {
- DPRINT(Debug,7,(&Debug,
- "delete_pending -> deleting mail info"));
- }
- X->head = NULL;
- X->next = NULL;
- }
-
- /* bzero is defined on hdrs/defs.h */
- bzero((void *)X, sizeof (*X));
- free(X);
- X = NULL;
- }
-
- *S = X;
- }
-
- S_(end_handler no_end_handler)
- static void no_end_handler(fd,title,rs,ret,exit_stat)
- union any_fd fd;
- char * title;
- struct run_state *rs;
- int ret;
- int exit_stat;
- {
- /* Nothing */
- }
-
-
- /* Return NULL if no editor (and no value either) */
- struct mailer_env_from * mailer_get_env_from(I)
- struct mailer_info *I;
- {
- struct mailer_env_from * ret = NULL;
- int flags = 0;
-
- if (I->magic != MAILER_INFO_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from",
- "Bad magic number (mailer info)",0);
-
- if (!valid_mailer(I->mailer_type))
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from",
- "Bad mailer type", 0);
-
-
- if (0 != (I->mailer_type->mailer_bits & MB_ALLOW_SET_SENDER))
- flags |= MAILER_ef_can_set;
-
- if (0 != (I->mailer_type->mailer_bits & MB_REQ_DEFAULT_SENDER))
- flags |= MAILER_ef_need_default;
-
- if (0 == flags)
- return NULL;
-
- ret = safe_malloc (sizeof (*ret));
-
- /* bzero is defined on hdrs/defs.h */
- bzero((void *)ret, sizeof (*ret));
-
- ret->magic = MAILER_ef_magic;
- ret->mail_from = NULL;
- ret->flags = flags;
-
- ret->head = I;
- ret->next = I->first_e;
- I->first_e = ret;
-
- if (MAILER_ef_need_default | ret->flags)
- I->mailer_type->mi_def_env_from(I->mailer_type,
- I,ret);
-

-
-
- return ret;
- }
-

- void mailer_free_env_from(X)
- struct mailer_env_from **X;
- {
- struct mailer_env_from * E = *X;
-
- if (E) {
- if (MAILER_ef_magic != E->magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_free_env_from",
- "Bad magic number (env from)",0);
-
- if (E->mail_from) {
- free(E->mail_from);
- E->mail_from = NULL;
- }
-
-
- if (E->head) {
- struct mailer_env_from * prev = NULL, *walk;
-
- for (walk = E->head->first_e; walk; walk = walk -> next) {
-
- if (walk == E)
- break;
-
- prev = walk;
- }
- if (walk != E)
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_free_env_from",
- "Env from not in list of mailer_info",0);
- if (!prev)
- E->head->first_e = E->next;
- else
- prev->next = E->next;
-
- if (E->head->delete_pending && can_delete_mailer_info(& (E->head))) {
- DPRINT(Debug,7,(&Debug,
- "delete_pending -> deleting mail info"));
- }
- E->head = NULL;
- E->next = NULL;
- }
-
- E->magic = 0; /* Set bad value */
-
- free(E);
- E = NULL;
- }
- *X = E;
- }
-
- /* return temporary pointer value -- do not free
- return NULL if currently no value set (use implicit default)
- */
- CONST char * mailer_env_from_value(X,can_edit)
- struct mailer_env_from *X;
- int *can_edit;
- {
- if (MAILER_ef_magic != X->magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_free_env_from",
- "Bad magic number (env from)",0);
-
- if (can_edit)
- *can_edit = 0 != (X->flags & MAILER_ef_can_set);
-
- return X->mail_from;
- }
-
- int env_from_changed(X)
- struct mailer_env_from *X;
- {
- if (MAILER_ef_magic != X->magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"env_from_changed",
- "Bad magic number (env from)",0);
-
- return 0 != (X->flags & MAILER_ef_changed);
- }
-
- void mailer_env_from_change(X,value)
- struct mailer_env_from *X;
- CONST char * value;
- {
- if (MAILER_ef_magic != X->magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from_change",
- "Bad magic number (env from)",0);
-
- if (MAILER_INFO_magic != X->head->magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from_change",
- "Bad magic number (mailer info)",0);
-
- if (!valid_mailer(X->head->mailer_type))
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from_change",
- "Bad mailer type",0);
-
- if (0 == (X->flags & MAILER_ef_can_set)) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmChangingEnvSenderNotAllowed,
- "Changing of envelope sender for mailer %s not allowed: %s"),
- X->head->mailer_type->mailer_type, value);
- return;
- }
-
- if (0 != (MB_USE_DOMAIN & X->head->mailer_type->mailer_bits) &&
- 0 != strcmp(value,"<>") &&
- NULL == strchr(value,'@')) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEnvSenderDomainRequired,
- "Mailer %s requires domain part on envelope sender: %s"),
- X->head->mailer_type->mailer_type, value);
- return;
-
- }
-
- X->head->mailer_type->mi_set_env_from(X->head->mailer_type,
- X->head,X,value);
- X->flags |= MAILER_ef_changed;
- }
-
- struct mail_send_state * mailer_init(addr_args,dsn,verbose,info,env_from)
- char **addr_args;
- int dsn;
- int verbose;
- struct mailer_info *info;
- struct mailer_env_from *env_from;
- {
- struct mail_send_state *ret;
- int i;
- int count;
-
- ret = safe_malloc (sizeof (*ret));
-
- /* bzero is defined on hdrs/defs.h */
- bzero((void *)ret, sizeof (*ret));
-
- ret->magic = MAILER_magic;
-
- if (info) {
-
- if (info->magic != MAILER_INFO_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_init",
- "Bad magic number (mailer info)",0);
-
- ret->mailer_type = info->mailer_type;
-
- ret->head = info;
- ret->next = info->first;
- info->first = ret;
-
- } else {
- ret->mailer_type = selected_mailer;
- ret->head = NULL;
- ret->next = NULL;
- }
- for (count = 0; addr_args[count]; count++);
-
- ret->addrs = safe_malloc(sizeof (* (ret->addrs)) * (count+1));
-
- for (i = 0; i < count; i++)
- ret->addrs[i] = safe_strdup(addr_args[i]);
- ret->addrs[count] = NULL;
- ret->addr_count = count;
-
- ret->dsn = dsn;
- ret->verbose = verbose;
- ret->fname = NULL;
- ret->mail_from = NULL;
-
- if (env_from) {
- if (MAILER_ef_magic != env_from->magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_init",
- "Bad magic number (env from)",0);
-
- if (env_from->mail_from)
- ret->mail_from = safe_strdup(env_from->mail_from);
- }
-
- ret->OUT.magic = 0; /* Nothing set */
- ret->orig_func = no_end_handler;
-
- DPRINT(Debug,5,(&Debug,
- "Initialising sending via %s mailer, %d recipients\n",
- ret->mailer_type->mailer_type,
- ret->addr_count));
-
- if (!valid_mailer(ret->mailer_type))
- panic("MAILER PANIC",__FILE__,__LINE__,"mailer_init",
- "Bad mailer type",
- 0);
-
- if (!ret->mailer_type->m_init_hook(ret->mailer_type,
- ret,info)) {
- free_mail_send_state(&ret);


- }
-
- return ret;
- }
-

- CONST char *get_mailer_path(X)
- struct mail_send_state *X;
- {
- if (X->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"get_mailer_path",
- "Bad magic number (mail send state)",0);
-
- if (X->mailer_type->mailer_path &&
- *(X->mailer_type->mailer_path) &&
- (*(X->mailer_type->mailer_path))[0])
- return *(X->mailer_type->mailer_path);
-
- return X->mailer_type->mailer_type;
- }
-
-
- out_state_t *get_mail_outfd(X)
- struct mail_send_state *X;
- {
- if (X->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"get_mail_outfd",
- "Bad magic number (mail send state)",0);
-
- return &(X->OUT);
- }
-
- S_(end_handler call_end_handler)
- static void call_end_handler(fd,title,rs,ret,exit_stat)
- union any_fd fd;
- char * title;
- struct run_state *rs;
- int ret;
- int exit_stat;
- {
- if (fd.mail_fd->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"call_end_handler",
- "Bad magic number (mail send state)",0);
-
- DPRINT(Debug,7,(&Debug,
- "Finished sending mail via %s mailer, ret=%d exit_stat=%d\n",
- fd.mail_fd->mailer_type->mailer_type,
- ret,exit_stat));
-
- fd.mail_fd->orig_func(fd,title,rs,ret,exit_stat);
- free_mail_send_state(&(fd.mail_fd));
- }
-
- static int backend_tail P_((struct mailer_config *M,
- struct mail_send_state **C,
- char * title,
- sending_message_func *sm,
- const char **argv));
-
- static int backend_tail(M,C,title,sm,argv)
- struct mailer_config *M;
- struct mail_send_state **C;
- char * title;
- sending_message_func *sm;
- CONST char **argv;
- {
- struct run_state RS;
-
- int options = SY_ENV_SHELL;
- int ret;
- union any_fd FD;
-
- if ((*C)->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"backend_tail",
- "Bad magic number (mail send state)",0);
-
- FD.mail_fd = *C;
-
- if (!(*C)->verbose)
- options |= SY_NOTTY;
-
- out_state_fseek (&((*C)->OUT), 0);
- #ifdef _POSIX_VERSION
- /* Synzronize underlying file descriptor */
- fflush(out_state_FILE(&((*C)->OUT)));;
- #else
- seek(fileno(out_state_FILE(&((*C)->OUT))),0,0);
- #endif
-
- ret=start_run(&RS, options, argv, fileno(out_state_FILE(&((*C)->OUT))),-1);
-
- if (ret) {
- int backgrounded = 0;
- int exit_code;
-
- ret = run_already_done(&RS,&exit_code);
- if (0 == ret) {
- sm(0);
-
- #ifdef BACKGROUD_PROCESSES /* We assume POSIX in here */
- if (background_wait_time) {
- int tmp;
- DPRINT(Debug,4, (&Debug,
- "Sleeping ( %d seconds ) for completion!\n",
- background_wait_time));
- #if POLL_METHOD
- tmp = wait_for_timeout(background_wait_time);
- if (!tmp) {
- DPRINT(Debug,4,(&Debug,
- " -- sleeping interrupted\n"));
- }
- #else
- tmp = sleep(background_wait_time);
- /* POSIX sleep returns time in left on
- * interrupt -- when sendmail terminates
- * we will get interrupt (SIGCHLD signal)
- */
- if (tmp > 0) {
- DPRINT(Debug,4,(&Debug,
- " -- sleeping interrupted, %d seconds left!\n",
- tmp));
- } else if (tmp < 0) {
- DPRINT(Debug,4,(&Debug,
- " -- sleeping failed?\n"));
- }
- #endif
- ret = run_already_done(&RS,&exit_code);
- if (0 == ret)
- ret = maybe_background(&RS,&exit_code,
- FD,title,call_end_handler);
- if (0 == ret) {
- sm(1);
- backgrounded = 1;
- *C = NULL; /* call_end_handler may free
- mail_send_state

- */
- }
- } else

- #endif
- ret = wait_end(&RS,&exit_code);
- }
- if (!backgrounded) {
- call_end_handler(FD,title,&RS,ret,exit_code);
- *C = NULL; /* call_end_handler free'ed mail_send_state
- */
- }
- } else {
- if (RS.save_errno)
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
- "Failed: %.30s: %.40s"),
- argv[0],error_description(RS.save_errno));
- else
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStart,
- "Can't start %.30s"),
- argv[0]);
- free_mail_send_state(C);


- }
-
- return ret;
- }
-
-

- int unknown_mailer_backend(M,C,encoding_top,title,sm)
- struct mailer_config *M;
- struct mail_send_state **C;
- int encoding_top;
- char * title;
- sending_message_func *sm;
- {
- char *mailerflags[20];
- CONST char **argv;
- int mf_idx=0;
- int r;
-
- if ((*C)->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"unknown_mailer_backend",
- "Bad magic number (mail send state)",0);
-
-
- mailerflags[mf_idx++] = unknown_mailer_path;
- mailerflags[mf_idx] = NULL;
-
- argv = join_argv(mailerflags,(*C)->addrs);
-
- r = backend_tail(M,C,title,sm,argv);
-
- free(argv);
-
- return r;
- }
-
- int sendmail_mailer_backend(M,C,encoding_top,title,sm)
- struct mailer_config *M;
- struct mail_send_state **C;
- int encoding_top;
- char * title;
- sending_message_func *sm;
- {
- char t[80];
- int r;
-
- char *mailerflags[22];
- CONST char **argv;
- int mf_idx=0;
-
- if ((*C)->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"sendmail_mailer_backend",
- "Bad magic number (mail send state)",0);
-
- mailerflags[mf_idx++] = sendmail_mailer_path;
-
- mailerflags[mf_idx++] = "-oi";
- mailerflags[mf_idx++] = "-oem";
-
- if ((*C)->mail_from && 0 != ( M -> mailer_bits & MB_ALLOW_SET_SENDER)) {
- mailerflags[mf_idx++] = "-f";
- mailerflags[mf_idx++] = (*C)->mail_from;
- }
-
- if ((*C)->verbose)
- mailerflags[mf_idx++] = "-v";
- if (metoo)
- mailerflags[mf_idx++] = "-om";
-
- if (sendmail_supported_bodytype >= have_8bit) {
- if (encoding_top == ENCODING_8BIT)
- mailerflags[mf_idx++] = "-B8BITMIME";
- }
-
- if (sendmail_supported_bodytype >= have_binary) {
- if (encoding_top == ENCODING_BINARY)
- /* With -BBINARYMIME lines must terminate with \r\n
- * Unix's \n is _NOT_ sufficient - K E H */
- mailerflags[mf_idx++] = "-BBINARYMIME";
- }
-
- if (sendmail_supports_dsn) {
- if ((*C)->dsn & DSN_FULL) {
- mailerflags[mf_idx++] = "-R";
- mailerflags[mf_idx++] = "full";
- } else if ((*C)->dsn & DSN_HDRS) {
- mailerflags[mf_idx++] = "-R";
- mailerflags[mf_idx++] = "hdrs";
- }
-
- if ((*C)->dsn & DSN_NEVER) {
- mailerflags[mf_idx++] = "-N";
- mailerflags[mf_idx++] = "never";
- } else if ((*C)->dsn & (DSN_SUCCESS|DSN_FAILURE|DSN_DELAY)) {
- t[0] = '\0';
- if ((*C)->dsn & DSN_SUCCESS)
- strfcat(t,"success", sizeof t);
- if ((*C)->dsn & DSN_FAILURE) {
- if (t[0]) strfcat(t,",", sizeof t);
- strfcat(t,"failure", sizeof t);
- }
- if ((*C)->dsn & DSN_DELAY) {
- if (t[0]) strfcat(t,",", sizeof t);
- strfcat(t,"delay", sizeof t);
- }
- mailerflags[mf_idx++] = "-N";
- mailerflags[mf_idx++] = t;
- }
- }
-
- mailerflags[mf_idx++] = "--";
-
- mailerflags[mf_idx] = NULL;
-
- argv = join_argv(mailerflags,(*C)->addrs);
-
- r = backend_tail(M,C,title,sm,argv);
-
- free(argv);
-
- return r;
- }
-
- /* Return
- -1 if caller should result with default data (return 1)
- -2 if caller should just test passwd
- 0 if failure
- 1 is succees
- */
- static int sendmail_mailer_info_verify_addr(M,I,text,result)
- struct mailer_config *M;
- struct mailer_info *I;
- CONST char *text;
- struct addr_item *result;
- {
-
- CONST char *mailerflags[5];
- int mf_idx=0;
- struct run_state RS;
- int ret,exit_code;
-
- if (I->magic != MAILER_INFO_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,
- "sendmail_mailer_info_verify_addr",
- "Bad magic number (mailer info)",0);
-
- if (!sendmail_verify_address) {
- DPRINT(Debug,4,(&Debug,
- "Don't call %s for verify -- falling back to default addr verify\n",
- sendmail_mailer_path));
- return -2; /* caller does job */
- }
-
- mailerflags[mf_idx++] = sendmail_mailer_path;
-
- mailerflags[mf_idx++] = "-bv";
-
- /* Do not treat -xyc as option */
- mailerflags[mf_idx++] = "--";
-
- mailerflags[mf_idx++] = text;
-
- mailerflags[mf_idx] = NULL;
-
- ret = start_run(&RS,SY_NOTTY|SY_ENV_SHELL,mailerflags,-1,-1);
-
- if (!ret) {
- DPRINT(Debug,4,(&Debug,
- "Can't run %s for address verify -- falling back to default addr verify\n",
- sendmail_mailer_path));
- return -2; /* caller does job */
- }
- ret = wait_end(&RS,&exit_code);
- if (ret < 0) {
- DPRINT(Debug,4,(&Debug,
- "%s died on signal %d -- falling back to default addr verify\n",
- sendmail_mailer_path,-ret));
- return -2; /* caller does job */
- }
- if (0 == ret) {
- DPRINT(Debug,4,(&Debug,
- "%s lost? -- falling back to default addr verify\n",
- sendmail_mailer_path));
- return -2; /* caller does job */
- }
-
- /* -1 is success, but caller should fill fullname */
- return exit_code == 0 ? -1 : 0;
- }
-
- static void sendmail_mailer_info_set_ef(M,I,X,value)
- struct mailer_config *M;
- struct mailer_info *I;
- struct mailer_env_from *X;
- CONST char *value;
- {
- CONST char *mailerflags[5];
- int mf_idx=0;
- struct run_state RS;
- int ret,exit_code;
-
- if (0 == strcmp(value,"<>")) {
- /* Null envelope sender is only valid as sender (not as recipient)
- so do not verify it
- */
- X->mail_from = strmcpy(X->mail_from,value);
- return;
- }
-
- if (I->magic != MAILER_INFO_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,
- "sendmail_mailer_info_set_ef",
- "Bad magic number (mailer info)",0);
-
- mailerflags[mf_idx++] = sendmail_mailer_path;
-
- mailerflags[mf_idx++] = "-bv";
-
- /* Do not treat -xyc as option */
- mailerflags[mf_idx++] = "--";
-
- mailerflags[mf_idx++] = value;
-
- mailerflags[mf_idx] = NULL;
-
- ret = start_run(&RS,SY_NOTTY|SY_ENV_SHELL,mailerflags,-1,-1);
-
- if (!ret) {
- DPRINT(Debug,4,(&Debug,
- "Can't run %s for address verify -- sendmail_mailer_info_set_ef failed\n",
- sendmail_mailer_path));
- goto failure;
- }
-
- ret = wait_end(&RS,&exit_code);
- if (ret < 0) {
- DPRINT(Debug,4,(&Debug,
- "%s died on signal %d -- sendmail_mailer_info_set_ef failed\n",
- sendmail_mailer_path,-ret));
- goto failure;
- }
-
- if (0 == ret) {
- DPRINT(Debug,4,(&Debug,
- "%s lost? -- sendmail_mailer_info_set_ef failed\n",
- sendmail_mailer_path));
- goto failure;
- }
-
-
- if (exit_code == 0) {
- X->mail_from = strmcpy(X->mail_from,value);
- DPRINT(Debug,8,(&Debug,
- " .. envelope sender=%s\n",
- X->mail_from));
-
- } else {
- DPRINT(Debug,4,(&Debug,
- "... exit code %d -- envelope sender address %s bad?\n",
- exit_code,value));
-
- failure:
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmChangingSendmEnvSenderFailed,
- "Changing of envelope sender for sendmail failed: %s"),
- value);
- }
- }
-
- static int submitmail_mailer_init(M,C,I)
- struct mailer_config *M;
- struct mail_send_state *C;
- struct mailer_info *I;


- {
- int i;
-

- if (C->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"submitmail_mailer_init",
- "Bad magic number (mail send state)",0);
-
- if (!default_mailer_init(M,C,I))
- return 0;
-
- /* WARNING: Untested --
- code copied from do_mmdf_addresses() on src/reply.c
- */
- for (i = 0; i < C -> addr_count; i++) {
- state_puts(C -> addrs[i],&(C->OUT)); state_putc('\n',&(C->OUT));
- }
- state_putc('\n',&(C->OUT));
-
- return 1; /* OK */
- }
-
-
- int submitmail_mailer_backend(M,C,encoding_top,title,sm)
- struct mailer_config *M;
- struct mail_send_state **C;
- int encoding_top;
- char * title;
- sending_message_func *sm;
- {
- int r;
- CONST char *mailerflags[20];
- int mf_idx=0;
-
- if ((*C)->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"submitmail_mailer_backend",
- "Bad magic number (mail send state)",0);
-
- /* WARNING: Untested --
- code copied from mail_backend() on src/mailmsg2.c
- */
-
- mailerflags[mf_idx++] = submitmail_mailer_path;
-
- mailerflags[mf_idx++] = "-mlrnv";
-
- mailerflags[mf_idx] = NULL;
-
- r = backend_tail(M,C,title,sm,mailerflags);
-
- return r;
- }
-
- int execmail_mailer_backend(M,C,encoding_top,title,sm)
- struct mailer_config *M;
- struct mail_send_state **C;
- int encoding_top;
- char * title;
- sending_message_func *sm;
- {
- int r;
- char *mailerflags[20];
- CONST char **argv;
- int mf_idx=0;
-
- if ((*C)->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"execmail_mailer_backend",
- "Bad magic number (mail send state)",0);
-
- /* WARNING: Untested --
- code copied from mail_backend() on src/mailmsg2.c
- */
-
- mailerflags[mf_idx++] = execmail_mailer_path;
-
- if ((*C)->verbose)
- mailerflags[mf_idx++] = "-d";
- if (metoo)
- mailerflags[mf_idx++] = "-m";
-
- argv = join_argv(mailerflags,(*C)->addrs);
-
- r = backend_tail(M,C,title,sm,argv);
-
- free(argv);
-
- return r;
- }
-
-
- int mail_backend2(mail_fd,func,encoding_top,title,
- sm)
- struct mail_send_state **mail_fd;
- end_handler *func;
- int encoding_top;
- char * title;
- sending_message_func *sm;
- {
- int r;
-
- if ((*mail_fd)->magic != MAILER_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"mail_backend2",
- "Bad magic number (mail send state)",0);
-
- DPRINT(Debug,7,(&Debug,
- "Sending mail via %s mailer, %d recipients\n",
- (*mail_fd)->mailer_type->mailer_type,
- (*mail_fd)->addr_count));
-
- (*mail_fd)->orig_func = func;
-
- if (!valid_mailer((*mail_fd)->mailer_type))
- panic("MAILER PANIC",__FILE__,__LINE__,"mail_backend2",
- "Bad mailer type",
- 0);
-
- r = (*mail_fd)->mailer_type->m_backend_hook((*mail_fd)->mailer_type,
- mail_fd,encoding_top,
- title,sm);
- return r;
- }
-
- # ifdef PWDINSYS
- # include <sys/pwd.h>
- # else
- # include <pwd.h>
- # endif
-
- /* Should return 1 if verify succees and fields of result to be filled
- -- caller should free fields of result
- Returns 0 on failure
- */
- int verify_mailer_addr(I,text,result)
- struct mailer_info *I;
- CONST char *text;
- struct addr_item *result;


- {
- int ret = 0;
-

- if (I->magic != MAILER_INFO_magic)
- panic("MAILER PANIC",__FILE__,__LINE__,"verify_mailer_addr",
- "Bad magic number (mailer info)",0);
-
- /* bzero is defined on hdrs/defs.h */
- bzero((void *)result, sizeof (*result));
- result -> addr = NULL;
- result -> fullname = NULL;
- result -> comment = NULL;
-
-
- if (!valid_mailer(I->mailer_type))
- panic("MAILER PANIC",__FILE__,__LINE__,"verify_mailer_addr",
- "Bad mailer type",
- 0);
-
- /* Returns
- -1 if caller should result with default data (return 1)
- -2 if caller should just test passwd
- 0 if failure
- 1 is succees
- */
- ret = I->mailer_type->mi_verify_addr(I->mailer_type,I,text,result);
-
- DPRINT(Debug,7,(&Debug,"Address %s verify result %d%s\n",
- text,ret,
- ret < 0 ? " (use default processing)" : ""));
- if (result->addr) {
- DPRINT(Debug,7,(&Debug,
- " ... resulting address %s\n",
- result->addr));
- }
-
- if (ret < 0) {
- struct passwd * P = getpwnam(text);
-
- if (P && ! result -> fullname ) {
- char * N = get_fullname1(P,text);
-
- /* FIXME: Posisble wrong charset */
- if (N) {
- result -> fullname = new_string2(system_charset,s2us(N));
- }
-
- ret = 1;
- } else {
- ret = ret == -1 ? 1 : 0;
- }
- }
-
- if (ret && !result->addr) {
-
- DPRINT(Debug,7,(&Debug,
- " ... filling resulting address\n",
- text));
-
-
- result->addr = safe_strdup(text);
-
-
- if (I->mailer_type->mi_query_hook(I->mailer_type,I,
- MI_USE_DOMAIN)) {
- result->addr = strmcat(result->addr,"@");
- result->addr = strmcat(result->addr,hostfullname);
- DPRINT(Debug,7,(&Debug,
- " ... %s => %s\n",
- text,result->addr));
- }


- }
-
- return ret;
- }
-

- char * kludge_addr(char **addr) {
- char * ptr = *addr;
- int l = strlen(ptr);
- char *res;
-
- ptr = safe_realloc(ptr,l + 1 + 2 + l + 1);
-
- res = ptr + l + 1;
-
- res[0] = '<';
- strfcpy(res+1,ptr,l+1);
- res[l+1] = '>';
- res[l+2] = '\0';
-
- *addr = ptr;
- return res;
- }
-
- char **argv_from_headers (headers)
- struct mailing_headers * headers;
- {
- int count =
- headers->to.addrs_len +
- headers->cc.addrs_len + headers->bcc.addrs_len;
- char **res;
- int idx = 0,i;
- struct addr_item *p;
-
- DPRINT(Debug,6,
- (&Debug, "argv_from_headers, count=%d\n",count));
-
- res = safe_malloc((count + 1) * sizeof (char *));
-
- dump_expanded_address(6,"argv_from_headers -- enter (to)",headers->to);
-
- for (p = headers->to.addrs;
- p < headers->to.addrs + headers->to.addrs_len;
- p++) {
- if (p->addr[0] == '-' || p->addr[0] == '@' ||
- p->addr[0] == '\0')
- /* Modify p->addr so that there is space
- * alloced also for <addr> form
- */
- res[idx++] = kludge_addr(&p->addr);
- else
- res[idx++] = p->addr;
- }
-
- dump_expanded_address(6,"argv_from_headers -- enter (cc)",headers->cc);
-
- for (p = headers->cc.addrs;
- p < headers->cc.addrs + headers->cc.addrs_len;
- p++) {
- if (p->addr[0] == '-' || p->addr[0] == '@' ||
- p->addr[0] == '\0')
- /* Modify p->addrs so that there is space
- * alloced also for <addr> form
- */
- res[idx++] = kludge_addr(&p->addr);
- else
- res[idx++] = p->addr;
- }
-
- dump_expanded_address(6,"argv_from_headers -- enter (bcc)",headers->bcc);
-
- for (p = headers->bcc.addrs;
- p < headers->bcc.addrs + headers->bcc.addrs_len;
- p++) {
- if (p->addr[0] == '-' || p->addr[0] == '@' ||
- p->addr[0] == '\0')
- /* Modify p->addrs so that there is space
- * alloced also for <addr> form
- */
- res[idx++] = kludge_addr(&p->addr);
- else
- res[idx++] = p->addr;
- }
-
- res[idx] = NULL;
-
- DPRINT(Debug,6,
- (&Debug, " idx=%d\n",idx));
- for (i = 0; i < idx; i++)
- DPRINT(Debug,6,
- (&Debug, " [%d]=%s\n",i,res[i]));
-
- dump_expanded_address(7,"argv_from_headers -- leave (to)",headers->to);
- dump_expanded_address(7,"argv_from_headers -- leave (cc)",headers->cc);
- dump_expanded_address(7,"argv_from_headers -- leave (bcc)",headers->bcc);
-
- return res;
- }


-
-
- /*
- * Local Variables:
- * mode:c
- * c-basic-offset:4
- * buffer-file-coding-system: iso-8859-1
- * End:
- */
--- 0 ----

Index: elm2.4.ME+.122-cvs/lib/mailer/def_mailer.h


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/lib/mailer/def_mailer.h 2005-05-21 20:58:32.000000000 +0300
***************
*** 0 ****
--- 1,25 ----
+ /* $Id: def_mailer.h,v 1.2 2005/05/21 17:58:32 hurtta Exp $ */
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ * or Kari Hurtta <e...@elmme-mailer.org>
+ *****************************************************************************/
+

+ #include "defs.h"
+ #include "elmlib.h"
+ #include "mailerlib.h"
+
+ #ifdef USE_DLOPEN
+ extern SHAREDLIB use_shared_mailer;
+ #endif


+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/lib/mailer/init.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/lib/mailer/init.c 2005-07-05 20:53:37.000000000 +0300
***************
*** 0 ****
--- 1,59 ----
+ static char rcsid[] = "@(#)$Id: init.c,v 1.3 2005/07/05 17:53:37 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ * or Kari Hurtta <e...@elmme-mailer.org>
+ *****************************************************************************/
+

+ #include "def_mailer.h"
+ #include "hdr_imp.h"
+ #include "save_opts.h"
+ #include "rc_imp.h"
+ #include "shared_imp.h"
+
+ static ZZZ_SAVE_TYPE mailer_info_data[] = {
+ {"mailer", ZZZ_DT_FUNC_(FL_SYS,mailerfunc), 0 },
+ {"use-mailer-library", ZZZ_DT_SHARED(&use_shared_mailer), 0 },
+ };
+
+ static int COUNT=(sizeof(mailer_info_data)/sizeof(ZZZ_SAVE_TYPE));
+ static save_info_recs *mailer_info = (save_info_recs *) mailer_info_data;


+
+
+ #if ANSI_C

+ static env_from_change_hook real_env_from_change;
+ #endif
+ static int real_env_from_change P_((struct mailer_env_from *X,


+ const char * value));
+

+ static int real_env_from_change(X,value)
+ struct mailer_env_from *X;
+ const char * value;
+ {
+
+ mailer_env_from_change(X,value);
+ return 1;
+
+ }
+
+
+ void init_mailerlib P_((void))
+ {
+
+ init_default_mailer();
+ set_env_from_change_hook(real_env_from_change);
+ register_delayed(mailer_info,COUNT);
+
+ register_list(&use_shared_mailer);


+ }
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/lib/mailer/mailer.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/lib/mailer/mailer.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 0 ****
--- 1,2271 ----
+ static char rcsid[] = "@(#)$Id: mailer.c,v 1.4 2005/06/17 21:02:55 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
+ *****************************************************************************/
+
+ #include "def_mailer.h"
+ #include "s_elm.h"
+ #include "mailer_imp.h"
+ #ifdef USE_DLOPEN
+ #include "shared_imp.h"


+ #endif
+
+
+

+ DEBUG_VAR(Debug,__FILE__,"mailer");
+
+ #include <errno.h>
+ #ifndef ANSI_C


+ extern int errno;
+ #endif

+
+ static unsigned char *s2us P_((char *str));
+ static unsigned char *s2us(str)
+ char *str;
+ {
+ return (unsigned char *)str;
+ }
+
+ int MO_default_value (M,L,value,set)
+ struct mailer_config *M;
+ struct mailer_option_list *L;
+ char **value;
+ int set;
+ {
+ if (set) {
+ if (!value) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailerOptionValue,
+ "Mailer option %s requires value"),
+ L->field);


+ return 0;
+ }
+

+ if (L->malloced) {
+ free(*(L->value));
+ *(L->value) = NULL;
+ }
+
+ *(L->value) = safe_strdup(*value);
+ L->malloced = 1;
+ }
+ else {
+ *value = *(L->value);


+ }
+ return 1;
+ }

+
+
+ #if ANSI_C

+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ S_(mailer_set_option default_set_option)
+ static int default_set_option(M,X,value)
+ struct mailer_config *M;
+ struct mailer_option_list *X;
+ char *value;
+ {
+ int r ;
+
+ r = X->value_func(M,X,&value,1);
+ return r;
+ }
+
+ S_(mailer_init_hook default_mailer_init)
+ static int default_mailer_init P_((struct mailer_config *M,
+ struct mail_send_state *C,
+ struct mailer_info *I));
+
+ S_(mailer_init_hook submitmail_mailer_init)
+ static int submitmail_mailer_init P_((struct mailer_config *M,
+ struct mail_send_state *C,
+ struct mailer_info *I));
+
+
+
+ S_(mailer_close_hook default_mailer_close)
+ static void default_mailer_close P_((struct mailer_config *M,
+ struct mail_send_state *C));
+
+
+ S_(mailer_info_init_hook default_mailer_info_init)
+ static int default_mailer_info_init P_((struct mailer_config *M,
+ struct mailer_info *I));
+
+
+ S_(mailer_info_close_hook null_mailer_info_close)
+ static void null_mailer_info_close(M,I)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ {
+ /* Nothing */
+ }
+
+ /* Return
+ -1 if caller should result with default data (return 1)
+ -2 if caller should just test passwd
+ 0 if failure
+ 1 is succees
+ */
+ S_(mailer_info_verify_addr default_mailer_info_verify_addr)
+ static int default_mailer_info_verify_addr(M,I,text,result)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ CONST char *text;
+ struct addr_item *result;
+ {
+ return -2; /* caller does job */
+ }
+
+ S_(mailer_info_gen_def_ef default_mailer_info_gen_def_ef)
+ static void default_mailer_info_gen_def_ef(M,I,X)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ struct mailer_env_from *X;
+ {
+ /* Nothing */
+ }
+
+ S_(mailer_info_set_ef default_mailer_info_set_ef)
+ static void default_mailer_info_set_ef(M,I,X,value)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ struct mailer_env_from *X;
+ CONST char *value;
+ {
+ /* Sets env from without checking */
+ X->mail_from = strmcpy(X->mail_from,value);


+ }
+
+ /* Return

+ 1 == mailer restarted, reconnect succeed -- reask info
+ 0 == mailer not disconnected
+ -1 == mailer disconnected, reconnect failed
+ */
+ S_(mailer_info_restart_hook default_mailer_info_rs_hook)
+ static int default_mailer_info_rs_hook P_((struct mailer_config *M,
+ struct mailer_info *I));
+ static int default_mailer_info_rs_hook(M,I)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ {
+ return 0; /* Assume not restarted */
+ }
+
+ S_(mailer_info_set_ef sendmail_mailer_info_set_ef)
+ static void sendmail_mailer_info_set_ef P_((struct mailer_config *M,
+ struct mailer_info *I,
+ struct mailer_env_from *X,


+ const char *value));
+

+ S_(mailer_info_verify_addr sendmail_mailer_info_verify_addr)
+ static int sendmail_mailer_info_verify_addr P_((struct mailer_config *M,
+ struct mailer_info *I,
+ const char *text,
+ struct addr_item *result));
+
+ S_(mailer_info_query_hook default_mailer_info_query)
+ static int default_mailer_info_query P_((struct mailer_config *M,
+ struct mailer_info *I,


+ enum MI_query query));
+

+ S_(mailer_info_query_hook sendmail_mailer_info_query)
+ static int sendmail_mailer_info_query P_((struct mailer_config *M,
+ struct mailer_info *I,


+ enum MI_query query));
+

+ S_(mailer_backend_hook unknown_mailer_backend)
+ static int unknown_mailer_backend P_((struct mailer_config *M,
+ struct mail_send_state **C,


+ int encoding_top,
+ char * title,
+ sending_message_func *sm));
+

+ S_(mailer_backend_hook sendmail_mailer_backend)
+ static int sendmail_mailer_backend P_((struct mailer_config *M,
+ struct mail_send_state **C,


+ int encoding_top,
+ char * title,
+ sending_message_func *sm));
+

+ S_(mailer_backend_hook submitmail_mailer_backend)
+ static int submitmail_mailer_backend P_((struct mailer_config *M,
+ struct mail_send_state **C,


+ int encoding_top,
+ char * title,
+ sending_message_func *sm));
+

+ S_(mailer_backend_hook execmail_mailer_backend)
+ static int execmail_mailer_backend P_((struct mailer_config *M,
+ struct mail_send_state **C,


+ int encoding_top,
+ char * title,
+ sending_message_func *sm));
+

+ static struct mailer_config * selected_mailer = NULL;
+
+ static char * unknown_mailer_path = DEFAULT_MAILER_PATH;
+ static char * sendmail_mailer_path = SENDMAIL_MAILER_PATH;
+ static char * submitmail_mailer_path = SUBMITMAIL_MAILER_PATH;
+ static char * execmail_mailer_path = EXECMAIL_MAILER_PATH;
+
+ static enum bodytypes {
+ have_7bit = 0, have_8bit = 1, have_binary = 2
+ } sendmail_supported_bodytype = have_7bit;
+ static int sendmail_supports_dsn = 0;
+ static int sendmail_verify_address = 0;
+
+ static int MO_sendmail_bodytype P_((struct mailer_config * M,
+ struct mailer_option_list * L,
+ char **value,int set));
+ static int MO_sendmail_bodytype (M,L,value,set)
+ struct mailer_config *M;
+ struct mailer_option_list *L;
+ char **value;
+ int set;
+ {
+ static char *sendmail_bodytypes[] = { "7bit", "8bit", "binary" };
+ static int value_set = 0;
+
+ if (set) {
+ int i;
+
+ if (!*value) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailerOptionValue,
+ "Mailer option %s requires value"),
+ L->field);
+ return 0;
+ }


+
+ for (i = 0;

+ i < sizeof sendmail_bodytypes / sizeof (sendmail_bodytypes[0]);
+ i++) {
+ if (0 == strcmp(sendmail_bodytypes[i],*value)) {
+ sendmail_supported_bodytype = (enum bodytypes)i;
+ value_set = 1;


+ return 1;
+ }
+ }

+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSendmailBadBodytype,
+ "Bad supported-bodytype %s for sendmail"),
+ *value);
+ return 0;
+ }
+ else {
+ if (sendmail_supported_bodytype < have_7bit ||
+ sendmail_supported_bodytype > have_binary)
+ panic("MAILER PANIC",__FILE__,__LINE__,
+ "MO_sendmail_bodytype",
+ "Bad supported-bodytype",0);
+
+ *value = sendmail_bodytypes[sendmail_supported_bodytype];
+ if (sendmail_supported_bodytype > have_7bit)
+ return 1; /* Give value always */
+ }
+ return value_set; /* Return calue only if set at lweast once */
+ }
+
+ static int MO_sendmail_dsn P_((struct mailer_config * M,
+ struct mailer_option_list * L,
+ char **value,int set));
+ static int MO_sendmail_dsn (M,L,value,set)
+ struct mailer_config *M;
+ struct mailer_option_list *L;
+ char **value;
+ int set;
+ {
+ static char *no_yes[] = { "no", "yes" };
+ static int value_set = 0;
+
+ if (set) {
+ if (!*value)
+ sendmail_supports_dsn = 1;
+ else if (0 == strcmp(*value,no_yes[0]))
+ sendmail_supports_dsn = 0;
+ else if (0 == strcmp(*value,no_yes[1]))
+ sendmail_supports_dsn = 1;
+ else {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSendmailBadDsn,
+ "Bad supports-dsn=%s for sendmail"),
+ *value);
+ return 0;
+ }
+ value_set = 1;
+ } else {
+ /* Do not return option if sendmail_supports_dsn is not supported */
+
+ if (sendmail_supports_dsn) {
+ *value = no_yes[1];
+ return 1;
+ }
+ *value = no_yes[0]; /* Only show if supports-dsn=no or
+ supports-dsn=yes is given at least once
+ */
+ }
+ return value_set;
+ }
+
+ static int MO_sendmail_verify P_((struct mailer_config * M,
+ struct mailer_option_list * L,
+ char **value,int set));
+ static int MO_sendmail_verify (M,L,value,set)
+ struct mailer_config *M;
+ struct mailer_option_list *L;
+ char **value;
+ int set;
+ {
+ static char *no_yes[] = { "no", "yes" };
+ static int value_set = 0;
+
+ if (set) {
+ if (!*value)
+ sendmail_verify_address = 1;
+ else if (0 == strcmp(*value,no_yes[0]))
+ sendmail_verify_address = 0;
+ else if (0 == strcmp(*value,no_yes[1]))
+ sendmail_verify_address = 1;
+ else {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSendmailBadVerify,
+ "Bad verify=%s for sendmail"),
+ *value);
+ return 0;
+ }
+ value_set = 1;
+ } else {
+ if (sendmail_verify_address) {
+ *value = no_yes[1];
+ return 1;
+ }
+ *value = no_yes[0]; /* Only show if verify=no or
+ verify=yes is given at least once
+ */
+ }
+ return value_set;
+ }
+
+
+ static int MO_dont_add_from P_((struct mailer_config * M,
+ struct mailer_option_list * L,
+ char **value,int set));
+ static int MO_dont_add_from (M,L,value,set)
+ struct mailer_config *M;
+ struct mailer_option_list *L;
+ char **value;
+ int set;
+ {
+ static char *yes_dont[] = { "yes", "dont" };
+ static int value_set = 0;
+
+ if (set) {
+ if (!*value)
+ M -> mailer_bits &= ~MB_DONT_ADD_FROM;
+ else if (0 == strcmp(*value,yes_dont[0]))
+ M -> mailer_bits &= ~MB_DONT_ADD_FROM;
+ else if (0 == strcmp(*value,yes_dont[1]))
+ M -> mailer_bits |= MB_DONT_ADD_FROM;
+ else {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadAddFrom,
+ "Bad add-from=%s for %s"),
+ *value, M->mailer_type);
+ return 0;
+ }
+ value_set = 1;
+ } else {
+
+ *value = yes_dont[ (M -> mailer_bits & MB_DONT_ADD_FROM) ?
+ 1 : 0 ];
+
+ if (M -> mailer_bits & MB_DONT_ADD_FROM)
+ return 1;
+
+ /* Do not show add-from=yes if it is not set explicity */
+ }
+
+ return value_set;
+ }
+
+ static int MO_use_domain P_((struct mailer_config * M,
+ struct mailer_option_list * L,
+ char **value,int set));
+ static int MO_use_domain (M,L,value,set)
+ struct mailer_config *M;
+ struct mailer_option_list *L;
+ char **value;
+ int set;
+ {
+ static char *no_yes[] = { "no", "yes" };
+ static int value_set = 0;
+
+ if (set) {
+ if (!*value)
+ M -> mailer_bits |= MB_USE_DOMAIN;
+ else if (0 == strcmp(*value,no_yes[0]))
+ M -> mailer_bits &= ~MB_USE_DOMAIN;
+ else if (0 == strcmp(*value,no_yes[1]))
+ M -> mailer_bits |= MB_USE_DOMAIN;
+ else {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadUseDomain,
+ "Bad use-domain=%s for %s"),
+ *value, M->mailer_type);
+ return 0;
+ }
+ value_set = 1;
+ } else {
+
+ *value = no_yes[ (M -> mailer_bits & MB_USE_DOMAIN) ?
+ 1 : 0 ];
+
+ if (!(M -> mailer_bits & MB_USE_DOMAIN))
+ return 1;
+
+ /* Do not show use-domain=yes if it is not set explicity */
+ }
+
+ return value_set;
+ }
+
+ int MO_allow_set_sender (M,L,value,set)
+ struct mailer_config *M;
+ struct mailer_option_list *L;
+ char **value;
+ int set;
+ {
+ static char *no_yes[] = { "no", "yes" };
+ static int value_set = 0;
+
+ if (set) {
+ if (!*value)
+ M -> mailer_bits |= MB_ALLOW_SET_SENDER;
+ else if (0 == strcmp(*value,no_yes[0]))
+ M -> mailer_bits &= ~MB_ALLOW_SET_SENDER;
+ else if (0 == strcmp(*value,no_yes[1]))
+ M -> mailer_bits |= MB_ALLOW_SET_SENDER;
+ else {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadAllowSetSender,
+ "Bad allow-set-sender=%s for %s"),
+ *value, M->mailer_type);
+ return 0;
+ }
+ value_set = 1;
+ } else {
+
+ *value = no_yes[ (M -> mailer_bits & MB_ALLOW_SET_SENDER) ?
+ 1 : 0 ];
+
+ if (M -> mailer_bits & MB_ALLOW_SET_SENDER)
+ return 1;
+
+ /* Do not show use-domain=no if it is not set explicity */
+ }
+
+ return value_set;
+ }
+
+
+ static struct mailer_option_list UNKNOWN_options[] = {
+ { "path", &unknown_mailer_path, MO_default_value, 0 },
+ { "add-from", NULL, MO_dont_add_from, 0 },
+ { "use-domain", NULL, MO_use_domain, 0 },
+ { NULL, NULL, MO_default_value, 0 }
+ };
+
+ static struct mailer_option_list SENDMAIL_options[] = {
+ { "path", &sendmail_mailer_path, MO_default_value, 0 },
+ { "add-from", NULL, MO_dont_add_from, 0 },
+ { "use-domain", NULL, MO_use_domain, 0 },
+ { "supported-bodytype", NULL, MO_sendmail_bodytype, 0 },
+ { "supports-dsn", NULL, MO_sendmail_dsn, 0 },
+ { "verify", NULL, MO_sendmail_verify, 0 },
+ { "allow-set-sender",NULL, MO_allow_set_sender, 0 },
+ { NULL, NULL, MO_default_value, 0 }
+ };
+
+ static struct mailer_option_list SUBMITMAIL_options[] = {
+ { "path", &submitmail_mailer_path, MO_default_value, 0 },
+ { "add-from", NULL, MO_dont_add_from, 0 },
+ { "use-domain", NULL, MO_use_domain, 0 },
+ { NULL, NULL, MO_default_value, 0 }
+ };
+ static struct mailer_option_list EXECMAIL_options[] = {
+ { "path", &execmail_mailer_path, MO_default_value, 0 },
+ { "add-from", NULL, MO_dont_add_from, 0 },
+ { "use-domain", NULL, MO_use_domain, 0 },
+ { NULL, NULL, MO_default_value, 0 }
+ };
+
+
+ static struct mailer_config MAILERS[] = {
+ { "unknown", &(UNKNOWN_options[0]), default_set_option,
+ default_mailer_init, default_mailer_close, unknown_mailer_backend,
+ &unknown_mailer_path,
+ default_mailer_info_init, null_mailer_info_close,
+ default_mailer_info_query, default_mailer_info_verify_addr,
+ default_mailer_info_gen_def_ef, default_mailer_info_set_ef,
+ default_mailer_info_rs_hook,
+
+ MB_USE_DOMAIN
+ },
+ { "sendmail", &(SENDMAIL_options[0]), default_set_option,
+ default_mailer_init, default_mailer_close, sendmail_mailer_backend,
+ &sendmail_mailer_path,
+ default_mailer_info_init, null_mailer_info_close,
+ sendmail_mailer_info_query, sendmail_mailer_info_verify_addr,
+ default_mailer_info_gen_def_ef, sendmail_mailer_info_set_ef,
+ default_mailer_info_rs_hook,
+
+ MB_DONT_ADD_FROM
+ },
+ { "submitmail", &(SUBMITMAIL_options[0]), default_set_option,
+ submitmail_mailer_init, default_mailer_close, submitmail_mailer_backend,
+ &submitmail_mailer_path,
+ default_mailer_info_init, null_mailer_info_close,
+ default_mailer_info_query, default_mailer_info_verify_addr,
+ default_mailer_info_gen_def_ef, default_mailer_info_set_ef,
+ default_mailer_info_rs_hook,
+
+ MB_USE_DOMAIN
+ },
+ { "execmail", &(EXECMAIL_options[0]), default_set_option,
+ default_mailer_init, default_mailer_close, execmail_mailer_backend,
+ &execmail_mailer_path,
+ default_mailer_info_init, null_mailer_info_close,
+ default_mailer_info_query, default_mailer_info_verify_addr,
+ default_mailer_info_gen_def_ef, default_mailer_info_set_ef,
+ default_mailer_info_rs_hook,
+
+ MB_DONT_ADD_FROM
+ }
+ };
+
+ static int valid_mailer P_((struct mailer_config *T));
+ static int valid_mailer(T)
+ struct mailer_config *T;


+ {
+ int x;
+

+ for (x = 0; x < (sizeof MAILERS) / sizeof (MAILERS[0]); x++)
+ if (T == &MAILERS[x])
+ return 1;
+ #ifdef USE_DLOPEN
+ for (x = 0; x < shared_MCF_type_count; x++)
+ if (T == shared_MCF_types[x].T)
+ return 1;
+ #endif


+ return 0;
+ }
+

+ static int default_mailer_info_init(M,I)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ {
+
+ if (M->mailer_path) {
+ /* CHECK that mailer is executable ... */
+
+ if (! *(M->mailer_path) ||
+ !(*(M->mailer_path))[0] ||
+ 0 == strcmp(*(M->mailer_path),"none")
+ ) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailerPath,
+ "Mailer path for %s not specified"),
+ M->mailer_type);


+ return 0;
+ }
+

+ if (0 != access(*(M->mailer_path),EXECUTE_ACCESS)) {


+ int err = errno;

+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNotExecutable,
+ "%s not executable: %s"),
+ *(M->mailer_path),error_description(err));


+ return 0;
+ }
+ }
+

+ return 1;
+ }
+
+
+ static int default_mailer_info_query(M,I,query)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ enum MI_query query;
+ {
+ /* Answer to universal queries */
+
+ switch(query) {
+ case MI_DONT_ADD_FROM:
+ return (M -> mailer_bits & MB_DONT_ADD_FROM) ? 1 : 0;
+ case MI_USE_DOMAIN:
+ return (M -> mailer_bits & MB_USE_DOMAIN) ? 1 : 0;
+ }
+
+ return 0; /* Not available */
+ }
+
+ static int sendmail_mailer_info_query(M,I,query)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ enum MI_query query;
+ {
+ switch(query) {
+
+ case MI_HAVE_8BITMIME:
+ return sendmail_supported_bodytype >= have_8bit;
+
+ case MI_HAVE_BINARYMIME:
+ return sendmail_supported_bodytype >= have_binary;
+
+ case MI_HAVE_DSN:
+ return sendmail_supports_dsn;
+ }
+
+ return default_mailer_info_query(M,I,query);
+ }
+
+
+ static char * delay_parsing_info = NULL;
+
+ static int check_mailer P_((void));
+ static int check_mailer()
+ {
+ if (selected_mailer)
+ return 1;
+ if (delay_parsing_info) {
+ int r = mailerfunc(&delay_parsing_info,-1,0,NULL);
+ free(delay_parsing_info); delay_parsing_info = NULL;
+ return r;


+ }
+ return 0;
+ }
+

+ #ifdef ANSI_C
+ option_func mailerfunc;
+ #endif
+ int mailerfunc(value,enter,lineno,filename)
+ char **value;
+ int enter;
+ int lineno;
+ char *filename;
+ {
+ int ok = 1;
+
+ if (enter) {
+ int i;
+ char * WALK;
+
+ char * temp = safe_strdup(*value);
+
+ char * f = mime_parse_content_opts(temp, &WALK);
+
+ if (!f) {
+ free(temp);
+ return 0;
+ }
+
+ for (i = 0; i < (sizeof MAILERS) / sizeof (MAILERS[0]); i++)
+ if (0 == strcmp(f,MAILERS[i].mailer_type))
+ break;
+ if (i >= (sizeof MAILERS) / sizeof (MAILERS[0])) {
+
+ #ifdef USE_DLOPEN
+ if (enter > 0) {
+ DPRINT(Debug,8,(&Debug,"mailerfunc: Parsing delayed\n"));
+
+ selected_mailer = NULL;
+ delay_parsing_info = strmcpy(delay_parsing_info,*value);
+ free(temp);


+ return 1;
+ }
+

+ selected_mailer = loc_mailer_type(f);
+ if (selected_mailer)
+ goto found_shared;
+ #endif
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnknowMailerType,
+ "Unknown mailer type %s"),
+ f);
+
+ free(temp);
+
+ mark_flocal_changed(mailerfunc);


+
+ return 0;
+ }

+ selected_mailer = &(MAILERS[i]);
+
+ found_shared:
+
+ DPRINT(Debug,8,(&Debug,
+ "mailerfunc: Selected %s\n",
+ selected_mailer->mailer_type));
+
+ while (NULL != (f = mime_parse_content_opts(NULL, &WALK))) {
+ char * q = strchr(f,'=');
+
+ if (q) {
+ char * x = q;
+
+ while (x > f && ' ' == *(x-1))
+ x--;
+ *x = '\0';
+
+ q++;
+
+ while (' ' == *q)
+ q++;
+ }
+
+ for (i = 0; selected_mailer->list[i].field; i++)
+ if ( 0 == strcmp(f,selected_mailer->list[i].field))
+ break;
+ if (!selected_mailer->list[i].field) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnknowMailerOption,
+ "Unknown mailer option %s"),
+ f);
+ ok = 0;
+ continue;
+ }
+
+ if (q) {
+ char * val = dequote_opt(q,strlen(q));
+
+ if (!selected_mailer->m_set_option(selected_mailer,
+ &(selected_mailer->list[i]),
+ val))
+ ok = 0;
+ free(val);
+ } else {
+ if (!selected_mailer->m_set_option(selected_mailer,
+ &(selected_mailer->list[i]),
+ NULL))
+ ok = 0;
+ }
+ }
+
+ if (selected_mailer->mailer_path &&
+ (!*(selected_mailer -> mailer_path) ||
+ !(*(selected_mailer -> mailer_path))[0] ||
+ 0 == strcmp(*(selected_mailer -> mailer_path),"none"))) {
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailerPath,
+ "Mailer path for %s not specified"),
+ selected_mailer->mailer_type);
+ ok = 0;
+ }
+
+ free(temp);
+ } else {
+ if (delay_parsing_info) {
+ *value = delay_parsing_info;
+ DPRINT(Debug,8,(&Debug,
+ "mailerfunc: Returning delayed parsing info\n"));
+ } else {
+ /* static pointer to buffer accross invocations */
+ static char * return_buffer = NULL;
+ int i;
+
+ if (!check_mailer())
+ selected_mailer = &(MAILERS[0]);
+
+ return_buffer = strmcpy(return_buffer,selected_mailer->mailer_type);
+
+ for (i = 0; selected_mailer->list[i].field; i++) {
+ char * value = NULL;
+
+ if (selected_mailer->
+ list[i].value_func(selected_mailer,
+ & (selected_mailer->list[i]),
+ &value,0)) {
+
+ return_buffer = strmcat(return_buffer,"; ");
+
+ if (value) {
+ char *Q = elm_message(FRM("%s=%Q"),
+ selected_mailer->list[i].field,
+ value);
+ return_buffer = strmcat(return_buffer,Q);
+ free(Q);
+ } else
+ return_buffer = strmcat(return_buffer,
+ selected_mailer->list[i].field);
+ }
+ }
+ *value = return_buffer;
+ }
+ }
+ return ok;
+ }
+
+ void init_default_mailer()
+ {
+ char * p;
+ char * type;
+
+ /* INIT default mailer if not given on configuration file */
+
+ if (check_mailer())
+ return;
+
+ p = strrchr(DEFAULT_MAILER_PATH,'/');
+ if (p)
+ p++;
+ else {
+ DPRINT(Debug,1,(&Debug,
+ "On mailer path %s have not / character!!",
+ DEFAULT_MAILER_PATH));
+ p = DEFAULT_MAILER_PATH;
+ }
+
+ if (0 == strcmp(p,"sendmail"))
+ type = "sendmail";
+ else if (0 == strcmp(p,"submit"))
+ type = "submitmail";
+ else if (0 == strcmp(p,"execmail"))
+ type = "execmail";
+ else
+ type = "unknown";
+
+ if (!mailerfunc(&type,1,0,NULL) ||
+ !check_mailer()) {
+ DPRINT(Debug,1,(&Debug,
+ "Calling of mailerfunc for setting of default mailer failed"));
+ return;
+ }
+
+ if (selected_mailer -> mailer_path) {
+ *(selected_mailer -> mailer_path) = DEFAULT_MAILER_PATH;
+
+ if (!*(selected_mailer -> mailer_path) ||
+ !(*(selected_mailer -> mailer_path))[0] ||
+ 0 == strcmp(*(selected_mailer -> mailer_path),"none")) {
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailerPath1,
+ "Give mailer path for mailer = %s on global elm.rc"),
+ selected_mailer->mailer_type);
+ /* wait that message will be noticed ... */
+ #if POLL_METHOD
+ wait_for_timeout(2);
+ #else
+ sleep(2);
+ #endif
+ }
+
+ } else {
+ DPRINT(Debug,1,(&Debug,"Mailer type %s do not have mailer path!\n",
+ selected_mailer -> mailer_type));
+ }
+
+ #if defined(DEFAULT_8BITMIME)
+ sendmail_supported_bodytype = have_8bit;
+ #endif
+
+ #if defined(DEFAULT_BINARYMIME)
+ sendmail_supported_bodytype = have_binary;
+ #endif
+
+ #if defined(DEFAULT_DSN)
+ sendmail_supports_dsn = 1;
+ #endif
+
+ #if defined(DEFAULT_DONT_ADD_FROM)
+ selected_mailer -> mailer_bits |= MB_DONT_ADD_FROM;
+ #else
+ selected_mailer -> mailer_bits &= ~MB_DONT_ADD_FROM;
+ #endif
+
+ #if defined(DEFAULT_USE_DOMAIN)
+ selected_mailer -> mailer_bits |= MB_USE_DOMAIN;
+ #else
+ selected_mailer -> mailer_bits &= ~MB_USE_DOMAIN;
+ #endif
+
+ }
+
+
+ static void delete_mail_info P_((struct mailer_info *S));
+
+
+ struct mailer_info *get_mailer_info() {
+ struct mailer_info * ret;
+
+ if (!check_mailer()) {
+ DPRINT(Debug,7,(&Debug,"No mailer available\n"));


+ return NULL;
+ }
+

+ DPRINT(Debug,8,(&Debug,
+ "get_mailer_info: Current mailer %s\n",
+ selected_mailer->mailer_type));
+
+
+
+ ret = safe_malloc (sizeof (*ret));
+
+ /* bzero is defined on hdrs/defs.h */
+ bzero((void *)ret, sizeof (*ret));
+
+ ret->magic = MAILER_INFO_magic;
+ ret->mailer_type = selected_mailer;
+
+ ret->delete_pending = 0;
+ ret->p.ptr = NULL;
+ ret->first = NULL;
+ ret->first_e = NULL;
+
+ DPRINT(Debug,7,(&Debug,
+ "Initialising info for %s mailer, info=%p\n",
+ ret->mailer_type->mailer_type,ret));
+
+ if (! ret->mailer_type->mi_init_hook(ret->mailer_type,ret)) {
+ /* FAILURE */
+ ret->delete_pending = 1;
+
+ delete_mail_info(ret);
+ return NULL;


+ }
+
+ return ret;
+ }
+

+ static void delete_mail_info(S)
+ struct mailer_info *S;
+ {
+
+ if (S->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"delete_mail_info",
+ "Bad magic number (mailer info)",0);
+
+ if (S->first)
+ panic("MAILER PANIC",__FILE__,__LINE__,"delete_mail_info",
+ "mailer send state list not empty",
+ 0);
+
+ if (S->first_e)
+ panic("MAILER PANIC",__FILE__,__LINE__,"delete_mail_info",
+ "mailer env from list not empty",
+ 0);
+
+ if (!valid_mailer(S->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"delete_mail_info",
+ "Bad mailer type",
+ 0);
+
+ DPRINT(Debug,7,(&Debug,
+ "Deleting info for %s mailer, info=%p\n",
+ S->mailer_type->mailer_type,S));
+
+ S->mailer_type->mi_close_hook(S->mailer_type,S);
+
+ if (S->p.ptr) {
+ DPRINT(Debug,1,(&Debug,
+ "delete_mail_info: WARNING: Private data (S->p.ptr) not free'ed\n"));
+ }
+
+
+ /* bzero is defined on hdrs/defs.h */
+ bzero((void *)S, sizeof (*S));
+
+ free(S);
+ }
+
+ static int can_delete_mailer_info P_((struct mailer_info **S));
+ static int can_delete_mailer_info(S)
+ struct mailer_info **S;
+ {
+ if ((*S)->first)
+ return 0;
+ if ((*S)->first_e)
+ return 0;
+ delete_mail_info(*S);


+
+ return 1;
+ }
+

+ void free_mailer_info(S)
+ struct mailer_info **S;
+ {
+ if (*S) {
+ if ((*S)->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"free_mail_info",
+ "Bad magic number (mailer info)",0);
+
+ (*S)->delete_pending = 1;
+ if (! can_delete_mailer_info(S)) {
+ DPRINT(Debug,7,(&Debug,
+ "delaying deleting of mail info -> delete_pending, info=%s\n",
+ *S));
+ }
+ *S = NULL;
+ }
+ }
+
+ int query_mailer_info(I,query)
+ struct mailer_info *I;
+ enum MI_query query;
+ {
+ int ret;
+
+ if (I->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"query_mailer_info",
+ "Bad magic number (mailer info)",0);
+
+ if (!valid_mailer(I->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"query_mailer_info",
+ "Bad mailer type",
+ 0);
+
+ ret = I->mailer_type->mi_query_hook(I->mailer_type,I,query);


+
+ return ret;
+ }
+
+

+ /* -1 if connection lost
+ 0 if OK
+ 1 if mailer reinitialized and query_mailer_info()
+ need to be called again
+ */

+ int mailer_restarted(I)
+ struct mailer_info *I;
+ {
+ int ret;
+
+ if (I->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_restarted",
+ "Bad magic number (mailer info)",0);
+
+ if (!valid_mailer(I->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_restarted",
+ "Bad mailer type",
+ 0);
+
+ ret = I->mailer_type->mi_restart_hook(I->mailer_type,I);


+
+ return ret;
+ }
+

+ static int default_mailer_init(M,C,I)
+ struct mailer_config *M;
+ struct mail_send_state *C;
+ struct mailer_info *I;
+ {
+ FILE * F;
+ char *tmp;
+
+ if (C->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"default_mailer_init",
+ "Bad magic number (mail send state)",0);


+
+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ tmp = "/tmp/";
+
+ C->fname = elm_message(FRM("%selm.snd-%d"),
+ tmp, getpid ());
+
+ if (!C->fname) {
+ DPRINT(Debug,1,(&Debug,
+ "couldn't make temp file nam! (mail)\n"));
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotMakeTemp,
+ "Sorry - couldn't make temp file name."));


+ return 0;
+ }
+

+ F = safeopen_rdwr(C->fname);
+
+ if (!F) {


+ int err = errno;

+ DPRINT(Debug,1, (&Debug,
+ "Attempt to open file %s for writing failed! (write_header_info)\n",
+ C->fname));
+ DPRINT(Debug,1, (&Debug, "** %s **\n\n", error_description(err)));
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorTryingToWrite,
+ "Error %s encountered trying to write to %s."),
+ error_description(err), C->fname);


+
+ return 0;
+ }
+

+ out_state_clear(& (C->OUT), STATE_out_file);
+ set_out_state_file(F,& (C->OUT));
+
+ return 1; /* OK */
+ }
+
+
+ static void default_mailer_close(M,C)
+ struct mailer_config *M;
+ struct mail_send_state *C;
+ {
+ /* close assigned FD FD */
+
+ if (C->OUT.magic) {
+ FILE *F = out_state_FILE(& (C->OUT));
+
+ if (F) {
+ out_state_destroy(& (C->OUT));
+ fclose(F);


+ }
+ }
+ }
+
+
+

+ void free_mail_send_state(S)
+ struct mail_send_state **S;
+ {
+ struct mail_send_state *X = *S;
+
+ if (X) {
+ int i;
+
+ if (X->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"free_mail_send_state",
+ "Bad magic number (mail send state)",0);
+
+ if (!valid_mailer(X->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"free_mail_send_state",
+ "Bad mailer type",
+ 0);
+
+ X->mailer_type->m_close_hook(X->mailer_type,X);
+
+ for (i = 0; i < X->addr_count; i++) {
+ if (X->addrs[i]) {
+ free(X->addrs[i]);
+ X->addrs[i] = NULL;
+ }
+ }
+ if (X->addrs) {
+ free(X->addrs);
+ X->addrs = NULL;
+ X->addr_count = 0;
+ }
+
+ if (X->fname) {
+ unlink(X->fname);
+ free(X->fname);
+ X->fname = NULL;
+ }
+
+ if (X->mail_from) {
+ free(X->mail_from);
+ X->mail_from = NULL;
+ }
+
+ /* destroy if assigned */
+ if (X->OUT.magic) {
+ DPRINT(Debug,1,(&Debug,
+ "free_mail_send_state: out state is probably leaking\n"));
+
+ out_state_destroy(& (X->OUT));
+ }
+
+ if (X->head) {
+ struct mail_send_state * prev = NULL, *walk;
+
+ for (walk = X->head->first; walk; walk = walk -> next) {
+
+ if (walk == X)
+ break;
+
+ prev = walk;
+ }
+ if (walk != X)
+ panic("MAILER PANIC",__FILE__,__LINE__,"free_mail_send_state",
+ "State not in list of mailer_info",0);
+ if (!prev)
+ X->head->first = X->next;
+ else
+ prev->next = X->next;
+
+ if (X->head->delete_pending && can_delete_mailer_info(& (X->head))) {
+ DPRINT(Debug,7,(&Debug,
+ "delete_pending -> deleting mail info"));
+ }
+ X->head = NULL;
+ X->next = NULL;
+ }
+
+ /* bzero is defined on hdrs/defs.h */
+ bzero((void *)X, sizeof (*X));
+ free(X);
+ X = NULL;
+ }
+
+ *S = X;
+ }
+
+ S_(end_handler no_end_handler)
+ static void no_end_handler(fd,title,rs,ret,exit_stat)
+ union any_fd fd;
+ char * title;
+ struct run_state *rs;
+ int ret;
+ int exit_stat;
+ {
+ /* Nothing */
+ }
+
+

+ /* Return NULL if no editor (and no value either) */

+ struct mailer_env_from * mailer_get_env_from(I)
+ struct mailer_info *I;
+ {
+ struct mailer_env_from * ret = NULL;
+ int flags = 0;
+
+ if (I->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from",
+ "Bad magic number (mailer info)",0);
+
+ if (!valid_mailer(I->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from",
+ "Bad mailer type", 0);
+
+
+ if (0 != (I->mailer_type->mailer_bits & MB_ALLOW_SET_SENDER))
+ flags |= MAILER_ef_can_set;
+
+ if (0 != (I->mailer_type->mailer_bits & MB_REQ_DEFAULT_SENDER))
+ flags |= MAILER_ef_need_default;
+
+ if (0 == flags)
+ return NULL;
+
+ ret = safe_malloc (sizeof (*ret));
+
+ /* bzero is defined on hdrs/defs.h */
+ bzero((void *)ret, sizeof (*ret));
+
+ ret->magic = MAILER_ef_magic;
+ ret->mail_from = NULL;
+ ret->flags = flags;
+
+ ret->head = I;
+ ret->next = I->first_e;
+ I->first_e = ret;
+
+ if (MAILER_ef_need_default | ret->flags)
+ I->mailer_type->mi_def_env_from(I->mailer_type,
+ I,ret);
+

+
+
+ return ret;
+ }
+

+ void mailer_free_env_from(X)
+ struct mailer_env_from **X;
+ {
+ struct mailer_env_from * E = *X;
+
+ if (E) {
+ if (MAILER_ef_magic != E->magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_free_env_from",
+ "Bad magic number (env from)",0);
+
+ if (E->mail_from) {
+ free(E->mail_from);
+ E->mail_from = NULL;
+ }
+
+
+ if (E->head) {
+ struct mailer_env_from * prev = NULL, *walk;
+
+ for (walk = E->head->first_e; walk; walk = walk -> next) {
+
+ if (walk == E)
+ break;
+
+ prev = walk;
+ }
+ if (walk != E)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_free_env_from",
+ "Env from not in list of mailer_info",0);
+ if (!prev)
+ E->head->first_e = E->next;
+ else
+ prev->next = E->next;
+
+ if (E->head->delete_pending && can_delete_mailer_info(& (E->head))) {
+ DPRINT(Debug,7,(&Debug,
+ "delete_pending -> deleting mail info"));
+ }
+ E->head = NULL;
+ E->next = NULL;
+ }
+
+ E->magic = 0; /* Set bad value */
+
+ free(E);
+ E = NULL;
+ }
+ *X = E;
+ }


+
+ /* return temporary pointer value -- do not free
+ return NULL if currently no value set (use implicit default)
+ */

+ CONST char * mailer_env_from_value(X,can_edit)
+ struct mailer_env_from *X;
+ int *can_edit;
+ {
+ if (MAILER_ef_magic != X->magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_free_env_from",
+ "Bad magic number (env from)",0);
+
+ if (can_edit)
+ *can_edit = 0 != (X->flags & MAILER_ef_can_set);
+
+ return X->mail_from;
+ }
+
+ int env_from_changed(X)
+ struct mailer_env_from *X;
+ {
+ if (MAILER_ef_magic != X->magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"env_from_changed",
+ "Bad magic number (env from)",0);
+
+ return 0 != (X->flags & MAILER_ef_changed);
+ }
+
+ void mailer_env_from_change(X,value)
+ struct mailer_env_from *X;
+ CONST char * value;
+ {
+ if (MAILER_ef_magic != X->magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from_change",
+ "Bad magic number (env from)",0);
+
+ if (MAILER_INFO_magic != X->head->magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from_change",
+ "Bad magic number (mailer info)",0);
+
+ if (!valid_mailer(X->head->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_env_from_change",
+ "Bad mailer type",0);
+
+ if (0 == (X->flags & MAILER_ef_can_set)) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmChangingEnvSenderNotAllowed,
+ "Changing of envelope sender for mailer %s not allowed: %s"),
+ X->head->mailer_type->mailer_type, value);
+ return;
+ }
+
+ if (0 != (MB_USE_DOMAIN & X->head->mailer_type->mailer_bits) &&
+ 0 != strcmp(value,"<>") &&
+ NULL == strchr(value,'@')) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEnvSenderDomainRequired,
+ "Mailer %s requires domain part on envelope sender: %s"),
+ X->head->mailer_type->mailer_type, value);


+ return;
+
+ }
+

+ X->head->mailer_type->mi_set_env_from(X->head->mailer_type,
+ X->head,X,value);
+ X->flags |= MAILER_ef_changed;
+ }
+
+ struct mail_send_state * mailer_init(addr_args,dsn,verbose,info,env_from)
+ char **addr_args;
+ int dsn;
+ int verbose;
+ struct mailer_info *info;
+ struct mailer_env_from *env_from;
+ {
+ struct mail_send_state *ret;
+ int i;
+ int count;
+
+ ret = safe_malloc (sizeof (*ret));
+
+ /* bzero is defined on hdrs/defs.h */
+ bzero((void *)ret, sizeof (*ret));
+
+ ret->magic = MAILER_magic;
+
+ if (info) {
+
+ if (info->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_init",
+ "Bad magic number (mailer info)",0);
+
+ ret->mailer_type = info->mailer_type;
+
+ ret->head = info;
+ ret->next = info->first;
+ info->first = ret;
+
+ } else {
+ ret->mailer_type = selected_mailer;
+ ret->head = NULL;
+ ret->next = NULL;
+ }
+ for (count = 0; addr_args[count]; count++);
+
+ ret->addrs = safe_malloc(sizeof (* (ret->addrs)) * (count+1));
+
+ for (i = 0; i < count; i++)
+ ret->addrs[i] = safe_strdup(addr_args[i]);
+ ret->addrs[count] = NULL;
+ ret->addr_count = count;
+
+ ret->dsn = dsn;
+ ret->verbose = verbose;
+ ret->fname = NULL;
+ ret->mail_from = NULL;
+
+ if (env_from) {
+ if (MAILER_ef_magic != env_from->magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_init",
+ "Bad magic number (env from)",0);
+
+ if (env_from->mail_from)
+ ret->mail_from = safe_strdup(env_from->mail_from);
+ }
+
+ ret->OUT.magic = 0; /* Nothing set */
+ ret->orig_func = no_end_handler;
+
+ DPRINT(Debug,5,(&Debug,
+ "Initialising sending via %s mailer, %d recipients\n",
+ ret->mailer_type->mailer_type,
+ ret->addr_count));
+
+ if (!valid_mailer(ret->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"mailer_init",
+ "Bad mailer type",
+ 0);
+
+ if (!ret->mailer_type->m_init_hook(ret->mailer_type,
+ ret,info)) {
+ free_mail_send_state(&ret);


+ }
+
+ return ret;
+ }
+

+ CONST char *get_mailer_path(X)
+ struct mail_send_state *X;
+ {
+ if (X->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"get_mailer_path",
+ "Bad magic number (mail send state)",0);
+
+ if (X->mailer_type->mailer_path &&
+ *(X->mailer_type->mailer_path) &&
+ (*(X->mailer_type->mailer_path))[0])
+ return *(X->mailer_type->mailer_path);
+
+ return X->mailer_type->mailer_type;
+ }
+
+
+ out_state_t *get_mail_outfd(X)
+ struct mail_send_state *X;
+ {
+ if (X->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"get_mail_outfd",
+ "Bad magic number (mail send state)",0);
+
+ return &(X->OUT);
+ }
+
+ S_(end_handler call_end_handler)
+ static void call_end_handler(fd,title,rs,ret,exit_stat)
+ union any_fd fd;
+ char * title;
+ struct run_state *rs;
+ int ret;
+ int exit_stat;
+ {
+ if (fd.mail_fd->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"call_end_handler",
+ "Bad magic number (mail send state)",0);
+
+ DPRINT(Debug,7,(&Debug,
+ "Finished sending mail via %s mailer, ret=%d exit_stat=%d\n",
+ fd.mail_fd->mailer_type->mailer_type,
+ ret,exit_stat));
+
+ fd.mail_fd->orig_func(fd,title,rs,ret,exit_stat);
+ free_mail_send_state(&(fd.mail_fd));
+ }
+
+ static int backend_tail P_((struct mailer_config *M,
+ struct mail_send_state **C,
+ char * title,
+ sending_message_func *sm,
+ const char **argv));
+
+ static int backend_tail(M,C,title,sm,argv)
+ struct mailer_config *M;
+ struct mail_send_state **C;
+ char * title;
+ sending_message_func *sm;
+ CONST char **argv;
+ {
+ struct run_state RS;
+
+ int options = SY_ENV_SHELL;
+ int ret;
+ union any_fd FD;
+
+ if ((*C)->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"backend_tail",
+ "Bad magic number (mail send state)",0);
+
+ FD.mail_fd = *C;
+
+ if (!(*C)->verbose)
+ options |= SY_NOTTY;
+
+ out_state_fseek (&((*C)->OUT), 0);
+ #ifdef _POSIX_VERSION
+ /* Synzronize underlying file descriptor */
+ fflush(out_state_FILE(&((*C)->OUT)));;
+ #else
+ seek(fileno(out_state_FILE(&((*C)->OUT))),0,0);
+ #endif
+
+ ret=start_run(&RS, options, argv, fileno(out_state_FILE(&((*C)->OUT))),-1);
+
+ if (ret) {
+ int backgrounded = 0;
+ int exit_code;
+
+ ret = run_already_done(&RS,&exit_code);
+ if (0 == ret) {
+ sm(0);
+
+ #ifdef BACKGROUD_PROCESSES /* We assume POSIX in here */
+ if (background_wait_time) {
+ int tmp;
+ DPRINT(Debug,4, (&Debug,
+ "Sleeping ( %d seconds ) for completion!\n",
+ background_wait_time));
+ #if POLL_METHOD
+ tmp = wait_for_timeout(background_wait_time);
+ if (!tmp) {
+ DPRINT(Debug,4,(&Debug,
+ " -- sleeping interrupted\n"));
+ }
+ #else
+ tmp = sleep(background_wait_time);
+ /* POSIX sleep returns time in left on
+ * interrupt -- when sendmail terminates
+ * we will get interrupt (SIGCHLD signal)
+ */
+ if (tmp > 0) {
+ DPRINT(Debug,4,(&Debug,
+ " -- sleeping interrupted, %d seconds left!\n",
+ tmp));
+ } else if (tmp < 0) {
+ DPRINT(Debug,4,(&Debug,
+ " -- sleeping failed?\n"));
+ }
+ #endif
+ ret = run_already_done(&RS,&exit_code);
+ if (0 == ret)
+ ret = maybe_background(&RS,&exit_code,
+ FD,title,call_end_handler);
+ if (0 == ret) {
+ sm(1);
+ backgrounded = 1;
+ *C = NULL; /* call_end_handler may free
+ mail_send_state
+ */


+ }
+ } else
+ #endif

+ ret = wait_end(&RS,&exit_code);
+ }
+ if (!backgrounded) {
+ call_end_handler(FD,title,&RS,ret,exit_code);
+ *C = NULL; /* call_end_handler free'ed mail_send_state
+ */
+ }
+ } else {
+ if (RS.save_errno)
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
+ "Failed: %.30s: %.40s"),
+ argv[0],error_description(RS.save_errno));
+ else
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStart,
+ "Can't start %.30s"),
+ argv[0]);
+ free_mail_send_state(C);


+ }
+
+ return ret;
+ }
+
+

+ static int unknown_mailer_backend(M,C,encoding_top,title,sm)
+ struct mailer_config *M;
+ struct mail_send_state **C;
+ int encoding_top;
+ char * title;
+ sending_message_func *sm;
+ {
+ char *mailerflags[20];
+ CONST char **argv;
+ int mf_idx=0;
+ int r;
+
+ if ((*C)->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"unknown_mailer_backend",
+ "Bad magic number (mail send state)",0);
+
+
+ mailerflags[mf_idx++] = unknown_mailer_path;
+ mailerflags[mf_idx] = NULL;
+
+ argv = join_argv(mailerflags,(*C)->addrs);
+
+ r = backend_tail(M,C,title,sm,argv);
+
+ free(argv);
+
+ return r;
+ }
+
+ int sendmail_mailer_backend(M,C,encoding_top,title,sm)
+ struct mailer_config *M;
+ struct mail_send_state **C;
+ int encoding_top;
+ char * title;
+ sending_message_func *sm;
+ {
+ char t[80];
+ int r;
+
+ char *mailerflags[22];
+ CONST char **argv;
+ int mf_idx=0;
+
+ if ((*C)->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"sendmail_mailer_backend",
+ "Bad magic number (mail send state)",0);
+
+ mailerflags[mf_idx++] = sendmail_mailer_path;
+
+ mailerflags[mf_idx++] = "-oi";
+ mailerflags[mf_idx++] = "-oem";
+
+ if ((*C)->mail_from && 0 != ( M -> mailer_bits & MB_ALLOW_SET_SENDER)) {
+ mailerflags[mf_idx++] = "-f";
+ mailerflags[mf_idx++] = (*C)->mail_from;
+ }
+
+ if ((*C)->verbose)
+ mailerflags[mf_idx++] = "-v";
+ if (metoo)
+ mailerflags[mf_idx++] = "-om";
+
+ if (sendmail_supported_bodytype >= have_8bit) {
+ if (encoding_top == ENCODING_8BIT)
+ mailerflags[mf_idx++] = "-B8BITMIME";
+ }
+
+ if (sendmail_supported_bodytype >= have_binary) {
+ if (encoding_top == ENCODING_BINARY)
+ /* With -BBINARYMIME lines must terminate with \r\n
+ * Unix's \n is _NOT_ sufficient - K E H */
+ mailerflags[mf_idx++] = "-BBINARYMIME";
+ }
+
+ if (sendmail_supports_dsn) {
+ if ((*C)->dsn & DSN_FULL) {
+ mailerflags[mf_idx++] = "-R";
+ mailerflags[mf_idx++] = "full";
+ } else if ((*C)->dsn & DSN_HDRS) {
+ mailerflags[mf_idx++] = "-R";
+ mailerflags[mf_idx++] = "hdrs";
+ }
+
+ if ((*C)->dsn & DSN_NEVER) {
+ mailerflags[mf_idx++] = "-N";
+ mailerflags[mf_idx++] = "never";
+ } else if ((*C)->dsn & (DSN_SUCCESS|DSN_FAILURE|DSN_DELAY)) {
+ t[0] = '\0';
+ if ((*C)->dsn & DSN_SUCCESS)
+ strfcat(t,"success", sizeof t);
+ if ((*C)->dsn & DSN_FAILURE) {
+ if (t[0]) strfcat(t,",", sizeof t);
+ strfcat(t,"failure", sizeof t);
+ }
+ if ((*C)->dsn & DSN_DELAY) {
+ if (t[0]) strfcat(t,",", sizeof t);
+ strfcat(t,"delay", sizeof t);
+ }
+ mailerflags[mf_idx++] = "-N";
+ mailerflags[mf_idx++] = t;
+ }
+ }
+
+ mailerflags[mf_idx++] = "--";
+
+ mailerflags[mf_idx] = NULL;
+
+ argv = join_argv(mailerflags,(*C)->addrs);
+
+ r = backend_tail(M,C,title,sm,argv);
+
+ free(argv);
+
+ return r;


+ }
+
+ /* Return

+ -1 if caller should result with default data (return 1)
+ -2 if caller should just test passwd
+ 0 if failure
+ 1 is succees
+ */
+ static int sendmail_mailer_info_verify_addr(M,I,text,result)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ CONST char *text;
+ struct addr_item *result;
+ {
+
+ CONST char *mailerflags[5];
+ int mf_idx=0;
+ struct run_state RS;
+ int ret,exit_code;
+
+ if (I->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,
+ "sendmail_mailer_info_verify_addr",
+ "Bad magic number (mailer info)",0);
+
+ if (!sendmail_verify_address) {
+ DPRINT(Debug,4,(&Debug,
+ "Don't call %s for verify -- falling back to default addr verify\n",
+ sendmail_mailer_path));
+ return -2; /* caller does job */
+ }
+
+ mailerflags[mf_idx++] = sendmail_mailer_path;
+
+ mailerflags[mf_idx++] = "-bv";
+
+ /* Do not treat -xyc as option */
+ mailerflags[mf_idx++] = "--";
+
+ mailerflags[mf_idx++] = text;
+
+ mailerflags[mf_idx] = NULL;
+
+ ret = start_run(&RS,SY_NOTTY|SY_ENV_SHELL,mailerflags,-1,-1);
+
+ if (!ret) {
+ DPRINT(Debug,4,(&Debug,
+ "Can't run %s for address verify -- falling back to default addr verify\n",
+ sendmail_mailer_path));
+ return -2; /* caller does job */
+ }
+ ret = wait_end(&RS,&exit_code);
+ if (ret < 0) {
+ DPRINT(Debug,4,(&Debug,
+ "%s died on signal %d -- falling back to default addr verify\n",
+ sendmail_mailer_path,-ret));
+ return -2; /* caller does job */
+ }
+ if (0 == ret) {
+ DPRINT(Debug,4,(&Debug,
+ "%s lost? -- falling back to default addr verify\n",
+ sendmail_mailer_path));
+ return -2; /* caller does job */
+ }
+
+ /* -1 is success, but caller should fill fullname */
+ return exit_code == 0 ? -1 : 0;
+ }
+
+ static void sendmail_mailer_info_set_ef(M,I,X,value)
+ struct mailer_config *M;
+ struct mailer_info *I;
+ struct mailer_env_from *X;
+ CONST char *value;
+ {
+ CONST char *mailerflags[5];
+ int mf_idx=0;
+ struct run_state RS;
+ int ret,exit_code;
+
+ if (0 == strcmp(value,"<>")) {
+ /* Null envelope sender is only valid as sender (not as recipient)
+ so do not verify it
+ */
+ X->mail_from = strmcpy(X->mail_from,value);
+ return;
+ }
+
+ if (I->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,
+ "sendmail_mailer_info_set_ef",
+ "Bad magic number (mailer info)",0);
+
+ mailerflags[mf_idx++] = sendmail_mailer_path;
+
+ mailerflags[mf_idx++] = "-bv";
+
+ /* Do not treat -xyc as option */
+ mailerflags[mf_idx++] = "--";
+
+ mailerflags[mf_idx++] = value;
+
+ mailerflags[mf_idx] = NULL;
+
+ ret = start_run(&RS,SY_NOTTY|SY_ENV_SHELL,mailerflags,-1,-1);
+
+ if (!ret) {
+ DPRINT(Debug,4,(&Debug,
+ "Can't run %s for address verify -- sendmail_mailer_info_set_ef failed\n",
+ sendmail_mailer_path));
+ goto failure;
+ }
+
+ ret = wait_end(&RS,&exit_code);
+ if (ret < 0) {
+ DPRINT(Debug,4,(&Debug,
+ "%s died on signal %d -- sendmail_mailer_info_set_ef failed\n",
+ sendmail_mailer_path,-ret));
+ goto failure;
+ }
+
+ if (0 == ret) {
+ DPRINT(Debug,4,(&Debug,
+ "%s lost? -- sendmail_mailer_info_set_ef failed\n",
+ sendmail_mailer_path));
+ goto failure;
+ }
+
+
+ if (exit_code == 0) {
+ X->mail_from = strmcpy(X->mail_from,value);
+ DPRINT(Debug,8,(&Debug,
+ " .. envelope sender=%s\n",
+ X->mail_from));
+
+ } else {
+ DPRINT(Debug,4,(&Debug,
+ "... exit code %d -- envelope sender address %s bad?\n",
+ exit_code,value));
+
+ failure:
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmChangingSendmEnvSenderFailed,
+ "Changing of envelope sender for sendmail failed: %s"),
+ value);
+ }
+ }
+
+ static int submitmail_mailer_init(M,C,I)
+ struct mailer_config *M;
+ struct mail_send_state *C;
+ struct mailer_info *I;


+ {
+ int i;
+

+ if (C->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"submitmail_mailer_init",
+ "Bad magic number (mail send state)",0);
+
+ if (!default_mailer_init(M,C,I))
+ return 0;
+
+ /* WARNING: Untested --
+ code copied from do_mmdf_addresses() on src/reply.c
+ */
+ for (i = 0; i < C -> addr_count; i++) {
+ state_puts(C -> addrs[i],&(C->OUT)); state_putc('\n',&(C->OUT));
+ }
+ state_putc('\n',&(C->OUT));
+
+ return 1; /* OK */
+ }
+
+
+ int submitmail_mailer_backend(M,C,encoding_top,title,sm)
+ struct mailer_config *M;
+ struct mail_send_state **C;
+ int encoding_top;
+ char * title;
+ sending_message_func *sm;
+ {
+ int r;
+ CONST char *mailerflags[20];
+ int mf_idx=0;
+
+ if ((*C)->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"submitmail_mailer_backend",
+ "Bad magic number (mail send state)",0);
+
+ /* WARNING: Untested --
+ code copied from mail_backend() on src/mailmsg2.c
+ */
+
+ mailerflags[mf_idx++] = submitmail_mailer_path;
+
+ mailerflags[mf_idx++] = "-mlrnv";
+
+ mailerflags[mf_idx] = NULL;
+
+ r = backend_tail(M,C,title,sm,mailerflags);
+
+ return r;
+ }
+
+ int execmail_mailer_backend(M,C,encoding_top,title,sm)
+ struct mailer_config *M;
+ struct mail_send_state **C;
+ int encoding_top;
+ char * title;
+ sending_message_func *sm;
+ {
+ int r;
+ char *mailerflags[20];
+ CONST char **argv;
+ int mf_idx=0;
+
+ if ((*C)->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"execmail_mailer_backend",
+ "Bad magic number (mail send state)",0);
+
+ /* WARNING: Untested --
+ code copied from mail_backend() on src/mailmsg2.c
+ */
+
+ mailerflags[mf_idx++] = execmail_mailer_path;
+
+ if ((*C)->verbose)
+ mailerflags[mf_idx++] = "-d";
+ if (metoo)
+ mailerflags[mf_idx++] = "-m";
+
+ argv = join_argv(mailerflags,(*C)->addrs);
+
+ r = backend_tail(M,C,title,sm,argv);
+
+ free(argv);
+
+ return r;
+ }
+
+
+ int mail_backend2(mail_fd,func,encoding_top,title,
+ sm)
+ struct mail_send_state **mail_fd;
+ end_handler *func;
+ int encoding_top;
+ char * title;
+ sending_message_func *sm;


+ {
+ int r;
+

+ if ((*mail_fd)->magic != MAILER_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"mail_backend2",
+ "Bad magic number (mail send state)",0);
+
+ DPRINT(Debug,7,(&Debug,
+ "Sending mail via %s mailer, %d recipients\n",
+ (*mail_fd)->mailer_type->mailer_type,
+ (*mail_fd)->addr_count));
+
+ (*mail_fd)->orig_func = func;
+
+ if (!valid_mailer((*mail_fd)->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"mail_backend2",
+ "Bad mailer type",
+ 0);
+
+ r = (*mail_fd)->mailer_type->m_backend_hook((*mail_fd)->mailer_type,
+ mail_fd,encoding_top,
+ title,sm);
+ return r;
+ }
+
+ # ifdef PWDINSYS
+ # include <sys/pwd.h>
+ # else
+ # include <pwd.h>
+ # endif


+
+ /* Should return 1 if verify succees and fields of result to be filled
+ -- caller should free fields of result
+ Returns 0 on failure
+ */

+ int verify_mailer_addr(I,text,result, errcode)
+ struct mailer_info *I;
+ CONST char *text;
+ struct addr_item *result;
+ enum mailer_errcode * errcode;
+ {
+ int ret = 0;
+
+ if (I->magic != MAILER_INFO_magic)
+ panic("MAILER PANIC",__FILE__,__LINE__,"verify_mailer_addr",
+ "Bad magic number (mailer info)",0);
+
+ /* bzero is defined on hdrs/defs.h */
+ bzero((void *)result, sizeof (*result));
+ result -> addr = NULL;
+ result -> fullname = NULL;
+ result -> comment = NULL;
+
+ *errcode = MAILER_NOT_AVAIL;
+
+ if (!valid_mailer(I->mailer_type))
+ panic("MAILER PANIC",__FILE__,__LINE__,"verify_mailer_addr",
+ "Bad mailer type",
+ 0);
+
+ /* Returns
+ -1 if caller should result with default data (return 1)
+ -2 if caller should just test passwd
+ 0 if failure
+ 1 is succees
+ */
+ ret = I->mailer_type->mi_verify_addr(I->mailer_type,I,text,result);
+
+ DPRINT(Debug,7,(&Debug,"Address %s verify result %d%s\n",
+ text,ret,
+ ret < 0 ? " (use default processing)" : ""));
+ if (result->addr) {
+ DPRINT(Debug,7,(&Debug,
+ " ... resulting address %s\n",
+ result->addr));
+ }
+
+ if (0 == ret)
+ *errcode = MAILER_NOT_EXIST;
+ if (ret > 0)
+ *errcode = MAILER_OK;
+
+ if (ret < 0) {
+ struct passwd * P = getpwnam(text);
+
+ if (P)
+ *errcode = MAILER_OK;
+
+ if (P && ! result -> fullname ) {
+ char * N = get_fullname1(P,text);
+
+ /* FIXME: Posible wrong charset */
+ if (N) {
+ result -> fullname = new_string2(system_charset,s2us(N));
+ }
+
+ ret = 1;
+ } else {
+ ret = ret == -1 ? 1 : 0;

Kari E. Hurtta

unread,
Jul 13, 2005, 5:49:54 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.12

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 12/18
=========================================================================
! (current_header->status & ACTION) != 0,
! (current_header->status & CONFIDENTIAL) != 0,
! (current_header->status & DELETED) != 0,
! (current_header->status & EXPIRED) != 0,
! (current_header->status & FORM_LETTER) != 0,
! (current_header->status & NEW) != 0,
! (current_header->status & PRIVATE_MAIL) != 0,
! (current_header->status & TAGGED) != 0,
! (current_header->status & URGENT) != 0,
! (current_header->status & VISIBLE) != 0,
! (current_header->status & UNREAD) != 0,
! (current_header->status & REPLIED) != 0,
! (current_header->status & MIME_MESSAGE) != 0,
! (current_header->status & PRE_MIME_CONTENT) != 0,
! (current_header->status & MIME_UNSUPPORTED) != 0,
! (current_header->status & NOHDRENCODING) != 0);
!
! Write_to_screen(FRM("\n\rReceived on: %s\r"),
! asctime(localtime(&current_header->received_time)));

-
header_time = current_header->time_sent + current_header->tz_offset;
! Write_to_screen(FRM("\rMessage sent on: %s\r\nFrom timezone: %s (%d)\n\r"),
! asctime(gmtime(&header_time)),
! current_header->time_zone,
! current_header->tz_offset);
!
! Write_to_screen(FRM("(Env) From: %s\n\r"),
! current_header->env_from);

if (current_header->from) {
! int first = 1;
! struct addr_item *p;


! for (p = current_header->from;

! p->fullname && p->addr && p->comment;
! p++) {
! if (first)
! Write_to_screen(FRM( "From: "));
! else
! Write_to_screen(FRM(",\r\n "));
! Write_to_screen(FRM("%-30S <%s>"),p->fullname,p->addr);
! first = 0;
! if (string_len(p->comment))
! Write_to_screen(FRM(" (%S)"),p->comment);
! }
! Write_to_screen(FRM("\r\n"));
}
!


! Write_to_screen(FRM("Subject: %S\n\rInternal Index Reference Number = %d/%d (hdr index %d)\n\r"),
! current_header->subject,
! index->mailbox_number,
! index->index,
! current_header->index_number_X);
!
if (current_header->to) {
int first = 1;
struct addr_item *p;
--- 1900,1990 ----

menu_ClearScreen(page);

! menu_Write_to_screen(page,
! FRM("\t\t\t----- Message %d -----\n\r\n\r\n\r\n\r"),
! current);
!
! menu_Write_to_screen(page,
! FRM("Lines: %-17dStatus: A C D E F N P T U V O R M P U N\n\r"),
! current_header->lines);
! menu_Write_to_screen(page,
! FRM("Content-Length: %-16dc o e x o e r a r i l e i r s H\n\r"),
! current_header->content_length);
! menu_Write_to_screen(page,
! FRM("Binary: %-24dt n l p r w i g g s d p m e u d\n\r"),
! current_header->binary);
! menu_Write_to_screen(page,
! FRM("'From ' on body: %-15dn f d d m v d n i l e M p r\n\r"),
! current_header->have_from);
!
! menu_Write_to_screen(page,
! FRM("\n\rOffset: %-22ld%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d\n"),
! current_header->offset,
! (current_header->status & ACTION) != 0,
! (current_header->status & CONFIDENTIAL) != 0,
! (current_header->status & DELETED) != 0,
! (current_header->status & EXPIRED) != 0,
! (current_header->status & FORM_LETTER) != 0,
! (current_header->status & NEW) != 0,
! (current_header->status & PRIVATE_MAIL) != 0,
! (current_header->status & TAGGED) != 0,
! (current_header->status & URGENT) != 0,
! (current_header->status & VISIBLE) != 0,
! (current_header->status & UNREAD) != 0,
! (current_header->status & REPLIED) != 0,
! (current_header->status & MIME_MESSAGE) != 0,
! (current_header->status & PRE_MIME_CONTENT) != 0,
! (current_header->status & MIME_UNSUPPORTED) != 0,
! (current_header->status & NOHDRENCODING) != 0);
!
! menu_Write_to_screen(page,
! FRM("\n\rReceived on: %s\r"),
! asctime(localtime(&current_header->received_time)));

header_time = current_header->time_sent + current_header->tz_offset;
!
! menu_Write_to_screen(page,
! FRM("\rMessage sent on: %s\r\nFrom timezone: %s (%d)\n\r"),
! asctime(gmtime(&header_time)),
! current_header->time_zone,
! current_header->tz_offset);
!
! menu_Write_to_screen(page,
! FRM("(Env) From: %s\n\r"),
! current_header->env_from);

if (current_header->from) {
! int first = 1;
! struct addr_item *p;


! for (p = current_header->from;

! p->fullname && p->addr && p->comment;
! p++) {
! if (first)
! menu_Write_to_screen(page,
! FRM( "From: "));
! else
! menu_Write_to_screen(page,
! FRM(",\r\n "));
! menu_Write_to_screen(page,
! FRM("%-30S <%s>"),p->fullname,p->addr);
! first = 0;
! if (string_len(p->comment))
! menu_Write_to_screen(page,
! FRM(" (%S)"),p->comment);
! }
! menu_Write_to_screen(page,
! FRM("\r\n"));
}
!


! menu_Write_to_screen(page,
! FRM("Subject: %S\n\rInternal Index Reference Number = %d/%d (hdr index %d)\n\r"),
! current_header->subject,
! index->mailbox_number,
! index->index,
! current_header->index_number_X);
!
if (current_header->to) {
int first = 1;
struct addr_item *p;
***************
*** 1695,1709 ****
p->fullname && p->addr && p->comment;
p++) {
if (first)
! Write_to_screen(FRM( "To: "));
else
! Write_to_screen(FRM(",\r\n "));
! Write_to_screen(FRM("%-30S <%s>"),p->fullname,p->addr);
first = 0;
if (string_len(p->comment))
! Write_to_screen(FRM(" (%S)"),p->comment);
}
! Write_to_screen(FRM("\r\n"));
}

if (current_header->cc) {
--- 1992,2011 ----
p->fullname && p->addr && p->comment;
p++) {
if (first)
! menu_Write_to_screen(page,
! FRM( "To: "));
else
! menu_Write_to_screen(page,
! FRM(",\r\n "));
! menu_Write_to_screen(page,
! FRM("%-30S <%s>"),p->fullname,p->addr);
first = 0;
if (string_len(p->comment))
! menu_Write_to_screen(page,
! FRM(" (%S)"),p->comment);
}
! menu_Write_to_screen(page,
! FRM("\r\n"));
}

if (current_header->cc) {
***************
*** 1713,1744 ****
p->fullname && p->addr && p->comment;
p++) {
if (first)
! Write_to_screen(FRM( "CC: "));
else
! Write_to_screen(FRM(",\r\n "));
! Write_to_screen(FRM("%-30S <%s>"),p->fullname,p->addr);
first = 0;
if (string_len(p->comment))
! Write_to_screen(FRM(" (%S)"),p->comment);
}
! Write_to_screen(FRM("\r\n"));
}


! Write_to_screen(FRM("Message-ID: %s\n\r"),
! strlen(current_header->messageid) > 0 ?
! current_header->messageid : "<none>");

! Write_to_screen(FRM("Status: %s\n\r"),
! current_header->mailx_status);

! Write_to_screen(FRM("Content-Transfer-Encoding: %s\n\r"),
! ENCODING(current_header->mime_rec.encoding));

fail1:
! PutLineX(LINES-1,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxPressAnyKey,
! "Please Press any key to return."));
if (REDRAW_MARK == menu_ReadCh(page, REDRAW_MARK))
goto redraw;

--- 2015,2055 ----
p->fullname && p->addr && p->comment;
p++) {
if (first)
! menu_Write_to_screen(page,
! FRM( "CC: "));
else
! menu_Write_to_screen(page,
! FRM(",\r\n "));
! menu_Write_to_screen(page,
! FRM("%-30S <%s>"),p->fullname,p->addr);
first = 0;
if (string_len(p->comment))
! menu_Write_to_screen(page,
! FRM(" (%S)"),p->comment);
}
! menu_Write_to_screen(page,
! FRM("\r\n"));
}


! menu_Write_to_screen(page,
! FRM("Message-ID: %s\n\r"),
! strlen(current_header->messageid) > 0 ?
! current_header->messageid : "<none>");

! menu_Write_to_screen(page,
! FRM("Status: %s\n\r"),
! current_header->mailx_status);

! menu_Write_to_screen(page,
! FRM("Content-Transfer-Encoding: %s\n\r"),
! ENCODING(current_header->mime_rec.encoding));

fail1:
! menu_PutLineX(page,
! LINES-1,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxPressAnyKey,
! "Please Press any key to return."));
if (REDRAW_MARK == menu_ReadCh(page, REDRAW_MARK))
goto redraw;

***************
*** 1774,1781 ****
}
}

! void check_range(mc)
struct menu_common *mc;
{
int i;
int current = mcommon_get_current(mc);
--- 2085,2093 ----
}
}

! void check_range(mc,LOC)
struct menu_common *mc;
+ struct screen_parts *LOC;
{
int i;


int current = mcommon_get_current(mc);
***************

*** 1809,1836 ****
}

mcommon_set_current(mc,current);
!

}

static char *no_aliases = NULL;

/* Return key if unknown */

! int motion(ch,mc, nufoot, header_page, page)
int ch;

struct menu_common *mc;
! int *nufoot;
! int *header_page;
struct menu_context *page;
{
/* Consolidated the standard menu navigation and delete/tag


* commands to a function. */

int i;

- int redraw = 0;

int current = mcommon_get_current(mc);

! switch (ch) {


case FIND_MARK:
--- 2121,2147 ----
}

mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);


}

static char *no_aliases = NULL;

/* Return key if unknown */

! int motion(ch,mc, LOC, page)
int ch;
struct menu_common *mc;
! struct screen_parts *LOC;
struct menu_context *page;
{
+
/* Consolidated the standard menu navigation and delete/tag


* commands to a function. */

int i;

int current = mcommon_get_current(mc);

! switch (ch) {


case FIND_MARK:
***************
*** 1842,1853 ****

}
else {
- int x = pattern_match(mc, *header_page,
- page);
-
- redraw += menu_need_redraw(page);
-


if (EOF == x) {
return EOF; /* ERROR */

--- 2153,2161 ----

}
else {

+ int x = pattern_match(mc, page, LOC);


+
if (EOF == x) {
return EOF; /* ERROR */

***************

*** 1855,1861 ****

if (x) {
current = mcommon_get_current(mc);
! nucurr = get_page(current,mc, header_page);
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmPatternNotFound,
--- 2163,2169 ----

if (x) {
current = mcommon_get_current(mc);
! get_page(mc, LOC->header_page);
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmPatternNotFound,
***************
*** 1864,1893 ****
}
break;

case PAGEDOWN_MARK :
case RIGHT_MARK :
case '+' : {
int selected = mcommon_get_selected(mc);
!
! /* move to next page if we're not on the last */

! if((selected &&
! (((*header_page)+1)*headers_per_page < selected))
! ||(!selected &&
! (((*header_page)+1)*headers_per_page < mcommon_get_count(mc)))) {

! (*header_page)++;
! nucurr = NEW_PAGE;

if(move_when_paged) {
/* move to first message of new page */
if(selected)
! current = visible_to_index((*header_page) *
! headers_per_page + 1,
! mc) + 1;
else
! current = (*header_page) * headers_per_page + 1;
mcommon_set_current(mc,current);
}
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 2172,2207 ----
}
break;

+
case PAGEDOWN_MARK :
case RIGHT_MARK :
case '+' : {
int selected = mcommon_get_selected(mc);
! int top = menu_header_get(LOC->header_page,header_top_line);
! int li,co;
!
! menu_get_sizes(LOC->header_page, &li, &co);

! /* move to next page if we're not on the last */
!
! if ((selected && (top+li < selected))
! ||
! (!selected && (top+li < mcommon_get_count(mc)))) {



! top += li;
!

! menu_header_change(LOC->header_page, header_top_line,top);

if(move_when_paged) {
/* move to first message of new page */
if(selected)
! current = visible_to_index(top+1,mc) + 1;
else
! current = top+1;
!
mcommon_set_current(mc,current);
+ menu_header_change(LOC->header_page,
+ header_current,top);
}
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 1898,2149 ****

case PAGEUP_MARK :
case LEFT_MARK :
! case '-' : {
! int selected = mcommon_get_selected(mc);
!
! /* move to prev page if we're not on the first */
! if((*header_page) > 0) {
! (*header_page)--;
! nucurr = NEW_PAGE;
!
! if(move_when_paged) {
! /* move to first message of new page */
! if(selected)
! current = visible_to_index(
! (*header_page) * headers_per_page + 1,
! mc) + 1;
! else
! current = (*header_page) * headers_per_page + 1;
! mcommon_set_current(mc,current);
! }


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmAlreadyOnFirstPage,
!
! "Already on first page."));
! }
! break;

! case HOME_MARK:
! case '=' : {
! int selected = mcommon_get_selected(mc);

! if (selected)
! current = visible_to_index(1,mc)+1;
! else
! current = 1;
! mcommon_set_current(mc,current);
! nucurr = get_page(current, mc, header_page);
! }
! break;

! case '*' : {
! int selected = mcommon_get_selected(mc);

! if (selected)
! current = (visible_to_index(selected,mc)+1);
! else
! current = mcommon_get_count(mc);
!
! mcommon_set_current(mc,current);
! nucurr = get_page(current, mc, header_page);
}
! break;
!
case EOF : return EOF; /* ERROR */


! case ctrl('D') :
! case '^' :
case 'd' :
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToDelete,
! "No %S to delete!"),
! mcommon_give_item(mc,m_item));
!
! } else {
! if(ch == ctrl('D')) {
!
! /* if current item did not become deleted,
! * don't to move to the next undeleted item */
! if(!meta_match(DELETED, mc, *header_page,
! page))
! break;
!
! } else
! delete_msg((ch == 'd'), TRUE, mc,
! *header_page);
!
! /* If given '^' command (toggle delete flag)
! go to next command regagdles is next command
! marked for deletion or not on resolve mode.
! In other words works same way than u)undelete
! command works.
! */
!
! if (resolve_mode) /* move after mail resolved */
! if((i=next_message(current-1,
! (ch == 'd') ? TRUE : FALSE,
! mc)) != -1) {
!
! current = i+1;
! mcommon_set_current(mc,current);

- nucurr = get_page(current, mc, header_page);
- }
- }
- break;

! case 'J' : if(current > 0) {
! if((i=next_message(current-1, FALSE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current,mc, header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreItemBelow,
! "No more %S below."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

next_undel_msg:
case DOWN_MARK :
! case 'j' : if(current > 0) {
! if((i=next_message(current-1, TRUE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current,mc, header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoItemUndeletedBelow,
! "No more undeleted %S below."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));

! break;

! case 'K' : if(current > 0) {
! if((i=prev_message(current-1, FALSE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current,mc, header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreItemAbove,
! "No more %S above."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

case UP_MARK :
! case 'k' : if(current > 0) {
! if((i=prev_message(current-1, TRUE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current, mc, header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreUndeletedAbove,
! "No more undeleted %S above."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

! case 'l' : Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmLimitDisplayBy,
! "Limit displayed %S by..."),
! mcommon_give_item(mc,m_items));
! clear_error();


! limit(mc, page);
! if (menu_need_redraw(page)) {

! current = mcommon_get_current(mc);
! get_page(current, mc, header_page);
! redraw++;
! } else {
! (*nufoot)++;
! }
! break;

! case ctrl('T') :
! case 'T' :
! case 't' : if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToTag,
! "No %S to tag!"),
! mcommon_give_item(mc,m_items));
!
! }
! else if (ch == 't')
! tag_message(TRUE, mc,*header_page);
! else if (ch == 'T') {
! tag_message(TRUE, mc, *header_page);
! goto next_undel_msg;
! }
! else
! meta_match(TAGGED, mc, *header_page,
! page);
! break;
!
!
! case 'u' : if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToMarkUndeleted,
! "No %S to mark as undeleted!"),
! mcommon_give_item(mc,m_items));
!
! }
! else {
! undelete_msg(TRUE, mc, *header_page);
! if (resolve_mode) /* move after mail resolved */
! if((i=next_message(current-1, FALSE, mc)) != -1) {


! current = i+1;
! mcommon_set_current(mc,current);
! nucurr = get_page(current, mc, header_page);

! }
/*************************************************************************
** What we've done here is to special case the "U)ndelete" command to
** ignore whether the next message is marked for deletion or not. The
--- 2212,2497 ----

case PAGEUP_MARK :
case LEFT_MARK :
! case '-' : {
! int selected = mcommon_get_selected(mc);
! int top = menu_header_get(LOC->header_page,header_top_line);
! int li,co;

! menu_get_sizes(LOC->header_page, &li, &co);
!
! /* move to prev page if we're not on the first */
! if(top > 0) {
!
! top -= li;


! if (top < 0)
! top = 0;

! menu_header_change(LOC->header_page, header_top_line,top);

! if(move_when_paged) {
! /* move to first message of new page */
! if(selected)
! current = visible_to_index(top + 1, mc) + 1;
! else
! current = top + 1;
! mcommon_set_current(mc,current);
! menu_header_change(LOC->header_page,
! header_current,top);
! }


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmAlreadyOnFirstPage,
!
! "Already on first page."));
! }
! break;

! case HOME_MARK:
! case '=' : {
! int selected = mcommon_get_selected(mc);
!
! if (selected)
! current = visible_to_index(1,mc)+1;
! else
! current = 1;
! mcommon_set_current(mc,current);
! menu_header_change(LOC->header_page, header_current,0);
!
! get_page(mc, LOC->header_page);
! }
! break;
!
! case '*' : {
! int selected = mcommon_get_selected(mc);
! int i;
!
! if (selected) {
! current = (visible_to_index(selected,mc)+1);
! } else {
! current = mcommon_get_count(mc);
}
!
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);
! }
! break;
!
case EOF : return EOF; /* ERROR */


! case ctrl('D') :
! case '^' :
case 'd' :
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToDelete,
! "No %S to delete!"),
! mcommon_give_item(mc,m_item));
!
! } else {
! if(ch == ctrl('D')) {
!
! /* if current item did not become deleted,
! * don't to move to the next undeleted item */
! if(!meta_match(DELETED, mc, page, LOC))
! break;
!
! } else
! delete_msg((ch == 'd'), mc, LOC);
!
! /* If given '^' command (toggle delete flag)
! go to next command regagdles is next command
! marked for deletion or not on resolve mode.
! In other words works same way than u)undelete
! command works.
! */
!
! if (resolve_mode) /* move after mail resolved */
! if((i=next_message(current-1,
! (ch == 'd') ? TRUE : FALSE,
! mc)) != -1) {
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);
! }
! }
! break;
!
! case 'F': { /* Actually this works onlye for messages
! * and not aliases
! */
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToFlag,
! "No %S to flag!"),
! mcommon_give_item(mc,m_items));
!
! } else
! flag_message(mc, LOC->header_page);
! }
! break;


! case 'J' :
! if (current > 0) {
! if((i=next_message(current-1, FALSE,
! mc)) != -1) {
! int j;
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreItemBelow,
! "No more %S below."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

next_undel_msg:
case DOWN_MARK :
! case 'j' :
! if (current > 0) {
! if((i=next_message(current-1, TRUE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoItemUndeletedBelow,
! "No more undeleted %S below."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));

! break;
!
! case 'K' :
! if (current > 0) {
! if((i=prev_message(current-1, FALSE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);

! get_page(mc, LOC->header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreItemAbove,
! "No more %S above."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

case UP_MARK :
! case 'k' :
! if (current > 0) {
! if((i=prev_message(current-1, TRUE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreUndeletedAbove,
! "No more undeleted %S above."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;
!
! case 'l' :

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLimitDisplayBy,
! "Limit displayed %S by..."),
! mcommon_give_item(mc,m_items));

! clear_error();
! limit(mc, page,LOC);

! break;
!

+ case ctrl('T') :
+ case 'T' :
+ case 't' :
+ if (mcommon_get_count(mc) < 1) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmNoItemToTag,
+ "No %S to tag!"),
+ mcommon_give_item(mc,m_items));
+
+ } else if (ch == 't')
+ tag_message(mc, LOC->header_page);
+ else if (ch == 'T') {
+ tag_message(mc, LOC->header_page);
+ goto next_undel_msg;
+ } else
+ meta_match(TAGGED, mc, page, LOC);
+ break;
+
+ case 'u' :
+ if (mcommon_get_count(mc) < 1) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet,
+ ElmNoItemToMarkUndeleted,
+ "No %S to mark as undeleted!"),
+ mcommon_give_item(mc,m_items));
+
+ } else {
+ undelete_msg(mc, LOC->header_page);
+
+ if (resolve_mode) /* move after mail resolved */
+ if((i=next_message(current-1, FALSE, mc)) != -1) {

! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);

! }
/*************************************************************************
** What we've done here is to special case the "U)ndelete" command to
** ignore whether the next message is marked for deletion or not. The
***************
*** 2154,2222 ****
** The old way, for those people that might want to see what the previous
** behaviour was to call next_message with TRUE, not FALSE.
**************************************************************************/
! }
! break;

! case ctrl('U') : if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToUndelete,
! "No %S to undelete!"),
! mcommon_give_item(mc,m_items));
!
! }
! else
! meta_match(UNDELETE, mc, *header_page,
! page);
! break;



! case ctrl('L') : redraw++; break;

! case NO_OP_COMMAND : break; /* noop for timeout loop */

! default : if (ch > '0' && ch <= '9') {
int selected = mcommon_get_selected(mc);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmNewCurrentItem,
! "New Current %S"),
! mcommon_give_item(mc,m_Item));
!

i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, page);

!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d (?)\n",
! current,i));
!
! if( i > mcommon_get_count(mc))
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotThatMany,
! "Not that many %S."),
! mcommon_give_item(mc,m_items));
! else if(selected
! && mcommon_isoff_status(mc,i-1,VISIBLE))
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotInLimitedDisplay,
! "%S not in limited display."),
! mcommon_give_item(mc,m_Item));
! else {
! current = i;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current, mc, header_page);
! }
! }
! else {


! if (redraw)
! menu_trigger_redraw(page);

! return ch; /* UNKNOWN command */
!
! }
}

- if (redraw)
- menu_trigger_redraw(page);


return 0; /* COmmand OK */
}

--- 2502,2573 ----
** The old way, for those people that might want to see what the previous
** behaviour was to call next_message with TRUE, not FALSE.
**************************************************************************/
! }
! break;

! case ctrl('U') :
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToUndelete,
! "No %S to undelete!"),
! mcommon_give_item(mc,m_items));
!
! } else
! meta_match(UNDELETE, mc, page, LOC);
! break;



! case ctrl('L') :

! menu_trigger_redraw(page);
! break;

! case NO_OP_COMMAND : break; /* noop for timeout loop */

!
! default :
! if (ch > '0' && ch <= '9') {
int selected = mcommon_get_selected(mc);



! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmNewCurrentItem,
! "New Current %S"),
! mcommon_give_item(mc,m_Item));
!
i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, page, LOC->prompt_page);
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d (?)\n",
! current,i));
!
! if( i > mcommon_get_count(mc))
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotThatMany,
! "Not that many %S."),
! mcommon_give_item(mc,m_items));
! else if(selected
! && mcommon_isoff_status(mc,i-1,
! status_basic,VISIBLE))
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotInLimitedDisplay,
! "%S not in limited display."),
! mcommon_give_item(mc,m_Item));
! else {
! current = i;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);
! }
!
! } else {
! return ch; /* UNKNOWN command */
!
! }
! break;


}

return 0; /* COmmand OK */
}

Index: elm2.4.ME+.122-cvs/src/file.c
*** elm2.4.ME+.121/src/file.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/file.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file.c,v 1.38 2004/07/26 12:41:46 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file.c,v 1.47 2005/06/17 21:02:55 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 32,38 ****
--- 32,40 ----

DEBUG_VAR(Debug,__FILE__,"mbox");

+ #ifndef errno


extern int errno;
+ #endif

static int save_message P_((int number,
struct folder_browser * XXX,
***************
*** 40,59 ****
WRITE_STATE ptr,
int pause, int appending,

int silently, int delete, int text_only,

- int *redraw,
struct MailboxView *mailbox,
struct AliasView *aview,
! int header_page));



struct string * prev_fold = NULL; /* name of previous folder */

! int save(silently, delete, text_only, mailbox, aview, header_page,
! page)
int silently, delete, text_only;


struct MailboxView *mailbox;
struct AliasView *aview;

- int header_page;
struct menu_context *page;
{

/** Save all tagged messages + current in a folder. If no messages
are tagged, save the current message instead! This routine

--- 42,62 ----
WRITE_STATE ptr,
int pause, int appending,

int silently, int delete, int text_only,
struct MailboxView *mailbox,

struct AliasView *aview,
! struct menu_context *header_area,
! struct menu_context *page));



struct string * prev_fold = NULL; /* name of previous folder */

! int save(silently, delete, text_only, mailbox, aview,

! page, prompt_area,header_area)


int silently, delete, text_only;
struct MailboxView *mailbox;

struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
+ struct menu_context *header_area;
{


/** Save all tagged messages + current in a folder. If no messages
are tagged, save the current message instead! This routine

***************
*** 73,82 ****
int tagged = 0, i, oldstat = 0, appending = 0,
is_ordinary_file, scount = 0;
int mesgnum = 0; /* message whose address is used for save-by-name fn */
- char
- answer;

! int redraw = 0;


struct folder_browser * XXX;
struct string * buffer = NULL;
WRITE_STATE write_ptr = NULL;

--- 76,83 ----
int tagged = 0, i, oldstat = 0, appending = 0,
is_ordinary_file, scount = 0;
int mesgnum = 0; /* message whose address is used for save-by-name fn */



! int delay_redraw = 0;

struct folder_browser * XXX;
struct string * buffer = NULL;
WRITE_STATE write_ptr = NULL;
***************

*** 120,134 ****

while (1) {
int code;
- int X,Y;


struct header_rec * mhdr = give_header(mailbox,mesgnum);

- int LINES, COLUMNS;
int r = 0;

- menu_get_sizes(page, &LINES, &COLUMNS);
-
-
if (!buffer && save_by_name &&
mhdr && mhdr->from && mhdr->from[0].addr) {
char buffer1[1000];
--- 121,130 ----
***************
*** 141,187 ****


}

/* 2 == text_only -- Not envelope information */
if (text_only > 0) {

if (tagged == 1)


r = gen_browser(page,
! XXX,&buffer,&redraw,

! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveTextMesTo,
! "%s text of message to: "),
! (delete ? cap_save_word : cap_copy_word));
else


r = gen_browser(page,
! XXX,&buffer,&redraw,

! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveTextMessagesTo,
! "%s text messages to: "),
! (delete ? cap_save_word : cap_copy_word));
} else {
if (tagged == 1)


r = gen_browser(page,
! XXX,&buffer,&redraw,

! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveMessageTo,
! "%s message to: "),
! (delete ? cap_save_word : cap_copy_word));
else


r = gen_browser(page,
! XXX,&buffer,&redraw,

! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveMessagesTo,
! "%s messages to: "),
! (delete ? cap_save_word : cap_copy_word));
}

- GetXYLocation(&X,&Y);


if (!r) {
--- 137,188 ----


}

/* 2 == text_only -- Not envelope information */

+
+ /* XXX gen_browser do not take line !!!
+ FIXME
+ FIXME gen_browser should use prompt_area
+ */
+
if (text_only > 0) {
if (tagged == 1)
r = gen_browser(page,
! XXX,&buffer,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveTextMesTo,
! "%s text of message to: "),
! (delete ? cap_save_word : cap_copy_word));
else
r = gen_browser(page,
! XXX,&buffer,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveTextMessagesTo,
! "%s text messages to: "),
! (delete ? cap_save_word : cap_copy_word));
} else {
if (tagged == 1)
r = gen_browser(page,
! XXX,&buffer,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveMessageTo,
! "%s message to: "),
! (delete ? cap_save_word : cap_copy_word));
else
r = gen_browser(page,
! XXX,&buffer,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveMessagesTo,
! "%s messages to: "),
! (delete ? cap_save_word : cap_copy_word));
}



if (!r) {
***************
*** 229,255 ****
if (0 != (code & BROWSER_EXIST)) { /* already there!! */
appending = 1;
if (confirm_append || (confirm_files && is_ordinary_file)) {
! char * msg_buffer = NULL;

! if (is_ordinary_file)
! msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmConfirmFilesAppend,
! "Append to an existing file `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);
else
! msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmConfirmFolderAppend,


! "Append to mail folder `%s'? (%c/%c) "),

! buffer,
! *def_ans_yes,
! *def_ans_no);

! answer = want_to(msg_buffer, *def_ans_no, LINES-2, 1,
! page);

! free(msg_buffer);

if (answer != *def_ans_yes) {
continue; /* RETRY */
--- 230,280 ----
if (0 != (code & BROWSER_EXIST)) { /* already there!! */
appending = 1;
if (confirm_append || (confirm_files && is_ordinary_file)) {


! int answer = '\0';

! again:
! if (is_ordinary_file)
! answer = prompt_letter(2,"",*def_ans_no,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel|

! PROMPT_center,


! prompt_area,
! CATGETS(elm_msg_cat, ElmSet,

! ElmConfirmFilesAppend,
! "Append to an existing file `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);
else
! answer = prompt_letter(2,"",*def_ans_no,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel|

! PROMPT_center,


! prompt_area,
! CATGETS(elm_msg_cat, ElmSet,

! ElmConfirmFolderAppend,


! "Append to mail folder `%S'? (%c/%c) "),

! buffer,
! *def_ans_yes,
! *def_ans_no);



! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {

! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);



! menu_ClearScreen(prompt_area);
!
! delay_redraw++; /* Can't trigger redraw yet... */

! goto again;
! }
!
!

! if (TERMCH_interrupt_char == answer ||
! EOF == answer)

! goto clean;

if (answer != *def_ans_yes) {
continue; /* RETRY */
***************
*** 257,284 ****
}
} else {
if (confirm_create || (confirm_folders && !is_ordinary_file)) {
! char * msg_buffer = NULL;

if (is_ordinary_file)
! msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
ElmConfirmFilesCreate,
"Create a new file `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);
else
! msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmConfirmFolderCreate,
! "Create a new mail folder `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);

! answer = want_to(msg_buffer, *def_ans_no, LINES-2, 1,
! page);

! free(msg_buffer);

if (answer != *def_ans_yes) {
continue; /* RETRY */
}
--- 282,331 ----
}
} else {
if (confirm_create || (confirm_folders && !is_ordinary_file)) {


! int answer = '\0';

+ again2:
if (is_ordinary_file)
! answer = prompt_letter(2,"",*def_ans_no,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel|

! PROMPT_center,


! prompt_area,
! CATGETS(elm_msg_cat, ElmSet,

ElmConfirmFilesCreate,
"Create a new file `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);
else
! answer = prompt_letter(2,"",*def_ans_no,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel|

! PROMPT_center,


! prompt_area,
! CATGETS(elm_msg_cat, ElmSet,

! ElmConfirmFolderCreate,
! "Create a new mail folder `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);


!
! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {

! menu_ClearScreen(page); /* Reset possible redraw flag */

! /* Call refresh routines of children */
! menu_redraw_children(page);

! menu_ClearScreen(prompt_area);

+ delay_redraw++; /* Can't trigger redraw yet... */
+ goto again2;
+ }


+
+ if (TERMCH_interrupt_char == answer)

+ goto clean;
+
if (answer != *def_ans_yes) {
continue; /* RETRY */
}
***************
*** 318,325 ****
* so whatever silently was, now it's true - we can't show those
* delete markings.
*/
! if(redraw)

silently = TRUE;

mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */

--- 365,374 ----
* so whatever silently was, now it's true - we can't show those
* delete markings.
*/
! if(delay_redraw || menu_need_redraw(page)) { /* ! ! ! */
silently = TRUE;
+ delay_redraw = 1;
+ }



mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */
***************

*** 329,341 ****



if (!save_message(i, XXX, buffer, write_ptr,

(tagged > 1), appending++,

! silently, delete, text_only, &redraw,

! mailbox, aview, header_page))
fail++;
! if(redraw)
silently = TRUE;
! scount++;
!
}
}

--- 378,394 ----



if (!save_message(i, XXX, buffer, write_ptr,

(tagged > 1), appending++,
! silently, delete, text_only,
! mailbox, aview,
! header_area,page))
fail++;
!
! if(delay_redraw || menu_need_redraw(page)) { /* ! ! ! */
silently = TRUE;
! delay_redraw = 1;
! }
!
! scount++;
}
}

***************
*** 382,409 ****
free_string(&buffer);

DPRINT(Debug,8,(&Debug,

! "save=%d redraw=%d\n",
! retval,redraw));

! if (redraw)
menu_trigger_redraw(page);

return retval;
}

static int save_message(number, XXX, name,ptr,
pause, appending, silently,
! delete, text_only, redraw,
! mailbox, aview, header_page)
int number, pause, appending, silently, delete;
struct folder_browser * XXX;
struct string * name;
WRITE_STATE ptr;
int text_only;
- int *redraw;


struct MailboxView *mailbox;
struct AliasView *aview;

! int header_page;
{
int ret = 0;

--- 435,464 ----
free_string(&buffer);

DPRINT(Debug,8,(&Debug,
! "save=%d delay_redraw=%d\n",
! retval,delay_redraw));

! if (delay_redraw)


menu_trigger_redraw(page);
+ else
+ menu_trigger_redraw(prompt_area);

return retval;
}

static int save_message(number, XXX, name,ptr,
pause, appending, silently,
! delete, text_only,
! mailbox, aview, header_area,page)
int number, pause, appending, silently, delete;
struct folder_browser * XXX;
struct string * name;
WRITE_STATE ptr;
int text_only;
struct MailboxView *mailbox;
struct AliasView *aview;
! struct menu_context *header_area;
! struct menu_context *page;
{
int ret = 0;

***************
*** 420,425 ****
--- 475,481 ----

int save_current, is_new;
int is_tagged = 0;


+ int delay_redraw = 0;

struct header_rec *hdr;
FILE *infile;

***************
*** 472,478 ****

/* Need redraw -- PGP output ?*/
if (raw_off_called()) {
! *redraw = TRUE;
silently = TRUE;
}

--- 528,536 ----

/* Need redraw -- PGP output ?*/
if (raw_off_called()) {
! DPRINT(Debug,9,(&Debug,
! "save_message: Raw OFF called\n"));
! delay_redraw = TRUE;
silently = TRUE;
}

***************
*** 520,533 ****
setit(hdr->status, TAGGED);
}

! if (! silently) {
struct menu_common MENU;
!
set_mcommon_from_mbxview(&MENU,mailbox);

! show_new_status(number, &MENU, header_page); /* update screen, if needed */
}

if (pause && (!silently) && (!appending))
sleep_message();

--- 578,600 ----
setit(hdr->status, TAGGED);
}

! if (! silently && header_area) {


struct menu_common MENU;
! int vis;
!

set_mcommon_from_mbxview(&MENU,mailbox);

! vis = compute_visible(number+1, &MENU);
! menu_header_status_update(header_area,vis-1);
!
}

+ DPRINT(Debug,9,(&Debug,
+ "save_message: delay_redraw=%d\n",delay_redraw));


+
+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

if (pause && (!silently) && (!appending))
sleep_message();

Index: elm2.4.ME+.122-cvs/src/fileio.c
*** elm2.4.ME+.121/src/fileio.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/fileio.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.57 2004/07/20 18:33:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fileio.c,v 1.59 2005/06/17 21:02:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.59 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 29,36 ****
extern int errno;
#endif

- char *error_description();
-

#ifdef USE_PGP
/* Prototype */

static int copy_pgp P_((char *,out_state_t *,int, struct header_rec *,

--- 29,34 ----
***************
*** 1353,1358 ****
--- 1351,1357 ----
}
}
if (update_status) {
+ char buffer[WLEN+10]; /* Enough space for status letters */
if (state_printf (dest_file,
FRM("%sStatus: "),
prefix) == EOF) {
***************
*** 1360,1405 ****
goto fail;
}

! if (ison(current_header->status, NEW)) {
! if (state_printf(dest_file, FRM("N")) == EOF) {
! DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
! goto fail;
! }
! } else {
! if (state_printf(dest_file, FRM("O")) == EOF) {
DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
goto fail;
! }
! }
! if (isoff(current_header->status, UNREAD)) {
! /* read */
! if (state_printf(dest_file, FRM("R")) == EOF) {
! DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
! goto fail;
! }
}
- if (ison(current_header->status, REPLIED)) {
- if (state_printf (dest_file, FRM("r")) == EOF) {
- DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
- goto fail;
- }
- }
- /* save all the status flags that ELM doesn't understand */
- for (i=0; current_header->mailx_status[i] != '\0'; i++)
- switch (current_header->mailx_status[i]) {
- case 'N':
- case 'R':
- case 'O':
- case 'r':
- break;
- default:
- if (state_printf (dest_file, FRM("%c"),
- current_header->mailx_status[i]) ==
- EOF) {
- DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
- goto fail;
- }
- }

/* Must use state_printf so EOLN_is_CRLF conversion occurs! */
if (state_printf(dest_file,
--- 1359,1372 ----
goto fail;
}

! if (status_2_mailbox(current_header,buffer,sizeof buffer) > 0) {
! if (state_printf (dest_file,
! FRM("%s"),
! buffer) == EOF) {
DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
goto fail;
! }
}

/* Must use state_printf so EOLN_is_CRLF conversion occurs! */
if (state_printf(dest_file,
Index: elm2.4.ME+.122-cvs/src/file_util.c
*** elm2.4.ME+.121/src/file_util.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/file_util.c 2005-07-01 19:05:30.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.25 2004/07/24 19:50:45 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.27 2005/07/01 16:05:30 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 26,34 ****
extern int errno; /* system error number */
#endif

- char *error_description(), *getlogin();
- long fsize();
-
long bytes(name)
char *name;
{
--- 26,31 ----
***************
*** 145,151 ****
retcode = 2;
} else if (mfile->mailfile_size < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMail,
! "You have no mail.\n\r"));
retcode = 1;
} else
retcode = 0;
--- 142,148 ----
retcode = 2;
} else if (mfile->mailfile_size < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMail,
! "You have no mail."));
retcode = 1;
} else
retcode = 0;
Index: elm2.4.ME+.122-cvs/src/forms.c
*** elm2.4.ME+.121/src/forms.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/forms.c 2005-06-18 00:02:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forms.c,v 1.25 2004/07/26 12:41:46 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forms.c,v 1.28 2005/06/17 21:02:56 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 48,55 ****
extern int errno;
#endif

- char *error_description();
-
static void prompt_for_sized_entry P_((char *prompt, char *buffer,
int field_size,
struct menu_context *page));
--- 48,53 ----
***************
*** 105,112 ****

FILE *form, *newform;
char newfname[SLEN], buffer[SLEN];
! register int form_count = 0;
int len_buf, err;

DPRINT(Debug,4, (&Debug, "Formatting form file '%s'\n", filename));

--- 103,111 ----

FILE *form, *newform;
char newfname[SLEN], buffer[SLEN];
! int form_count = 0;
int len_buf, err;
+ char *tmp;

DPRINT(Debug,4, (&Debug, "Formatting form file '%s'\n", filename));

***************
*** 130,137 ****
return(-1);
}

elm_sfprintf(newfname, sizeof newfname,


! FRM("%s%s%d"), temp_dir, temp_form_file, getpid());

if ((newform = safeopen(newfname)) == NULL) {
err = errno;
--- 129,140 ----
return(-1);


}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ tmp = "/tmp/";
+

elm_sfprintf(newfname, sizeof newfname,


! FRM("%s%s%d"), tmp, temp_form_file, getpid());

if ((newform = safeopen(newfname)) == NULL) {
err = errno;
***************
*** 140,145 ****
--- 143,149 ----
DPRINT(Debug,1,(&Debug,
"** Error encountered opening file \"%s\" - %s (check_form) **\n",
newfname, error_description(err)));
+ fclose(form);
return(-1);
}

***************
*** 188,205 ****
return(form_count);
}

! int mail_filled_in_form(mail_index,address, subject,
! mailbox,aview)


int mail_index;
struct addr_item *address;

char *subject;


struct MailboxView *mailbox;
struct AliasView *aview;

{
! /** This is the interesting routine. This one will read the
! message and prompt the user, line by line, for each of
! the fields...returns non-zero if it succeeds
! **/

FILE *fd;
int lines = 0, count, len_buf, max_lines;
--- 192,210 ----
return(form_count);
}

! void mail_filled_in_form(mail_index,address, subject,
! mailbox,aview, parent_page)


int mail_index;
struct addr_item *address;

char *subject;


struct MailboxView *mailbox;
struct AliasView *aview;

+ struct menu_context *parent_page;
{
! /** This is the interesting routine. This one will read the
! message and prompt the user, line by line, for each of
! the fields...returns non-zero if it succeeds
! **/

FILE *fd;
int lines = 0, count, len_buf, max_lines;
***************
*** 208,213 ****
--- 213,219 ----
struct menu_context *cpage;
struct header_rec *hdr = NULL;
FILE * mail_file = NULL;
+ char *tmp;


DPRINT(Debug,4,
***************
*** 219,225 ****
if (!give_message_data(mailbox,mail_index,
&hdr,&mail_file,NULL,
NO_mime_parse))
! return 0;

/* now we can fly along and get to the message body... */

--- 225,231 ----
if (!give_message_data(mailbox,mail_index,
&hdr,&mail_file,NULL,
NO_mime_parse))
! return;

/* now we can fly along and get to the message body... */

***************
*** 231,237 ****
else if (lines >= max_lines) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoFormInMessage,
"No form in this message!?"));
! return(0);
}

if (buffer[len_buf - 1] == '\n')
--- 237,243 ----
else if (lines >= max_lines) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoFormInMessage,
"No form in this message!?"));
! return;
}

if (buffer[len_buf - 1] == '\n')
***************
*** 241,247 ****
if (len_buf == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoFormInMessage,
"No form in this message!?"));
! return(0);
}

DPRINT(Debug,6,(&Debug,
--- 247,253 ----
if (len_buf == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoFormInMessage,
"No form in this message!?"));
! return;
}

DPRINT(Debug,6,(&Debug,
***************
*** 263,285 ****
if (lines >= max_lines) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadForm,
"Badly constructed form. Can't reply!"));
! return(0);
}
}

if (len_buf == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadForm,
"Badly constructed form. Can't reply!"));
! return(0);
}

DPRINT(Debug,6,(&Debug,
"- skipped the non-forms-image stuff -\n"));

/* one last thing - let's open the tempfile for output... */
!
elm_sfprintf(buffer, sizeof buffer,


! FRM("%s%s%d"), temp_dir, temp_form_file, getpid());

DPRINT(Debug,2,(&Debug,
"-- forms sending using file %s --\n", buffer));
--- 269,294 ----
if (lines >= max_lines) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadForm,
"Badly constructed form. Can't reply!"));
! return;
}
}

if (len_buf == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadForm,
"Badly constructed form. Can't reply!"));
! return;
}

DPRINT(Debug,6,(&Debug,
"- skipped the non-forms-image stuff -\n"));

/* one last thing - let's open the tempfile for output... */
! tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
! if (!tmp)
! tmp = "/tmp/";
!
elm_sfprintf(buffer, sizeof buffer,


! FRM("%s%s%d"), tmp, temp_form_file, getpid());

DPRINT(Debug,2,(&Debug,
"-- forms sending using file %s --\n", buffer));
***************
*** 291,297 ****
DPRINT(Debug,1,(&Debug,
"** Error %s encountered trying to open temp file %s;\n",
error_description(errno), buffer));
! return(0);
}

/* NOW we're ready to read the form image in and start prompting... */
--- 300,306 ----
DPRINT(Debug,1,(&Debug,
"** Error %s encountered trying to open temp file %s;\n",
error_description(errno), buffer));
! return;
}

/* NOW we're ready to read the form image in and start prompting... */
***************
*** 351,357 ****

erase_menu_context(&page);

! return(1);
}


--- 360,368 ----

erase_menu_context(&page);

! menu_trigger_redraw(parent_page);
!
! return;
}


Index: elm2.4.ME+.122-cvs/src/hdrconfg.c
*** elm2.4.ME+.121/src/hdrconfg.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/hdrconfg.c 2005-05-29 10:11:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.44 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.51 2005/05/29 07:11:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 87,93 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page
));

/*
--- 87,94 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area
));

/*
***************
*** 127,139 ****


/*
* Local procedures.
*/

- static void hdrmenu_clear_promptarea P_((struct menu_context *page));
static int hdrmenu_get P_((struct hdr_menu_item *h,


struct mailing_headers *headers,
struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));

static void hdrmenu_put P_((struct hdr_menu_item *h,
int already_clear,
struct mailing_headers *headers,
--- 128,140 ----


/*
* Local procedures.
*/

static int hdrmenu_get P_((struct hdr_menu_item *h,


struct mailing_headers *headers,
struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));
static void hdrmenu_put P_((struct hdr_menu_item *h,
int already_clear,
struct mailing_headers *headers,
***************
*** 156,163 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page

! ));


/* To: -header -------------------------------------------------------- */
--- 157,165 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area
! ));


/* To: -header -------------------------------------------------------- */
***************
*** 175,181 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));

/* CC: -header -------------------------------------------------------- */

--- 177,184 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

/* CC: -header -------------------------------------------------------- */

***************
*** 192,198 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));

/* BCC: -header -------------------------------------------------------- */

--- 195,202 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

/* BCC: -header -------------------------------------------------------- */

***************
*** 209,215 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));


/* Subject: -header -------------------------------------------------------- */
--- 213,220 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));


/* Subject: -header -------------------------------------------------------- */
***************
*** 227,233 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));


/* Reply-To: -header -------------------------------------------------- */
--- 232,239 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));


/* Reply-To: -header -------------------------------------------------- */
***************
*** 245,251 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));


/* Action: -header ---------------------------------------------------- */
--- 251,258 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));


/* Action: -header ---------------------------------------------------- */
***************
*** 263,269 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));

/* Expires: -header ---------------------------------------------------- */

--- 270,277 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

/* Expires: -header ---------------------------------------------------- */

***************
*** 280,286 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));

/* Priority: -header ---------------------------------------------------- */

--- 288,295 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

/* Priority: -header ---------------------------------------------------- */

***************
*** 297,303 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));

/* Precedence: -header ---------------------------------------------------- */

--- 306,313 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

/* Precedence: -header ---------------------------------------------------- */

***************
*** 314,320 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));

/* In-Reply-To: -header ---------------------------------------------------- */

--- 324,331 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

/* In-Reply-To: -header ---------------------------------------------------- */

***************
*** 331,337 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));

/* User defined header ---------------------------------------------------- */

--- 342,349 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

/* User defined header ---------------------------------------------------- */

***************
*** 349,355 ****


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page));

/*
* Definition of all the header editing menu fields.
--- 361,368 ----


struct mailer_info *mailer_info,
charset_t hdr_charset,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

/*
* Definition of all the header editing menu fields.
***************
*** 420,432 ****
1 if found
REDRAW_MARK is redraw required
*/
! int presend_action(headers,mailer_info,c,hdr_charset,aview,page)
struct mailing_headers *headers;
struct mailer_info *mailer_info;
int c;
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;
{

struct hdr_menu_item *h;
int LINES, COLUMNS;
--- 433,447 ----
1 if found
REDRAW_MARK is redraw required
*/
! int presend_action(headers,mailer_info,c,hdr_charset,aview,page,
! prompt_area)
struct mailing_headers *headers;
struct mailer_info *mailer_info;
int c;
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
struct hdr_menu_item *h;
int LINES, COLUMNS;
***************
*** 443,449 ****
CleartoEOS();

status = hdrmenu_get(h,headers,mailer_info,hdr_charset,aview,
! page);
if (REDRAW_MARK == status) {
return REDRAW_MARK;
}
--- 458,464 ----
CleartoEOS();

status = hdrmenu_get(h,headers,mailer_info,hdr_charset,aview,
! page,prompt_area);


if (REDRAW_MARK == status) {
return REDRAW_MARK;
}
***************

*** 579,587 ****
{
charset_t edit_charset = system_charset;
FILE * F = NULL;

char * filename = elm_message(FRM("%s%sHDR%d"),
! temp_dir, temp_file, getpid());


char * buffer = NULL;

char buffer1[32*1024];
int stat;
--- 594,605 ----
{
charset_t edit_charset = system_charset;
FILE * F = NULL;

+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+

char * filename = elm_message(FRM("%s%sHDR%d"),
! tmp ? tmp : "/tmp/",
! temp_file, getpid());


char * buffer = NULL;

char buffer1[32*1024];
int stat;
***************
*** 620,631 ****
if (encoding_supported) {
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentEnc,
! "# MIME enconding of headers is supported\n"));

} else {
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentNo,
! "# MIME enconding of headers is NOT supported\n"));

}

--- 638,649 ----
if (encoding_supported) {
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentEnc,
! "# MIME encoding of headers is supported\n"));

} else {
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentNo,
! "# MIME encoding of headers is NOT supported\n"));

}

***************
*** 744,749 ****
--- 762,768 ----

}

+
void edit_headers(headers,mailer_info,hdr_charset, hdr_encoding_supported,
aview)
struct mailing_headers *headers;
***************
*** 761,795 ****
editor_val &&


strcmp(editor_val, "builtin") != 0 &&

strcmp(editor_val, "none") != 0;
!

int LINES, COLUMNS;



struct menu_context *page = new_menu_context();


menu_get_sizes(page, &LINES, &COLUMNS);

/*
* Placement of prompts and messages at the bottom of the screen.
*/
- #define INSTRUCT_LINE (LINES-5)
- #define INPUT_LINE (LINES-3)
- #define ERROR_LINE (LINES-2)
- #define TOPMOST_PROMPTAREA_LINE INSTRUCT_LINE
-
-

/* expand out all of the header values */
/* menu displays expanded values, user edits unexpended versions */

do_redraw = TRUE;
while (TRUE) { /* forever */

resize_mark:
if (menu_resized(page)) {

menu_get_sizes(page,&LINES, &COLUMNS);


do_redraw = 1;

} else if (menu_need_redraw(page))

--- 780,817 ----
editor_val &&


strcmp(editor_val, "builtin") != 0 &&

strcmp(editor_val, "none") != 0;


! int ul = give_dt_enumerate_as_int(&user_level);

int LINES, COLUMNS;



struct menu_context *page = new_menu_context();

+ struct menu_context * prompt_area = NULL;

menu_get_sizes(page, &LINES, &COLUMNS);

/*
* Placement of prompts and messages at the bottom of the screen.
*/

+ prompt_area =
+ new_menu_subpage(page,LINES-5,5,
+ subpage_simple_noredraw,NULL);
+
/* expand out all of the header values */
/* menu displays expanded values, user edits unexpended versions */

do_redraw = TRUE;
while (TRUE) { /* forever */
+ menu_set_default(page);

resize_mark:


if (menu_resized(page)) {

menu_get_sizes(page,&LINES, &COLUMNS);
+

+ menu_subpage_relocate(prompt_area,page,LINES-5,5);


+
do_redraw = 1;

} else if (menu_need_redraw(page))

***************
*** 822,869 ****
hdrmenu_put(h, TRUE, headers, hdr_charset, page);
}
do_redraw = FALSE;
- }

! /* display the instructions */
! if (user_level > 0 && editor_available) {

#ifdef ALLOW_SUBSHELL
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1,
! "Choose header, u)ser defined header, !)shell, invoke e(d)itor, or <return>."));
#else
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1NoShell,


! "Choose header, u)ser defined header, invoke e(d)itor, or <return>."));
#endif

!
! } else {
!
#ifdef ALLOW_SUBSHELL
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct,
! "Choose header, u)ser defined header, !)shell, or <return>."));
#else
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstructNoShell,
! "Choose header, u)ser defined header, or <return>."));
#endif
!
}
/* prompt for command */
! PutLineX(INPUT_LINE, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPrompt, "Choice: "));
if (precmd) {
! c = precmd;
! precmd = 0;


} else {
! c = menu_ReadCh(page,REDRAW_MARK|READCH_resize|READCH_sig_char);
if (c == REDRAW_MARK) {
do_redraw = TRUE;
continue;
}

--- 844,909 ----
hdrmenu_put(h, TRUE, headers, hdr_charset, page);
}
do_redraw = FALSE;

! menu_redraw_children(page);
! }



+ if (menu_resized(prompt_area) ||
+ menu_need_redraw(prompt_area)) {
+
+ menu_ClearScreen(prompt_area);
+

+ /* display the instructions */
+ if (ul > 0 && editor_available) {
+
#ifdef ALLOW_SUBSHELL
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1,
! "Choose header, u)ser defined header, !)shell, invoke e(d)itor, or <return>."));
#else
! menu_print_format_center(prompt_area,0
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1NoShell,


! "Choose header, u)ser defined header, invoke e(d)itor, or <return>."));
#endif

!
! } else {
!
#ifdef ALLOW_SUBSHELL
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct,
! "Choose header, u)ser defined header, !)shell, or <return>."));
#else
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstructNoShell,
! "Choose header, u)ser defined header, or <return>."));
#endif
!
! }
}
+
+
+
/* prompt for command */
! menu_PutLineX(prompt_area,2, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPrompt, "Choice: "));
if (precmd) {
! c = precmd;
! precmd = 0;
} else {
! c = menu_ReadCh(prompt_area,REDRAW_MARK|READCH_resize|READCH_sig_char);
if (c == REDRAW_MARK) {
+ menu_ClearScreen(page); /* Clear possible redraw mark */
+

+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+

+ menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/
+
do_redraw = TRUE;
continue;
}
***************
*** 882,888 ****
if (isascii(c))
#endif
c = tolower(c);
! hdrmenu_clear_promptarea(page);

/* execute the command */
switch (c) {
--- 922,929 ----
if (isascii(c))
#endif
c = tolower(c);
!
! menu_ClearScreen(prompt_area);

/* execute the command */
switch (c) {
***************
*** 896,902 ****


#ifdef ALLOW_SUBSHELL
case '!':

! subshell(NULL, page);

if (menu_need_redraw(page))
do_redraw = TRUE;
break;

--- 937,944 ----
#ifdef ALLOW_SUBSHELL
case '!':

! subshell(NULL, page, prompt_area); /* !! */
!
if (menu_need_redraw(page))
do_redraw = TRUE;
break;
***************
*** 925,931 ****
if (h->menucmd == c) {
int status = hdrmenu_get(h,headers,mailer_info,
hdr_charset,aview,
! page);
if (REDRAW_MARK == status) {
precmd = c;
do_redraw = TRUE;
--- 967,973 ----
if (h->menucmd == c) {
int status = hdrmenu_get(h,headers,mailer_info,
hdr_charset,aview,
! page,prompt_area);
if (REDRAW_MARK == status) {
precmd = c;
do_redraw = TRUE;
***************
*** 942,951 ****
}
}
if (h->menucmd <= 0) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuBadChoice,
! "No such header!"));
Writechar('\007');
}
break;
--- 984,993 ----
}
}
if (h->menucmd <= 0) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuBadChoice,
! "No such header!"));
Writechar('\007');
}
break;
***************
*** 954,991 ****
}

OUT:
erase_menu_context(&page);
return;
}


- /*
- * Erase instructions, user input, left-over errors, etc.
- * This should be run after every user input command in this module.
- */
- static void hdrmenu_clear_promptarea(page)


- struct menu_context *page;
- {

- int LINES, COLUMNS;
-

- menu_get_sizes(page,&LINES, &COLUMNS);
-
- clear_error();
- MoveCursor(TOPMOST_PROMPTAREA_LINE, 0);
- CleartoEOS();
- }


/*
* Prompt the user for a header value, and do any required post-processing.
*/
! static int hdrmenu_get(h,headers,mailer_info,hdr_charset,aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct mailer_info *mailer_info;
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;
{

char *s;
int plen, ret, do_append, do_comma;
--- 996,1022 ----
}

OUT:
+ erase_menu_context(&prompt_area);
+
erase_menu_context(&page);
return;
}




/*
* Prompt the user for a header value, and do any required post-processing.
*/
! static int hdrmenu_get(h,headers,mailer_info,hdr_charset,aview,page,
! prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct mailer_info *mailer_info;
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
char *s;
int plen, ret, do_append, do_comma;
***************
*** 995,1019 ****

menu_get_sizes(page,&LINES, &COLUMNS);

/* display the instructions */
switch (h->flags & HF_PROMPT_MASK) {
case HF_PROMPT_EXP:
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetExpiresInstruct,
! "In how many days should this message expire? "));
break;
case HF_PROMPT_USR:
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetUserdefInstruct,
! "Enter in the format \"HeaderName: HeaderValue\"."));
break;
default:
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetInstruct,
! "Enter value for the header."));
break;
}

--- 1026,1052 ----

menu_get_sizes(page,&LINES, &COLUMNS);

+ menu_ClearLine(prompt_area,0);
+
/* display the instructions */
switch (h->flags & HF_PROMPT_MASK) {
case HF_PROMPT_EXP:
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetExpiresInstruct,
! "In how many days should this message expire? "));
break;
case HF_PROMPT_USR:
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetUserdefInstruct,
! "Enter in the format \"HeaderName: HeaderValue\"."));
break;
default:
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetInstruct,
! "Enter value for the header."));
break;
}

***************
*** 1021,1027 ****
plen = 0;

if (h->hdrname != NULL) {
! MoveCursor(INPUT_LINE, 0);
for (s = h->hdrname ; *s != '\0' ; ++s) {
if (*s != '(' && *s != ')') {
if (plen > sizeof header_name -4)
--- 1054,1060 ----
plen = 0;

if (h->hdrname != NULL) {
! menu_MoveCursor(prompt_area,2,0);
for (s = h->hdrname ; *s != '\0' ; ++s) {
if (*s != '(' && *s != ')') {
if (plen > sizeof header_name -4)
***************
*** 1041,1068 ****
do_comma = ((h->flags & HF_ADD_COMMA) != 0 &&
string_len(buffer));

! ret = optionally_enter2(page, &buffer, INPUT_LINE, 0,
! (do_append ? OE_APPEND_CURRENT : 0) |
! (do_comma ? OE_ADD_COMMA : 0) |


! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,

! FRM("%s"),header_name);
if (ret == REDRAW_MARK) {
! h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page);
return REDRAW_MARK;
}

! hdrmenu_clear_promptarea(page);



/* bail out on error */

if (ret != 0) {
if (buffer)


h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,
! page);
return -1;
}
/* see if there is some processing required on this value */

return h->hdrproc(h,headers,&buffer,FALSE,mailer_info,hdr_charset,
! aview,page);
}


--- 1074,1107 ----
do_comma = ((h->flags & HF_ADD_COMMA) != 0 &&
string_len(buffer));



! {
! /* FIXME --optionally_enter* should use prompt_area */

! int line1 = menu_GetAbsLine(prompt_area,2);
!
! ret = optionally_enter2(page, &buffer, line1, 0,
! (do_append ? OE_APPEND_CURRENT : 0) |
! (do_comma ? OE_ADD_COMMA : 0) |


! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,

! FRM("%s"),header_name);
! }
if (ret == REDRAW_MARK) {
! h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page,
! prompt_area);
return REDRAW_MARK;
}

! menu_ClearScreen(prompt_area);



/* bail out on error */

if (ret != 0) {
if (buffer)
h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,
! page,prompt_area);


return -1;
}
/* see if there is some processing required on this value */

return h->hdrproc(h,headers,&buffer,FALSE,mailer_info,hdr_charset,
! aview,page,prompt_area);
}


***************
*** 1215,1224 ****
buffer = new_string(display_charset);

if (string_len(p->fullname) || ! p->addr[0] || '@' == p->addr[0]) {
/* We do not quote displayed (only) address */
struct string * temp = NULL;

! switch (phrase_display_mode) {
case 0:
temp = cat_strings(buffer,p->fullname,1);
break;
--- 1254,1265 ----
buffer = new_string(display_charset);

if (string_len(p->fullname) || ! p->addr[0] || '@' == p->addr[0]) {
+ int pd = give_dt_enumerate_as_int(&phrase_display_mode);
+
/* We do not quote displayed (only) address */
struct string * temp = NULL;

! switch (pd) {
case 0:
temp = cat_strings(buffer,p->fullname,1);
break;
***************
*** 1343,1349 ****
}

static int hdrproc_from (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1384,1390 ----
}

static int hdrproc_from (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1352,1357 ****
--- 1393,1399 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->from,ptr,free_only,mailer_info,
aview);
***************
*** 1377,1383 ****
}

static int hdrproc_to (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1419,1425 ----
}

static int hdrproc_to (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1386,1391 ****
--- 1428,1434 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->to,ptr,free_only,mailer_info,
aview);
***************
*** 1411,1417 ****
}

static int hdrproc_cc (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1454,1460 ----
}

static int hdrproc_cc (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1420,1425 ****
--- 1463,1469 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->cc,ptr,free_only,mailer_info,
aview);
***************
*** 1445,1451 ****
}

static int hdrproc_bcc (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1489,1495 ----
}

static int hdrproc_bcc (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1454,1459 ****
--- 1498,1504 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->bcc,ptr,free_only,mailer_info,
aview);
***************
*** 1491,1497 ****
}

static int hdrproc_subject (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1536,1542 ----
}

static int hdrproc_subject (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1500,1505 ****
--- 1545,1551 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
if (!free_only) {
charset_t utf7;
***************
*** 1545,1551 ****
}

static int hdrproc_reply_to (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1591,1597 ----
}

static int hdrproc_reply_to (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1554,1559 ****
--- 1600,1606 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->reply_to,ptr,free_only,mailer_info,
aview);
***************
*** 1579,1585 ****
}

static int hdrproc_action (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1626,1632 ----
}

static int hdrproc_action (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1588,1593 ****
--- 1635,1641 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_text(&headers->action,ptr,free_only,hdr_charset);
}
***************
*** 1619,1625 ****
*/

static int hdrproc_expires (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 1667,1673 ----
*/

static int hdrproc_expires (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1628,1633 ****
--- 1676,1682 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
int ret_val = 0;

***************
*** 1661,1679 ****
/* verify the number of days is valid and in range */
days = string_to_long(*ptr,&fail_pos);
if (days < 1 || fail_pos >= 0) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuExpiresNotNumber,
! "Expiration must be specified as a number of days."));
ret_val = -1;
goto free_it;
}

if (days > 8*7) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuExpiresOutOfRange,
! "Expiration date must be within eight weeks of today."));
ret_val = -1;
goto free_it;
}
--- 1710,1728 ----
/* verify the number of days is valid and in range */
days = string_to_long(*ptr,&fail_pos);
if (days < 1 || fail_pos >= 0) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuExpiresNotNumber,
! "Expiration must be specified as a number of days."));
ret_val = -1;
goto free_it;
}

if (days > 8*7) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuExpiresOutOfRange,
! "Expiration date must be within eight weeks of today."));
ret_val = -1;
goto free_it;
}
***************
*** 1721,1728 ****
return text_to_expval(headers->priority,hdr_charset);
}

! static int hdrproc_priority (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 1770,1777 ----
return text_to_expval(headers->priority,hdr_charset);
}

! static int hdrproc_priority(h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1731,1736 ****
--- 1780,1786 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_text(&headers->priority,ptr,free_only,hdr_charset);
}
***************
*** 1763,1769 ****
*/

static int hdrproc_precedence(h,headers,ptr,free_only,mailer_info,
! hdr_charset,aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 1813,1819 ----
*/

static int hdrproc_precedence(h,headers,ptr,free_only,mailer_info,
! hdr_charset,aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1772,1777 ****
--- 1822,1828 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
int ret_val = 0;

***************
*** 1840,1849 ****

/* see if we reached the end of the list without a match */
if (prec == NULL) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPrecedenceBadValue,
! "Unknown precedence value specified."));
ret_val = -1;
free_string(&X);
free(buf);
--- 1891,1900 ----

/* see if we reached the end of the list without a match */
if (prec == NULL) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPrecedenceBadValue,
! "Unknown precedence value specified."));
ret_val = -1;
free_string(&X);
free(buf);
***************
*** 1904,1911 ****
add_ascii_to_string(m,s2us(headers->in_reply_to.id));

if (headers->in_reply_to.text) {

! switch (phrase_display_mode) {
int X;
struct string * temp;

--- 1955,1963 ----
add_ascii_to_string(m,s2us(headers->in_reply_to.id));

if (headers->in_reply_to.text) {
+ int pd = give_dt_enumerate_as_int(&phrase_display_mode);

! switch (pd) {
int X;
struct string * temp;

***************
*** 1943,1949 ****
}

static int hdrproc_in_reply_to (h,headers,ptr,free_only,mailer_info,
! hdr_charset,aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 1995,2001 ----
}

static int hdrproc_in_reply_to (h,headers,ptr,free_only,mailer_info,
! hdr_charset,aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1952,1957 ****
--- 2004,2010 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
int ret_val = 0;

***************
*** 1981,1991 ****
}

if (!p1) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuMissAngle,
! "Missing > after < on in-reply-to header."));
!
ret_val = -1;
goto free_it;
}
--- 2034,2044 ----
}

if (!p1) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuMissAngle,
! "Missing > after < on in-reply-to header."));
!
ret_val = -1;
goto free_it;
}
***************
*** 2015,2024 ****
if (p < Xl) {

if (!add_irt_phrase)
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPhraseIRT,
! "In-reply-to header should include only message-id"));

headers->in_reply_to.text = clip_from_string(*ptr,&p,Xl);
}
--- 2068,2077 ----
if (p < Xl) {

if (!add_irt_phrase)
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPhraseIRT,
! "In-reply-to header should include only message-id"));

headers->in_reply_to.text = clip_from_string(*ptr,&p,Xl);
}
***************
*** 2067,2073 ****
*/

static int hdrproc_userhdr(h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 2120,2126 ----
*/

static int hdrproc_userhdr(h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 2076,2081 ****
--- 2129,2135 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
int ret_val = 0;

***************
*** 2125,2134 ****

if (!isascii(utf8_value[0]) &&
!isalnum(utf8_value[0])) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuUserdefNotAlnum,
! "The user-defined header must begin with a letter or number."));
ret_val = -1;

free(utf8_value);
--- 2179,2188 ----

if (!isascii(utf8_value[0]) &&
!isalnum(utf8_value[0])) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuUserdefNotAlnum,
! "The user-defined header must begin with a letter or number."));
ret_val = -1;

free(utf8_value);
***************
*** 2145,2154 ****

/* there needs to be a colon at the end of the header name */
if (*s != ':') {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuUserdefMissingColon,
! "The user-defined header must have a colon after the field name."));
ret_val = -1;

free(utf8_value);
--- 2199,2208 ----

/* there needs to be a colon at the end of the header name */
if (*s != ':') {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuUserdefMissingColon,
! "The user-defined header must have a colon after the field name."));
ret_val = -1;

free(utf8_value);
Index: elm2.4.ME+.122-cvs/src/help.c
*** elm2.4.ME+.121/src/help.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/help.c 2005-04-23 23:06:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.22 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.27 2005/04/23 20:06:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 24,32 ****



static int display_file P_((char *file));

! void help(pager_help,page)
int pager_help;
struct menu_context *page;
{
/** Process the request for help [section] from the user.
If pager_help is TRUE, then act a little differently from

--- 24,33 ----



static int display_file P_((char *file));

! void help(pager_help,page, prompt_area)
int pager_help;
struct menu_context *page;
+ struct menu_context *prompt_area;


{
/** Process the request for help [section] from the user.
If pager_help is TRUE, then act a little differently from

***************
*** 38,43 ****
--- 39,45 ----


int ch; /* character buffer for input */

char *s; /* string pointer... */
int prompt_line, info_line;


+ int delay_redraw = 0;

static char *unknown_command = NULL;
int LINES, COLUMNS;
***************
*** 52,94 ****
"Unknown command. Use '?' for a list of commands.");
}

! MoveCursor(LINES-5,0);
! CleartoEOS();

if(pager_help) {
- put_border(page);
print_format_center(LINES-1,
CATGETS(elm_msg_cat, ElmSet, ElmHelpMessage,
"Press the key you want help for, '?' for a key list, or '.' to exit help"));
! prompt_line = LINES-4;
} else {
! print_format_center(LINES-5,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpSystem,
! "ELM Help System"));
! print_format_center(LINES-4,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpMessage,
! "Press the key you want help for, '?' for a key list, or '.' to exit help"));
! prompt_line = LINES-3;
}
info_line = prompt_line + 1;

do {
! PutLineX(prompt_line, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpPrompt,
! "Help for key: "));



! ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR

|READCH_sig_char);



if (ch == REDRAW_MARK) {
! menu_trigger_redraw(page);
! return;
}

if (ch == '.')
! return;

if (ch == TERMCH_interrupt_char)
! return;

s = unknown_command;

--- 54,103 ----
"Unknown command. Use '?' for a list of commands.");
}

! redraw:
! menu_ClearScreen(prompt_area);

if(pager_help) {
print_format_center(LINES-1,
CATGETS(elm_msg_cat, ElmSet, ElmHelpMessage,
"Press the key you want help for, '?' for a key list, or '.' to exit help"));
! prompt_line = 0;
} else {
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpSystem,
! "ELM Help System"));
! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpMessage,
! "Press the key you want help for, '?' for a key list, or '.' to exit help"));
! prompt_line = 2;
}
info_line = prompt_line + 1;

do {
! menu_PutLineX(prompt_area,
! prompt_line, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpPrompt,
! "Help for key: "));

! ch = menu_ReadCh(prompt_area,REDRAW_MARK|READCH_CURSOR
|READCH_sig_char);

if (ch == REDRAW_MARK) {
! menu_ClearScreen(page); /* clear possible redraw mark */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! delay_redraw++;
!

! /* This clear redraw mark from prompt_area */
! goto redraw;
}


if (ch == '.')

! break;

if (ch == TERMCH_interrupt_char)
! break;

s = unknown_command;

***************
*** 201,211 ****
break;

#ifdef ALLOW_MAILBOX_EDITING
! case 'e': if (user_level < 2)
! break;
! if(!pager_help) s = catgets(elm_msg_cat, ElmSet, ElmHelpEditor,
"e = Invoke the editor on the entire folder, resynchronizing when done.");
! break;
#endif

case 'f': s = catgets(elm_msg_cat, ElmSet, ElmHelpForward,
--- 210,224 ----
break;

#ifdef ALLOW_MAILBOX_EDITING
! case 'e': {


! int ul = give_dt_enumerate_as_int(&user_level);

!
! if (ul < 2)
! break;
! if(!pager_help) s = catgets(elm_msg_cat, ElmSet, ElmHelpEditor,
"e = Invoke the editor on the entire folder, resynchronizing when done.");
! }
! break;
#endif

case 'f': s = catgets(elm_msg_cat, ElmSet, ElmHelpForward,
***************
*** 371,381 ****
"<number> = Make specified number the current message.");
}

! ClearLine(info_line);
! Centerline(info_line, s, page);



} while (ch != '.');
!
return;
}

--- 384,398 ----
"<number> = Make specified number the current message.");
}

! menu_ClearLine(prompt_area,info_line);
! Centerline(info_line, s, prompt_area);



} while (ch != '.');

!
! if (delay_redraw)
! menu_trigger_redraw(page);
!

! menu_trigger_redraw(prompt_area);
return;
}

***************
*** 407,412 ****
--- 424,430 ----



struct menu_context *page = NULL;

int LINES, COLUMNS;
+ long oldpos = 0;

if (err) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmHelpCouldntOpenFile,
***************
*** 427,432 ****

--- 445,451 ----



page = new_menu_context();

+ redraw:
menu_ClearScreen(page);

menu_get_sizes(page,&LINES, &COLUMNS);
***************

*** 434,444 ****


while (fgets(buffer, SLEN, fileptr) != NULL) {
if (lines > LINES-4) {

int X;


! PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,

! ElmHelpPressSpaceToContinue,
! "Press <space> to continue, 'q' to return."));


! X = menu_ReadCh(page,READCH_sig_char);
if(X == 'q' || X == 'Q' ||
X == TERMCH_interrupt_char) {
clear_error();

--- 453,463 ----


while (fgets(buffer, SLEN, fileptr) != NULL) {
if (lines > LINES-4) {

int X;
! menu_PutLineX(page,LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHelpPressSpaceToContinue,
! "Press <space> to continue, 'q' to return."));


! X = menu_ReadCh(page,READCH_sig_char|REDRAW_MARK);
if(X == 'q' || X == 'Q' ||
X == TERMCH_interrupt_char) {
clear_error();

***************
*** 446,453 ****
--- 465,480 ----



goto OUT;
}
+
+ if (REDRAW_MARK == X) {
+ fseek(fileptr,oldpos,SEEK_SET);
+ lines = 0;
+ goto redraw;
+ }
+
lines = 0;
menu_ClearScreen(page);
+ oldpos = ftell(fileptr);
Write_to_screen(FRM("%s\r"), buffer);
}
else
***************
*** 460,467 ****
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressAnyKeyToReturn,
"Press any key to return."));

! (void) menu_ReadCh(page,0);
clear_error();

fclose(fileptr);

--- 487,501 ----


CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressAnyKeyToReturn,
"Press any key to return."));
+ {
+ int X = menu_ReadCh(page,REDRAW_MARK);
+ if (X == REDRAW_MARK) {
+ fseek(fileptr,oldpos,SEEK_SET);
+ lines = 0;
+ goto redraw;
+ }

! }
clear_error();

fclose(fileptr);

Index: elm2.4.ME+.122-cvs/src/init.c
*** elm2.4.ME+.121/src/init.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/init.c 2005-07-01 20:25:29.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: init.c,v 1.52 2004/07/10 18:55:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: init.c,v 1.61 2005/07/01 17:25:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 43,75 ****

extern char version_buff[];

- char *error_description();
-
- #ifndef I_UNISTD
- char *getlogin();
- unsigned short getgid(), getuid();

- struct passwd *getpwuid();
- #endif

-
- char *get_full_name();
-
SIGHAND_TYPE
#ifdef SIGTSTP
! sig_user_stop(), sig_return_from_user_stop(),
#endif
#ifdef SIGWINCH
! winch_signal(),
#endif
! quit_signal(), term_signal(), ill_signal(),
! fpe_signal(), segv_signal(),
#ifdef SIGBUS
! bus_signal(),
#endif
! alarm_signal(), pipe_signal(), hup_signal(),
! usr1_signal(), usr2_signal() ;

- extern void init_opts_menu();
- extern void malloc_failed_exit();

static struct folder_info *arg_to_folder P_((char * arg, int prompt,
struct AliasView *aview,
--- 43,63 ----

extern char version_buff[];

SIGHAND_TYPE
#ifdef SIGTSTP
! sig_user_stop P_((int)), sig_return_from_user_stop P_((int)),
#endif
#ifdef SIGWINCH
! winch_signal P_((int)),
#endif
! quit_signal P_((int)), term_signal P_((int)), ill_signal P_((int)),
! fpe_signal P_((int)), segv_signal P_((int)),
#ifdef SIGBUS
! bus_signal P_((int)),
#endif
! alarm_signal P_((int)), pipe_signal P_((int)), hup_signal P_((int)),
! usr1_signal P_((int)), usr2_signal P_((int)) ;


static struct folder_info *arg_to_folder P_((char * arg, int prompt,
struct AliasView *aview,
***************
*** 88,94 ****
struct folder_browser * XXX = new_browser(selection_folder);
struct string * buffer = new_string2(local_fs_charset,
s2us(arg));
- int redraw = 0;

if (!browser_expand(XXX,&buffer,NULL,aview)) {
if (!prompt)
--- 76,81 ----
***************
*** 97,103 ****
if (with_title)
with_title = "";

! gen_browser(page, XXX,&buffer,&redraw,word_change,NULL,
aview,
CATGETS(elm_msg_cat, ElmSet,
ElmSelectFolder,
--- 84,90 ----
if (with_title)
with_title = "";

! gen_browser(page, XXX,&buffer,word_change,NULL,
aview,
CATGETS(elm_msg_cat, ElmSet,
ElmSelectFolder,
***************
*** 126,148 ****
}

cleanup:
! free_string(&buffer);
free_dir(&XXX);

return folder;
}

! void initialize(requestedmfiles, main_mailbox, main_aliases, header_page,
page)
- char **requestedmfiles; /* first mail files to open, empty if the default */
- struct MailboxView **main_mailbox;
struct AliasView **main_aliases;
- int *header_page;
struct menu_context **page;
{
int init_scr_return;
- struct folder_info *folder = NULL;
- int several_folders = 0;



char buffer[SLEN], *cp;

--- 113,133 ----
}

cleanup:
! if (buffer)
! free_string(&buffer);
!
free_dir(&XXX);

return folder;
}

! void initialize(main_aliases,
page)
struct AliasView **main_aliases;
struct menu_context **page;
{
+
int init_scr_return;


char buffer[SLEN], *cp;

***************
*** 287,298 ****
--- 272,285 ----
init_backgroud_handling();
#endif

+ init_mailerlib();



/* Determine options that might be set in the global elmrc */

if (init_defaults() != 0) {
sleep(1);
}

+
/* Determine options that might be set in the .elm/elmrc */
if (read_rc_file(0) != 0) {
sleep(1);
***************
*** 511,516 ****
--- 498,505 ----
menu_ClearScreen(*page);
}

+ init_system_charset();
+

if (-1 != wanted_switchmode)
allow_charset_switching = wanted_switchmode;

***************
*** 568,713 ****

post_process_charset_options();

- if (! mail_only) {


- int LINES, COLUMNS;
-

- menu_get_sizes(*page,&LINES, &COLUMNS);
-
- if (mini_menu)
- headers_per_page = LINES - 14;
- else
- headers_per_page = LINES - 9; /* 5 more headers! */
-
- if (headers_per_page <= 0) {
- erase_menu_context(page);
-
- Raw(OFF);
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWindowSizeTooSmall,
- "The window is too small to run Elm. It must have at least %d rows"),
- LINES - headers_per_page);


- error_wait(); /* Be sure that we do not exit before error is shown */


! exit(1);
! }

! /* Determine the mail file to read */
! if (!requestedmfiles || ! requestedmfiles[0]) {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val)
! folder = enter_new_folder(default_val);
! else
! folder = NULL;
! } else {
! /* Assuming that file name given with -f is on
! local-fs-charset and not system_charset
! */

! if (requestedmfiles[1])
! several_folders++;

! folder = arg_to_folder(requestedmfiles[0], !several_folders,
! *main_aliases, *page);
}
! if (!folder) {
! erase_menu_context(page);

! Raw_OFF(1); /* Raw(OFF) and reprint error message */
! #ifdef REMOTE_MBX
! close_cached_connections();
! #endif
! exit(0);
}

! if (check_size)
! if(check_mailfile_size(folder) != 0) {
! erase_menu_context(page);
!
! close_folder(folder,CLOSE_NORMAL);
! Raw_OFF(1); /* Raw(OFF) and reprint error message */
!
! #ifdef REMOTE_MBX
! close_cached_connections();
! #endif
!
! exit(0);
! }
!
! if (with_title)
! set_folder_window_title(folder,
! with_title[0] ? with_title : wanted_title_string,
! wanted_icon_string);
! else if (set_window_title)
! set_folder_window_title(folder,
! wanted_title_string,
! wanted_icon_string);
!
! /* read in the folder! */
! newmbox_1(folder, FALSE, main_mailbox, FALSE, header_page,
! *page);

! if (several_folders) {
! int i;
!
! if (wanted_mailbox_title) {
! /* must not fred -- shared/stored to structure
! -- set_mailbox_title will free_string()
! it later */
! set_mailbox_title(*main_mailbox,
! new_string2(system_charset,
! s2us(wanted_mailbox_title)));
! }

! /* Index 0 is already processed! */
! for (i = 1; requestedmfiles[i]; i++) {


! struct folder_info *folder =

! arg_to_folder(requestedmfiles[i],FALSE,*main_aliases,
! *page);
!
! if (folder) {
! newmbox_1(folder, FALSE, main_mailbox,TRUE,
! header_page, *page);

! }

! }
! }




}

! /** fix the shell if needed **/

! if (shell[0] != '/') {

! elm_sfprintf(buffer, sizeof buffer,
! FRM("/bin/%s"),
! shell);
! strfcpy(shell, buffer, sizeof shell);
}


- #ifdef DEBUG
- if (Debug.active >= 2 && Debug.active < 10) {
- debug_action_call(&Debug,
- "hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
- hostname, username, full_username);
- debug_action_call(&Debug,
- "home = %-20s \n",
- home);

! debug_action_call(&Debug,
! "folders = %-20s \tprintout = %-20s\n",
! folders, printout);
!
! debug_action_call(&Debug,
! " \tprefix = %-20s \tshell = %-20s\n\n",
! prefixchars, shell);
! }
! #endif
}

-

/*
* Local Variables:
* mode:c

--- 557,720 ----

post_process_charset_options();


+ #ifdef DEBUG
+ if (Debug.active >= 2 && Debug.active < 10) {
+ debug_action_call(&Debug,
+ "hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
+ hostname, username, full_username);
+ debug_action_call(&Debug,
+ "home = %-20s \n",
+ home);

! debug_action_call(&Debug,
! "printout = %-20s\n",
! printout);
!
! debug_action_call(&Debug,
! " \tprefix = %-20s \t\n\n",
! prefixchars);
! }
! #endif
! }

! struct MailboxView * initialize_mailbox(requestedmfiles,
! page, main_aliases,
! check_mode)
! char **requestedmfiles; /* first mail files to open, empty if the default */
!
! struct menu_context *page;
! struct AliasView *main_aliases;
! enum check_mode check_mode;
! {
! struct MailboxView *main_mailbox = NULL;
! struct folder_info *folder = NULL;
! int several_folders = 0;

!
! /* Determine the mail file to read */
! if (!requestedmfiles || ! requestedmfiles[0]) {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,
! "incoming-mailbox");
!
! if (default_val)
! folder = enter_new_folder(default_val);
! else
! folder = NULL;
! } else {
! /* Assuming that file name given with -f is on
! local-fs-charset and not system_charset
! */
!
! if (requestedmfiles[1])
! several_folders++;
!
! folder = arg_to_folder(requestedmfiles[0], !several_folders,
! main_aliases, page);
! }

! if (!folder && !several_folders) {


! return NULL;
! }
!

! if (folder) {
! if (chk_size == check_mode && !several_folders) {
! if(check_mailfile_size(folder) != 0) {
!
! leave_old_folder(&folder,CLOSE_NORMAL);
!
! return NULL; /* FIXME -- not completely correct */
}
! }
!
! if (with_title)
! set_folder_window_title(folder,
! with_title[0] ? with_title : wanted_title_string,
! wanted_icon_string);
! else if (set_window_title)
! set_folder_window_title(folder,
! wanted_title_string,
! wanted_icon_string);
!
! /* read in the folder! */
! newmbox_1(folder, FALSE, &main_mailbox, FALSE,
! page);
! }

! if (several_folders) {
! int i;
!
! if (wanted_mailbox_title) {
! /* must not fred -- shared/stored to structure
! -- set_mailbox_title will free_string()
! it later */
! set_mailbox_title(main_mailbox,
! new_string2(system_charset,
! s2us(wanted_mailbox_title)));
! }
!
! /* Index 0 is already processed! */
! for (i = 1; requestedmfiles[i]; i++) {


! struct folder_info *folder =

! arg_to_folder(requestedmfiles[i],FALSE,main_aliases,
! page);
!
! if (folder) {
! newmbox_1(folder, FALSE, &main_mailbox,
! main_mailbox ? TRUE : FALSE,
! page);
!
}
+ }
+ }
+
+ if (chk_size == check_mode ||
+ chk_unread == check_mode) {
+ int mc = get_message_count(main_mailbox);

! if (0 == mc) {

! /* This also free's folder */
! free_mailbox(& main_mailbox);

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMail,
! "You have no mail."));
!

! return NULL;
! }
! }

! if (chk_unread == check_mode) {
! int i;
! int unread = 0;
! int mc = get_message_count(main_mailbox);

!

+ for (i = 0; i < mc; i++) {
+ struct header_rec * hdr = give_header(main_mailbox,i);

+ if (hdr &&
+ ison(hdr->status, UNREAD))
+ unread++;
}

! if (!unread) {
! /* This also free's folder */
! free_mailbox(& main_mailbox);

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoUnreadMail,
! "You have no unread mail."));
!
! return NULL;
}

+ }


! return main_mailbox;


}

/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.122-cvs/src/in_utils.c
*** elm2.4.ME+.121/src/in_utils.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/in_utils.c 2005-06-18 00:02:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.41 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.50 2005/06/17 21:02:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 41,47 ****

extern int tabspacing;

! unsigned alarm();

#define erase_a_char() { Writechar(BACKSPACE); Writechar(' '); \
Writechar(BACKSPACE); FlushBuffer(); }
--- 41,47 ----

extern int tabspacing;

!

#define erase_a_char() { Writechar(BACKSPACE); Writechar(' '); \
Writechar(BACKSPACE); FlushBuffer(); }
***************
*** 99,109 ****
}


! MoveCursor(line, (center || (cols < 2)) ? 0 : cols-2);
! CleartoEOLN();

! PutLineX(line, center ? cols/2 : cols,
! FRM("%S%c%c"), question, def, BACKSPACE);
FlushBuffer();

ch = menu_ReadCh(page, REDRAW_MARK
--- 99,109 ----
}


! menu_MoveCursor(page,line, (center || (cols < 2)) ? 0 : cols-2);
! menu_CleartoEOLN(page);

! menu_PutLineX(page,line, center ? cols/2 : cols,
! FRM("%S%c%c"), question, def, BACKSPACE);
FlushBuffer();

ch = menu_ReadCh(page, REDRAW_MARK
***************
*** 128,134 ****
for (x = letters; *x; x++) {

if (ch == *x) {
! Writechar(ch);
goto out;
}
}
--- 128,134 ----
for (x = letters; *x; x++) {

if (ch == *x) {
! menu_Writechar(page,ch);
goto out;
}
}
***************
*** 145,164 ****
for (x = letters; *x; x++) {

if (ch == *x) {
! Writechar(ch);
goto out;
}
}

if(ch == *def_ans_yes && yesno) {


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));

break;
} else if (ch == *def_ans_no && yesno) {


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));

break;
}

! Writechar('?');
FlushBuffer();
#if POLL_METHOD
wait_for_timeout(1);
--- 145,166 ----
for (x = letters; *x; x++) {

if (ch == *x) {
! menu_Writechar(page,ch);
goto out;
}
}

if(ch == *def_ans_yes && yesno) {
! menu_Write_to_screen(page,CATGETS(elm_msg_cat, ElmSet,
! ElmYesWord, "Yes."));
break;
} else if (ch == *def_ans_no && yesno) {
! menu_Write_to_screen(page,CATGETS(elm_msg_cat, ElmSet,
! ElmNoWord, "No."));
break;
}

! menu_Writechar(page,'?');
FlushBuffer();
#if POLL_METHOD
wait_for_timeout(1);
***************
*** 171,176 ****
--- 173,180 ----



out:
FlushBuffer();
+ free_string(&question);
+

if (EOF != ch && REDRAW_MARK != ch && ('L'&31) != ch &&
TERMCH_interrupt_char != ch) {
***************

*** 181,188 ****


sleep((sleepmsg + 1) / 2);

#endif
}
! MoveCursor(line, (center || (cols < 2)) ? 0 : cols-2);
! CleartoEOLN();
}

return ch;
--- 185,192 ----


sleep((sleepmsg + 1) / 2);

#endif
}
! menu_MoveCursor(page,line, (center || (cols < 2)) ? 0 : cols-2);
! menu_CleartoEOLN(page);
}

return ch;
***************
*** 202,208 ****
**/
int ch, cols;
int LINES, COLUMNS;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

--- 206,213 ----
**/
int ch, cols;
int LINES, COLUMNS;
! int redraw1 = 0;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 214,229 ****
DPRINT(Debug,3, (&Debug,"want_to: pos line=%d column=%d\n",
where, (clear_and_center || (cols < 2)) ? 0 : cols-2));

! MoveCursor(where, (clear_and_center || (cols < 2)) ? 0 : cols-2);
! CleartoEOLN();
!
! PutLineX(where, clear_and_center ? cols/2 : cols,
! FRM("%s%c%c"), question, dflt, BACKSPACE);
FlushBuffer();

ch = menu_ReadCh(page, REDRAW_MARK);


! if (ch == REDRAW_MARK)

! goto redraw;
if (ch == EOF) {
leave(0);
}
--- 219,243 ----
DPRINT(Debug,3, (&Debug,"want_to: pos line=%d column=%d\n",
where, (clear_and_center || (cols < 2)) ? 0 : cols-2));

! menu_MoveCursor(page,
! where, (clear_and_center || (cols < 2)) ? 0 : cols-2);
! menu_CleartoEOLN(page);
!
! menu_PutLineX(page,
! where, clear_and_center ? cols/2 : cols,
! FRM("%s%c%c"), question, dflt, BACKSPACE);
FlushBuffer();

ch = menu_ReadCh(page, REDRAW_MARK);
! if (ch == REDRAW_MARK) {


! menu_ClearScreen(page); /* Clear possible redraw mark */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! redraw1++;
! goto redraw;
! }
if (ch == EOF) {
leave(0);
}
***************
*** 231,238 ****

while (!( ch == *def_ans_yes || ch == *def_ans_no || ch == '\n' || ch == '\r')) {
ch = menu_ReadCh(page,REDRAW_MARK);
! if (ch == REDRAW_MARK)
goto redraw;
if (ch == EOF) {


leave(0); /* ???? global reference */
}

--- 245,259 ----

while (!( ch == *def_ans_yes || ch == *def_ans_no || ch == '\n' || ch == '\r')) {
ch = menu_ReadCh(page,REDRAW_MARK);
! if (ch == REDRAW_MARK) {


! menu_ClearScreen(page); /* Clear possible redraw mark */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! redraw1++;
goto redraw;
+ }
if (ch == EOF) {


leave(0); /* ???? global reference */
}

***************
*** 245,253 ****
ch = dflt;

if(ch == *def_ans_yes)


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));

else if (ch == *def_ans_no)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
else {
DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
return(ch); /* Don't write anything, just return */
--- 266,278 ----
ch = dflt;

if(ch == *def_ans_yes)
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
! "Yes."));
else if (ch == *def_ans_no)
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
else {
DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
return(ch); /* Don't write anything, just return */
***************
*** 260,277 ****


sleep((sleepmsg + 1) / 2);

#endif
}
! MoveCursor(where, (clear_and_center || (cols < 2)) ? 0 : cols-2);
! CleartoEOLN();

DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));


return(ch);
}

! int read_number(ch, item, current, page)
int ch;
CONST struct string *item;

int current;
struct menu_context *page;
{
/** Read a number, where 'ch' is the leading digit! **/

--- 285,307 ----


sleep((sleepmsg + 1) / 2);

#endif
}
! menu_MoveCursor(page,where,
! (clear_and_center || (cols < 2)) ? 0 : cols-2);
! menu_CleartoEOLN(page);
!
! if (redraw1)
! menu_trigger_redraw(page);

DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
return(ch);
}

! int read_number(ch, item, current, page,prompt_area)


int ch;
CONST struct string *item;

int current;
struct menu_context *page;
+ struct menu_context *prompt_area;


{
/** Read a number, where 'ch' is the leading digit! **/

***************

*** 283,297 ****



int need_redraw = 0;
int num, status;

! int bad;
! int LINES, COLUMNS;
fill_ascii_to_string(buff,1,ch);

redraw:
! menu_get_sizes(page,&LINES, &COLUMNS);



status = optionally_enter2(page,
! &buff, LINES-4, COLUMNS-40,
OE_APPEND_CURRENT|OE_REDRAW_MARK|

OE_SIG_CHAR /* allow Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
--- 313,329 ----



int need_redraw = 0;
int num, status;

! int bad, li,co, line;
!
fill_ascii_to_string(buff,1,ch);
+ menu_get_sizes(page,&li, &co);

redraw:
! /* FIXME --optionally_enter* should use prompt_page */
! line = menu_GetAbsLine(prompt_area,0);

status = optionally_enter2(page,
! &buff, line, co-40,
OE_APPEND_CURRENT|OE_REDRAW_MARK|
OE_SIG_CHAR /* allow Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
***************
*** 301,306 ****
--- 333,340 ----
if (status == -1) /* Ctrl-C */
return(current);
if (status == REDRAW_MARK) {


+ menu_ClearScreen(page); /* Reset possible redraw flag */

+

/* Can not set menu_trigger_redraw here or causes
redraw loop ... */

need_redraw = 1;


***************
*** 310,327 ****
if (need_redraw)
menu_trigger_redraw(page);

! if (0 == string_len(buff))
return current;

num = string_to_long(buff,&bad);

!


if (bad >= 0)
return current;
-
-
-
return(num);
}

--- 344,360 ----


if (need_redraw)
menu_trigger_redraw(page);

! if (0 == string_len(buff)) {
! free_string(&buff);
return current;
+ }

num = string_to_long(buff,&bad);

! free_string(&buff);



if (bad >= 0)
return current;
return(num);
}

***************
*** 390,398 ****

if (info->current_page != base_page) {

- resize = READCH_resize;
-
if (menu_resized(info->current_page)) {

if (info->ch_count == 0)
buffer = info->give_buffer(info,em_redraw_initial,
--- 423,432 ----

if (info->current_page != base_page) {

if (menu_resized(info->current_page)) {
+
+
+ menu_get_sizes(info->current_page, &LINES, &COLUMNS);

if (info->ch_count == 0)
buffer = info->give_buffer(info,em_redraw_initial,
***************
*** 403,408 ****
--- 437,445 ----

} else if (menu_need_redraw(info->current_page)) {

+ internal_redraw:
+
+ menu_ClearScreen(info->current_page); /* Reset redraw flag */
if (info->ch_count == 0)
buffer = info->give_buffer(info,em_redraw_initial,
base_page);
***************
*** 442,447 ****
--- 479,489 ----
goto resize_mark;

case REDRAW_MARK:
+ if (info->current_page != base_page) {
+ DPRINT(Debug,4, (&Debug," ... redrawing\n"));
+ goto internal_redraw;
+ }
+
ret = REDRAW_MARK;
goto out;
case TERMCH_eof_char:
***************
*** 697,704 ****
0x0009 /* HT */ != c)
goto other;

! GetXYLocation(&x1, &y1);
! StartBold();
while (ok) {

if (idx > 78) {
--- 739,746 ----
0x0009 /* HT */ != c)
goto other;

! menu_GetXYLocation(info->current_page,&x1, &y1);
! menu_StartXX(info->current_page,pg_BOLD);
while (ok) {

if (idx > 78) {
***************
*** 706,712 ****
break;
}
raw_data[idx++] = raw;
! Writechar(raw);



ch = menu_ReadCh2(info->current_page,
redraw|READCH_CURSOR|

--- 748,754 ----
break;
}
raw_data[idx++] = raw;
! menu_Writechar(info->current_page,raw);



ch = menu_ReadCh2(info->current_page,
redraw|READCH_CURSOR|

***************
*** 742,750 ****
break;
}
}
! EndBold();
! MoveCursor(x1,y1);
! CleartoEOLN();
raw_data[idx] = '\0';

DPRINT(Debug,4,(&Debug,
--- 784,792 ----
break;
}
}
! menu_EndXX(info->current_page,pg_BOLD);
! menu_MoveCursor(info->current_page,x1,y1);
! menu_CleartoEOLN(info->current_page);
raw_data[idx] = '\0';

DPRINT(Debug,4,(&Debug,
***************
*** 938,951 ****
out:

if (base_page != info->current_page) {
- erase_menu_context(& info->current_page);

DPRINT(Debug,9,(&Debug,
"enter_helper: erasing menu_context created by give_buffer()\n"));
!
info->current_page = base_page;
}

DPRINT(Debug,9,(&Debug,
"enter_helper=%d (returns)\n",ret));
return ret;
--- 980,997 ----
out:

if (base_page != info->current_page) {

+ erase_menu_context(& info->current_page);
+
DPRINT(Debug,9,(&Debug,
"enter_helper: erasing menu_context created by give_buffer()\n"));
!
info->current_page = base_page;
+
+ menu_trigger_redraw(base_page);
}

+
DPRINT(Debug,9,(&Debug,
"enter_helper=%d (returns)\n",ret));
return ret;
***************
*** 1176,1269 ****
return(ret);
}

- int pattern_enter(string, alt_string, x, y, alternate_prompt,
- prompt, redraw, page)
- struct string **string, **alt_string;
- struct string *alternate_prompt, *prompt;
- int x,y;
- int *redraw;


- struct menu_context *page;
- {

- /** This function is functionally similar to the routine
- optionally-enter, but if the first character pressed
- is a '/' character, then the alternate prompt and string
- are used rather than the normal one. This routine
- returns 1 if alternate was used, 0 if not
-
- returns -1 on failure (EOF*)
- **/
-
- struct string *vector[2];
- struct enter_info INFO;
- int mode = 0;
- int ret;
-
- if(!(x >=0 && y >= 0))
- GetXYLocation(&x, &y);
-
- vector[0] = prompt;
- vector[1] = *string;
-
- INFO.counter = 0;
- INFO.pvector = vector;
- INFO.px = x;
- INFO.py = y;
- INFO.give_buffer = gb_optionally_enter;
- INFO.flags = OE_ALT_SOLIDUS|OE_REDRAW_MARK;
- INFO.ch_count = 0;
- INFO.builtin = NULL;
- INFO.current_page = page;
- INFO.dir_p = NULL;
-
-
- again:
- switch(mode) {
- case 0:
- vector[0] = prompt;
- vector[1] = *string;
- break;
- case 1:
- vector[0] = alternate_prompt;
- vector[1] = *alt_string;
- break;
- }
-
- MoveCursor(x,y);
- CleartoEOLN();
-
- ret = enter_helper(&INFO, page);
-
- switch(mode) {
- case 0:
- *string = vector[1];
- break;
- case 1:
- *alt_string = vector[1];

- break;
- }
-
-

- switch(ret) {
- case REDRAW_MARK:
- *redraw = REDRAW_MARK;
- INFO.flags |= OE_APPEND_CURRENT;
-
- goto again;
- case 0: /* OK */
- return mode;
- case OE_ALT_SOLIDUS:
- mode = !mode; /* TOGGLE mode */
- goto again;
- case -1: /* Interrupt */
-
- if (*string)
- free_string(string);


- return 0;
- }
-

- return -1;
- }
-

int GetPrompt(page)
struct menu_context *page;
{

--- 1222,1227 ----
Index: elm2.4.ME+.122-cvs/src/leavembox.c
*** elm2.4.ME+.121/src/leavembox.c 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.122-cvs/src/leavembox.c 2005-06-18 00:02:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.50 2004/08/16 10:40:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.52 2005/06/17 21:02:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 38,45 ****
extern int errno;
#endif

- char *error_description();
-
static void block_signals P_((void));
static void unblock_signals P_((void));

--- 38,43 ----
***************
*** 330,340 ****


int leave_mbox(resyncing, quitting, prompt, new_folder, mailbox,
! header_page, page)
int resyncing, quitting, prompt;
struct folder_info **new_folder;
struct MailboxView *mailbox;
- int *header_page;
struct menu_context *page;
{
/** Close folder, deleting some messages, storing others in mbox,
--- 328,337 ----


int leave_mbox(resyncing, quitting, prompt, new_folder, mailbox,
! page)
int resyncing, quitting, prompt;
struct folder_info **new_folder;


struct MailboxView *mailbox;
struct menu_context *page;
{

/** Close folder, deleting some messages, storing others in mbox,
Index: elm2.4.ME+.122-cvs/src/limit.c

Kari E. Hurtta

unread,
Jul 13, 2005, 5:41:04 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.1

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 1/18
=========================================================================
NOTICE: You must create directory lib/mailer before applying this patch!

For applying thich patch use (on directory where Configure is)

mkdir lib/mailer
patch -p1 < {this-file}

Then check that removed files do not exists or are empty

ls -la `cat OBSOLETE `

If that lists non-empty files, patch failed.

Then remove emty files with command

rm `cat OBSOLETE `


Index: elm2.4.ME+.122-cvs/hdrs/patchlevel.h
Prereq: 1127000000
*** elm2.4.ME+.121/hdrs/patchlevel.h 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/patchlevel.h 2005-07-09 11:27:50.000000000 +0300
***************
*** 1,12 ****


! #define PATCHLEVEL "121 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.121
*/
! #define LAST_REPORT_TIME 1127000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"
! #define VERS_DATE "Sep, 2004" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Sep, 2004"

/*
* Local Variables:
--- 1,12 ----

! #define PATCHLEVEL "122 (25)"
/* Used by Configure:
! SHAREDTAG: .1.0.122
*/
! #define LAST_REPORT_TIME 1152000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

! #define VERS_DATE "Jul, 2005" /* for elm -v option */
#define WHAT_STRING \
! "@(#) Version 2.4(ME+), USENET supported version, released Jul, 2005"

/*
* Local Variables:
Index: elm2.4.ME+.122-cvs/README.ME+
*** elm2.4.ME+.121/README.ME+ 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/README.ME+ 2005-07-09 11:27:49.000000000 +0300
***************
*** 1,4 ****


! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.844 2004/09/22 17:37:08 hurtta Exp $

Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.993 2005/07/09 08:27:49 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
***************
*** 13,18 ****

--- 13,1075 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL122 (25) compared with Elm 2.4ME+ PL121 (25)
+ --------------------------------------------------------------------
+
+ Note: You must create directory
+ lib/mailer
+ before applying this patch!
+
+ WARNING: Quite lot of changes in many areas. So
+ please report new bugs which you observe...
+
+ * Some changes on screen handling:
+ - Moved title, menu and prompt area on mailbox,
+ aliases and attachment screens to own subpage.
+ - Changed layout of attachment screen more similar than
+ other screens.
+ - Removed redraw flag from main loop.
+ - Removed nufoot flag from main loop.
+ - Removed redraw flag from mailbox_command().
+ - Removed redraw flag from motion().
+ - Removed nufoot flag from mailbox_command().
+ - Removed nufoot flag from motion().
+ - Removed redraw flag from new_mail_check().
+ - Removed redraw flag from partial_loop().
+ - Removed nufoot flag from partial_loop().
+ - Removed redraw flag from digest_loop().
+ - Removed nufoot flag from digest_loop().
+ - Removed redraw flag from view_canceled_mails().
+ - Removed nufoot flag from view_canceled_mails().
+ - Removed redraw flag from alias().
+ - Removed nutitle flag from alias().
+ - Removed nufoot flag from alias().
+ - Changed passing of redraw data from remail().
+ - Removed redraw flag from remail().
+ - Changed passing of redraw data from forward().
+ - Changed passing of redraw data from reply_to_everyone().
+ - Removed redraw flag from reply_to_everyone().
+ - Changed passing of redraw data from send_msg_l()
+ and send_msg_middle().
+ - Changed passing of redraw data from reply().
+ - Removed redraw flag from reply().
+ - Changed passing of redraw data from mail_filled_in_form().
+ - Changed passing of redraw data from pgp_mail_public_key().
+ - Changed passing of redraw data from print_text().
+ - Changed passing of redraw data from save().
+ - Changed method how headers on aliases and mailbox
+ screen are drawn and updated.
+ - Removed inalias, last_current, last_header_page,
+ headers_per_page and nucurr global variables.
+ - One more mail is listed on mailbox screen.
+ - Removed passing of header_page variable.
+ - Changed method how screen is handled on 'after
+ paging' commands (showmsg_c).
+ - Removed/changed passing of redraw flag on file_browser(),
+ gen_browser() folder_browser(), attach_save()
+ - Changed passing of redraw data from name_copy_file().
+ - Changed handling of 'prompt area' on Mail Pre-Send Screen
+ and on Message Header Edit Screen screen.
+
+ - If several -f option is given (for combined view
+ of given folders), starting of Elm ME+ do not fail
+ if first folder is inaccessible.
+
+ - Handle REDRAW_MARK on pgp_encrypt()


+
+ - "If you had no aliases yet, and pushed j or k in the
+ aliases menu (or the down or up arrows), you had a
+ "bad item" "common menu panic". The reason was a
+ missing "break" statement in alias_item.c, which was
+ present in the approprite place in mailbox_item.c"
+ From: Kovacs Baldvin <bal...@cs.elte.hu>
+ ( Patch was agaist Elm ME+ 2.5 but applies also to Elm
+ 2.4ME+ )

+

+ - Fix error message
+ Path component "none" not absolute on key
+ "internal-mailcaps" value "none"
+ when on elmrc have line
+ internal-mailcaps = none
+

+ - Added elmrc option "pgp-encrypt-type", which take values
+ "application/pgp", "text/plain" and "text/x-pgp" (without
+ quotes). These are same values than for pgp-sign-type.
+ Except that this is for encryption. Because encrypted data
+ is ascii armored, also text -type can be used here.
+ Requested by: Axel Reinhold <ax...@freakout.de>
+
+ NOTE: Note that using text/plain for excrypted data causes
+ that charset=US-ASCII is used always (for type
+ application/pgp charset paramater is not added).
+ It is little guestionable is that correct. These
+ encrypted types do not interact very well with charsets
+ anyway.
+
+ - "MIME structure Menu" was draw incorrectly when arrow cursor
+ was used.
+ - "MIME structure Menu" screen's layout now resembles more
+ main mailbox screen.
+
+ - Handle some ambiguous multipart boundary prefixes.
+
+ - Ignore empty line before "begin " on uudecode.


+
+ - "I am seeing two exit messages if I start elm and exit right away
+ using ELM 2.4ME+ PL121"
+ Problem noted by: Bruce Momjian <ro...@candle.pha.pa.us>
+ - "On a Solaris 8 machine, if I enter ELM and don't make
+ any changes it now says "Folder unchanged." twice.
+ Not a big deal, but I thought I should report it. :-)"
+ Problem noted by: James Corey <plov...@yahoo.com>

+ > Make sure that first message is erased on exit (usually


+ ti/te erases screen or changes buffers, but that

+ apply to "elm -t" also.)
+
+ - Added elmrc option "prompt-metamail".
+ If set, also text
+ Parsing MIME structure... metamail not needed
+ is not printed after
+ Parsing MIME structure...
+ text, because opposite situation will be prompted!
+ - Setting "prompt-metamail" (default) causes
+ showing of "Metamail selection" screen. This is
+ same screen than "Mailcap program selection" screen.
+ Answering prompt with p)age command changes screen
+ to "Mailcap program selection" screen. Answering
+ proompt with m)etamail command calls metamail.
+
+ - Allow canceling of
+ Mailcap program selection
+ with Ctrl-C (interrupt character) on systems
+ which supports POSIX termios.
+
+ - Canceling of
+ Append to an existing file XXX ?
+ Append to mail folder XXX ?
+ Create a new file XXX ?
+ Create a new mail folder XXX ?
+ Some XXX are already tagged. Remove Tags?
+ One XXX is already tagged. Remove Tags?
+ Are you sure you want to remail this message ?
+ prompts with Ctrl-C (interrupt character) is possible
+ on systems which supports POSIX termios.
+
+ - Added to
+ Mailcap program selection
+ screen same title than on pager (on case when elmrc
+ option "titles" is set (default)).
+
+ - "First I did not even understand what I am asked
+ in the attach menu. I tried a .ps file, then I had
+ a question "Use gnome-gv to..." blabla, yes or no.
+ And down there I had "Answer questions, or m)etamail,
+ or q)uit". Now "quit" did not quit from aliases,
+ but instead it behaved as an "OK". Pushing 'm' worked,
+ but I did not know wether it utilized the answer that
+ I gave already, since it asked again (!) if I'd like
+ to use gnome-gv. "F?ck, I do", I thought... Then I've
+ realized what is going on: after I answered yes for
+ the first question, I need to say quit, and then I get
+ gnome-gv..."
+ Problem noted by: Kovacs Baldvin <bal...@cs.elte.hu>
+ > Changed q)uit command to d)one on
+ Mailcap program selection
+ screen.
+
+ - Letters 'q' and 'i' leaves now
+ Mailcap program selection
+ without paging message. Note that this changes
+ meaning of 'q' -command.
+
+ - Added O)verride charset and Ctrl-K (Mail PGP public key)
+ to 'after paging' (showmsg_c) commands.
+
+ - Added redraw handling to following prompts:
+ Already have selection criteria - add more?
+ Enter criteria or '?' for help:
+
+ - Fix valgrind reported memory leak:
+ 32 bytes in 2 blocks are definitely lost in loss record 6 of 28
+ at 0x400260DC: malloc (vg_replace_malloc.c:153)
+ by 0x8151DBF: safe_malloc (safemalloc.c:47)
+ by 0x8069EEE: attach_menu (attach_menu.c:2433)


+
+ - Add redraw handling to display_file()
+

+ - Fix "Reverse Thread" sorting order.
+

+ - Removed pattern_enter()
+
+ - Fix "Append to mail folder " -question.
+
+ - Changed IMAP \Flagged that they are not longer
+ tagged (+), but instead marked with new flag (F)
+ as flagged.
+ - \Flagged is shown on place of '+' on screen as 'F'.
+ - \Flagged can be modified with with new toggle F)lag command
+ - Flag is saved as letter F on Status: -header for
+ local mailbox
+ - Giving argument "flagged" (without quotes) to l)imit
+ command selects flagged messages. That is not mentioned "?"
+ help of l)imit command, because it it does not fit to
+ 80 characters. That is similar than "tagged" argument
+ to l)imit command.
+ - Command Ctrl-D accepts argument "flagged" (without quotes)
+ which deletes all visible flagged messages.
+ - Command Ctrl-D accepts argument "flagged" (without quotes)
+ which tags all visible flagged messages.
+ - Command Ctrl-U accepts argument "flagged" (without quotes)
+ which undeletes all visible flagged messages.
+
+ - Changed Ctrl-D command with argument "tagged" (without quotes)
+ so that it deletes only all visible tagged messages
+ (it was deleting also messages which was not on limited
+ selection.)


+
+ - Set close-on-exec flag for opened local mailbox.
+

+
+ - Added eucJP, eucKR, EUC-CN, GB2312, eucCN and
+ Big5-HKSCS, Big5HKSCS to ConfTool/CharMap
+
+ - Let ConfTool/LocaleMap also to use ConfTool/validcharset
+
+ - Changed on lib/precompiled_sets.c:
+ * Changed "ECMA-cyrillic" type from cs_unknown
+ to cs_ascii and given mime name KOI8-E
+ * Added ISO 2022 code for KOI8-E (ISO-IR-111)
+ * Added ISO 2022 code for IRV (codeset "ISO_646.irv:1983")
+ (ISO-IR-2)
+ * Added ISO 2022 code for ISO646-GB (codeset "BS_4730")
+ (ISO-IR-4)
+ * Changed codeset "NATS-SEFI" (ISO-IR-8-1) type from
+ cs_unknown to cs_iso646
+ * Added ISO 2022 code for codeset "NATS-SEFI" (ISO-IR-8-1)
+ * Added ISO 2022 code for codeset "NATS-SEFI-ADD"
+ (ISO-IR-8-2) (XX)
+ * Added ISO 2022 code for codeset "NATS-DANO"
+ (ISO-IR-9-1)
+ * Added ISO 2022 code for codeset "NATS-DANO-ADD"
+ (ISO-IR-9-2) (XX)
+ * Added ISO 2022 code for ISO646-FI (codeset
+ "SEN_850200_B") (ISO-IR-10)
+ * Added ISO 2022 code for ISO646-SE2 (codeset
+ "SEN_850200_C") (ISO-IR-11)
+ * Added ISO 2022 code for codeset "KS_C_5601-1987"
+ (ISO-IR-149) (XX)
+ * Changed codeset "KS_C_5601-1987" type from
+ cs_unknown to cs_iso2022
+ * Added ISO 2022 code for codeset "JIS_C6220-1969-jp"
+ (ISO-IR-13) (XX)
+ * Changed codeset "JIS_C6220-1969-jp" type from
+ cs_unknown to cs_iso2022
+ * Added ISO 2022 code for ISO646-IT (codeset "IT")
+ (ISO-IR-15)
+ * Added ISO 2022 code for ISO646-PT (codeset "PT")
+ (ISO-IR-16)
+ * Added ISO 2022 code for ISO646-ES (codeset "ES")
+ (ISO-IR-17)
+ * Added ISO 2022 code for codeset "greek7-old"
+ (ISO-IR-18)
+ * Added ISO 2022 code for codeset "latin-greek" (ISO-IR-19)
+ * Added ISO 2022 code for ISO646-DE (codeset "DIN_66003")
+ (ISO-IR-21)
+ * Added ISO 2022 code for ISO646-FR1
+ (codeset "NF_Z_62-010_(1973)") (ISO-IR-25)
+ * Added ISO 2022 code for codeset "Latin-greek-1"
+ (ISO-IR-27)
+ * Added ISO 2022 code for codeset "ISO_5427" (ISO-IR-37)
+ * Added ISO 2022 code for codeset "JIS_C6226-1978"
+ (ISO-IR-42) (XX)
+ * Changed codeset "JIS_C6226-1978" from type cs_unknown
+ to cs_iso2022
+ * Added ISO 2022 code for codeset "BS_viewdata"
+ (ISO-IR-47)
+ * Added ISO 2022 code for codeset "INIS"
+ (ISO-IR-49)
+ * Added ISO 2022 code for codeset "INIS-8"
+ (ISO-IR-50)
+ * Added ISO 2022 code for codeset "INIS-cyrillic"
+ (ISO-IR-51)
+ * Added ISO 2022 code for codeset "ISO_5427:1981"
+ (ISO-IR-54) (XX)
+ * Added ISO 2022 code for codeset "ISO_5428:1980"
+ (ISO-IR-55)
+ * Added ISO 2022 code for codeset "ISO_5428:1980"
+ (ISO-IR-55)
+ * Added ISO 2022 code for ISO646-CN (codeset "GB_1988-80")
+ (ISO-IR-57)
+ * Added ISO 2022 code for codeset "GB_2312-80"
+ (ISO-IR-58) (XX)
+ * Changed codeset "GB_2312-80" type from cs_unknown
+ to cs_iso2022
+ * Added ISO 2022 code for ISO646-NO (codeset "NS_4551-1")
+ (ISO-IR-60)
+ * Added ISO 2022 code for ISO646-NO2 (codeset "NS_4551-2")
+ (ISO-IR-61)
+ * Added ISO 2022 code for ISO646-FR (codeset "NF_Z_62-010")
+ (ISO-IR-69)
+ * Added ISO 2022 code for codeset "videotex-suppl"
+ (ISO-IR-70) (XX)
+ * Added ISO 2022 code for ISO646-PT2 (codeset "PT2")
+ (ISO-IR-84)
+ * Added ISO 2022 code for ISO646-ES2 (codeset "ES2")
+ (ISO-IR-85)
+ * Added ISO 2022 code for ISO646-HU (codeset "MSZ_7795.3")
+ (ISO-IR-86)
+ * Added ISO 2022 code for codeset "JIS_C6226-1983"
+ (ISO-IR-87) (XX)
+ * Changed codeset "JIS_C6226-1983" type from cs_unknown
+ to cs_iso2022
+ * Added ISO 2022 code for codeset "ASMO_449"
+ (ISO-IR-89)
+ * Added ISO 2022 code for codeset "iso-ir-90" (XX)
+ * Added ISO 2022 code for codeset "JIS_C6229-1984-a"
+ (ISO-IR-91)
+ * Added ISO 2022 code for ISO646-JP-OCR-B
+ (codeset "JIS_C6229-1984-b") (ISO-IR-92)
+ * Added ISO 2022 code for "JIS_C6229-1984-b-add"
+ (ISO-IR-93) (XX)
+ * Added ISO 2022 code for codeset "JIS_C6229-1984-hand"
+ (ISO-IR-94)
+ * Added ISO 2022 code for codeset "JIS_C6229-1984-hand-add"
+ (ISO-IR-95) (XX)
+ * Added ISO 2022 code for codeset "JIS_C6229-1984-kana"
+ (ISO-IR-96)
+ * Added ISO 2022 code for codeset "ISO_2033-1983"
+ (ISO-IR-98) (XX)
+ * Added ISO 2022 code for codeset "ANSI_X3.110-1983"
+ (ISO-IR-99) (XX)
+ * Added ISO 2022 code for codeset "T.61-7bit"
+ (ISO-IR-102)
+ * Added ISO 2022 code for codeset "T.61-8bit"
+ (ISO-IR-103)
+ * Added ISO 2022 code for ISO646-CA
+ (codeset "CSA_Z243.4-1985-1") (ISO-IR-121)
+ * Added ISO 2022 code for ISO646-CA2
+ (codeset "CSA_Z243.4-1985-2") (ISO-IR-122)
+ * Added ISO 2022 code for codeset
+ "CSA_Z243.4-1985-gr" (ISO-IR-123) (XX)
+ * Added ISO 2022 code for codeset
+ "T.101-G2" (ISO-IR-128) (XX)
+ * Added ISO 2022 code for codeset
+ "T.101-G2" (ISO-IR-128) (XX)
+ * Added ISO 2022 code for codeset "CSN_369103"
+ (ISO-IR-139)
+ * Changed codeset "CSN_369103" type fom cs_unknown
+ to cs_ascii
+ * Added ISO 2022 code for ISO646-YU
+ (codeset "JUS_I.B1.002") (ISO-IR-141)
+ * Added to ISO646 sets that MIME-subset=INVARIANT
+ * Added ISO 2022 code for codeset "ISO_6937-2-add"
+ (ISO-IR-141)
+ * Added ISO 2022 code for codeset "IEC_P27-1"
+ (ISO-IR-143)
+ * Changed codeset "IEC_P27-1" type from cs_unknown
+ to cs_ascii
+ * Added ISO 2022 code for codeset "JUS_I.B1.003-serb"
+ (ISO-IR-146)
+ * Added ISO 2022 code for codeset "JUS_I.B1.003-mac"
+ (ISO-IR-147)
+ * Added ISO 2022 code for codeset "greek-ccitt"
+ (ISO-IR-150)
+ * Added ISO 2022 code for ISO646-CU
+ (codeset "NC_NC00-10:81") (ISO-IR-151)
+ * Added ISO 2022 code for codeset "ISO_6937-2-25"
+ (ISO-IR-152)
+ * Changed codeset "ISO_6937-2-25" type from cs_unknown
+ to cs_ascii
+ * Added ISO 2022 code for codeset "GOST_19768-74"
+ (ISO-IR-153)
+ * Changed codeset "GOST_19768-74" type from cs_unknown to
+ cs_ascii
+ * Added ISO 2022 code for codeset "GOST_19768-74"
+ (ISO-IR-153)
+ * Added ISO 2022 code for codeset "ISO_8859-supp"
+ (ISO-IR-154) (XX)
+ * Changed codeset "ISO_8859-supp" type from cs_unknown
+ to cs_ascii
+ * Added ISO 2022 code for codeset "ISO_10367-box"
+ (ISO-IR-155) (XX)
+ * Changed codeset "ISO_10367-box" type from cs_unknown
+ to cs_ascii
+ * Added ISO 2022 code for codeset "latin-lap"
+ (ISO-IR-158) (XX)
+ * Changed codeset "latin-lap" type from cs_unknown
+ to cs_ascii
+ * Added ISO 2022 code for codeset "JIS_X0212-1990"
+ (ISO-IR-159) (XX)
+ * Changed codeset "JIS_X0212-1990" type from cs_unknown
+ to cs_iso2022
+
+
+ (XX) Actually it is unclear what that is supposed to mean
+ on context of
+ http://www.iana.org/assignments/character-sets
+ Most of these are not standalone character sets on
+ that sense what MIME use term 'charset' ....
+
+ - Configure now tests if system support wchar_t type
+ functions.
+ - Moved code of unknown charset type (cs_unknown)
+ from lib/cs_binary.c to lib/cs_unknown.c
+ - File lib/cs_wfallback.c includes 'fallback'
+ mapping for whar_t, similar than lib/cs_fallback.c
+ files 'fallback' defination.
+ - Unknown system (locale) charset is now implemented
+ with wide characters (wchar_t) on systems which
+ support it. Also support of wcwidth() function is
+ tested separately.
+ - On some cases that may cause warning/error message
+ "Unknown charsets are unsupported as keyboard input!"
+ to be printed (specially if there is significant state
+ used on keyboard input.)
+ - If __STDC_ISO_10646__ is defined, then wchar_t
+ is assumed to be Unicode (and 'fallback' mapping
+ is not needed.)
+ - Added elmrc option "locale-charsets" for systems
+ which have __STDC_ISO_10646__ defined. Given
+ charset names is type unknown used for system (locale)
+ charset, even when Elm ME+ is builtin defination
+ for charset.
+ - Added to terminal.info file new keyword DW.
+ This indicates for unknown system charset that wcwidth()
+ function should be used to get char width.
+ This means that logical width of character
+ may be 0,1 or 2 columns on that terminal.
+ - Keyword DW also may cause error/warning message
+ Double wide characters are not supported
+ to be printed.
+ - On systems which have __STDC_ISO_10646__ defined,
+ DW flag on terminal.info works like "locale-charsets"
+ option, if charset and terminal matches.
+
+ - Added UTF-8 for mlterm to terminal.info with
+ DW flag.
+
+ - pw_dir (home directory) and pw_shell is allowed
+ to be NULL on struct passwd.
+
+ - Added CP1251 as codeset for windows-1251. Seems that this is
+ returned by nl_langinfo(CODESET).
+ - Added CP1252 as codeset for windows-1252. Seems that this is
+ returned by nl_langinfo(CODESET).
+ - Added CP1255 as codeset for windows-1255. Seems that this is
+ returned by nl_langinfo(CODESET).
+ - Added CP1256 as codeset for windows-1256. Seems that this is
+ returned by nl_langinfo(CODESET).
+ - Added CP1257 as codeset for windows-1257. Seems that this is
+ returned by nl_langinfo(CODESET).
+
+ - Changed evaluation of elmrc option "text-charset".
+ - Changed evaluation of elmrc option "display-charset".
+ - Changed evaluation of elmrc option "local-fs-charset".
+ - Changed evaluation of elmrc option "default-nomime-charset".
+ - Changed evaluation of elmrc option
+ "default-mime-text-charset".
+ - Changed evaluation of elmrc option "imap-charset".
+ - Removed function get_charset_map_info().
+
+ - Changed implementation of elmrc option "shell".
+ - Changed implementation of elmrc option "tmpdir".
+ - Changed implementation of elmrc option "maildir"
+ (or "folders").
+ - Changed implementation of elmrc option "map-text-dir".
+ - Changed implementation of elmrc option "map-bin-dir".
+
+ - Fixed case where ISO-2022-JP subject was displayed on
+ message list, but when reading mail, subject was replaced
+ with question marks.
+
+ - Handle better bad sequense of bytes on text (for
+ example bad UTF-8 text).


+
+ - Configure was incorrectly made conlusion that
+ nl_langinfo(CODESET)
+ do not work on IRIX 6.5
+
+ - If given folder name 'aaa@bbb@ccc' for split_remote_name(),
+ do not split is as user='aaa', host='bbb@ccc', but use
+ user='aaa@bbb', host='ccc'
+ Problem noted by: admin <ad...@unixdemon.com>
+
+ - Remove duplicates from bin/elm.mimecharsets
+ during Configure
+ - Compare charset names in case insensitive way on
+ ConfTool/GenCharmap
+

+ - Added command "elmregister rpm-list", which
+ generates files listing suitable from rpm
+ %files -section.
+
+ - Declared that Elm ME is "Elm Millenium Edition".
+ Courtesy Vesa-Matti J Kari <vesa-ma...@helsinki.fi>


+
+ - get_type_flags() was called with NULL-pointer
+ argument from start_body_helper() line 381.
+ Problem noted by: Vesa-Matti J Kari <vesa-ma...@helsinki.fi>
+ > Return something 'intelligent' (instead of
+ crashing) in functions of lib/mediatype.c,
+ if them is called with NULL argument.
+
+ - Do not give NULL pointer for
+ Content-Type: *unknown*/MIXED
+ In other words do not return NULL pointer
+ if give_media_type() is asked to create
+ major media type '*unknown*' ('*unknown*'
+ matched MIME_TYPE_UNKNOWN signaling unknown
+ media type.)
+

+ - Added module (-M name) option and
+ correspond environment variable $ELM_MODULE
+ to elmregister.
+ - elmregister -M all may be used to register
+ file or command to all modules.
+
+ - Added command "elmregister rpm-list", which
+ generates files listing per -M option.


+
+ - Fixed Makefile error on
+ make package ROOT=/tmp/test-install

+ case.


+
+ - Sorting orders 'mailbox order' and
+ 'reverse mailbox order' was giving same order.
+ Fixed reverse sorting order.
+ - Little change for sorting.
+

+ - If "unstable-reverse-thread" is set, reverse thread
+ sorting is based on lastest message on thread.
+ Therefore thread moves to new location, when
+ new message arrives to thread.
+ - This variable is settable on o)ptions screen
+ with S)orting criteria command.
+
+ - Moved enumerate_list on save_opts to own
+ elmrc type rc_DT_ENUM and new data
+ type dt_enumerate_info
+
+ - Make possible to record changes of elm.rc
+ during installation.
+ - Option -c on elmrc-write and elmlibregister commands
+ gives file, which is used to record changes
+ (old values) of elm.rc during installation.
+ - During installation old values of failed elm.rc options
+ are kept on elm.rc.old-values file.
+
+ - Use malloc_gets() when reading elm.rc
+
+ - Added elmrc option "verify-domain". If set mail domains
+ are verified by gethostbyname(). Error HOST_NOT_FOUND
+ is treated as nonexisting domain and error NO_ADDRESS
+ is treated as valid mail domain.
+
+ - Added elmrc option "verify-local-address". If set
+ usernames of local addresses are verified. Using
+ this option requires that on global elm.rc have
+ "verify=yes" on mailer -option.
+
+ - Replaced elmrc types DT_ASR and DT_SRT with one type
+ rc_DT_SORT.
+
+ - Added elmrc option "local-dir-sortby". This specifies
+ sorting order for local files and folders on folder
+ and file browser. Possible values are "none", "name"
+ and "mtime" (and also "reverse-name" and "reverse-mtime").
+ Default value is "name".
+
+ - Added elmrc option "imap-dir-sortby". This specfies
+ sorting order for IMAP folders on folder browser. Possible
+ values are "none" and "name" (also "reverse-name").
+ Default value is "none".


+
+ - On 21 lines window browser help (Folder selection)
+ was not fitting to screen.
+

+ - Moved mailer related code from libelmme-base.so to
+ libelmme-mailer.so.
+ - Added elmrc type rc_DT_DELAY.
+ - Moved elmrc option "mailer" to libelmme-mailer.so.
+ It is 'proxied' with elmrc type rc_DT_DELAY.
+ - Added elmrc option "use-mailer-library" to
+ libelmme-mailer.so. It is 'proxied' with elmrc type
+ rc_DT_DELAY. "smtp" (ie. libelmme-smtp.so) is
+ now given on elmrc option "use-mailer-library"
+ (was on "use-connect-library".)
+ - Link libelmme-smtp.so with libelmme-mailer.so,
+ so that loading of libelmme-smtp.so succeed when
+ loader is not linked with libelmme-mailer.so.
+
+ - If elm is not compiled with -rdynamic, link
+ libelmme-smtp.so with libelmme-base.so, so that symbols
+ can be resolved.
+
+ - "I got http://www.elmme-mailer.org/elm-ME+2.5.alpha4.tar.gz
+ and tried to compile it on a SuSE 9.2 box. Configure
+ complained about missing termlibs and quit without even
+ generating a makefile.
+
+ Adding -lncurses in line 6333 of Configure (it now reads
+ for A in '' '-ltermlib' '-lcurses' '-ltermcap ' '-lncurses'; do
+ fixed this and elmme seems to work fine. Maybe you'd
+ like to include this patch in the next release ..."
+ From: Rainer Kaluscha <rainer....@web.de>
+
+ - Code changes for "-Wstrict-prototypes". I hope that these
+ do not broke something else.
+
+ - Added some support for RFC 2231:
+ MIME Parameter Value and Encoded Word Extensions:
+ Character Sets, Languages, and Continuations
+ - struct string may now carry language indicator
+ - Language specification is now accepted on encoded
+ words.
+ - When replying language specification is normally preserved
+ on replied address (phrase).
+ - [include -command now uses internally file browser
+ for refering file. This should handle better (theoretical)
+ situation where buffer charset is ddeferent than filesystem
+ charset.
+ - filename -arguments on mime -parameters use RFC 2231
+ encoding. Also non RFC 2231 ascii-only filename
+ argument is produced.
+ - Specially RFC 2231 encoded parameters are ignored
+ for most of other cases. Specially boundary -parameter
+ must not be RFC 2231 encoded.
+ - Added elmrc option "mime-parameters". Possible values are
+ "plain", "encoded" and "plain-and-encoded". If set
+ to "plain", then RFC 2231 encoded parameters are not
+ generated and not used when receiving mail (they still are
+ parsed.) When set to "plain-and-encoded both RFC 2231
+ encoded value and plain ascii value are generated (specially
+ for filename -parameter) when needed.
+
+ - Elm option -z (zero) do not longer imply option -n
+ (do not use ti/te).
+
+ - " would like to have an option like:
+ -z Zero - don't enter Elm if no mail is pending.
+
+ but:
+ -y Zero - don't enter Elm if no unread mail is
+ pending."
+ Suggested by: Axel Reinhold <ax...@freakout.de>
+
+ - Elm option -z now works correctly when several mailboxes
+ (several -f options) are given. Now Elm is not entered
+ when all given mailboxes are empty.
+
+ - doc/tmac.n states "This package may be circulated freely
+ with the news documentation; it may not be sold, but is to
+ be distributed with the unformatted news documents."
+ Removed, because Elm documentation is other documentation.
+ - Removed documentatiion which depends doc/tmac.n. That
+ documentation is more or less obsolete anyway:
+ doc/Alias.guide
+ doc/Config.guid
+ doc/Elm.cover
+ doc/Form.guide
+ doc/Ref.guide
+ doc/Users.guide
+ - Removed question about formatter of documentation
+ from Configure.


+
+ - f)orget command on "Mail Pre-Send Screen" incorrectly

+ sent mail when editor buffer was empty and on mail
+ there was on attachment.
+
+ - Both utils/elmrc-write.c and utils/elmlibregister.c
+ include routine for writing (user or system) elmrc.
+ Moved that to new file lib/write_rc.c.
+ - Changed src/save_opts.c to use lib/write_rc.c. This
+ means that elmrc option are saved on elmrc-info
+ older also when saved from Elm.
+ - Removed offset from struct rc_save_info_rec. It is
+ no longer needed.
+
+ - Changed default so that term.h is only included on
+ Linux (and not curses.h)
+
+ - "unicode_value (uint16) can not possibly exceed 0xFFFF.
+ Remove the statement, that triggers a compiler warning."
+ From: From: Mikhail T. <m...@aldan.algebra.com>
+ * Patch removes ...->unicode_value > 0xFFFF -test
+ from cs_add_state_to_iconv() on shared_libs/iconv/iconv.c.
+
+ - utils/answer.c included some bogus aliases reading routines.
+ Replaced it fetch_alias(). It still is broken, but
+ that is little better...
+ Problem noted by: From: Mikhail T. <m...@aldan.algebra.com>
+
+ New elmrc options:
+ mime-parameters
+ imap-dir-sortby
+ local-dir-sortby
+ locale-charsets
+ pgp-encrypt-type
+ prompt-metamail
+ unstable-reverse-thread
+ verify-domain
+ verify-local-address
+ use-mailer-library
+
+ New elm command line option:
+ -y Don't enter Elm if no unread mail
+ is pending.
+
+ New elm command:
+ F)lag
+
+ New files:


+ src/screen/subpage.c
+ src/screen/wrapper.c
+ src/screen/menu_param.c
+ src/screen/def_scommon.h
+ src/screen/scommon.c
+ src/screen/header.c
+ lib/cs_unknown.c
+ lib/cs_wfallback.c
+ charset/MAPPINGS/koi8-e.txt
+ lib/mailer/Makefile.SH
+ hdrs/mailerlib.h
+ lib/mailer/def_mailer.h

+ lib/mailer/outheaders.c
+ lib/mailer/shared_mailer.c
+ lib/mailer/init.c


+ lib/rc_delay.c
+ melib/mime_param.c
+ lib/write_rc.c

+
+ Moved files:
+ lib/mailer.c => lib/mailer/mailer.c
+
+ Removed files:
+ lib/add_site.c
+ lib/strtokq.c
+ doc/tmac.n
+ doc/Alias.guide
+ doc/Config.guid
+ doc/Elm.cover
+ doc/Form.guide
+ doc/Ref.guide
+ doc/Users.guide
+

+ Changes of Elm 2.4ME+ PL121h (25) compared with Elm 2.4ME+ PL121g (25)
+ ----------------------------------------------------------------------
+
+ - On 21 lines window browser help (Folder selection)
+ was not fitting to screen.
+
+ - f)orget command on "Mail Pre-Send Screen" incorrectly

+ sent mail when editor buffer was empty and on mail
+ there was on attachment.
+
+ Changes of Elm 2.4ME+ PL121g (25) compared with Elm 2.4ME+ PL121f (25)
+ ----------------------------------------------------------------------
+

+
+ Changes of Elm 2.4ME+ PL121f (25) compared with Elm 2.4ME+ PL121e (25)
+ ----------------------------------------------------------------------
+

+ - Fix another "Append to mail folder " -question.
+
+ - Configure was incorrectly made conlusion that
+ nl_langinfo(CODESET)
+ do not work on IRIX 6.5
+
+ - If given folder name 'aaa@bbb@ccc' for split_remote_name(),
+ do not split is as user='aaa', host='bbb@ccc', but use
+ user='aaa@bbb', host='ccc'
+ Problem noted by: admin <ad...@unixdemon.com>
+
+ - Remove duplicates from bin/elm.mimecharsets
+ during Configure
+ - Compare charset names in case insensitive way on
+ ConfTool/GenCharmap

+
+ Changes of Elm 2.4ME+ PL121e (25) compared with Elm 2.4ME+ PL121d (25)
+ ----------------------------------------------------------------------
+

+ - Set close-on-exec flag for opened local mailbox.
+

+ - Fix "Append to mail folder " -question.
+

+
+ Changes of Elm 2.4ME+ PL121d (25) compared with Elm 2.4ME+ PL121c (25)
+ ----------------------------------------------------------------------
+

+
+ Changes of Elm 2.4ME+ PL121c (25) compared with Elm 2.4ME+ PL121b (25)
+ ----------------------------------------------------------------------
+
+ - Fix incorrect drawing of "MIME structure Menu" when arrow
+ cursor was used.
+
+ Changes of Elm 2.4ME+ PL121b (25) compared with Elm 2.4ME+ PL121a (25)
+ ----------------------------------------------------------------------
+

+ - "If you had no aliases yet, and pushed j or k in the
+ aliases menu (or the down or up arrows), you had a
+ "bad item" "common menu panic". The reason was a
+ missing "break" statement in alias_item.c, which was
+ present in the approprite place in mailbox_item.c"
+ From: Kovacs Baldvin <bal...@cs.elte.hu>
+ ( Patch was agaist Elm ME+ 2.5 but applies also to Elm
+ 2.4ME+ )

+
+ Changes of Elm 2.4ME+ PL121a (25) compared with Elm 2.4ME+ PL121 (25)
+ ---------------------------------------------------------------------
+

+ - Fix error message
+ Path component "none" not absolute on key
+ "internal-mailcaps" value "none"

+ when on elmrc have line
+ internal-mailcaps = none
+
+

Changes of Elm 2.4ME+ PL121 (25) compared with Elm 2.4ME+ PL120 (25)
--------------------------------------------------------------------

***************
*** 9139,9145 ****
was allocated but the actual string was never built.
From: Mark Johnson <Mark.J...@ustc.vlsi.COM>

! - At the end of a message with the buildin pager I
sometimes get the prompt "MORE (you've seen 101%):"
and I can not read the next message with
pressing the space bar.

--- 10196,10202 ----


was allocated but the actual string was never built.
From: Mark Johnson <Mark.J...@ustc.vlsi.COM>

! - At the end of a message with the builtin pager I
sometimes get the prompt "MORE (you've seen 101%):"
and I can not read the next message with
pressing the space bar.

***************
*** 10006,10011 ****
--- 11063,11069 ----
term PRIVATE charset-name [ condition ] d/d d/d d/d

term flag flag-keyword
+ term DW charset-name

where term is type of terminal (ie value of $TERM).
ISO-2022 is literal, which indicates that
***************
*** 10045,10050 ****
--- 11103,11122 ----

vt200 ISO-2022-LIKE DEC-MCS left=bank-G0;bank-G0-94=4/2;right=bank-G2;bank-96=3/12

+ DW indicates that system charset that wcwidth()
+ function should be used to get char width.
+ This means that logical width of character
+ may be 0,1 or 2 columns on that terminal.
+
+ On systems which have __STDC_ISO_10646__ defined,
+ DW flag on terminal.info works like "locale-charsets"
+ option if charset and terminal matches.
+
+ If charset do not support calculation of visible len
+ and there is DW flag given for that charset and
+ terminal, then error message
+ Double wide characters are not supported
+ is printed.

Flag keyword xterm-title specifies that terminal supports
changing of window title and icon name similar than xterm.
***************
*** 10510,10516 ****
auto-iso-8859 MIME
background-wait-time -
bindata -
! browser-wildcard-matching -
charset-convert-ok MIME
convert-comment-to-fullname -
convert-utf-header (MIME)
--- 11582,11588 ----
auto-iso-8859 MIME
background-wait-time -
bindata -
! browser-wildcard-matching MIME / SYSTEM
charset-convert-ok MIME
convert-comment-to-fullname -
convert-utf-header (MIME)
***************
*** 10524,10529 ****
--- 11596,11602 ----
header-phrase-display-mode -
imap-charset IMAP
imap-connection-cache IMAP
+ imap-dir-sortby IMAP
imap-fast-lookup IMAP
imap-max-download-size IMAP
imap-naming-convention IMAP
***************
*** 10537,10546 ****
internal-mailcap-prompt-trusted MIME
iso646-charsets MIME
keeppassfor PGP (new on Elm 2.4 PL24ME)
! local-fast-lookup -
! local-fs-charset -
local-sessionlock-dir -
local-sessionlock-use-home -
lock-in-copy -
lock-folder -
mailer -
--- 11610,11621 ----
internal-mailcap-prompt-trusted MIME
iso646-charsets MIME
keeppassfor PGP (new on Elm 2.4 PL24ME)
! local-dir-sortby -
! local-fast-lookup SYSTEM
! local-fs-charset SYSTEM
local-sessionlock-dir -
local-sessionlock-use-home -
+ locale-charsets SYSTEM
lock-in-copy -
lock-folder -
mailer -
***************
*** 10550,10555 ****
--- 11625,11631 ----
metamail MIME
metamail-mailcaps MIME
menu-display-host -
+ mime-parameters MIME
mimebodykeywords MIME
mimeforward MIME (new on Elm 2.4 PL24ME)
noencoding MIME (new on Elm 2.4 PL24ME)
***************
*** 10562,10571 ****
--- 11638,11651 ----
pgp2 PGP
pgp5 PGP
gpg PGP
+ pgp-encrypt-type PGP / MIME
pgp-sign-type PGP / MIME
pgp-version PGP
pop-max-download-size POP
pop-show-greeting POP
+ prompt-after-metamail MIME
+ prompt-after-pager - (was: promptafter)
+ prompt-metamail MIME
quoteforward -
readdatapercentinc -
require-mime-version-for-body-encoding MIME
***************
*** 10576,10586 ****
--- 11656,11670 ----
sort-thread-max-time -
text-charset MIME
unidata MIME / SYSTEM
+ unstable-reverse-thread -
use-library -
use-base-library -
use-connect-library -
usepgppass PGP (new on Elm 2.4 PL24ME)
utf7-encode-optional MIME
+ verify-domain -
+ verify-local-address -
+

Obsolete elmrc variables
-------------------------
***************
*** 10601,10608 ****
New elm options for Elm 2.4ME+ (compared with Elm 2.4)
----------------------------------------------------

- -w Write .elm/elmrc on startup
-A Attach file

Obsolete elm options
--------------------
--- 11685,11694 ----
New elm options for Elm 2.4ME+ (compared with Elm 2.4)
----------------------------------------------------

-A Attach file
+ -w Write .elm/elmrc on startup
+ -y Don't enter Elm if no unread mail is
+ pending.

Obsolete elm options
--------------------
Index: elm2.4.ME+.122-cvs/charset/MAPPINGS/koi8-e.txt


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/charset/MAPPINGS/koi8-e.txt 2005-04-03 15:52:45.000000000 +0300
***************
*** 0 ****
--- 1,226 ----
+ # Source: http://czyborra.com/charsets/koi8-e.txt.gz
+ # Added control characters
+ 0x00 0x0000 # NULL
+ 0x01 0x0001 # START OF HEADING
+ 0x02 0x0002 # START OF TEXT
+ 0x03 0x0003 # END OF TEXT
+ 0x04 0x0004 # END OF TRANSMISSION
+ 0x05 0x0005 # ENQUIRY
+ 0x06 0x0006 # ACKNOWLEDGE
+ 0x07 0x0007 # BELL
+ 0x08 0x0008 # BACKSPACE
+ 0x09 0x0009 # HORIZONTAL TABULATION
+ 0x0A 0x000A # LINE FEED
+ 0x0B 0x000B # VERTICAL TABULATION
+ 0x0C 0x000C # FORM FEED
+ 0x0D 0x000D # CARRIAGE RETURN
+ 0x0E 0x000E # SHIFT OUT
+ 0x0F 0x000F # SHIFT IN
+ 0x10 0x0010 # DATA LINK ESCAPE
+ 0x11 0x0011 # DEVICE CONTROL ONE
+ 0x12 0x0012 # DEVICE CONTROL TWO
+ 0x13 0x0013 # DEVICE CONTROL THREE
+ 0x14 0x0014 # DEVICE CONTROL FOUR
+ 0x15 0x0015 # NEGATIVE ACKNOWLEDGE
+ 0x16 0x0016 # SYNCHRONOUS IDLE
+ 0x17 0x0017 # END OF TRANSMISSION BLOCK
+ 0x18 0x0018 # CANCEL
+ 0x19 0x0019 # END OF MEDIUM
+ 0x1A 0x001A # SUBSTITUTE
+ 0x1B 0x001B # ESCAPE
+ 0x1C 0x001C # FILE SEPARATOR
+ 0x1D 0x001D # GROUP SEPARATOR
+ 0x1E 0x001E # RECORD SEPARATOR
+ 0x1F 0x001F # UNIT SEPARATOR
+ 0x20 0x0020 # SPACE
+ 0x21 0x0021 # EXCLAMATION MARK
+ 0x22 0x0022 # QUOTATION MARK
+ 0x23 0x0023 # NUMBER SIGN
+ 0x24 0x0024 # DOLLAR SIGN
+ 0x25 0x0025 # PERCENT SIGN
+ 0x26 0x0026 # AMPERSAND
+ 0x27 0x0027 # APOSTROPHE
+ 0x28 0x0028 # LEFT PARENTHESIS
+ 0x29 0x0029 # RIGHT PARENTHESIS
+ 0x2A 0x002A # ASTERISK
+ 0x2B 0x002B # PLUS SIGN
+ 0x2C 0x002C # COMMA
+ 0x2D 0x002D # HYPHEN-MINUS
+ 0x2E 0x002E # FULL STOP
+ 0x2F 0x002F # SOLIDUS
+ 0x30 0x0030 # DIGIT ZERO
+ 0x31 0x0031 # DIGIT ONE
+ 0x32 0x0032 # DIGIT TWO
+ 0x33 0x0033 # DIGIT THREE
+ 0x34 0x0034 # DIGIT FOUR
+ 0x35 0x0035 # DIGIT FIVE
+ 0x36 0x0036 # DIGIT SIX
+ 0x37 0x0037 # DIGIT SEVEN
+ 0x38 0x0038 # DIGIT EIGHT
+ 0x39 0x0039 # DIGIT NINE
+ 0x3A 0x003A # COLON
+ 0x3B 0x003B # SEMICOLON
+ 0x3C 0x003C # LESS-THAN SIGN
+ 0x3D 0x003D # EQUALS SIGN
+ 0x3E 0x003E # GREATER-THAN SIGN
+ 0x3F 0x003F # QUESTION MARK
+ 0x40 0x0040 # COMMERCIAL AT
+ 0x41 0x0041 # LATIN CAPITAL LETTER A
+ 0x42 0x0042 # LATIN CAPITAL LETTER B
+ 0x43 0x0043 # LATIN CAPITAL LETTER C
+ 0x44 0x0044 # LATIN CAPITAL LETTER D
+ 0x45 0x0045 # LATIN CAPITAL LETTER E
+ 0x46 0x0046 # LATIN CAPITAL LETTER F
+ 0x47 0x0047 # LATIN CAPITAL LETTER G
+ 0x48 0x0048 # LATIN CAPITAL LETTER H
+ 0x49 0x0049 # LATIN CAPITAL LETTER I
+ 0x4A 0x004A # LATIN CAPITAL LETTER J
+ 0x4B 0x004B # LATIN CAPITAL LETTER K
+ 0x4C 0x004C # LATIN CAPITAL LETTER L
+ 0x4D 0x004D # LATIN CAPITAL LETTER M
+ 0x4E 0x004E # LATIN CAPITAL LETTER N
+ 0x4F 0x004F # LATIN CAPITAL LETTER O
+ 0x50 0x0050 # LATIN CAPITAL LETTER P
+ 0x51 0x0051 # LATIN CAPITAL LETTER Q
+ 0x52 0x0052 # LATIN CAPITAL LETTER R
+ 0x53 0x0053 # LATIN CAPITAL LETTER S
+ 0x54 0x0054 # LATIN CAPITAL LETTER T
+ 0x55 0x0055 # LATIN CAPITAL LETTER U
+ 0x56 0x0056 # LATIN CAPITAL LETTER V
+ 0x57 0x0057 # LATIN CAPITAL LETTER W
+ 0x58 0x0058 # LATIN CAPITAL LETTER X
+ 0x59 0x0059 # LATIN CAPITAL LETTER Y
+ 0x5A 0x005A # LATIN CAPITAL LETTER Z
+ 0x5B 0x005B # LEFT SQUARE BRACKET
+ 0x5C 0x005C # REVERSE SOLIDUS
+ 0x5D 0x005D # RIGHT SQUARE BRACKET
+ 0x5E 0x005E # CIRCUMFLEX ACCENT
+ 0x5F 0x005F # LOW LINE
+ 0x60 0x0060 # GRAVE ACCENT
+ 0x61 0x0061 # LATIN SMALL LETTER A
+ 0x62 0x0062 # LATIN SMALL LETTER B
+ 0x63 0x0063 # LATIN SMALL LETTER C
+ 0x64 0x0064 # LATIN SMALL LETTER D
+ 0x65 0x0065 # LATIN SMALL LETTER E
+ 0x66 0x0066 # LATIN SMALL LETTER F
+ 0x67 0x0067 # LATIN SMALL LETTER G
+ 0x68 0x0068 # LATIN SMALL LETTER H
+ 0x69 0x0069 # LATIN SMALL LETTER I
+ 0x6A 0x006A # LATIN SMALL LETTER J
+ 0x6B 0x006B # LATIN SMALL LETTER K
+ 0x6C 0x006C # LATIN SMALL LETTER L
+ 0x6D 0x006D # LATIN SMALL LETTER M
+ 0x6E 0x006E # LATIN SMALL LETTER N
+ 0x6F 0x006F # LATIN SMALL LETTER O
+ 0x70 0x0070 # LATIN SMALL LETTER P
+ 0x71 0x0071 # LATIN SMALL LETTER Q
+ 0x72 0x0072 # LATIN SMALL LETTER R
+ 0x73 0x0073 # LATIN SMALL LETTER S
+ 0x74 0x0074 # LATIN SMALL LETTER T
+ 0x75 0x0075 # LATIN SMALL LETTER U
+ 0x76 0x0076 # LATIN SMALL LETTER V
+ 0x77 0x0077 # LATIN SMALL LETTER W
+ 0x78 0x0078 # LATIN SMALL LETTER X
+ 0x79 0x0079 # LATIN SMALL LETTER Y
+ 0x7A 0x007A # LATIN SMALL LETTER Z
+ 0x7B 0x007B # LEFT CURLY BRACKET
+ 0x7C 0x007C # VERTICAL LINE
+ 0x7D 0x007D # RIGHT CURLY BRACKET
+ 0x7E 0x007E # TILDE
+ 0x7F 0x007F # DELETE
+ 0xA0 0x00A0 # NO-BREAK SPACE
+ 0xA1 0x0452 # CYRILLIC SMALL LETTER DJE
+ 0xA2 0x0453 # CYRILLIC SMALL LETTER GJE
+ 0xA3 0x0451 # CYRILLIC SMALL LETTER IO
+ 0xA4 0x0454 # CYRILLIC SMALL LETTER UKRAINIAN IE
+ 0xA5 0x0455 # CYRILLIC SMALL LETTER DZE
+ 0xA6 0x0456 # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+ 0xA7 0x0457 # CYRILLIC SMALL LETTER YI
+ 0xA8 0x0458 # CYRILLIC SMALL LETTER JE
+ 0xA9 0x0459 # CYRILLIC SMALL LETTER LJE
+ 0xAA 0x045A # CYRILLIC SMALL LETTER NJE
+ 0xAB 0x045B # CYRILLIC SMALL LETTER TSHE
+ 0xAC 0x045C # CYRILLIC SMALL LETTER KJE
+ 0xAD 0x00AD # SOFT HYPHEN
+ 0xAE 0x045E # CYRILLIC SMALL LETTER SHORT U
+ 0xAF 0x045F # CYRILLIC SMALL LETTER DZHE
+ 0xB0 0x2116 # NUMERO SIGN
+ 0xB1 0x0402 # CYRILLIC CAPITAL LETTER DJE
+ 0xB2 0x0403 # CYRILLIC CAPITAL LETTER GJE
+ 0xB3 0x0401 # CYRILLIC CAPITAL LETTER IO
+ 0xB4 0x0404 # CYRILLIC CAPITAL LETTER UKRAINIAN IE
+ 0xB5 0x0405 # CYRILLIC CAPITAL LETTER DZE
+ 0xB6 0x0406 # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+ 0xB7 0x0407 # CYRILLIC CAPITAL LETTER YI
+ 0xB8 0x0408 # CYRILLIC CAPITAL LETTER JE
+ 0xB9 0x0409 # CYRILLIC CAPITAL LETTER LJE
+ 0xBA 0x040A # CYRILLIC CAPITAL LETTER NJE
+ 0xBB 0x040B # CYRILLIC CAPITAL LETTER TSHE
+ 0xBC 0x040C # CYRILLIC CAPITAL LETTER KJE
+ 0xBD 0x00A4 # CURRENCY SIGN
+ 0xBE 0x040E # CYRILLIC CAPITAL LETTER SHORT U
+ 0xBF 0x040F # CYRILLIC CAPITAL LETTER DZHE
+ 0xC0 0x044E # CYRILLIC SMALL LETTER YU
+ 0xC1 0x0430 # CYRILLIC SMALL LETTER A
+ 0xC2 0x0431 # CYRILLIC SMALL LETTER BE
+ 0xC3 0x0446 # CYRILLIC SMALL LETTER TSE
+ 0xC4 0x0434 # CYRILLIC SMALL LETTER DE
+ 0xC5 0x0435 # CYRILLIC SMALL LETTER IE
+ 0xC6 0x0444 # CYRILLIC SMALL LETTER EF
+ 0xC7 0x0433 # CYRILLIC SMALL LETTER GHE
+ 0xC8 0x0445 # CYRILLIC SMALL LETTER HA
+ 0xC9 0x0438 # CYRILLIC SMALL LETTER I
+ 0xCA 0x0439 # CYRILLIC SMALL LETTER SHORT I
+ 0xCB 0x043A # CYRILLIC SMALL LETTER KA
+ 0xCC 0x043B # CYRILLIC SMALL LETTER EL
+ 0xCD 0x043C # CYRILLIC SMALL LETTER EM
+ 0xCE 0x043D # CYRILLIC SMALL LETTER EN
+ 0xCF 0x043E # CYRILLIC SMALL LETTER O
+ 0xD0 0x043F # CYRILLIC SMALL LETTER PE
+ 0xD1 0x044F # CYRILLIC SMALL LETTER YA
+ 0xD2 0x0440 # CYRILLIC SMALL LETTER ER
+ 0xD3 0x0441 # CYRILLIC SMALL LETTER ES
+ 0xD4 0x0442 # CYRILLIC SMALL LETTER TE
+ 0xD5 0x0443 # CYRILLIC SMALL LETTER U
+ 0xD6 0x0436 # CYRILLIC SMALL LETTER ZHE
+ 0xD7 0x0432 # CYRILLIC SMALL LETTER VE
+ 0xD8 0x044C # CYRILLIC SMALL LETTER SOFT SIGN
+ 0xD9 0x044B # CYRILLIC SMALL LETTER YERU
+ 0xDA 0x0437 # CYRILLIC SMALL LETTER ZE
+ 0xDB 0x0448 # CYRILLIC SMALL LETTER SHA
+ 0xDC 0x044D # CYRILLIC SMALL LETTER E
+ 0xDD 0x0449 # CYRILLIC SMALL LETTER SHCHA
+ 0xDE 0x0447 # CYRILLIC SMALL LETTER CHE
+ 0xDF 0x044A # CYRILLIC SMALL LETTER HARD SIGN
+ 0xE0 0x042E # CYRILLIC CAPITAL LETTER YU
+ 0xE1 0x0410 # CYRILLIC CAPITAL LETTER A
+ 0xE2 0x0411 # CYRILLIC CAPITAL LETTER BE
+ 0xE3 0x0426 # CYRILLIC CAPITAL LETTER TSE
+ 0xE4 0x0414 # CYRILLIC CAPITAL LETTER DE
+ 0xE5 0x0415 # CYRILLIC CAPITAL LETTER IE
+ 0xE6 0x0424 # CYRILLIC CAPITAL LETTER EF
+ 0xE7 0x0413 # CYRILLIC CAPITAL LETTER GHE
+ 0xE8 0x0425 # CYRILLIC CAPITAL LETTER HA
+ 0xE9 0x0418 # CYRILLIC CAPITAL LETTER I
+ 0xEA 0x0419 # CYRILLIC CAPITAL LETTER SHORT I
+ 0xEB 0x041A # CYRILLIC CAPITAL LETTER KA
+ 0xEC 0x041B # CYRILLIC CAPITAL LETTER EL
+ 0xED 0x041C # CYRILLIC CAPITAL LETTER EM
+ 0xEE 0x041D # CYRILLIC CAPITAL LETTER EN
+ 0xEF 0x041E # CYRILLIC CAPITAL LETTER O
+ 0xF0 0x041F # CYRILLIC CAPITAL LETTER PE
+ 0xF1 0x042F # CYRILLIC CAPITAL LETTER YA
+ 0xF2 0x0420 # CYRILLIC CAPITAL LETTER ER
+ 0xF3 0x0421 # CYRILLIC CAPITAL LETTER ES
+ 0xF4 0x0422 # CYRILLIC CAPITAL LETTER TE
+ 0xF5 0x0423 # CYRILLIC CAPITAL LETTER U
+ 0xF6 0x0416 # CYRILLIC CAPITAL LETTER ZHE
+ 0xF7 0x0412 # CYRILLIC CAPITAL LETTER VE
+ 0xF8 0x042C # CYRILLIC CAPITAL LETTER SOFT SIGN
+ 0xF9 0x042B # CYRILLIC CAPITAL LETTER YERU
+ 0xFA 0x0417 # CYRILLIC CAPITAL LETTER ZE
+ 0xFB 0x0428 # CYRILLIC CAPITAL LETTER SHA
+ 0xFC 0x042D # CYRILLIC CAPITAL LETTER E
+ 0xFD 0x0429 # CYRILLIC CAPITAL LETTER SHCHA
+ 0xFE 0x0427 # CYRILLIC CAPITAL LETTER CHE
+ 0xFF 0x042A # CYRILLIC CAPITAL LETTER HARD SIGN
Index: elm2.4.ME+.122-cvs/config.h.SH
*** elm2.4.ME+.121/config.h.SH 2003-08-16 09:58:21.000000000 +0300
--- elm2.4.ME+.122-cvs/config.h.SH 2005-03-28 18:27:30.000000000 +0300
***************
*** 274,281 ****
--- 274,283 ----
* spelling checker that is available to Elm.
*/
#$d_ispell ISPELL /**/
+ #ifdef ISPELL
#define ISPELL_PATH "$ispell_path" /**/
#define ISPELL_OPTIONS "$ispell_options" /**/
+ #endif

/* I_LOCALE:
* This symbol, if defined, indicates that the file locale.h
***************
*** 289,294 ****
--- 291,298 ----
#$d_nl_types I_NL_TYPES /**/
#$d_msgcat MSGCAT /**/
#$have_codeset HAVE_CODESET /**/
+ #$d_wchar WCHAR /**/
+ #$d_wcwidth WCWIDTH /**/

/* MALLOCVOID:
* This symbol, if defined, indicates that the malloc_t type should
Index: elm2.4.ME+.122-cvs/Configure
*** elm2.4.ME+.121/Configure 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/Configure 2005-07-06 13:38:46.000000000 +0300


***************
*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.161 2004/09/23 18:47:19 hurtta Exp $
#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.171 2005/07/06 10:38:46 hurtta Exp $
#

: sanity checks
***************
*** 146,151 ****
--- 146,158 ----
echo "Found bin directory"
fi

+ if test ! -d ../libs; then
+ echo "Making libs directory"
+ mkdir ../libs
+ else
+ echo "Found libs directory"
+ fi
+
case "$extractsh" in
true)

***************
*** 542,549 ****
d_usgnames=''
# passcat=''
rmttape=''
- roff=''
- roffopts=''
sigtype=''
spitshell=''
shsharp=''
--- 549,554 ----
***************
*** 567,572 ****
--- 572,579 ----
special_path2=''
dirname=''
locale_dir=''
+ d_wchar=''
+ d_wcwidth=''
CONFIG=''
: set package name
package=elm2.4me+
***************
*** 1392,1483 ****
EOSS
chmod +x filexp

- # determine text processor to use, default to troff if found.
- case "$roff" in
- '')
- if $test -f "$troff"; then
- dflt="$troff"
- elif $test -f "$nroff"; then
- dflt=$nroff
- elif $test -f "$gtroff"; then
- dflt=$gtroff
- else
- dflt=none
- fi
- ;;
- *) dflt="$roff";;
- esac
- $cat <<EOM
-
- The Elm documentation (Reference Guide, Configuration Guide, etc.) is set up
- for troff. If you only have nroff, it can be used, but the documentation will
- not be as readable. If you use an alternate processor for troff/nroff
- documents it can be specified here. Elm expects the text processor to write
- to standard out. You will be given a chance to provide command line options
- to this command in the next question.
-
- If you do not want install documentation, you can answer "none".
-
- EOM
- cont=true
- while $test "$cont" ; do
- echo " "
- echo "Give the name of the program used to format the Elm documentation on"
- $echo $n "your system: [$dflt] $c"
- rp="Preferred Elm documentation formatter program: [$dflt]"
- . myread
- roff=$ans;
- if $test -f "$ans"; then
- cont=''
- else
- lookup=`loc "$ans" "" . $pth`
-
- if $test "$ans" = none; then
- echo
- echo "Canceling generation of documentation"
- cont=''
- elif $test -f "$lookup"; then
- cont=''
- roff=$lookup
- else
- if $test "$fastread" = yes; then
- dflt=y
- else
- dflt=n
- fi
- echo "Text processor $ans doesn't exist."
- rp="Use that name anyway? [$dflt]"
- $echo $n "$rp $c"
- . myread
- dflt=''
- case "$ans" in
- y*) cont='';;
- esac
- fi
- fi
- done
-
- if $test "$roff" != none ; then
- # determine text processor flags to use.
- $cat <<EOM
-
- If this text processor requires any options for proper formatting, specify
- them here. To specify no options, enter the word "none". Some versions
- of troff require the -t option to write to standard out. This is the
- proper place to specify that option.
-
- EOM
- dflt="$roffopts"
- rp="What options should Elm use with $roff: [$dflt]"
- $echo $n "$rp $c"
- . myread
- roffopts=$ans
- case "$roffopts" in
- 'none') roffopts=''
- ;;
- esac
- fi
-
: default clear to no extra flags
xencf=
xenlf=
--- 1399,1404 ----
***************
*** 1680,1690 ****
$cat > trivial.c <<EOF
#include <stdio.h>



int main (argc,argv)
int argc;

char * argv;
{
! exit(0);
}
EOF
if $cc $ccflags -o trivial trivial.c && ./trivial ; then
--- 1601,1615 ----
$cat > trivial.c <<EOF
#include <stdio.h>

+ #if defined(__STDC__)
+ int main (int argc, char * argv);
+ #endif
+

int main (argc,argv)
int argc;

char * argv;
{
! return 0;
}
EOF
if $cc $ccflags -o trivial trivial.c && ./trivial ; then


***************
*** 3747,3753 ****

EOF

! if $cc $ccflags -o try_langinfo try_langinfo.c $A $libs > try.log 2>&1 &&
./try_langinfo > result_charset 2> try2.log
then
cs="`cat result_charset`"

--- 3672,3678 ----



EOF

! if $cc $ccflags -o try_langinfo try_langinfo.c $libs > try.log 2>&1 &&
./try_langinfo > result_charset 2> try2.log
then
cs="`cat result_charset`"

***************
*** 3766,3778 ****
fi

$rm -f try_langinfo try_langinfo.c try.log result_charset try2.log
! fi

else

# If we do not have local support, we can not have nl_langinfo(CODESET) support
have_codeset="$undef"

# check to see if the macros are 8-bit clean, ask the user
$cat <<EOM

--- 3691,3899 ----
fi

$rm -f try_langinfo try_langinfo.c try.log result_charset try2.log
! fi
!
! dflt=`loc wchar.h "" /usr/include $includepath`
! if $test -z "$dflt"; then
! echo "wchar.h not found, no native wide char support"
! d_wchar="$undef"
!
! else
! echo "wchar.h found"
!
! dflt=`loc wctype.h "" /usr/include $includepath`
! if $test -z "$dflt"; then
! echo "wctype.h not found, no native wide char support"
! d_wchar="$undef"
!
! else
! echo "wctype.h found, testing wide char support ..."
!
! $cat > try_wchar.c <<'EOF'
!
! #include <stdio.h>
! #include <string.h>
! #include <wchar.h>
! #include <wctype.h>
!
! int main (argc,argv)
! int argc;
! char * argv;
! {
! int i;
! mbstate_t a;
!
! wchar_t c;
! size_t r;
!
! wchar_t buffer1[10];
! const char *ptr;
!
! char buffer2[10];
! const wchar_t *ptr2;
!
!
! i = iswprint(L'a');
! if (!i) {
! fprintf (stderr, "iswprint(L'a') returned 0\n");
! exit(1);
! }
! i = iswprint(L' ');
! if (!i) {
! fprintf (stderr, "iswprint(L' ') returned 0\n");
! exit(1);
! }
!
! i = iswprint(L'\n');
! if (i) {
! fprintf (stderr, "iswprint(L'\\n') returned %d\n",i);
! exit(1);
! }
!
! i = iswcntrl(L'\n');
! if (!i) {
! fprintf (stderr, "iswcntrl(L'\\n') returned 0\n");
! exit(1);
! }
!
! memset(&a, 0, sizeof(a));
!
! r = mbrtowc(&c,"E", 1, &a);
!
! if (1 != r) {
! fprintf (stderr, "mbrtowc(&c,\"E\", 1, &A); returned %d\n",r);
! exit(1);
! }
! if (c != L'E') {
! fprintf (stderr, "mbrtowc(&c,\"E\", 1, &A); converted to %lc\n",c);


! exit(1);
! }
!
!

! memset(&a, 0, sizeof(a));
!
! ptr = "ELM";
! r = mbsrtowcs(buffer1,&ptr,10,&a);
! if (r != 3) {
! fprintf (stderr, "mbsrtowcs(buffer1,&ptr,10,&a) returned %d\n",r);
! exit(1);
! }
! if (ptr != NULL) {
! fprintf (stderr, "mbsrtowcs(buffer1,&ptr,10,&a) did not set ptr to NULL\n");
! exit(1);
! }
!
! i = wcscmp(buffer1,L"ELM");
! if (0 != i) {
! fprintf (stderr, "wcscmp(buffer1,L\"ELM\") returned %d\n",i);
! exit(1);
! }
!
! memset(&a, 0, sizeof(a));
! ptr2 = L"ELM";
!
! r = wcsrtombs(buffer2,&ptr2,sizeof buffer2,&a);
! if (r != 3) {
! fprintf (stderr, "wcsrtombs(buffer2,&ptr2,sizeof buffer2,&a) returned %d\n",r);
! exit(1);
! }
! if (ptr2 != NULL) {
! fprintf (stderr, "wcsrtombs(buffer2,&ptr2,sizeof buffer2,&a) did not set ptr2 to NULL\n");
! exit(1);
! }
!
! i = strcmp(buffer2,"ELM");
! if (0 != i) {
! fprintf (stderr, "strcmp(buffer2,\"ELM\") returned %d\n",i);
! exit(1);
! }
!
! printf("Wide character support tests succeed.\n");
! exit(0);
! }
!
! EOF
!
! if $cc $ccflags -o try_wchar try_wchar.c $libs > try.log 2>&1 &&
! ./try_wchar 2> try2.log
! then
! echo "System supports native wide characters."
! d_wchar="$define"
! else
! echo "System seems not support native wide characters"
! d_wchar="$undef"
! fi
!
!
! $rm -f try_wchar try_whcar.c try.log try2.log
! fi
! fi
!
! if $test "$d_wchar" = "$define" ; then
!
! echo "wide char support available, testing wcwidth() support"
!
! $cat > try_wcwidth.c <<'EOF'
!
! #include <stdio.h>
! #include <string.h>
! #include <wchar.h>
! #include <wctype.h>
!
! int wcwidth(wchar_t c);
!
! int main (argc,argv)
! int argc;
! char * argv;
! {
! int i;
!
! i = wcwidth(L'\0');
!
! if (0 != i) {
! fprintf (stderr, "wcwidth(L'\\0') returned %d (0 expected)\n",
! i);
! exit(1);
! }
!
! i = wcwidth(L'a');
!
! if (1 != i) {
! fprintf (stderr, "wcwidth(L'a') returned %d (1 expected)\n",
! i);


! exit(1);
! }
!
!

! printf("wcwidth() support tests succeed.\n");
! exit(0);
! }
! EOF
! if $cc $ccflags -o try_wcwidth try_wcwidth.c $libs > try.log 2>&1 &&
! ./try_wcwidth 2> try2.log
! then
! echo "System supports wcwidth()."
! d_wcwidth="$define"
! else
! echo "System seems not support wcwidth()"
! d_wcwidth="$undef"
! fi
!
! $rm -f try_wchar try_whcar.c try.log try2.log
! else
! d_wcwidth="$undef"
! fi
!

else

# If we do not have local support, we can not have nl_langinfo(CODESET) support
have_codeset="$undef"

+ # If we do not have local support, we can not have wchar support
+ d_wchar="$undef"
+ d_wcwidth="$undef"
+
# check to see if the macros are 8-bit clean, ask the user
$cat <<EOM

***************
*** 6322,6328 ****

EOF
d_havetlib=''
! for A in '' '-ltermlib' '-lcurses' '-ltermcap'; do
case "$d_havetlib" in
'')
echo " Trying ${A:-system} library"
--- 6443,6449 ----

EOF
d_havetlib=''
! for A in '' '-ltermlib' '-lcurses' '-ltermcap' '-lncurses'; do
case "$d_havetlib" in
'')
echo " Trying ${A:-system} library"
***************
*** 6391,6399 ****
"$undef:$define") dflt=c;;
*)
case "$uname_os" in
- Linux)
- dflt=b
- ;;
AIX|IRIX*)
dflt=c
;;
--- 6512,6517 ----
***************
*** 6946,6953 ****
d_usgnames='$d_usgnames'
# passcat='$passcat'
rmttape='$rmttape'
- roff='$roff'
- roffopts='$roffopts'
sigtype='$sigtype'
spitshell='$spitshell'
shsharp='$shsharp'
--- 7064,7069 ----
***************
*** 6969,6974 ****
--- 7085,7092 ----
special_path='$special_path'
special_path2='$special_path2'
locale_dir='$locale_dir'
+ d_wchar='$d_wchar'
+ d_wcwidth='$d_wcwidth'
CONFIG=true
EOT

Index: elm2.4.ME+.122-cvs/ConfTool/CharMap
*** elm2.4.ME+.121/ConfTool/CharMap 2002-01-26 13:14:44.000000000 +0200
--- elm2.4.ME+.122-cvs/ConfTool/CharMap 2005-03-03 21:36:20.000000000 +0200
***************
*** 1,4 ****
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/CharMap,v 1.12 2001/11/25 11:25:43 hurtta Exp $
result="(unsupported)"
extra=""

--- 1,4 ----
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/CharMap,v 1.13 2005/03/03 19:36:20 hurtta Exp $
result="(unsupported)"
extra=""

***************
*** 193,215 ****
result="$charmap"
;;
ISO-2022-*)
- # These are unsupported, but now we can indicate charset
result="$charmap"
;;
EUC-KR|EUC-JP)
- # These are unsupported, but now we can indicate charset
result="$charmap"
;;
KOI-8R)
result=KOI8-R
;;
KOI8-*)
result="$charmap"
;;
! Big5-HKSCS)
# "Big5-HKSCS" is registered
# These are unsupported, but now we can indicate charset
! result="$charmap"
;;
tis-620|TIS-620)
# "TIS-620" is registered
--- 193,222 ----
result="$charmap"
;;
ISO-2022-*)
result="$charmap"
;;
EUC-KR|EUC-JP)
result="$charmap"
;;
+ eucJP)
+ result=EUC-JP
+ ;;
+ eucKR)
+ result=EUC-KR
+ ;;
+ EUC-CN|GB2312|eucCN)
+ result=GB2312
+ ;;
KOI-8R)
result=KOI8-R
;;
KOI8-*)
result="$charmap"
;;
! Big5-HKSCS|Big5HKSCS)
# "Big5-HKSCS" is registered
# These are unsupported, but now we can indicate charset
! result="codeset=\"Big5-HKSCS\""
;;
tis-620|TIS-620)
# "TIS-620" is registered
Index: elm2.4.ME+.122-cvs/ConfTool/GenCharmap
*** elm2.4.ME+.121/ConfTool/GenCharmap 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.122-cvs/ConfTool/GenCharmap 2005-03-28 15:59:30.000000000 +0300
***************
*** 1,17 ****
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenCharmap,v 1.17 2003/08/26 17:07:29 hurtta Exp $



! is_validcharset=
! if (CC="$cc"; export CC; cd ConfTool; $make validcharset); then
! is_validcharset=y
! $echo "ConfTool/validcharset compiled"
! else
! $echo "Failed to generate ConfTool/validcharset ..."
! $echo "bin/elm.mimecharsets will be incorrent or incomplete"
! sleep 20
! is_validcharset=n
! fi
!
! if $test $new = y ; then
cat >bin/elm.mimecharsets <<'EOM'
# Mapping from LC_CTYPE locale to MIME's charset values
# Format is:
--- 1,6 ----

! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenCharmap,v 1.20 2005/03/28 12:59:30 hurtta Exp $

+ else


+ $echo "Failed to generate ConfTool/validcharset ..."
+ $echo "bin/elm.mimecharsets will be incorrent or incomplete"
+ sleep 20
+ is_validcharset=n

+ fi
+

+ if $test $new = y ; then
+ write_header

*** 52,58 ****


-f charset/MAPPINGS/$file -o \
-f charset/MAPPINGS/MICSFT/$file ; then
eval "$printit"

! if $egrep "^-.*$set;" bin/elm.mimecharsets > /dev/null; then


$echo " Charset $set already set, will not add map=$file"
else
echo "- $set$rest;map=$file" >> bin/elm.mimecharsets
--- 71,81 ----
-f charset/MAPPINGS/$file -o \
-f charset/MAPPINGS/MICSFT/$file ; then
eval "$printit"
! if $egrep -i "^-.*$set;alias=[^;]+\$" bin/elm.mimecharsets > /dev/null; then

! $echo " Charset $set alias already set"
! echo "- $set$rest;map=$file" >> bin/elm.mimecharsets
! echo " Adding map=$file for $set"


! elif $egrep -i "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add map=$file"
else
echo "- $set$rest;map=$file" >> bin/elm.mimecharsets
***************

*** 65,71 ****


printit='$echo "* Adding iso646 definations from ConfTool/iso646maps"; printit='
while read set map ; do
eval "$printit"
! if $egrep "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add \"$map\""
else
echo "- $set;MIME-subset=INVARIANT;type=iso646-set;map=\"$map\"" >> bin/elm.mimecharsets
--- 88,94 ----
printit='$echo "* Adding iso646 definations from ConfTool/iso646maps"; printit='
while read set map ; do
eval "$printit"
! if $egrep -i "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add \"$map\""
else
echo "- $set;MIME-subset=INVARIANT;type=iso646-set;map=\"$map\"" >> bin/elm.mimecharsets
***************

*** 81,87 ****


case "$loc" in
"-")
eval "$printit"
! if $egrep "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add $rest"
else
echo "- $set;$rest" >> bin/elm.mimecharsets
--- 104,110 ----
case "$loc" in
"-")
eval "$printit"
! if $egrep -i "^-.*$set;" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add $rest"
else
echo "- $set;$rest" >> bin/elm.mimecharsets
***************

*** 96,102 ****


case "$loc" in
"-")
eval "$printit"
! if $egrep "^-.*$set;.*alias=" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add $rest"
else
echo "- $set;$rest" >> bin/elm.mimecharsets
--- 119,125 ----
case "$loc" in
"-")
eval "$printit"
! if $egrep -i "^-.*$set;.*alias=" bin/elm.mimecharsets > /dev/null; then
$echo " Charset $set already set, will not add $rest"
else
echo "- $set;$rest" >> bin/elm.mimecharsets

***************
*** 237,243 ****
. ConfTool/LocaleMap
if $test "$result" != "" ; then
echo "$lc_ctype $result" >> bin/elm.mimecharsets
! echo "(as $result from $locale_dir/locale.alias)"
else
file=doc/mime.charsets
first="$lc_ctype"
--- 260,266 ----
. ConfTool/LocaleMap
if $test "$result" != "" ; then
echo "$lc_ctype $result" >> bin/elm.mimecharsets
! echo "(as $result$source)"
else
file=doc/mime.charsets
first="$lc_ctype"
Index: elm2.4.ME+.122-cvs/ConfTool/GenTerminalinfo
*** elm2.4.ME+.121/ConfTool/GenTerminalinfo 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.122-cvs/ConfTool/GenTerminalinfo 2005-03-15 14:29:06.000000000 +0200
***************
*** 1,4 ****
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenTerminalinfo,v 1.5 2003/09/05 19:31:30 hurtta Exp $



if $test $new = y ; then

cat >bin/elm.terminalinfo <<'EOM'
--- 1,4 ----
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenTerminalinfo,v 1.6 2005/03/15 12:29:06 hurtta Exp $



if $test $new = y ; then

cat >bin/elm.terminalinfo <<'EOM'
***************
*** 71,77 ****
else
termname=
case "$type" in
! "ISO-2022/DW"|ISO-2022|PRIVATE|FLAG|ISO-2022-LIKE)
# Does not work completely correctly
if $fgrep "$terminal" bin/elm.terminalinfo | \
$fgrep "$set" > /dev/null ;
--- 71,77 ----
else
termname=
case "$type" in
! "ISO-2022/DW"|ISO-2022|PRIVATE|FLAG|ISO-2022-LIKE|DW)
# Does not work completely correctly
if $fgrep "$terminal" bin/elm.terminalinfo | \
$fgrep "$set" > /dev/null ;
Index: elm2.4.ME+.122-cvs/ConfTool/LocaleMap
*** elm2.4.ME+.121/ConfTool/LocaleMap 2002-01-26 13:14:44.000000000 +0200
--- elm2.4.ME+.122-cvs/ConfTool/LocaleMap 2005-03-03 23:19:10.000000000 +0200
***************
*** 1,6 ****
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/LocaleMap,v 1.4 2000/03/21 05:59:12 hurtta Exp $
result=""
! if $test "$locale_dir" != none ; then
if $test -f $locale_dir/locale.alias ; then
charmap="`$egrep \"^$lc_ctype[ ]+\" < $locale_dir/locale.alias| $head -1 | $sed \"s/^$lc_ctype[ ]+//;\"`"
case "$charmap" in
--- 1,12 ----
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/LocaleMap,v 1.5 2005/03/03 21:19:10 hurtta Exp $
result=""
! source=""
!
! tmp=cs-$$
!
! if $test $is_validcharset = y && ConfTool/validcharset "$lc_ctype" > $tmp; then
! result="`cat $tmp`"
! elif $test "$locale_dir" != none ; then
if $test -f $locale_dir/locale.alias ; then
charmap="`$egrep \"^$lc_ctype[ ]+\" < $locale_dir/locale.alias| $head -1 | $sed \"s/^$lc_ctype[ ]+//;\"`"
case "$charmap" in
***************
*** 18,22 ****
--- 24,30 ----
if $test "$result" = "(unsupported)" ; then
result=
fi
+ source=" from $locale_dir/locale.alias"
fi
fi
+ $rm -f $tmp
\ No newline at end of file
Index: elm2.4.ME+.122-cvs/ConfTool/Makefile
*** elm2.4.ME+.121/ConfTool/Makefile 2002-01-26 13:14:44.000000000 +0200
--- elm2.4.ME+.122-cvs/ConfTool/Makefile 2005-04-03 10:57:05.000000000 +0300
***************
*** 4,9 ****
--- 4,12 ----
validcharset: validcharset.o precompiled_sets.o istrcmp.o
$(CC) $(CFLAGS) -o $@ validcharset.o precompiled_sets.o istrcmp.o

+ clean:
+ rm -f validcharset.o precompiled_sets.o istrcmp.o precompiled_sets.c istrcmp.c validcharset
+
validcharset.o: ../hdrs/defs.h ../hdrs/elmlib.h ../hdrs/cs_imp.h

precompiled_sets.o: ../hdrs/defs.h ../hdrs/elmlib.h ../hdrs/cs_imp.h
Index: elm2.4.ME+.122-cvs/ConfTool/mapfiles
*** elm2.4.ME+.121/ConfTool/mapfiles 2003-09-05 23:33:17.000000000 +0300
--- elm2.4.ME+.122-cvs/ConfTool/mapfiles 2005-03-28 20:34:34.000000000 +0300
***************
*** 39,41 ****
--- 39,42 ----
viscii.txt VISCII ;type=one-byte-map
dec-mcs.txt DEC-MCS ;type=ascii-set
hp-roman8.txt hp-roman8 ;type=ascii-set
+ koi8-e.txt KOI8-E ;type=ascii-set
Index: elm2.4.ME+.122-cvs/ConfTool/validcharset.c
*** elm2.4.ME+.121/ConfTool/validcharset.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/ConfTool/validcharset.c 2005-04-03 14:41:43.000000000 +0300
***************
*** 1,3 ****
--- 1,8 ----
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.75 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/

#include <stdio.h>
#include "defs.h"
***************
*** 44,49 ****
--- 49,121 ----
struct setlist set_latin7;
struct setlist set_latin9;
struct setlist set_iso885916;
+ struct setlist set_koi8e;
+ struct setlist set_iso_ir_2;
+ struct setlist set_iso_ir_4;
+ struct setlist set_iso_ir_8_1;
+ struct setlist set_iso_ir_8_2;
+ struct setlist set_iso_ir_9_1;
+ struct setlist set_iso_ir_9_2;
+ struct setlist set_iso_ir_10;
+ struct setlist set_iso_ir_11;
+ struct setlist set_iso_ir_149;
+ struct setlist set_iso_ir_13;
+ struct setlist set_iso_ir_15;
+ struct setlist set_iso_ir_16;
+ struct setlist set_iso_ir_17;
+ struct setlist set_iso_ir_18;
+ struct setlist set_iso_ir_19;
+ struct setlist set_iso_ir_21;
+ struct setlist set_iso_ir_25;
+ struct setlist set_iso_ir_27;
+ struct setlist set_iso_ir_37;
+ struct setlist set_iso_ir_42;
+ struct setlist set_iso_ir_47;
+ struct setlist set_iso_ir_49;
+ struct setlist set_iso_ir_50;
+ struct setlist set_iso_ir_51;
+ struct setlist set_iso_ir_54;
+ struct setlist set_iso_ir_55;
+ struct setlist set_iso_ir_57;
+ struct setlist set_iso_ir_58;
+ struct setlist set_iso_ir_60;
+ struct setlist set_iso_ir_61;
+ struct setlist set_iso_ir_69;
+ struct setlist set_iso_ir_70;
+ struct setlist set_iso_ir_84;
+ struct setlist set_iso_ir_85;
+ struct setlist set_iso_ir_86;
+ struct setlist set_iso_ir_87;
+ struct setlist set_iso_ir_89;
+ struct setlist set_iso_ir_90;
+ struct setlist set_iso_ir_91;
+ struct setlist set_iso_ir_92;
+ struct setlist set_iso_ir_93;
+ struct setlist set_iso_ir_94;
+ struct setlist set_iso_ir_95;
+ struct setlist set_iso_ir_96;
+ struct setlist set_iso_ir_98;
+ struct setlist set_iso_ir_99;
+ struct setlist set_iso_ir_102;
+ struct setlist set_iso_ir_103;
+ struct setlist set_iso_ir_121;
+ struct setlist set_iso_ir_122;
+ struct setlist set_iso_ir_123;
+ struct setlist set_iso_ir_128;
+ struct setlist set_iso_ir_139;
+ struct setlist set_iso_ir_141;
+ struct setlist set_iso_ir_142;
+ struct setlist set_iso_ir_143;
+ struct setlist set_iso_ir_146;
+ struct setlist set_iso_ir_147;
+ struct setlist set_iso_ir_150;
+ struct setlist set_iso_ir_151;
+ struct setlist set_iso_ir_152;
+ struct setlist set_iso_ir_153;
+ struct setlist set_iso_ir_154;
+ struct setlist set_iso_ir_155;
+ struct setlist set_iso_ir_158;
+ struct setlist set_iso_ir_159;

int main (argc, argv)
int argc;
Index: elm2.4.ME+.122-cvs/doc/Alias.guide
*** elm2.4.ME+.121/doc/Alias.guide 2002-01-26 13:14:45.000000000 +0200


--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************

*** 1,354 ****
- .\" @(#)$Id: Alias.guide,v 1.2 1998/10/20 19:57:19 hurtta Exp $
- .\"
- .\" A guide to the ELM alias system and so on.
- .\" format with:
- .\" tbl Alias.guide | troff tmac.n - > Alias.format'
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust
- .\" Elm is now in the public trust.
- .\"
- .\"
- .\"
- .tm Have we been run through "tbl" first?? I hope so!
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .za
- .sp |3.0i
- .ce 99
- .ps 20
- .ss 18
- .vs 12
- \f3The Elm Alias System Users Guide\f1
- .sp 4
- .ps 12
- .ss 14
- .vs 14
- \f2What aliases are and how to use them
- in the \f3Elm\fP mail system\f1
- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp |9.0i
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .fi
- .ad
- .bp 1
- .sv 5v
- .ps 14
- .ss 12
- .vs 16
- \f3The Elm Alias System Users Guide\f1
- .ds h0 "Alias Users Guide
- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- Syd Weinstein
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- This document is intended as a supplement to the \f2Elm Users Guide\f1
- and is only of interest to those users desiring more knowledge
- about how aliases work and how to create strange and exciting
- aliases for their systems (okay, so maybe it's not \f2that\f1 exciting!)
- .sp
- This document is broken up into the following sections;
- user aliases,
- group aliases,
- system aliases,
- editing and installing new aliases,
- general warnings and other chit-chat.
- .sp
- .hn 1 User Aliases
-
- The simplest type of aliases in the Elm system are individual
- user aliases. These are made up of three parts;
-
- .nf
- \f2aliasname list\f1 = \f2username\f1 = \f2address\f1
- .fi
-
- Where the \f2aliasname list\f1 is either a single aliasname\s-1\u1\d\s0
- .fn
- 1. Aliasnames can be any combination of letters, numbers, hyphens (\*q\-\*u),
- periods (\*q.\*u), or underscores (\*q_\*u). Letter case is not significant,
- that is, \*QFRED\*U, \*QFred\*U, and \*Qfred\*U are identical.
- .ef
- or a list of aliasnames separated by commas. Aliasnames are case insensitive and will be
- converted to all lower case by the alias system.
- .sp
- \f2Username\f1 is used to indicate the full \*Qreal name\*U of the user. For
- example, if you had an alias for \*Qtaylor\*U to get to me, the
- \f2username\f1 field would contain \*QDave Taylor\*U or
- perhaps \*QDave Taylor at HP\*U
- or some other permutation. The
- name can optionally be entered in the format of \*QTaylor; Dave\*U. When
- this is done, the alias system can sort aliases on a last name basis
- for presentation on the alias menu within Elm.
- Elm uses this information to add the user's full name to the addresses of
- outbound mail to get more readable addresses. No
- matter which format a name is entered, Elm displays it
- and puts it in mail headers the way you would expect (i.e., \*QDave Taylor\*U).
- .sp
- \f2Address\f1 is either the user's full electronic mail address or, if
- your system uses a smart mailer, the minimum address needed to specify
- the destination. For example, say my smart mailer
- contained information on how to get to machine \*Qhp-sdd\*U and I wanted
- to have an address for my friend Ken there \(em I could have his address
- specified as simply \*Qken@hp-sdd\*U (or alternatively \*Qhp-sdd!ken\*U since
- the two are functionally equivalent).
- .sp
- Let's get on to some examples, shall we?
- .sp
- Consider this excerpt from my own \f2.elm/aliases.text\f1 file;
-
- .nf
- .ft CW
- .zf
- .in .5i
- .ta \w'frank,minjarez 'u \w'frank,minjarez = Frank Minjarez 'u
- # Mail aliases for Dave Taylor
- # Friends from UCSD
- addie = Addie Silva = ad...@hp-sdd.SDD.HP.COM
- frank,minjarez = Frank Minjarez = Minjare...@dockmaster.ddn.mil
- pizzini = Ken Pizzini = hplabs!ucbvax!ucdavis!pai!ken
- george = Burdell; George P., Famous GT Guy = gbur...@matd.gatech.edu
- .ft 1
-
- .in 0
- .fi
- Note that the alias for Frank Minjarez has two \f2aliasnames\f1 associated
- with it, \f2frank\f1 and \f2minjarez\f1.
- Also notice that the first and second aliases
- use the Internet style naming convention of \f2user@machine\f1
- whereas the third uses the \f2uucp\f1 notation of \f2machine!user\f1.
- The fourth alias illustrates two features for the \f2username\f1
- field. An individual's name can be entered in the form of
- \f2lastname; firstname, comment\f1 which allows the alias system to be able
- to sort alias names on a last name basis. Additionally, any
- text after the comma is treated as a comment. It is stored in
- the alias file and displayed on the alias menu but will not
- appear in the comment field (between the parentheses) in the header
- of a message. This allows you to enter useful notes about an
- individual that you would not otherwise want to include in the
- \f3To:\f1 header of a mail message.
- .sp
- For the most part, the notational format is transparent within the
- alias file \(em the only time it \f2does\f1 make a difference
- is if you have to specify more than the machine that the user is
- receiving mail on (as in the third example above).
- .sp
- Suffice to say that if you must specify any sort of uucp route
- that you should use the uucp notation as much as possible to ensure
- that the system expands the correct machine name. Similarly, if
- you're bouncing mail through different Internet sites (to
- get to a foreign system, as in the example below) you should use the
- notation that system expects, e.g.:
-
- .ft CW
- .zf
- .ti .5i
- listserv%byuadmi...@rugters.edu
- .ft 1
- .sp
- .hn 1 Group Aliases
-
- After the confusion of user aliases, group aliases are even more
- fun! For the most part the notation is very similar:
-
- .nf
- .ti .5i
- \f2aliasname list\f1 = \f2groupname\f1 = \f2address list\f1
- .fi
-
- Where \f2aliasname list\f1 and \f2groupname\f1 are exactly equivalent
- to the corresponding fields in user aliases.
- .sp
- The interesting part is the \f2address list\f1 field; this
- field is actually in the same notation as the aliasname list (i.e.,
- a list of addresses separated by commas),
- so it's really quite easy to create.
- It's best to illustrate by example:
-
- .ft CW
- .zf
- .nf
- .in .5i
- friends, mypals = The Gang of Six = joe, larry, mary, joanna,
- \h'\w'friends, mypals = The Gang of Six = 'u'nancy, michael
- .ft 1
- .in 0
- .fi
-
- Notice that you can continue onto as many lines as you'd like so
- long as each additional line starts with either a \f2<space>\f1 or a
- \f2<tab>\f1 character.
- .sp
- At times it may be desirable to send a message to everyone in
- the group except one or two people. This can be accomplished by
- adding the individuals' actual IDs to the \f3To:\f1 list, preceded
- by a minus sign (\*q\-\*u). For example, if you were having a surprise
- party for \f2nancy\f1 from the above group and you wanted to discuss the
- details with the others, you could mail the message to:
-
- .ft CW
- .zf
- .nf
- .in .5i
- friends \-nancy
- .ft 1
- .in 0
- .fi
-
- Unlike in prior versions of Elm, group alias addresses need not
- be \f2previously defined aliases\f1 or valid mail addresses on
- the current machine. Any valid delivery address, local user, or
- prior user or group alias may now be part of a group alias
- \f2address list\f1.
- .sp
- .hn 1 System Aliases
-
- System aliases are functionally equivalent to the individual Elm
- alias lists each Elm user has (both user aliases and group aliases)
- but are \f2read only\f1 for everyone but the Elm administrator. The
- format of the file is identical to the users' files, and the only difference is
- that this file is expected to be located in the directory that contains
- the \f3system_hash_file\f1 and \f3system_data_file\f1 files (see the
- \f2Elm Configuration Guide\f1 for more details on these variables).
- .sp
- Simply create the system alias file in the specified directory
- as you would a normal alias file, and install it using the newalias
- command with the -g option (see the following section for more details
- on that). Voila!!
- .sp
- .hn 1 Editing and Installing New Aliases
-
- To install new aliases, you need merely to create, or modify,
- the file \f2$HOME/.elm/aliases.text\f1 until you're
- satisfied with it and it meets the requirements discussed above.
- You can then try to install it with the command:
-
- .ti .5i
- $ \f3newalias\f1
-
- which either reports the number of aliases installed
- or the errors encountered trying to parse and store the
- given alias list.
- .sp
- Note that blank lines are no problem and that comments are not only
- allowed but actually encouraged, and must have \*q#\*u as the first
- character of each comment line.
- .sp
- .hn 1 Other Stuff not Covered Yet
-
- Probably the biggest question you have in your mind right now
- is \*QBut how the heck does this relate to my existing \f2Berkeley Mail\f1
- aliases and the lower-level \f2sendmail\f1 alias system?\*U Well,
- rest assured that if you \f2really\f1 want to have
- your aliases down in the transport you can. No problem.
- .sp
- And for those ex-\f2Berkeley Mail\f1 fans, you can translate your
- aliases into the format that Elm wants by running them
- through the \f2awk\f1 script listed in the appendix.
- .sp
- Finally, if you have any problems or questions, try looking in
- the \f2newalias\f1 manual entry.
- .bp
- .ce 99
- \f3Appendix One
- An \f2awk\fP Script for Translating Aliases
- from a Berkeley Mail \f2.mailrc\fP File
- to an Elm \f2.elm/aliases.text\fP File\f1
- .ce 0
- .sp
- .nf
-
- .ta .5i
- .ft CW
- .zf
- BEGIN { print "# Elm .elm/aliases.text file, from a .mailrc file..."
- print ""
- }
- next_line == 1 {
- next_line = 0;
- group = ""
- for (i = 1; i <= NF; i++) {
- if (i == NF && $i == "\\\\") sep = ""
- else sep = ", "
- if ($i == "\\\\") {
- group = sprintf("%s,", group)
- next_line = 1;
- }
- else if (length(group) > 0)
- group = sprintf("%s%s%s", group, sep, $i);
- else
- group = $i;
- }
- print "\\t" group
- }
- $1 ~ /[Aa]lias | [Gg]roup/ {
- if ( NF == 3)
- print $2 " = user alias = " $3;
- else {
- group = ""
- for (i = 3; i <= NF; i++) {
- if (i == NF && $i == "\\\\") sep = ""
- else sep = ", "
- if ($i == "\\\\") {
- group = sprintf("%s,", group)
- next_line = 1;
- }
- else if (length(group) > 0)
- group = sprintf("%s%s%s", group, sep, $i);
- else
- group = $i;
- }
- print $2 " = group alias = " group;
- }
- }
-
- .ft 1
- .fi
- Note: this script is contained in the release as \f2utils/mailrc.awk\f1.
--- 0 ----
Index: elm2.4.ME+.122-cvs/doc/answer.1
*** elm2.4.ME+.121/doc/answer.1 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.122-cvs/doc/answer.1 2005-07-08 10:42:00.000000000 +0300
***************
*** 106,112 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2002 by Kari Hurtta


.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

--- 106,112 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 1996-2005 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

Index: elm2.4.ME+.122-cvs/doc/Config.guid
*** elm2.4.ME+.121/doc/Config.guid 2002-01-26 13:14:45.000000000 +0200


--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************

*** 1,390 ****
- .\" @(#)$Id: Config.guid,v 1.1.1.1 1998/10/15 15:36:39 hurtta Exp $
- .\"
- .\" A guide to the ELM alias system and so on.
- .\" format with:
- .\" 'troff tmac.n Config.guid > Config.fmtd'
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust
- .\"
- .\"
- .\"
- .\"
- .tm Have we been run through "tbl" first?? I hope so!
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .za
- .sp |3.0i
- .ce 99
- .ps 20
- \f3Elm Configuration Guide\f1
- .sp 4
- .ps 12
- .ss 14
- .vs 14
- \f2How to install and customize the Elm mail system\f1
- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp |9.0i
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .ps 10
- .ss 12
- .vs 12
- .fi
- .ad
- .bp 1
- .fi
- .ad
- .bp 1
- .sv 5v
- .ps 14
- \f3Elm Configuration Guide\f1
- .ds h0 "Elm Configuration Guide
- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- .sp 2
- Syd Weinstein
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- This document is intended as a supplement to the \f2Elm Users Guide\f1
- and \f2Elm Reference Guide\f1
- and should be of interest mainly to people at a site installing,
- maintaining, and/or modifying the source code to the Elm mail system.
- .sp
- It is \f2required\f1 that installation be done by using the
- \f2Configure\f1 script supplied with the system. Please see the
- file \f2Instruct\f1 for further information on running \f2Configure\f1.
- .sp
- The remainder of this document discusses the various questions
- asked by the \f2Configure\f1 script and the
- options available via direct editing of various files and
- parameters. As indicated above, almost all of the sites that install
- Elm should find the \f2Configure\f1 script more than
- sufficient.
- .hu Using \f2Configure\fP
-
- \f2Configure\fP is a shell script that automatically determines the
- type of system it is running on and tunes the parameters of Elm to fit
- that system and its environment. Where the installer has a choice, it
- asks questions of the installer. \f2Configure\fP provides its own
- instructions when run, so they are not repeated here. However, when
- the installer is presented with a choice, this next section explains
- some of the options available. Not all the questions or options to
- those questions are explained here.
- .sp
- .ne 6
- \f3Use fcntl style locking?\f1
- .br
- \f3Use flock style locking?\f1
- .br
- \f3Use dotlock (.lock) style locking?\f1
- .sp
- Elm, like all Mail User Agents (MUAs), has times when it needs exclusive
- access to the mail spool file. There are three methods of locking the
- mail spool file: \f2.lock\f1 files, \f2fcntl\f1, and \f2flock\f1.
- \&\f2.lock\f1 files is the original method,
- and is used by MUAs and Mail Transport Agents (MTAs). Whenever
- possible \f2.lock\f1 files should be enabled to assure backwards
- compatibility with older MUAs and MTAs.
- .sp
- BSD systems introduced \f2flock\f1 style locking. It uses the
- \f2flock(2)\f1 system call
- to lock the file on the local node. System V later introduced
- \f2fcntl\f1 style locking, which can also use a protocol for remote locking
- across the network. Where both styles are available, it is advisable
- to use both, unless you are sure that only one is in use at your site.
- Under many System V Release 4 (SVR4) systems, they both use the same underlying
- system call (\f2flock\f1 is translated into \f2fcntl\f1 style locking),
- so for that version of
- .ux ,
- \f2flock\f1 is not needed and \f2fcntl\f1 style alone can be used.
- .sp
- .ne 4
- \f3Enable calendar feature?\f1
- .sp
- Elm has a feature to take specially marked lines within mail messages
- and add them to a file for use by the system calendar program. The
- command to do this extraction needs to be enabled to work. There is
- also a follow on question regarding the name of the calendar file:
- .sp
- .ti .5i
- \f3Default calendar file?\f1
- .sp
- which is usually \f2calendar\f1 on most systems. This file resides in
- the user's home directory, not their \f2.elm\f1 directory.
- .sp
- .ne 5
- \f3Does your /etc/passwd file keep full names in Berkeley/V7 format (name
- first thing after \*q:\*u in GCOS field)?\f1
- .sp
- Elm uses the full name from the password file if it is available.
- There are two major ways this name is stored. Berkeley/V7 systems
- place the name as the entire GCOS field string, that is it starts
- directly after the \*q:\*u that delimits the fields. USG (UNIX Systems
- Group, or AT&T) systems put the user's name after a department number
- and separate it from that number by a hyphen (\*q\-\*u).
- The end of the user's full
- name in these systems is a \*q(\*u. Look at your \f2/etc/passwd\f1 file and if
- either version applies, answer \f2yes\f1 to this question; if neither
- applies, answer \f2no\f1. Elm can still get the user's name from the
- \&\f2.fullname\f1 file in their home directory.
- .sp
- .ne 6
- \f3Every now and then someone has a gethostname()/uname() that lies about
- the hostname but can't be fixed for political or economic reasons.
- Would you like to pretend gethostname()/uname() isn't there and maybe
- compile in the hostname?\f1
- .sp
- Elm needs to know the correct name of the host on which it is executing
- to be able to create the proper headers for the outbound mail. Some
- systems use one name for uucp and another name for the system and
- others just don't reply to the subroutines with the proper name. In
- this case it will be necessary to compile in the name. In all other
- cases this should not be needed. It is provided just in case there is
- a problem with your system.
- .sp
- .ne 4
- \f3Honors Content-Length: header?\f1
- .sp
- Starting with SVR4, many of the MTAs are
- binary transparent. This allows for sending binary messages, such as
- encoded voice or graphics. In doing so, they no longer can tolerate changes in
- the message content by the mailers to aid in determining the start of
- the next message. To solve this problem the \f3Content-Length:\f1 header was
- added. Elm generates the \f3Content-Length:\f1 header, but to make full use
- of it, Elm should also not escape such sequences as \*QFrom \*U at the
- start of a line of the message. If your MTA (mailer)
- does honor the \f3Content-Length:\f1 header for determining the start of the
- next message, answer this question \f2yes\f1.
- .sp
- Along the same lines, but now obsolete and being phased out, is a
- problem where an MTA thinks a message is terminated
- by a single lone period on a line. \f2sendmail\f1 has an option to turn off
- this behavior and this option is set by default in \f2Configure\f1. If your
- mailer cannot turn off this option, add a line to \f2sysdefs.SH\f1 to define
- the symbol \f3NEED_LONE_PERIOD_ESCAPE\f1. This symbol turns a line with
- a lone period into a period and a blank to avoid this problem.
- This symbol is ignored if the \*QHonors Content-Length: header?\*U question
- is answered \f2yes\f1.
- .sp
- .ne 4
- \f3Am I going to be running as a setgid program?\f1
- .sp
- On USG and many other type systems, access to the mailboxes and
- the mailbox directory is via the group permissions. The MUAs,
- such as Elm, need write access in this directory to be able
- to move the mailbox around for internal editing and to create lock
- files. If the permissions on your mailbox directory are \*Qdrwxrwxr-x\*U
- (no write access for \*Qothers\*U),
- then Elm needs to be a \f2setgid\f1 program.
- .sp
- .ne 4
- \f3What is the default editor on your system?\f1
- .sp
- If no editor is specified in the user's \f2.elm/elmrc\f1 file, this is
- which editor to use. The editor is used to compose outbound mail
- messages.
- .sp
- .ne 4
- \f3What pager do you prefer to use with Elm?\f1
- .sp
- This is the standard pager to use for reading messages. Besides the
- usual system pagers, two Elm specific internal options exist: \f2builtin\f1
- and \f2builtin+\f1. The \f2builtin\f1 pager is faster to execute but much less
- flexible than the system provided pagers. The \f2builtin+\f1 pager just clears
- the page before displaying the next page, otherwise the two versions
- are identical.
- .hu Other Configurable Parameters
- The following parameters rarely need to be changed, but are provided if
- you need them. \f2Configure\fP does not prompt for their values. To
- change them, edit the \f2hdrs/sysdefs.h\f1 file directly after running
- \f2Configure\f1.
- .lp MAX_IN_WEEDLIST 1.0i
- The maximum number of headers that can be specified in the weedout
- list of the \f2.elm/elmrc\f1 file. A suggested alternative approach if this
- number is too small is to specify initial substrings in the file
- rather than increasing the number. For example, say you want to
- weedout the headers \*QLatitude:\*U and \*QLatitudinal-Coords:\*U, you
- could simply specify \*QLatitud\*U and match them both! Furthermore
- you could also specify headers like \*QX\-\*U and remove all the user
- defined headers!
- .lp MAX_HOPS 1.0i
- When using the \f3group reply\f1 command, this is the maximum number of
- hops that a message can have taken. This is used to try to optimize the
- return address (remove cyclic loops and so on) and regular use
- should show that the default of 35 is plenty more than you'll
- ever need!
- .lp system_text_file 1.0i
- This is the source text file for the system level aliases.
- See either the \f2newalias\f1 man page or \f2The Elm
- Alias System Users Guide\f1 for further details.
- .lp system_hash_file 1.0i
- This is the file that contains the hashed version of the system
- aliases generated by \f2newalias\f1.
- .lp system_data_file 1.0i
- This is the other file the \f2newalias\f1 command installs in the system
- alias area and contains the actual addresses for each of the aliases
- contained in the hashed data file.
- .lp DEBUGFILE 1.0i
- The name of the file to put in the user's home directory if they choose to
- use the \f3\-d\f1 (\f3debug\f1) option.
- .lp OLDEBUG 1.0i
- The name of the file to save the previous debug output as (this feature
- was added to ensure that users wanting to mail bug reports wouldn't
- automatically overwrite the debug log of the session in question).
- .lp temp_lock_dir 1.0i
- Directory for lock files for XENIX.
- .lp temp_file 1.0i
- Temporary file for sending outbound messages.
- .lp temp_form_file 1.0i
- A place to store temporary forms (for Forms Mode) while answering them.
- .lp temp_mbox 1.0i
- Place to keep a copy of the incoming mailbox to avoid collisions with newer
- mail.
- .lp temp_print 1.0i
- File to use when creating a printout of a message.
- .lp temp_edit 1.0i
- File to use when editing the mailbox file on XENIX.
- .lp temp_uuname 1.0i
- Where to redirect output of the \f2uuname\f1 command.
- .lp mailtime_file 1.0i
- File to compare date to to determine if a given message is new
- since the last time the mail was read or not.
- .lp readmsg_file 1.0i
- File to use when communicating with the \f2readmsg\f1 program (see
- that program for more information).
- .lp smflags 1.0i
- Defines the options to hand to \f2sendmail\f1 if and when the program
- chooses to use it.
- .lp smflagsv 1.0i
- Defines the options to hand to \f2sendmail\f1 in verbose voyeur mode.
- .lp mailer 1.0i
- If you don't have \f2sendmail\f1, this is the mailer that'll be used.
- .lp helpfile 1.0i
- The help file name prefix.
- .lp ELMRC_INFO 1.0i
- The file containing textual messages associated with each
- Elm variable setting in the user's \f2.elm/elmrc\f1
- file. This is used when the user chooses to save the
- options from within the main program.
- .lp elmrcfile 1.0i
- The name of the automatic control file within the \f2.elm\f1
- directory (by default \f2elmrc\f1).
- .lp old_elmrcfile 1.0i
- When a new \f2elmrc\f1 file is saved, the old one is also saved by
- renaming it to whatever this identifier is set to.
- .lp system_rc_file 1.0i
- The name of the global \f2elmrc\f1 file (default is \f2$lib/elm.rc\f1). This
- is where the system administrator puts global default values for any
- parameters controlled by the \f2.elm/elmrc\f1 file.
- .lp mailheaders 1.0i
- The name of the optional file that users may have that is
- included in the headers of each outbound message.
- .lp dead_letter 1.0i
- If the user decides not to send a message it is instead saved
- to this filename in their home directory.
- .lp unedited_mail 1.0i
- In the strange case when the mailer suddenly finds all the directories
- it uses shut off (like \f2/usr/mail\f1 and \f2/tmp\f1)
- then it'll put the current
- mailbox into this file in the user's home directory.
- .lp newalias 1.0i
- How to install new aliases (note that you MUST have the \f3\-g\f1 option!).
- .lp readmsg 1.0i
- What the \f2readmsg\f1 program is installed as.
- .hu Runtime configuration \(em the global \f2$lib/elm.rc\fP file
-
- No global default file is provided as part of the installation of
- Elm. If you wish to override any default parameters for all
- users, create a file as defined in the \f3system_rc_file\f1 above. An
- easy way to create it is to copy a saved \f2.elm/elmrc\f1 and edit it
- to remove all user-specific parameters. Of particular interest are
- three additional parameters you may set: \f3hostdomain\f1, \f3hostfullname\f1,
- and \f3hostname\f1. See \f3String Variables\f1 in section 2
- of the \f2Elm Reference Guide\f1 for details on these variables.
- .hu When \f2Configure\fP Fails
-
- The \f2Configure\f1 script has run successfully tens of thousands of
- times. But maybe your system is the one in ten thousand that will
- confuse it. For example, \f2Configure\f1 assumes that if your system
- has a feature it would like, then it should be used. If vendors never
- made mistakes, then that might be a good assumption. In reality,
- \f2Configure\f1 might want to use a feature you'd prefer it didn't.
- .sp
- When \f2Configure\f1 completes its examination of your system, it
- gives you a final chance to make changes. When \f2Configure\f1 asks
- .sp
- .ti .5i
- \f3If you need to edit config.sh, do it as a shell escape here:\f1
- .sp
- you may briefly jump out of \f2Configure\f1 to make changes. For
- example, if \f2vi\f1 is your preferred editor, type \f3!vi config.sh\f1.
- .sp
- Unfortunately, \f2Configure\f1 makes the same mistakes every time it
- runs. This means that if you ever apply updates or changes to the
- Elm system and rerun \f2Configure\f1, you will have to manually make
- the same configuration changes. Or more likely, you'll forget that
- the changes are required.
- .sp
- The solution to this problem is to create a \f2config.over\f1 file
- in the Elm base directory. This file may contain any valid \f2sh\f1
- commands, and is loaded by \f2Configure\f1 immediately before the
- \f2config.sh\f1 file is created.
- For example, supposed that \f2Configure\f1 creates a \f2config.sh\f1
- file with the definition
- .sp
- .ti .5i
- \f3d_feature=define\f1
- .sp
- but instead you want it to say
- .sp
- .ti .5i
- \f3d_feature=undef\f1
- .sp
- All you need to do is create a \f2config.over\f1 file and put that
- final line in it.
--- 0 ----
Index: elm2.4.ME+.122-cvs/doc/elm.1
*** elm2.4.ME+.121/doc/elm.1 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.122-cvs/doc/elm.1 2005-07-01 19:05:29.000000000 +0300
***************
*** 6,12 ****
.\}
.TH ELM 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
! elm - an interactive mail system
.SH SYNOPSIS
.B elm
[
--- 6,12 ----
.\}
.TH ELM 1L "Elm Version 2.4ME+" "Kari Hurtta"
.SH NAME
! elm ME - an interactive mail system, Millenium Edition
.SH SYNOPSIS
.B elm
[
***************
*** 170,175 ****
--- 170,178 ----
Write .elm/elmrc and .elm/mime.options in startup. Useful if your .elm/elmrc
have errors.
.TP
+ .B " -y"
+ Don't enter \fBElm\fR if no unread mail is pending.
+ .TP
.B " -z"
Zero - don't enter \fBElm\fR if no mail is pending.
.TP


***************
*** 258,264 ****
.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

--- 261,267 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 1996-2005 by Kari Hurtta
.br
Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br

Index: elm2.4.ME+.122-cvs/doc/Elm.cover
*** elm2.4.ME+.121/doc/Elm.cover 2002-01-26 13:14:45.000000000 +0200


--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************

*** 1,69 ****
- .\" @(#)$Id: Elm.cover,v 1.2 1998/10/20 19:57:19 hurtta Exp $
- .\"
- .\" Cover sheet for the ELM mail system...
- .\" format with
- .\" troff tmac.n Elm.cover > Coversheet.fmtd'
- .\"
- .\" Elm is now in the public trust.
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust
- .\"
- .\"
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 8
- .lg 0
- .nf
- .na
- .rs
- .za
- .sv |2.0i
- .ce 99
- .ps 28
- \fBThe \s30Elm\s28 Mail System\fR
- .sp 2
- .ps 18
- .ss 16
- .vs 20
- \fIA Replacement Mailer for All Unix Systems\fR
- .sp 3
- \fBUSENET VERSION\fR
- .sp
- (2.4 Release System)
- .ps 14
- .vs 16
- .sp
- Syd Weinstein, Elm Coordinator
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 5
- .ps 10
- .ss 10
- .vs 12
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s11@\s10intuitive.com \ or \ limbo!taylor
-
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .sp
- .fi
- NOTICE: You may, without additional permission from the authors, distribute
- copies of the Elm Documentation, with or without additions developed by
- you or by others at no charge or at a charge that covers the cost of
- reproducing the copies, provided that the Elm copyright notice is retained.
--- 0 ----
Index: elm2.4.ME+.122-cvs/doc/elm-help.0
*** elm2.4.ME+.121/doc/elm-help.0 2003-11-15 18:19:06.000000000 +0200
--- elm2.4.ME+.122-cvs/doc/elm-help.0 2005-02-20 16:16:45.000000000 +0200
***************
*** 26,33 ****


^D Delete messages with a specified pattern

^E Extract PGP public keys from current message

e Edit current folder
- f Forward current message

^F Forget passphrase


g Group (all recipients) reply to current message

h Headers displayed with message

J Increment current message by one

--- 26,34 ----


^D Delete messages with a specified pattern

^E Extract PGP public keys from current message

e Edit current folder
^F Forget passphrase
+ F Flag current message (as important)


+ f Forward current message

g Group (all recipients) reply to current message

h Headers displayed with message

J Increment current message by one

Index: elm2.4.ME+.122-cvs/doc/elmlibregister.1
*** elm2.4.ME+.121/doc/elmlibregister.1 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.122-cvs/doc/elmlibregister.1 2005-04-30 09:57:41.000000000 +0300
***************
*** 36,41 ****
--- 36,46 ----
Read global configuration files only (by default user
configuration files are read.)
.TP
+ .B " -c \fIold-values\fR "
+ Records old values for options (which gives errors) to
+ -I old-values
+ file.
+ .TP
.B " -d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR "
Debug - set specified debug level - Output to "$HOME/ELMLIBREGISTER:debug.info"
if
***************
*** 60,63 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003 by Kari Hurtta
--- 65,68 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003,2005 by Kari Hurtta
Index: elm2.4.ME+.122-cvs/doc/elmrc-info
*** elm2.4.ME+.121/doc/elmrc-info 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/doc/elmrc-info 2005-07-05 20:53:37.000000000 +0300
***************
*** 1,4 ****


! #@(#)$Id: elmrc-info,v 1.67 2004/09/11 10:42:07 hurtta Exp $
# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.78 2005/07/05 17:53:37 hurtta Exp $


# Elm Version 2.4ME+
#
#$HDR - magic line to mark comments to put at top of user's elmrc file.

***************
*** 68,73 ****
--- 68,76 ----
# See also: allow-charset-switching, displaycharset, page-known-charsets,
# auto-attachment

+ dead-letter-dir
+ # Name of Canceled.mail.dir
+
shell
# The shell to use for shell escapes
# If not set value from passwd is used
***************
*** 87,92 ****
--- 90,109 ----

mailpermissions
# permissions to be given to newly-created saved mail files, default rw-------
+
+ mime-parameters
+ # Handling of RFC 2231 encoded mime parameters.
+ # Possible values: plain just use and generate plain
+ # non-encoded parameters
+ # encoded generate RFC 2231 encoded mime
+ # parameters, if needed
+ # plain-and-encoded Generate RFC 2231 encoded and
+ # plain ascii parameter values
+ #
+ # This parameter do not effect RFC 2231 language mark on mime encoded
+ # words!
+ #
+ # This is specially used for filename -parameter on content-disposition

tmpdir
# where to place temporary files, default directory is "/tmp"
***************
*** 133,138 ****
--- 150,172 ----

sortby
# how to sort folders, "Reverse Sent" by default
+ # Possible values: sent, reverse-sent
+ # thread, reverse-thread
+ # received, reverse-thread
+ # sender, reverse-sender
+ # size, reverse-size
+ # subject, reverse-subject
+ # mailbox, reverse-mailbox
+ # status, reverse-status
+ #
+ # See also: unstable-reverse-thread
+
+ unstable-reverse-thread
+ # If set, reverse thread sorting is based on lastest message on thread.
+ # Therefore thread moves to new location, when new message arrives to
+ # thread.
+ #
+ # See also: sortby

sort-thread-max-time
# What is maximum time in days between mails so that
***************
*** 140,145 ****
--- 174,182 ----

aliassortby
# how to sort the alias list, "Name" by default
+ # Possible values: alias, reverse-alias
+ # name, reverse-name
+ # text, reverse-text

print
# how to print a message ('%s' is the filename)
***************
*** 308,313 ****
--- 345,353 ----
prompt-after-pager
# prompt for a command after the external pager exits?

+ prompt-metamail
+ # Ask from user, should metamail be called?
+
browser-wildcard-matching
# If '*' or '?' are used on filename prompts, should these interprete
# as wildcards?
***************
*** 435,440 ****
--- 475,488 ----
# See also: page-known-charsets, allow-charset-switching, local-fs-charset,
# text-charset

+
+ local-dir-sortby
+ # How to sort local files and folders on folder and file browser?
+ # Possible values: none
+ # name, reverse-name
+ # mtive, reverse-mtime
+ # See also: imap-dir-sortby
+
local-fast-lookup
# If set indicates that directory listing not needed for lookup.


# Need to be unset, if same character on local-fs-charset has several

***************
*** 505,510 ****
--- 553,569 ----
#
# See also: page-known-charsets, compatcharsets

+ locale-charsets
+ # For these charsets is type type unknown used for system (locale)
+ # charset, even when Elm ME+ is builtin defination for charset.
+ #
+ # Available only if system supports wide characters and
+ # __STDC_ISO_10646__ is defined.
+ #
+ # This option may cause error message
+ # Unknown charsets are unsupported as keyboard input!
+ # to be printed in that case this option can not be used for given charset.
+
configoptions
# list of options that can be configured at the "o)ptions" screen

***************
*** 671,676 ****
--- 730,740 ----
# none Don't call gpg
# /path Call gpg via that path, if it is executable

+ pgp-encrypt-type
+ # Specifies content-type for pgp encrypted messages.
+ # Possible values are: application/pgp, text/plain, text/x-pgp
+
+
pgp-interactive
# Run pgp/gpg signing and encryption always on interactive mode

***************
*** 724,729 ****
--- 788,798 ----
pop-show-greeting
# Show server greeting?

+ imap-dir-sortby
+ # How to sort IMAP folders on folder browser?
+ # Possible values: none
+ # name, reverse-name
+ # See also: local-dir-sortby

imap-charset
# Character set used with IMAP
***************
*** 830,836 ****
# These libraries are loaded on startup and relocated to variables
# use-base-library and use-connect-library
#
! # See also: use-base-library, use-connect-library

use-base-library
# Specify tags for shared libraries, which should be loaded.
--- 899,905 ----
# These libraries are loaded on startup and relocated to variables
# use-base-library and use-connect-library
#
! # See also: use-base-library, use-connect-library, use-mailer-library

use-base-library
# Specify tags for shared libraries, which should be loaded.
***************
*** 838,847 ****
use-connect-library
# Specify tags for shared libraries, which should be loaded.



internal-mailcaps
# List of mailcaps for internal mailcap support (without metmail).
# List may be space or ':' seperated. Separate values may be quoted.
! # Set value to "none" to disable internal mailcap support.
# See also: metamail-mailcaps, internal-mailcap-trusted-programs

internal-mailcap-trusted-programs

--- 907,919 ----
use-connect-library
# Specify tags for shared libraries, which should be loaded.

+ use-mailer-library
+ # Specify tags for shared libraries, which should be loaded.
+

internal-mailcaps
# List of mailcaps for internal mailcap support (without metmail).
# List may be space or ':' seperated. Separate values may be quoted.
! # Set value to "none" (without quotes) to disable internal mailcap support.
# See also: metamail-mailcaps, internal-mailcap-trusted-programs

internal-mailcap-trusted-programs

***************
*** 862,864 ****
--- 934,946 ----
# (for example $MAILCAPS). Value of variables is splitted only from ':'
# (quotes and spaces are not treated specially.)
# See also: internal-mailcaps
+
+ verify-domain
+ # If set mail domains are verified by gethostbyname().
+ # Error HOST_NOT_FOUND is treated as nonexisting domain and error NO_ADDRESS
+ # is treated as valid mail domain.
+
+ verify-local-address
+ # If set usernames of local addresses are verified. Using this option
+ # requires that on global elm.rc have "verify=yes" on mailer -option.
+
Index: elm2.4.ME+.122-cvs/doc/elmrc-write.1
*** elm2.4.ME+.121/doc/elmrc-write.1 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.122-cvs/doc/elmrc-write.1 2005-04-30 09:57:41.000000000 +0300


***************
*** 32,37 ****
--- 32,42 ----

Read global configuration files only (by default user
configuration files are read.)
.TP
+ .B " -c \fIold-values\fR "
+ Records old values for options (which gives errors) to
+ -I old-values
+ file.
+ .TP
.B " -d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR "
Debug - set specified debug level - Output to "$HOME/ELMRC-WRITE:debug.info"
if
***************
*** 56,60 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2001,2002 by Kari Hurtta

--- 61,65 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2001-2005 by Kari Hurtta

Index: elm2.4.ME+.122-cvs/doc/elmregister.1
*** elm2.4.ME+.121/doc/elmregister.1 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/doc/elmregister.1 2005-04-15 20:37:48.000000000 +0300
***************
*** 17,22 ****
--- 17,26 ----
.B #LIB#/elmregister replay
.br
.B #LIB#/elmregister unstage
+ .br
+ .B #LIB#/elmregister rpm-list
+ .br
+ .B #LIB#/elmregister filter -M module -w target
.SH SUB-COMMAND SYNOPSIS
.B #LIB#/elmregister mkdir
.br
***************
*** 100,105 ****
--- 104,121 ----
.I "elmregister unstage"
after
.I "elmregister replay"
+ .PP
+ Command
+ .I #LIB#/elmregister rpm-list
+ can be used to generate file listing suitable for
+ rpm
+ .I %files
+ section.
+ Command
+ .I #LIB#/elmregister filter
+ can be used to generate file listing of certain module
+ (without -M gives listing of files which have not
+ marked for certain module.)
.SH AUTHOR
Kari Hurtta
.SH FILES
***************
*** 107,110 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003, 2004 by Kari Hurtta
--- 123,126 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003-2005 by Kari Hurtta
Index: elm2.4.ME+.122-cvs/doc/Form.guide
*** elm2.4.ME+.121/doc/Form.guide 2002-01-26 13:14:45.000000000 +0200


--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************

*** 1,402 ****
- .\" @(#)$Id: Form.guide,v 1.2 1998/10/20 19:57:19 hurtta Exp $
- .\"
- .\" A guide to using the Elm Forms mode
- .\" format with:
- .\" 'troff tmac.n - > Forms.format'
- .\"
- .\" Elm is now in the public trust.
- .\"
- .\" Copyright (c) 1988-1992 USENET Community Trust
- .\" Copyright (c) 1986,1987 Dave Taylor
- .\"
- .\"
- .\"
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .\" Define the big box macro for troff
- .de eb
- .sp -1
- .nf
- .ie t \{\
- \h'-.5n'\L'|\\nau-1'\l'\\n(.lu+1n\(ul'\L'-|\\nau+1'\l'|0u-.5n\(ul'
- .\}
- .el \{\
- \h'-.5n'\l'\\n(.lu+1n'
- .\}
- .fi
- ..
- .sv |3.0i
- .ce 99
- .ps 20
- .ss 18
- .vs 12
- \f3Elm Forms Mode Guide\f1
- .sp 3
- .ps 12
- .ss 14
- .vs 14
- \f2What Forms Mode is, how to use it to create
- custom forms, how to reply to forms, and how to
- use it for AT&T Mail messages\f1
- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp |9.0i
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .fi
- .ad
- .bp 1
- .sv 5v
- .ps 14
- .ss 12
- .vs 16
- .sp 2
- \f3A Guide to Forms Mode in Elm\f1
- .ds h0 "Forms Mode Guide
- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- Syd Weinstein
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- While there are a lot of mail systems that allow the transmission
- of text and primitive pictures, to send and reply to more complex
- forms is simply not possible. Elm, however, took
- the forms mode implemented as part of the AT&T Mail package and has
- expanded on it to be a smoothly fit part of the overall mail system.
- .sp
- Forms mode gives you the ability to send \*Qtemplate\*U files to people
- and receive the filled-in replies.\s-2\u1\d\s0
- .fn
- 1. Note that this feature assumes that the person on the other end is
- also using the Elm mail system, that both yourself and the person on
- the other end have their user levels set to something other than
- \f2Beginner\f1 (\f30\f1) and the \f3forms\f1 variable set ON in
- their \f2.elm/elmrc\f1 files.
- .ef
- Let's look at an example right off.
- .sp
- Say we were going to use computer mail as a way to file defects with
- software. There is a certain amount of information we want to be able
- to collect when each report is made, and if it is in a specific format
- we can use programs to file the defects upon receipt.
- .sp
- The form we'll try to emulate starts out looking like:
- .\" A manual page break has been done because the 'sd' macro doesn't like
- .\" coming up right after the footer or just doesn't like going to a new
- .\" page by itself. The bug has been reported.
- .bp
- .ft CW
- .zf
- .sd c
- .mk a
- .sp
- .tl ''Defect Reporting Form''
- .sp
- .tl 'Program:\ \l'2.3i-\w'Program:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
- .tl 'Operating\ System:\ \l'2.3i-\w'Operating\ System:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
- .sp
- .tl 'Defect\ Type:\ \l'2.3i-\w'Defect\ Type:\ 'u''''
- .sp
- .tl 'Date\ Found:\ \l'2.3i-\w'Date\ Found:\ 'u'''By\ Whom:\ \l'2.3i-\w'By\ Whom:\ 'u'\h'.2i''
- .tl 'Date\ Reported:\ \l'2.3i-\w'Date\ Reported:\ 'u'''Phone:\ \l'2.3i-\w'Phone:\ 'u'\h'.2i''
- .sp
- .tl 'Description:\ \l'6.4i-\w'Description:\ 'u''''
- .tl '\l'6.4i''''
- .tl '\l'6.4i''''
- .sp
- .eb
- .ed
- .ft 1
- .rs \" restore spacing from ed macro
- .sp
- This form can actually be created almost exactly as listed above in
- the Elm mail system by using your standard editor and can then
- be mailed about as needed.
- .sp
- Let's say that we want a bit more information, however, especially with
- fields like \f2Defect Type\f1, we want to list all the recommended answers.
- To create the actual form, we need merely to replace the underlines in
- the above form with spaces. The multi-line comments can simply be
- indicated by a \*q:\*u by itself on a line:
-
- .ft CW
- .zf
- .sd c
- .mk a
- .sp
- .tl ''Defect Reporting Form''
- .sp
- .tl 'Program:''Version:\h'1.7i-\w'Version:'u''
- .tl 'Operating System:''Version:\h'1.7i-\w'Version:'u''
- .sp
- .tl '(Valid Defect Types are: user-error, doc-error, fatal, other)'''
- .tl 'Defect Type:'''
- .sp
- .tl 'Date Found:''By\ Whom:\h'2.3i-\w'By\ Whom:'u''
- .tl 'Date Reported:''Phone:\h'2.3i-\w'Phone:'u''
- .sp
- .tl 'Description'''
- .tl ':'''
- .sp
- Thank you for filling in this form.
- .sp 2
- .eb
- .ed
- .ft 1
- .rs \" restore spacing from ed macro
- .sp
- As you can see, it is quite simple to create forms!!
- .sp
- Now that you have an idea what we're talking about, let's actually officially
- define the system.
- .br
- .ne 5
- .hu Forms Mode Specification
-
- [Note that this is all taken from the document \f2Standard for Exchanging
- Forms on AT&T Mail\f1, Version 1.9 of 6/7/86, from AT&T.]
- .sp
- The forms mode is really quite simple. Simple enough that it is amazing
- that it hadn't been implemented before AT&T Mail came along!!
- .sp
- In a nutshell, each field is delimited by a \*q:\*u followed by a number of
- blank spaces or tabs that represent the valid size for that field. That
- is, if we have a line in the form like:
- .sp
- .nf
- .ft CW
- .zf
- .tl ''Phone (area-code):\0\0\0\0\0Number:\0\0\0\0\0\0\0\0\0\0''
- .ft 1
- .fi
- .sp
- The area-code field is limited to three characters and the number to nine
- (this is kind of hard to see with the proportionally spaced formatted copy,
- alas).
- The only exception to the rule is that a \*q:\*u by itself on a line represents
- a field that is as large as the user entering the data desires.
-
- The actual form that is transmitted, in AT&T Mail parlance, is a \*QSIMPLE\*U
- forms handler message (as opposed to the \*QADVANCED\*U handler). This means
- that it contains three sections:
- .sp
- .ne 8
- .nf
- .in .5i
- .ft 2
- The Message Header
- .ft CW
- .zf
- [\&OPTIONS-SECTION]
- ***
- [\&FORMS-IMAGE]
- ***
- [\&RULES-SECTION]\f1
- .in 0
- .fi
- .sp
- Elm generates form messages with the \f2OPTIONS-SECTION\f1 filled out,
- but ignores it when receiving mail. The filled out \f2OPTIONS-SECTION\f1 is:
- .sp
- .ft CW
- .zf
- .nf
- .in .5i
- WIDTH=80
- TYPE=SIMPLE
- OUTPUT=TEXT\f1
- .in 0
- .fi
- .sp
- The \f2FORMS-IMAGE\f1 section is that described above, i.e. prompting
- text followed by a \*q:\*u, followed by spaces or tabs.
- The \f2RULES-SECTION\f1 can
- contain explicit rules about the possible values of each field, but
- this is currently ignored by Elm, being a \*QSIMPLE\*U forms mode
- mail system.
- .sp
- Forms also have the header \*QContent-Type: mailform\*U to indicate to the
- mail system (either Elm or AT&T Mail) that a form is being sent.
- .sp
- Elm further indicates that a form has been received by having an
- \*qF\*u as the status character in the header display section (instead of
- \*qN\*u for new, etc).
- .br
- .ne 5
- .hu Composing and Sending a Form
-
- The first step to enable sending forms is to change the setting of
- the variable \f3forms\f1 in your \f2.elm/elmrc\f1 file to ON:
- .sp
- .nf
- .ti .5i
- forms = ON
- .fi
- .sp
- The next step is to send the message to someone using the \f3m\f1 (\f3mail\f1)
- command, which drops you into an editor. Type in the form as
- indicated above, with appropriate colons and comments, and end the entry
- by leaving the editor.
- .sp
- The prompt is now:
- .sp
- .nf
- .ft CW
- .zf
- .tl ''Choose: E)dit msg, edit H)eaders, M)ake form, S)end or F)orget : @''
- .ft 1
- .fi
- .sp
- so we choose \f3m\f1 \(em \f3make form\f1. Elm then either
- rewrites the prompt without the \*QM)ake form\*U option, indicating that
- the form has been accepted, or indicates the problem and gives you
- a chance to correct it.
- .sp
- Once it has been accepted, simply use the \f3s\f1 \(em \f3send message\f1 \(em
- command and it's off!
- .sp
- Note that you cannot reply to a message with a form.
- .br
- .ne 6
- .hu Replying to a Form
-
- Let's reply to the form message we generated now. The header page of the
- Elm mail system indicates that the message is a form by having
- an \*qF\*u next to it. So we use \f3r\f1 to reply and the screen is immediately
- cleared and we're prompted, field by field, for the data requested.
- Each field has underscores in the input area to indicate the size field that
- is expected.
- .sp
- After answering all the questions we'll have a screen that looks like:
-
- .ft CW
- .zf
- .sd c
- .mk a
- .sp
- .tl ''Defect Reporting Form''
- .sp
- Program: \f3The Elm Mail System\f1\l'3i-\w'\f3The Elm Mail System'u'
- Version: \f31.5\f1\l'3i-\w'\f31.5'u'
- Operating System: \f3HP-UX\f1\l'3i-\w'\f3HP-UX'u'
- Version: \f35.141 C\f1\l'3i-\w'\f35.141 C'u'
- .sp
- (Valid Defect Types are: user-error, doc-error, fatal, other)
- Defect Type: \f3fatal\f1\l'5i-\w'\f3fatal\f1'u'
- .sp
- Date Found: \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u'
- By Whom: \f3Dave Taylor\f1\l'3i-\w'\f3Dave Taylor\f1'u'
- Date Reported: \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u'
- Phone: \f3(415) 857\-6887\f1\l'3i-\w'\f3(415) 857-6887\f1'u'
- .sp
- Description
- (Enter as many lines as needed, ending with a \*q.\*u by itself on a line)
- \f3When running it on a CPM system I cannot compile successfully.\f1
- \f3.\f1
- Thank you for filling in this form.
- .tl ''Choose: E)dit form, edit H)eaders, S)end or F)orget : @''
- .sp
- .eb
- .ed
- .ft 1
- .rs \" restore spacing from ed macro
- .sp
- Quite simple. Notice, however, that the order of prompting is
- left-to-right on each line, so the fields, \f2By Whom:\f1 and
- \f2Phone:\f1, although placed in what seems like a logical place on the
- form, turn out to be confusing when filling in the received form since
- it isn't clear what \f2Phone:\f1 is being asked for because of the
- intervention of the \f2Date Reported:\f1 field.
- .sp
- The message that is actually sent out from this has the
- fields in a more acceptable format:
- .\" Force page break, as there seems to be a bug in the .sd macro
- .bp
- .\"
- .ft CW
- .zf
- .mk a
- .sp
- WIDTH=80
- TYPE=SIMPLE
- OUTPUT=TEXT
- ***
- .tl ''Defect Reporting Form''
- .sp
- .tl ' Program: The Elm Mail System''Version: 1.5\h'1.5i-\w'Version: 1.5'u''
- .tl ' Operating System: HP-UX''Version: 5.141 C\h'1.5i-\w'Version: 5.141 C'u''
- .sp
- .tl ' (Valid Defect Types are: user-error, doc-error, fatal, other)'''
- .tl ' Defect Type: fatal'''
- .sp
- .tl ' Date Found: 10/9/86''By Whom: Dave Taylor\h'2.3i-\w'By Whom: Dave Taylor'u''
- .tl ' Date Reported: 10/9/86''Phone: (415) 857-6887\h'2.3i-\w'Phone: (415) 857-6887'u''
- .sp
- .tl ' Description'''
- .sp
- When running it on a CPM system I cannot compile successfully.
- .sp
- .tl ' Thank you for filling in this form.'''
- ***
- .sp
- .eb
- .ft 1
-
- .hu Comments on Forms Mode
-
- As was said at the beginning, this way of sending about forms could
- prove to be very helpful and useful in a variety of contexts. On the
- other hand, until a more sophisticated forms language is used for the
- forms, this should be sufficient to embody the power of the idea.
- .sp
- I welcome any comments and thoughts on this system and also welcome
- possible enhancements.
- .sp
- I also gratefully thank Dale DeJager of AT&T Information Systems
- for sending me more
- information on AT&T Mail than I could possibly digest in any finite
- amount of time.
--- 0 ----
Index: elm2.4.ME+.122-cvs/doc/Makefile.SH
*** elm2.4.ME+.121/doc/Makefile.SH 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/doc/Makefile.SH 2005-07-02 11:02:41.000000000 +0300
***************
*** 17,28 ****
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.31 2004/05/02 12:38:13 hurtta Exp $
#


# Makefile for the documentation of the ELM mail system
#
# (C) Copyright 1988-1992, USENET Community Trust

! #
#
# Variables
# Variables established by Configure

--- 17,32 ----
cat >Makefile <<!GROK!THIS!
#!$make
#
! # $Id: Makefile.SH,v 1.34 2005/07/02 08:02:41 hurtta Exp $


! #
! # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
! ######################################################################

! # Based on doc/Makefile.SH. That code was following copyright:
#


# Makefile for the documentation of the ELM mail system
#
# (C) Copyright 1988-1992, USENET Community Trust

! ######################################################################
#
# Variables
# Variables established by Configure
***************

*** 32,39 ****
SUBS = 's"\#LIB\#"$lib"g; s"\#ETC\#"$etc"g;'
DEST = $bin
ECHO = $echo
- FORMATTER = $roff
- FORMATTER_OPTS = $roffopts
LIB = \$(ELM_ROOT)//$lib
LN = $ln
MAN = \$(ELM_ROOT)//$mansrc
--- 36,41 ----
***************
*** 68,92 ****
REGCATMAN = $regcatman

!GROK!THIS!
- if $test "$roff" != none ; then
- cat >>Makefile <<!GROK!THIS!
- # List of formatted guides (obsolete)
- FORMATTED_LIST = Alias.fmtd \
- Config.fmtd \
- Cover.fmtd \
- Form.fmtd \
- Ref.fmtd \
- Users.fmtd
-
- !GROK!THIS!
- else
- cat >>Makefile <<!GROK!THIS!
- # No formatted quides (obsolete)
- FORMATTED_LIST =
-
- !GROK!THIS!
- fi
-


if $test "$make_sets_make" != "$define" ; then

--- 70,75 ----
***************
*** 655,680 ****
true ; \
fi

- # Dependencies and rules for formatting guides
- documentation: $(FORMATTED_LIST)
-
- Alias.fmtd: Alias.guide
- $(TBL) $? | $(FORMATTER) $(FORMATTER_OPTS) tmac.n - > $@
-
- Config.fmtd: Config.guid
- $(TBL) $? | $(FORMATTER) $(FORMATTER_OPTS) tmac.n - > $@
-
- Cover.fmtd: Elm.cover
- $(FORMATTER) $(FORMATTER_OPTS) tmac.n $? > $@
-
- Form.fmtd: Form.guide
- $(FORMATTER) $(FORMATTER_OPTS) tmac.n $? > $@
-
- Ref.fmtd: Ref.guide
- $(FORMATTER) $(FORMATTER_OPTS) tmac.n $? > $@

- Users.fmtd: Users.guide
- $(TBL) $? | $(FORMATTER) $(FORMATTER_OPTS) tmac.n - > $@

!NO!SUBS!

--- 638,644 ----
Index: elm2.4.ME+.122-cvs/doc/Ref.guide
*** elm2.4.ME+.121/doc/Ref.guide 2002-01-26 13:14:45.000000000 +0200


--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************

*** 1,2359 ****
- .\" @(#)$Id: Ref.guide,v 1.2 1998/10/20 19:57:19 hurtta Exp $
- .\"
- .\" Reference guide to the Elm mail system.
- .\" format with
- .\" troff tmac.n Ref.guide > Ref.format
- .\"
- .\" Elm is now in the public trust.
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust
- .\"
- .\"
- .\"
- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .za
- .sv |3.0i
- .ce 99
- .ps 20
- .ss 18
- .vs 12
- \f3The Elm Reference Guide\f1
- .sp 4
- .ps 12
- .ss 14
- .vs 14
- \f2A comprehensive list of all commands,
- options and such to the \f3Elm\fP mail system\f1
- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp |9.0i
- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .fi
- .ad
- .bp 1
- .sv 5v
- .ce 99
- .ps 14
- .vs 16
- \f3The Elm Reference Guide\f1
- .ds h0 "Elm Reference Guide
- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- Syd Weinstein
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by
- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- .hn 1 Introduction
-
- There are many parts to a complex software system and \f3The Elm
- Mail System\f1
- is no different. This document describes fully all the options
- available in the mailer, including the command line options,
- the commands (in considerably more detail than
- in \f2The Elm Users Guide\f1) and
- the \f2.elm/elmrc\f1 file.
-
- To be more explicit, this document covers:
- a discussion of
- the \f2.elm/elmrc\f1 file,
- command line options of Elm,
- outgoing mail processing,
- responses of various commands,
- mail archive folders,
- the Alias system,
- system aliases etc,
- more on the Elm utilities,
- and a section for expert mail users.
-
- Without any further ado, then, let's get this show on the road!!
- .sp
- .ne 8 \" footnote for UNIX forces text to next page but leaves footnote & hdr
- .hn 1 "The .elm/elmrc File"
-
- Elm, like lots of other software on the
- .ux
- system, has the ability to automatically read
- in a configuration file at each invocation. The file must be
- called \f2elmrc\f1 and reside in the \f2.elm\f1 directory located
- in your home directory. It can have any of the entries below, in any order.
- If you are missing any entries, or if you don't have an \f2.elm/elmrc\f1
- file, the default values (listed below for each option) or those values specified
- by your systems administrator in a system wide \f2elm.rc\f1 file are used.
- Note that those options below designated with \*q*\*u can be altered
- using Elm via the options screen, while those designated with a
- \*q+\*u can be placed
- on the options screen using the \f3configoptions\f1 variable.
- Also note that when you save a new \f2.elm/elmrc\f1 file via the \*q>\*u command
- of the options
- screen, it is (re)created including only those options that you
- have changed via your original \f2.elm/elmrc\f1 file or via the options screen.
-
- The format for each line of the \f2.elm/elmrc\f1 file is:
- .sp
- .nf
- .ft CW
- .zf
- .ti +.5i
- variable = value\f1
- .fi
- .sp
- .ne 8
- .hu String Variables
-
- .lp aliassortby* 1.0i
- You can have your alias display sorted by any of the following ways:
- .si 1.5i
- .lp alias 10n
- Sorts according to \f2aliasname\f1 for each address.
- .lp name 10n
- Sorts according to \f2username\f1 for each address.
- .lp text 10n
- Presents the aliases in the order found in the
- \f2aliases.text\f1 file.
- .ei
- .in 1.0i \" ei doesn't restore margin
- .sp
- Each of these fields can also optionally be prepended with the
- sequence \*Qreverse\-\*U to reverse the order of the sort. This doesn't
- imply anything about the order of the message in the \f2aliases.text\f1
- file itself and affects only their order on the display screen. The
- default is \f2name\f1 order.
-
- .lp alteditor+ 1.0i
- The editor to use when mailing to a message that already includes text,
- as the builtin editor cannot handle that situation. Messages that
- already include text are forwarded messages and replies where the
- original message is included in the reply. This value is not needed
- if the \f3editor\f1 variable is not set to \*Qbuiltin\*U.
-
- .lp alternatives 1.0i
- This is a list of other machine/username combinations
- that you receive mail from (forwarded). This is used
- when the \f2group reply\f1 feature is invoked to ensure that
- you don't send yourself a copy of the outbound message.
- The default is a list of no alternatives.
-
- .lp attribution 1.0i
- When you \f3forward\f1 a message or \f3reply\f1 to it, you can
- optionally attribute the quoted text to its original author.
- Defining the attribution string here allows you to indicate the
- form that the attribution should take. The sequence \*Q%s\*U in the
- attribution is replaced by the name of the original author.
- Examples are:
- .sp
- .nf
- .in 1.5i
- .ft CW
- .zf
- attribution = According to %s:
- attribution = %s writes:
- .ft 1
- .in 0
- .fi
-
- .lp calendar* 1.0i
- This is used in conjunction with the \*q<\*u \f2scan message for
- calendar entries\f1 command, as the file to append any found
- calendar entries to. The default is \f2calendar\f1 in your home directory.
-
- .lp charset 1.0i
- This is the character set used for messages with a
- \*QContent-Type: text/plain\*U header.
- The default depends on your site's installation, but is usually
- US-ASCII. \f3charset\f1 is only recognized if MIME
- (Multipurpose Internet Mail Extension)
- support is configured. You could set \f3charset\f1 to your preferred
- national character set, but be aware that there is currently no way
- to change it online. Also you must be aware that Elm probably needs
- \f2metamail\f1 to display messages with \f3charset\f1=US-ASCII if you change
- \f3charset\f1. Elm tries to know which character set could display US-ASCII
- too, but its list of compatible character sets is probably not complete.
-
- .lp compatcharsets 1.0i
- This is the list of character sets which are more or less a superset
- of US-ASCII. This enables Elm to display messages with \f3charset\f1=US-ASCII
- with the builtin pager, or your preferred pager, instead of calling
- \f2metamail\f1. \f3compatcharsets\f1 is only recognized if MIME support
- is configured. The ISO-8859-X character sets are defaulted.
-
- .lp configoptions 1.0i
- This is a list of letters that indicate which of the run-time
- configurable options you desire placed on the options screen (see
- section 7, \f3Commands\f1, for the \f3options\f1 command). There
- are 22 run-time configurable options, but only room for 15 on a
- 24-line screen. The default list is \f2^_cdefsopyv_am_un\f1. Two
- additional characters can be specified for formatting. Those are \*q_\*u, which
- adds a blank line, and \*q^\*u, which places the title message on that line
- instead of the bottom of the screen. The
- letters \*qi\*u, \*qq\*u, and \*qx\*u are reserved for \*Qreturn to
- index\*U, \*Qquit\*U,
- and \*Qexit\*U, respectively, and are not listed as part of the
- \f3configoptions\f1
- list. The options controlled by each letter are:
- .sp
- .in 1.5i
- .ta 0.5i
- a A)rrow cursor \f2(arrow)\f1
- .br
- b B)order on copy \f2(prefix)\f1
- .br
- c C)alendar file \f2(calendar)\f1
- .br
- d D)isplay mail using \f2(pager)\f1
- .br
- e E)ditor (primary) \f2(editor)\f1
- .br
- f F)older directory \f2(maildir)\f1
- .br
- h H)old sent message \f2(copy)\f1
- .br
- j J) reply editor \f2(alteditor)\f1
- .br
- k K) pause after pager \f2(promptafter)\f1
- .br
- l A(l)ias Sorting \f2(aliassortby)\f1
- .br
- m M)enu display \f2(menu)\f1
- .br
- n N)ames only \f2(names)\f1
- .br
- o O)utbound mail saved \f2(sentmail)\f1
- .br
- p P)rint mail using \f2(print)\f1
- .br
- r R)eply copies msg \f2(autocopy)\f1
- .br
- s S)orting criteria \f2(sortby)\f1
- .br
- t T)ext editor (~e) \f2(easyeditor)\f1
- .br
- u U)ser level \f2(userlevel)\f1
- .br
- v V)isual Editor (~v) \f2(visualeditor)\f1
- .br
- w W)ant Cc: prompt \f2(askcc)\f1
- .br
- y Y)our full name \f2(fullname)\f1
- .br
- z Z) signature dashes \f2(sigdashes)\f1
-
- .lp displaycharset 1.0i
- This is the character set which is supported by your terminal.
- The default depends on your site's installation but is usually
- US-ASCII. For sites with
- .xw
- support, ISO-8859-1
- is a reasonable default.
-
- .lp easyeditor+ 1.0i
- The editor to be used by the \*Q~e\*U escape within the builtin editor.
- The default value is the value of the configuration variable \f2emacs_editor\f1
- (see \f2The Elm Configuration Guide\f1).
-
- .lp editor* 1.0i
- The editor to use when typing in new mail. If you select
- \*Qnone\*U or \*Qbuiltin\*U you'll get a Berkeley Mail style
- interface for all mail that doesn't already have text
- in the buffer (e.g. a reply, mail with a \*Qsignature\*U, etc.)
- There are two possible formats for it, either a command that
- can have a filename appended to it before being
- executed, or a string that contains the metasequence \*Q%s\*U
- which is replaced by the name of the file before being
- executed. Examples of each are:
-
- .nf
- .in 1.5i
- .ft CW
- .zf
- editor = emacs \-nw
- editor = emacs \-nw %s \-f text-mode \-f turn-on-auto-fill
- .ft 1
- .in 1.0i
- .fi
-
- The default is to use the value of $EDITOR in your
- current environment, and if not set, an editor selected by
- the person who configured Elm for your system.
-
- .lp escape 1.0i
- The character used with the builtin editor (see \f3editor\f1 above)
- to escape from text entry to input a command.
- When a line begins with this character, the builtin editor interprets it
- as a command rather than as text to add.
- The default is \*q~\*u (tilde).
-
- .lp fullname* 1.0i
- This is the name the mailer uses in messages
- you send. It is highly recommended that you use your
- full name and nothing strange or unusual, as that can
- appear extremely rude to people receiving your mail.
- The default is to use the \*Qgcos\*U field from the \f2/etc/passwd\f1 file
- on systems that use this field to store full names, and to use the contents
- of the \f2.\|fullname\f1 file in your home directory on other systems.
-
- .lp hostdomain 1.0i
- This is the domain name of your system.
- This variable is only valid in the system-wide \f2elm.rc\f1 file.
- It is only necessary if the value returned by
- the \f2getdomainname\f1 system call is incorrect for your mail use or
- if that system call is unavailable on your system.
- If this variable is specified, then the \f3hostfullname\f1 variable must
- also be specified.
-
- .lp hostfullname 1.0i
- This is the \*Qfully qualified domain name\*U of your system.
- This variable is only valid in the system-wide \f2elm.rc\f1 file.
- It is only necessary if the value returned by the \f2getdomainname\f1 and
- \f2gethostname\f1 system calls are incorrect for your mail use or if those
- system calls are unavailable on your system. It is required if either
- the \f3hostdomain\f1 or the \f3hostname\f1 variables are used within the
- system-wide \f2elm.rc\f1 file.
-
- .lp hostname 1.0i
- This is the local node-name of your system.
- This variable is only valid in the system wide \f2elm.rc\f1 file.
- It is only necessary if the value returned by
- the \f2gethostname\f1 system call is incorrect for your mail use or if
- that system call is unavailable on your system.
- If this variable is specified, then the \f3hostfullname\f1 variable must
- also be specified.
-
- .lp localsignature 1.0i
- See \f3signature\f1.
-
- .lp maildir* 1.0i
- This is your folder directory.
- When you specify a folder name beginning with the \*q=\*u metacharacter,\s-2\u1\d\s0
- .fn
- 1. Note that \*q%\*u and \*q+\*u are synonymous with \*q=\*u throughout Elm.
- .ef
- it stands for this directory name. That is,
- if you save a message to folder \f2=stuff\f1
- the \*q=\*u is expanded to the current value of \f3maildir\f1.
- The default is the directory \f2Mail\fP in your home directory.
-
- .lp pager* 1.0i
- This is the program to be used to display messages. You can
- specify \*Qbuiltin\*U or the name of any standard pager. If you
- use \*Qbuiltin+\*U, each screenfull of displayed message is
- \*Qpaged\*U from the top of your screen with a title line,
- while \*Qbuiltin\*U simply \*Qscrolls up\*U subsequent screenfulls once
- it has \*Qpaged\*U the first screenfull.
- The default is to use the value of $PAGER in your
- current environment, and if not set, a pager selected by
- the person who configured Elm for your system, quite likely
- \*Qbuiltin+\*U.
-
- .lp precedences 1.0i
- Some mail transports look at a \*QPrecedence\*U header in outbound
- mail messages to determine how to deliver the message. The Elm header
- editing menu allows you to place a precedence on your mail messages.
- By default, Elm allows any value to be specified as the message
- precedence. This option may be used to restrict the allowed precedences
- to a particular list. For example, you might say:
-
- .nf
- .in 1.5i
- .ft CW
- .zf
- precedences = special-delivery air-mail first-class bulk junk
- .ft 1
- .in 1.0i
- .fi
-
- Exactly what precedences your mail transport supports and what they
- do (if anything at all!) will vary from site to site.
-
- The distinction between the \*QPrecedence\*U and \*QPriority\*U headers
- is subtle: the precedence tells the mail system how to handle the
- message and the priority tells the recipient how important the message
- is. Although these are quite different things, they are often related.
- This option will also allow you to associate message priorities with
- precedences. For example, you might say:
-
- .nf
- .in 1.5i
- .ft CW
- .zf
- precedences = special-delivery:urgent air-mail:urgent first-class bulk junk
- .ft 1
- .in 1.0i
- .fi
-
- In this example, if you select an \*Qair-mail\*U precedence then the
- message priority defaults to \*Qurgent\*U. If you select a
- \*Qfirst-class\*U precedence then no special priority is implied. The
- priorities given in this field are used only if you have not already
- assigned a priority to your message, and even if one is assigned via
- \f3precedences\f1 you can always go back and change it.
-
- .lp prefix+ 1.0i
- When you \f3reply\f1 to a message or \f3forward\f1 a message to another person,
- you can optionally include the original message. Defining the
- prefix value here allows you to indicate what the prefix of
- each included line should be. The default is \*Q>\ \*U (specified as
- \*Q>_\*U \(em underscore is interpreted as space) and is
- standard in the
- .ux
- community.
-
- .lp print* 1.0i
- This is the command used for printing mail messages. There are two
- possible formats for the command, depending on whether or not the command
- contains the sequence \*Q%s\*U. In the first form the mail message(s) to
- be printed are piped to the specified command. An example of this
- form is:
- .sp
- .in 1.5i
- .ft CW
- .zf
- print = print \-formfeed
- .ft 1
- .in 1.0i
- .sp
- In the second form the mail message(s) to be printed are dumped into
- a temporary file, and a \*Q%s\*U in the command string is replaced with
- the name of the temporary file. An example of this form is:
- .sp
- .in 1.5i
- .ft CW
- .zf
- print = pr %s | lpr
- .ft 1
- .in 1.0i
- .sp
- Another significant difference between the two forms is that in the
- second form all output from the command is discarded, but in the first
- form all output is displayed on the terminal. For
- example, if you wish to use the \*Qpass-through\*U feature to print on
- the \*Qaux\*U port of a terminal, you must use the first form. The second
- form is provided for backward compatibility with old versions of Elm.
- It is depreciated and might be removed in a future release. The
- default is set by the person who configured Elm for your system.
-
- .lp receivedmail 1.0i
- This is the folder to which incoming mail is saved after you've read it.
- When you answer \f2no\f1 to \*QKeep unread messages in
- your incoming mailbox?\*U or \f2yes\f1 to \*QStore read
- messages in your \*Qreceived\*U folder?\*U, this is where the messages go.
- The default is \*Q=received\*U, that is,
- a folder called \f2received\f1 in your \f3maildir\f1 directory.
-
- .lp remotesignature 1.0i
- See \f3signature\f1.
-
- .lp sentmail* 1.0i
- This is the folder to which a copy of outgoing mail is automatically
- saved. This is only done if the \f3copy\f1 boolean variable is set
- ON. Also note that if the \f3savename\f1 boolean variable is enabled
- then this folder may be ignored since the program may save to a folder
- that has the same name as the login of the person you're sending to.
- Whether or not a copy is saved, and to what folder, can be changed just
- prior to sending a message (see the \f3copy\f1 command of the mail
- command sub-menu in section 7, \f3Commands\f1). The default is
- \*Q=sent\*U, that is, a folder called \f2sent\f1 in your \f3maildir\f1
- directory.
-
- .lp shell 1.0i
- This defines the shell to use when doing \*q!\*u escapes and
- such. The default is to use the value of $SHELL in your
- current environment, and if not set, a shell selected by
- the person who configured Elm for your system.
- Note that the \*q!\*u escape is optional and may not be enabled in your
- version of Elm.
-
- .lp signature 1.0i
- This defines the file that is automatically appended to all
- outbound mail before the editor is invoked. Furthermore,
- if you'd like a different signature file for \*Qlocal\*U
- mail and \*Qremote\*U mail (remote being via other hosts),
- you can alternatively define two variables, \f3localsignature\f1
- and \f3remotesignature\f1, to have the same functionality.
- The default is to not have signatures appended to your messages.
-
- .lp sortby* 1.0i
- You can have your folder sorted in any of the following ways:
- .si 1.5i
- .lp from 10n
- Sorts according to whom each message is \f2from\f1.
- .lp lines 10n
- Sorts \f2shortest\f1 to \f2longest\f1 by message.
- .lp mailbox 10n
- Leaves the messages in the order found in the folder.
- .lp received 10n
- Sorts \f2least recently received\f1 to \f2most recently received\f1.
- .lp sent 10n
- Sorts \f2least recently sent\f1 to \f2most recently sent\f1.
- .lp status 10n
- Sorts by \f2priority\f1, \f2action\f1, \f2new\f1, \f2tagged\f1, then
- \f2deleted\f1.
- .lp subject 10n
- Sorts according to the \f2subject\f1 of each message.
- .ei
- .in 1.0i \" ei doesn't restore margin
- .sp
- Each of these fields can optionally be prepended with the
- sequence \*Qreverse\-\*U to reverse the order of the sort. This doesn't
- imply anything about the order of the messages in the folder
- itself and affects only their order on the index screen. The
- default is \f2mailbox\f1 order.
-
- .lp textencoding 1.0i
- This is the value for the
- \*QContent-Transfer-Encoding:\*U header,
- which is used to tell MIME
- (Multipurpose Internet Mail Extension) capable mail readers how they
- should decode your mail.
- The default depends on your site's installation, but is usually
- \f27bit\f1. Other possible values are \f28bit\f1, \f2base64\f1 or
- \f2quoted-printable\f1 (see RFC1341 for details).
- \f27bit\f1 and \f28bit\f1 implies no encoding.
- .sp
- Note that Elm doesn't look at this value; it is just placed in your
- outgoing mail headers.
- If you put \f2base64\f1 or \f2quoted-printable\f1 as the value,
- Elm will NOT turn your message into a \f2base64\f1/\f2quoted-printable\f1
- encoded message. You will have to do that
- yourself with whatever means are available in your MIME capable mail reader.
- Metamail, for instance, has a program called mimencode that you can use.
-
- .lp tmpdir 1.0i
- Use this if you want to define your own directory for the temporary
- file Elm creates while running. This is only necessary if using the
- system temporary directory could cause problems, such as when not all
- NFS clients mount the common temporary directory, or when the temporary
- directory is prone to being cleared periodically. The default entry
- of the system temporary directory is normally OK.
-
- .lp visualeditor+ 1.0i
- The editor to be used by the \*Q~v\*U escape within the builtin editor.
- The default value is the value of the configuration variable \f2vi_editor\f1
- (see \f2The Elm Configuration Guide\f1).
-
- .lp weedout 1.0i
- When specifying this option, you can list headers that
- you \f2don't\f1 want to see when you are displaying a message.
- This list can continue for as many lines as desired, as
- long as the continued lines all have leading indentation.
- All headers in this entry append to the default weedout list.
- There are two special header flags. The first, \*Q*clear-weed-list*\*U,
- clears the default list. The second, \*Q*end-of-user-headers*\*U,
- terminates the entry, in case the following lines look like they
- might be more headers for the list.
- The default \f3weedout\f1 list includes the following header strings:
- .sp
- .in 1.5i
- .ft CW
- .zf
- .nf
- \&>From
- \&Apparently-To:
- \&Content-Length
- \&Content-Transfer-Encoding
- \&Content-Type:
- \&From
- \&In-Reply-To:
- \&MIME-Version
- \&Message-Id:
- \&Newsgroups:
- \&Received:
- \&References:
- \&Status:
- \&X-Mailer:
- .ft 1
- .fi
- .sp
- .in 1.0i
- Note that the \*QFrom\*U entry weeds out both \*QFrom:\*U and the
- \*QFrom\ \*U headers. If you just want to weed out \*QFrom\ \*U, for example,
- put a \*Q*clear-weed-list*\*U at the start of the list followed by \*QFrom_\*U
- or \*QFrom\ \*U.
- .in 0
- .ne 8
- .hu Numeric Variables
-
- .lp bounceback 1.0i
- This is a hop count threshold value and allows you to
- set up the mailer so that when you send mail more than
- \f2n\f1 machines away, it'll automatically include a
- \*QCc:\*U to you through the remote machine. In practice
- this should be very rarely used. Note that this refuses to
- bounce mail off an Internet address. The default is to
- have it set to zero, which disables the function.
-
- .lp builtinlines 1.0i
- This is used to determine if the builtin pager should be used on some
- messages even if you would usually use an external pager program.
- There are two ways of determining whether the builtin pager should be
- used. If you want any message that is shorter than \f2n\f1 lines to
- use the internal pager, set this variable to \f2n\f1. If you want the
- builtin pager to be used if the message is \f2m\f1 lines shorter than
- the number of lines on your screen, set this variable to \f2\-m\f1.
- Setting this variable to zero will result in the message always being
- sent through your external pager. This variable is used only if
- the pager is not set to the builtin pager. The default is \-3.
-
- .lp readmsginc 1.0i
- This variable modifies the display of the message \*QReading in
- \f2foldername\f1, message: #\*U, which is displayed when reading a new
- folder. The message count is normally updated as
- each message in the folder is read. If you are on a slow terminal and are
- reading a folder with a large number of messages, the time it takes to
- redraw the message count can significantly exceed the time it takes to
- simply read the folder.
- .sp
- The \f3readmsginc\f1 variable controls the frequency with which the
- message count is updated. If this parameter is set to 50, the message
- count will be updated after every 50 messages (i.e., at 50, 100, 150,
- and so forth). The default value for this parameter is 1. If a value
- of less than 1 is specified for this parameter, the value is ignored,
- and the default value is used instead.
-
- .lp sleepmsg 1.0i
- This variable modifies the time Elm waits after displaying a transient
- message before erasing it and continuing. It can be set to zero to
- suppress the wait entirely. It is in units of whole seconds.
-
- .lp timeout 1.0i
- On more advanced systems, it's nice to start up the
- mailer in a window and let it sit in background
- until new mail arrives (see \f2wnewmail\f1 for
- another window based program), at which point
- it can be brought up to the forefront of the system
- and read. In this case, it would be quite convenient
- to have the mailer internally resynchronize every
- so often. This option specifies the number of seconds that this occurs.
- .sp
- This is also useful for non-windowing terminals. For example, you can
- leave Elm running at night (I usually do) and when you
- come in in the morning it'll be all ready to read your mail!
- .sp
- The default is a 300 second (5 minute) timeout period.
-
- .lp userlevel* 1.0i
- This is what the program uses to determine the relative level of
- sophistication of the user. The values are \*q0\*u for a new user (the
- default), \*q1\*u for someone familiar with Elm,
- and \*q2\*u for experts. Some advanced features are hidden from novice
- users, while experts get less verbose prompt messages.
- The default is \*q0\*u.
- .br
- .ne 8
- .hu Boolean Variables
-
- The value assigned to boolean variables can be \*QON\*U or \*QOFF\*U only.
-
- .lp alwaysdelete 1.0i
- Set ON to set the default answer to the \*QDelete messages?\*U prompt
- to \f2yes\f1 (see the \f3quit\f1 command in section 7, \f3Commands\f1,
- and the \f3ask\f1 variable below). This default answer also applies to
- deletions from the alias system. The default for \f3alwaysdelete\f1 is
- OFF.
-
- .lp alwayskeep 1.0i
- Set ON to set the default answer to the \*QKeep unread mail in incoming
- mailbox?\*U prompt to \f2yes\f1. However, if you set \f3alwaysstore\f1
- OFF or answer \f2no\fP to the \*QStore read mail in \*Qreceived\*U
- folder?\*U prompt, it is presumed that you also want to keep your
- unread mail in the incoming mailbox, so the value of \f3alwayskeep\f1
- is ignored in those cases. See the \f3quit\f1 command in section 7,
- \f3Commands\f1, and the \f3ask\f1 and \f3alwaysstore\f1 variables
- below for more details. The default for \f3alwayskeep\f1 is ON.
-
- .lp alwaysstore 1.0i
- Set ON to set the default answer to the \*QStore read mail in
- \*Qreceived\*U folder?\*U prompt to \f2yes\f1 (see the \f3quit\f1
- command in section 7, \f3Commands\f1, and the \f3ask\f1 variable
- below). The default for \f3alwaysstore\f1 is OFF.
-
- .lp arrow* 1.0i
- Sometimes you are forced to use a slow or \*Qdumb\*U terminal. Set ON
- to make the current message pointer the \*Q\->\*U sequence rather than
- the inverse bar. Note that this is overridden by the \*Q\-a\*U command
- line option (see section 3, \f3Command Line Options\f1). The default
- is OFF.
-
- .lp ask 1.0i
- Set OFF to tell Elm that you'd rather not be asked \*QDelete
- messages?\*U and such each time you quit, resynchronize, change
- folders, or return from the alias system, but that it should just use
- the values of \f3alwaysdelete\f1, \f3alwaysstore\f1, and
- \f3alwayskeep\f1 without prompting. Note that when you quit \f3Elm\fP,
- if you use \*qQ\*u instead of \*qq\*u, you will never be questioned,
- regardless of how you have \f3ask\f1 set. See the \f3quit\f1 commands
- in section 7, \f3Commands\f1, and the \f3alwaysdelete\f1,
- \f3alwayskeep\f1, and \f3alwaysstore\f1 variables above for more
- details. The default for \f3ask\f1 is ON.
-
- .lp askcc+ 1.0i
- Set OFF to allow sending mail without being presented the \*QCopies
- to:\*U prompt for each message. This still allows you to explicitly
- include addresses in the \*QCc:\*U list via either the header editor or
- \*Q~c\*U in the builtin editor (see section 8, \f3Using Elm with
- \*Qeditor = none\*U\f1). The default is ON.
-
- .lp autocopy+ 1.0i
- Set ON for Elm to automatically copy the text of each message
- replied to into the edit buffer. Otherwise you will be prompted as to
- whether you want the message included in your reply. See the
- \f3prefix\f1 variable under \f3String Variables\f1 in section 2 for how
- copied text is marked. The default for \f3autocopy\f1 is OFF.
-
- .lp confirmappend 1.0i
- Set ON to make Elm ask for permission
- to append messages to the end of any file that already exists.
- Whether the file is a mail folder in the user's mail directory
- or an ordinary file makes no difference.
- The default is OFF.
-
- .lp confirmcreate 1.0i
- Set ON to make Elm ask for permission before it creates
- a new file to store messages in.
- It makes no difference whether the new file would be a mail
- folder in the user's mail directory or an ordinary file.
- The default is OFF.
-
- .lp confirmfiles 1.0i
- This allows you to have some last resort control over Elm when a
- message would be appended (by copy, save, or auto-cc) to an existing
- file which is not a folder in your mail directory (see the
- \f3maildir\f1 variable under \f3String Variables\f1 in section 2). Set ON
- to make Elm ask for permission to append a message to the end of
- an ordinary file, otherwise it silently adds the message to the end of
- the specified file whether it is a folder or not. The default is OFF.

Kari E. Hurtta

unread,
Jul 13, 2005, 5:49:09 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.11

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 11/18
=========================================================================
if (buffer)
free_string(&buffer);
--- 177,184 ----
int visible_len;


! if (menu_resized(pager_page->root)) {


! menu_get_sizes(pager_page->root, &LINES, &COLUMNS);

if (buffer)
free_string(&buffer);
***************
*** 186,192 ****
goto new_page;
}

! if (menu_need_redraw(page)) {

if (buffer)
free_string(&buffer);
--- 187,193 ----
goto new_page;
}

! if (menu_need_redraw(pager_page->root)) {

if (buffer)
free_string(&buffer);
***************
*** 371,407 ****
StartBold();

if (idx >= linecount_stringbuffer(bout)) {
! PutLineX (LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinCommandi,
! "Command ('i' to return to index):"));
is_end = 1;
}
else {
int relative;
if (linecount_stringbuffer(bout) < 1)
relative = 100;
else
relative = 100 * idx / linecount_stringbuffer(bout);



! if (user_level == 0)

! PutLineX (LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltInMore0,
! "MORE (line %d-%d/%d, you've seen %d%%). Press <space> for more:"),
! idx_top+1,idx,linecount_stringbuffer(bout),
! relative);
else
! PutLineX (LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltInMore,
! "MORE (line %d-%d/%d, you've seen %d%%):"),
! idx_top+1,idx,linecount_stringbuffer(bout),
! relative);
is_end = 0;
}
EndBold();
CleartoEOS();
read_key:


! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);

if (ch != '/') {
if (search_pattern) {
--- 372,411 ----
StartBold();

if (idx >= linecount_stringbuffer(bout)) {
! menu_PutLineX (pager_page->root,LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinCommandi,
! "Command ('i' to return to index):"));
is_end = 1;
}
else {
int relative;


+ int ul = give_dt_enumerate_as_int(&user_level);
+

if (linecount_stringbuffer(bout) < 1)
relative = 100;
else
relative = 100 * idx / linecount_stringbuffer(bout);



! if (ul == 0)

! menu_PutLineX(pager_page->root,LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltInMore0,
! "MORE (line %d-%d/%d, you've seen %d%%). Press <space> for more:"),
! idx_top+1,idx,linecount_stringbuffer(bout),
! relative);
else
! menu_PutLineX(pager_page->root,
! LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltInMore,
! "MORE (line %d-%d/%d, you've seen %d%%):"),
! idx_top+1,idx,linecount_stringbuffer(bout),
! relative);
is_end = 0;
}
EndBold();
CleartoEOS();
read_key:
! ch = menu_ReadCh(pager_page->root, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);

if (ch != '/') {
if (search_pattern) {
***************
*** 443,449 ****
/* Avoid incrementing of idx: */
if (buffer)
free_string (&buffer);
! menu_ClearScreen(page);
break;
case FIND_MARK:
case '/':
--- 447,453 ----
/* Avoid incrementing of idx: */
if (buffer)
free_string (&buffer);
! menu_ClearScreen(pager_page->root);
break;
case FIND_MARK:
case '/':
***************
*** 451,457 ****
{
int code;

! code = optionally_enter2(page,
&search_pattern,
LINES-1, 0,
OE_REDRAW_MARK|
--- 455,461 ----
{
int code;

! code = optionally_enter2(pager_page->root,
&search_pattern,
LINES-1, 0,
OE_REDRAW_MARK|
***************
*** 491,496 ****
--- 495,502 ----
goto new_page; /* and draw match */
} else {
int relative;


+ int ul = give_dt_enumerate_as_int(&user_level);
+

if (linecount_stringbuffer(bout) < 1)
relative = 100;
else
***************
*** 498,504 ****

ClearLine (LINES-1);
StartBold();


! if (user_level == 0)

PutLineX (LINES-1, 0,
CATGETS(elm_msg_cat, ElmSet, ElmBuiltInNotFound0,
"NOT FOUND! (line %d-%d/%d, you've seen %d%%). Press <space> for more:"),
--- 504,510 ----

ClearLine (LINES-1);
StartBold();


! if (ul == 0)

PutLineX (LINES-1, 0,
CATGETS(elm_msg_cat, ElmSet, ElmBuiltInNotFound0,
"NOT FOUND! (line %d-%d/%d, you've seen %d%%). Press <space> for more:"),
***************
*** 537,554 ****
goto reprompt; /* Can't go down */
lines = LINES / 2;
CarriageReturn();
! if (CleartoEOLN() >= 0) {
! idx_top += LINES / 2;
! goto cr_restart; /* Hanlde Ctrl-D specially */
! }
!
! idx = idx_top + LINES / 2;
! if (idx < 0)
! idx = 0;


! if (buffer)
! free_string(&buffer);

! break;
!
case ctrl('U'):

idx = idx_top - LINES / 2;
if (idx < 0)
--- 543,553 ----
goto reprompt; /* Can't go down */
lines = LINES / 2;
CarriageReturn();
!
! CleartoEOLN();
! idx_top += LINES / 2;
! goto cr_restart; /* Hanlde Ctrl-D specially */


!
case ctrl('U'):

idx = idx_top - LINES / 2;
if (idx < 0)
***************
*** 589,596 ****

finish:

- erase_menu_context(&page);
-
if (buffer)
free_string (&buffer);
DPRINT(Debug,9,(&Debug,
--- 588,593 ----
Index: elm2.4.ME+.122-cvs/src/calendar.c
*** elm2.4.ME+.121/src/calendar.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/calendar.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: calendar.c,v 1.14 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: calendar.c,v 1.15 2005/06/17 21:02:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 38,45 ****

#include <s_error.h>

! char *error_description();
!
static int extract_info P_((FILE *save_to_fd,
struct MailboxView *mailbox));

--- 38,44 ----

#include <s_error.h>

! static char * is_cal_entry P_((char *string));
static int extract_info P_((FILE *save_to_fd,
struct MailboxView *mailbox));

***************
*** 118,124 ****

int entries = 0, lines;
int line_length;
! char buffer[SLEN], *cp, *is_cal_entry();

int current = get_current(mailbox);
struct header_rec *hdr = 0;
--- 117,123 ----

int entries = 0, lines;
int line_length;
! char buffer[SLEN], *cp;

int current = get_current(mailbox);
struct header_rec *hdr = 0;
***************
*** 161,167 ****
return(entries);
}

! char *
is_cal_entry(string)
register char *string;
{
--- 160,166 ----
return(entries);
}

! static char *
is_cal_entry(string)
register char *string;
{
Index: elm2.4.ME+.122-cvs/src/canceled.c
*** elm2.4.ME+.121/src/canceled.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/src/canceled.c 2005-02-20 16:16:46.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: canceled.c,v 1.5 2004/07/28 18:00:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: canceled.c,v 1.11 2005/02/20 14:16:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

****************************************************************************
***************
*** 19,66 ****

DEBUG_VAR(Debug,__FILE__,"ELM");

! static void cancel_menu P_((struct menu_context *page));
! static void cancel_menu(page)
! struct menu_context *page;
{
! /** write main system menu... **/
! int LINES, COLUMNS;

! menu_get_sizes(default_context,&LINES, &COLUMNS);
!
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCancelMenuLine1,
! "To select canceled message for mailing, press <return>."));
! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCancelMenuLine2,
! "To read message, press space. j = move down, k = move up"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCancelMenuLine3,
! "Also available: d)elete, u)ndelete, i)ndex"));

}


static int showmsg_cancel_cmd P_(( struct MailboxView *mailbox,


! int cmd, int *screen_mangled,

! struct menu_context *page));
! static int showmsg_cancel_cmd(mailbox,cmd,screen_mangled, page)
struct MailboxView *mailbox;
int cmd;
! int *screen_mangled;
! struct menu_context *page;
{

-
return cmd;
}

/* This leaks on exit */
char * last_canceled_mail = NULL;

int view_canceled_mails(cancel_view,cancel_selection,aview)
struct MailboxView * cancel_view;
int *cancel_selection;
--- 19,152 ----

DEBUG_VAR(Debug,__FILE__,"ELM");

! #if ANSI_C
! static subpage_simple_redraw sb_cancel_menu;
! #endif
! static int sb_cancel_menu P_((struct menu_context *ptr,
! struct menu_param *list));
! static int sb_cancel_menu(ptr,list)
! struct menu_context *ptr;
! struct menu_param *list;
{
! struct menu_common *mptr = mp_lookup_mcommon(list,elm_mp_menu);

! menu_ClearScreen(ptr);
!
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCancelMenuLine1,
! "To select canceled message for mailing, press <return>."));
! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCancelMenuLine2,
! "To read message, press space. j = move down, k = move up"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCancelMenuLine3,
! "Also available: d)elete, u)ndelete, i)ndex"));

+ return 1;
}


+
static int showmsg_cancel_cmd P_(( struct MailboxView *mailbox,


! int cmd,
! struct pager_page *pager_page));

! static int showmsg_cancel_cmd(mailbox,cmd,pager_page)
struct MailboxView *mailbox;
int cmd;
! struct pager_page *pager_page;
{

return cmd;
}

/* This leaks on exit */
char * last_canceled_mail = NULL;

+
+ static void set_mailbox_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_mailbox_screen(page,LOC, LIST)


+ struct menu_context *page;
+ struct screen_parts *LOC;
+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ /* 1) Title part of screen */
+

+ if (! LOC->title_page)

+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */


+
+ if (LOC->menu_page)

+ menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
+ else if (mini_menu)
+ LOC->menu_page = new_menu_subpage(page,LINES-8,4,
+ sb_cancel_menu,LIST);
+
+ mailbox_screen_common(page,LOC, LIST);
+ }
+
+ static void check_mailbox_screen P_((struct screen_parts *LOC,
+ struct menu_param *list));
+ static void check_mailbox_screen(LOC,list)


+ struct screen_parts *LOC;
+ struct menu_param *list;

+ {
+ if (menu_resized(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }


+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));

+ sb_update_title(LOC->title_page,list);
+ }


+
+ if (LOC->menu_page) {

+ /* 2) menu page */
+ if (menu_resized(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page redraw???\n"));
+ sb_cancel_menu(LOC->menu_page,list);
+ }
+ }
+
+ /* 3) prompt part */


+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {

+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.

+ */
+ }
+
+ /* 4) headers part */
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page resized\n"));
+ }
+ if (menu_need_redraw(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page redraw\n"));
+ menu_ClearScreen(LOC->header_page);


+ }
+ }
+
+
+

int view_canceled_mails(cancel_view,cancel_selection,aview)
struct MailboxView * cancel_view;
int *cancel_selection;
***************
*** 68,168 ****
{

int leave = 0;
- int redraw = 0, nufoot = 0;
int can_flag = 0;
int i;

struct menu_context *page = new_menu_context();

struct menu_common MENU;
int LINES, COLUMNS;
!
! int header_page = 0;
if (get_message_count(cancel_view) > 0) {

if (! last_canceled_mail ||
! cancel_set_current(cancel_view,last_canceled_mail))
set_current(cancel_view,1); /* Set current to first message */

update_view(cancel_view);
! resort_mailbox(cancel_view,1, &header_page);
}

start_again:
leave = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

! set_mcommon_from_mbxview(&MENU,cancel_view);
!
! showscreen(cancel_view,
! cancel_menu,&header_page, page);

while (!leave) {
int ch;

if (menu_resized(page)) {

menu_get_sizes(page,&LINES, &COLUMNS);

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))
! if (mini_menu)
! headers_per_page = max (LINES - 14, 1);
! else
! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;
! } else
! redraw = menu_need_redraw(page);

- nufoot = 0;
- nucurr = 0;

! new_mail_check(cancel_view, &header_page, page);
! redraw += menu_need_redraw(page);

if (update_view(cancel_view)) {
! resort_mailbox(cancel_view,1, &header_page);
!
! redraw++;
}

! if (redraw) {
! redraw = 0;
! showscreen(cancel_view,
! cancel_menu,&header_page, page);
! show_last_error();


}

!
! {
! int lin,col;

! prompt_s(mcommon_give_item(&MENU,m_Prompt));
! GetXYLocation(&lin,&col);
!
! CleartoEOLN();
! ch = GetPrompt(page);

- CleartoEOS();
-
- if (isascii(ch) && isprint(ch)) {
- DPRINT(Debug,4,(&Debug,
- "\nCommand: %c [%d]\n\n", ch, ch));
- } else {
- DPRINT(Debug,4,(&Debug,
- "\nCommand: %d\n\n", ch));
- }
-
- set_error(""); /* clear error buffer */
-
- MoveCursor(lin,col);
- }
-
- ch = motion(ch,&MENU,&nufoot, &header_page,
- page);


- redraw += menu_need_redraw(page);
-

switch (ch) {


case 0: /* OK */

break;
--- 154,255 ----
{

int leave = 0;
int can_flag = 0;
int i;



struct menu_context *page = new_menu_context();

+ struct screen_parts LOC = { NULL, NULL, NULL };

struct menu_common MENU;
+ struct menu_param PARAM[elm_mp_COUNT+1] = {
+ { mp_menu_common, 0 },


+ { mp_integer, 0 },
+ { mp_END,0 }
+ };
+

int LINES, COLUMNS;
!
! set_mcommon_from_mbxview(&MENU,cancel_view);
! mp_list_set_mcommon(PARAM,elm_mp_menu,&MENU);
! set_mailbox_screen(page,&LOC,PARAM);
!
if (get_message_count(cancel_view) > 0) {

if (! last_canceled_mail ||
! cancel_set_current(cancel_view,last_canceled_mail))
+
set_current(cancel_view,1); /* Set current to first message */
+
+ copy_current(&MENU,LOC.header_page);

update_view(cancel_view);
! resort_mailbox(cancel_view,1);
! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
}

start_again:
+
leave = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

! showscreen(page);

while (!leave) {
int ch;

+ menu_set_default(page);
+
if (menu_resized(page)) {
+
+ set_mailbox_screen(page,&LOC,PARAM);

menu_get_sizes(page,&LINES, &COLUMNS);

! menu_trigger_redraw(page);
! }


! new_mail_check(cancel_view, page, &LOC);

if (update_view(cancel_view)) {
! resort_mailbox(cancel_view,1);
!
! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */ menu_trigger_redraw(LOC.header_page);
}

! if (menu_need_redraw(page))
! showscreen(page);
! check_mailbox_screen(&LOC, PARAM);


!
! {
! int lin,col;
!

! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));
! menu_GetXYLocation(LOC.prompt_page,&lin,&col);
!
! menu_CleartoEOLN(LOC.prompt_page);
! ch = GetPrompt(LOC.prompt_page);
!
! menu_CleartoEOS(LOC.prompt_page);
!
! if (isascii(ch) && isprint(ch)) {
! DPRINT(Debug,4,(&Debug,
! "\nCommand: %c [%d]\n\n", ch, ch));
! } else {
! DPRINT(Debug,4,(&Debug,
! "\nCommand: %d\n\n", ch));
! }
!

! set_error(""); /* clear error buffer */
!

! menu_MoveCursor(LOC.prompt_page,lin,col);
}

! ch = motion(ch,&MENU,&LOC,
! page);

switch (ch) {


case 0: /* OK */

break;
***************
*** 206,211 ****
--- 293,299 ----


struct header_rec *hdr;
FILE *F;

int i = 0;
+ struct pager_page * PP = init_pager_page(&MENU);

/* define_softkeys(READ); */

***************
*** 215,221 ****
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(cancel_view),
! page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 303,309 ----
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(cancel_view),
! PP);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 224,238 ****
while (i > 0) {
i = process_showmsg_cmd(i, cancel_view,
showmsg_cancel_cmd,
! aview, &header_page,
! page);

switch (i) {
case EOF:
goto eof_mark;

case 'X': /* Quick Exit */

goto quit_mark;
case 0:
break;
--- 312,329 ----
while (i > 0) {
i = process_showmsg_cmd(i, cancel_view,
showmsg_cancel_cmd,
! aview,
! PP);

switch (i) {
case EOF:
+
+ exit_pager_page(&PP,page);
goto eof_mark;

case 'X': /* Quick Exit */

+ exit_pager_page(&PP,page);
goto quit_mark;
case 0:
break;
***************
*** 244,253 ****
}
}

current = get_current(cancel_view);

! redraw++;
! (void)get_page(current, &MENU, &header_page);
}
}
break;
--- 335,345 ----
}
}

+ exit_pager_page(&PP,page);
current = get_current(cancel_view);

! menu_trigger_redraw(page);
! get_page(&MENU, LOC.header_page);
}
}
break;
***************
*** 281,314 ****

}

! if (redraw)
! showscreen(cancel_view,
! cancel_menu,&header_page, page);
!
! check_range(&MENU);
!

! if (nucurr == NEW_PAGE) {
! DPRINT(Debug,5,(&Debug, " nucurr == NEW_PAGE\n"));
! show_headers(&MENU,&header_page, page);
! } else if (nucurr == SAME_PAGE) {
! DPRINT(Debug,5,(&Debug, " nucurr == SAME_PAGE\n"));
! show_current(&MENU,&header_page, page);
! } else if (nufoot) {
! if (mini_menu) {
! MoveCursor(LINES-8, 0);
! CleartoEOS();
! cancel_menu(page);
! }
! else {


! MoveCursor(LINES-5, 0);
! CleartoEOS();
! }

! show_last_error(); /* for those operations that have to
! * clear the footer except for a message.
! */
! }

} /* the BIG while loop! */


--- 373,385 ----

}

! if (menu_need_redraw(page))
! showscreen(page);

! check_range(&MENU, &LOC);

+ check_mailbox_screen(&LOC, PARAM);
+
} /* the BIG while loop! */


***************
*** 316,322 ****
int marked_deleted = 0;

for (i = 0; i < get_message_count(cancel_view); i++) {
! if (mcommon_ison_status(&MENU,i,DELETED))
marked_deleted++;
}

--- 387,393 ----
int marked_deleted = 0;

for (i = 0; i < get_message_count(cancel_view); i++) {
! if (mcommon_ison_status(&MENU,i,status_basic,DELETED))
marked_deleted++;
}

***************
*** 385,396 ****
if (get_current(cancel_view) > (n = get_message_count(cancel_view)))
set_current(cancel_view,n);

! resort_mailbox(cancel_view,1, &header_page);
!
goto start_again;
}

OUT:
erase_menu_context(&page);

DPRINT(Debug,4,(&Debug, "view_canceled_mails=%d *cancel_selection=%d\n",
--- 456,469 ----
if (get_current(cancel_view) > (n = get_message_count(cancel_view)))
set_current(cancel_view,n);

! resort_mailbox(cancel_view,1);
! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
goto start_again;
}

OUT:
+ free_mailbox_screen(&LOC);
+
erase_menu_context(&page);

DPRINT(Debug,4,(&Debug, "view_canceled_mails=%d *cancel_selection=%d\n",
Index: elm2.4.ME+.122-cvs/src/date.c
*** elm2.4.ME+.121/src/date.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/date.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: date.c,v 1.14 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: date.c,v 1.15 2005/06/17 21:02:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************
*** 63,114 ****
1900+the_time->tm_year);
}

- int
- month_number(name)
- char *name;
- {
- /** return the month number given the month name... **/
-
- int ch;
-
- if (!isascii(name[0]))
- return -1;
-
- switch (name[0]) {
- case 'a' :
- if (!isascii(name[1]))
- return -1;
-
- if ((ch = tolower(name[1])) == 'p') return(APRIL);
- else if (ch == 'u') return(AUGUST);
- else return(-1); /* error! */
-
- case 'd' : return(DECEMBER);
- case 'f' : return(FEBRUARY);
- case 'j' :
- if (!isascii(name[1]))
- return -1;
-
- if ((ch = tolower(name[1])) == 'a') return(JANUARY);
- else if (ch == 'u') {
- if ((ch = tolower(name[2])) == 'n') return(JUNE);
- else if (ch == 'l') return(JULY);
- else return(-1); /* error! */
- }
- else return(-1); /* error */
- case 'm' :
- if (!isascii(name[1]))
- return -1;
-
- if ((ch = tolower(name[2])) == 'r') return(MARCH);
- else if (ch == 'y') return(MAY);
- else return(-1); /* error! */
- case 'n' : return(NOVEMBER);
- case 'o' : return(OCTOBER);
- case 's' : return(SEPTEMBER);
- default : return(-1);
- }
- }

char *
elm_date_str(buf, seconds, size)
--- 63,68 ----
Index: elm2.4.ME+.122-cvs/src/def_elm.h
*** elm2.4.ME+.121/src/def_elm.h 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/def_elm.h 2005-05-21 20:58:32.000000000 +0300
***************
*** 1,4 ****
! /* $Id: def_elm.h,v 1.3 2004/03/27 18:31:44 hurtta Exp $ */

/* Author: Kari Hurtta */

--- 1,4 ----
! /* $Id: def_elm.h,v 1.4 2005/05/21 17:58:32 hurtta Exp $ */

/* Author: Kari Hurtta */

***************
*** 7,14 ****
--- 7,16 ----
*/

#include "headers.h"
+ #include "mailerlib.h"
#include "me.h"

+
extern JMP_BUF GetPromptBuf; /* setjmp buffer */


extern int InGetPrompt; /* set if in GetPrompt() in read() */

Index: elm2.4.ME+.122-cvs/src/delete.c
*** elm2.4.ME+.121/src/delete.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/delete.c 2005-02-20 16:16:46.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: delete.c,v 1.18 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: delete.c,v 1.21 2005/02/20 14:16:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************
*** 20,217 ****
#include "def_elm.h"
#include "s_elm.h"

! void delete_msg(real_del, update_screen, menu, header_page)
! int real_del, update_screen;
struct menu_common *menu;
! int header_page;
{
/** Delete current message. If real-del is false, then we're
actually requested to toggle the state of the current
message...
**/


int current = mcommon_get_current(menu);
!

if (mcommon_get_type(menu, current-1) & SYSTEM)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoDelSysAlias,
"Can't delete a system alias!"));
else if (real_del) {

! mcommon_setf_status(menu,current-1,DELETED);

} else {

! if (mcommon_ison_status(menu,current-1,DELETED))
! mcommon_clearf_status(menu,current-1,DELETED);
else
! mcommon_setf_status(menu,current-1,DELETED);

}

! if (update_screen)
! show_msg_status(current-1,menu, header_page);
}

! void unread_msg(update_screen, mailbox, header_page)
! int update_screen;
struct MailboxView *mailbox;
! int header_page;
{
int current = get_current(mailbox);
struct header_rec * hdr = give_header(mailbox,current-1);

! /** change the message flag to unread **/

if (hdr) {
setit(hdr->status, UNREAD);
hdr->status_chgd = TRUE;
}
!
! if (update_screen) {
struct menu_common MENU;

! set_mcommon_from_mbxview(&MENU, mailbox);

! show_msg_status(current-1, &MENU, header_page);
}
}

! void undelete_msg(update_screen,menu,header_page)
! int update_screen;
struct menu_common *menu;
! int header_page;
{
int current = mcommon_get_current(menu);

! mcommon_clearf_status(menu,current-1,DELETED);

! if (update_screen)
! show_msg_status(current-1,menu, header_page);
! }

! void show_msg_status(msg, menu, header_page)
! int msg;
! struct menu_common *menu;
! int header_page;
! {
! /** show the status of the current message only. **/
!
! char tempbuf[3];
! int current = 0;
!
! /* ??? */
! strfcpy(tempbuf, mcommon_show_status(menu,msg), sizeof tempbuf);
!
! if (on_page(msg, menu, header_page)) {
! MoveCursor(((compute_visible(msg+1, menu)-1)
! % headers_per_page) + 4, 2);
! if (msg+1 == current && !arrow_cursor) {
! StartBold();
! Writechar( tempbuf[0] );
! EndBold();
! }
! else
! Writechar( tempbuf[0] );
}
}

! int tag_message(update_screen, menu, header_page)
! int update_screen;
struct menu_common *menu;
! int header_page;
{
/** Tag current message and return TRUE.
If already tagged, untag it and return FALSE. **/

! int istagged;


! int current = mcommon_get_current(menu);
!

! if (mcommon_ison_status(menu,current-1,TAGGED)) {
!
! mcommon_clearf_status(menu,current-1,TAGGED);
! istagged = FALSE;
!
! } else {
!
! mcommon_setf_status(menu,current-1,TAGGED);
! istagged = TRUE;
!
! }
!
! if(update_screen)
! show_msg_tag(current-1,menu, header_page);
!
! return(istagged);
! }
!
! void show_msg_tag(msg, menu, header_page)
! int msg;
! struct menu_common *menu;
! int header_page;
! {
! /** show the tag status of the current message only. **/


!
int current = mcommon_get_current(menu);

! if (on_page(msg, menu, header_page)) {
!
! MoveCursor(((compute_visible(msg+1, menu)-1) %
! headers_per_page) + 4, 4);
!
! if (msg+1 == current && !arrow_cursor) {
!
! StartBold();
! Writechar(mcommon_ison_status(menu,msg,TAGGED)? '+' : ' ');
! EndBold();
!
! } else {
!
! Writechar(mcommon_ison_status(menu,msg,TAGGED)? '+' : ' ');

! }
}
}

! void show_new_status(msg,menu, header_page)
! int msg;
struct menu_common *menu;
! int header_page;
{
! /** If the specified message is on this screen, show
! the new status (could be marked for deletion now,
! and could have tag removed...)
! **/
!
! if (on_page(msg, menu, header_page)) {
! char * s = "";
! char c = ' ';
! int current = 0;

! current = mcommon_get_current(menu);
! s = mcommon_show_status(menu,msg);
! c = mcommon_ison_status(menu,msg,TAGGED) ? '+' : ' ';

! if (msg+1 == current && !arrow_cursor) {
! StartBold();
!
! PutLineX(((compute_visible(msg+1,menu)-1)
! % headers_per_page) + 4,
! 2, FRM("%s%c"),
! s,c);
!
! EndBold();
! } else
! PutLineX(((compute_visible(msg+1,menu)-1)
! % headers_per_page) + 4,
! 2, FRM("%s%c"),
! s,c);

}
}

! int DeleteTagged(menu, header_page,page)
struct menu_common *menu;


- int header_page;
struct menu_context *page;
{

/** delete all tagged messages. return TRUE if the current message was
--- 20,172 ----
#include "def_elm.h"
#include "s_elm.h"

! void delete_msg(real_del, menu, LOC)
! int real_del;
struct menu_common *menu;
! struct screen_parts *LOC;
{
/** Delete current message. If real-del is false, then we're
actually requested to toggle the state of the current
message...
**/


int current = mcommon_get_current(menu);
!

if (mcommon_get_type(menu, current-1) & SYSTEM)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoDelSysAlias,
"Can't delete a system alias!"));
else if (real_del) {

! mcommon_setf_status(menu,current-1,status_basic,DELETED);

} else {

! if (mcommon_ison_status(menu,current-1,status_basic,DELETED))
! mcommon_clearf_status(menu,current-1,status_basic,DELETED);
else
! mcommon_setf_status(menu,current-1,status_basic,DELETED);

}
+
+ if (LOC) {
+ int vis;

! vis = compute_visible(current, menu);
! menu_header_status_update(LOC->header_page,vis-1);
! }
}

! void unread_msg(mailbox, header_area)
struct MailboxView *mailbox;
! struct menu_context *header_area;
{
int current = get_current(mailbox);
struct header_rec * hdr = give_header(mailbox,current-1);

! /** change the message flag to unread **/

if (hdr) {
setit(hdr->status, UNREAD);
hdr->status_chgd = TRUE;
}
!
! if (header_area) {
struct menu_common MENU;
+ int vis;

! set_mcommon_from_mbxview(&MENU,mailbox);

! vis = compute_visible(current, &MENU);
! menu_header_status_update(header_area,vis-1);
}
}

! void undelete_msg(menu,header_area)
struct menu_common *menu;
! struct menu_context *header_area;
{
int current = mcommon_get_current(menu);

! mcommon_clearf_status(menu,current-1,status_basic,DELETED);

! if (header_area) {
! int vis;

! vis = compute_visible(current, menu);
! menu_header_status_update(header_area,vis-1);
}
}

!
! int tag_message(menu, header_area)
struct menu_common *menu;
! struct menu_context *header_area;
{
/** Tag current message and return TRUE.
If already tagged, untag it and return FALSE. **/

! int istagged;
int current = mcommon_get_current(menu);
+
+ if (mcommon_ison_status(menu,current-1,status_basic,TAGGED)) {
+
+ mcommon_clearf_status(menu,current-1,status_basic,TAGGED);
+ istagged = FALSE;
+
+ } else {
+
+ mcommon_setf_status(menu,current-1,status_basic,TAGGED);
+ istagged = TRUE;
+
+ }
+
+ if (header_area) {
+ int vis;

! vis = compute_visible(current, menu);

! menu_header_status_update(header_area,vis-1);
}
+
+ return(istagged);
}

! int flag_message(menu, header_area)
struct menu_common *menu;
! struct menu_context *header_area;
{
! /** flag current message and return TRUE.
! If already flagged, untag it and return FALSE. **/

! int isflagged;


! int current = mcommon_get_current(menu);
!

! if (mcommon_ison_status(menu,current-1,status_1,S1_FLAGGED)) {

! mcommon_clearf_status(menu,current-1,status_1,S1_FLAGGED);
! isflagged = FALSE;
!
! } else {
!
! mcommon_setf_status(menu,current-1,status_1,S1_FLAGGED);
! isflagged = TRUE;

}
+
+ if (header_area) {
+ int vis;
+
+ vis = compute_visible(current, menu);
+
+ menu_header_status_update(header_area,vis-1);
+ }
+
+ return(isflagged);
}

! int DeleteTagged(menu, page, header_area)
struct menu_common *menu;
struct menu_context *page;
+ struct menu_context *header_area;
{

/** delete all tagged messages. return TRUE if the current message was
***************
*** 221,252 ****


int iindex, count = 0;

int mc = mcommon_get_count(menu);
int current = mcommon_get_current(menu);
int LINES, COLUMNS;

menu_get_sizes(page, &LINES, &COLUMNS);

for (iindex=0; iindex < mc; iindex++) {
- if (mcommon_ison_status(menu,iindex,TAGGED)) {

! mcommon_setf_status(menu,iindex,DELETED);
! count++;
! show_new_status(iindex,menu, header_page);
}
}

if (count == 1)
! print_format_center(LINES-1,
! CATGETS(elm_msg_cat, ElmSet, ElmItemDeleted,
! "%S deleted."),
! mcommon_give_item(menu,m_Item));
else
! print_format_center(LINES-1,
! CATGETS(elm_msg_cat, ElmSet, ElmItemsDeleted,
! "%d %S deleted."),
! count,
! mcommon_give_item(menu,m_items));

! return( mcommon_ison_status(menu,current-1, DELETED) ? 1 : 0);
}

/*
--- 176,216 ----


int iindex, count = 0;

int mc = mcommon_get_count(menu);
int current = mcommon_get_current(menu);
+ int selected = mcommon_get_selected(menu);
int LINES, COLUMNS;

menu_get_sizes(page, &LINES, &COLUMNS);

for (iindex=0; iindex < mc; iindex++) {

! if (!selected ||
! (selected && mcommon_ison_status(menu,iindex,
! status_basic,VISIBLE))) {
!
! if (mcommon_ison_status(menu,iindex,status_basic,TAGGED)) {
!
! mcommon_setf_status(menu,iindex,status_basic,DELETED);
! count++;
!
! if (header_area)
! menu_header_status_update(header_area,iindex);
!
! }
}
}

if (count == 1)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmItemDeleted,
! "%S deleted."),
! mcommon_give_item(menu,m_Item));
else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmItemsDeleted,
! "%d %S deleted."),
! count,
! mcommon_give_item(menu,m_items));

! return( mcommon_ison_status(menu,current-1, status_basic,
! DELETED) ? 1 : 0);
}

/*
Index: elm2.4.ME+.122-cvs/src/digest.c
*** elm2.4.ME+.121/src/digest.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/src/digest.c 2005-04-23 23:06:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.11 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: digest.c,v 1.16 2005/04/23 20:06:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
***************
*** 19,153 ****

DEBUG_VAR(Debug,__FILE__,"ELM");

! static void digest_menu P_((struct menu_context *page));
! static void digest_menu(page)
! struct menu_context *page;
{
! /** write main system menu... **/


! int LINES, COLUMNS;
!

! menu_get_sizes(page, &LINES, &COLUMNS);
!

! if (user_level == 0) { /* a rank beginner. Give less options */
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,
! "You can use any of the following commands by pressing the first character;"));
! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0DgtLine2,
! "m)ail a message, r)eply or f)orward mail, return to i)ndex"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0DgtLine3,
! "To read a message, press <return>. j = move down, k = move up"));
} else {
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,
! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));
! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1DgtLine2,
! "a)lias, C)opy, f)orward, g)roup reply, m)ail,"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1DgtLine3,
! "n)ext, o)ptions, P)rint text, r)eply, s)ave, t)ag, or i)index"));
}
}

static int showmsg_digest_cmd P_(( struct MailboxView *mailbox,


! int cmd, int *screen_mangled,

! struct menu_context *page));
! static int showmsg_digest_cmd(mailbox,cmd,screen_mangled,page)
struct MailboxView *mailbox;
int cmd;
! int *screen_mangled;
! struct menu_context *page;
{
return cmd;
}


static void digest_loop P_((struct MailboxView *mailbox,
! struct AliasView *aview,
! int header_page));
! static void digest_loop(mailbox, aview, header_page)


struct MailboxView *mailbox;
struct AliasView *aview;
- int header_page;

{
int leave = 0;
- int redraw = 0, nufoot = 0;
int auto_assemble = 1;



struct menu_context *page = new_menu_context();

!
! showscreen(mailbox,
! digest_menu,&header_page, page);
!

while (!leave) {
int ch;
- struct menu_common MENU;
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);

if (menu_resized(page)) {

! menu_get_sizes(page,&LINES, &COLUMNS);

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))
! if (mini_menu)
! headers_per_page = max (LINES - 14, 1);
! else
! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;
! } else
! redraw = menu_need_redraw(page);
!
! nufoot = 0;
! nucurr = 0;


if (update_view(mailbox)) {
! resort_mailbox(mailbox,1, &header_page);
!
! redraw++;
}

! if (redraw) {
! redraw = 0;
! showscreen(mailbox,
! digest_menu,&header_page, page);
! show_last_error();


! }

!
! {
int lin,col;

! prompt_s(mcommon_give_item(&MENU, m_Prompt));
! GetXYLocation(&lin,&col);

! CleartoEOLN();

! if (auto_assemble && 2 == fragment_handling &&
have_partial(mailbox)) {
ch = 'A';
auto_assemble = 0;



DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else
! ch = GetPrompt(page);

! CleartoEOS();

if (isascii(ch) && isprint(ch)) {
DPRINT(Debug,4,(&Debug,
--- 19,241 ----

DEBUG_VAR(Debug,__FILE__,"ELM");

! #if ANSI_C
! static subpage_simple_redraw sb_digest_menu;
! #endif
! static int sb_digest_menu P_((struct menu_context *ptr,
! struct menu_param *list));
! static int sb_digest_menu(ptr,list)
! struct menu_context *ptr;
! struct menu_param *list;
{
! struct menu_common *mptr = mp_lookup_mcommon(list,elm_mp_menu);


! int ul = give_dt_enumerate_as_int(&user_level);
!

! menu_ClearScreen(ptr);
!
! if (ul == 0) { /* a rank beginner. Give less options */
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,
! "You can use any of the following commands by pressing the first character;"));
! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0DgtLine2,
! "m)ail a message, r)eply or f)orward mail, return to i)ndex"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0DgtLine3,
! "To read a message, press <return>. j = move down, k = move up"));
} else {
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,
! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));
! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1DgtLine2,
! "a)lias, C)opy, f)orward, g)roup reply, m)ail,"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1DgtLine3,
! "n)ext, o)ptions, P)rint text, r)eply, s)ave, t)ag, or i)index"));
}
+
+ return 1;
}

static int showmsg_digest_cmd P_(( struct MailboxView *mailbox,


! int cmd,
! struct pager_page *pager_page));

! static int showmsg_digest_cmd(mailbox,cmd,pager_page)
struct MailboxView *mailbox;
int cmd;
! struct pager_page *pager_page;
{
return cmd;
}


+
+ static void set_mailbox_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_mailbox_screen(page,LOC, LIST)


+ struct menu_context *page;
+ struct screen_parts *LOC;
+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ /* 1) Title part of screen */
+

+ if (! LOC->title_page)

+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */


+
+ if (LOC->menu_page)

+ menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
+ else if (mini_menu)
+ LOC->menu_page = new_menu_subpage(page,LINES-8,4,
+ sb_digest_menu,LIST);
+
+ mailbox_screen_common(page,LOC, LIST);
+ }
+
+
+ static void check_mailbox_screen P_((struct screen_parts *LOC,
+ struct menu_param *list));
+ static void check_mailbox_screen(LOC,list)


+ struct screen_parts *LOC;
+ struct menu_param *list;

+ {
+ if (menu_resized(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }


+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));

+ sb_update_title(LOC->title_page,list);
+ }


+
+ if (LOC->menu_page) {

+ /* 2) menu page */
+ if (menu_resized(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page redraw???\n"));
+ sb_digest_menu(LOC->menu_page,list);
+ }
+ }
+
+ /* 3) prompt part */


+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {

+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.

+ */
+ }
+
+ /* 4) headers part */
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page resized\n"));
+ }
+ if (menu_need_redraw(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page redraw\n"));
+ menu_ClearScreen(LOC->header_page);
+ }
+ }
+
static void digest_loop P_((struct MailboxView *mailbox,
! struct AliasView *aview));
! static void digest_loop(mailbox, aview)


struct MailboxView *mailbox;
struct AliasView *aview;

{
int leave = 0;
int auto_assemble = 1;



struct menu_context *page = new_menu_context();

! struct screen_parts LOC = { NULL };
! struct menu_common MENU;
! struct menu_param PARAM[elm_mp_COUNT+1] = {
! { mp_menu_common, 0 },
! { mp_integer, 0 },
! { mp_END,0 }
! };
!
! mp_list_set_mcommon(PARAM,elm_mp_menu,&MENU);
!
! set_mcommon_from_mbxview(&MENU,mailbox);
! set_mailbox_screen(page,&LOC,PARAM);
!
! resort_mailbox(mailbox,1);
! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! copy_current(&MENU,LOC.header_page);
!
! showscreen(page);

while (!leave) {
int ch;


int LINES, COLUMNS;

+ menu_set_default(page);
+

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);

if (menu_resized(page)) {

! set_mailbox_screen(page,&LOC,PARAM);

! menu_get_sizes(page,&LINES, &COLUMNS);

+ menu_trigger_redraw(page);
+ }

if (update_view(mailbox)) {
! resort_mailbox(mailbox,1);
! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! menu_trigger_redraw(LOC.header_page);
! menu_trigger_redraw(LOC.title_page);
}

! if (menu_need_redraw(page))
! showscreen(page);
! check_mailbox_screen(&LOC, PARAM);

! {
int lin,col;


+ int fh = give_dt_enumerate_as_int(&fragment_handling);

! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));
! menu_GetXYLocation(LOC.prompt_page,&lin,&col);

! menu_CleartoEOLN(LOC.prompt_page);

! if (auto_assemble && 2 == fh &&
have_partial(mailbox)) {
ch = 'A';
auto_assemble = 0;



DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else

! ch = GetPrompt(LOC.prompt_page);

! menu_CleartoEOS(LOC.prompt_page);

if (isascii(ch) && isprint(ch)) {
DPRINT(Debug,4,(&Debug,
***************
*** 159,172 ****



set_error(""); /* clear error buffer */

! MoveCursor(lin,col);


}

! ch = mailbox_command(mailbox,ch, &nufoot,

showmsg_digest_cmd, aview,
! &header_page,page);

- redraw += menu_need_redraw(page);

switch (ch) {


case 0: /* OK */

--- 247,259 ----



set_error(""); /* clear error buffer */

! menu_MoveCursor(LOC.prompt_page,lin,col);
}

! ch = mailbox_command(mailbox,ch, &LOC,
showmsg_digest_cmd, aview,
! page);


switch (ch) {


case 0: /* OK */

***************
*** 176,182 ****
int current = get_current(mailbox);


! Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmAssemble,
"Assemble message fragments"));
FlushBuffer();
--- 263,270 ----
int current = get_current(mailbox);


! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat,
ElmSet, ElmAssemble,
"Assemble message fragments"));
FlushBuffer();
***************
*** 184,192 ****

ViewPartial(mailbox,aview);

! (void)get_page(current, &MENU, &header_page);
! redraw++;
!
}
break;

--- 272,279 ----

ViewPartial(mailbox,aview);

! get_page(&MENU, LOC.header_page);
! menu_trigger_redraw(page);
}
break;

***************
*** 196,204 ****
case 'i':
case 'x':
case 'X':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmReturnIndex,
! "Return to index"));
FlushBuffer();

leave = 1;
--- 283,292 ----
case 'i':
case 'x':
case 'X':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmReturnIndex,
! "Return to index"));
FlushBuffer();

leave = 1;
***************
*** 215,251 ****

}

! if (redraw)
! showscreen(mailbox,
! digest_menu,&header_page, page);
!
! check_range(&MENU);


- if (nucurr == NEW_PAGE) {
- DPRINT(Debug,5,(&Debug, " nucurr == NEW_PAGE\n"));
- show_headers(&MENU,&header_page, page);
- } else if (nucurr == SAME_PAGE) {
- DPRINT(Debug,5,(&Debug, " nucurr == SAME_PAGE\n"));
- show_current(&MENU, &header_page, page);
- } else if (nufoot) {
- if (mini_menu) {
- MoveCursor(LINES-8, 0);
- CleartoEOS();
- digest_menu(page);
- }
- else {
- MoveCursor(LINES-5, 0);
- CleartoEOS();
- }
- show_last_error(); /* for those operations that have to
- * clear the footer except for a message.
- */
- }
-
} /* the BIG while loop! */

OUT:
erase_menu_context(&page);

}
--- 303,318 ----

}

! if (menu_need_redraw(page))
! showscreen(page);

+ check_range(&MENU,&LOC);
+ check_mailbox_screen(&LOC,PARAM);

} /* the BIG while loop! */

OUT:
+ free_mailbox_screen(&LOC);
erase_menu_context(&page);

}
***************
*** 313,327 ****


if (new_mailbox) {
- int header_page = 0;
if (get_message_count(new_mailbox) > 0) {
set_current(new_mailbox,1); /* Set current to first message */

update_view(new_mailbox);
- resort_mailbox(new_mailbox,1, &header_page);
}

! digest_loop(new_mailbox, aview, header_page);

free_mailbox(& new_mailbox);
}
--- 380,392 ----


if (new_mailbox) {
if (get_message_count(new_mailbox) > 0) {
set_current(new_mailbox,1); /* Set current to first message */

update_view(new_mailbox);
}

! digest_loop(new_mailbox, aview);

free_mailbox(& new_mailbox);
}
Index: elm2.4.ME+.122-cvs/src/edit.c
*** elm2.4.ME+.121/src/edit.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/src/edit.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: edit.c,v 1.21 2004/07/24 19:50:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: edit.c,v 1.23 2005/06/17 21:02:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 25,38 ****


extern int errno;
#endif

- char *error_description();

- long bytes();
-
#ifdef ALLOW_MAILBOX_EDITING

! void edit_mailbox(mailbox, header_page, page)
struct MailboxView **mailbox;


- int *header_page;
struct menu_context *page;
{

/** Allow the user to edit their folder, always resynchronizing
--- 25,34 ----
extern int errno;
#endif

#ifdef ALLOW_MAILBOX_EDITING

! void edit_mailbox(mailbox, page)
struct MailboxView **mailbox;
struct menu_context *page;
{
/** Allow the user to edit their folder, always resynchronizing
***************
*** 73,83 ****
}

menu_ClearScreen(page);
! newmbox_1(f, FALSE, mailbox, FALSE, header_page,
page);


! showscreen(*mailbox, show_menu, header_page, page);
return;
}

--- 69,79 ----
}

menu_ClearScreen(page);
! newmbox_1(f, FALSE, mailbox, FALSE,
page);


! showscreen(page);
return;
}

Index: elm2.4.ME+.122-cvs/src/editmsg.c
*** elm2.4.ME+.121/src/editmsg.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/editmsg.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.44 2004/07/11 11:36:08 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.48 2005/06/17 21:02:55 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 26,34 ****

DEBUG_VAR(Debug,__FILE__,"misc");

- char *error_description();
- long fsize();
-
/* The built-in editor is not re-entrant! */
static int builtin_editor_active = FALSE;
static char *simple_continue = NULL;
--- 26,31 ----
***************
*** 151,160 ****
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmEditmsgEndMsg,
"\t. \tby itself on a line (or a control-D) ends the message.\n\r"));



! PutLineX (LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpPressRet,
! "Press any key to return..."));

! if (REDRAW_MARK == menu_ReadCh (page,REDRAW_MARK))
goto redraw;

erase_menu_context(&page);
--- 148,157 ----
Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmEditmsgEndMsg,
"\t. \tby itself on a line (or a control-D) ends the message.\n\r"));

! menu_PutLineX(page,LINES-1, 0,

! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpPressRet,
! "Press any key to return..."));
! if (REDRAW_MARK == menu_ReadCh(page,REDRAW_MARK))

goto redraw;

erase_menu_context(&page);
***************
*** 413,419 ****
return;
}

! SIGHAND_TYPE
edit_interrupt(sig)
int sig;
{
--- 410,419 ----
return;
}

!
! static SIGHAND_TYPE edit_interrupt P_((int sig));
!
! static SIGHAND_TYPE
edit_interrupt(sig)
int sig;
{
***************
*** 448,453 ****
--- 448,455 ----
LONGJMP(edit_location, 1); /* get back */
}

+ static int enforce_newline P_((char *filename));
+
static int enforce_newline(filename)
char *filename;
{
***************
*** 1669,1676 ****
ElmUseSpecificCommand,
"(You need to use a specific command here. Continue.)"));
} else {
char * s3 = elm_message(FRM("%s%s.%d"),
! temp_dir, temp_edit, getpid());
char * s1;

X = 1;
--- 1671,1680 ----
ElmUseSpecificCommand,
"(You need to use a specific command here. Continue.)"));
} else {


+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");

char * s3 = elm_message(FRM("%s%s.%d"),


! tmp ? tmp : "/tmp/",

! temp_edit, getpid());
char * s1;

X = 1;
***************
*** 1712,1720 ****
redraw2:

/* ? ? ? */


! PutLineX(LINES-1, 0, CATGETS(elm_msg_cat, ElmSet,

! ElmPressAnyKeyToReturn,
! "\n\nPress any key to return to ELM: "));

if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {

goto redraw2;
--- 1716,1725 ----
redraw2:

/* ? ? ? */
! menu_PutLineX(cpage,
! LINES-1, 0, CATGETS(elm_msg_cat, ElmSet,

! ElmPressAnyKeyToReturn,
! "\n\nPress any key to return to ELM: "));

if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {

goto redraw2;
***************
*** 1946,1952 ****
static struct string **gb_editmsg(I,em, base_page)
struct enter_info *I;
enum enter_mode em;
! struct menu_context *base_page; /* KESKEN */
{
switch(em) {
case em_redraw_initial:
--- 1951,1957 ----
static struct string **gb_editmsg(I,em, base_page)
struct enter_info *I;
enum enter_mode em;
! struct menu_context *base_page;
{
switch(em) {
case em_redraw_initial:
***************
*** 1986,1993 ****
routine above have a pretty incestuous relationship (!)...
**/

! SIGHAND_TYPE edit_interrupt();
! SIGHAND_TYPE (*oldint)(), (*oldquit)();


struct builtin_edit INFO_1;
--- 1991,1998 ----
routine above have a pretty incestuous relationship (!)...
**/

! SIGHAND_TYPE edit_interrupt P_((int));
! SIGHAND_TYPE (*oldint) P_((int)), (*oldquit)P_((int));


struct builtin_edit INFO_1;
Index: elm2.4.ME+.122-cvs/src/elm.c
*** elm2.4.ME+.121/src/elm.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/elm.c 2005-07-01 19:05:29.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.74 2004/07/27 20:25:02 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.74 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.95 2005/07/01 16:05:29 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.95 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 18,23 ****
--- 18,24 ----

#include "patchlevel.h"
#include "elm.h"
+ #include "mailerlib.h"
#include "s_elm.h"

#ifdef BSD_TYPE
***************
*** 40,46 ****
static void do_check_only P_((char *argv[],
struct AliasView *aview));
static void debug_screen P_((struct MailboxView *mailbox,
! int header_page));
static void debug_message P_((struct header_rec *hdr, int current,
struct folder_view *index));

--- 41,47 ----
static void do_check_only P_((char *argv[],
struct AliasView *aview));
static void debug_screen P_((struct MailboxView *mailbox,
! struct screen_parts *LOC));
static void debug_message P_((struct header_rec *hdr, int current,
struct folder_view *index));

***************
*** 63,69 ****


/* MoveCursor() is not safe on interrupt */

if (interrupt) {
! ClearScreen();

Raw(OFF|RAW_FROM_SIGNAL);
} else {
--- 64,70 ----


/* MoveCursor() is not safe on interrupt */

if (interrupt) {

! ClearScreen(1); /* 1 == is called from interrupt */

Raw(OFF|RAW_FROM_SIGNAL);
} else {
***************
*** 107,123 ****
extern int errno;
#endif

! int mailbox_command(mailbox, ch, nufoot, cmdX, aview, header_page,
page)
struct MailboxView *mailbox;
int ch;
! int *nufoot;
showmsg_cmd cmdX;
struct AliasView *aview;
- int *header_page;
struct menu_context *page;
{


- int redraw = 0;

struct menu_common MENU;
int LINES, COLUMNS;

--- 108,122 ----
extern int errno;
#endif

! int mailbox_command(mailbox, ch, LOC, cmdX, aview,
page)
struct MailboxView *mailbox;
int ch;
! struct screen_parts *LOC;
showmsg_cmd cmdX;


struct AliasView *aview;
struct menu_context *page;
{

struct menu_common MENU;
int LINES, COLUMNS;

***************
*** 129,137 ****
switch (ch) {

#ifdef ALLOW_SUBSHELL
! case '!' : Writechar('!');
! subshell(mailbox, page);
! redraw += menu_need_redraw(page);

break;
#endif
--- 128,136 ----
switch (ch) {

#ifdef ALLOW_SUBSHELL
! case '!' :
! menu_Writechar(LOC->prompt_page,'!');
! subshell(mailbox, page,LOC->prompt_page);

break;
#endif
***************
*** 141,151 ****
#ifdef ENABLE_CALENDAR
int current = get_current(mailbox);

! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet,
! ElmScanForCalendar,
! "Scan message for calendar entries..."));
!
if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMailToScan,
--- 140,151 ----
#ifdef ENABLE_CALENDAR
int current = get_current(mailbox);



! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat,

! ElmSet,
! ElmScanForCalendar,
! "Scan message for calendar entries..."));
!
if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMailToScan,
***************
*** 171,177 ****

case 'a' :
alias(mailbox, aview);
! redraw++;
/* define_softkeys(MAIN); */
break;

--- 171,178 ----

case 'a' :
alias(mailbox, aview);
! menu_trigger_redraw(page);
!
/* define_softkeys(MAIN); */
break;

***************
*** 180,188 ****


struct header_rec *hdr;
FILE *F;

! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmBounceMessage,
! "Bounce message"));
FlushBuffer();
if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 181,190 ----


struct header_rec *hdr;
FILE *F;

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat,

! ElmSet, ElmBounceMessage,
! "Bounce message"));
FlushBuffer();
if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 192,200 ****
} else if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
NO_mime_parse)) {
! (*nufoot) = remail(hdr,F, aview, page);


!
! redraw += menu_need_redraw(page);

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 194,202 ----
} else if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
NO_mime_parse)) {
!
! remail(hdr,F, aview, page, LOC->prompt_page);
!

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 208,215 ****


struct header_rec *hdr;
FILE *F;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmExtractPGPKey,


! "Extract PGP public key"));

if (current < 1)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailInFolder,
--- 210,218 ----


struct header_rec *hdr;
FILE *F;

! menu_Write_to_screen(LOC->prompt_page,


! CATGETS(elm_msg_cat, ElmSet, ElmExtractPGPKey,
! "Extract PGP public key"));

if (current < 1)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailInFolder,
***************
*** 219,227 ****
&hdr,&F,NULL,NO_mime_parse)) {



if (hdr->pgp & PGP_PUBLIC_KEY) {

! /* FIX: mime structure is not currently used */
pgp_extract_public_key(hdr,F,page);
- redraw += menu_need_redraw(page);
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoPgpPublicKeys,
--- 222,229 ----
&hdr,&F,NULL,NO_mime_parse)) {



if (hdr->pgp & PGP_PUBLIC_KEY) {

! /* FIXME: mime structure is not currently used */
pgp_extract_public_key(hdr,F,page);
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoPgpPublicKeys,
***************
*** 232,243 ****

}
}
! break;
!
#endif

case ctrl('F'):
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmPassphraseForget,
"Forget passphrase"));
forget_passphrase();
--- 234,245 ----

}
}
! break;
#endif

case ctrl('F'):


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

ElmPassphraseForget,
"Forget passphrase"));
forget_passphrase();
***************
*** 248,256 ****


struct header_rec *hdr;
FILE *F;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmForward,
! "Forward"));
/* define_softkeys(YESNO); */
FlushBuffer();

--- 250,259 ----


struct header_rec *hdr;
FILE *F;

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmForward,
! "Forward"));
/* define_softkeys(YESNO); */
FlushBuffer();

***************
*** 260,273 ****
"No mail to forward!"));

else {


! forward(current-1,mailbox, aview, page);
!
! if (menu_need_redraw(page))

! redraw++;
! else {
! (*nufoot)++;

! show_msg_status(current-1,&MENU, *header_page);
! }
}
/* define_softkeys(MAIN); */
}
--- 263,273 ----
"No mail to forward!"));

else {
! forward(current-1,mailbox, aview,
! page,
! LOC->prompt_page,
! LOC->header_page);
!
}
/* define_softkeys(MAIN); */
}
***************
*** 279,287 ****
FILE *F;


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmGroupReply,
! "Group reply"));
FlushBuffer();

if (current < 1)
--- 279,288 ----
FILE *F;




! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmGroupReply,
! "Group reply"));
FlushBuffer();

if (current < 1)
***************
*** 298,312 ****
"Can't group reply to a Form!!"));

} else {
/* define_softkeys(YESNO); */

! reply_to_everyone(current-1, mailbox,
! aview,page);
! redraw += menu_need_redraw(page);
/* define_softkeys(MAIN); */

- if (!redraw)
- show_msg_status(current-1,&MENU, *header_page);
}
} else {
DPRINT(Debug,3,(&Debug,
--- 299,313 ----
"Can't group reply to a Form!!"));

} else {
+ int vis;
/* define_softkeys(YESNO); */

! reply_to_everyone(current-1, mailbox, aview,
! page,
! LOC->prompt_page,
! LOC->header_page);
/* define_softkeys(MAIN); */

}
} else {
DPRINT(Debug,3,(&Debug,
***************
*** 321,335 ****
int current = get_current(mailbox);

if (elm_filter)
! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet,
! ElmMessageWithHeaders,
! "Message with headers..."));
else
! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet,
! ElmDisplayMessage,
! "Display message"));
FlushBuffer();

if (current < 1)
--- 322,338 ----
int current = get_current(mailbox);

if (elm_filter)


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat,

! ElmSet,
! ElmMessageWithHeaders,
! "Message with headers..."));
else


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat,

! ElmSet,
! ElmDisplayMessage,
! "Display message"));
FlushBuffer();

if (current < 1)
***************
*** 342,372 ****
int j = elm_filter;
int i = 0;

elm_filter = FALSE;
!
!
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i > 0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview, header_page,
! page);

switch (i) {
case EOF:
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

return i; /* "call" parent */
case 0:
break;
--- 345,377 ----
int j = elm_filter;
int i = 0;

+ struct pager_page * PP = init_pager_page(&MENU);
elm_filter = FALSE;
!
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! PP);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i > 0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview,
! PP);

switch (i) {
case EOF:
+ exit_pager_page(&PP,page);
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

+ exit_pager_page(&PP,page);
return i; /* "call" parent */
case 0:
break;
***************
*** 378,415 ****
}
}

!
current = get_current(mailbox);

elm_filter = j;
! redraw++;
! (void)get_page(current, &MENU, header_page);
}
}
break;

#ifdef USE_PGP
case ctrl('K'):
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmMailPGPPublicKey,
! "Mail PGP public key"));
FlushBuffer();

! pgp_mail_public_key(mailbox, aview, page);
! redraw += menu_need_redraw(page);

break;
#endif

! case 'm' : Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmMail,
! "Mail"));
FlushBuffer();
send_msg_l(-1, NULL, NULL, NULL,
! MAIL_EDIT_MSG,allow_forms,
! mailbox, aview,page);


!
! redraw += menu_need_redraw(page);

break;

--- 383,422 ----
}
}

! exit_pager_page(&PP,page);
current = get_current(mailbox);

elm_filter = j;
! menu_trigger_redraw(page);
! get_page(&MENU, LOC->header_page);
}
}
break;

#ifdef USE_PGP
case ctrl('K'):


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMailPGPPublicKey,
! "Mail PGP public key"));
FlushBuffer();

! pgp_mail_public_key(mailbox, aview,
! page,
! LOC->prompt_page);

break;
#endif

! case 'm' :

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMail,
! "Mail"));
FlushBuffer();
send_msg_l(-1, NULL, NULL, NULL,
! MAIL_EDIT_MSG,allow_forms,
! mailbox, aview,page, LOC->prompt_page);



break;

***************
*** 418,426 ****

case ctrl('M'): {
int current = get_current(mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmDisplayMessage,
! "Display message"));
FlushBuffer();

if (current < 1)
--- 425,434 ----
case ctrl('M'): {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmDisplayMessage,
! "Display message"));
FlushBuffer();

if (current < 1)
***************
*** 431,436 ****
--- 439,445 ----


struct header_rec *hdr;
FILE *F;

int i = 0;
+ struct pager_page * PP = init_pager_page(&MENU);

/* define_softkeys(READ); */

***************
*** 440,462 ****
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i > 0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview, header_page,
! page);

switch (i) {
case EOF:
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

return i; /* "call" parent */
case 0:
break;
--- 449,473 ----
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! PP);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i > 0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview,
! PP);

switch (i) {
case EOF:
+ exit_pager_page(&PP,page);
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

+ exit_pager_page(&PP,page);
return i; /* "call" parent */
case 0:
break;
***************
*** 468,477 ****
}
}

current = get_current(mailbox);

! redraw++;
! (void)get_page(current, &MENU, header_page);
}
}
break;
--- 479,489 ----
}
}

+ exit_pager_page(&PP,page);
current = get_current(mailbox);

! menu_trigger_redraw(page);
! get_page(&MENU, LOC->header_page);
}
}
break;
***************
*** 479,487 ****


case 'n' : {
int current = get_current(mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmNextMessage,
! "Next Message"));
FlushBuffer();
/* define_softkeys(READ); */

--- 491,500 ----


case 'n' : {
int current = get_current(mailbox);

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmNextMessage,
! "Next Message"));
FlushBuffer();
/* define_softkeys(READ); */

***************
*** 494,523 ****
FILE *F;
int i = 0;
int mc;
!
/* define_softkeys(READ); */
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
mime_parse_routine))
i = show_msg(hdr, F, current,
get_message_count(mailbox),
! page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i >0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview, header_page,
! page);

switch (i) {
case EOF:
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */
!
return i; /* "call" parent */

case 0:
--- 507,540 ----
FILE *F;
int i = 0;
int mc;
! struct pager_page * PP = init_pager_page(&MENU);
!
/* define_softkeys(READ); */
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
mime_parse_routine))
i = show_msg(hdr, F, current,
get_message_count(mailbox),
! PP);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i >0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview,
! PP);

switch (i) {
case EOF:
+
+ exit_pager_page(&PP,page);
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */
!
! exit_pager_page(&PP,page);
return i; /* "call" parent */

case 0:
***************
*** 530,543 ****
}
}

current = get_current(mailbox);

! redraw++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

! (void)get_page(current, &MENU, header_page);
}
}
break;
--- 547,561 ----
}
}

+ exit_pager_page(&PP,page);
current = get_current(mailbox);

! menu_trigger_redraw(page);
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

! get_page(&MENU, LOC->header_page);
}
}
break;
***************
*** 545,553 ****


case ctrl('N'): {
int current = get_current(mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmNextUMessage,
! "Next Unread Message"));
FlushBuffer();


--- 563,572 ----


case ctrl('N'): {
int current = get_current(mailbox);

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmNextUMessage,
! "Next Unread Message"));
FlushBuffer();


***************
*** 560,565 ****
--- 579,586 ----
current-1);
int mc;


int i = 0;
+

+ struct pager_page * PP = init_pager_page(&MENU);

if(ison(hdr->status, UNREAD)) {
struct header_rec *hdr;
***************
*** 571,577 ****
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 592,598 ----
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! PP);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 581,596 ****
i = ctrl('N');

while (i >0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview, header_page,
! page);

switch (i) {
case EOF:
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

return i; /* "call" parent */

case 0:
--- 602,620 ----
i = ctrl('N');

while (i >0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview,
! PP);

switch (i) {
case EOF:
+
+ exit_pager_page(&PP,page);
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

+ exit_pager_page(&PP,page);
return i; /* "call" parent */

case 0:
***************
*** 603,616 ****
}
}

current = get_current(mailbox);

! redraw++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

! (void)get_page(current, &MENU, header_page);
}
}
break;
--- 627,642 ----
}
}

+ exit_pager_page(&PP,page);
current = get_current(mailbox);

!
! menu_trigger_redraw(page);
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

! get_page(&MENU, LOC->header_page);
}
}
break;
***************
*** 618,626 ****
case 'O' : {
int current = get_current(mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideCharset,
! "Override charset"));

FlushBuffer();

if (current < 1)
--- 644,653 ----
case 'O' : {
int current = get_current(mailbox);



! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideCharset,
! "Override charset"));

FlushBuffer();

if (current < 1)
***************
*** 628,643 ****
ElmNoMailToOverride,
"No mail to override!"));
else
! OverrideCharset(mailbox, *header_page, page);

}
break;


case 'P' : {
int current = get_current(mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmPrintTextMail,
! "Print text of mail"));
FlushBuffer();

if (current < 1) {
--- 655,675 ----
ElmNoMailToOverride,
"No mail to override!"));
else
! OverrideCharset(mailbox, page,
! LOC->prompt_page,
! LOC->header_page);

}
break;
+
+

case 'P' : {
int current = get_current(mailbox);

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmPrintTextMail,
! "Print text of mail"));
FlushBuffer();

if (current < 1) {
***************
*** 648,658 ****
} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! print_text(TRUE, mailbox, *header_page, page);
! if (menu_need_redraw(page))
! redraw++;
! else
! show_msg_status(current-1,&MENU, *header_page);


} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
--- 680,690 ----

} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! int vis;
!
! print_text(TRUE, mailbox, page, LOC->header_page);
!
!

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 665,673 ****


struct header_rec *hdr;
FILE *F;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmReplyToMessage,


! "Reply to message"));

FlushBuffer();

if (current < 1)
--- 697,706 ----


struct header_rec *hdr;
FILE *F;

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmReplyToMessage,


! "Reply to message"));

FlushBuffer();

if (current < 1)
***************
*** 675,686 ****
ElmNoMailToReplyTo,
"No mail to reply to!"));
else {


!
! reply(current-1,mailbox, aview, page);

! redraw += menu_need_redraw(page);

- if (!redraw)
- show_msg_status(current-1,&MENU, *header_page);
}
/* softkeys_on(); */
}
--- 708,720 ----
ElmNoMailToReplyTo,
"No mail to reply to!"));
else {
! int vis;
!
! reply(current-1,mailbox, aview,
! page,
! LOC->prompt_page,
! LOC->header_page);

}
/* softkeys_on(); */
}
***************
*** 693,705 ****
int current = get_current(mailbox);

if (ch != 'C')
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmSaveToFolder,
! "Save to folder"));
else
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmCopyToFolder,
! "Copy to folder"));
FlushBuffer();

if (current < 1) {
--- 727,741 ----
int current = get_current(mailbox);

if (ch != 'C')


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmSaveToFolder,
! "Save to folder"));
else


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCopyToFolder,
! "Copy to folder"));
FlushBuffer();

if (current < 1) {
***************
*** 716,722 ****
NULL,NULL,NULL,NO_mime_parse)) {

if (save(FALSE, (ch != 'C'), 0,mailbox, aview,
! *header_page, page)
&& resolve_mode && ch != 'C') {
int i;

--- 752,760 ----
NULL,NULL,NULL,NO_mime_parse)) {

if (save(FALSE, (ch != 'C'), 0,mailbox, aview,
! page,
! LOC->prompt_page,
! LOC->header_page)
&& resolve_mode && ch != 'C') {
int i;

***************
*** 726,737 ****
current = i+1;
set_current(mailbox,current);

! nucurr = get_page(current,&MENU, header_page);

}
}

- redraw += menu_need_redraw(page);


} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 764,774 ----
current = i+1;
set_current(mailbox,current);

! get_page(&MENU, LOC->header_page);



}
}

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 743,751 ****


case 'S' : {
int current = get_current(mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmSaveTextToFileorFolder,
! "Save (copy) text to file or folder"));
FlushBuffer();

if (current < 1) {
--- 780,789 ----


case 'S' : {
int current = get_current(mailbox);

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmSaveTextToFileorFolder,
! "Save (copy) text to file or folder"));
FlushBuffer();

if (current < 1) {
***************
*** 756,768 ****
} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! save(FALSE, 0, 1, mailbox, aview, *header_page,
! page);

- redraw += menu_need_redraw(page);

- if (!redraw)
- show_msg_status(current-1,&MENU, *header_page);


} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 794,807 ----
} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! int vis;
!
! save(FALSE, 0, 1, mailbox, aview,
! page,
! LOC->prompt_page,
! LOC->header_page);




} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 781,790 ****

}
else
! unread_msg(TRUE, mailbox, *header_page);
}
break;
!
case 'v' : {

struct header_rec *hdr;
FILE *F;

--- 820,829 ----

}
else
! unread_msg(mailbox, LOC->header_page);
}
break;
!
case 'v' : {

struct header_rec *hdr;
FILE *F;
***************

*** 795,806 ****
ElmNoMessages,
"There are no messages!"));
else {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmViewParts,
! "View parts of message"));

if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,mime_parse_routine)) {
if ((hdr->status & MIME_MESSAGE)) {

mime_warnings(hdr);
--- 834,848 ----
ElmNoMessages,
"There are no messages!"));
else {


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmViewParts,
! "View parts of message"));

if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,mime_parse_routine)) {
+ int vis;
+
if ((hdr->status & MIME_MESSAGE)) {

mime_warnings(hdr);
***************
*** 809,822 ****
NULL,
hdr->header_charset, NULL,
hdr,
! aview
! );
! redraw++;
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMIMEMessage,
"This is not a MIME message!"));
! show_msg_status(current-1,&MENU,*header_page);


} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 851,866 ----
NULL,
hdr->header_charset, NULL,
hdr,
! aview);
! menu_trigger_redraw(page);
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMIMEMessage,
"This is not a MIME message!"));
! /* FIXME ? */
! vis = compute_visible(current, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);
!

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 828,836 ****
case 'V': {
int current = get_current(mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmViewDigest,
! "View digest as mailbox"));

FlushBuffer();

--- 872,881 ----
case 'V': {
int current = get_current(mailbox);



! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmViewDigest,
! "View digest as mailbox"));

FlushBuffer();

***************
*** 844,856 ****
ViewDigest(mailbox,aview);

current = get_current(mailbox);
! (void)get_page(current, &MENU, header_page);
! redraw++;



} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

! show_msg_status(current-1,&MENU,*header_page);
}
}
break;
--- 889,905 ----
ViewDigest(mailbox,aview);

current = get_current(mailbox);
! get_page(&MENU, LOC->header_page);
! menu_trigger_redraw(page);

} else {
+ int vis;


DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

!
! /* FIXME? */
! vis = compute_visible(current, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);
}
}
break;
***************
*** 859,873 ****
return EOF;/* Read failed, control tty died? */

case '@' :
! debug_screen(mailbox, *header_page);
! redraw++;
break;

case '#' : {
int current = get_current(mailbox);
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmCheckMessage,
! "Check message"));
FlushBuffer();

if (current < 1)
--- 908,923 ----
return EOF;/* Read failed, control tty died? */

case '@' :
! debug_screen(mailbox,LOC);
! menu_trigger_redraw(page);
break;

case '#' : {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCheckMessage,
! "Check message"));
FlushBuffer();

if (current < 1)
***************
*** 884,890 ****
&index);

debug_message(hdr, current, &index);
! redraw++;
}
}
}
--- 934,940 ----
&index);

debug_message(hdr, current, &index);
! menu_trigger_redraw(page);
}
}
}
***************
*** 893,924 ****


default:
/* Maybe motion command */

! ch = motion(ch,&MENU,nufoot, header_page,
! page);

/* motion() may already set, menu_trigger_redraw(page),
we do not examine it */


- if (redraw)
- menu_trigger_redraw(page);

return ch;



}

- if (redraw)
- menu_trigger_redraw(page);

return 0; /* Command OK */
}

! void new_mail_check (mailbox, header_page, page)


struct MailboxView *mailbox;
- int *header_page;
struct menu_context *page;
{

int idx, mbxcount;


struct menu_common MENU;
int LINES, COLUMNS;

- int redraw = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

--- 943,968 ----


default:
/* Maybe motion command */

! ch = motion(ch,&MENU,LOC, page);

/* motion() may already set, menu_trigger_redraw(page),
we do not examine it */

return ch;

}

return 0; /* Command OK */
}

! void new_mail_check (mailbox, page, LOC)


struct MailboxView *mailbox;
struct menu_context *page;

+ struct screen_parts *LOC;
{
int idx, mbxcount;


struct menu_common MENU;
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 941,948 ****
&bytes)) {

int current = get_current(mailbox);
- int was_on_page = on_page(current, &MENU, *header_page);
- int pageon = *header_page;
int last_in_folder = storage->message_count;
int selected = get_selected(mailbox);
int ok;
--- 985,990 ----
***************
*** 958,964 ****

if (ok)
clear_error();
- *header_page = pageon;

if (selected) {
/* update count of selected messages */
--- 1000,1005 ----
***************
*** 966,974 ****
set_selected(mailbox,selected);
}

! if (on_page(current, &MENU, *header_page) ||
! was_on_page || !ok) /* do we REALLY have to rewrite? */
! redraw++;

ClearLine(LINES-2); /* remove reading message... */

--- 1007,1014 ----
set_selected(mailbox,selected);
}

! menu_trigger_redraw(LOC->header_page);
! menu_trigger_redraw(LOC->title_page);

ClearLine(LINES-2); /* remove reading message... */

***************
*** 996,1008 ****


}
}

! if (redraw)
! menu_trigger_redraw(page);

}



int main(argc, argv)
int argc;

char *argv[];
--- 1036,1237 ----
}
}

! }
!
! void mailbox_screen_common(page,LOC, LIST)
! struct menu_context *page;
! struct screen_parts *LOC;
! struct menu_param *LIST;
! {
! int LINES, COLUMNS;
! int headers_per_page;

+ menu_get_sizes(page,&LINES, &COLUMNS);
+
+ /* 3) prompt part */


+
+ if (LOC->prompt_page)
+ menu_subpage_relocate(LOC->prompt_page,page,LINES-4,4);
+ else
+ LOC->prompt_page = new_menu_subpage(page,LINES-4,4,
+ subpage_simple_noredraw,LIST);
+
+

+ headers_per_page = LOC->menu_page ? LINES-13 : LINES-9;
+ if (headers_per_page < 1) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWindowSizeTooSmall,
+ "The window is too small to run Elm. It must have at least %d rows"),
+ LINES - headers_per_page);
+
+ headers_per_page = 1;
+ }
+
+ /* 4) headers of screen */
+

+ if (! LOC->header_page)

+ LOC->header_page = new_menu_header(page,4,
+ headers_per_page,
+ hdr_show_header,
+ hdr_show_current,
+ null_header_param_changed,
+ hdr_show_status,
+ LIST);
+ else
+ menu_header_relocate(LOC->header_page,page,
+ 4,headers_per_page);
+
+ }
+
+ static void set_mailbox_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_mailbox_screen(page,LOC, LIST)


+ struct menu_context *page;
+ struct screen_parts *LOC;
+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ /* 1) Title part of screen */
+

+ if (! LOC->title_page)

+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */
+
+ if (LOC->menu_page && LINES < 14)
+ erase_menu_context (&(LOC->menu_page));
+ else if (LOC->menu_page)
+ menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
+ else if (mini_menu && LINES > 14)
+ LOC->menu_page = new_menu_subpage(page,LINES-8,4,
+ sb_show_menu,LIST);
+
+ mailbox_screen_common(page,LOC, LIST);
+ }
+
+ void free_mailbox_screen(LOC)
+ struct screen_parts *LOC;
+ {
+ erase_menu_context (&(LOC->title_page));


+
+ if (LOC->menu_page)

+ erase_menu_context (&(LOC->menu_page));
+
+ erase_menu_context (&(LOC->prompt_page));
+
+ if (LOC->header_page)
+ erase_menu_context (&(LOC->header_page));
+ }
+
+ static void check_mailbox_screen P_((struct screen_parts *LOC,
+ struct menu_param *list));
+ static void check_mailbox_screen(LOC,list)


+ struct screen_parts *LOC;
+ struct menu_param *list;

+ {
+ /* 1) title page */
+ if (menu_resized(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }


+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));

+ sb_update_title(LOC->title_page,list);
+ }


+
+ if (LOC->menu_page) {

+ /* 2) menu page */
+ if (menu_resized(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }


+ if (menu_need_redraw(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page redraw\n"));

+ sb_show_menu(LOC->menu_page,list);
+ }
+ }
+
+ /* 3) prompt part */


+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {
+ DPRINT(Debug,7, (&Debug, "prompt page redraw\n"));
+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.

+ */
+ }
+
+ /* 4) headers part */
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page resized\n"));
+ }
+ if (menu_need_redraw(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page redraw\n"));
+ menu_ClearScreen(LOC->header_page);


+ }
+ }
+
+ #if ANSI_C

+ static subpage_simple_redraw sb_update_sendtitle;
+ #endif
+ static int sb_update_sendtitle(ptr,list)


+ struct menu_context *ptr;
+ struct menu_param *list;
+ {

+ menu_ClearScreen(ptr);
+
+ menu_print_format_center(ptr,1,
+ CATGETS(elm_msg_cat, ElmSet, ElmSendOnlyMode,
+ "Send only mode [ELM %s]"),
+ version_buff);
+
+ return 1; /* Redraw completely done */
}

+ static void set_sendmode_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_sendmode_screen(page,LOC, LIST)


+ struct menu_context *page;
+ struct screen_parts *LOC;
+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ /* 1) Title part of screen */
+

+ if (! LOC->title_page)

+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_sendtitle,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */
+ LOC->menu_page = NULL;
+
+ /* 3) prompt part */


+
+ if (LOC->prompt_page)
+ menu_subpage_relocate(LOC->prompt_page,page,LINES-4,4);
+ else
+ LOC->prompt_page = new_menu_subpage(page,LINES-4,4,
+ subpage_simple_noredraw,LIST);
+

+ /* 4) headers of screen */
+ LOC->header_page = NULL;
+ }


+ int main P_((int argc, char *argv[]));

int main(argc, argv)
int argc;

char *argv[];
***************
*** 1013,1029 ****
int auto_assemble = 1;
int i,j; /** Random counting variables (etc) **/

- int redraw = 0, /* do we need to rewrite the entire screen? */
- nufoot = 0; /* clear lines 16 thru bottom and new menu */
- int header_page = 0; /* current header page */
-

struct menu_context *page = NULL;

struct MailboxView * cur_mailbox = NULL;
struct AliasView * cur_aliaslist = NULL;

set_panic_prepare(elm_panic_prepare);
set_panic_exit(elm_panic_exit);

#if DEBUG
init_debugfile("ELM");

--- 1242,1267 ----
int auto_assemble = 1;
int i,j; /** Random counting variables (etc) **/



struct menu_context *page = NULL;

+ struct screen_parts LOC = { NULL, NULL, NULL, NULL };

+ struct menu_common MENU;
+ struct menu_param PARAM[elm_mp_COUNT+1] = {
+ { mp_menu_common, 0 },


+ { mp_integer, 0 },
+ { mp_END,0 }
+ };
+

struct MailboxView * cur_mailbox = NULL;
struct AliasView * cur_aliaslist = NULL;
+ enum check_mode check_mode = chk_none;
+

set_panic_prepare(elm_panic_prepare);
set_panic_exit(elm_panic_exit);

+ set_mcommon_from_mbxview(&MENU,NULL); /* Clear initially */
+ mp_list_set_mcommon(PARAM,elm_mp_menu,&MENU);
+
#if DEBUG
init_debugfile("ELM");

***************
*** 1045,1065 ****

locale_init();

! req_mfile_vector = parse_arguments(argc, argv, &to_whom);
! initialize(req_mfile_vector, &cur_mailbox, &cur_aliaslist,
! &header_page, &page);
! if (req_mfile_vector) {
! int i;
!
! for (i = 0; req_mfile_vector[i]; i++) {
! free(req_mfile_vector[i]);
! req_mfile_vector[i] = NULL;
! }
!
! free(req_mfile_vector);
! req_mfile_vector = NULL;
! }
!


if (mail_only) {
--- 1283,1291 ----

locale_init();

! req_mfile_vector = parse_arguments(argc, argv, &to_whom,
! &check_mode);
! initialize(&cur_aliaslist, &page);


if (mail_only) {
***************
*** 1067,1173 ****
"Mail-only: mailing to\n"));

if(!batch_only) {
! print_format_center(1,
! CATGETS(elm_msg_cat, ElmSet, ElmSendOnlyMode,
! "Send only mode [ELM %s]"),
! version_buff);
! }
! send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
! (batch_only ? NO : allow_forms), cur_mailbox,
! cur_aliaslist, page);

! leave(0);
} else if (check_only) {
do_check_only(to_whom, cur_aliaslist);
! leave(0);
}

! showscreen(cur_mailbox,
! show_menu, &header_page, page);

while (1) {

- struct menu_common MENU;
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,cur_mailbox);

if (menu_resized(page)) {

menu_get_sizes(page,&LINES, &COLUMNS);

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))
! if (mini_menu)
! headers_per_page = max (LINES - 14, 1);
! else
! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;
}
- else
- redraw += menu_need_redraw(page);

- nufoot = 0;
- nucurr = 0;

#ifdef BACKGROUD_PROCESSES
if (handle_sigchld)
sigchld_handler();
#endif

! new_mail_check(cur_mailbox,&header_page,
! page);


! redraw += menu_need_redraw(page);
!

!
/* ??? FIX Is this correct ?? */
if (update_view(cur_mailbox)) {
! resort_mailbox(cur_mailbox,1,&header_page);

! redraw++;
}

! if (redraw) {
DPRINT(Debug,7, (&Debug,
"main: pending redraw\n"));
!
! redraw = 0;
! showscreen(cur_mailbox,
! show_menu, &header_page, page);
! show_last_error();


}

!
! {
int lin,col;
!

! prompt_s(mcommon_give_item(&MENU, m_Prompt));
! GetXYLocation(&lin,&col);

! CleartoEOS();
show_last_error();
! MoveCursor(lin,col);

/* fragment_handling: 0 == none,


1 == manual,
2 == auto */


! if (auto_assemble && 2 == fragment_handling &&
have_partial(cur_mailbox)) {
ch = 'A';
auto_assemble = 0;



DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else
! ch = GetPrompt(page);

/* ? ? ? resize again? */

! CleartoEOS();

if (isascii(ch) && isprint(ch)) {
DPRINT(Debug,4,(&Debug,
--- 1293,1420 ----
"Mail-only: mailing to\n"));

if(!batch_only) {
! set_sendmode_screen(page,&LOC,PARAM);
! sb_update_sendtitle(LOC.title_page,PARAM);
!
! send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
! (batch_only ? NO : allow_forms), cur_mailbox,
! cur_aliaslist, page,
! LOC.prompt_page);
! goto OUT;
! } else {
! send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
! (batch_only ? NO : allow_forms), cur_mailbox,
! cur_aliaslist, page,
! NULL);

! goto OUT_1;
! }
} else if (check_only) {
do_check_only(to_whom, cur_aliaslist);
! goto OUT_1;
! }
! set_mailbox_screen(page,&LOC,PARAM);
!
! cur_mailbox = initialize_mailbox(req_mfile_vector,page,
! cur_aliaslist, check_mode);
! if (req_mfile_vector) {
! int i;
!
! for (i = 0; req_mfile_vector[i]; i++) {
! free(req_mfile_vector[i]);
! req_mfile_vector[i] = NULL;
! }
!
! free(req_mfile_vector);
! req_mfile_vector = NULL;
}

! if (!cur_mailbox)
! goto fail;
!
! set_mcommon_from_mbxview(&MENU,cur_mailbox);
!
! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! copy_current(&MENU,LOC.header_page);
!
! showscreen(page);

while (1) {



int LINES, COLUMNS;

+ menu_set_default(page);
+

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,cur_mailbox);

if (menu_resized(page)) {

+ set_mailbox_screen(page,&LOC,PARAM);
+
menu_get_sizes(page,&LINES, &COLUMNS);

! menu_trigger_redraw(page); /* ? Is needed? */
}


#ifdef BACKGROUD_PROCESSES
if (handle_sigchld)
sigchld_handler();
#endif

! new_mail_check(cur_mailbox,page, &LOC);
!
/* ??? FIX Is this correct ?? */
if (update_view(cur_mailbox)) {
! resort_mailbox(cur_mailbox,1);

! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! menu_trigger_redraw(LOC.header_page);
! menu_trigger_redraw(LOC.title_page);
}

! if (menu_need_redraw(page)) {
DPRINT(Debug,7, (&Debug,
"main: pending redraw\n"));
!
! showscreen(page);
}
+ check_mailbox_screen(&LOC, PARAM);
+
+

! {
int lin,col;
! int fh = give_dt_enumerate_as_int(&fragment_handling);

! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));


! menu_GetXYLocation(LOC.prompt_page,&lin,&col);
!
! menu_CleartoEOS(LOC.prompt_page);
!

show_last_error();
! menu_MoveCursor(LOC.prompt_page,lin,col);

/* fragment_handling: 0 == none,


1 == manual,
2 == auto */


! if (auto_assemble && 2 == fh &&
have_partial(cur_mailbox)) {
ch = 'A';
auto_assemble = 0;



DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else

! ch = GetPrompt(LOC.prompt_page);



/* ? ? ? resize again? */

! menu_CleartoEOS(LOC.prompt_page);

if (isascii(ch) && isprint(ch)) {
DPRINT(Debug,4,(&Debug,
***************
*** 1179,1193 ****



set_error(""); /* clear error buffer */

! MoveCursor(lin,col);
}

! ch = mailbox_command(cur_mailbox,ch, &nufoot,
! showmsg_main_cmd,
! cur_aliaslist,
! &header_page,page);


!
! redraw += menu_need_redraw(page);

switch (ch) {


case 0: /* OK */

--- 1426,1439 ----



set_error(""); /* clear error buffer */

! menu_MoveCursor(LOC.prompt_page,lin,col);
}

! ch = mailbox_command(cur_mailbox,ch, &LOC,
! showmsg_main_cmd,
! cur_aliaslist,
! page);
!

switch (ch) {


case 0: /* OK */

***************
*** 1195,1231 ****

case HELP_MARK:
case '?' :
! help(FALSE, page);

- if (menu_need_redraw(page))
- redraw++;
- else
- nufoot++;
break;

case '$' : {
int current;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmResyncFolder,
! "Resynchronize folder"));
FlushBuffer();

! resync(& cur_mailbox, &header_page, page);
! redraw += menu_need_redraw(page);

/* FIX MENU pointer ... */
set_mcommon_from_mbxview(&MENU,cur_mailbox);

current = get_current(cur_mailbox);
! nucurr = get_page(current, &MENU, &header_page);
}
break;

case '|' : {
int current = get_current(cur_mailbox);

! Writechar('|');

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 1441,1474 ----

case HELP_MARK:
case '?' :
! help(FALSE, page, LOC.prompt_page);

break;

case '$' : {
int current;

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmResyncFolder,
! "Resynchronize folder"));
FlushBuffer();

! resync(& cur_mailbox, page, &LOC);

/* FIX MENU pointer ... */
set_mcommon_from_mbxview(&MENU,cur_mailbox);

current = get_current(cur_mailbox);
! get_page(&MENU, LOC.header_page);
}
break;

case '|' : {
int current = get_current(cur_mailbox);

! menu_Writechar(LOC.prompt_page,
! '|');

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 1237,1244 ****

/* softkeys_off(); */

! do_pipe(cur_mailbox, page);
! redraw += menu_need_redraw(page);

/* softkeys_on(); */
} else {
--- 1480,1487 ----

/* softkeys_off(); */

! do_pipe(cur_mailbox, page,LOC.prompt_page);

!

/* softkeys_on(); */
} else {

***************
*** 1251,1295 ****
case 'A': {
int current = get_current(cur_mailbox);

! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmAssemble,
! "Assemble message fragments"));
FlushBuffer();
sleep_message();

ViewPartial(cur_mailbox, cur_aliaslist);

current = get_current(cur_mailbox);
! (void)get_page(current, &MENU, &header_page);
! redraw++;

}
break;

! case 'c' : Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmChangeFolder,
! "Change folder"));
/* define_softkeys(CHANGE); */
! change_file(& cur_mailbox, cur_aliaslist,
! &header_page, page);
! redraw += menu_need_redraw(page);


! /* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,cur_mailbox);

/* define_softkeys(MAIN); */
break;

#ifdef ALLOW_MAILBOX_EDITING
case 'e' : {
int current = get_current(cur_mailbox);

! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmEditFolder,
! "Edit folder"));
!
! if (user_level < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoFolderEditing,
"You are not experienced to use folder editing"));
--- 1494,1555 ----
case 'A': {
int current = get_current(cur_mailbox);

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat,
! ElmSet, ElmAssemble,
! "Assemble message fragments"));
FlushBuffer();
sleep_message();

ViewPartial(cur_mailbox, cur_aliaslist);

current = get_current(cur_mailbox);
! get_page(&MENU, LOC.header_page);
! menu_trigger_redraw(page);

}
break;

! case 'c' : {
! struct MailboxView * new_mailbox = NULL;
!
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat,
! ElmSet, ElmChangeFolder,
! "Change folder"));
/* define_softkeys(CHANGE); */
! new_mailbox = change_file(cur_mailbox, cur_aliaslist,
! page);

+ if (!new_mailbox)
+ break;

! /* FIX MENU pointer ... redraw may use it */
! set_mcommon_from_mbxview(&MENU,new_mailbox);
!
! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
!
! menu_trigger_redraw(LOC.header_page);
! menu_trigger_redraw(LOC.title_page);
!
! free_mailbox(&cur_mailbox);
! cur_mailbox = new_mailbox;

/* define_softkeys(MAIN); */
+ }
break;

#ifdef ALLOW_MAILBOX_EDITING
case 'e' : {
int current = get_current(cur_mailbox);


+ int ul = give_dt_enumerate_as_int(&user_level);
+

+ menu_Write_to_screen(LOC.prompt_page,
+ CATGETS(elm_msg_cat,
+ ElmSet, ElmEditFolder,
+ "Edit folder"));

! if (ul < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoFolderEditing,
"You are not experienced to use folder editing"));
***************
*** 1302,1308 ****
ElmFolderIsEmpty,
"Folder is empty!"));
else
! edit_mailbox(&cur_mailbox, &header_page,
page);

}
--- 1562,1568 ----
ElmFolderIsEmpty,
"Folder is empty!"));
else
! edit_mailbox(&cur_mailbox,
page);

}
***************
*** 1318,1341 ****
case 'o' : {
int current = get_current(cur_mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmOptions,
! "Options"));
if((i=options(cur_mailbox, cur_aliaslist)) > 0) {
current = get_current(cur_mailbox);
! get_page(current, &MENU, &header_page);
} else if(i < 0)
! leave(0);
! redraw++; /* always fix da screen... */
}
break;

case 'p' : {
int current = get_current(cur_mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmPrintMail,
! "Print mail"));
FlushBuffer();

#if DISABLE_PRINT
--- 1578,1604 ----
case 'o' : {
int current = get_current(cur_mailbox);

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmOptions,
! "Options"));
if((i=options(cur_mailbox, cur_aliaslist)) > 0) {
current = get_current(cur_mailbox);
! get_page(&MENU, LOC.header_page);
} else if(i < 0)
! goto OUT;
!
! menu_trigger_redraw(page); /* always fix da screen... */
}
break;

case 'p' : {
int current = get_current(cur_mailbox);

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPrintMail,
! "Print mail"));
FlushBuffer();

#if DISABLE_PRINT
***************
*** 1353,1361 ****
used
*/
print_msg(TRUE,cur_mailbox, page);


!
! redraw += menu_need_redraw(page);
!

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 1616,1622 ----
used
*/
print_msg(TRUE,cur_mailbox, page);
!

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
***************

*** 1363,1381 ****
#endif
}
break;


! case 'q' : {
! int idx, mbxcount, found = 0;
!
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmQuit,
! "Quit"));
! FlushBuffer();
!
! mbxcount = get_storage_count(cur_mailbox);

! for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;



struct current_storage * storage =

--- 1624,1643 ----
#endif
}
break;
+
+
+ case 'q' : {
+ int idx, mbxcount, found = 0;

+ menu_Write_to_screen(LOC.prompt_page,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmQuit,
+ "Quit"));
+ FlushBuffer();

! mbxcount = get_storage_count(cur_mailbox);

! for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;



struct current_storage * storage =

***************
*** 1393,1410 ****
}
}

! if (!found)
quit(TRUE, &cur_mailbox,&cur_aliaslist,
! &header_page, page);
}
break;

case 'Q' : {
int idx, mbxcount, found = 0;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmQuickQuit,
! "Quick quit"));
FlushBuffer();

mbxcount = get_storage_count(cur_mailbox);
--- 1655,1679 ----
}
}

! if (!found) {
! free_mailbox_screen(&LOC);
!
quit(TRUE, &cur_mailbox,&cur_aliaslist,
! page);
!
! /* Canceled ... setup again */
! set_mailbox_screen(page,&LOC,PARAM);
! }
}
break;

case 'Q' : {
int idx, mbxcount, found = 0;

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmQuickQuit,
! "Quick quit"));
FlushBuffer();

mbxcount = get_storage_count(cur_mailbox);
***************
*** 1426,1434 ****
}
}

! if (!found)
quit(FALSE, &cur_mailbox,&cur_aliaslist,
! &header_page, page);
}
break;

--- 1695,1705 ----
}
}

! if (!found) {
! free_mailbox_screen(&LOC);
quit(FALSE, &cur_mailbox,&cur_aliaslist,
! page);
! }
}
break;

***************
*** 1436,1508 ****



! case 'X' : Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmQuickExit,
! "Quick Exit"));
! FlushBuffer();
! leave(0);
! break;

case ctrl('Q') :
! case 'x' : Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmExit,
! "Exit"));
! FlushBuffer();

exit_prog(&cur_mailbox,&cur_aliaslist,
&page);
break;

case EOF :
! leave(0);
/* Read failed, control tty died? */
! break;
!
!
default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmUnknownCommand,
"Unknown command. Use '?' for help."));
}

! if (redraw)
! showscreen(cur_mailbox,
! show_menu, &header_page, page);
!
! check_range(&MENU);
!
! if (nucurr == NEW_PAGE) {
! DPRINT(Debug,5,(&Debug, " nucurr == NEW_PAGE\n"));
! show_headers(&MENU,&header_page, page);
! } else if (nucurr == SAME_PAGE) {
! DPRINT(Debug,5,(&Debug, " nucurr == SAME_PAGE\n"));
! show_current(&MENU,&header_page, page);
! } else if (nufoot) {
! if (mini_menu) {
! MoveCursor(LINES-8, 0);
! CleartoEOS();
! show_menu(page);
! } else {


! MoveCursor(LINES-5, 0);
! CleartoEOS();
! }

! show_last_error(); /* for those operations that have to
! * clear the footer except for a message.
! */
! }

! } /* the BIG while loop! */
}

! static void debug_screen(mailbox, header_page)
struct MailboxView *mailbox;
! int header_page;
{
/**** spit out all the current variable settings and the table
entries for the current 'n' items displayed. ****/

int i, j;


int LINES, COLUMNS;
struct menu_context *page = new_menu_context();

redraw:
--- 1707,1785 ----



! case 'X' :
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmQuickExit,
! "Quick Exit"));
! FlushBuffer();
!
! goto OUT;
!

case ctrl('Q') :
! case 'x' :
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmExit,
! "Exit"));
! FlushBuffer();

exit_prog(&cur_mailbox,&cur_aliaslist,
&page);
break;

case EOF :
!
! goto OUT;
/* Read failed, control tty died? */
!
default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmUnknownCommand,
"Unknown command. Use '?' for help."));
}

! if (menu_need_redraw(page))
! showscreen(page);
!
! check_range(&MENU,&LOC);
!
! check_mailbox_screen(&LOC, PARAM);
!
! } /* the BIG while loop! */
!
! OUT:
! free_mailbox_screen(&LOC);
!
! OUT_1:
! erase_menu_context(&page);

! leave(0);
!
! return 0;
!
! fail:
! free_mailbox_screen(&LOC);
! erase_menu_context(&page);
!

! Raw_OFF(1); /* Raw(OFF) and reprint error message */
! #ifdef REMOTE_MBX
! close_cached_connections();
! #endif

! return 1;
}

! static void debug_screen(mailbox,LOC)
struct MailboxView *mailbox;
! struct screen_parts *LOC;
{
/**** spit out all the current variable settings and the table
entries for the current 'n' items displayed. ****/

int i, j;
int LINES, COLUMNS;
+ int li,co;


struct menu_context *page = new_menu_context();

redraw:
***************
*** 1514,1548 ****

menu_ClearScreen(page);

! PutLineX(0,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxCurrMsgNum,
! "Current message number = %d\t\t%d message(s) total\n"),
! get_current(mailbox),
! get_message_count(mailbox));
! PutLineX(2,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxHdrPage,
! "Header_page = %d \t\t%d possible page(s)\n"),
! header_page, (int) (get_message_count(mailbox) /
! headers_per_page) + 1);

{

struct folder_info * f = get_main_folder(mailbox);
if (f) {
! PutLineX(4,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxCurrMailFile,
! "\nCurrent mail file is %S.\n\r\n"),
! f->cur_folder_disp);
}
}

! i = header_page*headers_per_page; /* starting header */

! if ((j = i + (headers_per_page-1)) >= get_message_count(mailbox))
j = get_message_count(mailbox)-1;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDebugHeader,
! "Num From Subject Lines Offset Content\n\r\n\r"));

for (;i <= j; i++) {
struct header_rec * hdr = give_header(mailbox,i);
--- 1791,1827 ----

menu_ClearScreen(page);

! menu_PutLineX(page,
! 0,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxCurrMsgNum,
! "Current message number = %d\t\t%d message(s) total\n"),
! get_current(mailbox),
! get_message_count(mailbox));
!

{

struct folder_info * f = get_main_folder(mailbox);
if (f) {
! menu_PutLineX(page,
! 4,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxCurrMailFile,
! "\nCurrent mail file is %S.\n\r\n"),
! f->cur_folder_disp);
}
}

! i = menu_header_get(LOC->header_page,header_top_line); /* starting header */


! menu_get_sizes(LOC->header_page, &li, &co);

! if ((j = i + li-1) >= get_message_count(mailbox))
j = get_message_count(mailbox)-1;

! /* FIXME -- selected */
!
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmDebugHeader,
! "Num From Subject Lines Offset Content\n\r\n\r"));

for (;i <= j; i++) {
struct header_rec * hdr = give_header(mailbox,i);
***************
*** 1562,1600 ****
if (hdr->from &&
hdr->from->fullname &&
string_len(hdr->from->fullname))
! Write_to_screen(FRM("%3d %-16.16S %-35.35S %4d %8d %8d\n\r"),
! i+1,
! hdr->from->fullname,
! x,
! hdr->lines,
! hdr->offset,
! hdr->content_length);
else
! Write_to_screen(FRM("%3d %-16.16s %-35.35S %4d %8d %8d\n\r"),
! i+1,
! hdr->from &&
! hdr->from->addr &&
! hdr->from->addr[0] ?
! hdr->from->addr :
! hdr->env_from,
! x,
! hdr->lines,
! hdr->offset,
! hdr->content_length);

if (temp)
free_string(&temp);

}

! PutLineX(LINES-1,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxPressAnyKey,"Press any key to return."));


if (REDRAW_MARK == menu_ReadCh(page, REDRAW_MARK))

! goto redraw;
!
! erase_menu_context(&page);
! return;

}

static void debug_message(current_header,current,index)
--- 1841,1882 ----
if (hdr->from &&
hdr->from->fullname &&
string_len(hdr->from->fullname))
! menu_Write_to_screen(page,
! FRM("%3d %-16.16S %-35.35S %4d %8d %8d\n\r"),
! i+1,
! hdr->from->fullname,
! x,
! hdr->lines,
! hdr->offset,
! hdr->content_length);
else
! menu_Write_to_screen(page,
! FRM("%3d %-16.16s %-35.35S %4d %8d %8d\n\r"),
! i+1,
! hdr->from &&
! hdr->from->addr &&
! hdr->from->addr[0] ?
! hdr->from->addr :
! hdr->env_from,
! x,
! hdr->lines,
! hdr->offset,
! hdr->content_length);

if (temp)
free_string(&temp);



}

! menu_PutLineX(page,
! LINES-1,0,CATGETS(elm_msg_cat, ElmSet,

! ElmDbxPressAnyKey,"Press any key to return."));


if (REDRAW_MARK == menu_ReadCh(page, REDRAW_MARK))

! goto redraw;

+ erase_menu_context(&page);
+ return;
+
}

static void debug_message(current_header,current,index)
***************
*** 1618,1693 ****

menu_ClearScreen(page);

! Write_to_screen(FRM("\t\t\t----- Message %d -----\n\r\n\r\n\r\n\r"),
! current);
!
! Write_to_screen(FRM("Lines: %-17dStatus: A C D E F N P T U V O R M P U N\n\r"),
! current_header->lines);
! Write_to_screen(FRM("Content-Length: %-16dc o e x o e r a r i l e i r s H\n\r"),
! current_header->content_length);
! Write_to_screen(FRM("Binary: %-24dt n l p r w i g g s d p m e u d\n\r"),
! current_header->binary);
! Write_to_screen(FRM("'From ' on body: %-15dn f d d m v d n i l e M p r\n\r"),
! current_header->have_from);
!
! Write_to_screen(FRM("\n\rOffset: %-22ld%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d\n"),
! current_header->offset,

Kari E. Hurtta

unread,
Jul 13, 2005, 5:55:32 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.18

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 18/18
=========================================================================


ptr = buffer;
+ if (register_module) {
+ int l = strlen(register_module);
+ add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);
+ add_to_buffer(buffer, sizeof buffer,&ptr,register_module,l);
+ }

add_to_buffer(buffer, sizeof buffer,&ptr,"E",1);
for (j = x; j < argc; j++) {
int l = strlen(argv[j]);
***************
*** 2607,2622 ****
return translated;
}


static int copy_list P_((struct log_entries *entry,
struct log_instance *source,
struct log_instance *target,
! struct log_entries *last));
! static int copy_list(entry,source,target,last)
struct log_entries *entry;
struct log_instance *source;
struct log_instance *target;
struct log_entries *last;
{
struct log_record * ptr;
int L = strlen(installer_root);
--- 2743,2794 ----
return translated;
}

+ static int filter_record P_((struct log_record *record,
+ char **module, int match_all));
+ static int filter_record(record,module,match_all)
+ struct log_record *record;
+ char **module;
+ int match_all;
+ {
+ int i;
+ if (module && module[0] &&
+ 0 == strcmp(module[0], "all"))
+ return 1;
+
+ if (! record->module_ptr) {
+ if (!module)
+ return 1;
+

+ return 0;
+ }
+

+ if (match_all &&
+ 0 == strcmp(record->module_ptr,"all"))
+ return 1;
+
+ if (!module)
+ return 0;
+
+ for (i = 0; module[i]; i++) {
+ if (0 == strcmp(record->module_ptr,
+ module[i]))
+ return 1;
+ }


+
+ return 0;
+ }

static int copy_list P_((struct log_entries *entry,
struct log_instance *source,
struct log_instance *target,
! struct log_entries *last,
! char **module));
! static int copy_list(entry,source,target,last, module)
struct log_entries *entry;
struct log_instance *source;
struct log_instance *target;
struct log_entries *last;
+ char **module;
{
struct log_record * ptr;
int L = strlen(installer_root);
***************
*** 2631,2636 ****
--- 2803,2811 ----
int mode;
int is_dir;

+ if (! filter_record(ptr,module,1))
+ continue;
+
switch (ptr->command_letter) {
char *trg;

***************
*** 2818,2823 ****
--- 2993,3073 ----
return 0;
}

+
+ static struct log_record * on_other_module P_((struct log_instance *LI,
+ char *entry,
+ char **module));
+ static struct log_record * on_other_module(LI,entry,module)
+ struct log_instance *LI;
+ char *entry;
+ char **module;


+ {
+ int i;
+

+ for (i = 0; i < LI->entries_count; i++) {
+
+ struct log_record * ptr;
+
+ for (ptr = LI->entries[i].log;
+ ptr < LI->entries[i].log +
+ LI->entries[i].log_count; ptr++) {
+
+
+ /* Check if entry is mentioned on filtered module */
+
+ if (!filter_record(ptr,module,1)) {
+
+ switch (ptr->command_letter) {
+
+ case '\0': /* ENTRY DELETED */
+ break;
+
+ case '{':
+ case 's':
+ case 'F':
+ case 'd':
+ case 'C':
+ case 'M':
+
+ if (ptr->arg_ptrs && ptr->arg_ptrs[0] &&
+ 0 == strcmp(ptr->arg_ptrs[0],entry))
+ return ptr;
+
+ break;
+
+ case 'L':
+
+ /* second argument is new name */
+
+ if (ptr->arg_ptrs && ptr->arg_ptrs[1] &&
+ 0 == strcmp(ptr->arg_ptrs[1],entry))
+ return ptr;
+
+ break;
+
+ case 'E':
+ /* execute ... */
+ break;
+
+ case 'R':
+ /* remove ... */
+ break;
+
+
+ default:
+ fprintf(stderr,
+ "%s: [on_other_module] Bad command letter: %c \n",
+ program_name,ptr->command_letter);


+
+ }
+ }
+ }
+ }

+

+ return NULL;
+ }
+
+

static int on_current P_((struct log_instance *LI,char *entry));
static int on_current(LI,entry)
struct log_instance *LI;
***************
*** 2893,2906 ****
}

static void trim_list P_((struct log_entries *entry,
! struct log_instance *source));
! static void trim_list(entry,source)
struct log_entries *entry;
struct log_instance *source;
{
struct log_record * ptr;

for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {

switch (ptr->command_letter) {

--- 3143,3162 ----
}

static void trim_list P_((struct log_entries *entry,
! struct log_instance *source,
! char **module));
! static void trim_list(entry,source,module)
struct log_entries *entry;
struct log_instance *source;
+ char **module;
{
struct log_record * ptr;

for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {
+
+ if (! filter_record(ptr,module,0))
+ continue;
+

switch (ptr->command_letter) {

***************
*** 2975,2984 ****


static int unstage_list P_((struct log_entries *entry,
! struct log_instance *source));
! static int unstage_list(entry,source)
struct log_entries *entry;
struct log_instance *source;
{
int exit_stat = 0;
struct log_record * ptr;
--- 3231,3242 ----


static int unstage_list P_((struct log_entries *entry,
! struct log_instance *source,
! char **module));
! static int unstage_list(entry,source,module)
struct log_entries *entry;
struct log_instance *source;
+ char **module;
{
int exit_stat = 0;
struct log_record * ptr;
***************
*** 2986,2991 ****
--- 3244,3254 ----

for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {
int ok = 0;
+
+ if (! filter_record(ptr,module,0))
+ continue;
+
+
switch (ptr->command_letter) {

case '\0': /* ENTRY DELETED */
***************
*** 3001,3007 ****
--- 3264,3275 ----
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

+
if (0 == strncmp(stage_dir,ab,X)) {
+
+ struct log_record *other =
+ on_other_module(source,ptr->arg_ptrs[0],module);
+
struct stat X;

if (stat(ab,&X) < 0)
***************
*** 3022,3028 ****
}
} else {

! if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Stage file %s uninstalled\n",
program_name,ab);
--- 3290,3305 ----
}
} else {

! if (other) {
!
! fprintf(stdout,
! "%s: Keeping stage file %s, used by %s package/module\n",
! program_name,ab,
! other->module_ptr ? other->module_ptr : "main");
!
! ok = 1; /* Remove double reference */
!
! } else if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Stage file %s uninstalled\n",
program_name,ab);
***************
*** 3069,3079 ****

}

static int uninstall_list P_((struct log_entries *entry,
! struct log_instance *source));
! static int uninstall_list(entry,source)
struct log_entries *entry;
struct log_instance *source;
{
int exit_stat = 0;
struct log_record * ptr;
--- 3346,3362 ----

}

+ static dev_t this_program_dev = 0;
+ static ino_t this_program_ino = 0;
+ static int this_program = 0;
+
static int uninstall_list P_((struct log_entries *entry,
! struct log_instance *source,
! char **module));
! static int uninstall_list(entry,source,module)
struct log_entries *entry;
struct log_instance *source;
+ char **module;
{
int exit_stat = 0;
struct log_record * ptr;
***************
*** 3082,3087 ****
--- 3365,3373 ----
for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {
int ok = 0;

+ if (! filter_record(ptr,module,0))
+ continue;
+
switch (ptr->command_letter) {

case '\0': /* ENTRY DELETED */
***************
*** 3094,3101 ****
if (ptr->arg_ptrs && ptr->arg_ptrs[1]) {

char *ab = make_absolute(ptr,ptr->arg_ptrs[1]);

! if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Link %s uninstalled\n",
program_name,ab);
--- 3380,3435 ----
if (ptr->arg_ptrs && ptr->arg_ptrs[1]) {

char *ab = make_absolute(ptr,ptr->arg_ptrs[1]);
+ struct log_record *other =
+ on_other_module(source,ptr->arg_ptrs[1],module);
+
+ struct stat X;
+
+ if (stat(ab,&X) < 0) {
+
+ if (ENOENT == errno)
+ ok = 1;
+ else {
+ fprintf(stderr,
+ "%s: Can't stat %s\n",
+ program_name,ab);
+ exit_stat = 1;
+ }
+
+ } else if (
+
+ #ifdef S_ISLNK
+ ! S_ISREG(X.st_mode)
+ #else
+ S_IFREG != (X.st_mode & S_IFMT)
+ #endif
+ ) {

! fprintf(stderr,
! "%s: Name %s is not regular file (link)\n",
! program_name,ab);
!
! } else if (other) {
!
! fprintf(stdout,
! "%s: Keeping link %s, used by %s package/module\n",
! program_name,ab,
! other->module_ptr ? other->module_ptr : "main");
!
! ok = 1; /* Remove double reference */
!
! } else if ((!module || !module[0] || 0 != strcmp(module[0],"all")) &&
! (X.st_dev == this_program_dev &&
! X.st_ino == this_program_ino ||
! 0 == strcmp(program_name,ab))) {
!
! fprintf(stdout,
! "%s: Keeping link %s, is this program\n",
! program_name,ab);
!
! this_program++;
!
! } else if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Link %s uninstalled\n",
program_name,ab);
***************
*** 3143,3149 ****
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

! if (0 == unlink(ab)) {
fprintf(stdout,
"%s: File %s uninstalled\n",
program_name,ab);
--- 3477,3532 ----
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

! struct log_record *other =
! on_other_module(source,ptr->arg_ptrs[0],module);
!
! struct stat X;
!
! if (stat(ab,&X) < 0) {
!
! if (ENOENT == errno)
! ok = 1;
! else {
! fprintf(stderr,
! "%s: Can't stat %s\n",
! program_name,ab);
! exit_stat = 1;
! }
!
! } else if (
!
! #ifdef S_ISREG
! ! S_ISREG(X.st_mode)
! #else
! S_IFREG != (X.st_mode & S_IFMT)


! #endif
! ) {
!

! fprintf(stderr,
! "%s: Name %s is not regular file\n",
! program_name,ab);
!
! } else if (other) {
!
! fprintf(stdout,
! "%s: Keeping file %s, used by %s package/module\n",
! program_name,ab,
! other->module_ptr ? other->module_ptr : "main");
!
! ok = 1; /* Remove double reference */
!
! } else if ((!module || !module[0] || 0 != strcmp(module[0],"all")) &&
! (X.st_dev == this_program_dev &&
! X.st_ino == this_program_ino ||
! 0 == strcmp(program_name,ab))) {
!
! fprintf(stdout,
! "%s: Keeping file %s, is this program\n",
! program_name,ab);
!
! this_program++;
!
! } else if (0 == unlink(ab)) {
fprintf(stdout,
"%s: File %s uninstalled\n",
program_name,ab);
***************
*** 3166,3172 ****
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

! if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Config file %s uninstalled\n",
program_name,ab);
--- 3549,3593 ----
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

! struct log_record *other =
! on_other_module(source,ptr->arg_ptrs[0],module);
!
! struct stat X;
!
! if (stat(ab,&X) < 0) {
!
! if (ENOENT == errno)
! ok = 1;
! else {
! fprintf(stderr,
! "%s: Can't stat %s\n",
! program_name,ab);
! exit_stat = 1;
! }
!
! } else if (
!
! #ifdef S_ISREG
! ! S_ISREG(X.st_mode)
! #else
! S_IFREG != (X.st_mode & S_IFMT)


! #endif
! ) {
!

! fprintf(stderr,
! "%s: Name %s is not regular file\n",
! program_name,ab);
!
! } else if (other) {
!
! fprintf(stdout,
! "%s: Keeping config file %s, used by %s package/module\n",
! program_name,ab,
! other->module_ptr ? other->module_ptr : "main");
!
! ok = 1; /* Remove double reference */
!
! } else if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Config file %s uninstalled\n",
program_name,ab);
***************
*** 3215,3226 ****
static int replay_list P_((struct log_entries *entry,
struct log_instance *source,
struct log_instance *target,


! struct log_entries * last));

! static int replay_list(entry,source,target,last)
struct log_entries *entry;
struct log_instance *source;
struct log_instance *target;
struct log_entries * last;
{
struct log_record * ptr;
struct log_record * LAST_ARG = NULL;
--- 3636,3649 ----
static int replay_list P_((struct log_entries *entry,
struct log_instance *source,
struct log_instance *target,
! struct log_entries * last,
! char **module));
! static int replay_list(entry,source,target,last, module)
struct log_entries *entry;
struct log_instance *source;
struct log_instance *target;
struct log_entries * last;
+ char **module;
{
struct log_record * ptr;
struct log_record * LAST_ARG = NULL;
***************
*** 3237,3242 ****
--- 3660,3670 ----
*/
ptr = & entry->log[n];

+ if (! filter_record(ptr,module,1)) {
+ LAST_ARG = NULL;
+ continue;
+ }
+
switch (ptr->command_letter) {

case '\0': /* ENTRY DELETED */
***************
*** 3293,3301 ****

for (k = LAST_ARG; k < ptr; k++) {
if ('{' == k->command_letter &&
! k->buffer &&
0 == strcmp(ptr->arg_ptrs[i],
! k->buffer))
break;
}

--- 3721,3729 ----

for (k = LAST_ARG; k < ptr; k++) {
if ('{' == k->command_letter &&
! k->command_ptr &&
0 == strcmp(ptr->arg_ptrs[i],
! k->command_ptr))
break;
}

***************
*** 3324,3330 ****

} else if (is_dir) {

! copy_dir(src,trg,k->arg_ptrs[0],target,last);

} else {

--- 3752,3759 ----

} else if (is_dir) {

! copy_dir(src,trg,k->arg_ptrs[0],target,last,
! k->module_ptr);

} else {

***************
*** 3398,3404 ****
fprintf(stdout,"\n");
fflush(stdout);

! pipefd = create_pipe(i,translated,0,&pid,"/");

fd = fdopen(pipefd,"r");
if (!fd) {
--- 3827,3834 ----
fprintf(stdout,"\n");
fflush(stdout);

! pipefd = create_pipe(i,translated,0,&pid,"/",
! ptr->module_ptr);

fd = fdopen(pipefd,"r");
if (!fd) {
***************
*** 3457,3462 ****
--- 3887,3895 ----
ptr < entry->log + entry->log_count;
ptr++) {

+ if (! filter_record(ptr,module,1))
+ continue;
+
switch (ptr->command_letter) {
char *X;
struct passwd * p;
***************
*** 3633,3638 ****
--- 4066,4074 ----
struct log_instance LI_target;
struct log_entries * last = NULL;

+ char **module_filter = NULL;
+ int module_count = 0;
+
int remove_count;

#if ANSI_C
***************
*** 3646,3668 ****
clear_log_instance(&LI_source);
clear_log_instance(&LI_target);



! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {

! filelist = argv[x+1];
! x += 2;

! }

! if (x < argc -1 && 0 == strcmp("-R", argv[x])) {



! installer_root = argv[x+1];
! x += 2;
! } else
! installer_root = "/";

! if (stat(installer_root,&X) < 0) {
! fprintf(stderr,"%s: -R %s invalid\n",
! argv[0],installer_root);


!
return 1; /* FAILURE */
}

--- 4082,4130 ----
clear_log_instance(&LI_source);
clear_log_instance(&LI_target);



! installer_root = "/";

! while (x < argc && '-' == argv[x][0]) {

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
!
! filelist = argv[x+1];
! x += 2;
! } else if (x < argc -1 && 0 == strcmp("-R", argv[x])) {

! installer_root = argv[x+1];
! x += 2;
! } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {

! module_filter = realloc(module_filter,
! (module_count+2) *
! sizeof (module_filter[0]));
!
! if (! module_filter) {
! fprintf(stderr,
! "%s: Failed to realloc -M option\n",
! program_name);


! exit(1);
! }
!
!

! module_filter[module_count++] = argv[x+1];
! module_filter[module_count] = NULL;


! x += 2;
!
! } else {
! fprintf(stderr,
! "%s: Bad option %s\n",

! program_name,argv[x]);


! exit(1);
! }
! }
!

!
! if (stat(installer_root,&X) < 0) {
! fprintf(stderr,"%s: -R %s invalid\n",
! argv[0],installer_root);


!
return 1; /* FAILURE */
}

***************
*** 3678,3683 ****
--- 4140,4154 ----



return 1; /* FAILURE */
}

+
+ if (x < argc) {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);


+ exit(1);
+ }
+
+

LI_source.filename = filelist;
if (0 != strcmp(installer_root,"/")) {
***************
*** 3770,3776 ****
if (0 == strcmp(LI_source.entries[i].version, my_version)) {

r = copy_list(& LI_source.entries[i], &LI_source, &LI_target,
! last);
if (0 != r)
goto fail;
} else {
--- 4241,4247 ----
if (0 == strcmp(LI_source.entries[i].version, my_version)) {

r = copy_list(& LI_source.entries[i], &LI_source, &LI_target,
! last, module_filter);
if (0 != r)
goto fail;
} else {
***************
*** 3798,3804 ****

/* EXECUTE commands and fix permissions */
r = replay_list(&LI_source.entries[LI_source.entries_count-1],
! &LI_source,target,last);

/* Trim files marked for other versions ...
LAST entry is current so not need handle it ...
--- 4269,4276 ----

/* EXECUTE commands and fix permissions */
r = replay_list(&LI_source.entries[LI_source.entries_count-1],
! &LI_source,target,last,
! module_filter);

/* Trim files marked for other versions ...
LAST entry is current so not need handle it ...
***************
*** 3807,3813 ****
for (i = 0; i < target->entries_count-1; i++) {
if (0 != strcmp(target->entries[i].version, my_version)) {

! trim_list(& target->entries[i], target);
}
}

--- 4279,4285 ----
for (i = 0; i < target->entries_count-1; i++) {
if (0 != strcmp(target->entries[i].version, my_version)) {

! trim_list(& target->entries[i], target, module_filter);
}
}

***************
*** 3838,3843 ****
--- 4310,4320 ----
int remove_count;
int i;

+ char **module_filter = NULL;
+ int module_count = 0;
+
+ struct stat X;
+
#if ANSI_C
char my_version[] = "[ELM" VERSION " " PATCHLEVEL "]";
#else
***************
*** 3848,3859 ****

clear_log_instance(&LI);

- if (x < argc -1 && 0 == strcmp("-F", argv[x])) {



! filelist = argv[x+1];
! x += 2;
}

LI.filename = filelist;
LI.file = fopen(LI.filename,"r+");
if (!LI.file) {
--- 4325,4387 ----

clear_log_instance(&LI);


! while (x < argc && '-' == argv[x][0]) {
!

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
!
! filelist = argv[x+1];
! x += 2;
!

! } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
!

! module_filter = realloc(module_filter,
! (module_count+2) *
! sizeof (module_filter[0]));
!
! if (! module_filter) {
! fprintf(stderr,
! "%s: Failed to realloc -M option\n",
! program_name);
! exit(1);
! }
!
! module_filter[module_count++] = argv[x+1];
! module_filter[module_count] = NULL;


! x += 2;
!
! } else {
! fprintf(stderr,
! "%s: Bad option %s\n",

! program_name,argv[x]);


! exit(1);
! }
! }
!

! if (x < argc) {


! fprintf(stderr,
! "%s: Bad option %s\n",
! program_name,argv[x]);
! exit(1);
}

+ if (module_count != 1 ||
+ 0 != strcmp(module_filter[0],"all")) {
+
+ if (stat(program_name,&X) < 0) {
+ fprintf(stderr,
+ "%s: Failed to stat this program name -- needed to avoid unistalling this program\n",
+ program_name);
+
+ r = 1;
+ } else {
+ this_program_dev = X.st_dev;
+ this_program_ino = X.st_ino;


+ }
+ }
+
+
+

LI.filename = filelist;
LI.file = fopen(LI.filename,"r+");
if (!LI.file) {
***************
*** 3880,3888 ****
remove_unlinked(&LI,"/",&remove_count);

for (i = 0; i < LI.entries_count; i++) {
! if (0 != unstage_list(& LI.entries[i], &LI))
r = 1;
! if (0 != uninstall_list(& LI.entries[i], &LI))
r = 1;
}

--- 4408,4416 ----
remove_unlinked(&LI,"/",&remove_count);

for (i = 0; i < LI.entries_count; i++) {
! if (0 != unstage_list(& LI.entries[i], &LI,module_filter))
r = 1;
! if (0 != uninstall_list(& LI.entries[i], &LI,module_filter))
r = 1;
}

***************
*** 3895,3900 ****
--- 4423,4435 ----
return 1; /* FAILURE */
}

+ if (this_program) {
+ fprintf(stdout,
+ "%s: To unistall this program use %s -M all\n",
+ program_name,program_name);
+ }
+
+
fail:
return r;
}
***************
*** 3911,3916 ****
--- 4446,4454 ----
int remove_count;
int i;

+ char **module_filter = NULL;
+ int module_count = 0;
+
#if ANSI_C
char my_version[] = "[ELM" VERSION " " PATCHLEVEL "]";
#else
***************
*** 3921,3932 ****



clear_log_instance(&LI);

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {

! filelist = argv[x+1];
! x += 2;
}

LI.filename = filelist;
LI.file = fopen(LI.filename,"r+");
if (!LI.file) {
--- 4459,4503 ----

clear_log_instance(&LI);



! while (x < argc && '-' == argv[x][0]) {

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
!
! filelist = argv[x+1];
! x += 2;

! } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
!

! module_filter = realloc(module_filter,
! (module_count+2) *
! sizeof (module_filter[0]));
!
! if (! module_filter) {
! fprintf(stderr,
! "%s: Failed to realloc -M option\n",
! program_name);
! exit(1);
! }
!
! module_filter[module_count++] = argv[x+1];
! module_filter[module_count] = NULL;


! x += 2;
!
! } else {
! fprintf(stderr,
! "%s: Bad option %s\n",
! program_name,argv[x]);
! exit(1);
! }
}

+ if (x < argc) {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);


+ exit(1);
+ }
+
+

LI.filename = filelist;
LI.file = fopen(LI.filename,"r+");
if (!LI.file) {
***************
*** 3953,3959 ****
remove_unlinked(&LI,"/",&remove_count);

for (i = 0; i < LI.entries_count; i++) {
! if (0 != unstage_list(& LI.entries[i], &LI))
r = 1;
}

--- 4524,4530 ----
remove_unlinked(&LI,"/",&remove_count);

for (i = 0; i < LI.entries_count; i++) {
! if (0 != unstage_list(& LI.entries[i], &LI, module_filter))
r = 1;
}

***************
*** 3970,3977 ****
--- 4541,5088 ----
return r;
}

+ static int rpm_list P_((int argc, char *argv[], int x));
+ static int rpm_list(argc, argv, x)
+ int argc;
+ char *argv[];
+ int x;
+ {
+ int r = 0;
+ struct stat X;
+
+ struct log_instance LI;
+ int i;
+ char *user1 = "-";
+ char *group1 = "-";
+
+ char **module_filter = NULL;
+ int module_count = 0;
+
+ #if ANSI_C
+ char my_version[] = "[ELM" VERSION " " PATCHLEVEL "]";
+ #else
+ char my_version[40];
+
+ sprintf(my_version,"[ELM %s %s]",VERSION,PATCHLEVEL);
+ #endif
+
+ clear_log_instance(&LI);
+
+ installer_root = "/";
+
+ while (x < argc && '-' == argv[x][0]) {
+
+ if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
+
+ filelist = argv[x+1];
+ x += 2;
+ } else if (x < argc -1 && 0 == strcmp("-u", argv[x])) {
+ user1 = argv[x+1];
+ x += 2;
+ } else if (x < argc -1 && 0 == strcmp("-g", argv[x])) {
+ group1 = argv[x+1];
+ x += 2;
+ } else if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
+
+ installer_root = argv[x+1];
+ x += 2;

+
+ } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {

+
+ module_filter = realloc(module_filter,
+ (module_count+2) *
+ sizeof (module_filter[0]));
+
+ if (! module_filter) {
+ fprintf(stderr,
+ "%s: Failed to realloc -M option\n",
+ program_name);
+ exit(1);
+ }
+
+ module_filter[module_count++] = argv[x+1];
+ module_filter[module_count] = NULL;
+ x += 2;
+
+ } else {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);
+ exit(1);
+ }
+ }
+
+ if (x < argc) {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);
+ exit(1);
+ }
+
+
+ if (stat(installer_root,&X) < 0) {
+ fprintf(stderr,"%s: -R %s invalid\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */


+ }
+
+ if (

+ #ifdef S_ISDIR
+ ! S_ISDIR(X.st_mode)
+ #else
+ S_IFDIR != (buf.st_mode & S_IFMT)
+ #endif
+ ) {
+ fprintf(stderr,"%s: -R %s invalid (not a directory)\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */
+ }
+
+
+ LI.filename = filelist;
+ if (0 != strcmp(installer_root,"/")) {
+ int l = strlen(filelist) + strlen(installer_root) +2;
+ LI.filename = malloc(l);
+ if (!LI.filename) {
+ fprintf(stderr,"%s: malloc %d bytes failed\n",
+ program_name,l);
+ return 1; /* FAILURE */
+ }
+ sprintf(LI.filename,"%s%s",installer_root,filelist);
+ }
+
+ LI.file = fopen(LI.filename,"r");
+ if (!LI.file) {
+ fprintf(stderr,
+ "%s: Failed to open file %s\n",
+ program_name,LI.filename);
+ return 1; /* FAILURE */
+ }
+
+ add_entries(&LI);
+
+ if (LI.entries_count < 1 ||
+ 0 != strcmp(LI.entries[LI.entries_count-1].version,
+ my_version)) {
+
+ fprintf(stderr,
+ "%s: Last version on file %s is not %s\n",
+ program_name,
+ LI.filename,
+ my_version);
+ r = 1;
+ }
+
+ for (i = 0; i < LI.entries_count; i++) {
+ struct log_entries *I = &(LI.entries[i]);
+ int r;
+
+ /* Skip error message if list is actually empty */
+ if (I->log_count < 1)
+ continue;
+
+ if (0 != strcmp(I->version,my_version)) {
+ fprintf(stderr,
+ "%s: File %s includes version %s entries (current %s)\n",
+ program_name,
+ LI.filename,
+ I->version,
+ my_version);
+
+ }
+
+ for (r = 0; r < I->log_count; r++) {
+ struct log_record * R = & (I->log[r]);
+
+ char * user = R->user_ptr;
+ char * group = R->group_ptr;
+ char * mode = R->mode_ptr;
+ char * file = NULL;;
+
+ if (! filter_record(R,module_filter,1))
+ continue;
+
+ if (R->arg_ptrs && R->arg_ptrs[0])
+ file = R->arg_ptrs[0];
+
+ if (!user || 0 == strcmp(user,"-"))
+ user = user1;
+ if (!group || 0 == strcmp(group,"-"))
+ group = group1;
+ if (!mode || 0 == atoi(mode))
+ mode = "-";
+
+ if (!file)
+ continue;
+
+ switch (R->command_letter) {
+ case 'M':
+
+ fputs("%dir ",stdout);
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+ break;
+
+ case 'd':
+
+ fputs("%doc ",stdout);
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+ break;
+
+ case 'F':
+ case 's':
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+ break;
+
+ case 'C':
+
+ fputs("%config ",stdout);
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+ break;
+
+ case 'E':
+ break;
+
+ case 'R':
+ case 'L':
+ break;
+
+ case '{': {
+ char *F = make_rooted(R,file,installer_root);
+ struct stat X;
+
+ if (stat(F,&X) < 0) {
+ if (ENOENT != errno)
+ fprintf(stderr,
+ "%s: '%c' File %s (%s) not accessible\n",
+ program_name,R->command_letter,
+ file,F);
+
+ } else if (
+ #ifdef S_ISDIR
+ S_ISDIR(X.st_mode)
+ #else
+ S_IFDIR == (X.st_mode & S_IFMT)
+ #endif
+ ) {
+
+ fprintf(stderr,
+ "%s: '%c' File %s (%s) is directory\n",
+ program_name,R->command_letter,
+ file,F);
+
+ #ifdef DIROPS
+ /* Files are already logged ... */
+ fputs("%dir ",stdout);
+ #endif
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+
+
+ } else {
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+
+ }
+
+ free(F);
+ }
+ break;
+
+ default:
+ fprintf(stderr,
+ "%s: '%c' Bad command letter\n",
+ program_name,R->command_letter);


+
+ }
+ }
+ }
+

+
+ if (EOF == fclose(LI.file)) {
+ fprintf(stderr,
+ "%s: Failed on closing of file: %s\n",
+ program_name,LI.filename);
+ return 1; /* FAILURE */
+ }
+
+ fail:


+ return r;
+ }
+

+ static int filter P_((int argc, char *argv[], int x));
+ static int filter(argc, argv, x)
+ int argc;
+ char *argv[];
+ int x;
+ {
+ int r = 0;
+ struct stat X;
+
+ struct log_instance * target = NULL;
+ struct log_entries * last = NULL;
+
+ struct log_instance LI;
+ struct log_instance LI_target;


+
+ int i;
+

+ char **module_filter = NULL;
+ int module_count = 0;
+
+ #if ANSI_C
+ char my_version[] = "[ELM" VERSION " " PATCHLEVEL "]";
+ #else
+ char my_version[40];
+
+ sprintf(my_version,"[ELM %s %s]",VERSION,PATCHLEVEL);
+ #endif
+
+ clear_log_instance(&LI);
+ clear_log_instance(&LI_target);
+
+ installer_root = "/";
+
+ while (x < argc && '-' == argv[x][0]) {
+
+ if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
+
+ filelist = argv[x+1];
+ x += 2;
+
+ } else if (x < argc -1 && 0 == strcmp("-w", argv[x])) {
+
+ char * file = argv[x+1];
+ int t;
+ x += 2;
+
+ if (LI_target.filename) {
+ fprintf(stderr,
+ "%s: Duplicate -w option\n",
+ program_name);


+ exit(1);
+
+ }
+

+ LI_target.filename = file;
+
+ t = open(LI_target.filename,O_RDWR|O_CREAT,0644);
+ if (t < 0) {
+ fprintf(stderr,
+ "%s: Failed to open file %s on targe: %s\n",
+ program_name,filelist,LI_target.filename);
+
+ fclose(LI.file);
+
+ return 1; /* FAILURE */
+ }
+
+
+ LI_target.file = fdopen(t,"r+");
+ if (!LI_target.file) {
+ fprintf(stderr,
+ "%s: Failed to fdopen file %s on target (/): %s\n",
+ program_name,filelist,LI_target.filename);
+
+ fclose(LI.file);
+ close(t);
+ return 1; /* FAILURE */
+ }
+
+ add_entries(&LI_target);
+
+ target = &LI_target;
+
+ last = add_last(target);
+
+
+ } else if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
+
+ installer_root = argv[x+1];
+ x += 2;

+
+ } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {

+
+ module_filter = realloc(module_filter,
+ (module_count+2) *
+ sizeof (module_filter[0]));
+
+ if (! module_filter) {
+ fprintf(stderr,
+ "%s: Failed to realloc -M option\n",
+ program_name);
+ exit(1);
+ }
+
+ module_filter[module_count++] = argv[x+1];
+ module_filter[module_count] = NULL;
+ x += 2;
+
+ } else {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);
+ exit(1);
+ }
+ }
+
+ if (x < argc) {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);
+ exit(1);
+ }
+
+
+ if (stat(installer_root,&X) < 0) {
+ fprintf(stderr,"%s: -R %s invalid\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */


+ }
+
+ if (

+ #ifdef S_ISDIR
+ ! S_ISDIR(X.st_mode)
+ #else
+ S_IFDIR != (buf.st_mode & S_IFMT)
+ #endif
+ ) {
+ fprintf(stderr,"%s: -R %s invalid (not a directory)\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */
+ }
+

+ LI.filename = filelist;
+ if (0 != strcmp(installer_root,"/")) {
+ int l = strlen(filelist) + strlen(installer_root) +2;
+ LI.filename = malloc(l);
+ if (!LI.filename) {
+ fprintf(stderr,"%s: malloc %d bytes failed\n",
+ program_name,l);
+ return 1; /* FAILURE */
+ }
+ sprintf(LI.filename,"%s%s",installer_root,filelist);
+ }

+ LI.file = fopen(LI.filename,"r");
+ if (!LI.file) {
+ fprintf(stderr,
+ "%s: Failed to open file %s\n",
+ program_name,LI.filename);
+ return 1; /* FAILURE */
+ }
+
+ add_entries(&LI);
+
+ if (LI.entries_count < 1 ||
+ 0 != strcmp(LI.entries[LI.entries_count-1].version,
+ my_version)) {
+
+ fprintf(stderr,
+ "%s: Last version on file %s is not %s\n",
+ program_name,
+ LI.filename,
+ my_version);
+ r = 1;
+ }
+
+
+ if (target) {
+
+ for (i = 0; i < LI.entries_count; i++) {
+ struct log_entries *I = &(LI.entries[i]);
+ int r;
+
+ /* Skip error message if list is actually empty */
+ if (I->log_count < 1)
+ continue;
+
+ if (0 != strcmp(I->version,my_version)) {
+ fprintf(stderr,
+ "%s: File %s includes version %s entries (current %s)\n",
+ program_name,
+ LI.filename,
+ I->version,
+ my_version);
+
+ }
+
+ for (r = 0; r < I->log_count; r++) {
+ struct log_record * R = & (I->log[r]);
+
+ if (! filter_record(R,module_filter,1))
+ continue;
+
+ /* NOTE: NULLs buffer and arg_ptrs from R */
+ move_record(target,last,R);


+
+ }
+
+ }
+

+ if (EOF == fclose(target->file)) {
+ fprintf(stderr,
+ "%s: Write(?) failed on closing of file: %s\n",
+ program_name,target->filename);
+ return 1; /* FAILURE */
+ }
+ }
+
+ return r;
+ }
+
+

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 3986,3996 ****
register_command,
register_replay,
register_uninstall,
! register_unstage
} mode = register_command;

register_pipe = getenv("ELM_INSTALLER");
installer_root = getenv("ELM_ROOT");

program_name = argv[0];

--- 5097,5110 ----
register_command,
register_replay,
register_uninstall,
! register_unstage,
! register_rpm_list,
! register_filter
} mode = register_command;

register_pipe = getenv("ELM_INSTALLER");
installer_root = getenv("ELM_ROOT");
+ register_module = getenv("ELM_MODULE");

program_name = argv[0];

***************
*** 4036,4060 ****

x += 1;
mode = register_unstage;
! }

if (mode != register_command) {

if (register_pipe) {
fprintf(stderr,
! "%s: $ELM_INSTALLER=%s incompatible with arguments 'master' and 'replay'\n",
argv[0],register_pipe);



return 1; /* FAILURE */
}

if (installer_root) {
! fprintf(stderr,"%s: $ELM_ROOT=%s incompatible with arguments 'master' and 'replay'\n",
argv[0],installer_root);



return 1; /* FAILURE */
}

}


--- 5150,5190 ----

x += 1;
mode = register_unstage;
! } else if (x < argc && 0 == strcmp("rpm-list", argv[x])) {
!
! x += 1;
! mode = register_rpm_list;
! } else if (x < argc && 0 == strcmp("filter", argv[x])) {
!
! x += 1;
! mode = register_filter;
! }

if (mode != register_command) {

if (register_pipe) {
fprintf(stderr,
! "%s: $ELM_INSTALLER=%s incompatible with arguments 'master' and 'replay', 'unstage'\n",
argv[0],register_pipe);



return 1; /* FAILURE */
}

if (installer_root) {
! fprintf(stderr,"%s: $ELM_ROOT=%s incompatible with arguments 'master' and 'replay, 'unstage'\n",
argv[0],installer_root);



return 1; /* FAILURE */
}

+ if (installer_root) {
+ fprintf(stderr,"%s: $ELM_MODULE=%s incompatible with arguments 'master' and 'replay, 'unstage'\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */
+ }
+
+
}


***************
*** 4064,4070 ****
case register_command: r = command(argc,argv,x); break;
case register_replay: r = replay(argc,argv,x); break;
case register_uninstall: r = uninstall(argc,argv,x); break;
! case register_unstage: r = unstage(argc,argv,x); break;
}

return r;
--- 5194,5202 ----
case register_command: r = command(argc,argv,x); break;
case register_replay: r = replay(argc,argv,x); break;
case register_uninstall: r = uninstall(argc,argv,x); break;
! case register_unstage: r = unstage(argc,argv,x); break;
! case register_rpm_list: r = rpm_list(argc,argv,x); break;
! case register_filter: r = filter(argc,argv,x); break;
}

return r;
Index: elm2.4.ME+.122-cvs/utils/elmstringconvert.c
*** elm2.4.ME+.121/utils/elmstringconvert.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/elmstringconvert.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.9 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.11 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 48,53 ****
--- 48,54 ----
char * res;
int reslen;
int written;


+ int errors = 0;

if ('\n' == buffer[line_len-1])
count++;
***************
*** 61,67 ****
count+1,name,buffer);
}

! l = add_streambytes_to_string(in_str,line_len,s2us(buffer));

if (l < line_len) {
DPRINT(Debug,7,(&Debug,
--- 62,68 ----
count+1,name,buffer);
}

! l = add_streambytes_to_string(in_str,line_len,s2us(buffer),&errors);

if (l < line_len) {
DPRINT(Debug,7,(&Debug,
***************
*** 72,78 ****
count,name,buffer);
errcount++;
}
!
out_str = convert_string(target_charset,in_str,0);

bytestream_from_string(out_str,&res,&reslen);
--- 73,84 ----
count,name,buffer);
errcount++;
}
! if (errors) {
! DPRINT(Debug,7,(&Debug,
! "Feeding of line failed: %d errors\n",
! errors));
! errcount += errors;
! }
out_str = convert_string(target_charset,in_str,0);

bytestream_from_string(out_str,&res,&reslen);
***************
*** 149,154 ****
--- 155,161 ----
return 1;


}

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];

Index: elm2.4.ME+.122-cvs/utils/elmterminal.c
*** elm2.4.ME+.121/utils/elmterminal.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/elmterminal.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.14 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.16 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 18,24 ****
--- 18,26 ----

char * program_name = "elmterminal";


int register_fd = -1;
+ char * register_module = NULL;

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];

Index: elm2.4.ME+.122-cvs/utils/elmunidata.c
*** elm2.4.ME+.121/utils/elmunidata.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/elmunidata.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.19 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.21 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 16,25 ****
--- 16,27 ----

int register_fd = -1;
char * program_name = "elmunidata";

+ char * register_module = NULL;

extern char *optarg;
extern int optind;

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];

Index: elm2.4.ME+.122-cvs/utils/fastmail.c
*** elm2.4.ME+.121/utils/fastmail.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/fastmail.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.31 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.33 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 44,49 ****
--- 44,50 ----


**/

#include "elmutil.h"
+ #include "mailerlib.h"

#include "s_fastmail.h"

#if 0
***************

*** 52,59 ****

#define temphome "/tmp/fastmail."

! char *get_arpa_date();
! static void usage();



static unsigned char *s2us P_((char *str));

static unsigned char *s2us(str)
--- 53,60 ----

#define temphome "/tmp/fastmail."

!
! static void usage P_((void));



static unsigned char *s2us P_((char *str));

static unsigned char *s2us(str)
***************
*** 154,160 ****
free_addr_items(TMP);
}

!

int main(argc, argv)
int argc;
char *argv[];

--- 155,161 ----
free_addr_items(TMP);
}

! int main P_((int argc, char *argv[]));


int main(argc, argv)
int argc;
char *argv[];
***************

*** 200,205 ****
--- 201,208 ----

user_init();
init_defaults();
+ init_mailerlib();
+
read_rc_file(0);

mailer_info = get_mailer_info();
Index: elm2.4.ME+.122-cvs/utils/from.c
*** elm2.4.ME+.121/utils/from.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/from.c 2005-07-06 10:39:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: from.c,v 1.49 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: from.c,v 1.52 2005/07/06 07:39:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 91,100 ****
int *selected,
char *realname));

- #ifndef ANSI_C


- struct passwd *getpwuid();
- #endif

int main(argc, argv)
int argc;
char *argv[];

--- 91,98 ----
int *selected,
char *realname));




+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 105,110 ****
--- 103,110 ----


int total_msgs = 0, selected_msgs = 0;
char realname[SLEN];

+ int df = give_dt_enumerate_as_int(&def_folder_status);
+

extern int optind;
extern char *optarg;

***************

*** 334,340 ****
m = SESSIONLOCK_NONE;
if ((selct == NEW_MSG) &&
FOLDER_FILE == get_folder_mode(folder) &&
! FOLDER_STATUS_NEW != def_folder_status) {


lib_error(CATGETS(elm_msg_cat,
--- 334,340 ----
m = SESSIONLOCK_NONE;
if ((selct == NEW_MSG) &&
FOLDER_FILE == get_folder_mode(folder) &&
! FOLDER_STATUS_NEW != df) {


lib_error(CATGETS(elm_msg_cat,
***************
*** 380,399 ****
/* no messages at all? */
if (total_msgs == 0) {
if (user_mailbox)
! printf(catgets(elm_msg_cat,FromSet,FromStringNoMail,
! "%s no mail.\n"),
! whos_mail(infile, realname));
else
if (!summarize) {
if (get_folder_mode(folder) & FOLDER_MBOX)
! printf(catgets(elm_msg_cat,FromSet,
! FromNoMesgInMailbox,
! "No messages in that mailbox!\n"));

else
! printf(catgets(elm_msg_cat,FromSet,
! FromNoMesgInFolder,
! "No messages in that folder!\n"));
}
}
else
--- 380,402 ----
/* no messages at all? */
if (total_msgs == 0) {
if (user_mailbox)
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromStringNoMail,
! "%s no mail.\n"),
! whos_mail(infile, realname));
else
if (!summarize) {
if (get_folder_mode(folder) & FOLDER_MBOX)
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,
! FromNoMesgInMailbox,
! "No messages in that mailbox!\n"));

else
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,
! FromNoMesgInFolder,
! "No messages in that folder!\n"));
}
}
else
***************
*** 722,729 ****
if (user_mailbox)
printf("%s ", whos_mail(infile, realname));
else
! printf(catgets(elm_msg_cat,FromSet,FromFolderContains,
! "Folder contains "));

for (i=0; i<ALL_MSGS; i++) {
if (summary[i] > 0) {
--- 725,732 ----
if (user_mailbox)
printf("%s ", whos_mail(infile, realname));
else
! elm_fprintf(stdout,CATGETS(elm_msg_cat,FromSet,FromFolderContains,
! "Folder contains "));

for (i=0; i<ALL_MSGS; i++) {
if (summary[i] > 0) {
***************
*** 767,774 ****
if (output)
printf(".\n");
else
! printf(catgets(elm_msg_cat,FromSet,FromNoMessages,
! "no messages.\n"));
}
}

--- 770,778 ----
if (output)
printf(".\n");
else
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromNoMessages,
! "no messages.\n"));
}
}

***************
*** 817,827 ****
static void print_help()
{

! printf(catgets(elm_msg_cat,FromSet,FromHelpTitle,
! "frm -- list from and subject lines of messages in mailbox or folder\n"));

usage("frm");
! printf(catgets(elm_msg_cat,FromSet,FromHelpText,
"\noption summary:\n\
-h\tprint this help message.\n\
-n\tdisplay the message number of each message printed.\n\
--- 821,833 ----
static void print_help()
{

! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromHelpTitle,
! "frm -- list from and subject lines of messages in mailbox or folder\n"));

usage("frm");
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromHelpText,
"\noption summary:\n\
-h\tprint this help message.\n\
-n\tdisplay the message number of each message printed.\n\
Index: elm2.4.ME+.122-cvs/utils/Makefile.SH
*** elm2.4.ME+.121/utils/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/Makefile.SH 2005-05-21 20:58:33.000000000 +0300
***************
*** 13,28 ****


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac

echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.36 2004/09/11 07:31:19 hurtta Exp $
#
# Makefile for the Elm system utilities
#

# (C) Copyright 1986,1987, by Dave Taylor

# (C) Copyright 1988-1992, USENET Community Trust
! #
#
# Variables
# Variables established by Configure

--- 13,35 ----


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac

+ libx="../libs/libelmme-base.a ../libs/libelmme-mailer.a"
+ libxs="../shlib/libelmme-base.so ../shlib/libelmme-mailer.so"
+

echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.38 2005/05/21 17:58:33 hurtta Exp $


#
# Makefile for the Elm system utilities
#

+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on utils/Makefile.SH. That code was following copyright:


+ #
# (C) Copyright 1986,1987, by Dave Taylor

# (C) Copyright 1988-1992, USENET Community Trust
! ######################################################################
#
# Variables
# Variables established by Configure
***************

*** 276,385 ****


# Dependencies and rules
# Dependencies and rules for compiling and linting C programs

.PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h \
! $(INCLDIR)/headers.h ../lib/libutil.a

- answer.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_answer.h $(INCLDIR)/sysdefs.h
- elmalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_elmalias.h
- fastmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_fastmail.h
- from.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_from.h $(INCLDIR)/s_elm.h
- newalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newalias.h
- newmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newmail.h
- prlong.o: $(INCLDIR)/elmutil.h $(INCLDIR)/defs.h
- readmsg.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_readmsg.h
- elmcharset.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
- $(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h charmapcopy.h
- elmrc-write.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
- $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
- $(INCLDIR)/reghelper.h
- elmterminal.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
- $(INCLDIR)/reghelper.h
- elmunidata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
- $(INCLDIR)/unidata.h $(INCLDIR)/reghelper.h
- elmbindata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
- $(INCLDIR)/bindata.h $(INCLDIR)/reghelper.h $(INCLDIR)/cs_imp.h \
- charmapcopy.o
- elmstringconvert.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
- elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h
- reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
- $(INCLDIR)/reghelper.h
- charmapcopy.o: charmapcopy.h $(INCLDIR)/s_elm.h $(INCLDIR)/elmlib.h \
- $(INCLDIR)/defs.h $(INCLDIR)/s_me.h $(INCLDIR)/reghelper.h
- elmlibregister.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
- $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
- $(INCLDIR)/reghelper.h



checkalias: checkalias.SH ; sh $?
listalias: listalias.SH ; sh $?

messages: messages.SH ; sh $?
printmail: printmail.SH ; sh $?

! $(BIN)/answer: $(ANSWER_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ANSWER_OBJ) ../lib/libutil.a $(LIB2)

answer_lint: $(ANSWER_SRC)
$(LINT) $(LINTFLAGS) $(ANSWER_SRC) >> LINT.OUT

! $(BIN)/elmalias: $(ELMALIAS_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMALIAS_OBJ) ../lib/libutil.a $(LIB2)

elmalias_lint: $(ELMALIAS_SRC)
$(LINT) $(LINTFLAGS) $(ELMALIAS_SRC) >> LINT.OUT

! $(BIN)/fastmail: $(FASTMAIL_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(FASTMAIL_OBJ) ../lib/libutil.a $(LIB2)

fastmail_lint: $(FASTMAIL_SRC)
$(LINT) $(LINTFLAGS) $(FASTMAIL_SRC) >> LINT.OUT

! $(BIN)/frm: $(FRM_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(FRM_OBJ) ../lib/libutil.a $(LIB2)

frm_lint: $(FRM_SRC)
$(LINT) $(LINTFLAGS) $(FRM_SRC) >> LINT.OUT

! $(BIN)/newalias: $(NEWALIAS_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(NEWALIAS_OBJ) ../lib/libutil.a $(LIB2)

newalias_lint: $(NEWALIAS_SRC)
$(LINT) $(LINTFLAGS) $(NEWALIAS_SRC) >> LINT.OUT

! $(BIN)/newmail: $(NEWMAIL_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(NEWMAIL_OBJ) ../lib/libutil.a $(LIB2)

newmail_lint: $(NEWMAIL_SRC)
$(LINT) $(LINTFLAGS) $(NEWMAIL_SRC) >> LINT.OUT

! $(BIN)/readmsg: $(READMSG_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(READMSG_OBJ) ../lib/libutil.a $(LIB2)

readmsg_lint: $(READMSG_SRC)
$(LINT) $(LINTFLAGS) $(READMSG_SRC) >> LINT.OUT

! $(BIN)/prlong: $(PRLONG_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(PRLONG_OBJ) ../lib/libutil.a $(LIB2)

prlong_lint: $(PRLONG_SRC)
$(LINT) $(LINTFLAGS) $(PRLONG_SRC) >> LINT.OUT

! $(BIN)/elmcharset: $(ELMCHARSET_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMCHARSET_OBJ) ../lib/libutil.a $(LIB2)

! $(BIN)/elmrc-write: $(ELMRCWRITE_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMRCWRITE_OBJ) ../lib/libutil.a $(LIB2)


! $(BIN)/elmterminal: $(ELMTERMINAL_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMTERMINAL_OBJ) ../lib/libutil.a $(LIB2)


! $(BIN)/elmunidata: $(ELMUNIDATA_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMUNIDATA_OBJ) ../lib/libutil.a $(LIB2)

! $(BIN)/elmbindata: $(ELMBINDATA_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMBINDATA_OBJ) ../lib/libutil.a $(LIB2)

! $(BIN)/elmstringconvert: $(ELMSCONV_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMSCONV_OBJ) ../lib/libutil.a $(LIB2)

../lib/putenv.o:
cd ../lib; $(MAKE) putenv.o
--- 283,364 ----
# Dependencies and rules


# Dependencies and rules for compiling and linting C programs

.PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h \
! $(INCLDIR)/headers.h $(LIBX)




checkalias: checkalias.SH ; sh $?
listalias: listalias.SH ; sh $?

messages: messages.SH ; sh $?
printmail: printmail.SH ; sh $?

! $(BIN)/answer: $(ANSWER_OBJ) ../libs/libelmme-base.a ../libs/libelmme-mailer.a
! $(CC) $(LFLAGS) -o $@ $(ANSWER_OBJ) ../libs/libelmme-base.a ../libs/libelmme-mailer.a $(LIB2)

answer_lint: $(ANSWER_SRC)
$(LINT) $(LINTFLAGS) $(ANSWER_SRC) >> LINT.OUT

! $(BIN)/elmalias: $(ELMALIAS_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMALIAS_OBJ) ../libs/libelmme-base.a $(LIB2)

elmalias_lint: $(ELMALIAS_SRC)
$(LINT) $(LINTFLAGS) $(ELMALIAS_SRC) >> LINT.OUT

! $(BIN)/fastmail: $(FASTMAIL_OBJ) ../libs/libelmme-base.a ../libs/libelmme-mailer.a
! $(CC) $(LFLAGS) -o $@ $(FASTMAIL_OBJ) \
! ../libs/libelmme-base.a ../libs/libelmme-mailer.a $(LIB2)

fastmail_lint: $(FASTMAIL_SRC)
$(LINT) $(LINTFLAGS) $(FASTMAIL_SRC) >> LINT.OUT

! $(BIN)/frm: $(FRM_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(FRM_OBJ) ../libs/libelmme-base.a $(LIB2)

frm_lint: $(FRM_SRC)
$(LINT) $(LINTFLAGS) $(FRM_SRC) >> LINT.OUT

! $(BIN)/newalias: $(NEWALIAS_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(NEWALIAS_OBJ) ../libs/libelmme-base.a $(LIB2)

newalias_lint: $(NEWALIAS_SRC)
$(LINT) $(LINTFLAGS) $(NEWALIAS_SRC) >> LINT.OUT

! $(BIN)/newmail: $(NEWMAIL_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(NEWMAIL_OBJ) ../libs/libelmme-base.a $(LIB2)

newmail_lint: $(NEWMAIL_SRC)
$(LINT) $(LINTFLAGS) $(NEWMAIL_SRC) >> LINT.OUT

! $(BIN)/readmsg: $(READMSG_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(READMSG_OBJ) ../libs/libelmme-base.a $(LIB2)

readmsg_lint: $(READMSG_SRC)
$(LINT) $(LINTFLAGS) $(READMSG_SRC) >> LINT.OUT

! $(BIN)/prlong: $(PRLONG_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(PRLONG_OBJ) ../libs/libelmme-base.a $(LIB2)

prlong_lint: $(PRLONG_SRC)
$(LINT) $(LINTFLAGS) $(PRLONG_SRC) >> LINT.OUT

! $(BIN)/elmcharset: $(ELMCHARSET_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMCHARSET_OBJ) ../libs/libelmme-base.a $(LIB2)

! $(BIN)/elmrc-write: $(ELMRCWRITE_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMRCWRITE_OBJ) ../libs/libelmme-base.a $(LIB2)


! $(BIN)/elmterminal: $(ELMTERMINAL_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMTERMINAL_OBJ) ../libs/libelmme-base.a $(LIB2)


! $(BIN)/elmunidata: $(ELMUNIDATA_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMUNIDATA_OBJ) ../libs/libelmme-base.a $(LIB2)

! $(BIN)/elmbindata: $(ELMBINDATA_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMBINDATA_OBJ) ../libs/libelmme-base.a $(LIB2)

! $(BIN)/elmstringconvert: $(ELMSCONV_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMSCONV_OBJ) ../libs/libelmme-base.a $(LIB2)

../lib/putenv.o:
cd ../lib; $(MAKE) putenv.o
***************
*** 389,396 ****
$(BIN)/elmregister: elmregister.o reghelper.o ../lib/putenv.o $(STROBJ)
$(CC) $(LFLAGS) -o $@ elmregister.o reghelper.o \
../lib/putenv.o $(STROBJ)
! $(BIN)/elmlibregister: $(ELMLIBREG_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMLIBREG_OBJ) ../lib/libutil.a $(LIB2)

# Rules to make shell scripts in bin directory
$(BIN)/checkalias: checkalias
--- 368,375 ----
$(BIN)/elmregister: elmregister.o reghelper.o ../lib/putenv.o $(STROBJ)
$(CC) $(LFLAGS) -o $@ elmregister.o reghelper.o \
../lib/putenv.o $(STROBJ)
! $(BIN)/elmlibregister: $(ELMLIBREG_OBJ) ../libs/libelmme-base.a ../libs/libelmme-mailer.a
! $(CC) $(LFLAGS) -o $@ $(ELMLIBREG_OBJ) ../libs/libelmme-mailer.a ../libs/libelmme-base.a $(LIB2)

# Rules to make shell scripts in bin directory
$(BIN)/checkalias: checkalias
***************
*** 423,436 ****
$(TOUCH) $@



# Dependencies of C object files

! answer.o: $(INCLDIR)/ndbz.h $(INCLDIR)/elmutil.h $(INCLDIR)/s_answer.h
! elmalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_elmalias.h
! fastmail.o: $(INCLDIR)/patchlevel.h $(INCLDIR)/elmutil.h $(INCLDIR)/s_fastmail.h
! from.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_from.h
! newalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/sysdefs.h $(INCLDIR)/s_newalias.h


! newmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newmail.h
! readmsg.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_readmsg.h

! prlong.o: $(INCLDIR)/defs.h

# Dependencies and rules for installing programs from bin directory

--- 402,439 ----
$(TOUCH) $@



# Dependencies of C object files

! answer.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_answer.h \
! $(INCLDIR)/sysdefs.h $(INCLDIR)/mailerlib.h


! elmalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_elmalias.h
! fastmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_fastmail.h \

! $(INCLDIR)/mailerlib.h


! from.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_from.h $(INCLDIR)/s_elm.h
! newalias.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newalias.h
! newmail.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_newmail.h

! prlong.o: $(INCLDIR)/elmutil.h $(INCLDIR)/defs.h


! readmsg.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_readmsg.h
! elmcharset.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \

! $(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h charmapcopy.h


! elmrc-write.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \

! $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
! $(INCLDIR)/reghelper.h


! elmterminal.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \

! $(INCLDIR)/reghelper.h


! elmunidata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \

! $(INCLDIR)/unidata.h $(INCLDIR)/reghelper.h


! elmbindata.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \

! $(INCLDIR)/bindata.h $(INCLDIR)/reghelper.h $(INCLDIR)/cs_imp.h \
! charmapcopy.o


! elmstringconvert.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h

! elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h
! reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
! $(INCLDIR)/reghelper.h
! charmapcopy.o: charmapcopy.h $(INCLDIR)/s_elm.h $(INCLDIR)/elmlib.h \
! $(INCLDIR)/defs.h $(INCLDIR)/s_me.h $(INCLDIR)/reghelper.h


! elmlibregister.o: $(INCLDIR)/elmutil.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \

! $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
! $(INCLDIR)/reghelper.h $(INCLDIR)/mailerlib.h
!

# Dependencies and rules for installing programs from bin directory

***************
*** 458,477 ****

!NO!SUBS!



if $test "$d_shared" = "$define" ; then

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/answer-shared: $(ANSWER_OBJ) ../shlib/libelmme-base.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ANSWER_OBJ) ../shlib/libelmme-base.so $(LIB2)


$(BIN)/elmalias-shared: $(ELMALIAS_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMALIAS_OBJ) ../shlib/libelmme-base.so $(LIB2)


! $(BIN)/fastmail-shared: $(FASTMAIL_OBJ) ../shlib/libelmme-base.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(FASTMAIL_OBJ) ../shlib/libelmme-base.so $(LIB2)


$(BIN)/frm-shared: $(FRM_OBJ) ../shlib/libelmme-base.so
--- 461,489 ----

!NO!SUBS!


+ for i in $libx
+ do
+ y="`echo $i|$sed 's%^../%%'`"

+ cat >>Makefile <<!SUBS!


+ $i:
+ cd ..; \$(MAKE) \$(MJ) \$(MFLAGS) $y
+ !SUBS!
+ done

+
if $test "$d_shared" = "$define" ; then

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/answer-shared: $(ANSWER_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ANSWER_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so $(LIB2)


$(BIN)/elmalias-shared: $(ELMALIAS_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMALIAS_OBJ) ../shlib/libelmme-base.so $(LIB2)


! $(BIN)/fastmail-shared: $(FASTMAIL_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(FASTMAIL_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so $(LIB2)


$(BIN)/frm-shared: $(FRM_OBJ) ../shlib/libelmme-base.so
***************
*** 496,503 ****
$(BIN)/elmrc-write-shared: $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so $(LIB2)

! $(BIN)/elmlibregister-shared: $(ELMLIBREG_OBJ) ../shlib/libelmme-base.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMLIBREG_OBJ) ../shlib/libelmme-base.so $(LIB2)

$(BIN)/elmterminal-shared: $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so $(LIB2)
--- 508,515 ----
$(BIN)/elmrc-write-shared: $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so $(LIB2)

! $(BIN)/elmlibregister-shared: $(ELMLIBREG_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMLIBREG_OBJ) ../shlib/libelmme-mailer.so ../shlib/libelmme-base.so $(LIB2)

$(BIN)/elmterminal-shared: $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so $(LIB2)
***************
*** 563,568 ****
--- 575,589 ----

!NO!SUBS!


+ for i in $libxs
+ do
+ y="`echo $i|$sed 's%^../%%'`"

+ cat >>Makefile <<!SUBS!


+ $i:
+ cd ..; \$(MAKE) \$(MJ) \$(MFLAGS) $y

+ !SUBS!
+ done
+

else

cat >>Makefile <<'!NO!SUBS!'
Index: elm2.4.ME+.122-cvs/utils/newalias.c
*** elm2.4.ME+.121/utils/newalias.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/newalias.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newalias.c,v 1.16 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newalias.c,v 1.18 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 33,42 ****
#include "elmutil.h"
#include "s_newalias.h"

- void error();
-

extern int is_system; /* system file updating? */

int main(argc, argv)
int argc;
char *argv[];

--- 33,41 ----
#include "elmutil.h"
#include "s_newalias.h"



extern int is_system; /* system file updating? */

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 124,137 ****
/*NOTREACHED*/
}

- void
- error(err_message)
- char *err_message;
- {
- fflush(stdout);
- fprintf(stderr, "\n%s\n", err_message);
- return;
- }

/*
* Local Variables:
--- 123,128 ----
Index: elm2.4.ME+.122-cvs/utils/newmail.c
*** elm2.4.ME+.121/utils/newmail.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/newmail.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmail.c,v 1.36 2004/06/18 09:29:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmail.c,v 1.38 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 105,113 ****

#define metachar(c) (c == '+' || c == '=' || c == '%')

- char *getusername();
- long bytes();
-
struct folder_struct {
struct folder_info *F;
char prefix[NLEN];
--- 105,110 ----
***************
*** 163,168 ****
--- 160,166 ----


static void save_acc P_((char *name));


+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 806,812 ****
/** return the number of bytes in the specified file. This
is to check to see if new mail has arrived.... **/

- extern int errno; /* system error number! */
struct stat buffer;

if (stat(name, &buffer) != 0)
--- 804,809 ----
***************
*** 828,849 ****

}

! char *getusername()
! {
! /** Getting the username on some systems is a real pain, so...
! This routine is guaranteed to return a usable username **/
!
! char *return_value, *getlogin(), *cuserid();
!
! if ((return_value = getlogin()) == NULL)
! if ((return_value = cuserid(NULL)) == NULL) {
! lib_error(CATGETS(elm_msg_cat, NewmailSet, NewmailErrUsername,
! "Newmail: I can't get username!\n"));
! exit(1);
! }
!
! return( (char *) return_value);
! }

static void usage(name)
char *name;
--- 825,832 ----

}

! /* seems that header files do not declare it */
! extern char *cuserid P_((char *string));

static void usage(name)
char *name;
Index: elm2.4.ME+.122-cvs/utils/prlong.c
*** elm2.4.ME+.121/utils/prlong.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/prlong.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: prlong.c,v 1.12 2004/07/10 08:08:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: prlong.c,v 1.13 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 63,79 ****
char inbuf[1024]; /* space to hold an input record */
char outbuf[4096]; /* space to accumulate output record */

! int calc_col(); /* calculate output column position */

!
! void usage_error(prog)
! char *prog;
{
fprintf(stderr,
"usage: %s [-w wid] [-1 first_leader] [-l leader] [-f sep]\n", prog);
exit(1);


}

int main(argc, argv)
int argc;
char *argv[];

--- 63,81 ----
char inbuf[1024]; /* space to hold an input record */
char outbuf[4096]; /* space to accumulate output record */

! /* calculate output column position */
! static int calc_col P_((int col, char *s));

! static void usage_error P_((char *prog));
! static void usage_error(prog)
! char *prog;
{
fprintf(stderr,
"usage: %s [-w wid] [-1 first_leader] [-l leader] [-f sep]\n", prog);
exit(1);


}

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 212,220 ****
}


! int calc_col(col, s)
! register int col;
! register char *s;
{
while (*s != '\0') {
switch (*s) {
--- 214,222 ----
}


! static int calc_col(col, s)
! register int col;
! register char *s;
{
while (*s != '\0') {
switch (*s) {
Index: elm2.4.ME+.122-cvs/utils/readmsg.c
*** elm2.4.ME+.121/utils/readmsg.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/readmsg.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.19 2004/06/18 09:29:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.20 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.20 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 97,104 ****
/*
* local procedures
*/
! void weed_headers();
! char *skip_word();

static int print_patmatch_mssg P_((FILE *fp,
char *pat,
--- 97,105 ----
/*
* local procedures
*/
! static void weed_headers P_((char *buf));
! static char *skip_word P_((char *str));
!

static int print_patmatch_mssg P_((FILE *fp,
char *pat,
***************
*** 112,119 ****
extern int optind; /* .. starting arguments */


!
! void usage_error()
{
lib_error(CATGETS(elm_msg_cat, ReadmsgSet, ReadmsgUsage,
"Usage: %s [-anhp] [-f Folder] {MessageNum ... | pattern | *}\n"),
--- 113,120 ----
extern int optind; /* .. starting arguments */




! static void usage_error P_((void));
! static void usage_error()
{

lib_error(CATGETS(elm_msg_cat, ReadmsgSet, ReadmsgUsage,
"Usage: %s [-anhp] [-f Folder] {MessageNum ... | pattern | *}\n"),
***************
*** 121,127 ****
exit(1);


}

! void malloc_fail_handler(proc, size)
char *proc;
unsigned size;
{

--- 122,130 ----
exit(1);
}

! static void malloc_fail_handler P_((char *proc,
! unsigned size));


! static void malloc_fail_handler(proc, size)
char *proc;
unsigned size;
{
***************

*** 189,195 ****


return mssg_num_to_index_st(i+1,& (fstate->storage[mb]));

}

!

int main(argc, argv)
int argc;
char *argv[];

--- 192,199 ----


return mssg_num_to_index_st(i+1,& (fstate->storage[mb]));

}

!
! int main P_((int argc, char *argv[]));

int main(argc, argv)
int argc;
char *argv[];
***************

*** 735,742 ****
* line should (at least in some cases) continue to the next line, but we
* don't handle that.
*/
! void weed_headers(buf)
! char *buf;
{
static int got_from = FALSE; /* already printed From: */
static int got_date = FALSE; /* already printed Date: */
--- 739,748 ----
* line should (at least in some cases) continue to the next line, but we
* don't handle that.
*/
!
! static void weed_headers P_((char *buf));
! static void weed_headers(buf)
! char *buf;
{
static int got_from = FALSE; /* already printed From: */
static int got_date = FALSE; /* already printed Date: */
***************
*** 801,808 ****
/*
* Advance to the start of the next word.
*/
! char *skip_word(str)
! char *str;
{
while (*str != '\0' && !isspace(*str))
++str;
--- 807,814 ----
/*
* Advance to the start of the next word.
*/
! static char *skip_word(str)
! char *str;
{
while (*str != '\0' && !isspace(*str))
++str;
Index: elm2.4.ME+.122-cvs/utils/reghelper.c
*** elm2.4.ME+.121/utils/reghelper.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/utils/reghelper.c 2005-04-13 23:22:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reghelper.c,v 1.6 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: reghelper.c,v 1.7 2005/04/13 20:22:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 90,96 ****


register_fd = fd;
!
}

void log_config(file)
--- 90,96 ----


register_fd = fd;
! register_module = getenv("ELM_MODULE");
}

void log_config(file)
***************
*** 101,126 ****
file++;

if (register_fd != -1)
! log_it("C",file,"-","-",0);
}

! void log_it(letter,target_r,user,group,mode)
char * letter;
char * target_r;
char * user;
char * group;
int mode;
{
int l_letter = strlen(letter);
int l_target = strlen(target_r);
int l_user = strlen(user);
int l_group = strlen(group);



char buffer[ MAX_PIPE_LOG];
char *ptr;

char mode_s[6];

! int L = 14 + l_letter + l_target + l_user + l_group;

sprintf(mode_s,"%05o",mode);

--- 101,128 ----
file++;

if (register_fd != -1)
! log_it("C",file,"-","-",0, register_module);
}

! void log_it(letter,target_r,user,group,mode, module)
char * letter;
char * target_r;
char * user;
char * group;
int mode;
+ char * module;
{
int l_letter = strlen(letter);
int l_target = strlen(target_r);
int l_user = strlen(user);
int l_group = strlen(group);
+ int l_module = module ? strlen(module) : 0;



char buffer[ MAX_PIPE_LOG];
char *ptr;

char mode_s[6];

! int L = 17 + l_letter + l_target + l_user + l_group + l_module;

sprintf(mode_s,"%05o",mode);

***************
*** 132,137 ****
--- 134,144 ----

ptr = buffer;

+ if (module) {


+ add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);

+ add_to_buffer(buffer, sizeof buffer,&ptr,module,l_module);
+ }
+
add_to_buffer(buffer, sizeof buffer,&ptr,letter,l_letter);
add_to_buffer(buffer, sizeof buffer,&ptr,user,l_user);
add_to_buffer(buffer, sizeof buffer,&ptr,group,l_group);

Kari E. Hurtta

unread,
Jul 13, 2005, 5:52:18 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.15

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 15/18
=========================================================================
}
! PutLineX (x_coord, y_coord,FRM("%c"),def_ans);
! MoveCursor(x_coord, y_coord);

switch((ans = menu_ReadCh(page, REDRAW_MARK))) {
case '\n':
--- 867,884 ----
print_format_center(LINES-3,
CATGETS(elm_msg_cat, ElmSet, ElmPgpEncSign,
"e)ncrypt, s)ign, b)oth encrypt and sign or q)uit"));
!
! menu_PutLineX (page,
! LINES-4, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpP,
! "pgp: "));
! menu_GetXYLocation(page,
! &x_coord, &y_coord);

update = FALSE;
}
! menu_PutLineX (page,
! x_coord, y_coord,FRM("%c"),def_ans);
! menu_MoveCursor(page,x_coord, y_coord);

switch((ans = menu_ReadCh(page, REDRAW_MARK))) {
case '\n':
***************
*** 874,895 ****

switch(ans) {
case 'e':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPgpEncrypt,
! "Encrypt"));
return (pgp_call (filename, PGP_MESSAGE, headers, version, page));
case 's':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPgpSign,
! "Sign"));
return (pgp_call (filename, PGP_SIGNED_MESSAGE, headers,
version, page));
case 'b':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPgpSignEncrypt,
! "Sign and Encrypt"));
return (pgp_call (filename, PGP_MESSAGE | PGP_SIGNED_MESSAGE,
headers, version, page));
case 'q':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPgpQuit,
! "Quit"));
return FALSE;
case REDRAW_MARK:
case ctrl('L'):
--- 890,915 ----

switch(ans) {
case 'e':
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpEncrypt,
! "Encrypt"));
return (pgp_call (filename, PGP_MESSAGE, headers, version, page));
case 's':
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpSign,
! "Sign"));
return (pgp_call (filename, PGP_SIGNED_MESSAGE, headers,
version, page));
case 'b':
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpSignEncrypt,
! "Sign and Encrypt"));
return (pgp_call (filename, PGP_MESSAGE | PGP_SIGNED_MESSAGE,
headers, version, page));
case 'q':
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpQuit,
! "Quit"));
return FALSE;
case REDRAW_MARK:
case ctrl('L'):
***************
*** 899,908 ****
/* not reached */
}

! void pgp_mail_public_key (mailbox, aview, page)
struct MailboxView *mailbox;


struct AliasView *aview;
struct menu_context *page;
{

/* If redraw is needed use
menu_trigger_redraw(page)

--- 919,929 ----
/* not reached */
}

! void pgp_mail_public_key (mailbox, aview, page, prompt_area)


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
+ struct menu_context *prompt_area;

{
/* If redraw is needed use
menu_trigger_redraw(page)
***************

*** 915,923 ****
char userid[SLEN], pgpkey[SLEN], tmpfil[STRING], subj[STRING];
int status;
int need_redraw = FALSE;
! enum pgp_version v = send_pgp_version;
enum pgp_version version;


int LINES, COLUMNS;

menu_get_sizes(page, &LINES, &COLUMNS);

--- 936,949 ----
char userid[SLEN], pgpkey[SLEN], tmpfil[STRING], subj[STRING];
int status;
int need_redraw = FALSE;
! enum pgp_version v = (enum pgp_version) give_dt_enumerate_as_int(&send_pgp_version);
enum pgp_version version;
int LINES, COLUMNS;
+ char *tmp;
+

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ return;

menu_get_sizes(page, &LINES, &COLUMNS);

***************
*** 947,952 ****
--- 973,980 ----
if ( status != 0) {
if (need_redraw)
menu_trigger_redraw(page);
+
+ menu_trigger_redraw(prompt_area);
return;
}

***************
*** 960,966 ****
return;
}
elm_sfprintf(tmpfil, sizeof tmpfil,
! FRM("%selm.%d.asc"), temp_dir, getpid());

switch(version) {
static char path[1000];
--- 988,994 ----
return;
}
elm_sfprintf(tmpfil, sizeof tmpfil,
! FRM("%selm.%d.asc"), tmp, getpid());

switch(version) {
static char path[1000];
***************
*** 1060,1066 ****

/* Now send the message off! */
send_msg_l(-1,NULL, NULL, subj, 0, 0, mailbox, aview,
! page);

unlink (included_file); /* make sure to clean up. */
included_file[0] = '\0';
--- 1088,1095 ----

/* Now send the message off! */
send_msg_l(-1,NULL, NULL, subj, 0, 0, mailbox, aview,
! page,
! prompt_area /* XXX Redraw will be triggered anyway to page*/);

unlink (included_file); /* make sure to clean up. */
included_file[0] = '\0';
***************
*** 1085,1092 ****
int argc = 0;
FILE *fpout;
int res;
! enum pgp_version v = send_pgp_version;
enum pgp_version version;

if (!hdr)
return;
--- 1114,1125 ----
int argc = 0;
FILE *fpout;
int res;
! enum pgp_version v = (enum pgp_version) give_dt_enumerate_as_int(&send_pgp_version);
enum pgp_version version;


+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");

+

+ if (!tmp)
+ return;

if (!hdr)
return;
***************
*** 1095,1101 ****


return;

elm_sfprintf(tempfile,sizeof tempfile,
! FRM("%selm.%d"),temp_dir,getpid());

fpout=safeopen_rdwr(tempfile);
if (!fpout) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmOpenTmpWriting,
--- 1128,1134 ----
return;

elm_sfprintf(tempfile,sizeof tempfile,
! FRM("%selm.%d"),tmp,getpid());
fpout=safeopen_rdwr(tempfile);
if (!fpout) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmOpenTmpWriting,
Index: elm2.4.ME+.122-cvs/src/quit.c
*** elm2.4.ME+.121/src/quit.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/quit.c 2005-06-18 00:02:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: quit.c,v 1.43 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: quit.c,v 1.48 2005/06/17 21:02:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,40 ****
extern int errno; /* system error number on failure */
#endif

- long bytes();
- char *error_description();

! void quit(prompt, mailbox,aview, header_page, page)
int prompt;
struct MailboxView **mailbox;
struct AliasView **aview;


- int *header_page;
struct menu_context *page;
{

--- 27,37 ----
extern int errno; /* system error number on failure */
#endif


! void quit(prompt, mailbox,aview, page)
int prompt;
struct MailboxView **mailbox;
struct AliasView **aview;
struct menu_context *page;
{

***************
*** 44,50 ****
int LINES, COLUMNS;

status = leave_mbox(FALSE, TRUE, prompt, NULL, *mailbox,
! header_page, page);
if ( status == -1)
/* new mail - leave not done - can't change to another file yet
* check for change in mailfile_size in main() will do the work
--- 41,47 ----
int LINES, COLUMNS;

status = leave_mbox(FALSE, TRUE, prompt, NULL, *mailbox,
! page);
if ( status == -1)
/* new mail - leave not done - can't change to another file yet
* check for change in mailfile_size in main() will do the work
***************
*** 96,105 ****
leave(0);
}

! void resync(mailbox, header_page, page)


struct MailboxView **mailbox;
- int *header_page;
struct menu_context *page;
{

/** Resync on the current folder. Leave current and read it back in.

--- 93,102 ----
leave(0);
}

! void resync(mailbox, page, LOC)


struct MailboxView **mailbox;
struct menu_context *page;

+ struct screen_parts *LOC;
{
/** Resync on the current folder. Leave current and read it back in.

***************
*** 113,119 ****
int result;
int sc,i;

! result = leave_mbox(TRUE, FALSE, TRUE, NULL, *mailbox, header_page,
page);
if( result == -1)
/* new mail - leave not done - can't change to another file yet
--- 110,116 ----
int result;
int sc,i;

! result = leave_mbox(TRUE, FALSE, TRUE, NULL, *mailbox,
page);
if( result == -1)
/* new mail - leave not done - can't change to another file yet
***************
*** 159,177 ****
leave(0);
}

! newmbox_1(storage->current_folder, FALSE, mailbox,1, header_page,
page);
}
}

! menu_trigger_redraw(page);
return;
}

! void change_file(mailbox, aview, header_page, page)
! struct MailboxView **mailbox;


struct AliasView *aview;
- int *header_page;
struct menu_context *page;
{

/* Prompt user for name of folder to change to.
--- 156,182 ----
leave(0);
}

! newmbox_1(storage->current_folder, FALSE, mailbox,1,
page);
}
}

! {
! struct menu_common MENU;
! set_mcommon_from_mbxview(&MENU,*mailbox);
!
! get_page(&MENU, LOC->header_page); /* resort_mailbox no longer call get_page() */
! }
!

! menu_trigger_redraw(LOC->header_page);
! menu_trigger_redraw(LOC->title_page);

!
return;
}

! struct MailboxView * change_file(mailbox, aview, page)
! struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{
/* Prompt user for name of folder to change to.
***************
*** 186,191 ****
--- 191,197 ----
struct folder_info *new_folder = NULL;


struct folder_browser * XXX = new_browser(selection_folder);

struct string * buffer = NULL;
+ struct MailboxView * new_mailbox = NULL;

int file_changed = 0;

***************
*** 198,204 ****
int i;

new_folder = folder_browser(page,
! XXX,&buffer,&redraw,
aview,
CATGETS(elm_msg_cat, ElmSet,
ElmChangeToWhichFolder,
--- 204,210 ----
int i;

new_folder = folder_browser(page,
! XXX,&buffer,
aview,
CATGETS(elm_msg_cat, ElmSet,
ElmChangeToWhichFolder,
***************
*** 207,216 ****
break;


! mbc = get_storage_count(*mailbox);

for (i = 0; i < mbc; i++) {
! struct current_storage *storage = get_storage(*mailbox,i);

if (!storage)
continue;
--- 213,226 ----
break;


! DPRINT(Debug,3,(&Debug,
! "change_file(%p): new folder = %p\n",
! mailbox,new_folder));
!
! mbc = get_storage_count(mailbox);

for (i = 0; i < mbc; i++) {
! struct current_storage *storage = get_storage(mailbox,i);

if (!storage)
continue;
***************
*** 262,279 ****
CleartoEOS();


! if (*mailbox) {
int result;

if (redraw) {
menu_ClearScreen(page);
- /* Show folder name which we are leaving ... */
- update_title(*mailbox, page);

}

! result = leave_mbox(FALSE, FALSE, TRUE, &new_folder, *mailbox,
! header_page, page);
if(result ==-1) {
/* new mail - leave not done - ca not change to another file
* yet check for change in mailfile_size in main() will do the
--- 272,290 ----
CleartoEOS();


! if (mailbox) {
int result;

if (redraw) {
+ /* Show page what we are leaving... */
menu_ClearScreen(page);


+ /* Call refresh routines of children */
+ menu_redraw_children(page);
}

! result = leave_mbox(FALSE, FALSE, TRUE, &new_folder, mailbox,
! page);
if(result ==-1) {
/* new mail - leave not done - ca not change to another file
* yet check for change in mailfile_size in main() will do the
***************
*** 347,364 ****
emergency_exit(0);
}

! }
!
!
!
}
! redraw = TRUE;
!
if (set_window_title || with_title)
set_folder_window_title(new_folder,
! wanted_title_string,wanted_icon_string);

! newmbox_1(new_folder, FALSE,mailbox,0, header_page, page);
}

fail:
--- 358,374 ----
emergency_exit(0);
}

! }
}
!
if (set_window_title || with_title)
set_folder_window_title(new_folder,


! wanted_title_string,
! wanted_icon_string);
!

! newmbox_1(new_folder, FALSE,&new_mailbox,0, page);

! /* No redraws before data is updated ... */
}

fail:
***************
*** 370,376 ****

if (redraw)
menu_trigger_redraw(page);
! return;
}

/*
--- 380,395 ----

if (redraw)
menu_trigger_redraw(page);
!
! if (!new_mailbox) {
! DPRINT(Debug,3,(&Debug,
! "change_file(%p) = NULL\n",mailbox));
! } else {
! DPRINT(Debug,3,(&Debug,
! "change_file(%p) = %p\n",mailbox,new_mailbox));
! }
!
! return new_mailbox;
}

/*
Index: elm2.4.ME+.122-cvs/src/read_rc.c
*** elm2.4.ME+.121/src/read_rc.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/src/read_rc.c 2005-06-18 00:02:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.26 2004/05/01 19:08:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.29 2005/06/17 21:02:57 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 94,107 ****

DEBUG_VAR(Debug,__FILE__,"config");

- extern opts_menu *find_cfg_opts();
-
#include <errno.h>
#ifndef ANSI_C
extern int errno;
#endif

- char *error_description(), *shift_lower(), *mode_to_str();

static void dump_rc_results P_((void));

--- 94,104 ----
***************
*** 137,147 ****

NewLine();
cpage = Raw(ON | NO_TITE);
! MoveCursor(LINES-1,0);
! CleartoEOS();

redraw1:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNotice,
"\n\rNotice:\
\n\rThis version of ELM requires the use of a .elm directory in your home\
\n\rdirectory to store your elmrc and alias files. Shall I create the\
--- 134,144 ----

NewLine();
cpage = Raw(ON | NO_TITE);
! menu_MoveCursor(cpage,LINES-1,0);
! menu_CleartoEOS(cpage);

redraw1:
! menu_Write_to_screen(cpage,CATGETS(elm_msg_cat, ElmSet, ElmDirNotice,
"\n\rNotice:\
\n\rThis version of ELM requires the use of a .elm directory in your home\
\n\rdirectory to store your elmrc and alias files. Shall I create the\
***************
*** 165,184 ****
ch = *def_ans_no;

if (ch == *def_ans_no) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeNo,
! "No.\n\rVery well. I won't create it.\n\rBut, you may run into difficulties later.\n\r"));
if (sleepmsg > 0) {
error_sleep(sleepmsg *2);
}
}
else if (ch == *def_ans_yes) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeYes,
! "Yes.\n\rGreat! I'll do it now.\n\r"));
create_new_elmdir();
}
else {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeQuit,
! "Quit.\n\rOK. Bailing out of ELM.\n\r"));
Raw(OFF | NO_TITE);
exit(1);
}
--- 162,184 ----
ch = *def_ans_no;

if (ch == *def_ans_no) {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeNo,
! "No.\n\rVery well. I won't create it.\n\rBut, you may run into difficulties later.\n\r"));
if (sleepmsg > 0) {
error_sleep(sleepmsg *2);
}
}
else if (ch == *def_ans_yes) {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeYes,
! "Yes.\n\rGreat! I'll do it now.\n\r"));
create_new_elmdir();
}
else {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeQuit,
! "Quit.\n\rOK. Bailing out of ELM.\n\r"));
Raw(OFF | NO_TITE);
exit(1);
}
***************
*** 186,250 ****
}

/* see if the user has a folders directory */
! if (access(folders, 00) == -1) {
! struct menu_context *cpage;
!
! if(batch_only) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBatchNoticeFoldersDir,
! "\n\
Notice:\n\
ELM requires the use of a folders directory to store your mail folders in.\n\
I'd like to create the directory %s for you,\n\
but I can't in \"batch mode\". Please run ELM in \"normal mode\" first.\n"),
! folders);
! exit(1);
! }
!
! NewLine();
! cpage = Raw( ON | NO_TITE );
! MoveCursor(LINES-1,0);
! CleartoEOS();

redraw2:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoticeFoldersDir,
! "\n\rNotice:\n\r\
ELM requires the use of a folders directory to store your mail folders in.\n\r\
Shall I create the directory %s for you (%c/%c/q)? %c%c"),
! folders, *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
!
! FlushBuffer();
! ch = menu_ReadCh(cpage,REDRAW_MARK);
! if (REDRAW_MARK == ch)
! goto redraw2;

#ifdef ASCII_CTYPE
! if (isascii(ch))
#endif
! ch = tolower(ch);

! if (ch == '\n' || ch == '\r') /* they took the default by pressing cr */
! ch = *def_ans_yes;

! if (ch == *def_ans_no) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeNo,
! "No.\n\rVery well. I won't create it.\n\rBut, you may run into difficulties later.\n\r"));
! if (sleepmsg > 0) {
! error_sleep(sleepmsg *2);
}
}
- else if (ch == *def_ans_yes) {
- Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeYes,
- "Yes.\n\rGreat! I'll do it now.\n\r"));
- create_new_folders();
- }
- else {
- Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeQuit,
- "Quit.\n\rOK. Bailing out of ELM.\n\r"));
- Raw(OFF | NO_TITE);
- exit(0);
- }
- Raw( OFF | NO_TITE );
- }

/* validate/correct config_options string */

--- 186,260 ----
}

/* see if the user has a folders directory */


! {
! /* give_dt_estr_as_str adds / to end */
! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
!

! if (folders_val) {
! if (access(folders_val, 00) == -1) {
! struct menu_context *cpage;
!
! if(batch_only) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBatchNoticeFoldersDir,
! "\n\
Notice:\n\
ELM requires the use of a folders directory to store your mail folders in.\n\
I'd like to create the directory %s for you,\n\
but I can't in \"batch mode\". Please run ELM in \"normal mode\" first.\n"),
! folders_val);
! exit(1);
! }
!
! NewLine();
! cpage = Raw(ON | NO_TITE );
! menu_MoveCursor(cpage,LINES-1,0);
! menu_CleartoEOS(cpage);

redraw2:
! menu_Write_to_screen(cpage,CATGETS(elm_msg_cat, ElmSet, ElmNoticeFoldersDir,
! "\n\rNotice:\n\r\
ELM requires the use of a folders directory to store your mail folders in.\n\r\
Shall I create the directory %s for you (%c/%c/q)? %c%c"),
! folders_val, *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);

+ FlushBuffer();
+ ch = menu_ReadCh(cpage,REDRAW_MARK);
+ if (REDRAW_MARK == ch)
+ goto redraw2;
+
#ifdef ASCII_CTYPE
! if (isascii(ch))
#endif
! ch = tolower(ch);

! if (ch == '\n' || ch == '\r') /* they took the default by pressing cr */
! ch = *def_ans_yes;

! if (ch == *def_ans_no) {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeNo,
! "No.\n\rVery well. I won't create it.\n\rBut, you may run into difficulties later.\n\r"));
! if (sleepmsg > 0) {
! error_sleep(sleepmsg *2);
! }
! }
! else if (ch == *def_ans_yes) {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeYes,
! "Yes.\n\rGreat! I'll do it now.\n\r"));
! create_new_folders();
! }
! else {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeQuit,
! "Quit.\n\rOK. Bailing out of ELM.\n\r"));
! Raw(OFF | NO_TITE);
! exit(0);
! }
! Raw( OFF | NO_TITE );
! }
}
}

/* validate/correct config_options string */

***************
*** 272,278 ****
int i, j, len = 0;

for (i = 0; i < NUMBER_OF_SAVEABLE_OPTIONS; i++) {
- extern char *sort_name(), *alias_sort_name();

if (DT_SYN == save_info[i].dt_type ||
DT_MLT == save_info[i].dt_type)
--- 282,287 ----
Index: elm2.4.ME+.122-cvs/src/remail.c
*** elm2.4.ME+.121/src/remail.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/remail.c 2005-06-18 00:02:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remail.c,v 1.36 2004/07/27 20:25:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remail.c,v 1.40 2005/06/17 21:02:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 28,36 ****


extern int errno;
#endif

- char *error_description();

- extern void display_to();
-
static void remail_sent P_((union any_fd fd, char * title,
struct run_state *rs,
int ret, int exit_stat));
--- 28,33 ----
***************
*** 51,80 ****
FlushBuffer();
}

! int remail(current_header,F1, aview, page)
struct header_rec *current_header;
FILE *F1;
! struct AliasView *aview;
struct menu_context *page;
{
! /** remail a message... returns TRUE if new foot needed ... **/
!
struct mail_send_state * mailer = NULL;


- int redraw = 0;

! char buffer[VERY_LONG_STRING], ch;

int encoding = ENCODING_NONE;
char title[80];
struct mailing_headers mailing_headers;



struct mailer_info *mailer_info = get_mailer_info();

! int LINES, COLUMNS;

! menu_get_sizes(page, &LINES, &COLUMNS);

if (!mailer_info)
! return 0;

/* Actually headers are not written. headers structure is just
* used to pass mailing addresses to backend .
--- 48,77 ----
FlushBuffer();
}

! void remail(current_header,F1, aview, page, prompt_area)
struct header_rec *current_header;
FILE *F1;
! struct AliasView *aview;
struct menu_context *page;
+ struct menu_context *prompt_area;
{
!
struct mail_send_state * mailer = NULL;

! char buffer[VERY_LONG_STRING];

int encoding = ENCODING_NONE;
char title[80];
struct mailing_headers mailing_headers;



struct mailer_info *mailer_info = get_mailer_info();

! int li,co,ch;


! int delay_redraw = 0;

! menu_get_sizes(prompt_area, &li, &co);

if (!mailer_info)
! return;

/* Actually headers are not written. headers structure is just
* used to pass mailing addresses to backend .
***************
*** 82,90 ****
zero_mailing_headers(&mailing_headers);

if (!current_header || !F1)


! return 0;
!
!

/* free_mailing_headers will free this */

if (!mailing_headers.env_from)
--- 79,85 ----
zero_mailing_headers(&mailing_headers);

if (!current_header || !F1)
! return;



/* free_mailing_headers will free this */

if (!mailing_headers.env_from)
***************
*** 96,102 ****
}

if (! get_to(&mailing_headers.to,mailer_info, aview, page,
! NULL, NULL))
goto free_it;

display_to(mailing_headers.to, page);
--- 91,97 ----
}

if (! get_to(&mailing_headers.to,mailer_info, aview, page,
! NULL, NULL,prompt_area))
goto free_it;

display_to(mailing_headers.to, page);
***************
*** 127,150 ****

/** Got the messsage, now let's ensure the person really wants to
remail it... **/
-
- ClearLine(LINES-1-1);
- ClearLine(LINES-1);
- elm_sfprintf(buffer, sizeof buffer,
- CATGETS(elm_msg_cat, ElmSet, ElmSureYouWantToRemail,
- "Are you sure you want to remail this message (%c/%c)? "),
- *def_ans_yes, *def_ans_no);
- FlushBuffer();

! ch = want_to(buffer, *def_ans_yes, LINES-2, 0, page);

- if (ch == *def_ans_no) { /* another day, another No... */
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBounceCancelled,
"Bounce of message canceled."));
! goto free_it;


}
! redraw += menu_need_redraw(page);
!

if (current_header -> status & MIME_MESSAGE) {
encoding = current_header->mime_rec.encoding;

--- 122,164 ----

/** Got the messsage, now let's ensure the person really wants to
remail it... **/

! again:
! menu_ClearLine(prompt_area,2);
! menu_ClearLine(prompt_area,3);
!
!
! ch = prompt_letter(2,"",*def_ans_yes,
! PROMPT_yesno|PROMPT_redraw_mark|PROMPT_ctrlL|
! PROMPT_cancel,
! prompt_area,
!
! CATGETS(elm_msg_cat, ElmSet, ElmSureYouWantToRemail,
! "Are you sure you want to remail this message (%c/%c)? "),
! *def_ans_yes, *def_ans_no);
! if (('L'&31) == ch ||
! REDRAW_MARK == ch) {


! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area);
!
! delay_redraw++; /* Can't trigger redraw yet... */
! goto again;
! }

! if (delay_redraw)
! menu_trigger_redraw(page);
!

! if (ch == *def_ans_no ||
! TERMCH_interrupt_char == ch) { /* another day, another No... */

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBounceCancelled,
"Bounce of message canceled."));
! goto free_it;
}
!
if (current_header -> status & MIME_MESSAGE) {
encoding = current_header->mime_rec.encoding;

***************
*** 169,181 ****
if(mailer)
free_mail_send_state(&mailer);



- if (redraw)
- menu_trigger_redraw(page);

-
free_mailing_headers(&mailing_headers);

free_mailer_info(&mailer_info);
! return(1);
}

static void remail_sent (fd,title,rs,ret,exit_code)
--- 183,195 ----
if(mailer)
free_mail_send_state(&mailer);

free_mailing_headers(&mailing_headers);

free_mailer_info(&mailer_info);
!
! menu_trigger_redraw(prompt_area);
!
! return;
}

static void remail_sent (fd,title,rs,ret,exit_code)
Index: elm2.4.ME+.122-cvs/src/reply.c
*** elm2.4.ME+.121/src/reply.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/reply.c 2005-06-18 00:02:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reply.c,v 1.39 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: reply.c,v 1.43 2005/06/17 21:02:57 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 34,47 ****
be altered while in the editor composing the reply message!
**/

- char *get_token();

#include <errno.h>
#ifndef ANSI_C


extern int errno;
#endif

- char *error_description();

/* Prototype */
static void get_reply_subj P_((char *, char *, char *, int));
--- 34,45 ----
***************
*** 307,317 ****
return result;
}

! void reply(index, mailbox, aview, page)
int index;


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
{
/** Reply to the current message.

--- 305,317 ----
return result;
}

! void reply(index, mailbox, aview, page, prompt_area, header_area)
int index;


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
+ struct menu_context *prompt_area;
+ struct menu_context *header_area;
{
/** Reply to the current message.

***************
*** 319,325 ****
**/

char subject[SLEN];


- int redraw = 0;

int form_letter;
struct addr_item * rt = NULL;
struct string * temp1 = NULL;
--- 319,324 ----
***************
*** 356,371 ****
"Re: your mail") ),
sizeof subject);

! if (form_letter)
! redraw = mail_filled_in_form(index,rt, subject,
! mailbox, aview);
! else {
send_msg_l(index,rt, NULL, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
NO, mailbox, aview,
! page);


!
! redraw += menu_need_redraw(page);

if (me_retcode) {
current_header->status |= REPLIED;
--- 355,370 ----
"Re: your mail") ),
sizeof subject);

! if (form_letter) {
! mail_filled_in_form(index,rt, subject,
! mailbox, aview,
! page); /* Generates always new page ... */
!
! } else {
send_msg_l(index,rt, NULL, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
NO, mailbox, aview,
! page, prompt_area);

if (me_retcode) {
current_header->status |= REPLIED;
***************
*** 379,395 ****
free_string(&temp1);
free(temp2);


! if (redraw)
! menu_trigger_redraw(page);

return;
}

! void reply_to_everyone(index,mailbox, aview, page)
int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;
! struct menu_context *page;
{
/** Reply to everyone who received the current message.
This includes other people in the 'To:' line and people
--- 378,404 ----
free_string(&temp1);
free(temp2);

! /* XXX Is this needed? */


! if (header_area) {
! int vis;

! struct menu_common MENU;
!
! set_mcommon_from_mbxview(&MENU,mailbox);
!
! vis = compute_visible(index+1, &MENU);
! menu_header_status_update(header_area,vis-1);
! }

return;
}

! void reply_to_everyone(index,mailbox, aview, page, prompt_area, header_area)
int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;
! struct menu_context *page;
! struct menu_context *prompt_area;
! struct menu_context *header_area;
{
/** Reply to everyone who received the current message.
This includes other people in the 'To:' line and people
***************
*** 397,403 ****
has to be rewritten. **/

char subject[SLEN];


- int redraw = 0;

struct addr_item * rt;
struct addr_item * cc;

--- 406,411 ----
***************
*** 433,443 ****
sizeof subject);

send_msg_l(index,rt, cc, subject,
! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);


!
! redraw += menu_need_redraw(page);

if (me_retcode) {
current_header->status |= REPLIED;
--- 441,449 ----
sizeof subject);

send_msg_l(index,rt, cc, subject,
! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page, prompt_area);

if (me_retcode) {
current_header->status |= REPLIED;
***************
*** 450,467 ****

free_string(&temp1);
free(temp2);
!

! if (redraw)
! menu_trigger_redraw(page);

return;
}

! void forward(index,mailbox,aview, page)
int index;


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
{
/** Forward the current message. What this actually does is
to temporarily set forwarding to true, then call 'send' to
--- 456,483 ----

free_string(&temp1);
free(temp2);
!
! /* XXX Is this needed? */


! if (header_area) {
! int vis;

! struct menu_common MENU;
!
! set_mcommon_from_mbxview(&MENU,mailbox);
!
! vis = compute_visible(index+1, &MENU);
! menu_header_status_update(header_area,vis-1);
! }

return;
}

! void forward(index,mailbox,aview, page, prompt_area,header_area)
int index;


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
+ struct menu_context *prompt_area;
+ struct menu_context *header_area;
{
/** Forward the current message. What this actually does is
to temporarily set forwarding to true, then call 'send' to
***************
*** 475,511 ****

char subject[SLEN];
int edit_msg = FALSE;
! int LINES, COLUMNS;
struct header_rec *current_header = give_header(mailbox,index);

! menu_get_sizes(page, &LINES, &COLUMNS);

if (! current_header)
return;

if (current_header->status & FORM_LETTER)
! PutLineX(LINES-4,COLUMNS-40,
! CATGETS(elm_msg_cat, ElmSet,
! ElmNoEditingAllowed,
! "<No editing allowed.>"));
else {
-

/* NOTICE: prompt_letter may return EOF */


! int X1 = prompt_letter(LINES-4,"",*def_ans_yes,
! PROMPT_yesno|PROMPT_cancel,page,
!
! CATGETS(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
! "Edit outgoing message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);

! if (TERMCH_interrupt_char == X1) {
! return;
}

if (EOF == X1)
! return;

edit_msg = (X1 != *def_ans_no);
}
--- 491,545 ----

char subject[SLEN];
int edit_msg = FALSE;
! int li, co;
struct header_rec *current_header = give_header(mailbox,index);

! menu_get_sizes(prompt_area, &li, &co);

if (! current_header)
return;

if (current_header->status & FORM_LETTER)
! menu_PutLineX(prompt_area,0,co-40,
! CATGETS(elm_msg_cat, ElmSet,
! ElmNoEditingAllowed,
! "<No editing allowed.>"));
else {


/* NOTICE: prompt_letter may return EOF */

+
+ int X1;
+ int delay_redraw = 0;

+ again:
+ X1 = prompt_letter(0,"",*def_ans_yes,
+ PROMPT_yesno|PROMPT_redraw_mark|PROMPT_ctrlL|
+ PROMPT_cancel,prompt_area,
+
+ CATGETS(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
+ "Edit outgoing message? (%c/%c) "),
+ *def_ans_yes, *def_ans_no);
+
+ if (('L'&31) == X1 ||
+ REDRAW_MARK == X1) {


+ menu_ClearScreen(page); /* Reset possible redraw flag */
+

+ /* Call refresh routines of children */
+ menu_redraw_children(page);

! menu_ClearScreen(prompt_area);

! delay_redraw++; /* Can't trigger redraw yet... */
! goto again;


}

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

+ if (TERMCH_interrupt_char == X1)
+ goto out;
+
if (EOF == X1)
! goto out;

edit_msg = (X1 != *def_ans_no);
}
***************
*** 533,545 ****
strfcat(subject, " (fwd)", sizeof subject);

send_msg_l(index,
! NULL, NULL, subject,
! (edit_msg ? MAIL_EDIT_MSG : 0 ) |
! MAIL_FORWARDING,
! current_header->status & FORM_LETTER ?
! PREFORMATTED : allow_forms,
! mailbox, aview,
! page);

free_string(&temp1);
free(temp2);
--- 567,579 ----
strfcat(subject, " (fwd)", sizeof subject);

send_msg_l(index,
! NULL, NULL, subject,
! (edit_msg ? MAIL_EDIT_MSG : 0 ) |
! MAIL_FORWARDING,
! current_header->status & FORM_LETTER ?
! PREFORMATTED : allow_forms,
! mailbox, aview,
! page, prompt_area);

free_string(&temp1);
free(temp2);
***************
*** 547,563 ****
}
else
send_msg_l(index,
! NULL, NULL,
! /* TODO: Fix this mess... */
! catgets(elm_msg_cat, ElmSet, ElmForwardedMail,
! "Forwarded mail..."),
! (edit_msg ? MAIL_EDIT_MSG : 0 ) |
! MAIL_FORWARDING,
! current_header->status & FORM_LETTER ?
! PREFORMATTED : allow_forms,
! mailbox, aview,
! page);
!
return;
}

--- 581,611 ----
}
else
send_msg_l(index,
! NULL, NULL,
! /* TODO: Fix this mess... */
! catgets(elm_msg_cat, ElmSet, ElmForwardedMail,
! "Forwarded mail..."),
! (edit_msg ? MAIL_EDIT_MSG : 0 ) |
! MAIL_FORWARDING,
! current_header->status & FORM_LETTER ?
! PREFORMATTED : allow_forms,
! mailbox, aview,
! page, prompt_area);
!
! out:
!
! menu_trigger_redraw(prompt_area);
!
! if (header_area) {
! int vis;


! struct menu_common MENU;
!

! set_mcommon_from_mbxview(&MENU,mailbox);
!
! vis = compute_visible(index+1, &MENU);
! menu_header_status_update(header_area,vis-1);
! }
!
return;
}

Index: elm2.4.ME+.122-cvs/src/savecopy.c
*** elm2.4.ME+.121/src/savecopy.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/savecopy.c 2005-06-18 00:02:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.46 2004/06/18 20:40:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.50 2005/06/17 21:02:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.50 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,28 ****

DEBUG_VAR(Debug,__FILE__,"mbox");

- char *error_description(), *ctime();
-
#include <errno.h>


#ifndef ANSI_C
extern int errno;

--- 21,26 ----


***************
*** 286,292 ****
else
msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,

ElmConfirmFolderAppend,
! "Append to mail folder `%s'? (%c/%c) "),

cf->copy_file,
*def_ans_yes, *def_ans_no);

--- 284,290 ----


else
msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,

ElmConfirmFolderAppend,
! "Append to mail folder `%S'? (%c/%c) "),

cf->copy_file,
*def_ans_yes, *def_ans_no);

***************
*** 454,480 ****
return 1;
}

! int name_copy_file(cf,aview, page)
struct copy_file *cf;


struct AliasView *aview;
struct menu_context *page;
{

/** Prompt user for name of file for saving copy of outbound msg to.
! Return true if we need a redraw. **/
!
! int redraw = 0; /* set when we ask for help = need redraw */

if (!cf->dir)
cf->dir = new_browser(selection_folder);

gen_browser(page,
cf->dir, &(cf->copy_file),
! &redraw,word_save_copy,NULL,
aview,
CATGETS(elm_msg_cat, ElmSet, ElmSaveCopyInPrompt,
"Save copy in (use '?' for help): "));

- return redraw;
}

int append_copy_to_file(headers, dir, form, mime_info, conv_file,dest)
--- 452,475 ----
return 1;
}

! void name_copy_file(cf,aview, page)
struct copy_file *cf;


struct AliasView *aview;
struct menu_context *page;
{

/** Prompt user for name of file for saving copy of outbound msg to.
! Called menu_trigger_redraw(page) if we need redraw **/

if (!cf->dir)
cf->dir = new_browser(selection_folder);

gen_browser(page,
cf->dir, &(cf->copy_file),
! word_save_copy,NULL,
aview,
CATGETS(elm_msg_cat, ElmSet, ElmSaveCopyInPrompt,
"Save copy in (use '?' for help): "));

}

int append_copy_to_file(headers, dir, form, mime_info, conv_file,dest)
***************
*** 493,503 ****
dest is not seekable !!!
*/
int env_flag;

char * fname_copy = elm_message(FRM("%selmcopy-%d"),
! temp_dir, getpid ());
out_state_t buffer;
charset_t charset_vector[2];

/* Needed by STATE_out_dir */
charset_vector[0] = RAW_BUFFER;
--- 488,502 ----
dest is not seekable !!!
*/
int env_flag;


+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");

+

char * fname_copy = elm_message(FRM("%selmcopy-%d"),


! tmp ? tmp : "/tmp/",

! getpid ());
out_state_t buffer;
charset_t charset_vector[2];
+

/* Needed by STATE_out_dir */
charset_vector[0] = RAW_BUFFER;
Index: elm2.4.ME+.122-cvs/src/save_opts.c
*** elm2.4.ME+.121/src/save_opts.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/save_opts.c 2005-07-05 20:53:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.27 2004/06/18 09:29:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.29 2005/07/05 17:53:38 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 30,51 ****

#define absolute(x) ((x) < 0? -(x) : (x))

extern int errno;
extern char version_buff[];

! char *error_description(), *sort_name(), *alias_sort_name(), *level_name();
! char *mode_to_str();
! long ftell();

#include "rc_imp.h"
#include "save_opts.h"

FILE *elminfo; /* informational file as needed... */

- static void add_comment P_((int iindex, FILE *fd));
- static void build_offset_table P_((FILE *elminfo_fd));
- static int find_and_store_loc P_((char *name, long offset));
-
void save_options()
{
/** Save the options currently specified to a file. This is a
--- 30,47 ----

#define absolute(x) ((x) < 0? -(x) : (x))



+ #ifndef errno
extern int errno;
+ #endif

extern char version_buff[];

!

#include "rc_imp.h"
#include "save_opts.h"

FILE *elminfo; /* informational file as needed... */

void save_options()
{
/** Save the options currently specified to a file. This is a
***************
*** 64,72 ****
and such.
**/

- FILE *newelmrc;
char oldfname[SLEN], newfname[SLEN];
! int err;

strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
--- 60,67 ----
and such.
**/

char oldfname[SLEN], newfname[SLEN];
! int err,r;

strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
***************
*** 86,123 ****
}

/** now let's open the datafile if we can... **/
-
- if ((elminfo = fopen(ELMRC_INFO, "r")) == NULL)
- lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavingWithoutComments,


- "Warning: saving without comments! Can't get to %s."),
- ELMRC_INFO);
-

- /** next, open the new .elm/elmrc file... **/
-
- err = can_open(newfname, "w");
- if (err) {
- lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
- "Can't save configuration! Can't write to %s [%s]."),
- newfname, error_description(errno));
- return;
- }

! if ((newelmrc = fopen(newfname, "w")) == NULL) {
! lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
! "Can't save configuration! Can't write to %s [%s]."),
! newfname, error_description(errno));
! return;
! }

- save_user_options(elminfo, newelmrc);
restore_file_stats(newfname);
-
- lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcOptionsSavedIn,
- "Options saved in file %s."), newfname);
- }


! int find_opt(s)
char *s;
{
int x, y = 0;
--- 81,98 ----
}

/** now let's open the datafile if we can... **/

! r = write_rc(newfname,NULL,0,"ELM",full_username);

restore_file_stats(newfname);

+ if (r)
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcOptionsSavedIn,
+ "Options saved in file %s."), newfname);
+ }

! static int find_opt P_((char *s));
! static int find_opt(s)
char *s;
{
int x, y = 0;
***************
*** 142,148 ****
if (0 == strcmp("aliassortby",s))
t = alias_sort_name(SHORT);
else if (0 == strcmp("userlevel",s))
! t = level_name(user_level);
else {
int x = find_opt(s);
if (x >= 0) {
--- 117,123 ----
if (0 == strcmp("aliassortby",s))
t = alias_sort_name(SHORT);
else if (0 == strcmp("userlevel",s))
! t = level_name(give_dt_enumerate_as_int(&user_level));
else {
int x = find_opt(s);
if (x >= 0) {
***************
*** 158,316 ****
return(t);
}

-
- void save_user_options(elminfo_fd, newelmrc)
- FILE *elminfo_fd, *newelmrc;
- {
- int x, local_value;
- char buf[SLEN];
-
- /** save the information in the file. If elminfo_fd == NULL don't look
- for comments!
- **/
-
- if (elminfo_fd != NULL)
- build_offset_table(elminfo_fd);
-
- elm_fprintf(newelmrc,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcOptionsFile,
- "#\n# .elm/elmrc - options file for the ELM mail system\n#\n"));
-
- if (strlen(full_username) > 0)
- elm_fprintf(newelmrc,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoFor,
- "# Saved automatically by ELM %s for %s\n#\n\n"),
- version_buff, full_username);
- else
- elm_fprintf(newelmrc,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAuto,
- "# Saved automatically by ELM %s\n#\n\n"),
- version_buff);
-
- if (elminfo_fd != NULL) {
- x = FALSE;
- rewind(elminfo_fd);
- while (!x && fgets(buf, sizeof(buf), elminfo_fd) != NULL)
- x = (strncmp(buf, "#$HDR", 5) == 0);
- if (x) {
- while (fgets(buf, sizeof(buf), elminfo_fd) != NULL) {
- if (buf[0] != '#')
- break;
- fputs(buf, newelmrc);
- }
- }
- }
-
- for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
-
- /** skip system-only options **/
- if (save_info[x].flags & FL_SYS) {
- DPRINT(Debug,15,(&Debug,
- "Option %d -- \"%s\" system-only, flags=%0x\n",
- x,save_info[x].name, save_info[x].flags ));
- continue;
- }
-

- local_value = save_info[x].flags & FL_LOCAL;

- add_comment(x, newelmrc);
-

- if (RCTYPE_magic != save_info[x].dt_type->magic)

- panic("RC PANIC",__FILE__,__LINE__,"save_user_options",


- "Bad config item type",0);
-

- save_info[x].dt_type->print_value(newelmrc,


- & save_info[x],
- !local_value);
- }

-
- #ifdef USE_DLOPEN
- print_local_shared_options(newelmrc,0);
- #endif
-
- fclose(newelmrc);
- if ( elminfo_fd != NULL ) {
- fclose(elminfo_fd);
- }
- }
-
- static void add_comment(iindex, fd)
- int iindex;
- FILE *fd;
- {
- /** get to and add the comment to the file **/
- char buffer[SLEN];
-
- /** always put a blank line between options */
- fputc('\n', fd);
-
- /** add the comment from the comment file, if available **/
- if (save_info[iindex].offset > 0L) {
- if (fseek(elminfo, save_info[iindex].offset, 0) == -1) {
- DPRINT(Debug,1,(&Debug,
- "** error %s seeking to %ld in elm-info file!\n",
- error_description(errno),
- save_info[iindex].offset));
- } else {
- while (fgets(buffer, SLEN, elminfo) != NULL) {
- if (buffer[0] != '#')
- break;
- fputs(buffer, fd);


- }
- }
- }
- }
-

- static void build_offset_table(elminfo_fd)
- FILE *elminfo_fd;
- {
- /** read in the info file and build the table of offsets.
- This is a rather laborious puppy, but at least we can
- do a binary search through the array for each element and
- then we have it all at once!
- **/
-

- char line_buffer[SLEN];
-

- while (fgets(line_buffer, SLEN, elminfo_fd) != NULL) {
- if (strlen(line_buffer) > 1)
- if (line_buffer[0] != '#' && !whitespace(line_buffer[0])) {
- no_ret(line_buffer);
- if (find_and_store_loc(line_buffer, ftell(elminfo_fd))) {
- DPRINT(Debug,1,(&Debug,
- "** Couldn't find and store \"%s\" **\n",
- line_buffer));


- }
- }
- }
- }
-

- static int find_and_store_loc(name, offset)
- char *name;
- long offset;
- {
- /** given the name and offset, find it in the table and store it **/
-
- int first = 0, last, middle, compare;
-
- last = NUMBER_OF_SAVEABLE_OPTIONS;
-
- while (first <= last) {
-
- middle = (first+last) / 2;
-
- if ((compare = strcmp(name, save_info[middle].name)) < 0) /* a < b */
- last = middle - 1;
- else if (compare == 0) { /* a = b */
- save_info[middle].offset = offset;
- return(0);
- }
- else /* greater */ /* a > b */
- first = middle + 1;
- }
-
- return(-1);
- }
-

/*
* Local Variables:
* mode:c

--- 133,138 ----
Index: elm2.4.ME+.122-cvs/src/screen.c
*** elm2.4.ME+.121/src/screen.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/screen.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: screen.c,v 1.35 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: screen.c,v 1.45 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 18,23 ****
--- 18,24 ----

#include "def_elm.h"
#include "s_elm.h"
+ #include "s_aliases.h"

DEBUG_VAR(Debug,__FILE__,"ui");

***************
*** 25,32 ****

extern char version_buff[];

- static int fix_header_page P_((struct menu_common *menu,
- int *header_page));



static char *us2s P_((unsigned char *str));

static char *us2s(str)
--- 26,31 ----
***************
*** 35,62 ****
return (char *)str;
}

!
!
! void showscreen(mailbox,menu, header_page, page)
! struct MailboxView *mailbox;
! menu_func *menu;
! int *header_page;
struct menu_context *page; /* new page assumed */
{
- struct menu_common MENU;
-
- set_mcommon_from_mbxview(&MENU,mailbox);
-
menu_ClearScreen(page);
-
- update_title(mailbox, page);

! last_header_page = -1; /* force a redraw regardless */
! show_headers(&MENU, header_page, page);

- if (mini_menu)
- menu(page);
-
show_last_error();

/* define_softkeys(MAIN); */
--- 34,47 ----
return (char *)str;
}

! void showscreen(page)
struct menu_context *page; /* new page assumed */
{
menu_ClearScreen(page);



! /* Call refresh routines of children */
! menu_redraw_children(page);

show_last_error();

/* define_softkeys(MAIN); */
***************
*** 109,506 ****
free_string(&title_1);
}

!
! void update_title(mailbox, page)
! struct MailboxView *mailbox;
! struct menu_context *page;
{
! /** display a new title line, probably due to new mail arriving **/
!

struct string * buffer = NULL;

struct string * buffer2 = NULL;
! struct string * f1 = mailbox_title(mailbox);
! int message_count = get_message_count(mailbox);
! int selected = get_selected(mailbox);

int l1,l2,l;
int LINES, COLUMNS;

! menu_get_sizes(page, &LINES, &COLUMNS);

! ClearLine(1);
! ClearLine(2);

if (selected)
buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
ElmShownXWithSelect,
"%S with %d shown out of %d"),
f1,selected,
message_count);
! else if (message_count == 1)
! buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmShownXNoSelect,
! "%S with 1 message"),
! f1);
! else
! buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmShownXNoSelectPlural,
! "%S with %d messages"),
! f1,message_count);

free_string(&f1);

l1 = string_len(buffer);

! buffer2 = format_string(FRM("[ELM %s]"),version_buff);
l2 = string_len(buffer2);
l = l1 + l2 + 1; /* Assumed */

if (l > COLUMNS) {
if (l2 < COLUMNS)
! PutLineX(2,(COLUMNS - l2)/2,FRM("%S"),buffer2);
if (l1 > COLUMNS)
! PutLineX(1,1,FRM("%S"),buffer);
else
! PutLineX(1,(COLUMNS - l1)/2,FRM("%S"),buffer);
} else {
! PutLineX(1,(COLUMNS - l)/2,FRM("%S %S"),buffer,buffer2);
}
!
free_string(&buffer);
free_string(&buffer2);

}

! void show_menu(page)


! struct menu_context *page;
{
! /** write main system menu... **/
! int LINES, COLUMNS;

! menu_get_sizes(page,&LINES, &COLUMNS);



! if (user_level == 0) { /* a rank beginner. Give less options */

! print_format_center(LINES-1-7,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,
! "You can use any of the following commands by pressing the first character;"));

! print_format_center(LINES-1-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine2,
! "d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit"));
! print_format_center(LINES-1-5,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine3,
! "To read a message, press <return>. j = move down, k = move up, ? = help"));
} else {
! print_format_center(LINES-1-7,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,
! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));

! print_format_center(LINES-1-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine2,
! "a)lias, C)opy, c)hange folder, d)elete, e)dit, f)orward, g)roup reply, m)ail,"));
! print_format_center(LINES-1-5,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine3,
! "n)ext, o)ptions, p)rint, q)uit, r)eply, s)ave, t)ag, u)ndelete, or e(x)it"));
}
}

!
! int show_headers(menu, header_page, page)
! struct menu_common *menu;
! int *header_page;
! struct menu_context *page; /* not really currently used */
!
{
- /** Display page of headers (10) if present. First check to
- ensure that header_page is in bounds, fixing silently if not.
- If out of bounds, return zero, else return non-zero
- Modified to only show headers that are "visible" to ze human
- person using ze program, eh?
- **/
-
- int this_msg = 0, line = 4, last = 0, last_line,
- displayed = 0, using_to;
-
- int selected = mcommon_get_selected(menu);
int LINES, COLUMNS;

! menu_get_sizes(default_context,&LINES, &COLUMNS);
!
! if (fix_header_page(menu,header_page))
! return(FALSE);
!
! if (selected) {
! if (((*header_page)*headers_per_page) > selected)
! return(FALSE); /* too far! too far! */
!
! this_msg = visible_to_index((*header_page) * headers_per_page + 1,
! menu);
! displayed = (*header_page) * headers_per_page;
!
! last = displayed+headers_per_page;
!
! } else {
! if ((*header_page) == last_header_page) /* nothing to do! */
! return(FALSE);
!
! /** compute last header to display **/
!
! this_msg = (*header_page) * headers_per_page;
! last = this_msg + (headers_per_page - 1);
! }
!
! if (last >= mcommon_get_count(menu))
! last = mcommon_get_count(menu)-1;
!
! /** Okay, now let's show the header page! **/
!
! ClearLine(line); /* Clear the top line... */
!
! MoveCursor(line, 0); /* and move back to the top of the page... */
!
! DPRINT(Debug,15,(&Debug,
! "show_headers: inalias=%d, selected=%d, last=%d\n",
! inalias,selected,last));
!
! while ((selected && displayed < last) || this_msg <= last) {
!
! #if DEBUG && 0
! if (Debug.active > 10 && !inalias) {


! struct addr_item * p;

! struct header_rec * hdr = give_header(mailbox,this_msg);
!
! DPRINT(Debug,15,(&Debug,
! "-- %d: %x \n",
! this_msg,hdr));
!
! for (p = hdr->from; p && p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- %d:from[%d] addr='%s' comment='%S' fullname='%S'\n",
! this_msg,
! p - hdr->from,


! p->addr,
! p->comment,
! p->fullname));
! }
!

! for (p = hdr->to; p && p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- %d: to[%d] addr='%s' comment='%S' fullname='%S'\n",
! this_msg,
! p - hdr->to,


! p->addr,
! p->comment,
! p->fullname));
! }
!

! for (p = hdr->cc; p && p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- %d: cc[%d] addr='%s' comment='%S' fullname='%S'\n",
! this_msg,
! p - hdr->cc,


! p->addr,
! p->comment,
! p->fullname));
! }
! }


! if (Debug.active > 10 && inalias) {
! struct alias_rec * a = give_alias(aview,this_msg);

! DPRINT(Debug,15,(&Debug,
! "-- %d: %x alias='%s'\n",
! this_msg,a, a->alias));

}
!
! #endif
! mcommon_screen_print_menu_line(menu,this_msg, page);
!
! if (selected)
! displayed++;
!
! CleartoEOLN();
! line++; /* for clearing up in a sec... */
!
! if (selected) {
! if ((this_msg = next_message(this_msg, FALSE, menu)) < 0)
! break; /* GET OUTTA HERE! */
!
! /* the preceeding looks gross because we're using an INDEX
! variable to pretend to be a "current" counter, and the
! current counter is always 1 greater than the actual
! index. Does that make sense??
! */
! }
! else
! this_msg++; /* even dumber... */
!
! }
!
! /* clear unused lines */
!
! if (mini_menu)
! last_line = LINES-9;
! else
! last_line = LINES-5;
!
! while (line < last_line) {
! CleartoEOLN();
! NewLine();
! line++;
}
!
! display_central_message();
!
! last_current = mcommon_get_current(menu);
! last_header_page = (*header_page);
!
! return(TRUE);
}

! void show_current(menu, header_page, page)
! struct menu_common *menu;
! int *header_page;
! struct menu_context *page;
{
! /** Show the new header, with all the usual checks **/

! int first = 0, last = 0, last_line, new_line, using_to;


! int selected = mcommon_get_selected(menu);

!
! (void) fix_header_page(menu, header_page); /* Who cares what it does? ;-) */

! /** compute the first and last header on this page **/
! first = (*header_page) * headers_per_page + 1;
! last = first + (headers_per_page - 1);
!
! /* if not a full page adjust last to be the real last */
! if (selected && last > selected)
! last = selected;
! if (!selected && last > mcommon_get_count(menu))
! last = mcommon_get_count(menu);
!
! /** okay, now let's show the pointers... **/
!
! /** have we changed??? **/
! if (mcommon_get_current(menu) == last_current) {
! DPRINT(Debug,5,(&Debug,"show_current: Not changed last_current=%d\n",
! last_current));
! return;
}

! if (selected) {
! last_line = ((compute_visible(last_current, menu)-1) %
! headers_per_page)+4;
! new_line = ((compute_visible(mcommon_get_current(menu),
! menu)-1) %
! headers_per_page)+4;
! } else {
! last_line = ((last_current-1) % headers_per_page)+4;
! new_line = ((mcommon_get_current(menu)
! -1) % headers_per_page)+4;
}
!
! if (has_highlighting && ! arrow_cursor) {
!
! /* clear last current if it's in proper range */
! if (last_current > 0) { /* not a dummy value */
! int vis = compute_visible(last_current, menu);
!
! if (vis <= last && vis >= first) {
!
! DPRINT(Debug,5,(&Debug,
! "\nlast_current = %d ... clearing [1] before we add [2]\n",
! last_current));
! DPRINT(Debug,5,(&Debug,
! "first = %d, and last = %d\n\n",
! first, last));
!
! ClearLine(last_line);
! MoveCursor(last_line,0);
!
! mcommon_screen_print_menu_line(menu,last_current-1,
! page);

- } else {
- DPRINT(Debug,5,(&Debug, "show_current: last_current %d not visible: %d (range: %d - %d)\n",
- last_current,vis,first,last));
- }

! }


! MoveCursor(new_line, 0);
!
! {


! int current = mcommon_get_current(menu);
!

! mcommon_screen_print_menu_line(menu,current-1,
! page);
!
! DPRINT(Debug,5,(&Debug, "show_current: ... adding new (line %d) current=%d\n",
! new_line,current));

}

} else {


! int current = mcommon_get_current(menu);
!

! if (on_page(last_current-1, menu,*header_page))
! PutLine0(last_line,0," "); /* remove old pointer... */
! if (on_page(current-1, menu,*header_page))
! PutLine0(new_line, 0,"->");
}

! last_current = mcommon_get_current(menu);

}

! static int fix_header_page(menu, header_page)
! struct menu_common *menu;
! int *header_page;
{
! /** this routine will check and ensure that the current header
! page being displayed contains messages! It will silently
! fix 'header-page' if wrong. Returns TRUE if changed. **/
!
! int last_page, old_header;
!
! old_header = (*header_page);
!
! last_page = (int) ((mcommon_get_count(menu)-1) /
! headers_per_page);
!
! if ((*header_page) > last_page)
! (*header_page) = last_page;
! if ((*header_page) < 0)
! (*header_page) = 0;

! return(old_header != (*header_page));
! }

! int on_page(message,menu,header_page)
! int message;


! struct menu_common *menu;
! int header_page;
! {

! int selected = mcommon_get_selected(menu);

! /** Returns true iff the specified message is on the displayed page. **/

! if (selected)
! message = compute_visible(message, menu);

! if (message >= (header_page) * headers_per_page)
! if (message < (((header_page)+1) * headers_per_page))
! return(TRUE);
!
! return(FALSE);
}

/*
--- 94,413 ----
free_string(&title_1);
}

! #if ANSI_C
! subpage_simple_redraw sb_update_title;
! #endif
! int sb_update_title(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;
{
! struct menu_common *mptr = mp_lookup_mcommon(list,elm_mp_menu);

! int modified = mp_lookup_integer(list,elm_mp_modified);
!
! int message_count = mcommon_get_count(mptr);
! int selected = mcommon_get_selected(mptr);
! struct string * f1 = mcommon_title(mptr);
!

struct string * buffer = NULL;

struct string * buffer2 = NULL;
! struct string * modmsg = NULL;

int l1,l2,l;
int LINES, COLUMNS;
+
+ DPRINT(Debug,9, (&Debug, "sb_update_title\n"));

! menu_ClearScreen(ptr);
! menu_get_sizes(ptr, &LINES, &COLUMNS);

! if (modified) {
! modmsg = format_string(CATGETS(elm_msg_cat, AliasesSet,
! AliasesModified,
! "(modified, resync needed) "));
! }
! else {
! modmsg = new_string(system_charset);
! }

+
if (selected)
buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
ElmShownXWithSelect,
"%S with %d shown out of %d"),
f1,selected,
message_count);
! else
! buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmShownXNoSelectItem,
! "%S with %d %S"),
! f1, message_count,
! (message_count == 1) ?
! mcommon_give_item(mptr,m_item) :
! mcommon_give_item(mptr,m_items));
!

+
free_string(&f1);

l1 = string_len(buffer);

! buffer2 = format_string(FRM("%S[ELM %s]"),
! modmsg,version_buff);
l2 = string_len(buffer2);
l = l1 + l2 + 1; /* Assumed */

if (l > COLUMNS) {
if (l2 < COLUMNS)
! menu_PutLineX(ptr,2,(COLUMNS - l2)/2,FRM("%S"),buffer2);
if (l1 > COLUMNS)
! menu_PutLineX(ptr,1,1,FRM("%S"),buffer);
else
! menu_PutLineX(ptr,1,(COLUMNS - l1)/2,FRM("%S"),buffer);
} else {
! menu_PutLineX(ptr,1,(COLUMNS - l)/2,FRM("%S %S"),buffer,buffer2);
}
!
! free_string(&modmsg);
free_string(&buffer);
free_string(&buffer2);

+ return 1; /* subpage area updated completely */
}

! #if ANSI_C
! subpage_simple_redraw sb_show_menu;
! #endif
! int sb_show_menu(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;
{
! struct menu_common *mptr = mp_lookup_mcommon(list,elm_mp_menu);
! int ul = give_dt_enumerate_as_int(&user_level);
!

! DPRINT(Debug,9, (&Debug, "sb_show_menu\n"));

! menu_ClearScreen(ptr);



! if (ul == 0) { /* a rank beginner. Give less options */
! menu_print_format_center(ptr,

! 0, CATGETS(elm_msg_cat, ElmSet,

! ElmLevel0MenuLine1,
! "You can use any of the following commands by pressing the first character;"));

! menu_print_format_center(ptr,
! 1, CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine2,
! "d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit"));
! menu_print_format_center(ptr,
! 2, CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine3,
! "To read a message, press <return>. j = move down, k = move up, ? = help"));
} else {
! menu_print_format_center(ptr,
! 0, CATGETS(elm_msg_cat, ElmSet,

! ElmLevel1MenuLine1,
! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));

! menu_print_format_center(ptr,
! 1, CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine2,
! "a)lias, C)opy, c)hange folder, d)elete, e)dit, f)orward, g)roup reply, m)ail,"));
! menu_print_format_center(ptr,
! 2, CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine3,
! "n)ext, o)ptions, p)rint, q)uit, r)eply, s)ave, t)ag, u)ndelete, or e(x)it"));
}
+
+ return 1;
}

! static void draw_dummy_hl P_((struct menu_context *ptr, int line_number,
! int is_current));
! static void draw_dummy_hl(ptr,line_number,is_current)
! struct menu_context *ptr;
! int line_number;
! int is_current;
{
int LINES, COLUMNS;

! menu_get_sizes(ptr, &LINES, &COLUMNS);

+ menu_MoveCursor(ptr,line_number,0);

! if (is_current) {
! int l = 0;

! menu_StartXX(ptr,pg_INVERSE);

+ while (l < COLUMNS) {
+ menu_Writechar(ptr,' ');
+ l++;
}
! menu_EndXX(ptr,pg_INVERSE);
}
!
! menu_Writechar(ptr,'\r');
! menu_Writechar(ptr,'\n');
}

!
! #if ANSI_C
! header_line_redraw hdr_show_header;
! #endif
! void hdr_show_header(ptr,list,line_number,index,is_current)


! struct menu_context *ptr;
! struct menu_param *list;

! int line_number;
! int index;
! int is_current;
{
! struct menu_common *menu = mp_lookup_mcommon(list,elm_mp_menu);
! int count = mcommon_get_count(menu);


! int selected = mcommon_get_selected(menu);

! int rindex = index;
!
! DPRINT(Debug,9, (&Debug, "hdr_show_header\n"));
!
! /* mcommon_screen_print_menu_line() looks current pointer
! from 'menu', so is_current is not needed
! */

! menu_ClearLine(ptr,line_number);
! menu_MoveCursor(ptr,line_number,0);

! if (selected) {
! if (index < 0 || index >= selected)
! goto out;
! rindex = visible_to_index(index+1,menu);
}

! if (rindex >= 0 && rindex < count)
! mcommon_screen_print_menu_line(menu,rindex,ptr);
! else {
! out:
! if (has_highlighting && ! arrow_cursor) {
! draw_dummy_hl(ptr,line_number,is_current);
! } else {
! if (is_current)
! menu_PutLine0(ptr,line_number,0,"->");
! }
}
! }


! #if ANSI_C
! header_line_redraw hdr_show_current;
! #endif
! void hdr_show_current(ptr,list,line_number,index,is_current)


! struct menu_context *ptr;
! struct menu_param *list;

! int line_number;
! int index;
! int is_current;
! {
! struct menu_common *menu = mp_lookup_mcommon(list,elm_mp_menu);
! int count = mcommon_get_count(menu);
!
! DPRINT(Debug,9, (&Debug, "hdr_show_current\n"));

+ if (has_highlighting && ! arrow_cursor) {


+ int selected = mcommon_get_selected(menu);

+ int rindex = index;

! /* mcommon_screen_print_menu_line() looks current pointer
! from 'menu', so is_current is not needed
! */

+ menu_ClearLine(ptr,line_number);
+ menu_MoveCursor(ptr,line_number,0);
+
+ if (selected) {
+ if (index < 0 || index >= selected)
+ goto out;
+ rindex = visible_to_index(index+1,menu);
}

+
+ if (rindex >= 0 && rindex < count)
+ mcommon_screen_print_menu_line(menu,rindex,ptr);
+ else {
+ out:
+ draw_dummy_hl(ptr,line_number,is_current);
+ }
} else {
! if (!is_current)
! menu_PutLine0(ptr,line_number,0," "); /* remove old pointer... */
! else
! menu_PutLine0(ptr,line_number,0,"->");
}
+ }
+
+ void copy_current(menu,ptr)
+ struct menu_common *menu;
+ struct menu_context *ptr;
+ {
+ int current = mcommon_get_current(menu);
+ int j = menu_header_get(ptr,header_current);

! /* Compute visible takes account is there selected messages or not.
! Note that it is 1 based ... */
! int n = compute_visible(current,menu)-1;
!
! DPRINT(Debug,5,(&Debug,
! "copy_current: current %d: header_page current %d => %d\n",
! current,j,n));

+ menu_header_change(ptr, header_current,n);
}

! void hdr_show_status(ptr,list,line_number,index,is_current)


! struct menu_context *ptr;
! struct menu_param *list;

! int line_number;
! int index;
! int is_current;
{
! struct menu_common *menu = mp_lookup_mcommon(list,elm_mp_menu);
! int count = mcommon_get_count(menu);


! int selected = mcommon_get_selected(menu);

! int rindex = index;


! char * s = "";

! char tagged = ' ';
!
! DPRINT(Debug,9, (&Debug, "hdr_show_status\n"));

! if (selected) {
! if (index < 0 || index >= selected)
! goto out;
! rindex = visible_to_index(index+1,menu);
! }
!
! if (rindex >= 0 && rindex < count) {
! s = mcommon_show_status(menu,rindex);
! if (mcommon_ison_status(menu,rindex,status_basic,TAGGED))
! tagged = '+';
! else if (mcommon_ison_status(menu,rindex,status_1,S1_FLAGGED))
! tagged = 'F';
! else
! tagged = ' ';
! } else {
! out:
! s = " ";
! tagged = ' ';
! }

! menu_MoveCursor(ptr,line_number,0);

! if (has_highlighting && ! arrow_cursor && is_current)
! menu_StartXX(ptr,pg_INVERSE);

! menu_Write_to_screen(ptr,
! FRM("%.2s%.2s%c"),
! (is_current && arrow_cursor)? "->" : " ",
! s,tagged);

! if (has_highlighting && ! arrow_cursor && is_current)
! menu_EndXX(ptr,pg_INVERSE);
!
! return;
}

/*
***************
*** 510,512 ****
--- 417,423 ----
* buffer-file-coding-system: iso-8859-1
* End:


*/
+
+
+
+

Index: elm2.4.ME+.122-cvs/src/screen/context.c
*** elm2.4.ME+.121/src/screen/context.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/screen/context.c 2005-02-12 22:49:23.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: context.c,v 1.5 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: context.c,v 1.8 2005/02/12 20:49:23 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 13,21 ****
--- 13,28 ----


struct menu_context ROOT_MENU = {
MENU_CONTEXT_magic,

+ &CURSES_ROUTINES, /* menu_draw_routine */
+ NULL, NULL, /* subpages, container */
+

0,0, /* lines, columns */
0,0, /* changed, redraw */

+ 0, /* modes */
+ 0,0, /* row,col */
+
+ NULL, /* dummy */

NULL /* prev */,
NULL /* next */
***************
*** 25,33 ****
--- 32,47 ----


struct menu_context COOKED_MENU = {
MENU_CONTEXT_magic,

+ &CURSES_ROUTINES, /* menu_draw_routine */
+ NULL, NULL, /* subpages, container */
+

0,0, /* lines, columns */
0,0, /* changed, redraw */

+ 0, /* modes */
+ 0,0, /* row,col */
+
+ NULL, /* dummy */

NULL /* prev */,
NULL /* next */
***************
*** 36,56 ****

struct menu_context * default_context = &COOKED_MENU;

! struct menu_context * new_menu_context()
{
struct menu_context *ret = safe_malloc(sizeof (*ret));



/* bzero is defined hdrs/defs.h */

bzero((void *)ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;


ret->lines = ROOT_MENU.lines;
ret->columns = ROOT_MENU.columns;
ret->changed = ROOT_MENU.changed;
ret->redraw = ROOT_MENU.redraw;

/* chain to list */

ret->next_menu = ROOT_MENU.next_menu;
--- 50,104 ----

struct menu_context * default_context = &COOKED_MENU;

! struct menu_context * new_menu_type(T)
! struct menu_draw_routine *T;
{
struct menu_context *ret = safe_malloc(sizeof (*ret));

+ if (MENU_DRAW_magic != T->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_type",
+ "Bad routine magic number",0);
+
/* bzero is defined hdrs/defs.h */
bzero((void *)ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;
+ ret->routine = T;
+
+ ret->subpages = NULL;
+ ret->container = NULL;
+
+ ret->lines = 0;
+ ret->columns = 0;
+ ret->changed = 0;
+ ret->redraw = 0;
+
+ ret->modes = 0;
+ ret->row = 0;
+ ret->col = 0;

+ ret->u.dummy = NULL;
+
+ T->wra_init(ret);


+
+ return ret;
+ }
+

+ struct menu_context * new_menu_context()
+ {
+ struct menu_context *ret = new_menu_type(&CURSES_ROUTINES);
+
+ /* Take data from root menu */

ret->lines = ROOT_MENU.lines;
ret->columns = ROOT_MENU.columns;
ret->changed = ROOT_MENU.changed;
ret->redraw = ROOT_MENU.redraw;

+ ret->modes = ROOT_MENU.modes;
+ ret->row = ROOT_MENU.row;
+ ret->col = ROOT_MENU.col;
+
/* chain to list */

ret->next_menu = ROOT_MENU.next_menu;
***************
*** 63,77 ****
if (default_context == &COOKED_MENU) {
DPRINT(Debug,1, (&Debug,
"new_menu_context: On COOKED MENU, not changing default context\n"));
! } else
default_context = ret;

return ret;
}

void erase_menu_context(ptr)
struct menu_context **ptr;
{
if ((*ptr)->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"Bad type magic number",0);
--- 111,134 ----
if (default_context == &COOKED_MENU) {
DPRINT(Debug,1, (&Debug,
"new_menu_context: On COOKED MENU, not changing default context\n"));
! } else {
default_context = ret;

+ DPRINT(Debug,9, (&Debug,
+ "new_menu_context: default context to %p\n",
+ default_context));
+
+ Syncronize(default_context);
+ }
+
return ret;
}

void erase_menu_context(ptr)
struct menu_context **ptr;
{
+ struct menu_subpages *list, *next = NULL;
+
if ((*ptr)->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"Bad type magic number",0);
***************
*** 84,106 ****
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"attempt to erase cooked menu",0);

! if (default_context == (*ptr))
default_context = (*ptr)->prev_menu;

if (!default_context)
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"no default content",0);

if ((*ptr)->next_menu)
(*ptr)->next_menu->prev_menu = (*ptr)->prev_menu;
if ((*ptr)->prev_menu)
(*ptr)->prev_menu->next_menu = (*ptr)->next_menu;

(*ptr)->magic = 0; /* Invalidate */
free(*ptr);
*ptr = NULL;
}

int menu_resized(ptr)
struct menu_context *ptr;
{
--- 141,352 ----
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"attempt to erase cooked menu",0);

! if (MENU_DRAW_magic != (*ptr)->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
! "Bad routine magic number",0);
!
! EndSyncronize(*ptr);
!
! if ((*ptr)->container)
! detach_subpage(*ptr);
!
! if ((*ptr)->subpages) {
! DPRINT(Debug,1, (&Debug,
! "erase_menu_context: %p: WARNING: subpages not erased / detached\n",
! *ptr));
!
! for (list = (*ptr)->subpages; list; list = next) {
! if (MENU_CONTAINER_magic != list->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
! "Bad subpage type magic number",0);
! if (list->parent != *ptr)
! panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
! "Bad parent pointer on subpage",0);
! next = list->next;
!
! if (list->subpage) {
! if (list != list->subpage->container)
! panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
! "Bad container pointer on subpage",0);
!
! /* Reset congtainer pointer so that erase menu
! content do not call detach_subpage()
! */
! list->subpage->container = NULL;
!
! erase_menu_context( & (list->subpage) );
! }
!
! list->prev = NULL;
! list->next = NULL;
! list->magic = 0; /* Invalidate */
! free(list);
! }
!
! (*ptr)->subpages = NULL;
! }
!
! if (default_context == (*ptr)) {
default_context = (*ptr)->prev_menu;

+ DPRINT(Debug,9, (&Debug,
+ "erase_menu_context: default context to %p\n",
+ default_context));
+
+ }
+
if (!default_context)
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"no default content",0);
+
+ Syncronize(default_context);

if ((*ptr)->next_menu)
(*ptr)->next_menu->prev_menu = (*ptr)->prev_menu;
if ((*ptr)->prev_menu)
(*ptr)->prev_menu->next_menu = (*ptr)->next_menu;

+ (*ptr)->routine->wra_free(*ptr);
+
+ if ((*ptr)->u.dummy) {
+ DPRINT(Debug,1, (&Debug,
+ "erase_menu_context: Data not free'ed\n"));
+ }
+
+
(*ptr)->magic = 0; /* Invalidate */
free(*ptr);
*ptr = NULL;
}

+ void attach_subpage(parent,subpage, first_line, last_line)
+ struct menu_context *parent;
+ struct menu_context *subpage;
+ /* absolute screen cordinates */
+ int first_line, last_line;
+ {
+ struct menu_subpages * X;
+
+ if (MENU_CONTEXT_magic != parent->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"attach_subpage",
+ "Bad parent type magic number",0);
+
+ if (MENU_CONTEXT_magic != subpage->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"attach_subpage",
+ "Bad subpage type magic number",0);
+
+ X = safe_malloc(sizeof (*X));
+
+ /* bzero is defined hdrs/defs.h */
+ bzero((void *)X,sizeof (*X));
+
+ X->magic = MENU_CONTAINER_magic;
+ X->location.first_line = first_line;
+ X->location.last_line = last_line;
+ X->location.gone_out = 0;
+
+ subpage->lines = last_line - first_line + 1;
+ subpage->columns = parent->columns;
+ subpage->redraw = 1;
+ subpage->container = X;
+
+ X->subpage = subpage;
+ X->parent = parent;
+ X->next = parent->subpages;
+ X->prev = NULL;
+ if (parent->subpages) {
+ if (parent->subpages->prev)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"attach_subpage",
+ "parentäs subpage list do not point to first item",0);
+
+ parent->subpages->prev = X;
+ }
+ parent->subpages = X;
+
+ }
+
+
+ extern void detach_subpage(subpage)
+ struct menu_context *subpage;
+ {
+ if (MENU_CONTEXT_magic != subpage->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad subpage type magic number",0);
+
+ if (MENU_CONTAINER_magic != subpage->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad container type magic number",0);
+
+ if (MENU_CONTEXT_magic != subpage->container->parent->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad parent type magic number",0);
+ if (subpage->container->subpage != subpage)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad subpage of container",0);
+
+
+ /* Remove from list */
+ if (subpage->container->prev) {
+ if (subpage->container != subpage->container->prev->next)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad prev of container",0);
+
+ subpage->container->prev->next = subpage->container->next;
+ } else {
+ if (subpage->container != subpage->container->parent->subpages)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad subpages of parent",0);
+
+ subpage->container->parent->subpages = subpage->container->next;
+ }
+
+ if (subpage->container->next) {
+ if (subpage->container != subpage->container->next->prev)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad next of container",0);
+
+ subpage->container->next->prev = subpage->container->prev;
+ }
+
+ subpage->container->subpage = NULL;
+ subpage->container->magic = 0; /* Invalidate */
+ free(subpage->container);
+ subpage->container = NULL;
+ }
+
+ static struct menu_context * get_root_menu P_((struct menu_context *ptr,
+ int *pending_redraw));
+ static struct menu_context * get_root_menu(ptr,pending_redraw)
+ struct menu_context *ptr;
+ int *pending_redraw;
+ {
+ struct menu_context *pptr = ptr;
+
+ while (pptr->container) {
+ if (MENU_CONTAINER_magic != pptr->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"get_root_menu",
+ "Bad subpage container type magic number",0);
+
+ pptr = pptr->container->parent;
+
+ if (pptr->redraw)
+ (*pending_redraw) ++;
+
+ if (pptr->magic != MENU_CONTEXT_magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"get_root_menu",
+ "Bad parent type magic number",0);
+ }
+
+ if (pptr != default_context) {
+ DPRINT(Debug,7, (&Debug,
+ "get_root_menu(%p): root %p is not default context %p\n",
+ ptr,pptr,default_context));
+ }
+
+ return pptr;
+ }
+
+
int menu_resized(ptr)
struct menu_context *ptr;
{
***************
*** 110,120 ****

check_changes();

if (ptr->changed) {

! ptr->lines = ROOT_MENU.lines;
! ptr->columns = ROOT_MENU.columns;
! ptr->changed = ROOT_MENU.changed; /* ? ? ? ? */

return 1;
}
--- 356,389 ----

check_changes();

+
if (ptr->changed) {
+ struct menu_subpages *list, *next = NULL;
+
+ if (MENU_DRAW_magic != ptr->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_resized",
+ "Bad routine magic number",0);
+
+
+ ptr->routine->wra_resized(ptr);

! /* Turn changed flag for subpages ... */
!
! for (list = ptr->subpages; list; list = list->next) {
! if (MENU_CONTAINER_magic != list->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_resized",
! "Bad subpage container type magic number",0);
! if (list->parent != ptr)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_resized",
! "Bad parent pointer on subpage",0);
!
! if (list->subpage) {
! if (MENU_CONTEXT_magic != list->subpage->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_resized",
! "Bad subpage type magic number",0);
! list->subpage->changed = 1;
! }
! }

return 1;
}
***************
*** 122,128 ****
return 0;
}

! extern void menu_get_sizes(ptr,lines,columns)
struct menu_context *ptr;
int *lines;
int *columns;
--- 391,397 ----
return 0;
}

! void menu_get_sizes(ptr,lines,columns)
struct menu_context *ptr;
int *lines;
int *columns;
***************
*** 135,175 ****
*columns = ptr->columns;
}

int menu_need_redraw(ptr)
struct menu_context *ptr;
{
if (ptr->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",
"Bad type magic number",0);

check_changes();

if (ptr->redraw) {

/* Reset ptr->redraw .... */

- ptr->redraw = ROOT_MENU.redraw; /* ? ? ? ? */

! DPRINT(Debug,7, (&Debug,
! "menu_need_redraw(%p): returning redraw\n",
! ptr));

! return 1;
}

return 0;
}

void menu_trigger_redraw(ptr)
struct menu_context *ptr;
{
if (ptr->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"menu_trigger_redraw",
"Bad type magic number",0);
DPRINT(Debug,7, (&Debug,
"menu_trigger_redraw(%p): triggering redraw\n",
ptr));
! ptr->redraw = 1;
}


--- 404,587 ----
*columns = ptr->columns;
}

+
int menu_need_redraw(ptr)
struct menu_context *ptr;
{
+ struct menu_context *pptr;
+ int pending_redraw = 0;
+
if (ptr->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",
"Bad type magic number",0);

check_changes();

+ /* Check parents */
+ pptr = get_root_menu(ptr,&pending_redraw);
+
+ if (pending_redraw) {
+ DPRINT(Debug,7, (&Debug,
+ "menu_need_redraw(%p): pending redraw on parent\n",
+ ptr));
+ ptr->redraw = 1;
+ }
+
+ if (pptr->routine != &CURSES_ROUTINES) {
+ DPRINT(Debug,1, (&Debug,
+ "menu_need_redraw(%p): ERROR -- parent %p not main manu (not connected) -- quiting%s\n",
+ ptr,pptr,
+ ptr->redraw ? " (returning redraw)": ""));
+
+ return ptr->redraw;
+ }
+
+ if (pptr != default_context) {
+ DPRINT(Debug,9, (&Debug,
+ "menu_need_redraw: default context to %p (redraw needed)\n",
+ pptr));
+ default_context = pptr;
+ Syncronize(default_context);
+ pptr->redraw = 1;
+ ptr->redraw = 1;
+ }
+
if (ptr->redraw) {
+ struct menu_subpages *list;
+ int r;
+
+ if (MENU_DRAW_magic != ptr->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",
+ "Bad routine magic number",0);
+

/* Reset ptr->redraw .... */
+ ptr->routine->wra_reset_redraw(ptr);


! /* Turn redraw flag for subpages ... */

! for (list = ptr->subpages; list; list = list->next) {
! if (MENU_CONTAINER_magic != list->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",
! "Bad subpage container type magic number",0);
! if (list->parent != ptr)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",
! "Bad parent pointer on subpage",0);
!
! if (list->subpage)
! menu_trigger_redraw(list->subpage);
! }
!
!
! r = ptr->routine->wra_do_redraw(ptr);
!
! if (r) {
! DPRINT(Debug,7, (&Debug,
! "menu_need_redraw(%p): redraw done\n", ptr));
! } else {
! DPRINT(Debug,7, (&Debug,
! "menu_need_redraw(%p): returning redraw\n",
! ptr));
! return 1;
! }
}

return 0;


}

+ /* Call refresh routines of children */

+ void menu_redraw_children(ptr)
+ struct menu_context *ptr;
+ {
+ struct menu_subpages *list;
+
+ if (ptr->magic != MENU_CONTEXT_magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",
+ "Bad type magic number",0);
+
+ for (list = ptr->subpages; list; list = list->next) {
+ if (MENU_CONTAINER_magic != list->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",
+ "Bad subpage container type magic number",0);
+
+ if (list->parent != ptr)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",
+ "Bad parent pointer on subpage",0);
+
+ if (list->subpage) {
+ struct menu_context *ptr1 = list->subpage;
+ int r;
+
+ if (ptr1->magic != MENU_CONTEXT_magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",
+ "Bad type magic number",0);
+
+
+ if (MENU_DRAW_magic != ptr1->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",
+ "Bad routine magic number",0);
+
+ r = ptr1->routine->wra_do_redraw(ptr1);
+
+ if (r) {
+ DPRINT(Debug,7, (&Debug,
+ "menu_redraw_children(%p): %p: redraw done\n",
+ ptr,ptr1));
+ } else
+ ptr1->redraw = 1;
+ }
+ }
+ }
+
+
void menu_trigger_redraw(ptr)
struct menu_context *ptr;
{
+ struct menu_context *pptr;
+ int pending_redraw = 0;
+ int r;
+
if (ptr->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"menu_trigger_redraw",
"Bad type magic number",0);
DPRINT(Debug,7, (&Debug,
"menu_trigger_redraw(%p): triggering redraw\n",
ptr));
!
! if (MENU_DRAW_magic != ptr->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_trigger_redraw",
! "Bad routine magic number",0);
!
! /* Check parents */
!
! pptr = get_root_menu(ptr,&pending_redraw);
!
! if (pptr == default_context) {
! /* Is active */
!
! if (pending_redraw) {
! DPRINT(Debug,7, (&Debug,
! "menu_trigger_redraw(%p): pending redraw on parent\n",
! ptr));
! ptr->redraw = 1;
! } else {
!
! r = ptr->routine->wra_do_redraw(ptr);
!
! if (r) {
! DPRINT(Debug,7, (&Debug,
! "menu_trigger_redraw(%p): redraw done\n",
! ptr));
! } else
! ptr->redraw = 1;
! }
! } else {
! DPRINT(Debug,7, (&Debug,
! "menu_trigger_redraw(%p): parent %p not active\n",
! ptr,pptr));
! ptr->redraw = 1;
! }
}


Index: elm2.4.ME+.122-cvs/src/screen/curses.c
*** elm2.4.ME+.121/src/screen/curses.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/screen/curses.c 2005-07-06 20:54:14.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curses.c,v 1.11 2004/07/13 14:36:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curses.c,v 1.19 2005/07/06 17:54:14 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 25,30 ****
--- 25,36 ----
#include <term.h> /* Defination for tgetent.h and so on ... */
#endif /* I_TERM */

+ #if !defined(I_CURSES) && !defined(I_TERM)
+ char *tgetstr();
+ int tgetent(); /* get termcap entry */
+ char *tgoto();
+ #endif
+
#undef lines /* ... But undefine lines macro */
#undef columns /* ... But undefine columns macro */

***************
*** 150,157 ****
-2..-n No termcap for this terminal type known
*/

! int tgetent(), /* get termcap entry */
! err;
char *termenv;
int fd;

--- 156,163 ----
-2..-n No termcap for this terminal type known
*/

!
! int err;
char *termenv;
int fd;

***************
*** 307,319 ****
*columns = _columns;
}

! void cur_GetXYLocation(x,y)
! int *x,*y;
{
/* return the current cursor location on the screen */

! *x = _line;
! *y = _col;
}

static int need_moveabsolute = 0;
--- 313,325 ----
*columns = _columns;
}

! void cur_GetXYLocation(row,col)
! int *row,*col;
{
/* return the current cursor location on the screen */

! *row = _line;
! *col = _col;
}

static int need_moveabsolute = 0;
***************
*** 325,352 ****
_col = 0;
}

! int cur_ClearScreen(mc)
! struct menu_context *mc;
{
! /* clear the screen: returns -1 if not capable */

! _line = 0; /* clear leaves us at top... */
! _col = 0;

! mc->redraw = 0;
! _intransmit = -1; /* Re-set state */

! if (!_clearscreen)
! return(-1);

! tputs(_clearscreen, 1, outchar);
! FlushBuffer(); /* clear the output buffer */
! return(0);
}

static void moveabsolute P_((int col, int row));

! void cur_CursorUp(n)
int n;
{
/** move the cursor up 'n' lines **/
--- 331,366 ----
_col = 0;
}

! void cur_ClearScreen()
{
! /* clear the screen: returns -1 if not capable */
!
! _line = 0; /* clear leaves us at top... */
! _col = 0;

! if (default_context->redraw) {
! SIGDPRINT(Debug,7,(&Debug,
! "cur_ClearScreen: clearing redraw context from default context\n"));
! default_context->redraw = 0;
! }
! _intransmit = -1; /* Re-set state */

! if (!_clearscreen) {
! SIGDPRINT(Debug,4,(&Debug, "cur_ClearScreen: NO _clearscreen set!!\n"));

! return;
! }

! tputs(_clearscreen, 1, outchar);
! FlushBuffer(); /* clear the output buffer */
!
! return;
}

static void moveabsolute P_((int col, int row));

! static void cur_CursorUp P_((int n));
! static void cur_CursorUp(n)
int n;
{
/** move the cursor up 'n' lines **/
***************
*** 358,364 ****
_line = (_line-n > 0? _line - n: 0); /* up 'n' lines... */

if (n > 1 && _up_many) {
! char *stuff, *tgoto();

stuff = tgoto(_up_many,0,n);
tputs(stuff, 1, outchar);
--- 372,378 ----
_line = (_line-n > 0? _line - n: 0); /* up 'n' lines... */

if (n > 1 && _up_many) {
! char *stuff;

stuff = tgoto(_up_many,0,n);
tputs(stuff, 1, outchar);
***************
*** 368,386 ****

}

! void cur_CursorDown(n)
int n;
{
/** move the cursor down 'n' lines **/
/** Caller must check that _down is not null before calling **/

if (need_moveabsolute)
! moveabsolute(_col, _line);;

_line = (_line+n < _lines? _line + n: _lines-1); /* down 'n' lines... */

if (n > 1 && _down_many) {
! char *stuff, *tgoto();

stuff = tgoto(_down_many,0,n);
tputs(stuff, 1, outchar);
--- 382,401 ----

}

! static void cur_CursorDown P_((int n));
! static void cur_CursorDown(n)
int n;
{
/** move the cursor down 'n' lines **/
/** Caller must check that _down is not null before calling **/

if (need_moveabsolute)
! moveabsolute(_col, _line);

_line = (_line+n < _lines? _line + n: _lines-1); /* down 'n' lines... */

if (n > 1 && _down_many) {
! char *stuff;

stuff = tgoto(_down_many,0,n);
tputs(stuff, 1, outchar);
***************
*** 390,396 ****
}


! void cur_CursorLeft(n)
int n;
{
/** move the cursor 'n' characters to the left **/
--- 405,412 ----
}


! static void cur_CursorLeft P_((int n));
! static void cur_CursorLeft(n)
int n;
{
/** move the cursor 'n' characters to the left **/
***************
*** 402,408 ****
_col = (_col - n> 0? _col - n: 0); /* left 'n' chars... */

if (n > 1 && _left_many) {
! char *stuff, *tgoto();

stuff = tgoto(_left_many,0,n);
tputs(stuff, 1, outchar);
--- 418,424 ----
_col = (_col - n> 0? _col - n: 0); /* left 'n' chars... */

if (n > 1 && _left_many) {
! char *stuff;

stuff = tgoto(_left_many,0,n);
tputs(stuff, 1, outchar);
***************
*** 412,418 ****

}

! static int cur_CursorRight(n)
int n;
{
/** move the cursor 'n' characters to the right (nondestructive) **/
--- 428,435 ----

}

! static void cur_CursorRight P_((int n));
! static void cur_CursorRight(n)
int n;
{
/** move the cursor 'n' characters to the right (nondestructive) **/
***************
*** 427,433 ****
/* right 'n' chars... */

if (n > 1 && _right_many) {
! char *stuff, *tgoto();

stuff = tgoto(_right_many,0,n);
tputs(stuff, 1, outchar);
--- 444,450 ----
/* right 'n' chars... */

if (n > 1 && _right_many) {
! char *stuff;

stuff = tgoto(_right_many,0,n);
tputs(stuff, 1, outchar);
***************
*** 435,448 ****
} else while (n-- > 0)
tputs(_right, 1, outchar);

- return(0);
}

static void moveabsolute(col, row)
int col, row;
{

! char *stuff, *tgoto();

if (need_moveabsolute) {
SIGDPRINT(Debug,4,(&Debug,
--- 452,464 ----
} else while (n-- > 0)
tputs(_right, 1, outchar);

}

static void moveabsolute(col, row)
int col, row;
{

! char *stuff;

if (need_moveabsolute) {
SIGDPRINT(Debug,4,(&Debug,
***************
*** 459,477 ****
need_moveabsolute = 0;
}

! int cur_MoveCursor(row, col)
int row, col;
{
/** move cursor to the specified row column on the screen.
0,0 is the top left! **/

int scrollafter = 0;
!
/* we don't want to change "rows" or we'll mangle scrolling... */

if (need_moveabsolute)
moveabsolute(_col, _line);;

if (col < 0)
col = 0;
if (col >= _columns)
--- 475,536 ----
need_moveabsolute = 0;
}

! static int in_area P_((int line, struct cur_printarea *lim));
! static int in_area(line,lim)
! int line;
! struct cur_printarea *lim;
! {
! int r = line >= lim->first_line && line <= lim->last_line;
!
! if (line >= _lines) {
! DPRINT(Debug,4, (&Debug, "in_area: Not in screen (line=%d)\n",line));
! r = 0;
! }
!
! DPRINT(Debug,12, (&Debug,
! "in_area(line=%d,lim=%p)=%d: first_line=%d last_line=%d\n",
! line,lim,r,lim->first_line,lim->last_line));
!
! return r;
! }
!
! void cur_MoveCursor(row, col, lim)
int row, col;
+ struct cur_printarea *lim;
+
{
/** move cursor to the specified row column on the screen.
0,0 is the top left! **/

int scrollafter = 0;
!
/* we don't want to change "rows" or we'll mangle scrolling... */

if (need_moveabsolute)
moveabsolute(_col, _line);;

+ if (lim) {
+ int in = in_area(row,lim);
+
+
+ if (lim->gone_out && in) {
+ DPRINT(Debug,4,(&Debug,"cur_MoveCursor: Going to printing area, enabling printing\n"));
+ lim->gone_out = 0;
+ }
+
+ if (!in) {
+
+ if ( ! lim->gone_out) {
+ DPRINT(Debug,4,(&Debug,"cur_MoveCursor: Going out of printing area, disabling printing\n"));
+ lim->gone_out = 1;
+ }
+
+ return;


+ }
+
+ }
+
+

if (col < 0)
col = 0;
if (col >= _columns)
***************
*** 483,495 ****
scrollafter = row - _lines +1;
row = _lines -1;
}
-
- if (!_moveto)
- return(-1);

if (row == _line) {
if (col == _col)
! return(0); /* already there! */

else if (col == 0)
outchar('\r');
--- 542,557 ----
scrollafter = row - _lines +1;
row = _lines -1;
}

+ if (!_moveto) {
+ DPRINT(Debug,4,(&Debug, "curses: NO _moveto set!!\n"));
+
+ return;
+ }
+
if (row == _line) {
if (col == _col)
! return; /* already there! */

else if (col == 0)
outchar('\r');
***************
*** 529,535 ****
--- 591,606 ----
_col = col;

if (scrollafter) {
+
DPRINT(Debug,49, (&Debug, " scrollafter=%d\n",scrollafter));
+
+ if (lim) {
+ DPRINT(Debug,4,(&Debug,"cur_MoveCursor: scroling not allowed, disabling printing\n"));
+ lim->gone_out = 0;
+
+ FlushBuffer();
+ return;
+ }

outchar('\r');

***************
*** 539,545 ****
}

FlushBuffer();
- return(0);
}

void cur_changemode(mode,set,reset)
--- 610,615 ----
***************
*** 549,554 ****
--- 619,634 ----
{
int i;

+ /* To allow switching modes from 'reset' to 'set', run reset first */
+
+ for (i =0 ; i < (sizeof set_modes) / sizeof (set_modes[0]); i++) {
+ if ((reset & set_modes[i].mode) && set_modes[i].off) {
+ tputs(set_modes[i].off, 1, outchar);
+ *mode &= ~(set_modes[i].mode);
+ }
+ }
+
+
for (i =0 ; i < (sizeof set_modes) / sizeof (set_modes[0]); i++) {

if ((set & set_modes[i].mode) && set_modes[i].on) {
***************
*** 556,566 ****
*mode |= set_modes[i].mode;
}

- if ((reset & set_modes[i].mode) && set_modes[i].off) {
- tputs(set_modes[i].off, 1, outchar);
- *mode &= ~(set_modes[i].mode);
- }
-
}

}
--- 636,641 ----
***************
*** 572,592 ****

/* called with value of -1 if just preprosessing needed
(ie need_moveabsolute)
*/
! static int write_control P_((int ch));
! static int write_control(ch)
int ch;
{
int justwrapped, nt;

if (need_moveabsolute)
moveabsolute(_col, _line);

justwrapped = 0;

switch (ch) {
/* if return, just go to left column. */
case 0x0D: /* CR */
if (wrappedlastchar)
justwrapped = 1; /* preserve wrap flag */
else {
--- 647,702 ----

/* called with value of -1 if just preprosessing needed
(ie need_moveabsolute)
+
+ returns value indication is character printing needed
*/
! static int write_control P_((int ch, struct cur_printarea *lim));
! static int write_control(ch,lim)
int ch;
+ struct cur_printarea *lim;
{
+ /* Setting lim disables scrooling !!
+ */
+
int justwrapped, nt;
+ static int warn = 0;

if (need_moveabsolute)
moveabsolute(_col, _line);

justwrapped = 0;

+ /* We do nothing if cursor is not currently on area ... */
+ if (lim && !in_area(_line,lim)) {
+ if (!warn) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "write_control: Cursor not in print area (lines %d-%d): line %d\n",
+ lim->first_line,
+ lim->last_line,
+ _line));
+ }
+ warn++;


+ return 0;
+ }
+

+ if (lim && lim->gone_out) {
+ if (!warn) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "write_control: Cursor was going out of print area (lines %d-%d): line %d\n",
+ lim->first_line,
+ lim->last_line,
+ _line));
+ }
+ warn++;


+ return 0;
+ }
+

+ warn = 0;
+
switch (ch) {
/* if return, just go to left column. */
case 0x0D: /* CR */
+
if (wrappedlastchar)
justwrapped = 1; /* preserve wrap flag */
else {
***************
*** 599,604 ****
--- 709,726 ----
* do nothing, else output a newline and increment the line count */
case 0x0A: /* LF */
if (!wrappedlastchar) {
+
+ if (lim && _line == lim->last_line) {
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "write_control: going out of printing area (CR), disabling printing\n"));
+
+ /* Disable printing */
+ need_moveabsolute = 1;
+ lim->gone_out = 1;


+ return 0;
+ }
+

outchar('\n');
if (_line < _lines-1)
++_line;
***************
*** 611,617 ****
--- 733,747 ----
tputs(_left, 1, outchar);
_col--;
}
+
else if (_line > 0) {
+
+ if (lim && _line == lim->first_line) {
+
+ /* BACKSPACE does nothing */
+ break;
+ }
+
_col = _columns - 1;
_line--;
moveabsolute (_col, _line);
***************
*** 640,645 ****
--- 770,790 ----
moveabsolute (_col, _line);
break;
default: /* Is 'printable' character (or -1) */
+
+ if (lim && _col == _columns-1 && _automargin &&
+ _line == _lines-1) {
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "write_control: going out of printing area and screen, disabling printing on last column\n"));
+
+ /* Disable printing */
+ need_moveabsolute = 1;
+ lim->gone_out = 1;


+
+ return 0;
+ }
+
+

return 1;
}

***************
*** 647,655 ****
return 0; /* Need no printing */
}

! static void increment_position P_((int len));
! static void increment_position(len)
int len;
{
int justwrapped;

--- 792,801 ----
return 0; /* Need no printing */
}

! static void increment_position P_((int len,struct cur_printarea *lim));
! static void increment_position(len,lim)
int len;
+ struct cur_printarea *lim;
{
int justwrapped;

***************
*** 666,679 ****
/* if we only had one column left, simulate automargins if
* the terminal doesn't have them */
if (_col + len == _columns) {
! if (!_automargin || _eatnewlineglitch) {
! outchar('\r');
! outchar('\n');
}
- if (_line < _lines-1)
- ++_line;
- _col = 0;
- justwrapped = 1;
}
/* if we are here this means we have no interference from the
* right margin - just increment the column position. */
--- 812,841 ----
/* if we only had one column left, simulate automargins if
* the terminal doesn't have them */
if (_col + len == _columns) {
!
! if (lim && _col == _columns-1 && _line == lim->last_line) {
!
! SIGDPRINT(Debug,4,(&Debug,
! "increment_position: going out of printing area (CR), disabling printing\n"));
!
! /* Disable printing */
! need_moveabsolute = 1;
! lim->gone_out = 1;
!
! } else {
!
! if (!_automargin || _eatnewlineglitch) {
! SIGDPRINT(Debug,40,(&Debug, "increment_position: EOLN -- printing CR LF\n"));
! outchar('\r');
! outchar('\n');
! } else {
! SIGDPRINT(Debug,40,(&Debug, "increment_position: EOLN -- screen wrapping assumed\n"));
! }
! if (_line < _lines-1)
! ++_line;
! _col = 0;
! justwrapped = 1;
}
}
/* if we are here this means we have no interference from the
* right margin - just increment the column position. */
***************
*** 705,715 ****

ch &= 0xFF;

! need_print = write_control(ch);

if (need_print) {
outchar(ch);
! increment_position(1);
}
}

--- 867,877 ----

ch &= 0xFF;

! need_print = write_control(ch, NULL);

if (need_print) {
outchar(ch);
! increment_position(1, NULL);
}
}

***************
*** 719,726 ****


/* This assumes one byte charset */
! void cur_Writechar(ch)
int ch;
{
/** write a character to the current screen location. **/
int need_print = 1;
--- 881,889 ----


/* This assumes one byte charset */
! void cur_Writechar(ch, lim)
int ch;
+ struct cur_printarea *lim;
{
/** write a character to the current screen location. **/
int need_print = 1;
***************
*** 728,734 ****
ch &= 0xFF;

/* ASCII assumed */
! need_print = write_control(ch);

if (need_print) {
#ifndef ASCII_CTYPE
--- 891,897 ----
ch &= 0xFF;

/* ASCII assumed */
! need_print = write_control(ch,lim);

if (need_print) {
#ifndef ASCII_CTYPE
***************
*** 752,768 ****
free_state(&st);
}
outchar(ch);
! increment_position(1);
}
}


static int preinit_output P_((struct string *S, struct string **buffer,
! charset_t *stored_display));
! static int preinit_output(S,buffer,stored_display)
struct string *S;
struct string **buffer;
! charset_t *stored_display;
{
int sw = -1;

--- 915,931 ----
free_state(&st);
}
outchar(ch);
! increment_position(1,lim);
}
}


static int preinit_output P_((struct string *S, struct string **buffer,
! charset_t stored_display));
! static int preinit_output(S,buffer, stored_display)
struct string *S;
struct string **buffer;
! charset_t stored_display;
{
int sw = -1;

***************
*** 775,780 ****
--- 938,944 ----
switch_display_charset(0); /* Print using system charset */
} else if (allow_charset_switching &&
0 != (charset_properties(S->string_type) & CS_printable) &&
+ stored_display &&
set_display_charset(S->string_type,1)) {
sw = 2; /* Arrange return to correct display charset */
*buffer = S;
***************
*** 810,816 ****

struct string *ret1 = NULL;

! sw = preinit_output(S,&buffer,&stored_display);

DPRINT(Debug,35,(&Debug,
"curses_printable_clip: S=%S cs=%s -- using %s\n",
--- 974,980 ----

struct string *ret1 = NULL;

! sw = preinit_output(S,&buffer, stored_display);

DPRINT(Debug,35,(&Debug,
"curses_printable_clip: S=%S cs=%s -- using %s\n",
***************
*** 868,875 ****
return ret1;
}

! void cur_PutLineS(S)
struct string *S;
{
int idx = 0;


struct string *buffer = NULL;

--- 1032,1040 ----
return ret1;
}

! void cur_PutLineS(S, lim)
struct string *S;
+ struct cur_printarea *lim;
{
int idx = 0;


struct string *buffer = NULL;

***************
*** 880,886 ****



! sw = preinit_output(S,&buffer,&stored_display);

buffer_len = string_len(buffer);

--- 1045,1051 ----



! sw = preinit_output(S,&buffer, stored_display);

buffer_len = string_len(buffer);

***************
*** 907,916 ****

/* ASCII assumed */
if (ch <= 31)
! need_print = write_control(ch);
else
! need_print = write_control(-1); /* HACK for position of cursor */
if (!need_print) {
DPRINT(Debug,40,(&Debug,
"PutLineS: [%d] unicode=%d (control)\n",
idx,ch));
--- 1072,1089 ----

/* ASCII assumed */
if (ch <= 31)
! need_print = write_control(ch, lim);
else
! need_print = write_control(-1, lim); /* HACK for position of cursor */
if (!need_print) {
+
+ if (lim && !in_area(_line,lim)) {
+ DPRINT(Debug,40,(&Debug,
+ "PutLineS: [%d] not in area ... \n",
+ idx));
+ break;
+ }
+
DPRINT(Debug,40,(&Debug,
"PutLineS: [%d] unicode=%d (control)\n",
idx,ch));
***************
*** 964,978 ****
}

if (printable_len)
! increment_position(printable_len->ret_len);
else
! increment_position(idx-old_idx);

if (idx == old_idx) {
DPRINT(Debug,10,(&Debug,"No any characters printed...\n"));
CleartoEOLN();
! cur_Writechar('\r');
! cur_Writechar('\n');
}

free(s);
--- 1137,1151 ----
}

if (printable_len)
! increment_position(printable_len->ret_len, lim);
else
! increment_position(idx-old_idx, lim);

if (idx == old_idx) {
DPRINT(Debug,10,(&Debug,"No any characters printed...\n"));
CleartoEOLN();
! cur_Writechar('\r',lim);
! cur_Writechar('\n',lim);
}

free(s);
***************
*** 989,1000 ****

void cur_Write_to_screen (
#if ANSI_C


CONST char *format, CONST char *msg, ...

#else
! format, msg, va_alist
#endif
)
#if !ANSI_C


CONST char *format;
CONST char *msg;

va_dcl
--- 1162,1175 ----

void cur_Write_to_screen (
#if ANSI_C
+ struct cur_printarea *lim,


CONST char *format, CONST char *msg, ...

#else
! lim, format, msg, va_alist
#endif
)
#if !ANSI_C
+ struct cur_printarea *lim;


CONST char *format;
CONST char *msg;

va_dcl
***************
*** 1010,1043 ****
looking for "\n" sequences... **/

text = elm_smessage(0,format,msg,vl);
! cur_PutLineS(text);
free_string(&text);

va_end(vl);

}

! void cur_PutLine0(x, y, line)
! int x,y;
CONST char *line;
{
/** Write a zero argument line at location x,y **/

! cur_MoveCursor(x,y);
! while(*line)
! cur_Writechar(*line++);
}

void cur_PutLineX(
! #if ANSI_C
! int x, int y, const char *format, const char *line, ...
#else
! x, y, format, line, va_alist
#endif
)
#if !ANSI_C
! int x;
! int y;
CONST char *format;
CONST char *line;
va_dcl
--- 1185,1246 ----
looking for "\n" sequences... **/

text = elm_smessage(0,format,msg,vl);
! cur_PutLineS(text, lim);
free_string(&text);

va_end(vl);

}

! void cur_PutLine0(row, col, line, lim)
! int row,col;
CONST char *line;
+ struct cur_printarea *lim;
{
/** Write a zero argument line at location x,y **/

! if (lim && ! in_area(row,lim)) {
! DPRINT(Debug,10,(&Debug,
! "cur_Putline0: (row %d,col %d) not in area row %d-%d\n",
! row,col,
! lim->first_line,
! lim->last_line));
!
! lim->gone_out = 1;
! return;
! }
! if (lim)
! lim->gone_out = 0;
!
! cur_MoveCursor(row,col, lim);
! while(*line) {
! cur_Writechar(*line++, lim);
!
! if (lim && !in_area(_line,lim)) {
! DPRINT(Debug,40,(&Debug,
! "cur_Putline0: not in area ... \n"));


! break;
! }
!
!

! }
}

+
+
void cur_PutLineX(
! #if ANSI_C
! int row, int col,
! struct cur_printarea *lim,
! const char *format, const char *line, ...
#else
! row, col, lim, format, line, va_alist
#endif
)
#if !ANSI_C
! int row;
! int col;
! struct cur_printarea *lim;
CONST char *format;
CONST char *line;
va_dcl
***************
*** 1046,1092 ****
va_list vl;
struct string *text;

Va_start(vl, line); /* defined in defs.h */

! cur_MoveCursor(x,y);

text = elm_smessage(0,format,line,vl);
! cur_PutLineS(text);
free_string(&text);

va_end(vl);

}

! int cur_CleartoEOLN()
{
/** clear to end of line **/

if (need_moveabsolute)
moveabsolute(_col, _line);

! if (!_cleartoeoln)
! return(-1);

tputs(_cleartoeoln, 1, outchar);

! return(0);
}


! int cur_CleartoEOS()
{
/** clear to end of screen **/

if (need_moveabsolute)
moveabsolute(_col, _line);

! if (!_cleartoeos)
! return(-1);

tputs(_cleartoeos, 1, outchar);

! return(0);
}

static int _inraw = 0; /* are we IN rawmode? */
--- 1249,1316 ----
va_list vl;
struct string *text;

+ if (lim && ! in_area(row,lim)) {
+ DPRINT(Debug,10,(&Debug,
+ "cur_PutlineX: (row %d,col %d) not in area row %d-%d\n",
+ row,col,
+ lim->first_line,
+ lim->last_line));
+
+ lim->gone_out = 1;
+ return;
+ }
+ if (lim)
+ lim->gone_out = 0;
+
+
Va_start(vl, line); /* defined in defs.h */

! cur_MoveCursor(row,col, lim);

text = elm_smessage(0,format,line,vl);
! cur_PutLineS(text,lim);
free_string(&text);

va_end(vl);

}

! void cur_CleartoEOLN()
{
/** clear to end of line **/

if (need_moveabsolute)
moveabsolute(_col, _line);

! if (!_cleartoeoln) {
! SIGDPRINT(Debug,4,(&Debug, "curses: NO _cleartoeoln set!!\n"));
!
! return;
! }
!

tputs(_cleartoeoln, 1, outchar);

! return;
}


! void cur_CleartoEOS()
{
/** clear to end of screen **/

if (need_moveabsolute)
moveabsolute(_col, _line);

! if (!_cleartoeos) {
! SIGDPRINT(Debug,4,(&Debug, "curses: NO _cleartoeos set!!\n"));
!
! return;
! }

tputs(_cleartoeos, 1, outchar);

! return;
}

static int _inraw = 0; /* are we IN rawmode? */
Index: elm2.4.ME+.122-cvs/src/screen/curs_input.c
*** elm2.4.ME+.121/src/screen/curs_input.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/screen/curs_input.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.11 2004/07/14 11:21:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.15 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 118,132 ****
#endif


! int cur_ReadCh(flags,break_flag,mc)
int flags;
int break_flag;
- struct menu_context *mc;
{
int ret = 0;

do {
! struct charset_state *ch = cur_ReadCh2(flags,break_flag, mc);

if (!ch) {
ret = EOF;
--- 118,131 ----
#endif


! int cur_ReadCh(flags,break_flag)
int flags;
int break_flag;
{
int ret = 0;

do {
! struct charset_state *ch = cur_ReadCh2(flags,break_flag);

if (!ch) {
ret = EOF;
***************
*** 157,167 ****
#include <termios.h>
#endif

! struct charset_state * cur_ReadCh2(flags,break_flag,
! mc)
int flags;
int break_flag;
- struct menu_context *mc;
{
int redraw = (flags & READCH_MASK);
int cursorkeys = (flags & READCH_CURSOR) != 0;
--- 156,191 ----
#include <termios.h>
#endif

! struct charset_state * last_state = NULL;
!
! void set_last_state(cs)
! charset_t cs;
! {
! if (last_state && last_state->charset != cs) {
! DPRINT(Debug,4,(&Debug,
! "Keyboard input charset is changed -- was %s\n",
! last_state->charset->MIME_name ?
! last_state->charset->MIME_name :
! "<no MIME name>"));
! free_state(&last_state);
! }
!
! if (!last_state) {
! last_state = new_state(cs);
! DPRINT(Debug,4,(&Debug,
! "Keyboard input charset is %s\n",
! last_state->charset->MIME_name ?
! last_state->charset->MIME_name :
! "<no MIME name>"));


! }
!
!
! }
!

!
! struct charset_state * cur_ReadCh2(flags,break_flag)
int flags;
int break_flag;
{
int redraw = (flags & READCH_MASK);
int cursorkeys = (flags & READCH_CURSOR) != 0;
***************
*** 210,215 ****
--- 234,253 ----
bzero((void *)&T,sizeof T);
#endif

+ DPRINT(Debug,4,(&Debug,
+ "cur_ReadCH2: flags=%d %s%s%s%s%s%s%s %s\n",
+ flags,
+ redraw ? " redraw" : "",
+ cursorkeys ? " cursorkeys" : "",
+ nocursor ? " nocurosr" : "",
+ term_char ? " term_char" : "",
+ resize_flag ? " resize_flag" : "",
+ sig_char ? " sig_char" : "",
+ quote_char ? " quote_char" : "",
+
+ break_flag ? "break_flag" : ""));
+
+
#if POLL_METHOD
change_action(terminal_fd,0,background_read,no_action_routine,
no_action_routine,
***************
*** 220,233 ****
DPRINT(Debug,4,(&Debug,"cur_ReadCH2: line=%d col=%d\n",
line,col));

! if (!last_state) {
! last_state = new_state(system_charset);
! DPRINT(Debug,4,(&Debug,
! "Keyboard input charset is %s\n",
! last_state->charset->MIME_name ?
! last_state->charset->MIME_name :
! "<no MIME name>"));
! }

if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
--- 258,264 ----
DPRINT(Debug,4,(&Debug,"cur_ReadCH2: line=%d col=%d\n",
line,col));

! set_last_state(system_charset);

if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
***************
*** 259,265 ****
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
! cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;
--- 290,296 ----
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
! cur_ClearScreen();

reset_state(last_state,1);
last_state->caller_flags = redraw;
***************
*** 270,280 ****
return last_state;
}

! cur_MoveCursor(line,col);
FlushBuffer();

check_changes();
! if (resize_flag && mc->changed) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Pending resize...\n"));
reset_state(last_state,1);
--- 301,311 ----
return last_state;
}

! cur_MoveCursor(line,col,NULL);
FlushBuffer();

check_changes();
! if (resize_flag && default_context->changed) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Pending resize...\n"));
reset_state(last_state,1);
***************
*** 286,295 ****
return last_state;
}

! if (redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Pending redraw...\n"));
! cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;
--- 317,326 ----
return last_state;
}

! if (redraw && default_context->redraw) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Pending redraw...\n"));
! cur_ClearScreen();

reset_state(last_state,1);
last_state->caller_flags = redraw;
***************
*** 300,313 ****
return last_state;
}

! if ((_intransmit != ON || mc->redraw) &&
cursorkeys && _transmit_on) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Enabling cursor keys...\n"));
transmit_functions(ON);
}

! if ((_intransmit != OFF || mc->redraw) &&
nocursor && _transmit_off) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Disabling cursor keys...\n"));
--- 331,344 ----
return last_state;
}

! if ((_intransmit != ON || default_context->redraw) &&
cursorkeys && _transmit_on) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Enabling cursor keys...\n"));
transmit_functions(ON);
}

! if ((_intransmit != OFF || default_context->redraw) &&
nocursor && _transmit_off) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Disabling cursor keys...\n"));
***************
*** 344,350 ****

check_changes();

! if (resize_flag && mc->changed) {
DPRINT(Debug,4,(&Debug,
" ... return resize to caller\n"));

--- 375,381 ----

check_changes();

! if (resize_flag && default_context->changed) {
DPRINT(Debug,4,(&Debug,
" ... return resize to caller\n"));

***************
*** 355,361 ****


/* Return error: */
! if ((redraw && mc->redraw)
|| break_flag /* GetPrompt wants to see errors! */
) {
DPRINT(Debug,4,(&Debug,
--- 386,392 ----


/* Return error: */
! if ((redraw && default_context->redraw)
|| break_flag /* GetPrompt wants to see errors! */
) {
DPRINT(Debug,4,(&Debug,
***************
*** 396,402 ****

check_changes();

! if (resize_flag && mc->changed) {
DPRINT(Debug,4,(&Debug,
" ... return resize to caller\n"));

--- 427,433 ----

check_changes();

! if (resize_flag && default_context->changed) {
DPRINT(Debug,4,(&Debug,
" ... return resize to caller\n"));

***************
*** 406,412 ****
}

/* Return error: */
! if ((redraw && mc->redraw)
|| break_flag /* GetPrompt wants to see errors! */
) {
found_key = -1;
--- 437,443 ----
}

/* Return error: */
! if ((redraw && default_context->redraw)
|| break_flag /* GetPrompt wants to see errors! */
) {
found_key = -1;
***************
*** 449,455 ****
}

/* Return error: */
! if (redraw && mc->redraw
|| break_flag /* GetPrompt wants to see errors! */
) {
found_key = -1;
--- 480,486 ----
}

/* Return error: */
! if (redraw && default_contect->redraw
|| break_flag /* GetPrompt wants to see errors! */
) {
found_key = -1;
***************
*** 527,533 ****
if (VQUIT_char == ch)
found_key = TERMCH_interrupt_char;
if (VSUSP_char == ch) {
! SIGHAND_TYPE (*sig1)(), (*sig2)();

DPRINT(Debug,1,(&Debug,
"cur_ReadCh2: Found suspend character!\n"));
--- 558,564 ----
if (VQUIT_char == ch)
found_key = TERMCH_interrupt_char;
if (VSUSP_char == ch) {
! SIGHAND_TYPE (*sig1) P_((int)), (*sig2) P_((int));

DPRINT(Debug,1,(&Debug,
"cur_ReadCh2: Found suspend character!\n"));
***************
*** 558,564 ****
if (redraw) {
DPRINT(Debug,1,(&Debug,
"cur_ReadCh2: returning redraw because of suspend\n"));
! cur_ClearScreen(mc);
found_key = redraw;
} else
goto reinit_ReadChar;
--- 589,595 ----
if (redraw) {
DPRINT(Debug,1,(&Debug,
"cur_ReadCh2: returning redraw because of suspend\n"));
! cur_ClearScreen();
found_key = redraw;
} else
goto reinit_ReadChar;
***************
*** 660,666 ****
#endif

/* Ring a bell */
! cur_Writechar('\007');
goto reinit_ReadChar;
}
} else
--- 691,697 ----
#endif

/* Ring a bell */
! cur_Writechar('\007',NULL);
goto reinit_ReadChar;
}
} else
***************
*** 670,676 ****

}

! if (found_key <= 0 && redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Redraw...\n"));
if(!cur_RawState()) { /* Check that we have in 'raw' mode */
--- 701,707 ----

}

! if (found_key <= 0 && redraw && default_context->redraw) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Redraw...\n"));
if(!cur_RawState()) { /* Check that we have in 'raw' mode */
***************
*** 678,684 ****
"cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
}
! cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;
--- 709,715 ----
"cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
}
! cur_ClearScreen();

reset_state(last_state,1);
last_state->caller_flags = redraw;
***************
*** 690,696 ****
return last_state;
}

! cur_MoveCursor(line,col);

Kari E. Hurtta

unread,
Jul 13, 2005, 5:46:01 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.7

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 7/18
=========================================================================
/* memory? */
#endif
! int user_level = 0; /* flag: how good is the user? */
int use_tite = 1; /* flag: use termcap/terminfo ti/te?*/
int utf7_encode_optional = 1; /* flag: Should utf7 optional direct
characters to be encoded? */
char v_editor[SLEN] = {0}; /* "~v" editor... */
int elm_filter = 1; /* flag: weed out header lines? */
PATH weedlist = {
--- 950,1010 ----
int sleepmsg = 2; /* time to sleep for messages being */
/* overwritten on screen */

!
! static struct sortval SRT_srtval[]={
! {"sent", SENT_DATE},
! {"thread", THREAD},
! {"received", RECEIVED_DATE},
! {"recieved", RECEIVED_DATE},
! {"rec", RECEIVED_DATE},
! {"from", SENDER},
! {"sender", SENDER},
! {"size", SIZE},
! {"lines", SIZE},
! {"subject", SUBJECT},
! {"mailbox", MAILBOX_ORDER},
! {"folder", MAILBOX_ORDER},
! {"status", STATUS},
! {NULL, 0}
! };
!
! SORT sortby = { /* how to sort incoming mail... */
! REVERSE SENT_DATE,
!
! SRT_srtval
! };
!
long elm_timeout = 600L; /* timeout (secs) on main prompt */
int sort_thread_max_time = 30; /* Number of days which can considered
be same thread */
! ESTR temp_dir_e = { /* name of temp directory */
! ESTR_slash,
! NULL,
! NULL
! };
!
#ifdef USE_PGP
int pgp_keeppass=0; /* should Elm keep the passphrase in*/
/* memory? */
#endif
!
! static char * USERLEVELS[] = { "beginner", "intermediate", "expert", NULL };
! ENUMERATE user_level = { /* flag: how good is the user? */
! 0,
! 3, &(USERLEVELS[0])
! };
!
int use_tite = 1; /* flag: use termcap/terminfo ti/te?*/
int utf7_encode_optional = 1; /* flag: Should utf7 optional direct
characters to be encoded? */
+ #ifdef I_NETDB
+ int verify_domain = 0; /* flag: Should we try check existence
+ of mail domain
+ */
+ #endif
+ int verify_local_address = 0; /* flag: Should we try check existence
+ of local user
+ */
char v_editor[SLEN] = {0}; /* "~v" editor... */
int elm_filter = 1; /* flag: weed out header lines? */
PATH weedlist = {
***************
*** 418,423 ****
--- 1014,1031 ----


#ifdef REMOTE_MBX
+ static struct sortval IMAP_srtval[]={
+ {"none", ID_NONE},
+ {"name", ID_NAME_SORT},
+ {NULL, 0}
+ };
+
+ SORT imap_dir_sortby = { /* how to sort imap folders... */
+ ID_NONE,
+ IMAP_srtval
+ };
+
+
char raw_imap_charset[SLEN] = "SYSTEM"; /* IMAP foldername charset */
int imap_fast_lookup = 0; /* flag: skip some directory listing */
int imap_max_dl_size = 4*1024; /* Maximum size of message to be
***************
*** 480,491 ****
strfcpy(dest,"none",destlen);

} else if (NULL == strpbrk(src,"/$\\;{}()")) {
! if (0 != access(map_bindir,ACCESS_EXISTS)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmNoBinMapDirX,
"%s: no map-bin-dir exist: %s: %s"),
descr,
! map_bindir,error_description(err));

/* No error counter incrementging because
map-bin-dir can be modified only on system
--- 1088,1109 ----
strfcpy(dest,"none",destlen);

} else if (NULL == strpbrk(src,"/$\\;{}()")) {


!
! /* give_dt_estr_as_str adds / to end */

! char * map_bindir_val = give_dt_estr_as_str(&map_bindir_e,
! "map-bin-dir");
!
! if (!map_bindir_val) {
! dest[0] = '\0';
! return;
! }
!
! if (0 != access(map_bindir_val,ACCESS_EXISTS)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmNoBinMapDirX,
"%s: no map-bin-dir exist: %s: %s"),
descr,
! map_bindir_val,error_description(err));

/* No error counter incrementging because
map-bin-dir can be modified only on system
***************
*** 494,500 ****
}
elm_sfprintf(dest,destlen,
FRM("%s/%s"),
! map_bindir,src);

} else
do_expand_meta(descr, dest, src, destlen);
--- 1112,1118 ----
}
elm_sfprintf(dest,destlen,
FRM("%s/%s"),
! map_bindir_val,src);

} else
do_expand_meta(descr, dest, src, destlen);
***************
*** 510,515 ****
--- 1128,1134 ----
static int locale_init_called = 0;
static int locale_error = 0;

+
void locale_init () {
#ifdef I_LOCALE
char *res;
***************
*** 717,723 ****
system_charset = d_matches[j];

DPRINT(Debug,3,(&Debug,
! "map_display_charset: using match %d: \"%s\" (codeset \"%s\") as %s\n",
j,lc_ctype,codeset,
system_charset->MIME_name ?
system_charset->MIME_name :
--- 1336,1342 ----
system_charset = d_matches[j];

DPRINT(Debug,3,(&Debug,
! "map_system_charset: using match %d: \"%s\" (codeset \"%s\") as %s\n",
j,lc_ctype,codeset,
system_charset->MIME_name ?
system_charset->MIME_name :
***************
*** 872,877 ****
--- 1491,1499 ----
}
}

+ /* shell value from passwd */
+ static char shell0[STRING] = "";
+
void user_init()
{
char *cp;
***************
*** 879,885 ****

/** initialize the whole ball of wax.
**/
! struct passwd *pass, *getpwnam();

if (!locale_init_called)
locale_init ();
--- 1501,1507 ----

/** initialize the whole ball of wax.
**/
! struct passwd *pass;

if (!locale_init_called)
locale_init ();
***************
*** 931,942 ****
"You have no password entry!"));
exit(1);
}
strfcpy(username, pass->pw_name, sizeof username);
! strfcpy(home, pass->pw_dir, sizeof home);
! strfcpy(shell, pass->pw_shell, sizeof shell);
! /* Null shell in /etc/passwd means /bin/sh */
! if ('\0' == shell[0])
! strfcpy(shell, "/bin/sh", sizeof shell);

if((cp = get_full_name(username)) != NULL)
strfcpy(full_username, cp, sizeof full_username);
--- 1553,1575 ----
"You have no password entry!"));
exit(1);
}
+
strfcpy(username, pass->pw_name, sizeof username);
!
! if (pass->pw_dir)
! strfcpy(home, pass->pw_dir, sizeof home);
! else if (NULL != (cp = getenv("USER")))
! strfcpy(home,cp,sizeof home);
! else
! strfcpy(home,"/",sizeof home);
!
! if (pass->pw_shell)
! strfcpy(shell0, pass->pw_shell, sizeof shell0);
!
! /* Null shell in /etc/passwd means /bin/sh */
! if ('\0' == shell0[0])
! strfcpy(shell0, "/bin/sh", sizeof shell0);
!

if((cp = get_full_name(username)) != NULL)
strfcpy(full_username, cp, sizeof full_username);
***************
*** 1165,1193 ****

allowed_precedences[0] = '\0';
/* no defaults for those */
-
- if (NULL != (cp = getenv("SHELL")) && '\0' != cp[0]) {
- strfcpy(raw_shell, "$SHELL", sizeof raw_shell);
- do_expand_env("shell", shell, raw_shell, sizeof(shell));
- } else {
- /* Shell is set from /etc/passwd in initialize () */
- raw_shell[0] = '\0';
- }

#ifdef USE_BUILTIN_PAGER
set_dt_estr(&pager_e, "builtin++", NULL);
#else
set_dt_estr(&pager_e,default_pager,"PAGER");
#endif

! strfcpy(raw_temp_dir, (cp = getenv("TMPDIR")) ? cp : default_temp,
! sizeof raw_temp_dir);
!
! do_expand_env("temp_dir", temp_dir, raw_temp_dir, sizeof(temp_dir));
! if (temp_dir[0] == '\0' ||
! temp_dir[strlen (temp_dir)-1] != '/')
! strfcat(temp_dir, "/", sizeof temp_dir);
!
set_dt_estr(&editor_e,default_editor,"EDITOR");

if ((cp = getenv("MAILCAPS")) == NULL) {
--- 1798,1815 ----

allowed_precedences[0] = '\0';
/* no defaults for those */

+
+ set_dt_estr(&shell_e,shell0,"SHELL");
+ /* Shell is set from /etc/passwd in user_init () */
+
#ifdef USE_BUILTIN_PAGER
set_dt_estr(&pager_e, "builtin++", NULL);
#else
set_dt_estr(&pager_e,default_pager,"PAGER");
#endif

! set_dt_estr(&temp_dir_e,default_temp,"TMPDIR");
set_dt_estr(&editor_e,default_editor,"EDITOR");

if ((cp = getenv("MAILCAPS")) == NULL) {
***************
*** 1250,1264 ****
internal_mailcaps.unexpanded = safe_strdup("$MAILCAPS");
}

! elm_sfprintf(raw_folders, sizeof raw_folders, FRM("~/%s"),
! default_folders);
! do_expand_env("folders", folders, raw_folders, sizeof(folders));
!
! do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
! sizeof(map_txtdir));
!
! do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
! sizeof(map_bindir));

calendar_file_e.unexpanded =
elm_message(FRM("~/%s"), dflt_calendar_file);
--- 1872,1880 ----
internal_mailcaps.unexpanded = safe_strdup("$MAILCAPS");
}

! folders_e.unexpanded = elm_message(FRM("~/%s"), default_folders);
! map_txtdir_e.unexpanded = safe_strdup("{lib}/elm.map.txt");
! map_bindir_e.unexpanded = safe_strdup("{lib}/elm.map.bin");

calendar_file_e.unexpanded =
elm_message(FRM("~/%s"), dflt_calendar_file);
***************
*** 1268,1278 ****
strfcpy(e_editor, emacs_editor, sizeof e_editor);
strfcpy(v_editor, default_editor, sizeof v_editor);

! elm_sfprintf(raw_folders, sizeof raw_folders,
! FRM("%s/%s"), home, default_folders);
! strfcpy(folders, raw_folders, sizeof folders);
!
!
/* try system-wide rc file */
file = fopen(system_rc_file, "r");
if ( file != NULL ) {
--- 1884,1890 ----
strfcpy(e_editor, emacs_editor, sizeof e_editor);
strfcpy(v_editor, default_editor, sizeof v_editor);

!
/* try system-wide rc file */
file = fopen(system_rc_file, "r");
if ( file != NULL ) {
***************
*** 1323,1336 ****
generate_hostfullname();
}

- /* load_locale_map may refer to map-text-dir ... */
- do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
- sizeof(map_txtdir));
-
- /* Also map-bin-dir used by expand_map_bin() ... */
- do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
- sizeof(map_bindir));
-
/* Also bindata ... notice temorary variable */
expand_map_bin("bindata", bindata_path_global, raw_bindata_path,
sizeof(bindata_path));
--- 1935,1940 ----
***************
*** 1343,1350 ****
parse_service_entries(system_mail_services,1 /* SYSTEM */,&errors);
#endif

- init_default_mailer();
-
DPRINT(Debug,3,(&Debug,
"init_defaults=%d (errors)\n",errors));

--- 1947,1952 ----
***************
*** 1470,1482 ****
}
}

- /* load_locale_map may refer to map-text-dir ... */
- do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
- sizeof(map_txtdir));
-
- /* Also map-bin-dir used by expand_map_bin() ... */
- do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
- sizeof(map_bindir));

/* Also bindata ... */
expand_map_bin("bindata", bindata_path, raw_bindata_path,
--- 2072,2077 ----
***************
*** 1498,1519 ****
return errors;
}

! void post_init_check(int flag) {

struct stat st_buffer;
char *t;

- do_expand_env("folders", folders, raw_folders, sizeof(folders));
-
do_expand_env("extra-mailbox-dir", extra_mailbox_dir,
raw_extra_mailbox_dir, sizeof(extra_mailbox_dir));

! if (raw_extra_mailbox_dir[0] &&
! 0 == strcmp(extra_mailbox_dir,folders)) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmExtraNoFolders,
"\"extra-mailbox-dir\" should not be \"folders\" or \"maildir\" directory."));
raw_extra_mailbox_dir[0] = '\0';
}

t = give_dt_estr_as_str(&dead_letter_dir_e,"dead-letter-dir");
--- 2093,2119 ----
return errors;
}

! void post_init_check(flag)
! int flag;
! {

struct stat st_buffer;
char *t;

do_expand_env("extra-mailbox-dir", extra_mailbox_dir,
raw_extra_mailbox_dir, sizeof(extra_mailbox_dir));
+
+ t = give_dt_estr_as_str(&folders_e,"maildir");

! if (raw_extra_mailbox_dir[0] &&
! t &&
! 0 == strcmp(extra_mailbox_dir,t)) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmExtraNoFolders,
"\"extra-mailbox-dir\" should not be \"folders\" or \"maildir\" directory."));
raw_extra_mailbox_dir[0] = '\0';
+
+ mark_local_changed(& raw_extra_mailbox_dir);
}

t = give_dt_estr_as_str(&dead_letter_dir_e,"dead-letter-dir");
***************
*** 1533,1538 ****
--- 2133,2140 ----

free(dead_letter_dir_e.unexpanded);
dead_letter_dir_e.unexpanded = NULL;
+
+ mark_local_changed(& dead_letter_dir_e);
}

if (!raw_attachment_dir[0]) {
***************
*** 1548,1565 ****
} else
do_expand_env("attachment-dir", attachment_dir,
raw_attachment_dir, sizeof(attachment_dir));
!
! do_expand_env("temp_dir", temp_dir, raw_temp_dir, sizeof(temp_dir));
! if ('\0' == temp_dir[0])
! strfcpy(temp_dir,"/tmp/", sizeof temp_dir);
! else if (temp_dir[strlen (temp_dir)-1] != '/')
! strfcat(temp_dir, "/", sizeof temp_dir);
!
! if (raw_shell[0] != '\0') {
! /* shell is taken from /etc/passwd in initialize() */
! do_expand_env("shell", shell, raw_shell, sizeof(shell));
! }
!
if (strcmp(raw_printout,"none") == 0 ||
raw_printout[0] == '\0') {
strfcpy(raw_printout,"none", sizeof raw_printout);
--- 2150,2156 ----
} else
do_expand_env("attachment-dir", attachment_dir,
raw_attachment_dir, sizeof(attachment_dir));
!
if (strcmp(raw_printout,"none") == 0 ||
raw_printout[0] == '\0') {
strfcpy(raw_printout,"none", sizeof raw_printout);
***************
*** 1582,1587 ****
--- 2173,2180 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReadDataIncrement,
"Warning: readdatapercentinc is set to less than 1. Ignored."));
readdatapercentinc = 1;
+
+ mark_local_changed(& readdatapercentinc);
}

if (readmsginc < 1) {
***************
*** 1589,1594 ****
--- 2182,2189 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReadMessageIncrement,
"Warning: readmsginc is set to less than 1. Ignored."));
readmsginc = 1;
+
+ mark_local_changed(& readmsginc);
}

if (sleepmsg < 0) {
***************
*** 1596,1601 ****
--- 2191,2198 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSleepMessageInvalid,
"Warning: sleepmsg is set to less than 0. Setting to 0."));
sleepmsg = 0;
+
+ mark_local_changed(& sleepmsg);
}

#ifdef BACKGROUD_PROCESSES
***************
*** 1604,1609 ****
--- 2201,2208 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBackgroundLLT,
"Warning: background_wait_time is set less than 0. Setting to 0."));
background_wait_time = 0;
+
+ mark_local_changed(& background_wait_time);
}
#endif

***************
*** 1630,1664 ****

map_system_charset(display_locale,display_codeset);

/* Current display charset is locale charset */
display_charset = system_charset;

if (!special_charset_keyword(raw_text_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_text_charset,
! sizeof buffer))
do_expand_env("text-charset", buffer,
raw_text_charset,
sizeof(buffer));
! text_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(text_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnknownTextCharset,
"text-charset %s is unknown, conversion to text-charset does not work"),
! text_charset->MIME_name);
strfcpy(raw_text_charset,"DISPLAY",sizeof raw_text_charset);
text_charset = display_charset;
! }
}

if (!special_charset_keyword(raw_display_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_display_charset,
! sizeof buffer))
do_expand_env("display-charset", buffer,
raw_display_charset,
sizeof(buffer));
! wanted_display_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(wanted_display_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 2229,2280 ----

map_system_charset(display_locale,display_codeset);



+ #if defined(WCHAR) && defined(__STDC_ISO_10646__)

+ change_system_charset();
+ #endif
+
/* Current display charset is locale charset */
display_charset = system_charset;

if (!special_charset_keyword(raw_text_charset)) {
!
! if (! load_charset_map_info(&text_charset,
! raw_text_charset) ) {
!
! char buffer[LONG_STRING];
!
do_expand_env("text-charset", buffer,
raw_text_charset,
sizeof(buffer));
! text_charset = MIME_name_to_charset(buffer,CHARSET_create);
! }
!
if (!(CS_mapping & charset_properties(text_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnknownTextCharset,
"text-charset %s is unknown, conversion to text-charset does not work"),
! text_charset->MIME_name ?
! text_charset->MIME_name :
! raw_text_charset);
strfcpy(raw_text_charset,"DISPLAY",sizeof raw_text_charset);
text_charset = display_charset;
!
! mark_local_changed(& raw_text_charset);
! }
}

if (!special_charset_keyword(raw_display_charset)) {
!
! if (! load_charset_map_info(& wanted_display_charset,
! raw_display_charset )) {
!
! char buffer[LONG_STRING];
do_expand_env("display-charset", buffer,
raw_display_charset,
sizeof(buffer));
! wanted_display_charset = MIME_name_to_charset(buffer,CHARSET_create);
! }
!
if (!(CS_mapping & charset_properties(wanted_display_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 1666,1686 ****
"display-charset %s is unsupported, charset switching does not work"),
wanted_display_charset->MIME_name ?
wanted_display_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_display_charset,"SYSTEM",
sizeof raw_display_charset);
! wanted_display_charset = system_charset;
}
}

if (!special_charset_keyword(raw_local_fs_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_local_fs_charset,
! sizeof buffer))
do_expand_env("local-fs-charset", buffer,
raw_local_fs_charset,
sizeof(buffer));
! local_fs_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(local_fs_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 2282,2307 ----
"display-charset %s is unsupported, charset switching does not work"),
wanted_display_charset->MIME_name ?
wanted_display_charset->MIME_name :
! raw_display_charset);
strfcpy(raw_display_charset,"SYSTEM",
sizeof raw_display_charset);
! wanted_display_charset = system_charset;
!
! mark_local_changed(& raw_display_charset);
}
}

if (!special_charset_keyword(raw_local_fs_charset)) {
!
! if (! load_charset_map_info(&local_fs_charset,
! raw_local_fs_charset) ) {
! char buffer[LONG_STRING];
do_expand_env("local-fs-charset", buffer,
raw_local_fs_charset,
sizeof(buffer));
! local_fs_charset = MIME_name_to_charset(buffer,CHARSET_create);
! }
!
if (!(CS_mapping & charset_properties(local_fs_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 1688,1708 ****
"local-fs-charset %s is unsupported, file access does not work"),
local_fs_charset->MIME_name ?
local_fs_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_local_fs_charset,"SYSTEM",
sizeof raw_local_fs_charset);
local_fs_charset = system_charset;
}
}

if (!special_charset_keyword(raw_default_nomime_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_default_nomime_charset,
! sizeof buffer))
do_expand_env("default-nomime-charset", buffer,
raw_default_nomime_charset,
sizeof(buffer));
! default_nomime_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(default_nomime_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 2309,2335 ----
"local-fs-charset %s is unsupported, file access does not work"),
local_fs_charset->MIME_name ?
local_fs_charset->MIME_name :
! raw_local_fs_charset);
strfcpy(raw_local_fs_charset,"SYSTEM",
sizeof raw_local_fs_charset);
local_fs_charset = system_charset;
+
+ mark_local_changed(& raw_local_fs_charset);
}
}

if (!special_charset_keyword(raw_default_nomime_charset)) {
!
! if (! load_charset_map_info(& default_nomime_charset,
! raw_default_nomime_charset) ) {
! char buffer[LONG_STRING];
!
do_expand_env("default-nomime-charset", buffer,
raw_default_nomime_charset,
sizeof(buffer));
! default_nomime_charset = MIME_name_to_charset(buffer,CHARSET_create);
! }
!
if (!(CS_mapping & charset_properties(default_nomime_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 1710,1730 ****
"default-nomime-charset %s is unsupported"),
default_nomime_charset->MIME_name ?
default_nomime_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_default_nomime_charset,"SYSTEM",
sizeof raw_default_nomime_charset);
default_nomime_charset = system_charset;
}
}

if (!special_charset_keyword(raw_default_mimetext_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_default_mimetext_charset,
! sizeof buffer))
do_expand_env("default-mime-text-charset", buffer,
raw_default_mimetext_charset,
sizeof(buffer));
! default_mimetext_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(default_mimetext_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 2337,2364 ----
"default-nomime-charset %s is unsupported"),
default_nomime_charset->MIME_name ?
default_nomime_charset->MIME_name :
! raw_default_nomime_charset);
!
strfcpy(raw_default_nomime_charset,"SYSTEM",
sizeof raw_default_nomime_charset);
default_nomime_charset = system_charset;
+
+ mark_local_changed(& raw_default_nomime_charset);
}
}

if (!special_charset_keyword(raw_default_mimetext_charset)) {
!
! if (! load_charset_map_info(& default_mimetext_charset,
! raw_default_mimetext_charset) ) {
!
! char buffer[LONG_STRING];
do_expand_env("default-mime-text-charset", buffer,
raw_default_mimetext_charset,
sizeof(buffer));
! default_mimetext_charset = MIME_name_to_charset(buffer,CHARSET_create);
! }
!
if (!(CS_mapping & charset_properties(default_mimetext_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 1732,1754 ****
"default-mime-text-charset %s is unsupported"),
default_mimetext_charset->MIME_name ?
default_mimetext_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_default_mimetext_charset,"US-ASCII",
sizeof raw_default_mimetext_charset);
default_mimetext_charset = ASCII_SET;
}
}


#ifdef REMOTE_MBX
if (!special_charset_keyword(raw_imap_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_imap_charset,
! sizeof buffer))
do_expand_env("imap-charset", buffer,
raw_imap_charset,
sizeof(buffer));
! imap_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(imap_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 2366,2395 ----
"default-mime-text-charset %s is unsupported"),
default_mimetext_charset->MIME_name ?
default_mimetext_charset->MIME_name :
! raw_default_mimetext_charset);
!
strfcpy(raw_default_mimetext_charset,"US-ASCII",
sizeof raw_default_mimetext_charset);
default_mimetext_charset = ASCII_SET;
+
+ mark_local_changed(& raw_default_mimetext_charset);
}
}


#ifdef REMOTE_MBX
if (!special_charset_keyword(raw_imap_charset)) {
!
! if (! load_charset_map_info(& imap_charset,
! raw_imap_charset) ) {
!
! char buffer[LONG_STRING];
do_expand_env("imap-charset", buffer,
raw_imap_charset,
sizeof(buffer));
! imap_charset = MIME_name_to_charset(buffer,CHARSET_create);
! }
!
if (!(CS_mapping & charset_properties(imap_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 1756,1765 ****
"imap-charset %s is unsupported"),
imap_charset->MIME_name ?
imap_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_imap_charset,"SYSTEM",
sizeof raw_imap_charset);
imap_charset = system_charset;
}
}
#endif
--- 2397,2409 ----
"imap-charset %s is unsupported"),
imap_charset->MIME_name ?
imap_charset->MIME_name :
! raw_imap_charset);
!
strfcpy(raw_imap_charset,"SYSTEM",
sizeof raw_imap_charset);
imap_charset = system_charset;
+
+ mark_local_changed(& raw_imap_charset);
}
}
#endif
***************
*** 1836,1841 ****
--- 2480,2490 ----
wanted_display_charset = system_charset;

allow_charset_switching = 0;
+
+ mark_local_changed(& raw_unidata_path);
+ mark_local_changed(& raw_display_charset);
+ mark_local_changed(& allow_charset_switching);
+
}

}
***************
*** 1856,1861 ****
--- 2505,2511 ----
strfcpy(raw_bindata_path,"none",sizeof raw_bindata_path);
strfcpy(bindata_path,"none",sizeof bindata_path);

+ mark_local_changed(& raw_bindata_path);
}
}

***************
*** 1898,1907 ****
do_expand_env("gpg", gpg_path, raw_gpg_path,
sizeof(gpg_path));
}
! if (pgp_none == send_pgp_version) {
! if ('/' == gpg_path[0]) send_pgp_version = gpg;
! if ('/' == pgp5_dir[0]) send_pgp_version = pgp5;
! if ('/' == pgp2_path[0]) send_pgp_version = pgp2;
}
#endif

--- 2548,2557 ----
do_expand_env("gpg", gpg_path, raw_gpg_path,
sizeof(gpg_path));
}
! if (pgp_none == give_dt_enumerate_as_int(&send_pgp_version)) {
! if ('/' == gpg_path[0]) send_pgp_version.val = gpg;
! if ('/' == pgp5_dir[0]) send_pgp_version.val = pgp5;
! if ('/' == pgp2_path[0]) send_pgp_version.val = pgp2;
}
#endif

***************
*** 1910,1936 ****
#endif
}

- static struct rc_save_info_rec * eval_option P_((struct rc_save_info_rec *
- rc_options,
- int rc_option_count,
- int lcl,
- char *word1,
- char *word2,
- char *filename));

! void do_rc(file, lcl, filename)
FILE *file;
! int lcl;
char *filename;
{
struct rc_save_info_rec * prev_type = NULL;
char current_tag[SLEN];

int ignored = 0;
!
! int x;
!
! char buffer[LONG_STRING];

if (!file)
return;
--- 2560,2646 ----
#endif
}


!
! /* Return rest */
!
! static char * split_keyword(buffer,line_len,keyword,size,tag,
! assig)
! char *buffer;
! int line_len;
! char *keyword;
! int size;
! char **tag;
! int *assig;
! {
! int i;
! char * c;
!
! DPRINT(Debug,10,(&Debug,
! "split_keyword len=%d, buffer=%s\n",
! line_len,buffer));
!
! *assig = 0;
!
! i = 0;
! for (c = buffer; c - buffer < line_len && i < size; c++) {
! if ('_' == *c)
! keyword[i++] = '-';
! else if (!*tag && ':' == *c) {
! /* Mark tag from buffer */
! *c = '\0';
! *tag = buffer;
! i = 0;
! } else if (!isascii(*c))
! break;
! else if (!ok_rc_char(*c))
! break;
! else {
! keyword[i++] = tolower((unsigned char)*c);
! }
! }
!
! keyword[i] = '\0';
!
! while (whitespace(*c))
! c++;
!
! if ('=' == *c) {
! c++;
! *assig = 1;
! }
! while (whitespace(*c))
! c++;
!
! DPRINT(Debug,10,(&Debug,
! "split_keyword: keyword(i=%d)=%s\n",
! i,keyword));
!
! if (*tag) {
! DPRINT(Debug,10,(&Debug,
! "split_keyword: tag=%s\n",*tag));
! }
!
! DPRINT(Debug,10,(&Debug,
! "split_keyword=%s\n",c));
!
! return c;
! }
!
! static void do_rc(file, lcl, filename)
FILE *file;
! enum record_mode lcl;
char *filename;
{
struct rc_save_info_rec * prev_type = NULL;
+ struct hist_record * rec = NULL;
+
char current_tag[SLEN];

int ignored = 0;
!
! char * buffer = NULL;
! int r; /* length of line or error/eof status */

if (!file)
return;
***************
*** 1938,1996 ****

current_tag[0] = '\0';

! while (0 < (x =
! mail_gets(buffer, sizeof buffer, file))) {
char * tag = NULL;
char keyword[SLEN], *c;
char * rest = NULL;
int i;

lineno++;

! /* remove return */
! if ('\n' == buffer[x -1])
! buffer[x - 1] = '\0';
! else {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTooLongLine,
! "%30s: %d: Too long line: %.30s..."),
! filename,lineno,buffer);
! errors ++;
break;
! }
!
! if (buffer[0] == '#' /* comment */
! || x < 2) /* empty line */
continue;

- i = 0;
- for (c = buffer; c - buffer < x && i < sizeof keyword; c++) {
- if ('_' == *c)
- keyword[i++] = '-';
- else if (!tag && ':' == *c) {
- /* Mark tag from buffer */
- *c = '\0';
- tag = buffer;
- i = 0;
- } else if (!isascii(*c))
- break;
- else if (!ok_rc_char(*c))
- break;
- else {
- keyword[i++] = tolower((unsigned char)*c);
- }
- }
-
- keyword[i] = '\0';

! while (whitespace(*c))
! c++;

- if ('=' == *c)
- c++;
- while (whitespace(*c))
- c++;
- rest = c;
-
if (tag && !keyword[0]) {
strfcpy(current_tag, tag, sizeof current_tag);

--- 2648,2676 ----

current_tag[0] = '\0';

! while (0 <= ( r = malloc_gets(&buffer,MAX_LINE,file))) {
!
char * tag = NULL;
char keyword[SLEN], *c;
char * rest = NULL;
+
+ int negate = 0;
+ int assig = 0;
int i;

lineno++;

! if (!buffer) /* EOF */
break;
!
! if (buffer[0] == '#' /* comment */
! || r < 1) /* empty line */
continue;


! rest = split_keyword(buffer,r,keyword, sizeof keyword,&tag,
! &assig);

if (tag && !keyword[0]) {
strfcpy(current_tag, tag, sizeof current_tag);

***************
*** 2008,2076 ****
panic("RC PANIC",__FILE__,__LINE__,"do_rc",
"Bad prev_type",0);

if (!prev_type->dt_type ->
parse_cline(prev_type,
lcl,
rest,
lineno,
! filename))
errors++;
}
! } else if (tag || current_tag[0]) {
! struct rc_save_info_rec * rc_options = NULL;
! int rc_option_count = 0;

! if (!tag)
! tag = current_tag;
! else
! ignored = 0;


#ifdef USE_DLOPEN
! if (give_options(tag,&rc_options,&rc_option_count)) {
!
! prev_type = eval_option(rc_options,rc_option_count,
! lcl,keyword,rest,filename);
! ignored = 0;

if (!prev_type) {
errors++;
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyTagInElmrc,
! "I can't understand keyword \"%s\" (section %s) in line %d in \"%s\" file"),
! keyword, tag,lineno,filename);
}
!
! } else if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIgnoredSection,
! "Keywords on section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);
!
}
! #else
! if (!ignored) {
! ignored = 1;

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSharedIgnoredSection,
! "Shared libraries not supported. Section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);
! errors++;
}
! #endif

! } else {
! prev_type = do_set(lcl, keyword, rest, filename);
! if (!prev_type) {
errors++;
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyInElmrc,
! "I can't understand keyword \"%s\" in line %d in \"%s\" file"),
! keyword, lineno,filename);
}
}
!

}
}

/*
--- 2688,2849 ----
panic("RC PANIC",__FILE__,__LINE__,"do_rc",
"Bad prev_type",0);

+ if (rec) {
+ rec->old_line = safe_realloc(rec->old_line,
+ sizeof(rec->old_line[0]) *
+ ( rec->line_count + 1));
+
+ rec->old_line [ rec->line_count ] = safe_strdup(rest);
+ rec->line_count++;
+ }
+
if (!prev_type->dt_type ->
parse_cline(prev_type,
lcl,
rest,
lineno,
! filename)) {
errors++;
+
+ /* If there was errors, then assume that rewriting
+ of elmrc entry causes it to be rewritten
+ */
+ if (rec)
+ rec->changed++;
+ }
}
! } else if (assig) {

! if (tag || current_tag[0]) {
! struct rc_save_info_rec * rc_options = NULL;
! int rc_option_count = 0;
!
! if (!tag)
! tag = current_tag;
! else
! ignored = 0;


#ifdef USE_DLOPEN
! if (give_options(tag,&rc_options,&rc_option_count)) {
!
! prev_type = locate_option(rc_options,rc_option_count,
! keyword,rest,filename,
! &negate);
! ignored = 0;
!
! if (!prev_type) {
! errors++;
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyTagInElmrc,
! "I can't understand keyword \"%s\" (section %s) in line %d in \"%s\" file"),
! keyword, tag,lineno,filename);
! continue;
! }
!
!
! } else if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIgnoredSection,
! "Keywords on section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);
!
! }
! #else
! if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSharedIgnoredSection,
! "Shared libraries not supported. Section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);
! errors++;
! }
! #endif
!
! } else {
!
! prev_type = locate_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
! keyword,rest,filename,&negate);
!
!

if (!prev_type) {
errors++;
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyInElmrc,
! "I can't understand keyword \"%s\" in line %d in \"%s\" file"),
! keyword, lineno,filename);


!
! continue;
}
!
}
!

! if (!prev_type)
! continue;
!
! rec = need_record(lcl,prev_type,tag);
! if (rec) {
! if (rec->line_count)
! panic("RC PANIC",__FILE__,__LINE__,"do_rc",
! "Bad prev_type",0);

! rec->old_line = safe_malloc(sizeof(rec->old_line[0]));
!
! rec->old_line[0] = safe_strdup(rest);
!
! rec->line_count = 1;
}
!
! if (ignored)
! continue;

! if (prev_type->flags & FL_SYS && lcl == LOCAL_RC) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmBadLocalKeyInElmrc,
! "Keyword \"%s\" is not valid on user file %s"),
! prev_type->name,filename);
! continue;
! }
!
!
! if (!rc_eval_tail(prev_type,lcl,rest,lineno,filename,negate)) {
errors++;
!
! /* If there was errors, then assume that rewriting
! of elmrc entry causes it to be rewritten
! */
! if (rec)
! rec->changed++;
!
}
+ } else {
+ prev_type = NULL;
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadLineInElmrc,
+ "Keyword \"%s\" without = -character in line %d in \"%s\" file"),
+ keyword, lineno,filename);
+ errors++;
}
! }



+ if (-1 == r) {

+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTooLongLine,
+ "%30s: %d: Too long line: %.30s..."),
+ filename,lineno+1,
+ buffer ? buffer : "<not available>");
+ errors++;
+ }
+
+ if (ferror(file)) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReading,
+ "Error reading from %.50s"),
+ filename);
+ errors++;
}
+
+ if (buffer)
+ free(buffer);
+
}

/*
***************
*** 2087,2108 ****
*/


! static struct rc_save_info_rec * eval_option (rc_options,rc_option_count,lcl,
! word1,word2,filename)
struct rc_save_info_rec * rc_options;
int rc_option_count;
- int lcl;
char *word1;
char *word2;
char *filename;
{
- int negate = 0;
-

int x, y = 0;

! int e_val = 0;
!
if ('!' == *word1) {
! negate++;
word1++;
}

--- 2860,2879 ----
*/


! static struct rc_save_info_rec *locate_option(rc_options,rc_option_count,
! word1,word2,filename,negate)
struct rc_save_info_rec * rc_options;
int rc_option_count;
char *word1;
char *word2;
char *filename;
+ int *negate;


{
int x, y = 0;

!
!
if ('!' == *word1) {
! (*negate)++;
word1++;
}

***************
*** 2115,2181 ****
if (y != 0)
return NULL;

! if (rc_options[x].flags & FL_SYS && lcl == LOCAL_RC) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmBadLocalKeyInElmrc,
! "Keyword \"%s\" is not valid on user file %s"),
! rc_options[x].name,filename);
! return NULL;
! }
!
! if (lcl == LOCAL_RC)
! rc_options[x].flags |= FL_LOCAL;
! rc_options[x].flags |= FL_CHANGED;
!
! if (rc_options[x].e_ptr) {
! int ci = -1, i;
! e_val = 0; /* First value is 'unknown' */
!
! for (i = 0; i < rc_options[x].e_ptr->nlen; i++)
! if (0 == strcmp(rc_options[x].e_ptr->list[i],word2)) {
! e_val = i;
! break;
! } else if (0 == istrcmp(rc_options[x].e_ptr->list[i],word2))
! ci = i;
! if (!e_val && ci >= 0)
! e_val = ci;
!
! if (i == rc_options[x].e_ptr->nlen) {
! char *p;
! if (
! (rc_options[x].dt_type != DT_NUM ||
! strtol(word2,&p,10) < 0) || *p != '\0'
! ) {
!
! errors++;
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadEKeyInElmrc,
! "I can't understand %s key \"%s\" in line %d in \"%s\" file"),
! word1,word2, lineno,filename);
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadEKeyValues,
! "Possible values are:"));
! for (i = 0; i < rc_options[x].e_ptr->nlen; i++)
! lib_error(FRM(" - %s"),
! rc_options[x].e_ptr->list[i]);
! }
! }

! } else
! e_val = 0;

! if (RCTYPE_magic != rc_options[x].dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"do_set",


"Bad config item type",0);

! if (!rc_options[x].dt_type->parse_line(& (rc_options[x]),
! lcl,
! word2,
! lineno,
! filename,
! e_val,
! negate))
! errors++;
!
! return & (rc_options[x]);
}

struct rc_save_info_rec * do_set(lcl, word1, word2, filename)
--- 2886,2920 ----
if (y != 0)
return NULL;

! return & (rc_options[x]);
! }

! int rc_eval_tail(ret,lcl,value,lineno,filename,negate)
! struct rc_save_info_rec *ret;
! int lcl;
! char *value;
! int lineno;
! char *filename;
! int negate;
! {

! if (lcl == LOCAL_RC)
! ret->flags |= FL_LOCAL;
! ret->flags |= FL_CHANGED;
!
! if (RCTYPE_magic != ret->dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"rc_eval_tail",


"Bad config item type",0);

+
+ if (! ret->dt_type->parse_line(ret,
+ lcl,
+ value,
+ lineno,
+ filename,
+ negate))
+ return 0;

! return 1;
}

struct rc_save_info_rec * do_set(lcl, word1, word2, filename)
***************
*** 2183,2190 ****
char *word1, *word2;
char *filename;
{
! return eval_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
! lcl,word1,word2,filename);
}

static CONST char WEED_NO_DEFAULT[] = "*clear-weed-list*";
--- 2922,2947 ----
char *word1, *word2;
char *filename;
{
! int negate = 0;
!
! struct rc_save_info_rec * ret = locate_option(save_info,
! NUMBER_OF_SAVEABLE_OPTIONS,
! word1,word2,filename,
! &negate);
!
! if (!ret) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyInElmrc,
! "I can't understand keyword \"%s\" in line %d in \"%s\" file"),
! word1, lineno,filename);
!
! return NULL;
! }
!
!
! if (!rc_eval_tail(ret,lcl,word2,lineno,filename,negate))
! return NULL;
!
! return ret;
}

static CONST char WEED_NO_DEFAULT[] = "*clear-weed-list*";
Index: elm2.4.ME+.122-cvs/lib/realfrom.c
*** elm2.4.ME+.121/lib/realfrom.c 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/realfrom.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.13 2004/08/28 09:03:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.15 2005/06/17 21:02:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 15,22 ****

DEBUG_VAR(Debug,__FILE__,"addr");

- extern long make_gmttime();
-
int real_from(buffer, entry)
char *buffer;
struct header_rec *entry;
--- 15,20 ----
***************
*** 46,51 ****
--- 44,51 ----
int len=0; /* length of current field */
int month, day, year, hours, mins, secs, tz, i;

+ int ef = give_dt_enumerate_as_int(&env_from_source);
+
/*
* Zero out the portions of the record we fill in.
*/
***************
*** 64,70 ****
*/

DPRINT(Debug,9,(&Debug,
! "env_from_source=%d\n",env_from_source));

/* From */
if (strncmp(buffer, "From ", 5) != 0) {
--- 64,70 ----
*/

DPRINT(Debug,9,(&Debug,
! "env_from_source=%d\n",ef));

/* From */
if (strncmp(buffer, "From ", 5) != 0) {
***************
*** 98,104 ****
else {
/* field2 is month, field3 is day */

! if (env_from_source < 2) {
/* <user> */
if (entry != NULL)
*( entry->env_from ) = '\0';
--- 98,104 ----
else {
/* field2 is month, field3 is day */

! if (ef < 2) {
/* <user> */
if (entry != NULL)
*( entry->env_from ) = '\0';
***************
*** 112,118 ****
}
else {

! if (env_from_source < 2) {
char *X = field;
int l;

--- 112,118 ----
}
else {

! if (ef < 2) {
char *X = field;
int l;

Index: elm2.4.ME+.122-cvs/lib/remote_mbx.c
*** elm2.4.ME+.121/lib/remote_mbx.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/remote_mbx.c 2005-03-28 15:59:30.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.51 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.54 2005/03/28 12:59:30 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 177,188 ****

--- 177,192 ----
extern int errno;
#endif


+ #define REMOTE_ACCOUNT_magic 0xF504
+
void zero_remote_account(ra)
struct remote_account *ra;
{

/* bzero is defined hdrs/defs.h */

bzero ((void *)ra, sizeof (struct remote_account));

+ ra->magic = REMOTE_ACCOUNT_magic;
+
ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = 0;
ra->stream = NULL;

***************
*** 258,263 ****


--- 262,272 ----
void free_remote_account(ra)
struct remote_account *ra;
{
+ if (ra->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,
+ "free_remote_account",
+ "Bad magic number",0);
+
ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = -1;

***************
*** 397,402 ****
--- 406,416 ----

int idx;

+ if (ra->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,
+ "connect_remote_account",
+ "Bad magic number",0);
+
if(ra->stream) {
DPRINT(Debug,12,(&Debug,
"connect_remote_account: Closing for reopening\n"));

***************
*** 600,605 ****


--- 614,621 ----
sep = strchr(name,'@');

if (sep && (!*rest || *rest > sep)) {
+ char * sep2;
+
if (sep == name || sep[1] == '\0' ||
*rest == sep+1) {
lib_error(CATGETS(elm_msg_cat, MeSet,MeBadRemoteMailbox,
***************

*** 608,613 ****


--- 624,639 ----
ret = -1;
goto clean;
}
+
+ /* Test for '@' on hostname -- if there is, then
+ assume that first '@' was on username
+ */
+ sep2 = strchr(sep+1,'@');
+ if (sep2 && (!*rest || *rest > sep2+1)) {
+ DPRINT(Debug,12,(&Debug,
+ "split_remote_name: Found second '@' from hostname, Assuming that first '@' was on username\n"));
+ sep = sep2;
+ }

if (*rest) {
CONST char * START = sep+1;

***************
*** 665,688 ****
char *imap_folder;
{


char * prefix = "mbox.";

/* In here we can use temp_dir instead of default_temp because


* that file does not act as session lock ...
*/

if (imap_folder)

elm_sfprintf(fh-> cur_tempfolder,
sizeof fh -> cur_tempfolder,
FRM("%s%s%s@%s:%s"),
! temp_dir,prefix,
X->username,
X->host,imap_folder);
else
elm_sfprintf(fh-> cur_tempfolder,
sizeof fh -> cur_tempfolder,
FRM("%s%s%s@%s"),
! temp_dir,prefix,
X->username,X->host);

DPRINT(Debug,12,(&Debug,
--- 691,725 ----
char *imap_folder;
{


char * prefix = "mbox.";

+ char *tmp;

/* In here we can use temp_dir instead of default_temp because
* that file does not act as session lock ...
*/

+

+ if (X->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,
+ "set_remote_tempmbox",

+ "Bad magic number",0);
+

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ tmp = "/tmp/";


+
if (imap_folder)

elm_sfprintf(fh-> cur_tempfolder,

sizeof fh -> cur_tempfolder,
FRM("%s%s%s@%s:%s"),
! tmp,prefix,
X->username,
X->host,imap_folder);
else
elm_sfprintf(fh-> cur_tempfolder,
sizeof fh -> cur_tempfolder,
FRM("%s%s%s@%s"),
! tmp,prefix,
X->username,X->host);

DPRINT(Debug,12,(&Debug,


***************
*** 690,696 ****
fh-> cur_tempfolder));
}

! /* May free X (if succeed) or copy */
int make_remote_mbox(fh,X,se,rest,rewrite)
struct folder_info *fh;
struct remote_account *X;

--- 727,735 ----


fh-> cur_tempfolder));
}

! /* May free X (if succeed) or copy
! If make copy of X, then X is zeroed
! */
int make_remote_mbox(fh,X,se,rest,rewrite)
struct folder_info *fh;
struct remote_account *X;
***************
*** 704,709 ****

--- 743,753 ----


int got;
static struct connection_cache *CX;

+ if (X->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,
+ "make_remote_mbox",
+ "Bad magic number",0);
+
DPRINT(Debug,10,(&Debug,
"make_remote_mbox: fh=%X, rest=%s, rewrite=%d\n",
fh,rest ? rest : "<NULL>", rewrite));
***************
*** 764,770 ****
else
fh->p->a.imap_mbx.folder = safe_strdup(imap_only);

- free_remote_account(X);
} else {
PORTS ports[] = { PORT_imap4, PORT_pop3, PORT_end };
PORTS ports_imaponly[] = { PORT_imap4, PORT_end };

--- 808,813 ----
***************
*** 789,794 ****
--- 832,839 ----


fh->folder_type->init_it(fh);
free_remote_account(&(fh->p->a.pop_mbx.C));
fh->p->a.pop_mbx.C = *X;
+ zero_remote_account(X); /* Avoid double free */
+
status = &(fh->p->a.pop_mbx.C);

break;
***************
*** 845,850 ****

--- 890,897 ----



fail:

+ free_remote_account(X);
+
if (imap_only)
free(imap_only);

Index: elm2.4.ME+.122-cvs/lib/safemalloc.c
*** elm2.4.ME+.121/lib/safemalloc.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/safemalloc.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: safemalloc.c,v 1.13 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: safemalloc.c,v 1.14 2005/06/17 21:02:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 38,44 ****
exit(1);
}

! void (*safe_malloc_fail_handler)() = dflt_safe_malloc_fail_handler;

malloc_t safe_malloc(len)
unsigned len;
--- 38,45 ----
exit(1);
}

! void (*safe_malloc_fail_handler) P_((char *proc,
! unsigned len)) = dflt_safe_malloc_fail_handler;

malloc_t safe_malloc(len)
unsigned len;
Index: elm2.4.ME+.122-cvs/lib/savefolder.c
*** elm2.4.ME+.121/lib/savefolder.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/savefolder.c 2005-05-08 12:24:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.77 2004/06/18 09:29:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.77 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.80 2005/05/08 09:24:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.80 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 22,27 ****
--- 22,33 ----

DEBUG_VAR(Debug,__FILE__,"mbox");


+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+
static unsigned char * s2us P_((char *str));
static unsigned char * s2us(str)
char *str;
***************

*** 314,331 ****

switch(dir->sel_type) {
case selection_folder:
- /* Local folders directory */
- if (folders[0] && 0 == access(folders,READ_ACCESS)) {
- char * str = safe_strdup(folders);
- int l = strlen(str);
- if (str[l-1] != '/')
- str = strmcat(str,"/");

! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,str,new_string2(system_charset,s2us("=")),
! BROWSER_NOFOLDER);
}

{
--- 320,340 ----

switch(dir->sel_type) {
case selection_folder:



! {
! /* give_dt_estr_as_str adds / to end */
! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
!

! /* Local folders directory */
! if (folders_val && 0 == access(folders_val,READ_ACCESS)) {
! char * str = safe_strdup(folders_val);
!
! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,str,new_string2(system_charset,s2us("=")),
! BROWSER_NOFOLDER);
! }
}

{
***************
*** 700,705 ****
--- 709,718 ----
int F = 0;
struct stat bufX, *buf = NULL; /* stat command */
int idx;
+
+ /* give_dt_estr_as_str adds / to end */
+ char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
+

idx = browser_select_generic(dir,dir->dirname,
rel_itemname,relative,&Lstr,&str,'/',
***************
*** 722,729 ****
else if (extra_mailbox_dir[0] &&
in_directory(buf,str,extra_mailbox_dir))
F |= BROWSER_MAILFILE;
! else if (folders[0] &&
! in_directory(buf,str,folders))
F |= BROWSER_MAILFILE;

if (idx >= 0) {
--- 735,742 ----
else if (extra_mailbox_dir[0] &&
in_directory(buf,str,extra_mailbox_dir))
F |= BROWSER_MAILFILE;
! else if (folders_val &&
! in_directory(buf,str,folders_val))
F |= BROWSER_MAILFILE;

if (idx >= 0) {


***************
*** 1075,1081 ****
*/
if (0 <= (code = split_remote_name(dir->a.dummy_browser.remote,
&X,&se,&rest,

! 0 /* Both POP adn IMAP are OK */
))) {

if (code == 0 || rest)
--- 1088,1094 ----


*/
if (0 <= (code = split_remote_name(dir->a.dummy_browser.remote,
&X,&se,&rest,

! 0 /* Both POP and IMAP are OK */
))) {


if (code == 0 || rest)
***************
*** 1091,1107 ****
new_string2(display_charset,
s2us(dir->a.dummy_browser.remote));

! /* May free X (if succeed) or copy */
if (!make_remote_mbox(res,&X,se,NULL,1)) {
- free_remote_account(&X);

res -> folder_type = NO_NAME;
res->folder_type->init_it(res);
}
free_temporary_service_entry(&se);
goto clean;
}
free_temporary_service_entry(&se);
}
#endif
lib_error(CATGETS(elm_msg_cat, MeSet, MeRemoteFolderNotAvail,

--- 1104,1124 ----


new_string2(display_charset,
s2us(dir->a.dummy_browser.remote));

! /* May free X (if succeed) or copy
! If make copy of X, then X is zeroed
! */
if (!make_remote_mbox(res,&X,se,NULL,1)) {

res -> folder_type = NO_NAME;
res->folder_type->init_it(res);
}
free_temporary_service_entry(&se);
+ free_remote_account(&X);
+
goto clean;
}
free_temporary_service_entry(&se);
+ free_remote_account(&X);
}
#endif
lib_error(CATGETS(elm_msg_cat, MeSet, MeRemoteFolderNotAvail,

***************
*** 2126,2131 ****
--- 2143,2159 ----
"browser_update_dummy() called",0);
}

+
+ S_(browser_folder_sort_dir browser_folder_sort_dummy)
+ static void browser_folder_sort_dummy P_((struct folder_browser *dir,
+ print_sort_message * print));
+ static void browser_folder_sort_dummy(dir,print)


+ struct folder_browser *dir;
+ print_sort_message * print;
+ {

+ /* Nothing */
+ }
+

static struct browser_type dummy_browser = { browser_zero_dummy,
browser_free_dummy,
browser_change_dummy,
***************
*** 2151,2157 ****
browser_make_ref_dummy,
browser_update_dummy,
browser_dummy_do_stat,
! browser_sync_write_dummy
};


--- 2179,2186 ----
browser_make_ref_dummy,
browser_update_dummy,
browser_dummy_do_stat,
! browser_sync_write_dummy,
! browser_folder_sort_dummy,
};


***************
*** 2303,2313 ****
flags & BROWSER_NEEDSTAT ? " (need stat)" : ""));

dir->vector = safe_realloc (dir->vector,
! (dir->vector_len+1) *
! sizeof (struct name_vector));
dir->vector[dir->vector_len].sys_name = sys_name;
dir->vector[dir->vector_len].disp_name = disp_name;
dir->vector[dir->vector_len].flags = flags;
dir->vector_len++;
}

--- 2332,2342 ----
flags & BROWSER_NEEDSTAT ? " (need stat)" : ""));

dir->vector = safe_realloc (dir->vector,
! (dir->vector_len+1) * sizeof (dir->vector[0]));
dir->vector[dir->vector_len].sys_name = sys_name;
dir->vector[dir->vector_len].disp_name = disp_name;
dir->vector[dir->vector_len].flags = flags;
+ dir->vector[dir->vector_len].mtime = 0;
dir->vector_len++;
}

***************
*** 2779,2795 ****

/* Local folder directory */
if (1 == len) {
! if (change_type(dir,
#ifdef DIROPS
! &local_browser
#else
! &dummy_browser
#endif
! ))
! clear_dir_vector(dir);
! *relative_to_type = new_string2(local_fs_charset,
! s2us(folders));
! ret = 1;
break;
}

--- 2808,2833 ----

/* Local folder directory */
if (1 == len) {

!
! /* give_dt_estr_as_str adds / to end */
! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
!

! if (!folders_val)
! ret = 0;
! else {
! if (change_type(dir,
#ifdef DIROPS
! &local_browser
#else
! &dummy_browser
#endif
! ))
! clear_dir_vector(dir);
!
! *relative_to_type = new_string2(local_fs_charset,
! s2us(folders_val));
! ret = 1;
! }
break;
}

***************
*** 3339,3344 ****
--- 3377,3405 ----
return ret;
}

+
+ void folder_sort_dir(dir,print)


+ struct folder_browser *dir;
+ print_sort_message * print;

+ {
+ struct string * ret;
+
+ if (!valid_browser(dir->type))
+ panic("BROWSER PANIC",__FILE__,__LINE__,"folder_sort_dir",
+ "Bad browser (type)",0);
+
+ DPRINT(Debug,10,(&Debug,
+ "folder_sort_dir: dir=%p (%s); type=%p\n",
+ dir,dir->sys_dir ? dir->sys_dir : "<NULL>",
+ dir->type));
+
+ /* browser_vector_len() will update cache */
+ browser_vector_len(dir);
+
+ dir->type->browser_folder_sort_it(dir,print);
+ }
+
+
/* return reference to array -- do not free_string() result !!! */
struct string * give_line_dir(dir,idx,flags)
struct folder_browser *dir;
Index: elm2.4.ME+.122-cvs/lib/sb_file.c
*** elm2.4.ME+.121/lib/sb_file.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/sb_file.c 2005-03-26 22:18:57.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: sb_file.c,v 1.10 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: sb_file.c,v 1.11 2005/03/26 20:18:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 36,42 ****
{
static int count = 0;
int i;
!
buffer->p->a.file.offset_count = 0;
buffer->p->a.file.offsets = NULL;
buffer->p->a.file.filename = NULL;
--- 36,47 ----
{
static int count = 0;
int i;
! char *tmp;
!

! tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
! if (!tmp)
! tmp = "/tmp/";
!

buffer->p->a.file.offset_count = 0;
buffer->p->a.file.offsets = NULL;
buffer->p->a.file.filename = NULL;
***************
*** 46,52 ****
count++;

buffer->p->a.file.filename = elm_message(FRM("%selmsb-%d-%d"),
! temp_dir, getpid (),
count);

buffer->p->a.file.fh = safeopen_rdwr(buffer->p->a.file.filename);
--- 51,57 ----
count++;

buffer->p->a.file.filename = elm_message(FRM("%selmsb-%d-%d"),
! tmp, getpid (),
count);

buffer->p->a.file.fh = safeopen_rdwr(buffer->p->a.file.filename);
Index: elm2.4.ME+.122-cvs/lib/shared_all.c
*** elm2.4.ME+.121/lib/shared_all.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/shared_all.c 2005-07-05 23:44:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.3 2004/04/24 16:33:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.7 2005/07/05 20:44:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 16,24 ****
--- 16,29 ----
DEBUG_VAR(Debug,__FILE__,"dl");

#include "shared_imp.h"
+ #include "rc_imp.h"
#include "save_opts.h"
#include "cs_imp.h"

+
+
+
+
#include "s_me.h"

#if ANSI_C
***************
*** 27,50 ****
#define S_(x)
#endif

- static void mark_changed P_((void *A));
- static void mark_changed(A)
- void *A;
- {
- int x;


-
- for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {

- if (save_info[x].val.dummy == A)
- save_info[x].flags |= FL_CHANGED | FL_LOCAL;
- }
- }

! static SHAREDLIB * shared_lib_lists[] = {
&use_shared_base,
&use_shared_connect,
- NULL
};

S_(sl_reg_functions sl_reg_all)
static int sl_reg_all P_((struct ImpInfo *i,
int reg_idx));
--- 32,66 ----
#define S_(x)
#endif


! static SHAREDLIB * shared_lib_lists_INIT[] = {
&use_shared_base,
&use_shared_connect,
};

+ static SHAREDLIB ** shared_lib_lists = shared_lib_lists_INIT;
+ static int shared_lib_lists_count = sizeof (shared_lib_lists_INIT) /
+ sizeof (shared_lib_lists_INIT[0]);
+
+ void register_list(Z)
+ SHAREDLIB *Z;
+ {
+ if (shared_lib_lists == shared_lib_lists_INIT) {
+ int i;
+ shared_lib_lists = safe_malloc((shared_lib_lists_count+1) *
+ sizeof (shared_lib_lists_INIT[0]));
+
+ for (i = 0; i < shared_lib_lists_count; i++)
+ shared_lib_lists[i] = shared_lib_lists_INIT[i];
+ } else
+ shared_lib_lists = safe_realloc(shared_lib_lists,
+ (shared_lib_lists_count+1) *
+ sizeof (shared_lib_lists_INIT[0]));
+
+ shared_lib_lists[shared_lib_lists_count] = Z;
+ shared_lib_lists_count++;
+ }
+
S_(sl_reg_functions sl_reg_all)
static int sl_reg_all P_((struct ImpInfo *i,
int reg_idx));
***************
*** 70,76 ****
"sl_reg_all: Trying move %s out of use-library [var %p]\n",
i->tag,i->regs[reg_idx].var));

! for (j = 0; shared_lib_lists[j]; j++) {
int k = give_rnum(i,shared_lib_lists[j]);

/* First assume validity ... */
--- 86,92 ----
"sl_reg_all: Trying move %s out of use-library [var %p]\n",
i->tag,i->regs[reg_idx].var));

! for (j = 0; j < shared_lib_lists_count; j++) {
int k = give_rnum(i,shared_lib_lists[j]);

/* First assume validity ... */
***************
*** 78,85 ****

if (reg_code1(i,k)) {
i->regs[reg_idx].valid = 0; /* remove form use-library */
! mark_changed((void *)shared_lib_lists[j]);
! mark_changed((void *)&use_shared_all);

shared_lib_lists[j]->libraries_loaded = 0;

--- 94,101 ----

if (reg_code1(i,k)) {
i->regs[reg_idx].valid = 0; /* remove form use-library */
! mark_local_changed((void *)shared_lib_lists[j]);
! mark_local_changed((void *)&use_shared_all);

shared_lib_lists[j]->libraries_loaded = 0;

***************
*** 188,194 ****
int found = 0;
int k;

! for (k = 0; shared_lib_lists[k]; k++) {
int m = give_rnum(I,shared_lib_lists[k]);

/* First assume validity ... */
--- 204,210 ----
int found = 0;
int k;

! for (k = 0; k < shared_lib_lists_count; k++) {
int m = give_rnum(I,shared_lib_lists[k]);

/* First assume validity ... */
***************
*** 196,202 ****

if (reg_code1(I,m)) {
found++;
! mark_changed((void *)shared_lib_lists[k]);

shared_lib_lists[k]->libraries_loaded = 0;
} else {
--- 212,218 ----

if (reg_code1(I,m)) {
found++;
! mark_local_changed((void *)shared_lib_lists[k]);

shared_lib_lists[k]->libraries_loaded = 0;
} else {
Index: elm2.4.ME+.122-cvs/lib/shared_base.c
*** elm2.4.ME+.121/lib/shared_base.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/shared_base.c 2005-04-30 14:01:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_base.c,v 1.2 2004/03/28 13:37:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_base.c,v 1.3 2005/04/30 11:01:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 16,21 ****
--- 16,22 ----
DEBUG_VAR(Debug,__FILE__,"dl");

#include "shared_imp.h"
+ #include "rc_imp.h"
#include "save_opts.h"
#include "cs_imp.h"

Index: elm2.4.ME+.122-cvs/lib/shared.c
*** elm2.4.ME+.121/lib/shared.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/shared.c 2005-05-21 20:58:31.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared.c,v 1.56 2004/06/18 09:29:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared.c,v 1.62 2005/05/21 17:58:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 17,28 ****

#include "shared_imp.h"
#include "mbx_imp.h"
- #include "save_opts.h"
#include "rc_imp.h"
#include "s_me.h"
#include "cs_imp.h"
#include "ss_imp.h"
- #include "mailer_imp.h"

#include "s_elm.h"

--- 17,27 ----

#include "shared_imp.h"
#include "mbx_imp.h"
#include "rc_imp.h"
+ #include "save_opts.h"
#include "s_me.h"
#include "cs_imp.h"
#include "ss_imp.h"

#include "s_elm.h"

***************
*** 143,148 ****
--- 142,151 ----
if (I->regs[i].var == var)
return i;

+ DPRINT(Debug,7,(&Debug,
+ "give_rnum: Adding var %p to %s => rnum=%d\n",
+ var,I->shname,i));
+
I->regs = safe_realloc(I->regs,
(I->regs_count+1) * sizeof (I->regs[0]));

***************
*** 151,156 ****
--- 154,164 ----
I->regs[i].updated = 0;
I->regs[i].r.dummy = NULL;

+ DPRINT(Debug,10,(&Debug,
+ "give_rnum: [%p]->regs[%d].valid=%d\n",
+ I,i,I->regs[i].valid));
+
+
if (SHARED_LOADER_magic != var->loader->magic)
panic("SHARED PANIC",__FILE__,__LINE__,
"give_rnum",
***************
*** 165,170 ****
--- 173,182 ----
if (var->shared_list[k] == I)
goto found;

+ DPRINT(Debug,7,(&Debug,
+ "give_rnum: Adding %s to var %p shared_list (index %d)\n",
+ I->shname,var,k));
+
var->shared_list = safe_realloc(var->shared_list,
(k+1) * sizeof (var->shared_list[0]));

***************
*** 174,179 ****
--- 186,194 ----

found:

+ DPRINT(Debug,7,(&Debug,
+ "give_rnum=%d [var %p]\n",i,var));
+
return i;


***************
*** 350,356 ****
DPRINT(Debug,7,(&Debug,"reg_code1: ... %s result = %d [%d var %p] valid = %d\n",
I->shname,res,r,I->regs[r].var,
I->regs[r].valid));
! }

return res;
}
--- 365,378 ----
DPRINT(Debug,7,(&Debug,"reg_code1: ... %s result = %d [%d var %p] valid = %d\n",
I->shname,res,r,I->regs[r].var,
I->regs[r].valid));
! } else {
! DPRINT(Debug,7,(&Debug,
! "reg_code1: Skipping library %s ... [%d var %p] valid=%d updated=%d\n",
! I->shname,r,I->regs[r].var,
! I->regs[r].valid,
! I->regs[r].updated));
! }
!

return res;
}
***************
*** 384,389 ****
--- 406,417 ----

I->regs[r].valid = 0;
I->regs[r].updated = 0;
+
+ DPRINT(Debug,10,(&Debug,
+ "unreg1: [%p]->regs[%d].valid=%d\n",
+ I,r,I->regs[r].valid));
+
+
}

static void unload_code P_((int idx));
***************
*** 499,506 ****
--- 527,550 ----
if (var->shared_list[i]->valid) {
int r = give_rnum(var->shared_list[i],var);

+ DPRINT(Debug,7,(&Debug,
+ "Prosessing [var %p] %d, %s : valid=%d => r=%d\n",
+ var, i,
+ var->shared_list[i]->shname,
+ var->shared_list[i]->valid,
+ r));
+
reg_code1(var->shared_list[i],r);

+ } else {
+
+ DPRINT(Debug,7,(&Debug,
+ "Skipping [var %p] %d, %s : valid=%d\n",
+ var, i,
+ var->shared_list[i]->shname,
+ var->shared_list[i]->valid));
+
+
}
}

***************
*** 553,558 ****
--- 597,606 ----
I->regs[rnum].valid = 1;
S->libraries_loaded = 0;

+ DPRINT(Debug,10,(&Debug,
+ "process_lib_reg: [%p]->regs[%d].valid=%d\n",
+ I,rnum,I->regs[rnum].valid));
+
} else {
int err = errno;

***************
*** 572,584 ****
}

S_(rc_parse_line dt_SHARED_parse_line)
! static int dt_SHARED_parse_line(r,lcl,value,lineno,filename, e_val, negate)
struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;
{
int i;

--- 620,631 ----
}

S_(rc_parse_line dt_SHARED_parse_line)
! static int dt_SHARED_parse_line(r,lcl,value,lineno,filename, negate)
struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
{
int i;

***************
*** 606,611 ****
--- 653,667 ----

if (r->val.shared == r->val.shared->shared_list[i]->regs[j].var) {
r->val.shared->shared_list[i]->regs[j].valid = 0;
+
+
+ DPRINT(Debug,10,(&Debug,
+ "dt_SHARED_parse_line: [%p]->regs[%d].valid=%d\n",
+ r->val.shared->shared_list[i],
+ j,
+ r->val.shared->shared_list[i]->regs[j].valid));
+
+
goto found1;
}

***************
*** 796,801 ****
--- 852,901 ----
return NULL;
}

+ void mark_shared_changed(A)
+ void *A;


+ {
+ int i;
+

+ for (i = 0; i < library_list_count; i++) {
+ int x;
+
+ if (!library_list[i]->handle)
+ continue;
+
+ for (x = 0; x < library_list[i]->rc_option_count; x++) {
+
+ if (library_list[i]->rc_options[x].val.dummy == A) {
+ mark_XX(& (library_list[i]->rc_options[x]));


+ }
+
+ }
+ }
+ }

+
+
+ void mark_fshared_changed(A)
+ option_func *A;


+ {
+ int i;
+

+ for (i = 0; i < library_list_count; i++) {
+ int x;
+
+ if (!library_list[i]->handle)
+ continue;
+
+ for (x = 0; x < library_list[i]->rc_option_count; x++) {
+
+ if (library_list[i]->rc_options[x].func_val == A) {
+ mark_XX(& (library_list[i]->rc_options[x]));


+ }
+
+ }
+ }
+ }

+
+

int give_options(tag,rc_options,rc_option_count)
char *tag;
Index: elm2.4.ME+.122-cvs/lib/shared_connect.c
*** elm2.4.ME+.121/lib/shared_connect.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/shared_connect.c 2005-05-21 20:58:31.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.3 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.5 2005/05/21 17:58:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 16,26 ****
DEBUG_VAR(Debug,__FILE__,"dl");

#include "shared_imp.h"
#include "save_opts.h"
#include "cs_imp.h"
#include "mbx_imp.h"
#include "ss_imp.h"
- #include "mailer_imp.h"

#if ANSI_C
#define S_(x) static x;
--- 16,26 ----
DEBUG_VAR(Debug,__FILE__,"dl");

#include "shared_imp.h"
+ #include "rc_imp.h"
#include "save_opts.h"
#include "cs_imp.h"
#include "mbx_imp.h"
#include "ss_imp.h"

#if ANSI_C
#define S_(x) static x;
***************
*** 97,107 ****
} f6;


- union F14 {
- void * ptr;
- provides_shared_MCF_f * f14;
- } f14;
-
struct reg_list *r = & (i->regs[reg_idx]);

if (&use_shared_connect != r->var)
--- 97,102 ----
***************
*** 121,127 ****
f5.ptr = dlsym(i->handle, "provides_shared_IMAP_CAPA");
f6.ptr = dlsym(i->handle, "provides_shared_SEOT");

- f14.ptr = dlsym(i->handle, "provides_shared_MCF");

if (!f1.f1) {
DPRINT(Debug,7,(&Debug," ... NO provides_shared_CT\n"));
--- 116,121 ----
***************
*** 143,151 ****
DPRINT(Debug,7,(&Debug, " ... NO provides_shared_SEOT\n"));
}

- if (!f14.f14) {
- DPRINT(Debug,7,(&Debug, " ... NO provides_shared_MCF\n"));
- }



--- 137,142 ----
***************
*** 324,365 ****
#endif


-
- if (f14.f14) {
- int count;
- size_t s_res14, s_opt_size;
-
- struct mailer_config *res14 = f14.f14(&count,&s_res14,
- &s_opt_size);
-
- if (s_res14 != sizeof (*res14)) {
- DPRINT(Debug,1,(&Debug,
- "... struct mailer_config mismatch: %d should be %d\n",
- s_res14,sizeof (*res14)));
- } else if (s_opt_size != sizeof (struct mailer_option_list)) {
- DPRINT(Debug,1,(&Debug,
- "... struct mailer_option_list mismatch: %d should be %d\n",
- s_opt_size,sizeof (struct mailer_option_list)));
- } else {
- int x;
-
- shared_MCF_types =
- safe_realloc(shared_MCF_types,
- sizeof (shared_MCF_types[0]) *
- (shared_MCF_type_count + count));
-
- DPRINT(Debug,7,(&Debug," ... provides_shared_MCF: (shared_MCF_types) count %d\n",
- count));
- res = 1;
-
- for (x = 0; x < count; x++) {
- shared_MCF_types[shared_MCF_type_count+x].T = &(res14[x]);
- shared_MCF_types[shared_MCF_type_count+x].imp_idx = i;
- }
- shared_MCF_type_count += count;
- }
- }
-
i->regs[reg_idx].valid = res;

return res;
--- 315,320 ----
***************
*** 402,423 ****
NULL, 0
};

- struct mailer_config * loc_mailer_type(f)
- char *f;


- {
- int x;
-

- /* We must load all connect libraries */
- load_shared_libs1(&use_shared_connect);
-
-
- for (x = 0; x < shared_MCF_type_count; x++)
- if (0 == strcmp(shared_MCF_types[x].T->mailer_type,f)) {
- return shared_MCF_types[x].T;
- }


- return NULL;
- }
-

/* ------------------------------------------------------------------------ */


--- 357,362 ----
Index: elm2.4.ME+.122-cvs/lib/state.c
*** elm2.4.ME+.121/lib/state.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/state.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: state.c,v 1.10 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: state.c,v 1.12 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 25,37 ****
panic("STATE PANIC",f,ln,pr,ms,0);
}

- static unsigned char *s2us P_((char *str));
- static unsigned char *s2us(str)
- char *str;


- {
- return (unsigned char *)str;
- }
-

static CONST unsigned char *cs2us P_((const char *str));
static CONST unsigned char *cs2us(str)
CONST char *str;
--- 25,30 ----
***************
*** 862,867 ****
--- 855,862 ----
}
r = add_streambyte_to_string(s->filter_line,ch);
if (!r) {
+ uint16 BAD = UNICODE_BAD_CHAR;
+
DPRINT(Debug,10,(&Debug,
"state_putc: failed to add byte %d to charset %s\n",
ch,
***************
*** 869,874 ****
--- 864,871 ----
s->filter_line->string_type->MIME_name :
"<not set>"));

+ /* Indicate bad character */
+ add_unicode_to_string(s->filter_line,1,&BAD);
}

if ('\n' == ch) {
***************
*** 951,956 ****
--- 948,955 ----
for (i = 0; i < len; i++) {
if ('\n' == string[i]) {
int r;


+ int errors = 0;

+
if (!s->filter_line) {
if (!s->filter) {
/* STATE_out_dir also requires s->display_charset[0]
***************
*** 961,967 ****
s->filter_line = new_string(s->filter);
}
r = add_streambytes_to_string(s->filter_line,
! i-first+1,cs2us(string+first));
if (r < i-first+1) {
DPRINT(Debug,10,(&Debug,
"state_put: failed to add all streambytes to string (r=%d != %d=len), ret=%d, charset %s\n",
--- 960,967 ----
s->filter_line = new_string(s->filter);
}
r = add_streambytes_to_string(s->filter_line,
! i-first+1,cs2us(string+first),
! &errors);
if (r < i-first+1) {
DPRINT(Debug,10,(&Debug,
"state_put: failed to add all streambytes to string (r=%d != %d=len), ret=%d, charset %s\n",
***************
*** 974,985 ****
--- 974,993 ----
return first + r; /* FAILURE */
}

+ if (errors) {
+ DPRINT(Debug,10,(&Debug,
+ "state_put: %d errors\n",
+ errors));
+ }
+
flush_filter(s, 0);
first = i+1;
}
}
if (first < len) {
int r;


+ int errors = 0;

+
if (!s->filter_line) {
if (!s->filter) {
/* STATE_out_dir also requires s->display_charset[0]
***************
*** 991,997 ****
}

r = add_streambytes_to_string(s->filter_line,
! len-first,cs2us(string+first));
if (r < len-first) {
DPRINT(Debug,10,(&Debug,
"state_put: failed to add all streambytes to string (r=%d != %d=len), ret=%d\n",
--- 999,1006 ----
}

r = add_streambytes_to_string(s->filter_line,
! len-first,cs2us(string+first),
! &errors);
if (r < len-first) {
DPRINT(Debug,10,(&Debug,
"state_put: failed to add all streambytes to string (r=%d != %d=len), ret=%d\n",
***************
*** 1005,1010 ****
--- 1014,1026 ----

return first + r; /* FAILURE */
}
+
+
+ if (errors) {
+ DPRINT(Debug,10,(&Debug,
+ "state_put: %d errors\n",
+ errors));
+ }
}

DPRINT(DebugIO,30,(&DebugIO,
Index: elm2.4.ME+.122-cvs/lib/string.c
*** elm2.4.ME+.121/lib/string.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/string.c 2005-07-01 12:15:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: string.c,v 1.39 2004/04/24 12:30:02 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.39 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: string.c,v 1.43 2005/07/01 09:15:04 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 134,139 ****
--- 134,140 ----
res->p->len = 0;
res->p->state = NULL;
res->p->private_flag = 0; /* Mostly not used */
+ res->p->lang = NULL;

res->string_type->charset_type->cs_init_it(res);
return res;
***************
*** 160,165 ****
--- 161,188 ----
return res;
}

+ struct string * new_langstring(set,lang)
+ charset_t set;
+ char *lang;
+ {
+ struct string *res;
+
+ DPRINT(Debug,60,(&Debug,"new_langstring(set=%p '%s', lang=%s)\n",
+ set,
+ set->MIME_name ? set->MIME_name : "<none>",
+ lang));
+
+ res = malloc_string(set);
+ res->p->lang = safe_strdup(lang);
+
+ DPRINT(Debug,60,(&Debug,"new_langstring=%p (type=%p '%s')\n",
+ res,
+ res->string_type->charset_type,
+ res->string_type->charset_type->type_name));
+
+ return res;
+ }
+
struct string * new_string2 P_((charset_t set,
CONST unsigned char *data));
struct string * new_string2(set,data)
***************
*** 167,172 ****
--- 190,196 ----
CONST unsigned char *data;
{
struct string * res;
+ int ERRORS = 0;

DPRINT(Debug,60,(&Debug,
"new_string2: set=%p '%s'\n",
***************
*** 181,194 ****
res->string_type->charset_type->
cs_add_streambytes_to_it(res,
strlen(cus2s(data)),
! data);

DPRINT(Debug,60,(&Debug,
! "new_string2=%p (type=%p '%s'): len=%d\n",
res,
res->string_type->charset_type,
res->string_type->charset_type->type_name,
! res->p->len));
return res;
}

--- 205,219 ----
res->string_type->charset_type->
cs_add_streambytes_to_it(res,
strlen(cus2s(data)),
! data,&ERRORS);

DPRINT(Debug,60,(&Debug,
! "new_string2=%p (type=%p '%s'): len=%d ERRORS=%d\n",
res,
res->string_type->charset_type,
res->string_type->charset_type->type_name,
! res->p->len,
! ERRORS));
return res;
}

***************
*** 218,223 ****
--- 243,257 ----



(*str)->string_type->charset_type->cs_free_it(*str);

+ if ((*str)->p->state) {
+ free_state_internal(&((*str)->p->state));
+ }
+

+ if ((*str)->p->lang) {
+ free((*str)->p->lang);
+ (*str)->p->lang = NULL;
+ }
+

free((*str)->p);
(*str)->p = NULL;
(*str)->string_type = NULL;

***************
*** 226,231 ****
--- 260,289 ----
*str = NULL;
}

+ CONST char * get_string_lang(str)
+ CONST struct string *str;
+ {
+ if (!charset_valid_magic(str->string_type))
+ panic("STRING PANIC",__FILE__,__LINE__,"get_string_lang",
+ "Bad magic number (string type)",0);
+
+ if (str->p->magic != CS_str_magic)
+ panic("STRING PANIC",__FILE__,__LINE__,"get_string_lang",
+ "Bad magic number (str_private_data)",0);
+
+ return str->p->lang;
+ }
+
+ CONST char * get_string_MIME_name(str)
+ CONST struct string *str;
+ {
+ if (!charset_valid_magic(str->string_type))
+ panic("STRING PANIC",__FILE__,__LINE__,"get_string_MIME_name",
+ "Bad magic number (string type)",0);
+
+ return str->string_type->MIME_name;
+ }
+
int add_streambyte_to_string(str,ch)
struct string *str;
int ch;
***************
*** 272,284 ****
return r;
}

! int add_streambytes_to_string(str,count,data)


struct string *str;
int count;
CONST unsigned char *data;
{

int r;

if (!charset_valid_magic(str->string_type))
panic("STRING PANIC",__FILE__,__LINE__,"add_streambytes_to_string",
"Bad magic number (string type)",0);
--- 330,345 ----
return r;
}

! int add_streambytes_to_string(str,count,data, errors)


struct string *str;
int count;
CONST unsigned char *data;
+ int *errors;
{

int r;

+ int ERRORS = 0;
+
if (!charset_valid_magic(str->string_type))
panic("STRING PANIC",__FILE__,__LINE__,"add_streambytes_to_string",
"Bad magic number (string type)",0);
***************
*** 307,316 ****
count,data));
}

! r = str->string_type->charset_type->cs_add_streambytes_to_it(str,
! count,data);

! DPRINT(Debug,60,(&Debug,"add_streambytes_to_string=%d\n",r));

return r;
}
--- 368,380 ----
count,data));
}

! r = str->string_type->charset_type->cs_add_streambytes_to_it(str, count,data, &ERRORS);
!
! if (errors)
! *errors = ERRORS;

! DPRINT(Debug,60,(&Debug,"add_streambytes_to_string=%d ERRORS=%d\n",
! r,ERRORS));

return r;
}
***************
*** 433,444 ****
--- 497,517 ----
0 != (charset_properties(str2 -> string_type) & CS_mapping))) {
ret = malloc_string(str2 -> string_type);
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str2);
+
+ if (str2->p->lang) {
+ ret->p->lang = safe_strdup(str2->p->lang);
+ }
+
} else if (str2->p->len == 0 &&
(!printind ||
0 != (charset_properties(str1 -> string_type) & CS_mapping))) {
ret = malloc_string(str1 -> string_type);
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str1);

+ if (str1->p->lang) {
+ ret->p->lang = safe_strdup(str1->p->lang);
+ }
+
} else if (str1 -> string_type == str2 -> string_type) {
/* 1) Same CHARSET */

***************
*** 447,452 ****
--- 520,530 ----
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str1);
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str2);

+ if (str1->p->lang && str2->p->lang &&
+ 0 == strcmp(str1->p->lang, str2->p->lang)) {
+ ret->p->lang = safe_strdup(str1->p->lang);
+ }
+
} else if (str1 -> string_type -> charset_type ==
str2 -> string_type -> charset_type &&
charset_superset_of(str1 -> string_type,str2 -> string_type)) {
***************
*** 457,462 ****
--- 535,545 ----
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str1);
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str2);

+ if (str1->p->lang && str2->p->lang &&
+ 0 == strcmp(str1->p->lang, str2->p->lang)) {
+ ret->p->lang = safe_strdup(str1->p->lang);
+ }
+
} else if (str1 -> string_type -> charset_type ==
str2 -> string_type -> charset_type &&
charset_superset_of(str2 -> string_type,str1 -> string_type)) {
***************
*** 466,471 ****
--- 549,559 ----

ret->string_type->charset_type->cs_add_intdata_to_it(ret,str1);
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str2);
+
+ if (str1->p->lang && str2->p->lang &&
+ 0 == strcmp(str1->p->lang, str2->p->lang)) {
+ ret->p->lang = safe_strdup(str1->p->lang);
+ }

} else if (printind &&
0 != (charset_properties(str1 -> string_type) & CS_mapping) &&
***************
*** 491,496 ****
--- 579,588 ----
add_name_to_string(ret,csUs(str2 -> string_type -> MIME_name));
add_name_to_string(ret,csUs("?]"));
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str2);
+
+ } else if (0 == str1->p->len && 0 == str2->p->len) {
+ /* Avoid mallocing null vector */
+ ret = malloc_string(display_charset);
} else {
/* 4) Unrelated CHARSETs -- so we try use display charset instead */
int i;
***************
*** 526,531 ****
--- 618,629 ----

ret->string_type->charset_type->cs_add_unicodedata_to_it(ret,l,vector);
free(vector);
+
+ if (str1->p->lang && str2->p->lang &&
+ 0 == strcmp(str1->p->lang, str2->p->lang)) {
+ ret->p->lang = safe_strdup(str1->p->lang);
+ }
+
}

DPRINT(Debug,60,(&Debug,
***************
*** 564,571 ****
}

int string_cmp(str1,str2,unknown_val)


! struct string *str1;
! struct string *str2;

int unknown_val;
{
int ret = 0;
--- 662,669 ----
}

int string_cmp(str1,str2,unknown_val)


! CONST struct string *str1;
! CONST struct string *str2;

int unknown_val;


{
int ret = 0;
***************

*** 678,683 ****
--- 776,786 ----
ret = malloc_string(str -> string_type);
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str);

+ if (str->p->lang) {
+ ret->p->lang = safe_strdup(str->p->lang);
+ }
+
+
DPRINT(Debug,60,(&Debug,"dup_string=%p ('%s'; type=%p '%s')\n",
ret,
ret->string_type->MIME_name ?
***************
*** 725,730 ****
--- 828,839 ----
} else if (set == str->string_type) {
/* 1) Same charset */
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str);
+
+ if (str->p->lang) {
+ ret->p->lang = safe_strdup(str->p->lang);
+ }
+
+
} else if (printind &&
0 != (charset_properties(set) & CS_mapping) &&
0 == (charset_properties(str -> string_type) & CS_mapping) &&
***************
*** 751,756 ****
--- 860,870 ----

ret->string_type->charset_type->cs_add_unicodedata_to_it(ret,l,vector);
free(vector);
+
+ if (str->p->lang) {
+ ret->p->lang = safe_strdup(str->p->lang);
+ }
+
}

DPRINT(Debug,60,(&Debug,
***************
*** 1107,1112 ****
--- 1221,1230 ----
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str);
}

+ if (str->p->lang) {
+ ret->p->lang = safe_strdup(str->p->lang);
+ }
+
DPRINT(Debug,60,(&Debug,
"ascify_string=%p ('%s'; type=%p '%s'): len=%d\n",
ret,
Index: elm2.4.ME+.122-cvs/lib/stringtok.c
*** elm2.4.ME+.121/lib/stringtok.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/stringtok.c 2005-07-01 20:06:08.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: stringtok.c,v 1.4 2004/03/27 18:31:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: stringtok.c,v 1.6 2005/07/01 17:06:08 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 30,56 ****
{ 0x005B /* [ */, 0x005D /* ] */ }
};

! static int is_special P_((int x));
! static int is_special(x)
int x;
{
switch (x) {
case 0x0028 /* '(' */ :
case 0x0029 /* ')' */ :
- case 0x003C /* '<' */ :
- case 0x003E /* '>' */ :
- case 0x003A /* ':' */ :
- case 0x0040 /* '@' */ :
case 0x002C /* ',' */ :
case 0x003B /* ';' */ :
case 0x005C /* '\\'*/ :
case 0x0022 /* '"' */ :
- case 0x002E /* '.' */ :
case 0x005B /* '[' */ :
case 0x005D /* ']' */ :

return x;
}
return 0;
}

--- 30,75 ----
{ 0x005B /* [ */, 0x005D /* ] */ }
};

! static int is_special P_((int x, int flags));
! static int is_special(x,flags)
int x;
+ int flags;
{
switch (x) {
case 0x0028 /* '(' */ :
case 0x0029 /* ')' */ :
case 0x002C /* ',' */ :
+ case 0x003A /* ':' */ :
case 0x003B /* ';' */ :
case 0x005C /* '\\'*/ :
case 0x0022 /* '"' */ :
case 0x005B /* '[' */ :
case 0x005D /* ']' */ :

return x;
}
+
+ if (flags & TOK_mail) {
+ switch (x) {
+ case 0x003C /* '<' */ :
+ case 0x003E /* '>' */ :
+ case 0x002E /* '.' */ :
+ case 0x0040 /* '@' */ :
+
+ return x;
+ }
+ }
+
+
+ if (flags & TOK_mime) {
+ switch (x) {
+ case 0x003D /* = */ :
+ case 0x002F /* / */ :
+
+ return x;


+ }
+ }
+
return 0;
}

***************
*** 72,79 ****
#define NUM_pair ( sizeof pairs / sizeof (pairs[0]))


! struct string_token * string_tokenize(line)
CONST struct string *line;
{
struct string_token * result = NULL;
int result_len = 0;
--- 91,99 ----
#define NUM_pair ( sizeof pairs / sizeof (pairs[0]))


! struct string_token * string_tokenize(line,flags)
CONST struct string *line;
+ int flags;
{
struct string_token * result = NULL;
int result_len = 0;
***************
*** 147,153 ****
goto add_token;
}

! special = is_special(code);
if (!special) {
int start = i;
int len;
--- 167,173 ----
goto add_token;
}

! special = is_special(code,flags);
if (!special) {
int start = i;
int len;
***************
*** 157,163 ****

if (is_space(code))
break;
! if (is_special(code))
break;
}
len = i - start;
--- 177,183 ----

if (is_space(code))
break;
! if (is_special(code,flags))
break;
}
len = i - start;
Index: elm2.4.ME+.122-cvs/lib/strtokq.c
*** elm2.4.ME+.121/lib/strtokq.c 2004-03-30 19:38:44.000000000 +0300
--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************
*** 1,83 ****
- static char rcsid[] = "@(#)$Id: strtokq.c,v 1.5 2004/03/27 18:31:41 hurtta Exp $";


-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $
- *
- * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
- * (was hurtt...@ozone.FMI.FI)
- ******************************************************************************

- * The Elm Mail System
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- *****************************************************************************/
-
-
- /* Like strtok, but returns quoted strings as one token (quotes removed)
- * if flag is non-null. Quotes and backslahes can be escaped with backslash.
- */


-
- #include "headers.h"
-

- /* Why there is ' -- it is not quote character in mail.
- * - K E H <hur...@ozone.FMI.FI>
- */
-
- char *strtokq(source, keys, flag)
- char *source, *keys;
- int flag;


- {
- register int last_ch;

- static char *sourceptr = NULL;
- char *return_value;


-
- if (source != NULL)

- sourceptr = source;
-
- if (sourceptr == NULL || *sourceptr == '\0')

- return(NULL); /* we hit end-of-string last time!? */
-

- sourceptr += strspn(sourceptr, keys); /* skip leading crap */


-
- if (*sourceptr == '\0')

- return(NULL); /* we've hit end-of-string */
-

- if (flag)
- if (*sourceptr == '"' || *sourceptr == '\'') { /* quoted string */
- register char *sp;
- char quote = *sourceptr++;
-
- for (sp = sourceptr; *sp != '\0' && *sp != quote; sp++)
- if (*sp == '\\') sp++; /* skip escaped characters */
- /* expand_macros will fix them later */


-
- return_value = sourceptr;

- sourceptr = sp;
- if (*sourceptr != '\0') sourceptr++;
- *sp = '\0'; /* zero at end */
-
- return return_value;
- }
-
- last_ch = strcspn(sourceptr, keys); /* end of good stuff */


-
- return_value = sourceptr; /* and get the ret */
-
- sourceptr += last_ch; /* ...value */
-

- if (*sourceptr != '\0') /* don't forget if we're at END! */
- sourceptr++; /* and skipping for next time */


-
- return_value[last_ch] = '\0'; /* ..ending right */
-

- return((char *) return_value); /* and we're outta here! */
- }
-
- /*


- * Local Variables:
- * mode:c
- * c-basic-offset:4
- * buffer-file-coding-system: iso-8859-1
- * End:
- */

-
--- 0 ----
Index: elm2.4.ME+.122-cvs/lib/syscall.c
*** elm2.4.ME+.121/lib/syscall.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/syscall.c 2005-05-21 20:58:32.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.13 2004/07/12 17:48:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.18 2005/05/21 17:58:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 52,62 ****
DPRINT(Debug,5,(&Debug, "No run_tty_init_hook ...\n"));
}

! static int no_SR_ClearScreen P_((void));
! static int no_SR_ClearScreen()
{
DPRINT(Debug,5,(&Debug, "No ClearScreen_hook ...\n"));
- return 0;


}

static char *us2s P_((unsigned char *str));

--- 52,61 ----
DPRINT(Debug,5,(&Debug, "No run_tty_init_hook ...\n"));
}

! static void no_SR_ClearScreen P_((void));
! static void no_SR_ClearScreen()
{
DPRINT(Debug,5,(&Debug, "No ClearScreen_hook ...\n"));


}

static char *us2s P_((unsigned char *str));

***************
*** 185,194 ****
/* Optionally override the SHELL environment variable. */
if (options&SY_ENV_SHELL) {
static char sheq[] = "SHELL=";
! char * sh = ((options & SY_USER_SHELL) ? shell : "/bin/sh");
! int size = sizeof(sheq) + strlen(sh);

! char *p = malloc(size);
if (p) {
elm_sfprintf(p, size,
FRM("%s%s"), sheq, sh);
--- 184,202 ----
/* Optionally override the SHELL environment variable. */
if (options&SY_ENV_SHELL) {
static char sheq[] = "SHELL=";
! char * sh = "/bin/sh";
! int size;
! char *p;
!
! if (0 != (options & SY_USER_SHELL)) {
! char * s = give_dt_estr_as_str(&shell_e,"shell");
! if (s)
! sh = s;
! }

! size = sizeof(sheq) + strlen(sh);
!
! p = malloc(size);
if (p) {
elm_sfprintf(p, size,
FRM("%s%s"), sheq, sh);
***************
*** 202,207 ****
--- 210,217 ----



#ifdef BACKGROUD_PROCESSES /* We assume POSIX in here */

+ VOLATILE int handle_sigchld = 0; /* got SIGCHLD */
+
static struct process_list {
union any_fd fd;
char * message;
***************
*** 216,221 ****
--- 226,232 ----
{
SIGDPRINT(Debug,2,(&Debug,
"got_sigchld: Setting handle_sigchld\n"));
+
handle_sigchld = 1;


}

***************
*** 602,610 ****
raw_exit(rs);
return 0;
}
fcntl(pfd[0], F_SETFD, 1);
fcntl(pfd[1], F_SETFD, 1);
!
rs->pid = fork();

if (rs->pid == -1) {

--- 613,627 ----
raw_exit(rs);
return 0;
}
+
+ #ifdef FD_CLOEXEC


+ fcntl(pfd[0], F_SETFD, FD_CLOEXEC);
+ fcntl(pfd[1], F_SETFD, FD_CLOEXEC);
+ #else
fcntl(pfd[0], F_SETFD, 1);
fcntl(pfd[1], F_SETFD, 1);
! #endif
!
rs->pid = fork();

if (rs->pid == -1) {

Index: elm2.4.ME+.122-cvs/lib/terminal.c
*** elm2.4.ME+.121/lib/terminal.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/terminal.c 2005-03-27 20:54:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.40 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.47 2005/03/27 17:54:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 20,26 ****

enum terminal_map_keyword { terminal_bad = -1, terminal_iso2022 = 0,
terminal_private = 1, terminal_iso2022_mb = 2,
! terminal_flag = 3, terminal_iso2022_like = 4
};

enum terminal_flags { terminal_bad_flag = -1,
--- 20,27 ----

enum terminal_map_keyword { terminal_bad = -1, terminal_iso2022 = 0,
terminal_private = 1, terminal_iso2022_mb = 2,
! terminal_flag = 3, terminal_iso2022_like = 4,
! terminal_dw
};

enum terminal_flags { terminal_bad_flag = -1,
***************
*** 46,51 ****
--- 47,53 ----
charset_t charset;
struct setlist * iso2022_info;
} iso2022_like;
+ char * dw_charset;
} value;
};

***************
*** 64,69 ****
--- 66,74 ----
return terminal_private;
if (0 == istrcmp(word,"FLAG"))
return terminal_flag;
+ if (0 == istrcmp(word,"DW"))
+ return terminal_dw;
+

return terminal_bad;
}
***************
*** 535,540 ****
--- 540,552 ----
char * c3;
int size;
int i;
+ case terminal_dw:
+ result[result_len].keyword = kw;
+ result[result_len].value.dw_charset = safe_strdup(c2);
+ result[result_len].match = safe_strdup(c);
+ result_len++;
+ break;
+
case terminal_iso2022:
case terminal_iso2022_mb:
result[result_len].keyword = kw;
***************
*** 791,798 ****
--- 803,819 ----
result[result_len].match = NULL;
result[result_len].keyword = terminal_bad;

+
+ if (!feof(f)) {
+ DPRINT(Debug,3,(&Debug,
+ "load_terminal_map: %s, All results not readed\n",
+ filename));
+ }
+
fclose(f);

+
+
DPRINT(Debug,10,(&Debug,
"load_terminal_map: %s, result_len=%d\n",
filename,result_len));
***************
*** 822,827 ****
--- 843,857 ----
char *s;
int i;

+ case terminal_dw:
+ fputs(ptr->match,f);
+ fputc('\t',f);
+ fputs("DW",f);
+ fputc('\t',f);
+ fputs(ptr->value.dw_charset,f);
+ fputc('\n',f);
+ break;
+
case terminal_iso2022:
case terminal_iso2022_mb:
fputs(ptr->match,f);
***************
*** 953,973 ****


return terminal_bad_flag;
}

!

/* Hopefully quite safe to be called from signal handler */
static struct terminal_map_item * loc_info P_((const char *terminal,

! charset_t set));

! static struct terminal_map_item * loc_info(terminal,set)
CONST char *terminal;
charset_t set;
{
int i;

! SIGDPRINT(Debug,9,(&Debug,"** Looking terminal %s (set %s)\n",
terminal,
! set->MIME_name ? set->MIME_name : "<no MIME name>"));

for (i = 0; i < 2; i++) {
struct terminal_map_item *ptr = user_terminal_map;
--- 983,1027 ----
return terminal_bad_flag;
}

! int match_charset_name(cs1,cs2)


! charset_t cs1;
! charset_t cs2;
! {
!
! if (cs1 == cs2)
! return 1;
!
! if (!cs1 || !cs2)

! return 0;
!

! if (cs1->MIME_name && cs2->MIME_name &&
! 0 == istrcmp(cs1->MIME_name,cs2->MIME_name)) {
!
! SIGDPRINT(Debug,9,(&Debug,
! "** Matched charset by name %s (%p) == %s (%p)\n",
! cs1->MIME_name,cs1,
! cs2->MIME_name,cs2));
! return 1;

! }
! return 0;
! }

/* Hopefully quite safe to be called from signal handler */
static struct terminal_map_item * loc_info P_((const char *terminal,

! charset_t set,
! int only_switch));

! static struct terminal_map_item * loc_info(terminal,set, only_switch)
CONST char *terminal;
charset_t set;
+ int only_switch;
{
int i;

! SIGDPRINT(Debug,9,(&Debug,"** Looking terminal %s (set %s)%s\n",
terminal,
! set->MIME_name ? set->MIME_name : "<no MIME name>",
! only_switch ? " charset switches only" : ""));

for (i = 0; i < 2; i++) {
struct terminal_map_item *ptr = user_terminal_map;


***************
*** 984,990 ****
0 == strncmp(ptr->match,terminal,c - ptr->match))) {

if (ptr->keyword == terminal_iso2022 &&
! ptr->value.iso2022.charset == set) {
SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 match %s\n",
ptr->match));

--- 1038,1044 ----


0 == strncmp(ptr->match,terminal,c - ptr->match))) {

if (ptr->keyword == terminal_iso2022 &&

! match_charset_name(ptr->value.iso2022.charset,set)) {


SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 match %s\n",
ptr->match));

***************
*** 992,998 ****
}

if (ptr->keyword == terminal_iso2022_mb &&
! ptr->value.iso2022.charset == set) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 MB match %s\n",
ptr->match));

--- 1046,1052 ----


}

if (ptr->keyword == terminal_iso2022_mb &&

! match_charset_name(ptr->value.iso2022.charset,set)) {



SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 MB match %s\n",
ptr->match));
***************
*** 1001,1007 ****
}

if (ptr->keyword == terminal_iso2022_like &&
! ptr->value.iso2022_like.charset == set) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022-LIKE match %s\n",
ptr->match));

--- 1055,1061 ----


}

if (ptr->keyword == terminal_iso2022_like &&

! match_charset_name(ptr->value.iso2022_like.charset,set)) {



SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022-LIKE match %s\n",
ptr->match));
***************
*** 1010,1016 ****
}

if (ptr->keyword == terminal_private &&
! ptr->value.private.charset == set) {
if (ptr->value.private.condition) {
if (!eval_condition(ptr->value.private.condition)) {
goto no_this;

--- 1064,1070 ----


}

if (ptr->keyword == terminal_private &&

! match_charset_name(ptr->value.private.charset, set)) {


if (ptr->value.private.condition) {
if (!eval_condition(ptr->value.private.condition)) {
goto no_this;
***************

*** 1022,1027 ****
--- 1076,1099 ----

return ptr;
}
+
+ if (ptr->keyword == terminal_dw && set->MIME_name &&
+ 0 == istrcmp(set->MIME_name,ptr->value.dw_charset)) {
+
+ if (only_switch) {
+
+ SIGDPRINT(Debug,9,(&Debug,"-- Found DW match %s (ignored)\n",
+ ptr->match));
+
+ goto no_this;
+
+ }
+ SIGDPRINT(Debug,9,(&Debug,"-- Found DW match %s\n",
+ ptr->match));
+

+ return ptr;
+ }
+
}

no_this:
ptr++;
***************
*** 1038,1050 ****
{

int i;

/* Can not switch to other sets if can not
switch back to display_charset
*/
! if (!loc_info(terminal,display_charset))
return;

for (i = 0; i < 2; i++) {
struct terminal_map_item *ptr = user_terminal_map;

--- 1110,1125 ----
{

int i;
+ struct terminal_map_item * back;

/* Can not switch to other sets if can not
switch back to display_charset
*/
! back = loc_info(terminal,display_charset,1);
! if (!back)
return;

+
for (i = 0; i < 2; i++) {
struct terminal_map_item *ptr = user_terminal_map;

***************
*** 1138,1144 ****
int silent;
{

! struct terminal_map_item * a = loc_info(terminal,set);

if (!a) {
if (!silent)
--- 1213,1219 ----
int silent;
{

! struct terminal_map_item * a = loc_info(terminal,set,1);

if (!a) {
if (!silent)
***************
*** 1151,1157 ****
return 0;
}

! a = loc_info(terminal,display_charset);

if (!a) {
if (!silent)
--- 1226,1232 ----
return 0;
}

! a = loc_info(terminal,display_charset,1);

if (!a) {
if (!silent)
***************
*** 1359,1364 ****
--- 1434,1444 ----

for (i = 0; i < sizeof (p->width) / sizeof (p->width[0]); i++)
p->width[i] = -1;
+
+ #ifdef WCHAR
+ p->wcwidth = 0;
+ #endif
+
}

void free_terminal_info(p)
***************
*** 1554,1559 ****
--- 1634,1665 ----


LAST_COMPLAIN = NULL;
LAST_COMPLAIN_b = NULL;

+ if (terminal_info->set_count > 0 &&
+ terminal_info->sets[0].type == iso2022_other) {
+
+ if (same_setid(terminal_info->sets[0],
+ *(iso2022_info->sets[0]))) {
+
+ DPRINT(Debug,8,(&Debug,

+ "terminal_charset_post_init: Terminal was on no ISO2022 mode ... NO change\n"));
+
+ return NULL;
+
+ } else {
+

+ char *c;
+
+ DPRINT(Debug,8,(&Debug,
+ "terminal_charset_post_init: Terminal was on no ISO2022 mode ... returning to ISO2022\n"));
+
+ c = iso2022_setid_stream(return_to_iso2022,NULL,0);
+ ret = strmcat(ret,c);
+ free(c);
+
+ reset_display_settings(terminal_info);

+ }
+ }
+

/* Remove assignments which does not belong to iso2022_info */
for (k = 0; k < 4; k++) {
if (terminal_info->bank[k] >= max) {
***************
*** 1565,1570 ****

--- 1671,1678 ----


}
}

+
+
if (bank_unspecified != iso2022_info->initial_L &&
terminal_info->current_L != iso2022_info->initial_L) {
char *c = lock_shift(0,terminal_info->current_L,NULL,0);

***************
*** 1757,1763 ****
}

terminal_info->sets[setpos] = ID;
! terminal_info->width[setpos] = -1; /* Initially no with */
}

terminal_info->bank[ID.bank] = setpos;
--- 1865,1871 ----
}

terminal_info->sets[setpos] = ID;
! terminal_info->width[setpos] = -1; /* Initially no width */
}

terminal_info->bank[ID.bank] = setpos;
***************
*** 1895,1904 ****
iso2022_96x96 == ID.type))
terminal_info->width[n] = 2;
else
! terminal_info->width[n] = 1;
}
}

for (i = 0;
i < sizeof (iso2022_info->sets) /
sizeof (iso2022_info->sets[0]) &&
--- 2003,2017 ----
iso2022_96x96 == ID.type))
terminal_info->width[n] = 2;
else
! terminal_info->width[n] = 1;
!
}
}

+ #ifdef WCHAR
+ terminal_info->wcwidth = MB;
+ #endif
+
for (i = 0;
i < sizeof (iso2022_info->sets) /
sizeof (iso2022_info->sets[0]) &&
***************
*** 1926,1932 ****
change_helper_2(&ret,ID,terminal_info,buffer,size,
maybe_signal,setpos);

! /* Do not support varaiable width inside of bank */
if (MB &&
(iso2022_94x94 == ID.type ||
iso2022_96x96 == ID.type))
--- 2039,2045 ----
change_helper_2(&ret,ID,terminal_info,buffer,size,
maybe_signal,setpos);

! /* Do not support variable width inside of bank */
if (MB &&
(iso2022_94x94 == ID.type ||
iso2022_96x96 == ID.type))
***************
*** 1940,1983 ****
*RET = ret;
}

/* May be called from signal handler -- on that situation use
buffer specified as argument -- otherwise result is malloced
*/
! char * terminal_switch_to(terminal,set,terminal_info,buffer,size)
char *terminal;
charset_t set;
! screen_info_p *terminal_info;
char * buffer;
int size;
{
int maybe_signal = buffer != NULL;

char *ret = NULL;
! struct terminal_map_item * a = loc_info(terminal,set);
!
! if (!a)
! return NULL;
!
! if (maybe_signal) {
! SIGDPRINT(Debug,8,(&Debug,
! "terminal_switch_to: buffer=%p size=%d\n",
! buffer,size));
! }

! if (!*terminal_info) {
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",
! "*terminal_info not set",maybe_signal);
}
!
! if (DISPLAY_STATE_magic != (*terminal_info)->magic)
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",
"Bad terminal_info (bad magic)",
maybe_signal);

! if ((*terminal_info)->set_count > 0 &&
! (*terminal_info)->sets[0].type == iso2022_other) {
SIGDPRINT(Debug,8,(&Debug,
"Terminal was on no ISO2022 mode ... returning\n"));
if (maybe_signal)
--- 2053,2216 ----
*RET = ret;
}

+ void terminal_change_system_charset(terminal)
+ char *terminal;
+ {
+ struct terminal_map_item * a = loc_info(terminal,system_charset,0);


+
+ if (system_charset->charset_type == &cs_unknown) {

+ DPRINT(Debug,9,(&Debug,"terminal_change_system_charset: System charset is already type unknown\n"));
+ return;
+ }
+

+ #if defined(WCHAR) && defined(__STDC_ISO_10646__)

+ if (a && a->keyword == terminal_dw) {
+ change_system_charset_1();
+ }
+ #endif
+
+ }
+
+
+ char * terminal_set_info (terminal,set,terminal_info)
+ char *terminal;
+ charset_t set;
+ screen_info_p terminal_info;
+ {
+ char * ret = NULL;
+ struct terminal_map_item * a;
+
+ if (!terminal_info) {


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "terminal_set_info",
+ "terminal_info not set",0);
+ }
+
+ if (DISPLAY_STATE_magic != terminal_info->magic)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "terminal_set_info",
+ "Bad terminal_info (bad magic)",
+ 0);
+
+ /* We do not reset bank settings on here */
+ #ifdef WCHAR
+ terminal_info->wcwidth = 0;
+ #endif
+
+ a = loc_info(terminal,set,0);
+ if (!a)
+ return ret;
+
+ switch (a->keyword) {
+ case terminal_dw: {


+ static int warned = 0;
+

+ #ifdef WCHAR
+ if (&cs_unknown != set->charset_type ||
+ 0 == (CS_printable_len & charset_properties(set))) {
+
+ if (!warned)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeUnsupportedDW,
+ "Double wide characters are not supported"));
+
+ warned = 1;


+ return NULL;
+ }
+

+ terminal_info->wcwidth = 1;
+
+ #else
+
+ if (!warned)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeUnsupportedDW,
+ "Double wide characters are not supported"));
+
+ warned = 1;
+ #endif
+ }
+ break;
+
+ case terminal_iso2022_mb: {
+ static int warned = 0;
+
+ if (0 == (CS_printable_len & charset_properties(set))) {
+
+ if (!warned)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeUnsupportedDW,
+ "Double wide characters are not supported"));
+
+ warned = 1;


+ return ret;
+ }
+

+ if (set->iso2022_info)
+ change_helper_3(&ret,set->iso2022_info,terminal_info,NULL,0,0,1);
+
+ #ifdef WCHAR
+ terminal_info->wcwidth = 1;
+ #endif


+ }
+ break;
+ }
+

+
+ #ifdef WCHAR
+ SIGDPRINT(Debug,8,(&Debug,
+ "terminal_set_info: wcwidth=%d\n",
+ terminal_info->wcwidth));
+ #endif
+
+
+
+ return ret;
+ }
+
+
/* May be called from signal handler -- on that situation use
buffer specified as argument -- otherwise result is malloced
*/
! char * terminal_switch_to(terminal,set,terminal_info,buffer,size,silent)
char *terminal;
charset_t set;
! screen_info_p terminal_info;
char * buffer;
int size;
+ int silent;
{
int maybe_signal = buffer != NULL;

char *ret = NULL;
! struct terminal_map_item * a = loc_info(terminal,set,1);

! if (!terminal_info) {
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",
! "terminal_info not set",maybe_signal);
}
!
! if (DISPLAY_STATE_magic != (terminal_info)->magic)
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",
"Bad terminal_info (bad magic)",
maybe_signal);
+
+
+ if (!a) {
+ return NULL;
+ }

!
! if (maybe_signal) {
! SIGDPRINT(Debug,8,(&Debug,
! "terminal_switch_to: buffer=%p size=%d\n",
! buffer,size));
! }
!
! if ((terminal_info)->set_count > 0 &&
! (terminal_info)->sets[0].type == iso2022_other) {
SIGDPRINT(Debug,8,(&Debug,
"Terminal was on no ISO2022 mode ... returning\n"));
if (maybe_signal)
***************
*** 1986,2005 ****
ret = iso2022_setid_stream(return_to_iso2022,NULL,0);
}

! reset_display_settings(*terminal_info);

switch(a->keyword) {
case terminal_iso2022:
case terminal_iso2022_mb:
! if (set->iso2022_info) {
! SIGDPRINT(Debug,8,(&Debug,
! "Using ISO 2022 code for assignment\n"));
!
! change_helper_3(&ret,set->iso2022_info,*terminal_info,
! buffer,size,maybe_signal,
! a->keyword == terminal_iso2022_mb);
! }
! break;

case terminal_iso2022_like:

--- 2219,2260 ----
ret = iso2022_setid_stream(return_to_iso2022,NULL,0);
}

! reset_display_settings(terminal_info);

switch(a->keyword) {
+ int mb;
case terminal_iso2022:
case terminal_iso2022_mb:
! if (set->iso2022_info) {
! SIGDPRINT(Debug,8,(&Debug,
! "Using ISO 2022 code for assignment\n"));
!
! mb = 0;
!
! if (a->keyword == terminal_iso2022_mb) {
! if (0 != (CS_printable_len & charset_properties(set)))
! mb = 1;
! else if (!silent) {
! static int warned = 0;
!
! if (!warned)
! lib_error(CATGETS(elm_msg_cat, MeSet,
! MeUnsupportedDW,
! "Double wide characters are not supported"));
!
! warned = 1;
! }
! }
!
! change_helper_3(&ret,set->iso2022_info,terminal_info,
! buffer,size,maybe_signal,
! mb);
! } else {
! SIGDPRINT(Debug,1,(&Debug,
! "No ISO 2022 code for changing charset!\n"));
!
! }
! break;

case terminal_iso2022_like:

***************
*** 2007,2013 ****
"Using ISO 2022 LIKE code for assignment\n"));

change_helper_3(&ret,a->value.iso2022_like.iso2022_info,
! *terminal_info,
buffer,size,maybe_signal,0);

break;
--- 2262,2268 ----
"Using ISO 2022 LIKE code for assignment\n"));

change_helper_3(&ret,a->value.iso2022_like.iso2022_info,
! terminal_info,
buffer,size,maybe_signal,0);

break;
***************
*** 2025,2030 ****
--- 2280,2291 ----

}

+ #ifdef WCHAR
+ SIGDPRINT(Debug,8,(&Debug,
+ "terminal_switch_to: wcwidth=%d\n",
+ (terminal_info)->wcwidth));
+ #endif
+
if (maybe_signal && ret && ret != buffer)
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",
Index: elm2.4.ME+.122-cvs/lib/unidata.c
*** elm2.4.ME+.121/lib/unidata.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/unidata.c 2005-01-17 21:09:37.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.28 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.29 2005/01/17 19:09:37 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 84,90 ****
uint16 value; /* backpointer to character */
uint16 storage; /* pointer/index to decomp storage */
uint8 type_byte;
! uint8 len_byte; /* legth of decomposed data on storage */
};

static struct decomp_cell_1 unassigned_decomp_buffer = {
--- 84,90 ----
uint16 value; /* backpointer to character */
uint16 storage; /* pointer/index to decomp storage */
uint8 type_byte;
! uint8 len_byte; /* length of decomposed data on storage */
};

static struct decomp_cell_1 unassigned_decomp_buffer = {
Index: elm2.4.ME+.122-cvs/lib/write_rc.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/lib/write_rc.c 2005-07-05 20:53:37.000000000 +0300
***************
*** 0 ****
--- 1,293 ----
+ static char rcsid[] = "@(#)$Id: write_rc.c,v 1.2 2005/07/05 17:53:37 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
+ *****************************************************************************
+ * Some code based on ../src/save_opts.c
+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1992 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************/
+
+ #include "headers.h"
+ #include "rc_imp.h"
+ #include "save_opts.h"
+ #include "s_elmrc.h"


+
+ #include <errno.h>
+ #ifndef ANSI_C

+ extern int errno;
+ #endif
+
+ DEBUG_VAR(Debug,__FILE__,"config");
+
+ int write_rc(targetfile,commentfile,global,actor,username)
+ char *targetfile;
+ FILE * commentfile;
+ int global;
+ char *actor;
+ char *username;
+ {
+ int close_comment_file = 0;
+ char *tmp = NULL;
+ int res = 0;
+ int errcode;
+
+ int x;
+ FILE *f;
+
+ if (!commentfile) {
+ commentfile = fopen(ELMRC_INFO,"r");
+ if (!commentfile)
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet,
+ ElmrcSavingWithoutComments,
+ "Warning: saving without comments! Can't get to %s."),
+ ELMRC_INFO);
+ else
+ close_comment_file++;
+
+ }
+
+
+ tmp = elm_message(FRM("%s.N"),targetfile);
+
+ errcode = can_open(tmp,"w");
+
+ if (errcode) {
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcFileNotWriteable,
+ "File %s is not writeable: %s"),
+ tmp, error_description(errcode));
+
+ res = 0;


+ goto fail;
+ }
+

+
+ f = fopen(tmp,"w");
+ if (!f) {


+ int errcode = errno;

+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcFileNotWriteable,
+ "File %s is not writeable: %s"),
+ tmp, error_description(errcode));
+
+ res = 0;


+ goto fail;
+ }
+

+ if (username && username[0])
+ elm_fprintf(f,
+ CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoFor1,
+ "# Saved automatically by %s %s for %s\n#\n\n"),
+ actor, version_buff, username);
+ else
+ elm_fprintf(f,
+ CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoWrite1,
+ "# Saved automatically by %s %s\n#\n\n"),
+ actor,version_buff);
+
+
+ if (commentfile) {
+ char line_buffer[SLEN];
+ int x;
+ int len;
+ int local_value;
+ int skip = 1;
+
+ while (0 < (len =
+ mail_gets(line_buffer, sizeof line_buffer,
+ commentfile))) {
+
+ int y = 0;
+
+ if (line_buffer[len-1] != '\n') {
+ DPRINT(Debug,1,(&Debug,
+ "Too long line (read len=%d): %s\n",
+ len,line_buffer));
+ break;
+ }
+ line_buffer[--len] = '\0';


+ if (0 == len)

+ continue;
+
+ if ('#' == line_buffer[0] || whitespace(line_buffer[0])) {
+
+ if (strncmp(line_buffer, "#$HDR", 5) == 0) {
+ skip = 0;
+ continue;
+ }
+
+ if (skip)
+ continue;
+
+ /* Copy initial comments */
+
+ fprintf(f,"%s\n",line_buffer);
+ continue;
+ }
+ skip = 1;
+
+
+ for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
+ y = strcmp(line_buffer, save_info[x].name);
+ if (y <= 0)
+ break;
+ }
+
+ if (x >= NUMBER_OF_SAVEABLE_OPTIONS || y != 0) {
+
+ DPRINT(Debug,15,(&Debug,
+ "Skipping option %s ... \n",
+ line_buffer));
+
+ continue;
+ }
+
+ if (global &&
+ ! (save_info[x].flags & FL_CHANGED) &&
+ ! (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping user option %s ... \n",
+ line_buffer));
+
+ continue;
+ }
+
+ if (!global &&
+ (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping system option %s ... \n",
+ line_buffer));
+
+ continue;
+ }
+
+ fprintf(f,"\n");
+
+ /* Copy comments */
+ while (0 < (len =
+ mail_gets(line_buffer, sizeof line_buffer,
+ commentfile))) {
+ if ('#' != line_buffer[0])
+ break;
+ fputs(line_buffer,f);
+ }
+
+ if (global)
+ local_value = save_info[x].flags & FL_CHANGED;
+ else
+ local_value = save_info[x].flags & FL_LOCAL;
+ if (RCTYPE_magic != save_info[x].dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"main",
+ "Bad config item type",0);
+
+ DPRINT(Debug,15,(&Debug,
+ "Writing option %s ... %s\n",
+ save_info[x].name,
+ local_value ? "(local value)" : ""));
+
+ save_info[x].dt_type->print_value(f,
+ & save_info[x],
+ !local_value);
+
+
+ save_info[x].flags |= FL_SAVED;
+ }
+ }
+
+ for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
+ int local_value;
+
+
+ if (save_info[x].flags & FL_SAVED)
+ continue;
+
+ if (global &&
+ ! (save_info[x].flags & FL_CHANGED) &&
+ ! (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping user option %s ... \n",
+ save_info[x].name));
+
+ continue;
+ }
+
+ if (!global &&
+ (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping system option %s ... \n",
+ save_info[x].name));
+
+ continue;
+ }
+
+ fprintf(f,"\n");
+
+ if (global)
+ local_value = save_info[x].flags & FL_CHANGED;
+ else
+ local_value = save_info[x].flags & FL_LOCAL;
+ if (RCTYPE_magic != save_info[x].dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"main",
+ "Bad config item type",0);
+
+ DPRINT(Debug,15,(&Debug,
+ "Writing option %s ... %s (no comment)\n",
+ save_info[x].name,
+ local_value ? "(local value)" : ""));
+
+
+ save_info[x].dt_type->print_value(f,
+ & save_info[x],
+ !local_value);
+ }
+
+ #ifdef USE_DLOPEN
+ print_local_shared_options(f,global);
+ #endif
+
+ if (EOF == fclose(f)) {


+ int errcode = errno;

+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcFileNotWriteable,
+ "File %s is not writeable: %s"),
+ tmp, error_description(errcode));
+
+ res = 0;
+ goto fail;
+ }
+
+ if (0 != rename(tmp,targetfile)) {


+ int errcode = errno;

+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcFileNotRenamed,
+ "Failed to rename temporary file to %s: %s"),
+ targetfile, error_description(errcode));
+
+ res = 0;


+ goto fail;
+ }
+

+ res = 1;
+
+ fail:
+ if (tmp)
+ free(tmp);
+
+ if (close_comment_file)
+ fclose(commentfile);
+
+ return res;


+ }
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

+
Index: elm2.4.ME+.122-cvs/Makefile-1.SH
*** elm2.4.ME+.121/Makefile-1.SH 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/Makefile-1.SH 2005-04-30 11:58:17.000000000 +0300
***************
*** 27,33 ****
echo "Extracting Makefile-1 (with variable substitutions)"
cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.12 2004/05/02 16:58:30 hurtta Exp $


#
#
# Makefile for the ELM (ME+) mail program.

--- 27,33 ----
echo "Extracting Makefile-1 (with variable substitutions)"
cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.15 2005/04/30 08:58:17 hurtta Exp $


#
#
# Makefile for the ELM (ME+) mail program.
***************

*** 60,66 ****
libreg

$(ETC)/elm.rc: $(LIB)/elmrc-write doc/elmrc-info
! $(REG) -s doc {$(LIB)/elmrc-write} -G -I -C {doc/elmrc-info}
$(REG) $(CHMOD) u=rw,go=r {$@}

$(LIB)/elm.map.bin/unidata.bin: $(LIB) $(LIB)/elm.map.bin \
--- 60,67 ----
libreg

$(ETC)/elm.rc: $(LIB)/elmrc-write doc/elmrc-info
! $(REG) -s doc {$(LIB)/elmrc-write} -G -I -C {doc/elmrc-info} \
! -c {$(ETC)/elm.rc.old-values}
$(REG) $(CHMOD) u=rw,go=r {$@}

$(LIB)/elm.map.bin/unidata.bin: $(LIB) $(LIB)/elm.map.bin \
***************
*** 116,124 ****
# Register new libraries and unregister removed libraries
# Also libraries which are not loadable are unregistered
libreg:
! \$(REG) {\$(LIB)/elmlibregister} -G -I $aa
!SUBS!
!
;;
*)

--- 117,133 ----
# Register new libraries and unregister removed libraries
# Also libraries which are not loadable are unregistered
libreg:
! \$(REG) {\$(LIB)/elmlibregister} -G -I -c {\$(ETC)/elm.rc.old-values}
!SUBS!
! for domake in $aa ; do
! cat >>Makefile-1 <<!SUBS!
! \$(REG) -M "$domake" {\$(LIB)/elmlibregister} -G -I -c {\$(ETC)/elm.rc.old-values} $domake
! !SUBS!
! done
! cat >>Makefile-1 <<'!NO!SUBS!'
! $(REG) -M all -s doc {$(LIB)/elmrc-write} -G -I -C {doc/elmrc-info} \
! -c {$(ETC)/elm.rc.old-values} {$(ETC)/elm.rc.old-values}
! !NO!SUBS!
;;
*)

Index: elm2.4.ME+.122-cvs/Makefile.SH
*** elm2.4.ME+.121/Makefile.SH 2004-02-25 21:39:18.000000000 +0200
--- elm2.4.ME+.122-cvs/Makefile.SH 2005-05-30 11:34:44.000000000 +0300
***************
*** 18,33 ****
*) sln='ln';;
esac

echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.20 2004/02/20 19:38:07 hurtta Exp $
#
# Makefile for the entire ELM mail system


#
# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! #
#

# Variables established by Configure
--- 18,39 ----
*) sln='ln';;
esac

+ liblist="mailer"
+
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.24 2005/05/30 08:34:44 hurtta Exp $
#
# Makefile for the entire ELM mail system


#
+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on Makefile.SH. That code was following copyright:


+ #
# (C) Copyright 1986,1987, by Dave Taylor
# (C) Copyright 1988-1992, USENET Community Trust
! ######################################################################
#

# Variables established by Configure
***************

*** 66,73 ****

install: config.h config.sh hdrs/sysdefs.h Makefile installer all
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) install_s
! bin/elmregister replay
! bin/elmregister unstage

uninstall: config.h config.sh installer
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) uninstall_s
--- 72,79 ----

install: config.h config.sh hdrs/sysdefs.h Makefile installer all
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) install_s


! bin/elmregister replay -M all

! bin/elmregister unstage -M all

uninstall: config.h config.sh installer
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) uninstall_s
***************
*** 75,88 ****

Kari E. Hurtta

unread,
Jul 13, 2005, 5:43:29 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.4

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 4/18
=========================================================================


+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_soft_reset_s_unknown",


+ "Bad magic number",0);
+

+ if (!warned &&
+ !mbsinit(&(st->p->a.wchar.s))) {
+ warned = 1;
+ lib_error(CATGETS(elm_msg_cat, MeSet,MeUnknownUnsupportedKB,
+ "Unknown charsets are unsupported as keyboard input!"));
+ }


+
+ memset(&(st->p->a.wchar.s), 0, sizeof(st->p->a.wchar.s));

+ st->p->a.wchar.value = L'\0';
+ }
+ else
+ #endif
+ {
+ st->p->a.byte = 0;
+ }
+
+ }
+
+ S_(cs_add_streambyte_to_state cs_add_streambyte_to_s_unknown)
+ static int cs_add_streambyte_to_s_unknown P_((struct charset_state *st,
+ int ch));
+ static int cs_add_streambyte_to_s_unknown(st,ch)
+ struct charset_state *st;
+ int ch;
+ {
+ #ifdef WCHAR


+ if (st->charset == system_charset) {

+ size_t x;
+ CONST char s = ch;
+

+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)

+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_streambyte_to_s_unknown",


+ "Bad magic number",0);
+

+ x = mbrtowc(& st->p->a.wchar.value, &s, 1, &(st->p->a.wchar.s));
+
+ if ((size_t)(-2) == x) {
+ DPRINT(Debug,62,(&Debug, "cs_add_streambyte_to_s_unknown: Incomplete sequence -- OK\n"));
+
+ return 1;
+ }
+
+ if ((size_t)(-1) == x) {
+ DPRINT(Debug,4,(&Debug,
+ "cs_add_streambyte_to_s_unknown: mbrtowc failed: errno = %d\n",
+ errno));


+
+ memset(&(st->p->a.wchar.s), 0, sizeof(st->p->a.wchar.s));
+ st->p->a.wchar.value = L'\0';

+
+ return 0;
+ }
+

+ st->p->ready = 1;
+ }
+ else
+ #endif
+ {
+ st->p->ready = 1;
+ st->p->a.byte = ch;
+ }
+ return 1;
+ }
+
+
+
+ S_(cs_add_streambyte_to_string cs_add_streambyte_to_unknown)
+ static int cs_add_streambyte_to_unknown P_((struct string *str,int ch));
+ static int cs_add_streambyte_to_unknown(str,ch)
+ struct string *str;
+ int ch;
+ {
+ #ifdef WCHAR
+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);
+
+ #endif
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambyte_to_unknown",


+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR
+

+ if (!str->p->state)

+ str->p->state = new_state_1(str->string_type);
+
+ if (str->p->state->charset->charset_type != &cs_unknown)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_streambyte_to_unknown",
+ "Bad state",0);
+
+ if (!cs_add_streambyte_to_s_unknown(str->p->state,ch)) {
+ DPRINT(Debug,10,(&Debug,
+ "cs_add_streambyte_to_unknown: Failed to add byte\n"));
+ return 0;
+ }
+
+ if (str->p->state->p->ready) {
+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+1)*
+ sizeof (wchar_t));
+
+ str->p->a.wchars[str->p->len++] =
+ str->p->state->p->a.wchar.value;
+ str->p->state->p->ready = 0;
+ }
+ return 1;


+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_free_unknown",
+ "No wchar_t support",0);
+ #endif
+ } else {
+ /* Use bytes (raw form) */
+

+ /* NOTE: str->p->a.bytes is not NUL terminated */
+
+ str->p->a.bytes = safe_realloc(str->p->a.bytes,str->p->len+1);
+ str->p->a.bytes[str->p->len++] = ch;
+ }


+ return 1;
+ }
+

+ S_(cs_add_state_to_string cs_add_state_to_unknown)
+ static void cs_add_state_to_unknown P_((struct string *str,
+ struct charset_state *ch));
+ static void cs_add_state_to_unknown(str,ch)
+ struct string *str;
+ struct charset_state *ch;
+ {
+ if (str->string_type->charset_type !=
+ ch->charset->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_state_to_unknown",
+ "String/state type mismatch",0);
+
+ #ifdef WCHAR
+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);
+
+ #endif
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_state_to_unknown",


+ "private_flag set for non-system charset",0);

+
+
+ #ifdef WCHAR

+ if (ch->charset != system_charset)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_state_to_unknown",
+ "Oops",0);
+
+ if (STATE_WCHAR_magic != ch->p->a.wchar.magic)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_state_to_unknown",


+ "Bad magic number",0);
+
+

+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+1)*
+ sizeof (wchar_t));
+
+ str->p->a.wchars[str->p->len++] =
+ ch->p->a.wchar.value;
+
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_state_to_unknown",


+ "No wchar_t support",0);
+ #endif
+ } else {
+ /* Use bytes (raw form) */

+
+ #ifdef WCHAR
+ if (ch->charset == system_charset)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_state_to_unknown",
+ "Oops",0);
+ #endif
+
+ /* NOTE: str->p->a.bytes is not NUL terminated */
+
+ str->p->a.bytes = safe_realloc(str->p->a.bytes,str->p->len+1);
+ str->p->a.bytes[str->p->len++] = ch->p->a.byte;
+ }
+ }
+
+ S_(cs_state_same_char cs_s_unknown_same_char)
+ static int cs_s_unknown_same_char P_((struct charset_state *A,
+ struct charset_state *B,
+ int ignore_case));
+ static int cs_s_unknown_same_char(A,B,ignore_case)
+ struct charset_state *A;
+ struct charset_state *B;
+ int ignore_case;
+ {
+
+ if (A->charset != B->charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_s_unknown_same_char",
+ "Oops",0);
+
+ #ifdef WCHAR
+ if (A->charset == system_charset) {
+ wchar_t c2;
+ wchar_t c1;
+
+ if (STATE_WCHAR_magic != A->p->a.wchar.magic)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_s_unknown_same_char",


+ "Bad magic number",0);

+ if (STATE_WCHAR_magic != B->p->a.wchar.magic)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_s_unknown_same_char",


+ "Bad magic number",0);
+

+ c1 = A->p->a.wchar.value ;
+ c2 = B->p->a.wchar.value ;
+ if (c1 == c2)
+ return 1;
+
+ if (ignore_case &&
+ towlower(c1) == towlower(c2))
+ return 1;


+
+ return 0;
+ }

+ else
+ #endif
+ {

+ unsigned char c2 = B->p->a.byte;
+ unsigned char c1 = A->p->a.byte;
+
+ if (c1 == c2)
+ return 1;
+
+ if (!ignore_case)
+ return 0;
+
+ return -1; /* Use UNICODE comparision on upper level instead */
+ }
+ }
+
+
+ S_(cs_add_streambytes_to_string cs_add_streambytes_to_unknown)
+ /* Returns number of bytes added */
+ static int cs_add_streambytes_to_unknown P_((struct string *str,
+ int count,
+ const unsigned char *data,
+ int *errors));
+ static int cs_add_streambytes_to_unknown(str,count,data,errors)
+ struct string *str;
+ int count;
+ CONST unsigned char *data;
+ int *errors;


+ {
+ int i;
+

+ if (count < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_unknown",
+ "Negative length",0);
+
+ *errors = 0;
+
+ #ifdef WCHAR
+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);
+ #endif
+
+ if (count > 0) {
+ /* realloc with size 0 is equivalent of free and may
+ corrupt memory ...
+ */
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_unknown",


+ "private_flag set for non-system charset",0);

+
+
+ #ifdef WCHAR
+

+ if (!str->p->state)

+ str->p->state = new_state_1(str->string_type);
+
+ if (str->p->state->charset->charset_type != &cs_unknown)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_streambytes_to_unknown",
+ "Bad state",0);
+
+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+count)*
+ sizeof (wchar_t));
+
+
+ for (i = 0; i < count; i++) {
+ if (!cs_add_streambyte_to_s_unknown(str->p->state,data[i])) {
+ DPRINT(Debug,10,(&Debug,
+ "cs_add_streambytes_to_unknown: Failed to add byte, idx=%d\n",
+ i));
+
+ (*errors)++;
+ str->p->a.wchars[str->p->len++] = L'?';
+ continue;
+ }
+
+ if (str->p->state->p->ready) {
+ str->p->a.wchars[str->p->len++] =
+ str->p->state->p->a.wchar.value;
+ str->p->state->p->ready = 0;
+ }
+ }
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",


+ "No wchar_t support",0);
+ #endif

+
+ } else {


+ /* Use bytes (raw form) */
+

+ /* NOTE: str->p->a.bytes is not NUL terminated */
+ str->p->a.bytes = safe_realloc(str->p->a.bytes,str->p->len+count);
+ for (i = 0; i < count; i++)
+ str->p->a.bytes[str->p->len++] = data[i];
+ return count;


+ }
+ }
+ return 0;

+ }
+
+ S_(cs_add_intdata_to_string cs_add_intdata_to_unknown)
+ static void cs_add_intdata_to_unknown P_((struct string *str,
+ const struct string *data));
+ static void cs_add_intdata_to_unknown(str,data)
+ struct string *str;
+ CONST struct string *data;


+ {
+ int i;
+

+ if (str->string_type->charset_type !=
+ data->string_type->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_intdata_to_unknown",
+ "String type mismatch",0);
+
+
+ if (data->p->len > 0) {
+ /* realloc with size 0 is equivalent of free and may
+ corrupt memory ...
+ */


+
+
+ #ifdef WCHAR

+ if (!str->p->private_flag &&
+ data->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);
+ if (!data->p->private_flag &&
+ str->p->private_flag &&
+ data->string_type == system_charset)
+ convert_to_wchar(data);
+ #endif
+
+ if (str->p->private_flag &&
+ data->p->private_flag) {


+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset ||

+ data->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_intdata_to_unknown",


+ "private_flag set for non-system charset",0);

+
+
+ #ifdef WCHAR
+

+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+data->p->len)*
+ sizeof (wchar_t));
+ for (i = 0; i < data->p->len; i++)
+ str->p->a.wchars[str->p->len++] = data->p->a.wchars[i];
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_intdata_to_unknown",


+ "No wchar_t support",0);
+ #endif

+
+ } else {
+
+ if (str->p->private_flag ||
+ data->p->private_flag)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_intdata_to_unknown",
+ "Ooops -- MIME subtypes of unknown charset is not supported",0);
+
+
+ /* NOTE: str->p->a.bytes is not NUL terminated */
+ str->p->a.bytes = safe_realloc(str->p->a.bytes,
+ data->p->len+str->p->len);
+
+ for (i = 0; i < data->p->len; i++)
+ str->p->a.bytes[str->p->len++] = data->p->a.bytes[i];

+
+ }
+ }
+ }
+
+
+

+ static uint16 cs_unicode_unknown_helper P_((unsigned int ch,
+ charset_t set, int *found));
+ static uint16 cs_unicode_unknown_helper(ch,set, found)
+ unsigned int ch;
+ charset_t set;
+ int *found;
+ {
+ *found = 0;
+
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position
+ */
+
+ /* If charset is system character set then assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+ if (set == system_charset) {
+ uint16 val = map_fallback(ch);
+ if (val != MAPPING_NONE) {
+ *found = 1;
+ return val;
+ }
+ }
+
+ if (ch < 32) {
+ *found = 1;
+ return ch;
+ }
+ return 0x003F; /* '?' */


+
+ }
+
+ #ifdef WCHAR

+ static uint16 cs_unicode_unknown_whelper P_((wint_t ch,
+ charset_t set, int *found));
+ static uint16 cs_unicode_unknown_whelper(ch,set, found)
+ wint_t ch;
+ charset_t set;
+ int *found;
+ {
+ uint16 val;
+ int c1;
+
+ *found = 0;
+
+ if (set != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_unicode_unknown_whelper",
+ "Not a system charset",0);
+
+ /* This function is used only for system charset
+ *
+ * Assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ val = map_wfallback(ch);
+ if (val != MAPPING_NONE) {
+ *found = 1;
+ return val;
+ }
+
+ /* returns EOF if character is not exactly one byte long */
+ c1 = wctob(ch);
+
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position
+ *
+ */
+
+ if (c1 < 32 && c1 >= 0) {
+ *found = 1;
+ return c1;
+ }
+
+ return 0x003F; /* '?' */

+ }
+ #endif
+
+

+ /* Does compression, recalculation and so on ...
+ so 'const' is not very const
+ */
+ S_(cs_check_length_string cs_check_length_unknown)
+ static void cs_check_length_unknown P_((const struct string *str));
+ static void cs_check_length_unknown(str)


+ CONST struct string *str;
+ {
+

+ #ifdef WCHAR
+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);
+ #endif
+
+ /* No compression */
+ }
+
+ S_(cs_give_unicode_from_string cs_give_unicode_from_unknown)
+ static uint16 cs_give_unicode_from_unknown P_((const struct string *str,
+ int pos, int *found));
+ static uint16 cs_give_unicode_from_unknown(str,pos,found)


+ CONST struct string *str;

+ int pos;
+ int *found;
+ {
+ if (pos < 0 || pos >= str->p->len)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_give_unicode_from_unknown",
+ "Index out of array",0);
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */

+
+ #ifdef WCHAR
+ wchar_t ch;


+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_give_unicode_from_unknown",


+ "private_flag set for non-system charset",0);

+
+ ch = str->p->a.wchars[pos];
+
+ return cs_unicode_unknown_whelper(ch,str->string_type,found);
+
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_give_unicode_from_unknown",


+ "No wchar_t support",0);

+ return MAPPING_NONE; /* Not reached */
+ #endif
+ } else {
+ unsigned char ch;


+ /* Use bytes (raw form) */

+
+ ch = str->p->a.bytes[pos];
+ return cs_unicode_unknown_helper(ch,str->string_type,found);
+ }
+ }
+
+ S_(cs_give_unicode_from_state cs_give_unicode_from_s_unknown)
+ static uint16 cs_give_unicode_from_s_unknown P_((struct charset_state *st,
+ int *found));
+ static uint16 cs_give_unicode_from_s_unknown(st,found)
+ struct charset_state *st;
+ int *found;


+ {
+
+ #ifdef WCHAR

+ if (st->charset == system_charset) {

+ wchar_t ch;
+

+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)

+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_give_unicode_from_s_unknown",


+ "Bad magic number",0);
+

+ ch = st->p->a.wchar.value;
+ return cs_unicode_unknown_whelper(ch,st->charset,found);
+ }
+ else
+ #endif
+ {
+
+ unsigned char ch;
+
+ ch = st->p->a.byte;
+ return cs_unicode_unknown_helper(ch,st->charset,found);
+ }
+ }
+
+ S_(cs_add_unicodedata_to_string cs_add_unicodedata_to_unknown)
+ static void cs_add_unicodedata_to_unknown P_((struct string *str,
+ int len, const uint16 *data));
+ static void cs_add_unicodedata_to_unknown(str,len,data)
+ struct string *str;
+ int len;
+ CONST uint16 *data;


+ {
+ int i;
+

+ if (len > 0) {
+ /* realloc with size 0 is equivalent of free and may
+ corrupt memory ...
+ */
+
+ #ifdef WCHAR
+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);
+ #endif
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_unicodedata_to_unknown",


+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR
+

+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+len)*
+ sizeof (wchar_t));
+
+ for (i = 0; i < len; i++) {
+ wint_t ch = 0;
+ int found = 0;
+
+ /* str->p->private_flag is set only if charset
+ * is system character set.
+ *
+ * Assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ ch = map_wfallback_rev(data[i],&found);
+ if (found)
+ str->p->a.wchars[str->p->len++] = ch;
+
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position
+ */
+
+ if (!found && data[i] < 32)
+ str->p->a.wchars[str->p->len++] = btowc(data[i]);
+
+ /*
+ * If map_wfallback_rev() is given replacement character
+ * we use it.
+ */
+
+ else if (ch && !found)
+ str->p->a.wchars[str->p->len++] = ch;
+
+ }
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",


+ "No wchar_t support",0);
+ #endif

+
+ } else {


+ /* Use bytes (raw form) */
+

+ /* NOTE: str->p->a.bytes is not NUL terminated */
+ str->p->a.bytes = safe_realloc(str->p->a.bytes,len+str->p->len);
+

+ for (i = 0; i < len; i++) {

+ unsigned char ch = 0;
+ int found = 0;
+
+ /* If charset is system character set assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ if (str->string_type == system_charset) {
+ ch = map_fallback_rev(data[i],&found);
+ if (found)
+ str->p->a.bytes[str->p->len++] = ch;
+ }
+
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position
+ */
+
+ if (!found && data[i] < 32)
+ str->p->a.bytes[str->p->len++] = data[i];
+
+ /* Because character set is unknow we do not know any
+ * replacement character what we can use, therefore
+ * we add nothing.
+ *
+ * If however map_fallback_rev() is given replacement character
+ * we use it.
+ */
+
+ else if (ch && !found)
+ str->p->a.bytes[str->p->len++] = ch;


+
+ }
+ }
+ }
+ }
+

+ S_(cs_cmp_string cs_cmp_unknown)
+ static int cs_cmp_unknown P_((const struct string *str1,const struct string *str2));
+ static int cs_cmp_unknown(str1,str2)
+ CONST struct string *str1;
+ CONST struct string *str2;


+ {
+ int i;
+

+ if (str1->string_type->charset_type !=
+ str2->string_type->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_cmp_unknown",
+ "String type mismatch",0);
+
+ #ifdef WCHAR
+ if (!str1->p->private_flag &&
+ str2->p->private_flag)
+ convert_to_wchar(str1);
+ if (!str2->p->private_flag &&
+ str1->p->private_flag)
+ convert_to_wchar(str2);
+ #endif
+
+
+ if (str1->p->private_flag &&
+ str2->p->private_flag) {


+ /* Use wchars (locale) */
+

+ /* If str1->p->private_flag is set, charset is

+ * locale charset
+ */

+ if (str1->string_type != system_charset ||
+ str2->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_cmp_unknown",


+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR
+

+ for (i = 0; i < str1->p->len && i < str2->p->len; i++) {
+ if (str1->p->a.wchars[i] < str2->p->a.wchars[i])
+ return -1;
+ if (str1->p->a.wchars[i] > str2->p->a.wchars[i])
+ return 1;
+ }
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_cmp_unknown",


+ "No wchar_t support",0);
+ #endif

+
+ } else {


+ /* Use bytes (raw form) */

+
+ if (str1->p->private_flag ||
+ str2->p->private_flag)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_cmp_unknown",
+ "Ooops",0);
+
+ for (i = 0; i < str1->p->len && i < str2->p->len; i++) {
+ if (str1->p->a.bytes[i] < str2->p->a.bytes[i])
+ return -1;
+ if (str1->p->a.bytes[i] > str2->p->a.bytes[i])
+ return 1;
+ }
+ }
+
+ if (i < str1->p->len)
+ return 1;
+ if (i < str2->p->len)
+ return -1;


+ return 0;
+ }
+

+ S_(cs_state_printable cs_s_unknown_printable)
+ static int cs_s_unknown_printable P_((struct charset_state *st));
+ static int cs_s_unknown_printable(st)
+ struct charset_state *st;
+ {
+ #ifdef WCHAR


+ if (st->charset == system_charset) {

+ wint_t ch;
+

+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)

+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_s_unknown_printable",


+ "Bad magic number",0);
+

+ ch = st->p->a.wchar.value;
+ return iswprint(ch);


+ }
+ else
+ #endif

+ {
+ #ifndef ASCII_CTYPE


+ if (st->charset == system_charset)

+ return cs_s_locale_printable(st);
+ #endif
+ }
+
+ return -1; /* Use unicode values */
+ }
+
+
+ /* If character corresponds one byte on stream, returns it.
+ * Otherwise returns 0. This is used implement ReadCh().
+ * It is assumed that returned character corresponds to
+ * code character set (and perhaps also US-ASCII)
+ */
+ S_(cs_state_is_onebyte cs_s_unknown_is_onebyte)
+ static int cs_s_unknown_is_onebyte P_((struct charset_state *st));
+ static int cs_s_unknown_is_onebyte(st)
+ struct charset_state *st;
+ {
+ #ifdef WCHAR


+ if (st->charset == system_charset) {

+ wint_t ch;
+ int c1;
+

+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)

+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_s_unknown_printable",


+ "Bad magic number",0);
+

+ ch = st->p->a.wchar.value;
+
+ /* returns EOF if character is not exactly one byte long */
+ c1 = wctob(ch);
+
+ if (EOF == c1)
+ return 0;
+ return c1;

+ }
+ else
+ #endif

+ {
+ unsigned char c1 = st->p->a.byte;
+ return c1;
+ }
+ }
+
+ S_(cs_stream_from_string cs_stream_from_unknown)
+ static unsigned char *cs_stream_from_unknown P_((const struct string *str,
+ int printable,
+ screen_info_p terminal,
+ int *reslen));
+ static unsigned char *cs_stream_from_unknown(str,printable,terminal,reslen)


+ CONST struct string *str;

+ int printable;
+ screen_info_p terminal; /* NOT USED */
+ int *reslen;
+ {
+ unsigned char * ret = NULL;
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */

+
+ #ifdef WCHAR
+

+ int alloced;
+ int l;
+ mbstate_t State;
+ wchar_t * tmp;
+ const wchar_t *src, *ctmp;
+ int i;
+

+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_stream_from_unknown",


+ "private_flag set for non-system charset",0);
+

+ /* NOTE: str->p->a.wchars is not NUL terminated

+ *
+ * ! ! ! NOTE! this do not convert strings including \0
+ * characters
+ */
+

+ tmp = safe_malloc((str->p->len + 1) * sizeof (tmp[0]));
+ for (i = 0; i < str->p->len; i++) {
+ wchar_t c = str->p->a.wchars[i];
+
+ if (printable && !iswprint(c))
+ c = L'?';
+ tmp[i] = c;
+ }
+ tmp[i] = L'\0';
+
+ ctmp = (const wchar_t *) tmp;


+
+ memset(&State, 0, sizeof(State));
+
+

+ alloced = str->p->len+1;
+
+ ret = safe_malloc(alloced);
+
+
+ for (src = ctmp, l = 0; src; ) {


+ int left = alloced - l;

+ size_t r = wcsrtombs(ret+l,&src,left,&State);


+
+ if ((size_t)(-1) == r) {

+ int pos = src-ctmp;
+
+ if (L'?' == *src)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_stream_from_unknown",


+ "? not convertible",0);

+ if (L'\0' == *src)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_stream_from_unknown",


+ "Ooops",0);
+
+

+ DPRINT(Debug,61,(&Debug,
+ "cs_stream_from_unknown: Failed to convert 0x%04x at %d: errno = %d\n",
+ (int)*src,pos,errno));
+
+
+ tmp[pos] = L'?';
+
+ } else {
+

+ if (l >= 0)
+ l += r;
+ else

+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_stream_from_unknown",
+ "Unexpected return from wcsrtombs()",0);
+
+ if (src) {
+ int x;
+
+ x = str->p->len - (src-tmp);
+
+ alloced += x + MB_CUR_MAX;
+
+ ret = safe_realloc(ret,alloced);
+ }
+ }
+ }
+
+ if ('\0' != ret[l])


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_stream_from_unknown",


+ "\\0 not written",0);
+

+ free(tmp); tmp = NULL;
+
+ *reslen = l;
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",


+ "No wchar_t support",0);
+ #endif

+
+ } else {


+ /* Use bytes (raw form) */
+

+ #ifndef ASCII_CTYPE
+ if (printable &&
+ str->string_type == system_charset)
+ return cs_stream_from_locale(str,reslen);
+ #endif
+
+ if (!printable) {
+ int l = 0,i;
+
+ ret = safe_malloc(str->p->len+1);
+
+ for (i = 0; i < str->p->len; i++)
+ ret[l++] = str->p->a.bytes[i];
+ ret[l] = '\0';
+ *reslen = l;
+
+ } else if (str->string_type == system_charset) {
+ int l = 0,i;
+ ret = safe_malloc(str->p->len+1);
+
+ /* If charset is system character set assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ for (i = 0; i < str->p->len; i++) {
+ uint16 val = map_fallback(str->p->a.bytes[i]);
+
+ if (val != MAPPING_NONE &&
+ val >= 0x0020)
+ ret[l++] = str->p->a.bytes[i];
+ else
+ ret[l++] = '?'; /* See above ... */
+ }
+ ret[l] = '\0';
+ *reslen = l;
+
+ } else {
+ /* Because charset is unknown we do not have able to print
+ * printable characters -- also we do not know replacement
+ * characters...
+ */
+
+ ret = s2us(safe_strdup(""));
+ *reslen = 0;
+ }
+ }


+ return ret;
+ }
+
+

+ S_(cs_streamclip_from_string cs_streamclip_from_unknown)
+ static unsigned char *cs_streamclip_from_unknown P_((const struct string *str,
+ int *pos, int len,
+ screen_info_p terminal,
+ struct cs_printable_len *printable_len));
+ static unsigned char *cs_streamclip_from_unknown(str,pos,len,terminal,printable_len)


+ CONST struct string *str;

+ int *pos;
+ int len;
+ screen_info_p terminal;
+ struct cs_printable_len *printable_len;
+ {
+ unsigned char * ret = NULL;
+
+ if (*pos < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
+ "Index out of array",0);
+
+ if (len < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
+ "Negative size",0);
+
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */

+
+ #ifdef WCHAR
+ int alloced;
+ int l;
+ mbstate_t State;
+ wchar_t * tmp;
+ const wchar_t *ctmp, *src;


+ int i;
+
+

+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
+ "private_flag set for non-system charset",0);
+
+
+ if (printable_len)
+ printable_len->ret_len = 0;
+
+ /* NOTE: str->p->a.wchars is not NUL terminated

+ *
+ * ! ! ! NOTE! this do not convert strings including \0
+ * characters

+ */
+
+ if (len > str->p->len)
+ len = str->p->len;
+
+ if (len <= 0)
+ goto done;
+
+ tmp = safe_malloc((len + 1) * sizeof (tmp[0]));
+
+ for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {
+ wchar_t c = str->p->a.wchars[*pos];
+
+ if (!iswprint(c))
+ c = L'?';
+
+ if (printable_len) {
+ #ifdef WCWIDTH
+ int w = 1;
+
+ if (terminal->wcwidth)
+ w = wcwidth(c);
+
+ if (printable_len->max_len < printable_len->ret_len + w)
+ break;
+
+ printable_len->ret_len += w;
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
+ "printable_len not supported",0);


+ #endif
+ }
+
+

+ tmp[i] = c;
+ }
+ tmp[i] = L'\0';
+
+ ctmp = (const wchar_t *) tmp;


+
+ memset(&State, 0, sizeof(State));
+

+ alloced = len+1;
+
+ ret = safe_malloc(alloced);
+
+ for (src = ctmp, l = 0; src; ) {


+ int left = alloced - l;

+ size_t r = wcsrtombs(ret+l,&src,left,&State);


+
+ if ((size_t)(-1) == r) {

+ int pos = src-ctmp;
+ if (L'?' == *src)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_streamclip_from_unknown",


+ "? not convertible",0);

+ if (L'\0' == *src)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_streamclip_from_unknown",
+ "Ooops",0);
+
+ DPRINT(Debug,61,(&Debug,
+ "convert_to_wchar: Failed to convert 0x%04x at %d: errno = %d\n",
+ (int)*src,pos,errno));
+
+
+ tmp[pos] = L'?';
+
+ } else {
+

+ if (l >= 0)
+ l += r;
+ else

+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_stream_from_unknown",
+ "Unexpected return from wcsrtombs()",0);
+
+ if (src) {
+ int x;
+
+ x = len - (src-ctmp);
+
+ alloced += x + MB_CUR_MAX;
+
+ ret = safe_realloc(ret,alloced);
+ }
+ }
+ }
+
+ if ('\0' != ret[l])


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_stream_from_unknown",


+ "\\0 not written",0);
+

+ free(tmp); tmp = NULL;
+
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",


+ "No wchar_t support",0);
+ #endif

+
+ } else {


+ /* Use bytes (raw form) */
+

+ if (printable_len)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
+ "printable_len not supported",0);
+
+ #ifndef ASCII_CTYPE
+ if (str->string_type == system_charset)
+ return cs_streamclip_from_locale(str,pos,len);
+ #endif
+
+ if (str->string_type == system_charset) {
+ int l = 0,i;
+ ret = safe_malloc(len+1);
+
+ /* If charset is system character set then assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {
+ uint16 val = map_fallback(str->p->a.bytes[*pos]);
+
+ if (val != MAPPING_NONE &&
+ val >= 0x0020)
+ ret[l++] = str->p->a.bytes[*pos];
+ else
+ ret[l++] = '?'; /* See above ... */
+ }
+ ret[l] = '\0';
+
+ } else {
+
+ done:
+
+ ret = s2us(safe_strdup(""));
+ /* Because charset is unknown we do not have able to print
+ * printable characters -- also we not know replacement
+ * characters...
+ */
+
+ /* Indicate that we are 'clipped' whole string */
+ if (*pos < str->p->len)
+ *pos = str->p->len;


+
+ }
+ }
+ return ret;
+ }
+
+

+ S_(cs_clip_from_string cs_clip_from_unknown)
+ static void cs_clip_from_unknown P_((struct string *ret,
+ const struct string *str,
+ int *pos, int len));
+
+ static void cs_clip_from_unknown(ret,str,pos,len)
+ struct string *ret;


+ CONST struct string *str;

+ int *pos;
+ int len;


+ {
+ int i;
+

+ if (ret->string_type->charset_type !=
+ str->string_type->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_binary",
+ "String type mismatch",0);
+
+ if (*pos < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_binary",
+ "Index out of array",0);
+
+ if (len < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_binary",
+ "Negative size",0);
+
+ cs_free_unknown(ret);
+
+ if (len > str->p->len)
+ len = str->p->len;
+
+ if (len <= 0)
+ return;
+
+ /* realloc with len == 0 is equivalent of freeing and
+ may result corruption of memory ...
+ */
+

+ if (str->p->private_flag) {

+ /* Use wchars (locale) */
+
+

+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_unknown",


+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR
+

+ ret->p->private_flag = 1;
+
+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ ret->p->a.wchars = safe_malloc(len *
+ sizeof(ret->p->a.wchars[0]));
+ ret->p->len = 0;
+
+ for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {
+ ret->p->a.wchars[ret->p->len++] = str->p->a.wchars[*pos];
+ }
+
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_unknown",


+ "No wchar_t support",0);
+ #endif

+
+ } else {


+ /* Use bytes (raw form) */
+

+ ret->p->private_flag = 0;
+
+ /* NOTE: str->p->a.bytes is not NUL terminated */
+ ret->p->a.bytes = safe_malloc(len);
+ ret->p->len = 0;
+
+ for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {
+ ret->p->a.bytes[ret->p->len++] = str->p->a.bytes[*pos];


+ }
+ }
+ }
+
+
+

+ S_(cs_can_ascii_string cs_can_ascii_unknown)
+ static int cs_can_ascii_unknown P_((const struct string *str));
+ static int cs_can_ascii_unknown(str)


+ CONST struct string *str;
+ {
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */

+
+ #ifdef WCHAR
+ int i;


+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_can_ascii_unknown",


+ "private_flag set for non-system charset",0);

+
+ for (i = 0; i < str->p->len; i++) {
+ wchar_t c = str->p->a.wchars[i];
+ int c1 = wctob(c);
+ uint16 val;
+
+ /* wctob returns unsigned char if character is representable
+ * as byte or EOF otehrwise
+ */
+
+ if (EOF == c1)
+ return 0;
+
+ /* Assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ val = map_wfallback(c);
+
+ /* MAPPING_NONE is > 127 */
+ if (val > 127)
+ return 0;
+ }
+ return 1;
+
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_can_ascii_unknown",
+ "No wchar_t support",0);
+
+ return 0; /* Not reached */
+ #endif
+
+ } else {


+ /* Use bytes (raw form) */
+

+ if (str->string_type == system_charset) {
+ int i;
+ /* If charset is system character set then assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ for (i = 0; i < str->p->len; i++) {
+ uint16 val = map_fallback(str->p->a.bytes[i]);
+
+ /* MAPPING_NONE is > 127 */
+ if (val > 127)
+ return 0;
+ }
+ return 1;
+ } else
+ return 0;


+ }
+ }
+
+
+
+

+ S_(cs_find_pattern_from_string cs_find_pattern_from_unknown)
+ static int cs_find_pattern_from_unknown P_((const struct string *str,
+ const struct string *pattern,
+ int ignore_case));
+
+ static int cs_find_pattern_from_unknown(str,pattern,ignore_case)


+ CONST struct string *str;

+ CONST struct string *pattern;
+ int ignore_case;


+ {
+ int ret = 0;

+ int i, j;
+
+ if (pattern->string_type->charset_type !=
+ str->string_type->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_find_pattern_from_unknown",
+ "String type mismatch",0);
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_find_pattern_from_unknown",


+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR
+

+
+ for (i = 0; i < str->p->len; ) {
+ CONST int s = i + 1;
+
+ for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {
+ wint_t c2 = pattern->p->a.wchars[j];
+ wint_t c1 = str->p->a.wchars[i];
+
+ if (ignore_case) {
+ c2 = tolower(c2);
+ c1 = tolower(c1);
+ }
+ if (c1 != c2)
+ break;
+ }
+ if (j >= pattern->p->len) {
+ ret = 1;
+ break;
+ }
+ i = s;
+ }
+
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_find_pattern_from_unknown",


+ "No wchar_t support",0);
+ #endif

+
+ } else {


+ /* Use bytes (raw form) */
+

+ #ifndef ASCII_CTYPE
+ if (ignore_case && str->string_type == system_charset)
+ return cs_find_pattern_from_locale(str,pattern);
+ #endif
+
+ for (i = 0; i < str->p->len; ) {
+ CONST int s = i + 1;
+
+ for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {
+ unsigned char c2 = pattern->p->a.bytes[j];
+ unsigned char c1 = str->p->a.bytes[i];
+
+ /* We can not convert characters lowercase because
+ * charset is unknown
+ */
+
+ if (c1 != c2)
+ break;
+ }
+ if (j >= pattern->p->len) {
+ ret = 1;
+ break;
+ }
+ i = s;


+ }
+ }
+ return ret;
+ }
+

+ S_(cs_remove_control cs_remove_control_unknown)
+ static void cs_remove_control_unknown P_((const struct string *str));
+ static void cs_remove_control_unknown(str)


+ CONST struct string *str;
+ {

+ int i;
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_remove_control_unknown",


+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR
+

+ for (i = 0; i < str->p->len; i++) {
+ wchar_t c1 = str->p->a.wchars[i];
+
+ if (!iswprint(c1))
+ str->p->a.wchars[i] = L' ';
+ }
+
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_remove_control_unknown",


+ "No wchar_t support",0);
+ #endif

+
+ } else {


+ /* Use bytes (raw form) */
+

+ #ifndef ASCII_CTYPE
+ if (str->string_type == system_charset) {
+ cs_remove_control_locale(str,' ');
+ return;
+ }
+ #endif
+
+ for (i = 0; i < str->p->len; i++) {
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position
+ */
+
+
+ if (str->p->a.bytes[i] < 32) {
+ if (str->string_type == system_charset)
+ /* If charset is system character set then assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+ str->p->a.bytes[i] = ' ';
+
+ else
+ /* We HOPE that 32 is printable character... */
+ str->p->a.bytes[i] = 32;


+ }
+ }
+ }
+ }
+

+ S_(cs_find_map_type cs_find_unknown)
+ static struct map_info * cs_find_unknown P_((const char * map_name));
+ static struct map_info * cs_find_unknown(map_name)
+ CONST char * map_name;


+ {
+ return NULL;
+ }
+

+ S_(cs_set_properties cs_unknown_properties)
+ static int cs_unknown_properties P_((charset_t st));
+ static int cs_unknown_properties(st)
+ charset_t st;
+ {
+ int prop = 0;
+
+ if (st->map_info)
+ prop |= CS_mapping | CS_printable;
+
+ #ifdef WCHAR
+ /* We know printable characters from locale */
+ if (system_charset == st) {
+ prop |= CS_printable;
+ #ifdef WCWIDTH
+ prop |= CS_printable_len;
+ #endif
+ #ifdef __STDC_ISO_10646__
+ prop |= CS_mapping;
+ #endif
+ }
+
+ #endif
+
+ #ifndef ASCII_CTYPE
+ /* We know printable characters from locale */
+ if (system_charset == st)
+ prop |= CS_printable;
+ #endif
+
+ return prop;
+ }
+
+
+
+ S_(cs_iso2022_info_set cs_iso2022_info_set_unknown)
+ static int cs_iso2022_info_set_unknown P_((struct charcode_info *new_vals,
+ struct setlist *new_setlist,
+ int setcount));
+ static int cs_iso2022_info_set_unknown(new_vals, new_setlist,setcount)
+ struct charcode_info *new_vals;
+ struct setlist *new_setlist;
+ int setcount;
+ {
+ int ptr_94 = -1;
+ int ptr_96 = -1;
+ int banks[ISO2022_BANK_NUM];
+
+ if (!cs_info_set_scan(new_vals,new_setlist,setcount,&ptr_94,&ptr_96,
+ banks)) {


+ return 0;
+ }
+

+ new_vals->iso2022_info = loc_setlist(*new_setlist);
+ new_vals->flags &= ~SET_nodata;
+
+ return 1;
+ }
+
+
+ /* Return number of characters consumed */
+ S_(cs_estimate_clip_string cs_estimate_clip_unknown)
+ static int cs_estimate_clip_unknown(str,pos,len,terminal,printable_len)


+ CONST struct string *str;

+ int pos;
+ int len; /* UPPER LIMIT */
+ screen_info_p terminal;
+ struct cs_printable_len *printable_len;
+ {
+
+ if (pos < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_estimate_clip_unknown",
+ "Index out of array",0);
+
+ if (len < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_estimate_clip_unknown",
+ "Negative size",0);
+
+
+ printable_len->ret_len = 0;
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */

+
+ #ifdef WCHAR
+ int counter = 0;
+ int i;
+

+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_estimate_clip_unknown",


+ "private_flag set for non-system charset",0);
+

+ while (pos < str->p->len && counter < len) {
+ wchar_t c = str->p->a.wchars[pos];
+ int w = 1;
+
+ if (!iswprint(c))
+ goto bail_out;
+
+ if (terminal->wcwidth)
+ w = wcwidth(c);
+
+ if (printable_len->max_len < printable_len->ret_len + w)
+ break;
+
+ printable_len->ret_len += w;
+
+ counter++;
+ pos++;
+ }
+
+ return counter;
+
+ bail_out:
+
+ DPRINT(Debug,49,(&Debug,
+ "cs_estimate_clip_unknown: bailing out at %d, counter=%d\n",
+ pos,counter));
+
+ if (counter > 0)
+ return counter;
+
+ return -1;
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_estimate_clip_unknown",


+ "No wchar_t support",0);
+ #endif

+
+ } else {


+ /* Use bytes (raw form) */
+

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_estimate_clip_unknown",
+ "printable_len not supported",0);
+
+ }
+
+
+ return -1;
+ }
+
+
+
+ struct charset_type cs_unknown = { "unknown-charset",
+ cs_init_unknown,
+ cs_free_unknown,
+ cs_add_streambyte_to_unknown,
+ cs_add_intdata_to_unknown,
+ cs_check_length_unknown,
+ cs_give_unicode_from_unknown,
+ cs_add_unicodedata_to_unknown,
+ cs_cmp_unknown,
+ cs_stream_from_unknown,
+ cs_can_ascii_unknown,
+ cs_streamclip_from_unknown,
+ cs_clip_from_unknown,
+ cs_find_pattern_from_unknown,
+ cs_add_streambytes_to_unknown,
+ cs_find_unknown,
+ cs_remove_control_unknown,
+ cs_add_state_to_unknown,
+ cs_init_s_unknown,
+ cs_free_s_unknown,
+ cs_add_streambyte_to_s_unknown,
+ cs_soft_reset_s_unknown,
+ cs_give_unicode_from_s_unknown,
+ cs_s_unknown_same_char,
+ cs_s_unknown_printable,
+ cs_s_unknown_is_onebyte,
+ cs_unknown_properties,
+ cs_estimate_clip_unknown,
+ cs_iso2022_info_set_unknown,
+ &cs_ascii


+ };
+
+
+
+
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/lib/cs_utf.c
*** elm2.4.ME+.121/lib/cs_utf.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/cs_utf.c 2005-07-01 12:15:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_utf.c,v 1.27 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cs_utf.c,v 1.29 2005/07/01 09:15:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************
*** 576,585 ****
}
}

! static int cs_cmp_utf P_((struct string *str1,struct string *str2));
static int cs_cmp_utf(str1,str2)


! struct string *str1;
! struct string *str2;
{

int i;

--- 576,585 ----
}
}

! static int cs_cmp_utf P_((const struct string *str1,const struct string *str2));
static int cs_cmp_utf(str1,str2)


! CONST struct string *str1;
! CONST struct string *str2;
{

int i;

***************
*** 1271,1282 ****


/* Returns number of bytes added */

static int cs_add_streambytes_to_utf8 P_((struct string *str,

int count,
! const unsigned char *data));

! static int cs_add_streambytes_to_utf8(str,count,data)


struct string *str;
int count;
CONST unsigned char *data;
{

if (count > 0) {
int i;


/* realloc with size 0 is equivalent of free and may

--- 1271,1286 ----


/* Returns number of bytes added */

static int cs_add_streambytes_to_utf8 P_((struct string *str,

int count,
! const unsigned char *data,
! int *errors));

! static int cs_add_streambytes_to_utf8(str,count,data, errors)


struct string *str;
int count;
CONST unsigned char *data;
+ int *errors;
{

+ *errors = 0;
+
if (count > 0) {

int i;


/* realloc with size 0 is equivalent of free and may

***************
*** 1302,1308 ****
"cs_add_streambytes_to_utf8: Failed to add byte, idx=%d\n",
i));

! break;
}

if (str->p->state->p->ready) {
--- 1306,1316 ----
"cs_add_streambytes_to_utf8: Failed to add byte, idx=%d\n",
i));

! handle_error:
! (*errors)++;
! str->p->a.words[str->p->len++] = MAPPING_NONE;
! cs_soft_reset_s_utf8(str->p->state);
! continue;
}

if (str->p->state->p->ready) {
***************
*** 1310,1316 ****
DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_utf8: Value (%X) out of range\n",
str->p->state->p->a.utf8.value));
! break;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf8.value;
--- 1318,1324 ----
DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_utf8: Value (%X) out of range\n",
str->p->state->p->a.utf8.value));
! goto handle_error;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf8.value;
***************
*** 1324,1335 ****

static int cs_add_streambytes_to_utf7 P_((struct string *str,

int count,
! const unsigned char *data));

! static int cs_add_streambytes_to_utf7(str,count,data)


struct string *str;
int count;
CONST unsigned char *data;
{

if (count > 0) {
int i;


/* realloc with size 0 is equivalent of free and may

--- 1332,1347 ----

static int cs_add_streambytes_to_utf7 P_((struct string *str,

int count,
! const unsigned char *data,
! int *errors));

! static int cs_add_streambytes_to_utf7(str,count,data,errors)


struct string *str;
int count;
CONST unsigned char *data;
+ int *errors;
{

+ *errors = 0;
+
if (count > 0) {

int i;


/* realloc with size 0 is equivalent of free and may

***************
*** 1355,1361 ****
DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_utf7: Failed to add byte, idx=%d\n",
i));
! break;
}

if (str->p->state->p->ready) {
--- 1367,1377 ----
DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_utf7: Failed to add byte, idx=%d\n",
i));
! handle_error:
! (*errors) ++;
! str->p->a.words[str->p->len++] = MAPPING_NONE;
! cs_soft_reset_s_utf7(str->p->state);
! continue;
}

if (str->p->state->p->ready) {
***************
*** 1364,1370 ****
"cs_add_streambytes_to_utf7: Value (%X) out of range\n",
str->p->state->p->a.utf7.value));

! break;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf7.value;
--- 1380,1386 ----
"cs_add_streambytes_to_utf7: Value (%X) out of range\n",
str->p->state->p->a.utf7.value));

! goto handle_error;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf7.value;
***************
*** 1378,1389 ****

static int cs_add_streambytes_to_imap P_((struct string *str,

int count,
! const unsigned char *data));

! static int cs_add_streambytes_to_imap(str,count,data)


struct string *str;
int count;
CONST unsigned char *data;
{

if (count > 0) {
int i;


/* realloc with size 0 is equivalent of free and may

--- 1394,1408 ----

static int cs_add_streambytes_to_imap P_((struct string *str,

int count,
! const unsigned char *data,
! int *errors));

! static int cs_add_streambytes_to_imap(str,count,data,errors)


struct string *str;
int count;
CONST unsigned char *data;
+ int *errors;
{

+ *errors = 0;
if (count > 0) {
int i;


/* realloc with size 0 is equivalent of free and may

***************
*** 1408,1414 ****
DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_imap: Failed to add byte, idx=%d\n",
i));
! break;
}

if (str->p->state->p->ready) {
--- 1427,1436 ----
DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_imap: Failed to add byte, idx=%d\n",
i));
! handle_error:
! (*errors)++;
! str->p->a.words[str->p->len++] = MAPPING_NONE;
! continue;
}

if (str->p->state->p->ready) {
***************
*** 1417,1423 ****
"cs_add_streambytes_to_imap: Value (%X) out of range\n",
str->p->state->p->a.utf7.value));

! break;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf7.value;
--- 1439,1445 ----
"cs_add_streambytes_to_imap: Value (%X) out of range\n",
str->p->state->p->a.utf7.value));

! goto handle_error;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf7.value;
Index: elm2.4.ME+.122-cvs/lib/cs_wfallback.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/lib/cs_wfallback.c 2005-03-13 20:37:35.000000000 +0200
***************
*** 0 ****
--- 1,235 ----
+ static char rcsid[] = "@(#)$Id: cs_wfallback.c,v 1.2 2005/03/13 18:37:35 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *

+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)


+ *****************************************************************************/
+
+ #include "headers.h"

+ #include "s_me.h"
+ #include "cs_imp.h"
+

+ DEBUG_VAR(Debug,__FILE__,"charset");
+

+ #ifdef __STDC_ISO_10646__
+
+ uint16 map_wfallback(c)
+ wint_t c;
+ {
+ if (c >= 0 && c <= 0xFFFF)
+ return c;
+
+ return MAPPING_NONE;
+ }
+
+ wchar_t map_wfallback_rev(val, found)
+ unsigned int val;
+ int *found;
+ {
+ *found = 1;
+ return val;
+ }
+
+ #else
+
+ static struct wfallback {
+ wchar_t c;
+ uint16 c1;
+ } fallback_table[] = {
+ { L'\r', 0x000D },
+ { L'\n', 0x000A },
+ { L'\t', 0x0009 },
+ /* This table defines mapping between charset used in string
+ * constants and unicode. This includes only characters, which
+ * are likely to be existed in all sets.
+ */
+ { L' ', 0x0020 /* ;*;SPACE;;; */ },
+ { L'!', 0x0021 /* ;*;EXCLAMATION MARK;;; */ },
+ { L'"', 0x0022 /* ;*;QUOTATION MARK;;; */ },
+ { L'%', 0x0025 /* ;*;PERCENT SIGN;;; */ },
+ { L'&', 0x0026 /* ;*;AMPERSAND;;; */ },
+ { L'(', 0x0028 /* ;*;LEFT PARENTHESIS;;OPENING PARENTHESIS; */ },
+ { L')', 0x0029 /* ;*;RIGHT PARENTHESIS;;CLOSING PARENTHESIS; */ },
+ { L'*', 0x002A /* ;*;ASTERISK;;; */ },
+ { L'+', 0x002B /* ;*;PLUS SIGN;;; */ },
+ { L',', 0x002C /* ;*;COMMA;;; */ },
+ { L'-', 0x002D /* ;*;HYPHEN-MINUS;;; */ },
+ { L'.', 0x002E /* ;*;FULL STOP;;PERIOD; */ },
+ { L'/', 0x002F /* ;*;SOLIDUS;;SLASH; */ },
+ { L'0', 0x0030 /* ;*;DIGIT ZERO;;; */ },
+ { L'1', 0x0031 /* ;*;DIGIT ONE;;; */ },
+ { L'2', 0x0032 /* ;*;DIGIT TWO;;; */ },
+ { L'3', 0x0033 /* ;*;DIGIT THREE;;; */ },
+ { L'4', 0x0034 /* ;*;DIGIT FOUR;;; */ },
+ { L'5', 0x0035 /* ;*;DIGIT FIVE;;; */ },
+ { L'6', 0x0036 /* ;*;DIGIT SIX;;; */ },
+ { L'7', 0x0037 /* ;*;DIGIT SEVEN;;; */ },
+ { L'8', 0x0038 /* ;*;DIGIT EIGHT;;; */ },
+ { L'9', 0x0039 /* ;*;DIGIT NINE;;; */ },
+ { L':', 0x003A /* ;*;COLON;;; */ },
+ { L';', 0x003B /* ;*;SEMICOLON;;; */ },
+ { L'<', 0x003C /* ;*;LESS-THAN SIGN;;; */ },
+ { L'=', 0x003D /* ;*;EQUALS SIGN;;; */ },
+ { L'>', 0x003E /* ;*;GREATER-THAN SIGN;;; */ },
+ { L'?', 0x003F /* ;*;QUESTION MARK;;; */ },
+ { L'A', 0x0041 /* ;*;LATIN CAPITAL LETTER A;;; */ },
+ { L'B', 0x0042 /* ;*;LATIN CAPITAL LETTER B;;; */ },
+ { L'C', 0x0043 /* ;*;LATIN CAPITAL LETTER C;;; */ },
+ { L'D', 0x0044 /* ;*;LATIN CAPITAL LETTER D;;; */ },
+ { L'E', 0x0045 /* ;*;LATIN CAPITAL LETTER E;;; */ },
+ { L'F', 0x0046 /* ;*;LATIN CAPITAL LETTER F;;; */ },
+ { L'G', 0x0047 /* ;*;LATIN CAPITAL LETTER G;;; */ },
+ { L'H', 0x0048 /* ;*;LATIN CAPITAL LETTER H;;; */ },
+ { L'I', 0x0049 /* ;*;LATIN CAPITAL LETTER I;;; */ },
+ { L'J', 0x004A /* ;*;LATIN CAPITAL LETTER J;;; */ },
+ { L'K', 0x004B /* ;*;LATIN CAPITAL LETTER K;;; */ },
+ { L'L', 0x004C /* ;*;LATIN CAPITAL LETTER L;;; */ },
+ { L'M', 0x004D /* ;*;LATIN CAPITAL LETTER M;;; */ },
+ { L'N', 0x004E /* ;*;LATIN CAPITAL LETTER N;;; */ },
+ { L'O', 0x004F /* ;*;LATIN CAPITAL LETTER O;;; */ },
+ { L'P', 0x0050 /* ;*;LATIN CAPITAL LETTER P;;; */ },
+ { L'Q', 0x0051 /* ;*;LATIN CAPITAL LETTER Q;;; */ },
+ { L'R', 0x0052 /* ;*;LATIN CAPITAL LETTER R;;; */ },
+ { L'S', 0x0053 /* ;*;LATIN CAPITAL LETTER S;;; */ },
+ { L'T', 0x0054 /* ;*;LATIN CAPITAL LETTER T;;; */ },
+ { L'U', 0x0055 /* ;*;LATIN CAPITAL LETTER U;;; */ },
+ { L'V', 0x0056 /* ;*;LATIN CAPITAL LETTER V;;; */ },
+ { L'W', 0x0057 /* ;*;LATIN CAPITAL LETTER W;;; */ },
+ { L'X', 0x0058 /* ;*;LATIN CAPITAL LETTER X;;; */ },
+ { L'Y', 0x0059 /* ;*;LATIN CAPITAL LETTER Y;;; */ },
+ { L'Z', 0x005A /* ;*;LATIN CAPITAL LETTER Z;;; */ },
+
+ { L'a', 0x0061 /* ;*;LATIN SMALL LETTER A;;; */ },
+ { L'b', 0x0062 /* ;*;LATIN SMALL LETTER B;;; */ },
+ { L'c', 0x0063 /* ;*;LATIN SMALL LETTER C;;; */ },
+ { L'd', 0x0064 /* ;*;LATIN SMALL LETTER D;;; */ },
+ { L'e', 0x0065 /* ;*;LATIN SMALL LETTER E;;; */ },
+ { L'f', 0x0066 /* ;*;LATIN SMALL LETTER F;;; */ },
+ { L'g', 0x0067 /* ;*;LATIN SMALL LETTER G;;; */ },
+ { L'h', 0x0068 /* ;*;LATIN SMALL LETTER H;;; */ },
+ { L'i', 0x0069 /* ;*;LATIN SMALL LETTER I;;; */ },
+ { L'j', 0x006A /* ;*;LATIN SMALL LETTER J;;; */ },
+ { L'k', 0x006B /* ;*;LATIN SMALL LETTER K;;; */ },
+ { L'l', 0x006C /* ;*;LATIN SMALL LETTER L;;; */ },
+ { L'm', 0x006D /* ;*;LATIN SMALL LETTER M;;; */ },
+ { L'n', 0x006E /* ;*;LATIN SMALL LETTER N;;; */ },
+ { L'o', 0x006F /* ;*;LATIN SMALL LETTER O;;; */ },
+ { L'p', 0x0070 /* ;*;LATIN SMALL LETTER P;;; */ },
+ { L'q', 0x0071 /* ;*;LATIN SMALL LETTER Q;;; */ },
+ { L'r', 0x0072 /* ;*;LATIN SMALL LETTER R;;; */ },
+ { L's', 0x0073 /* ;*;LATIN SMALL LETTER S;;; */ },
+ { L't', 0x0074 /* ;*;LATIN SMALL LETTER T;;; */ },
+ { L'u', 0x0075 /* ;*;LATIN SMALL LETTER U;;; */ },
+ { L'v', 0x0076 /* ;*;LATIN SMALL LETTER V;;; */ },
+ { L'w', 0x0077 /* ;*;LATIN SMALL LETTER W;;; */ },
+ { L'x', 0x0078 /* ;*;LATIN SMALL LETTER X;;; */ },
+ { L'y', 0x0079 /* ;*;LATIN SMALL LETTER Y;;; */ },
+ { L'z', 0x007A /* ;*;LATIN SMALL LETTER Z;;; */ }
+ };
+
+ struct wfallback *wchar2unicode_hash[MAP_REV_MAP_DIV],
+ *unicode2wchar_hash[MAP_REV_MAP_DIV];
+
+
+ static int initialized = 0;
+
+ static void init_fallback() {
+ int i;
+
+ int col1 = 0, col2 = 0;
+
+ for (i = 0; i < MAP_REV_MAP_DIV; i++) {
+ wchar2unicode_hash[i] = NULL;
+ unicode2wchar_hash[i] = NULL;
+ }
+
+ for (i = 0; i < sizeof fallback_table / sizeof fallback_table[0]; i++) {
+ int x1 = fallback_table[i].c % MAP_REV_MAP_DIV;
+ int x2 = fallback_table[i].c1 % MAP_REV_MAP_DIV;
+
+ if (wchar2unicode_hash[x1])
+ col1++;
+ else
+ wchar2unicode_hash[x1] = & (fallback_table[i]);
+
+ if (unicode2wchar_hash[x1])
+ col2++;
+ else
+ unicode2wchar_hash[x1] = & (fallback_table[i]);
+
+ }
+
+ DPRINT(Debug,4,(&Debug,
+ "Wide fallback map initialized: wchar2unicode_hash %d collisions, unicode2wchar_hash %d collisions\n",
+ col1,col2));
+
+ initialized = 1;
+ }
+
+ uint16 map_wfallback(c)
+ wint_t c;
+ {
+ int x,i;
+
+ if (!initialized)
+ init_fallback();
+
+ x = c % MAP_REV_MAP_DIV;
+
+ if (!wchar2unicode_hash[x])
+ return MAPPING_NONE;
+
+ if (wchar2unicode_hash[x]->c == c)
+ return wchar2unicode_hash[x]->c1;
+
+ for (i = 0; i < sizeof fallback_table / sizeof fallback_table[0]; i++) {
+ if (fallback_table[i].c == c) {
+ return fallback_table[i].c1;
+ }
+ }
+ return MAPPING_NONE;
+ }
+
+ wchar_t map_wfallback_rev(val, found)
+ unsigned int val;
+ int *found;
+ {
+ int x,i;
+
+ if (!initialized)
+ init_fallback();
+
+ x = val % MAP_REV_MAP_DIV;
+
+ if (! unicode2wchar_hash[x]) {
+ *found = 0;
+
+ return L'?';
+ }
+
+ if (unicode2wchar_hash[x]->c1 == val) {
+ *found = 1;
+ return unicode2wchar_hash[x]->c;
+ }
+
+ for (i = 0; i < sizeof fallback_table / sizeof fallback_table[0]; i++) {
+ if (fallback_table[i].c1 == val) {
+ *found = 1;
+ return fallback_table[i].c;
+ }
+ }
+
+ *found = 0;
+ return L'?'; /* Not found */
+ }
+
+ #endif
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/lib/debug.c
*** elm2.4.ME+.121/lib/debug.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/debug.c 2005-02-12 08:49:09.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: debug.c,v 1.21 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: debug.c,v 1.22 2005/02/12 06:49:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

Index: elm2.4.ME+.122-cvs/lib/errno.c
*** elm2.4.ME+.121/lib/errno.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/errno.c 2005-06-18 00:02:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: errno.c,v 1.6 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: errno.c,v 1.8 2005/06/17 21:02:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 22,28 ****
**/

#include "headers.h"
- #include "me.h"

#ifndef STRERROR
#ifdef ERRLST
--- 22,27 ----
***************
*** 77,85 ****
{
#ifdef STRERROR

! extern char *strerror();

! return strerror(errnumber);

#else /* !STRERROR */

--- 76,84 ----
{
#ifdef STRERROR

! extern char *strerror P_((int n));

! return strerror(errnumber);

#else /* !STRERROR */

Index: elm2.4.ME+.122-cvs/lib/expand.c
*** elm2.4.ME+.121/lib/expand.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/expand.c 2005-03-27 12:02:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: expand.c,v 1.18 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: expand.c,v 1.19 2005/03/27 09:02:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 33,44 ****
{
if (filename[0] == '+' || filename[0] == '%' || filename[0] == '=') {
char buffer[SLEN];
!
! strfcpy(buffer,folders, sizeof buffer);
! if (folders[0] && folders[strlen(folders)-1] != '/' &&
! filename[0] != '/')
! strfcat(buffer, "/", sizeof buffer);
!
strfcat(buffer,filename+1, sizeof buffer);

strfcpy(filename, buffer, size);
--- 33,47 ----
{
if (filename[0] == '+' || filename[0] == '%' || filename[0] == '=') {
char buffer[SLEN];


!
! /* give_dt_estr_as_str adds / to end */

! char * str = give_dt_estr_as_str(&folders_e,"maildir");
!
! if (!str)
! return 0;
!
! strfcpy(buffer,str, sizeof buffer);
!
strfcat(buffer,filename+1, sizeof buffer);

strfcpy(filename, buffer, size);
***************
*** 161,183 ****
if (src[0] == '+' || src[0] == '%' || src[0] == '=') {
CONST char * expval;
int len,p;
! if (folders[0] == '\0') {
expval = "=";
ret = -1;
len = 1;
} else {
! expval = folders;
! len = strlen(folders);
}
strnfcpy(dest, expval, len, destlen,&p);
dest += p;
destlen -= p;
++src;
! if (folders[0] && folders[strlen(folders)-1] != '/' &&
! src[0] != '/' && destlen > 0) {
! *dest++ = '/';
! destlen--;
! }

if (expand_path(dest,src,destlen+1) < 0)
ret = -1;
--- 164,188 ----
if (src[0] == '+' || src[0] == '%' || src[0] == '=') {
CONST char * expval;
int len,p;


!
! /* give_dt_estr_as_str adds / to end */

! char * str = give_dt_estr_as_str(&folders_e,"maildir");
!
! if (!str) {
expval = "=";
ret = -1;
len = 1;
} else {
! expval = str;
! len = strlen(str);
}
strnfcpy(dest, expval, len, destlen,&p);
dest += p;
destlen -= p;
++src;
!
! if ('/' == src[0] && str)
! src++;

if (expand_path(dest,src,destlen+1) < 0)
ret = -1;
Index: elm2.4.ME+.122-cvs/lib/forwarded.c
*** elm2.4.ME+.121/lib/forwarded.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/forwarded.c 2005-04-23 23:06:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forwarded.c,v 1.6 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forwarded.c,v 1.7 2005/04/23 20:06:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 29,41 ****

char machine[SLEN], who[SLEN], work[SLEN];
int count, pointer;

machine[0] = '\0';
who[0]='\0';

DPRINT(Debug,7,(&Debug,
"forwarded: buffer=%s, env_from_source=%d\n",
! buffer,env_from_source));

/* env_from_source:
0 == forward-from,
--- 29,42 ----

char machine[SLEN], who[SLEN], work[SLEN];
int count, pointer;
+ int e = give_dt_enumerate_as_int(&env_from_source);

machine[0] = '\0';
who[0]='\0';

DPRINT(Debug,7,(&Debug,
"forwarded: buffer=%s, env_from_source=%d\n",
! buffer,e));

/* env_from_source:
0 == forward-from,
***************
*** 43,49 ****
2 == return-path
*/

! if (env_from_source < 1) {
for (count = 0, pointer=0;
count < 10;
count++) {
--- 44,50 ----
2 == return-path
*/

! if (e < 1) {
for (count = 0, pointer=0;
count < 10;
count++) {
Index: elm2.4.ME+.122-cvs/lib/getaddr.c
*** elm2.4.ME+.121/lib/getaddr.c 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/getaddr.c 2005-07-01 12:15:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.23 2004/08/24 13:06:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.25 2005/07/01 09:15:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*
***************
*** 40,48 ****
DPRINT(Debug,25,(&Debug,
" : [%i]=\"%s\"\n",i,res[i]));
}
! res[count] = NULL;
DPRINT(Debug,25,(&Debug,
! " : [%i]=NULL\n",count));
return res;
}

--- 40,48 ----
DPRINT(Debug,25,(&Debug,
" : [%i]=\"%s\"\n",i,res[i]));
}
! res[i] = NULL;
DPRINT(Debug,25,(&Debug,
! " : [%i]=NULL\n",i));
return res;
}

***************
*** 219,225 ****
struct string * res = NULL;


char * buffer = NULL;

int idx, max_idx;
!
DPRINT(Debug,25,(&Debug,
"scanned_to_phrase:"));
for (max_idx = 0; scanned[max_idx]; max_idx++) {
--- 219,226 ----
struct string * res = NULL;


char * buffer = NULL;

int idx, max_idx;
! CONST char *A,*B;
!
DPRINT(Debug,25,(&Debug,
"scanned_to_phrase:"));
for (max_idx = 0; scanned[max_idx]; max_idx++) {
***************
*** 242,247 ****
--- 243,253 ----
res = new_string(set);

DPRINT(Debug,25,(&Debug, "scanned_to_phrase=%S\n",res));
+ A = get_string_MIME_name(res);
+ B = get_string_lang(res);
+ DPRINT(Debug,25,(&Debug, " cs=%s lang=%s\n",
+ A ? A : "<none>", B ? B : "<none>"));
+
return res;
}

***************
*** 402,407 ****
--- 408,416 ----
}
if (res[res_idx].addr || res[res_idx].fullname ||
res[res_idx].comment) {
+
+ CONST char *A,*B;
+
res[res_idx].addr = strmcat(res[res_idx].addr,"");
if (!res[res_idx].fullname)
res[res_idx].fullname = new_string(defcharset);
***************
*** 411,422 ****
--- 420,448 ----

"break_down_address: [%d].addr =%.100s\n",
res_idx,res[res_idx].addr));
+
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
+ A = get_string_MIME_name(res[res_idx].fullname);
+ B = get_string_lang(res[res_idx].fullname);
+ DPRINT(Debug,11,(&Debug,
+ " cs=%s lang=%s\n",
+ A ? A : "<none>",
+ B ? B : "<none>"));
+
+
DPRINT(Debug,11,(&Debug,
" .comment =%.100S\n",
res[res_idx].comment));
+
+ A = get_string_MIME_name(res[res_idx].comment);
+ B = get_string_lang(res[res_idx].comment);
+ DPRINT(Debug,11,(&Debug,
+ " cs=%s lang=%s\n",
+ A ? A : "<none>",
+ B ? B : "<none>"));
+
res_idx++;
}
break;
***************
*** 439,444 ****
--- 465,473 ----
}
if (res[res_idx].addr || res[res_idx].fullname
|| res[res_idx].comment) {
+
+ CONST char *A, *B;
+
res[res_idx].addr = strmcat(res[res_idx].addr,"");
if (!res[res_idx].fullname)
res[res_idx].fullname = new_string(defcharset);
***************
*** 452,461 ****
--- 481,507 ----
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
+
+ A = get_string_MIME_name(res[res_idx].fullname);
+ B = get_string_lang(res[res_idx].fullname);
+ DPRINT(Debug,11,(&Debug,
+ " cs=%s lang=%s\n",
+ A ? A : "<none>",
+ B ? B : "<none>"));
+
+
DPRINT(Debug,11,(&Debug,

" .comment =%.100S\n",
res[res_idx].comment));
+
+ A = get_string_MIME_name(res[res_idx].comment);
+ B = get_string_lang(res[res_idx].comment);
+ DPRINT(Debug,11,(&Debug,
+ " cs=%s lang=%s\n",
+ A ? A : "<none>",
+ B ? B : "<none>"));
+

res_idx++;
}
***************
*** 538,543 ****
--- 584,592 ----
}
if (res[res_idx].addr || res[res_idx].fullname
|| res[res_idx].comment) {
+
+ CONST char *A,*B;
+
res[res_idx].addr = strmcat(res[res_idx].addr,"");
if (!res[res_idx].fullname)
res[res_idx].fullname = new_string(defcharset);
***************
*** 550,559 ****
--- 599,622 ----
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
+ A = get_string_MIME_name(res[res_idx].fullname);
+ B = get_string_lang(res[res_idx].fullname);
+ DPRINT(Debug,11,(&Debug,
+ " cs=%s lang=%s\n",
+ A ? A : "<none>",
+ B ? B : "<none>"));
+
DPRINT(Debug,11,(&Debug,
" .comment =%.100S\n",
res[res_idx].comment));

+ A = get_string_MIME_name(res[res_idx].comment);
+ B = get_string_lang(res[res_idx].comment);
+ DPRINT(Debug,11,(&Debug,
+ " cs=%s lang=%s\n",
+ A ? A : "<none>",
+ B ? B : "<none>"));
+
res_idx++;
}
break;
***************
*** 585,590 ****
--- 648,655 ----
}
if (res[res_idx].addr || res[res_idx].fullname
|| res[res_idx].comment) {
+ CONST char *A, *B;
+
res[res_idx].addr = strmcat(res[res_idx].addr,"");
if (!res[res_idx].fullname)
res[res_idx].fullname = new_string(defcharset);
***************
*** 597,606 ****
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
DPRINT(Debug,11,(&Debug,
" .comment =%.100S\n",
res[res_idx].comment));
!

res_idx++;
}
--- 662,684 ----
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
+ A = get_string_MIME_name(res[res_idx].fullname);
+ B = get_string_lang(res[res_idx].fullname);
+ DPRINT(Debug,11,(&Debug,
+ " cs=%s lang=%s\n",
+ A ? A : "<none>",
+ B ? B : "<none>"));
+
DPRINT(Debug,11,(&Debug,
" .comment =%.100S\n",
res[res_idx].comment));
! A = get_string_MIME_name(res[res_idx].comment);
! B = get_string_lang(res[res_idx].comment);
! DPRINT(Debug,11,(&Debug,
! " cs=%s lang=%s\n",
! A ? A : "<none>",
! B ? B : "<none>"));
!

res_idx++;
}
Index: elm2.4.ME+.122-cvs/lib/getfullnam.c
*** elm2.4.ME+.121/lib/getfullnam.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/getfullnam.c 2005-06-18 00:02:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getfullnam.c,v 1.6 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: getfullnam.c,v 1.7 2005/06/17 21:02:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 23,30 ****
# include <pwd.h>
#endif

- char *gcos_name();
-
char * get_full_name(logname)
char *logname;
{
--- 23,28 ----
***************
*** 34,40 ****
* from ~/.fullname.
*/

! struct passwd *getpwnam(), *pass;

if((pass = getpwnam(logname)) == NULL)
return(NULL);
--- 32,38 ----
* from ~/.fullname.
*/

! struct passwd *pass;

if((pass = getpwnam(logname)) == NULL)
return(NULL);
Index: elm2.4.ME+.122-cvs/lib/get_tz.c
*** elm2.4.ME+.121/lib/get_tz.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/get_tz.c 2005-06-18 00:02:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: get_tz.c,v 1.11 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: get_tz.c,v 1.12 2005/06/17 21:02:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 46,52 ****
{
struct tm *tm;
long t2, t1;
- extern long make_gmttime(); /* from date_util.c */

tm = localtime(&tval);
t1 = make_gmttime(1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday,
--- 46,51 ----
Index: elm2.4.ME+.122-cvs/lib/hdrdecode.c
*** elm2.4.ME+.121/lib/hdrdecode.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/hdrdecode.c 2005-07-06 00:23:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrdecode.c,v 1.13 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrdecode.c,v 1.17 2005/07/05 21:23:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 52,66 ****
return NULL;
}

! static struct string * hdr_qp_decode P_((charset_t set,char *buffer));
! static struct string * hdr_qp_decode(set,buffer)
charset_t set;
char *buffer;
{
! struct string *ret = new_string(set);
! char *p;

! for (p = buffer; *p; p++) {
switch(*p) {
int a,b;
case '_':
--- 52,89 ----
return NULL;
}

! void append_string(res,s)
! struct string ** res;
! struct string *s;
! {
! if (!*res)
! *res = dup_string(s);
! else {
! struct string *t = cat_strings(*res,s,1);
! free_string(res);
! *res = t;
! }
! }
!
! static unsigned char * us_str P_((char *str));
! static unsigned char * us_str(str)
! char *str;
! {
! return (unsigned char *)str;
! }
!
!
! static struct string * hdr_qp_decode P_((charset_t set,char *buffer,
! char *lang));
! static struct string * hdr_qp_decode(set,buffer,lang)
charset_t set;
char *buffer;
+ char *lang;
{
! struct string *ret = lang ? new_langstring(set,lang) : new_string(set);
! unsigned char *p;

! for (p = us_str(buffer); *p; p++) {
switch(*p) {
int a,b;
case '_':
***************
*** 94,110 ****
return NULL;
}

! static struct string * hdr_base64_decode P_((charset_t set,char *buffer));
! static struct string * hdr_base64_decode(set,buffer)
charset_t set;
char *buffer;
{
! struct string *ret = new_string(set);
int val = 0;
int bits = 0;
! char *p;

! for (p = buffer; *p; p++) {
int a;

if ('=' == *p)
--- 117,135 ----
return NULL;
}

! static struct string * hdr_base64_decode P_((charset_t set,char *buffer,
! char *lang));
! static struct string * hdr_base64_decode(set,buffer,lang)
charset_t set;
char *buffer;
+ char *lang;
{
! struct string *ret = lang ? new_langstring(set,lang) : new_string(set);
int val = 0;
int bits = 0;
! unsigned char *p;

! for (p = us_str(buffer); *p; p++) {
int a;

if ('=' == *p)
***************
*** 143,148 ****
--- 168,174 ----
char * temp = safe_strdup(buffer);
char *p = temp;
char *sn = NULL;
+ char *lang = NULL;
char E = '\0';
char *encoded = NULL;


struct string *ret = NULL;

***************
*** 153,162 ****
if ('?' != *p++)
goto fail;
sn = p;
! while (*p && '?' != *p)
p++;
if (!*p)
goto fail;
*p++ = '\0';
E = *p++;
if ('Q' != E && 'B' != E &&
--- 179,198 ----
if ('?' != *p++)
goto fail;
sn = p;
! while (*p && '?' != *p && '*' != *p)
p++;
if (!*p)
goto fail;


+ if ('*' == *p) {

+ *p++ = '\0';
+ lang = p;
+
+ while (*p && '?' != *p && '*' != *p)
+ p++;
+ if ('?' != *p)


+ goto fail;
+ }
+

*p++ = '\0';
E = *p++;
if ('Q' != E && 'B' != E &&
***************
*** 181,191 ****
switch(E) {
case 'Q':
case 'q':
! ret = hdr_qp_decode(set,encoded);
break;
case 'B':
case 'b':
! ret = hdr_base64_decode(set,encoded);
break;
}

--- 217,227 ----
switch(E) {
case 'Q':
case 'q':
! ret = hdr_qp_decode(set,encoded,lang);
break;
case 'B':
case 'b':
! ret = hdr_base64_decode(set,encoded,lang);
break;
}

***************
*** 199,210 ****
return ret;
}

- static unsigned char * us_str P_((char *str));
- static unsigned char * us_str(str)


- char *str;
- {
- return (unsigned char *)str;
- }

static struct string * hdr_dequote P_((char *buffer,
charset_t defcharset));
--- 235,240 ----
***************
*** 246,252 ****

for (ptr = buffer; ptr && *ptr; ptr = walk) {
unsigned char safe = 0;
! struct string * ok = NULL, * newresult;
int nostore = 0;

walk = blstrpbrk(ptr," \t\r\n()");
--- 276,282 ----

for (ptr = buffer; ptr && *ptr; ptr = walk) {
unsigned char safe = 0;
! struct string * ok = NULL;
int nostore = 0;

walk = blstrpbrk(ptr," \t\r\n()");
***************
*** 278,288 ****
}

/* Now compine strings */
! newresult = cat_strings(ret,ok,1);
! free_string(&ret);
free_string(&ok);
- ret = newresult;
-

if (nostore) {
/* If last was not encoded we are not going to delete
--- 308,315 ----
}

/* Now compine strings */
! append_string(&ret,ok);
free_string(&ok);

if (nostore) {
/* If last was not encoded we are not going to delete
***************
*** 318,324 ****

for (i = 0; tokenized[i]; i++) {

! struct string * ok = NULL, * newresult;
int nostore = 0;

if ('(' == tokenized[i][0]) {
--- 345,351 ----

for (i = 0; tokenized[i]; i++) {

! struct string * ok = NULL;
int nostore = 0;

if ('(' == tokenized[i][0]) {
***************
*** 351,360 ****
}

/* Now compine strings */
! newresult = cat_strings(ret,ok,1);
! free_string(&ret);
free_string(&ok);
- ret = newresult;

last_char = 0;
if (!nostore && tokenized[i+1] &&
--- 378,385 ----
}

/* Now compine strings */
! append_string(&ret,ok);
free_string(&ok);

last_char = 0;
if (!nostore && tokenized[i+1] &&
***************
*** 380,393 ****
charset_t defcharset;
int demime;
{
! struct string * ret = new_string(defcharset);

char * walk, *ptr;
unsigned char last_char = 0;

for (ptr = buffer; ptr && *ptr; ptr = walk) {
unsigned char safe = 0;
! struct string * ok = NULL, * newresult;
int nostore = 0;

walk = strpbrk(ptr," \t\r\n");
--- 405,418 ----
charset_t defcharset;
int demime;
{
! struct string * ret = NULL;

char * walk, *ptr;
unsigned char last_char = 0;

for (ptr = buffer; ptr && *ptr; ptr = walk) {
unsigned char safe = 0;
! struct string * ok = NULL;
int nostore = 0;

walk = strpbrk(ptr," \t\r\n");
***************
*** 407,412 ****
--- 432,439 ----
unsigned char ascii[2];
ascii[0] = last_char;
ascii[1] = '\0';
+ if (!ret)
+ ret = new_string(defcharset);
add_ascii_to_string(ret,ascii);
}

***************
*** 416,425 ****
}

/* Now compine strings */
! newresult = cat_strings(ret,ok,1);
! free_string(&ret);
free_string(&ok);
- ret = newresult;

if (nostore) {
/* If last was not encoded we are not going to delete
--- 443,450 ----
}

/* Now compine strings */
! append_string(&ret,ok);
free_string(&ok);

if (nostore) {
/* If last was not encoded we are not going to delete
***************
*** 429,434 ****
--- 454,461 ----
unsigned char ascii[2];
ascii[0] = safe;
ascii[1] = '\0';
+ if (!ret)
+ ret = new_string(defcharset);
add_ascii_to_string(ret,ascii);
}
last_char = 0;
***************
*** 465,470 ****
--- 492,503 ----

free(temp);

+ if (!ret) {
+ ret = new_string(defcharset);
+ DPRINT(Debug,30,(&Debug,
+ "hdr_to_string: Returning empty header...\n"));
+ }
+
DPRINT(Debug,30,(&Debug,
"hdr_to_string=%p (class=%d, buffer='%s', defcharset=%p '%s', demime=%d)\n",
ret,
Index: elm2.4.ME+.122-cvs/lib/hdrencode.c
*** elm2.4.ME+.121/lib/hdrencode.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/hdrencode.c 2005-07-01 12:15:03.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrencode.c,v 1.11 2004/03/27 18:31:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrencode.c,v 1.12 2005/07/01 09:15:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 30,52 ****
/* Need also encode special characters is comments and phrases:
\ " ( ) < > and so on
*/
! static char * hdr_tencode P_((char *buffer, const char *cs, int *Elen));
! static char * hdr_tencode(buffer,cs,Elen)
char *buffer;
CONST char *cs;
int *Elen;
{
char * ret = NULL;
int bad = 0;
char * p1, *work;
! int clen;
int l;
int i = 0;

! if (!cs || 0 != strpbrk(cs," \t\r\n()\""))
cs = "UNKNOWN-8BIT";
clen = strlen(cs);

for (p1 = buffer; *p1; p1++) {
if ((*p1 < '0' || *p1 > '9') &&
(*p1 < 'a' || *p1 > 'z') &&
--- 30,59 ----
/* Need also encode special characters is comments and phrases:
\ " ( ) < > and so on
*/
! static char * hdr_tencode P_((char *buffer, const char *cs, int *Elen,
! const char *lang));
! static char * hdr_tencode(buffer,cs,Elen,lang)
char *buffer;
CONST char *cs;
int *Elen;
+ CONST char *lang;
{
char * ret = NULL;
int bad = 0;
char * p1, *work;
! int clen,llen=0;
int l;
int i = 0;

! if (!cs || NULL != strpbrk(cs," \t\r\n()\"?*'="))
cs = "UNKNOWN-8BIT";
clen = strlen(cs);

+ if (lang && NULL != strpbrk(lang," \t\r\n()\"?*'="))
+ lang = NULL;
+ if (lang)
+ llen = strlen(lang);
+
for (p1 = buffer; *p1; p1++) {
if ((*p1 < '0' || *p1 > '9') &&
(*p1 < 'a' || *p1 > 'z') &&
***************
*** 83,93 ****
--- 90,107 ----

ret = strmcat(ret,"=?");
ret = strmcat(ret,cs);
+ if (lang) {
+ ret = strmcat(ret,"*");
+ ret = strmcat(ret,lang);
+ }
ret = strmcat(ret,"?Q?");
ret = strmcat(ret,work);
ret = strmcat(ret,"?=");
*Elen = i + clen + 8;

+ if (lang)
+ *Elen += llen + 1;
+
DPRINT(Debug,32,(&Debug,
"hdr_tencode=%s (len=%d)\n",
ret,*Elen));
***************
*** 106,117 ****
char * cname = buffer->string_type->MIME_name ?
buffer->string_type->MIME_name :
"UNKNOWN-8BIT";
! int overhead = strlen(cname) +8;
int splitlen = 75 - overhead;
int blen = string_len(buffer);
char * ret = NULL;
int X;

splitlen -= splitlen/8; /* Rough estimate */

if (splitlen < 1) /* Should not happen .... */
--- 120,137 ----
char * cname = buffer->string_type->MIME_name ?
buffer->string_type->MIME_name :
"UNKNOWN-8BIT";
! CONST char * lang = get_string_lang(buffer);
! int overhead = strlen(cname) + 8 + (lang ? strlen(lang) + 1 : 0);
int splitlen = 75 - overhead;
int blen = string_len(buffer);
char * ret = NULL;
int X;

+
+ DPRINT(Debug,32,(&Debug,
+ " (hdr_encode cname=%s, lang=%s)",
+ cname,lang ? lang : "<none>"));
+
splitlen -= splitlen/8; /* Rough estimate */

if (splitlen < 1) /* Should not happen .... */
***************
*** 123,129 ****
int oldX = X;
int Elen;

! /* We no spillting on struct string and not result stream
because we no not want split on middle of UTF-8 character
or ISO 2022 escape sequnces
*/
--- 143,149 ----
int oldX = X;
int Elen;

! /* We are splitting on struct string and not result stream
because we no not want split on middle of UTF-8 character
or ISO 2022 escape sequnces
*/
***************
*** 131,137 ****
restart:
split = clip_from_string(buffer,&X,splitlen);
tmp = us2s(stream_from_string(split,0,NULL));
! tmp2 = hdr_tencode(tmp,cname,&Elen);

if (Elen > 75 && splitlen > 3) {
int rawlen = Elen - overhead; /* Estimate */
--- 151,157 ----
restart:
split = clip_from_string(buffer,&X,splitlen);
tmp = us2s(stream_from_string(split,0,NULL));
! tmp2 = hdr_tencode(tmp,cname,&Elen,lang);

if (Elen > 75 && splitlen > 3) {
int rawlen = Elen - overhead; /* Estimate */
***************
*** 149,155 ****
newlen = splitlen -2;

DPRINT(Debug,32,(&Debug,
! "hdr_tencode restarting split_len=%d -> %d",
splitlen,newlen));


--- 169,175 ----
newlen = splitlen -2;

DPRINT(Debug,32,(&Debug,
! "hdr_encode restarting split_len=%d -> %d",
splitlen,newlen));


***************
*** 225,236 ****
--- 245,263 ----
int enmime;
{
char * ret = NULL;
+ CONST char * lang = get_string_lang(buffer);
struct string *temp;
char * tmp;
int bad = 0;
int hi = 0;
char * p1;

+ CONST char * A = get_string_MIME_name(buffer);
+
+ DPRINT(Debug,32,(&Debug," (hdr_phrase cs=%s lang=%s) ",
+ A ? A : "<none>",
+ lang ? lang : "<none>"));
+
if (!enmime)
temp = convert_string(defcharset,buffer,1);
else
***************
*** 248,258 ****
}

if (!bad && ( !enmime ||
! (temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) ||
! charset_ok_p(temp->string_type)))
ret = strmcat(ret,tmp);
else if (!enmime ||
(!hi && ( (temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,
"US-ASCII")) ||
--- 275,287 ----
}

if (!bad && ( !enmime ||
! !lang &&
! ((temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) ||
! charset_ok_p(temp->string_type))))
ret = strmcat(ret,tmp);
else if (!enmime ||
+ !lang &&
(!hi && ( (temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,
"US-ASCII")) ||
***************
*** 288,300 ****
}

static char * hdr_comment P_((const struct string *buffer,
! charset_t defcharset, int enmime));
static char * hdr_comment(buffer,defcharset,enmime)
CONST struct string *buffer;
charset_t defcharset;
int enmime;
{
char * ret;

if (!enmime) {
struct string *temp = convert_string(defcharset,buffer,1);
--- 317,335 ----
}

static char * hdr_comment P_((const struct string *buffer,
! charset_t defcharset, int enmime));
static char * hdr_comment(buffer,defcharset,enmime)
CONST struct string *buffer;
charset_t defcharset;
int enmime;
{
char * ret;
+ CONST char * lang = get_string_lang(buffer);
+ CONST char * A = get_string_MIME_name(buffer);
+
+ DPRINT(Debug,32,(&Debug," (hdr_comment cs=%s lang=%s) ",
+ A ? A : "<none>",
+ lang ? lang : "<none>"));

if (!enmime) {
struct string *temp = convert_string(defcharset,buffer,1);
***************
*** 309,315 ****
struct string *temp = ascify_string(buffer);
ret = NULL;

! if (temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) {
char *tmp = us2s(stream_from_string(temp,0,NULL));

--- 344,351 ----
struct string *temp = ascify_string(buffer);
ret = NULL;

! if (!lang &&
! temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) {
char *tmp = us2s(stream_from_string(temp,0,NULL));

***************
*** 338,343 ****
--- 374,386 ----
int enmime;
{
char * ret;
+ CONST char * lang = get_string_lang(buffer);
+ CONST char * A = get_string_MIME_name(buffer);
+
+ DPRINT(Debug,32,(&Debug," (hdr_text cs=%s lang=%s) ",
+ A ? A : "<none>",
+ lang ? lang : "<none>"));
+
if (!enmime) {
struct string *temp = convert_string(defcharset,buffer,1);
ret = us2s(stream_from_string(temp,0,NULL));
***************
*** 347,353 ****
struct string *temp = ascify_string(buffer);
ret = NULL;

! if (temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) {
ret = us2s(stream_from_string(temp,0,NULL));

--- 390,397 ----
struct string *temp = ascify_string(buffer);
ret = NULL;

! if (!lang &&
! temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) {
ret = us2s(stream_from_string(temp,0,NULL));

Index: elm2.4.ME+.122-cvs/lib/headers.c
*** elm2.4.ME+.121/lib/headers.c 2004-05-19 19:10:14.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/headers.c 2005-04-23 23:06:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: headers.c,v 1.31 2004/05/15 15:51:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: headers.c,v 1.32 2005/04/23 20:06:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 189,195 ****
} else {


char * buffer = NULL;

int j;
!
for (j = i; tokens[j]; j++) {
if ('(' == tokens[j][0])
break;
--- 189,197 ----
} else {


char * buffer = NULL;

int j;
! int ph = give_dt_enumerate_as_int(&phrase_display_mode);
!
!
for (j = i; tokens[j]; j++) {
if ('(' == tokens[j][0])
break;
***************
*** 205,211 ****

R = hdr_to_string(HDR_PHRASE,buffer,defcharset,demime);


! switch (phrase_display_mode) {
case 0:

break;
default:
--- 207,213 ----

R = hdr_to_string(HDR_PHRASE,buffer,defcharset,demime);

! switch (ph) {
case 0:
break;
default:
***************
*** 288,293 ****
--- 290,298 ----
if (bracket <= 0 &&
( ':' == tok ||
'<' == tok)) {
+
+ int ph = give_dt_enumerate_as_int(&phrase_display_mode);
+
DPRINT(Debug,25,(&Debug,
"hdr_decode_from_addr: Adding phrase\n"));

***************
*** 295,301 ****
demime,
defcharset);


! switch (phrase_display_mode) {
case 0:

break;
default:
--- 300,306 ----
demime,
defcharset);

! switch (ph) {
case 0:
break;
default:
Index: elm2.4.ME+.122-cvs/lib/imap.c
*** elm2.4.ME+.121/lib/imap.c 2004-04-13 14:26:13.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/imap.c 2005-06-18 00:02:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: imap.c,v 1.104 2004/04/04 06:17:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.104 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: imap.c,v 1.107 2005/06/17 21:02:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.107 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 14,19 ****
--- 14,25 ----

DEBUG_VAR(Debug,__FILE__,"imap");



+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

#ifdef REMOTE_MBX

/* Seems that h_errno is macro on AIX */
***************
*** 175,188 ****
static struct imap_flag {
char * flag;
int mask_elm;
long mask_imap;
} IMAP_flags[] = {
! { "\\Seen", 0, IMAP_Seen },
! { "\\Answered", REPLIED, IMAP_Answered },
! { "\\Flagged", TAGGED, IMAP_Flagged },
! { "\\Deleted", DELETED, IMAP_Deleted },
! { "\\Draft", 0, IMAP_Draft },
! { "\\Recent", NEW, IMAP_Recent },
} ;

static struct browser_flag {
--- 181,195 ----
static struct imap_flag {
char * flag;
int mask_elm;
+ int mask_elm1;
long mask_imap;
} IMAP_flags[] = {
! { "\\Seen", 0, 0, IMAP_Seen },
! { "\\Answered", REPLIED, 0, IMAP_Answered },
! { "\\Flagged", 0, S1_FLAGGED, IMAP_Flagged },
! { "\\Deleted", DELETED, 0, IMAP_Deleted },
! { "\\Draft", 0, 0, IMAP_Draft },
! { "\\Recent", NEW, 0, IMAP_Recent },
} ;

static struct browser_flag {
***************
*** 3023,3028 ****
--- 3030,3036 ----

/* IMAP browser */

+ static void browser_zero_imap P_((struct folder_browser *dir));
static void browser_zero_imap(dir)
struct folder_browser *dir;
{
***************
*** 3064,3069 ****
--- 3072,3078 ----
}
}

+ static void browser_free_imap P_((struct folder_browser *dir));
static void browser_free_imap(dir)
struct folder_browser *dir;
{
***************
*** 4545,4550 ****
--- 4554,4563 ----

if (0 != (IMAP_flags[j].mask_elm & current_header->status))
flags |= IMAP_flags[j].mask_imap;
+
+
+ if (0 != (IMAP_flags[j].mask_elm1 & current_header->status1))
+ flags |= IMAP_flags[j].mask_imap;
}

DPRINT(Debug,9,(&Debug,
***************
*** 4745,4750 ****
--- 4758,4836 ----
"browser_update_imap() called",0);

}

+ static int sort_by_name P_((const void *A, const void *B));
+ static int sort_by_name(A,B)
+ CONST void *A;
+ CONST void *B;
+ {
+ CONST struct name_vector * A1 = A;
+ CONST struct name_vector * B1 = B;

+

+ int r = string_cmp(A1->disp_name,
+ B1->disp_name,
+ 0 /* compare fialure */);

+

+ if (0 == r)
+ r = strcmp(A1->sys_name,B1->sys_name);

+
+ return r;
+ }
+

+ static int sort_by_revname P_((const void *A, const void *B));
+ static int sort_by_revname(A,B)
+ CONST void *A;
+ CONST void *B;
+ {
+ return -sort_by_name(A,B);
+ }
+

+ S_(browser_folder_sort_dir browser_folder_sort_imap)
+ static void browser_folder_sort_imap P_((struct folder_browser *dir,
+ print_sort_message * print));
+ static void browser_folder_sort_imap(dir,print)


+ struct folder_browser *dir;
+ print_sort_message * print;

+ {
+ struct string * msg = NULL;
+ int i;
+

+ if (dir->vector_len < 2)
+ return;
+

+ switch (give_dt_sort_as_int(&imap_dir_sortby)) {
+ case ID_NONE: return;
+ case ID_NAME_SORT:


+
+ if (dir->vector_len > 10) {
+ msg = format_string(CATGETS(elm_msg_cat, MeSet, MeSortingDirByName,
+ "Sorting directory %S by Name"),
+ dir->dirname);
+ print(msg);
+ }
+ qsort(dir->vector,dir->vector_len,sizeof (dir->vector[0]),
+ sort_by_name);
+ break;

+ case REVERSE ID_NAME_SORT:


+
+ if (dir->vector_len > 10) {
+ msg = format_string(CATGETS(elm_msg_cat, MeSet, MeSortingDirByRevName,
+ "Sorting directory %S by Reverse Name"),
+ dir->dirname);
+ print(msg);
+ }
+ qsort(dir->vector,dir->vector_len,sizeof (dir->vector[0]),
+ sort_by_revname);

+ break;
+
+ }
+

+ if (msg) {
+ print(NULL);
+ free_string(&msg);
+ }
+ }
+

+
struct browser_type imap_browser = { browser_zero_imap,
browser_free_imap,
browser_change_imap,
***************
*** 4770,4776 ****
browser_make_ref_imap,
browser_update_imap,
browser_imap_do_stat,
! browser_sync_write_imap
};

/* ----------------------------------------------------------------------- */
--- 4856,4863 ----
browser_make_ref_imap,
browser_update_imap,
browser_imap_do_stat,
! browser_sync_write_imap,
! browser_folder_sort_imap
};

/* ----------------------------------------------------------------------- */
***************
*** 5670,5676 ****
"mbx_copy_envelope_imap: Flags"));
for (j = 0; j < sizeof IMAP_flags / sizeof (struct imap_flag); j++)
if (0 != (ref->imap_flags & IMAP_flags[j].mask_imap)) {
! entry->status |= IMAP_flags[j].mask_elm;
DPRINT(Debug,14,(&Debug, " %s", IMAP_flags[j].flag));
}
DPRINT(Debug,14,(&Debug, "\n"));
--- 5757,5764 ----
"mbx_copy_envelope_imap: Flags"));
for (j = 0; j < sizeof IMAP_flags / sizeof (struct imap_flag); j++)
if (0 != (ref->imap_flags & IMAP_flags[j].mask_imap)) {
! entry->status |= IMAP_flags[j].mask_elm;
! entry->status1 |= IMAP_flags[j].mask_elm1;
DPRINT(Debug,14,(&Debug, " %s", IMAP_flags[j].flag));
}
DPRINT(Debug,14,(&Debug, "\n"));
***************
*** 6512,6524 ****
j < sizeof IMAP_flags / sizeof (struct imap_flag);
j++) {

! if (0 != (IMAP_flags[j].mask_elm & entry->status))
ref->imap_flags |= IMAP_flags[j].mask_imap;

/* So that 't' (tag / untag) works:
* Note that IMAP_flags[j].mask_elm == 0 for \Seen !!!
*/
! else if (0 != IMAP_flags[j].mask_elm)
ref->imap_flags &= ~IMAP_flags[j].mask_imap;
}
if (keep)
--- 6600,6614 ----
j < sizeof IMAP_flags / sizeof (struct imap_flag);
j++) {

! if (0 != (IMAP_flags[j].mask_elm & entry->status) ||
! 0 != (IMAP_flags[j].mask_elm1 & entry->status1))
ref->imap_flags |= IMAP_flags[j].mask_imap;

/* So that 't' (tag / untag) works:
* Note that IMAP_flags[j].mask_elm == 0 for \Seen !!!
*/
! else if (0 != IMAP_flags[j].mask_elm ||
! 0 != IMAP_flags[j].mask_elm1)
ref->imap_flags &= ~IMAP_flags[j].mask_imap;
}
if (keep)
Index: elm2.4.ME+.122-cvs/lib/iso2022.c
*** elm2.4.ME+.121/lib/iso2022.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/iso2022.c 2005-04-03 14:41:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.29 2004/03/27 18:31:39 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.97 2005/04/03 11:41:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.97 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 35,44 ****
--- 35,79 ----
static struct iso2022_setid set1_iso885916 = /* ISO-8859-16 */
{ bank_unspecified, iso2022_96, { 0x66, 0x00, 0x00, 0x00 } };

+ static struct iso2022_setid set1_koi8e = /* ECMA Cyrilic, ISO-IR-111, KOI8-E */
+ { bank_unspecified, iso2022_96, { 0x40, 0x00, 0x00, 0x00 } };
+
+ static struct iso2022_setid set1_iso_ir_2 = /* IRV, ISO_646.irv:1983, ISO-IR-2 */
+ { bank_G0, iso2022_94, { 0x40, 0x00, 0x00, 0x00 } };
+
+ static struct iso2022_setid set1_iso_ir_4 = /* ISO646-GB, BS_4730, ISO-IR-4 */
+ { bank_G0, iso2022_94, { 0x41, 0x00, 0x00, 0x00 } };
+
+ static struct iso2022_setid set1_iso_ir_8_1 = /* NATS-SEFI, ISO-IR-8-1 */
+ { bank_G0, iso2022_94, { 0x43, 0x00, 0x00, 0x00 } };
+
+ static struct iso2022_setid set1_iso_ir_8_2 = /* NATS-SEFI-ADD, ISO-IR-8-2 */
+ { bank_G0, iso2022_94, { 0x44, 0x00, 0x00, 0x00 } };
+
+ static struct iso2022_setid set1_iso_ir_9_1 = /* NATS-DANO, ISO-IR-9-1 */
+ { bank_G0, iso2022_94, { 0x45, 0x00, 0x00, 0x00 } };
+
+ static struct iso2022_setid set1_iso_ir_9_2 = /* NATS-DANO-ADD, ISO-IR-9-2 */
+ { bank_G0, iso2022_94, { 0x46, 0x00, 0x00, 0x00 } };
+
+ static struct iso2022_setid set1_iso_ir_10 = /* ISO646-FI, ISO646-SE, SEN_850200_B, ISO-IR-10 */
+ { bank_G0, iso2022_94, { 0x47, 0x00, 0x00, 0x00 } };
+
+ static struct iso2022_setid set1_iso_ir_11 =
+ /* ISO646-SE2, SEN_850200_C, ISO-IR-11 */
+ { bank_G0, iso2022_94, { 0x48, 0x00, 0x00, 0x00 } };
+
+
static struct iso2022_setid set_KSC5601 =
/* KSC 5601, part of ISO-2022-KR */
{ bank_G1, iso2022_94x94, { 0x43, 0x00, 0x00, 0x00 } };

+
+
+ static struct iso2022_setid set1_iso_ir_13 =
+ /* JIS_C6220-1969-jp, ISO-IR-13 */
+ { bank_G1, iso2022_94, { 0x49, 0x00, 0x00, 0x00 } };
+
static struct iso2022_setid set_JISC6220 =
/* JIS C 6220-1976 or JIS X 0201, part of ISO-2022-JP */
{ bank_G0, iso2022_94, { 0x4A, 0x00, 0x00, 0x00 } };
***************
*** 46,52 ****
static struct iso2022_setid set_JISX0201_euc =
/* JIS X 0201:1976, part of EUC-JP */
{ bank_G2, iso2022_94, { 0x4A, 0x00, 0x00, 0x00 } };
!
static struct iso2022_setid set_JISC6226a =
/* JIS C 6226-1978 or JIS X 0208-1978, part of ISO-2022-JP */
{ bank_G0, iso2022_94x94, { 0x40, 0x00, 0x00, 0x00 } };
--- 81,290 ----
static struct iso2022_setid set_JISX0201_euc =
/* JIS X 0201:1976, part of EUC-JP */
{ bank_G2, iso2022_94, { 0x4A, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_15 =
! /* IT, ISO-IR-15, ISO646-IT */
! { bank_G0, iso2022_94, { 0x59, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_16 =
! /* PT, ISO-IR-16, ISO646-PT */
! { bank_G0, iso2022_94, { 0x4C, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_17 =
! /* ES, ISO-IR-17, ISO646-ES */
! { bank_G0, iso2022_94, { 0x5A, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_18 =
! /* greek7-old, ISO-IR-18 */
! { bank_G0, iso2022_94, { 0x5B, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_19 =
! /* latin-greek, ISO-IR-19 */
! { bank_G0, iso2022_94, { 0x5C, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_21 =
! /* ISO646-DE, DIN_66003, ISO-IR-21 */
! { bank_G0, iso2022_94, { 0x4B, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_25 =
! /* ISO646-FR1, NF_Z_62-010_(1973), ISO-IR-25 */
! { bank_G0, iso2022_94, { 0x52, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_27 =
! /* Latin-greek-1 , ISO-IR-25 */
! { bank_G0, iso2022_94, { 0x55, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_37 =
! /* ISO_5427 , ISO-IR-37 */
! { bank_G0, iso2022_94, { 0x4E, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_47 =
! /* BS_viewdata" , ISO-IR-47 */
! { bank_G0, iso2022_94, { 0x56, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_49 =
! /* INIS , ISO-IR-49 */
! { bank_G0, iso2022_94, { 0x57, 0x00, 0x00, 0x00 } };
! static struct iso2022_setid set1_iso_ir_50 =
! /* INIS-8 , ISO-IR-50 */
! { bank_G1, iso2022_94, { 0x5D, 0x00, 0x00, 0x00 } };
! static struct iso2022_setid set1_iso_ir_51 =
! /* INIS-cyrillic , ISO-IR-51 */
! { bank_G1, iso2022_94, { 0x5E, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_54 =
! /* ISO_5427:1981 , ISO-IR-54 */
! { bank_G0, iso2022_94, { 0x51, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_55 =
! /* ISO_5428:1980 , ISO-IR-55 */
! { bank_G0, iso2022_94, { 0x53, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_57 =
! /* ISO646-CN, GB_1988-80 , ISO-IR-57 */
! { bank_G0, iso2022_94, { 0x54, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_60 =
! /* ISO646-NO, NS_4551-1 , ISO-IR-60 */
! { bank_G0, iso2022_94, { 0x60, 0x00, 0x00, 0x00 } };
! static struct iso2022_setid set1_iso_ir_61 =
! /* ISO646-NO2, NS_4551-2 , ISO-IR-61 */
! { bank_G0, iso2022_94, { 0x61, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_69 =
! /* ISO646-FR, NF_Z_62-010 , ISO-IR-69 */
! { bank_G0, iso2022_94, { 0x66, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_70 =
! /* codeset videotex-suppl , ISO-IR-70 */
! { bank_G0, iso2022_94, { 0x62, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_84 =
! /* ISO646-PT2, PT2 , ISO-IR-84 */
! { bank_G0, iso2022_94, { 0x67, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_85 =
! /* ISO646-ES2, ES2 , ISO-IR-85 */
! { bank_G0, iso2022_94, { 0x68, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_86 =
! /* ISO646-HU, MSZ_7795.3 , ISO-IR-86 */
! { bank_G0, iso2022_94, { 0x69, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_89 =
! /* ASMO_449 , ISO-IR-89 */
! { bank_G0, iso2022_94, { 0x6B, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_90 =
! /* ISO-IR-90 */
! { bank_G1, iso2022_94, { 0x6C, 0x00, 0x00, 0x00 } };
!
!
! static struct iso2022_setid set1_iso_ir_91 =
! /* JIS_C6229-1984-a , ISO-IR-91 */
! { bank_G0, iso2022_94, { 0x6D, 0x00, 0x00, 0x00 } };
! static struct iso2022_setid set1_iso_ir_92 =
! /* ISO646-JP-OCR-B, JIS_C6229-1984-b , ISO-IR-92 */
! { bank_G0, iso2022_94, { 0x6E, 0x00, 0x00, 0x00 } };
! static struct iso2022_setid set1_iso_ir_93 =
! /* JIS_C6229-1984-b-add , ISO-IR-93 */
! { bank_G1, iso2022_94, { 0x6F, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_94 =
! /* JIS_C6229-1984-hand , ISO-IR-94 */
! { bank_G0, iso2022_94, { 0x70, 0x00, 0x00, 0x00 } };
! static struct iso2022_setid set1_iso_ir_95 =
! /* JIS_C6229-1984-hand-add , ISO-IR-95 */
! { bank_G1, iso2022_94, { 0x71, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_96 =
! /* JIS_C6229-1984-kana , ISO-IR-96 */
! { bank_G0, iso2022_94, { 0x72, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_98 =
! /* ISO_2033-1983 , ISO-IR-98 */
! { bank_G0, iso2022_94, { 0x73, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_99 =
! /* ANSI_X3.110-1983 , ISO-IR-99 */
! { bank_G2, iso2022_94, { 0x74, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_102 =
! /* T.61-7bit , ISO-IR-102 */
! { bank_G0, iso2022_94, { 0x75, 0x00, 0x00, 0x00 } };
! static struct iso2022_setid set1_iso_ir_103 =
! /* T.61-8bit , ISO-IR-103 */
! { bank_G1, iso2022_94, { 0x76, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_121 =
! /* ISO646-CA, CSA_Z243.4-1985-1, ISO-IR-121 */
! { bank_G0, iso2022_94, { 0x77, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_122 =
! /* ISO646-CA2, CSA_Z243.4-1985-2, ISO-IR-122 */
! { bank_G0, iso2022_94, { 0x78, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_123 =
! /* CSA_Z243.4-1985-gr, ISO-IR-123 */
! { bank_G1, iso2022_96, { 0x45, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_128 =
! /* T.101-G2 , ISO-IR-128 */
! { bank_G2, iso2022_94, { 0x7C, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_139 =
! /* CSN_369103 , ISO-IR-139 */
! { bank_unspecified, iso2022_96, { 0x49, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_141 =
! /* ISO646-YU, JUS_I.B1.002 , ISO-IR-141 */
! { bank_G0, iso2022_94, { 0x7A, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_142 =
! /* ISO_6937-2-add , ISO-IR-142 */
! { bank_G1, iso2022_96, { 0x4A, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_143 =
! /* IEC_P27-1 , ISO-IR-143 */
! { bank_G1, iso2022_96, { 0x4B, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_146 =
! /* JUS_I.B1.003-serb , ISO-IR-146 */
! { bank_G0, iso2022_94, { 0x7B, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_147 =
! /* JUS_I.B1.003-mac , ISO-IR-147 */
! { bank_G0, iso2022_94, { 0x7D, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_150 =
! /* greek-ccitt , ISO-IR-150 */
! { bank_G0, iso2022_94, { 0x21, 0x40, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_151 =
! /* ISO646-CU, NC_NC00-10:81 , ISO-IR-151 */
! { bank_G0, iso2022_94, { 0x21, 0x41, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_152 =
! /* ISO_6937-2-25 , ISO-IR-152 */
! { bank_G1, iso2022_96, { 0x4E, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_153 =
! /* GOST_19768-74 , ISO-IR-153 */
! { bank_G1, iso2022_96, { 0x4F, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_154 =
! /* ISO_8859-supp , ISO-IR-154 */
! { bank_G3, iso2022_96, { 0x50, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_155 =
! /* ISO_10367-box , ISO-IR-155 */
! { bank_G1, iso2022_96, { 0x51, 0x00, 0x00, 0x00 } };
!
! static struct iso2022_setid set1_iso_ir_158 =
! /* ISO_10367-box , ISO-IR-158 */
! { bank_G3, iso2022_96, { 0x58, 0x00, 0x00, 0x00 } };
!
!
static struct iso2022_setid set_JISC6226a =
/* JIS C 6226-1978 or JIS X 0208-1978, part of ISO-2022-JP */
{ bank_G0, iso2022_94x94, { 0x40, 0x00, 0x00, 0x00 } };
***************
*** 182,187 ****
--- 420,486 ----
{ &set1_latin8, NULL, ml_system },
{ &set1_latin9, NULL, ml_system },
{ &set1_iso885916, NULL, ml_system },
+ { &set1_koi8e, NULL, ml_system },
+ { &set1_iso_ir_2, NULL, ml_system },
+ { &set1_iso_ir_4, NULL, ml_system },
+ { &set1_iso_ir_8_1, NULL, ml_system },
+ { &set1_iso_ir_8_2, NULL, ml_system },
+ { &set1_iso_ir_9_1, NULL, ml_system },
+ { &set1_iso_ir_9_2, NULL, ml_system },
+ { &set1_iso_ir_10, NULL, ml_system },
+ { &set1_iso_ir_11, NULL, ml_system },
+ { &set1_iso_ir_13, NULL, ml_system },
+ { &set1_iso_ir_15, NULL, ml_system },
+ { &set1_iso_ir_16, NULL, ml_system },
+ { &set1_iso_ir_17, NULL, ml_system },
+ { &set1_iso_ir_18, NULL, ml_system },
+ { &set1_iso_ir_19, NULL, ml_system },
+ { &set1_iso_ir_21, NULL, ml_system },
+ { &set1_iso_ir_25, NULL, ml_system },
+ { &set1_iso_ir_27, NULL, ml_system },
+ { &set1_iso_ir_37, NULL, ml_system },
+ { &set1_iso_ir_47, NULL, ml_system },
+ { &set1_iso_ir_49, NULL, ml_system },
+ { &set1_iso_ir_50, NULL, ml_system },
+ { &set1_iso_ir_51, NULL, ml_system },
+ { &set1_iso_ir_54, NULL, ml_system },
+ { &set1_iso_ir_55, NULL, ml_system },
+ { &set1_iso_ir_57, NULL, ml_system },
+ { &set1_iso_ir_60, NULL, ml_system },
+ { &set1_iso_ir_61, NULL, ml_system },
+ { &set1_iso_ir_69, NULL, ml_system },
+ { &set1_iso_ir_70, NULL, ml_system },
+ { &set1_iso_ir_84, NULL, ml_system },
+ { &set1_iso_ir_85, NULL, ml_system },
+ { &set1_iso_ir_86, NULL, ml_system },
+ { &set1_iso_ir_89, NULL, ml_system },
+ { &set1_iso_ir_90, NULL, ml_system },
+ { &set1_iso_ir_91, NULL, ml_system },
+ { &set1_iso_ir_92, NULL, ml_system },
+ { &set1_iso_ir_93, NULL, ml_system },
+ { &set1_iso_ir_94, NULL, ml_system },
+ { &set1_iso_ir_95, NULL, ml_system },
+ { &set1_iso_ir_96, NULL, ml_system },
+ { &set1_iso_ir_98, NULL, ml_system },
+ { &set1_iso_ir_99, NULL, ml_system },
+ { &set1_iso_ir_102, NULL, ml_system },
+ { &set1_iso_ir_103, NULL, ml_system },
+ { &set1_iso_ir_121, NULL, ml_system },
+ { &set1_iso_ir_122, NULL, ml_system },
+ { &set1_iso_ir_123, NULL, ml_system },
+ { &set1_iso_ir_128, NULL, ml_system },
+ { &set1_iso_ir_139, NULL, ml_system },
+ { &set1_iso_ir_141, NULL, ml_system },
+ { &set1_iso_ir_142, NULL, ml_system },
+ { &set1_iso_ir_143, NULL, ml_system },
+ { &set1_iso_ir_146, NULL, ml_system },
+ { &set1_iso_ir_147, NULL, ml_system },
+ { &set1_iso_ir_150, NULL, ml_system },
+ { &set1_iso_ir_151, NULL, ml_system },
+ { &set1_iso_ir_152, NULL, ml_system },
+ { &set1_iso_ir_153, NULL, ml_system },
+ { &set1_iso_ir_154, NULL, ml_system },
+ { &set1_iso_ir_155, NULL, ml_system },
{ &set_KSC5601, NULL, ml_system },
{ &set_JISC6220, NULL, ml_system },
{ &set_JISX0201_euc, NULL, ml_system },
***************
*** 860,865 ****
--- 1159,1710 ----
bank_G0, bank_G2
};

+ struct setlist set_koi8e = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_koi8e, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G2
+ };
+
+
+ /* codeset ISO_646.irv:1983 -- iso-ir-2 */
+ struct setlist set_iso_ir_2 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_2, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-GB - codeset BS_4730 -- iso-ir-4 */
+ struct setlist set_iso_ir_4 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_4, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset NATS-SEFI -- iso-ir-8-1 */
+ struct setlist set_iso_ir_8_1 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_8_1, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset NATS-SEFI-ADD -- iso-ir-8-2 */
+ struct setlist set_iso_ir_8_2 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_8_2, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset NATS-DANO -- iso-ir-9-1 */
+ struct setlist set_iso_ir_9_1 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_9_1, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset NATS-DANO-ADD -- iso-ir-9-2 */
+ struct setlist set_iso_ir_9_2 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_9_2, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-FI, codeset SEN_850200_B -- iso-ir-10 */
+ struct setlist set_iso_ir_10 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_10, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+
+ /* ISO646-SE2, codeset SEN_850200_C -- iso-ir-11 */
+ struct setlist set_iso_ir_11 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_11, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+
+ /* "KS_C_5601-1987" -- ISO-IR-149 */
+ struct setlist set_iso_ir_149 = {
+ { -1, -1, -1, -1 },
+ { &set_KSC5601jp, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ... must probably incorrect assigment of backs ... */
+ struct setlist set_iso_ir_13 = {
+ { -1, -1, -1, -1 },
+ { &set_JISC6220, &set1_iso_ir_13, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* ISO646-IT, codeset IT -- iso-ir-15 */
+ struct setlist set_iso_ir_15 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_15, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-PT, codeset PT -- iso-ir-16 */
+ struct setlist set_iso_ir_16 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_16, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-ES, codeset ES -- iso-ir-17 */
+ struct setlist set_iso_ir_17 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_17, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset greek7-old -- iso-ir-18 */
+ struct setlist set_iso_ir_18 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_18, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset latin-greek -- iso-ir-19 */
+ struct setlist set_iso_ir_19 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_19, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-DE, codeset DIN_66003 -- iso-ir-21 */
+ struct setlist set_iso_ir_21 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_21, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-FR1, codeset NF_Z_62-010_(1973) -- iso-ir-25 */
+ struct setlist set_iso_ir_25 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_25, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset Latin-greek-1 -- iso-ir-27 */
+ struct setlist set_iso_ir_27 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_27, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset ISO_5427 -- iso-ir-37 */
+ struct setlist set_iso_ir_37 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_37, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset BS_viewdata -- iso-ir-47 */
+ struct setlist set_iso_ir_47 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_47, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset INIS -- iso-ir-49 */
+ struct setlist set_iso_ir_49 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_49, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset INIS-8 -- iso-ir-50 */
+ struct setlist set_iso_ir_50 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_49, &set1_iso_ir_50, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* codeset INIS-cyrillic -- iso-ir-51 */
+ struct setlist set_iso_ir_51 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_49, &set1_iso_ir_51, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* codeset "ISO_5427:1981" -- iso-ir-54 */
+ struct setlist set_iso_ir_54 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_54, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "ISO_5428:1980" -- iso-ir-55 */
+ struct setlist set_iso_ir_55 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_55, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-CN, codeset "GB_1988-80" -- iso-ir-57 */
+ struct setlist set_iso_ir_57 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_57, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-NO, codeset "NS_4551-1" -- iso-ir-60 */
+ struct setlist set_iso_ir_60 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_60, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-NO2, codeset "NS_4551-2" -- iso-ir-61 */
+ struct setlist set_iso_ir_61 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_61, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-FR, codeset "NF_Z_62-010" -- iso-ir-69 */
+ struct setlist set_iso_ir_69 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_69, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "videotex-suppl" -- iso-ir-70 */
+ struct setlist set_iso_ir_70 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_70, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-PT2, codeset "PT2" -- iso-ir-84 */
+ struct setlist set_iso_ir_84 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_84, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-ES2, codeset "ES2" -- iso-ir-85 */
+ struct setlist set_iso_ir_85 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_85, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-HU, codeset "MSZ_7795.3" -- iso-ir-86 */
+ struct setlist set_iso_ir_86 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_86, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "ASMO_449" -- iso-ir-89 */
+ struct setlist set_iso_ir_89 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_89, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "iso-ir-90" */
+ struct setlist set_iso_ir_90 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_2, &set1_iso_ir_90, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* codeset "JIS_C6229-1984-a" -- iso-ir-91 */
+ struct setlist set_iso_ir_91 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_91, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-JP-OCR-B , codeset "JIS_C6229-1984-b" -- iso-ir-92 */
+ struct setlist set_iso_ir_92 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_92, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* This is quite likely wrong...
+ codeset "JIS_C6229-1984-b-add" -- iso-ir-93 */
+ struct setlist set_iso_ir_93 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_92, &set1_iso_ir_93, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* codeset "JIS_C6229-1984-hand" -- iso-ir-94 */
+ struct setlist set_iso_ir_94 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_94, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+ /* codeset "JIS_C6229-1984-hand-add" -- iso-ir-95
+ This is quite likely incorrect...
+ */
+ struct setlist set_iso_ir_95 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_94, &set1_iso_ir_95, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+
+ /* codeset "JIS_C6229-1984-kana" -- iso-ir-96 */
+ struct setlist set_iso_ir_96 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_96, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "ISO_2033-1983" -- iso-ir-98
+ * this is likely to be incorrect
+ */
+ struct setlist set_iso_ir_98 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_98, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "ANSI_X3.110-1983" -- iso-ir-99
+ this is incorrect
+ */
+ struct setlist set_iso_ir_99 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_99, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G2, bank_unspecified
+ };
+
+ /* codeset "T.61-7bit" -- iso-ir-102
+ */
+ struct setlist set_iso_ir_102 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_102, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "T.61-8bit" -- iso-ir-103
+ */
+ struct setlist set_iso_ir_103 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_102, &set1_iso_ir_103, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* ISO646-CA, codeset "CSA_Z243.4-1985-1" -- iso-ir-121
+ */
+ struct setlist set_iso_ir_121 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_121, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-CA2, codeset "CSA_Z243.4-1985-2" -- iso-ir-122
+ */
+ struct setlist set_iso_ir_122 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_122, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "CSA_Z243.4-1985-gr" -- iso-ir-123
+ * This is probably incorrect
+ */
+ struct setlist set_iso_ir_123 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_121, &set1_iso_ir_123, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* codeset "T.101-G2", ISO-IR-128
+ * This is likely to be incorrect
+ */
+ struct setlist set_iso_ir_128 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_128, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G2, bank_unspecified
+ };
+
+ /* codeset "CSN_369103", ISO-IR-139
+ * This is almost ISO-8859-2
+ */
+ struct setlist set_iso_ir_139 = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_iso_ir_139, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G2
+ };
+
+ /* ISO646-YU, codeset "JUS_I.B1.002", IS-IR-141 */
+ struct setlist set_iso_ir_141 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_141, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "ISO_6937-2-add", ISO-IR-142
+ */
+ struct setlist set_iso_ir_142 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_2, &set1_iso_ir_142, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* codeset "IEC_P27-1", ISO-IR-143
+ */
+ struct setlist set_iso_ir_143 = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_iso_ir_143, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* codeset "JUS_I.B1.003-serb", ISO-IR-146
+ */
+ struct setlist set_iso_ir_146 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_146, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "JUS_I.B1.003-mac", ISO-IR-147
+ */
+ struct setlist set_iso_ir_147 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_147, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset "greek-ccitt", ISO-IR-150
+ */
+ struct setlist set_iso_ir_150 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_150, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* ISO646-CU, codeset "NC_NC00-10:81", ISO-IR-151
+ */
+ struct setlist set_iso_ir_151 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_151, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+
+ /* codeset "ISO_6937-2-25", ISO-IR-152
+ * Assumed to be like ISO-8859-*
+ */
+ struct setlist set_iso_ir_152 = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_iso_ir_152, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* codeset "GOST_19768-74 ", ISO-IR-153
+ * Assumed to be like ISO-8859-*
+ */
+ struct setlist set_iso_ir_153 = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_iso_ir_153, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+ /* codeset "ISO_8859-supp", ISO-IR-154
+ * Assumed to be like ISO-8859-*
+ * This is likely to be incorrect
+ */
+ struct setlist set_iso_ir_154 = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_iso_ir_154, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G3
+ };
+
+
+ /* codeset "ISO_10367-box ", ISO-IR-155
+ * Assumed to be like ISO-8859-*
+ * This is likely to be incorrect
+ */
+ struct setlist set_iso_ir_155 = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_iso_ir_155, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1
+ };
+
+
+ /* codeset "latin-lap", ISO-IR-158
+ * Assumed to be like ISO-8859-*
+ * This is likely to be incorrect
+ */
+ struct setlist set_iso_ir_158 = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_iso_ir_158, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G3
+ };
+
+

/* ISO-2022-KR - RFC 1557 --- ASCII
KSC 5601
***************
*** 896,901 ****
--- 1741,1763 ----
bank_G0, bank_unspecified
};

+ /* iso-ir-42 -- must likely incorrenct */
+ struct setlist set_iso_ir_42 = {
+ { -1, -1, -1, -1 },
+ { &set_JISC6226a, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* iso-ir-87 -- must likely incorrenct */
+ struct setlist set_iso_ir_87 = {
+ { -1, -1, -1, -1 },
+ { &set_JISC6226b, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+
/* EUC-JP - G0 ASCII
G1 JIS X 0208-1983
G2 JIS X 0201:1976/1997
***************
*** 938,943 ****
--- 1800,1826 ----
&set_ISO88597, NULL },
bank_G0, bank_G2
};
+
+ /* GB_2312-80, iso-ir-58 */
+ struct setlist set_iso_ir_58 = {
+ { -1, -1, -1, -1 },
+ { &set_GB2312jp , NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset JIS_X0212-1990, iso-ir-159
+ * This is likely be incorrect
+ */
+ struct setlist set_iso_ir_159 = {
+ { -1, -1, -1, -1 },
+ { &set_JISX0212, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+
+

/* ISO-2022-CN -- RFC 1922, ASCII,
GB 2312,
***************
*** 1006,1020 ****

static struct setlist * INITIAL_setlists[] = {
&set_utf8,
&set_latin8,
&set_ISO2022KR,
&set_EUCKR,
&set_ISO2022JP,
&set_EUCJP,
&set_ISO646JP,
&set_ISO2022JP2,
&set_ISO2022CN,
! &set_ISO2022CNEXT
};

struct setlist sets_iso_8859_X [] = {
--- 1889,1973 ----

static struct setlist * INITIAL_setlists[] = {
&set_utf8,
+ &set_latin7,
&set_latin8,
+ &set_latin9,
+ &set_iso885916,
+ &set_koi8e,
+ &set_iso_ir_2,
+ &set_iso_ir_4,
+ &set_iso_ir_8_1,
+ &set_iso_ir_8_2,
+ &set_iso_ir_9_1,
+ &set_iso_ir_9_2,
+ &set_iso_ir_10,
+ &set_iso_ir_11,
+ &set_iso_ir_13,
+ &set_iso_ir_15,
+ &set_iso_ir_16,
+ &set_iso_ir_17,
+ &set_iso_ir_18,
+ &set_iso_ir_19,
+ &set_iso_ir_21,
+ &set_iso_ir_25,
+ &set_iso_ir_27,
+ &set_iso_ir_37,
+ &set_iso_ir_47,
+ &set_iso_ir_49,
+ &set_iso_ir_50,
+ &set_iso_ir_51,
+ &set_iso_ir_54,
+ &set_iso_ir_55,
+ &set_iso_ir_57,
+ &set_iso_ir_58,
+ &set_iso_ir_60,
+ &set_iso_ir_61,
+ &set_iso_ir_69,
+ &set_iso_ir_70,
+ &set_iso_ir_84,
+ &set_iso_ir_85,
+ &set_iso_ir_86,
+ &set_iso_ir_89,
+ &set_iso_ir_90,
+ &set_iso_ir_91,
+ &set_iso_ir_92,
+ &set_iso_ir_93,
+ &set_iso_ir_94,
+ &set_iso_ir_95,
+ &set_iso_ir_96,
+ &set_iso_ir_98,
+ &set_iso_ir_99,
+ &set_iso_ir_102,
+ &set_iso_ir_103,
+ &set_iso_ir_121,
+ &set_iso_ir_122,
+ &set_iso_ir_123,
+ &set_iso_ir_128,
+ &set_iso_ir_139,
+ &set_iso_ir_141,
+ &set_iso_ir_142,
+ &set_iso_ir_143,
+ &set_iso_ir_146,
+ &set_iso_ir_147,
+ &set_iso_ir_150,
+ &set_iso_ir_151,
+ &set_iso_ir_152,
+ &set_iso_ir_153,
+ &set_iso_ir_154,
+ &set_iso_ir_155,
+ &set_iso_ir_158,
+ &set_iso_ir_159,
&set_ISO2022KR,
&set_EUCKR,
+ &set_iso_ir_149,
&set_ISO2022JP,
&set_EUCJP,
&set_ISO646JP,
&set_ISO2022JP2,
+ &set_iso_ir_42,
+ &set_iso_ir_87,
&set_ISO2022CN,
! &set_ISO2022CNEXT,
};

struct setlist sets_iso_8859_X [] = {
Index: elm2.4.ME+.122-cvs/lib/iso2022_map.c
*** elm2.4.ME+.121/lib/iso2022_map.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/iso2022_map.c 2005-03-27 13:07:26.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iso2022_map.c,v 1.9 2004/03/27 18:31:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: iso2022_map.c,v 1.12 2005/03/27 10:07:26 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 51,64 ****
if ('\0' == *name)
return NULL;
if (is_on_mapdir(name)) {
! if (0 != access(map_txtdir,ACCESS_EXISTS)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet,MeNoTxtMapDir,
"Map %s: no map-text-dir exist: %s: %s"),
! name,map_txtdir,error_description(err));
return NULL;
}
! *fn = elm_message(FRM("%s/%s"),map_txtdir,name);
map_dir++;
} else {
char buffer[STRING];
--- 51,70 ----
if ('\0' == *name)
return NULL;
if (is_on_mapdir(name)) {


! /* give_dt_estr_as_str adds / to end */

! char * map_txtdir_val = give_dt_estr_as_str(&map_txtdir_e,
! "map-text-dir");
! if (!map_txtdir_val)
! return NULL;
!
! if (0 != access(map_txtdir_val,ACCESS_EXISTS)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet,MeNoTxtMapDir,
"Map %s: no map-text-dir exist: %s: %s"),
! name,map_txtdir_val,error_description(err));
return NULL;
}
! *fn = elm_message(FRM("%s%s"),map_txtdir_val,name);
map_dir++;
} else {
char buffer[STRING];
***************
*** 874,881 ****
*type = Mx->type;

if (Mx->builtin_map) {
!
! unsigned char ch = '\0';
int found = 0;



if (&cs_onebyte == Mx->builtin_map->map_type)

--- 880,886 ----
*type = Mx->type;

if (Mx->builtin_map) {
! int ch = '\0';
int found = 0;

Kari E. Hurtta

unread,
Jul 13, 2005, 5:47:34 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.9

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 9/18
=========================================================================


215 Your mail is being forwarded to %s.\n\r
$ #SeekFailed

***************
*** 828,835 ****
455 (use <space> to toggle, any other key to leave)
$ #SpaceToChange
456 <space> to change
$ #SpaceForNext
! 457 (SPACE for next, or R)everse)
$ #ResortingFolder
458 Resorting folder...
$ #SortRSentDate
--- 828,837 ----
455 (use <space> to toggle, any other key to leave)
$ #SpaceToChange
456 <space> to change
+ $quote "
$ #SpaceForNext
! 457 " (SPACE for next, or R)everse)"
! $quote
$ #ResortingFolder
458 Resorting folder...
$ #SortRSentDate
***************
*** 956,961 ****
--- 958,964 ----
\t -V \t\tEnable sendmail voyeur mode.\n\r\
\t -v \t\tPrint out ELM version information.\n\r\
\t -w \t\tWrite .elm/elmrc and .elm/mime.charsets\n\r\
+ \t -y \t\tdon't enter ELM if no unread mail is pending\n\r\
\t -z \t\tZero - don't enter ELM if no mail is pending\n\r\
\n\n
$ #AlreadyReadingThatFolder
***************
*** 1072,1079 ****


\r or a filename (a leading '=' denotes your folder directory).\n\r\n\r

$ #ShownXWithSelect
593 %S with %d shown out of %d
- $ #ShownXNoSelect
- 594 %S with 1 message
$ #FolderWord
595 Folder
$ #MailboxWord
--- 1075,1080 ----
***************
*** 1162,1169 ****
641 \n\nStopped. Use "fg" to return to ELM\n\n
$ #BackInElmRedraw
642 \nBack in ELM. (You might need to explicitly request a redraw.)\n\n
- $ #ShownXNoSelectPlural
- 643 %S with %d messages
$quote '
$ #KeyF1
644 ' Display Msg'
--- 1163,1168 ----
***************
*** 1345,1353 ****
$ #SortUnknown
740 *UNKNOWN-SORT-PARAMETER*
$ #EnterLastSelected
! 741 Enter: {"subject","to","from","cc","header"} [pattern] OR {"thread","tagged","all"}
$ #EnterSelected
! 742 Enter: {"subject","to","from","header"} [pattern] OR {"thread","tagged"}
$ #HelpUndeletePattern
743 ^U = Undelete all messages with the specified pattern.
$ #NoIncludeFilename
--- 1344,1352 ----
$ #SortUnknown
740 *UNKNOWN-SORT-PARAMETER*
$ #EnterLastSelected
! 741 Enter: {"subject","to","from","cc","header"} [pattern] OR {"tagged","all",...}
$ #EnterSelected
! 742 Enter: {"subject","to","from","header"} [pattern] OR {"thread","tagged",...}
$ #HelpUndeletePattern
743 ^U = Undelete all messages with the specified pattern.
$ #NoIncludeFilename
***************
*** 1571,1579 ****
$ #ErrorReading
866 Error reading from %.50s
$ #ErrorReadableUser
! 867 %.50s isn't readable by user!
$ #CantOpenAttach
! 868 Can't open attachment: %.50s
$ #InternalnoFD
869 Internal error: no parent fd!
$ #FailedSeekAttach
--- 1570,1578 ----
$ #ErrorReading
866 Error reading from %.50s
$ #ErrorReadableUser
! 867 %S isn't readable by user!
$ #CantOpenAttach
! 868 Can't open attachment: %S
$ #InternalnoFD
869 Internal error: no parent fd!
$ #FailedSeekAttach
***************
*** 1599,1605 ****
$ #CouldOpenReading
881 Could not open file for reading!
$ #StrucredNoEncoding
! 882 %.30s: Structured types don't allow encoding of data.
$ #NotKnowPrint
883 Don't know how to print this type of data!
$ #MailNotSaved
--- 1598,1604 ----
$ #CouldOpenReading
881 Could not open file for reading!
$ #StrucredNoEncoding
! 882 %S: Structured types don't allow encoding of data.
$ #NotKnowPrint
883 Don't know how to print this type of data!
$ #MailNotSaved
***************
*** 1640,1653 ****
901 Structured types must be encoded in leaf type!
$ #UnknownCommand2
902 Unknown command.
! $ #FileNotExist
! 903 That file %.20s does not exist!
! $ #CantStatFile
! 904 Could not stat file %.20s!
! $ #NotReadableByUser
! 905 %.50s isn't readable by user!
! $ #CheckingEncoding
! 906 Checking %s...
$ #CantOpenFile
907 Can't open %s!
$ #NoAttachments
--- 1639,1652 ----
901 Structured types must be encoded in leaf type!
$ #UnknownCommand2
902 Unknown command.
! $ #FileNotExistS
! 903 That file %S does not exist!
! $ #CantStatFileS
! 904 Could not stat file %S!
! $ #NotReadableByUserS
! 905 %S isn't readable by user!
! $ #CheckingEncodingS
! 906 Checking %S...
$ #CantOpenFile
907 Can't open %s!
$ #NoAttachments
***************
*** 1706,1713 ****
934 Header has 8BIT data and charset=US-ASCII, using charset=UNKNOWN-8BIT instead.
$ #HeaderBadCharset
935 Bad charset=%s, using charset=UNKNOWN-8BIT instead.
! $ #ErrorOpeningName
! 936 Error opening %s!
$ #ErrorWhenReading
937 Error when reading: %S
$ #FailedLeaveFolder
--- 1705,1712 ----
934 Header has 8BIT data and charset=US-ASCII, using charset=UNKNOWN-8BIT instead.
$ #HeaderBadCharset
935 Bad charset=%s, using charset=UNKNOWN-8BIT instead.
! $ #ErrorOpeningNameS
! 936 Error opening %S!
$ #ErrorWhenReading
937 Error when reading: %S
$ #FailedLeaveFolder
***************
*** 1820,1827 ****
$quote
$ #DbxCurrMsgNum
1005 Current message number = %d\t\t%d message(s) total\n
- $ #DbxHdrPage
- 1006 Header_page = %d \t\t%d possible page(s)\n
$ #DbxCurrMailFile
1007 \nCurrent mail file is %S.\n\r\n
$ #DbxPressAnyKey
--- 1819,1824 ----
***************
*** 2174,2181 ****
2094 "%2d Use '%s' to show %s/%s"
$ #Metamail
2095 "Metamail"
! $ #MailcapQuit
! 2096 "Answer questions, use m)etamail or q)uit menu: "
$ #TitleQuit
2097 "Elm: exiting"
$ #IconQuit
--- 2171,2178 ----
2094 "%2d Use '%s' to show %s/%s"
$ #Metamail
2095 "Metamail"
! $ #MailcapDone
! 2096 "Press enter for default or use y/n, use m)etamail or d)one: "
$ #TitleQuit
2097 "Elm: exiting"
$ #IconQuit
***************
*** 2233,2239 ****
$ #SearchingInMessageFound
2124 "Searching %d (%02d%%) FOUND"
$ #Level0PartLine2
! 2125 "d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, return to i)ndex"
$ #Level0PartLine3
2126 "To read a message, press <return>. j = move down, k = move up"
$ #Level1PartLine2
--- 2230,2236 ----
$ #SearchingInMessageFound
2124 "Searching %d (%02d%%) FOUND"
$ #Level0PartLine2
! 2125 "d)elete or u)ndelete mail, m)ail a message, r)eply mail, return to i)ndex"
$ #Level0PartLine3
2126 "To read a message, press <return>. j = move down, k = move up"
$ #Level1PartLine2
***************
*** 2253,2261 ****
$ #HdrEditComment
2134 "# Headers are automatically converted from %s charset and not need encoded\n"
$ #HdrEditCommentEnc
! 2135 "# MIME enconding of headers is supported\n"
$ #HdrEditCommentNo
! 2136 "# MIME enconding of headers is NOT supported\n"
$ #HdrNotSupported
2137 "Editing of %s header is not supported."
$ #HdrGarbage
--- 2250,2258 ----
$ #HdrEditComment
2134 "# Headers are automatically converted from %s charset and not need encoded\n"
$ #HdrEditCommentEnc
! 2135 "# MIME encoding of headers is supported\n"
$ #HdrEditCommentNo
! 2136 "# MIME encoding of headers is NOT supported\n"
$ #HdrNotSupported
2137 "Editing of %s header is not supported."
$ #HdrGarbage
***************
*** 2325,2328 ****
2168 'Also available: d)elete, u)ndelete, i)ndex'
$ #VfyMessageKept1
2169 'Message kept. Can be restored at next m)ail command.'
!
--- 2322,2381 ----
2168 'Also available: d)elete, u)ndelete, i)ndex'
$ #VfyMessageKept1
2169 'Message kept. Can be restored at next m)ail command.'
! $ #ShownXNoSelectItem
! 2170 %S with %d %S
! $ #MailcapPage
! 2171 'Press enter for default, use m)etamail or p)age mail: '
! $quote "
! $ #MetamailMenu1
! 2172 "Viewing of this message requires metamail. Press 'm' to select metamail."
! $ #MetamailMenu2
! 2173 "Or you can p)age message without metamail."
! $ #MetamailMenu
! 2174 "Metamail selection"
! $ #MailcapMenu1
! 2175 "Viewing of this message requires external programs (press 'y' to confirm.)"
! $ #MailcapMenu2
! 2176 "To refuse external program press 'n'. Also you can page message with m)etamail."
! $ #Done
! 2177 "Done"
! $ #ShownTitleNoMailbox
! 2178 "No mailbox"
! $ #NoItemToFlag
! 2179 "No %S to flag!"
! $ #LimitReturnToLastSelection
! 2180 "Returned to last selection."
! $ #ReverseUnstable
! 2181 "(SPACE, R)everse or U)nstable)"
! $ #PadUnsThread
! 2182 "Unstable Reverse Thread "
! $ #AbrUnsThread
! 2183 "(Unstable) Reverse-Thread"
! $ #LongUnsThread
! 2184 "Unstable Reverse Thread"
! $quote '
! $ #BadLineInElmrc
! 2185 'Keyword "%s" without = -character in line %d in "%s" file'
! $ #DomainUnknown
! 2186 'Domain %s of address %S is unknown'
! $ #VerifyNot
! 2189 'Unable to verify mail address %S'
! $quote
! $ #VerifyBad
! 2190 Address %S is not e-mail address or Elm's alias
! $ #VerifyBad1
! 2191 Address %s is not e-mail address
! $ #VerifyNot1
! 2192 Unable to verify mail address %s
! $ #ErrorReadingS
! 2193 Error reading from %S
! $ #CantOpenFileS
! 2194 Can't open %S!
! $ #FailErrnoS
! 2195 Failed: %S: %.40s
! $ #ArgsBadZoption
! 2196 Option -z incompatible with given other options.
! $ #ArgsBadYoption
! 2197 Option -y incompatible with given other options.
! $ #NoUnreadMail
! 2198 You have no unread mail.
Index: elm2.4.ME+.122-cvs/nls/C/C/C/s_elmrc.m
*** elm2.4.ME+.121/nls/C/C/C/s_elmrc.m 2003-05-28 21:49:27.000000000 +0300
--- elm2.4.ME+.122-cvs/nls/C/C/C/s_elmrc.m 2005-07-05 20:53:38.000000000 +0300
***************
*** 13,25 ****
6 Options saved in file %s.
$ #OptionsFile
7 #\n# .elm/elmrc - options file for the ELM mail system\n#\n
- $ #SavedAutoFor
- 8 # Saved automatically by ELM %s for %s\n#\n\n
- $ #SavedAuto
- 9 # Saved automatically by ELM %s\n#\n\n
$ #NoBothwI
10 Can't specify both -w and -I options!
! $ #SavedAutoWrite
! 11 # Saved automatically by ELMRC-WRITE %s\n#\n\n
! $ #SavedAutoLIB
! 12 # Saved automatically by ELMLIBREGISTER %s\n#\n\n
--- 13,25 ----
6 Options saved in file %s.
$ #OptionsFile
7 #\n# .elm/elmrc - options file for the ELM mail system\n#\n
$ #NoBothwI
10 Can't specify both -w and -I options!
! $ #SavedAutoWrite1
! 13 # Saved automatically by %s %s\n#\n\n
! $ #FileNotWriteable
! 14 File %s is not writeable: %s
! $ #FileNotRenamed
! 15 Failed to rename temporary file to %s: %s
! $ #SavedAutoFor1
! 16 # Saved automatically by %s %s for %s\n#\n\n
Index: elm2.4.ME+.122-cvs/nls/C/C/C/s_me.m
*** elm2.4.ME+.121/nls/C/C/C/s_me.m 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/nls/C/C/C/s_me.m 2005-07-01 12:15:05.000000000 +0300
***************
*** 3,9 ****
$ #DecodeDescA
1 '"%.60S" ]\n'
$ #DecodeDescFilenameA
! 2 'Filename: %.60s ]\n'
$ #DecodeAttachA
3 '[ Attach #%d/%d: '
$ #DecodePartA
--- 3,9 ----
$ #DecodeDescA
1 '"%.60S" ]\n'
$ #DecodeDescFilenameA
! 2 'Filename: %.60S ]\n'
$ #DecodeAttachA
3 '[ Attach #%d/%d: '
$ #DecodePartA
***************
*** 134,142 ****
$ #DecodeSignedNosubtypes
71 Content-Type: multipart/signed, no subtypes
$ #DecodeNoProtocol
! 72 'protocol' paramater is missing from Multipart/Signed -type!
$ #ParseNoBoundary
! 73 'boundary' paramater is missing from Multipart -type!
$ #ParseErrorContent
74 PARSE ERROR: Several Content-Type headers!
$ #ParseErrorDisposition
--- 134,142 ----
$ #DecodeSignedNosubtypes
71 Content-Type: multipart/signed, no subtypes
$ #DecodeNoProtocol
! 72 'protocol' parameter is missing from Multipart/Signed -type!
$ #ParseNoBoundary
! 73 'boundary' parameter is missing from Multipart -type!
$ #ParseErrorContent
74 PARSE ERROR: Several Content-Type headers!
$ #ParseErrorDisposition
***************
*** 419,428 ****
225 Name %S (expands to %s, %S) is unsafe use as file
$ #UnsafeFile2
226 Name %S (expands to %s) is unsafe use as file
! $ #AttachFilename1
! 227 Filename : %.*s
! $ #AttachFilename2
! 228 F)ilename : %.*s
$ #AttachDescription
229 D)escription : %.*S
$ #AttachContentType
--- 419,426 ----
225 Name %S (expands to %s, %S) is unsafe use as file
$ #UnsafeFile2
226 Name %S (expands to %s) is unsafe use as file
! $ #AttachFilenameS
! 227 Filename : %.*S
$ #AttachDescription
229 D)escription : %.*S
$ #AttachContentType
***************
*** 671,673 ****
--- 669,737 ----
354 %S canceled
$ #ConnectCanceled
355 Connect %s canceled.
+ $ #ParseAmbiguousMultipart
+ 356 Ambiguous multipart boundary prefix
+ $ #ExecuteMetamail
+ 357 Executing metamail...\n
+ $ #SaveToFile
+ 358 Save to File
+ $ #PrintAttach
+ 359 Print attachment
+ $ #ViewSubparts
+ 360 View MIME subparts
+ $ #UnknownUnsupportedKB
+ 361 UnknownUnsupportedKB
+ $ #UnsupportedDW
+ 362 Double wide characters are not supported
+ $ #LookingUpNotExists
+ 363 Looking up %s ... Not exists
+ $ #LookingUpFailed
+ 364 Looking up %s ... Failed
+ $ #SortingDirByName
+ 365 Sorting directory %S by Name
+ $ #SortingDirByRevName
+ 366 Sorting directory %S by Reverse Name
+ $ #SortingDirByMtime
+ 367 Sorting directory %S by Modify Time
+ $ #SortingDirByRevMtime
+ 368 Sorting directory %S by Reverse Modify Time
+ $ #MissingEqual
+ 369 PARSE ERROR: Missing = on %s header
+ $ #MissingName
+ 370 PARSE ERROR: Missing name of param on %s header
+ $ #TrailingBackslashHeader
+ 371 PARSE ERROR: Trailing \\ on %s header
+ $ #MissingQuote
+ 372 PARSE ERROR: Missing ending " on %s header
+ $ #EqualOnValue
+ 373 PARSE ERROR: Missing ; or = on param value on %s header
+ $ #SpaceOnValue
+ 374 PARSE ERROR: Missing ; or space on param value on %s header
+ $ #MissingValue
+ 375 PARSE ERROR: Missing value of param on %s header
+ $ #MissingSemicolonHeader
+ 376 PARSE ERROR: Missing ; on %s header
+ $ #AttachFilename0
+ 377 F)ilename : <none>
+ $ #AsciiRequiredTok
+ 378 Ascii required for token %S
+ $ #ParseErrorNameExpected
+ 379 Parse error on %S -- name expected
+ $ #ParseErrorEqualExpectedEOS
+ 380 Parse error on end of string -- = expected
+ $ #ParseErrorEqualExpected
+ 391 Parse error on %S -- = expected
+ $ #ParseErrorValueExpectedEOS
+ 392 Parse error on end of string -- value of param expected
+ $ #ParseErrorValueExpected
+ 393 Parse error on %S -- value of param expected
+ $ #ParseErrorSemicolonExpected
+ 394 Parse error on %S -- ; or end of string expected
+ $ #ParseErrorFailed
+ 395 Parse error on %S -- failed to parse parameters
+ $ #TrailingBackslashOnString
+ 396 Trailing Backslash (\\) on %S
+ $ #MissingEndQuote
+ 397 Missing ending quote (") on %S
+ $ #DecodeDescFilenameA1
+ 398 Filename: %.60s ]\n
Index: elm2.4.ME+.122-cvs/OBSOLETE
*** elm2.4.ME+.121/OBSOLETE 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.122-cvs/OBSOLETE 2005-07-02 10:43:34.000000000 +0300
***************
*** 35,37 ****
--- 35,47 ----
src/curses.c
hdrs/elm_curses.h
src/find_alias.c
+ lib/add_site.c
+ lib/strtokq.c
+ lib/mailer.c


+ doc/tmac.n
+ doc/Alias.guide
+ doc/Config.guid
+ doc/Elm.cover
+ doc/Form.guide
+ doc/Ref.guide
+ doc/Users.guide

Index: elm2.4.ME+.122-cvs/shared_libs/iconv/iconv.c
*** elm2.4.ME+.121/shared_libs/iconv/iconv.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/shared_libs/iconv/iconv.c 2005-07-08 09:42:56.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iconv.c,v 1.12 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: iconv.c,v 1.17 2005/07/08 06:42:56 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 490,497 ****

S_(cs_cmp_string cs_cmp_iconv)
static int cs_cmp_iconv(str1,str2)


! struct string *str1;
! struct string *str2;
{
int i;

--- 490,497 ----

S_(cs_cmp_string cs_cmp_iconv)
static int cs_cmp_iconv(str1,str2)


! CONST struct string *str1;
! CONST struct string *str2;
{
int i;

***************

*** 868,877 ****
}

S_(cs_add_streambytes_to_string cs_add_streambytes_to_iconv)
! static int cs_add_streambytes_to_iconv(str,count,data)


struct string *str;
int count;

const unsigned char *data;
{
#if 0
/* We not currently use state for checking encoding ... */
--- 868,878 ----
}

S_(cs_add_streambytes_to_string cs_add_streambytes_to_iconv)
! static int cs_add_streambytes_to_iconv(str,count,data,errors)


struct string *str;
int count;

const unsigned char *data;
+ int *errors;
{
#if 0
/* We not currently use state for checking encoding ... */
***************
*** 883,888 ****
--- 884,891 ----
panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_iconv",
"Negative length",0);



+ *errors = 0;
+

if (str->p->private_flag)
convert_to_raw(str);

***************
*** 999,1006 ****
if (str->p->private_flag) {
/* Add unicode value */

- if (ch->p->a.g1->unicode_value > 0xFFFF)
- return;

/* NOTE: str->p->a.words is not NUL terminated */
str->p->a.words = safe_realloc(str->p->a.words,
--- 1002,1007 ----
***************
*** 1378,1384 ****


static ZZZ_SAVE_TYPE save_info_data[] = {
! { "auto-charset", -1L, ZZZ_DT_BOL(&auto_charset), 0, NULL },
};

#if ANSI_C
--- 1379,1385 ----


static ZZZ_SAVE_TYPE save_info_data[] = {
! { "auto-charset", ZZZ_DT_BOL(&auto_charset), 0 },
};

#if ANSI_C
Index: elm2.4.ME+.122-cvs/shared_libs/iconv/Makefile.SH
*** elm2.4.ME+.121/shared_libs/iconv/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/shared_libs/iconv/Makefile.SH 2005-04-13 23:22:43.000000000 +0300


***************
*** 17,23 ****
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.9 2004/09/05 08:17:07 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.10 2005/04/13 20:22:43 hurtta Exp $


#
#
# Makefile for the ELM (ME+) mail program.
***************

*** 25,31 ****
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = $shlib/libelmme-iconv.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf
--- 25,31 ----
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-iconv.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf

***************
*** 36,42 ****
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister
!GROK!THIS!

A=
--- 36,42 ----
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister -M iconv
!GROK!THIS!

A=
Index: elm2.4.ME+.122-cvs/shared_libs/Makefile.SH
*** elm2.4.ME+.121/shared_libs/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elm2.4.ME+.122-cvs/shared_libs/Makefile.SH 2005-04-13 23:22:43.000000000 +0300
***************
*** 17,23 ****
echo "Extracting shared_libs/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.14 2004/01/24 11:06:02 hurtta Exp $


#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----

echo "Extracting shared_libs/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.15 2005/04/13 20:22:43 hurtta Exp $


#
#
# Makefile for the ELM (ME+) mail program.

Index: elm2.4.ME+.122-cvs/shared_libs/smtp/config
*** elm2.4.ME+.121/shared_libs/smtp/config 2002-01-26 13:15:59.000000000 +0200
--- elm2.4.ME+.122-cvs/shared_libs/smtp/config 2005-05-22 10:12:33.000000000 +0300
***************
*** 4,19 ****
smtp_ok=''

if $test "$d_netdb" = "$define" ; then
! if $test $d_dynamic_main = "$define" ; then
! smtp_ok="$define"
! else
! $cat <<EOM
! Unable to found how resolve mail program symbols from dynamic libary,
! therefore SMTP is not available...
!
! EOM
! smtp_ok="$undef"
! fi
else
$echo "No <netdb.h> therefore SMTP is not available..."
smtp_ok="$undef"
--- 4,10 ----
smtp_ok=''

if $test "$d_netdb" = "$define" ; then
! smtp_ok="$define"
else
$echo "No <netdb.h> therefore SMTP is not available..."
smtp_ok="$undef"
Index: elm2.4.ME+.122-cvs/shared_libs/smtp/elmsmtp.h
*** elm2.4.ME+.121/shared_libs/smtp/elmsmtp.h 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/shared_libs/smtp/elmsmtp.h 2005-05-21 20:58:32.000000000 +0300
***************
*** 1,13 ****
! /* $Id: elmsmtp.h,v 1.8 2004/03/27 18:31:43 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/

#include "elmshared.h"

#include "../../hdrs/mailer_imp.h"
#include "../../hdrs/mbx_imp.h"
#include "../../hdrs/ss_imp.h"
--- 1,14 ----
! /* $Id: elmsmtp.h,v 1.9 2005/05/21 17:58:32 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/

#include "elmshared.h"

+ #include "../../hdrs/mailerlib.h"
#include "../../hdrs/mailer_imp.h"
#include "../../hdrs/mbx_imp.h"
#include "../../hdrs/ss_imp.h"
Index: elm2.4.ME+.122-cvs/shared_libs/smtp/Makefile.SH
*** elm2.4.ME+.121/shared_libs/smtp/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/shared_libs/smtp/Makefile.SH 2005-05-22 10:12:33.000000000 +0300
***************
*** 13,23 ****


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac


echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.13 2004/09/05 08:17:07 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.

--- 13,40 ----


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;

esac

+ # libelmme-smtp.so my be loaded with program, which do not have
+ # linked with libelmme-mailer.so. On that case loading failed
+ # with unresolved symbols. Therefore we link libelmme-smtp.so
+ # with libelmme-mailer.so. If loading program is linked with
+ # libelmme-smtp.so, that do not cause that libelmme-mailer.so
+ # is linked twice on run time.
+ #
+ libxs="../../shlib/libelmme-mailer.so"
+
+ # If it is not possible to resolve mail program symbols from
+ # dynamic library, link libelmme-smtp.so with libelmme-base.so
+
+ if $test $d_dynamic_main = "$define" ; then
+ :
+ else
+ libxs="$libxs ../../shlib/libelmme-base.so"
+ fi



echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.17 2005/05/22 07:12:33 hurtta Exp $


#
#
# Makefile for the ELM (ME+) mail program.
***************

*** 25,31 ****
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = $shlib/libelmme-smtp.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf

--- 42,48 ----


# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-smtp.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf

***************
*** 36,42 ****
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister
!GROK!THIS!

A=
--- 53,60 ----
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! LIBXS = $libxs
! REG = ../../bin/elmregister -M smtp
!GROK!THIS!

A=
***************
*** 87,93 ****
clean:

elmsmtp.h: $(INCLDIR)/elmshared.h ../../hdrs/mailer_imp.h \
! ../../hdrs/mbx_imp.h ../../hdrs/ss_imp.h ../../hdrs/mime.h


$(CHMOD) u+w $@
$(TOUCH) $@

--- 105,112 ----
clean:

elmsmtp.h: $(INCLDIR)/elmshared.h ../../hdrs/mailer_imp.h \
! ../../hdrs/mbx_imp.h ../../hdrs/ss_imp.h ../../hdrs/mime.h \
! ../../hdrs/mailer_imp.h


$(CHMOD) u+w $@
$(TOUCH) $@

***************
*** 97,106 ****
$(AR) r $@ $?
$(RANLIB) $@

! ../../shlib/libelmme-smtp.so: $(OBJS)
! $(CC) $(CCFLAGS) $(SONAME) -o $@ $(OBJS)

$(INSTLIB): ../../shlib/libelmme-smtp.so


$(REG) copy -m 444 $? $@

!NO!SUBS!
--- 116,134 ----
$(AR) r $@ $?
$(RANLIB) $@

! ../../shlib/libelmme-smtp.so: $(OBJS) $(LIBXS)
! $(CC) $(CCFLAGS) $(SONAME) -o $@ $(OBJS) $(LIBXS)

$(INSTLIB): ../../shlib/libelmme-smtp.so


$(REG) copy -m 444 $? $@

!NO!SUBS!
+

+ for i in $libxs
+ do

+ y="`echo $i|$sed 's%^../../%%'`"


+ cat >>Makefile <<!SUBS!
+ $i:

+ cd ../..; \$(MAKE) \$(MJ) \$(MFLAGS) $y
+ !SUBS!
+ done
Index: elm2.4.ME+.122-cvs/shared_libs/smtp/smtp.c
*** elm2.4.ME+.121/shared_libs/smtp/smtp.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/shared_libs/smtp/smtp.c 2005-05-21 20:58:32.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: smtp.c,v 1.43 2004/05/23 12:31:00 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: smtp.c,v 1.45 2005/05/21 17:58:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 1335,1340 ****
--- 1335,1341 ----
struct mailer_info *I;
{


FILE * F;
+ char *tmp;

if (C->magic != MAILER_magic)

panic("MAILER PANIC",__FILE__,__LINE__,"smtp_common_mailer_init",
***************
*** 1345,1350 ****
--- 1346,1355 ----
return 0;


}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ return 0;
+
if (I->p.p1->SMTP_flags & SMTP_reserve) {
panic("MAILER PANIC",__FILE__,__LINE__,
"smtp_common_mailer_init",
***************
*** 1360,1366 ****
}


! C->fname = tempnam(temp_dir, "snd.");
if (!C->fname) {
DPRINT(Debug,1,(&Debug,

"couldn't make temp file nam! (mail)\n"));

--- 1365,1371 ----
}


! C->fname = tempnam(tmp, "snd.");
if (!C->fname) {
DPRINT(Debug,1,(&Debug,

"couldn't make temp file nam! (mail)\n"));

Index: elm2.4.ME+.122-cvs/shared_libs/tls/Makefile.SH
*** elm2.4.ME+.121/shared_libs/tls/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/shared_libs/tls/Makefile.SH 2005-04-13 23:22:43.000000000 +0300


***************
*** 17,23 ****
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.17 2004/09/05 08:17:07 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"
$cat >Makefile <<!GROK!THIS!
#!$make

! # $Id: Makefile.SH,v 1.18 2005/04/13 20:22:43 hurtta Exp $


#
#
# Makefile for the ELM (ME+) mail program.
***************

*** 25,31 ****
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = $shlib/libelmme-tls.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf
--- 25,31 ----
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-tls.so$d_shared_rev
AR = ar
CC = $cc
CCFLAGS = $ccflags $picflag $xencf

***************
*** 36,42 ****
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister
!GROK!THIS!

A=
--- 36,42 ----
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister -M tls
!GROK!THIS!

A=
Index: elm2.4.ME+.122-cvs/shared_libs/tls/tls.c
*** elm2.4.ME+.121/shared_libs/tls/tls.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/shared_libs/tls/tls.c 2005-07-05 20:53:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: tls.c,v 1.32 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: tls.c,v 1.34 2005/07/05 17:53:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 1586,1595 ****


static ZZZ_SAVE_TYPE save_info_data[] = {
! { "rand-egd", -1L, ZZZ_DT_STR(raw_rand_egd),
! sizeof raw_rand_egd, NULL },
! { "rand-file", -1L, ZZZ_DT_STR(raw_rand_file),
! sizeof raw_rand_file, NULL },

};

--- 1586,1593 ----


static ZZZ_SAVE_TYPE save_info_data[] = {
! { "rand-egd", ZZZ_DT_STR(raw_rand_egd), sizeof raw_rand_egd },
! { "rand-file", ZZZ_DT_STR(raw_rand_file), sizeof raw_rand_file },

};

Index: elm2.4.ME+.122-cvs/src/addr_util.c
*** elm2.4.ME+.121/src/addr_util.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/addr_util.c 2005-07-01 12:15:05.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.42 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.44 2005/07/01 09:15:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 18,23 ****
--- 18,24 ----

#include "def_elm.h"
#include "s_elm.h"

+ #include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"addr");

***************
*** 133,145 ****
} else {
for (i = 0;
addrs[i].addr && addrs[i].fullname && addrs[i].comment; i++) {
DPRINT(Debug,6,
(&Debug,
" [%d]: {addr=%s, fullname=%S, comment=%S}",
i,
addrs[i].addr, addrs[i].fullname,
addrs[i].comment));
!
}
}
DPRINT(Debug,6,
--- 134,161 ----
} else {
for (i = 0;
addrs[i].addr && addrs[i].fullname && addrs[i].comment; i++) {


+ CONST char *A, *B;
+

DPRINT(Debug,6,
(&Debug,
" [%d]: {addr=%s, fullname=%S, comment=%S}",
i,
addrs[i].addr, addrs[i].fullname,
addrs[i].comment));
!
! A = get_string_MIME_name(addrs[i].fullname);
! B = get_string_lang(addrs[i].fullname);
! DPRINT(Debug,11,
! (&Debug, " (fullname cs=%s lang=%s)",

! A ? A : "<none>",
! B ? B : "<none>"));
!

! A = get_string_MIME_name(addrs[i].comment);
! B = get_string_lang(addrs[i].comment);
! DPRINT(Debug,11,
! (&Debug, " (comment cs=%s lang=%s)",

! A ? A : "<none>",
! B ? B : "<none>"));
}
}

DPRINT(Debug,6,
***************
*** 207,213 ****
struct expanded_address result;
struct textual *ptr = expanded->surface;

! struct string_token * tokenized = string_tokenize(buffer);

zero_expanded_address(&result);

--- 223,229 ----
struct expanded_address result;
struct textual *ptr = expanded->surface;

! struct string_token * tokenized = string_tokenize(buffer, TOK_mail);

zero_expanded_address(&result);

***************
*** 436,441 ****
--- 452,532 ----
*expanded);
}

+
+ #ifdef I_NETDB
+ static int verify_mail_domain P_((char *domain));
+ static int verify_mail_domain(domain)
+ char *domain;
+ {
+ static char * last_verify_domain = NULL;
+ static int last_verify_result = -1;
+ time_t last_verify_time = 0;
+
+ int result = -1;
+
+ time_t now;
+
+ time(&now);
+
+ if (last_verify_time + 1000 > now &&
+ last_verify_domain &&
+ 0 == istrcmp(last_verify_domain,domain))
+ result = last_verify_result;
+
+ if (-1 == result) {
+ struct hostent *he = NULL;
+
+ lib_transient(CATGETS(elm_msg_cat, MeSet,
+ MeLookingUp,
+ "Looking up %s ..."),
+ domain);
+
+ he = gethostbyname(domain);
+
+ if (!he) {
+ DPRINT(Debug,9,(&Debug,
+ "verify_mail_domain: %s: h_errno=%d\n",
+ domain,h_errno));
+
+ switch(h_errno) {
+ case HOST_NOT_FOUND:
+ result = 0;
+ break;
+
+ case NO_ADDRESS:
+ result = 1;
+
+ }
+ } else
+ result = 1;
+
+
+ if (result >= 0) {
+ last_verify_domain = strmcpy(last_verify_domain,domain);
+ last_verify_result = result;
+ last_verify_time = now;
+
+ if (result)
+ lib_transient(CATGETS(elm_msg_cat, MeSet,MeLookingUpOK,
+ "Looking up %s ... OK"),
+ domain);
+ else
+ lib_transient(CATGETS(elm_msg_cat, MeSet,MeLookingUpNotExists,
+ "Looking up %s ... Not exists"),
+ domain);
+ } else
+ lib_transient(CATGETS(elm_msg_cat, MeSet,
+ MeLookingUpFailed,
+ "Looking up %s ... Failed"),
+ domain);
+
+ }
+
+ return result;


+ }
+
+ #endif
+

int build_address_l(expanded,mailer_info,aview)
struct expanded_address *expanded;
struct mailer_info *mailer_info;
***************
*** 457,462 ****
--- 548,554 ----
struct addr_item * aliases;

struct addr_item verify_result;
+ enum mailer_errcode errcode = MAILER_NOT_AVAIL;

if (!ptr->Textual) {

***************
*** 543,552 ****


int p;

! if (qstrpbrk(ptr1->addr,"!:@") == NULL &&
! mailer_info &&
! query_mailer_info(mailer_info,MI_USE_DOMAIN)) {
ptr1->addr = strmcat(ptr1->addr,"@");
ptr1->addr = strmcat(ptr1->addr, hostfullname);
}
--- 635,743 ----


int p;
+ char * sep = qstrpbrk(ptr1->addr,"!:@");

! if (sep) {
! DPRINT(Debug,9,
! (&Debug,
! "build_address_l: addr %s separator %c\n",
! ptr1->addr,
! *sep));
! }
!
! if (sep && '@' == *sep &&
! sep > ptr1->addr) {
!
! if (0 == istrcmp(sep+1,hostfullname) ||
! 0 == istrcmp(sep+1,hostname)) {
!
! if (verify_local_address) {
!
! if (mailer_info &&
! verify_mailer_domaddr(mailer_info,
! ptr1->addr,
! &verify_result,
! &errcode)) {
!
!
! DPRINT(Debug,5,
! (&Debug,
! "Address %s verified -- really %s\n",
! ptr1->addr,
! verify_result.addr));
!
!
!
!
! ptr1->addr = strmcpy(ptr1->addr,
! verify_result.addr);
!
! if (!ptr1->fullname) {
! ptr1->fullname = verify_result.fullname;
! verify_result.fullname = NULL;
! } else if (verify_result.fullname)
! free_string(&verify_result.fullname);
!
! if (!ptr1->comment) {
! ptr1->comment = verify_result.comment;
! verify_result.comment = NULL;
! } else if (verify_result.comment)
! free_string(&verify_result.comment);
! free(verify_result.addr);
! verify_result.addr = NULL;
!
! } else {
!
! switch (errcode) {
!
! case MAILER_NOT_AVAIL:
! lib_error(CATGETS(elm_msg_cat,
! ElmSet,
! ElmVerifyNot1,
! "Unable to verify mail address %s"),
! ptr1->addr);
! break;
!
! case MAILER_NOT_EXIST:
! lib_error(CATGETS(elm_msg_cat,
! ElmSet, ElmVerifyBad1,
! "Address %s is not e-mail address"),
! ptr1->addr);


! break;
! }
! }
!
!

!

! }
!
!
! } else

! #ifdef I_NETDB
! if (verify_domain) {
!
! int r;
!
! DPRINT(Debug,9,
! (&Debug,
! "build_address_l: verifying domain %s\n",
! sep+1));
!
! r = verify_mail_domain(sep+1);
!
! if (0 == r) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmDomainUnknown,
! "Domain %s of address %S is unknown"),
!
! sep+1,
! ptr->Textual);
! }
! }
! #endif
!
! } else if (sep == NULL &&
! mailer_info &&
! query_mailer_info(mailer_info,MI_USE_DOMAIN)) {
ptr1->addr = strmcat(ptr1->addr,"@");
ptr1->addr = strmcat(ptr1->addr, hostfullname);
}
***************
*** 661,667 ****

else if (mailer_info &&
verify_mailer_addr(mailer_info,us2s(utf8_textual),
! &verify_result)) {
int pos;

DPRINT(Debug,5,
--- 852,859 ----

else if (mailer_info &&
verify_mailer_addr(mailer_info,us2s(utf8_textual),
! &verify_result,
! &errcode)) {
int pos;

DPRINT(Debug,5,
***************
*** 707,712 ****
--- 899,920 ----
struct string * comment = NULL;
int pos;

+
+ if (verify_local_address) {
+ switch (errcode) {
+ case MAILER_NOT_AVAIL:
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmVerifyNot,
+ "Unable to verify mail address %S"),
+ ptr->Textual);
+ break;
+ case MAILER_NOT_EXIST:
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmVerifyBad,
+ "Address %S is not e-mail address or Elm's alias"),
+ ptr->Textual);


+ break;
+ }
+ }
+

/* Preserve possible comment
*
* Use dup_string() to avoid shared pointer so
Index: elm2.4.ME+.122-cvs/src/a_edit.c
*** elm2.4.ME+.121/src/a_edit.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/a_edit.c 2005-01-08 23:08:04.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_edit.c,v 1.11 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: a_edit.c,v 1.12 2005/01/08 21:08:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $
*


* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************

*** 18,27 ****

#include "def_elm.h"

! int edit_aliases_text(aview, header_page, page)


struct AliasView *aview;
- int *header_page;
struct menu_context *page;
{

/** Allow the user to edit their aliases text, always resynchronizing
afterwards. This routine calls the function edit_a_file()
--- 18,27 ----

#include "def_elm.h"

! int edit_aliases_text(aview, page, LOC)


struct AliasView *aview;
struct menu_context *page;

+ struct screen_parts *LOC;
{
/** Allow the user to edit their aliases text, always resynchronizing
afterwards. This routine calls the function edit_a_file()
***************
*** 39,45 ****
/*
* Redo the hash table...always!
*/
! install_aliases(aview, header_page);

/*
* clear any limit in effect.
--- 39,45 ----
/*
* Redo the hash table...always!
*/
! install_aliases(aview, LOC);

/*
* clear any limit in effect.
Index: elm2.4.ME+.122-cvs/src/alias.c
*** elm2.4.ME+.121/src/alias.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/src/alias.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.41 2004/07/26 12:41:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.57 2005/06/17 21:02:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.57 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 39,75 ****
static int get_aliasname P_((char *aliasname, char *buffer,int *duplicate,
int size,int buffer_size,


struct AliasView *aview,
! struct menu_context *page));

static int superceed_system P_((int this_alias, char *buffer,
int buffer_size,


struct AliasView *aview,
! struct menu_context *page));

/*

* A simple macro to make it easier to remember how to do a simple
* resync and not screw up whether or not to prompt on deletions.
*/

! #define resync_aliases(newaliases,aview, page) \
! delete_aliases(newaliases,TRUE, aview, page)
!
! extern char *alias_type();
! char *error_description(), *get_parens();

static int get_realnames P_((char *aliasname,
! char *firstname,
! char *lastname,
! char *comment,
! char *buffer,
! int size_first,
! int size_last,
! int size_comment,
! int size_buffer,
! int is_group,
! struct menu_context *page));
static int add_alias P_((int replace, int to_replace,

! struct AliasView *aview, int header_page,

! struct menu_context *page));
static int ask_accept P_((char *aliasname,
char *firstname,
char *lastname,
--- 39,76 ----
static int get_aliasname P_((char *aliasname, char *buffer,int *duplicate,
int size,int buffer_size,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

static int superceed_system P_((int this_alias, char *buffer,
int buffer_size,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

/*

* A simple macro to make it easier to remember how to do a simple
* resync and not screw up whether or not to prompt on deletions.
*/

! #define resync_aliases(newaliases,aview, page, prompt_area) \
! delete_aliases(newaliases,TRUE, aview, page, prompt_area)

static int get_realnames P_((char *aliasname,
! char *firstname,
! char *lastname,
! char *comment,
! char *buffer,
! int size_first,
! int size_last,
! int size_comment,
! int size_buffer,
! int is_group,


! struct menu_context *page,
! struct menu_context *prompt_area));

static int add_alias P_((int replace, int to_replace,
! struct AliasView *aview,
! struct menu_context *page,
! struct screen_parts *LOC));
static int ask_accept P_((char *aliasname,
char *firstname,
char *lastname,
***************
*** 80,88 ****
int replacement,
int size_buffer,
struct AliasView *avies,
! int headerPage,
! struct menu_context *page));
! static void alias_help P_((struct menu_context *page));




extern int is_system; /* system file updating? */

--- 81,90 ----
int replacement,
int size_buffer,
struct AliasView *avies,
! struct menu_context *page,
! struct screen_parts *LOC));
! static void alias_help P_((struct menu_context *page,
! struct menu_context *prompt_area));


extern int is_system; /* system file updating? */

***************
*** 106,116 ****
*a_group_name, *a_person_name, *a_system_flag;


! void open_alias_files(aview, alias_header_page)
struct AliasView *aview;
! int *alias_header_page;
{
- static int first_time = TRUE;
/*
* Close and re-open the system and user alias files, if present,
* and if they have changed since last we opened them.
--- 108,117 ----
*a_group_name, *a_person_name, *a_system_flag;


! void open_alias_files(aview, LOC)
struct AliasView *aview;
! struct screen_parts *LOC;
{
/*
* Close and re-open the system and user alias files, if present,
* and if they have changed since last we opened them.
***************
*** 120,171 ****

int A,B;

- if (first_time) {
- a_group_name = catgets(elm_msg_cat, AliasesSet, AliasesGroup,
- " Group");
- a_person_name = catgets(elm_msg_cat, AliasesSet, AliasesPerson,
- "Person");
- a_system_flag = catgets(elm_msg_cat, AliasesSet, AliasesSystemFlag,
- "(S)");
- a_rev_alias_pad = catgets(elm_msg_cat, AliasesSet, AliasesRevAliasPad,
- "Reverse Alias Name ");
- a_rev_alias_abr = catgets(elm_msg_cat, AliasesSet, AliasesRevAliasAbr,
- "Reverse-Alias");
- a_rev_alias_name = catgets(elm_msg_cat, AliasesSet, AliasesRevAliasName,
- "Reverse Alias Name");
- a_rev_full_pad = catgets(elm_msg_cat, AliasesSet, AliasesRevFullPad,
- "Reverse Full (Real) Name");
- a_full_abr = catgets(elm_msg_cat, AliasesSet, AliasesRevFullAbr,
- "Reverse-Name");
- a_rev_full_name = catgets(elm_msg_cat, AliasesSet, AliasesRevFullName,
- "Reverse Full (Real) Name");
- a_rev_text_pad = catgets(elm_msg_cat, AliasesSet, AliasesRevTextPad,
- "Reverse Text File ");
- a_text_abr = catgets(elm_msg_cat, AliasesSet, AliasesRevTextAbr,
- "Reverse-Text");
- a_rev_text_file = catgets(elm_msg_cat, AliasesSet, AliasesRevTextFile,
- "Reverse Text File");
- a_alias_pad = catgets(elm_msg_cat, AliasesSet, AliasesAliasPad,
- "Alias Name ");
- a_alias_abr = catgets(elm_msg_cat, AliasesSet, AliasesAliasAbr,
- "Alias");
- a_alias_name = catgets(elm_msg_cat, AliasesSet, AliasesAliasName,
- "Alias Name");
- a_full_pad = catgets(elm_msg_cat, AliasesSet, AliasesFullPad,
- "Full (Real) Name ");
- a_full_abr = catgets(elm_msg_cat, AliasesSet, AliasesFullAbr,
- "Name");
- a_full_name = catgets(elm_msg_cat, AliasesSet, AliasesFullName,
- "Full (Real) Name");
- a_text_pad = catgets(elm_msg_cat, AliasesSet, AliasesTextPad,
- "Text File ");
- a_text_abr = catgets(elm_msg_cat, AliasesSet, AliasesTextAbr,
- "Text");
- a_text_file = catgets(elm_msg_cat, AliasesSet, AliasesTextFile,
- "Text File");
- first_time = FALSE;
- }
-
if (update_aview(aview)) {
if (!mail_only && !check_only) {
int tac = get_total_alias_count(aview);
--- 121,126 ----
***************
*** 173,198 ****
set_alias_current(aview,0);

if (tac) {
! sort_aliases(tac, FALSE, alias_header_page ? 1 : 0,aview);
set_alias_current(aview,1);
}
- if (alias_header_page) {
- struct menu_common MENU;

! set_mcommon_from_aliasview(&MENU, aview);
! (void) get_page(get_alias_current(aview), &MENU,
! alias_header_page);
! }
}
}

}

! static int add_alias(replace, to_replace, aview, header_page, page)
int replace, to_replace;
struct AliasView *aview;


- int header_page;
struct menu_context *page;
{
/*

* Add an alias to the user alias text file. If there
--- 128,156 ----
set_alias_current(aview,0);

if (tac) {
! sort_aliases(tac, FALSE, LOC ? 1 : 0,aview);
set_alias_current(aview,1);
}

! if (LOC) {


! struct menu_common MENU;
!

! set_mcommon_from_aliasview(&MENU, aview);
! copy_current(&MENU,LOC->header_page);


!
! get_page(&MENU, LOC->header_page);

! }
!
}
}

}

! static int add_alias(replace, to_replace, aview, page, LOC)
int replace, to_replace;


struct AliasView *aview;
struct menu_context *page;

+ struct screen_parts *LOC;
{
/*
* Add an alias to the user alias text file. If there
***************
*** 223,228 ****
--- 181,188 ----
char bufferA[100]; /* TODO: Can remove? */
int ac;



+ int delay_redraw = 0;
+

/*
* See if there are any tagged aliases.
*/
***************
*** 239,282 ****

if (tagged == 1) {


char * buffer = NULL;

- int LINES, COLUMNS;

- menu_get_sizes(page,&LINES,&COLUMNS);
/*
* There is only on alias tagged. Ask the question
* but the default response is NO.
*/
! PutLineX(LINES-3,0, CATGETS(elm_msg_cat,
! AliasesSet, AliasesOneTagged,
! "There is 1 alias tagged..."));
! CleartoEOLN();
buffer = elm_message(CATGETS(elm_msg_cat,
AliasesSet, AliasesCreateGroup,
"Create group alias? (%c/%c) "),
*def_ans_yes, *def_ans_no);
! ch = want_to(buffer, *def_ans_no, LINES-4, 0, page);
free(buffer);
}
else if (tagged > 1) {


char * buffer = NULL;

- int LINES, COLUMNS;

- menu_get_sizes(page,&LINES,&COLUMNS);
/*
* If multiple tagged aliases then we assume the user
* wants to create a group alias. The default response
* is YES.
*/
! PutLineX(LINES-3,0, CATGETS(elm_msg_cat,
! AliasesSet, AliasesManyTagged,
! "There are %d aliases tagged..."),
tagged);
! CleartoEOLN();
buffer = elm_message(CATGETS(elm_msg_cat,
AliasesSet, AliasesCreateGroup,
"Create group alias? (%c/%c) "),
*def_ans_yes, *def_ans_no);
! ch = want_to(buffer, *def_ans_yes, LINES-4, 0, page);
free(buffer);
}

--- 199,240 ----

if (tagged == 1) {


char * buffer = NULL;

/*
* There is only on alias tagged. Ask the question
* but the default response is NO.
*/
! menu_PutLineX(LOC->prompt_page,1,0, CATGETS(elm_msg_cat,
! AliasesSet,
! AliasesOneTagged,
! "There is 1 alias tagged..."));
! menu_CleartoEOLN(LOC->prompt_page);
buffer = elm_message(CATGETS(elm_msg_cat,
AliasesSet, AliasesCreateGroup,
"Create group alias? (%c/%c) "),
*def_ans_yes, *def_ans_no);
! ch = want_to(buffer, *def_ans_no, 0, 0, LOC->prompt_page);
free(buffer);
}
else if (tagged > 1) {


char * buffer = NULL;

/*
* If multiple tagged aliases then we assume the user
* wants to create a group alias. The default response
* is YES.
*/
! menu_PutLineX(LOC->prompt_page,
! 1,0, CATGETS(elm_msg_cat,
! AliasesSet, AliasesManyTagged,
! "There are %d aliases tagged..."),
tagged);
! menu_CleartoEOLN(LOC->prompt_page);
buffer = elm_message(CATGETS(elm_msg_cat,
AliasesSet, AliasesCreateGroup,
"Create group alias? (%c/%c) "),
*def_ans_yes, *def_ans_no);
! ch = want_to(buffer, *def_ans_yes, 0, 0, LOC->prompt_page);
free(buffer);
}

***************
*** 315,326 ****
*/
if (replace) {
char buffer[100]; /* TODO: Fix this mess! */
- int LINES, COLUMNS;

struct alias_rec * a = give_alias(aview,to_replace);

- menu_get_sizes(page,&LINES,&COLUMNS);
-
aliasname[0] = '\0';
if (a) {
strfcpy(aliasname, a->alias, sizeof aliasname);
--- 273,281 ----
***************
*** 340,347 ****
* then just return.
*/
if( ! superceed_system(to_replace, buffer, sizeof buffer,
! aview, page)) {
! ClearLine(LINES-3);
return(0);
}
}
--- 295,302 ----
* then just return.
*/
if( ! superceed_system(to_replace, buffer, sizeof buffer,
! aview, page, LOC->prompt_page)) {
! menu_ClearLine(LOC->prompt_page,1);
return(0);
}
}
***************
*** 349,381 ****
}
else {
char buffer[100]; /* TODO: Fix this mess! */


- int LINES, COLUMNS;
-
- menu_get_sizes(page,&LINES,&COLUMNS);

strfcpy(buffer, catgets(elm_msg_cat,
AliasesSet, AliasesEnterAliasName,
"Enter alias name: "),
sizeof buffer);
! PutLine0(LINES-3,0, buffer);
! CleartoEOLN();
*aliasname = '\0';

replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page);
while (REDRAW_MARK == replace) {
! PutLine0(LINES-3,0, buffer);
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page);
}

if (replace < 0) {
DPRINT(Debug,3,
(&Debug,
"Aliasname [%s] was rejected in add_alias\n", aliasname));
! ClearLine(LINES-3);
return(0);
}
}
--- 304,345 ----
}
else {
char buffer[100]; /* TODO: Fix this mess! */

strfcpy(buffer, catgets(elm_msg_cat,
AliasesSet, AliasesEnterAliasName,
"Enter alias name: "),
sizeof buffer);
! menu_PutLine0(LOC->prompt_page,1,0, buffer);
! menu_CleartoEOLN(LOC->prompt_page);
*aliasname = '\0';

replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page,LOC->prompt_page);
while (REDRAW_MARK == replace) {


! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page);
! delay_redraw++;
!
! menu_PutLine0(LOC->prompt_page,1,0, buffer);
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page,LOC->prompt_page);
}

if (replace < 0) {
+

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

DPRINT(Debug,3,
(&Debug,
"Aliasname [%s] was rejected in add_alias\n", aliasname));
! menu_ClearLine(LOC->prompt_page,1);
return(0);
}
}
***************
*** 417,427 ****
* presented.
*/
if (tagged == 0) {
! char buffer[1000]; /* Fix this mess !!! */


! int LINES, COLUMNS;
!

!
! menu_get_sizes(page,&LINES,&COLUMNS);

elm_sfprintf(buffer, sizeof buffer,
CATGETS(elm_msg_cat,
--- 381,387 ----
* presented.
*/
if (tagged == 0) {
! char buffer[1000]; /* Fix this mess !!! */

elm_sfprintf(buffer, sizeof buffer,
CATGETS(elm_msg_cat,
***************
*** 430,438 ****
aliasname);


! PutLine0(LINES-3,0, buffer);

! CleartoEOLN();
if (replace) {

struct alias_rec * a = give_alias(aview,to_replace);
--- 390,398 ----
aliasname);


! menu_PutLine0(LOC->prompt_page,1,0, buffer);

! menu_CleartoEOLN(LOC->prompt_page);
if (replace) {

struct alias_rec * a = give_alias(aview,to_replace);
***************
*** 448,468 ****
}

do {
int status =
! optionally_enter(address1, LINES-3, strlen(buffer),
OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */, sizeof address1,


page);

while (REDRAW_MARK == status) {

elm_sfprintf(buffer, sizeof buffer,
CATGETS(elm_msg_cat,
AliasesSet, AliasesEnterAddress,
"Enter address for %s: "),
aliasname);
! PutLine0(LINES-3,0, buffer);
status =
! optionally_enter(address1, LINES-3, strlen(buffer),
OE_REDRAW_MARK|OE_APPEND_CURRENT|
OE_SIG_CHAR /* Ctrl-C */,
sizeof address1,
--- 408,438 ----
}

do {
+ /* FIXME --optionally_enter* should use prompt_page */
+ int line = menu_GetAbsLine(LOC->prompt_page,1);
int status =
! optionally_enter(address1, line, strlen(buffer),
OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */, sizeof address1,


page);

while (REDRAW_MARK == status) {

+ menu_ClearScreen(page); /* Reset possible redraw flag */

+ delay_redraw++; /* Can't trigger redraw yet... */


+
+ /* Call refresh routines of children */
+ menu_redraw_children(page);

+
+ menu_ClearScreen(LOC->prompt_page);
+
elm_sfprintf(buffer, sizeof buffer,
CATGETS(elm_msg_cat,
AliasesSet, AliasesEnterAddress,
"Enter address for %s: "),
aliasname);
! menu_PutLine0(LOC->prompt_page,1,0, buffer);
status =
! optionally_enter(address1, line, strlen(buffer),
OE_REDRAW_MARK|OE_APPEND_CURRENT|
OE_SIG_CHAR /* Ctrl-C */,
sizeof address1,
***************
*** 471,476 ****
--- 441,451 ----

if (0 != status ||
strlen(address1) == 0) {
+

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+
+

lib_error(CATGETS(elm_msg_cat, AliasesSet,
AliasesNoAddressSpec,
"No address specified!"));
***************
*** 486,498 ****

if (!get_realnames(aliasname, firstname, lastname, comment, bufferA,
sizeof firstname, sizeof lastname, sizeof comment,
! sizeof bufferA, is_group, page))
! return 0;


if(ask_accept(aliasname, firstname, lastname, comment, address1,
bufferA, replace, to_replace,
! sizeof bufferA, aview, header_page, page)) {
/*
* We can only clear the tags after we know that the
* alias was added. This allows the user to back out
--- 461,482 ----

if (!get_realnames(aliasname, firstname, lastname, comment, bufferA,
sizeof firstname, sizeof lastname, sizeof comment,
! sizeof bufferA, is_group, page,LOC->prompt_page)) {


!
! if (delay_redraw)
! menu_trigger_redraw(page);

+ return 0;
+ }

if(ask_accept(aliasname, firstname, lastname, comment, address1,
bufferA, replace, to_replace,
! sizeof bufferA, aview, page, LOC)) {


!
! if (delay_redraw)
! menu_trigger_redraw(page);
!
!

/*
* We can only clear the tags after we know that the
* alias was added. This allows the user to back out
***************
*** 506,537 ****

if (a &&
ison(a->status, TAGGED)) {
-
struct menu_common MENU;
!
! set_mcommon_from_aliasview(&MENU, aview);

clearit(a->status, TAGGED);
! show_msg_tag(i,&MENU, header_page);
}
}
}
return(1);
}
! else {
! return(0);
! }
}

static int add_current_alias P_((struct MailboxView *mailbox,
struct AliasView *aview,
! int header_page,
! struct menu_context *page));
! static int add_current_alias(mailbox,aview, header_page, page)


struct MailboxView *mailbox;
struct AliasView *aview;

- int header_page;
struct menu_context *page;
{
/*

* Alias the current message to the specified name and
--- 490,528 ----

if (a &&
ison(a->status, TAGGED)) {


struct menu_common MENU;
! int vis;

clearit(a->status, TAGGED);
!
! set_mcommon_from_aliasview(&MENU,aview);
!
! vis = compute_visible(i+1, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);
!
}
}
}
+
return(1);
}
!

!
! if (delay_redraw)
! menu_trigger_redraw(page);
!

! return(0);
}

static int add_current_alias P_((struct MailboxView *mailbox,
struct AliasView *aview,


! struct menu_context *page,
! struct screen_parts *LOC));

! static int add_current_alias(mailbox,aview, page, LOC)


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

+ struct screen_parts *LOC;
{
/*
* Alias the current message to the specified name and
***************
*** 552,562 ****
int i, match;
int replace, to_replace;

int current_mail_message = get_current(mailbox);



- int LINES, COLUMNS;
-
- menu_get_sizes(page,&LINES,&COLUMNS);

if (current_mail_message == 0) {
DPRINT(Debug,3,
--- 543,551 ----
int i, match;
int replace, to_replace;



+ int delay_redraw = 0;

int current_mail_message = get_current(mailbox);


if (current_mail_message == 0) {
DPRINT(Debug,3,
***************
*** 580,604 ****
strfcpy(buffer, catgets(elm_msg_cat, AliasesSet, AliasesCurrentMessage,
"Current message address aliased to: "),
sizeof buffer);
! PutLine0(LINES-3,0, buffer);
! CleartoEOLN();

*aliasname = '\0';
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page);
while (REDRAW_MARK == replace) {
! PutLine0(LINES-3,0, buffer);
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page);
}
if (replace < 0) {
DPRINT(Debug,3,
(&Debug,
"Aliasname [%s] was rejected in add_current_alias\n",
aliasname));
! ClearLine(LINES-3);
return(0);
}

--- 569,609 ----
strfcpy(buffer, catgets(elm_msg_cat, AliasesSet, AliasesCurrentMessage,
"Current message address aliased to: "),
sizeof buffer);
! menu_PutLine0(LOC->prompt_page,1,0, buffer);
! menu_CleartoEOLN(LOC->prompt_page);

*aliasname = '\0';
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page,LOC->prompt_page);
while (REDRAW_MARK == replace) {


! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/


!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */

! delay_redraw++;
!
! menu_PutLine0(LOC->prompt_page,1,0, buffer);
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page,LOC->prompt_page);
}
+

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

if (replace < 0) {
DPRINT(Debug,3,
(&Debug,
"Aliasname [%s] was rejected in add_current_alias\n",
aliasname));
! menu_ClearLine(LOC->prompt_page,1);
return(0);
}

***************
*** 707,713 ****

if (!get_realnames(aliasname, firstname, lastname, comment, buffer,
sizeof firstname, sizeof lastname, sizeof comment,
! sizeof buffer, 0, page))
return 0;

/* grab the return address of this message */
--- 712,718 ----

if (!get_realnames(aliasname, firstname, lastname, comment, buffer,
sizeof firstname, sizeof lastname, sizeof comment,
! sizeof buffer, 0, page,LOC->prompt_page))
return 0;

/* grab the return address of this message */
***************
*** 715,721 ****

return(ask_accept(aliasname, firstname, lastname, comment, address1,
buffer, replace, to_replace, sizeof buffer, aview,
! header_page, page));

}

--- 720,726 ----

return(ask_accept(aliasname, firstname, lastname, comment, address1,
buffer, replace, to_replace, sizeof buffer, aview,
! page, LOC));

}

***************
*** 967,993 ****
return(0);
}

void alias(mailbox, aview)


struct MailboxView *mailbox;
struct AliasView *aview;

{
!
/*
* Work with alias commands...
*/

! char name[NLEN], buffer[SLEN];
! int ch;
! static int newaliases = 0;
! int i;
! int nutitle = 0;
! int too_long;
!
! int redraw = 0; /** do we need to rewrite the entire screen? **/
! int nufoot = 0; /** clear lines 16 thru bottom and new menu **/
! int header_page = 0;
!
! struct menu_context *page = new_menu_context();

/*
* We're going to try to match the way elm does it at
--- 972,1085 ----
return(0);
}

+ static void set_alias_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_alias_screen(page,LOC, LIST)
+ struct menu_context *page;
+ struct screen_parts *LOC;


+ struct menu_param *LIST;
+ {

+ int LINES, COLUMNS;
+

+ menu_get_sizes(page,&LINES, &COLUMNS);
+
+ /* 1) Title part of screen */
+
+ if (! LOC->title_page)
+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */
+
+ if (LOC->menu_page)
+ menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
+ else if (mini_menu)
+ LOC->menu_page = new_menu_subpage(page,LINES-8,4,

+ sb_alias_menu,LIST);


+
+ mailbox_screen_common(page,LOC, LIST);
+ }
+

+ static void check_alias_screen P_((struct screen_parts *LOC,
+ struct menu_param *list));
+ static void check_alias_screen(LOC,list)


+ struct screen_parts *LOC;
+ struct menu_param *list;
+ {
+ /* 1) title page */
+ if (menu_resized(LOC->title_page)) {

+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }


+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));
+ sb_update_title(LOC->title_page,list);
+ }
+
+ if (LOC->menu_page) {
+ /* 2) menu page */
+ if (menu_resized(LOC->menu_page)) {

+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }


+ if (menu_need_redraw(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page redraw???\n"));

+ sb_show_menu(LOC->menu_page,list);
+ }
+ }
+

+ /* 3) prompt part */
+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {
+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to

+ * clear the footer except for a message.
+ */
+ }
+

+ /* 4) headers part */
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page resized\n"));
+ }
+ if (menu_need_redraw(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page redraw\n"));
+ menu_ClearScreen(LOC->header_page);

+ }
+ }
+
+
void alias(mailbox, aview)


struct MailboxView *mailbox;
struct AliasView *aview;

{
!
/*
* Work with alias commands...
*/
+
+ char name[NLEN], buffer[SLEN];
+ int ch;
+ static int newaliases = 0;
+ int i;
+ int too_long;
+
+ struct menu_context *page = new_menu_context();
+
+
+ struct screen_parts LOC = { NULL, NULL };


+ struct menu_common MENU;
+ struct menu_param PARAM[elm_mp_COUNT+1] = {
+ { mp_menu_common, 0 },
+ { mp_integer, 0 },
+ { mp_END,0 }
+ };

! static int first_time = TRUE;

/*
* We're going to try to match the way elm does it at
***************
*** 995,1053 ****
* main menu routines, but I will "borrow" from them. RLH
*/

- main_state(); /* Save globals for return to main menu */

! open_alias_files(aview, NULL); /* First, read the alias files. RLH */

! alias_screen(newaliases,aview, &header_page, page);
! /* define_softkeys(ALIAS); */

! while (1) {
! struct menu_common MENU;

! resize_mark:
! set_mcommon_from_aliasview(&MENU, aview);

! if (menu_resized(page)) {


! int LINES, COLUMNS;

! menu_get_sizes(page,&LINES, &COLUMNS);

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))
! if (mini_menu)
! headers_per_page = max (LINES - 14, 1);
! else
! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;
! }

! else
! redraw += menu_need_redraw(page);

! nucurr = 0;
! nufoot = 0;

! {
! int lin,col;



! prompt_s(mcommon_give_item(&MENU, m_Prompt));
! GetXYLocation(&lin,&col);
!

! CleartoEOLN();
! ch = menu_ReadCh(page,
! REDRAW_MARK|READCH_CURSOR|
! READCH_resize);
! MoveCursor(lin,col); CleartoEOS();


! }

! if (isascii(ch) && isprint(ch)) {
! DPRINT(Debug,4,

! (&Debug, "-- Alias command: %c [%d]\n",ch,ch));
! } else {
! DPRINT(Debug,4,
! (&Debug, "-- Alias command: [%d]\n",ch));


! }

switch (ch) {
case RESIZE_MARK:

--- 1087,1211 ----
* main menu routines, but I will "borrow" from them. RLH
*/


! if (first_time) {
! a_group_name = catgets(elm_msg_cat, AliasesSet, AliasesGroup,
! " Group");
! a_person_name = catgets(elm_msg_cat, AliasesSet, AliasesPerson,
! "Person");
! a_system_flag = catgets(elm_msg_cat, AliasesSet, AliasesSystemFlag,
! "(S)");
! a_rev_alias_pad = catgets(elm_msg_cat, AliasesSet, AliasesRevAliasPad,
! "Reverse Alias Name ");
! a_rev_alias_abr = catgets(elm_msg_cat, AliasesSet, AliasesRevAliasAbr,
! "Reverse-Alias");
! a_rev_alias_name = catgets(elm_msg_cat, AliasesSet, AliasesRevAliasName,
! "Reverse Alias Name");
! a_rev_full_pad = catgets(elm_msg_cat, AliasesSet, AliasesRevFullPad,
! "Reverse Full (Real) Name");
! a_full_abr = catgets(elm_msg_cat, AliasesSet, AliasesRevFullAbr,
! "Reverse-Name");
! a_rev_full_name = catgets(elm_msg_cat, AliasesSet, AliasesRevFullName,
! "Reverse Full (Real) Name");
! a_rev_text_pad = catgets(elm_msg_cat, AliasesSet, AliasesRevTextPad,
! "Reverse Text File ");
! a_text_abr = catgets(elm_msg_cat, AliasesSet, AliasesRevTextAbr,
! "Reverse-Text");
! a_rev_text_file = catgets(elm_msg_cat, AliasesSet, AliasesRevTextFile,
! "Reverse Text File");
! a_alias_pad = catgets(elm_msg_cat, AliasesSet, AliasesAliasPad,
! "Alias Name ");
! a_alias_abr = catgets(elm_msg_cat, AliasesSet, AliasesAliasAbr,
! "Alias");
! a_alias_name = catgets(elm_msg_cat, AliasesSet, AliasesAliasName,
! "Alias Name");
! a_full_pad = catgets(elm_msg_cat, AliasesSet, AliasesFullPad,
! "Full (Real) Name ");
! a_full_abr = catgets(elm_msg_cat, AliasesSet, AliasesFullAbr,
! "Name");
! a_full_name = catgets(elm_msg_cat, AliasesSet, AliasesFullName,
! "Full (Real) Name");
! a_text_pad = catgets(elm_msg_cat, AliasesSet, AliasesTextPad,
! "Text File ");
! a_text_abr = catgets(elm_msg_cat, AliasesSet, AliasesTextAbr,
! "Text");
! a_text_file = catgets(elm_msg_cat, AliasesSet, AliasesTextFile,
! "Text File");
! first_time = FALSE;
! }

! set_mcommon_from_aliasview(&MENU, aview);
! mp_list_set_mcommon(PARAM,elm_mp_menu,&MENU);

! mp_list_set_integer(PARAM,elm_mp_modified,newaliases);
! set_alias_screen(page,&LOC,PARAM);

! open_alias_files(aview, &LOC); /* First, read the alias files. RLH */

! copy_current(&MENU,LOC.header_page);
! alias_screen(aview, page);
! /* define_softkeys(ALIAS); */
!
! while (1) {
!
! resize_mark:
! menu_set_default(page);
!
! set_mcommon_from_aliasview(&MENU, aview);
!
! if (menu_resized(page)) {
! int LINES, COLUMNS;

! set_alias_screen(page,&LOC,PARAM);
!
! menu_get_sizes(page,&LINES, &COLUMNS);

! menu_trigger_redraw(page);

! }

! if (menu_need_redraw(page)) { /* Redraw screen if necessary */
! DPRINT(Debug,7, (&Debug,
! "alias: pending redraw\n"));
!
! mp_list_set_integer(PARAM,elm_mp_modified,newaliases);
! alias_screen(aview, page);
!
! }
! check_alias_screen(&LOC, PARAM);


!
! {
! int lin,col;
!
! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));
!
! menu_GetXYLocation(LOC.prompt_page,&lin,&col);
!
! menu_CleartoEOLN(LOC.prompt_page);

! show_last_error();
! menu_MoveCursor(LOC.prompt_page,lin,col);

! ch = menu_ReadCh(LOC.prompt_page,
! REDRAW_MARK|READCH_CURSOR|
! READCH_resize);
! menu_MoveCursor(LOC.prompt_page,lin,col);
! menu_CleartoEOS(LOC.prompt_page);
!

!
! if (isascii(ch) && isprint(ch)) {
! DPRINT(Debug,4,

! (&Debug, "-- Alias command: %c [%d]\n",ch,ch));
! } else {
! DPRINT(Debug,4,
! (&Debug, "-- Alias command: [%d]\n",ch));
! }
!
! set_error(""); /* clear error buffer */
!
! menu_MoveCursor(LOC.prompt_page,lin,col);


! }

switch (ch) {
case RESIZE_MARK:
***************

*** 1056,1095 ****

case HELP_MARK:
case '?':
! alias_help(page);

! redraw += menu_need_redraw(page);
break;

case REDRAW_MARK:
! case 'L'&31: redraw++; break;


case '$':
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet, AliasesResync,
! "Resynchronize aliases..."));
FlushBuffer();

/*
* Process deletions and then see if we need to
* re-run the "newalias" routine.
*/
! if (resync_aliases(newaliases,aview, page)) {
! install_aliases(aview,&header_page);
! newaliases = 0;
! redraw++;


! }
! break;

case 'a':

! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet,
AliasesAddCurrent,
"Add address from current message..."));
FlushBuffer();

clear_error();
! if (add_current_alias(mailbox,aview, header_page, page)) {
newaliases++;
! nutitle++;
}
break;

--- 1214,1262 ----

case HELP_MARK:
case '?':
! alias_help(page,LOC.prompt_page);
break;

case REDRAW_MARK:
! case 'L'&31:
! menu_trigger_redraw(page);
! break;


case '$':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesResync,
! "Resynchronize aliases..."));
FlushBuffer();

/*
* Process deletions and then see if we need to
* re-run the "newalias" routine.
*/
! if (resync_aliases(newaliases,aview, page, LOC.prompt_page)
! >=0) {
! install_aliases(aview,&LOC);
! newaliases = 0;
! menu_trigger_redraw(page);
!
! }
! break;

case 'a':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet,
AliasesAddCurrent,
"Add address from current message..."));
FlushBuffer();

clear_error();
! if (add_current_alias(mailbox,aview, page, &LOC)) {
newaliases++;
!
! mp_list_set_integer(PARAM,elm_mp_modified,newaliases);
! menu_trigger_redraw(LOC.title_page);
!
}
break;

***************
*** 1097,1112 ****
int alias_current = get_alias_current(aview);

if (alias_current > 0) {
! Write_to_screen(CATGETS(elm_msg_cat,
! AliasesSet, AliasesReplaceCurrent,
! "Replace current alias in database..."));
FlushBuffer();

clear_error();
! if (add_alias(TRUE, alias_current-1, aview, header_page,
! page)) {
newaliases++;
! nutitle++;
}
}
else {
--- 1264,1283 ----
int alias_current = get_alias_current(aview);

if (alias_current > 0) {
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesReplaceCurrent,
! "Replace current alias in database..."));
FlushBuffer();

clear_error();
! if (add_alias(TRUE, alias_current-1, aview,
! page, &LOC)) {
newaliases++;
!
! mp_list_set_integer(PARAM,elm_mp_modified,newaliases);
! menu_trigger_redraw(LOC.title_page);
!
}
}
else {
***************
*** 1118,1125 ****
break;

case 'e':
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet, AliasesEdit,
! "Edit %s..."), USER_ALIAS_TEXT);
FlushBuffer();

/*
--- 1289,1298 ----
break;

case 'e':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet, AliasesEdit,
! "Edit %s..."),
! USER_ALIAS_TEXT);
FlushBuffer();

/*
***************
*** 1127,1137 ****
* have to do this *before* checking current because
* all aliases could be marked for deletion.
*/
! (void) resync_aliases(newaliases,aview, page);
! if (edit_aliases_text(aview, &header_page, page)) {
newaliases = 0;
}
! redraw++;

break;

--- 1300,1312 ----
* have to do this *before* checking current because
* all aliases could be marked for deletion.
*/
! if (resync_aliases(newaliases,aview, page,
! LOC.prompt_page) < 0)
! break;
! if (edit_aliases_text(aview, page, &LOC)) {
newaliases = 0;
}
! menu_trigger_redraw(page);

break;

***************
*** 1139,1152 ****
int alias_current = get_alias_current(aview);

if (alias_current > 0) {
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet, AliasesMail,
! "Mail..."));
FlushBuffer();

a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,


! page);
! redraw += menu_need_redraw(page);

}

else {
--- 1314,1327 ----
int alias_current = get_alias_current(aview);

if (alias_current > 0) {
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet, AliasesMail,
! "Mail..."));
FlushBuffer();

a_sendmsg(TRUE,allow_forms,
! mailbox, aview,
! page, &LOC);

}
else {
***************
*** 1158,1172 ****
break;

case 'n':
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet, AliasesAddNew,
! "Add a new alias to database..."));
FlushBuffer();

clear_error();
! if (add_alias(FALSE, -1, aview, header_page,
! page)) {
newaliases++;
! nutitle++;
}
break;

--- 1333,1350 ----
break;

case 'n':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet, AliasesAddNew,
! "Add a new alias to database..."));
FlushBuffer();

clear_error();
! if (add_alias(FALSE, -1, aview, page, &LOC)) {
newaliases++;
!
! mp_list_set_integer(PARAM,elm_mp_modified,
! newaliases);
! menu_trigger_redraw(LOC.title_page);
}
break;

***************
*** 1177,1185 ****
case 'r':
case 'R': {
int r;
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddReturn,
! "Return to main menu..."));
FlushBuffer();

/*
--- 1355,1364 ----
case 'r':
case 'R': {
int r;
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddReturn,
! "Return to main menu..."));
FlushBuffer();

/*
***************
*** 1188,1204 ****
* on uppercase letters so that deletions are
* NOT queried.
*/
! r = delete_aliases(newaliases, islower(ch), aview, page);
if (-1 == r) { /* Ctrl-C */
break;
}

if (r > 0) {
! install_aliases(aview,&header_page);
newaliases = 0;
}
clear_error();
- main_state(); /* Done with aliases. */

goto OUT;
}
--- 1367,1383 ----
* on uppercase letters so that deletions are
* NOT queried.
*/
! r = delete_aliases(newaliases, islower(ch), aview, page,
! LOC.prompt_page);
if (-1 == r) { /* Ctrl-C */
break;
}

if (r > 0) {
! install_aliases(aview,&LOC);
newaliases = 0;
}
clear_error();

goto OUT;
}
***************
*** 1222,1250 ****
struct alias_rec *a = give_alias(aview,
alias_current-1);

! if (a) {


! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES,&COLUMNS);
!
if (a->type & GROUP) {
! PutLineX(LINES-2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesGroupAlias,
! "Group alias: %-60.60s"),
! a->address);
}
else {
! PutLineX(LINES-2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAliasedAddress,
! "Aliased address: %-60.60s"),
a->address);
}
-
}
! }
! else {
lib_error(CATGETS(elm_msg_cat,
AliasesSet, AliasesNoneToView,
"Warning: no aliases to view!"));
--- 1401,1425 ----
struct alias_rec *a = give_alias(aview,
alias_current-1);

! if (a) {
if (a->type & GROUP) {
! menu_PutLineX(LOC.prompt_page,2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet,
! AliasesGroupAlias,
! "Group alias: %-60.60s"),
! a->address);
}
else {
! menu_PutLineX(LOC.prompt_page,2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet,
! AliasesAliasedAddress,
! "Aliased address: %-60.60s"),
a->address);
}
}
! } else {
lib_error(CATGETS(elm_msg_cat,
AliasesSet, AliasesNoneToView,
"Warning: no aliases to view!"));
***************
*** 1254,1269 ****

case 'x':
case 'X':
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddReturn,
! "Return to main menu..."));
FlushBuffer();
!
! exit_alias(aview);
! clear_error();
! main_state(); /* Done with aliases. */
!
! goto OUT;

case 'f':
case 'F': {
--- 1429,1444 ----



case 'x':
case 'X':
! menu_Write_to_screen(LOC.prompt_page,

! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddReturn,
! "Return to main menu..."));
FlushBuffer();
!
! exit_alias(aview);
! clear_error();
!
! goto OUT;

case 'f':
case 'F': {
***************
*** 1277,1286 ****
strfcpy(name, a->alias, sizeof name);

if (ch == 'F') {
! int status;


! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES,&COLUMNS);



/* TODO: Fix this mess... */

strfcpy(buffer, catgets(elm_msg_cat,
--- 1452,1459 ----
strfcpy(name, a->alias, sizeof name);

if (ch == 'F') {
! int status, line;


! int delay_redraw = 0;

/* TODO: Fix this mess... */

strfcpy(buffer, catgets(elm_msg_cat,
***************
*** 1288,1319 ****
AliasesFullyExpanded,
"Fully expand alias: "),
sizeof buffer);
! PutLine0(LINES-3,0, buffer);
! CleartoEOS();

! status = optionally_enter(name, LINES-3,
strlen(buffer),


OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,

sizeof name,


page);
while (REDRAW_MARK == status) {

! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(name, LINES-3,
strlen(buffer),
OE_REDRAW_MARK|
OE_APPEND_CURRENT|
OE_SIG_CHAR /* Ctrl-C */,
sizeof name,
page);
! redraw++;
}
if (0 != status)
break;
}

{
struct addr_item * address;
too_long = FALSE;
address = get_alias_address_l(name, TRUE,
&too_long, NULL,
--- 1461,1502 ----
AliasesFullyExpanded,
"Fully expand alias: "),
sizeof buffer);
! menu_PutLine0(LOC.prompt_page,1,0, buffer);
! menu_CleartoEOS(LOC.prompt_page);



! /* FIXME --optionally_enter* should use prompt_page */

! line = menu_GetAbsLine(LOC.prompt_page,1);
! status = optionally_enter(name, line,
strlen(buffer),


OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,

sizeof name,
page);
+
while (REDRAW_MARK == status) {


! menu_ClearScreen(page); /* Reset possible redraw flag */

! delay_redraw++; /* Can't trigger redraw yet... */
!

! menu_PutLine0(LOC.prompt_page,1,0, buffer);
! status = optionally_enter(name, line,
strlen(buffer),
OE_REDRAW_MARK|
OE_APPEND_CURRENT|
OE_SIG_CHAR /* Ctrl-C */,
sizeof name,
page);
!

}
+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

if (0 != status)
break;
}

{
struct addr_item * address;
+
too_long = FALSE;
address = get_alias_address_l(name, TRUE,
&too_long, NULL,
***************
*** 1334,1377 ****

menu_ClearScreen(page2);

! PutLineX(2,0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAliasedFull,
! "Aliased address for:\t%s\n\r"),
! name);
i = 4;

while (i < LINES-3) {
if (walk->addr && walk->fullname) {
if (string_len(walk->fullname) ||
NULL != strchr(walk->addr,'@')) {
! PutLineX(i++, 4, FRM("%S <%s>"),
! walk->fullname,walk->addr);
} else
! PutLine0(i++, 4, walk->addr);
walk++;
} else
break;
}
! PutLineX(LINES-2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesPressReturn,
! "Press <return> to continue."));
if (REDRAW_MARK == menu_ReadCh(page2,
REDRAW_MARK)) {
! redraw++;
goto redraw2;
}
if (walk->addr == NULL) {
- redraw++;
break;
}
}
free_addr_items(address);

erase_menu_context(&page2);
! }
! else if (! too_long) {
lib_error(CATGETS(elm_msg_cat,
AliasesSet, AliasesNotFound,
"Not found."));
--- 1517,1563 ----

menu_ClearScreen(page2);

! menu_PutLineX(page2,2,0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAliasedFull,
! "Aliased address for:\t%s\n\r"),
! name);
i = 4;

while (i < LINES-3) {
if (walk->addr && walk->fullname) {
if (string_len(walk->fullname) ||
NULL != strchr(walk->addr,'@')) {
! menu_PutLineX(page2,
! i++, 4, FRM("%S <%s>"),
! walk->fullname,walk->addr);
} else
! menu_PutLine0(page2,
! i++, 4, walk->addr);
walk++;
} else
break;
}
! menu_PutLineX(page2,
! LINES-2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesPressReturn,
! "Press <return> to continue."));
if (REDRAW_MARK == menu_ReadCh(page2,
REDRAW_MARK)) {
! menu_ClearScreen(page2); /* Reset possible redraw flag */
goto redraw2;
}
if (walk->addr == NULL) {
break;
}
}
free_addr_items(address);

erase_menu_context(&page2);
! menu_trigger_redraw(page);
!
! } else if (! too_long) {
lib_error(CATGETS(elm_msg_cat,
AliasesSet, AliasesNotFound,
"Not found."));
***************
*** 1392,1402 ****
* it must be a "motion" command (or an error).
*/
default :
! ch = motion(ch,&MENU,&nufoot, &header_page,


! page);
!
! redraw += menu_need_redraw(page);

!
switch (ch) {
case 0: /* OK */

break;
--- 1578,1585 ----
* it must be a "motion" command (or an error).
*/
default :
! ch = motion(ch,&MENU,&LOC, page);


!
switch (ch) {
case 0: /* OK */

break;
***************
*** 1411,1463 ****
}
}

! if (redraw) { /* Redraw screen if necessary */
DPRINT(Debug,7, (&Debug,
"alias: pending redraw\n"));
- alias_screen(newaliases, aview, &header_page, page);
- nutitle = 0;
- }

! if (nutitle) { /* Redraw title if necessary */
! alias_title(newaliases, aview);
! nutitle = 0;


}

! check_range(&MENU);
!
! if (nucurr == NEW_PAGE)

! show_headers(&MENU,&header_page,page);


! else if (nucurr == SAME_PAGE)

! show_current(&MENU,&header_page, page);
! else if (nufoot) {

! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES,&COLUMNS);
!
! if (mini_menu) {


! MoveCursor(LINES-8, 0);
! CleartoEOS();

! show_alias_menu(page);


! }
! else {
! MoveCursor(LINES-5, 0);
! CleartoEOS();
! }
! show_last_error(); /* for those operations that have to

! * clear the footer except for a message.
! */
! }

! } /* BIG while loop... */

OUT:

! erase_menu_context(&page);
! return;
}

! void install_aliases(aview, header_page)
struct AliasView *aview;
! int *header_page;
{
/*
* Run the 'newalias' program and update the
--- 1594,1624 ----
}
}

! if (menu_need_redraw(page)) { /* Redraw screen if necessary */
DPRINT(Debug,7, (&Debug,
"alias: pending redraw\n"));

! mp_list_set_integer(PARAM,elm_mp_modified,newaliases);
! alias_screen(aview, page);
}

! check_range(&MENU, &LOC);
! check_alias_screen(&LOC, PARAM);
!
!
! } /* BIG while loop... */

OUT:

! free_mailbox_screen(&LOC);
!
! erase_menu_context(&page);
! return;
}

! void install_aliases(aview,LOC)
struct AliasView *aview;
! struct screen_parts *LOC;
{
/*
* Run the 'newalias' program and update the
***************
*** 1486,1499 ****
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesReReading,
"Processed %d aliases. Re-reading the database..."),
na);
! open_alias_files(aview, header_page);
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesUpdatedOK,
"Aliases updated successfully."));
}
}

! static void alias_help(page)
struct menu_context *page;
{
/*
* Help section for the alias menu...
--- 1647,1661 ----
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesReReading,
"Processed %d aliases. Re-reading the database..."),
na);
! open_alias_files(aview, LOC);
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesUpdatedOK,
"Aliases updated successfully."));
}
}

! static void alias_help(page,prompt_area)


struct menu_context *page;
+ struct menu_context *prompt_area;
{
/*

* Help section for the alias menu...
***************
*** 1502,1537 ****
*/

int ch;
! int redraw=0;
! char *alias_prompt;
!

! int LINES, COLUMNS;

! menu_get_sizes(page,&LINES,&COLUMNS);

!
!
! if (mini_menu)
! alias_prompt = catgets(elm_msg_cat, AliasesSet, AliasesShortKey,
! "Key: ");
! else
! alias_prompt = catgets(elm_msg_cat, AliasesSet, AliasesLongKey,
! "Key you want help for: ");
!
! MoveCursor(LINES-4, 0); CleartoEOS();

if (mini_menu) {
! print_format_center(LINES-4,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesKeyMenu,


! "Press the key you want help for, '?' for a key list, or '.' to exit help"));
}

- lower_prompt(alias_prompt);

! while ((ch = menu_ReadCh(page,0|READCH_CURSOR|READCH_sig_char)) != '.') {

if (ch == TERMCH_interrupt_char)
-
break;
switch(ch) {
case EOF :
--- 1664,1707 ----
*/

int ch;
! int delay_redraw=0;

! redraw:
! menu_ClearScreen(prompt_area);

if (mini_menu) {
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesKeyMenu,


! "Press the key you want help for, '?' for a key list, or '.' to exit help"));
}


! do {
! menu_PutLineX(prompt_area,
! 2, 0,
! CATGETS(elm_msg_cat, AliasesSet, AliasesLongKey,
! "Key you want help for: "));
!
! ch = menu_ReadCh(prompt_area,
! REDRAW_MARK|READCH_CURSOR|READCH_sig_char);
!

! if (ch == REDRAW_MARK) {

! menu_ClearScreen(page); /* Clear possible redraw mark */


!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! delay_redraw++;
!
! /* This clear redraw mark from prompt_area */
! goto redraw;

! }
!
! if (ch == '.')


! break;

if (ch == TERMCH_interrupt_char)

break;
switch(ch) {
case EOF :
***************
*** 1540,1546 ****
case HELP_MARK:
case '?' :
display_helpfile(ALIAS_HELP);
- redraw++;
menu_trigger_redraw(page);
return;

--- 1710,1715 ----
***************
*** 1648,1701 ****
"That key isn't used in this section."));
break;
}
- lower_prompt(alias_prompt);
- }
-
- /* Remove help lines */
- MoveCursor(LINES-4, 0); CleartoEOS();



! if (redraw)
! menu_trigger_redraw(page);

return;
}

- void main_state()
- {
- /* Save the globals that are shared for both menus
- * so that we can return to the main menu without
- * "tragedy".
- */
-
- static int alias_last = -1;
-
- static int main_last = -1;
-
-
- if (inalias) { /* Restore the settings */
- alias_last = last_current;
-
-
- last_current = main_last;
-
-
- DPRINT(Debug,2,
- (&Debug, "Leaving alias mode\n"));
- inalias = FALSE;
- }
- else {
- main_last = last_current;
-
-
- last_current = alias_last;
-
-
-
- DPRINT(Debug,2,
- (&Debug, "Entered alias mode\n"));
- inalias = TRUE;
- }
- }

static int parse_aliases(buffer, remainder, size_buffer, size_remainder)
char *buffer, *remainder;
--- 1817,1832 ----
"That key isn't used in this section."));
break;
}

! } while (ch != '.');



+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

+ menu_trigger_redraw(prompt_area);
return;
}


static int parse_aliases(buffer, remainder, size_buffer, size_remainder)
char *buffer, *remainder;
***************
*** 1751,1762 ****
}

static int get_aliasname(aliasname, buffer, duplicate, size, buffer_size,
! aview, page)
char *aliasname, *buffer;
int *duplicate;
int size, buffer_size;


struct AliasView *aview;
struct menu_context *page;
{

/*

--- 1882,1894 ----
}

static int get_aliasname(aliasname, buffer, duplicate, size, buffer_size,
! aview, page, prompt_area)
char *aliasname, *buffer;
int *duplicate;
int size, buffer_size;


struct AliasView *aview;
struct menu_context *page;
+ struct menu_context *prompt_area;
{

/*

***************
*** 1781,1804 ****
*/

int loc;


- int LINES, COLUMNS;
-
- menu_get_sizes(page,&LINES,&COLUMNS);


do {
! int status =
! optionally_enter(aliasname, LINES-3, strlen(buffer),
OE_REDRAW_MARK|OE_SIG_CHAR, size, page);

if (REDRAW_MARK == status)
! return REDRAW_MARK;

/*
* Return if nothing was entered.
*/
if (0 != status || strlen(aliasname) == 0)
! return(-1);

} while (check_alias(aliasname) == -1);

--- 1913,1935 ----
*/

int loc;


do {


! /* FIXME --optionally_enter* should use prompt_page */

! int line = menu_GetAbsLine(prompt_area,1);
! int status =
! optionally_enter(aliasname, line, strlen(buffer),
OE_REDRAW_MARK|OE_SIG_CHAR, size, page);

if (REDRAW_MARK == status)
! return REDRAW_MARK;

/*
* Return if nothing was entered.
*/
if (0 != status || strlen(aliasname) == 0)
! return(-1);

} while (check_alias(aliasname) == -1);

***************
*** 1811,1850 ****
struct alias_rec *a = give_alias(aview,loc);

if (a) {
DPRINT(Debug,2,
(&Debug,
"Attempt to add a duplicate alias [%s] in get_aliasname\n",
a->alias));

if (a->type & GROUP )
! PutLineX(LINES-3,0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAlreadyGroup,
! "Already a group with name %s."),
! a->alias);
else
! PutLineX(LINES-3,0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAlreadyAlias,
! "Already an alias for %s."),
! a->alias);
! CleartoEOLN();
! elm_sfprintf(buffer, buffer_size,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesReplaceExisting,
! "Replace existing alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
/*
* If they don't want to replace the alias by that name
* then just return.
*/
! if (want_to(buffer, *def_ans_no, LINES-4, 0,
! page) != *def_ans_yes)
return(-1);
*duplicate = loc;
return(1);
}
}
/*
* If they have elected to replace an existing alias then
* we assume that they would also elect to superceed a
--- 1942,2012 ----
struct alias_rec *a = give_alias(aview,loc);

if (a) {
+ int answer;
+ int redraw = 0;
+
DPRINT(Debug,2,
(&Debug,
"Attempt to add a duplicate alias [%s] in get_aliasname\n",
a->alias));

+ againD:
+
if (a->type & GROUP )
! menu_PutLineX(prompt_area,1,0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAlreadyGroup,
! "Already a group with name %s."),
! a->alias);
else
! menu_PutLineX(prompt_area,1,0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAlreadyAlias,
! "Already an alias for %s."),
! a->alias);
! menu_CleartoEOLN(prompt_area);
!
!
/*
* If they don't want to replace the alias by that name
* then just return.
*/
!
! answer = prompt_letter(1,"",*def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark|


! PROMPT_ctrlL|PROMPT_cancel,
! prompt_area,
! CATGETS(elm_msg_cat,

! AliasesSet, AliasesReplaceExisting,
! "Replace existing alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!

! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {

! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area);
!

! redraw++; /* Can't trigger redraw yet... */
! goto againD;


! }
! if (redraw)
! menu_trigger_redraw(page);

!
! if (TERMCH_interrupt_char == answer)
! return -1;


!
! if (answer != *def_ans_yes)

return(-1);
+
*duplicate = loc;
return(1);
}
}
+
/*
* If they have elected to replace an existing alias then
* we assume that they would also elect to superceed a
***************
*** 1866,1872 ****
a->address));

if( ! superceed_system(loc, buffer, buffer_size,
! aview, page))
return(-1);
}
}
--- 2028,2034 ----
a->address));

if( ! superceed_system(loc, buffer, buffer_size,
! aview, page,prompt_area))
return(-1);
}
}
***************
*** 1874,1899 ****

}

! static int superceed_system(this_alias, buffer, buffer_size, aview,page)
int this_alias;
char *buffer;
int buffer_size;


struct AliasView *aview;
struct menu_context *page;
{

struct alias_rec *a = give_alias(aview,this_alias);


- int LINES, COLUMNS;
-
- menu_get_sizes(page,&LINES,&COLUMNS);

if (!a)
return 0;



! PutLineX(LINES-3, 0,
! CATGETS(elm_msg_cat,

! AliasesSet, AliasesSystemAlias,
! "System (%6s) alias for %s."),
! alias_type(a->type), a->alias);

elm_sfprintf(buffer, buffer_size,
CATGETS(elm_msg_cat, AliasesSet, AliasesSuperceed,
--- 2036,2059 ----

}

! static int superceed_system(this_alias, buffer, buffer_size, aview,page,prompt_area)
int this_alias;
char *buffer;
int buffer_size;


struct AliasView *aview;
struct menu_context *page;
+ struct menu_context *prompt_area;
{

struct alias_rec *a = give_alias(aview,this_alias);

if (!a)
return 0;



! menu_PutLineX(prompt_area,1, 0,
! CATGETS(elm_msg_cat,

! AliasesSet, AliasesSystemAlias,
! "System (%6s) alias for %s."),
! alias_type(a->type), a->alias);

elm_sfprintf(buffer, buffer_size,
CATGETS(elm_msg_cat, AliasesSet, AliasesSuperceed,
***************
*** 1902,2070 ****
* If they don't want to superceed the SYSTEM alias then
* return a FALSE.
*/
! return(want_to(buffer, *def_ans_no, LINES-4, 0,
! page) == *def_ans_yes);

}

static int get_realnames(aliasname, firstname, lastname, comment, buffer,
size_first, size_last, size_comment, size_buffer,
! is_group, page)
char *aliasname, *firstname, *lastname, *comment, *buffer;
int size_first, size_last, size_comment, size_buffer;
int is_group;
struct menu_context *page;
{
int status;
!

! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES,&COLUMNS);
!

if (is_group) {
lastname[0] = '\0';
firstname[0] = '\0';
} else {
elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterLastName,
"Enter last name for %s: "), aliasname);
! PutLine0(LINES-3,0, buffer);
! CleartoEOLN();
! status = optionally_enter(lastname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_last, page);
! while (REDRAW_MARK == status) {
! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(lastname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
! size_last, page);
! }

! if (status != 0) /* Error or Ctrl-C */
return 0;

! elm_sfprintf(buffer, size_buffer,
! CATGETS(elm_msg_cat, AliasesSet, AliasesEnterFirstName,
! "Enter first name for %s: "), aliasname);
! PutLine0(LINES-3,0, buffer);
! CleartoEOLN();
! status = optionally_enter(firstname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_first, page);
! while (REDRAW_MARK == status) {
! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(firstname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
! size_first, page);
}

! if (0 != status) /* Ctrl-C or error */
return 0;

if (strlen(lastname) == 0) {
strfcpy(lastname, firstname, size_last);
*firstname = '\0';
}
! }

! elm_sfprintf(buffer, size_buffer,
! CATGETS(elm_msg_cat, AliasesSet, AliasesEnterComment,
! "Enter optional comment for %s: "), aliasname);
! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(comment, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_comment, page);
! while (status == REDRAW_MARK) {
! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(comment, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
! size_comment, page);
! }

! if (0 != status) /* Ctrl-C or error */
! return 0;

! return 1;
}

static int ask_accept(aliasname, firstname, lastname, comment, address, buffer,
! replace, replacement, size_buffer, aview, header_page,
! page)
char *aliasname, *firstname, *lastname, *comment, *address, *buffer;
int replace, replacement;
int size_buffer;
struct AliasView *aview;
- int header_page;
struct menu_context *page;
{
! char ch;
! char *(old_alias[1]);

! int LINES, COLUMNS;

- menu_get_sizes(page,&LINES,&COLUMNS);

/*
* If firstname == lastname, they probably just took all
* the deafaults. We *assume* they don't want lastname
* entered twice, so we will truncate it.
*/
- if (strcmp(firstname, lastname) == 0) {
- *firstname = '\0';
- }

! if (strlen(lastname) == 0) {
! PutLineX(LINES-2,0, CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddressAs1,
! "Messages addressed as: %s"),
! address);
! strfcpy(buffer, aliasname, size_buffer);
! } else {
! if (strlen(firstname) == 0) {
! strfcpy(buffer, lastname, size_buffer);
! }
! else {
! elm_sfprintf(buffer, size_buffer,
! FRM("%s %s"), firstname, lastname);
! }
! PutLineX(LINES-2,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddressAs,
! "Messages addressed as: %s <%s>"),
! buffer,address);
}
! if (strlen(comment) != 0) {
! strfcat(buffer, ", ", size_buffer);
! strfcat(buffer, comment, size_buffer);
}
!
! PutLineX(LINES-3,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddressTo,
! "New alias: %s is '%s'."),
! aliasname, buffer);
! CleartoEOLN();
/*
* Kludge Alert: Spaces are padded to the front of the prompt
* to write over the previous question. Should probably record
* the end of the line, move to it, and CleartoEOLN() it.
*/
- elm_sfprintf(buffer, size_buffer,
- CATGETS(elm_msg_cat, AliasesSet, AliasesAcceptNew,
- " Accept new alias? (%c/%c) "),
- *def_ans_yes, *def_ans_no);
- if((ch = want_to(buffer, *def_ans_yes, LINES-4, 0,
- page)) == *def_ans_yes) {
- if (replace) {
- struct alias_rec *a = give_alias(aview,replacement);

! if (a) {
! old_alias[0] = a->alias;

/*
* First, clear flag if this is marked to be deleted.
* This prevents the problem where they marked it for
--- 2062,2313 ----
* If they don't want to superceed the SYSTEM alias then
* return a FALSE.
*/
! return(want_to(buffer, *def_ans_no, 0, 0,
! prompt_area) == *def_ans_yes);

}

static int get_realnames(aliasname, firstname, lastname, comment, buffer,
size_first, size_last, size_comment, size_buffer,
! is_group, page, prompt_area)
char *aliasname, *firstname, *lastname, *comment, *buffer;
int size_first, size_last, size_comment, size_buffer;
int is_group;


struct menu_context *page;
+ struct menu_context *prompt_area;
{

int status;


! int delay_redraw = 0;

if (is_group) {
lastname[0] = '\0';
firstname[0] = '\0';
} else {
+ int line;
+
elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterLastName,
"Enter last name for %s: "), aliasname);
! menu_PutLine0(prompt_area,1,0, buffer);
! menu_CleartoEOLN(prompt_area);
!

! /* FIXME --optionally_enter* should use prompt_page */

! line = menu_GetAbsLine(prompt_area,1);
!
! status = optionally_enter(lastname, line, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_last, page);
! while (REDRAW_MARK == status) {


! menu_ClearScreen(page); /* Reset possible redraw flag */

! delay_redraw++; /* Can't trigger redraw yet... */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area);
!

! /* FIXME --optionally_enter* should use prompt_page */

! line = menu_GetAbsLine(prompt_area,1);
! menu_PutLine0(prompt_area,1,0, buffer);
! status = optionally_enter(lastname, line, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
! size_last, page);
! }
!

! if (status != 0) { /* Error or Ctrl-C */


! if (delay_redraw)
! menu_trigger_redraw(page);

return 0;
+ }

! {
! int line;
!
! elm_sfprintf(buffer, size_buffer,
! CATGETS(elm_msg_cat, AliasesSet, AliasesEnterFirstName,
! "Enter first name for %s: "), aliasname);
! menu_PutLine0(prompt_area,1,0, buffer);
! menu_CleartoEOLN(prompt_area);
!

! /* FIXME --optionally_enter* should use prompt_page */

! line = menu_GetAbsLine(prompt_area,1);
!
! status = optionally_enter(firstname, line, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_first, page);
! while (REDRAW_MARK == status) {


! menu_ClearScreen(page); /* Reset possible redraw flag */

! delay_redraw++; /* Can't trigger redraw yet... */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area);
!

! /* FIXME --optionally_enter* should use prompt_page */

! line = menu_GetAbsLine(prompt_area,1);
! menu_PutLine0(prompt_area,1,0, buffer);
! status = optionally_enter(firstname, line, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
! size_first, page);
! }
}

! if (0 != status) { /* Ctrl-C or error */


! if (delay_redraw)
! menu_trigger_redraw(page);

return 0;
+ }

if (strlen(lastname) == 0) {
strfcpy(lastname, firstname, size_last);
*firstname = '\0';
}
! }

! {
! int line;
!
! elm_sfprintf(buffer, size_buffer,
! CATGETS(elm_msg_cat, AliasesSet, AliasesEnterComment,
! "Enter optional comment for %s: "), aliasname);
! menu_PutLine0(prompt_area,1,0, buffer);
!

! /* FIXME --optionally_enter* should use prompt_page */

! line = menu_GetAbsLine(prompt_area,1);
!
! status = optionally_enter(comment, line, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_comment, page);
! while (status == REDRAW_MARK) {


! menu_ClearScreen(page); /* Reset possible redraw flag */

! delay_redraw++; /* Can't trigger redraw yet... */

!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area);

! menu_PutLine0(prompt_area,1,0, buffer);
! status = optionally_enter(comment, line, strlen(buffer),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,
! size_comment, page);
! }
! }
!
! if (delay_redraw)
! menu_trigger_redraw(page);
!
! if (0 != status) /* Ctrl-C or error */
! return 0;
!
! return 1;
}

static int ask_accept(aliasname, firstname, lastname, comment, address, buffer,
! replace, replacement, size_buffer, aview,
! page,LOC)
char *aliasname, *firstname, *lastname, *comment, *address, *buffer;
int replace, replacement;
int size_buffer;


struct AliasView *aview;
struct menu_context *page;

+ struct screen_parts *LOC;
{


! int delay_redraw = 0;

! int answer = 0;

! char *(old_alias[1]);


+ again:
/*
* If firstname == lastname, they probably just took all
* the deafaults. We *assume* they don't want lastname
* entered twice, so we will truncate it.
*/

! if (strcmp(firstname, lastname) == 0) {
! *firstname = '\0';
! }
!
! if (strlen(lastname) == 0) {
! menu_PutLineX(LOC->prompt_page,
! 2,0, CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddressAs1,
! "Messages addressed as: %s"),
! address);
! strfcpy(buffer, aliasname, size_buffer);
! } else {
! if (strlen(firstname) == 0) {
! strfcpy(buffer, lastname, size_buffer);
}
! else {
! elm_sfprintf(buffer, size_buffer,
! FRM("%s %s"), firstname, lastname);
}
! menu_PutLineX(LOC->prompt_page,
! 2,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddressAs,
! "Messages addressed as: %s <%s>"),
! buffer,address);
! }
! if (strlen(comment) != 0) {
! strfcat(buffer, ", ", size_buffer);
! strfcat(buffer, comment, size_buffer);
! }
!
! menu_PutLineX(LOC->prompt_page,1,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddressTo,
! "New alias: %s is '%s'."),
! aliasname, buffer);
! menu_CleartoEOLN(LOC->prompt_page);
/*
* Kludge Alert: Spaces are padded to the front of the prompt
* to write over the previous question. Should probably record
* the end of the line, move to it, and CleartoEOLN() it.
*/

! answer = prompt_letter(1,"",*def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel,
! LOC->prompt_page,
! CATGETS(elm_msg_cat, AliasesSet, AliasesAcceptNew,
! " Accept new alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {

! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);

+ menu_ClearScreen(LOC->prompt_page);
+
+ delay_redraw++; /* Can't trigger redraw yet... */
+ goto again;
+ }


+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

+ if (TERMCH_interrupt_char == answer)
+ goto clean;
+

+
+ if(answer == *def_ans_yes) {
+ if (replace) {
+ struct alias_rec *a = give_alias(aview,replacement);
+
+ if (a) {
+ old_alias[0] = a->alias;
+
/*
* First, clear flag if this is marked to be deleted.
* This prevents the problem where they marked it for
***************
*** 2074,2097 ****
* the new alias we just so carefully added to the
* text file.
*/
! if (ison(a->status, DELETED)) {
! clearit(a->status, DELETED);
! }
/*
* Changed aliases are given the NEW flag.
*/
! setit(a->status, NEW);
! {
struct menu_common MENU;

! set_mcommon_from_aliasview(&MENU, aview);

! show_msg_status(replacement,&MENU, header_page);
! }
/*
* Now we can delete it...
*/
! delete_from_alias_text(old_alias, 1);

/*
* Kludge Alert: We need to get the trailing comma
--- 2317,2344 ----
* the new alias we just so carefully added to the
* text file.
*/
! if (ison(a->status, DELETED)) {
! clearit(a->status, DELETED);
! }
/*
* Changed aliases are given the NEW flag.
*/
! setit(a->status, NEW);


!
! {
struct menu_common MENU;

+ int vis;

! set_mcommon_from_aliasview(&MENU,aview);
!
! vis = compute_visible(replacement+1, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);

! }
/*
* Now we can delete it...
*/
! delete_from_alias_text(old_alias, 1);

/*
* Kludge Alert: We need to get the trailing comma
***************
*** 2099,2112 ****
* alias since the display won't be re-sync'd right
* away.
*/
! *((old_alias[0])+strlen(old_alias[0])-1) = '\0';
! }
}
- add_to_alias_text(aliasname, firstname, lastname, comment, address);
}
! ClearLine(LINES-3);
! ClearLine(LINES-2);
! return(ch == *def_ans_yes ? 1 : 0);

}

--- 2346,2362 ----
* alias since the display won't be re-sync'd right
* away.
*/
! *((old_alias[0])+strlen(old_alias[0])-1) = '\0';
}
}
! add_to_alias_text(aliasname, firstname, lastname, comment, address);
! }
!
! clean:
! menu_ClearLine(LOC->prompt_page,1);
! menu_ClearLine(LOC->prompt_page,2);
!
! return(answer == *def_ans_yes ? 1 : 0);

}

Index: elm2.4.ME+.122-cvs/src/aliases/astorage_hash.c
*** elm2.4.ME+.121/src/aliases/astorage_hash.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/aliases/astorage_hash.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: astorage_hash.c,v 1.4 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: astorage_hash.c,v 1.5 2005/06/17 21:02:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
***************
*** 155,161 ****
*/

register struct alias_rec *a;
! extern struct alias_rec *fetch_alias();

if ((a = fetch_alias(db, (char *)NULL)) == NULL)
return 0;
--- 155,161 ----
*/

register struct alias_rec *a;
!

if ((a = fetch_alias(db, (char *)NULL)) == NULL)
return 0;
Index: elm2.4.ME+.122-cvs/src/aliaslib.c
*** elm2.4.ME+.121/src/aliaslib.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/aliaslib.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: aliaslib.c,v 1.27 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: aliaslib.c,v 1.30 2005/06/17 21:02:55 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,27 ****

DEBUG_VAR(Debug,__FILE__,"alias");

- char *qstrpbrk();
extern int current_mail_message;

struct expand {
--- 21,26 ----
***************


*** 87,93 ****
{
char ** tokenized = rfc822_tokenize(group);
char **ptr, **next = NULL;
!
remove_space_tokenized(tokenized); /* removes spaces and comments */

for (ptr = tokenized; *ptr; ptr = next) {

--- 86,93 ----


{
char ** tokenized = rfc822_tokenize(group);
char **ptr, **next = NULL;
! int result = 0;
!
remove_space_tokenized(tokenized); /* removes spaces and comments */

for (ptr = tokenized; *ptr; ptr = next) {
***************

*** 107,125 ****

if (ptr+1 == next) {
struct addr_item verify_result;

/* see if this name is really an alias */
if (do_get_alias_l(name,buffer,TRUE,sysalias,depth,too_longp,


mailer_info, aview))
continue;

! if ( *too_longp )
! return FALSE;
!
/* verify it is a valid address */
if (mailer_info &&
verify_mailer_addr(mailer_info,name,

! &verify_result)) {

DPRINT(Debug,7,
(&Debug,
--- 107,128 ----

if (ptr+1 == next) {
struct addr_item verify_result;
+ enum mailer_errcode errcode = MAILER_NOT_AVAIL;

/* see if this name is really an alias */
if (do_get_alias_l(name,buffer,TRUE,sysalias,depth,too_longp,


mailer_info, aview))
continue;

! if ( *too_longp ) {
! result = 0;

! goto fail;
! }
!

/* verify it is a valid address */
if (mailer_info &&
verify_mailer_addr(mailer_info,name,

! &verify_result,&errcode)) {

DPRINT(Debug,7,
(&Debug,

***************
*** 199,208 ****
next++;
}

if (tokenized)
! free(tokenized);

! return TRUE;
}


--- 202,214 ----
next++;
}

+ result = 1;
+ fail:
+
if (tokenized)
! free_rfc822tokenized(tokenized);

! return result;
}


Index: elm2.4.ME+.122-cvs/src/a_quit.c
*** elm2.4.ME+.121/src/a_quit.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/a_quit.c 2005-01-18 19:38:58.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_quit.c,v 1.18 2004/07/21 10:04:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: a_quit.c,v 1.19 2005/01/18 17:38:58 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,36 ****


extern int errno; /* system error number on failure */
#endif

! int delete_aliases(newaliases, prompt, aview, page)
int newaliases, prompt;


struct AliasView *aview;
struct menu_context * page;
{
/*

* Update aliases by processing deletions. Prompting is


--- 27,37 ----
extern int errno; /* system error number on failure */
#endif

! int delete_aliases(newaliases, prompt, aview, page, prompt_area)
int newaliases, prompt;


struct AliasView *aview;
struct menu_context * page;

+ struct menu_context * prompt_area;
{
/*
* Update aliases by processing deletions. Prompting is
***************
*** 58,66 ****
int to_delete = 0, to_keep = 0, i, marked_deleted = 0, ask_questions;
int answer;
int ac = get_alias_count(aview);
- int LINES, COLUMNS;

- menu_get_sizes(page,&LINES,&COLUMNS);

DPRINT(Debug,1,
(&Debug, "\n\n-- leaving aliases --\n\n"));
--- 59,65 ----
***************
*** 97,113 ****
int def = answer;

if (marked_deleted == 1)
! answer = prompt_letter(LINES-4,"",def,
PROMPT_yesno|PROMPT_cancel,
! page,
CATGETS(elm_msg_cat, AliasesSet, AliasesDelete,
"Delete 1 alias? (%c/%c) "),
*def_ans_yes, *def_ans_no);
else
! answer = prompt_letter(LINES-4,"",def,
PROMPT_yesno|PROMPT_cancel,
! page,
!
CATGETS(elm_msg_cat, AliasesSet,
AliasesDeletePlural,
"Delete %d aliases? (%c/%c) "),
--- 96,111 ----
int def = answer;

if (marked_deleted == 1)
! answer = prompt_letter(0,"",def,
PROMPT_yesno|PROMPT_cancel,
! prompt_area,
CATGETS(elm_msg_cat, AliasesSet, AliasesDelete,
"Delete 1 alias? (%c/%c) "),
*def_ans_yes, *def_ans_no);
else
! answer = prompt_letter(0,"",def,
PROMPT_yesno|PROMPT_cancel,
! prompt_area,
CATGETS(elm_msg_cat, AliasesSet,
AliasesDeletePlural,
"Delete %d aliases? (%c/%c) "),
Index: elm2.4.ME+.122-cvs/src/args.c
*** elm2.4.ME+.121/src/args.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/args.c 2005-07-01 19:05:29.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: args.c,v 1.63 2004/07/10 08:08:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.63 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.69 2005/07/01 16:05:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 75,84 ****
char * wanted_mailbox_title = NULL;

/* Retuns array of files requested */
! char ** parse_arguments(argc, argv, to_whom)
int argc;
char *argv[];
char ***to_whom;
{
/** Set flags according to what was given to program. If we are
fed a name or series of names, put them into the 'to_whom' buffer
--- 75,85 ----
char * wanted_mailbox_title = NULL;

/* Retuns array of files requested */
! char ** parse_arguments(argc, argv, to_whom, chk_mode)
int argc;
char *argv[];
char ***to_whom;
+ enum check_mode * chk_mode;
{
/** Set flags according to what was given to program. If we are
fed a name or series of names, put them into the 'to_whom' buffer
***************
*** 87,101 ****
Return req_mfile, which points to a named mail file or is empty.
**/

! int c = 0;
! int v = 0;
! char ** req_vector = NULL;
! int req_len = 0;
! *to_whom = NULL;
! batch_subject[0] = '\0';
! included_file[0] = '\0';

! while ((c = getopt(argc, argv, "?aA:cd:D:f:hi:kKms:tVvwX:z-:")) != EOF) {
switch (c) {
case 'a' : arrow_cursor++; break;
case 'A' :
--- 88,103 ----
Return req_mfile, which points to a named mail file or is empty.
**/

! int c = 0;
! int v = 0;
! char ** req_vector = NULL;
! int req_len = 0;
!
! *to_whom = NULL;
! batch_subject[0] = '\0';
! included_file[0] = '\0';

! while ((c = getopt(argc, argv, "?aA:cd:D:f:hi:kKms:tVvwX:yz-:")) != EOF) {
switch (c) {
case 'a' : arrow_cursor++; break;
case 'A' :
***************
*** 150,156 ****
exit(1);
#endif
break;
! case 'z' : check_size++; use_tite = 0; break;
case '-':

if (0 == strncmp(optarg, "title-name=",11))
--- 152,176 ----
exit(1);
#endif
break;
! case 'y' :
! if (*chk_mode != chk_none) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsBadYoption,
! "Option -y incompatible with given other options."));
! exit(1);
! }
! *chk_mode = chk_unread;
!
! break;
!
! case 'z' :
! if (*chk_mode != chk_none) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsBadZoption,
! "Option -z incompatible with given other options."));
! exit(1);
! }
! *chk_mode = chk_size;
!
! break;
case '-':

if (0 == strncmp(optarg, "title-name=",11))
***************
*** 186,193 ****
if (optind < argc) {
*to_whom = argv + optind;
if(!check_only)
! mail_only++;
! check_size = 0; /* NEVER do this if we're mailing!! */
}

if (strlen(batch_subject) > 0 && ! mail_only) {
--- 206,213 ----
if (optind < argc) {
*to_whom = argv + optind;
if(!check_only)
! mail_only++;
! *chk_mode = chk_none; /* NEVER do this if we're mailing!! */
}

if (strlen(batch_subject) > 0 && ! mail_only) {
***************
*** 258,263 ****
--- 278,284 ----
\t -V \t\tEnable sendmail voyeur mode.\n\r\
\t -v \t\tPrint out ELM version information.\n\r\
\t -w \t\tWrite .elm/elmrc and .elm/mime.charsets\n\r\
+ \t -y \t\tdon't enter ELM if no unread mail is pending\n\r\
\t -z \t\tZero - don't enter ELM if no mail is pending\n\r\
\n\n"));
/*
***************
*** 275,281 ****
--- 296,307 ----

/** print out version information **/

+
printf("\nElm Version and Identification Information:\n\n");
+
+ if (i == 1)
+ printf("\tElm Millenium Edition \n\n");
+
printf("\tElm %s PL%s, of %s\n",VERSION,PATCHLEVEL,VERS_DATE);

#ifdef BINARY_PACKAGE


***************
*** 297,303 ****
printf("\n\tBased on Elm 2.4 PL24 - PL25\n\n");

if (i < 3) {
! printf("\t(C) Copyright 1996-2004 Kari Hurtta\n");
printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");

printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}
--- 323,329 ----


printf("\n\tBased on Elm 2.4 PL24 - PL25\n\n");

if (i < 3) {
! printf("\t(C) Copyright 1996-2005 Kari Hurtta\n");
printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");

printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
}
***************
*** 415,420 ****
--- 441,459 ----
#else
printf("\tSystem does not support nl_langinfo(CODESET) query: not HAVE_CODESET\n");
#endif
+ #ifdef WCHAR
+ printf("\tSystem have native wide character support: WCHAR\n");
+ #ifdef __STDC_ISO_10646__
+ printf("\t wchar_t is Unicode (the Universal Character Set): __STDC_ISO_10646__\n");
+ #endif
+ #ifdef WCWIDTH
+ printf("\t wcwidth() function is available: WCWIDTH\n");
+ #else
+ printf("\t Character width function is not available: not WCWIDTH\n");
+ #endif
+ #else
+ printf("\tSystem do not support wide characters: not WCHAR\n");
+ #endif

#ifdef MSGCAT
printf("\tUses system's msgcat() implementation: MSGCAT\n");
Index: elm2.4.ME+.122-cvs/src/a_screen.c
*** elm2.4.ME+.121/src/a_screen.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/a_screen.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_screen.c,v 1.15 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: a_screen.c,v 1.19 2005/06/17 21:02:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 19,26 ****
#include "def_elm.h"
#include "s_aliases.h"

- char *alias_type();
-
char *show_alias_status(entry)
struct alias_rec *entry;
{
--- 19,24 ----
***************
*** 64,180 ****
}


! void alias_screen(modified, aview, header_page, page)
! int modified;


struct AliasView *aview;
- int *header_page;
struct menu_context *page;
{

struct menu_common MENU;

set_mcommon_from_aliasview(&MENU,aview);
!
/* Stolen from showscreen() */

menu_ClearScreen(page);

! alias_title(modified,aview);
!

! last_header_page = -1; /* force a redraw regardless */
! show_headers(&MENU, header_page, page);

!
! if (mini_menu)
! show_alias_menu(page);
!
show_last_error();

/* define_softkeys(ALIAS); */
}

! void alias_title(modified,aview)
! int modified;
! struct AliasView *aview;
!
! {
! /** display a new title line, due to re-sync'ing the aliases **/
!
! struct string * buffer = NULL;
! struct string * modmsg = NULL;
! int ac = get_alias_count(aview);
! int alias_selected = get_alias_selected(aview);
!

! if (modified) {
! modmsg = format_string(CATGETS(elm_msg_cat, AliasesSet,
! AliasesModified,
! "(modified, resync needed) "));
! }
! else {
! modmsg = new_string(system_charset);
}

! if (alias_selected)
! buffer = format_string(CATGETS(elm_msg_cat, AliasesSet, AliasesSelect,
! "Alias mode: %d shown out of %d %S[ELM %s]"),
! alias_selected, ac, modmsg,
! version_buff);
! else if (ac == 1)
! buffer = format_string(CATGETS(elm_msg_cat, AliasesSet, AliasesSingle,
! "Alias mode: 1 alias %S[ELM %s]"),
! modmsg, version_buff);
! else
! buffer = format_string(CATGETS(elm_msg_cat, AliasesSet, AliasesPlural,
! "Alias mode: %d aliases %S[ELM %s]"),
! ac, modmsg, version_buff);
!
! ClearLine(1);
!
! print_center(1, buffer);
!
! free_string(&modmsg);
! free_string(&buffer);
! }
!
! void show_alias_menu(page)
! struct menu_context *page;
! {


! int LINES, COLUMNS;
! menu_get_sizes(page,&LINES,&COLUMNS);

!
! /** write alias menu... **/
! /* Moved from alias.c */
!
! if (user_level == RANK_AMATEUR) { /* Give less options */
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn1,


! "You can use any of the following commands by pressing the first character;"));

! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn2,
! "a)lias current message, n)ew alias, d)elete or u)ndelete an alias,"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn3,
! "m)ail to alias, or r)eturn to main menu. To view an alias, press <return>."));
! print_format_center(LINES-5,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn4,
! "j = move down, k = move up, ? = help"));
! }
! else {
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn1,
! "Alias commands: ?=help, <n>=set current to n, /=search pattern"));
! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn2,
! "a)lias current message, c)hange, d)elete, e)dit aliases.text, f)ully expand,"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn3,
! "l)imit display, m)ail, n)ew alias, r)eturn, t)ag, u)ndelete, or e(x)it"));
! }
}

struct string *build_alias_line(entry, message_number, highlight, page)
--- 62,135 ----
}


! void alias_screen(aview, page)

struct AliasView *aview;
struct menu_context *page;
{

struct menu_common MENU;

set_mcommon_from_aliasview(&MENU,aview);
!
/* Stolen from showscreen() */



menu_ClearScreen(page);

! /* Call refresh routines of children */
! menu_redraw_children(page);

!
show_last_error();

/* define_softkeys(ALIAS); */
}

! #if ANSI_C
! subpage_simple_redraw sb_alias_menu;
! #endif
! int sb_alias_menu(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;

! {


! struct menu_common *mptr = mp_lookup_mcommon(list,elm_mp_menu);
! int ul = give_dt_enumerate_as_int(&user_level);
!

! menu_ClearScreen(ptr);
!
! /** write alias menu... **/
! /* Moved from alias.c */
!
! if (ul == RANK_AMATEUR) { /* Give less options */
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn1,


! "You can use any of the following commands by pressing the first character;"));

! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn2,
! "a)lias current message, n)ew alias, d)elete or u)ndelete an alias,"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn3,
! "m)ail to alias, or r)eturn to main menu. To view an alias, press <return>."));
! menu_print_format_center(ptr,3,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn4,
! "j = move down, k = move up, ? = help"));
! } else {
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn1,
! "Alias commands: ?=help, <n>=set current to n, /=search pattern"));
! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn2,
! "a)lias current message, c)hange, d)elete, e)dit aliases.text, f)ully expand,"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn3,
! "l)imit display, m)ail, n)ew alias, r)eturn, t)ag, u)ndelete, or e(x)it"));
}

! return 1;
}

struct string *build_alias_line(entry, message_number, highlight, page)
***************
*** 219,225 ****
entry->address);

/* complete line with name, type and alias. */
! ret = format_string(FRM("%S%-*.*S %s %-18.18s"),
buffer,
/* give max and min width parameters for 'name' */
name_width, name_width, mybuffer,
--- 174,180 ----
entry->address);

/* complete line with name, type and alias. */
! ret = format_string(FRM("%S%-*.*S %s %-20.20s"),
buffer,
/* give max and min width parameters for 'name' */
name_width, name_width, mybuffer,
Index: elm2.4.ME+.122-cvs/src/a_sort.c
*** elm2.4.ME+.121/src/a_sort.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/a_sort.c 2005-06-18 00:02:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_sort.c,v 1.15 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: a_sort.c,v 1.17 2005/06/17 21:02:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 22,29 ****

DEBUG_VAR(Debug,__FILE__,"alias");

- char *alias_sort_name();
-
static void alias_old_current P_((long iindex,
struct AliasView *aview));

--- 22,27 ----
***************
*** 108,114 ****
return ret;
}

! switch (abs(alias_sortby)) {
case ALIAS_SORT:
ret = strcmp(first->alias, second->alias);
break;
--- 106,112 ----
return ret;
}

! switch (abs(give_dt_sort_as_int(&alias_sortby))) {
case ALIAS_SORT:
ret = strcmp(first->alias, second->alias);
break;
***************
*** 139,145 ****
break;
}

! if (alias_sortby < 0)


ret = -ret;

return ret;

--- 137,143 ----
break;
}

! if (give_dt_sort_as_int(&alias_sortby) < 0)


ret = -ret;

return ret;
***************

*** 156,163 ****


pad = (type == PAD);
abr = (type == SHORT);

! if (alias_sortby < 0) {
! switch (- alias_sortby) {


case ALIAS_SORT : return(
pad? "Reverse Alias Name " :
abr? "Reverse-Alias" :

--- 154,161 ----

Kari E. Hurtta

unread,
Jul 13, 2005, 5:45:10 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.6

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 6/18
=========================================================================
+ }
+ }
+
+ if (ret && !result->addr) {
+
+ DPRINT(Debug,7,(&Debug,
+ " ... filling resulting address\n",
+ text));
+
+
+ result->addr = safe_strdup(text);
+
+
+ if (I->mailer_type->mi_query_hook(I->mailer_type,I,
+ MI_USE_DOMAIN)) {
+ result->addr = strmcat(result->addr,"@");
+ result->addr = strmcat(result->addr,hostfullname);
+ DPRINT(Debug,7,(&Debug,
+ " ... %s => %s\n",
+ text,result->addr));
+ }
+ }
+

+ return ret;
+ }
+

+ /* Should return 1 if verify succees and fields of result to be filled
+ -- caller should free fields of result
+ Returns 0 on failure
+ */

+ int verify_mailer_domaddr(I,text,result, errcode)


+ struct mailer_info *I;
+ CONST char *text;
+ struct addr_item *result;
+ enum mailer_errcode * errcode;

+ {
+ int ret = 0;
+

+ if (I->magic != MAILER_INFO_magic)

+ panic("MAILER PANIC",__FILE__,__LINE__,"verify_mailer_domaddr",
+ "Bad magic number (mailer info)",0);
+

+ /* bzero is defined on hdrs/defs.h */
+ bzero((void *)result, sizeof (*result));
+ result -> addr = NULL;
+ result -> fullname = NULL;
+ result -> comment = NULL;
+
+ *errcode = MAILER_NOT_AVAIL;
+
+ if (!valid_mailer(I->mailer_type))

+ panic("MAILER PANIC",__FILE__,__LINE__,"verify_mailer_domaddr",
+ "Bad mailer type",
+ 0);
+

+ /* Returns
+ -1 if caller should result with default data (return 1)
+ -2 if caller should just test passwd
+ 0 if failure
+ 1 is succees
+ */
+ ret = I->mailer_type->mi_verify_addr(I->mailer_type,I,text,result);
+
+ DPRINT(Debug,7,(&Debug,"Address %s verify result %d%s\n",
+ text,ret,
+ ret < 0 ? " (use default processing)" : ""));
+ if (result->addr) {
+ DPRINT(Debug,7,(&Debug,
+ " ... resulting address %s\n",
+ result->addr));

+ }
+

+ if (0 == ret)
+ *errcode = MAILER_NOT_EXIST;
+ if (ret > 0)
+ *errcode = MAILER_OK;
+

+
+ if (-1 == ret)
+ ret = 1;
+ if (-2 == ret)
+ ret = 0;
+
+ if (ret && !result->addr) {
+
+ DPRINT(Debug,7,(&Debug,
+ " ... filling resulting address\n",
+ text));
+
+
+ result->addr = safe_strdup(text);


+ }
+
+ return ret;
+ }
+
+

+ char * kludge_addr(char **addr) {
+ char * ptr = *addr;
+ int l = strlen(ptr);
+ char *res;
+
+ ptr = safe_realloc(ptr,l + 1 + 2 + l + 1);
+
+ res = ptr + l + 1;
+
+ res[0] = '<';
+ strfcpy(res+1,ptr,l+1);
+ res[l+1] = '>';
+ res[l+2] = '\0';
+
+ *addr = ptr;


+ return res;
+ }
+

+ char **argv_from_headers (headers)
+ struct mailing_headers * headers;


+ {
+ int count =

+ headers->to.addrs_len +
+ headers->cc.addrs_len + headers->bcc.addrs_len;
+ char **res;
+ int idx = 0,i;
+ struct addr_item *p;
+
+ DPRINT(Debug,6,
+ (&Debug, "argv_from_headers, count=%d\n",count));
+
+ res = safe_malloc((count + 1) * sizeof (char *));
+
+ dump_expanded_address(6,"argv_from_headers -- enter (to)",headers->to);
+
+ for (p = headers->to.addrs;
+ p < headers->to.addrs + headers->to.addrs_len;
+ p++) {
+ if (p->addr[0] == '-' || p->addr[0] == '@' ||
+ p->addr[0] == '\0')
+ /* Modify p->addr so that there is space
+ * alloced also for <addr> form
+ */
+ res[idx++] = kludge_addr(&p->addr);
+ else
+ res[idx++] = p->addr;
+ }
+
+ dump_expanded_address(6,"argv_from_headers -- enter (cc)",headers->cc);
+
+ for (p = headers->cc.addrs;
+ p < headers->cc.addrs + headers->cc.addrs_len;
+ p++) {
+ if (p->addr[0] == '-' || p->addr[0] == '@' ||
+ p->addr[0] == '\0')
+ /* Modify p->addrs so that there is space
+ * alloced also for <addr> form
+ */
+ res[idx++] = kludge_addr(&p->addr);
+ else
+ res[idx++] = p->addr;
+ }
+
+ dump_expanded_address(6,"argv_from_headers -- enter (bcc)",headers->bcc);
+
+ for (p = headers->bcc.addrs;
+ p < headers->bcc.addrs + headers->bcc.addrs_len;
+ p++) {
+ if (p->addr[0] == '-' || p->addr[0] == '@' ||
+ p->addr[0] == '\0')
+ /* Modify p->addrs so that there is space
+ * alloced also for <addr> form
+ */
+ res[idx++] = kludge_addr(&p->addr);
+ else
+ res[idx++] = p->addr;
+ }
+
+ res[idx] = NULL;
+
+ DPRINT(Debug,6,
+ (&Debug, " idx=%d\n",idx));
+ for (i = 0; i < idx; i++)
+ DPRINT(Debug,6,
+ (&Debug, " [%d]=%s\n",i,res[i]));
+
+ dump_expanded_address(7,"argv_from_headers -- leave (to)",headers->to);
+ dump_expanded_address(7,"argv_from_headers -- leave (cc)",headers->cc);
+ dump_expanded_address(7,"argv_from_headers -- leave (bcc)",headers->bcc);
+
+ return res;


+ }
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/lib/mailer/Makefile.SH


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/lib/mailer/Makefile.SH 2005-05-21 20:58:32.000000000 +0300
***************
*** 0 ****
--- 1,149 ----
+ case $CONFIG in
+ '')
+ if test ! -f config.sh; then
+ ln ../config.sh . || \
+ ln ../../config.sh . || \
+ ln ../../../config.sh . || \
+ (echo "Can't find config.sh."; exit 1)
+ fi
+ . ./config.sh
+ ;;
+ esac
+ case "$0" in
+ */*) cd `expr X$0 : 'X\(.*\)/'` ;;
+ esac
+
+ case "$d_dlopen_libs" in
+ define) sharedsrc="shared_mailer.c"
+ sharedobj="shared_mailer.o"
+ ;;
+ *) sharedsrc=
+ sharedobj=


+ ;;
+ esac
+
+

+
+ echo "Extracting lib/mailer/Makefile (with variable substitutions)"
+ #!$make
+ # $Id: Makefile.SH,v 1.2 2005/05/21 17:58:32 hurtta Exp $
+ #
+ #
+ # Makefile for the ELM (ME+) mail program.
+ #
+ # Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
+ #
+ #
+ $cat >Makefile <<!GROK!THIS!
+ AR = ar
+ CC = $cc
+ CCFLAGS = $ccflags $picflag $xencf
+ CP = $cp
+ RM = $rm -f
+ MV = $mv
+ OPTIMIZE = $optimize
+ RANLIB = $ranlib
+ TOUCH = $touch
+ CHMOD = $chmod
+ REG = ../../bin/elmregister
+
+ SHAREDSRC = $sharedsrc
+ SHAREDOBJ = $sharedobj
+ !GROK!THIS!
+
+

+ if $test "$d_shared" = "$define" ; then

+ A=
+ if $test "$soname_include_path" = y ; then
+ A="$shlib/"
+ fi
+
+ cat >>Makefile <<SUBSTITUTE
+ INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-mailer.so$d_shared_rev
+ SONAME = ${soname_opt}${A}libelmme-mailer.so$d_shared_rev
+
+ SUBSTITUTE
+
+ else
+
+ cat >>Makefile <<'!NO!SUBS!'
+ INSTLIB =
+ SONAME =
+ !NO!SUBS!
+
+ fi
+
+ $cat >>Makefile <<'!NO!SUBS!'
+ CFLAGS = -I$(INCLDIR) $(CCFLAGS) $(OPTIMIZE)
+ INCLDIR = ../../hdrs
+ OBJS = mailer.o outheaders.o $(SHAREDOBJ) init.o
+
+
+ all: Makefile ../../libs/libelmme-mailer.a ../../shlib/libelmme-mailer.so
+ install_s: all $(INSTLIB)
+
+ uninstall_s:
+ $(REG) rm $(INSTLIB)
+
+ clean:
+ rm -f $(OBJS) ../../shlib/libelmme-mailer.so ../../libs/libelmme-mailer.a
+
+ .PRECIOUS: ../../hdrs/defs.h def_mailer.h
+
+ ../../hdrs/defs.h: ../../config.h ../../hdrs/sysdefs.h
+ $(CHMOD) u+w $@
+ $(TOUCH) $@
+
+ def_mailer.h: ../../hdrs/defs.h ../../hdrs/elmlib.h \
+ ../../hdrs/mailerlib.h
+ $(CHMOD) u+w $@
+ $(TOUCH) $@
+
+ Makefile: Makefile.SH ../../config.sh
+ @echo "You must run 'sh Configure -S' or 'sh Configure'"
+ exit 1
+
+
+ lint:
+
+ tags:
+
+ clean:
+
+ init.o: def_mailer.h $(INCLDIR)/hdr_imp.h $(INCLDIR)/save_opts.h \
+ $(INCLDIR)/rc_imp.h $(INCLDIR)/shared_imp.h
+
+ mailer.o: def_mailer.h $(INCLDIR)/s_elm.h $(INCLDIR)/mailer_imp.h $(INCLDIR)/shared_imp.h
+
+ outheaders.o: def_mailer.h $(INCLDIR)/s_me.h $(INCLDIR)/hdr_imp.h
+
+ shared_mailer.o: def_mailer.h $(INCLDIR)/mailer_imp.h \
+ $(INCLDIR)/shared_imp.h $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h
+
+ ../../libs/libelmme-mailer.a: $(OBJS)
+ $(AR) r $@ $?
+ $(RANLIB) $@
+
+ ../../shlib/libelmme-mailer.so: $(OBJS)
+ $(CC) $(CCFLAGS) $(SONAME) -o $@ $(OBJS)

+
+
+ !NO!SUBS!
+

+ if $test "$d_shared" = "$define" ; then
+

+ cat >>Makefile <<'!NO!SUBS!'
+

+ $(INSTLIB): ../../shlib/libelmme-mailer.so
+ $(REG) copy -m 444 $? $@
+
+ !NO!SUBS!
+
+ else
+

+ cat >>Makefile <<'!NO!SUBS!'
+

+ !NO!SUBS!
+
+ fi
+
Index: elm2.4.ME+.122-cvs/lib/mailer/outheaders.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/lib/mailer/outheaders.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 0 ****
--- 1,193 ----
+ static char rcsid[] = "@(#)$Id: outheaders.c,v 1.3 2005/07/06 08:42:42 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
+ *****************************************************************************/
+

+ #include "def_mailer.h"
+ #include "hdr_imp.h"

+ #include "s_me.h"


+
+ #include <errno.h>
+ #ifndef ANSI_C
+ extern int errno;
+ #endif
+

+ DEBUG_VAR(Debug,__FILE__,"header");
+

+
+ static unsigned char *s2us P_((char *str));
+ static unsigned char *s2us(str)
+ char *str;
+ {
+ return (unsigned char *)str;

+ }
+
+ char * from_addr_literal(mailer_info)
+ struct mailer_info *mailer_info;
+ {
+ char * Q = NULL;
+
+ /* If on username is strange characters (specially if username
+ is from some other user database backend than from /etc/passwd)
+ then quote it...
+ */
+
+ if (NULL != strpbrk(username,
+ ":\"\\!#%&()=?',;.:<>")) {
+ Q = elm_message(FRM("%Q"),username);
+
+ DPRINT(Debug,6,
+ (&Debug, "from_addr_literal: Quoting username: %s\n",Q));
+
+ } else
+ Q = safe_strdup(username);
+
+
+ if (mailer_info &&
+ query_mailer_info(mailer_info,MI_USE_DOMAIN)) {
+ Q = strmcat(Q,"@");
+ Q = strmcat(Q, hostfullname);
+ }
+
+ return Q;
+ }
+
+ void make_from_addr(expanded,mailer_info)
+ struct expanded_address *expanded;
+ struct mailer_info *mailer_info;
+ {
+ int pos;


+
+ /* FIXME: Posible wrong charset */

+ struct string * comment = new_string(display_charset);
+ struct string * name = new_string2(display_charset,s2us(full_username));
+
+ char *s = safe_strdup(username); /* Use username as surface addr */
+ struct string *s1 = NULL;
+ char *x;
+
+ char * Q = from_addr_literal(mailer_info);
+
+ free_expanded_address(expanded);
+
+ pos = add_expanded_addr_(expanded,Q,name,comment);
+ free(Q); Q = NULL;
+
+ /* No fancy quotation stuff on textual form for editing */
+ for (x = s; *x; x++) {
+ switch(*x) {
+ case '"': case '\\': case '(': case ')': case ':':
+ case '<': case '>':
+ *x = '_';


+ break;
+ }
+ }
+

+ s1 = new_string2(display_charset,s2us(s));
+
+ add_textual_addr_(expanded,s1,pos,1);
+ free(s); s = NULL;
+
+ free_string(&s1);
+
+ free_string(&name);
+ free_string(&comment);
+ }
+
+
+
+ void zero_mailing_headers (hdrs)
+ struct mailing_headers *hdrs;
+ {
+ /* bzero is defined hdrs/defs.h */
+ bzero((void *)hdrs,sizeof (*hdrs));
+
+ hdrs->magic = MAIL_HDR_magic;
+
+ hdrs->subject = NULL;
+ zero_expanded_address(&(hdrs->from));
+ zero_id_phrase(&(hdrs->in_reply_to));
+ hdrs->expires = NULL;
+ hdrs->action = NULL;
+ hdrs->priority = NULL;
+ hdrs->sender = NULL;
+ zero_expanded_address(&(hdrs->reply_to));
+ zero_expanded_address(&(hdrs->to));
+ zero_expanded_address(&(hdrs->cc));
+ hdrs->user_header = NULL;
+ hdrs->user_header_count = 0;
+ zero_expanded_address(&(hdrs->bcc));
+ hdrs->precedence = NULL;
+ hdrs->expires_days = NULL;
+ hdrs->env_from = NULL;
+ }
+
+ void free_mailing_headers (hdrs)
+ struct mailing_headers *hdrs;
+ {
+ if (hdrs->magic != MAIL_HDR_magic)
+ panic("HEADERS PANIC",__FILE__,__LINE__,"free_mailing_headers",


+ "Bad magic number",0);
+

+ if (hdrs->subject)
+ free_string(&(hdrs->subject));
+ hdrs->subject = NULL;
+ free_expanded_address(&(hdrs->from));
+ free_id_phrase(&(hdrs->in_reply_to));
+ if (hdrs->expires)
+ free(hdrs->expires);
+ hdrs->expires = NULL;
+ if (hdrs->action)
+ free(hdrs->action);
+ hdrs->action = NULL;
+ if (hdrs->priority)
+ free(hdrs->priority);
+ hdrs->priority = NULL;
+ if (hdrs->sender)
+ free(hdrs->sender);
+ hdrs->sender = NULL;
+ free_expanded_address(&(hdrs->reply_to));
+ free_expanded_address(&(hdrs->to));
+ free_expanded_address(&(hdrs->cc));
+
+ if (hdrs->user_header) {
+ int i;
+
+ for (i = 0; i < hdrs->user_header_count; i++) {
+ if (hdrs->user_header[i].value)
+ free_string(&(hdrs->user_header[i].value));
+ hdrs->user_header[i].name = NULL;
+ }
+ free(hdrs->user_header);
+ hdrs->user_header = NULL;
+ }
+ hdrs->user_header_count = 0;
+
+ free_expanded_address(&(hdrs->bcc));
+ if (hdrs->precedence)
+ free(hdrs->precedence);
+ hdrs->precedence = NULL;
+ if (hdrs->expires_days)
+ free(hdrs->expires_days);
+ hdrs->expires_days = NULL;
+
+ if (hdrs->env_from)
+ mailer_free_env_from( &(hdrs->env_from) );
+
+ /* Make sure that dangling pointters are catched */
+ /* bzero is defined hdrs/defs.h */
+ bzero((void *)hdrs,sizeof (*hdrs));
+

+ }
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/lib/mailer/shared_mailer.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/lib/mailer/shared_mailer.c 2005-05-21 20:58:32.000000000 +0300
***************


*** 0 ****
--- 1,154 ----

+ static char rcsid[] = "@(#)$Id: shared_mailer.c,v 1.2 2005/05/21 17:58:32 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *

+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
+ *****************************************************************************/
+
+ /*
+ * This file is compiled only if dlopen() is available, so
+ * that file does not need to be guarded with #ifdef
+ */


+
+ #include "def_mailer.h"
+

+ DEBUG_VAR(Debug,__FILE__,"dl");
+
+ #include "shared_imp.h"
+ #include "mailer_imp.h"
+

+ #include "rc_imp.h"
+ #include "save_opts.h"
+

+

+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ #define SHARED_MAILER_magic 0xF904
+
+ struct sl_mailer_data {
+ uint16 magic;
+
+ };
+
+
+ S_(sl_reg_functions sl_reg_mailer)
+ static int sl_reg_mailer P_((struct ImpInfo *i,
+ int reg_idx));
+ static int sl_reg_mailer(i,reg_idx)
+ struct ImpInfo *i;
+ int reg_idx;
+ {
+ /* union hack to avoid warnings about casting
+ * between pointer-to-object and pointer-to-function
+ */
+

+ int res = 0;
+

+ union F14 {
+ void * ptr;
+ provides_shared_MCF_f * f14;
+ } f14;
+
+ f14.ptr = dlsym(i->handle, "provides_shared_MCF");
+
+ if (!f14.f14) {
+ DPRINT(Debug,7,(&Debug, " ... NO provides_shared_MCF\n"));
+ }
+
+ if (f14.f14) {
+ int count;
+ size_t s_res14, s_opt_size;
+
+ struct mailer_config *res14 = f14.f14(&count,&s_res14,
+ &s_opt_size);
+
+ if (s_res14 != sizeof (*res14)) {
+ DPRINT(Debug,1,(&Debug,
+ "... struct mailer_config mismatch: %d should be %d\n",
+ s_res14,sizeof (*res14)));
+ } else if (s_opt_size != sizeof (struct mailer_option_list)) {
+ DPRINT(Debug,1,(&Debug,
+ "... struct mailer_option_list mismatch: %d should be %d\n",
+ s_opt_size,sizeof (struct mailer_option_list)));
+ } else {
+ int x;
+
+ shared_MCF_types =
+ safe_realloc(shared_MCF_types,
+ sizeof (shared_MCF_types[0]) *
+ (shared_MCF_type_count + count));
+
+ DPRINT(Debug,7,(&Debug," ... provides_shared_MCF: (shared_MCF_types) count %d\n",
+ count));
+ res = 1;
+
+ for (x = 0; x < count; x++) {
+ shared_MCF_types[shared_MCF_type_count+x].T = &(res14[x]);
+ shared_MCF_types[shared_MCF_type_count+x].imp_idx = i;
+ }
+ shared_MCF_type_count += count;
+ }
+ }
+
+ i->regs[reg_idx].valid = res;


+
+ return res;
+ }
+

+ S_(sl_zero_reg_list sl_zero_mailer)
+ static void sl_zero_mailer P_((struct dt_shared_info *var,
+ struct reg_list *r));
+ static void sl_zero_mailer(var,r)
+ struct dt_shared_info *var;
+ struct reg_list *r;
+ {
+ r->var = var;
+ r->valid = 0;
+ r->r.mailer = safe_malloc(sizeof (*r->r.mailer)); /* never freed ... */
+ r->r.mailer->magic = SHARED_MAILER_magic;
+ }
+
+ S_(sl_unreg_functions sl_unreg_mailer)
+ static void sl_unreg_mailer P_((struct ImpInfo *i, int reg_idx));
+ static void sl_unreg_mailer(i,reg_idx)
+ struct ImpInfo *i;
+ int reg_idx;
+ {
+ struct reg_list *r = & (i->regs[reg_idx] );
+ r->valid = 0;
+
+ }
+
+ static struct shared_loader mailer_loader = {
+ SHARED_LOADER_magic,
+ sl_reg_mailer,
+ sl_zero_mailer,
+ sl_unreg_mailer
+ };
+
+ SHAREDLIB use_shared_mailer = {
+ &mailer_loader /* loader */,
+ 0,

+ NULL, 0
+ };
+

+ struct mailer_config * loc_mailer_type(f)
+ char *f;
+ {
+ int x;
+
+ /* We must load all mailer libraries */
+ load_shared_libs1(&use_shared_mailer);
+
+
+ for (x = 0; x < shared_MCF_type_count; x++)
+ if (0 == strcmp(shared_MCF_types[x].T->mailer_type,f)) {
+ return shared_MCF_types[x].T;


+ }
+ return NULL;
+ }

Index: elm2.4.ME+.122-cvs/lib/mail_gets.c
*** elm2.4.ME+.121/lib/mail_gets.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/mail_gets.c 2005-04-30 09:57:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.10 2004/07/19 19:39:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.11 2005/04/30 06:57:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
***************
*** 105,111 ****
return -1;

if (ferror(mailfile))
! return-2;

return line_bytes;
}
--- 105,111 ----
return -1;

if (ferror(mailfile))
! return -2;

return line_bytes;
}
Index: elm2.4.ME+.122-cvs/lib/Makefile.SH
*** elm2.4.ME+.121/lib/Makefile.SH 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/Makefile.SH 2005-07-08 10:51:37.000000000 +0300
***************
*** 43,58 ****
;;
esac



echo "Extracting lib/Makefile (with variable substitutions)"

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.91 2004/09/05 08:17:07 hurtta Exp $
#


# Makefile for the ELM mail program.
#

# Copyright (c) 1986,1987 Dave Taylor
# Copyright (c) 1988-1992 USENET Community Trust
! #
#
#
# Variables

--- 43,71 ----
;;
esac

+ case "$d_wchar" in
+ define) widesrc="cs_wfallback.c"
+ wideobj="cs_wfallback.o"
+ ;;
+ *) widesrc=
+ wideobj=
+ ;;
+ esac
+

echo "Extracting lib/Makefile (with variable substitutions)"

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.102 2005/07/08 07:51:37 hurtta Exp $
#


# Makefile for the ELM mail program.

#
+ # Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>
+ ######################################################################

+ # Based on lib/Makefile.SH. That code was following copyright:
+ #
# Copyright (c) 1986,1987 Dave Taylor
# Copyright (c) 1988-1992 USENET Community Trust
! ######################################################################
#
#
# Variables
***************
*** 86,91 ****
--- 99,107 ----
SHAREDSRC = $sharedsrc
SHAREDOBJ = $sharedobj

+ WIDESRC = $widesrc
+ WIDEOBJ = $wideobj
+
!GROK!THIS!

case "$ccflags" in
***************
*** 112,118 ****



cat >>Makefile <<SUBSTITUTE
SHLIST = ../shlib/libelmme-base.so
! INSTLIB = $shlib/libelmme-base.so$d_shared_rev
SONAME = ${soname_opt}${A}libelmme-base.so$d_shared_rev
SHLIB = $shlib
SUBSTITUTE

--- 128,134 ----



cat >>Makefile <<SUBSTITUTE
SHLIST = ../shlib/libelmme-base.so
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-base.so$d_shared_rev
SONAME = ${soname_opt}${A}libelmme-base.so$d_shared_rev
SHLIB = $shlib
SUBSTITUTE

***************
*** 138,145 ****
REG = ../bin/elmregister

# Lists
! LIB_SRC = add_site.c \
! atonum.c \
bindata.c \
mmaputil.c \
mk_aliases.c \
--- 154,160 ----
REG = ../bin/elmregister

# Lists
! LIB_SRC = atonum.c \
bindata.c \
mmaputil.c \
mk_aliases.c \
***************
*** 156,161 ****
--- 171,178 ----
cs_iso2022.c \
cs_fallback.c \
cs_utf.c \
+ cs_unknown.c \
+ $(WIDESRC) \
date_util.c \
$(DEBUGSRC) \
dispaddr.c \
***************
*** 187,193 ****
len_next.c \
localmbx.c \
mail_gets.c \
- mailer.c \
mediatype.c \
mbox.c \
move_left.c \
--- 204,209 ----
***************
*** 206,211 ****
--- 222,228 ----
realfrom.c \
remote_mbx.c \
qstrings.c \
+ rc_delay.c \
rc_handle.c \
read_rc.c \
reverse.c \
***************
*** 229,244 ****
$(STRSRC) \
$(FTIMESRC) \
strmcpy.c \
- strtokq.c \
syscall.c \
terminal.c \
unicode.c \
unidata.c \
write_hdr.c \
safeopen.c

! LIB_OBJ = add_site.o \
! atonum.o \
bindata.o \
mmaputil.o \
mk_aliases.o \
--- 246,260 ----
$(STRSRC) \
$(FTIMESRC) \
strmcpy.c \
syscall.c \
terminal.c \
unicode.c \
unidata.c \
write_hdr.c \
+ write_rc.c \
safeopen.c

! LIB_OBJ = atonum.o \
bindata.o \
mmaputil.o \
mk_aliases.o \
***************
*** 255,260 ****
--- 271,278 ----
cs_iso2022.o \
cs_fallback.o \
cs_utf.o \
+ cs_unknown.o \
+ $(WIDEOBJ) \
date_util.o \
$(DEBUGOBJ) \
dispaddr.o \
***************
*** 285,291 ****
len_next.o \
localmbx.o \
mail_gets.o \
- mailer.o \
mediatype.o \
mbox.o \
move_left.o \
--- 303,308 ----


***************
*** 302,307 ****
--- 319,325 ----

pop.o \
putenv.o \
qstrings.o \
+ rc_delay.o \
rc_handle.o \
read_rc.o \
realfrom.o \
***************
*** 327,348 ****
$(STROBJ) \
$(FTIMEOBJ) \
strmcpy.o \
- strtokq.o \
syscall.o \
terminal.o \
unicode.o \
unidata.o \
write_hdr.o \
safeopen.o

! all: magic_diffs Makefile libutil.a $(SHLIST)

! install_s: Makefile libutil.a $(INSTLIB)

uninstall_s:
$(REG) rm $(INSTLIB)

! libutil.a: $(LIB_OBJ)


$(AR) r $@ $?
$(RANLIB) $@

--- 345,366 ----
$(STROBJ) \
$(FTIMEOBJ) \
strmcpy.o \
syscall.o \
terminal.o \
unicode.o \
unidata.o \
write_hdr.o \
+ write_rc.o \
safeopen.o

! all: magic_diffs Makefile ../libs/libelmme-base.a $(SHLIST)

! install_s: Makefile ../libs/libelmme-base.a $(INSTLIB)

uninstall_s:
$(REG) rm $(INSTLIB)

! ../libs/libelmme-base.a: $(LIB_OBJ)


$(AR) r $@ $?
$(RANLIB) $@

***************
*** 368,374 ****
$(TAGS) $(LIB_SRC)

clean:
! $(RM) $(LIB_OBJ) libutil.a

# Dependencies and rules
# Dependencies of header files upon other header files they include
--- 386,392 ----
$(TAGS) $(LIB_SRC)

clean:
! $(RM) $(LIB_OBJ) ../libs/libelmme-base.a

# Dependencies and rules
# Dependencies of header files upon other header files they include
***************
*** 397,403 ****
strstr.o: $(INCLDIR)/defs_major.h

# --- Dependencies of C object files
- add_site.o: $(INCLDIR)/headers.h
atonum.o: $(INCLDIR)/headers.h
bindata.o: $(INCLDIR)/headers.h $(INCLDIR)/mmaputil.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/s_me.h $(INCLDIR)/bindata.h
--- 415,420 ----
***************
*** 417,423 ****
--- 434,442 ----
cs_binary.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/bindata.h
cs_fallback.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
+ cs_wfallback.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_utf.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
+ cs_unknown.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
cs_iso2022.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
date_util.o: $(INCLDIR)/headers.h
debug.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/patchlevel.h
***************
*** 449,457 ****
localmbx.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h
mail_gets.o: $(INCLDIR)/headers.h
! mailer.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/mailer_imp.h $(INCLDIR)/shared_imp.h
! mediatype.o: $(INCLDIR)/headers.h
mbox.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h
mgets.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h
--- 468,474 ----
localmbx.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h
mail_gets.o: $(INCLDIR)/headers.h
! mediatype.o: $(INCLDIR)/headers.h
mbox.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h
mgets.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h
***************
*** 469,474 ****
--- 486,493 ----
pop.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h
posixsig.o: $(INCLDIR)/headers.h
+ rc_delay.o: $(INCLDIR)/headers.h $(INCLDIR)/save_opts.h \
+ $(INCLDIR)/rc_imp.h
rc_handle.o: $(INCLDIR)/headers.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/s_elm.h $(INCLDIR)/rc_imp.h $(INCLDIR)/shared_imp.h
read_rc.o: $(INCLDIR)/headers.h $(INCLDIR)/save_opts.h \
***************
*** 488,499 ****
$(INCLDIR)/rc_imp.h $(INCLDIR)/cs_imp.h $(INCLDIR)/ss_imp.h \
$(INCLDIR)/mailer_imp.h
shared_connect.o: $(INCLDIR)/headers.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h $(INCLDIR)/mailer_imp.h
shared_base.o: $(INCLDIR)/headers.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
shared_all.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
sb_file.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
sb_mem.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
schedule.o: $(INCLDIR)/headers.h
--- 507,518 ----
$(INCLDIR)/rc_imp.h $(INCLDIR)/cs_imp.h $(INCLDIR)/ss_imp.h \
$(INCLDIR)/mailer_imp.h
shared_connect.o: $(INCLDIR)/headers.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h $(INCLDIR)/mailer_imp.h
shared_base.o: $(INCLDIR)/headers.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
shared_all.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/rc_imp.h $(INCLDIR)/cs_imp.h
sb_file.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
sb_mem.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
schedule.o: $(INCLDIR)/headers.h
***************
*** 510,522 ****
strmcpy.o: $(INCLDIR)/headers.h
strincmp.o: $(INCLDIR)/headers.h
striparens.o: $(INCLDIR)/headers.h
- strtokq.o: $(INCLDIR)/headers.h
syscall.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h
terminal.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
unicode.o: $(INCLDIR)/headers.h $(INCLDIR)/mmaputil.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/unidata.h
unidata.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/unidata.h
! write_hdr.o: $(INCLDIR)/headers.h


!NO!SUBS!

if $test "$d_shared" = "$define" ; then

--- 529,542 ----
strmcpy.o: $(INCLDIR)/headers.h
strincmp.o: $(INCLDIR)/headers.h
striparens.o: $(INCLDIR)/headers.h
syscall.o: $(INCLDIR)/headers.h $(INCLDIR)/s_elm.h
terminal.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
unicode.o: $(INCLDIR)/headers.h $(INCLDIR)/mmaputil.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/unidata.h
unidata.o: $(INCLDIR)/headers.h $(INCLDIR)/s_me.h $(INCLDIR)/unidata.h
! write_rc.o: $(INCLDIR)/headers.h
! write_hdr.o: $(INCLDIR)/headers.h $(INCLDIR)/rc_imp.h \
! $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h


!NO!SUBS!

if $test "$d_shared" = "$define" ; then

Index: elm2.4.ME+.122-cvs/lib/mbox.c
*** elm2.4.ME+.121/lib/mbox.c 2004-06-27 22:39:33.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/mbox.c 2005-04-23 23:06:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.53 2004/06/18 09:29:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.53 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.55 2005/04/23 20:06:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 643,653 ****
}

if (in_mail) {
! if (folders[0]) {
! if (in_directory(buf,filename,folders)) {
DPRINT(Debug,8,(&Debug,
"get_folder_type: On folders directory: %s\n",
! folders));
*in_mail = in_folders;
}
}
--- 643,656 ----
}

if (in_mail) {


! /* give_dt_estr_as_str adds / to end */
! char * str = give_dt_estr_as_str(&folders_e,"maildir");
!

! if (str) {
! if (in_directory(buf,filename,str)) {
DPRINT(Debug,8,(&Debug,
"get_folder_type: On folders directory: %s\n",
! str));
*in_mail = in_folders;
}
}
***************
*** 2194,2203 ****
struct header_rec *entry;
CONST char *value;
{
DPRINT(Debug,20,(&Debug,
"return_path_to_env_from- value=%s\n",value));
DPRINT(Debug,20,(&Debug,
! "env_from_source=%d\n",env_from_source));



/* env_from_source:
0 == forward-from,

--- 2197,2208 ----
struct header_rec *entry;
CONST char *value;
{


+ int ef = give_dt_enumerate_as_int(&env_from_source);
+

DPRINT(Debug,20,(&Debug,
"return_path_to_env_from- value=%s\n",value));
DPRINT(Debug,20,(&Debug,
! "env_from_source=%d\n",ef));



/* env_from_source:
0 == forward-from,
***************

*** 2205,2211 ****
2 == return-path
*/

! if (env_from_source <3) {
char * temp = return_path_to_env_from_1(value);

if (temp) {
--- 2210,2216 ----
2 == return-path
*/

! if (ef <3) {
char * temp = return_path_to_env_from_1(value);

if (temp) {
Index: elm2.4.ME+.122-cvs/lib/mediatype.c
*** elm2.4.ME+.121/lib/mediatype.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/mediatype.c 2005-04-10 21:26:08.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.14 2004/07/19 19:39:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.15 2005/04/10 18:26:08 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 109,114 ****
--- 109,117 ----
enum mime_major_type get_major_type_code(T)
media_type_t T;
{
+ if (!T)
+ return MIME_TYPE_UNKNOWN;
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_major_type_code",

"Bad magic number",0);
***************


*** 124,129 ****
--- 127,135 ----
CONST char * get_major_type_name(T)
media_type_t T;
{
+ if (!T)
+ return "?unknown?";
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_major_type_name",

"Bad magic number",0);
***************


*** 152,157 ****
--- 158,167 ----
media_type_t T;
{

int ret;
+
+ if (!T)
+ return 0;
+

if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_type_flags",

"Bad magic number",0);
***************


*** 175,184 ****
--- 185,200 ----
CONST char * get_subtype_name(T)
media_type_t T;
{
+
+ if (!T)
+ return "?unknown?";
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_subtype_name",

"Bad magic number",0);


+ if (! T->subtype)
+ return "?unknown?";

return T->subtype;
}
***************
*** 236,242 ****

enum mime_major_type I1 = give_major_type(major,create);

! if (MIME_TYPE_UNKNOWN == I1)
return NULL;

return give_media_type2(I1,minor,create);
--- 252,258 ----

enum mime_major_type I1 = give_major_type(major,create);

! if (MIME_TYPE_UNKNOWN == I1 && !create)
return NULL;

return give_media_type2(I1,minor,create);

***************
*** 301,306 ****


--- 317,325 ----
int give_text_type_code(T)
media_type_t T;
{
+ if (!T)

+ return -1;
+

if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"give_text_type_code",

"Bad magic number",0);
***************


*** 398,403 ****
--- 417,428 ----
int *is_default;
enum mt_handle_type kind;
{
+ if (!T) {
+ *H = NULL;

+ return 0;
+ }
+
+

if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"walk_mt_handler",

"Bad magic number",0);
***************


*** 426,432 ****
}
if (i >= T->handle_count) {
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"walk_mt_handler",
! "previous non defualt handler not found",0);
return 0; /* NOT REACHED */
}

--- 451,457 ----
}
if (i >= T->handle_count) {
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"walk_mt_handler",
! "previous non-default handler not found",0);
return 0; /* NOT REACHED */
}

Index: elm2.4.ME+.122-cvs/lib/ndbz.c
*** elm2.4.ME+.121/lib/ndbz.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/ndbz.c 2005-07-06 00:40:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.7 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.9 2005/07/05 21:40:38 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 165,175 ****
#define TAGSHIFT 0
#endif

! static int getconf();
! static int32 getno();
! static int putconf();
! static void mybytemap();
! static of_t bytemap();

/*
* For a program that makes many, many references to the database, it
--- 165,186 ----
#define TAGSHIFT 0
#endif

! static int /* 0 success, -1 failure */
! getconf P_((FILE *df, /* NULL means just give me the default */
! FILE *pf, /* NULL means don't care about .pag */
! struct dbzconfig *cp));
!
! static int32 getno P_((FILE *f,
! int *ep));
!
! static int /* 0 success, -1 failure */
! putconf P_((FILE *f, struct dbzconfig *cp));
!
! static void mybytemap P_((int map[])); /* -> int[SOF] */
!
! static of_t /* transformed result */
! bytemap P_((of_t ino,int *map1,int *map2));
!

/*
* For a program that makes many, many references to the database, it
***************
*** 198,209 ****
# ifndef MAXRUN
# define MAXRUN 100
# endif
! static void start();
#define FRESH ((struct searcher *)NULL)
! static of_t search();
#define NOTFOUND ((of_t)-1)
! static int okayvalue();
! static int set();

/*
* Arguably the searcher struct for a given routine ought to be local to
--- 209,228 ----
# ifndef MAXRUN
# define MAXRUN 100
# endif
!
! static void start P_((DBZ *db, datum *kp, struct searcher *osp));
!
!
#define FRESH ((struct searcher *)NULL)
! static of_t /* NOTFOUND if we hit VACANT or error */
! search P_((DBZ *db));
!
#define NOTFOUND ((of_t)-1)
! static int /* predicate */
! okayvalue P_((DBZ *db,of_t value));
!
! static int /* 0 success, -1 failure */
! set P_((DBZ *db,of_t value));

/*
* Arguably the searcher struct for a given routine ought to be local to
***************
*** 217,241 ****
#define MAPIN(o) ((db->dbz_bytesame) ? (o) : bytemap((o), db->dbz_conf.bytemap, db->dbz_mybmap))
#define MAPOUT(o) ((db->dbz_bytesame) ? (o) : bytemap((o), db->dbz_mybmap, db->dbz_conf.bytemap))

- /* externals used */
- #if !defined(atol) /* avoid problems with systems that declare atol as a macro */
- extern long atol();
- #endif

/* misc. forwards */
! static long hash();
! static void crcinit();
! static int isprime();
! static FILE *latebase();

/* file-naming stuff */
static char dir[] = ".dir";
static char pag[] = ".pag";
! static char *enstring();

/* central data structures */
! static of_t *getcore();
! static int putcore();

/*
- dbz_fresh - set up a new database, no historical info
--- 236,268 ----
#define MAPIN(o) ((db->dbz_bytesame) ? (o) : bytemap((o), db->dbz_conf.bytemap, db->dbz_mybmap))
#define MAPOUT(o) ((db->dbz_bytesame) ? (o) : bytemap((o), db->dbz_mybmap, db->dbz_conf.bytemap))


/* misc. forwards */
! static long hash P_((char *name, int size));
!
! static void crcinit P_((void));
!
! static int /* predicate */
! isprime P_((long x));
!
! static FILE *
! latebase P_(( DBZ *db ));
!

/* file-naming stuff */
static char dir[] = ".dir";
static char pag[] = ".pag";
!
! static char * /* NULL if malloc fails */
! enstring P_((char *s1,char *s2));
!

/* central data structures */
! static of_t * /* pointer to copy, or NULL */
! getcore P_((DBZ *db));
!
! static int /* 0 okay, -1 fail */
! putcore P_((DBZ *db));

/*
- dbz_fresh - set up a new database, no historical info
***************
*** 344,349 ****
--- 371,378 ----
return(dbz_open(name, O_RDWR, 0));
}

+ long dbzsize P_((long contents)); /* 0 means what's the default */
+
/*
- dbz_size - what's a good table size to hold this many entries?
*/
***************
*** 1184,1197 ****
"fseek failure in putconf\n"));
ret = -1;
}
! fprintf(f, "dbz %d %ld %d %ld %ld %d %d", dbzversion, cp->tsize,
! cp->fieldsep, cp->tagenb,
! cp->tagmask, cp->tagshift, cp->valuesize);
for (i = 0; i < cp->valuesize; i++)
fprintf(f, " %d", cp->bytemap[i]);
fprintf(f, "\n");
for (i = 0; i < NUSEDS; i++)
! fprintf(f, "%ld%c", cp->used[i], (i < NUSEDS-1) ? ' ' : '\n');

(void) fflush(f);
if (ferror(f))
--- 1213,1226 ----
"fseek failure in putconf\n"));
ret = -1;
}
! fprintf(f, "dbz %d %ld %d %ld %ld %d %d", dbzversion, (long int) cp->tsize,
! cp->fieldsep, (long int) cp->tagenb,
! (long int) cp->tagmask, cp->tagshift, cp->valuesize);
for (i = 0; i < cp->valuesize; i++)
fprintf(f, " %d", cp->bytemap[i]);
fprintf(f, "\n");
for (i = 0; i < NUSEDS; i++)
! fprintf(f, "%d%c", cp->used[i], (i < NUSEDS-1) ? ' ' : '\n');

(void) fflush(f);
if (ferror(f))
***************
*** 1588,1599 ****
return(sum);
}

/*
- dbzdebug - control dbz debugging at run time
*/
int /* old value */
dbzdebug(value)
! int value;
{
#ifdef DBZDEBUG
register int old = debug;
--- 1617,1632 ----
return(sum);
}

+
+ int /* old value */
+ dbzdebug P_((int value));
+
/*
- dbzdebug - control dbz debugging at run time
*/
int /* old value */
dbzdebug(value)
! int value;
{
#ifdef DBZDEBUG
register int old = debug;
Index: elm2.4.ME+.122-cvs/lib/outheaders.c
*** elm2.4.ME+.121/lib/outheaders.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/outheaders.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.22 2004/07/28 08:55:59 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.27 2005/07/06 08:42:42 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 25,123 ****
return (unsigned char *)str;
}

- static char *us2s P_((unsigned char *str));
- static char *us2s(str)
- unsigned char *str;
- {
- return (char *)str;
- }
-
-
-
- void zero_mailing_headers (hdrs)
- struct mailing_headers *hdrs;
- {
- /* bzero is defined hdrs/defs.h */
- bzero((void *)hdrs,sizeof (*hdrs));
-
- hdrs->magic = MAIL_HDR_magic;
-
- hdrs->subject = NULL;
- zero_expanded_address(&(hdrs->from));
- zero_id_phrase(&(hdrs->in_reply_to));
- hdrs->expires = NULL;
- hdrs->action = NULL;
- hdrs->priority = NULL;
- hdrs->sender = NULL;
- zero_expanded_address(&(hdrs->reply_to));
- zero_expanded_address(&(hdrs->to));
- zero_expanded_address(&(hdrs->cc));
- hdrs->user_header = NULL;
- hdrs->user_header_count = 0;
- zero_expanded_address(&(hdrs->bcc));
- hdrs->precedence = NULL;
- hdrs->expires_days = NULL;
- hdrs->env_from = NULL;
- }
-
- void free_mailing_headers (hdrs)
- struct mailing_headers *hdrs;
- {
- if (hdrs->magic != MAIL_HDR_magic)
- panic("HEADERS PANIC",__FILE__,__LINE__,"free_mailing_headers",
- "Bad magic number",0);
-
- if (hdrs->subject)
- free_string(&(hdrs->subject));
- hdrs->subject = NULL;
- free_expanded_address(&(hdrs->from));
- free_id_phrase(&(hdrs->in_reply_to));
- if (hdrs->expires)
- free(hdrs->expires);
- hdrs->expires = NULL;
- if (hdrs->action)
- free(hdrs->action);
- hdrs->action = NULL;
- if (hdrs->priority)
- free(hdrs->priority);
- hdrs->priority = NULL;
- if (hdrs->sender)
- free(hdrs->sender);
- hdrs->sender = NULL;
- free_expanded_address(&(hdrs->reply_to));
- free_expanded_address(&(hdrs->to));
- free_expanded_address(&(hdrs->cc));
-
- if (hdrs->user_header) {
- int i;
-
- for (i = 0; i < hdrs->user_header_count; i++) {
- if (hdrs->user_header[i].value)
- free_string(&(hdrs->user_header[i].value));
- hdrs->user_header[i].name = NULL;
- }
- free(hdrs->user_header);
- hdrs->user_header = NULL;
- }
- hdrs->user_header_count = 0;
-
- free_expanded_address(&(hdrs->bcc));
- if (hdrs->precedence)
- free(hdrs->precedence);
- hdrs->precedence = NULL;
- if (hdrs->expires_days)
- free(hdrs->expires_days);
- hdrs->expires_days = NULL;
-
- if (hdrs->env_from)
- mailer_free_env_from( &(hdrs->env_from) );
-
- /* Make sure that dangling pointters are catched */
- /* bzero is defined hdrs/defs.h */
- bzero((void *)hdrs,sizeof (*hdrs));
-
- }
-
int add_expanded_addr_ (x,ADR,FN,COM)
struct expanded_address *x;
CONST char *ADR;
--- 25,30 ----
***************
*** 294,371 ****
return result;
}

- char * from_addr_literal(mailer_info)
- struct mailer_info *mailer_info;
- {
- char * Q = NULL;
-
- /* If on username is strange characters (specially if username
- is from some other user database backend than from /etc/passwd)
- then quote it...
- */
-
- if (NULL != strpbrk(username,
- ":\"\\!#%&()=?',;.:<>")) {
- Q = elm_message(FRM("%Q"),username);
-
- DPRINT(Debug,6,
- (&Debug, "from_addr_literal: Quoting username: %s\n",Q));
-
- } else
- Q = safe_strdup(username);
-
-
- if (mailer_info &&
- query_mailer_info(mailer_info,MI_USE_DOMAIN)) {
- Q = strmcat(Q,"@");
- Q = strmcat(Q, hostfullname);
- }
-
- return Q;
- }
-
- void make_from_addr(expanded,mailer_info)
- struct expanded_address *expanded;
- struct mailer_info *mailer_info;
- {
- int pos;


-
- /* FIXME: Posisble wrong charset */

- struct string * comment = new_string(display_charset);
- struct string * name = new_string2(display_charset,s2us(full_username));
-
- char *s = safe_strdup(username); /* Use username as surface addr */
- struct string *s1 = NULL;
- char *x;
-
- char * Q = from_addr_literal(mailer_info);
-
- free_expanded_address(expanded);
-
- pos = add_expanded_addr_(expanded,Q,name,comment);
- free(Q); Q = NULL;
-
- /* No fancy quotation stuff on textual form for editing */
- for (x = s; *x; x++) {
- switch(*x) {
- case '"': case '\\': case '(': case ')': case ':':
- case '<': case '>':
- *x = '_';


- break;
- }
- }
-

- s1 = new_string2(display_charset,s2us(s));
-
- add_textual_addr_(expanded,s1,pos,1);
- free(s); s = NULL;
-
- free_string(&s1);
-
- free_string(&name);
- free_string(&comment);
- }
-
void expanded_address_from_items(result,TMP)
struct expanded_address *result;
struct addr_item *TMP;
--- 201,206 ----
***************
*** 521,526 ****
--- 356,382 ----
return 1;
}

+ #if ANSI_C
+ static env_from_change_hook dummy_env_from_change;
+ #endif
+ static int dummy_env_from_change P_((struct mailer_env_from *X,


+ const char * value));
+

+ static int dummy_env_from_change(X,value)


+ struct mailer_env_from *X;
+ const char * value;

+ {
+ return 0;
+
+ }
+

+ static env_from_change_hook * ef_hook = &dummy_env_from_change;
+
+ void set_env_from_change_hook(hook)
+ env_from_change_hook *hook;
+ {
+ ef_hook = hook;
+ }

#ifdef ANSI_C
hdr_add_to_mailing_hdr add_env_from_hdr;
***************
*** 536,543 ****
int ret = 0;



if (0 == strcmp(value,"<>")) {

! mailer_env_from_change(headers->env_from,value);
! ret = 1;
} else {
struct addr_item * TMP;

--- 392,398 ----
int ret = 0;



if (0 == strcmp(value,"<>")) {

! ret = ef_hook(headers->env_from,value);
} else {
struct addr_item * TMP;

***************
*** 545,552 ****

if (TMP[0].addr && headers->env_from) {
char * t = elm_message(FRM("<%s>"),TMP[0].addr);
! mailer_env_from_change(headers->env_from,t);
! ret = 1;
free(t);
}

--- 400,406 ----

if (TMP[0].addr && headers->env_from) {
char * t = elm_message(FRM("<%s>"),TMP[0].addr);
! ret = ef_hook(headers->env_from,t);
free(t);
}

***************
*** 684,695 ****
--- 538,570 ----
"%*s %d [%d] ERROR! NULL element!\n",
l,"",j,ptr->pos+j));
} else {


+ CONST char *A, *B;
+

DPRINT(Debug,debuglevel,
(&Debug,
"%*s %d [%d] addr=%s \tfullname=%S\tcomment=%S\n",
l,"",j,ptr->pos+j,
ptr1->addr,ptr1->fullname,
ptr1->comment));
+
+ A = get_string_MIME_name(ptr1->fullname);
+ B = get_string_lang(ptr1->fullname);
+
+ DPRINT(Debug,debuglevel,
+ (&Debug,
+ "%*s fullname cs=%s lang=%s, ",
+ l,"",
+ A ? A : "<none>",
+ B ? B : "<none>"));
+
+ A = get_string_MIME_name(ptr1->comment);
+ B = get_string_lang(ptr1->comment);
+
+ DPRINT(Debug,debuglevel,
+ (&Debug,"comment cs=%s lang=%s\n",
+ A ? A : "<none>",
+ B ? B : "<none>"));
+
}
LASTPOS = ptr->pos+j;
}
***************
*** 761,774 ****
int retcode;

char local_buffer[80];
int n;

int res;

DPRINT(Debug,5,(&Debug, "eval_backquote: command: %s\n",
clip));

! argv[0] = shell;
argv[1] = "-c";
argv[2] = clip;
argv[3] = NULL;
--- 636,653 ----
int retcode;

char local_buffer[80];
+ char * sh = give_dt_estr_as_str(&shell_e,"shell");
int n;

int res;

+ if (!sh)
+ sh = "/bin/sh";
+
DPRINT(Debug,5,(&Debug, "eval_backquote: command: %s\n",
clip));

! argv[0] = sh;
argv[1] = "-c";
argv[2] = clip;
argv[3] = NULL;
Index: elm2.4.ME+.122-cvs/lib/pop.c
*** elm2.4.ME+.121/lib/pop.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/pop.c 2005-06-18 00:02:54.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pop.c,v 1.46 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pop.c,v 1.48 2005/06/17 21:02:54 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1200,1205 ****
--- 1200,1208 ----
return status;
}

+ static int mbx_sessionlock_pop P_((struct folder_info *folder,
+ enum sessionlock_mode mode));
+
static int mbx_sessionlock_pop(folder,mode)
struct folder_info *folder;
enum sessionlock_mode mode;
***************
*** 1495,1504 ****
status = 0;
goto clean;
}
! if (pop_command_ok(folder)) {
! char * fname;


char * buffer = NULL;

int buffer_len = 0;

/* If command is unimplemeted that is OK ... */

--- 1498,1507 ----
status = 0;
goto clean;
}
! if (pop_command_ok(folder)) {

char * buffer = NULL;

int buffer_len = 0;
+ char * str;

/* If command is unimplemeted that is OK ... */

***************
*** 1556,1564 ****
buffer = NULL;
}

! fname = elm_message(FRM("%s/.%s"),folders,folder->cur_folder_sys);
! update_uidls(fname,&(folder -> p->a.pop_mbx.uidl_root));
! free(fname);
}


--- 1559,1573 ----
buffer = NULL;


}

!
! /* give_dt_estr_as_str adds / to end */

! str = give_dt_estr_as_str(&folders_e,"maildir");
!
! if (str) {
! char * fname = elm_message(FRM("%s.%s"),str,folder->cur_folder_sys);
! update_uidls(fname,&(folder -> p->a.pop_mbx.uidl_root));
! free(fname);
! }
}


***************
*** 2372,2378 ****
struct folder_info *folder;
KEEP_STATE keep_state_ptr;
{
! char *fname;
int status = 0;

DPRINT(Debug,11,(&Debug,
--- 2381,2387 ----
struct folder_info *folder;
KEEP_STATE keep_state_ptr;
{
! char *str;
int status = 0;

DPRINT(Debug,11,(&Debug,
***************
*** 2397,2405 ****
FreeStreamStack( &(folder -> p->a.pop_mbx.C.stream));
}

! fname = elm_message(FRM("%s/.%s"),folders,folder->cur_folder_sys);
! update_uidls(fname,&(folder -> p->a.pop_mbx.uidl_root));
! free(fname);

clean:
DPRINT(Debug,11,(&Debug,
--- 2406,2418 ----
FreeStreamStack( &(folder -> p->a.pop_mbx.C.stream));


}

! /* give_dt_estr_as_str adds / to end */

! str = give_dt_estr_as_str(&folders_e,"maildir");
! if (str) {
! char * fname = elm_message(FRM("%s.%s"),str,folder->cur_folder_sys);
! update_uidls(fname,&(folder -> p->a.pop_mbx.uidl_root));
! free(fname);
! }

clean:
DPRINT(Debug,11,(&Debug,
Index: elm2.4.ME+.122-cvs/lib/precompiled_sets.c
*** elm2.4.ME+.121/lib/precompiled_sets.c 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/precompiled_sets.c 2005-04-03 14:59:14.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: precompiled_sets.c,v 1.23 2004/03/27 18:31:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: precompiled_sets.c,v 1.100 2005/04/03 11:59:14 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.100 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 20,60 ****

struct charcode_info precompiled_sets[] = {
{ &cs_iso646, &map_invariant, SET_valid, "INVARIANT", NULL, NULL, 29, NULL },
{ &cs_ascii, &map_ascii, SET_valid, "US-ASCII",
INVARIANT, &(sets_iso_8859_X[0]), 3, "ANSI_X3.4-1968" },
{ &cs_ascii, &map_latin1, SET_valid, "ISO-8859-1",
ASCII, &(sets_iso_8859_X[1]), 4, "ISO_8859-1:1987" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-2",
ASCII, &(sets_iso_8859_X[2]), 5, "ISO_8859-2:1987" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-3",
ASCII, &(sets_iso_8859_X[3]), 6, "ISO_8859-3:1988" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-4",
ASCII, &(sets_iso_8859_X[4]), 7, "ISO_8859-4:1988" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-5",
ASCII, &(sets_iso_8859_X[5]), 8, "ISO_8859-5:1988" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-6",
ASCII, &(sets_iso_8859_X[6]), 9, "ISO_8859-6:1987" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-7",
ASCII, &(sets_iso_8859_X[7]), 10, "ISO_8859-7:1987" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-8",
ASCII, &(sets_iso_8859_X[8]), 11, "ISO_8859-8:1988" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-9",
ASCII, &(sets_iso_8859_X[9]), 12, "ISO_8859-9:1989" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-10",
ASCII, &(sets_iso_8859_X[10]), 13, NULL },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-11",
ASCII, &(sets_iso_8859_X[11]), 2259, "TIS-620" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-13",
ASCII, &set_latin7, 109, NULL },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-14", ASCII, &set_latin8, 110, NULL },
{ &cs_ascii, &map_885915, SET_valid, "ISO-8859-15",
ASCII, &set_latin9, 111, NULL },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-16",
ASCII, &set_iso885916, 112, NULL },
{ &cs_ascii, &map_koi8r, SET_valid, "KOI8-R", ASCII, NULL, 2084, NULL },
{ &cs_ascii, &map_koi8u, SET_valid, "KOI8-U", ASCII, NULL, 2088, NULL },
! { &cs_ascii, &map_cp1251, SET_valid, "windows-1251", ASCII, NULL, 2251, NULL },
! { &cs_ascii, &map_cp1252, SET_valid, "windows-1252", LATIN1,NULL, 2252, NULL },
{ &cs_utf8, &map_utf8, SET_valid, "UTF-8", NULL, &set_utf8, 106, NULL },
{ &cs_utf7, &map_utf7, SET_valid, "UTF-7", NULL, NULL, 1012, NULL },

--- 20,89 ----

struct charcode_info precompiled_sets[] = {
{ &cs_iso646, &map_invariant, SET_valid, "INVARIANT", NULL, NULL, 29, NULL },
+
+ /* iso-ir-6 */
{ &cs_ascii, &map_ascii, SET_valid, "US-ASCII",
INVARIANT, &(sets_iso_8859_X[0]), 3, "ANSI_X3.4-1968" },
+
+ /* iso-ir-100 */
{ &cs_ascii, &map_latin1, SET_valid, "ISO-8859-1",
ASCII, &(sets_iso_8859_X[1]), 4, "ISO_8859-1:1987" },
+
+ /* iso-ir-101 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-2",
ASCII, &(sets_iso_8859_X[2]), 5, "ISO_8859-2:1987" },
+
+ /* iso-ir-109 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-3",
ASCII, &(sets_iso_8859_X[3]), 6, "ISO_8859-3:1988" },
+
+ /* iso-ir-110 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-4",
ASCII, &(sets_iso_8859_X[4]), 7, "ISO_8859-4:1988" },
+
+ /* iso-ir-144 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-5",
ASCII, &(sets_iso_8859_X[5]), 8, "ISO_8859-5:1988" },
+
+ /* iso-ir-127 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-6",
ASCII, &(sets_iso_8859_X[6]), 9, "ISO_8859-6:1987" },
+
+ /* iso-ir-126 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-7",
ASCII, &(sets_iso_8859_X[7]), 10, "ISO_8859-7:1987" },
+
+ /* iso-ir-138 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-8",
ASCII, &(sets_iso_8859_X[8]), 11, "ISO_8859-8:1988" },
+
+ /* iso-ir-148 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-9",
ASCII, &(sets_iso_8859_X[9]), 12, "ISO_8859-9:1989" },
+
+ /* iso-ir-157 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-10",
ASCII, &(sets_iso_8859_X[10]), 13, NULL },
+
{ &cs_ascii, NULL, SET_valid, "ISO-8859-11",
ASCII, &(sets_iso_8859_X[11]), 2259, "TIS-620" },
{ &cs_ascii, NULL, SET_valid, "ISO-8859-13",
ASCII, &set_latin7, 109, NULL },
+
+ /* iso-ir-199 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-14", ASCII, &set_latin8, 110, NULL },
+
{ &cs_ascii, &map_885915, SET_valid, "ISO-8859-15",
ASCII, &set_latin9, 111, NULL },
+
+ /* iso-ir-226 */
{ &cs_ascii, NULL, SET_valid, "ISO-8859-16",
ASCII, &set_iso885916, 112, NULL },
+
{ &cs_ascii, &map_koi8r, SET_valid, "KOI8-R", ASCII, NULL, 2084, NULL },
{ &cs_ascii, &map_koi8u, SET_valid, "KOI8-U", ASCII, NULL, 2088, NULL },
! { &cs_ascii, &map_cp1251, SET_valid, "windows-1251", ASCII, NULL, 2251, "CP1251" },
! { &cs_ascii, &map_cp1252, SET_valid, "windows-1252", LATIN1,NULL, 2252, "CP1252" },
{ &cs_utf8, &map_utf8, SET_valid, "UTF-8", NULL, &set_utf8, 106, NULL },
{ &cs_utf7, &map_utf7, SET_valid, "UTF-7", NULL, NULL, 1012, NULL },

***************
*** 79,98 ****

/* Multibyte character set so cs_ascii does not work .... */
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 27, "ISO-10646-UTF-1" },
! { &cs_iso646, NULL, SET_valid, NULL, NULL, NULL,
28, "ISO_646.basic:1983" },
! { &cs_iso646, NULL, SET_valid, "IRV", NULL, NULL, 30, "ISO_646.irv:1983" },
! { &cs_iso646, NULL, SET_valid, "ISO646-GB", NULL, NULL,
20, "BS_4730" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 31, "NATS-SEFI" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 32, "NATS-SEFI-ADD" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 33, "NATS-DANO" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 34, "NATS-DANO-ADD" },
! { &cs_iso646, NULL, SET_valid, "ISO646-FI", NULL, NULL,
35, "SEN_850200_B" },
! { &cs_iso646, NULL, SET_valid, "ISO646-SE2", NULL, NULL,
21, "SEN_850200_C" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 36, "KS_C_5601-1987" },
{ &cs_iso2022, &map_ISO2022_ascii, SET_valid, "ISO-2022-KR", NULL,
&set_ISO2022KR, 37, NULL }, /* RFC 1557 */
{ &cs_euc, &map_EUC_ascii, SET_valid, "EUC-KR", NULL,
--- 108,144 ----

/* Multibyte character set so cs_ascii does not work .... */
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 27, "ISO-10646-UTF-1" },
! { &cs_iso646, NULL, SET_valid, NULL, INVARIANT, NULL,
28, "ISO_646.basic:1983" },
! /* iso-ir-2 */
! { &cs_iso646, NULL, SET_valid, "IRV", INVARIANT, &set_iso_ir_2, 30, "ISO_646.irv:1983" },
!
! /* iso-ir-4 */
! { &cs_iso646, NULL, SET_valid, "ISO646-GB", INVARIANT, &set_iso_ir_4,
20, "BS_4730" },
! /* iso-ir-8-1 */
! { &cs_iso646, NULL, SET_valid, NULL, INVARIANT, &set_iso_ir_8_1, 31, "NATS-SEFI" },
!
! /* iso-ir-8-2 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_8_2, 32, "NATS-SEFI-ADD" },
!
! /* iso-ir-9-1 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_9_1, 33, "NATS-DANO" },
!
! /* iso-ir-9-2 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_9_2, 34, "NATS-DANO-ADD" },
!
! /* iso-ir-10 */
! { &cs_iso646, NULL, SET_valid, "ISO646-FI", INVARIANT, &set_iso_ir_10,
35, "SEN_850200_B" },
!
! /* iso-ir-11 */
! { &cs_iso646, NULL, SET_valid, "ISO646-SE2", INVARIANT, &set_iso_ir_11,
21, "SEN_850200_C" },
!
! /* iso-ir-149 */
! { &cs_iso2022, NULL, SET_valid, NULL, NULL, &set_iso_ir_149, 36, "KS_C_5601-1987" },
!
{ &cs_iso2022, &map_ISO2022_ascii, SET_valid, "ISO-2022-KR", NULL,
&set_ISO2022KR, 37, NULL }, /* RFC 1557 */
{ &cs_euc, &map_EUC_ascii, SET_valid, "EUC-KR", NULL,
***************
*** 105,177 ****
&set_ISO2022CN, 104, NULL }, /* RFC 1922 */
{ &cs_iso2022, &map_ISO2022_ascii, SET_valid, "ISO-2022-CN-EXT", NULL,
&set_ISO2022CNEXT, 105, NULL }, /* RFC 1922 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 41, "JIS_C6220-1969-jp" },
! { &cs_iso646, NULL, SET_valid, "ISO646-JP", NULL, &set_ISO646JP, 42, "JIS_C6220-1969-ro" },
! { &cs_iso646, NULL, SET_valid, "ISO646-IT", NULL, NULL, 22, "IT" },
! { &cs_iso646, NULL, SET_valid, "ISO646-PT", NULL, NULL, 43, "PT" },
! { &cs_iso646, NULL, SET_valid, "ISO646-ES", NULL, NULL, 23, "ES" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 44, "greek7-old" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 45, "latin-greek" },
! { &cs_iso646, NULL, SET_valid, "ISO646-DE", NULL, NULL, 24, "DIN_66003" },
! { &cs_iso646, NULL, SET_valid, "ISO646-FR1", NULL, NULL, 46, "NF_Z_62-010_(1973)" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 47, "Latin-greek-1" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 48, "ISO_5427" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 49, "JIS_C6226-1978" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 50, "BS_viewdata" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 51, "INIS" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 52, "INIS-8" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 53, "INIS-cyrillic" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 54, "ISO_5427:1981" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 55, "ISO_5428:1980" },
! { &cs_iso646, NULL, SET_valid, "ISO646-CN", NULL, NULL, 56, "GB_1988-80" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 57, "GB_2312-80" },
! { &cs_iso646, NULL, SET_valid, "ISO646-NO", NULL, NULL, 25, "NS_4551-1" },
! { &cs_iso646, NULL, SET_valid, "ISO646-NO2", NULL, NULL, 58, "NS_4551-2" },
! { &cs_iso646, NULL, SET_valid, "ISO646-FR", NULL, NULL, 26, "NF_Z_62-010" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 59, "videotex-suppl" },
! { &cs_iso646, NULL, SET_valid, "ISO646-PT2", NULL, NULL, 60, "PT2" },
! { &cs_iso646, NULL, SET_valid, "ISO646-ES2", NULL, NULL, 61, "ES2" },
! { &cs_iso646, NULL, SET_valid, "ISO646-HU", NULL, NULL, 62, "MSZ_7795.3" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 63, "JIS_C6226-1983" },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 64, "greek7" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 65, "ASMO_449" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 66, "iso-ir-90" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 67, "JIS_C6229-1984-a" },
! { &cs_iso646, NULL, SET_valid, "ISO646-JP-OCR-B", NULL, NULL, 68, "JIS_C6229-1984-b" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 69, "JIS_C6229-1984-b-add" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 70, "JIS_C6229-1984-hand" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 71, "JIS_C6229-1984-hand-add" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 72, "JIS_C6229-1984-kana" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 73, "ISO_2033-1983" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 74, "ANSI_X3.110-1983" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 75, "T.61-7bit" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 76, "T.61-8bit" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 77, "ECMA-cyrillic" },
! { &cs_iso646, NULL, SET_valid, "ISO646-CA", NULL, NULL, 78, "CSA_Z243.4-1985-1" },
! { &cs_iso646, NULL, SET_valid, "ISO646-CA2", NULL, NULL, 79, "CSA_Z243.4-1985-2" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 80, "CSA_Z243.4-1985-gr" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 83, "T.101-G2" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 86, "CSN_369103" },
! { &cs_iso646, NULL, SET_valid, "ISO646-YU", NULL, NULL, 87, "JUS_I.B1.002" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 14, "ISO_6937-2-add" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 88, "IEC_P27-1" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 89, "JUS_I.B1.003-serb" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 90, "JUS_I.B1.003-mac" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 91, "greek-ccitt" },
! { &cs_iso646, NULL, SET_valid, "ISO646-CU", NULL, NULL, 92, "NC_NC00-10:81" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 93, "ISO_6937-2-25" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 94, "GOST_19768-74" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 95, "ISO_8859-supp" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 96, "ISO_10367-box" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 97, "latin-lap" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 98, "JIS_X0212-1990" },
! { &cs_iso646, NULL, SET_valid, "ISO646-DK", NULL, NULL, 99, "DS_2089" },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 100, "us-dk" },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 101, "dk-us" },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 15, "JIS_X0201" },
! { &cs_iso646, NULL, SET_valid, "ISO646-KR", NULL, NULL, 102, "KSC5636" },
! { &cs_ascii, NULL, SET_valid, "DEC-MCS", ASCII, NULL, 2008, NULL },
! { &cs_ascii, NULL, SET_valid, "hp-roman8" , ASCII, NULL, 2004, NULL },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 2027, "macintosh" },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 2030, "IBM273" },
{ &cs_ascii, NULL, SET_valid, "CP437", ASCII, NULL, 2011, "IBM437" },
--- 151,347 ----
&set_ISO2022CN, 104, NULL }, /* RFC 1922 */
{ &cs_iso2022, &map_ISO2022_ascii, SET_valid, "ISO-2022-CN-EXT", NULL,
&set_ISO2022CNEXT, 105, NULL }, /* RFC 1922 */
!
! /* iso-ir-13 */
! { &cs_iso2022, NULL, SET_valid, NULL, NULL, &set_iso_ir_13, 41, "JIS_C6220-1969-jp" },
!
! /* iso-ir-14 */
! { &cs_iso646, NULL, SET_valid, "ISO646-JP", INVARIANT, &set_ISO646JP, 42, "JIS_C6220-1969-ro" },
!
! /* iso-ir-15 */
! { &cs_iso646, NULL, SET_valid, "ISO646-IT", INVARIANT, &set_iso_ir_15, 22, "IT" },
!
! /* iso-ir-16 */
! { &cs_iso646, NULL, SET_valid, "ISO646-PT", INVARIANT, &set_iso_ir_16, 43, "PT" },
!
! /* iso-ir-17 */
! { &cs_iso646, NULL, SET_valid, "ISO646-ES", INVARIANT, &set_iso_ir_17, 23, "ES" },
!
! /* iso-ir-18 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_18, 44, "greek7-old" },
!
! /* iso-ir-19 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_19, 45, "latin-greek" },
!
! /* iso-ir-21 */
! { &cs_iso646, NULL, SET_valid, "ISO646-DE", INVARIANT, &set_iso_ir_21, 24, "DIN_66003" },
!
! /* iso-ir-25 */
! { &cs_iso646, NULL, SET_valid, "ISO646-FR1", INVARIANT, &set_iso_ir_25, 46, "NF_Z_62-010_(1973)" },
!
! /* iso-ir-27 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_27, 47, "Latin-greek-1" },
!
! /* iso-ir-37 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_37, 48, "ISO_5427" },
!
!
! /* iso-ir-42 */
! { &cs_iso2022, NULL, SET_valid, NULL, NULL, &set_iso_ir_42, 49, "JIS_C6226-1978" },
!
! /* iso-ir-47 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_47, 50, "BS_viewdata" },
!
! /* iso-ir-49 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_49, 51, "INIS" },
!
! /* iso-ir-50 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_50, 52, "INIS-8" },
!
! /* iso-ir-51 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_51, 53, "INIS-cyrillic" },
!
! /* iso-ir-54 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_54, 54, "ISO_5427:1981" },
!
! /* iso-ir-55 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_55, 55, "ISO_5428:1980" },
!
! /* iso-ir-57 */
! { &cs_iso646, NULL, SET_valid, "ISO646-CN", INVARIANT, &set_iso_ir_57, 56, "GB_1988-80" },
!
! /* iso-ir-58 */
! { &cs_iso2022, NULL, SET_valid, NULL, NULL, &set_iso_ir_58, 57, "GB_2312-80" },
!
! /* iso-ir-60 */
! { &cs_iso646, NULL, SET_valid, "ISO646-NO", INVARIANT, &set_iso_ir_60, 25, "NS_4551-1" },
!
! /* iso-ir-61 */
! { &cs_iso646, NULL, SET_valid, "ISO646-NO2", INVARIANT, &set_iso_ir_61, 58, "NS_4551-2" },
!
! /* iso-ir-69 */
! { &cs_iso646, NULL, SET_valid, "ISO646-FR", INVARIANT, &set_iso_ir_69, 26, "NF_Z_62-010" },
!
! /* iso-ir-70 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_70, 59, "videotex-suppl" },
!
! /* iso-ir-84 */
! { &cs_iso646, NULL, SET_valid, "ISO646-PT2", INVARIANT, &set_iso_ir_84, 60, "PT2" },
!
! /* iso-ir-85 */
! { &cs_iso646, NULL, SET_valid, "ISO646-ES2", INVARIANT, &set_iso_ir_85, 61, "ES2" },
!
! /* iso-ir-86 */
! { &cs_iso646, NULL, SET_valid, "ISO646-HU", INVARIANT, &set_iso_ir_86, 62, "MSZ_7795.3" },
!
! /* iso-ir-87 */
! { &cs_iso2022, NULL, SET_valid, NULL, NULL, &set_iso_ir_87, 63, "JIS_C6226-1983" },
!
! /* iso-ir-88 */
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 64, "greek7" },
!
! /* iso-ir-89 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_89, 65, "ASMO_449" },
!
! /* iso-ir-90 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_90, 66, "iso-ir-90" },
!
! /* iso-ir-91 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_91, 67, "JIS_C6229-1984-a" },
!
! /* iso-ir-92 */
! { &cs_iso646, NULL, SET_valid, "ISO646-JP-OCR-B", INVARIANT,
! &set_iso_ir_92, 68, "JIS_C6229-1984-b" },
!
! /* iso-ir-93 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_93, 69, "JIS_C6229-1984-b-add" },
!
! /* iso-ir-94 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_94, 70, "JIS_C6229-1984-hand" },
!
! /* iso-ir-95 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_95, 71, "JIS_C6229-1984-hand-add" },
!
! /* iso-ir-96 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_96, 72, "JIS_C6229-1984-kana" },
!
! /* iso-ir-98 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_98, 73, "ISO_2033-1983" },
!
! /* iso-ir-99 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_99, 74, "ANSI_X3.110-1983" },
!
! /* iso-ir-102 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_102, 75, "T.61-7bit" },
!
! /* iso-ir-103 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_103, 76, "T.61-8bit" },
!
! /* iso-ir-111 */
! { &cs_ascii, NULL, SET_valid, "KOI8-E", NULL, &set_koi8e, 77, "ECMA-cyrillic" },
!
! /* iso-ir-121 */
! { &cs_iso646, NULL, SET_valid, "ISO646-CA", INVARIANT, &set_iso_ir_121, 78, "CSA_Z243.4-1985-1" },
!
! /* iso-ir-122 */
! { &cs_iso646, NULL, SET_valid, "ISO646-CA2", INVARIANT, &set_iso_ir_122, 79, "CSA_Z243.4-1985-2" },
!
! /* iso-ir-123 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_123, 80, "CSA_Z243.4-1985-gr" },
!
! /* iso-ir-128 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_128, 83, "T.101-G2" },
!
! /* iso-ir-139 */
! { &cs_ascii, NULL, SET_valid, NULL, ASCII, &set_iso_ir_139, 86, "CSN_369103" },
!
! /* iso-ir-141 */
! { &cs_iso646, NULL, SET_valid, "ISO646-YU", INVARIANT, &set_iso_ir_141, 87, "JUS_I.B1.002" },
!
! /* iso-ir-142 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_142, 14, "ISO_6937-2-add" },
!
! /* iso-ir-143 */
! { &cs_ascii, NULL, SET_valid, NULL, ASCII, &set_iso_ir_143, 88, "IEC_P27-1" },
!
! /* iso-ir-146 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_146, 89, "JUS_I.B1.003-serb" },
!
! /* iso-ir-147 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_147, 90, "JUS_I.B1.003-mac" },
!
! /* iso-ir-150 */
! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_150, 91, "greek-ccitt" },
!
! /* iso-ir-151 */
! { &cs_iso646, NULL, SET_valid, "ISO646-CU", INVARIANT,
! &set_iso_ir_151, 92, "NC_NC00-10:81" },
!
! /* iso-ir-152 */
! { &cs_ascii, NULL, SET_valid, NULL, ASCII, &set_iso_ir_152, 93, "ISO_6937-2-25" },
!
! /* iso-ir-153 */
! { &cs_ascii, NULL, SET_valid, NULL, ASCII, &set_iso_ir_153, 94, "GOST_19768-74" },
!
! /* iso-ir-154 */
! { &cs_ascii, NULL, SET_valid, NULL, ASCII, &set_iso_ir_154, 95, "ISO_8859-supp" },
!
! /* iso-ir-155 */
! { &cs_ascii, NULL, SET_valid, NULL, ASCII, &set_iso_ir_155, 96, "ISO_10367-box" },
!
! /* iso-ir-158 */
! { &cs_ascii, NULL, SET_valid, NULL, ASCII, &set_iso_ir_158, 97, "latin-lap" },
!
! /* iso-ir-159 */
! { &cs_iso2022, NULL, SET_valid, NULL, NULL, &set_iso_ir_159, 98, "JIS_X0212-1990" },
!
! { &cs_iso646, NULL, SET_valid, "ISO646-DK", INVARIANT, NULL, 99, "DS_2089" },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 100, "us-dk" },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 101, "dk-us" },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 15, "JIS_X0201" },
! { &cs_iso646, NULL, SET_valid, "ISO646-KR", INVARIANT, NULL, 102, "KSC5636" },
! { &cs_ascii, NULL, SET_valid, "DEC-MCS", ASCII, NULL, 2008, NULL },
! { &cs_ascii, NULL, SET_valid, "hp-roman8" , ASCII, NULL, 2004, NULL },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 2027, "macintosh" },
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 2030, "IBM273" },
{ &cs_ascii, NULL, SET_valid, "CP437", ASCII, NULL, 2011, "IBM437" },
***************
*** 234,244 ****
{ &cs_ascii, NULL, SET_valid, "windows-1250", ASCII, NULL, 2250, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1253", ASCII, NULL, 2253, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1254", ASCII ,NULL, 2254, NULL },
! { &cs_ascii, NULL, SET_valid, "windows-1255", ASCII ,NULL, 2255, NULL },
! { &cs_ascii, NULL, SET_valid, "windows-1256", ASCII ,NULL, 2256, NULL },
! { &cs_ascii, NULL, SET_valid, "windows-1257", ASCII ,NULL, 2257, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1258", ASCII ,NULL, 2258, NULL },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 2085, "HZ-GB-2312" },

/* How this compares to windows-1252 ... ?? */
{ &cs_ascii, NULL, SET_valid, NULL, LATIN1, NULL, 2000, "ISO-8859-1-Windows-3.0-Latin-1" },
--- 404,414 ----
{ &cs_ascii, NULL, SET_valid, "windows-1250", ASCII, NULL, 2250, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1253", ASCII, NULL, 2253, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1254", ASCII ,NULL, 2254, NULL },
! { &cs_ascii, NULL, SET_valid, "windows-1255", ASCII ,NULL, 2255, "CP1255" },
! { &cs_ascii, NULL, SET_valid, "windows-1256", ASCII ,NULL, 2256, "CP1256" },
! { &cs_ascii, NULL, SET_valid, "windows-1257", ASCII ,NULL, 2257, "CP1257" },
{ &cs_ascii, NULL, SET_valid, "windows-1258", ASCII ,NULL, 2258, NULL },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 2085, "HZ-GB-2312" },

/* How this compares to windows-1252 ... ?? */
{ &cs_ascii, NULL, SET_valid, NULL, LATIN1, NULL, 2000, "ISO-8859-1-Windows-3.0-Latin-1" },
Index: elm2.4.ME+.122-cvs/lib/rc_delay.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/lib/rc_delay.c 2005-07-06 12:41:48.000000000 +0300
***************
*** 0 ****
--- 1,462 ----
+ static char rcsid[] = "@(#)$Id: rc_delay.c,v 1.4 2005/07/06 09:41:48 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ * or Kari Hurtta <e...@elmme-mailer.org>

+ *****************************************************************************/
+
+ #include "headers.h"

+ #include "rc_imp.h"
+ #include "save_opts.h"
+

+ DEBUG_VAR(Debug,__FILE__,"config");
+

+ enum xx { line_normal, line_negate, line_continue };
+
+ struct rec1 {
+ int lcl;
+ char *value;

+ int lineno;
+ char *filename;

+ enum xx negate_continue;
+ };
+
+ static void replay_rec P_((struct rec1 *rec,
+ struct rc_save_info_rec * real));
+ static void replay_rec(rec,real)
+ struct rec1 *rec;
+ struct rc_save_info_rec * real;
+ {
+ switch (rec->negate_continue) {
+
+ case line_normal:
+ rc_eval_tail(real,rec->lcl,rec->value,rec->lineno,rec->filename,0);
+ break;
+
+ case line_negate:
+ rc_eval_tail(real,rec->lcl,rec->value,rec->lineno,rec->filename,1);
+ break;
+
+ case line_continue:
+
+ if (RCTYPE_magic != real->dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"replay_rec",


+ "Bad config item type",0);
+

+ real->dt_type->parse_cline(real,rec->lcl,rec->value,rec->lineno,
+ rec->filename);


+ break;
+ }
+ }
+

+ static struct rc_save {
+ struct rc_save_info_rec * real;
+ struct rc_save_info_rec * delayed;
+
+ struct rec1 * lines;
+ int line_count;
+
+ struct rc_save * next;
+ } * root = NULL;
+
+ void mark_delayed_changed(A)
+ void *A;
+ {
+ struct rc_save *x;
+
+ for (x = root; x; x = x->next) {
+ if (x->real && x->real->val.dummy == A) {
+
+ DPRINT(Debug,10,(&Debug,
+ "mark_delayed_changed: %p: %p\n",
+ x,A));
+
+ mark_XX(x->real);
+
+ if (x->delayed)
+ mark_XX(x->delayed);
+ else {
+ DPRINT(Debug,10,(&Debug,
+ "mark_delayed_changed: %p: %p -- no delayed registered\n",
+ x,A));


+
+ }
+
+ }
+ }

+
+ }
+
+ void mark_fdelayed_changed(A)
+ option_func *A;
+ {
+ struct rc_save *x;
+
+ for (x = root; x; x = x->next) {
+ if (x->real && x->real->func_val == A) {
+
+ DPRINT(Debug,10,(&Debug,
+ "mark_fdelayed_changed: %p: %p\n",
+ x,A));
+
+ mark_XX(x->real);
+
+ if (x->delayed)
+ mark_XX(x->delayed);
+ else {
+ DPRINT(Debug,10,(&Debug,
+ "mark_fdelayed_changed: %p: %p -- no delayed registered\n",
+ x,A));

+ }
+ }
+ }
+
+ }
+
+
+

+ static struct rc_save * new_record P_((void));
+ static struct rc_save * new_record()
+ {
+ struct rc_save * x = safe_malloc(sizeof (*x));
+
+ bzero((void *)x,sizeof (*x));
+
+ x->real = NULL;
+ x->delayed = NULL;
+
+ x->next = root;
+ root = x;
+
+ return x;
+ }
+
+ static void replay_saved P_((struct rc_save *p));
+ static void replay_saved(p)
+ struct rc_save *p;


+ {
+ int i;
+

+ for (i = 0; i < p->line_count; i++) {
+ replay_rec(& (p->lines[i]), p->real);
+ }
+
+ for (i = 0; i < p->line_count; i++) {
+ if (p->lines[i].value)
+ free(p->lines[i].value);
+ p->lines[i].value = NULL;
+
+ if (p->lines[i].filename)
+ free(p->lines[i].filename);
+ p->lines[i].filename = NULL;
+ }
+
+ if (p->lines)
+ free(p->lines);
+ p->lines = NULL;
+ p->line_count = 0;
+ }
+
+ static void add_delayed P_((struct rc_save *p));
+ static void add_delayed(p)
+ struct rc_save *p;
+ {
+ int x;
+

+ for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {

+ if (0 == strcmp(save_info[x].name,p->real->name)) {
+
+ if (save_info[x].dt_type != &rc_DT_DELAY)
+ panic("RC PANIC",__FILE__,__LINE__,"add_delayed",
+ "Option is not delayed",0);
+
+ p->delayed = & (save_info[x]);
+ return;
+ }
+
+ }
+
+ panic("RC PANIC",__FILE__,__LINE__,"add_delayed",
+ "Deleayed option not found",0);
+ }
+
+ static void register_delayed1 P_((struct rc_save_info_rec *option_real));
+ static void register_delayed1(option_real)
+ struct rc_save_info_rec *option_real;
+ {
+ struct rc_save *p;
+
+ for (p = root; p; p = p->next) {
+ if (option_real == p->real)
+ panic("RC PANIC",__FILE__,__LINE__,"register_delayed1",
+ "Duplicate registeration",0);
+ if (p->delayed &&
+ 0 == strcmp(option_real->name,p->delayed->name)) {
+
+ if (p->real)
+ panic("RC PANIC",__FILE__,__LINE__,"register_delayed1",
+ "Duplicate name",0);
+ p->real = option_real;
+
+ replay_saved(p);
+
+ return;
+ }
+ }
+ p = new_record();
+ p->real = option_real;
+
+ add_delayed(p);
+ }
+
+
+ void register_delayed(rc_options,rc_option_count)
+ struct rc_save_info_rec * rc_options;
+ int rc_option_count;


+ {
+ int i;
+

+ for (i = 0; i < rc_option_count; i++) {
+ register_delayed1(& (rc_options[i]) );
+ }
+ }
+
+ static struct rc_save * register_delayed2 P_((struct rc_save_info_rec *option_proxy));
+ static struct rc_save * register_delayed2(option_proxy)
+ struct rc_save_info_rec *option_proxy;
+ {
+ struct rc_save *p;
+
+ for (p = root; p; p = p->next) {
+ if (option_proxy == p->delayed)
+ return p;
+
+ if (p->real &&
+ 0 == strcmp(option_proxy->name,p->real->name)) {
+
+ if (p->delayed)
+ panic("RC PANIC",__FILE__,__LINE__,"register_delayed2",
+ "Duplicate name",0);
+ p->delayed = option_proxy;
+
+ return p;
+ }
+ }
+
+ p = new_record();
+ p->delayed = option_proxy;
+
+ return p;


+ }
+
+ #ifdef ANSI_C

+ static rc_parse_line dt_DELAY_parse_line;
+ #endif
+ static int dt_DELAY_parse_line(r,lcl,value,lineno,filename, negate)
+ struct rc_save_info_rec *r;
+ int lcl;
+ char *value;

+ int lineno;
+ char *filename;

+ int negate;
+ {
+ int ret = 1;
+ struct rc_save *p = register_delayed2(r);
+
+ if (p->real && p->line_count)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_parse_line",


+ "Bad state",0);
+

+ if (p->real) {
+
+ ret = rc_eval_tail(p->real,lcl,value,lineno,filename,negate);
+
+ } else {
+
+ p->lines = safe_realloc(p->lines,
+ (p->line_count + 1) * sizeof (p->lines[0]));
+
+ bzero((void *)& (p->lines[p->line_count]),
+ sizeof (p->lines[p->line_count]) );
+
+ p->lines[p->line_count].lcl = lcl;
+ p->lines[p->line_count].value = safe_strdup(value);
+ p->lines[p->line_count].lineno = lineno;
+ p->lines[p->line_count].filename = safe_strdup(filename);
+ p->lines[p->line_count].negate_continue = negate ?
+ line_negate : line_normal;
+
+ p->line_count++;
+ ret = 1;
+
+ }


+ return ret;
+ }
+

+ #ifdef ANSI_C
+ static rc_parse_cline dt_DELAY_parse_cline;
+ #endif
+ static int dt_DELAY_parse_cline(r,lcl,value,lineno,filename)
+ struct rc_save_info_rec *r;
+ int lcl;
+ char *value;

+ int lineno;
+ char *filename;

+ {
+ int ret = 1;
+ struct rc_save *p = register_delayed2(r);
+
+ if (p->real && p->line_count)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_parse_cline",


+ "Bad state",0);
+

+ if (p->real) {
+
+ if (RCTYPE_magic != p->real->dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_parse_cline",


+ "Bad config item type",0);
+
+

+ ret = p->real->dt_type->parse_cline(p->real,lcl,value,lineno,
+ filename);
+
+ } else {
+
+ if (!p->line_count)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_parse_cline",


+ "Bad state",0);
+
+

+ p->lines = safe_realloc(p->lines,
+ (p->line_count + 1) * sizeof (p->lines[0]));
+
+ bzero((void *)& (p->lines[p->line_count]),
+ sizeof (p->lines[p->line_count]) );
+
+ p->lines[p->line_count].lcl = lcl;
+ p->lines[p->line_count].value = safe_strdup(value);
+ p->lines[p->line_count].lineno = lineno;
+ p->lines[p->line_count].filename = safe_strdup(filename);
+ p->lines[p->line_count].negate_continue = line_continue;
+
+ p->line_count++;
+ ret = 1;
+
+ }


+ return ret;
+
+ }
+

+ #if ANSI_C
+ static rc_print_value dt_DELAY_print_value;
+ #endif
+ static void dt_DELAY_print_value(F,r,comment)
+ FILE *F;
+ struct rc_save_info_rec *r;
+ int comment;
+ {
+ struct rc_save *p = register_delayed2(r);
+
+ if (p->real && p->line_count)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_print_value",


+ "Bad state",0);
+

+ if (p->real) {
+
+ if (RCTYPE_magic != p->real->dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_print_value",


+ "Bad config item type",0);
+
+

+ p->real->dt_type->print_value(F,p->real,comment);
+
+ } else if (p->line_count) {
+ int i,start = 0;
+
+ for (i = 0; i < p->line_count; i++) {
+ if (line_normal == p->lines[i].negate_continue)
+ start = i;
+ }
+
+ for (i = start; i < p->line_count; i++) {
+
+ if (comment)
+ fprintf(F, "### ");
+
+ switch (p->lines[i].negate_continue) {
+ case line_normal:
+ fprintf(F, "%s = %s\n", r->name, p->lines[i].value);
+
+ break;
+
+ case line_continue:
+ if (0 == i)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_print_value",


+ "Bad state",0);
+

+ fprintf(F, "\t%s\n", p->lines[i].value);
+
+ break;
+
+ case line_negate:
+ /* unsupported */
+ fprintf(F, "# !%s = %s\n", r->name, p->lines[i].value);


+ break;
+ }
+ }
+

+ }
+ }
+
+ #if ANSI_C
+ static rc_get_value dt_DELAY_get_value;
+ #endif
+ static char * dt_DELAY_get_value(r)
+ struct rc_save_info_rec *r;
+ {
+ struct rc_save *p = register_delayed2(r);
+
+ if (p->real && p->line_count)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_get_value",


+ "Bad state",0);
+

+ if (p->real) {
+
+ if (RCTYPE_magic != p->real->dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_get_value",


+ "Bad config item type",0);
+

+ return p->real->dt_type->get_value(p->real);
+ } else if (p->line_count) {
+
+ int i,start = 0;
+
+ for (i = 0; i < p->line_count; i++) {
+ if (line_normal == p->lines[i].negate_continue)
+ start = i;
+ }
+
+ if (start == p->line_count-1 &&
+ line_normal == p->lines[start].negate_continue)
+ return p->lines[start].value;
+ }
+
+
+ return "*bad*";
+ }
+
+
+
+ struct rc_type rc_DT_DELAY = { RCTYPE_magic,
+ dt_DELAY_parse_line, dt_DELAY_parse_cline,
+ dt_DELAY_print_value, dt_DELAY_get_value };


+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/lib/rc_handle.c
*** elm2.4.ME+.121/lib/rc_handle.c 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/rc_handle.c 2005-05-05 12:59:12.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.30 2004/09/13 11:44:23 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.36 2005/05/05 09:59:12 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

***************
*** 26,38 ****
#ifdef ANSI_C
static rc_parse_line dt_SYN_parse_line;
#endif
! static int dt_SYN_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

! int e_val;
{
if (negate) {
char buffer[SLEN];
--- 26,38 ----
#ifdef ANSI_C
static rc_parse_line dt_SYN_parse_line;
#endif
! static int dt_SYN_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

! int negate;
{
if (negate) {
char buffer[SLEN];
***************
*** 93,105 ****
#ifdef ANSI_C
static rc_parse_line dt_STR_parse_line;
#endif
! static int dt_STR_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 93,104 ----
#ifdef ANSI_C
static rc_parse_line dt_STR_parse_line;
#endif
! static int dt_STR_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 178,190 ****
#ifdef ANSI_C
static rc_parse_line dt_NUM_parse_line;
#endif
! static int dt_NUM_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
char *p;
--- 177,188 ----
#ifdef ANSI_C
static rc_parse_line dt_NUM_parse_line;
#endif
! static int dt_NUM_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
char *p;
***************
*** 197,206 ****
return 0;
}

! if (r->e_ptr && (e_val || *p || l < 0)) {
! *(r->val.num) = e_val;
! } else
! *(r->val.num) = l;

return 1;
}
--- 195,201 ----
return 0;
}

! *(r->val.num) = l;

return 1;
}
***************
*** 216,240 ****
if (comment)
fprintf(F, "### ");

! if (r->e_ptr &&
! *r->val.num >= 0 &&
! *r->val.num < r->e_ptr->nlen) {
!
! char * s = r->e_ptr->list[*r->val.num];
! fprintf(F, "%s = %s\n", r->name, s);
!
! DPRINT(Debug,9,(&Debug,
! " option \"%s\", value=\"%s\"\n",
! r->name,s ));
!
! } else {
! fprintf(F, "%s = %d\n", r->name,
! *r->val.num);

! DPRINT(Debug,9,(&Debug,
! " option \"%s\", value=%d\n",
! r->name,*r->val.num ));
! }
}

/* Returns static pointer */
--- 211,222 ----
if (comment)
fprintf(F, "### ");

! fprintf(F, "%s = %d\n", r->name,
! *r->val.num);

! DPRINT(Debug,9,(&Debug,
! " option \"%s\", value=%d\n",
! r->name,*r->val.num ));
}

/* Returns static pointer */
***************
*** 246,258 ****
{
static char * buffer = NULL;

- if (r->e_ptr &&
- *r->val.num >= 0 &&
- *r->val.num < r->e_ptr->nlen)
- return r->e_ptr->list[*r->val.num];
-
if (buffer)
free(buffer);
buffer = elm_message(FRM("%d"), *r->val.num);

return buffer;
--- 228,236 ----
{
static char * buffer = NULL;

if (buffer)
free(buffer);
+
buffer = elm_message(FRM("%d"), *r->val.num);

return buffer;
***************
*** 266,278 ****
#ifdef ANSI_C
static rc_parse_line dt_BOL_parse_line;
#endif
! static int dt_BOL_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 244,255 ----
#ifdef ANSI_C
static rc_parse_line dt_BOL_parse_line;
#endif
! static int dt_BOL_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 330,342 ****
#ifdef ANSI_C
static rc_parse_line dt_CHR_parse_line;
#endif
! static int dt_CHR_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 307,318 ----
#ifdef ANSI_C
static rc_parse_line dt_CHR_parse_line;
#endif
! static int dt_CHR_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 386,421 ****
dt_CHR_parse_line, BAD_parse_cline,
dt_CHR_print_value, dt_CHR_get_value };

- static struct {
- char *kw;
- int sv;
- } SRT_srtval[]={
- {"sent", SENT_DATE},
- {"thread", THREAD},
- {"received", RECEIVED_DATE},
- {"recieved", RECEIVED_DATE},
- {"rec", RECEIVED_DATE},
- {"from", SENDER},
- {"sender", SENDER},
- {"size", SIZE},
- {"lines", SIZE},
- {"subject", SUBJECT},
- {"mailbox", MAILBOX_ORDER},
- {"folder", MAILBOX_ORDER},
- {"status", STATUS},
- {NULL, 0}
- };
-
#ifdef ANSI_C
! static rc_parse_line dt_SRT_parse_line;
#endif
! static int dt_SRT_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
char buffer[SLEN];
--- 362,376 ----
dt_CHR_parse_line, BAD_parse_cline,
dt_CHR_print_value, dt_CHR_get_value };

#ifdef ANSI_C
! static rc_parse_line dt_SORT_parse_line;
#endif
! static int dt_SORT_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
char buffer[SLEN];
***************
*** 434,445 ****
if (negate)
f = -f;

! for (y= 0; SRT_srtval[y].kw; y++) {
! if (equal(s, SRT_srtval[y].kw))
break;
}
! if (SRT_srtval[y].kw) {
! *(r->val.sort) = f > 0 ? SRT_srtval[y].sv : -SRT_srtval[y].sv;
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmBadSortKeyInElmrc,
--- 389,402 ----
if (negate)
f = -f;

! for (y= 0; r->val.sort->sortval[y].kw; y++) {
! if (equal(s, r->val.sort->sortval[y].kw))
break;
}
! if (r->val.sort->sortval[y].kw) {
! r->val.sort->val = f > 0 ?
! r->val.sort->sortval[y].sv :
! - r->val.sort->sortval[y].sv;
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmBadSortKeyInElmrc,
***************
*** 450,483 ****
return 1;
}

! #if ANSI_C
! static rc_get_value dt_SRT_get_value;
! #endif
! static char * dt_SRT_get_value(r)
! struct rc_save_info_rec *r;
{
int y;

! for (y= 0; SRT_srtval[y].kw; y++) {
! if (SRT_srtval[y].sv == *(r->val.sort))
! return SRT_srtval[y].kw;
! else if (SRT_srtval[y].sv == - *(r->val.sort)) {

static char * buffer = NULL;

buffer = strmcpy(buffer,"reverse-");
! buffer = strmcat(buffer, SRT_srtval[y].kw);

return buffer;
}
}
return "*bad*";
}

#if ANSI_C
! static rc_print_value dt_SRT_print_value;
#endif
! static void dt_SRT_print_value(F,r,comment)
FILE *F;
struct rc_save_info_rec *r;
int comment;
--- 407,467 ----
return 1;
}

! static char * give_sort_value P_((struct dt_sort_info *ptr));
! static char * give_sort_value(ptr)
! struct dt_sort_info *ptr;
{
int y;

! for (y= 0; ptr->sortval[y].kw; y++) {
! if (ptr->sortval[y].sv == ptr->val)
! return ptr->sortval[y].kw;
! else if (ptr->sortval[y].sv == - ptr->val) {

static char * buffer = NULL;

buffer = strmcpy(buffer,"reverse-");
! buffer = strmcat(buffer, ptr->sortval[y].kw);

return buffer;
}
}
return "*bad*";
+
}

#if ANSI_C
! static rc_get_value dt_SORT_get_value;
#endif
! static char * dt_SORT_get_value(r)
! struct rc_save_info_rec *r;
! {
! return give_sort_value(r->val.sort);
! }
!
! CONST char * give_dt_sort_as_str(ptr)
! struct dt_sort_info *ptr;
! {
! return give_sort_value(ptr);
! }
!
! int give_dt_sort_as_int(ptr)
! struct dt_sort_info *ptr;
! {
! return ptr->val;
! }
!
! void set_dt_sort_as_int(ptr,val)
! struct dt_sort_info *ptr;
! int val;
! {
! ptr->val = val;


! }
!
! #if ANSI_C

! static rc_print_value dt_SORT_print_value;
! #endif
! static void dt_SORT_print_value(F,r,comment)
FILE *F;
struct rc_save_info_rec *r;
int comment;
***************
*** 486,508 ****
fprintf(F, "### ");

fprintf(F, "%s = %s\n", r->name,
! dt_SRT_get_value(r));
}

! struct rc_type rc_DT_SRT = { RCTYPE_magic,
! dt_SRT_parse_line, BAD_parse_cline,
! dt_SRT_print_value, dt_SRT_get_value };

#ifdef ANSI_C
static rc_parse_line dt_MLT_parse_line;
#endif
! static int dt_MLT_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
int ok = 1;
--- 470,491 ----
fprintf(F, "### ");

fprintf(F, "%s = %s\n", r->name,
! dt_SORT_get_value(r));
}

! struct rc_type rc_DT_SORT = { RCTYPE_magic,
! dt_SORT_parse_line, BAD_parse_cline,
! dt_SORT_print_value, dt_SORT_get_value };

#ifdef ANSI_C
static rc_parse_line dt_MLT_parse_line;
#endif
! static int dt_MLT_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
int ok = 1;
***************
*** 527,640 ****
dt_MLT_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };

- static struct {
- char *kw;
- int sv;
- } ASR_srtval[]={
- {"alias", ALIAS_SORT},
- {"name", NAME_SORT},
- {"text", TEXT_SORT},
- {NULL, 0}
- };
-
- #ifdef ANSI_C
- static rc_parse_line dt_ASR_parse_line;
- #endif
- static int dt_ASR_parse_line(r,lcl,value,lineno,filename, e_val, negate)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;
- char *filename;
- int e_val;
- int negate;
- {
- char buffer[SLEN];
- char *s = buffer;
- int f, y;
-
- f = 1;
- strfcpy(buffer, shift_lower(value), sizeof buffer);
-
- if (strncmp(s, "rev-", 4) == 0 ||
- strncmp(s, "reverse-", 8) == 0) {
- f = -f;
- s = index(s, '-') + 1;
- }
-
- if (negate)
- f = -f;
-
- for (y= 0; ASR_srtval[y].kw; y++) {
- if (equal(s, ASR_srtval[y].kw))
- break;
- }
- if (ASR_srtval[y].kw) {
- *(r->val.sort) = f > 0 ? ASR_srtval[y].sv : -ASR_srtval[y].sv;


- } else {
- lib_error(CATGETS(elm_msg_cat, ElmSet,

- ElmBadAliasSortInElmrc,
- "I can't understand alias sort key \"%s\" in line %d in \"%s\" file"),
- value, lineno,filename);


- return 0;
- }
-

- return 1;


- }
-
- #if ANSI_C

- static rc_get_value dt_ASR_get_value;
- #endif
- static char * dt_ASR_get_value(r)
- struct rc_save_info_rec *r;
- {
- int y;
-
- for (y= 0; ASR_srtval[y].kw; y++) {
- if (ASR_srtval[y].sv == *(r->val.sort))
- return ASR_srtval[y].kw;
- else if (ASR_srtval[y].sv == - *(r->val.sort)) {
-
- static char * buffer = NULL;
-
- buffer = strmcpy(buffer,"reverse-");
- buffer = strmcat(buffer, ASR_srtval[y].kw);
-
- return buffer;
- }
- }
- return "*bad*";


- }
-
-
- #if ANSI_C

- static rc_print_value dt_ASR_print_value;
- #endif
- static void dt_ASR_print_value(F,r,comment)
- FILE *F;
- struct rc_save_info_rec *r;
- int comment;
- {
- if (comment)
- fprintf(F, "### ");
-
- fprintf(F, "%s = %s\n", r->name, dt_ASR_get_value(r));
- }
-
- struct rc_type rc_DT_ASR = { RCTYPE_magic,
- dt_ASR_parse_line, BAD_parse_cline,
- dt_ASR_print_value, dt_ASR_get_value };
-
#ifdef ANSI_C
static rc_parse_line dt_PRM_parse_line;
#endif
! static int dt_PRM_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
char *s = value;
--- 510,524 ----
dt_MLT_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };

#ifdef ANSI_C
static rc_parse_line dt_PRM_parse_line;
#endif
! static int dt_PRM_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
char *s = value;
***************
*** 707,719 ****
#ifdef ANSI_C
static rc_parse_line dt_FUNC_parse_line;
#endif
! static int dt_FUNC_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 591,602 ----
#ifdef ANSI_C
static rc_parse_line dt_FUNC_parse_line;
#endif
! static int dt_FUNC_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 773,785 ****
#ifdef ANSI_C
static rc_parse_line dt_LONG_parse_line;
#endif
! static int dt_LONG_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
char *p;
--- 656,667 ----
#ifdef ANSI_C
static rc_parse_line dt_LONG_parse_line;
#endif
! static int dt_LONG_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
char *p;
***************
*** 832,902 ****
dt_LONG_parse_line, BAD_parse_cline,
dt_LONG_print_value, dt_LONG_get_value };

- #ifdef USE_PGP
-
- #ifdef ANSI_C
- static rc_parse_line dt_PGPVER_parse_line;
- #endif
- static int dt_PGPVER_parse_line(r,lcl,value,lineno,filename, e_val, negate)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;
- char *filename;
- int e_val;
- int negate;
- {
- if (negate) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadNegate,
- "!%s is not supported in line %d in \"%s\" file"),
- r->name,lineno,filename);


- return 0;
- }
-

- * (r->val.pgpver) = (enum pgp_version) e_val;


-
- return 1;
- }
-

- #if ANSI_C
- static rc_print_value dt_PGPVER_print_value;
- #endif
- static void dt_PGPVER_print_value(F,r,comment)
- FILE *F;
- struct rc_save_info_rec *r;
- int comment;
- {
- if (r->e_ptr &&
- *(r->val.pgpver) >= 0 &&
- *(r->val.pgpver) <= r->e_ptr->nlen) {
- char * s = r->e_ptr->list[*(r->val.pgpver)];
-
- if (comment)
- fprintf(F, "### ");
-
- fprintf(F, "%s = %s\n", r->name, s);


- }
- }
-
- #if ANSI_C

- static rc_get_value dt_PGPVER_get_value;
- #endif
- static char * dt_PGPVER_get_value(r)
- struct rc_save_info_rec *r;
- {
- if (r->e_ptr &&
- *(r->val.pgpver) >= 0 &&
- *(r->val.pgpver) <= r->e_ptr->nlen) {
- return r->e_ptr->list[*(r->val.pgpver)];
- }
- return "*bad*";
- }
-
- struct rc_type rc_DT_PGPVER = { RCTYPE_magic,
- dt_PGPVER_parse_line, BAD_parse_cline,
- dt_PGPVER_print_value, dt_PGPVER_get_value };
- #endif
-

/* Appends expanded value to list
0 == failure
--- 714,719 ----
***************
*** 929,934 ****
--- 746,763 ----


if (!recursive) {
DPRINT(Debug,8,(&Debug, "expand_dt_path: %s: %s\n",
fieldname,val));

+

+ if (0 == strcmp(val,"none") && 0 == ptr->nlen) {
+
+ /* Set dummy value indicating none ... */
+ ptr->list = safe_realloc(ptr->list,sizeof (ptr->list[0]));
+ ptr->list[0] = NULL;

+ ptr->nlen = 0;
+

+ return ret;
+ }
+
+
} else {
DPRINT(Debug,11,(&Debug, "expand_dt_path: %s: %s (recursive=%d)\n",
fieldname,val,recursive));
***************
*** 1277,1282 ****

--- 1106,1121 ----


if (!ptr->list)
return NULL;

+ if (ptr->list && 0 == ptr->nlen) {
+ res = safe_strdup("none");
+
+ DPRINT(Debug,9,(&Debug,
+ "give_dt_path_as_str=%s\n",res));
+
+ return res;

+ }
+
+

for (i = 0; i < ptr->nlen; i++)
L += strlen(ptr->list[i]) +1;

***************

*** 1325,1337 ****
static rc_parse_line dt_PATH_parse_line;
#endif

! static int dt_PATH_parse_line(r,lcl,value,lineno,filename,e_val,negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 1164,1175 ----
static rc_parse_line dt_PATH_parse_line;
#endif

! static int dt_PATH_parse_line(r,lcl,value,lineno,filename,negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 1422,1427 ****
--- 1260,1269 ----



fprintf(F, "%s = ",r->name);

+ if (r->val.path->list && 0 == r->val.path->nlen) {
+ fprintf(F, "none");

+ }
+

for (i = 0; i < r->val.path->nlen; i++) {
/* NOTE: space is always valid separator even when

PATH_sep_comma or PATH_sep_colon is set */
***************
*** 1447,1452 ****
--- 1289,1295 ----


fputs(r->val.path->list[i],F);
len += strlen(r->val.path->list[i]) + 1;
}
+
fprintf(F, "\n");
}
}

***************
*** 1458,1470 ****
#ifdef ANSI_C
static rc_parse_line dt_OBS_parse_line;
#endif
! static int dt_OBS_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
/* This message is not perhaps very visible, because
--- 1301,1312 ----
#ifdef ANSI_C
static rc_parse_line dt_OBS_parse_line;
#endif
! static int dt_OBS_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
/* This message is not perhaps very visible, because
***************
*** 1511,1516 ****
--- 1353,1378 ----
return 0;
}

+ /* Fix shell if needed */
+ if (ptr->flags & ESTR_bin) {
+ if (buffer[0] != '/') {
+ char * A = elm_message(FRM("/bin/%s"), buffer);
+
+ if (ptr->expanded)
+ free(ptr->expanded);
+ ptr->expanded = A;
+ return 1;
+ }
+ }
+
+ /* Fix temp_dir if needed */
+ if (ptr->flags & ESTR_slash) {
+ int l = strlen(buffer);
+
+ if (0 == l || buffer[l-1] != '/')
+ strfcat(buffer,"/",sizeof buffer);
+ }
+
ptr->expanded = strmcpy(ptr->expanded,buffer);

return 1;
***************
*** 1553,1565 ****
#ifdef ANSI_C
static rc_parse_line dt_ESTR_parse_line;
#endif
! static int dt_ESTR_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 1415,1426 ----
#ifdef ANSI_C
static rc_parse_line dt_ESTR_parse_line;
#endif
! static int dt_ESTR_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 1611,1616 ****
--- 1472,1629 ----
dt_ESTR_print_value, dt_ESTR_get_value };


+ int give_dt_enumerate_as_int(ptr)
+ struct dt_enumerate_info *ptr;
+ {
+ return ptr->val;
+ }
+
+ CONST char * give_dt_enumerate_as_str(ptr)
+ struct dt_enumerate_info *ptr;
+ {
+ static char * buffer = NULL;
+
+ if (ptr->val >= 0 &&
+ ptr->val < ptr->nlen)
+ return ptr->list[ptr->val];


+
+ if (buffer)
+ free(buffer);

+ buffer = elm_message(FRM("%d"), ptr->val);
+
+ return buffer;
+ }
+
+ int set_dt_enumerate_as_str(ptr,str)
+ struct dt_enumerate_info *ptr;
+ char *str;
+ {
+ int ci = -1, i;
+
+ int e_val;
+
+ e_val = 0; /* First value is 'unknown' */
+
+ for (i = 0; i < ptr->nlen; i++)
+ if (0 == strcmp(ptr->list[i],str)) {
+ e_val = i;
+ break;
+ } else if (0 == istrcmp(ptr->list[i],str))
+ ci = i;
+
+ if (!e_val && ci >= 0)
+ e_val = ci;
+
+ if (i == ptr->nlen) {
+ char *p;
+
+ if ((e_val = strtol(str,&p,10)) < 0 || *p != '\0')

+ return 0;
+
+ }
+

+ ptr->val = e_val;


+
+ return 1;
+ }
+
+
+

+ #ifdef ANSI_C
+ static rc_parse_line dt_ENUM_parse_line;
+ #endif
+ static int dt_ENUM_parse_line(r,lcl,value,lineno,filename, negate)
+ struct rc_save_info_rec *r;
+ int lcl;
+ char *value;

+ int lineno;
+ char *filename;

+ int negate;
+ {
+ if (negate) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadNegate,
+ "!%s is not supported in line %d in \"%s\" file"),
+ r->name,lineno,filename);


+ return 0;
+ }
+

+ if (!set_dt_enumerate_as_str(r->val.enumerate,value)) {
+ int i;
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadEKeyInElmrc,
+ "I can't understand %s key \"%s\" in line %d in \"%s\" file"),
+ r->name,value, lineno,filename);
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadEKeyValues,
+ "Possible values are:"));
+ for (i = 0; i < r->val.enumerate->nlen; i++)
+ lib_error(FRM(" - %s"),
+ r->val.enumerate->list[i]);


+
+ return 0;
+ }
+

+ return 1;
+ }
+

+ #if ANSI_C
+ static rc_get_value dt_ENUM_get_value;
+ #endif
+ static char * dt_ENUM_get_value(r)
+ struct rc_save_info_rec *r;
+ {
+ static char * buffer = NULL;
+
+ if (r->val.enumerate->val >= 0 &&
+ r->val.enumerate->val < r->val.enumerate->nlen)
+ return r->val.enumerate->list[r->val.enumerate->val];


+
+ if (buffer)
+ free(buffer);

+ buffer = elm_message(FRM("%d"), r->val.enumerate->val);
+
+ return buffer;
+ }
+
+ #if ANSI_C
+ static rc_print_value dt_ENUM_print_value;
+ #endif
+ static void dt_ENUM_print_value(F,r,comment)
+ FILE *F;
+ struct rc_save_info_rec *r;
+ int comment;
+ {
+
+ if (comment)
+ fprintf(F, "### ");
+
+ if (r->val.enumerate->val >= 0 &&
+ r->val.enumerate->val < r->val.enumerate->nlen) {
+
+ char * s = r->val.enumerate->list[r->val.enumerate->val];
+
+ fprintf(F, "%s = %s\n", r->name, s);
+
+ DPRINT(Debug,9,(&Debug,
+ " option \"%s\", value=\"%s\"\n",
+ r->name,s ));
+
+ } else {
+ fprintf(F, "%s = %d\n", r->name,
+ r->val.enumerate->val);
+
+ DPRINT(Debug,9,(&Debug,
+ " option \"%s\", value=%d\n",
+ r->name,r->val.enumerate->val ));


+
+ }
+ }
+
+

+ struct rc_type rc_DT_ENUM = { RCTYPE_magic,
+ dt_ENUM_parse_line, BAD_parse_cline,
+ dt_ENUM_print_value, dt_ENUM_get_value };
+


/*
Index: elm2.4.ME+.122-cvs/lib/read_rc.c
*** elm2.4.ME+.121/lib/read_rc.c 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/lib/read_rc.c 2005-07-05 23:44:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.142 2004/07/27 20:25:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.142 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.168 2005/07/05 20:44:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.168 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 47,56 ****
# include <sys/utsname.h>
# endif

! #define ASSIGNMENT 0

- #define SYSTEM_RC 0
- #define LOCAL_RC 1

#ifdef HAVE_CODESET
#include <langinfo.h>
--- 47,504 ----
# include <sys/utsname.h>
# endif

! struct hist_record {
! char *tag;
! struct rc_save_info_rec * entry;
! int changed;
!
!
! char ** old_line;
! int line_count;
! };
!
! static struct elmrc_recorder {
! struct hist_record *recs;
! int rec_count;
!
! } * recorders[RC_MODE_COUNT];
!
! struct elmrc_recorder * enable_recorder(mode)
! enum record_mode mode;
! {
! if (mode < 0 || mode >= RC_MODE_COUNT)
! panic("RC PANIC",__FILE__,__LINE__,"enable_recorder",
! "Bad mode",0);
!
! if (! recorders[mode] ) {
! struct elmrc_recorder * X;
!
! X = safe_malloc(sizeof (*X));
!
! bzero((void *)X, sizeof (* (X)));
!
! X->recs = NULL;
! X->rec_count = 0;
!
! recorders[mode] = X;
! }
!
!
! return recorders[mode];
! }
!
! static struct hist_record * record1 P_((struct elmrc_recorder *recorder,
! struct rc_save_info_rec *X,
! char *tag));
!
! static struct hist_record * record1(recorder,X,tag)
! struct elmrc_recorder *recorder;
! struct rc_save_info_rec *X;
! char *tag;
! {
! struct hist_record *r;
!
!
! recorder->recs = safe_realloc(recorder->recs,
! sizeof (recorder->recs[0]) *
! ( recorder->rec_count + 1 ));
!
! r = & (recorder->recs[recorder->rec_count]);
!
! bzero((void *)r, sizeof (*r));
!
! r->entry = X;
! r->tag = NULL;
!
! if (tag)
! r->tag = safe_strdup(tag);
!
! r->old_line = 0;
! r->line_count = 0;
! r->changed = 0;
!
! recorder->rec_count++;
!
! return r;
! }
!
! static struct hist_record * need_record P_((enum record_mode mode,
! struct rc_save_info_rec *X,
! char *tag));
! static struct hist_record * need_record(mode,X,tag)
! enum record_mode mode;
! struct rc_save_info_rec * X;
! char *tag;
! {
! int i;
! struct hist_record *r;
!
!
! if (! recorders[mode] )

! return NULL;
!
!

! /* If old value is already recorded,
! do not add 'new' old value
! */
!
! for (i = 0; i < recorders[mode]->rec_count; i++)
! if (recorders[mode]->recs[i].entry == X)


! return NULL;
!
!

! return record1(recorders[mode],X,tag);
! }
!
! static char * split_keyword P_((char *buffer, int line_len,
! char *keyword, int size,
! char **tag,
! int *assig));
! static struct rc_save_info_rec *locate_option P_((struct rc_save_info_rec * rc_options,
! int rc_option_count,
! char *word1,
! char *word2,
! char *filename,
! int *negate));
!
! #define MAX_LINE 10000
!
!
! int seed_history(F,filename,recorder)
! FILE *F;
! char * filename;
! struct elmrc_recorder *recorder;
! {
! int ok = 1;


! char * buffer = NULL;
! int r; /* length of line or error/eof status */

! int lineno = 0;
! char current_tag[SLEN];
!
! struct rc_save_info_rec * prev_type = NULL;
! struct hist_record * rec = NULL;
! int ignored = 0;
!
! current_tag[0] = '\0';
!
! /* malloc_gets does realloc, so buffer need not
! be freed on loop
! */
! while (0 <= ( r = malloc_gets(&buffer,MAX_LINE,F))) {


! char * tag = NULL;

! char keyword[SLEN], *c;
! char * rest = NULL;
! int assig = 0;
!

! int negate = 0;
!

! lineno++;
!

! if (!buffer) /* EOF */

! break;


!
! if (buffer[0] == '#' /* comment */
! || r < 1) /* empty line */

! continue;
!

! rest = split_keyword(buffer,r,keyword, sizeof keyword,

! &tag,&assig);
!
!
! if (tag && !keyword[0]) {
! strfcpy(current_tag, tag, sizeof current_tag);
!
! if (rest[0] && '#' != rest[0]) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIgnoredLine,
! "Rest of line ignored after \"%s:\" on line %d on file %s"),
! tag, lineno,filename);
! ok = 0;
! }
!
! } else if (!keyword[0]) {
! if (prev_type != NULL) {
!
! if (RCTYPE_magic != prev_type->dt_type->magic)


! panic("RC PANIC",__FILE__,__LINE__,"do_rc",
! "Bad prev_type",0);
!

! if (rec) {
! rec->old_line = safe_realloc(rec->old_line,
! sizeof(rec->old_line[0]) *
! ( rec->line_count + 1));
!
! rec->old_line [ rec->line_count ] = safe_strdup(rest);
! rec->line_count++;
!
! /* Preserve seeded data when printing again */
! rec->changed++;
! }
! }
!
! } else if (assig) {
!

! if (tag || current_tag[0]) {
! struct rc_save_info_rec * rc_options = NULL;
! int rc_option_count = 0;
!
! if (!tag)
! tag = current_tag;
! else
! ignored = 0;

!
! #ifdef USE_DLOPEN


! if (give_options(tag,&rc_options,&rc_option_count)) {
!
! prev_type = locate_option(rc_options,rc_option_count,
! keyword,rest,filename,
! &negate);
! ignored = 0;
!
! if (!prev_type) {

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyTagInElmrc,
! "I can't understand keyword \"%s\" (section %s) in line %d in \"%s\" file"),
! keyword, tag,lineno,filename);

! ok = 0;
! continue;
! }
!

! } else if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIgnoredSection,
! "Keywords on section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);

! ok = 0;


! }
! #else
! if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSharedIgnoredSection,
! "Shared libraries not supported. Section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);

! ok = 0;
! }
! #endif
!

! } else {
!
! prev_type = locate_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
! keyword,rest,filename,&negate);
!
! if (!prev_type) {

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyInElmrc,
! "I can't understand keyword \"%s\" in line %d in \"%s\" file"),
! keyword, lineno,filename);

! ok = 0;
! continue;
! }
!
! }
!
! rec = record1(recorder,prev_type,tag);


! if (rec) {
! if (rec->line_count)
! panic("RC PANIC",__FILE__,__LINE__,"do_rc",
! "Bad prev_type",0);
!
! rec->old_line = safe_malloc(sizeof(rec->old_line[0]));
!
! rec->old_line[0] = safe_strdup(rest);
!
! rec->line_count = 1;

! rec->changed++;
! }
! } else {
! prev_type = NULL;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadLineInElmrc,
! "Keyword \"%s\" without = -character in line %d in \"%s\" file"),
! keyword, lineno,filename);
! ok = 0;
!
! }
! }
!
! if (-1 == r) {

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTooLongLine,
! "%30s: %d: Too long line: %.30s..."),

! filename,lineno+1,
! buffer ? buffer : "<not available>");
! ok = 0;
! }
!
! if (ferror(F)) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReading,
! "Error reading from %.50s"),
! filename);
! ok = 0;
! }
!
! if (buffer)
! free(buffer);
!
!
! return ok;
! }
!
! static void print_history_record P_((FILE *F,struct hist_record *x));
! static void print_history_record(F,x)
! FILE *F;
! struct hist_record *x;


! {
! int i;
!

! fprintf(F,"\n%s = %s\n",
! x->entry->name,
! x->old_line[0]);
!
! for (i = 1; i < x->line_count; i++) {
! fprintf(F,"\t%s\n",
! x->old_line[i]);


! }
!
!
! }
!

! void print_history_changed(F,recorder)
! FILE *F;
! struct elmrc_recorder *recorder;


! {
! int i;
!

! /* First print lines without tag */
! char * last_tag = NULL;
!
!
! for (i = 0; i < recorder->rec_count; i++) {
!
! if (recorder->recs[i].changed &&
! NULL == recorder->recs[i].tag) {
! print_history_record(F,& (recorder->recs[i]));
! }
!
! }
!
! /* Then print values with tag */
!
! for (i = 0; i < recorder->rec_count; i++) {
!
! if (recorder->recs[i].changed &&
! NULL != recorder->recs[i].tag) {
!
! if (!last_tag ||
! 0 != strcmp(last_tag,
! recorder->recs[i].tag)) {
! last_tag = recorder->recs[i].tag;
!
! fprintf(F,"\n\n%s:\n",
! last_tag);
!
! print_history_record(F,& (recorder->recs[i]));


!
! }
! }
! }
! }
!

! void mark_XX(x)
! struct rc_save_info_rec *x;
! {
! enum record_mode mode;
!
! int found = 0;
!
! x->flags |= FL_LOCAL;
! x->flags |= FL_CHANGED;
!
! DPRINT(Debug,10,(&Debug,
! "mark_XX: Setting %p %s changed\n",
! x,x->name));
!
! for (mode = SYSTEM_RC; mode < RC_MODE_COUNT; mode++) {
!
! if (recorders[mode]) {
! int i;
!
! for (i = 0; i < recorders[mode]->rec_count; i++)
! if (recorders[mode]->recs[i].entry == x) {
! recorders[mode]->recs[i].changed++;
! found++;
!
! DPRINT(Debug,10,(&Debug,
! "mark_XX: recorders[%d]->recs[%d].entry == %p\n",
! mode,i,x));
!
! }
! } else {
! DPRINT(Debug,10,(&Debug,
! "mark_XX: no mode=%d\n",mode));
! }
! }
!
! if (!found) {
! DPRINT(Debug,10,(&Debug,
! "mark_XX: no change record\n"));
! }
!
! }
!
! void mark_local_changed(A)
! void *A;


! {
! int x;
!
!

! for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
! if (save_info[x].val.dummy == A) {
!
! DPRINT(Debug,10,(&Debug,
! "mark_local_changed: %d: %p\n",
! x,A));
!
! mark_XX(& (save_info[x]));
!
! }
! }
!
! #ifdef USE_DLOPEN
! mark_shared_changed(A);
! #endif
!
! mark_delayed_changed(A);


!
! }
!
!
!
!

! void mark_flocal_changed(A)
! option_func *A;


! {
! int x;
!
!

! for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
! if (save_info[x].func_val == A) {
!
! DPRINT(Debug,10,(&Debug,
! "mark_flocal_changed: %d: %p\n",
! x,A));
!
! mark_XX(& (save_info[x]));
!
! }
! }
!
! #ifdef USE_DLOPEN
! mark_fshared_changed(A);
! #endif
!
! mark_fdelayed_changed(A);
! }
!


#ifdef HAVE_CODESET
#include <langinfo.h>
***************
*** 60,66 ****
static int errors = 0;

static void do_expand_env P_((char *, char *, char *, unsigned));
! static void do_rc P_((FILE *file,int lcl, char *filaname));

int parse_elmrc(F,global,filename)
FILE *F;
--- 508,514 ----
static int errors = 0;

static void do_expand_env P_((char *, char *, char *, unsigned));
! static void do_rc P_((FILE *file,enum record_mode lcl, char *filaname));

int parse_elmrc(F,global,filename)
FILE *F;
***************
*** 86,95 ****
char system_mail_services[SLEN] = SYSTEM_MAIL_SERVICES;
char hostdomfile[SLEN] = HOSTDOMFILE;
char system_mime_charsets[SLEN] = SYSTEM_MIME_CHARSETS;
! char map_txtdir[SLEN] = {0}; /* init_defaults */
! char raw_map_txtdir[SLEN] = "{lib}/elm.map.txt";
! char map_bindir[SLEN] = {0}; /* init_defaults */
! char raw_map_bindir[SLEN] = "{lib}/elm.map.bin";
char unidata_path[SLEN] = {0}; /* init_defaults */
char raw_unidata_path[SLEN] = "unidata.bin"; /* init_defaults */

--- 534,549 ----
char system_mail_services[SLEN] = SYSTEM_MAIL_SERVICES;
char hostdomfile[SLEN] = HOSTDOMFILE;
char system_mime_charsets[SLEN] = SYSTEM_MIME_CHARSETS;
! ESTR map_txtdir_e = { /* init_defaults */
! ESTR_meta|ESTR_slash,


! NULL,
! NULL
! };

! ESTR map_bindir_e = { /* init_defaults */
! ESTR_meta|ESTR_slash,


! NULL,
! NULL
! };

char unidata_path[SLEN] = {0}; /* init_defaults */
char raw_unidata_path[SLEN] = "unidata.bin"; /* init_defaults */

***************
*** 97,103 ****
char bindata_path[SLEN] = {0}; /* init_defaults */
char raw_bindata_path[SLEN] = "bindata.bin"; /* init_defaults */

!

char user_rc_file[SLEN] = ELMRCFILE; /* user_init fixes */
char user_text_file[SLEN] = USER_ALIAS_TEXT; /* user_init fixes */
--- 551,557 ----
char bindata_path[SLEN] = {0}; /* init_defaults */
char raw_bindata_path[SLEN] = "bindata.bin"; /* init_defaults */

! int unstable_reverse_thread = 0;

char user_rc_file[SLEN] = ELMRCFILE; /* user_init fixes */
char user_text_file[SLEN] = USER_ALIAS_TEXT; /* user_init fixes */
***************
*** 154,160 ****
*/
int allow_charset_switching=0; /* flag: allow changing charset of */
/* terminal if terminal supports */
! int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */
PATH alternative_addresses = { /* how else do we get mail? */
PATH_sep_comma,
--- 608,627 ----
*/
int allow_charset_switching=0; /* flag: allow changing charset of */
/* terminal if terminal supports */
!
! static struct sortval ASR_srtval[]={
! {"alias", ALIAS_SORT},
! {"name", NAME_SORT},
! {"text", TEXT_SORT},


! {NULL, 0}
! };
!

! SORT alias_sortby = { /* how to sort aliases... */
! NAME_SORT,
!
! ASR_srtval
! };
!
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */
PATH alternative_addresses = { /* how else do we get mail? */
PATH_sep_comma,
***************
*** 169,187 ****
int prompt_for_cc = 1; /* flag: ask user for "cc:" value? */
#ifdef USE_PGP
int pgp_askpgpsig=0; /* Should pgp ask userid to sign messages with? */
! int pgp_sign_type=0; /* 0 = application/pgp
! 1 = text/plain
! 2 = text/x-pgp
! */
int pgp_interactive=0; /* Should pgp/gpg encryption/signing to be
run always on interactive mode */
! enum pgp_version send_pgp_version = pgp_none; /* preferred pgp version*/
#endif
char attribution[SLEN] = {0}; /* attribution string for replies */
! int auto_attachment = 1; /* 0 = none,
! 1 = application,
! 2 = non-text
! */
int auto_copy = 0; /* flag: automatically copy source? */
int auto_iso_8859 = 1; /* flag: Should ISO-8859-X charsets defined
on demand ? */
--- 636,678 ----
int prompt_for_cc = 1; /* flag: ask user for "cc:" value? */
#ifdef USE_PGP
int pgp_askpgpsig=0; /* Should pgp ask userid to sign messages with? */
!
!
! static char * PGP_SIGN_TYPES[] = { "application/pgp", "text/plain",
! "text/x-pgp", NULL };
!
!
! ENUMERATE pgp_sign_type= { /* 0 = application/pgp */
! 0, /* 1 = text/plain */
! 3, &(PGP_SIGN_TYPES[0]) /* 2 = text/x-pgp */
! };
!
! static char * PGP_ENCRYPT_TYPES[] = { "application/pgp", "text/plain",
! "text/x-pgp", NULL };
!
! ENUMERATE pgp_encrypt_type= { /* 0 = application/pgp */
! 0, /* 1 = text/plain */
! 3, &(PGP_ENCRYPT_TYPES[0]) /* 2 = text/x-pgp */
! };
!
int pgp_interactive=0; /* Should pgp/gpg encryption/signing to be
run always on interactive mode */
!
! static char * PGP_VERSIONS[] = { "default", "pgp2", "pgp5", "gpg", NULL };
! ENUMERATE send_pgp_version = { /* preferred pgp version*/
! pgp_none,
! 4, &(PGP_VERSIONS[0])
! };
!
#endif
char attribution[SLEN] = {0}; /* attribution string for replies */
!
! static char * AUTO_ATTACH[] = { "none", "application", "non-text", NULL };
! ENUMERATE auto_attachment = { /* 0 = none, */
! 1, /* 1 = application, */
! 3, &(AUTO_ATTACH[0]) /* 2 = non-text */
! };
!
int auto_copy = 0; /* flag: automatically copy source? */
int auto_iso_8859 = 1; /* flag: Should ISO-8859-X charsets defined
on demand ? */
***************
*** 189,195 ****
int background_wait_time = 2; /* If > 0 background mailer after */
/* this number of seconds */
#endif
! /* int bounceback = 0; */ /* flag: bounce copy off remote? */
int browser_wildcards = 1; /* flag: do wildcard match? */
int builtin_lines= -3; /* int: if < 0 use builtin if message*/
/* shorter than LINES+builtin_lines */
--- 680,686 ----
int background_wait_time = 2; /* If > 0 background mailer after */
/* this number of seconds */
#endif
!
int browser_wildcards = 1; /* flag: do wildcard match? */
int builtin_lines= -3; /* int: if < 0 use builtin if message*/
/* shorter than LINES+builtin_lines */
***************
*** 203,212 ****
charset_t default_mimetext_charset = NULL; /* pointer to character set */
char raw_default_nomime_charset[SLEN] = "SYSTEM"; /* name of character set */
charset_t default_nomime_charset = NULL; /* pointer to character set */
! int def_folder_status = FOLDER_STATUS_OLD; /* 0 = Read
! 1 = Old
! 2 = New
! */
char config_options[SLEN] = {0};/* which options are in o)ptions */
int confirm_append = 0; /* flag: confirm append to folder? */
int confirm_create = 0; /* flag: confirm create new folder? */
--- 694,706 ----
charset_t default_mimetext_charset = NULL; /* pointer to character set */
char raw_default_nomime_charset[SLEN] = "SYSTEM"; /* name of character set */
charset_t default_nomime_charset = NULL; /* pointer to character set */
!
! static char * FOLDER_STATUS[] = { "Read", "Old", "New", NULL };
! ENUMERATE def_folder_status = { /* 0 = Read */
! FOLDER_STATUS_OLD, /* 1 = Old */
! 3, &(FOLDER_STATUS[0]) /* 2 = New */
! };
!
char config_options[SLEN] = {0};/* which options are in o)ptions */
int confirm_append = 0; /* flag: confirm append to folder? */
int confirm_create = 0; /* flag: confirm create new folder? */
***************
*** 231,249 ****
NULL
};

! int env_from_source = 0; /* 0 == forward-from,
! 1 == from,
! 2 == return-path
! */

char escape_char = TILDE_ESCAPE;/* '~' or something else.. */
int force_name = 0; /* flag: save by name forced? */
! int fragment_handling = 1; /* 0 == none,
! 1 == manual,
! 2 == auto */
int allow_forms = NO; /* flag: are AT&T Mail forms okay? */
char full_username[SLEN] = {0}; /* Full username - gecos */
! int phrase_display_mode = 0; /* 0 == plain, 1 = quoted */
char hostdomain[SLEN] = {0}; /* name of domain we're in */
char hostfullname[SLEN] = {0}; /* name of FQDN we're in */
char hostname[SLEN] = {0}; /* name of machine we're on */
--- 725,761 ----
NULL
};

! static char * MPAR[] = { "plain", "encoded", "plain-and-encoded" };
! ENUMERATE mime_parameters = {
! 2,
! 3, &(MPAR[0])
! };
!
! static char * ENV_FROM_SOURCES[] = { "forward-from", "from", "return-path",
! NULL };
! ENUMERATE env_from_source = { /* 0 == forward-from, */
! 0, /* 1 == from, */
! 3, &(ENV_FROM_SOURCES[0]) /* 2 == return-path */
! };

char escape_char = TILDE_ESCAPE;/* '~' or something else.. */
int force_name = 0; /* flag: save by name forced? */
!
! static char * FRAGMENTH_list[] = { "none", "manual", "auto" };
! ENUMERATE fragment_handling = { /* 0 == none, */
! 1, /* 1 == manual, */
! 3, &(FRAGMENTH_list[0]) /* 2 == auto */
! };
!
int allow_forms = NO; /* flag: are AT&T Mail forms okay? */
char full_username[SLEN] = {0}; /* Full username - gecos */
!
! static char * HDR_PHRASE_DISPLAY_MODES[] = { "plain", "quoted", NULL };
! ENUMERATE phrase_display_mode = { /* 0 == plain, 1 = quoted */
! 0,
! 2, &(HDR_PHRASE_DISPLAY_MODES[0])
! };
!
char hostdomain[SLEN] = {0}; /* name of domain we're in */
char hostfullname[SLEN] = {0}; /* name of FQDN we're in */
char hostname[SLEN] = {0}; /* name of machine we're on */
***************
*** 257,270 ****
int pgp_keeppassfor = 300; /* 5 minutes */
#endif

int local_fast_lookup = 0; /* flag: directory listing not needed
for lookup */
char local_sessionlock_dir[SLEN] = default_temp;
! int local_sessionlock_use_home; /* 0 == newer,
! 1 == spool
! 2 == always
! 3 == non-spool
! */
char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */
charset_t local_fs_charset = NULL; /* filesystem charset */

--- 769,796 ----
int pgp_keeppassfor = 300; /* 5 minutes */
#endif

+ static struct sortval DIR_srtval[]={
+ {"none", LD_NONE},
+ {"name", LD_NAME_SORT},
+ {"mtime", LD_MTIME_SORT},


+ {NULL, 0}
+ };
+

+ SORT local_dir_sortby = { /* how to sort files... */
+ LD_NAME_SORT,
+ DIR_srtval
+ };
+
int local_fast_lookup = 0; /* flag: directory listing not needed
for lookup */
char local_sessionlock_dir[SLEN] = default_temp;
!
! static char * LSL_list[] = { "never", "spool", "always", "non-spool", NULL };
! ENUMERATE local_sessionlock_use_home = { /* 0 == newer, */
! 0, /* 1 == spool */
! 4, &(LSL_list[0]) /* 2 == always */
! }; /* 3 == non-spool */
!
char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */
charset_t local_fs_charset = NULL; /* filesystem charset */

***************
*** 274,279 ****
--- 800,816 ----
NULL
};
/* signature file */


+
+
+ #if defined(WCHAR) && defined(__STDC_ISO_10646__)

+ PATH locale_charsets= { /* Use type=unknown for these charsets
+ * if system charset
+ */
+ 0, /* flags */
+ NULL , 0, NULL
+ };
+ #endif
+
#ifdef SYSCALL_LOCKING
int lockfolders = 1; /* Lock folder when open */
int lock_in_copy = 1; /* Lock folder when copied to it */
***************
*** 281,288 ****
int lockfolders = 0; /* Lock folder when open */
int lock_in_copy = 0; /* Lock folder when copied to it */
#endif
! char folders[SLEN] = {0}; /* folder home directory */
! char raw_folders[SLEN] = {0}; /* unexpanded folder home directory */
char extra_mailbox_dir[SLEN] = {0};
char raw_extra_mailbox_dir[SLEN] = {0};
char raw_attachment_dir[SLEN] = {0};
--- 818,828 ----
int lockfolders = 0; /* Lock folder when open */
int lock_in_copy = 0; /* Lock folder when copied to it */
#endif
! ESTR folders_e = { /* folder home directory */


! ESTR_slash,
! NULL,
! NULL
! };

char extra_mailbox_dir[SLEN] = {0};
char raw_extra_mailbox_dir[SLEN] = {0};
char raw_attachment_dir[SLEN] = {0};
***************
*** 290,297 ****

int mail_permissions = 0600; /* int: permissions for mailbox files */
int mini_menu = 1; /* flag: menu specified? */
! int message_hide_hack = 0; /* 0 == none */
! /* 1 = FOLDER INTERNAL DATA */
char raw_metamail_path[SLEN] = METAMAIL_PATH;
char metamail_path[SLEN] = "metamail"; /* Metamail path or "none" */
/* if no metamail */
--- 830,842 ----

int mail_permissions = 0600; /* int: permissions for mailbox files */
int mini_menu = 1; /* flag: menu specified? */
!
! static char * hide_hacks[] = { "none", "FOLDER INTERNAL DATA", NULL };
! ENUMERATE message_hide_hack = { /* 0 == none */
! 0, /* 1 = FOLDER INTERNAL DATA */
! 2, &(hide_hacks[0])
! };
!
char raw_metamail_path[SLEN] = METAMAIL_PATH;
char metamail_path[SLEN] = "metamail"; /* Metamail path or "none" */
/* if no metamail */
***************
*** 319,327 ****
int askmimeforward = 1; /* flag: prompt about messaga/rfc822 forward */
int move_when_paged = 0; /* flag: move when '+' or '-' used? */
int names_only = 1; /* flag: display user names only? */
! int allow_no_encoding = 0; /* 1: Allow 8bit without -B8BITMIME */
! /* 2: Allow binary without -BBINARYMIME and */
! /* and 8bit without -B8BITMIME */
int allow_no_hdrencoding = 0; /* TRUE, if header encoding is */
/* not required */
int noheader = 1; /* flag: copy + header to file? */
--- 864,877 ----
int askmimeforward = 1; /* flag: prompt about messaga/rfc822 forward */
int move_when_paged = 0; /* flag: move when '+' or '-' used? */
int names_only = 1; /* flag: display user names only? */
!
! static char * NOENCODINGS[] = { "pass-7bit", "pass-8bit", "pass-binary",
! NULL };
! ENUMERATE allow_no_encoding = { /* 1: Allow 8bit without -B8BITMIME */
! 0, /* 2: Allow binary without -BBINARYMIME and */
! 3, &(NOENCODINGS[0]) /* and 8bit without -B8BITMIME */
! };
!
int allow_no_hdrencoding = 0; /* TRUE, if header encoding is */
/* not required */
int noheader = 1; /* flag: copy + header to file? */
***************
*** 355,360 ****
--- 905,911 ----
/* unexpanded how to print messages */
int prompt_after_pager = 1; /* flag: prompt after pager exits */
int prompt_after_metamail = 1; /* flag: prompt after metamail exits */
+ int prompt_metamail = 1; /* flag: prompt for calling of metamil */
int quote_forward = 0; /* flag: fwd'd msgs quoted like replies */
int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/
***************
*** 382,389 ****
};

int send_mime_plain = 1; /* flag: send plain text as MIME? */
! char shell[SLEN] = {0}; /* current system shell */
! char raw_shell[SLEN] = {0}; /* unexpanded current system shell */
int set_window_title = 0; /* flag: set (xterm?) window title and
icon name */
#ifdef USE_PGP
--- 933,944 ----
};

int send_mime_plain = 1; /* flag: send plain text as MIME? */
! ESTR shell_e = { /* current system shell */
! ESTR_bin,


! NULL,
! NULL
! };
!

int set_window_title = 0; /* flag: set (xterm?) window title and
icon name */
#ifdef USE_PGP
***************
*** 395,414 ****


int sleepmsg = 2; /* time to sleep for messages being */
/* overwritten on screen */

! int sortby = REVERSE SENT_DATE; /* how to sort incoming mail... */


long elm_timeout = 600L; /* timeout (secs) on main prompt */
int sort_thread_max_time = 30; /* Number of days which can considered
be same thread */

! char temp_dir[SLEN] = {0}; /* name of temp directory */
! char raw_temp_dir[SLEN] = {0}; /* unexpanded name of temp directory*/

Kari E. Hurtta

unread,
Jul 13, 2005, 5:53:18 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.16

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 16/18
=========================================================================
DPRINT(Debug,50,(&Debug,
"cur_ReadCh2: found_key=%d (line=%d col=%d)\n",
found_key, line,col));
--- 721,727 ----
return last_state;
}

! cur_MoveCursor(line,col,NULL);
DPRINT(Debug,50,(&Debug,
"cur_ReadCh2: found_key=%d (line=%d col=%d)\n",
found_key, line,col));
Index: elm2.4.ME+.122-cvs/src/screen/def_scommon.h


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/src/screen/def_scommon.h 2005-02-13 22:41:37.000000000 +0200
***************
*** 0 ****
--- 1,107 ----


+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
+ *

+ * Author: Kari Hurtta <e...@elmme-mailer.org>
+ *****************************************************************************/
+
+ struct subpage_common {
+ unsigned short magic; /* MENU_SCOMMON_magic */
+
+ int rel_start_line;
+ struct menu_param * param_ptr;
+ };
+
+ extern void scommon_zero P_((struct subpage_common *c));
+ extern void scommon_clear P_((struct subpage_common *c));
+
+ extern void calculate_printing_area P_((struct menu_context *ctx));
+ extern void scommon_relocate P_((struct menu_context *subpage,
+ struct menu_context *parent,
+ int rel_start_line,
+ int lines));
+
+ #if ANSI_C
+ #define E_(x) extern x;
+ #else
+ #define E_(x)
+ #endif
+
+ E_(w_menu_Writechar scommon_Writechar)
+ extern void scommon_Writechar P_((struct menu_context * ctx, int ch));
+
+ E_(w_menu_PutLineS scommon_PutLineS)
+ extern void scommon_PutLineS P_((struct menu_context * ctx,
+ struct string *text));
+
+ E_(w_menu_PutLine0 scommon_PutLine0)
+ extern void scommon_PutLine0 P_((struct menu_context * ctx,
+ int row, int col,
+ const char *line));
+
+ E_(w_menu_CleartoEOLN scommon_CleartoEOLN)
+ extern void scommon_CleartoEOLN P_((struct menu_context * ctx));
+
+ E_(w_menu_CleartoEOS scommon_CleartoEOS)
+ extern void scommon_CleartoEOS P_((struct menu_context * ctx));
+
+ E_(w_menu_ReadCh2 scommon_ReadCh2)
+ extern struct charset_state * scommon_ReadCh2 P_((struct menu_context *ctx,
+ int flags,
+ int break_flag));
+
+ E_(w_menu_ReadCh scommon_ReadCh)
+ extern int scommon_ReadCh P_((struct menu_context *ctx,
+ int flags,
+ int break_flag));
+
+
+ E_(w_menu_ScreenSize scommon_ScreenSize)
+ extern void scommon_ScreenSize P_((struct menu_context *ctx,


+ int *lines, int *columns));
+

+ E_(w_menu_GetXYLocation scommon_GetXYLocation)
+ extern void scommon_GetXYLocation P_((struct menu_context *ctx,
+ int *row, int *col));
+
+ E_(w_menu_ClearScreen scommon_ClearScreen)
+ extern void scommon_ClearScreen P_((struct menu_context *ctx));
+
+ E_(w_menu_MoveCursor scommon_MoveCursor)
+ extern void scommon_MoveCursor P_((struct menu_context *ctx,
+ int row, int col));
+
+ E_(w_menu_changemode scommon_changemode)
+ extern void scommon_changemode P_((struct menu_context *ctx,
+ int start, int end));
+
+ E_(w_menu_SyncEnter scommon_SyncEnter)
+ extern void scommon_SyncEnter P_((struct menu_context *ctx));
+
+ E_(w_menu_SyncLeave scommon_SyncLeave)
+ extern void scommon_SyncLeave P_((struct menu_context *ctx));
+
+ E_(w_menu_resized scommon_resized)
+ /* called from menu_resized() */
+ extern void scommon_resized P_((struct menu_context *ctx));
+
+ E_(w_menu_calculate_line scommon_calculate_line)
+ extern void scommon_calculate_line P_((struct menu_context *ctx,
+ int rel_line, int *result));
+
+ E_(w_menu_get_linelimit scommon_get_linelimit)
+ extern void scommon_get_linelimit P_((struct menu_context *ctx,
+ int *startline, int *endline));
+
+ E_(w_menu_reset_redraw scommon_reset_redraw)
+ /* called by need_redraw() */
+ extern void scommon_reset_redraw P_((struct menu_context *ctx));


+
+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/src/screen/def_screen.h
*** elm2.4.ME+.121/src/screen/def_screen.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/screen/def_screen.h 2005-06-18 00:02:58.000000000 +0300
***************
*** 1,4 ****
! /* $Id: def_screen.h,v 1.8 2004/07/13 14:39:29 hurtta Exp $ */

#include "headers.h"
#include "me.h"
--- 1,4 ----
! /* $Id: def_screen.h,v 1.15 2005/06/17 21:02:58 hurtta Exp $ */

#include "headers.h"
#include "me.h"
***************
*** 7,20 ****


extern int InGetPrompt; /* set if in GetPrompt() in read() */

/* HACK */



! #define pg_BOLD 0x01
! #define pg_UNDERLINE 0x02
! #define pg_HALFBRIGHT 0x04
! #define pg_INVERSE 0x08
!

/* curses.c */


extern int cur_tabspacing; /* Default? */

--- 7,25 ----


extern int InGetPrompt; /* set if in GetPrompt() in read() */

/* HACK */

! extern int CUR_modes;
! extern void EndSyncronize P_((struct menu_context *ctx));
! extern void Syncronize P_((struct menu_context *ctx));

/* curses.c */

+ struct cur_printarea {
+ /* Currently disables scrolling */
+

+ int first_line, last_line;
+

+ int gone_out;
+ };

extern int cur_tabspacing; /* Default? */

***************
*** 33,59 ****

extern void cur_ScreenSize P_((int *lines, int *columns));
extern void cur_GetXYLocation P_((int *line, int *col));
! extern int cur_ClearScreen P_((struct menu_context *mc));
! extern void cur_CursorUp P_((int n));
! extern void cur_CursorDown P_((int n));
! extern void cur_CursorLeft P_((int n));
! extern int cur_MoveCursor P_((int row, int col));

extern void cur_changemode P_((int *mode, int set, int reset));



/* This assumes one byte charset */

! extern void cur_Writechar P_((int ch));

! extern void cur_PutLineS P_((struct string *S));

! extern void cur_Write_to_screen P_((const char *format,
const char *msg, ...));

! extern void cur_PutLine0 P_((int x, int y, const char *line));
! extern void cur_PutLineX P_((int x, int y, const char *format,
const char *line, ...));
! extern int cur_CleartoEOLN P_((void));
! extern int cur_CleartoEOS P_((void));

extern int cur_RawState P_((void));

--- 38,64 ----

extern void cur_ScreenSize P_((int *lines, int *columns));
extern void cur_GetXYLocation P_((int *line, int *col));
! extern void cur_ClearScreen P_((void));
! extern void cur_MoveCursor P_((int row, int col, struct cur_printarea *lim));

extern void cur_changemode P_((int *mode, int set, int reset));



/* This assumes one byte charset */

! extern void cur_Writechar P_((int ch, struct cur_printarea *lim));

! extern void cur_PutLineS P_((struct string *S, struct cur_printarea *lim));

! extern void cur_Write_to_screen P_((struct cur_printarea *lim,
! const char *format,
const char *msg, ...));

! extern void cur_PutLine0 P_((int row, int col, const char *line,
! struct cur_printarea *lim));
! extern void cur_PutLineX P_((int row, int col, struct cur_printarea *lim,
! const char *format,
const char *line, ...));
! extern void cur_CleartoEOLN P_((void));
! extern void cur_CleartoEOS P_((void));

extern int cur_RawState P_((void));

***************
*** 64,79 ****

extern void transmit_functions P_((int newstate));


#if POLL_METHOD
extern void clear_input_buffer P_((void));
#endif

! extern int cur_ReadCh P_((int flags, int break_flag,
! struct menu_context *mc));
extern struct charset_state * cur_ReadCh2 P_((int flags,
! int break_flag,
! struct menu_context *mc));

extern int cursor_control;
extern int _intransmit; /* are we transmitting keys? */
--- 69,85 ----

extern void transmit_functions P_((int newstate));

+ extern void init_system_charset P_((void));
+

#if POLL_METHOD
extern void clear_input_buffer P_((void));
#endif

! extern void set_last_state P_((charset_t cs));
! extern int cur_ReadCh P_((int flags, int break_flag));
extern struct charset_state * cur_ReadCh2 P_((int flags,
! int break_flag));

extern int cursor_control;
extern int _intransmit; /* are we transmitting keys? */
***************
*** 103,136 ****

/* -------------------------------------------------------------------- */

#define MENU_CONTEXT_magic 0xF800

extern struct menu_context {
unsigned short magic; /* MENU_CONTEXT_magic */

int lines, columns;
int changed;
int redraw;
!
struct menu_context * next_menu;
struct menu_context * prev_menu;
} ROOT_MENU, COOKED_MENU;

extern void check_changes P_((void));

/* init.c */

extern void get_term_chars P_((int fd));

extern char backspace, /* the current backspace char */
! kill_line, /* the current kill-line char */
! word_erase, /* the current word-erase char */
! interrupt_char, /* the current interrupt char */
! reprint_char, /* the current reprint-line char */
! eof_char; /* the current end-of-file char */

extern char VQUIT_char, /* the current quit char */
! VSUSP_char; /* the current suspend char */

/*
* Local Variables:
--- 109,251 ----

/* -------------------------------------------------------------------- */

+

+ #define MENU_CONTAINER_magic 0xF802
+

+ struct menu_subpages {
+ unsigned short magic; /* MENU_CONTAINER_magic */
+
+ struct cur_printarea location;
+ struct menu_context * subpage;
+
+ struct menu_context * parent;
+ struct menu_subpages * prev;
+ struct menu_subpages * next;
+ };
+
#define MENU_CONTEXT_magic 0xF800

extern struct menu_context {
unsigned short magic; /* MENU_CONTEXT_magic */

+ struct menu_draw_routine * routine;
+ struct menu_subpages * subpages;
+ struct menu_subpages * container;
+
int lines, columns;
int changed;
int redraw;
!
! /* absolute cordinates */
! int modes;
! int row, col;
!
! union {
! void * dummy;
! struct subpage_common * common;
! struct menu_subpage * subpage;
! struct menu_header * header;
!
! } u;
!
struct menu_context * next_menu;
struct menu_context * prev_menu;
} ROOT_MENU, COOKED_MENU;

extern void check_changes P_((void));
+ extern void attach_subpage P_((struct menu_context *parent,
+ struct menu_context *subpage,


+ /* absolute screen cordinates */

+ int first_line, int last_line));
+
+ extern void detach_subpage P_((struct menu_context *subpage));

/* init.c */

extern void get_term_chars P_((int fd));

extern char backspace, /* the current backspace char */
! kill_line, /* the current kill-line char */
! word_erase, /* the current word-erase char */
! interrupt_char, /* the current interrupt char */
! reprint_char, /* the current reprint-line char */
! eof_char; /* the current end-of-file char */

extern char VQUIT_char, /* the current quit char */
! VSUSP_char; /* the current suspend char */
!
! /* ---------------------------------------- */
!
! typedef void w_menu_Writechar P_((struct menu_context * ctx,
! int ch));
! typedef void w_menu_PutLineS P_((struct menu_context * ctx,
! struct string *text));
! typedef void w_menu_PutLine0 P_((struct menu_context * ctx,


! int x, int y,

! const char *line));
! typedef void w_menu_CleartoEOLN P_((struct menu_context * ctx));
! typedef void w_menu_CleartoEOS P_((struct menu_context * ctx));
! typedef struct charset_state * w_menu_ReadCh2 P_((struct menu_context *ctx,
! int flags,
! int break_flag));
! typedef int w_menu_ReadCh P_((struct menu_context *ctx,
! int flags,
! int break_flag));
! typedef void w_menu_ScreenSize P_((struct menu_context *ctx,
! int *lines, int *columns));
! typedef void w_menu_GetXYLocation P_((struct menu_context *ctx,
! int *x, int *y));
! typedef void w_menu_ClearScreen P_((struct menu_context *ctx));
! typedef void w_menu_MoveCursor P_((struct menu_context *ctx,
! int row, int col));
! typedef void w_menu_changemode P_((struct menu_context *ctx,
! int start, int end));
! typedef void w_menu_SyncEnter P_((struct menu_context *ctx));
! typedef void w_menu_SyncLeave P_((struct menu_context *ctx));
!
!
! typedef void w_menu_init P_((struct menu_context *ctx));
! typedef void w_menu_free P_((struct menu_context *ctx));
!
! typedef void w_menu_resized P_((struct menu_context *ctx));
! typedef void w_menu_calculate_line P_((struct menu_context *ctx,
! int rel_line, int *result));
! typedef void w_menu_get_linelimit P_((struct menu_context *ctx,
! int *startline, int *endline));
! typedef void w_menu_reset_redraw P_((struct menu_context *ctx));
! typedef int w_menu_do_redraw P_((struct menu_context *ctx));
!
! #define MENU_DRAW_magic 0xF801
! extern struct menu_draw_routine {
! unsigned short magic; /* MENU_DRAW_magic */
!
! w_menu_init * wra_init;
! w_menu_free * wra_free;
!
! w_menu_Writechar * wra_Writechar;
! w_menu_PutLineS * wra_PutLineS;
! w_menu_PutLine0 * wra_PutLine0;
! w_menu_CleartoEOLN * wra_CleartoEOLN;
! w_menu_CleartoEOS * wra_CleartoEOS;
! w_menu_ReadCh2 * wra_ReadCh2;
! w_menu_ReadCh * wra_ReadCh;
! w_menu_ScreenSize * wra_ScreenSize;
! w_menu_GetXYLocation * wra_GetXYLocation;
! w_menu_ClearScreen * wra_ClearScreen;
! w_menu_MoveCursor * wra_MoveCursor;
! w_menu_changemode * wra_changemode;
! w_menu_SyncEnter * wra_SyncEnter;
! w_menu_SyncLeave * wra_SyncLeave;
! w_menu_resized * wra_resized;
! w_menu_calculate_line * wra_calculate_line;
! w_menu_get_linelimit * wra_get_linelimit;
! w_menu_reset_redraw * wra_reset_redraw;
! w_menu_do_redraw * wra_do_redraw;
!
! } CURSES_ROUTINES;
!
! extern struct menu_context * new_menu_type P_((struct menu_draw_routine *T));
! extern void mp_set_any1 P_((struct menu_param *list, int idx, struct menu_param *v));

/*
* Local Variables:
Index: elm2.4.ME+.122-cvs/src/screen/header.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/src/screen/header.c 2005-02-13 22:41:37.000000000 +0200
***************
*** 0 ****
--- 1,331 ----
+ static char rcsid[] = "@(#)$Id: header.c,v 1.3 2005/02/13 20:41:37 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $
+ *

+ * Author: Kari Hurtta <e...@elmme-mailer.org>
+ *****************************************************************************/
+
+ #include "def_screen.h"
+ #include "def_scommon.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ #define MENU_HEADER_magic 0xF804
+ struct menu_header {
+ struct subpage_common c;
+ unsigned short magic; /* MENU_HEADER_magic */
+
+ int params[HEADER_PARAMS_COUNT];
+ header_line_redraw * line_redraw;
+ header_line_redraw * current_redraw;
+ header_param_changed * param_change;
+ header_line_redraw * status_redraw;


+ };
+
+
+ #if ANSI_C

+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ S_(w_menu_init mheader_init)
+ static void mheader_init P_((struct menu_context *ctx));
+ static void mheader_init(ctx)
+ struct menu_context *ctx;


+ {
+ int i;
+

+ DPRINT(Debug,10, (&Debug, "mheader_init: %p\n",
+ ctx));
+
+ ctx->u.header = safe_malloc (sizeof (* ctx->u.header));


+
+ /* bzero is defined hdrs/defs.h */

+ bzero((void *)ctx->u.header,sizeof (* ctx->u.header));
+
+ scommon_zero(&(ctx->u.header->c));
+ ctx->u.header->magic = MENU_HEADER_magic;
+
+ for (i = 0; i < HEADER_PARAMS_COUNT; i++)
+ ctx->u.header->params[i] = 0;
+
+ ctx->u.header->line_redraw = header_line_noredraw;
+ ctx->u.header->current_redraw = header_line_noredraw;
+ ctx->u.header->param_change = null_header_param_changed;
+ ctx->u.header->status_redraw = header_line_noredraw;
+ }
+
+ S_(w_menu_free mheader_free)
+ static void mheader_free P_((struct menu_context *ctx));
+ static void mheader_free(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "mheader_free: %p\n",
+ ctx));
+
+ if (MENU_HEADER_magic != ctx->u.header->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"subpage_free",


+ "Bad magic number",0);
+

+ scommon_clear( & (ctx->u.header->c) );
+
+ ctx->u.header->magic = 0; /* Invalidate */
+ free(ctx->u.header);
+ ctx->u.header = NULL;
+ }
+
+
+ static void header_change_current P_((struct menu_context *ctx,
+ int old_value));
+ static void header_change_current(ctx,old_value)
+ struct menu_context *ctx;
+ int old_value;
+ {
+ int current = ctx->u.header->params[header_current];
+ int top = ctx->u.header->params[header_top_line];


+
+ int i;
+

+ i = old_value - top;
+ if (i >= 0 && i < ctx->lines)
+ ctx->u.header->current_redraw(ctx,
+ ctx->u.header->c.param_ptr,
+ i,
+ old_value,
+ 0);
+
+ i = current - top;
+ if (i >= 0 && i < ctx->lines)
+ ctx->u.header->current_redraw(ctx,
+ ctx->u.header->c.param_ptr,
+ i,
+ current,
+ 1);
+ }
+
+ S_(w_menu_do_redraw mheader_do_redraw)
+ static int mheader_do_redraw P_((struct menu_context *ctx));
+ static int mheader_do_redraw(ctx)
+ struct menu_context *ctx;
+ {
+ int current, line,i;
+
+ if (MENU_HEADER_magic != ctx->u.header->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"header_do_redraw",


+ "Bad magic number",0);
+

+ current = ctx->u.header->params[header_current];
+ line = ctx->u.header->params[header_top_line];
+
+ for (i = 0; i < ctx->lines; i++) {
+ ctx->u.header->line_redraw(ctx,
+ ctx->u.header->c.param_ptr,
+ i,
+ line,
+ line == current);
+ line++;


+ }
+
+ return 1;
+ }
+

+ static struct menu_draw_routine HEADER_ROUTINES = {
+ MENU_DRAW_magic,
+
+ mheader_init,
+ mheader_free,
+
+ scommon_Writechar,
+ scommon_PutLineS,
+ scommon_PutLine0,
+ scommon_CleartoEOLN,
+ scommon_CleartoEOS,
+ scommon_ReadCh2,
+ scommon_ReadCh,
+ scommon_ScreenSize,
+ scommon_GetXYLocation,
+ scommon_ClearScreen,
+ scommon_MoveCursor,
+ scommon_changemode,
+ scommon_SyncEnter,
+ scommon_SyncLeave,
+ scommon_resized,
+ scommon_calculate_line,
+ scommon_get_linelimit,
+ scommon_reset_redraw,
+ mheader_do_redraw,
+ };
+
+
+ void header_line_noredraw(ptr,list,line_number,index,is_current)
+ struct menu_context *ptr;
+ struct menu_param *list;
+ int line_number;
+ int index;
+ int is_current;


+ {
+ return;
+ }
+

+ void null_header_param_changed(ptr,list,param_index)
+ struct menu_context *ptr;
+ struct menu_param *list;
+ int param_index;


+ {
+ return;
+ }
+

+ struct menu_context * new_menu_header(parent,rel_start_line,lines,
+ line_redraw,current_redraw,
+ param_change,status_redraw,list)
+ struct menu_context *parent;
+ int rel_start_line;
+ int lines;
+ header_line_redraw line_redraw;
+ header_line_redraw current_redraw;
+ header_param_changed param_change;
+ header_line_redraw status_redraw;
+ /* only rereference is saved */


+ struct menu_param *list;
+ {

+ int rline = 0;
+ int lline = 0;
+
+ struct menu_context *ret = new_menu_type(&HEADER_ROUTINES);


+
+ if (MENU_CONTEXT_magic != parent->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_header",
+ "Bad parent magic number",0);
+
+ ret->lines = lines;
+ ret->columns = parent->columns;
+ ret->u.header->c.rel_start_line = rel_start_line;
+ ret->u.header->c.param_ptr = list;
+
+ ret->u.header->line_redraw = line_redraw;
+ ret->u.header->current_redraw = current_redraw;
+ ret->u.header->param_change = param_change;
+ ret->u.header->status_redraw = status_redraw;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_header",
+ "Bad parent draw magic number",0);
+
+ parent->routine->wra_calculate_line(parent,rel_start_line,&rline);
+
+ lline = rline + lines -1; /* calculate_printing_area() fixes */
+
+ attach_subpage(parent,ret,rline,lline);
+
+ calculate_printing_area(ret);


+
+ return ret;
+ }
+
+

+ void menu_header_change(subpage,param,value)
+ struct menu_context *subpage;
+ enum header_params param;
+ int value;
+ {
+ int old_value;
+
+ if (&HEADER_ROUTINES != subpage->routine)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_header_change",
+ "Not a header subpage",0);
+
+ if (MENU_HEADER_magic != subpage->u.header->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_header_change",


+ "Bad magic number",0);
+

+ if (param < 0 || param >= HEADER_PARAMS_COUNT)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_header_change",
+ "Bad param number",0);
+
+ old_value = subpage->u.header->params[param];
+
+ subpage->u.header->params[param] = value;
+
+
+ switch (param) {
+ case header_top_line:
+ if (value != old_value)
+ menu_trigger_redraw(subpage);
+ break;
+ case header_current:
+ if (value != old_value)
+ header_change_current(subpage,old_value);


+ break;
+ }
+
+ }
+

+ int menu_header_get(subpage,param)
+ struct menu_context *subpage;
+ enum header_params param;
+ {
+ if (&HEADER_ROUTINES != subpage->routine)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_header_get",
+ "Not a header subpage",0);
+
+ if (MENU_HEADER_magic != subpage->u.header->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_header_get",


+ "Bad magic number",0);
+

+ if (param < 0 || param >= HEADER_PARAMS_COUNT)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_header_get",
+ "Bad param number",0);
+
+ return subpage->u.header->params[param];
+ }
+
+ void menu_header_relocate(subpage,parent,rel_start_line,lines)
+ struct menu_context *subpage;
+ struct menu_context *parent;
+ int rel_start_line;
+ int lines;
+ {
+ if (&HEADER_ROUTINES != subpage->routine)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_header_relocate",
+ "Not a header subpage",0);
+
+ scommon_relocate(subpage,parent,rel_start_line,lines);
+ }
+
+ void menu_header_status_update(subpage,item)
+ struct menu_context *subpage;
+ int item;
+ {
+ int i, current, top;
+
+ if (&HEADER_ROUTINES != subpage->routine)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_header_status_update",
+ "Not a header subpage",0);
+
+ if (MENU_HEADER_magic != subpage->u.header->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_header_status_update",


+ "Bad magic number",0);
+

+ current = subpage->u.header->params[header_current];
+ top = subpage->u.header->params[header_top_line];
+
+ i = item - top;
+ if (i >= 0 && i < subpage->lines)
+ subpage->u.header->status_redraw(subpage,
+ subpage->u.header->c.param_ptr,
+ i,
+ item,
+ current == item);


+
+ }
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/src/screen/Makefile.SH
*** elm2.4.ME+.121/src/screen/Makefile.SH 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/screen/Makefile.SH 2005-01-08 23:08:06.000000000 +0200
***************
*** 17,23 ****
echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.4 2004/07/10 18:55:35 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
--- 17,23 ----
echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.6 2005/01/08 21:08:06 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
***************
*** 43,49 ****
SHELL = /bin/sh

OBJ = screen.o curses.o curs_input.o termbuffer.o \
! termtitle.o termcharset.o cur_process.o context.o init.o

all: Makefile libscreen.a

--- 43,50 ----
SHELL = /bin/sh

OBJ = screen.o curses.o curs_input.o termbuffer.o \
! termtitle.o termcharset.o cur_process.o context.o init.o subpage.o \
! wrapper.o menu_param.o scommon.o header.o

all: Makefile libscreen.a

***************
*** 63,69 ****
$(RANLIB) $@



# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/headers.h def_screen.h

$(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
--- 64,71 ----
$(RANLIB) $@



# Dependencies of header files upon other header files they include

! .PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/headers.h \
! def_screen.h def_scommon.h

$(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
***************
*** 88,91 ****
--- 90,99 ----
cur_process.o: def_screen.h $(INCLDIR)/s_elm.h
context.o: def_screen.h
init.o: def_screen.h
+ wrapper.o: def_screen.h
+ menu_param.o: def_screen.h
+ #
+ subpage.o: def_screen.h def_scommon.h
+ scommon.o: def_screen.h def_scommon.h
+ header.o: def_screen.h def_scommon.h
!NO!SUBS!
Index: elm2.4.ME+.122-cvs/src/screen/menu_param.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/src/screen/menu_param.c 2005-01-08 23:08:06.000000000 +0200
***************
*** 0 ****
--- 1,76 ----
+ static char rcsid[] = "@(#)$Id: menu_param.c,v 1.2 2005/01/08 21:08:06 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>

+ *****************************************************************************/
+
+ #include "def_screen.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ int mp_lookup_integer(list,idx)
+ struct menu_param *list;
+ int idx;


+ {
+ int i;
+

+ for (i = 0; i < idx; i++) {
+ if (mp_END == list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_lookup_integer",
+ "Bad index",0);
+ }
+ if (mp_integer != list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_lookup_integer",
+ "Bad type",0);
+
+ return list[i].u.i;
+ }
+
+ struct menu_common * mp_lookup_mcommon(list,idx)
+ struct menu_param *list;
+ int idx;


+ {
+ int i;
+

+ for (i = 0; i < idx; i++) {
+ if (mp_END == list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_lookup_mcommon",
+ "Bad index",0);
+ }
+ if (mp_menu_common != list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_lookup_mcommon",
+ "Bad type",0);
+
+ return list[i].u.c;
+ }
+
+ void mp_set_any1(list,idx,v)
+ struct menu_param *list;
+ int idx;
+ struct menu_param *v;


+ {
+ int i;
+

+ for (i = 0; i < idx; i++) {
+ if (mp_END == list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_set_any1",
+ "Bad index",0);
+ }
+
+ if (v->t != list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_set_any1",
+ "Bad type",0);
+
+ list[i].u = v->u;


+ }
+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/src/screen/scommon.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/src/screen/scommon.c 2005-06-18 00:02:58.000000000 +0300
***************
*** 0 ****
--- 1,726 ----
+ static char rcsid[] = "@(#)$Id: scommon.c,v 1.4 2005/06/17 21:02:58 hurtta Exp $";


+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>

+ *****************************************************************************/
+
+ #include "def_screen.h"
+ #include "def_scommon.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ #define MENU_SCOMMON_magic 0xF805
+
+ void scommon_zero(c)
+ struct subpage_common *c;
+ {
+
+ c->magic = MENU_SCOMMON_magic;
+ c->rel_start_line = 0;
+ c->param_ptr = NULL;
+ }
+
+ void scommon_clear(c)
+ struct subpage_common *c;
+ {
+ c->magic = 0; /* Invalidate */
+ }
+
+ void calculate_printing_area(ctx)
+ struct menu_context *ctx;
+ {
+ struct menu_context *parent;
+ int startline = 0;
+ int endline;
+
+ int S, E;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"calculate_printing_area",
+ "Bad container magic number",0);
+
+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"calculate_printing_area",
+ "Bad parent draw magic number",0);
+
+ /* Need to calculate absolute from relative position */
+
+ parent->routine->wra_calculate_line(parent,
+ ctx->u.common->rel_start_line,
+ &startline);
+
+ endline = startline + ctx->lines -1;
+
+ parent->routine->wra_get_linelimit(parent,&S,&E);
+
+ if (startline < S)
+ startline = S;
+ if (endline > E)
+ endline = E;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"calculate_printing_area",
+ "Bad container magic number",0);
+
+ ctx->container->location.first_line = startline;
+ ctx->container->location.last_line = endline;
+
+ DPRINT(Debug,11, (&Debug,
+ "calculate_printing_area(%p): startline=%d endline=%d\n",
+ ctx,startline,endline));
+ }
+
+ void scommon_Writechar(ctx,ch)
+ struct menu_context * ctx;
+ int ch;
+ {
+ int remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_Writechar",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_Writechar(%p,%d)\n",ctx,ch));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw
+ */
+
+ cur_MoveCursor(ctx->row, ctx->col,& (ctx->container->location)); /* syncronize position */
+ if (ctx->container->location.gone_out)
+ return; /* Not in drawing area */
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+ cur_Writechar(ch, & (ctx->container->location));
+
+ cur_GetXYLocation(& ctx->row,& ctx->col);
+ }
+
+ void scommon_PutLineS(ctx,text)
+ struct menu_context * ctx;
+ struct string *text;
+ {
+ int remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLineS",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_putlineS(%p,\"%S\")\n",ctx,text));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw
+ */
+
+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location)); /* syncronize position */
+ if (ctx->container->location.gone_out)
+ return; /* Not in drawing area */
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+ cur_PutLineS(text, & (ctx->container->location));
+
+ cur_GetXYLocation(& ctx->row,& ctx->col);
+ }
+
+ void scommon_PutLine0(ctx,row,col,line)
+ struct menu_context * ctx;
+ int row;
+ int col;
+ CONST char *line;
+ {
+ int rline, remove;
+ struct menu_context * parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLine0",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_Putline0(%p,%d,%d,\"%s\")\n",
+ ctx,row,col,line));
+
+
+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLine0",
+ "Bad parent draw magic number",0);
+
+ if (MENU_SCOMMON_magic != ctx->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLine0",
+ "Bad subpage magic number",0);
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* Need to calculate absolute from relative position */
+
+ parent->routine->wra_calculate_line(parent,
+ ctx->u.common->rel_start_line + row,
+ &rline);
+ ctx->row = rline;
+ ctx->col = col;
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+
+ cur_PutLine0(rline,col,line, & (ctx->container->location));
+
+ cur_GetXYLocation(& ctx->row,& ctx->col);
+ }
+
+ void scommon_CleartoEOLN(ctx)
+ struct menu_context * ctx;
+ {
+ int remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLineS",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_CleartoEOLN(%p)\n",ctx));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw
+ */
+
+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location)); /* syncronize position */
+ if (ctx->container->location.gone_out)
+ return; /* Not in drawing area */
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+ cur_CleartoEOLN();
+
+ /* CleartoEOLN do not move cursor ... */
+ }
+
+ void scommon_CleartoEOS(ctx)
+ struct menu_context * ctx;
+ {
+ int row, remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLineS",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_CleartoEOS(%p)\n",ctx));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw
+ */
+
+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location)); /* syncronize position */
+ if (ctx->container->location.gone_out)
+ return; /* Not in drawing area */
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+
+ /* Cant use cur_CleartoEOS() -- clear rest of current line*/
+ cur_CleartoEOLN();
+
+ /* clear rest of lines */
+ for (row = ctx->row+1; row <= ctx->container->location.last_line; row++) {
+ cur_MoveCursor(row,0, & (ctx->container->location)); /* syncronize position */
+ cur_CleartoEOLN();
+ }
+
+ /* CleartoEOS do not move cursor ... */
+ }
+
+ struct charset_state * scommon_ReadCh2(ctx,flags,break_flag)
+ struct menu_context *ctx;
+ int flags;
+ int break_flag;
+ {
+ int remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_ReadCh2",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_ReadCh2(%p,%d,%d)\n",ctx,flags,break_flag));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw
+ */
+
+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location)); /* syncronize position */
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+
+ return cur_ReadCh2(flags,break_flag);
+ }
+
+ int scommon_ReadCh(ctx,flags,break_flag)
+ struct menu_context *ctx;
+ int flags;
+ int break_flag;
+ {
+ int remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_ReadCh",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_ReadCh(%p,%d,%d)\n",ctx,flags,break_flag));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw
+ */
+
+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location)); /* syncronize position */
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+ return cur_ReadCh(flags,break_flag);
+ }
+
+ void scommon_ScreenSize(ctx,lines,columns)
+ struct menu_context *ctx;
+ int *lines;
+ int *columns;
+ {
+
+ DPRINT(Debug,11, (&Debug, "scommon_ScreenSize(%p,%p,%p)\n",
+ ctx,lines,columns));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* ? ? ? */
+
+ *lines = ctx->lines;
+ *columns = ctx->columns;
+ }
+
+ void scommon_GetXYLocation(ctx,row,col)
+ struct menu_context *ctx;
+ int *row;
+ int *col;
+ {
+ struct menu_context * parent;
+ int diff;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_GetXYLocation",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_getXYLocation(%p,%p,%p)\n",
+ ctx,row,col));
+
+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_GetXYLocation",
+ "Bad parent draw magic number",0);
+
+ if (MENU_SCOMMON_magic != ctx->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_GetXYLocation",
+ "Bad subpage magic number",0);
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* Need to calculate absolute from relative position */
+
+ parent->routine->wra_calculate_line(parent,
+ ctx->u.common->rel_start_line,
+ &diff);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw
+ */
+
+
+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location)); /* syncronize position */
+
+ *col = ctx->col;
+ *row = ctx->row - diff;
+ }
+
+ void scommon_ClearScreen(ctx)
+ struct menu_context *ctx;
+ {
+ int row, remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_ClearScreen",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_ClearScreen(%p)\n"));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* cur_ClearScreen() reset redraw flag ... we simulate it also on here */
+ ctx->redraw = 0;
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+
+ /* clear lines */
+ for (row = ctx->container->location.first_line;
+ row <= ctx->container->location.last_line;
+ row++) {
+ cur_MoveCursor(row, 0, & (ctx->container->location)); /* syncronize position */
+ cur_CleartoEOLN();
+ }
+
+ /* ClearScreen do not move cursor ... */
+ }
+
+ void scommon_MoveCursor(ctx,row,col)
+ struct menu_context *ctx;
+ int row;
+ int col;
+ {
+ int rline;
+ struct menu_context * parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_MoveCursor",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_MoveCursor(%p,%d,%d)\n",
+ ctx,row,col));
+
+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_MoveCursor",
+ "Bad parent draw magic number",0);
+
+ if (MENU_SCOMMON_magic != ctx->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_MoveCursor",
+ "Bad subpage magic number",0);
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* Need to calculate absolute from relative position */
+
+ parent->routine->wra_calculate_line(parent,
+ ctx->u.common->rel_start_line + row,
+ &rline);
+ ctx->row = rline;
+ ctx->col = col;
+
+ cur_MoveCursor(rline, col, & (ctx->container->location));
+ }
+
+ void scommon_changemode(ctx,start,end)
+ struct menu_context *ctx;
+ int start;
+ int end;
+ {
+ int remove;
+
+ DPRINT(Debug,11, (&Debug, "scommon_changemode(%p,%d,%d)\n",
+ ctx,start,end));
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ remove &= ~start;
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+ cur_changemode(&ctx->modes, start, end);
+
+ CUR_modes = ctx->modes;
+ }
+
+ void scommon_SyncEnter(ctx)
+ struct menu_context *ctx;
+ {
+ int remove;
+
+ DPRINT(Debug,10, (&Debug,
+ "scommon_SyncEnter: %p: Setting mode=0x%02x row=%d col=%d\n",
+ ctx,ctx->modes,ctx->row,ctx->col));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+ /* Move cursor */
+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location));
+ }
+
+ void scommon_SyncLeave(ctx)
+ struct menu_context *ctx;
+ {
+ /* disable attributes */
+ cur_changemode(&CUR_modes,0,ctx->modes);
+
+ /* Remember cursor location */
+
+ cur_GetXYLocation(&ctx->row, &ctx->col);
+
+ DPRINT(Debug,10, (&Debug,
+ "scommon_SyncLeave: %p: mode=0x%02x row=%d col=%d\n",
+ ctx,ctx->modes,ctx->row,ctx->col));
+
+ }
+
+ void scommon_resized(ctx)
+ struct menu_context *ctx;
+ {


+ struct menu_context *parent;
+

+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_resized",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_resized(%p)\n",ctx));
+
+ parent = ctx->container->parent;
+
+ /* FIX: resizing of lines not supported */
+
+ ctx->columns = parent->columns;
+ ctx->changed = parent->changed; /* ? ? ? ? */
+
+ calculate_printing_area(ctx);
+ }
+
+ void scommon_calculate_line(ctx,rel_line,result)
+ struct menu_context *ctx;
+ int rel_line;
+ int *result;
+ {
+ struct menu_context * parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_calculate_line",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_calculate_line(%p,%d,%p)\n",
+ ctx,rel_line,result));
+
+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_calculate_line",
+ "Bad parent draw magic number",0);
+
+ if (MENU_SCOMMON_magic != ctx->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_calculate_line",
+ "Bad subpage magic number",0);
+
+ /* Need to calculate absolute from relative position */
+
+ parent->routine->wra_calculate_line(parent,
+ ctx->u.common->rel_start_line + rel_line,
+ result);
+ }
+
+ void scommon_get_linelimit(ctx,startline,endline)
+ struct menu_context *ctx;
+ int *startline;
+ int *endline;
+ {
+ int S, E;
+ struct menu_context * parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_get_linelimit",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_get_linelimit(%p,%p,%p)\n",
+ ctx,startline,endline));
+
+ *startline = ctx->container->location.first_line;
+ *endline = ctx->container->location.last_line;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_get_linelimit",
+ "Bad container magic number",0);
+
+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_get_linelimit",
+ "Bad parent draw magic number",0);
+
+ parent->routine->wra_get_linelimit(parent,&S,&E);
+
+ if (*startline < S)
+ *startline = S;
+
+ if (*endline > E)
+ *endline = E;
+ }
+
+ /* called by need_redraw() */
+ void scommon_reset_redraw(ctx)
+ struct menu_context *ctx;
+ {


+ struct menu_context *parent;
+

+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_reset_redraw",
+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_reset_redraw(%p)\n",
+ ctx));
+
+ parent = ctx->container->parent;
+
+ ctx->redraw = parent->redraw; /* ? ? ? ? */
+ }
+
+ #if 0
+ void scommon_mp_set_any P_((struct menu_context *ptr,
+ int idx,
+ struct menu_param *v));
+
+ void scommon_mp_set_any(ptr,idx,v)
+ struct menu_context *ptr;
+ int idx;
+ struct menu_param *v;
+ {
+ if (MENU_SCOMMON_magic != ptr->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_mp_set_any",


+ "Bad magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_mp_set_any(%p,%d,%p)\n",
+ ptr,idx,v));
+
+ mp_set_any1(ptr->u.common->param_ptr,idx,v);
+ }
+ #endif
+
+ void scommon_relocate(subpage,parent,rel_start_line,lines)
+ struct menu_context *subpage;
+ struct menu_context *parent;
+ int rel_start_line;
+ int lines;


+ {
+ if (MENU_CONTEXT_magic != subpage->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",
+ "Bad subpage magic number",0);
+
+
+ if (MENU_SCOMMON_magic != subpage->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",
+ "Bad subpage magic number",0);
+

+ if (MENU_CONTEXT_magic != parent->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",
+ "Bad parent magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_relocate(%p,%p,%d,%d)\n",
+ subpage,parent,rel_start_line,lines));
+
+ subpage->lines = lines;


+ subpage->columns = parent->columns;

+ subpage->u.common->rel_start_line = rel_start_line;
+
+ if (subpage->container) {


+ if (MENU_CONTAINER_magic != subpage->container->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",
+ "Bad container magic number",0);
+
+ if (parent != subpage->container->parent) {
+ detach_subpage(subpage);
+ goto attach_new;
+ }
+
+
+ } else {
+ int rline, lline;
+
+ attach_new:
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",
+ "Bad parent draw magic number",0);
+
+
+ parent->routine->wra_calculate_line(parent,rel_start_line,&rline);
+
+ lline = rline + lines -1; /* calculate_printing_area() fixes */
+
+ attach_subpage(parent,subpage,rline,lline);
+ }
+
+ calculate_printing_area(subpage);


+ }
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/src/screen/screen.c
*** elm2.4.ME+.121/src/screen/screen.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/screen/screen.c 2005-05-29 10:11:04.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: screen.c,v 1.10 2004/07/14 11:17:24 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: screen.c,v 1.17 2005/05/29 07:11:04 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
***************
*** 20,25 ****
--- 20,30 ----

DEBUG_VAR(Debug,__FILE__,"screen");

+ static struct menu_context * sync_ctx = NULL;
+
+ #define SYNC(x) while (x != sync_ctx) { Syncronize(x); }
+
+ static void StartSyncronize P_((struct menu_context *ctx));

static void PutLineS P_((struct string *S));

***************
*** 28,35 ****
{

DPRINT(Debug,49, (&Debug, "PutLineS(\"%S\")\n",S));
!
! cur_PutLineS(S);
}


--- 33,41 ----
{

DPRINT(Debug,49, (&Debug, "PutLineS(\"%S\")\n",S));
!
! SYNC(default_context);
! cur_PutLineS(S,NULL);
}


***************
*** 40,45 ****
--- 46,57 ----
Raw(state);
}

+ static void ClearScreen0 P_((void));
+ static void ClearScreen0()
+ {
+ ClearScreen(0);
+ }
+
int InitScreen(struct menu_context **page)
{
int r;
***************
*** 50,56 ****
r = cur_InitScreen();

set_start_run_hooks(print_status,RawState,Raw0,
! start_run_tty_init,ClearScreen,
PutLineS, print_status_cooked);

/* Real lines .. not lines-1 !!! */
--- 62,68 ----
r = cur_InitScreen();

set_start_run_hooks(print_status,RawState,Raw0,
! start_run_tty_init,ClearScreen0,
PutLineS, print_status_cooked);

/* Real lines .. not lines-1 !!! */
***************
*** 59,65 ****
set_root_menu(lines,columns);

*page = new_menu_context();
!
return r;
}

--- 71,77 ----
set_root_menu(lines,columns);

*page = new_menu_context();
!
return r;
}

***************
*** 69,75 ****
{
DPRINT(Debug,49, (&Debug, "Writechar('%c')\n",ch));

! cur_Writechar(ch);
}

/*VARARGS2*/
--- 81,105 ----
{
DPRINT(Debug,49, (&Debug, "Writechar('%c')\n",ch));

! SYNC(default_context);
! cur_Writechar(ch, NULL);
! }
!
! void menu_Writechar(ctx,ch)
! struct menu_context * ctx;
! int ch;
! {
! DPRINT(Debug,49, (&Debug, "menu_Writechar(%p,'%c')\n",ctx,ch));
!
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_Writechar",
! "Bad type magic number",0);
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_Writechar",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_Writechar(ctx,ch);
}

/*VARARGS2*/
***************
*** 92,97 ****
--- 122,129 ----

DPRINT(Debug,49, (&Debug, "Write_to_screen(format=\"%s\",...)\n",format));

+ SYNC(default_context);
+
Va_start(vl, msg); /* defined in defs.h */

/** This routine writes to the screen at the current location.
***************
*** 106,118 ****

}

void PutLine0(x, y, line)


int x,y;
CONST char *line;
{

DPRINT(Debug,49, (&Debug, "PutLine0(%d,%d,\"%s\")\n",x,y,line));

! cur_PutLine0(x,y,line);
}


--- 138,221 ----

}

+
+ /*VARARGS2*/
+
+ void menu_Write_to_screen (
+ #if ANSI_C
+ struct menu_context * ctx,
+ CONST char *format, CONST char *msg, ...
+ #else
+ ctx, format, msg, va_alist
+ #endif
+ )
+ #if !ANSI_C
+ struct menu_context * ctx;
+ CONST char *format;
+ CONST char *msg;
+ va_dcl
+ #endif
+ {
+ va_list vl;
+ struct string *text;
+
+ DPRINT(Debug,49, (&Debug,
+ "menu_Write_to_screen(%p,format=\"%s\",...)\n",
+ ctx,format));
+
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_Write_to_screen",
+ "Bad type magic number",0);
+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_Write_to_screen",
+ "Bad draw magic number",0);
+
+ SYNC(ctx);
+
+ Va_start(vl, msg); /* defined in defs.h */
+
+ /** This routine writes to the screen at the current location.
+ when done, it increments lines & columns accordingly by
+ looking for "\n" sequences... **/
+
+ text = elm_smessage(0,format,msg,vl);
+
+ ctx->routine->wra_PutLineS(ctx,text);
+
+ free_string(&text);
+
+ va_end(vl);
+
+ }
+
void PutLine0(x, y, line)


int x,y;
CONST char *line;
{

DPRINT(Debug,49, (&Debug, "PutLine0(%d,%d,\"%s\")\n",x,y,line));

! SYNC(default_context);
! cur_PutLine0(x,y,line,NULL);
! }
!
! void menu_PutLine0(ctx, x, y, line)
! struct menu_context * ctx;
! int x,y;
! CONST char *line;
! {
! DPRINT(Debug,49, (&Debug,
! "menu_PutLine0(%p,%d,%d,\"%s\")\n",
! ctx,x,y,line));
!
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_PutLine0",
! "Bad type magic number",0);
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_PutLine0",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_PutLine0(ctx,x,y,line);
}


***************
*** 136,141 ****
--- 239,246 ----

DPRINT(Debug,49, (&Debug, "PutLineX(%d,%d,format=\"%s\",...)\n",x,y,format));

+ SYNC(default_context);


+
Va_start(vl, line); /* defined in defs.h */

MoveCursor(x,y);
***************
*** 148,172 ****

}

!
! int CleartoEOLN()
{
! int r;

DPRINT(Debug,49, (&Debug, "CleartoEOLN()\n"));
- r = cur_CleartoEOLN();

! return r;
}

! int CleartoEOS()
{
! int r;

DPRINT(Debug,49, (&Debug, "CleartoEOS()\n"));
! r = cur_CleartoEOS();

! return r;
}

int RawState()
--- 253,351 ----

}

! void menu_PutLineX(
! #if ANSI_C
! struct menu_context * ctx,


! int x, int y, const char *format, const char *line, ...

! #else
! ctx, x, y, format, line, va_alist
! #endif
! )
! #if !ANSI_C
! struct menu_context * ctx;

! int x;
! int y;

! CONST char *format;
! CONST char *line;
! va_dcl
! #endif
{
! va_list vl;
! struct string *text;
!
! DPRINT(Debug,49, (&Debug,
! "menu_PutLineX(%p,%d,%d,format=\"%s\",...)\n",
! ctx, x,y,format));
!
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_PutLineX",
! "Bad type magic number",0);
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_PutLineX",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_MoveCursor(ctx, x, y);
!
! Va_start(vl, line); /* defined in defs.h */
!
!
! text = elm_smessage(0,format,line,vl);
!
! ctx->routine->wra_PutLineS(ctx,text);

+ free_string(&text);
+
+ va_end(vl);
+
+ }
+
+ void CleartoEOLN()
+ {
DPRINT(Debug,49, (&Debug, "CleartoEOLN()\n"));

! SYNC(default_context);
! cur_CleartoEOLN();
}

! void menu_CleartoEOLN(ctx)
! struct menu_context * ctx;
{
! DPRINT(Debug,49, (&Debug, "menu_CleartoEOLN(%p)\n",ctx));
!
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_CleartoEOLN",
! "Bad type magic number",0);
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_CleartoEOLN",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_CleartoEOLN(ctx);
! }

+ void CleartoEOS()
+ {
DPRINT(Debug,49, (&Debug, "CleartoEOS()\n"));
!
! SYNC(default_context);
! cur_CleartoEOS();
! }

! void menu_CleartoEOS(ctx)
! struct menu_context * ctx;
! {
! DPRINT(Debug,49, (&Debug, "menu_CleartoEOS(%p)\n",ctx));
!
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_CleartoEOS",
! "Bad type magic number",0);
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_CleartoEOS",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_CleartoEOS(ctx);
}

int RawState()
***************
*** 209,223 ****
--- 388,416 ----
DPRINT(Debug,4, (&Debug, " ... To ROOT MENU\n"));
}

+ DPRINT(Debug,9, (&Debug,
+ "Raw: default context to %p\n",
+ default_context));
+
+
+ StartSyncronize(default_context);
+
return default_context;
}


if (! cur_RawState() && tite && !on_cooked) {
+
+ EndSyncronize(default_context);
+
DPRINT(Debug,4, (&Debug, "Raw: Switching TO COOKED MENU\n"));

default_context = &COOKED_MENU;

+ DPRINT(Debug,9, (&Debug,
+ "Raw: default context to %p\n",
+ default_context));
+
return default_context;
}
}
***************
*** 239,245 ****

DPRINT(Debug,49, (&Debug, "ReadCh2(%d)\n",flags));

! st = cur_ReadCh2(flags,InGetPrompt,default_context);

return st;
}
--- 432,439 ----

DPRINT(Debug,49, (&Debug, "ReadCh2(%d)\n",flags));

! SYNC(default_context);
! st = cur_ReadCh2(flags,InGetPrompt);

return st;
}
***************
*** 250,258 ****
{
struct charset_state *st;

! DPRINT(Debug,49, (&Debug, "menu_ReadCh2(...,%d)\n",flags));

! st = cur_ReadCh2(flags,InGetPrompt,ptr);

return st;
}
--- 444,480 ----
{
struct charset_state *st;

! DPRINT(Debug,49, (&Debug, "menu_ReadCh2(%p,...,%d)\n",ptr,flags));
!
! if (MENU_CONTEXT_magic != ptr->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh2",
! "Bad type magic number",0);


! if (MENU_DRAW_magic != ptr->routine->magic)

! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh2",
! "Bad draw magic number",0);
!
! SYNC(ptr);
! if (ptr->redraw && (flags & READCH_MASK)) {
! set_last_state(system_charset);
!
! reset_state(last_state,1);
! last_state->caller_flags = (flags & READCH_MASK);
!
! return last_state; /* cur_ReadCh2 checks now default_contect
! */
! }

! if (ptr->changed && (flags & READCH_resize)) {
! set_last_state(system_charset);
!
! reset_state(last_state,1);
! last_state->caller_flags = RESIZE_MARK;
!
! return last_state; /* cur_ReadCh2 checks now default_contect
! */
! }
!
! st = ptr->routine->wra_ReadCh2(ptr,flags,InGetPrompt);

return st;
}
***************
*** 264,270 ****

DPRINT(Debug,49, (&Debug, "ReadCh(%d)\n",flags));

! c = cur_ReadCh(flags,InGetPrompt,default_context);

DPRINT(Debug,50, (&Debug, "ReadCh=0x%02x\n",c));

--- 486,493 ----

DPRINT(Debug,49, (&Debug, "ReadCh(%d)\n",flags));

! SYNC(default_context);
! c = cur_ReadCh(flags,InGetPrompt);

DPRINT(Debug,50, (&Debug, "ReadCh=0x%02x\n",c));

***************
*** 277,289 ****
{
int c;



if (ptr->magic != MENU_CONTEXT_magic)

panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh",


"Bad type magic number",0);

- DPRINT(Debug,49, (&Debug, "menu_ReadCh(...,%d)\n",flags));

! c = cur_ReadCh(flags,InGetPrompt,ptr);

DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x\n",c));

--- 500,532 ----
{
int c;

+ DPRINT(Debug,49, (&Debug, "menu_ReadCh(%p,...,%d)\n",ptr,flags));


+
if (ptr->magic != MENU_CONTEXT_magic)

panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh",
"Bad type magic number",0);


+ if (MENU_DRAW_magic != ptr->routine->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh",
+ "Bad draw magic number",0);
+ SYNC(ptr);
+
+ if (ptr->redraw && (flags & READCH_MASK)) {
+ c = (flags & READCH_MASK);
+ DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x (REDRAW_MARK)\n",c));
+ return c; /* cur_ReadCh checks now
+ default_contect
+ */
+ }
+
+ if (ptr->changed && (flags & READCH_resize)) {
+ c = RESIZE_MARK;
+ DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x (RESIZE_MARK)\n",c));
+ return c;
+ }


!
! c = ptr->routine->wra_ReadCh(ptr,flags,InGetPrompt);

DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x\n",c));

***************
*** 301,361 ****
cur_ScreenSize(lines,columns);

((*lines)--);

}

void GetXYLocation(x,y)
int *x,*y;
{
DPRINT(Debug,49, (&Debug, "GetXYLocation(*,*)\n"));

cur_GetXYLocation(x,y);
}

/* NOTE: Is called fron interrupt! */
! int ClearScreen()
{
! int r;

! DPRINT(Debug,49, (&Debug, "ClearScreen()\n"));

! r = cur_ClearScreen(default_context);

! return r;
}

! int menu_ClearScreen(ptr)
struct menu_context *ptr;
{
int r;



if (ptr->magic != MENU_CONTEXT_magic)

panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ClearScreen",


"Bad type magic number",0);

- DPRINT(Debug,49, (&Debug, "menu_ClearScreen(...)\n"));

! r = cur_ClearScreen(ptr);

! return r;
}

! int MoveCursor(row, col)
int row, col;
{
- int r;
-
DPRINT(Debug,49, (&Debug, "MoveCursor(%d,%d)\n",row,col));

! r = cur_MoveCursor(row, col);

! return r;
}

void CarriageReturn()
{

DPRINT(Debug,49, (&Debug, "CarriageReturn()\n"));
/** move the cursor to the beginning of the current line **/
Writechar('\r');
}
--- 544,703 ----
cur_ScreenSize(lines,columns);

((*lines)--);
+ }
+
+ void menu_ScreenSize(ctx,lines, columns)
+ struct menu_context *ctx;
+ int *lines, *columns;
+ {
+
+ DPRINT(Debug,49, (&Debug, "ScreenSize(%p,*,*)\n",ctx));
+
+ if (ctx->magic != MENU_CONTEXT_magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ScreenSize",
+ "Bad type magic number",0);
+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ScreenSize",
+ "Bad draw magic number",0);

+
+ /* menu_ScreenSize DO NOT return lines-1 (as ScreenSize() did) */
+
+ ctx->routine->wra_ScreenSize(ctx,lines,columns);
}

+
void GetXYLocation(x,y)
int *x,*y;
{
DPRINT(Debug,49, (&Debug, "GetXYLocation(*,*)\n"));

+ SYNC(default_context);
cur_GetXYLocation(x,y);
}

+ void menu_GetXYLocation(ctx,row,col)
+ struct menu_context *ctx;
+ int *row,*col;
+ {
+ DPRINT(Debug,49, (&Debug, "menu_GetXYLocation(%p,*,*)\n",ctx));
+
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_GetXYLocation",
+ "Bad type magic number",0);
+
+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_GetXYLocation",
+ "Bad draw magic number",0);
+
+ SYNC(ctx);
+ ctx->routine->wra_GetXYLocation(ctx,row,col);
+
+ /* WARNING:
+
+ row,col != ctx->row, ctx->col
+
+ because row,col are relative and ctc->row, ctx->col
+ are absolute
+
+ */
+
+ }
+
+
/* NOTE: Is called fron interrupt! */
! void ClearScreen(interrupt)
! int interrupt;
{
! if (interrupt) {

! SIGDPRINT(Debug,49, (&Debug, "ClearScreen() -- interrupt\n"));

! } else {
! DPRINT(Debug,49, (&Debug, "ClearScreen() -- no interrupt\n"));
! SYNC(default_context);
! }

! cur_ClearScreen();
}

! void menu_ClearScreen(ptr)
struct menu_context *ptr;
{
int r;

+
+ DPRINT(Debug,49, (&Debug, "menu_ClearScreen(%p,...)\n",ptr));


+
if (ptr->magic != MENU_CONTEXT_magic)

panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ClearScreen",


"Bad type magic number",0);


! if (MENU_DRAW_magic != ptr->routine->magic)

! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_GetXYLocation",
! "Bad draw magic number",0);

! SYNC(ptr);
! ptr->routine->wra_ClearScreen(ptr);
}

! void MoveCursor(row, col)
int row, col;
{
DPRINT(Debug,49, (&Debug, "MoveCursor(%d,%d)\n",row,col));

! SYNC(default_context);
! cur_MoveCursor(row, col, NULL);
! }

! void menu_MoveCursor(ctx,row, col)
! struct menu_context *ctx;
! int row, col;
! {
! DPRINT(Debug,49, (&Debug, "MoveCursor(%p,%d,%d)\n",ctx,row,col));
!
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_GetXYLocation",
! "Bad type magic number",0);
!
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_GetXYLocation",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_MoveCursor(ctx, row, col);
! }
!
! int menu_GetAbsLine(ctx,row)
! struct menu_context *ctx;
! int row;
! {
! int result;
!
! DPRINT(Debug,49, (&Debug, "menu_GetAbsLine(%p,%d)\n",ctx,row));
!
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_GetAbsLine",
! "Bad type magic number",0);
!
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_GetAbsLine",
! "Bad draw magic number",0);
!
! ctx->routine->wra_calculate_line(ctx,row,&result);
!
! DPRINT(Debug,49, (&Debug, "menu_GetAbsLine=%d\n",result));
! return result;
}

void CarriageReturn()
{

DPRINT(Debug,49, (&Debug, "CarriageReturn()\n"));
+
+ SYNC(default_context);
+
/** move the cursor to the beginning of the current line **/
Writechar('\r');
}
***************
*** 365,444 ****
DPRINT(Debug,49, (&Debug, "NewLine()\n"));
/** move the cursor to the beginning of the next line **/

Writechar('\r');
Writechar('\n');
FlushBuffer();
}

! int modes = 0;

! int StartBold()
{
DPRINT(Debug,49, (&Debug, "StartBold()\n"));
- cur_changemode(&modes, pg_BOLD,0);

! return 0;
}

! int EndBold()
{
DPRINT(Debug,49, (&Debug, "EndBold()\n"));
/** compliment of startbold **/

! cur_changemode(&modes, 0, pg_BOLD);
!
! return 0;
}

! int StartInverse() {
!
DPRINT(Debug,49, (&Debug, "StartInverse()\n"));
- cur_changemode(&modes, pg_INVERSE,0);
-
- return 0;
- }

! int EndInverse() {

DPRINT(Debug,49, (&Debug, "EndInverse()\n"));
- cur_changemode(&modes, 0, pg_INVERSE);
-
- return 0;
- }


- int StartUnderline() {

DPRINT(Debug,49, (&Debug, "StartUnderline()\n"));
- cur_changemode(&modes, pg_UNDERLINE,0);


-
- return 0;
- }

! int EndUnderline() {

DPRINT(Debug,49, (&Debug, "EndUnderline()\n"));
! cur_changemode(&modes, 0, pg_UNDERLINE);
!
! return 0;
}

! int StartHalfbright() {

DPRINT(Debug,49, (&Debug, "StartHalfbright()\n"));
! cur_changemode(&modes, pg_HALFBRIGHT,0);
!
! return 0;
}

! int EndHalfbright() {

DPRINT(Debug,49, (&Debug, "EndHalfbright()\n"));
- cur_changemode(&modes, 0, pg_HALFBRIGHT);

! return 0;
}

int get_tabspacing()
{
DPRINT(Debug,49, (&Debug, "get_tabspacing()\n"));
--- 707,974 ----
DPRINT(Debug,49, (&Debug, "NewLine()\n"));
/** move the cursor to the beginning of the next line **/

+ SYNC(default_context);
+
Writechar('\r');
Writechar('\n');
FlushBuffer();
}

! int CUR_modes = 0;

! void StartBold()
{
DPRINT(Debug,49, (&Debug, "StartBold()\n"));

! SYNC(default_context);
! cur_changemode(&CUR_modes, pg_BOLD,0);
}

! void EndBold()
{
DPRINT(Debug,49, (&Debug, "EndBold()\n"));
/** compliment of startbold **/

! SYNC(default_context);
! cur_changemode(&CUR_modes, 0, pg_BOLD);
}

! void StartInverse()
! {
DPRINT(Debug,49, (&Debug, "StartInverse()\n"));

! SYNC(default_context);
! cur_changemode(&CUR_modes, pg_INVERSE,0);
! }

+ void EndInverse()
+ {
DPRINT(Debug,49, (&Debug, "EndInverse()\n"));

+ SYNC(default_context);
+ cur_changemode(&CUR_modes, 0, pg_INVERSE);
+ }


+ void StartUnderline()
+ {
DPRINT(Debug,49, (&Debug, "StartUnderline()\n"));

! SYNC(default_context);
! cur_changemode(&CUR_modes, pg_UNDERLINE,0);
! }

+ void EndUnderline()
+ {
DPRINT(Debug,49, (&Debug, "EndUnderline()\n"));
!
! SYNC(default_context);
! cur_changemode(&CUR_modes, 0, pg_UNDERLINE);
}

! void StartHalfbright()
! {

DPRINT(Debug,49, (&Debug, "StartHalfbright()\n"));
!
! SYNC(default_context);
! cur_changemode(&CUR_modes, pg_HALFBRIGHT,0);
}

! void EndHalfbright()
! {

DPRINT(Debug,49, (&Debug, "EndHalfbright()\n"));

! SYNC(default_context);
! cur_changemode(&CUR_modes, 0, pg_HALFBRIGHT);
! }
!
! void menu_StartXX(ctx,f)
! struct menu_context *ctx;
! int f;
! {
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_StartXX",
! "Bad type magic number",0);
!
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_StartXX",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_changemode(ctx, f, 0);
! }
!
! void menu_EndXX(ctx,f)
! struct menu_context *ctx;
! int f;
! {
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_EndXX",
! "Bad type magic number",0);
!
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_EndXX",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_changemode(ctx, 0, f);
! }
!
! void EndSyncronize(ctx)
! struct menu_context *ctx;
! {
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"EndSyncronize",
! "Bad type magic number",0);
!
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"EndSyncronize",
! "Bad draw magic number",0);
!
! if (sync_ctx != ctx)
! return; /* Nothing need to do */
!
! if (ctx == &COOKED_MENU) {
! DPRINT(Debug,9, (&Debug, "EndSyncronize: Skippig cooked meny syncronize\n"));
! sync_ctx = NULL;
! return;
! }
!
! DPRINT(Debug,9, (&Debug, "EndSyncronize: Syncronize from %p\n",ctx));
!
! ctx->routine->wra_SyncLeave(ctx);
! sync_ctx = NULL;
}

+ static void StartSyncronize(ctx)
+ struct menu_context *ctx;
+ {
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"EndSyncronize",
+ "Bad type magic number",0);
+
+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"EndSyncronize",
+ "Bad draw magic number",0);
+
+ if (sync_ctx == ctx)
+ return; /* Nothing need to do */
+
+ if (ctx == &COOKED_MENU) {
+ DPRINT(Debug,9, (&Debug, "StartSyncronize: Skippig cooked menu syncronize\n"));
+ sync_ctx = ctx;
+ return;
+ }
+
+ DPRINT(Debug,9, (&Debug, "StartSyncronize: Syncronize to %p\n",ctx));
+
+ ctx->routine->wra_SyncEnter(ctx);
+ sync_ctx = ctx;
+ }
+
+
+ void Syncronize(ctx)
+ struct menu_context *ctx;
+ {
+ if (sync_ctx == ctx)
+ return; /* Nothing need to do */
+
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"Syncronize",
+ "Bad type magic number",0);
+
+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"Syncronize",
+ "Bad draw magic number",0);
+
+ if (sync_ctx == &COOKED_MENU) {
+ DPRINT(Debug,9, (&Debug, "Syncronize: Skippig cooked menu syncronize\n"));
+ sync_ctx = NULL;
+ }
+
+
+ if (sync_ctx) {
+ if (MENU_CONTEXT_magic != sync_ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"Syncronize",
+ "Bad type magic number",0);
+
+ if (MENU_DRAW_magic != sync_ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"Syncronize",
+ "Bad draw magic number",0);
+
+ DPRINT(Debug,9, (&Debug, "Syncronize: Syncronize from %p\n",sync_ctx));
+
+ sync_ctx->routine->wra_SyncLeave(sync_ctx);
+ }
+
+ if (ctx == &COOKED_MENU) {
+ DPRINT(Debug,9, (&Debug, "Syncronize: Skippig cooked menu syncronize\n"));
+ sync_ctx = ctx;
+ return;
+ }
+
+ DPRINT(Debug,9, (&Debug, "Syncronize: Syncronize to %p\n",ctx));
+
+ ctx->routine->wra_SyncEnter(ctx);
+ sync_ctx = ctx;
+ }
+
+ void menu_set_default(ctx)
+ struct menu_context *ctx;
+ {
+ if (default_context == ctx)
+ return;
+
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_set_default",
+ "Bad type magic number",0);
+
+ if (sync_ctx->routine != &CURSES_ROUTINES)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_set_default",
+ "Not a main menu",0);
+
+ SYNC(ctx);
+ default_context = ctx;
+
+ DPRINT(Debug,9, (&Debug, "menu_set_default: Clearing screen, and setting redraw flag\n"));
+ cur_ClearScreen();
+ ctx->redraw = 1;
+
+
+ DPRINT(Debug,9, (&Debug,
+ "menu_set_default: default context to %p\n",
+ default_context));
+ }
+
+ void mp_list_set_integer(list,idx,v)
+ struct menu_param *list;
+ int idx;
+ int v;
+ {
+ struct menu_param v1;
+
+ v1.t = mp_integer;
+ v1.u.i = v;
+
+ mp_set_any1(list,idx,&v1);
+ }
+
+ void mp_list_set_mcommon(list,idx,v)
+ struct menu_param *list;
+ int idx;
+ struct menu_common *v;
+ {
+ struct menu_param v1;
+
+ v1.t = mp_menu_common;
+ v1.u.c = v;
+
+ mp_set_any1(list,idx,&v1);
+ }
+
+
int get_tabspacing()
{
DPRINT(Debug,49, (&Debug, "get_tabspacing()\n"));
Index: elm2.4.ME+.122-cvs/src/screen/subpage.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/src/screen/subpage.c 2005-05-21 20:58:32.000000000 +0300
***************
*** 0 ****
--- 1,181 ----
+ static char rcsid[] = "@(#)$Id: subpage.c,v 1.8 2005/05/21 17:58:32 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>

+ *****************************************************************************/
+
+ #include "def_screen.h"
+ #include "def_scommon.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+

+ #define MENU_SUBPAGE_magic 0xF803
+

+ struct menu_subpage {
+ struct subpage_common c;
+ unsigned short magic; /* MENU_SUBPAGE_magic */
+
+ subpage_simple_redraw * redraw_routine;


+ };
+
+
+ #if ANSI_C

+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ int subpage_simple_noredraw P_((struct menu_context *ptr,


+ struct menu_param *list));
+

+ S_(w_menu_init subpage_init)
+ static void subpage_init P_((struct menu_context *ctx));
+ static void subpage_init(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "subpage_init: %p\n",
+ ctx));
+
+ ctx->u.subpage = safe_malloc (sizeof (* ctx->u.subpage));


+
+ /* bzero is defined hdrs/defs.h */

+ bzero((void *)ctx->u.subpage,sizeof (* ctx->u.subpage));
+
+ scommon_zero(&(ctx->u.subpage->c));
+ ctx->u.subpage->magic = MENU_SUBPAGE_magic;
+
+ ctx->u.subpage->redraw_routine = subpage_simple_noredraw;
+ }
+
+ S_(w_menu_free subpage_free)
+ static void subpage_free P_((struct menu_context *ctx));
+ static void subpage_free(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "subpage_free: %p\n",
+ ctx));
+
+ if (MENU_SUBPAGE_magic != ctx->u.subpage->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"subpage_free",


+ "Bad magic number",0);
+

+ scommon_clear( & (ctx->u.subpage->c) );
+
+ ctx->u.subpage->magic = 0; /* Invalidate */
+ free(ctx->u.subpage);
+ ctx->u.subpage = NULL;
+ }
+
+
+ S_(w_menu_do_redraw subpage_do_redraw)
+ static int subpage_do_redraw P_((struct menu_context *ctx));
+ static int subpage_do_redraw(ctx)
+ struct menu_context *ctx;
+ {
+ if (MENU_SUBPAGE_magic != ctx->u.subpage->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"subpage_do_redraw",


+ "Bad magic number",0);
+

+ return ctx->u.subpage->redraw_routine(ctx,
+ ctx->u.subpage->c.param_ptr);
+ }
+
+
+ static struct menu_draw_routine SUBPAGE_ROUTINES = {
+ MENU_DRAW_magic,
+
+ subpage_init,
+ subpage_free,
+
+ scommon_Writechar,
+ scommon_PutLineS,
+ scommon_PutLine0,
+ scommon_CleartoEOLN,
+ scommon_CleartoEOS,
+ scommon_ReadCh2,
+ scommon_ReadCh,
+ scommon_ScreenSize,
+ scommon_GetXYLocation,
+ scommon_ClearScreen,
+ scommon_MoveCursor,
+ scommon_changemode,
+ scommon_SyncEnter,
+ scommon_SyncLeave,
+ scommon_resized,
+ scommon_calculate_line,
+ scommon_get_linelimit,
+ scommon_reset_redraw,
+ subpage_do_redraw,
+ };
+
+ int subpage_simple_noredraw(ptr,list)
+ struct menu_context *ptr;
+ struct menu_param *list;


+ {
+ return 0;
+ }
+

+ struct menu_context * new_menu_subpage(parent,rel_start_line,lines,redraw,
+ list)
+ struct menu_context *parent;
+ int rel_start_line;
+ int lines;
+ subpage_simple_redraw redraw;


+ struct menu_param *list;
+ {

+ int rline = 0;
+ int lline = 0;
+
+ struct menu_context *ret = new_menu_type(&SUBPAGE_ROUTINES);


+
+ if (MENU_CONTEXT_magic != parent->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_subpage",
+ "Bad parent magic number",0);
+
+ ret->lines = lines;
+ ret->columns = parent->columns;
+ ret->u.subpage->c.rel_start_line = rel_start_line;
+ ret->u.subpage->c.param_ptr = list;
+ ret->u.subpage->redraw_routine = redraw;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_subpage",
+ "Bad parent draw magic number",0);
+
+ parent->routine->wra_calculate_line(parent,rel_start_line,&rline);
+
+ lline = rline + lines -1; /* calculate_printing_area() fixes */
+
+ attach_subpage(parent,ret,rline,lline);
+
+ calculate_printing_area(ret);


+
+ return ret;
+ }
+

+ void menu_subpage_relocate(subpage,parent,rel_start_line,lines)
+ struct menu_context *subpage;
+ struct menu_context *parent;
+ int rel_start_line;
+ int lines;
+ {
+
+ if (&SUBPAGE_ROUTINES != subpage->routine)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_subpage_relocate",
+ "Not a subpage",0);
+
+ scommon_relocate(subpage,parent,rel_start_line,lines);


+ }
+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/src/screen/termcharset.c
*** elm2.4.ME+.121/src/screen/termcharset.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/screen/termcharset.c 2005-03-16 21:05:35.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: termcharset.c,v 1.4 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: termcharset.c,v 1.9 2005/03/16 19:05:35 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 11,17 ****
DEBUG_VAR(Debug,__FILE__,"elmpage");

charset_t target_display_charset = NULL;
- struct charset_state * last_state = NULL;
screen_info_p last_display_state = NULL;


--- 11,16 ----
***************
*** 54,63 ****
--- 53,115 ----
return 0;

target_display_charset = set;
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "set_display_charset: Initializes target_display_charset to %s\n",
+ target_display_charset->MIME_name ?
+ target_display_charset->MIME_name : ""));
+
+
switch_display_charset(1);
return 1;
}

+ void init_system_charset()
+ {
+ char *str;
+
+ /* Changes system_charset to type unknown if system supports
+ wide characters and there is DW flag on terminal.info
+ */
+ terminal_change_system_charset(terminal_type);
+
+ target_display_charset = system_charset;
+ display_charset = system_charset;
+
+ if (!last_display_state) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "init_system_charset: Creating terminal state\n"));
+
+ last_display_state = create_terminal_info();
+ }
+
+ /* if buffer is set to NULL, malloces result */
+ str = terminal_set_info(terminal_type,system_charset,last_display_state);
+
+ if (str) {
+ int i;
+
+ DPRINT(Debug,4,(&Debug,
+ "init_system_charset: Extra initialization for %s (",
+ system_charset->MIME_name ?
+ system_charset->MIME_name : "<no MIME name>"));
+ for (i = 0; str[i]; i++) {
+ DPRINT(Debug,4,(&Debug,
+ "%s%02X",
+ i ? " " : "", str[i]));
+ }
+ DPRINT(Debug,4,(&Debug,
+ ") for terminal %s\n",terminal_type));
+
+ for (i = 0; str[i]; i++) {
+ outchar(str[i]);
+ }
+
+ free(str);
+ }
+ }
+
+
void switch_display_charset(to_display)
int to_display;
{
***************
*** 66,77 ****
charset_t t;
char * str;

! if (!target_display_charset)
target_display_charset = display_charset;
!

- if (!last_display_state)
- last_display_state = create_terminal_info();


t = to_display ? target_display_charset : system_charset;
--- 118,137 ----
charset_t t;
char * str;

! if (!target_display_charset) {
target_display_charset = display_charset;
! SIGDPRINT(Debug,4,(&Debug,
! "switch_display_charset: Initializes target_display_charset to %s\n",
! target_display_charset->MIME_name ?
! target_display_charset->MIME_name : ""));
! }
!
! if (!last_display_state) {
! SIGDPRINT(Debug,4,(&Debug,
! "switch_display_charset: Creating terminal state\n"));
! last_display_state = create_terminal_info();
! }



t = to_display ? target_display_charset : system_charset;
***************
*** 82,89 ****
return;
}

! str = terminal_switch_to(terminal_type,t,&last_display_state,
! buffer, sizeof buffer);

if (str) {
int i;
--- 142,149 ----
return;
}

! str = terminal_switch_to(terminal_type,t,last_display_state,
! buffer, sizeof buffer, 1);

if (str) {
int i;
Index: elm2.4.ME+.122-cvs/src/screen/wrapper.c


*** /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300

--- elm2.4.ME+.122-cvs/src/screen/wrapper.c 2005-02-13 22:41:38.000000000 +0200
***************
*** 0 ****
--- 1,280 ----
+ static char rcsid[] = "@(#)$Id: wrapper.c,v 1.7 2005/02/13 20:41:38 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>

+ *****************************************************************************/
+
+ #include "def_screen.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");


+
+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ static void CUR_init P_((struct menu_context *ctx));
+ static void CUR_init(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "CUR_init: %p\n",
+ ctx));
+
+ }
+
+ static void CUR_free P_((struct menu_context *ctx));
+ static void CUR_free(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "CUR_free: %p\n",
+ ctx));
+
+ }
+
+
+ static void CUR_Writechar P_((struct menu_context * ctx, int ch));
+ static void CUR_Writechar(ctx,ch)
+ struct menu_context * ctx;
+ int ch;
+ {
+ cur_Writechar(ch, NULL);
+ }
+
+ static void CUR_PutLineS P_((struct menu_context * ctx,
+ struct string *text));
+ static void CUR_PutLineS(ctx,text)
+ struct menu_context * ctx;
+ struct string *text;
+ {
+
+ cur_PutLineS(text,NULL);
+ }
+
+ static void CUR_PutLine0 P_((struct menu_context * ctx,


+ int x, int y,

+ const char *line));
+ static void CUR_PutLine0(ctx,x,y,line)
+ struct menu_context * ctx;
+ int x;
+ int y;
+ CONST char *line;
+ {
+ cur_PutLine0(x,y,line,NULL);
+ }
+
+ static void CUR_CleartoEOLN P_((struct menu_context * ctx));
+ static void CUR_CleartoEOLN(ctx)
+ struct menu_context * ctx;
+ {
+ cur_CleartoEOLN();
+ }
+
+ static void CUR_CleartoEOS P_((struct menu_context * ctx));
+ static void CUR_CleartoEOS(ctx)
+ struct menu_context * ctx;
+ {
+ cur_CleartoEOS();
+ }
+
+ static struct charset_state * CUR_ReadCh2 P_((struct menu_context *ctx,
+ int flags,
+ int break_flag));
+ static struct charset_state * CUR_ReadCh2(ctx,flags,break_flag)
+ struct menu_context *ctx;
+ int flags;
+ int break_flag;
+ {
+
+ return cur_ReadCh2(flags,break_flag);
+ }
+
+ static int CUR_ReadCh P_((struct menu_context *ctx,
+ int flags,
+ int break_flag));
+ static int CUR_ReadCh(ctx,flags,break_flag)
+ struct menu_context *ctx;
+ int flags;
+ int break_flag;
+ {
+ return cur_ReadCh(flags,break_flag);
+ }
+
+ static void CUR_ScreenSize P_((struct menu_context *ctx,


+ int *lines, int *columns));
+

+ static void CUR_ScreenSize(ctx,lines,columns)
+ struct menu_context *ctx;
+ int *lines;
+ int *columns;
+ {
+ cur_ScreenSize(lines,columns);
+
+ /* ? ? ? syncronize? */
+ ctx->lines = *lines;
+ ctx->columns = *columns;
+ }
+
+ static void CUR_GetXYLocation P_((struct menu_context *ctx,
+ int *x, int *y));
+ static void CUR_GetXYLocation(ctx,x,y)
+ struct menu_context *ctx;
+ int *x;
+ int *y;
+ {
+ cur_GetXYLocation(x,y);
+ }
+
+ static void CUR_ClearScreen P_((struct menu_context *ctx));
+ static void CUR_ClearScreen(ctx)
+ struct menu_context *ctx;
+ {
+ ctx->redraw = 0; /* cur_ClearScreen() clear flag from
+ default_context now */
+ cur_ClearScreen();
+ }
+
+ static void CUR_MoveCursor P_((struct menu_context *ctx,
+ int row, int col));
+ static void CUR_MoveCursor(ctx,row,col)
+ struct menu_context *ctx;
+ int row;
+ int col;
+ {
+ cur_MoveCursor(row, col,NULL);
+ }
+
+ static void CUR_changemode P_((struct menu_context *ctx,
+ int start, int end));
+ static void CUR_changemode(ctx,start,end)
+ struct menu_context *ctx;
+ int start;
+ int end;
+ {
+ cur_changemode(&ctx->modes, start, end);
+ }
+
+ static void CUR_SyncEnter P_((struct menu_context *ctx));
+ static void CUR_SyncEnter(ctx)
+ struct menu_context *ctx;
+ {
+ DPRINT(Debug,10, (&Debug,
+ "CUR_SyncEnter: %p: Setting mode=0x%02x row=%d col=%d\n",
+ ctx,ctx->modes,ctx->row,ctx->col));
+
+ /* Switch attributes */
+ cur_changemode(&CUR_modes,ctx->modes,CUR_modes);
+
+ /* Move cursor */
+ cur_MoveCursor(ctx->row,ctx->col,NULL);
+ }
+
+ static void CUR_SyncLeave P_((struct menu_context *ctx));
+ static void CUR_SyncLeave(ctx)
+ struct menu_context *ctx;
+ {
+ /* Remeber attributes */
+ ctx->modes |= CUR_modes;
+
+ /* disable attributes */
+ cur_changemode(&CUR_modes,0,ctx->modes);
+
+ /* Remember cursor location */
+
+ cur_GetXYLocation(&ctx->row, &ctx->col);
+
+ DPRINT(Debug,10, (&Debug,
+ "CUR_SyncLeave: %p: mode=0x%02x row=%d col=%d\n",
+ ctx,ctx->modes,ctx->row,ctx->col));
+
+ }
+
+ /* called from menu_resized() */
+ static void CUR_resized P_((struct menu_context *ctx));
+ static void CUR_resized(ctx)
+ struct menu_context *ctx;
+ {
+ ctx->lines = ROOT_MENU.lines;
+ ctx->columns = ROOT_MENU.columns;
+ ctx->changed = ROOT_MENU.changed; /* ? ? ? ? */
+ }
+
+ static void CUR_calculate_line P_((struct menu_context *ctx,
+ int rel_line, int *result));
+
+ static void CUR_calculate_line(ctx,rel_line,result)
+ struct menu_context *ctx;
+ int rel_line;
+ int *result;
+ {
+ *result = rel_line;
+ }
+
+ static void CUR_get_linelimit P_((struct menu_context *ctx,
+ int *startline, int *endline));
+ static void CUR_get_linelimit(ctx,startline,endline)
+ struct menu_context *ctx;
+ int *startline;
+ int *endline;
+ {
+ *startline = 0;
+
+ *endline = ctx->lines-1;
+ if (ROOT_MENU.lines <= *endline)
+ *endline = ROOT_MENU.lines-1;
+ }
+
+ /* called by need_redraw() */
+ static void CUR_reset_redraw P_((struct menu_context *ctx));
+ static void CUR_reset_redraw(ctx)
+ struct menu_context *ctx;
+ {
+ ctx->redraw = ROOT_MENU.redraw; /* ? ? ? ? */
+ }
+
+ static int CUR_do_redraw P_((struct menu_context *ctx));
+ static int CUR_do_redraw(ctx)
+ struct menu_context *ctx;


+ {
+ return 0;
+ }
+

+ struct menu_draw_routine CURSES_ROUTINES = {
+ MENU_DRAW_magic,
+
+ CUR_init,
+ CUR_free,
+
+ CUR_Writechar,
+ CUR_PutLineS,
+ CUR_PutLine0,
+ CUR_CleartoEOLN,
+ CUR_CleartoEOS,
+ CUR_ReadCh2,
+ CUR_ReadCh,
+ CUR_ScreenSize,
+ CUR_GetXYLocation,
+ CUR_ClearScreen,
+ CUR_MoveCursor,
+ CUR_changemode,
+ CUR_SyncEnter,
+ CUR_SyncLeave,
+ CUR_resized,
+ CUR_calculate_line,
+ CUR_get_linelimit,
+ CUR_reset_redraw,
+ CUR_do_redraw,


+ };
+
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elm2.4.ME+.122-cvs/src/showmsg.c
*** elm2.4.ME+.121/src/showmsg.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/showmsg.c 2005-03-26 22:18:58.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.38 2004/07/11 11:36:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.48 2005/03/26 20:18:58 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 18,23 ****
--- 18,24 ----

#include "def_elm.h"
#include "s_elm.h"
+ #include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"ui");

***************
*** 26,39 ****
extern int errno;
#endif

! VOLATILE int pipe_abort = FALSE; /* not used anymore, but won't compile without it */
!
!
!
! void OverrideCharset(mailbox, header_page, page)
struct MailboxView *mailbox;


- int header_page;
struct menu_context *page;
{

int oldstat = 0, tagged = 0;
int current = get_current(mailbox);


--- 27,37 ----
extern int errno;

#endif

! void OverrideCharset(mailbox, page, prompt_area, header_area)
struct MailboxView *mailbox;


struct menu_context *page;
+ struct menu_context *prompt_area;

+ struct menu_context *header_area;
{
int oldstat = 0, tagged = 0;
int current = get_current(mailbox);
***************
*** 43,51 ****
int code;
charset_t res = NULL;
int mc,i;


! int LINES, COLUMNS;
!

! menu_get_sizes(page, &LINES, &COLUMNS);

if (chdr)
oldstat = chdr->status; /* remember */
--- 41,48 ----
int code;
charset_t res = NULL;
int mc,i;


! int delay_redraw = 0;

! int line;

if (chdr)
oldstat = chdr->status; /* remember */
***************
*** 68,119 ****
else
strfcpy(override_charset,"none", sizeof override_charset);

! redraw:
if (tagged > 1)
! print_format_center(LINES-3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmOverrideTagged,
! "Override charset of %d tagged messages. Use \"none\" to cancel override."),
! tagged);
else if (1 == tagged)
! print_format_center(LINES-3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmOverrideTaggedOne,
! "Override charset of tagged message. Use \"none\" to cancel override."));
else if (chdr && chdr->override_charset)
! print_format_center(LINES-3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmOverrideCurrentOver,
! "Override charset of current message. Use \"none\" to cancel override."));
else
! print_format_center(LINES-3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmOverrideCurrent,
! "Override charset of current message."));

- PutLineX(LINES-2,0,CATGETS(elm_msg_cat, ElmSet, ElmOverrideCSprompt,
- "Override charset: "));

code = optionally_enter(override_charset,-1,-1,OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,
sizeof override_charset, page);

switch(code) {
case REDRAW_MARK:
goto redraw;


case -1: /* Interrupt */

return;
case 1: /* EOF */
return;


case 0:
/* OK */
break;

default:
DPRINT(Debug,9,(&Debug, "optionally enter returned %d (unexpected)n",
code));
return;
}

if (! override_charset[0])
return;

--- 65,138 ----
else
strfcpy(override_charset,"none", sizeof override_charset);

! redraw:
if (tagged > 1)

! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideTagged,
! "Override charset of %d tagged messages. Use \"none\" to cancel override."),
! tagged);
else if (1 == tagged)

! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideTaggedOne,
! "Override charset of tagged message. Use \"none\" to cancel override."));
else if (chdr && chdr->override_charset)


! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideCurrentOver,
! "Override charset of current message. Use \"none\" to cancel override."));
else


! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideCurrent,
! "Override charset of current message."));


+ /* FIXME --optionally_enter* should use prompt_area */
+ line = menu_GetAbsLine(prompt_area,2);
+
+ menu_PutLineX(page,line,0,CATGETS(elm_msg_cat, ElmSet, ElmOverrideCSprompt,
+ "Override charset: "));
code = optionally_enter(override_charset,-1,-1,OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,
sizeof override_charset, page);

switch(code) {
case REDRAW_MARK:


+ menu_ClearScreen(page); /* Reset possible redraw flag */
+ delay_redraw++; /* Can't trigger redraw yet... */
+

goto redraw;


case -1: /* Interrupt */

+ if (delay_redraw)
+ menu_trigger_redraw(page);

+ menu_trigger_redraw(prompt_area);
+
return;
case 1: /* EOF */


+ if (delay_redraw)
+ menu_trigger_redraw(page);

+ menu_trigger_redraw(prompt_area);
+
return;


case 0:
/* OK */
break;

default:


+ if (delay_redraw)
+ menu_trigger_redraw(page);

+ menu_trigger_redraw(prompt_area);
+
DPRINT(Debug,9,(&Debug, "optionally enter returned %d (unexpected)n",
code));
return;


}

+ if (delay_redraw)
+ menu_trigger_redraw(page);

+ menu_trigger_redraw(prompt_area);
+
if (! override_charset[0])
return;

***************
*** 157,165 ****
for (i=0; i < mc; i++) { /* get each tagged msg */
struct header_rec * hdr = give_header(mailbox,i);
if (hdr && ison(hdr->status, TAGGED)) {
- struct menu_common MENU;

- set_mcommon_from_mbxview(&MENU,mailbox);

hdr->override_charset = res;

--- 176,182 ----
***************
*** 168,174 ****
mime_classify_media(&(hdr->mime_rec),hdr);

clearit(hdr->status, TAGGED);
! show_new_status(i,&MENU,header_page); /* update screen, if needed */


}
--- 185,200 ----
mime_classify_media(&(hdr->mime_rec),hdr);

clearit(hdr->status, TAGGED);
!
! if (header_area) {
! struct menu_common MENU;


! int vis;
!
! set_mcommon_from_mbxview(&MENU,mailbox);

!
! vis = compute_visible(i+1, &MENU);

! menu_header_status_update(header_area,vis-1);
! }


}
***************
*** 180,185 ****
--- 206,270 ----
}


+ struct screen_parts2 {
+ struct menu_context * title_area;


+ struct menu_context * prompt_area;

+ };
+
+ static void set_prompt_screen P_((struct menu_context *page, struct screen_parts2 *LOC, int current));
+ static void set_prompt_screen(page,LOC,current)
+ struct menu_context *page;
+ struct screen_parts2 *LOC;
+ int current;


+ {
+ int LINES, COLUMNS;

+ int C = 5;


+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ if (title_messages && current > 0) {
+ C = 7;
+ }


+
+ /* 1) Title part of screen */
+

+ if (! LOC->title_area)
+ LOC->title_area = new_menu_subpage(page,0,C,
+ subpage_simple_noredraw,NULL);
+ else
+ menu_subpage_relocate(LOC->title_area,page,0,C);
+
+
+ /* 2) Prompt part of screen */
+
+ if (! LOC->prompt_area)
+ LOC->prompt_area = new_menu_subpage(page,C,LINES-C,
+ subpage_simple_noredraw,NULL);
+ else
+ menu_subpage_relocate(LOC->title_area,page,C,LINES-C);
+ }
+
+ static void free_prompt_screen P_((struct screen_parts2 *LOC));
+ static void free_prompt_screen(LOC)
+ struct screen_parts2 *LOC;
+ {
+ erase_menu_context (&(LOC->title_area));
+ erase_menu_context (&(LOC->prompt_area));
+ }
+
+ static void redraw_prompt_screen P_((struct menu_context *page));
+ static void redraw_prompt_screen(page)
+ struct menu_context *page;
+ {
+ menu_ClearScreen(page);


+
+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+

+ show_last_error();
+ }
+
+
/* Returns 0 on quit */

struct prompt_list {
***************
*** 189,227 ****
int col;
};

! static void update_prompt P_((struct prompt_list ** list, int *list_len,
! int *current_offset, int idx,
struct menu_context *page));

! static void update_prompt (list,list_len,current_offset,idx,page)
! struct prompt_list ** list;
! int *list_len;
! int *current_offset;
int idx;
! struct menu_context *page; /* new context assumed */
{
int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES, &COLUMNS);



if (idx < 0) {
int i;

! *current_offset = 0;
menu_ClearScreen(page);

- print_format_center(1,
- CATGETS(elm_msg_cat, ElmSet, ElmMailcapMenu,
- "Mailcap program selection"));
-
for (i = *current_offset;
i >= 0 &&
i < *current_offset - 2 + LINES / 3 &&
i < *list_len;
i++)
! update_prompt(list,list_len,current_offset,i, page);

} else if (idx >= 0 &&
idx >= *current_offset &&
--- 274,435 ----
int col;
};

! struct update_params {
! struct prompt_list ** list;
! int *list_len;
! int *current_offset;
! };
!
! static void update_prompt P_((struct update_params *P,
! int idx,
struct menu_context *page));

!
! static void prompt_Z P_((struct menu_context *page,
! int ask_metamail));
! static void prompt_Z(page,ask_metamail)
! struct menu_context *page;
! int ask_metamail;


! {
! int lin,col;
!

! menu_get_sizes(page, &lin,&col);
!
! if (ask_metamail)
! menu_PutLineX(page,
! lin-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapPage,
! "Press enter for default, use m)etamail or p)age mail: "));
! else
! menu_PutLineX(page,
! lin-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapDone,
! "Press enter for default or use y/n, use m)etamail or d)one: "));
!
! }
!
! static void check_prompt_screen P_((struct screen_parts2 *LOC,
! struct update_params *P,
! int ask_metamail,


! int current,
! int message_count,

! struct header_rec *hdr));
! static void check_prompt_screen(LOC,P,ask_metamail,current,message_count,hdr)
! struct screen_parts2 *LOC;
! struct update_params *P;
! int ask_metamail;
! int current;
! int message_count;
! struct header_rec *hdr;
! {
!
! /* 1) Title part of screen */
! if (menu_resized(LOC->title_area)) {
! DPRINT(Debug,1, (&Debug, "title area resized\n"));
!
! }
!
! if (menu_need_redraw(LOC->title_area)) {
! int X = 1;
!
! DPRINT(Debug,7, (&Debug, "title area redraw\n"));
!
! menu_ClearScreen(LOC->title_area);
!
! if (title_messages && current > 0) {
! int li,co;
! struct string *T;
!
! menu_get_sizes(LOC->title_area,&li,&co);
!
! X = 3;
!
! T = title_text(hdr,current,message_count,
! co,
! display_charset);
!
! menu_PutLineX(LOC->title_area,0,0,FRM("%S"),T);
! free_string(&T);
!
!
! if (hdr->subject)
! menu_print_format_center(LOC->title_area,1,
! FRM("%S"),
! hdr->subject);
!
! }
!
! if (ask_metamail) {
! menu_print_format_center(LOC->title_area,X,
! CATGETS(elm_msg_cat, ElmSet, ElmMetamailMenu,
! "Metamail selection"));
!
! menu_PutLineX(LOC->title_area,X+2,0,
! CATGETS(elm_msg_cat, ElmSet, ElmMetamailMenu1,
! "Viewing of this message requires metamail. Press 'm' to select metamail."));
! menu_PutLineX(LOC->title_area,X+3,0,
! CATGETS(elm_msg_cat, ElmSet, ElmMetamailMenu2,
! "Or you can p)age message without metamail."));
!
! } else {
! menu_print_format_center(LOC->title_area,X,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapMenu,
! "Mailcap program selection"));
!
! menu_PutLineX(LOC->title_area,X+2,0,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapMenu1,
! "Viewing of this message requires external programs (press 'y' to confirm.)"));
!
! menu_PutLineX(LOC->title_area,X+3,0,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapMenu2,
! "To refuse external program press 'n'. Also you can page message with m)etamail."));


!
!
! }
! }
!

! /* 2) Prompt part of screen */
!
! if (menu_resized(LOC->prompt_area)) {
! DPRINT(Debug,1, (&Debug, "prompt area resized\n"));
!
! }
!
! if (menu_need_redraw(LOC->prompt_area)) {
!
! DPRINT(Debug,7, (&Debug, "prompt area redraw\n"));
!
! update_prompt(P,-1, LOC->prompt_area);
!
! prompt_Z(LOC->prompt_area,ask_metamail);
! }
! }
!
! static void update_prompt (P,idx,page)
! struct update_params *P;
int idx;
! struct menu_context *page;
{
int LINES, COLUMNS;
! struct prompt_list ** list = P->list;
! int *list_len = P->list_len;
! int *current_offset = P->current_offset;


+ menu_get_sizes(page,&LINES, &COLUMNS);

if (idx < 0) {
int i;

! *(P->current_offset) = 0;
menu_ClearScreen(page);

for (i = *current_offset;
i >= 0 &&
i < *current_offset - 2 + LINES / 3 &&
i < *list_len;
i++)
! update_prompt(P,i, page);

} else if (idx >= 0 &&
idx >= *current_offset &&
***************
*** 245,252 ****
&visible_len,
COLUMNS-10);

! PutLineX(X,0,FRM("%S ? "),S1);
! CleartoEOLN();

(*list)[idx].col = visible_len+3;

--- 453,460 ----
&visible_len,
COLUMNS-10);

! menu_PutLineX(page,X,0,FRM("%S ? "),S1);
! menu_CleartoEOLN(page);

(*list)[idx].col = visible_len+3;

***************
*** 254,266 ****
(*list)[idx].selected) {

if ((*list)[idx].structure->handler_data->use_entry)
! PutLineX(X,(*list)[idx].col,


CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
"Yes."));
else

! PutLineX(X,(*list)[idx].col,


! CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
}

free_string(&S1);
--- 462,474 ----
(*list)[idx].selected) {

if ((*list)[idx].structure->handler_data->use_entry)
! menu_PutLineX(page,X,(*list)[idx].col,


CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
"Yes."));
else

! menu_PutLineX(page,X,(*list)[idx].col,


! CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
}

free_string(&S1);
***************
*** 340,346 ****

i = (*list_len)++;

! update_prompt(list,list_len,current_offset,i,page);
}
}

--- 548,561 ----

i = (*list_len)++;

! {
! struct update_params P;
! P.list = list;
! P.list_len = list_len;
! P.current_offset = current_offset;
! update_prompt(&P,i,page);
! }
!
}
}

***************
*** 379,624 ****
}
}

! /* return TRUE if metamail is used instead */
! static int prompt_programs P_((struct mimeinfo *structure));
! static int prompt_programs(structure)
! struct mimeinfo *structure;
{
int r = TRUE;

struct prompt_list * list = NULL;
int list_len = 0;
int offset = 0;



struct menu_context *page = new_menu_context();

- int LINES, COLUMNS;
-
- menu_get_sizes(page, &LINES, &COLUMNS);


! update_prompt(&list,&list_len,&offset,-1, page);
!
! prompt_programs_1(structure,&list,&list_len,&offset, page);

! if (list_len > 0) {
! int q = 0;
! int ch;

! /* Check if all programs was trusted ... */

! while (q < list_len &&
! list[q].selected &&
! list[q].structure &&
! list[q].structure->handler_data &&
! list[q].structure->handler_data->use_entry)
! q++;
!
! r = FALSE;
! if (q >= list_len && !internal_mailcap_t_prompt)
! goto out;
!
! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,
! "Answer questions, use m)etamail or q)uit menu: "));

! do {
! int defans;

! resize_mark:
! defans = *def_ans_no;

! if (menu_resized(page)) {
! menu_get_sizes(page, &LINES, &COLUMNS);
}

! if (menu_need_redraw(page))
! goto redraw;
!
! if (q >= list_len) {

! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,
! "Answer questions, use m)etamail or q)uit menu: "));
! defans = 'q';
!
! } else {
! int X = (q - offset) * 3 + 3;
!
! if (X <= 1) {
! offset = q-1;
! if (offset < 0)
! offset = 0;
! ch = REDRAW_MARK;
! goto redraw;
! }

! if (X >= LINES-2) {
! offset = q;
! ch = REDRAW_MARK;
! goto redraw;
! }

! MoveCursor(X,list[q].col);
}
!

! CleartoEOLN(); /* Clear current answer */

! Write_to_screen(FRM("%c%c"),defans,BACKSPACE);
FlushBuffer();
!
!
! ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR|READCH_resize);

! if (ch == '\n')
! ch = defans;

! switch (ch) {
! case RESIZE_MARK:
!
! DPRINT(Debug,4, (&Debug," .... resizing\n"));
! goto resize_mark;
!
! case REDRAW_MARK:
! redraw:
! update_prompt(&list,&list_len,&offset,-1, page);
!
! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,
! "Answer questions, use m)etamail or q)uit menu: "));
! break;
!
! case '-':
! case LEFT_MARK:
! case PAGEUP_MARK:
! offset -= LINES / 3 - 2;
! if (offset < 0)
! offset = 0;
! q = offset;
! goto redraw;
!
! case '+':
! case RIGHT_MARK:
! case PAGEDOWN_MARK:
!
! offset += LINES / 3 - 2;
! if (offset >= list_len);
! offset = list_len-1;
! q = offset;
! goto redraw;
!
! case DOWN_MARK:
! if (q < list_len) {
! update_prompt(&list,&list_len,&offset,q, page);
! q++;
! }
! break;
!
! case UP_MARK:
! if (q < list_len)
! update_prompt(&list,&list_len,&offset,q, page);
! if (q > 0)
! q--;
! break;
!
! case 'q':
ch = 0;
!
! if (q < list_len)
! update_prompt(&list,&list_len,&offset,q, page);
!
! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,
! "Answer questions, use m)etamail or q)uit menu: "));


!
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmQuit,
! "Quit"));

!
! break;
!
! case 'm':
!
! if (q < list_len)
! update_prompt(&list,&list_len,&offset,q, page);
!
! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,
! "Answer questions, use m)etamail or q)uit menu: "));
!
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmMetamail,
! "Metamail"));
!
! if (have_metamail()) {
! ch = 0;
! r = TRUE;
! }
!
! break;
}
!
! if (q < list_len) {

! if (ch == *def_ans_yes) {
! list[q].selected = 1;
! list[q].structure->handler_data->use_entry = 1;
! update_prompt(&list,&list_len,&offset,q, page);
! q++;
! } else if (ch == *def_ans_no) {
!
! list[q].selected = 1;
! list[q].structure->handler_data->use_entry = 0;
! update_prompt(&list,&list_len,&offset,q, page);
! q++;
!
! }
! }
!
! FlushBuffer();

! } while(ch);
! }
!
!
out:
failure:
!
if (list) {
int i;
!
for (i = 0; i < list_len; i++) {
if (list[i].printable_command) {
free(list[i].printable_command);
list[i].printable_command = NULL;
}
}
!
free(list);
list = NULL;
}
list_len = 0;
!
erase_menu_context(&page);
!
return r;
}


! int need_meta (hdr)
struct header_rec *hdr;
{
/* Determine whether or not we need to call metamail to display the
* message contents.
*/
int result = 0;

! if ((hdr->status & (MIME_MESSAGE)) && (hdr->status & MIME_UNSUPPORTED))
! result = have_metamail();
!
/* Do not call metamail if Disposition is not inline */
! else if ((hdr->status & MIME_MESSAGE) &&
! hdr->mime_rec.disposition != DISP_INLINE)
result = FALSE;
else if (hdr->status & (MIME_MESSAGE | PRE_MIME_CONTENT)) {

--- 594,911 ----
}
}

! /* return TRUE if metamail is used instead,
! -1 to cancel
! */
! static int prompt_programs P_((struct header_rec *hdr, int ask_metamail,
! int current, int message_count));
! static int prompt_programs(hdr, ask_metamail, current, message_count)
! struct header_rec *hdr;
! int ask_metamail;
! int current;
! int message_count;
{
int r = TRUE;
+ struct mimeinfo *structure = &(hdr->mime_rec);

struct prompt_list * list = NULL;
int list_len = 0;
int offset = 0;



struct menu_context *page = new_menu_context();

+ struct screen_parts2 LOC = { NULL, NULL };
+ struct update_params P;


+ int q = 0;

+ int ch;

! if (ask_metamail)
! ask_metamail = have_metamail();

! P.list = &list;
! P.list_len = &list_len;
! P.current_offset = &offset;

! set_prompt_screen(page,&LOC,current);

! redraw_prompt_screen(page);
!
! prompt_programs_1(structure,&list,&list_len,&offset, LOC.prompt_area);

! check_prompt_screen(&LOC,&P,ask_metamail, current,message_count,hdr);

! /* Check if all programs was trusted ... */
!
! while (q < list_len &&
! list[q].selected &&
! list[q].structure &&
! list[q].structure->handler_data &&
! list[q].structure->handler_data->use_entry)
! q++;
!
! r = FALSE;
! if (q >= list_len && !internal_mailcap_t_prompt)
! goto out;
!
! do {
! int defans;
! int sel = q;
!
! resize_mark:
! defans = *def_ans_no;
!
! if (menu_resized(page)) {
! set_prompt_screen(page,&LOC,current);
! }
!
! if (menu_need_redraw(page))
! goto redraw;
!
! /* Search first not selected entry */
! while (sel < list_len &&
! list[sel].selected)
! sel++;

! if (q >= list_len) {
!
! prompt_Z(LOC.prompt_area,ask_metamail);
!
! defans = ask_metamail ? 'm' : 'd';
!
! } else {
! int X = (q - offset) * 3 + 3;
! int lin,col;
! menu_get_sizes(LOC.prompt_area, &lin,&col);
!
! if (X <= 1) {
! offset = q-1;
! if (offset < 0)
! offset = 0;
!
! ch = REDRAW_MARK;
! menu_trigger_redraw(LOC.prompt_area);
! goto redraw1;
}

! if (X >= lin-2) {
! offset = q;
!
! ch = REDRAW_MARK;
! menu_trigger_redraw(LOC.prompt_area);
! goto redraw1;
! }

! menu_MoveCursor(LOC.prompt_area,X,list[q].col);
! }

!
! menu_CleartoEOLN(LOC.prompt_area); /* Clear current answer */
!
! menu_Write_to_screen(LOC.prompt_area,
! FRM("%c%c"),defans,BACKSPACE);
! FlushBuffer();
!
!
! ch = menu_ReadCh(LOC.prompt_area,REDRAW_MARK|READCH_CURSOR|
! READCH_resize|READCH_sig_char);
!
! if (ch == '\n')
! ch = defans;
!
! switch (ch) {
! case TERMCH_interrupt_char:
! r=-1;
! goto failure;
! case 'i':
! case 'q':
! menu_Write_to_screen(LOC.prompt_area,
! CATGETS(elm_msg_cat, ElmSet,


! ElmQuit,
! "Quit"));
! FlushBuffer();

! r=-1;
! goto failure;

! case RESIZE_MARK:
!
! DPRINT(Debug,4, (&Debug," .... resizing\n"));
! goto resize_mark;
!
! case REDRAW_MARK:
! redraw:
!
! redraw_prompt_screen(page);
!
! break;
!
! case '-':
! case LEFT_MARK:
! case PAGEUP_MARK: {
! int lin,col;
! menu_get_sizes(LOC.prompt_area, &lin,&col);
!
! offset -= lin / 3 - 2;
! if (offset < 0)
! offset = 0;
! q = offset;
!
! menu_trigger_redraw(LOC.prompt_area);
! }
! goto redraw1;
!
!
! case '+':
! case RIGHT_MARK:
! case PAGEDOWN_MARK: {
! int lin,col;
! menu_get_sizes(LOC.prompt_area, &lin,&col);
!
! offset += lin / 3 - 2;
! if (offset >= list_len);
! offset = list_len-1;
! q = offset;
!
! menu_trigger_redraw(LOC.prompt_area);
! }
! goto redraw1;
!
! case DOWN_MARK:
! if (q < list_len) {
! update_prompt(&P,q, LOC.prompt_area);
! q++;
}
! break;

! case UP_MARK:
! if (q < list_len)
! update_prompt(&P,q, LOC.prompt_area);
! if (q > 0)
! q--;
! break;

! case 'd':
! done:
! ch = 0;
!
! if (q < list_len)
! update_prompt(&P,q, LOC.prompt_area);
!
! prompt_Z(LOC.prompt_area,ask_metamail);
!
! menu_Write_to_screen(LOC.prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmDone,
! "Done"));
FlushBuffer();
! break;

! case 'm':
! if (q < list_len)
! update_prompt(&P,q, LOC.prompt_area);

! prompt_Z(LOC.prompt_area,ask_metamail);
!
! menu_Write_to_screen(LOC.prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmMetamail,
! "Metamail"));
! if (have_metamail()) {
ch = 0;
! r = TRUE;
}
!
! break;
!
! case 'p':
! if (q < list_len)
! update_prompt(&P,q, LOC.prompt_area);
!
! if (sel >= list_len)
! goto done;
! q = sel;
! ask_metamail = 0;
!
! menu_trigger_redraw(LOC.prompt_area);
! menu_trigger_redraw(LOC.title_area);
!
! break;
!
!
! }
!
! if (q < list_len) {
!
! if (ch == *def_ans_yes) {
! list[q].selected = 1;
! list[q].structure->handler_data->use_entry = 1;
! update_prompt(&P,q, LOC.prompt_area);
! q++;

! } else if (ch == *def_ans_no) {

! list[q].selected = 1;
! list[q].structure->handler_data->use_entry = 0;
! update_prompt(&P,q, LOC.prompt_area);
! q++;
!
! }
! }
!
! redraw1:
! check_prompt_screen(&LOC,&P,ask_metamail,current, message_count,
! hdr);
!
! FlushBuffer();
!
! } while(ch);
!
!
out:
failure:
!
if (list) {
int i;
!
for (i = 0; i < list_len; i++) {
if (list[i].printable_command) {
free(list[i].printable_command);
list[i].printable_command = NULL;
}
}
!
free(list);
list = NULL;
}
list_len = 0;
!
! free_prompt_screen(&LOC);
erase_menu_context(&page);
!
return r;
}


! /* -1 == cancel */
! int need_meta (hdr,current,message_count)
struct header_rec *hdr;
+ int current, message_count;
{
/* Determine whether or not we need to call metamail to display the
* message contents.
*/
int result = 0;

! if ((hdr->status & (MIME_MESSAGE)) && (hdr->status & MIME_UNSUPPORTED)) {
! if (have_metamail()) {
! if (prompt_metamail)
! result = prompt_programs (hdr,1,current,message_count);
! else
! result = TRUE;
! } else
! result = FALSE;
/* Do not call metamail if Disposition is not inline */
! } else if ((hdr->status & MIME_MESSAGE) &&
! hdr->mime_rec.disposition != DISP_INLINE)
result = FALSE;
else if (hdr->status & (MIME_MESSAGE | PRE_MIME_CONTENT)) {

***************
*** 627,639 ****
NOTPLAIN_canuse_mailcap 0x04
*/

! if (0 != (X & NOTPLAIN_need_metamail) && have_metamail())
! result = TRUE;
! else if (0 != (X & NOTPLAIN_canuse_mailcap) ||
! 0 != (X & NOTPLAIN_need_mailcap)) {
!
! result = prompt_programs (& (hdr->mime_rec));

}

}
--- 914,928 ----
NOTPLAIN_canuse_mailcap 0x04
*/

! if (0 != (X & NOTPLAIN_need_metamail) && have_metamail()) {
! if (prompt_metamail)
! result = prompt_programs (hdr,1,current,message_count);
! else
! result = TRUE;
! } else if (0 != (X & NOTPLAIN_canuse_mailcap) ||
! 0 != (X & NOTPLAIN_need_mailcap)) {

+ result = prompt_programs (hdr,0,current,message_count);
}

}
***************
*** 642,652 ****
return result;
}

! int show_msg(current_header, infile, current,message_count, page)
struct header_rec *current_header;
FILE *infile;
int current, message_count;
! struct menu_context *page;
{
/*** Display number'th message. Get starting and ending lines
of message from headers data structure, then fly through
--- 931,941 ----
return result;
}

! int show_msg(current_header, infile, current,message_count, pager_page)


struct header_rec *current_header;
FILE *infile;

int current, message_count;
! struct pager_page *pager_page;
{
/*** Display number'th message. Get starting and ending lines
of message from headers data structure, then fly through
***************
*** 660,669 ****



! int is_need_meta = 0;


! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES, &COLUMNS);

DPRINT(Debug,4,(&Debug,
"displaying %d lines from message #%d\n",
--- 949,974 ----



! int is_need_meta = 0;


! int LINES, COLUMNS;
!

! menu_get_sizes(pager_page->root,&LINES, &COLUMNS);
!

! /* erase showmsg_c border line and prompt area */
!
! if (pager_page->border_line)
! erase_menu_context( &(pager_page->border_line));
! if (pager_page->prompt_area)
! erase_menu_context( &(pager_page->prompt_area));
!
! #if 0
! /* Do not erase screen on here, copying mail may take long time
! lefting screen empty before it can be displayed
! */
!
! menu_ClearScreen(pager_page->root);
! #endif
!

DPRINT(Debug,4,(&Debug,
"displaying %d lines from message #%d\n",
***************
*** 680,696 ****
current_header->status_chgd = TRUE;
}



- is_need_meta = need_meta(current_header);
-
if (is_need_meta) {
char fname[STRING], Cmd[SLEN];
int err;
FILE *fpout;

elm_sfprintf(fname, sizeof fname,
! FRM("%semm.%d.%d"), temp_dir, getpid(), getuid());

if ((fpout = safeopen_rdwr(fname)) == NULL) {
err = errno;
--- 985,1008 ----
current_header->status_chgd = TRUE;
}

+ is_need_meta = need_meta(current_header,current,message_count);
+ if (is_need_meta < 0) {
+ return 0;
+ }


if (is_need_meta) {
char fname[STRING], Cmd[SLEN];
int err;
FILE *fpout;
+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");


+
+ if (!tmp)
+ return 0;
+

elm_sfprintf(fname, sizeof fname,
! FRM("%semm.%d.%d"), tmp, getpid(), getuid());

if ((fpout = safeopen_rdwr(fname)) == NULL) {
err = errno;
***************
*** 719,727 ****
elm_sfprintf(Cmd, sizeof Cmd,
FRM("%s -p -z -m Elm %s"),
metamail_path, fname);
! Raw(OFF);
! ClearScreen();
! printf ("Executing metamail...\n");
system_call(Cmd, SY_ENAB_SIGINT|SY_ENV_METAMAIL, NULL);
(void) unlink (fname);

--- 1031,1050 ----
elm_sfprintf(Cmd, sizeof Cmd,
FRM("%s -p -z -m Elm %s"),
metamail_path, fname);
!
! {
! struct menu_context *xpage;
!
! xpage = Raw(OFF);
!
! menu_ClearScreen(xpage);
! menu_Write_to_screen(xpage,
! CATGETS(elm_msg_cat, MeSet,
! MeExecuteMetamail,
! "Executing metamail...\n"));
! FlushBuffer();
! }
!
system_call(Cmd, SY_ENAB_SIGINT|SY_ENV_METAMAIL, NULL);
(void) unlink (fname);

***************
*** 732,745 ****
redraw:
menu_get_sizes(cpage,&LINES, &COLUMNS);

! PutLineX(LINES-1,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyIndex,
! "Press any key to return to index."));


if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK)

goto redraw;



! printf("\r\n");

Raw(OFF | NO_TITE); /* Raw off so raw on takes effect */
}

--- 1055,1069 ----
redraw:
menu_get_sizes(cpage,&LINES, &COLUMNS);

! menu_PutLineX(cpage,
! LINES-1,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyIndex,
! "Press any key to return to index."));


if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK)

goto redraw;



! menu_Write_to_screen(cpage,FRM("\r\n"));

Raw(OFF | NO_TITE); /* Raw off so raw on takes effect */
}

***************
*** 748,754 ****
} else {

return (metapager (infile, current_header, TRUE,
! current, message_count, page));
}
}

--- 1072,1078 ----
} else {

return (metapager (infile, current_header, TRUE,
! current, message_count, pager_page));
}
}

Index: elm2.4.ME+.122-cvs/src/showmsg_c.c
*** elm2.4.ME+.121/src/showmsg_c.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/showmsg_c.c 2005-03-27 20:54:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.37 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.37 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.42 2005/03/27 17:54:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 60,70 ****



! int showmsg_main_cmd(mailbox,cmd,screen_mangled, page)


struct MailboxView *mailbox;
int cmd;
! int *screen_mangled;

! struct menu_context *page;
{
struct menu_common MENU;

--- 60,69 ----



! int showmsg_main_cmd(mailbox,cmd, pager_page)


struct MailboxView *mailbox;
int cmd;
! struct pager_page *pager_page;
{

struct menu_common MENU;

***************
*** 73,103 ****
switch (cmd) {
case '?' :

! help(TRUE, page);
!
! if (menu_need_redraw(page)) {
! menu_ClearScreen(page);
! build_bottom(&MENU,page);
! } else
! *screen_mangled = TRUE;
return 256;

case '|' : {
int current = get_current(mailbox);

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmPipe, "Pipe"),

! TRUE, &MENU, page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,

NO_mime_parse))
! do_pipe(mailbox, page);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

! menu_ClearScreen(page);
! build_bottom(&MENU, page);
}

return 256;

--- 72,100 ----
switch (cmd) {
case '?' :

! put_cmd_name(pager_page,TRUE,FRM("?"));
! help(TRUE,

! pager_page->root,
! pager_page->prompt_area);

!
return 256;

case '|' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmPipe, "Pipe"));
!

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))
! do_pipe(mailbox, pager_page->root,pager_page->prompt_area);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}
!
}

return 256;

***************
*** 108,141 ****
}


! int process_showmsg_cmd(command, mailbox, XX, aview, header_page, page)


int command;
struct MailboxView *mailbox;
showmsg_cmd XX;

struct AliasView *aview;
! int *header_page;

! struct menu_context *page;
{


int i, intbuf; /* for dummy parameters...etc */
int istagged; /* for tagging and subsequent msg */


! /* FIXME: Should this allocate new page context ? ? ? */
!
! /* ? ? ? Why this Raw is on here ? ? ? */
! Raw(ON);



while (TRUE) {
struct menu_common MENU;

- int LINES, COLUMNS;
-
- menu_get_sizes(page, &LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);

clear_error();

! command = XX(mailbox,command,&screen_mangled, page);

switch (command) {

--- 105,291 ----
}


! #if ANSI_C
! static subpage_simple_redraw sb_update_border;
! #endif
! static int sb_update_border(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;
! {

! int li,co,i;
!
! DPRINT(Debug,9, (&Debug, "sb_update_border\n"));
! menu_get_sizes(ptr,&li, &co);
!
! menu_ClearScreen(ptr);
! menu_MoveCursor(ptr,0,0);
!
! for (i = 0; i < co; i++)
! menu_Writechar(ptr,'-');
!
! return 1;
! }
!
! static void set_border P_((struct pager_page *pager_page));
! static void set_border(pager_page)
! struct pager_page *pager_page;


! {
! int LINES, COLUMNS;
!

! menu_get_sizes(pager_page->root,&LINES, &COLUMNS);
!

! if (! pager_page->border_line)
! pager_page->border_line = new_menu_subpage(pager_page->root,
! LINES-5,1,sb_update_border,
! pager_page->PARAM
! );
! else
! menu_subpage_relocate(pager_page->border_line,pager_page->root,
! LINES-5,1);


! }
!
! #if ANSI_C

! static subpage_simple_redraw sb_update_prompt;
! #endif
! static int sb_update_prompt(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;
! {
! struct menu_common *mptr = mp_lookup_mcommon(list,elm_mp_menu);
!

! DPRINT(Debug,9, (&Debug, "sb_update_prompt\n"));
!
! menu_ClearScreen(ptr);
!
! menu_PutLineX(ptr,0,0,


! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
!

! menu_PutLineX(ptr,0, 45,

! CATGETS(elm_msg_cat, ElmSet, ElmUseIToReturnIndex,
! "(Use 'i' to return to index.)"));

! return 1;

Kari E. Hurtta

unread,
Jul 13, 2005, 5:51:27 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.14

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 14/18
=========================================================================
! NewLine();
}

/*
--- 242,257 ----


*/
if (selected && !arrow_cursor) {
while (was_len < subj_width) {

! menu_Writechar(page,' ');
was_len++;
}
}
!
if (selected && has_highlighting && ! arrow_cursor)
! menu_EndXX(page,pg_INVERSE);
!

! menu_Writechar(page,'\r');
! menu_Writechar(page,'\n');
}

/*
Index: elm2.4.ME+.122-cvs/src/messages/canceled_mail.c
*** elm2.4.ME+.121/src/messages/canceled_mail.c 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.122-cvs/src/messages/canceled_mail.c 2005-07-06 00:40:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.9 2004/08/28 09:26:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.11 2005/07/05 21:40:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 111,116 ****
--- 111,118 ----

header_clear ( & ( mbx->u.canceldir->message_list[i].REC) );
}
+ free(mbx->u.canceldir->message_list);
+ mbx->u.canceldir->message_list = NULL;
}
mbx->u.canceldir->message_list_len = 0;

***************
*** 1229,1240 ****
}

fprintf(view->u.canceldir->index_F,
! "T %d\n",
! current->REC.received_time);

fprintf(view->u.canceldir->index_F,
! "d %d\n",
! current->REC.time_sent);

if (current->REC.env_from[0]) {
fprintf(view->u.canceldir->index_F,
--- 1231,1242 ----
}

fprintf(view->u.canceldir->index_F,
! "T %ld\n",
! (long int) current->REC.received_time);

fprintf(view->u.canceldir->index_F,
! "d %ld\n",
! (long int) current->REC.time_sent);

if (current->REC.env_from[0]) {
fprintf(view->u.canceldir->index_F,
Index: elm2.4.ME+.122-cvs/src/messages/def_messages.h
*** elm2.4.ME+.121/src/messages/def_messages.h 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/messages/def_messages.h 2005-05-21 20:58:32.000000000 +0300
***************
*** 1,12 ****
! /* $Id: def_messages.h,v 1.8 2004/07/27 20:25:03 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "headers.h"
#include "me.h"

#if ANSI_C
--- 1,13 ----
! /* $Id: def_messages.h,v 1.9 2005/05/21 17:58:32 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/



#include "headers.h"
+ #include "mailerlib.h"
#include "me.h"

#if ANSI_C
Index: elm2.4.ME+.122-cvs/src/messages/header_alloc.c
*** elm2.4.ME+.121/src/messages/header_alloc.c 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.122-cvs/src/messages/header_alloc.c 2005-07-01 12:15:06.000000000 +0300
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.11 2004/08/24 13:06:10 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,8 ----
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.15 2005/07/01 09:15:06 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 72,77 ****
--- 72,78 ----
h->lines = 0;
h->index_number_X = 0;
h->status = 0;
+ h->status1 = 0;
h->encrypted = 0;
h->exit_disposition = 0;
h->status_chgd = 0;
***************
*** 126,131 ****
--- 127,133 ----
h->lines = 0;
h->index_number_X = 0;
h->status = 0;
+ h->status1 = 0;
h->encrypted = 0;
h->exit_disposition = 0;
h->status_chgd = 0;
***************
*** 162,167 ****
--- 164,171 ----
struct header_rec *current_header;
header_list_ptr parsed_headers;
{
+ int mh = give_dt_enumerate_as_int(&message_hide_hack);
+
header_list_ptr tmphdr;



if (NULL != (tmphdr = locate_header_by_name(parsed_headers,

***************
*** 224,248 ****



if (NULL != (tmphdr = locate_header_by_name(parsed_headers,

"Status"))) {
! strfcpy(current_header->mailx_status, tmphdr->body, WLEN);
! remove_possible_trailing_spaces(current_header->
! mailx_status);
!
! /* Okay readjust the status. If there's an 'R', message
! * is read; if there is no 'R' but there is an 'O', message
! * is unread. In any case it isn't new because a new
! * message wouldn't have a Status: header.
! * -- if message is re$ynced there may now be
! * Status: -header
! */
! if (index(current_header->mailx_status, 'R') != NULL)
! current_header->status &= ~(NEW | UNREAD);
! else if (index(current_header->mailx_status,'O') != NULL) {
! current_header->status &= ~NEW;
! current_header->status |= UNREAD;
! }
! if (index(current_header->mailx_status, 'r') != NULL)
! current_header->status |= REPLIED;


}

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,

--- 228,234 ----



if (NULL != (tmphdr = locate_header_by_name(parsed_headers,

"Status"))) {
! mailbox_2_status(tmphdr->body,current_header);


}

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,

***************
*** 264,270 ****


/* This does not work correctly with unknown character
sets... */

! remove_control(current_header->subject);

free(Subject);
} else if (!current_header->subject)
--- 250,257 ----



/* This does not work correctly with unknown character
sets... */

! if (current_header->subject)
! remove_control(current_header->subject);

free(Subject);
} else if (!current_header->subject)
***************
*** 341,347 ****
/* message_hide_hack values: 0 == none */


/* 1 = FOLDER INTERNAL DATA */

! switch (message_hide_hack) {
header_list_ptr tmphdr2;

case 1:
--- 328,334 ----
/* message_hide_hack values: 0 == none */


/* 1 = FOLDER INTERNAL DATA */

! switch (mh) {
header_list_ptr tmphdr2;

case 1:
***************
*** 353,359 ****
"DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA")) {
current_header->exit_disposition = HIDE;
DPRINT(Debug,10,(&Debug, "message_hide_hack=%d -- hiding message: %s\n",
! message_hide_hack,tmphdr->body));
}
break;
}
--- 340,346 ----
"DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA")) {
current_header->exit_disposition = HIDE;
DPRINT(Debug,10,(&Debug, "message_hide_hack=%d -- hiding message: %s\n",
! mh,tmphdr->body));
}
break;
}
***************
*** 381,392 ****
if (0 != (get_type_flags(current_header->mime_rec.TYPE) &
MIME_SIGNED)) {
#ifdef USE_PGP
! char protocol[STRING];
! if (mime_get_param ("protocol", protocol,
! current_header->
! mime_rec.type_opts,
! sizeof protocol) &&
! 0 == istrcmp(protocol,
"application/pgp-signature"))
current_header->pgp |= PGP_SIGNED_MESSAGE;
#endif
--- 368,380 ----
if (0 != (get_type_flags(current_header->mime_rec.TYPE) &
MIME_SIGNED)) {
#ifdef USE_PGP


! CONST char *pv;
!

! pv = get_mime_param_compat(current_header->
! mime_rec.TYPE_opts,"protocol");
!
! if (pv &&
! 0 == istrcmp(pv,
"application/pgp-signature"))
current_header->pgp |= PGP_SIGNED_MESSAGE;
#endif
Index: elm2.4.ME+.122-cvs/src/messages/Makefile.SH
*** elm2.4.ME+.121/src/messages/Makefile.SH 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/messages/Makefile.SH 2005-05-21 20:58:32.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.7 2004/07/27 20:25:03 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----

echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.8 2005/05/21 17:58:32 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************

*** 73,79 ****


$(CHMOD) u+w $@
$(TOUCH) $@

! def_messages.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h


$(CHMOD) u+w $@
$(TOUCH) $@

--- 73,79 ----


$(CHMOD) u+w $@
$(TOUCH) $@

! def_messages.h: $(INCLDIR)/headers.h $(INCLDIR)/me.h $(INCLDIR)/mailerlib.h


$(CHMOD) u+w $@
$(TOUCH) $@

Index: elm2.4.ME+.122-cvs/src/messages/partial.c
*** elm2.4.ME+.121/src/messages/partial.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/messages/partial.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.16 2004/07/27 20:25:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.18 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 506,514 ****

if (!mailbox->u.partial->fname) {
static int un = 1;
!
mailbox->u.partial->fname = elm_message(FRM("%selmpartial-%d-%d"),
! temp_dir, getpid (), un++);

DPRINT(Debug,9,(&Debug,
"check_tempfile: temporary folder name is %s\n",
--- 506,519 ----

if (!mailbox->u.partial->fname) {
static int un = 1;


! char *tmp;
!
! tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
! if (!tmp)
! tmp = "/tmp/";
!

mailbox->u.partial->fname = elm_message(FRM("%selmpartial-%d-%d"),
! tmp, getpid (), un++);

DPRINT(Debug,9,(&Debug,
"check_tempfile: temporary folder name is %s\n",
***************
*** 828,848 ****
mt_add_partial_digest
};

- static struct partial_vector * locate_record(struct header_rec * hdr,
- char * id);
- static struct partial_vector * locate_record(hdr,id)
- struct header_rec * hdr;
- char * id;
- {
- int i;
-
- for (i = 0; i < hdr->partial_len; i++) {
- if (0 == strcmp(hdr->partial_vector[i].id, id))
- return (& (hdr->partial_vector[i] ));
- }


-
- return NULL;
- }

static struct info_rec {
FILE * F;
--- 833,838 ----
Index: elm2.4.ME+.122-cvs/src/metapager.c
*** elm2.4.ME+.121/src/metapager.c 2004-09-24 20:54:19.000000000 +0300
--- elm2.4.ME+.122-cvs/src/metapager.c 2005-03-27 20:54:07.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: metapager.c,v 1.43 2004/09/17 07:37:02 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.43 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: metapager.c,v 1.49 2005/03/27 17:54:07 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 36,44 ****
menu_get_sizes(cpage,&LINES, &COLUMNS);

redraw:
! PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmMetaPagePressAnyKey,
! "Press any key to continue..."));


if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK)
goto redraw;

--- 36,45 ----
menu_get_sizes(cpage,&LINES, &COLUMNS);

redraw:


! menu_PutLineX(cpage,
! LINES-1, 0,

! CATGETS(elm_msg_cat, ElmSet, ElmMetaPagePressAnyKey,
! "Press any key to continue..."));


if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK)
goto redraw;

***************
*** 65,77 ****
(*inf)++;
}

! int metapager (fp, hdr, do_headers, current, message_count, page)
FILE *fp;
struct header_rec *hdr;
int do_headers;
int current;
int message_count;
! struct menu_context *page;
{

int wait_ret, fork_ret, builtin = 0, status, len;
--- 66,301 ----
(*inf)++;
}

! struct string * title_text(hdr,current,message_count,width,cs)
! struct header_rec *hdr;
! int current, message_count;
! int width;
! charset_t cs;
! {
! struct string * res = new_string(cs);
! char buf2[STRING];
! struct string *t;
! int l1,len;
!
! if (hdr->status & DELETED)
! t = format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmPagerStatDeleted,
! "[Deleted] %d/%d "),
! current,message_count);
! else
! t = format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmPagerStatMessage,
! "Message %d/%d "),
! current,message_count);
! append_string(&res,t);
! free_string(&t);
! l1 = string_len(res);
!
! elm_date_str(buf2, hdr->time_sent + hdr->tz_offset, sizeof buf2);
! strfcat(buf2, " ", sizeof buf2);
! strfcat(buf2, hdr->time_zone, sizeof buf2);
!
! len = width - 2 - l1 - strlen(buf2);
!
! if (hdr->from) {
! struct string * buf4 = new_string(cs);
! int buf4_visible_len = 0;
! int filllen;


! struct addr_item *p;
!

! #define ADDRLEN 15
!
! for (p = hdr->from; p->addr && p->fullname; p++) {
! int left = len- buf4_visible_len -4;
! int total;


! int reserve = strlen(p->addr);
!
! if (reserve > ADDRLEN)
! reserve = ADDRLEN;
!

! if (left < 4) {
! break;
! }
!
! if (string_len(buf4) > 0) {
! add_ascii_to_string(buf4,s2us(", "));
! buf4_visible_len += 2;


!
! left = len - buf4_visible_len-4;
! }
!

! if (reserve > left) {


! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;

! break;
! }
!
!

! if (left > reserve+8 &&
! (0 < (total = string_len(p->fullname)))) {
! struct string * Sbase;
! struct string * s1 = NULL;
! int X = 0;
! int visible_len;
! int Old;
!
! /* Use convert_string instead of dup_string so
! * that text with unknown charset is printed
! * as [?charset?]
! */

! Sbase = convert_string(cs,p->fullname,1);


!
! Old = string_len(Sbase);
!
! s1 = curses_printable_clip(Sbase,&X,len+total,&visible_len,
! left-reserve-8);
!
! if (s1) {

! append_string(&buf4,s1);


!
! buf4_visible_len += visible_len; /* Assumed */

! free_string(&s1);
! }
!
! if (X < Old) {
! /* Look if rest of name fits on place of '...' */
!
! left = len - buf4_visible_len-4;
!
! s1 = curses_printable_clip(Sbase,&X,len+total,&visible_len,
! left-reserve-4);
!
! if (X == Old && s1) {
!

! append_string(&buf4,s1);


!
! buf4_visible_len += visible_len; /* Assumed */

!
! } else {
!

! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! }
! if (s1)
! free_string(&s1);
! }
!
! free_string(&Sbase);

!
!
! } else if (total > 0) {


! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! }
!

! /* And include address */
! left = len - buf4_visible_len -4;
! if (left > 4) {
! char *T;

!

! struct string * s0 = NULL;
! struct string * s2 = NULL;
! int X = 0;
! int visible_len;
!
! T = p->addr;
! if ((total=strlen(p->addr)) > left-3) {
! int clip = total-left +6;
!
! if (clip > total)
! clip=total;
!
! T = p->addr + clip;
! }
!
! s0 = format_string(FRM(" <%s%s>"),
! T > p->addr ? "..." : "",
! T);
!
! s2 = curses_printable_clip(s0,&X,len+total,&visible_len,
! left);
!
! free_string(&s0);
! if (s2) {

! append_string(&buf4,s2);


!
! buf4_visible_len += visible_len; /* Assumed */
!

! free_string(&s2);
! }
! }
! }
!
! filllen = len - buf4_visible_len;
! if (filllen < 0)
! filllen = 0;
!
! t = format_string(FRM("%S%*s %s"),
! buf4,
! filllen,"",
! buf2);
! free_string(&buf4);
! } else if (len > 10)
! t = format_string(FRM("(env) %-*.*s %s"),
! len-7,
! len-7,
! hdr->env_from,
! buf2);
!
! append_string(&res,t);
! free_string(&t);
!
! return res;
! }
!
!
! struct pager_page * init_pager_page(mptr)
! struct menu_common *mptr;
! {
! struct pager_page *p = safe_malloc(sizeof (*p));
!
! /* bzero is defined on hdrs/defs.h */
! bzero((void *)p, sizeof (*p));
!
! p->root = new_menu_context();
!
! p->border_line = NULL;
! p->prompt_area = NULL;
!
! p->PARAM[0].t = mp_menu_common;
! p->PARAM[1].t = mp_END;
!
! mp_list_set_mcommon(p->PARAM,elm_mp_menu,mptr);
!
! return p;
! }
!
! void exit_pager_page(pager_page,other)
! struct pager_page ** pager_page;
! struct menu_context * other;
! {
! if ((*pager_page)->border_line)
! erase_menu_context( &((*pager_page)->border_line));
!
! if ((*pager_page)->prompt_area)
! erase_menu_context( &((*pager_page)->prompt_area));
!
! if ((*pager_page)->root)
! erase_menu_context( &((*pager_page)->root));
!
! menu_trigger_redraw(other);
!
! free(*pager_page);
! (*pager_page) = NULL;
! }
!
! int metapager (fp, hdr, do_headers, current, message_count, pager_page)
FILE *fp;
struct header_rec *hdr;
int do_headers;
int current;
int message_count;
! struct pager_page *pager_page;
{

int wait_ret, fork_ret, builtin = 0, status, len;
***************
*** 87,94 ****
int x1;
int LINES, COLUMNS;
char * exp_pager;

! menu_get_sizes(page,&LINES, &COLUMNS);

/* check to see if we want the internal pager */

--- 311,319 ----
int x1;
int LINES, COLUMNS;
char * exp_pager;
+ char *tmp;

! menu_get_sizes(pager_page->root,&LINES, &COLUMNS);

/* check to see if we want the internal pager */

***************
*** 107,115 ****
builtin++;
}

if (!builtin) {
elm_sfprintf (tempfile, sizeof tempfile,


! FRM("%selm.%d"), temp_dir, getpid());

unlink(tempfile);
fpout = safeopen_rdwr(tempfile);
--- 332,346 ----
builtin++;
}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");


+ if (!tmp)
+ return 0;
+

if (!builtin) {
+
+
elm_sfprintf (tempfile, sizeof tempfile,


! FRM("%selm.%d"), tmp, getpid());

unlink(tempfile);
fpout = safeopen_rdwr(tempfile);
***************
*** 173,363 ****
return (0);
}

! /* this is only true if metapager() is not called from ViewAttachment() */
if (do_headers) {
header_list_ptr all_hdrs = NULL, last_hdr = NULL;
int in_envelope = 1;



if (title_messages && current > 0) {

int addempty = 0;
- char buf2[STRING];
- struct addr_item *p;
- /* first print a title line */
- int l1, inf = 0;
-
- if (hdr->status & DELETED)
- l1 = state_printf(&buffer,
- CATGETS(elm_msg_cat, ElmSet,
- ElmPagerStatDeleted,
- "[Deleted] %d/%d "),
- current,message_count);
- else
- l1 = state_printf(&buffer,
- CATGETS(elm_msg_cat, ElmSet,
- ElmPagerStatMessage,
- "Message %d/%d "),
- current,message_count);
-
- elm_date_str(buf2, hdr->time_sent + hdr->tz_offset, sizeof buf2);
- strfcat(buf2, " ", sizeof buf2);
- strfcat(buf2, hdr->time_zone, sizeof buf2);
- len = COLUMNS - 2 - l1 - strlen(buf2);
-
- if (hdr->from) {
- struct string * buf4 = new_string(buffer.display_charset[0]);
- int buf4_visible_len = 0;
- int filllen;
-
- #define ADDRLEN 15
-
- for (p = hdr->from; p->addr && p->fullname; p++) {
- int left = len- buf4_visible_len -4;
- int total;
- int reserve = strlen(p->addr);
-
- if (reserve > ADDRLEN)
- reserve = ADDRLEN;
-
- if (left < 4) {
- break;
- }
-
- if (string_len(buf4) > 0) {
- add_ascii_to_string(buf4,s2us(", "));
- buf4_visible_len += 2;
-
- left = len - buf4_visible_len-4;
- }
-
- if (reserve > left) {
- add_ascii_to_string(buf4,s2us("..."));
- buf4_visible_len += 3;


- break;
- }
-
-

- if (left > reserve+8 &&
- (0 < (total = string_len(p->fullname)))) {
- struct string * Sbase;


- struct string * s1 = NULL;
- int X = 0;

- int visible_len;
- int Old;
-
- /* Use convert_string instead of dup_string so
- * that text with unknown charset is printed
- * as [?charset?]
- */
- Sbase = convert_string(buffer.display_charset[0],
- p->fullname,1);
-
- Old = string_len(Sbase);
-
- s1 = curses_printable_clip(Sbase,&X,len+total,&visible_len,
- left-reserve-8);
-
- if (s1) {
- struct string * s = cat_strings(buf4,s1,1);
-
- buf4_visible_len += visible_len; /* Assumed */


-
- free_string(&buf4);
- buf4 = s;
- free_string(&s1);
- }

-
- if (X < Old) {
- /* Look if rest of name fits on place of '...' */



! left = len - buf4_visible_len-4;
!
! s1 = curses_printable_clip(Sbase,&X,len+total,&visible_len,
! left-reserve-4);
!
! if (X == Old && s1) {

! struct string * s = cat_strings(buf4,s1,1);
!
! buf4_visible_len += visible_len; /* Assumed */
!
! free_string(&buf4);
! buf4 = s;
! free_string(&s1);

!
! } else {
!

! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! }
! if (s1)
! free_string(&s1);
! }
!
! free_string(&Sbase);

!
!
! } else if (total > 0) {


! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! }

- /* And include address */
- left = len - buf4_visible_len -4;
- if (left > 4) {
- char *T;
-
- struct string * s0 = NULL;
- struct string * s2 = NULL;


- int X = 0;

- int visible_len;
-
- T = p->addr;
- if ((total=strlen(p->addr)) > left-3) {
- int clip = total-left +6;
-
- if (clip > total)
- clip=total;
-
- T = p->addr + clip;
- }
-
- s0 = format_string(FRM(" <%s%s>"),
- T > p->addr ? "..." : "",
- T);
-
- s2 = curses_printable_clip(s0,&X,len+total,&visible_len,
- left);
-
- free_string(&s0);
- if (s2) {
- s0 = cat_strings(buf4,s2,1);
-
- buf4_visible_len += visible_len; /* Assumed */
-
- free_string(&buf4);
- buf4 = s0;
- free_string(&s2);
- }
- }
- }

! filllen = len - buf4_visible_len;
! if (filllen < 0)
! filllen = 0;

! state_printf(&buffer,
! FRM("%S%*s %s"),
! buf4,
! filllen,"",
! buf2);
! free_string(&buf4);
! } else if (len > 10)
! state_printf(&buffer,
! FRM("(env) %-*.*s %s"),
! len-7,
! len-7,
! hdr->env_from,
! buf2);

/** Print the subject line centered if there is enough room **/
if (hdr->subject &&
--- 404,428 ----
return (0);
}

! /* this is only true if metapager() is not called from ViewAttachment() */
if (do_headers) {
header_list_ptr all_hdrs = NULL, last_hdr = NULL;
int in_envelope = 1;



if (title_messages && current > 0) {

int addempty = 0;

! struct string *T = title_text(hdr,current,message_count,
! COLUMNS,
! buffer.display_charset[0]);

! /* first print a title line */
! int inf = 0;


! state_printf(&buffer,FRM("%S"),T);

! free_string(&T);

/** Print the subject line centered if there is enough room **/
if (hdr->subject &&
***************
*** 416,421 ****
--- 481,487 ----



+ #if 0
/* HACK: Required by state_write_headers / state_write_header so that 8bit headers are
printed correctly
*/
***************
*** 433,438 ****
--- 499,510 ----
buffer.filter = buffer.display_charset[x1];
} else
buffer.filter = buffer.display_charset[0];
+ #endif
+
+
+ /* Now state_write_header() changes itself buffer.filter according
+ * of current header charset and buffer.display_charset
+ */


/* read_header_line with flag = 1 (RHL_MARK_FOLDING)
***************
*** 520,526 ****
/** Now run the pager! **/

if (builtin) {
! ch = builtinplusplus (bout);
free_stringbuffer(&bout);
return (ch);
}
--- 592,598 ----
/** Now run the pager! **/

if (builtin) {
! ch = builtinplusplus (bout, pager_page);
free_stringbuffer(&bout);
return (ch);
}
***************
*** 601,619 ****
cpage = Raw(ON | NO_TITE);

if (prompt_after_pager) {
! StartBold ();


! PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCommandIToReturn,
! " Command ('i' to return to index): "));
! EndBold ();
FlushBuffer();
ch = menu_ReadCh(cpage, 'i' | READCH_CURSOR);
}
else
ch = 0;

! /* This is necessary so that that ti is outputted
* after te that was caused on Raw(OFF) before pager.
*/
Raw(OFF | NO_TITE);
--- 673,692 ----
cpage = Raw(ON | NO_TITE);

if (prompt_after_pager) {
! menu_StartXX(cpage,pg_BOLD);


! menu_PutLineX(cpage,
! LINES-1, 0,

! CATGETS(elm_msg_cat, ElmSet,
! ElmCommandIToReturn,


! " Command ('i' to return to index): "));

! menu_EndXX(cpage,pg_BOLD);
FlushBuffer();
ch = menu_ReadCh(cpage, 'i' | READCH_CURSOR);
}
else
ch = 0;

! /* This is necessary so that ti is outputted
* after te that was caused on Raw(OFF) before pager.
*/
Raw(OFF | NO_TITE);
Index: elm2.4.ME+.122-cvs/src/mime.c
*** elm2.4.ME+.121/src/mime.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/mime.c 2005-07-05 23:44:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime.c,v 1.34 2004/07/20 19:54:30 hurtta Exp $";
!
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.34 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,6 ----
! static char rcsid[] = "@(#)$Id: mime.c,v 1.41 2005/07/05 20:44:36 hurtta Exp $";
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 42,48 ****
mime_info->raw_level = mailer_7bit;

mime_info->encoding_top = ENCODING_7BIT;
! mime_info->type_opts_top = NULL;
mime_info->hdr_charset = text_charset;

/* FIXME: is this correct?
--- 41,47 ----
mime_info->raw_level = mailer_7bit;

mime_info->encoding_top = ENCODING_7BIT;
! mime_info->TYPE_opts_top = NULL;
mime_info->hdr_charset = text_charset;

/* FIXME: is this correct?
***************
*** 74,83 ****
mime_info->top_parts[ptr].encoding_part = ENCODING_7BIT;
mime_info->top_parts[ptr].encoding_part_text = NULL;
mime_info->top_parts[ptr].TYPE = 0;
! mime_info->top_parts[ptr].type_opts_part = NULL;

mime_info->top_parts[ptr].disposition = 0;
! mime_info->top_parts[ptr].disposition_opts = NULL;

mime_info->top_parts[ptr].description = NULL;

--- 73,82 ----
mime_info->top_parts[ptr].encoding_part = ENCODING_7BIT;
mime_info->top_parts[ptr].encoding_part_text = NULL;
mime_info->top_parts[ptr].TYPE = 0;
! mime_info->top_parts[ptr].TYPE_opts_part = NULL;

mime_info->top_parts[ptr].disposition = 0;
! mime_info->top_parts[ptr].DISPOSITION_opts = NULL;

mime_info->top_parts[ptr].description = NULL;

***************
*** 111,127 ****
}

mime_info->top_parts[i].TYPE = NULL;
! if (mime_info->top_parts[i].type_opts_part) {
! free(mime_info->top_parts[i].type_opts_part);
! mime_info->top_parts[i].type_opts_part = NULL;
! }
!
mime_info->top_parts[i].disposition = 0;
! if (mime_info->top_parts[i].disposition_opts) {
! free(mime_info->top_parts[i].disposition_opts);
! mime_info->top_parts[i].disposition_opts = NULL;
! }
!
if (mime_info->top_parts[i].description) {
free_string(&(mime_info->top_parts[i].description));
mime_info->top_parts[i].description = NULL;
--- 110,122 ----
}

mime_info->top_parts[i].TYPE = NULL;
! if (mime_info->top_parts[i].TYPE_opts_part)
! free_mime_param(&(mime_info->top_parts[i].TYPE_opts_part));
!
mime_info->top_parts[i].disposition = 0;
! if (mime_info->top_parts[i].DISPOSITION_opts)
! free_mime_param(&(mime_info->top_parts[i].DISPOSITION_opts));
!
if (mime_info->top_parts[i].description) {
free_string(&(mime_info->top_parts[i].description));
mime_info->top_parts[i].description = NULL;
***************
*** 150,159 ****

mime_info->encoding_top = 0;
mime_info->mime_boundary[0] = '\0';
! if (mime_info->type_opts_top) {
! free(mime_info->type_opts_top);
! mime_info->type_opts_top = NULL;
! }
mime_info->hdr_charset = NULL;
mime_info->encode_hdr = 1;
mime_info->msg_is_multipart = 0;
--- 145,152 ----

mime_info->encoding_top = 0;
mime_info->mime_boundary[0] = '\0';
! if (mime_info->TYPE_opts_top)
! free_mime_param(&(mime_info->TYPE_opts_top));
mime_info->hdr_charset = NULL;
mime_info->encode_hdr = 1;
mime_info->msg_is_multipart = 0;
***************
*** 179,184 ****
--- 172,178 ----
*ptr = strmcpy(*ptr,buffer);
}

+
static int write_one_part P_((mime_send_t *mime_info,
struct mime_send_part * X,
out_state_t *mailer,
***************
*** 257,269 ****
update_encoding(&(mime_info->encoding_top),X->encoding_part);

if (X->result_charset) {
/* Update Charset of part */

/* 1) If charset can be replaced with US-ASCII, do it */
if (!(need_enc & HAVE_8BIT) &&
X->result_charset != ascii_ptr &&
! charset_ok_p(X->result_charset))
X->result_charset = ascii_ptr;

/* 2) If charset claim to be US-ASCII, but there is 8-bit data
use UNKNOWN-8BIT instead (should not happen...)
--- 251,277 ----
update_encoding(&(mime_info->encoding_top),X->encoding_part);

if (X->result_charset) {
+ int ascii_compat = charset_ok_p(X->result_charset);
+
/* Update Charset of part */

+ DPRINT(Debug,8,(&Debug,
+ "charset=%s (%p) 8bit=%s charset ascii compatible=%s\n",
+ X->result_charset->MIME_name ?
+ X->result_charset->MIME_name :
+ "???",
+ X->result_charset,
+ (need_enc & HAVE_8BIT) ? "yes" : "no",
+ ascii_compat ? "yes" : "no"));
+
/* 1) If charset can be replaced with US-ASCII, do it */
if (!(need_enc & HAVE_8BIT) &&
X->result_charset != ascii_ptr &&
! ascii_compat) {
!
X->result_charset = ascii_ptr;
+ DPRINT(Debug,8,(&Debug, "Replacing charset with US-ASCII\n"));
+ }

/* 2) If charset claim to be US-ASCII, but there is 8-bit data
use UNKNOWN-8BIT instead (should not happen...)
***************
*** 275,289 ****
"Text has 8BIT data and charset=US-ASCII, using charset=UNKNOWN-8BIT instead."));

X->result_charset = MIME_name_to_charset("UNKNOWN-8BIT",1);
}

/* Add charset to options */
! add_parameter_1(&(X->type_opts_part),
! "charset",
! X->result_charset->MIME_name ?
! X->result_charset->MIME_name :
! "UNKNOWN-8BIT",
! FALSE);
}

state_putc('\n',mailer); /* filler */
--- 283,298 ----
"Text has 8BIT data and charset=US-ASCII, using charset=UNKNOWN-8BIT instead."));

X->result_charset = MIME_name_to_charset("UNKNOWN-8BIT",1);
+
+ DPRINT(Debug,8,(&Debug, "Replacing charset with UNKNOWN-8BIT\n"));
}

/* Add charset to options */
! mime_params_add_compat(&(X->TYPE_opts_part),
! "charset",
! X->result_charset->MIME_name ?
! X->result_charset->MIME_name :
! "UNKNOWN-8BIT");
}

state_putc('\n',mailer); /* filler */
***************
*** 336,342 ****
static int Include_Part P_((FILE *dest,char *buffer,
mime_send_t *mime_info,
struct mime_send_part * X,
! struct mailer_info *mailer_info));



/* Returns 1 if OK */

int convert_text(source,dest,mime_info,from_charset,to_charset,do_pgp,
--- 345,352 ----
static int Include_Part P_((FILE *dest,char *buffer,
mime_send_t *mime_info,
struct mime_send_part * X,


! struct mailer_info *mailer_info,
! charset_t from_charset));

/* Returns 1 if OK */

int convert_text(source,dest,mime_info,from_charset,to_charset,do_pgp,
***************
*** 359,364 ****
--- 369,378 ----

struct mime_send_part * X = NULL;



+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");

+ if (!tmp)
+ tmp = "/tmp/";
+

reset_parts(mime_info);

if (do_pgp) {
***************
*** 372,408 ****
X->encoding_part_text = NULL;

if (do_pgp & PGP_MESSAGE) {
! X -> TYPE = give_media_type2(MIME_TYPE_APPLICATION,"pgp",1);
! } else switch (pgp_sign_type) {
! case 0:
! default:
! X -> TYPE = give_media_type2(MIME_TYPE_APPLICATION,"pgp",1);


! break;
! case 1:

! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"plain",0);
! if (!X -> TYPE)
! mime_panic(__FILE__,__LINE__,"convert_text",
! "text/plain is not known");
! break;
! case 2:
! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"x-pgp",1);
}
!
if (do_pgp & PGP_PUBLIC_KEY)
! add_parameter_1(&(X->type_opts_part),"format","keys-only", FALSE);
else {
! add_parameter_1(&(X->type_opts_part), "format", "text", FALSE);
/* This next bit is a non-non-standard, but exmh does this and it
* can be very useful when parsing the message.
*/
if (pgp_status & PGP_MESSAGE) {
! add_parameter_1(&(X->type_opts_part), "x-action",
! (do_pgp & PGP_SIGNED_MESSAGE) ?
! "encryptsign" : "encrypt", FALSE);
! }
! else
! add_parameter_1(&(X->type_opts_part), "x-action", "sign",
! FALSE);
}

/* If message is signed, it can not be character set converted! */
--- 386,439 ----
X->encoding_part_text = NULL;

if (do_pgp & PGP_MESSAGE) {
! int pe = give_dt_enumerate_as_int(&pgp_encrypt_type);
!
! switch (pe) {
! case 0:
! default:
! X -> TYPE = give_media_type2(MIME_TYPE_APPLICATION,"pgp",1);


! break;
! case 1:

! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"plain",0);
! if (!X -> TYPE)
! mime_panic(__FILE__,__LINE__,"convert_text",
! "text/plain is not known");
! break;
! case 2:
! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"x-pgp",1);
! }
! } else {
! int ps = give_dt_enumerate_as_int(&pgp_sign_type);
!
! switch (ps) {
! case 0:
! default:
! X -> TYPE = give_media_type2(MIME_TYPE_APPLICATION,"pgp",1);


! break;
! case 1:

! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"plain",0);
! if (!X -> TYPE)
! mime_panic(__FILE__,__LINE__,"convert_text",
! "text/plain is not known");
! break;
! case 2:
! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"x-pgp",1);
! }
}
!
if (do_pgp & PGP_PUBLIC_KEY)
! mime_params_add_compat(&(X->TYPE_opts_part),"format","keys-only");
else {
! mime_params_add_compat(&(X->TYPE_opts_part), "format", "text");
/* This next bit is a non-non-standard, but exmh does this and it
* can be very useful when parsing the message.
*/
if (pgp_status & PGP_MESSAGE) {
! mime_params_add_compat(&(X->TYPE_opts_part), "x-action",
! (do_pgp & PGP_SIGNED_MESSAGE) ?
! "encryptsign" : "encrypt");
! } else
! mime_params_add_compat(&(X->TYPE_opts_part), "x-action", "sign");
}

/* If message is signed, it can not be character set converted! */
***************
*** 557,563 ****
X->save_it_on_copy = !no_save;
X->is_text = 0;

! if (Include_Part(dest,buffer,mime_info,X,mailer_info) < 0)
ok = 0;
continue;
} else if (strncmp(buffer, START_ENCODE,
--- 588,595 ----
X->save_it_on_copy = !no_save;
X->is_text = 0;

! if (Include_Part(dest,buffer,mime_info,X,mailer_info,
! from_charset) < 0)
ok = 0;
continue;
} else if (strncmp(buffer, START_ENCODE,
***************
*** 597,603 ****
int i;
for (i = 0; i < 10; i++) {
char * filename = elm_message(FRM("%selmsd-%d-%d"),
! temp_dir, getpid (),
tmpcount++);
tmpfile = safeopen_rdwr(filename);
if (!tmpfile) {
--- 629,635 ----
int i;
for (i = 0; i < 10; i++) {
char * filename = elm_message(FRM("%selmsd-%d-%d"),
! tmp, getpid (),
tmpcount++);
tmpfile = safeopen_rdwr(filename);
if (!tmpfile) {
***************
*** 639,645 ****
if (!X -> TYPE)
mime_panic(__FILE__,__LINE__,
"convert_text",
! "text/X-ELM-encode is not known");

fputs(START_ENCODE,tmpfile);
fputc('\n',tmpfile);
--- 671,677 ----
if (!X -> TYPE)
mime_panic(__FILE__,__LINE__,
"convert_text",
! "application/X-ELM-encode is not known");

fputs(START_ENCODE,tmpfile);
fputc('\n',tmpfile);
***************
*** 790,799 ****
return ok;
}

! int check_for_multipart(filedesc, mime_info, mailer_info)
FILE *filedesc;
mime_send_t *mime_info;
struct mailer_info *mailer_info;
{
char buffer[SLEN];
int Multi_Part = FALSE;
--- 822,832 ----
return ok;
}

! int check_for_multipart(filedesc, mime_info, mailer_info, from_charset)
FILE *filedesc;
mime_send_t *mime_info;
struct mailer_info *mailer_info;
+ charset_t from_charset;
{
char buffer[SLEN];
int Multi_Part = FALSE;
***************
*** 803,809 ****
if (strncmp(buffer, MIME_INCLUDE, strlen(MIME_INCLUDE)) == 0) {
Multi_Part = TRUE;
if (Include_Part(NULL,buffer, mime_info, NULL,
! mailer_info) == -1) {
return(-1);
}
}
--- 836,843 ----
if (strncmp(buffer, MIME_INCLUDE, strlen(MIME_INCLUDE)) == 0) {
Multi_Part = TRUE;
if (Include_Part(NULL,buffer, mime_info, NULL,
! mailer_info,
! from_charset) == -1) {
return(-1);
}
}
***************
*** 812,829 ****
return(Multi_Part);
}

! static int Include_Part(dest, buffer, mime_info, X, mailer_info)
FILE *dest;
char *buffer;
mime_send_t *mime_info;
struct mime_send_part * X;
struct mailer_info *mailer_info;
{
int check = (X == NULL);
char *ptr;
char *incptr;
char Include_Filename[SLEN];
! char Expanded_Filename[SLEN];
char Primary_Type[SLEN];
char SubType[SLEN];
media_type_t Type;
--- 846,869 ----
return(Multi_Part);
}

! static int Include_Part(dest, buffer, mime_info, X, mailer_info, from_charset)
FILE *dest;
char *buffer;
mime_send_t *mime_info;
struct mime_send_part * X;
struct mailer_info *mailer_info;
+ charset_t from_charset;
{
int check = (X == NULL);
char *ptr;
char *incptr;
char Include_Filename[SLEN];
! struct string * orig_filename = NULL;
! struct folder_browser * expanded_file = new_browser(selection_file);
! char * expanded_2 = NULL;
! int is_copy = 0;
! int ret = 0;
!
char Primary_Type[SLEN];
char SubType[SLEN];
media_type_t Type;
***************
*** 895,913 ****
if (strlen(Include_Filename) == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoIncludeFilename,
"No Filename given, include line ignored"));
! return(-1);
}
! if (0 != expand_env(Expanded_Filename, Include_Filename,
! sizeof(Expanded_Filename))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedToExpandInclude,
"Failed to expand include filename"));
! return -1;
}

if (strlen(Primary_Type) == 0 || strlen(SubType) == 0 ) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoContentTypeGiven,
"No Content-type given, include line ignored"));
! return(-1);
}

Enc_Type = check_encoding(Encoding);
--- 935,958 ----
if (strlen(Include_Filename) == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoIncludeFilename,
"No Filename given, include line ignored"));
! ret = -1;
! goto check_out;
}
!
! orig_filename = new_string2(from_charset,s2us(Include_Filename));
!
! if (! select_dir_item(expanded_file,&orig_filename)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedToExpandInclude,
"Failed to expand include filename"));
! ret = -1;
! goto check_out;
}

if (strlen(Primary_Type) == 0 || strlen(SubType) == 0 ) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoContentTypeGiven,
"No Content-type given, include line ignored"));
! ret = -1;
! goto check_out;
}

Enc_Type = check_encoding(Encoding);
***************
*** 915,948 ****
if (Enc_Type == ENCODING_ILLEGAL) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEncodingIsIllegal,
"Encoding is illegal"));
! return(-1);
}

! if (can_open(Expanded_Filename, "r")) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIncludeCannotAccess,
"Include File can't be accessed"), 0);
! return(-1);
}

/* Don't allow 7BIT if 8-bit charcters in any type,
* don't allow 8BIT if 'binary' characters - K E H */
if (Enc_Type == ENCODING_7BIT || Enc_Type == ENCODING_NONE
|| Enc_Type == ENCODING_8BIT) {
!
! FILE * fp = fopen (Expanded_Filename, "r");
if (fp) {
int tmp = needs_encoding (fp);
if (tmp & HAVE_BINARY) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmIncludeBINARY,
"Include file has BINARY data."));
! if (Enc_Type == ENCODING_7BIT || Enc_Type == ENCODING_8BIT)
! return -1; /* indicate failure */
Enc_Type = ENCODING_BINARY;
} else if ((tmp & HAVE_8BIT) && Enc_Type != ENCODING_8BIT) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmInclude8BIT,
"Include file has 8BIT data."));
! if (Enc_Type == ENCODING_7BIT)
! return -1; /* indicate failure */
Enc_Type = ENCODING_8BIT;

}
--- 960,1024 ----
if (Enc_Type == ENCODING_ILLEGAL) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEncodingIsIllegal,
"Encoding is illegal"));
! ret = -1;
! goto check_out;
}

!
! Type = give_media_type(Primary_Type,SubType,1);
!
! /* 1 if is text type (true)
! * 0 if not text type
! * -1 if can't be encoded (ie structured) Message/ or Multipart/
! */
!
! /* 7bit and 8bit are only allowed for line orienteed types */
! if (Enc_Type == ENCODING_NONE ||
! Enc_Type == ENCODING_7BIT ||
! Enc_Type == ENCODING_8BIT) {
! DPRINT(Debug,11,(&Debug,
! "Include_Part: textual encoding (%s)\n",
! ENCODING(Enc_Type)));
! is_text = 1;
! } else
! is_text = give_text_type_code(Type);
!
!
!
!
! if (!dir_make_ref(expanded_file,&expanded_2,&is_copy, is_text)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIncludeCannotAccess,
"Include File can't be accessed"), 0);
! ret = -1;
! goto check_out;
}

+
/* Don't allow 7BIT if 8-bit charcters in any type,
* don't allow 8BIT if 'binary' characters - K E H */
if (Enc_Type == ENCODING_7BIT || Enc_Type == ENCODING_NONE
|| Enc_Type == ENCODING_8BIT) {
!
! FILE * fp = fopen (expanded_2, "r");
if (fp) {
int tmp = needs_encoding (fp);
if (tmp & HAVE_BINARY) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmIncludeBINARY,
"Include file has BINARY data."));
! if (Enc_Type == ENCODING_7BIT || Enc_Type == ENCODING_8BIT) {
! /* indicate failure */
! ret = -1;
! goto check_out;
! }
Enc_Type = ENCODING_BINARY;
} else if ((tmp & HAVE_8BIT) && Enc_Type != ENCODING_8BIT) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmInclude8BIT,
"Include file has 8BIT data."));
! if (Enc_Type == ENCODING_7BIT) {
! /* indicate failure */
! ret = -1;
! goto check_out;
! }
Enc_Type = ENCODING_8BIT;

}
***************
*** 954,960 ****
if (mime_info->raw_level < mailer_8bit) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmDoesnt8BIT,
"Mailer (MTA) doesn't support 8BIT encoding."));
! return -1; /* indicate failure */
}
}

--- 1030,1037 ----
if (mime_info->raw_level < mailer_8bit) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmDoesnt8BIT,
"Mailer (MTA) doesn't support 8BIT encoding."));
! ret = -1; /* indicate failure */
! goto check_out;
}
}

***************
*** 962,1009 ****
if (mime_info->raw_level < mailer_binary) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmDoesntBINARY,
"Mailer (MTA) doesn't support BINARY encoding!"));
! return (-1);
}
}

- Type = give_media_type(Primary_Type,SubType,1);
-
- /* 1 if is text type (true)
- * 0 if not text type
- * -1 if can't be encoded (ie structured) Message/ or Multipart/
- */
-
- /* 7bit and 8bit are only allowed for line orienteed types */
- if (Enc_Type == ENCODING_NONE ||
- Enc_Type == ENCODING_7BIT ||
- Enc_Type == ENCODING_8BIT) {
- DPRINT(Debug,11,(&Debug,
- "Include_Part: textual encoding (%s)\n",
- ENCODING(Enc_Type)));
- is_text = 1;
- } else
- is_text = give_text_type_code(Type);
-

if (is_text < 0 && (Enc_Type == ENCODING_QUOTED ||
Enc_Type == ENCODING_BASE64)) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmDontEncoding,
"Content-Type don't allow encoding -- ignoring this part."));
! return (-1);
}


(void) update_encoding(&(mime_info->encoding_top),Enc_Type);

if (check) {
! return(0);
}

! incfile = fopen (Expanded_Filename, "r");
if (incfile) {
DPRINT(Debug,4,(&Debug,
"Include_Part: '%s' C-T=%s/%s Params=%s Enc=%d is_text=%d\n",
! Expanded_Filename,Primary_Type,SubType, Params, Enc_Type,
is_text));

X->encoding_part = Enc_Type;
--- 1039,1092 ----
if (mime_info->raw_level < mailer_binary) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmDoesntBINARY,
"Mailer (MTA) doesn't support BINARY encoding!"));
! ret = -1;
! goto check_out;
}
}


if (is_text < 0 && (Enc_Type == ENCODING_QUOTED ||
Enc_Type == ENCODING_BASE64)) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmDontEncoding,
"Content-Type don't allow encoding -- ignoring this part."));
!
! ret = -1;
! goto check_out;
}


(void) update_encoding(&(mime_info->encoding_top),Enc_Type);

if (check) {
! check_out:
!
! if (orig_filename)
! free_string(&orig_filename);
! if (expanded_file)
! free_dir(&expanded_file);
!
! if (expanded_2) {
! if (is_copy &&
! 0 == unlink(expanded_2)) {
! DPRINT(Debug,4,(&Debug,
! "Include_Part: '%s' unlinked\n",
! expanded_2));
! }
! free(expanded_2);
!
! }
!
! return ret;
}

!
!
!
! incfile = fopen (expanded_2, "r");
if (incfile) {
DPRINT(Debug,4,(&Debug,
"Include_Part: '%s' C-T=%s/%s Params=%s Enc=%d is_text=%d\n",
! expanded_2,Primary_Type,SubType, Params, Enc_Type,
is_text));

X->encoding_part = Enc_Type;
***************
*** 1011,1025 ****
X->encoding_part_text = safe_strdup(Encoding);
}
X->TYPE = Type;
! if (Params[0])
! X->type_opts_part = safe_strdup(Params);

/* When user uses [include ...] it is better use disposition
* 'inline' instead of 'attachment'
*/
! X->disposition = DISP_INLINE;
! add_parameter_1(&(X->disposition_opts),"filename",
! Include_Filename,0);

fputc('\n',dest); /* filler */
X->start_loc = ftell(dest);
--- 1094,1174 ----
X->encoding_part_text = safe_strdup(Encoding);
}
X->TYPE = Type;
! if (Params[0]) {

! int mp = give_dt_enumerate_as_int(&mime_parameters);
! /* 0 == plain
! 1 == encoded

! 2 == plain-and-encoded
! */
!
! struct string * XX = new_string2(from_charset,s2us(Params));
!
! switch(mp) {
! case 0:
! X->TYPE_opts_part = parse_mime_param_string(XX,0,1);


! break;
! case 1:

! X->TYPE_opts_part = parse_mime_param_string(XX,0,0);
! break;
! default:
! X->TYPE_opts_part = parse_mime_param_string(XX,
! MAX_COMPAT_LEN,
! 0);
! break;
! }
! free_string(&XX);
! }

/* When user uses [include ...] it is better use disposition
* 'inline' instead of 'attachment'
*/


! {
! int mp = give_dt_enumerate_as_int(&mime_parameters);
! /* 0 == plain
! 1 == encoded
! 2 == ascii-and-encoded
! */
!

! int was_ok = 1;
! char * compat = compat_filename(Include_Filename,&was_ok);
! int have_encoded = 0;
!

! if (mp > 0 &&

! (!was_ok || !can_ascii_string(orig_filename))) {
!
!
! struct string *p1 = pick_name(orig_filename);
!
! if (p1) {
! mime_params_add(& (X->DISPOSITION_opts),
! "filename", p1);


!
! free_string(&p1);
!
! have_encoded ++;
! }
! }

!
! DPRINT(Debug,9,
! (&Debug,

! "include: mime_parameters=%d have_encoded=%d was_ok=%d\n",
! mp,have_encoded));
!
!
!

! if (0 == mp ||
! 2 == mp ||
! ! have_encoded) {
!

! X->disposition = DISP_INLINE;
! mime_params_add_compat(&(X->DISPOSITION_opts),"filename",
! compat);
!
! }
! free(compat); compat = NULL;
!
! }
!

fputc('\n',dest); /* filler */
X->start_loc = ftell(dest);
***************
*** 1053,1059 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmWriteFailedCopy,
"Write failed to temp file in copy"));
! return -1; /* Just indicate failure */
}

DPRINT(Debug,4,(&Debug,
--- 1202,1210 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmWriteFailedCopy,
"Write failed to temp file in copy"));
! /* Just indicate failure */
! ret = -1;
! goto fail_out;
}

DPRINT(Debug,4,(&Debug,
***************
*** 1065,1073 ****
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenIncludedFile,
"Can't open included File"));
! return -1;
}
! return(0);
}


--- 1216,1242 ----
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenIncludedFile,
"Can't open included File"));
! ret = -1;
! goto fail_out;
! }
!
! fail_out:
! if (orig_filename)
! free_string(&orig_filename);
! if (expanded_file)
! free_dir(&expanded_file);
!
! if (expanded_2) {
! if (is_copy &&
! 0 == unlink(expanded_2)) {
! DPRINT(Debug,4,(&Debug,
! "Include_Part: '%s' unlinked\n",
! expanded_2));
! }
! free(expanded_2);
}
!
! return ret;
}


***************
*** 1136,1143 ****
return (ret);
}

- char *error_description();
-
int have_metamail()
{
int return_value = 1;
--- 1305,1310 ----
Index: elm2.4.ME+.122-cvs/src/mime_encode.c
*** elm2.4.ME+.121/src/mime_encode.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/mime_encode.c 2005-07-01 12:15:06.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_encode.c,v 1.32 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_encode.c,v 1.33 2005/07/01 09:15:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 43,69 ****
return str;
}

- void add_parameter_t (t,name,value,quoted)
- mime_t *t;
- char *name, *value;
- int quoted;
- {
- char buffer[1025];
-
- if (t->magic != MIME_magic)
- mime_panic(__FILE__,__LINE__,"add_paramater_t",
- "Bad magic number");
-
- buffer[0] = '\0';
-
- if (t->type_opts)
- strfcpy(buffer,t->type_opts,sizeof(buffer));
-
- add_parameter(buffer,name,value,sizeof buffer,quoted);
-
- t->type_opts = strmcpy(t->type_opts,buffer);
- }
-
void add_parameter(opts,name,value,size,quoted)
char *opts, *name, *value;
int size, quoted;
--- 43,48 ----
***************
*** 110,127 ****
mime_panic(__FILE__,__LINE__,"attach_message",
"Bad magic number");

! if ((err = can_open(part->pathname,"r")) != 0) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
! "Failed: %.30s: %.40s"),
! part->pathname,error_description(err));
return 0;
}

! srcfp = fopen (part->pathname, "r");
if (!srcfp) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningName,
! "Error opening %s!"),
! part->pathname);
}

/* 1 if is text type (true)
--- 89,106 ----
mime_panic(__FILE__,__LINE__,"attach_message",
"Bad magic number");

! if ((err = can_open(part->pathname0,"r")) != 0) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrnoS,
! "Failed: %S: %.40s"),
! part->dispname,error_description(err));
return 0;
}

! srcfp = fopen (part->pathname0, "r");
if (!srcfp) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningNameS,
! "Error opening %S!"),
! part->dispname);
}

/* 1 if is text type (true)
***************
*** 153,163 ****

X -> TYPE = part ->TYPE;

! if (part->type_opts)
! X -> type_opts_part = safe_strdup(part->type_opts);
X ->disposition = part -> disposition;
! if (part->disposition_opts)
! X -> disposition_opts = safe_strdup(part->disposition_opts);
if (part->description)
X -> description = dup_string(part->description);
X -> encoding_part = part->encoding;
--- 132,142 ----

X -> TYPE = part ->TYPE;

! if (part->TYPE_opts)
! X -> TYPE_opts_part = copy_mime_param(part->TYPE_opts);
X ->disposition = part -> disposition;
! if (part->DISPOSITION_opts)
! X -> DISPOSITION_opts = copy_mime_param(part->DISPOSITION_opts);
if (part->description)
X -> description = dup_string(part->description);
X -> encoding_part = part->encoding;
***************
*** 482,512 ****
state_printf(mailer,FRM("Content-Type: %s/%s"),
get_major_type_name(part->TYPE),
get_subtype_name(part->TYPE));
! if (part->type_opts_part) {
state_putc(';',mailer);
! if (strlen(get_major_type_name(part->TYPE)) +
strlen(get_subtype_name(part->TYPE)) +
! strlen(part->type_opts_part) > 70) {
print_EOLN(mailer,ptr->encoding_top);
}
! state_putc(' ',mailer);
! state_puts(part->type_opts_part,mailer);
}
print_EOLN(mailer,ptr->encoding_top);

/* 3) Content-Disposition */
if (part->disposition != DISP_INLINE ||
! part->disposition_opts) {
state_printf(mailer,FRM("Content-Disposition: %s"),
DISPOSITION(part->disposition));
! if (part->disposition_opts) {
state_putc(';',mailer);
! if (strlen(DISPOSITION(part->disposition)) +
! strlen(part->disposition_opts) > 70) {
print_EOLN(mailer,ptr->encoding_top);
}
! state_putc(' ',mailer);
! state_puts(part->disposition_opts,mailer);
}
print_EOLN(mailer,ptr->encoding_top);
}
--- 461,515 ----
state_printf(mailer,FRM("Content-Type: %s/%s"),
get_major_type_name(part->TYPE),
get_subtype_name(part->TYPE));
! if (part->TYPE_opts_part) {
! char **X;
! char **V = encode_mime_params_v(part->TYPE_opts_part);
state_putc(';',mailer);
! if (V && V[0] &&
! strlen(get_major_type_name(part->TYPE)) +
strlen(get_subtype_name(part->TYPE)) +
! strlen(V[0]) > 70) {
print_EOLN(mailer,ptr->encoding_top);
}
! for (X = V; X && *X; X++) {
! state_putc(' ',mailer);
! state_puts(*X,mailer);
! if (*(X+1)) {
! state_putc(';',mailer);
! print_EOLN(mailer,ptr->encoding_top);
! }
! free(*X); *X = NULL;
! }
! free(V);
}
print_EOLN(mailer,ptr->encoding_top);

/* 3) Content-Disposition */
if (part->disposition != DISP_INLINE ||
! part->DISPOSITION_opts) {
state_printf(mailer,FRM("Content-Disposition: %s"),
DISPOSITION(part->disposition));
! if (part->DISPOSITION_opts) {
! char **X;
! char **V = encode_mime_params_v(part->DISPOSITION_opts);
state_putc(';',mailer);
! if (V && V[0] &&
! strlen(DISPOSITION(part->disposition)) +
! strlen(V[0]) > 70) {
print_EOLN(mailer,ptr->encoding_top);
}
!
! for (X = V; X && *X; X++) {
! state_putc(' ',mailer);
! state_puts(*X,mailer);
! if (*(X+1)) {
! state_putc(';',mailer);
! print_EOLN(mailer,ptr->encoding_top);
! }
! free(*X); *X = NULL;
! }
! free(V);
!
}
print_EOLN(mailer,ptr->encoding_top);
}
***************
*** 527,534 ****
print_EOLN(mailer, ptr->encoding_top);

if (ptr->msg_is_multipart) {
! state_printf(mailer,FRM("Content-Type: multipart/mixed; %s"),
! ptr->type_opts_top);
print_EOLN(mailer, ptr->encoding_top);
state_printf(mailer,FRM("Content-Transfer-Encoding: %s"),
ENCODING(ptr->encoding_top));
--- 530,551 ----
print_EOLN(mailer, ptr->encoding_top);

if (ptr->msg_is_multipart) {
! char **X;
! char **V = encode_mime_params_v(ptr->TYPE_opts_top);
!
! state_puts("Content-Type: multipart/mixed;",mailer);
!
! for (X = V; X && *X; X++) {
! state_putc(' ',mailer);
! state_puts(*X,mailer);
! if (*(X+1)) {
! state_putc(';',mailer);
! print_EOLN(mailer,ptr->encoding_top);
! }
! free(*X); *X = NULL;
! }
! free(V);
!
print_EOLN(mailer, ptr->encoding_top);
state_printf(mailer,FRM("Content-Transfer-Encoding: %s"),
ENCODING(ptr->encoding_top));
Index: elm2.4.ME+.122-cvs/src/mkhdrs.c
*** elm2.4.ME+.121/src/mkhdrs.c 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122-cvs/src/mkhdrs.c 2005-06-18 00:02:57.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mkhdrs.c,v 1.25 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mkhdrs.c,v 1.26 2005/06/17 21:02:57 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 28,35 ****
DEBUG_VAR(Debug,__FILE__,"header");
#endif

- char *elm_date_str();
-


static unsigned char *s2us P_((char *str));

static unsigned char *s2us(str)
--- 28,33 ----
Index: elm2.4.ME+.122-cvs/src/newmbox.c
*** elm2.4.ME+.121/src/newmbox.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/newmbox.c 2005-07-07 10:15:49.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.86 2004/07/24 19:50:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.86 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.92 2005/07/07 07:15:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.92 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 24,31 ****
extern int errno;
#endif


- char *error_description();
- long bytes();

#if !defined(ANSI_C) && !defined(atol) /* avoid problems with systems that declare atol as a macro */
extern void rewind();
extern long atol();
--- 24,29 ----
***************
*** 74,85 ****
return 1;
}

! void newmbox_1(new_folder, adds_only,mailbox, append, header_page,page)
struct folder_info *new_folder;
int adds_only;
struct MailboxView **mailbox;
int append;


- int *header_page;
struct menu_context *page;
{

int ret;
--- 72,82 ----
return 1;
}

! void newmbox_1(new_folder, adds_only,mailbox, append, page)
struct folder_info *new_folder;
int adds_only;
struct MailboxView **mailbox;
int append;
struct menu_context *page;
{
int ret;
***************
*** 202,208 ****

update_view(*mailbox);
resort_mailbox(*mailbox, adds_only ||
! append && !same_file, header_page);

return;
}
--- 199,205 ----

update_view(*mailbox);
resort_mailbox(*mailbox, adds_only ||
! append && !same_file);

return;
}
***************
*** 266,272 ****

menu_get_sizes(default_context,&LINES, &COLUMNS);

! width = COLUMNS - 52
- ((skipcount >= 10000) ? 1 : 0)
- ((count >= 10000) ? 1 : 0);

--- 263,269 ----

menu_get_sizes(default_context,&LINES, &COLUMNS);

! width = COLUMNS - 53
- ((skipcount >= 10000) ? 1 : 0)
- ((count >= 10000) ? 1 : 0);

***************
*** 443,453 ****
/* Keep current_header->mime_rec.type_opts ! */
}
DPRINT(Debug,10,(&Debug,
! "-- encrypted, %d/%s; opts=%s\n",
get_major_type_code(current_header->
mime_rec.TYPE),
! get_subtype_name(current_header->mime_rec.TYPE),
! NONULL(current_header->mime_rec.type_opts)));
}

#ifdef USE_PGP
--- 440,450 ----
/* Keep current_header->mime_rec.type_opts ! */
}
DPRINT(Debug,10,(&Debug,
! "-- encrypted, %d/%s\n",
get_major_type_code(current_header->
mime_rec.TYPE),
! get_subtype_name(current_header->mime_rec.TYPE)));
!
}

#ifdef USE_PGP
***************
*** 457,463 ****
DPRINT(Debug,10,(&Debug, "-- PGP PUBLIC KEY: %s\n",
buffer));
} else {
- char pgpbuffer[STRING];

/* Text/plain can be converted to
* application/pgp. There will a possible
--- 454,459 ----
***************
*** 476,523 ****
}

if (strncmp(buffer + 15, "SIG", 3) == 0) {
current_header->pgp |= PGP_SIGNED_MESSAGE;
DPRINT(Debug,10,(&Debug, "-- PGP signed: %s\n",
buffer));

! if (!mime_get_param("x-action",
! pgpbuffer,
! current_header->
! mime_rec.type_opts,
! sizeof(pgpbuffer))) {
! add_parameter_t(&(current_header->mime_rec),
! "x-action", "sign",
! FALSE);
}
DPRINT(Debug,10,(&Debug,
! "-- PGP signed, %d/%s; opts=%s\n",
get_major_type_name(current_header->
mime_rec.TYPE),
get_subtype_name(current_header->
! mime_rec.TYPE),
! NONULL(current_header->
! mime_rec.type_opts)));
} else {
current_header->pgp |= PGP_MESSAGE;
DPRINT(Debug,10,(&Debug,
"-- PGP message: %s\n",
buffer));
!
! if (!mime_get_param("x-action",pgpbuffer,
! current_header->
! mime_rec.type_opts,
! sizeof(pgpbuffer))) {
! add_parameter_t(&(current_header->mime_rec),
! "x-action", "encrypt",FALSE);
}
DPRINT(Debug,10,(&Debug,
! "-- PGP message, %d/%s; opts=%s\n",
get_major_type_name(current_header->
mime_rec.TYPE),
get_subtype_name(current_header->
! mime_rec.TYPE),
! NONULL(current_header->
! mime_rec.type_opts)));
}
}
}
--- 472,521 ----
}

if (strncmp(buffer + 15, "SIG", 3) == 0) {
+ CONST char *mp;
+
current_header->pgp |= PGP_SIGNED_MESSAGE;
DPRINT(Debug,10,(&Debug, "-- PGP signed: %s\n",
buffer));

! mp = get_mime_param_compat(current_header->
! mime_rec.TYPE_opts,
! "x-action");
! if (!mp) {
! mime_params_add_compat(& (current_header->
! mime_rec.TYPE_opts),
! "x-action", "sign");
!
}
DPRINT(Debug,10,(&Debug,
! "-- PGP signed, %d/%s; \n",
get_major_type_name(current_header->
mime_rec.TYPE),
get_subtype_name(current_header->
! mime_rec.TYPE)));
} else {
+ CONST char *mp;
+
current_header->pgp |= PGP_MESSAGE;
+
DPRINT(Debug,10,(&Debug,
"-- PGP message: %s\n",
buffer));
!
! mp = get_mime_param_compat(current_header->
! mime_rec.TYPE_opts,
! "x-action");
! if (!mp) {
! mime_params_add_compat(& (current_header->
! mime_rec.TYPE_opts),
! "x-action", "encrypt");
}
DPRINT(Debug,10,(&Debug,
! "-- PGP message, %d/%s\n",
get_major_type_name(current_header->
mime_rec.TYPE),
get_subtype_name(current_header->
! mime_rec.TYPE)));
}
}
}
***************
*** 564,573 ****
return 1;
}

! void resort_mailbox(mailbox, add_new_only, header_page)
struct MailboxView *mailbox;
int add_new_only;
- int *header_page;
{
int current;
int count = get_message_count(mailbox);
--- 562,570 ----
return 1;
}

! void resort_mailbox(mailbox, add_new_only)
struct MailboxView *mailbox;
int add_new_only;
{
int current;
int count = get_message_count(mailbox);
***************
*** 619,625 ****
goto found_new;


}
}
! switch (sortby) {
case SENT_DATE:

case RECEIVED_DATE:
case MAILBOX_ORDER:
--- 616,622 ----
goto found_new;


}
}
! switch (give_dt_sort_as_int(&sortby)) {
case SENT_DATE:

case RECEIVED_DATE:
case MAILBOX_ORDER:
***************
*** 631,643 ****

set_current(mailbox,current);

- {


- struct menu_common MENU;
-

- set_mcommon_from_mbxview(&MENU,mailbox);
-
- get_page(current, &MENU, header_page);
- }
}
}

--- 628,633 ----
Index: elm2.4.ME+.122-cvs/src/options.c
*** elm2.4.ME+.121/src/options.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/options.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: options.c,v 1.31 2004/07/24 19:50:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.41 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 67,90 ****
#undef onoff
#define onoff(n) (n == 1? on_name : off_name)

- extern char *alias_sort_name(), *sort_name();
-
static void on_or_off P_((int *var, int x, int y,
struct menu_context *page));
- static void switch_user_level P_((int *ulevel, int x, int y,
- struct menu_context *page));
static void one_liner P_((char *string,
struct menu_context *page));
static void sort_one_liner P_((int sorting_by,
struct menu_context *page));
static void alias_sort_one_liner P_((int sorting_by,
struct menu_context *page));
! static int change_sort P_((int *var, int x, int y,


struct MailboxView *mailbox,
struct menu_context *page));

- static int change_alias_sort P_((int *var,int x, int y,
- struct AliasView *aview,
- struct menu_context *page));
static int info_enter P_((char *name, int ypos, int xpos, int append_current,
int passwd, struct MailboxView *mailbox,
struct AliasView *aview,
--- 67,84 ----
#undef onoff
#define onoff(n) (n == 1? on_name : off_name)

static void on_or_off P_((int *var, int x, int y,
struct menu_context *page));
static void one_liner P_((char *string,
struct menu_context *page));
static void sort_one_liner P_((int sorting_by,
struct menu_context *page));
static void alias_sort_one_liner P_((int sorting_by,
struct menu_context *page));
! static int change_sort P_((struct dt_sort_info *var, int x, int y,
struct MailboxView *mailbox,
+ struct AliasView *aview,
struct menu_context *page));
static int info_enter P_((char *name, int ypos, int xpos, int append_current,
int passwd, struct MailboxView *mailbox,
struct AliasView *aview,
***************
*** 95,124 ****

static void options_help P_((struct menu_context *page));

-
- char *level_name();
static char *on_name = NULL;
static char *off_name = NULL;
static int resort = 0;


-
-
-
- static int post_folder P_((int f));
- static int post_folder(f)
- int f;
- {
- (void) expand_env(folders, raw_folders, sizeof(folders));


- return 0;
- }
-

static int post_sort P_((int f));
static int post_sort(f)
int f;
{
! if (f)
resort++;
return 0;
}

--- 89,107 ----

static void options_help P_((struct menu_context *page));

static char *on_name = NULL;
static char *off_name = NULL;
static int resort = 0;


static int post_sort P_((int f));
static int post_sort(f)
int f;
{
! if (f) {
!
resort++;
+ }
return 0;
}

***************
*** 131,148 ****
return 0;
}

- /* ? ? ? What this is ? */
- static int post_menu P_((int f));
- static int post_menu(f)
- int f;
- {


- int LINES, COLUMNS;
-

- menu_get_sizes(default_context,&LINES, &COLUMNS);
-
- headers_per_page = LINES - (mini_menu ? 14 : 9);
- return 0;
- }

opts_menu cfg_opts[] = {

--- 114,119 ----
***************
*** 163,169 ****
{'e', "E)ditor (primary)", ElmOptionEditorMenu, "editor", NULL,
"This is the editor used for all outbound messages (may be 'builtin').", ElmOptionEditorHelp},

! {'f', "F)older directory", ElmOptionFolderMenu, "maildir", post_folder,
"This is the folders directory used when '=' (etc) is used in filenames.", ElmOptionFolderHelp},

{'h', "H)old sent message", ElmOptionHoldMenu, "copy", NULL,
--- 134,140 ----
{'e', "E)ditor (primary)", ElmOptionEditorMenu, "editor", NULL,
"This is the editor used for all outbound messages (may be 'builtin').", ElmOptionEditorHelp},

! {'f', "F)older directory", ElmOptionFolderMenu, "maildir", NULL,
"This is the folders directory used when '=' (etc) is used in filenames.", ElmOptionFolderHelp},

{'h', "H)old sent message", ElmOptionHoldMenu, "copy", NULL,
***************
*** 178,184 ****
{'l', "A(l)ias Sorting", ElmOptionaLiasMenu, "aliassortby", post_sort,
"This is used to specify the sorting criteria for the alias display.", ElmOptionaLiasHelp},

! {'m', "M)enu display", ElmOptionMenuMenu, "menu", post_menu,
"This determines if you have the mini-menu displayed or not.", ElmOptionMenuHelp},

{'n', "N)ames only", ElmOptionNameMenu, "names", NULL,
--- 149,155 ----
{'l', "A(l)ias Sorting", ElmOptionaLiasMenu, "aliassortby", post_sort,
"This is used to specify the sorting criteria for the alias display.", ElmOptionaLiasHelp},

! {'m', "M)enu display", ElmOptionMenuMenu, "menu", NULL,
"This determines if you have the mini-menu displayed or not.", ElmOptionMenuHelp},

{'n', "N)ames only", ElmOptionNameMenu, "names", NULL,
***************
*** 247,256 ****
return(o->parm ? o : NULL);
}

!
! char *
! one_liner_for(c)
! char c;
{
opts_menu *o;

--- 218,226 ----
return(o->parm ? o : NULL);
}

! static char * one_liner_for P_((int c));
! static char * one_liner_for(c)
! int c;
{
opts_menu *o;

***************
*** 262,268 ****
return(NULL);
}

-
static void display_options(page)
struct menu_context *page;
{
--- 232,237 ----
***************
*** 322,327 ****
--- 291,297 ----
CATGETS(elm_msg_cat, ElmSet, ElmPressKeyHelp,


"Press the key you want help for, '?' for a key list, or '.' to exit help"));

+ /* FIXME */
lower_prompt(prompt = catgets(elm_msg_cat, ElmSet, ElmKeyPrompt, "Key : "));

while ((c = menu_ReadCh(page,0|READCH_sig_char|READCH_CURSOR)) != '.') {
***************
*** 377,385 ****
}


! char *
! level_name(n)
! int n;
{
/** return the 'name' of the level... **/

--- 347,354 ----
}


! char * level_name(n)
! int n;
{
/** return the 'name' of the level... **/

***************
*** 454,461 ****
ElmSelectOptionLetter,
"Select letter of option line, '>' to save, or 'i' to return to index."));

! PutLineX(LINES-3, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmPrompt, "Command: "));

ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize|READCH_CURSOR);
if (ch == REDRAW_MARK)
--- 423,431 ----
ElmSelectOptionLetter,
"Select letter of option line, '>' to save, or 'i' to return to index."));

! menu_PutLineX(page,
! LINES-3, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmPrompt, "Command: "));

ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize|READCH_CURSOR);


if (ch == REDRAW_MARK)
***************

*** 535,546 ****
int ch;
int oldvar = *var;

! PutLineX(x, y+6,
! CATGETS(elm_msg_cat, ElmSet, ElmUseSpaceToToggle,
! "(use <space> to toggle, any other key to leave)"));
!
! MoveCursor(x,y+3); /* at end of value... */

do {
ch = menu_ReadCh(page,READCH_sig_char|READCH_CURSOR);

--- 505,517 ----
int ch;
int oldvar = *var;

! menu_PutLineX(page,
! x, y+6,
! CATGETS(elm_msg_cat, ElmSet, ElmUseSpaceToToggle,
! "(use <space> to toggle, any other key to leave)"));

+ menu_MoveCursor(page,x,y+3); /* at end of value... */
+
do {
ch = menu_ReadCh(page,READCH_sig_char|READCH_CURSOR);

***************
*** 551,658 ****

if (ch == SPACE) {
*var = ! *var;
! PutLine0(x,y, onoff(*var));
! }
} while (ch == SPACE);
!
! MoveCursor(x,y+4); CleartoEOLN(); /* remove help prompt */
}


! static void switch_user_level(ulevel, x, y, page)
! int *ulevel, x, y;
struct menu_context *page;
{
! /** step through possible user levels... **/

! PutLineX(x, y+20,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceToChange,
! "<space> to change"));

! MoveCursor(x,y); /* at end of value... */

! while (menu_ReadCh(page,0) == ' ') {
! *ulevel = (*ulevel >= 2? 0 : *ulevel + 1);
! PutLineX(x,y, FRM("%s"), level_name(*ulevel));
! }

! MoveCursor(x,y+20); CleartoEOLN(); /* remove help prompt */
}


! static int change_sort(var, x, y, mailbox, page)
! int *var;
int x,y;


struct MailboxView *mailbox;
struct menu_context *page;

{
! /** change the sorting scheme... **/
! /** return !0 if new sort order, else 0 **/

! int last_sortby, /* so we know if it changes... */
! sign = 1; /* are we reverse sorting?? */
! int ch; /* character typed in ... */

! int LINES, COLUMNS;

! menu_get_sizes(page,&LINES, &COLUMNS);


/* *var = sortby; or... *var == sortby; */
! last_sortby = sortby; /* remember current ordering */

- PutLineX(x, COLUMNS-29,
- CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
- "(SPACE for next, or R)everse)"));
- sort_one_liner(sortby, page);
- MoveCursor(x, y);

! do {
! ch = menu_ReadCh(page, READCH_sig_char|READCH_CURSOR);

! if (ch == TERMCH_interrupt_char) {
! sortby = last_sortby;
! break;
! }



#ifdef ASCII_CTYPE
! if (isascii(ch))
#endif

ch = tolower(ch);
! switch (ch) {
! case SPACE : if (sortby < 0) {
! sign = -1;
! sortby = - sortby;
! }
! else sign = 1; /* insurance! */
! sortby = sign * ((sortby + 1) % (STATUS+3));
! if (sortby == 0) sortby = sign; /* snicker */
! PutLine0(x, y, sort_name(PAD));
! sort_one_liner(sortby, page);
! MoveCursor(x, y);
! break;
!
! case 'r' : sortby = - sortby;
! PutLine0(x, y, sort_name(PAD));
! sort_one_liner(sortby, page);
! MoveCursor(x, y);
! }
! } while (ch == SPACE || ch == 'r');
!
! MoveCursor(x, COLUMNS-30); CleartoEOLN();
!
! if (sortby != last_sortby) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmResortingFolder,
! "Resorting folder..."));
! if (sleepmsg > 0) {
! error_sleep((sleepmsg + 1) / 2);
! }
! sort_mailbox(get_message_count(mailbox), 0, mailbox);
}
! ClearLine(LINES-3); /* clear sort_one_liner()! */
! *var=sortby;
! sortby=last_sortby;
! return(*var-sortby);
}

static void one_liner(string, page)
--- 522,817 ----

if (ch == SPACE) {
*var = ! *var;
! menu_PutLine0(page,x,y, onoff(*var));
! }
} while (ch == SPACE);
!
! menu_MoveCursor(page,x,y+4);
! menu_CleartoEOLN(page); /* remove help prompt */
}


! static void change_enum P_((struct dt_enumerate_info *enumeration,


! int x, int y,

! struct menu_context *page));
! static void change_enum(enumeration, x, y, page)
! struct dt_enumerate_info *enumeration;
! int x, y;
struct menu_context *page;
{
! int c;
! int val = enumeration->val;
!
! menu_PutLineX(page,
! x,y, FRM("%s"),
! give_dt_enumerate_as_str(enumeration));


! menu_CleartoEOLN(page);
!
! menu_PutLineX(page,

! x, y+20,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceToChange,
! "<space> to change"));

! menu_MoveCursor(page,
! x,y); /* at end of value... */

! while ((c = menu_ReadCh(page,0)) == ' ') {

! val = (val +1 ) % enumeration->nlen;

! menu_PutLineX(page,
! x,y, FRM("%s"), enumeration->list[val]);
!

! menu_CleartoEOLN(page);
!
! menu_PutLineX(page,

! x, y+20,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceToChange,
! "<space> to change"));
!
! menu_MoveCursor(page,
! x,y); /* at end of value... */
! }
!
! if (c == TERMCH_interrupt_char) {
! fail:
! menu_PutLineX(page,
! x,y, FRM("%s"),
! give_dt_enumerate_as_str(enumeration));
! menu_CleartoEOLN(page);
! return;
! }
!
! if (c != '\n') {
! char buffer[SLEN+1];
! int code;
!
! menu_MoveCursor(page,
! x,y); /* at end of value... */
! menu_CleartoEOLN(page);
!
! buffer[0] = c;
! buffer[1] = '\0';
!
! code = optionally_enter(buffer, x,y,
! OE_SIG_CHAR|OE_REDRAW_MARK|OE_APPEND_CURRENT,
! sizeof buffer,page);
!
! if (0 != code) /* Ctrl-C, error or REDRAW_MARK*/
! goto fail;
!
! if (! set_dt_enumerate_as_str(enumeration,buffer))
! goto fail;
! } else
! enumeration->val = val;
!
! menu_PutLineX(page,
! x,y, FRM("%s"),
! give_dt_enumerate_as_str(enumeration));
! menu_CleartoEOLN(page);
! return;
}


! static int change_sort(var, x, y, mailbox, aview, page)
! struct dt_sort_info *var;
int x,y;
struct MailboxView *mailbox;
+ struct AliasView *aview;
struct menu_context *page;
{
! /** change the sorting scheme... **/
! /** return !0 if new sort order, else 0 **/
!
! int last_sortby, /* so we know if it changes... */
! sign = 1; /* are we reverse sorting?? */
! int ch; /* character typed in ... */
!
! int last_unstable = unstable_reverse_thread;

! int LINES, COLUMNS;
! int z,lastval=0;

! menu_get_sizes(page,&LINES, &COLUMNS);

! /* mailbox sort values are not in order! */
! for (z = 0; var->sortval[z].kw; z++)
! if (lastval < var->sortval[z].sv)
! lastval = var->sortval[z].sv;


/* *var = sortby; or... *var == sortby; */
! last_sortby = var->val; /* remember current ordering */


! if (var != &sortby ||
! var->val != REVERSE THREAD)
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
! " (SPACE for next, or R)everse)"));
! else
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmReverseUnstable,
! "(SPACE, R)everse or U)nstable)"));
!
! if (var == &sortby) {
! PutLine0(x, y, sort_name(PAD));
! sort_one_liner(var->val, page);
! }
! else if (var == &alias_sortby) {
! PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(var->val,page);
! }
! else {
! PutLine0(x, y, give_dt_sort_as_str(var));
! menu_CleartoEOLN(page);
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
! " (SPACE for next, or R)everse)"));
! }

! menu_MoveCursor(page,x, y);
!
! do {
! int o = var->val;
!
! ch = menu_ReadCh(page, READCH_sig_char|READCH_CURSOR);
!
! if (ch == TERMCH_interrupt_char) {
! var->val = last_sortby;
! unstable_reverse_thread = last_unstable;
! break;
! }



#ifdef ASCII_CTYPE
! if (isascii(ch))
#endif

ch = tolower(ch);
!
! switch (ch) {
! case SPACE :
! if (var->val < 0) {
! sign = -1;
! var->val = - var->val;
! } else
! sign = 1; /* insurance! */
!
! var->val = sign * ((var->val + 1) % (lastval+1));
! if (var->val == 0 &&
! var->sortval[0].sv != 0)
! var->val = sign; /* snicker */
!
! if (var == &sortby) {
! PutLine0(x, y, sort_name(PAD));
! sort_one_liner(var->val, page);
! } else if (var == &alias_sortby) {
! PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(var->val,page);
! } else {
! PutLine0(x, y, give_dt_sort_as_str(var));
! menu_CleartoEOLN(page);
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
! " (SPACE for next, or R)everse)"));
! }
!
! MoveCursor(x, y);
! break;
!
! case 'r' :
! var->val = - var->val;
!
! #if 0
! if (val == &sortby) {
! PutLine0(x, y, sort_name(PAD));
! sort_one_liner(sortby->val, page);
! }
! else if (var == alias_sortby) {
! PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(alias_sortby,page);
! }
! else
! #endif
! {
! PutLine0(x, y, give_dt_sort_as_str(var));
! menu_CleartoEOLN(page);
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
! " (SPACE for next, or R)everse)"));
! }
!
! MoveCursor(x, y);
!
! break;
!
! case 'u':
! if (var == &sortby &&
! var->val == REVERSE THREAD) {
!
! unstable_reverse_thread = !unstable_reverse_thread;
! PutLine0(x, y, sort_name(PAD));
! sort_one_liner(var->val, page);
! MoveCursor(x, y);


!
! }
! break;
! }
!

! if (var == &sortby &&
! ( o == REVERSE THREAD ||
! var->val == REVERSE THREAD)) {
!
! if (var->val != REVERSE THREAD)
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
! " (SPACE for next, or R)everse)"));
! else
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmReverseUnstable,
! "(SPACE, R)everse or U)nstable)"));
! MoveCursor(x, y);
!
! }
!
! } while (ch == SPACE || ch == 'r' || ch == 'u');
!
! menu_MoveCursor(page,x, COLUMNS-30);
! menu_CleartoEOLN(page);
!
! ClearLine(LINES-3); /* clear sort_one_liner()! */
!
! if (var == &sortby &&
! (var->val != last_sortby ||
! unstable_reverse_thread != last_unstable)) {
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmResortingFolder,
! "Resorting folder..."));
! if (sleepmsg > 0) {
! error_sleep((sleepmsg + 1) / 2);
! }
! sort_mailbox(get_message_count(mailbox), 0, mailbox);
!
!
! if (unstable_reverse_thread != last_unstable) {
! mark_local_changed(&unstable_reverse_thread);


! }
! return 1;
! }
!

! if (var == &alias_sortby &&
! var->val != last_sortby) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmResortingAliases,
! "Resorting aliases..."));
! if (sleepmsg > 0) {
! error_sleep((sleepmsg + 1) / 2);
}
!
! sort_aliases(get_alias_count(aview), FALSE, FALSE, aview);


!
! return 1;
! }
!

! return(var->val != last_sortby);
}

static void one_liner(string, page)
***************
*** 767,842 ****
}
}

- static int change_alias_sort(var, x, y, aview, page)
- int *var;
- int x,y;
- struct AliasView *aview;


- struct menu_context *page;
- {

- /** change the sorting scheme... **/
- /** return !0 if new sort order, else 0 **/
-
- int last_sortby, /* so we know if it changes... */
- sign = 1; /* are we reverse sorting?? */
- int ch; /* character typed in ... */
-

- int LINES, COLUMNS;
-
- menu_get_sizes(page,&LINES, &COLUMNS);

-
- /* *var = alias_sortby; or... *var == alias_sortby; */
- last_sortby = alias_sortby; /* remember current ordering */
-
- PutLineX(x, COLUMNS-29,
- CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
- "(SPACE for next, or R)everse)"));
- alias_sort_one_liner(alias_sortby,page);
- MoveCursor(x, y);
-
- do {
- ch = menu_ReadCh(page,0);
- #ifdef ASCII_CTYPE
- if (isascii(ch))
- #endif
- ch = tolower(ch);
- switch (ch) {
- case SPACE : if (alias_sortby < 0) {
- sign = -1;
- alias_sortby = - alias_sortby;
- }
- else sign = 1; /* insurance! */
- alias_sortby = sign * ((alias_sortby + 1)
- % (LAST_ALIAS_SORT+1));
- if (alias_sortby == 0) alias_sortby = sign;
- PutLine0(x, y, alias_sort_name(PAD));
- alias_sort_one_liner(alias_sortby,page);
- MoveCursor(x, y);
- break;
-
- case 'r' : alias_sortby = - alias_sortby;
- PutLine0(x, y, alias_sort_name(PAD));
- alias_sort_one_liner(alias_sortby,page);
- MoveCursor(x, y);
- }
- } while (ch == SPACE || ch == 'r');
-
- MoveCursor(x, COLUMNS-30); CleartoEOLN();
-
- if (alias_sortby != last_sortby) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmResortingAliases,
- "Resorting aliases..."));
- if (sleepmsg > 0) {
- error_sleep((sleepmsg + 1) / 2);
- }
- main_state();
- sort_aliases(get_alias_count(aview), FALSE, FALSE, aview);
- main_state();
- }
- ClearLine(LINES-1-2); /* clear alias_sort_one_liner()! */
- *var=alias_sortby;
- alias_sortby=last_sortby;
- return(*var-alias_sortby);
- }

static void alias_sort_one_liner(sorting_by,page)
int sorting_by;
--- 926,931 ----
***************
*** 914,944 ****
if (q)
return(1);

! if (DT_SRT == save_info[x].dt_type) {
! number = *SAVE_INFO_SRT(x);
! if (change_sort(&number, ypos, xpos, mailbox, page) != 0) {
! *SAVE_INFO_SRT(x) = number;
! ++q;
! }
!
! } else if(DT_ASR == save_info[x].dt_type) {
! number = *SAVE_INFO_ASR(x);
! if (change_alias_sort(&number, ypos, xpos, aview, page) != 0) {
! *SAVE_INFO_ASR(x) = number;
++q;
}

- } else if(DT_NUM == save_info[x].dt_type) {
- number = *SAVE_INFO_NUM(x);
- if (equal(name, "userlevel")) {
- switch_user_level(&number, ypos, xpos, page);
- }
-
- if (number != *SAVE_INFO_NUM(x)) {
-
- *SAVE_INFO_NUM(x) = number;
- ++q;
- }

} else if (DT_BOL == save_info[x].dt_type) {
number = *SAVE_INFO_BOL(x);
--- 1003,1014 ----
if (q)
return(1);

! if (&rc_DT_SORT == save_info[x].dt_type) {
! if (change_sort(save_info[x].val.sort,
! ypos, xpos, mailbox, aview,page) != 0) {
++q;
}


} else if (DT_BOL == save_info[x].dt_type) {
number = *SAVE_INFO_BOL(x);
***************
*** 949,954 ****
--- 1019,1028 ----
++q;
}

+ } else if (&rc_DT_ENUM == save_info[x].dt_type) {
+
+ change_enum(save_info[x].val.enumerate, ypos, xpos, page);
+
} else { /* Hopefully generic routine ... */
int code;
char * s;
***************
*** 978,990 ****
if (save_info[x].dt_type->parse_line(& save_info[x],
1 /* local */ ,buffer,
0,"<config editor>",
! 0,0))
q++;
}
}

if (q)
! save_info[x].flags |= FL_LOCAL;

return(q != 0);
}
--- 1052,1064 ----
if (save_info[x].dt_type->parse_line(& save_info[x],
1 /* local */ ,buffer,
0,"<config editor>",
! 0))
q++;
}
}

if (q)


! mark_XX(& (save_info[x]));

return(q != 0);
}
Index: elm2.4.ME+.122-cvs/src/out_utils.c
*** elm2.4.ME+.121/src/out_utils.c 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/src/out_utils.c 2004-12-22 20:35:59.000000000 +0200
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.28 2004/07/20 12:28:27 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.29 2004/12/22 18:35:59 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 339,345 ****
}
}

! void prompt_s(S)
CONST struct string *S;
{
/** prompt user for input on LINES-3 line, left justified **/
--- 339,346 ----
}
}

! void prompt_s(page,S)
! struct menu_context *page;
CONST struct string *S;
{
/** prompt user for input on LINES-3 line, left justified **/
***************
*** 347,356 ****
if(RawState()) {


int LINES, COLUMNS;

! menu_get_sizes(default_context,&LINES, &COLUMNS);

! PutLineX(LINES-4,0,FRM("%S"),S);
! CleartoEOLN();
} else {
lib_transient(FRM("%S\n"),S);
}
--- 348,357 ----
if(RawState()) {


int LINES, COLUMNS;

! menu_get_sizes(page,&LINES, &COLUMNS);

! menu_PutLineX(page,LINES-4,0,FRM("%S"),S);
! menu_CleartoEOLN(page);
} else {
lib_transient(FRM("%S\n"),S);
}
***************
*** 428,433 ****
--- 429,478 ----
PutLineX(line,(COLUMNS - l1)/2,FRM("%S"),buffer);
}

+ void menu_print_center(ptr,line,buffer)
+ struct menu_context *ptr;
+ int line;
+ struct string * buffer;
+ {
+ int l1 = string_len(buffer);


+ int LINES, COLUMNS;
+

+ menu_get_sizes(ptr,&LINES, &COLUMNS);
+
+ if (l1 < COLUMNS)
+ menu_PutLineX(ptr,line,(COLUMNS - l1)/2,FRM("%S"),buffer);
+ }
+
+
+ void menu_print_format_center(
+ #if ANSI_C
+ struct menu_context *ptr,
+ int lineY,const char *format, const char *line, ...
+ #else
+ ptr,lineY,format,line,va_alist


+ #endif
+ )
+ #if !ANSI_C

+ struct menu_context *ptr;
+ int lineY;
+ CONST char *format;
+ CONST char *line;


+ va_dcl
+ #endif
+ {
+ va_list vl;
+

+ struct string *text;
+

+ Va_start(vl, line); /* defined in defs.h */

+ text = elm_smessage(0,format,line,vl);
+ va_end(vl);
+
+ menu_print_center(ptr,lineY,text);


+
+ free_string(&text);
+ }
+

void print_format_center(
#if ANSI_C
int lineY,const char *format, const char *line, ...
Index: elm2.4.ME+.122-cvs/src/partial.c
*** elm2.4.ME+.121/src/partial.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/partial.c 2005-04-23 23:06:22.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.10 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.10 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.15 2005/04/23 20:06:22 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
***************
*** 20,72 ****

DEBUG_VAR(Debug,__FILE__,"ELM");

! static void partial_menu P_((struct menu_context *page));
! static void partial_menu(page)
! struct menu_context *page;
{


! /** write main system menu... **/

! int LINES, COLUMNS;

- menu_get_sizes(default_context,&LINES, &COLUMNS);
-

! if (user_level == 0) { /* a rank beginner. Give less options */
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,


! "You can use any of the following commands by pressing the first character;"));
! print_format_center(LINES-7,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0PartLine2,
! "d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, return to i)ndex"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0PartLine3,
! "To read a message, press <return>. j = move down, k = move up"));
} else {
! print_format_center(LINES-8,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,

! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));
! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1PartLine2,
! "a)lias, C)opy, d)elete, f)orward, g)roup reply, m)ail,"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1PartLine3,


! "n)ext, o)ptions, P)rint text, r)eply, s)ave, t)ag, or i)index"));
}
}

static int showmsg_partial_cmd P_(( struct MailboxView *mailbox,


! int cmd, int *screen_mangled,

! struct menu_context *page));
! static int showmsg_partial_cmd(mailbox,cmd,screen_mangled, page)


struct MailboxView *mailbox;
int cmd;
! int *screen_mangled;
! struct menu_context *page;
{
struct menu_common MENU;

--- 20,79 ----

DEBUG_VAR(Debug,__FILE__,"ELM");

!
! #if ANSI_C
! static subpage_simple_redraw sb_partial_menu;
! #endif
! static int sb_partial_menu P_((struct menu_context *ptr,
! struct menu_param *list));
! static int sb_partial_menu(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;
{

! struct menu_common *mptr = mp_lookup_mcommon(list,elm_mp_menu);

! int ul = give_dt_enumerate_as_int(&user_level);


! menu_ClearScreen(ptr);
!
! if (ul == 0) { /* a rank beginner. Give less options */
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,


! "You can use any of the following commands by pressing the first character;"));
! menu_print_format_center(ptr,1,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0PartLine2,
! "d)elete or u)ndelete mail, m)ail a message, r)eply mail, return to i)ndex"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0PartLine3,
! "To read a message, press <return>. j = move down, k = move up"));
} else {
! menu_print_format_center(ptr,0,


! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,

! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));
! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1PartLine2,
! "a)lias, C)opy, d)elete, f)orward, g)roup reply, m)ail,"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1PartLine3,
! "n)ext, o)ptions, P)rint text, r)eply, s)ave, t)ag, or i)index"));
}
+
+ return 1;
}

static int showmsg_partial_cmd P_(( struct MailboxView *mailbox,


! int cmd,
! struct pager_page *pager_page));

! static int showmsg_partial_cmd(mailbox,cmd,pager_page)


struct MailboxView *mailbox;
int cmd;
! struct pager_page *pager_page;
{
struct menu_common MENU;

***************

*** 76,94 ****


case '|' : {
int current = get_current(mailbox);

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmPipe, "Pipe"),
! TRUE, &MENU, page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))

! (void) do_pipe(mailbox, page); /* do pipe - ignore return val */


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

- menu_ClearScreen(page);
- build_bottom(&MENU,page);
}
break;
}
--- 83,102 ----


case '|' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page, TRUE,


! CATGETS(elm_msg_cat, ElmSet, ElmPipe, "Pipe"));

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))
! do_pipe(mailbox,

! pager_page->root,
! pager_page->prompt_area);
!

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}
}

break;
}
***************
*** 97,193 ****
}


static void partial_loop P_((struct MailboxView *mailbox,
! struct AliasView *aview,
! int header_page));
! static void partial_loop(mailbox, aview, header_page)


struct MailboxView *mailbox;
struct AliasView *aview;
- int header_page;

{
int leave = 0;
- int redraw = 0, nufoot = 0;



struct menu_context *page = new_menu_context();

!

struct menu_common MENU;
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);

! showscreen(mailbox,
! partial_menu,&header_page, page);




while (!leave) {
int ch;

if (menu_resized(page)) {

!
menu_get_sizes(page,&LINES, &COLUMNS);

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))
! if (mini_menu)
! headers_per_page = max (LINES - 14, 1);
! else
! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;

! } else
! redraw = menu_need_redraw(page);
!

! nufoot = 0;
! nucurr = 0;

! new_mail_check(mailbox, &header_page, page);
! redraw += menu_need_redraw(page);

- if (update_view(mailbox)) {
- resort_mailbox(mailbox,1, &header_page);

! redraw++;
! }

! if (redraw) {
! redraw = 0;
! showscreen(mailbox,
! partial_menu,&header_page, page);
! show_last_error();
}
-

! {
! int lin,col;
! prompt_s(mcommon_give_item(&MENU,m_Prompt));
! GetXYLocation(&lin,&col);

! CleartoEOLN();
! ch = GetPrompt(page);
!
! CleartoEOS();


!
! if (isascii(ch) && isprint(ch)) {

DPRINT(Debug,4,(&Debug,

"\nCommand: %c [%d]\n\n", ch, ch));
! } else {
! DPRINT(Debug,4,(&Debug,
! "\nCommand: %d\n\n", ch));

! }
!
! set_error(""); /* clear error buffer */
!
! MoveCursor(lin,col);
! }



! ch = mailbox_command(mailbox,ch, &nufoot,

! showmsg_partial_cmd, aview, &header_page,


page);

- redraw += menu_need_redraw(page);
-
switch (ch) {

case 0: /* OK */
break;

--- 105,284 ----
}


+
+ static void set_mailbox_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_mailbox_screen(page,LOC, LIST)
+ struct menu_context *page;


+ struct screen_parts *LOC;
+ struct menu_param *LIST;

+ {
+ int LINES, COLUMNS;
+

+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ /* 1) Title part of screen */
+

+ if (! LOC->title_page)
+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */
+
+ if (LOC->menu_page)
+ menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
+ else if (mini_menu)
+ LOC->menu_page = new_menu_subpage(page,LINES-8,4,

+ sb_partial_menu,LIST);
+
+
+ mailbox_screen_common(page,LOC, LIST);
+ }
+
+ static void check_mailbox_screen P_((struct screen_parts *LOC,
+ struct menu_param *list));


+ static void check_mailbox_screen(LOC,list)
+ struct screen_parts *LOC;

+ struct menu_param *list;
+ {

+ if (menu_resized(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }


+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));
+ sb_update_title(LOC->title_page,list);
+ }
+ if (LOC->menu_page) {
+ /* 2) menu page */
+ if (menu_resized(LOC->menu_page)) {

+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }


+ if (menu_need_redraw(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page redraw???\n"));

+ sb_partial_menu(LOC->menu_page,list);
+ }
+ }
+

+ /* 3) prompt part */
+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {
+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.

+ */
+ }
+

+ /* 4) headers part */
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page resized\n"));
+ }
+ if (menu_need_redraw(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page redraw\n"));
+ menu_ClearScreen(LOC->header_page);

+ }
+ }
+
static void partial_loop P_((struct MailboxView *mailbox,
! struct AliasView *aview));
! static void partial_loop(mailbox, aview)


struct MailboxView *mailbox;
struct AliasView *aview;
{

int leave = 0;



struct menu_context *page = new_menu_context();

! struct screen_parts LOC = { NULL };

struct menu_common MENU;
+ struct menu_param PARAM[elm_mp_COUNT+1] = {
+ { mp_menu_common, 0 },
+ { mp_integer, 0 },
+ { mp_END,0 }

+ };
+
int LINES, COLUMNS;

+ mp_list_set_mcommon(PARAM,elm_mp_menu,&MENU);
+
+
menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);
+ set_mailbox_screen(page,&LOC,PARAM);
+
+ resort_mailbox(mailbox,1);



! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! copy_current(&MENU,LOC.header_page);
!
! showscreen(page);


while (!leave) {
int ch;

+ menu_set_default(page);
+
if (menu_resized(page)) {

!
! set_mailbox_screen(page,&LOC,PARAM);


!
menu_get_sizes(page,&LINES, &COLUMNS);

! menu_trigger_redraw(page);

! }


! new_mail_check(mailbox, page, &LOC);
!
! if (update_view(mailbox)) {


! resort_mailbox(mailbox,1);

! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! menu_trigger_redraw(LOC.header_page);
! menu_trigger_redraw(LOC.title_page);
}

! if (menu_need_redraw(page))
! showscreen(page);
! check_mailbox_screen(&LOC, PARAM);

! {
! int lin,col;
!

! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));
! menu_GetXYLocation(LOC.prompt_page,&lin,&col);
!
! menu_CleartoEOLN(LOC.prompt_page);

! ch = GetPrompt(LOC.prompt_page);
!
! menu_CleartoEOS(LOC.prompt_page);

!
! if (isascii(ch) && isprint(ch)) {

DPRINT(Debug,4,(&Debug,

"\nCommand: %c [%d]\n\n", ch, ch));
! } else {
! DPRINT(Debug,4,(&Debug,
! "\nCommand: %d\n\n", ch));

! }
!
! set_error(""); /* clear error buffer */
!
! menu_MoveCursor(LOC.prompt_page,lin,col);
! }



! ch = mailbox_command(mailbox,ch, &LOC,

! showmsg_partial_cmd, aview,
page);

switch (ch) {


case 0: /* OK */
break;

***************
*** 195,201 ****


case '|' : {
int current = get_current(mailbox);

! Writechar('|');

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,

--- 286,293 ----


case '|' : {
int current = get_current(mailbox);

! menu_Writechar(LOC.prompt_page,
! '|');

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************

*** 207,214 ****

/* softkeys_off(); */

! do_pipe(mailbox, page);
! redraw += menu_need_redraw(page);

/* softkeys_on(); */
} else {
--- 299,305 ----

/* softkeys_off(); */

! do_pipe(mailbox, page,LOC.prompt_page);


/* softkeys_on(); */
} else {
***************

*** 225,233 ****
case 'i':
case 'x':
case 'X':


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmReturnIndex,
! "Return to index"));
FlushBuffer();

leave = 1;

--- 316,325 ----
case 'i':


case 'x':
case 'X':
! menu_Write_to_screen(LOC.prompt_page,

! CATGETS(elm_msg_cat, ElmSet,
! ElmReturnIndex,
! "Return to index"));
FlushBuffer();

leave = 1;
***************

*** 244,280 ****



}

! if (redraw)
! showscreen(mailbox,

! partial_menu,&header_page, page);

! check_range(&MENU);
!

!
! if (nucurr == NEW_PAGE) {

! DPRINT(Debug,5,(&Debug, " nucurr == NEW_PAGE\n"));
! show_headers(&MENU,&header_page, page);

! } else if (nucurr == SAME_PAGE) {

! DPRINT(Debug,5,(&Debug, " nucurr == SAME_PAGE\n"));

! show_current(&MENU,&header_page, page);
! } else if (nufoot) {

! if (mini_menu) {
! MoveCursor(LINES-8, 0);
! CleartoEOS();

! partial_menu(page);


! }
! else {
! MoveCursor(LINES-5, 0);
! CleartoEOS();
! }
! show_last_error(); /* for those operations that have to
! * clear the footer except for a message.
! */
! }

} /* the BIG while loop! */

OUT:
erase_menu_context(&page);

}

--- 336,352 ----



}

! if (menu_need_redraw(page))
! showscreen(page);

! check_range(&MENU, &LOC);

! check_mailbox_screen(&LOC, PARAM);


!

} /* the BIG while loop! */

OUT:
+ free_mailbox_screen(&LOC);
erase_menu_context(&page);

}
***************

*** 288,302 ****
new_mailbox = partial_to_mailbox_view(parent_mailbox);



if (new_mailbox) {
- int header_page = 0;
if (get_message_count(new_mailbox) > 0) {
set_current(new_mailbox,1); /* Set current to first message */

update_view(new_mailbox);
- resort_mailbox(new_mailbox,1, &header_page);
}

! partial_loop(new_mailbox, aview, header_page);

free_mailbox(& new_mailbox);
}
--- 360,372 ----
new_mailbox = partial_to_mailbox_view(parent_mailbox);



if (new_mailbox) {
if (get_message_count(new_mailbox) > 0) {
set_current(new_mailbox,1); /* Set current to first message */

update_view(new_mailbox);
}

! partial_loop(new_mailbox, aview);

free_mailbox(& new_mailbox);
}
Index: elm2.4.ME+.122-cvs/src/pattern.c
*** elm2.4.ME+.121/src/pattern.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/pattern.c 2005-07-06 11:42:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pattern.c,v 1.36 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pattern.c,v 1.47 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.47 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 26,37 ****
return (unsigned char *)str;
}


- static CONST unsigned char *cs2us P_((const char *str));

- static CONST unsigned char *cs2us(str)
- CONST char *str;
- {
- return (CONST unsigned char *)str;


- }

#include <errno.h>
#ifndef ANSI_C

--- 26,31 ----
***************
*** 44,50 ****
#define S_(x)
#endif

- char *error_description(), *shift_lower();
static char *tag_word = NULL;
static char *tagged_word = NULL;
static char *Tagged_word = NULL;
--- 38,43 ----
***************
*** 55,71 ****
static char *undeleted_word = NULL;
static char *Undeleted_word = NULL;

! static int DoAll P_((int func,struct menu_common *menu, int header_page));

DEBUG_VAR(Debug,__FILE__,"mbox");

! int meta_match(function, menu, header_page,page)
int function;


struct menu_common *menu;
! int header_page;

! struct menu_context *page;
{
- char ch, tagmsg[SLEN];

/** Perform specific function based on whether an entered string
matches either the From or Subject lines..
--- 48,66 ----
static char *undeleted_word = NULL;
static char *Undeleted_word = NULL;

! static int DoAll P_((int func,struct menu_common *menu,
! struct screen_parts *LOC));
! static int DoFlagged P_((int func, struct menu_common *menu,
! struct screen_parts *LOC));

DEBUG_VAR(Debug,__FILE__,"mbox");

! int meta_match(function, menu, page, LOC)
int function;
struct menu_common *menu;
! struct menu_context *page;
! struct screen_parts *LOC;
{

/** Perform specific function based on whether an entered string
matches either the From or Subject lines..
***************
*** 76,85 ****
char msg[SLEN];

struct string * meta_pattern = NULL;
! int status;


! int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES, &COLUMNS);

if (delete_word == NULL) {
tag_word = catgets(elm_msg_cat, ElmSet, ElmTag, "Tag");
--- 71,77 ----
char msg[SLEN];

struct string * meta_pattern = NULL;
! int status, line;

if (delete_word == NULL) {
tag_word = catgets(elm_msg_cat, ElmSet, ElmTag, "Tag");
***************
*** 93,170 ****
Undeleted_word = catgets(elm_msg_cat, ElmSet, ElmCapUndeleted, "Undeleted");
}

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmMessagesMatchPattern,
! "%s %S that match pattern..."),
! function==TAGGED?tag_word: function==DELETED?delete_word:undelete_word,
! mcommon_give_item(menu, m_items));

if (function == TAGGED) { /* are messages already tagged??? */
int mc = mcommon_get_count(menu);



for (i=0; i < mc; i++) {

! if (mcommon_ison_status(menu,i,TAGGED))
tagged++;
}

if (tagged) {
if (tagged > 1) {
elm_sfprintf(tagmsg, sizeof tagmsg,
CATGETS(elm_msg_cat, ElmSet,
ElmSomeMessagesATagged,
"Some %S are already tagged."),
mcommon_give_item(menu,m_items));
! elm_sfprintf(msg, sizeof msg,
! CATGETS(elm_msg_cat, ElmSet, ElmRemoveTags,
! "%s Remove Tags? (%c/%c) "),
! tagmsg, *def_ans_yes, *def_ans_no);
} else {
elm_sfprintf(tagmsg, sizeof tagmsg,
CATGETS(elm_msg_cat, ElmSet,
ElmAMessageATagged,
"One %S is already tagged."),
mcommon_give_item(menu,m_item));
! elm_sfprintf(msg, sizeof msg,
! CATGETS(elm_msg_cat, ElmSet, ElmRemoveTag,
! "%s Remove Tag? (%c/%c) "),
! tagmsg, *def_ans_yes, *def_ans_no);
}

! ch = want_to(msg, *def_ans_yes, LINES-3, 0, page);
if (ch != *def_ans_no) { /* remove tags... */


for (i=0; i < mc; i++) {

! mcommon_clearf_status(menu,i,TAGGED);
! show_new_status(i, menu, header_page);
}
}
}
}

!
status = optionally_enter2(page,
! &meta_pattern, LINES-1-2, 0,


OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmEnterPattern,
"Enter pattern: "));



! while (status == REDRAW_MARK) {

! status = optionally_enter2(page,
! &meta_pattern, LINES-1-2, 0,


! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet,
! ElmEnterPattern,
! "Enter pattern: "));
}
!
if (status != 0 || !meta_pattern ||
string_len(meta_pattern) == 0) {

if (meta_pattern)
free_string( & (meta_pattern));

! ClearLine(LINES-1-2);
return(curtag);
}

--- 85,220 ----
Undeleted_word = catgets(elm_msg_cat, ElmSet, ElmCapUndeleted, "Undeleted");


}

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMessagesMatchPattern,
! "%s %S that match pattern..."),
! function==TAGGED?tag_word: function==DELETED?delete_word:undelete_word,
! mcommon_give_item(menu, m_items));

if (function == TAGGED) { /* are messages already tagged??? */


int mc = mcommon_get_count(menu);
+

for (i=0; i < mc; i++) {

! if (mcommon_ison_status(menu,i,status_basic,TAGGED))
tagged++;
}

+
if (tagged) {
+ char tagmsg[SLEN];
+ int ch;
+

+ int delay_redraw = 0;
+ again:

if (tagged > 1) {
elm_sfprintf(tagmsg, sizeof tagmsg,
CATGETS(elm_msg_cat, ElmSet,
ElmSomeMessagesATagged,
"Some %S are already tagged."),
mcommon_give_item(menu,m_items));
!
! ch = prompt_letter(1,"",*def_ans_yes,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel,
! LOC->prompt_page,

! CATGETS(elm_msg_cat, ElmSet, ElmRemoveTags,
! "%s Remove Tags? (%c/%c) "),
! tagmsg, *def_ans_yes, *def_ans_no);
} else {
elm_sfprintf(tagmsg, sizeof tagmsg,
CATGETS(elm_msg_cat, ElmSet,
ElmAMessageATagged,
"One %S is already tagged."),
mcommon_give_item(menu,m_item));
! ch = prompt_letter(1,"",*def_ans_yes,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel,
! LOC->prompt_page,

! CATGETS(elm_msg_cat, ElmSet, ElmRemoveTag,
! "%s Remove Tag? (%c/%c) "),
! tagmsg, *def_ans_yes, *def_ans_no);


}

! if (('L'&31) == ch ||
! REDRAW_MARK == ch) {

! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/
!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! delay_redraw++;

! goto again;


! }
!
! if (delay_redraw)
! menu_trigger_redraw(page);
!

! if (TERMCH_interrupt_char == ch)
! goto clean;
!
if (ch != *def_ans_no) { /* remove tags... */


for (i=0; i < mc; i++) {

! int vis;
!
! mcommon_clearf_status(menu,i,status_basic,TAGGED);
!
! vis = compute_visible(i+1, menu);
! menu_header_status_update(LOC->header_page,vis-1);
!
}
}
}
}


! /* FIXME --optionally_enter* should use prompt_area */
! line = menu_GetAbsLine(LOC->prompt_page,1);

status = optionally_enter2(page,
! &meta_pattern, line, 0,


OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmEnterPattern,
"Enter pattern: "));

! {


! int delay_redraw = 0;
!

! while (status == REDRAW_MARK) {

! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/
!

! delay_redraw++; /* Can't trigger redraw yet... */
!
! status = optionally_enter2(page,
! &meta_pattern, line, 0,


! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet,
! ElmEnterPattern,
! "Enter pattern: "));
! }
!
! if (delay_redraw)
! menu_trigger_redraw(page);
}
!
if (status != 0 || !meta_pattern ||
string_len(meta_pattern) == 0) {

if (meta_pattern)
free_string( & (meta_pattern));

! menu_ClearLine(LOC->prompt_page,1);
return(curtag);
}

***************
*** 174,183 ****
if (meta_pattern)
free_string( & (meta_pattern));

! return(DeleteTagged(menu, header_page, page));

! } else if (string_matches_ascii(meta_pattern, s2us("all")))
! count = DoAll(function, menu, header_page);

else {
int mc = mcommon_get_count(menu);
--- 224,236 ----
if (meta_pattern)
free_string( & (meta_pattern));

! return(DeleteTagged(menu, page, LOC->header_page));

! } else if (string_matches_ascii(meta_pattern, s2us("flagged")))
! count = DoFlagged(function, menu, LOC);
!
! else if (string_matches_ascii(meta_pattern, s2us("all")))
! count = DoAll(function, menu, LOC);

else {
int mc = mcommon_get_count(menu);
***************
*** 187,197 ****
for (i = 0; i < mc; i++) {
if (mcommon_matches(menu,i,meta_pattern) &&
(!selected ||
! (selected && mcommon_ison_status(menu,i,VISIBLE))
)) {

if (function == UNDELETE)
! mcommon_clearf_status(menu,i,DELETED);

else if ((function == DELETED) &&
(mcommon_get_type(menu,i) & SYSTEM)) {
--- 240,251 ----
for (i = 0; i < mc; i++) {
if (mcommon_matches(menu,i,meta_pattern) &&
(!selected ||
! (selected && mcommon_ison_status(menu,i,
! status_basic,VISIBLE))
)) {

if (function == UNDELETE)
! mcommon_clearf_status(menu,i,status_basic,DELETED);

else if ((function == DELETED) &&
(mcommon_get_type(menu,i) & SYSTEM)) {
***************
*** 200,215 ****
count--;

} else
! mcommon_setf_status(menu,i, function);

- show_new_status(i,menu, header_page);
if(i == current - 1) curtag++;
count++;
}
}
}

! ClearLine(LINES-1-2); /* remove "pattern: " prompt */

if (count > 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTaggedMessages,
--- 254,270 ----
count--;

} else
! mcommon_setf_status(menu,i, status_basic,function);
!
! menu_header_status_update(LOC->header_page,i); /* ! */

if(i == current - 1) curtag++;
count++;
}
}
}

! menu_ClearLine(LOC->prompt_page,1); /* remove "pattern: " prompt */

if (count > 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTaggedMessages,
***************
*** 231,247 ****
function==TAGGED? tagged_word :
function==DELETED? mark_delete_word: undeleted_word);
}
!
if (meta_pattern)
free_string( & (meta_pattern));

return(curtag);
}

! int pattern_match(menu, header_page, page)
struct menu_common *menu;


- int header_page;
struct menu_context *page;
{

/** Get a pattern from the user and try to match it with the
from/subject lines being displayed. If matched (ignoring
--- 286,303 ----
function==TAGGED? tagged_word :
function==DELETED? mark_delete_word: undeleted_word);
}
!
! clean:
if (meta_pattern)
free_string( & (meta_pattern));

return(curtag);
}

! int pattern_match(menu, page, LOC)
struct menu_common *menu;
struct menu_context *page;
+ struct screen_parts *LOC;
{
/** Get a pattern from the user and try to match it with the
from/subject lines being displayed. If matched (ignoring
***************
*** 261,337 ****
static struct string * alt_pattern = NULL;
int ret = 0 ;



! int redraw = 0;

int anywhere = FALSE;
int matched;
- struct string * buffer = NULL;
- struct string *buffer1 = NULL;

struct string * SEARCH = NULL; /* SHARED: point either to
pattern or alt_pattern */

int val;


! int LINES, COLUMNS;

- menu_get_sizes(page,&LINES, &COLUMNS);

! buffer = format_string(CATGETS(elm_msg_cat, ElmSet,

! ElmMatchPatternInEntire,
! "Match pattern (in entire %S):"),
! mcommon_give_item(menu,m_item));
!
! PutLineX(LINES-4,40, CATGETS(elm_msg_cat, ElmSet, ElmMatchAnywhere,
! "/ = Match anywhere in %S."),
! mcommon_give_item(menu, m_items));
!
! buffer1 = format_string(CATGETS(elm_msg_cat, ElmSet, ElmMatchPattern,
! "Match pattern:"));



! val = pattern_enter(&pattern, &alt_pattern, LINES-2,0,
! buffer, buffer1, &redraw, page);

! /* 0 == pattern given
! 1 == alt_pattern given
! -1 == EOF ...
!
! */

! if (val < 0) {
! ret = EOF;
! goto out;
! }

! if (1 == val) {
! if (! alt_pattern ||
! string_len(alt_pattern) == 0) {

! ret = 1;
! goto out;
! }

! anywhere = TRUE;
! SEARCH = alt_pattern;
! }

! if (0 == val) {
! if (! pattern ||
! string_len(pattern) == 0) {
! ret = 0;
goto out;
- }

! anywhere = FALSE;
! SEARCH = pattern;
}
!
if (SEARCH) {

! if (anywhere)
! ret = mcommon_match_in_text(menu,SEARCH, header_page,
! page);
! else {

int current = mcommon_get_current(menu);
int mc = mcommon_get_count(menu);
--- 317,435 ----
static struct string * alt_pattern = NULL;
int ret = 0 ;



! int delay_redraw = 0;

int anywhere = FALSE;
int matched;

struct string * SEARCH = NULL; /* SHARED: point either to
pattern or alt_pattern */

int val;
! int line;


! int append = 0;


+ /* Redraw loop */
+ append = OE_ALT_SOLIDUS;
+ do {

! menu_PutLineX(LOC->prompt_page,0,40,
! CATGETS(elm_msg_cat, ElmSet, ElmMatchAnywhere,
! "/ = Match anywhere in %S."),
! mcommon_give_item(menu, m_items));



! /* FIXME --optionally_enter* should use prompt_area */
! line = menu_GetAbsLine(LOC->prompt_page,1);

! val = optionally_enter2(page,
! &pattern, line, 0,
! OE_REDRAW_MARK|append|


! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet, ElmMatchPattern,
! "Match pattern:"));

! if (REDRAW_MARK == val) {

! menu_ClearScreen(page); /* Clear possible redraw mark */

! /* Call refresh routines of children */
! menu_redraw_children(page);



! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/
!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! delay_redraw++;

! if (pattern &&
! string_len(pattern) > 0)
! append = OE_APPEND_CURRENT;
! }
! } while (val == REDRAW_MARK);
!
! anywhere = FALSE;
! SEARCH = pattern;
!
! if (val == OE_ALT_SOLIDUS) {

! append = 0;

! menu_MoveCursor(LOC->prompt_page,0,40);


! menu_CleartoEOLN(LOC->prompt_page);
!
!

! do {
!

! /* FIXME --optionally_enter* should use prompt_area */
! line = menu_GetAbsLine(LOC->prompt_page,1);

! val = optionally_enter2(page,
! &alt_pattern, line, 0,
! OE_REDRAW_MARK|append|


! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet,
! ElmMatchPatternInEntire,
! "Match pattern (in entire %S):"),
! mcommon_give_item(menu,m_item));
!
! if (REDRAW_MARK == val) {

! menu_ClearScreen(page); /* Clear possible redraw mark */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/
!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! delay_redraw++;

! append = OE_APPEND_CURRENT;
! }
!
! } while (val == REDRAW_MARK);
!
! anywhere = TRUE;
! SEARCH = alt_pattern;
! }
!
! if (0 != val) {
! if (-1 == val) /* Ctrl-C */
goto out;

! ret = EOF;
! goto out;
}
!
if (SEARCH) {

! if (string_len(SEARCH) == 0) {
! ret = 0;


! goto out;
! }
!

! if (anywhere)
! ret = mcommon_match_in_text(menu,SEARCH,page, LOC);
! else {

int current = mcommon_get_current(menu);
int mc = mcommon_get_count(menu);
***************
*** 340,350 ****
for (i = current; i < mc; i++) {
if (mcommon_matches(menu,i,SEARCH) &&
(!selected ||
! (selected && mcommon_ison_status(menu,i,VISIBLE))
)) {

current = ++i;
mcommon_set_current(menu,current);

ret = 1;
goto out;
--- 438,451 ----
for (i = current; i < mc; i++) {
if (mcommon_matches(menu,i,SEARCH) &&
(!selected ||
! (selected && mcommon_ison_status(menu,i,
! status_basic,VISIBLE))
)) {

current = ++i;
mcommon_set_current(menu,current);
+ copy_current(menu,LOC->header_page);
+ get_page(menu, LOC->header_page);

ret = 1;
goto out;
***************
*** 360,382 ****
and should have remembered, so that behauviour matches
to Elm 2.4
*/
-
- if (buffer)
- free_string(&buffer);
- if (buffer1)
- free_string(&buffer1);

! if (redraw)
menu_trigger_redraw(page);

return(ret);
}

/* This will tag, delete, or undelete all or the currently visible messages */
! static int DoAll(func, menu, header_page)
int func;


struct menu_common *menu;
! int header_page;

{
int i, count = 0;
int mc = mcommon_get_count(menu);
--- 461,481 ----
and should have remembered, so that behauviour matches
to Elm 2.4
*/



! if (delay_redraw)
menu_trigger_redraw(page);
+ else

+ menu_trigger_redraw(LOC->prompt_page);

return(ret);
}

+
/* This will tag, delete, or undelete all or the currently visible messages */
! static int DoAll(func, menu, LOC)
int func;


struct menu_common *menu;
! struct screen_parts *LOC;
{

int i, count = 0;
int mc = mcommon_get_count(menu);
***************
*** 385,400 ****


for (i=0; i < mc; i++) {

if (!selected ||
! (selected && mcommon_ison_status(menu,i,VISIBLE))) {
if (func == UNDELETE)
! mcommon_clearf_status(menu,i,DELETED);
else
! mcommon_setf_status(menu,i,func);

! show_new_status(i,menu, header_page);
++count;
}
}
return(count);
}

--- 484,536 ----


for (i=0; i < mc; i++) {

if (!selected ||
! (selected && mcommon_ison_status(menu,i,status_basic,VISIBLE))) {
if (func == UNDELETE)
! mcommon_clearf_status(menu,i,status_basic,DELETED);
else
! mcommon_setf_status(menu,i,status_basic,func);
!
! menu_header_status_update(LOC->header_page,i); /* ! ! ! */
!
! ++count;
! }
! }
!
! DPRINT(Debug,7,(&Debug, "DoAll=%d\n",count));
!
! return(count);
! }

! static int DoFlagged(func, menu, LOC)
! int func;
! struct menu_common *menu;
! struct screen_parts *LOC;
! {
! int i, count = 0;
! int mc = mcommon_get_count(menu);


! int selected = mcommon_get_selected(menu);
!

! for (i=0; i < mc; i++) {
! if (!selected ||
! (selected && mcommon_ison_status(menu,i,status_basic,VISIBLE))) {
!
! if (mcommon_ison_status(menu,i,status_1,S1_FLAGGED)) {
!
! if (func == UNDELETE)
! mcommon_clearf_status(menu,i,status_basic,DELETED);
! else
! mcommon_setf_status(menu,i,status_basic,func);
!
! menu_header_status_update(LOC->header_page,i); /* ! ! ! */
!
++count;
+ }
}
}
+
+
+ DPRINT(Debug,7,(&Debug, "DoFlagged=%d\n",count));
+
return(count);
}

Index: elm2.4.ME+.122-cvs/src/pgp.c
*** elm2.4.ME+.121/src/pgp.c 2004-08-04 20:07:35.000000000 +0300
--- elm2.4.ME+.122-cvs/src/pgp.c 2005-07-05 23:44:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp.c,v 1.45 2004/07/26 12:41:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp.c,v 1.52 2005/07/05 20:44:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.52 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 484,489 ****
--- 484,490 ----
char * env[2];
int a;
int ret = 0;
+ int was_redraw = 0; /* FIXME */
struct run_state RS;
int exit_code;
int LINES, COLUMNS;
***************
*** 509,514 ****
--- 510,516 ----
goto next_recipient;

if (GetPGPKey(c, keyid, sizeof keyid, v) == -1) {
+ redraw1:
while(1) {
int x_coord, y_coord, ans;
int def_ans = 'q';
***************
*** 516,538 ****
CleartoEOS ();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmPgpNoMatch,
"Couldn't find key matching '%s'!"),
! c);
print_format_center (LINES-3,
CATGETS(elm_msg_cat, ElmSet, ElmPgpKeyError,
"e)dit recipient list, s)kip recipient, q)uit"));
! PutLineX (LINES-1-3, 0, CATGETS(elm_msg_cat, ElmSet,
! ElmPgpSelect,
! "Select [e/s/q]: "));
! GetXYLocation(&x_coord, &y_coord);


! PutLineX (x_coord, y_coord,FRM("%c"),def_ans);
! MoveCursor(x_coord, y_coord);

switch((ans = menu_ReadCh(page,REDRAW_MARK))) {
case '\n':

case '\r':
ans = def_ans;
}

switch(ans) {
case 'e':
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
--- 518,546 ----
CleartoEOS ();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmPgpNoMatch,
"Couldn't find key matching '%s'!"),
! c);
print_format_center (LINES-3,
CATGETS(elm_msg_cat, ElmSet, ElmPgpKeyError,
"e)dit recipient list, s)kip recipient, q)uit"));
! menu_PutLineX (page,LINES-1-3, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPgpSelect,
! "Select [e/s/q]: "));
! menu_GetXYLocation(page, &x_coord, &y_coord);
! menu_PutLineX (page,x_coord, y_coord,FRM("%c"),def_ans);
! menu_MoveCursor(page, x_coord, y_coord);

switch((ans = menu_ReadCh(page,REDRAW_MARK))) {
case '\n':
case '\r':
ans = def_ans;
+ case REDRAW_MARK:
+ was_redraw = 1;
+ menu_ClearScreen(page);
+ goto redraw1;
}

+
switch(ans) {
case 'e':
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
***************
*** 602,608 ****
FRM("%s.asc"), filename);

Raw(OFF);
! ClearScreen();
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,ElmRunningPgp,
"Running PGP..."));
Write_to_screen(FRM("\n\n"));
--- 610,616 ----
FRM("%s.asc"), filename);

Raw(OFF);
! ClearScreen(0);
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,ElmRunningPgp,
"Running PGP..."));
Write_to_screen(FRM("\n\n"));
***************
*** 827,832 ****
--- 835,844 ----
argv[0],error_description(RS.save_errno));
return TRUE;
}
+
+ if (was_redraw) /* FIXME: Should not needed */
+ menu_trigger_redraw(page);
+
return opts;
}

***************
*** 836,842 ****
struct menu_context *page;
{
int update = TRUE;


! enum pgp_version v = send_pgp_version;
enum pgp_version version;

int x_coord = 0, y_coord = 0;
int def_ans = 'q';
--- 848,854 ----
struct menu_context *page;
{
int update = TRUE;


! enum pgp_version v = (enum pgp_version) give_dt_enumerate_as_int(&send_pgp_version);
enum pgp_version version;

int x_coord = 0, y_coord = 0;
int def_ans = 'q';
***************
*** 855,868 ****


print_format_center(LINES-3,
CATGETS(elm_msg_cat, ElmSet, ElmPgpEncSign,
"e)ncrypt, s)ign, b)oth encrypt and sign or q)uit"));

! PutLineX (LINES-4, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpP,
! "pgp: "));
! GetXYLocation(&x_coord, &y_coord);

update = FALSE;

Kari E. Hurtta

unread,
Jul 13, 2005, 5:40:16 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.0

Elm 2.4ME+ PL122 (25)


- Is be available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

files elm-2.4ME+PL122.patch.gz
and elm-2.4ME+122.tar.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+PL122.patch.gz >
and <URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+122.tar.gz >
via WWW.

- Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

files elm-2.4ME+PL122.patch.gz
and elm-2.4ME+122.tar.gz
for a moment.

- Is available with (3)
<URL: http://www.elmme-mailer.org/elm-2.4ME+PL122.patch.gz >
and <URL: http://www.elmme-mailer.org/elm-2.4ME+122.tar.gz >
via WWW.

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL122.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+122.tar.gz >
via WWW.


- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL122.patch.gz >
and <URL: http://koti.welho.com/khurtta/elm-2.4ME+122.tar.gz >
via WWW.

- Will available on ftp.funet.fi (or ftp.ipv6.funet.fi) (4)


via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+

files elm-2.4ME+PL122.patch.gz
and elm-2.4ME+122.tar.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL122.patch.gz >
and <URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+122.tar.gz >
via WWW.

(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire. Actually
ozone.fmi.fi was scheduled to retire one year ago...

Finnish Meteorological Institute will move in September 2005 to
new house. These machines ozone2.fmi.fi (www.ozone.fmi.fi)
and ozone.fmi.fi (ftp.ozone.fmi.fi) are most likely not moved...

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)
are now on site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.

(4) Is submitted to ftp.funet.fi, directory pub/unix/incoming/elm-2.4ME+-3/

Before applying patch catenate parts 1 - 18 first.

That part (part 0) do not include patch. Patch
is on part 1 - 18.

For applying thich patch use (on directory where Configure is)

mkdir lib/mailer
patch -p1 < {catenated-parts}

Then check that removed files do not exists or are empty

ls -la `cat OBSOLETE `

If that lists non-empty files, patch failed.

Then remove empty files with command

rm `cat OBSOLETE `

Changes of Elm 2.4ME+ PL122 (25) compared with Elm 2.4ME+ PL121 (25)
--------------------------------------------------------------------

Note: You must create directory

lib/mailer
before applying this patch!

WARNING: Quite lot of changes in many areas. So

please report new bugs which you observe...

* Some changes on screen handling:


- Moved title, menu and prompt area on mailbox,

aliases and attachment screens to own subpage.

- Changed layout of attachment screen more similar than

other screens.


- Removed redraw flag from main loop.

- Removed nufoot flag from main loop.

- Removed redraw flag from mailbox_command().

- Removed redraw flag from motion().

- Removed nufoot flag from mailbox_command().

- Removed nufoot flag from motion().

- Removed redraw flag from new_mail_check().

- Removed redraw flag from partial_loop().

- Removed nufoot flag from partial_loop().

- Removed redraw flag from digest_loop().

- Removed nufoot flag from digest_loop().

- Removed redraw flag from view_canceled_mails().

- Removed nufoot flag from view_canceled_mails().

- Removed redraw flag from alias().

- Removed nutitle flag from alias().

- Removed nufoot flag from alias().

- Changed passing of redraw data from remail().

- Removed redraw flag from remail().

- Changed passing of redraw data from forward().

- Changed passing of redraw data from reply_to_everyone().

- Removed redraw flag from reply_to_everyone().

- Changed passing of redraw data from send_msg_l()

and send_msg_middle().


- Changed passing of redraw data from reply().

- Removed redraw flag from reply().

- Changed passing of redraw data from mail_filled_in_form().

- Changed passing of redraw data from pgp_mail_public_key().

- Changed passing of redraw data from print_text().

- Changed passing of redraw data from save().

- Changed method how headers on aliases and mailbox

screen are drawn and updated.

- Removed inalias, last_current, last_header_page,

headers_per_page and nucurr global variables.

- One more mail is listed on mailbox screen.

- Removed passing of header_page variable.

- Changed method how screen is handled on 'after

paging' commands (showmsg_c).


- Removed/changed passing of redraw flag on file_browser(),

gen_browser() folder_browser(), attach_save()


- Changed passing of redraw data from name_copy_file().

- Changed handling of 'prompt area' on Mail Pre-Send Screen

and on Message Header Edit Screen screen.

- If several -f option is given (for combined view


of given folders), starting of Elm ME+ do not fail

if first folder is inaccessible.

- Handle REDRAW_MARK on pgp_encrypt()

- "If you had no aliases yet, and pushed j or k in the

aliases menu (or the down or up arrows), you had a

"bad item" "common menu panic". The reason was a

missing "break" statement in alias_item.c, which was

present in the approprite place in mailbox_item.c"

From: Kovacs Baldvin <bal...@cs.elte.hu>


( Patch was agaist Elm ME+ 2.5 but applies also to Elm

2.4ME+ )

- Fix error message


Path component "none" not absolute on key

"internal-mailcaps" value "none"


when on elmrc have line

internal-mailcaps = none

- Added elmrc option "pgp-encrypt-type", which take values

"application/pgp", "text/plain" and "text/x-pgp" (without

quotes). These are same values than for pgp-sign-type.

Except that this is for encryption. Because encrypted data

is ascii armored, also text -type can be used here.

Requested by: Axel Reinhold <ax...@freakout.de>

NOTE: Note that using text/plain for excrypted data causes

that charset=US-ASCII is used always (for type

application/pgp charset paramater is not added).

It is little guestionable is that correct. These

encrypted types do not interact very well with charsets

anyway.

- "MIME structure Menu" was draw incorrectly when arrow cursor

was used.


- "MIME structure Menu" screen's layout now resembles more

main mailbox screen.

- Handle some ambiguous multipart boundary prefixes.

- Ignore empty line before "begin " on uudecode.

- "I am seeing two exit messages if I start elm and exit right away
using ELM 2.4ME+ PL121"


Problem noted by: Bruce Momjian <ro...@candle.pha.pa.us>

- "On a Solaris 8 machine, if I enter ELM and don't make

any changes it now says "Folder unchanged." twice.

Not a big deal, but I thought I should report it. :-)"

Problem noted by: James Corey <plov...@yahoo.com>

> Make sure that first message is erased on exit (usually

ti/te erases screen or changes buffers, but that

apply to "elm -t" also.)

- Added elmrc option "prompt-metamail".

If set, also text

Parsing MIME structure... metamail not needed

is not printed after
Parsing MIME structure...

text, because opposite situation will be prompted!

- Setting "prompt-metamail" (default) causes

showing of "Metamail selection" screen. This is

same screen than "Mailcap program selection" screen.

Answering prompt with p)age command changes screen

to "Mailcap program selection" screen. Answering

proompt with m)etamail command calls metamail.

- Allow canceling of
Mailcap program selection


with Ctrl-C (interrupt character) on systems

which supports POSIX termios.

- Canceling of


Append to an existing file XXX ?

Append to mail folder XXX ?

Create a new file XXX ?

Create a new mail folder XXX ?

Some XXX are already tagged. Remove Tags?

One XXX is already tagged. Remove Tags?

Are you sure you want to remail this message ?


prompts with Ctrl-C (interrupt character) is possible

on systems which supports POSIX termios.

- Added to
Mailcap program selection


screen same title than on pager (on case when elmrc

option "titles" is set (default)).

- "First I did not even understand what I am asked


in the attach menu. I tried a .ps file, then I had

a question "Use gnome-gv to..." blabla, yes or no.

And down there I had "Answer questions, or m)etamail,

or q)uit". Now "quit" did not quit from aliases,

but instead it behaved as an "OK". Pushing 'm' worked,

but I did not know wether it utilized the answer that

I gave already, since it asked again (!) if I'd like

to use gnome-gv. "F?ck, I do", I thought... Then I've

realized what is going on: after I answered yes for

the first question, I need to say quit, and then I get

gnome-gv..."


Problem noted by: Kovacs Baldvin <bal...@cs.elte.hu>

> Changed q)uit command to d)one on

Mailcap program selection
screen.

- Letters 'q' and 'i' leaves now

Mailcap program selection


without paging message. Note that this changes

meaning of 'q' -command.

- Added O)verride charset and Ctrl-K (Mail PGP public key)

to 'after paging' (showmsg_c) commands.

- Added redraw handling to following prompts:


Already have selection criteria - add more?

Enter criteria or '?' for help:

- Fix valgrind reported memory leak:


32 bytes in 2 blocks are definitely lost in loss record 6 of 28

at 0x400260DC: malloc (vg_replace_malloc.c:153)

by 0x8151DBF: safe_malloc (safemalloc.c:47)

by 0x8069EEE: attach_menu (attach_menu.c:2433)

- Add redraw handling to display_file()

- Fix "Reverse Thread" sorting order.

- Fix valgrind reported memory leak:


56 bytes in 5 blocks are definitely lost in loss record 9 of 28

at 0x400260DC: malloc (vg_replace_malloc.c:153)

by 0x8147F8F: safe_malloc (safemalloc.c:47)

by 0x80E9095: new_state_1 (charset_input.c:18)

by 0x80F9FFC: cs_add_streambyte_to_utf8 (cs_utf.c:348)

- Fix valgrind reported memory leak:


16 bytes in 2 blocks are definitely lost in loss record 3 of 28

at 0x400260DC: malloc (vg_replace_malloc.c:153)

by 0x8147F8F: safe_malloc (safemalloc.c:47)

by 0x8163E41: malloc_string (string.c:116)

by 0x8163FBC: new_string (string.c:153)

by 0x80876EA: read_number (in_utils.c:282)

- Fix valgrind reported memory leak:


30 bytes in 1 blocks are definitely lost in loss record 7 of 29

at 0x4002668F: realloc (vg_replace_malloc.c:310)

by 0x8148225: safe_realloc (safemalloc.c:63)

by 0x8133394: elm_vmessage (output.c:1281)

by 0x8133A5E: elm_message (output.c:1460)

by 0x80FD9DA: init_debug (debug.c:58)

- Fix valgrind reported memory leak:


8 bytes in 1 blocks are definitely lost in loss record 1 of 31

at 0x400260DC: malloc (vg_replace_malloc.c:153)

by 0x8148173: safe_malloc (safemalloc.c:47)

by 0x8145BA9: split_remote_name (remote_mbx.c:620)

by 0x814ADA3: browser_folder_from_dummy (savefolder.c:1076)

- Fix valgrind reported memory leak:

14 bytes in 1 blocks are definitely lost in loss record 3 of 31

at 0x400260DC: malloc (vg_replace_malloc.c:153)

by 0x8148349: safe_strdup (safemalloc.c:79)

by 0x8145B8E: split_remote_name (remote_mbx.c:618)

by 0x814ADA3: browser_folder_from_dummy (savefolder.c:1076)

- Fix valgrind reported memory leak:


8 bytes in 1 blocks are definitely lost in loss record 1 of 30

at 0x400260DC: malloc (vg_replace_malloc.c:153)

by 0x8148237: safe_malloc (safemalloc.c:47)

by 0x8164109: malloc_string (string.c:116)

by 0x8164FDC: cat_strings (string.c:449)

by 0x81307E5: elm_smessage (output.c:857)

by 0x8087063: prompt_letter (in_utils.c:84)

- Fix valgrind reported memory leak:


29 bytes in 5 blocks are definitely lost in loss record 7 of 30

at 0x400260DC: malloc (vg_replace_malloc.c:153)

by 0x8148243: safe_malloc (safemalloc.c:47)

by 0x8105414: rfc822_tokenize (getaddr.c:37)

by 0x8061333: do_expand_group_l (aliaslib.c:88)

- Fix valgrind reported memory leak:


7104 bytes in 1 blocks are definitely lost in loss record 27 of 29

at 0x4002668F: realloc (vg_replace_malloc.c:310)

by 0x8148339: safe_realloc (safemalloc.c:63)

by 0x80BFA69: add_canceled_mail1 (canceled_mail.c:1291)

- Fix valgrind reported memory leak:


8 bytes in 1 blocks are definitely lost in loss record 2 of 29

at 0x400260DC: malloc (vg_replace_malloc.c:153)

by 0x814826B: safe_malloc (safemalloc.c:47)

by 0x816413D: malloc_string (string.c:116)

by 0x81642B8: new_string (string.c:153)

by 0x80885D9: enter_helper (in_utils.c:656)

by 0x8089324: optionally_enter2 (in_utils.c:1115)

by 0x808E52B: limit (limit.c:110)

- Removed pattern_enter()

- Fix "Append to mail folder " -question.

- Changed IMAP \Flagged that they are not longer

tagged (+), but instead marked with new flag (F)

as flagged.
- \Flagged is shown on place of '+' on screen as 'F'.


- \Flagged can be modified with with new toggle F)lag command

- Flag is saved as letter F on Status: -header for

local mailbox


- Giving argument "flagged" (without quotes) to l)imit

command selects flagged messages. That is not mentioned "?"

help of l)imit command, because it it does not fit to

80 characters. That is similar than "tagged" argument

to l)imit command.


- Command Ctrl-D accepts argument "flagged" (without quotes)

which deletes all visible flagged messages.

- Command Ctrl-D accepts argument "flagged" (without quotes)

which tags all visible flagged messages.

- Command Ctrl-U accepts argument "flagged" (without quotes)

which undeletes all visible flagged messages.

- Changed Ctrl-D command with argument "tagged" (without quotes)


so that it deletes only all visible tagged messages

(it was deleting also messages which was not on limited

selection.)

- Set close-on-exec flag for opened local mailbox.

- "I am seeing two exit messages if I start elm and exit right away
using ELM 2.4ME+ PL121"


Problem noted by: Bruce Momjian <ro...@candle.pha.pa.us>

- "On a Solaris 8 machine, if I enter ELM and don't make

any changes it now says "Folder unchanged." twice.

Not a big deal, but I thought I should report it. :-)"

Problem noted by: James Corey <plov...@yahoo.com>

> Make sure that first message is erased on exit (often

ti/te erases screen or changes buffers, but that

problem apply to "elm -t" also.)

- Fix case whare ascii only mail was sent with headers


Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=ISO-8859-1
instead of
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

- Added mlterm to terminal.info without charset UTF-8.


To actually use that terminal defination you need also

doc/term/mlterm.ti from mlterm distribution. Install it

with 'tic' command. Then you need start start mlterm with

'mlterm -y mlterm' option, otherwise mlterm sets $TERM to

xterm.


- Seems that mlterm do not handle return to ISO 2022 code

( ESC % @ ) or switch to UTF-8 code ( ESC % G ) ?

- Also Elm ME+ do not handle double wide UTF-8 characters

- Fixed case where switch to UTF-8 code ( ESC % G )

was given on several times. However after ESC % G

only ESC % @ is valid.

- Now ConfTool/GenCharmap adds mapping from ConfTool/mapfiles


to bin/elm.mimecharsets even when elm.mimecharsets have

already alias defination for charset.

- Added eucJP, eucKR, EUC-CN, GB2312, eucCN and
Big5-HKSCS, Big5HKSCS to ConfTool/CharMap

- Let ConfTool/LocaleMap also to use ConfTool/validcharset

- Changed on lib/precompiled_sets.c:


* Changed "ECMA-cyrillic" type from cs_unknown

to cs_ascii and given mime name KOI8-E

* Added ISO 2022 code for KOI8-E (ISO-IR-111)

* Added ISO 2022 code for IRV (codeset "ISO_646.irv:1983")

(ISO-IR-2)


* Added ISO 2022 code for ISO646-GB (codeset "BS_4730")

(ISO-IR-4)


* Changed codeset "NATS-SEFI" (ISO-IR-8-1) type from

cs_unknown to cs_iso646

* Added ISO 2022 code for codeset "NATS-SEFI" (ISO-IR-8-1)

* Added ISO 2022 code for codeset "NATS-SEFI-ADD"

(ISO-IR-8-2) (XX)


* Added ISO 2022 code for codeset "NATS-DANO"

(ISO-IR-9-1)


* Added ISO 2022 code for codeset "NATS-DANO-ADD"

(ISO-IR-9-2) (XX)


* Added ISO 2022 code for ISO646-FI (codeset

"SEN_850200_B") (ISO-IR-10)


* Added ISO 2022 code for ISO646-SE2 (codeset

"SEN_850200_C") (ISO-IR-11)


* Added ISO 2022 code for codeset "KS_C_5601-1987"

(ISO-IR-149) (XX)


* Changed codeset "KS_C_5601-1987" type from

cs_unknown to cs_iso2022


* Added ISO 2022 code for codeset "JIS_C6220-1969-jp"

(ISO-IR-13) (XX)


* Changed codeset "JIS_C6220-1969-jp" type from

cs_unknown to cs_iso2022
* Added ISO 2022 code for ISO646-IT (codeset "IT")
(ISO-IR-15)


* Added ISO 2022 code for ISO646-PT (codeset "PT")

(ISO-IR-16)


* Added ISO 2022 code for ISO646-ES (codeset "ES")

(ISO-IR-17)


* Added ISO 2022 code for codeset "greek7-old"

(ISO-IR-18)


* Added ISO 2022 code for codeset "latin-greek" (ISO-IR-19)

* Added ISO 2022 code for ISO646-DE (codeset "DIN_66003")

(ISO-IR-21)


* Added ISO 2022 code for ISO646-FR1

(codeset "NF_Z_62-010_(1973)") (ISO-IR-25)


* Added ISO 2022 code for codeset "Latin-greek-1"

(ISO-IR-27)


* Added ISO 2022 code for codeset "ISO_5427" (ISO-IR-37)

* Added ISO 2022 code for codeset "JIS_C6226-1978"

(ISO-IR-42) (XX)


* Changed codeset "JIS_C6226-1978" from type cs_unknown

to cs_iso2022


* Added ISO 2022 code for codeset "BS_viewdata"

(ISO-IR-47)


* Added ISO 2022 code for codeset "INIS"

(ISO-IR-49)


* Added ISO 2022 code for codeset "INIS-8"

(ISO-IR-50)


* Added ISO 2022 code for codeset "INIS-cyrillic"

(ISO-IR-51)


* Added ISO 2022 code for codeset "ISO_5427:1981"

(ISO-IR-54) (XX)


* Added ISO 2022 code for codeset "ISO_5428:1980"

(ISO-IR-55)


* Added ISO 2022 code for codeset "ISO_5428:1980"

(ISO-IR-55)


* Added ISO 2022 code for ISO646-CN (codeset "GB_1988-80")

(ISO-IR-57)


* Added ISO 2022 code for codeset "GB_2312-80"

(ISO-IR-58) (XX)


* Changed codeset "GB_2312-80" type from cs_unknown

to cs_iso2022


* Added ISO 2022 code for ISO646-NO (codeset "NS_4551-1")

(ISO-IR-60)


* Added ISO 2022 code for ISO646-NO2 (codeset "NS_4551-2")

(ISO-IR-61)


* Added ISO 2022 code for ISO646-FR (codeset "NF_Z_62-010")

(ISO-IR-69)


* Added ISO 2022 code for codeset "videotex-suppl"

(ISO-IR-70) (XX)


* Added ISO 2022 code for ISO646-PT2 (codeset "PT2")

(ISO-IR-84)


* Added ISO 2022 code for ISO646-ES2 (codeset "ES2")

(ISO-IR-85)


* Added ISO 2022 code for ISO646-HU (codeset "MSZ_7795.3")

(ISO-IR-86)


* Added ISO 2022 code for codeset "JIS_C6226-1983"

(ISO-IR-87) (XX)


* Changed codeset "JIS_C6226-1983" type from cs_unknown

to cs_iso2022


* Added ISO 2022 code for codeset "ASMO_449"

(ISO-IR-89)

* Added ISO 2022 code for codeset "iso-ir-90" (XX)

* Added ISO 2022 code for codeset "JIS_C6229-1984-a"

(ISO-IR-91)


* Added ISO 2022 code for ISO646-JP-OCR-B

(codeset "JIS_C6229-1984-b") (ISO-IR-92)


* Added ISO 2022 code for "JIS_C6229-1984-b-add"

(ISO-IR-93) (XX)


* Added ISO 2022 code for codeset "JIS_C6229-1984-hand"

(ISO-IR-94)


* Added ISO 2022 code for codeset "JIS_C6229-1984-hand-add"

(ISO-IR-95) (XX)


* Added ISO 2022 code for codeset "JIS_C6229-1984-kana"

(ISO-IR-96)

* Added ISO 2022 code for codeset "ISO_2033-1983"

(ISO-IR-98) (XX)


* Added ISO 2022 code for codeset "ANSI_X3.110-1983"

(ISO-IR-99) (XX)


* Added ISO 2022 code for codeset "T.61-7bit"

(ISO-IR-102)

* Added ISO 2022 code for codeset "T.61-8bit"

(ISO-IR-103)

* Added ISO 2022 code for ISO646-CA

(codeset "CSA_Z243.4-1985-1") (ISO-IR-121)


* Added ISO 2022 code for ISO646-CA2

(codeset "CSA_Z243.4-1985-2") (ISO-IR-122)


* Added ISO 2022 code for codeset

"CSA_Z243.4-1985-gr" (ISO-IR-123) (XX)


* Added ISO 2022 code for codeset

"T.101-G2" (ISO-IR-128) (XX)


* Added ISO 2022 code for codeset

"T.101-G2" (ISO-IR-128) (XX)


* Added ISO 2022 code for codeset "CSN_369103"

(ISO-IR-139)


* Changed codeset "CSN_369103" type fom cs_unknown

to cs_ascii


* Added ISO 2022 code for ISO646-YU

(codeset "JUS_I.B1.002") (ISO-IR-141)


* Added to ISO646 sets that MIME-subset=INVARIANT

* Added ISO 2022 code for codeset "ISO_6937-2-add"

(ISO-IR-141)


* Added ISO 2022 code for codeset "IEC_P27-1"

(ISO-IR-143)


* Changed codeset "IEC_P27-1" type from cs_unknown

to cs_ascii


* Added ISO 2022 code for codeset "JUS_I.B1.003-serb"

(ISO-IR-146)


* Added ISO 2022 code for codeset "JUS_I.B1.003-mac"

(ISO-IR-147)


* Added ISO 2022 code for codeset "greek-ccitt"

(ISO-IR-150)


* Added ISO 2022 code for ISO646-CU

(codeset "NC_NC00-10:81") (ISO-IR-151)

* Added ISO 2022 code for codeset "ISO_6937-2-25"

(ISO-IR-152)


* Changed codeset "ISO_6937-2-25" type from cs_unknown

to cs_ascii


* Added ISO 2022 code for codeset "GOST_19768-74"

(ISO-IR-153)


* Changed codeset "GOST_19768-74" type from cs_unknown to

cs_ascii


* Added ISO 2022 code for codeset "GOST_19768-74"

(ISO-IR-153)


* Added ISO 2022 code for codeset "ISO_8859-supp"

(ISO-IR-154) (XX)


* Changed codeset "ISO_8859-supp" type from cs_unknown

to cs_ascii


* Added ISO 2022 code for codeset "ISO_10367-box"

(ISO-IR-155) (XX)


* Changed codeset "ISO_10367-box" type from cs_unknown

to cs_ascii


* Added ISO 2022 code for codeset "latin-lap"

(ISO-IR-158) (XX)


* Changed codeset "latin-lap" type from cs_unknown

to cs_ascii


* Added ISO 2022 code for codeset "JIS_X0212-1990"

(ISO-IR-159) (XX)


* Changed codeset "JIS_X0212-1990" type from cs_unknown

to cs_iso2022


(XX) Actually it is unclear what that is supposed to mean

on context of
http://www.iana.org/assignments/character-sets

Most of these are not standalone character sets on

that sense what MIME use term 'charset' ....

- Configure now tests if system support wchar_t type
functions.

- Moved code of unknown charset type (cs_unknown)

from lib/cs_binary.c to lib/cs_unknown.c

- File lib/cs_wfallback.c includes 'fallback'

mapping for whar_t, similar than lib/cs_fallback.c

files 'fallback' defination.


- Unknown system (locale) charset is now implemented

with wide characters (wchar_t) on systems which

support it. Also support of wcwidth() function is

tested separately.


- On some cases that may cause warning/error message

"Unknown charsets are unsupported as keyboard input!"

to be printed (specially if there is significant state

used on keyboard input.)


- If __STDC_ISO_10646__ is defined, then wchar_t

is assumed to be Unicode (and 'fallback' mapping

is not needed.)


- Added elmrc option "locale-charsets" for systems

which have __STDC_ISO_10646__ defined. Given

charset names is type unknown used for system (locale)

charset, even when Elm ME+ is builtin defination
for charset.

- Added to terminal.info file new keyword DW.

This indicates for unknown system charset that wcwidth()

function should be used to get char width.

This means that logical width of character

may be 0,1 or 2 columns on that terminal.

- Keyword DW also may cause error/warning message

Double wide characters are not supported

to be printed.


- On systems which have __STDC_ISO_10646__ defined,

DW flag on terminal.info works like "locale-charsets"

option, if charset and terminal matches.

- Added UTF-8 for mlterm to terminal.info with
DW flag.

- pw_dir (home directory) and pw_shell is allowed

to be NULL on struct passwd.

- Added CP1251 as codeset for windows-1251. Seems that this is
returned by nl_langinfo(CODESET).


- Added CP1252 as codeset for windows-1252. Seems that this is

returned by nl_langinfo(CODESET).


- Added CP1255 as codeset for windows-1255. Seems that this is

returned by nl_langinfo(CODESET).


- Added CP1256 as codeset for windows-1256. Seems that this is

returned by nl_langinfo(CODESET).


- Added CP1257 as codeset for windows-1257. Seems that this is

returned by nl_langinfo(CODESET).

- Changed evaluation of elmrc option "text-charset".

- Changed evaluation of elmrc option "display-charset".

- Changed evaluation of elmrc option "local-fs-charset".

- Changed evaluation of elmrc option "default-nomime-charset".

- Changed evaluation of elmrc option

"default-mime-text-charset".


- Changed evaluation of elmrc option "imap-charset".

- Removed function get_charset_map_info().

- Changed implementation of elmrc option "shell".

- Changed implementation of elmrc option "tmpdir".

- Changed implementation of elmrc option "maildir"

(or "folders").

- Changed implementation of elmrc option "map-text-dir".

- Changed implementation of elmrc option "map-bin-dir".

- Fixed case where ISO-2022-JP subject was displayed on


message list, but when reading mail, subject was replaced

with question marks.

- Handle better bad sequense of bytes on text (for

example bad UTF-8 text).

- Configure was incorrectly made conlusion that

nl_langinfo(CODESET)


do not work on IRIX 6.5

- If given folder name 'aaa@bbb@ccc' for split_remote_name(),

do not split is as user='aaa', host='bbb@ccc', but use

user='aaa@bbb', host='ccc'

Problem noted by: admin <ad...@unixdemon.com>

- Remove duplicates from bin/elm.mimecharsets
during Configure


- Compare charset names in case insensitive way on

ConfTool/GenCharmap

- Added command "elmregister rpm-list", which

generates files listing suitable from rpm

%files -section.



- Declared that Elm ME is "Elm Millenium Edition".

Courtesy Vesa-Matti J Kari <vesa-ma...@helsinki.fi>

- get_type_flags() was called with NULL-pointer


argument from start_body_helper() line 381.

Problem noted by: Vesa-Matti J Kari <vesa-ma...@helsinki.fi>

> Return something 'intelligent' (instead of

crashing) in functions of lib/mediatype.c,

if them is called with NULL argument.

- Do not give NULL pointer for
Content-Type: *unknown*/MIXED


In other words do not return NULL pointer

if give_media_type() is asked to create

major media type '*unknown*' ('*unknown*'

matched MIME_TYPE_UNKNOWN signaling unknown
media type.)

- Added module (-M name) option and
correspond environment variable $ELM_MODULE
to elmregister.


- elmregister -M all may be used to register

file or command to all modules.

- Added command "elmregister rpm-list", which

generates files listing per -M option.

- Fixed Makefile error on
make package ROOT=/tmp/test-install
case.

- Sorting orders 'mailbox order' and

'reverse mailbox order' was giving same order.

Fixed reverse sorting order.


- Little change for sorting.

- If "unstable-reverse-thread" is set, reverse thread


sorting is based on lastest message on thread.

Therefore thread moves to new location, when

new message arrives to thread.


- This variable is settable on o)ptions screen

with S)orting criteria command.

- Moved enumerate_list on save_opts to own

elmrc type rc_DT_ENUM and new data

type dt_enumerate_info

- Make possible to record changes of elm.rc

during installation.

- Option -c on elmrc-write and elmlibregister commands

gives file, which is used to record changes

(old values) of elm.rc during installation.


- During installation old values of failed elm.rc options

are kept on elm.rc.old-values file.

- Use malloc_gets() when reading elm.rc

- Added elmrc option "verify-domain". If set mail domains


are verified by gethostbyname(). Error HOST_NOT_FOUND

is treated as nonexisting domain and error NO_ADDRESS

is treated as valid mail domain.

- Added elmrc option "verify-local-address". If set


usernames of local addresses are verified. Using

this option requires that on global elm.rc have
"verify=yes" on mailer -option.

- Replaced elmrc types DT_ASR and DT_SRT with one type
rc_DT_SORT.

- Added elmrc option "local-dir-sortby". This specifies

sorting order for local files and folders on folder

and file browser. Possible values are "none", "name"

and "mtime" (and also "reverse-name" and "reverse-mtime").

Default value is "name".

- Added elmrc option "imap-dir-sortby". This specfies


sorting order for IMAP folders on folder browser. Possible

values are "none" and "name" (also "reverse-name").

Default value is "none".

- On 21 lines window browser help (Folder selection)


was not fitting to screen.

- Moved mailer related code from libelmme-base.so to
libelmme-mailer.so.
- Added elmrc type rc_DT_DELAY.


- Moved elmrc option "mailer" to libelmme-mailer.so.

It is 'proxied' with elmrc type rc_DT_DELAY.

- Added elmrc option "use-mailer-library" to

libelmme-mailer.so. It is 'proxied' with elmrc type

rc_DT_DELAY. "smtp" (ie. libelmme-smtp.so) is

now given on elmrc option "use-mailer-library"

(was on "use-connect-library".)


- Link libelmme-smtp.so with libelmme-mailer.so,

so that loading of libelmme-smtp.so succeed when
loader is not linked with libelmme-mailer.so.

- If elm is not compiled with -rdynamic, link

libelmme-smtp.so with libelmme-base.so, so that symbols

can be resolved.

and tried to compile it on a SuSE 9.2 box. Configure

complained about missing termlibs and quit without even

generating a makefile.

Adding -lncurses in line 6333 of Configure (it now reads

for A in '' '-ltermlib' '-lcurses' '-ltermcap ' '-lncurses'; do

fixed this and elmme seems to work fine. Maybe you'd

like to include this patch in the next release ..."
From: Rainer Kaluscha <rainer....@web.de>



- Code changes for "-Wstrict-prototypes". I hope that these

do not broke something else.

- Added some support for RFC 2231:

MIME Parameter Value and Encoded Word Extensions:

Character Sets, Languages, and Continuations

- struct string may now carry language indicator

- Language specification is now accepted on encoded

words.


- When replying language specification is normally preserved

on replied address (phrase).


- [include -command now uses internally file browser

for refering file. This should handle better (theoretical)

situation where buffer charset is ddeferent than filesystem

charset.


- filename -arguments on mime -parameters use RFC 2231

encoding. Also non RFC 2231 ascii-only filename

argument is produced.


- Specially RFC 2231 encoded parameters are ignored

for most of other cases. Specially boundary -parameter

must not be RFC 2231 encoded.

- Added elmrc option "mime-parameters". Possible values are

"plain", "encoded" and "plain-and-encoded". If set

to "plain", then RFC 2231 encoded parameters are not

generated and not used when receiving mail (they still are

parsed.) When set to "plain-and-encoded both RFC 2231

encoded value and plain ascii value are generated (specially

for filename -parameter) when needed.

- Elm option -z (zero) do not longer imply option -n
(do not use ti/te).

- " would like to have an option like:

-z Zero - don't enter Elm if no mail is pending.

but:
-y Zero - don't enter Elm if no unread mail is
pending."


Suggested by: Axel Reinhold <ax...@freakout.de>

- Elm option -z now works correctly when several mailboxes


(several -f options) are given. Now Elm is not entered

when all given mailboxes are empty.

- doc/tmac.n states "This package may be circulated freely

with the news documentation; it may not be sold, but is to

be distributed with the unformatted news documents."

Removed, because Elm documentation is other documentation.

- Removed documentatiion which depends doc/tmac.n. That

documentation is more or less obsolete anyway:

doc/Alias.guide
doc/Config.guid
doc/Elm.cover
doc/Form.guide
doc/Ref.guide
doc/Users.guide


- Removed question about formatter of documentation

from Configure.

- f)orget command on "Mail Pre-Send Screen" incorrectly

sent mail when editor buffer was empty and on mail

there was on attachment.

- Both utils/elmrc-write.c and utils/elmlibregister.c

include routine for writing (user or system) elmrc.

Moved that to new file lib/write_rc.c.

- Changed src/save_opts.c to use lib/write_rc.c. This

means that elmrc option are saved on elmrc-info

older also when saved from Elm.

- Removed offset from struct rc_save_info_rec. It is

no longer needed.

- Changed default so that term.h is only included on

Linux (and not curses.h)



- "unicode_value (uint16) can not possibly exceed 0xFFFF.

Remove the statement, that triggers a compiler warning."

From: From: Mikhail T. <m...@aldan.algebra.com>

* Patch removes ...->unicode_value > 0xFFFF -test

from cs_add_state_to_iconv() on shared_libs/iconv/iconv.c.

- utils/answer.c included some bogus aliases reading routines.

Replaced it fetch_alias(). It still is broken, but

that is little better...


Problem noted by: From: Mikhail T. <m...@aldan.algebra.com>

New elmrc options:
mime-parameters
imap-dir-sortby
local-dir-sortby
locale-charsets
pgp-encrypt-type
prompt-metamail
unstable-reverse-thread
verify-domain
verify-local-address
use-mailer-library

New elm command line option:

-y Don't enter Elm if no unread mail
is pending.

New elm command:
F)lag

New files:
src/screen/subpage.c
src/screen/wrapper.c
src/screen/menu_param.c
src/screen/def_scommon.h
src/screen/scommon.c
src/screen/header.c
lib/cs_unknown.c
lib/cs_wfallback.c
charset/MAPPINGS/koi8-e.txt
lib/mailer/Makefile.SH
hdrs/mailerlib.h
lib/mailer/def_mailer.h
lib/mailer/outheaders.c
lib/mailer/shared_mailer.c
lib/mailer/init.c
lib/rc_delay.c
melib/mime_param.c
lib/write_rc.c

Moved files:
lib/mailer.c => lib/mailer/mailer.c

Removed files:
lib/add_site.c
lib/strtokq.c
doc/tmac.n
doc/Alias.guide
doc/Config.guid
doc/Elm.cover
doc/Form.guide
doc/Ref.guide
doc/Users.guide


Warnings
--------

- Not compiled with MMDF support defined, so probably it doesn't
work (or even compile).

- This has not been tested much so there can be bad bugs.
Bug reports to: Kari E. Hurtta <hurtt...@posti.FMI.FI>

- Support for multipart/signed and multipart/encrypted (specially:
support for PGP/MIME) only in reading side. There is no support
for attachments with multipart/encrypted.

> But anyway, Elm will never be MIME Conformant

- HP's shoftkeys are no longer supported

- DECNET addresses like host::user may be interpreted as phrase
of group syntax or as route of source routed address.

- Header editing screen now uses addresses in form phrase <address>,
but because it does not require using of comma (,), multiword
phrases must be entered in quotes.

For example: "Kari Hurtta" <hurtta>

- If address includes <> or comments (), they are not aliased
expanded. So aliases must be entered as bare words.

- Addresses given as arguments to elm command should be given
as one address as arguments. Giving of sevaral addresses as
one arguments causes that address is misparsed if header is
edited on header editing screen.

That is:

Use: elm '"Kari Hurtta" <hurtta>' 'Admin <root>'

Don't use: elm 'Kari Hurtta <hurtta>, Admin <root>'

- readmsg does not use mailbox (lib/mbox.c) routines!
- p)rint command on article menu is still broken
(but you perhaps may use P)rint text command)
- Elm tools (on utils/*) do not use mime routines (melib).

- Some Linux libraries does not follow $LC_CTYPE when program is
setgid. Net result is that your locale is always C. That is
visible that $LC_CTYPE does not effect to locale printed by
'elm -vvvvv':

Locale (LC_CTYPE): C
Display character-set: US-ASCII
Sending character-set: US-ASCII

- Conversion from Display character-set to Sending character-set
is not possible it should be refused (but if it is not detected
result of conversion will be practically empty.)

- All refrences iso2022 maps are parsed and read to memory.
This may cause quite big memory consumption specially because
eastern (multibyte) sets tend to be lot of characters. That
mapping information should be shared between processes to
reduce memory consuption.

- If display charset is produced by using mapping from locale
to charset where charset definition is later invalidated
("removed") by setting explicit compatcharsets on user's
.elm/elmrc, that may cause PANIC on elm's internal pager
or other problems. Invalidation happens if display charset
is on implicit compatcharsets list (because of charset
definition), but does not have explicit compatcharsets list
given by user.

- Neither Unicode didirectional algorithm nor Right-Left scripts
are supported.

- In some situations two Status headers may be generated two
Status headers -- one by IMAP deamon and one from APPENDed
message.

- When APPENDing message to IMAP folder (which is normal UNIX
mailbox format) original "From " separator line can not be
preserved -- specially it is not possible to pass envelope
sender address.

- For UTF-8 charset Elm only knows printable characters from
Latin/1 range, if unicode database (see elmrc option "unidata")
is not loaded.

- For using of ISO2022 character sets it is required that mapping
them to unicode is know -- otherwise Elm ME+ does not know which
characters are printable.

- UTF-16 surrogate pairs (D800-DFFF) are not supported on UTF-7
charset.

- Mixing of names using IMAP naming convention
(imap-naming-convention = yes)
and names using imap-charset does not work very well...

- Some Linux gethostbyname implementations accept ip-address as
name, but return garbage on h_name -field of struct hostent.

- " Regarding my message (8 Aug 2000) regarding 'newmail' on
AIX 4.3.3 in an 'aixterm' window and the 'aixterm' did not
close, indeed the problem was NOT related to 'newmail' but an
AIX bug.

IBM has release a patch, and the 'aixterm' in AIX 4.3.3 must
be update with fileset X11.apps.aixterm.4.3.3.26 (PTF
U473920) is solved to problem."
From: Noam G. Nudelman <no...@mail.biu.ac.il>

- File /usr/share/locale/fi/charset gives charset name utf-8 on
Linux Mandrake 7.2. This causes that Configure generates
mapping
fi utf-8
to elm.mimecharsets. However that seems to have
incorrect mapping. You may want change this to
fi ISO-8859-1

( however nl_langinfo(CODESET) gives charset ISO-8859-15
but look following entry. )

- Locale 'fi' seems to have charset ISO-8859-15 according
of nl_langinfo(CODESET) on Mandrake Linux 7.2 (and probaly
others with same glibc version). However for example gnome
terminal uses font
-misc-fixed-medium-r-normal--12-200-75-75-c-100-iso8859-1
and not
-misc-fixed-medium-r-normal--12-200-75-75-c-100-iso8859-15

Also KDE's konsole program seems use iso8859-1 character set
although locale is 'fi' which should have ISO-8859-15 according
of nl_langinfo (selecting "unicode" from menu seems fix that.)

Because of mismatch more correct locale is fi_FI.88591, which gives
ISO-8859-1 character set according of nl_langinfo(CODESET).

( Locale seems come from /etc/sysconfig/i18n or $HOME/.i18n )

> To enable handling of ISO-8859-1 and ISO-8859-15 character sets
on linux console, read comments from doc/terminal.info file.

- Mandrake Linux 7.2 seems set LD_PRELOAD to load
/usr/lib/libxalflaunch.so.0. That (xalf-0.4-2mdk) causes that
elm to crash on startup (actually before main() is reached.)

- fastmail is broken

- kterm on Mandrake Linux 7.2 seems have (at least on my test
environment) seems get bad fontlist (*VT100*fontList) which
gives bad font for iso8859-1 -- therefore ISO-8859-1 characters
do not work.

("xrdb -query" seems report resource with name "*fontList"
-- that probably overrides "*VT100*fontList" which comes
from /usr/lib/X11/app-defaults/KTerm )

- Also note that initially kterm does NOT default to
ISO-8859-1 -- therefore ISO-8859-1 works only when
elm explicity switch to ISO-8859-1 (for example
with 'elm -D ISO-8859-1')

- When assembling message/partial MIME (RFC 2046)
requires that all headers except Content-*, Subject,
MIME-Version, Message-ID and Encrypted are copied from
initial enclosing message to assembled message. It also
requires that headers except Content-*, Subject,
MIME-Version, Message-ID and Encrypted are ignored and
dropped from enclosed message.

For now we copy only Received: -headers. Dropping extra
headers from enclosed message makes assembly more
complicated (and dropping of Received: -headers
from enclosed message do not make sense.)

- Running '//' Match pattern (in entire message): on
one big mailbox seems cause segementation violation
on malloc(). Seems memory corruption to me. However
running same search on same mailbox undef of valgrind
do not report error. Valgrind do not report that there is
illegal free() somewhere occured.

Collector of these patches
--------------------------

Kari E. Hurtta <elm @ elmme-mailer.org>


Kari E. Hurtta

unread,
Jul 13, 2005, 5:41:50 PM7/13/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122.2

Before applying patch catenate parts 1 - 18 first.

This patch is agaist Elm 2.4ME+ PL121 (25) part 2/18
=========================================================================
-
- .lp confirmfolders 1.0i
- Set ON to make Elm ask before creating new mail folders in your
- mail directory (see the \f3maildir\f1 variable under \f3String
- Variables\f1 in section 2), otherwise it silently creates new mail folders
- whenever a copy of a message is going to be stored in a folder that
- does not already exist. See the \f3copy\f1, \f3savename\f1, and
- \f3forcename\f1 variables below for additional information about
- copying messages. The default for \f3confirmfolders\f1 is OFF.
-
- .lp copy+ 1.0i
- Set ON to have silent copies made of all outgoing mail. Where the copy
- of the message is saved is determined by the \f3maildir\f1 and
- \f3sentmail\f1 string variables and the \f3savename\f1 and
- \f3forcename\f1 boolean variables. Whether a copy is saved and to
- which folder can also be set prior to sending a message \(em see the
- \f3copy\f1 command of the mail command sub-menu in section 7,
- \f3Commands\f1, for details. The default for \f3copy\f1 is OFF.
-
- .lp forcename 1.0i
- Set ON to force creation of folders for copies of outbound mail by the
- recipient name. For complete details of how to enable automatic
- copying of outbound messages, see the \f3copy\f1 and \f3savename\f1
- boolean variables. The default is OFF.
-
- .lp forms 1.0i
- Set ON to enable the generation of \*Qforms\*U type messages. See the
- \f2Elm Forms Mode Guide\f1 for further information about mail forms.
-
- .lp keepempty 1.0i
- The mail system has a habit of deleting folders when you've removed
- everything from them. Set ON to preserve empty folders as zero-length
- files. Note that this option does not apply to your incoming mailbox.


- The default is OFF.
-

- .lp keypad 1.0i
- Set ON to indicate that you have an HP terminal and want the
- \f2<NEXT>\f1, \f2<PREV>\f1, \f2<HOME>\f1 and \f2<SHIFT-HOME>\f1 keys enabled.


- The default is OFF.
-

- .lp menu* 1.0i
- Set OFF to inhibit the menu display on all screen displays within
- Elm. Note that this is overridden by the \*Q\-m\*U command line
- option (see section 3, \f3Command Line Options\f1). The default is
- ON.
-
- .lp metoo 1.0i
- Set ON to get a copy of mail you send to a mailing list you are on,
- otherwise you do not get a copy of such messages. The default is OFF.
-
- .lp movepage 1.0i
- Set ON to enable commands that move through the folder by pages (see
- the \*q+\*u, \*q\-\*u, \f2<right>\f1, and \f2<left>\f1 keys in section
- 7, \f3Commands\f1) to move the current message pointer to the top of
- that page of messages. Set OFF to not alter the current message
- pointer location when moving through pages. The default is OFF.
-
- .lp names* 1.0i
- Set OFF to display the primary recipients' addresses on your screen
- with their full names when you send a message. Set ON to display only
- the full names. The default is ON.
-
- .lp noheader 1.0i
- Set ON to not include the headers of messages when copying a message
- into the edit buffer for replying or forwarding (see the \f3autocopy\f1
- variable above). The default is ON.
-
- .lp pointnew 1.0i
- Set ON to cause the current message pointer to point to the first new
- message in your incoming mailbox when started, instead of at message #1
- of the index. This has no effect for other folders since they are not
- expected to have \*Qnew\*U mail. The default is ON.
-
- .lp promptafter+ 1.0i
- Set ON to display a command prompt rather than the index screen when
- exiting from an external pager. This variable has no effect on the
- builtin pager. See the \f3pager\f1 variable under \f3String Variables\f1
- in section 2 to specify which pager to use to read messages.
-
- If your external pager immediately exits when it reaches the end of the
- message, you should set \f3promptafter\f1 ON so that the last screen of
- the displayed message is not immediately replaced by the index screen.
- If your external pager doesn't exit until you command it to, you have a
- choice. If you usually want to see the index screen before issuing a
- command, setting this variable OFF eliminates the extra keystroke
- needed to return to the index screen. If you usually don't need to see
- the index screen before issuing the next command, setting it ON allows
- you to enter your next command without waiting for the index screen to
- be redrawn. The default is ON.
-
- .lp resolve 1.0i
- Set ON to move the current message pointer to the next message on the
- index when a mail message is \*Qdealt with\*U through deleting,
- undeleting, saving, forwarding, etc. or set OFF to leave the current
- message pointer unchanged. The default is ON.
-
- .lp savename 1.0i
- One of the problems with electronic mail systems is that one tends to
- get very large, one-dimensional (flat) files that contain lots of
- completely unrelated mail. Elm can use a more intelligent
- algorithm: for incoming mail, when you \f3save\f1 or \f3copy\f1 it
- (see section 7, \f3Commands\f1), the default folder is the login name
- of the person who sent you the message (changed by pressing anything
- other than \f2<return>\f1 of course). Similarly, when sending mail,
- instead of just blindly saving it to the \f3sentmail\f1 folder,
- Elm can save it to a folder that is the login name of the
- recipient of the mail.\s-2\u2\d\s0
- .fn
- 2. When sending to a group, it's saved to the login name of the first
- person in the list only.
- .ef
- Set \f3savename\f1 ON to enable this algorithm.
-
- If \f3forcename\f1 is OFF (see above), the copy is saved to that folder
- only if the folder already exists. In practice, this means that
- important people that you communicate with (those that you tend to save
- mail from) have folders that are actually \f2a recorded log of the
- discussion in both directions\f1 and others (random mailings) are all
- stuffed in the \f3sentmail\f1 folder for easy perusal and removal (see
- the \f3sentmail\f1 variable under \f3String Variables\f1 in section
- 2). If you always want to save copies of outgoing messages in separate
- folders by recipient login name, you'll want to set \f3forcename\f1
- ON.
-
- The default for \f3savename\f1 is ON.
-
- .lp sigdashes+ 1.0i
- Set ON to tell Elm that you wish to follow the
- convention of prefixing your signature with \*Q\f2newline dash dash
- blank newline\f1\*U. This is placed in your message before your
- signature file (see the \f3signature\f1, \f3localsignature\f1, and
- \f3remotesignature\f1 variables under \f3String Variables\f1 in section 2).
- If OFF, the signature file, if any, is placed at
- the end of the message without any prefix. The default is ON.
-
- .lp softkeys 1.0i
- Set ON to tell Elm that you have an HP terminal with the
- HP 2622 function key protocol and that you'd like to have the function
- keys available while in the program. The default is OFF.
-
- .lp titles 1.0i
- Set ON to have the first line of a message titled with:


- .sp
- .ft CW
- .zf

- .ps 9
- .nf
- .tl ' Message \f2N/M\fP from \f2username\fP''\f2date\fP at \f2time\f1 '
- .fi
- .ps 10


- .ft 1
- .sp

- where all the information is extracted from the message.
- This is especially useful if you weed out all the headers of each
- message with a large \f3weedout\f1 list (see the \f3weedout\f1 variable
- under \f3String Variables\f1 in section 2).
- The default is ON.
-
- .lp usetite 1.0i
- Set ON to enable use of the \f2termcap/terminfo\f1
- \f3ti/te\f1 capabilities.
- Many terminal emulators require it (not the least of which is the
- OpenLook \f2cmdtool\f1).
- Some terminal emulators clear the screen on \f3te\f1 (some \f2xterm\f1s).
- Set OFF to disable use of \f3ti/te\f1.
- Note that this is overridden by the \*Q\-t\*U command line option
- (see section 3, \f3Command Line Options\f1). The default is ON.
-
- .lp weed 1.0i
- Set ON to have Elm \*Qweed out\*U certain headers from displayed
- messages, that is, not display them. The \f3weedout\f1 variable under
- \f3String Variables\f1 in section 2 allows you to custom define the set of
- headers you would like to not have displayed while reading messages.
- The default for the \f3weed\f1 variable is ON.
- .in 0
- .sp
- .sp
- For a better idea of how this all works, here's a sample \f2.elm/elmrc\f1
- file. While looking through it, notice that you can have lots of
- comments and blank lines for readability and that you can also use
- \*Qshell variables\*U and the \*q~\*u (tilde) metacharacter for your home
- directory, and they are expanded accordingly when read in by the
- mailer. Note that this was automatically saved by the Elm
- program on the fly from the options screen.


- .sp
- .ft CW

- .zf
- .nf
- #
- # .elm/elmrc \- options file for the ELM mail system
- #
- # Saved automatically by ELM 2.4 for Elm Development Group
- #
-
- # For yes/no settings with ?, ON means yes, OFF means no
-
- # where to save calendar entries
- calendar = ~/.Agenda
-
- # what editor to use ("none" means simulate Berkeley Mail)
- # \'%s\' can be used as the temporary filename for the outgoing message
- editor = none
-
- # the character to use in the builtin editor for entering commands
- escape = ~
-
- # the full user name for outbound mail
- fullname = Elm Development Group
-
- # where to save received messages to, default file is "=received"
- receivedmail = $HOME/Mail/received
-
- # where to save my mail to, default directory is "Mail"
- maildir = /users/elmdev/Mail
-
- #directory to hold my temporary files to avoid NFS cross mount problems
- tmpdir = /users/elmdev/Mail/tmp
-
- # program to use for displaying messages (\'builtin\' is recommended)
- pager = builtin
-
- # prefix sequence for indenting included message text in outgoing messages...
- prefix = >_
-
- # how to print a message (\'%s\' is the filename)
- print = lpr \-Plw2 %s
-
- # attribution string for replies (\'%s\' is the author of original message)


- attribution = According to %s:
-

- # where to save copies of outgoing mail to, default file is "=sent"
- sentmail = /users/elmdev/Mail/mail.sent
-
- # the shell to use for shell escapes
- shell = /bin/csh
-
- # local ".signature" file to append to appropriate messages...
- localsignature = localsig
-
- # remote ".signature" file to append to appropriate messages...
- remotesignature = remotesig
-
- # do we want dashes above signatures? (News 2.11 compatibility and convention)
- sigdashes = ON
-
- # how to sort folders, "Reverse Sent" by default
- sortby = Reverse\-Received
-
- # should the default be to delete messages we\'ve marked for deletion?
- alwaysdelete = ON
-
- # should the default be to store read messages to the "received" folder?
- alwaysstore = ON
-
- # should the default be to keep unread messages in the incoming mailbox?
- alwayskeep = ON
-
- # should we use the "\->" rather than the inverse video bar?
- arrow = OFF
-
- # should the message disposition questions be displayed (ON) or
- # auto\-answered (OFF) with the default answers when we resync or change folders?
- ask = ON
-
- # would you like to be asked for Carbon\-Copies information each msg?
- askcc = ON
-
- # automatically copy message being replied to into buffer?
- autocopy = OFF
-
- # threshold for bouncing copies of remote uucp messages...
- # zero = disable function.
- bounceback = 0
-
- # save a copy of all outbound messages?
- copy = ON
-
- # do we want to be able to mail out AT&T Mail Forms?
- forms = OFF
-
- # should we keep folders from which all messages are deleted?
- keepempty = OFF
-
- # we\'re running on an HP terminal and want HOME, PREV, NEXT, etc...
- keypad = OFF
-
- # should we display the three\-line \'mini\' menu?
- menu = ON
-
- # would you like a copy of a message you send to an alias you are on?
- metoo = OFF
-
- # when using the page commands (+ \- <NEXT> <PREV>) change the current
- # message pointer...?
- movepage = ON
-
- # just show the names when expanding aliases?
- names = ON
-
- # when messages are copied into the outbound buffer, don\'t include headers?
- noheader = ON
-
- # start up by pointing to the first new message received, if possible?
- pointnew = ON
-
- # prompt for a command after the external pager exits?
- promptafter = ON
-
- # emulate the mailx message increment mode (only increment after something
- # has been \'done\' to a message, either saved or deleted, as opposed to
- # simply each time something is touched)?
- resolve = ON
-
- # save messages, incoming and outbound, by login name of sender/recipient?
- savename = ON
-
- # save outbound messages by login name of sender/recipient even if the
- # associated folder doesn\'t already exist?
- forcename = OFF
-
- # are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
- # (this implies "keypad=ON" too)
- softkeys = OFF
-
- # set the main prompt timeout for resynching...
- timeout = 60
-
- # display message title when displaying pages of message?
- titles = ON
-
- # are we good at it? 0=beginner, 1=intermediate, 2+ = expert!
- userlevel = 2
-
- # enable the weedout list to be read?
- weed = ON
-
- # what headers I DON\'T want to see, ever.
- weedout = "Path:" "Via:" "Sent:" "Date" "Status:" "Original" "Phase"
- "Subject:" "Fruit" "Sun" "Lat" "Buzzword" "Return" "Posted"
- "Telephone" "Postal\-Address" "Origin" "X\-Sent\-By\-Nmail\-V" "Resent"
- "X\-Location" "Source" "Mood" "Neuron" "Libido" "To:" "X\-Mailer:"
- "Full\-Name:" "X\-HPMAIL" "Cc:" "cc:" "Mmdf" "Network\-" "Really\-"
- "Sender:" "Post" "Message\-" "Relay\-" "Article\-" "Lines:"
- "Approved:" "Xref:" "Organization:" "*end\-of\-user\-headers*"
-
- # alternative addresses that I could receive mail from (usually a
- # forwarding mailbox) and don\'t want to have listed...
- alternatives = dsidev!elmdev dsirel!elmdev elmdev@dsidev elmdev%dsidev
-
- # list of delivery precedences allowed, or empty to allow anything
- # precedence may be followed by optional ":priority" specification
- precedences = special\-delivery:urgent air\-mail:urgent first\-class bulk junk
-
- # name of Character Set used with MIME text/plain Content\-type
- # US\-ASCII is default. Be aware that if you use a national charset
- # elm probably needs metamail to display US\-ASCII. Elm tries to
- # know if that charset could display US\-ASCII too, but the list
- # of us\-ascii compatible charsets is not yet complete
- charset=US\-ASCII
-
- # name of Character Set which the display supports. This is independent
- # of the above "charset".
- displaycharset=US\-ASCII
-
- # list of Character Sets, which are more or less a superset of US\-ASCII
- # so we know that we can display messages with charset=US\-ASCII without
- # help of metamail
- compatcharsets = ISO\-8859\-1 ISO\-8859\-2 ISO\-8859\-3 ISO\-8859\-4 ISO\-8859\-5 ISO\-8859\-6 ISO\-8859\-7 ISO\-8859\-8 ISO\-8859\-9
-
- # would you like to use termcap/terminfo ti/te entries?
- usetite = ON
-
- # Value by which message count is incremented while reading a new mailbox.
- # Setting this value to a number larger than one will speed up the time it
- # takes to read a large mailbox when using a slow terminal.
- readmsginc = 5
-
- # time in seconds which Elm will wait after displaying a transient message
- # and before erasing it. Can be 0 or positive integer.
- sleepmsg = 2
- .fi


- .br
- .ne 5

- .sp 2
- .hn 1 Command Line Options
-
- There are a number of command line options to the Elm
- program, with only one that needs to be remembered: \*Q\-?\*Uor \*Q\-h\*U
- for help.
-
- The options are:
-
- .lp \h'24p'\-a 66p
- This allows you to have the \*Q\->\*U arrow pointer
- rather than the inverse bar. This can also be set in
- the \f2.elm/elmrc\f1
- file with the boolean variable \f3arrow\f1.
-
- .lp \h'24p'\-c 66p
- Check only. This is useful for expanding aliases
- without sending any mail. The invocation is similar to
- invoking Elm in send-only mode:


- .sp
- .ft CW
- .zf

- .ti 1.5i
- elm \-c\f2 list-of-aliases\f1
-
- .lp "\h'24p'\-d \f2n\f1" 66p
- Set debug level to \f2n\f1. Useful for debugging the Elm
- program, this option will create a file in your home
- directory called \f2ELM:debug.info\f1 containing
- a running log of what is going on with
- the program. Level \f2n\f1 can be 1 through 11,
- where the higher numbers generate more output.
- This option might be disabled by the the person who configured
- Elm for your system.
-
- .lp "\h'24p'\-f \f2folder\f1" 66p
- Read the specified folder rather than the default incoming mailbox.
- Note that you can use the same metacharacters (e.g. \*q=\*u) as when
- you \f2change folders\f1 from within the program. You can also use the
- same abbreviatory symbols (\*q!\*u, \*q>\*u and \*q<\*u),
- but remember to \*Qsingle quote\*U them
- in case they have special meaning in the shell you use.
-
- .lp "\h'24p'\-h or \-?" 66p
- Help message. Gives a short list of all these options and exits.
-
- .lp "\h'24p'\-i \f2file\f1" 66p
- Include a prepared file in the edit buffer before sending.
- This facilitates using Elm with other programs
- that interface with mail (like news readers, for example). There
- is an example of how to set up the \f2rn\f1 news reading program to
- use Elm in \f2The Elm Users Guide\f1. The file specified is
- copied into the temporary file just before the signature file.
-
- .lp \h'24p'\-k 66p
- Keypad enable. This option lets the Elm program
- know that you're on an HP terminal, and it can then interpret
- the <PREV>, <NEXT> and <HOME>/<SHIFT>-<HOME> keys accordingly. If you
- are not on an HP terminal, it is recommended that you do
- NOT use this option. See also the \f3keypad\f1 variable,
- described under \f3Boolean Variables\f1 in section 2.
-
- .lp \h'24p'\-K 66p
- Keypad + softkeys enable. The Elm mailer can
- use the HP softkeys as an alternative form of
- input. If you specify this option be sure that you're on
- an HP terminal that can accept the standard 2622 terminal
- escape sequences! See also the \f3softkeys\f1 variable,
- described under \f3Boolean Variables\f1 in section 2.
-
- .lp \h'24p'\-m 66p
- Inhibit display of the 3-line menu when using the mailer. This,
- of course, gives you three more message headers per page instead.
- See also the \f3menu\f1 variable, described under \f3Boolean
- Variables\f1 in section 2.
-
- .lp "\h'24p'\-s \f2subject\f1" 66p
- In send-only and batch mode, this is how to indicate the subject of the
- resulting message. Please see the section on \f3Non-Interactive
- Uses of Elm\f1 in \f2The Elm Users Guide\f1 for more information.
-
- .lp \h'24p'\-t 66p
- Disable use of the \f2termcap/terminfo\f1 \f3ti/te\f1 capabilities.
- Many terminal emulators require it (not the least of which is the
- OpenLook \f2cmdtool\f1).
- Some terminal emulators clear the screen on \f3te\f1 (some \f2xterm\f1s).
- See also the \f3usetite\f1 variable, described under \f3Boolean
- Variables\f1 in section 2.
-
- .lp \h'24p'\-z 66p
- This causes Elm not to start if you don't
- have any mail, but instead to display the message \*QYou have no
- mail.\*U This emulates the behavior of programs
- like \f2Berkeley Mail\f1.
-
- .in 0
- All the above options default to reasonable values, so there is
- usually no need to use them. Furthermore, the most used options
- are available through the \f2.elm/elmrc\f1 file, described in section 2.


- .br
- .ne 5

- .sp
- .hn 1 Multi-Media Capabilities of Elm
-
- Elm optionally provides you with some Multi-Media features, which
- are compliant
- to the MIME (Multipurpose Internet Mail Extension) IETF draft.
-
- If the support is compiled into Elm, on the receiving side
- Elm accesses Metamail from Nathaniel Borenstein of
- Bellcore. If you receive a MIME compliant message, Elm calls
- Metamail automatically to display the message. Metamail
- asks you if you want to display each part of the message
- and uses the display programs available at your site. This
- is controlled through the \f2mailcap\f1 file.
-
- On the sending side, there is a simple mechanism integrated in Elm
- to compose MIME compliant messages. If you have one or more key lines
- of the form


-
- .ft CW
- .zf
- .ti .5i

- [\&include \f2file contenttype/subtype encoding\f1]
- .ft 1
-
- in the message body, at each
- of these key lines, a file is included, and becomes a part
- of the message. The text lines before, between and after the \f2include\f1
- lines go into extra message parts of type \f2text\f1.
-
- As an example, say you want to include the file \f2foo.gif\f1 into your message,
- which is a GIF image, and you want to use \f2base64\f1 encoding, use the
- following line:


-
- .ft CW
- .zf

- .ti .5i
- [\&include foo.gif image/gif base64]
- .ft 1
-
- Or you want to include a text file which contains plain ASCII:


-
- .ft CW
- .zf
- .ti .5i

- [\&include foo.txt text/plain]
- .ft 1
-
- The \f2encoding\f1 parameter is optional and the default is \f27bit\f1.
-
- Refer to RFC1341 for valid \f2contenttype/subtype\f1 and \f2encoding\f1
- parameter values.


- .br
- .ne 5

- .sp
- .hn 1 Special Outgoing Mail Processing
-
- There are a few extra features that Elm offers on
- outgoing mail that are worthy of mention.
-
- The first, and probably the most exciting feature,\s-2\u3\d\s0 is the
- .fn
- 3. Unfortunately, at many non-US sites, it's quite probable that
- you won't be able to use this feature since you won't have
- the \f2crypt()\f1 library available due to licensing restrictions.
- .ef
- ability to send \f2encrypted\f1 mail! To do this is
- extremely simple: you need merely to have two key lines


-
- .ft CW
- .zf
- .ti .5i

- [\&encode]
- .ft 1
- .br
- and


- .ft CW
- .zf

- .ti .5i
- [\&clear]
- .ft 1
-
- in the message body.
-
- .ne 15
- Consider the following outgoing message:
- .sp
- .nf
- .ps 9
- .in .5i
- .ft CW
- .zf
- Joe,
- Remember that talk we had about Amy? Well, I talked to my manager
- about it and he said...
- uhh...better encrypt this...the usual \`key\'...
- [\&encode]
- He said that Amy was having family problems and that it had been
- affecting her work.
- Given this, I went and talked to her, and told her I was sorry for
- getting angry. She said that she understood.
- We\'re friends again!!
- [\&clear]
- Exciting stuff, eh?
- \h'3i'Mike
- .ps 10


- .ft 1
- .in 0
- .fi

- .sp
- While this is obviously quite readable while being typed into
- the editor, as soon as the message is confirmed as wanting
- to be sent, the Elm mailer prompts with:


- .sp
- .nf
- .ft CW
- .zf

- .ps 9
- .ti .5i
- Enter encryption key: @
- .ps 10


- .ft 1
- .fi
- .sp

- and accepts a key (a series of 8 or less characters) without
- echoing them to the screen. After entry, it will ask for the
- same key again to confirm it, then *\f2poof\f1* it will encrypt and
- send the mail.
-
- If you have the \f3copy\f1 option enabled, the program will save
- your copy of the message encrypted too. (This is to ensure
- the privacy and security of your mail archive, too.)
-
- If the mailer doesn't ask for the encryption key, it's because
- you don't have the \f2[\&encode]\f1 entered as the first 8 characters
- of the line. It MUST be so for this to work!!
-
- On the other end, a person receiving this mail (they must also
- be using Elm to receive it, since this mailer has a
- unique encryption program) will be reading the
- message and then suddenly be prompted:


- .sp
- .nf
- .ft CW
- .zf

- .ps 9
- .ti .5i
- Enter decryption key: @
- .ft 1
- .ps 10
- .fi
- .sp
- and will again be asked to re-enter it to confirm.
- The program will then on-the-fly decrypt the mail
- and display each line as it is decoded. The \f2[\&clear]\f1
- line signifies that the block to encrypt is done.
-
- Note that it is not possible currently to \f3pipe\f1 or \f3print\f1
- encrypted mail.
- .sp 2
- The other feature on outgoing mail is the ability to
- specify what section of the message you want to have
- archived (assuming \f3copy\f1 is enabled) and what section
- you don't. This is most useful for sending out source
- file listings and so on.
-
- To indicate the end of the section that should be
- saved in the archive, you need merely to have the key line


- .sp
- .nf
- .ft CW
- .zf

- .ti .5i
- [\&nosave]
- .ft 1
- or


- .ft CW
- .zf
- .ti .5i

- [\&no save]


- .ft 1
- .fi
- .sp

- appear by itself on a line. This key line is removed from
- the outgoing mail, and indicates the last line of
- the message to be saved.
- Other than this, the saved mail is identical to the outgoing mail.


- .br
- .ne 5

- .sp
- .hn 1 Customized header lines
-
- The mailer provides a facility for including customized
- header lines in the messages you send.
- If you have an \f2.elm/elmheaders\f1 file,
- the mailer will include its contents
- immediately after the regular headers of all outbound mail.
- The mailer supports use of the backquote convention in this file
- to run commands and substitute the commands' output for the backquoted
- text.
- Here's a typical \f2.elm/elmheaders\f1 file:


- .sp
- .ft CW
- .zf
- .nf

- Organization: Hewlett-Packard Laboratories
- Phone: (415)-555-1234
- Operating-System: \`uname -srv\`
- .fi


- .ft 1
- .sp

- These lines will be inserted after all other header lines in the message.
- .br
- .ne 5
- .sp
- .hn 1 Commands
- .sp
-
- This section discusses each command in the Elm
- program in more detail than above, including the
- prompts the user can expect upon executing the
- command, the meaning of different options, etc.
-
- .lp \h'24p'? 66p
- Help. This command used once puts you in the \f2help\f1
- mode, where any key you press results in a one-line description
- of the key. Pressing \*q?\*u again at this point produces a
- summary listing each command available.
- Pressing \*q.\*u (period) leaves the help mode and returns you to the
- command level.
-
- .lp \h'24p'<space> 66p
- Display the current message.
- <space> is useful for reading through a mail folder.
- When issued from the index screen,
- it displays the first screen of the current message.
- When issued while in the builtin pager,
- it pages through the message to the end.
- When issued at the end of a message
- (with either the builtin pager or an external pager),
- it displays the first screen of the next message not marked for deletion.
-
- .lp \h'24p'<return> 66p
- Display the current message.
- <return> behaves somewhat differently from <space>.
- When issued while in the builtin pager,
- it scrolls the current message forward one line,
- and then when issued at the end of a message
- (with either the builtin pager or an external pager),
- it redisplays the first screen of the the \f2current\fP message.
- The latter is useful in case you have issued a non-pager
- command while in the builtin pager and want to restart the display
- of the current message.
-
- .lp \h'24p'! 66p
- Shell. This allows you to send a command to the shell without
- leaving the program. Note that it is possible that the person who
- installed Elm on your system disabled this feature.
-
- .lp \h'24p'| 66p
- Pipe. This command allows you to pipe the current message
- or the set of \f2tagged\f1 messages
- through other filters as you desire. The shell used for
- the entire command is either the one specified in
- your \f2.elm/elmrc\f1 file, or the default shell (see the \f3shell\f1
- variable under \f3String Variables\f1 in section 2).
-
- .lp \h'24p'\/ 66p
- Pattern match. This command, at the command level, allows the
- user to search through all the \f2from\f1 and \f2subject\f1 lines of
- the current folder starting at the current message and
- continuing through the end. If the first character of the
- pattern is a \*q/\*u, then Elm tries to match the
- specified pattern against \f2any\f1 line in the folder. Again,
- this works from the current message through the
- end. Both searches are case insensitive.
-
- .lp "\h'24p'\- or <left>" 66p
- Display the previous page of the message index.
-
- .lp "\h'24p'+ or <right>" 66p
- Display the next page of the message index.
-
- .lp \h'24p'<number><return> 66p
- Specify new current message. When you type in any digit, Elm
- prompts \*QSet current to : \f2n\f1\*U, where \f2n\f1 is
- the digit entered. Continue entering the full number
- and terminate with <return>. Note that changing the
- current message to a message not on the
- current page of headers results in a new page
- being displayed.
-
- .lp \h'24p'< 66p
- Scan message for calendar entries. A rather novel feature of
- the Elm mailer is the ability to automatically incorporate
- calendar/agenda information from a mail message into the user's
- calendar file. This is done quite simply; any line that has
- the pattern
-
- .ti +.5i
- \-> \f2calendar entry\f1
-
- is automatically added to the user's \f3calendar\f1 file
- when the \*q<\*u command is used
- (see the \f3calendar\f1 variable under \f3String Variables\f1 in section 2).
- .sp
- For example, let's say we had a message with the text:


-
- .ft CW
- .zf

- .ps 9
- .ti +.5i
- Regardless of that meeting, here\'s the seminar stuff:
- .br
- .ti +.5i
- \-> 8/03 3:00pm: AI Seminar with Ira Goldstein of HP Labs
- .ft 1
- .ps 10
-
- then using the \*q<\*u command would add the line:


-
- .ft CW
- .zf

- .ps 9
- .ti +.5i
- 8/03 3:00pm: AI Seminar with Ira Goldstein of HP Labs
- .ps 10
- .ft 1
-
- to the user's \f3calendar\f1 file.
-
- .lp \h'24p'a 66p
- Alias. The alias system is a way by which more complex mail addresses
- can be shortened for the mail user. For example:
- .sp
- .nf
- .ps 9


- .ft CW
- .zf
- .ti +.5i

- joe, bleu = Joe Bleu = j...@hpfcla.SSO.HP.COM
- .ft 1
- .ps 10
- .fi
- .sp
- which allows mail to \*Qjoe\*U or \*Qbleu\*U with the system expanding
- the address properly. Obviously, this saves having to remember
- complex addresses. A more detailed discussion can
- be found in either the section entitled \f2The Alias System\f1 in
- this document or \f2The Elm Alias System Users Guide\f1.
-
- .lp \h'24p'b 66p
- Bounce mail. This \*Qremails\*U mail to someone else in such a
- way as to make the return address the original sender rather
- than you. The \f3forward\f1 command is similar, but it makes
- the return address \f2you\f1 rather than the original sender.
-
- .lp \h'24p'C 66p
- Copy to folder. This command copies the current message or set of
- tagged messages to
- a folder. If there is anything in the folder currently the
- message is appended to the end, otherwise the folder is created
- containing only the newly copied messages. The prompt for this command
- is \*QCopy to folder: \*U. A response of <return> cancels the command
- and returns the user to the command prompt. The usual filename
- metacharacters are available, too. That is, this command expands filenames
- with \*q~\*u (tilde) to your home directory and \*q=\*u to your
- \f3maildir\f1 directory, if defined. This command also allows you to
- use \*q>\*u for your \f3receivedmail\f1 folder,
- \*q<\*u for your \f3sentmail\f1 folder,
- \*q.\*u for the last folder you saved or copied a message to
- and \*Q@alias\*U for the default folder for \*Qalias\*U.
- If you use a shell wildcard in the file or folder name, you are
- given a list of all files or folders which match the wildcard.
- Elm uses your shell to find the names, so whatever wildcards you are
- used to will work.
- Finally, you can also enter \*q?\*u at the prompt
- to get detailed help.
-
- .lp \h'24p'c 66p
- Change folder. Specifying this command allows the user to change
- the folder that is currently being read. This is intended
- for perusal and reply to previously archived messages.
- The prompt is \*QName of new folder: \*U and entering <return>
- cancels the operation, while entering a filename causes the program
- to read that file as the new folder,
- if possible. This command expands filenames
- with \*q~\*u (tilde) to your home directory and \*q=\*u to your
- \f3maildir\f1 directory, if defined. This command also allows you to
- use \*q!\*u as an abbreviation for you incoming mailbox,
- \*q>\*u for your \f3receivedmail\f1 folder,
- \*q<\*u for your \f3sentmail\f1 folder,
- \*q.\*u for the last folder you saved or copied a message to
- and \*Q@alias\*U for the default folder for \*Qalias\*U.
- If you use a shell wildcard in the file or folder name, you are
- given a list of all files or folders which match the wildcard.
- Elm uses your shell to find the names, so whatever wildcards you are
- used to will work.
- Finally, you can also enter \*q?\*u at the prompt
- to get detailed help.
-
- .lp "\h'24p'd, u" 66p
- Delete and undelete. Neither of these two commands have any prompts
- and indicate their action by either adding a \*qD\*u to the current
- message index entry (indicating deletion pending) or removing
- the \*qD\*u (indicating that the message isn't set for deletion).
-
- .lp \h'24p'<control>-D 66p
- This command allows you to easily mark for deletion all messages
- that have a specific pattern. After \f3<control>-D\f1 is pressed,
- Elm prompts for the string to match in
- either the \f2from\f1 or \f2subject\f1 lines of
- the messages.
-
- .lp \h'24p'<control>-U 66p
- This is the direct opposite command to the \f3<control>-D\f1 command
- \(em all messages
- that match the specified pattern have any mark for deletion
- removed by this command.
-
- .lp \h'24p'e 66p
- Edit mailbox. This allows you to modify the current mail file at
- a single keystroke. This is mostly useful for editing messages
- before saving them. Modifying headers should be done with extreme
- caution, as they contain routing information and other vital stuff
- for full functionality. This command may be disabled by whoever
- configured your Elm installation.
-
- .lp \h'24p'f 66p
- Forward. Allows the user to forward the current message to another user.
- This copies the message into the edit buffer and allows the user to add
- their own message too. The prompt is \*QForward to:\*U and will expand an alias
- if entered. See also \f3bounce\f1, above.
-
- Elm will ask you if you want to edit the message before sending it. If you
- answer \f2yes\f1, Elm will prepend your prefix string to each line of the
- message, and let you edit the result. If you do not want the prefix string
- on each line, answer \f2no\f1; you will have another chance to edit the message
- when you get to the \*Qsend\*U menu. See the \f3prefix\f1 variable
- under \f3String Variables\f1 in section 2.
-
- .lp \h'24p'g 66p
- Group reply. Identical to \f3reply\f1 below, except that the
- response is mailed to \f2all recipients\f1 of the original
- message except yourself. See the \f3alternatives\f1
- variable under \f3String Variables\f1 in section 2.
-
- .lp \h'24p'h 66p
- Display the current message with all headers intact.
- When you display a message with other commands,
- certain header lines are formatted and others discarded according
- to the \f3weedlist\fP variable, described under \f3String
- Variables\f1 in section 2.
-
- .lp \h'24p'i 66p
- Return to the index screen,
- when issued in the builtin pager or at the end of a message with
- either the builtin pager or an external pager.
-
- .lp "\h'24p'j or <down>, k or <up>" 66p
- These four keys work similarly to what they would do in \f2vi\f1 or
- any of the other (precious few) screen oriented
- programs. The \f3j\f1 and \f3<down>\f1 keys move
- the current message pointer down to the next message skipping
- over any marked deleted (going to
- the next page if necessary) and the \f3k\f1 and \f3<up>\f1 keys move
- the current
- message pointer back to the previous message skipping
- over any marked deleted (also changing pages if necessary).
-
- .lp "\h'24p'J, K" 66p
- These two keys work similarly to their lower case counterparts,
- except that they don't skip over deleted messages.
-
- .lp \h'24p'l 66p
- Limit. This feature allows you to specify a subset of the existing
- messages to be dealt with. For example, let's say we had a folder with
- four hundred messages in it, with only four or five different subjects. We
- could then limit what we're dealing with by using the \f3limit\f1
- command. Pressing \f3l\f1 would result in the prompt:


- .sp
- .nf
- .ft CW
- .zf
- .ti +.5i

- Criteria:


- .ft 1
- .fi
- .sp

- to which we could answer
- \*Qsubject \f2string\f1\*U,
- \*Qfrom \f2string\f1\*U or
- \*Qto \f2string\f1\*U. In our example, we could use
- \*Qsubject programming\*U
- as a criterion for selection. Once we've limited our selections,
- the screen is rewritten with just the selected messages
- and the top line changes to have a message like:


- .sp
- .nf
- .ft CW
- .zf

- .ps 9
- .tl ''\0\0\0\0\0Folder is "=elm" with 92 shown out of 124 [Elm 2.4]''
- .ps 10


- .ft 1
- .fi
- .sp

- We can further limit selections by using the \f3limit\f1 option
- repeatedly to enter further criteria.
-
- To clear all the criteria and get back to the \*Qregular\*U display, simply
- enter \*Qall\*U as the limiting criteria. It should be noted that the
- selection based on \*Qto\*U isn't fully implemented for this version, so
- it is recommended that users stay with \*Qsubject\*U and \*Qfrom\*U as the
- basis for their criteria.
-
- .lp \h'24p'm 66p
- Mail. Send mail to a specified user. The prompt associated
- with this command is \*QSend mail to: \*U. Entering an alias name results
- in the full address being rewritten in parenthesis immediately. This
- prompt is followed by \*QSubject: \*U which allows the user to title their
- note. The final prompt is \*QCopies to: \*U, which allows other people
- specified to receive \*Qcarbon copies\*U of the message, but see the
- \f3askcc\f1 variable under \f3Boolean Variables\f1 in section 2. Upon
- entering all three items the
- editor is invoked and the message can be composed.
-
- .lp \h'24p'n 66p
- Next message that is not marked for deletion.
- Useful for displaying successive messages in a folder.
- When issued from the index screen, it displays the current message,
- and when issued while in the builtin pager or at the end of a message
- (with either the builtin pager or an external pager),
- it displays the first screen of the next message not marked for deletion.
-
- .lp \h'24p'o 66p
- Options. This full-screen display allows you to alter the settings
- of a number of parameters, including the current sorting method,
- the method of printing files, the calendar file, the save file, and
- so on. It's self-documenting (where have you heard \f2that\f1
- before?) so isn't explained in too much detail here. See the
- \f3configoptions\f1 variable under \f3String Variables\f1 in section 2.
-
- .lp \h'24p'p 66p
- Print. This allows you to print out the current
- message or the tagged messages to a previously defined printer. See
- the \f3print\f1 variable under \f3String Variables\f1 in section 2.
-
- .lp \h'24p'q 66p
- Quit. If you in the pager, you are returned to the index screen. If you are
- at the index screen, Elm quits altogether. However, if you have the
- \f3ask\fP variable set ON, Elm first prompts you for the disposition of the
- messages in the current folder. If any messages are marked for deletion, it
- asks if you want them deleted. If the current folder is your incoming
- mailbox, you are also asked if read messages should be stored in your
- \f3receivedmail\f1 folder,
- and if unread messages should be kept in the incoming mailbox.
- The default answers to these questions are set by the \f2.elm/elmrc\f1
- variables \f3alwaysdelete\f1, \f3alwaysstore\f1, and \f3alwayskeep\f1
- (see \f3Boolean Variables\f1 in section 2).
- However, if you elect to not store your read messages (i.e. keep them)
- it is presumed you want to keep your unread messages, too.
-
- .lp \h'24p'Q 66p
- Quick quit. This behaves similar to the \f3quit\f1 command except that
- you are never prompted for answers to the message disposition questions.
- Elm disposes of messages according to the values you
- have set for \f3alwaysdelete\f1, \f3alwaysstore\f1, and \f3alwayskeep\f1
- in your \f2.elm/elmrc\f1 file (see \f3Boolean Variables\f1 in section 2).
-
- .lp \h'24p'r 66p
- Reply. Reply to the sender of the current message. If
- the \f3autocopy\f1 variable is set to OFF in your \f2.elm/elmrc\f1 file,
- Elm prompts \*QCopy message? (y/n)\*U, to which you can specify
- whether or not a copy of the source message is to be copied into the edit
- buffer. If copied in, all lines from the message are
- prepended with the \f3prefix\f1 character sequence specified in
- your \f2.elm/elmrc\f1 file (see \f3String Variables\f1 in section 2).
-
- .lp \h'24p's 66p
- Save to folder. This command is like the \f3copy\f1 command, except
- that the saved messages are marked for deletion and, if you are
- saving just the current message, the current message pointer is
- incremented afterwards (see the \f3resolve\f1 variable under \f3Boolean
- Variables\f1 in section 2). This command expands folder names
- with \*q~\*u (tilde) to your home directory and \*q=\*u to your
- \f3maildir\f1 directory, if defined. This command also allows you to
- use \*q>\*u for your \f3receivedmail\f1 folder,
- \*q<\*u for your \f3sentmail\f1 folder (see \f3String Variables\f1 in
- section 2),
- \*q.\*u (period) for the last folder you saved or copied a message to
- and \*Q@alias\*U for the default folder for \*Qalias\*U.
-
- .lp \h'24p't 66p
- Tag.
- .fn
- 4. Currently only \f3copy\f1, \f3pipe\f1, \f3print\f1, and \f3save\f1
- support this.
- .ef
- Tag the current message for a later operation.\s-2\u4\d\s0
-
- .lp \h'24p'T 66p
- Tag and move to next undeleted message.
- This command is like the `Tag' command but also increments the current message
- pointer to the next undeleted message.
-
- .lp \h'24p'<control>-T 66p
- Tag all messages containing the specified pattern. Since \f2tagging\f1
- messages can occur on screens other than the one being viewed,
- Elm first checks to see if any messages are currently
- \f2tagged\f1 and ask you if you'd like to remove those tags. After
- that, it will, similar to the \f3<control>-D\f1 command, prompt for
- a pattern to match and then mark all messages that contain
- the (case insensitive) pattern in either the \f2from\f1 or \f2subject\f1
- lines.
-
- .lp \h'24p'x 66p
- Exit. This leaves Elm and discards any changes to the mailbox.
- If changes are pending (such as messages marked for deletion) you are
- asked to confirm discarding the changes. If confirmed, no
- messages are deleted and the status of all messages is unchanged. That is,
- any messages that were new will remain new instead of being noted as old,
- and any messages that were read for the first time
- will be again noted as unread.
-
- .lp \h'24p'X 66p
- Exit immediately. This leaves Elm in the quickest possible manner
- without even prompting about discarding the changes to the mailbox.
- No messages are deleted and the status of all messages is unchanged. That is,
- any messages that were new will remain new instead of being noted as old,
- and any messages that were read for the first time
- will be again noted as unread.
-
- .in 0
- .sp
- When you are about to send a message with the \f3forward\f1, \f3mail\f1,
- or \f3reply\f1 commands (see above), a small menu of the following
- options appears:
-
- .lp \h'24p'c 66p
- Specify the folder for saving a copy of the message.
- This allows you to override the
- \f3copy\f1, \f3forcename\f1 and \f3savename\f1 variables
- from your \f2.elm/elmrc\f1 file (see \f3Boolean Variables\f1 in
- section 2). It prompts you for the name
- of the folder where a copy of the outgoing message is to be saved. The
- default displayed is taken from those three \f2.elm/elmrc\f1
- options and can be changed. This command also allows you to
- use \*q>\*u for your \f3receivedmail\f1 folder
- and \*q<\*u for your \f3sentmail\f1 folder (see \f3String Variables\f1
- in section 2),
- and \*q=?\*u to mean \*Qconditionally save by name\*U
- and \*q=\*u to mean \*Qunconditionally save by name\*U.
- Since you could next enter
- the \f3edit headers\f1 command and change the recipients
- of your message, the name of the folder under the
- two \*Qsave by name\*U options is not established until you enter the \f3send\f1
- command.
- If you use a shell wildcard in the file or folder name, you are
- given a list of all files or folders which match the wildcard.
- Elm uses your shell to find the names, so whatever wildcards you are
- used to will work.
- You can also enter \*q?\*u at the prompt
- to get help about saving.
-
- .lp \h'24p'e 66p
- Edit message (or form). Entering this command allows you to edit
- the text of your message or form.
-
- .lp \h'24p'f 66p
- Forget. This gets you out of sending a message you started. If you are
- in send-only mode, the message is saved to the file \f2Canceled.mail\f1
- in your home directory. Otherwise
- it can be restored at the next \f3forward\f1, \f3mail\f1,
- or \f3reply\f1 command during the current session of Elm After
- issuing one of those commands you will be prompted with \*QRecall last
- kept message?\*U
-
- .lp \h'24p'h 66p
- Edit headers. This puts you into the \f2header editing mode\f1, whereby
- you can edit any of the various headers of your message. Like
- the options screen, it's self-documenting, so it isn't explained in too much
- detail here.
-
- .lp \h'24p'i 66p
- Run \f2ispell\f1 (or some other configured spelling correction program).
- The outgoing message is run through an interactive spelling correction program
- if one is available. The default spelling program is the GNU \f2ispell\f1 program
- unless changed by the person who installed Elm on your system.
-
- .lp \h'24p'm 66p
- Make form. This converts the message you have edited into a form. See
- the \f3forms\f1 variable under \f3Boolean Variables\f1 in section 2 and
- \f2The Elm Forms Mode Guide\f1 for more details.
-
- .lp \h'24p's 66p
- Send. This sends the message as is without any further ado.
- .in 0


- .br
- .ne 5

- .sp
- .hn 1 "Using Elm with \*Qeditor = none\*U"
- .sp
- The Elm program also supports a builtin editor for simple message
- composition that is very (very) similar to the simple line
- editor available from the \f2Berkeley Mail\f1 system.
-
- To access it, you need merely to specify \*Q\f3editor=none\f1\*U in
- your \f2.elm/elmrc\f1 file.
- With that, any messages to be composed
- that don't already have text in the buffer (e.g. no reply with
- the text included, etc.), will use this editor.
- .sp
- From the builtin editor, the following options are available for use.
- Each command here is prefixed with a \*q~\*u (tilde).
- You can specify a different \*Qescape\*U character in your \f2.elm/elmrc\f1 file,
- if you desire (see the \f3escape\f1 variable under \f3String
- Variables\f1 in section 2).
- .sp
-
- .lp \h'16p'~? .5i
- Print a brief help menu.
-
- .lp \h'16p'~b .5i
- Change the Blind-Carbon-Copy list.
-
- .lp \h'16p'~c .5i
- Change the Carbon-Copy list.
-
- .lp \h'16p'~e .5i
- Invoke the \f3easyeditor\f1 editor on the message, if possible
- (see the \f3easyeditor\f1 variable under \f3String Variables\f1 in
- section 2).
-
- .lp \h'16p'~f .5i
- Add the specified message or current message.
-
- .lp \h'16p'~h .5i
- Change all the available headers (To, Cc, Bcc, and Subject).
-
- .lp \h'16p'~m .5i
- Same as \f3~f\f1, but with the current \f3prefix\f1 (see the
- \f3prefix\f1 variable under \f3String Variables\f1 in section 2).
-
- .lp \h'16p'~o .5i
- Invoke a user specified editor on the message.
-
- .lp \h'16p'~p .5i
- Print out, on the screen, the message as typed in so far.
-
- .lp \h'16p'~r .5i
- Include (read in) the contents of the specified file.
-
- .lp \h'16p'~s .5i
- Change the Subject line.
-
- .lp \h'16p'~t .5i
- Change the To list.
-
- .lp \h'16p'~v .5i
- Invoke the \f2vi\f1 visual editor on the message.
-
- .lp \h'16p'~< .5i
- Execute the specified
- .ux
- command, entering the output
- of the command into the editor buffer upon completion.
- For example, \*Q~< who\*U includes the output of
- the \f2who\f1 command in your message.
-
- .lp \h'16p'~! .5i
- Execute a
- .ux
- command if one is given (as in \*Q~!ls\*U) or
- give the user a shell, either from the \f3shell\f1 variable setting in
- the \f2.elm/elmrc\f1 file or the default (see the \f3shell\f1 variable
- under \f3String Variables\f1 in section 2).
-
- .lp \h'16p'~~ .5i
- Add a line prefixed by a single \*q~\*u character.
- .in 0
- .sp
- A useful note is that the \f3~f\f1 and \f3~m\f1 commands invoke the \f2readmsg\f1
- command, so you can pass parameters along too. For example, if we
- wanted to include a message from Joe, without any headers, but with each
- line prefixed, we could use:


- .sp
- .nf
- .ft CW
- .zf

- .ti .5i
- \&~m \-n Joe


- .ft 1
- .fi
- .sp

- to accomplish the task.
-
- To learn more about how they work, try 'em!


- .br
- .ne 5

- .sp
- .hn 1 The Alias System
- .sp
- As mentioned previously, there exists in the Elm
- system a set of aliases that associate
- an arbitrary word (such as a persons name) to a complex address or group.
- The advantages are readily apparent; rather than
- remembering an address of the form:
- .sp
- .nf
- .ps 9


- .ft CW
- .zf
- .ti .5i

- host1!host2! ... !hostN!user
- .ft 1
- .ps 10
- .fi
- .sp
- the user merely has to remember a single word.
-
- Two alias tables are available for a each
- user within Elm,
- namely the system alias file and the user's alias file. The
- system alias file is created and maintained (by the system administrator)
- by editing the file name defined for \f2SYSTEM_ALIASES\f1 in the
- \f2sysdefs.h\f1 file (see \f2The Elm Configuration Guide\f1) and as described
- in the documentation with the \f2newalias\f1 command,
- then running the \f2newalias\f1 program.
-
- An individual user can also have an alias file which works
- in conjunction with the system aliases. To do this, one
- merely needs to enter the alias menu system and create aliases with
- the \f3a\f1 (\f3alias current message\f1) or \f3n\f1
- (\f3make new alias\f1) commands.
- Alternatively, the user can peruse the documentation for the \f2newalias\f1
- command and create a file as indicated therein. After
- executing the program, the aliases are available
- for use from within Elm.
- .sp
- Please refer to \f2The Elm Alias Users Guide\f1 for complete details.
- .sp 2
- Within Elm,
- however, the alias system acts as an entirely different program, with
- its own display, own commands, and own mini-menu. The aliases are
- presented in a
- list similar to the index screen with the following menu:
- .sp
- .sd
- .nf
- .ps 9


- .ft CW
- .zf

- .ce 3
- Alias commands: ?=help, <n>=set current to n, /=search pattern
- a)lias current message, c)hange, d)elete, e)dit aliases.text, f)ully expand,
- l)imit display, m)ail, n)ew alias, r)eturn, t)ag, u)ndelete, or e(x)it
- .sp
- Alias: @


- .sp
- .ps 10

- .ft 1
- .ed
- .fi
-
- The commands are:
-
- .lp \h'16p'? .5i
- Help. This command used once puts you in the \f2help\f1
- mode, where any key you press will result in a one-line description
- of the key. Pressing \*q?\*u again at this point produces a
- summary listing each command available.
- Pressing \*q.\*u (period) leaves the help mode and returns you to the
- alias command prompt.
-
- .lp "\h'16p'<space> or <return> or v" .5i
- Display the current alias address. The alias address is displayed below
- the alias menu. This command allows you to verify the address for a
- person or the contents of a group alias.
-
- .lp \h'16p'$ .5i
- Resynchronize the alias text file (\f2$HOME/.elm/aliases.text\f1) and
- alias database by rebuilding the database from the text file by running
- \f2newalias\f1. Aliases marked for deletion are removed, tagged aliases
- are untagged, and new and changed aliases are recognized. The alias
- screen is updated to reflect these changes.
-
- .lp \h'16p'\/ .5i
- Pattern match. This command allows the
- user to search through all the \f2alias\f1 and \f2username\f1
- entries in the alias list
- starting at the current alias and
- continuing through the end.
- If the first character of the
- pattern is a \*q/\*u, then Elm also includes the \f2comment\f1
- and the fully expanded \f2address\f1 fields in the search.
- The search is case insensitive. This allows the user to find a
- specific alias in the situation where there are a large number of
- aliases.
-
- .lp \h'16p'a .5i
- Alias current message.
- This allows the user to create an alias that has the
- return address of the current message as the address field of
- the alias. It prompts for a unique alias name. If the alias
- name is not unique, you will be asked if you wish to replace
- the existing alias. For further
- information, please see \f2The Elm Alias System Users Guide\f1.
-
- .lp \h'16p'c .5i
- Change current alias. This will prompt for changes to the current
- names and address. If other aliases are tagged you will be asked if you
- want to create a group alias from the tagged aliases. The original
- alias is replaced with the new information in
- your individual alias file (\f2$HOME/.elm/aliases.text\f1) and
- then added to the database (at the next alias resync). Aliases
- that have been changed are marked with an \*qN\*u (for new) until
- the database is updated.
-
- .lp "\h'16p'd, u" .5i
- Delete or undelete an alias.
- This allows the user to mark an alias for deletion in the same fashion
- as on the index screen. The deletions are not
- actually made until the user returns to the main menu with the \f3r\f1,
- \f3q\f1, or \f3i\f1 commands or resyncs
- the display with the \f3$\f1 command. Deletions on system aliases are not
- allowed. These commands (plus the \f3<control>-D\f1
- and \f3<control>-U\f1 versions) behave identically to their index screen
- counterparts (see section 7, \f3Commands\f1).
-
- .lp \h'16p'e .5i
- Edit the \f2.elm/aliases.text\f1 file. The user alias file is edited
- using the editor defined in the \f3editor\f1 variable in your
- \f2\&.elm/elmrc\f1 file (see \f3String Variables\f1 in section 2).
- \f2newalias\f1 is run after the edit.
-
- .lp \h'16p'f .5i
- Display fully expanded alias. The currently selected
- alias is fully expanded and displayed to the user. This is most useful when
- working with group aliases.
-
- .lp \h'16p'l .5i
- Limit the display. You can limit the display by alias type (person/group
- or user/system) or by search pattern on name or alias. Otherwise, this
- works exactly like the limit command on the index screen.
-
- .lp \h'16p'm .5i
- Send mail to the current alias. The user is prompted to compose a new
- mail message to be sent to the
- person or group specified by the selected alias. If aliases are
- tagged the message is mailed to the person(s) and/or group(s)
- specified by the tagged aliases. Tags are cleared after mailing the
- message.
-
- .lp \h'16p'n .5i
- Make a new user alias. This prompts for a unique alias name and
- then for an address. If the alias
- name is not unique, you are asked if you wish to replace
- the existing alias. If aliases are tagged you are asked if you
- want to create a group alias from the tagged aliases.
- The information provided is added
- to your individual alias file (\f2$HOME/.elm/aliases.text\f1) and
- then added to the database at the next alias resync.
-
- .lp "\h'16p'r or q or i" .5i
- Return. Return to the index screen of the Elm program. Any pending
- deletions are processed and newalias is run to update the database. New
- additions are handled at this time as well.
-
- .lp "\h'16p'R or Q or I" .5i
- Quick return. This behaves like the \*qr\*u command except that you are never
- prompted for answers to alias disposition questions.
- Elm disposes of aliases according to the value
- set for the \f3alwaysdelete\f1 variable
- in your \f2.elm/elmrc\f1 file (see \f3Boolean Variables\f1 in
- section 2).
-
- .lp \h'16p't .5i
- Tag.
- Tag the current alias for a later operation.\s-2\u5\d\s0
- .fn
- 5. Currently only \f3mail\f1, \f3change\f1, and \f2n3w alias\f1 support this.
- .ef
- This command (plus the \f3<control>-T\f1
- version) behaves identically to its index screen
- counterpart (see section 7, \f3Commands\f1).
-
- .lp \h'16p'x .5i
- Exit alias menu. Exits the alias menu without processing any
- deletions. Aliases marked for deletion are unmarked and
- \f2newalias\f1 is not run, even if alias additions have been made.
- .in 0
- .sp
- Additionally, the movement keys (\*qj\*u, \*qk\*u, \*q+\*u, \*q\-\*u,
- etc.) work in the same fashion as on the index screen (see section 7,
- \f3Commands\f1).
- .br
- .ne 5
- .sp
- .hn 1 Elm and Signals
-
- Elm can handle several standard
- .ux
- \f2signals\fR to do
- some special processing.
- Signals are interrupt messages sent from one program to
- another. No detailed messages are sent, but a properly configured
- program (such as Elm) can watch for and handle these signals.
-
- In particular, Elm watches for the following signals
- and takes these actions:
- .lp ALRM .5i
- This is the alarm clock signal or time warning.
- Elm uses this to wake itself up periodically and check for
- new mail.
- .lp HUP .5i
- This is the hangup notice.
- It means that the terminal/modem/whatever which you have been using
- with Elm has become detached from the system where Elm
- was running.
- When Elm gets this signal, it aborts all the pending operations
- and exits, leaving your mailbox unchanged.
- .lp USR1 .5i
- This is the first user-defined signal.
- When Elm gets this signal, it receives any pending mail,
- performs all the pending operations (deletes), and exits
- leaving all unread mail marked as new.
- This is the same as giving both the \f3$\f1 and \f3X\f1 commands.
- .lp USR2 .5i
- This is the second user-defined signal.
- When Elm gets this signal, it receives any pending mail,
- performs all the pending operations (deletes), and exits,
- leaving all unread mail marked as old.
- This is the same as giving both the \f3$\f1 and \f3Q\f1 commands.
- .in 0
- .sp
- You would only use these signals yourself under the most unusual
- circumstances. For example, suppose you were using \f3Elm\fR
- to read mail on \f2host_1\fR. You have many messages, most of
- which have been read and filed (and therefore deleted), or simply
- deleted. You have not yet resynchronized your mailbox (\f3$\f1
- command). Now you go to lunch.
- On your return, you're stopped at the door and told to take care
- of an emergency. You go to another part of the building, and want
- to read your mail to see what the emergency is \(em but you can't,
- because Elm is still running at your desk.
-
- What you really want is one of the scenarios given in the
- description of \f2HUP\f1, \f2USR1\f1 or \f2USR2\f1.
- Use your local \f2ps\f1 command to find out what the \f2process number\f1
- of your Elm session is. Then give the command


- .sp
- .nf
- .ft CW
- .zf

- .ti .5i
- kill \-\f2XXX process_number\f1
- .fi
- .sp
- where \f2XXX\f1 is either \*QHUP\*U, \*QUSR1\*U or \*QUSR2\*U and
- \f2process_number\f1 is the process number for your remote Elm session.
- Your remote session will terminate with the actions noted above.


- .br
- .ne 5

- .sp
- .hn 1 Expert Mail Users and Debugging the Mailer
-
- There are some additional facilities available in the Elm
- mailer for those people who are knowledgeable about
- mail protocols, or trying to debug/track down a problem.
-
- The \f3h\f1 (\f3display with headers\f1) command at the command prompt
- displays the current message ignoring the current
- setting of the \f3weed\f1 variable (see \f3Boolean Variables\f1 in
- section 2). This is most useful
- for answering questions of the form \*QI wonder what
- this guy put in his header?\*U and such. This command
- does not show up on the mini-menu because it is somewhat
- esoteric, but it does appear on the help screen.
-
- The \f3@\f1 command at the command prompt
- outputs a screen of debugging information,
- including the number of lines and
- offsets of each of the messages in the current mailbox.
-
- The \f3#\f1 command at the command prompt
- displays the entire stored \*Qrecord structure\*U for
- the current message.
-
- The \f3%\f1 command
- displays the full computed return address of the
- current message.
-
- Starting up Elm with the \f3\-d\f1 (debug) option (see section 3,
- \f3Command Line Options\f1) creates a file called
- \f2ELM:debug.info\f1 in your home directory which contains a wealth of useful
- information (to me, at least!) to aid in tracking down
- what errors are occurring and why.
-
- If there are any problems with Elm, please try
- to recreate the error with the debug option enabled
- and set to the highest level (11) before sending defect reports my way.
-
- One final note: all error names reported by the program
- are documented in the \f2AT&T System V Interface Definition Reference
- Manual\f1 in \f3errno\f1(2).
--- 0 ----
Index: elm2.4.ME+.122-cvs/doc/terminal.info
*** elm2.4.ME+.121/doc/terminal.info 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/doc/terminal.info 2005-03-15 14:29:06.000000000 +0200
***************
*** 59,64 ****
--- 59,67 ----
# working font for *-iso8859-1
kterm ISO-2022 ISO-8859-1

+
+
+
# These are for Linux Mandrake 7.1 and 9.0
#
# Following does not work, to geto these work change on
***************
*** 78,80 ****
--- 81,131 ----


# Only same are listed than on /etc/profile.d/lang.sh
linux PRIVATE ISO-8859-2 [ $SYSFONTACM="iso02" ] 1/11 2/8 4/11 0/15

linux PRIVATE ISO-8859-15 [ $SYSFONTACM="iso15" ] 1/11 2/8 4/11 0/15
+

+ # By defualt mlterm treats fullwidth characters characters as
+ # they use two columns. This setting also causes that
+ # for system (local) character set is used wchar_t routines
+ # and wcwidth() -function. This also requires that
+ # system defines __STDC_ISO_10646__ -macro.
+ mlterm DW UTF-8
+

+ #
+ mlterm FLAG xterm-title

Index: elm2.4.ME+.122-cvs/doc/tmac.n
*** elm2.4.ME+.121/doc/tmac.n 2002-01-26 13:14:45.000000000 +0200
--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************
*** 1,786 ****
- .\" @(#)$Id: tmac.n,v 1.1.1.1 1998/10/15 15:36:39 hurtta Exp $
- .\" The News macro package
- .\"
- .\" This is the macro package that is used to format news documents. It
- .\" was written because many sites do not have one of the -mm or -ms pack-
- .\" ages that the documents use. This is NOT compatible with EITHER, but
- .\" (I hope) will become the standard for all news documents (man pages
- .\" excepted, since everyone seems to have -man.)
- .\"
- .\" This package was written using only the "NROFF/TROFF Users' Guide",
- .\" and therefore if you can run NROFF/TROFF, you can legitimately use
- .\" this package. However, because NROFF/TROFF are proprietary programs,
- .\" I cannot place this package in the public domain. This should not
- .\" matter, because if you legitimately have NROFF/TROFF, you have the
- .\" documentation; if not, you can't run off the documentation anyway.
- .\"
- .\" This package may be circulated freely with the news documentation; it
- .\" may not be sold, but is to be distributed with the unformatted news
- .\" documents. However, the name of the author and the place at which it
- .\" was written (in the author's own time, of course) are not to be
- .\" removed from the package regardless of how it is modified or altered.
- .\" Further, please do not distribute this package if you make any changes
- .\" because I don't want to get bug reports of macros I haven't written;
- .\" if you have a goodie you want me to add, send it to me and we'll talk.
- .\" (I really do like feedback!) I'd really appreciate your cooperation.
- .\"
- .\" Author: Matt Bishop
- .\" Research Institute for Advanced Computer Science
- .\" Mail Stop 230-5
- .\" NASA Ames Research Center
- .\" Moffett Field, CA 94035
- .\"
- .\" version 1.0 September 28, 1985 m...@riacs.arpa
- .\" initial version
- .\" version 1.1 October 25, 1985 m...@riacs.arpa
- .\" fixed an incredibly obscure footnote bug (that occurred twice in
- .\" the news documentation!) which put footnoted words on one page
- .\" and the footnote on the next if the word was in the next-to-last
- .\" or last line; commented it, and generally cleaned up
- .\" Version 1.2 October 27, 1985 m...@riacs.arpa
- .\" Added a few more comments and a check to keep footnotes lined up
- .\" with the bottom margin.
- .\" Version 1.3 February 12, 1986 m...@riacs.arpa
- .\" Added an error check to catch unmatched ef's and ed's
- .\" Version 1.4 December 29, 1986 m...@riacs.edu
- .\" Changed footnote for ux, pd, and vx macros and added a string
- .\" for rg ("Registered Trademark")
- .\" Version 1.5 January 2, 1989 Matt....@dartmouth.edu
- .\" Minor modifications for nroff compatibility
- .\" Version 1.6 March 15, 1989 Matt....@dartmouth.edu
- .\" ..!bear.dartmouth.edu!bishop
- .\" Fixed a bug in footnote handling (again, sigh ...) This one
- .\" occurred when the the "fo" trap position was reset just beneath
- .\" the current line; the footnote overflow trap would kick in and
- .\" never be closed.
- .\"
- .\"
- .\" **********
- .\" these preserve and restore various things
- .\" they are used to shorten other macros
- .de yf \" restore fonts
- .ft \\n(f2 \" previous font
- .ft \\n(f1 \" current font
- ..
- .de yi \" restore indents
- 'in \\n(i2u \" previous indent
- 'in \\n(i1u \" current indent
- ..
- .de ys \" restore point sizes
- .ps \\n(s2 \" previous point size
- .ps \\n(s1 \" current point size
- ..
- .de yv \" restore vertical spacings
- .vs \\n(v2u \" previous vertical spacing
- .vs \\n(v1u \" current vertical spacing
- ..
- .de ya \" restore everything
- .yf \" restore fonts
- .yi \" restore indents
- .ys \" restore point sizes
- .yv \" restore vertical spacing
- .if \\n(f1==0 .ft CW \" unknown font, set to CW
- ..
- .de zf \" preserve fonts
- .nr f1 \\n(.f \" current font
- .ft \" switch to previous font
- .nr f2 \\n(.f \" previous font
- .ft \" back to current font
- ..
- .de zi \" preserve indents
- .nr i1 \\n(.iu \" current indent
- 'in \" switch to previous indent
- .nr i2 \\n(.iu \" previous indent
- 'in \" back to current indent
- ..
- .de zs \" preserve point sizes
- .nr s1 \\n(.su \" current point size
- .ps \" switch to previous point size
- .nr s2 \\n(.su \" previous point size
- .ps \" back to current point size
- ..
- .de zv \" preserve vertical spacings
- .nr v1 \\n(.vu \" current vertical spacing
- .vs \" switch to previous vertical spacing
- .nr v2 \\n(.vu \" previous vertical spacing
- .vs \" back to current vertical spacing
- ..
- .de za \" save everything
- .zf \" save fonts
- .zi \" save indents
- .zs \" save point sizes
- .zv \" save vertical spacings
- ..
- .\" **********
- .\" these actually print the header and footer titles
- .\" they are defined separately from the "hd" and "fo" macros
- .\" to make user redefinition easy
- .de pt \" print header title
- . \" omit header on first page
- .if \\n%>1 \{\
- ' sp |\\$1u \" move to proper position
- . ft 1 \" change to default font
- . ps \\n(ps \" change to default point size
- . vs \\n(vs \" change to default spacing
- . tl '\\*(h0'\\*(h1'\\*(h2' \" center title
- . vs \" restore current vertical spacing
- . ps \" restore current point size
- . ft \" restore current font
- .\}
- ..
- .de pf \" print footer title
- .ft 1 \" change to default font
- .ps \\n(ps \" change to default point size
- .vs \\n(vs \" change to default spacing
- .ie \\n%=1 .tl '\\*(h0'\\*(h1'\\*(h2' \" on first page, print the header here
- .el .tl '\\*(f0'\\*(f1'\\*(f2' \" on other pages, print the footer
- .vs \" restore current vertical spacing
- .ps \" restore current point size
- .ft \" restore current font
- ..
- .\" **********
- .\" these are the top of page (header) and bottom of page (footer) macros
- .\" they don't actually print anything, just call the right macros
- .de hd \" header -- do top of page processing
- .if t .if \\n(cm .tl '\(rn''' \" drop cut mark if needed
- .pt \\n(ttu \" print header
- .nr fc 0 1 \" init footnote count
- .nr fs \\n(.pu-\\n(bmu-1u \" if any footnotes, start print here
- .nr fp 0-\\n(bmu \" reset current footer place
- .ch fo -\\n(bmu \" reset footer trap
- .if \\n(dn .fz \" put leftover footnotes st bottom
- .ya \" restore font, etc.
- 'sp |\\n(tmu \" move to top of body
- .ns \" don't allow any more space
- ..
- .de fo \" footer -- do bottom of page processing
- .za \" save font, etc.
- .rs \" you want motions here
- .nr dn 0 \" clobber diversion size register
- .if \\n(fc .fd \" now print the footnotes, if any
- 'bp \" force out page
- ..
- .\" **********
- .\" these are the footnote macros
- .\" here's an overview:
- .\" Footnotes are processed in environment #1, which is initialized
- .\" at the bottom of this package. When "fn" is called, nroff/troff
- .\" switches to this environment. The body of the footnote is saved
- .\" in the diversion "tf" (for "temporary footnote"), so you will
- .\" NEVER spring a trap during the first reading of a footnote. When
- .\" "ef" ("end footnote") is called, the diversion is closed. If
- .\" this is the first footnote on the page (ie, the number register
- .\" "fc" is 1), and the footnote height (plus the height of 1 line)
- .\" crosses the bottom margin, you get the footnoted word on one
- .\" page and the footnote on the other. In this case we just call
- .\" "fo" manually (taking case it cannot be re-invoked on the same
- .\" page!) If this situation does not occur, we just adjust the
- .\" footer trap's position upwards (we'll get to how far in a min-
- .\" ute); if this puts the trap above the current line, we reposi-
- .\" tion the trap just beneath the current line to be sure of trig-
- .\" triggering it once the current line is forced out.
- .\" To reposition the footer trap, we proceed as follows. Because
- .\" the trap may be sprung in the middle of a line, it is possible
- .\" that the footnote will not fit on the page (regardless of where
- .\" on the page the footnoted word occurs -- really!) if we move the
- .\" trap up by the size of the footnote diversion "tf". So, we
- .\" fudge things a little bit -- for the first footnote on each page
- .\" we move the footer trap up 1 extra line ("line" being 1v in env-
- .\" ironment #0). Unless the point size and vertical spacing are
- .\" increased between the first footnote and the footer trap's being
- .\" sprung, this will keep the footnotes on the same page as the
- .\" footnoted word. But as there may be now as much as 1v of space
- .\" between the footnote and the bottom margin, which looks HIDEOUS,
- .\" we use the number register "fs" to mark where the footer trap
- .\" would REALLY go, and just space to it when it comes time to put
- .\" out the footnotes.
- .de fd \" dump footnotes
- .nr gs 1v \" get a measure of 1 line in env #0
- .ev 1 \" switch to footnote environment
- .nr gs +2v \" min of 2 lines of footnotes
- . \" if the number register ns > 0,
- . \" the last text line may contain a
- . \" footnote that is too big to fit;
- . \" this checks for such a note and
- . \" if so, forces the footnote into
- . \" the "fy" diversion that carries
- . \" it onto the next text page
- .ie (\\n(nsu>0)&(\\n(gsu>=\\n(.tu) 'sp \\n(gsu \" be sure you can get it down
- .el .if \\n(fsu>\\n(nlu 'sp \\n(fsu-\\n(nlu \" move to footnote start position
- 'nf \" don't reprocess footnotes
- 'in 0 \" don't indent them any more either
- .tf \" drop text of footnotes
- .rm tf
- .if '\\n(.z'fy' .di \" end overflow diversion, if any
- .nr fc 0 \" re-init footnote count
- .ev \" return to usual environment
- ..
- .de fn \" start footnote
- . \" look for nested footnotes -- ILLEGAL
- .ie \\n(if>0 .er "footnote within footnote"
- .el .da tf \" append footnote to footnote diversion
- .nr if +1 \" increment level of footnoting
- .nr fc +1 \" one more footnote on this page
- .if \\n(fc=1 .nr fp -1v \" The reason for this "fudge factor"
- . \" is that there is no way to force
- . \" NROFF/TROFF to invoke a macro at
- . \" the end of each line. At times,
- . \" the trap boundary will not match up
- . \" with the bottom of a line, so the
- . \" "fo" trap which is set at 2320 may
- . \" not be triggered until 2340 -- and
- . \" then the footnote won't fit. This
- . \" gives some slack so the footnote is
- . \" more likely to fit. *sigh*
- .ev 1 \" enter footnote environment
- .if \\n(fc=1 .fs \" drop separator if first footnote
- .br \" flush out any previous line in footnote
- .fi \" process footnote in fill mode
- ..
- .de ef \" end footnote
- .br \" flush out the line in footnote
- .ie \\n(if<=0 .er "end footnote has no corresponding begin footnote"
- .el \{\
- . nr if -1 \" decrement level of footnoting
- . nr fg 2v \" remember this for repositioning fo
- . ev \" back to usual environment
- . if \\n(if=0 \{\
- . di \" end of footnote proper
- . nr fp -\\n(dnu \" "fo" will be moved at least up this far
- . nr fs -\\n(dnu \" increase size of footnote
- . ch fo \\n(fpu \" reposition "fo" trap (first guess)
- . \" the first part of the "ie" clause
- . \" is taken in the special case
- . \" described above
- . ie (\\n(fc=1)&((\\n(nlu+1v+\\n(fgu)>=(\\n(.pu-\\n(bmu)) \{\
- . nr ns \\n(dnu \" suppress footnote separator
- . \" since this footnote contains it
- . \" keep "fo" from being invoked twice
- . ch fo \\n(.pu+1i
- . fo \" force the page out AT ONCE
- . nr ns 0 \" re-enable footnote separator
- . \}
- . \" footnote won't fit completely
- . \" invoke the footer trap but
- . \" don't worry about the footnote
- . \" separator (it's already there)
- . el .if (\\n(nlu+1v)>=(\\n(.pu+\\n(fpu) \{\
- . \" as before we must reposition the
- . \" "fo" trap to prevent "fo" from
- . \" being invoked twice
- . ch fo \\n(.pu+1i
- . fo \" force the page out AT ONCE
- . \}
- . \}
- .\}
- ..
- .de fs \" drop footnote separator
- . \" only if not already dropped
- .if \\n(ns=0 \l'1i'
- .nr ns 0 \" in case footnotes are over 1 page long
- ..
- .de fx \" process footnote overflow
- .if \\n(fc .di fy \" stuff them in the right place
- ..
- .de fz \" deposit footnote overflow
- .fn \" treat it as a footnote
- .nf \" it's already been processed
- .in 0 \" and indented
- .fy \" "fx" put it here
- .ef \" end the footnote
- ..
- .\" **********
- .\" the ones after here are user-invoked (like "fn" and "ef" above)
- .\" title, author, etc.
- .de mt \" main title
- \&
- .sp |\\n(mtu \" space
- .ft 3 \" in bold
- .ps \\n(ps+2p \" large point size and
- .vs \\n(vs+2p \" vertical spacing
- .ce 1000 \" center the title
- .nr t2 1 \" space it
- ..
- .de au \" author
- .nr t2 0 \" spacing here
- .sp 2v \" space
- .ft 2 \" in italics
- .ps \\n(ps \" usual point size and
- .vs \\n(vs \" vertical spacing
- .ce 1000 \" center the name(s)
- ..
- .de ai \" author's institution
- .if \\n(t2 .sp 2v \" space after a title
- .nr t2 0 \" institution
- .ft 2 \" in italics
- .ps \\n(ps \" usual point size and
- .vs \\n(vs \" vertical spacing
- .ce 1000 \" center the name(s)
- ..
- .de bt \" begin text macro
- .nr t2 0 \" hold it here
- .nr it +1 \" mark as called
- .ce 0 \" end any centering
- .sn 3v \" a little bit of space
- ..
- .\" paragraph
- .de si \" start indented section
- .nr lo \\n(lm \" remember the current level
- .nr lm +1 \" go to the next level
- .ie '\\$1'' .nr l\\n(lm \\n(l\\n(lo+5n \" if no arg, indent 5n
- .el .nr l\\n(lm \\$1n \" otherwise, indent that much
- ..
- .de ei \" end indent
- .nr lm -1 \" down one level
- .if \\n(lm<0 .nr lm 0 \" make sure you don't go too far
- ..
- .de pg \" plain old paragraph
- .if !\\n(it .bt \" end the title and such
- .sn \\n(pdu \" inter-paragraph spacing
- .ft 1 \" reset a few things (paranoia)
- . \" these ONLY if not in footnote
- .ie \\n(if=0 \{\
- . ps \\n(ps \" reset point size
- . vs \\n(vs \" reset vertical spacing
- . ne 1v+\\n(.Vu \" slightly more than 1 line
- .\}
- .el \{\
- . ps \\n(ps-2p \" reset point size
- . vs \\n(vs-2p \" reset vertical spacing
- .\}
- .in \\n(l\\n(lmu \" stop any indenting
- .ce 0 \" stop any centering
- .if !'\\$1'L' .if !'\\$1'l' .ti +\\n(piu \" indent the sucker
- ..
- .de lp \" labelled paragraph
- .pg l \" reset paragraph
- .if \\n(.$>1 .nr li \\$2 \" if indent given use it
- .in +\\n(liu \" indent for paragraph
- .ti -\\n(liu \" force first line NOT to indent
- .ta +\\n(liu \" for the label
- \&\\$1\t\c
- .if \\w'\\$1'u>=(\\n(l\\n(lmu+\\n(liu) .br \" don't overwrite
- ..
- .\" The following two macros (hu & hn) have been modified for ELM usage.
- .\" If the macros have text as part of the macro call, the text will be
- .\" increased in size by two points. After printing the text, the font
- .\" will be returned to normal, otherwise the font will be left bold.
- .\"
- .\" section
- .de hu \" header, unnumbered
- . \" format: .hu [text]
- .if !\\n(it .bt \" end the title and such
- .br \" force out previous line
- .b
- .ie \\n(hP .ps \\n(hP
- .el .ps \\n(ps
- .ie \\n(hv .vs \\n(hv
- .el .vs \\n(vs
- .in \\n(l\\n(lmu \" stop any indenting
- .sn \\n(hsu \" inter-section spacing
- .ne 3v+\\n(.Vu \" slightly more than 3 lines
- .fi \" process the text, too
- .if \\n(.$>=1 \{\
- .ps +2
- \\$1
- .\}
- .if \\n(.$>=2 \\$2
- .if \\n(.$>=3 \\$3
- .if \\n(.$>=4 \\$4
- .if \\n(.$>=5 \\$5
- .if \\n(.$>=6 \\$6
- .if \\n(.$>=7 \\$7
- .if \\n(.$>=8 \\$8
- .if \\n(.$=9 \\$9
- .if \\n(.$>=1 \{\
- .ps -2
- .br
- .ft 1
- .\}
- ..
- .de hn \" header, numbered
- . \" format: .hn [level] [text]
- .if !\\n(it .bt \" end the title and such
- .br \" force out previous line
- .b
- .ie \\n(hP .ps \\n(hP
- .el .ps \\n(ps
- .ie \\n(hv .vs \\n(hv
- .el .vs \\n(vs
- .in \\n(l\\n(lmu \" stop any indenting
- .sn \\n(hsu \" inter-section spacing
- .ne 3v+\\n(.Vu \" slightly more than 3 lines
- .fi \" process the text, too
- .ie !'\\$1'' .nr hn \\$1
- .el .nr hn 1
- .ie \\n(hn>0 .nr hn -1
- .el .nr hn 0
- .ie \\n(hn=0 \{\
- . nr h0 +1 \" add 1 to main section header
- . nr h1 0 \" zap remaining section numbers
- . nr h2 0 \" zap remaining section numbers
- . nr h3 0 \" zap remaining section numbers
- .ie \\n(.$>=2 \{\
- .ps +2
- \\n(h0.
- .ps -2
- .\}
- .el \\n(h0.
- .\}
- .el .ie \\n(hn=1 \{\
- . nr h1 +1 \" add 1 to the section header
- . nr h2 0 \" zap remaining section numbers
- . nr h3 0 \" zap remaining section numbers
- .ie \\n(.$>=2 \{\
- .ps +2
- \\n(h0.\\n(h1.
- .ps -2
- .\}
- .el \\n(h0.\\n(h1.
- .\}
- .el .ie \\n(hn=2 \{\
- . nr h2 +1 \" add 1 to the section header
- . nr h3 0 \" zap remaining section numbers
- .ie \\n(.$>=2 \{\
- .ps +2
- \\n(h0.\\n(h1.\\n(h2.
- .ps -2
- .\}
- .el \\n(h0.\\n(h1.\\n(h2.
- .\}
- .el \{\
- . nr h3 +1 \" add 1 to the section number
- .ie \\n(.$>=2 \{\
- .ps +2
- \\n(h0.\\n(h1.\\n(h2.\\n(h3.
- .ps -2
- .\}
- .el \\n(h0.\\n(h1.\\n(h2.\\n(h3.
- .\}
- .if \\n(.$>=2 \{\
- .ps +2
- \\$2
- .\}
- .if \\n(.$>=3 \\$3
- .if \\n(.$>=4 \\$4
- .if \\n(.$>=5 \\$5
- .if \\n(.$>=6 \\$6
- .if \\n(.$>=7 \\$7
- .if \\n(.$>=8 \\$8
- .if \\n(.$>=9 \\$9
- .if \\n(.$>=2 \{\
- .br
- .ft 1
- .ps -2
- .\}
- ..
- .\" displays (no floats, thank God!)
- .de sd \" start display
- . \" look for nested displays -- ILLEGAL
- .ie \\n(id>0 .er "display within display"
- .el \{\
- . ie '\\$1'c' .nr sf 1 \" center the sucker
- . el .nr sf 0 \" don't center it
- .\}
- .sn \\n(pdu \" a little bit of space
- .ev 2 \" switch to display environment
- .nf \" what you type is what you get
- .if \\n(id=0 .di dd \" start saving text
- .rs \" don't eat leading space
- .nr id +1 \" increment level of display
- ..
- .de ed \" end display
- .br \" flush line
- .ie \\n(id<=0 .er "end display has no corresponding begin display"
- .el \{\
- . nr id -1 \" decrement level of display
- . if \\n(id=0 \{\
- . di \" end diversion
- . fi \" resume filling
- . in -\\n(piu \" dedent
- . ev \" pop environment
- . ne \\n(dnu \" be sure you have room
- . nf \" don't reprocess display
- . rs \" don't eat leading space
- . zi \" save indents
- . ie \\n(sf .in (\\n(llu-\\n(dlu)/2u \" center on the line length
- . el .in +\\n(piu \" indent the sucker
- . dd \" drop display
- . yi \" restore indents
- . \}
- .\}
- .fi \" resume filling
- .sn \\n(pdu \" a little bit of space
- ..
- .\" **********
- .\" fonts -- if argument(s), apply only to first
- .de b \" bold (font 3)
- .ie \\n(.$>0 \\&\\$3\\f3\\$1\\fP\\$2
- .el .ft 3
- ..
- .de i \" italics (font 2)
- .ie \\n(.$>0 \\&\\$3\\f2\\$1\\fP\\$2
- .el .ft 2
- ..
- .de r \" roman (font 1)
- .ft 1 \" just restore it
- ..
- .de bi \" bold italics (embolden font 2)
- \\&\\$3\c
- \\kb\\f2\\$1\\fP\\h'|\\nbu+2u'\\f2\\$1\\fP\\$2
- ..
- .\" **********
- .\" point sizes -- if argument(s), apply only to first
- .de sm \" reduce point size by 2
- .ie \\n(.$>0 \\&\\$3\\s-2\\$1\\s0\\$2
- .el .ps -2
- ..
- .de is \" increase point size by 2
- .ie \\n(.$>0 \\&\\$3\\s+2\\$1\\s0\\$2
- .el .ps +2
- ..
- .de nl \" return to normal size
- .ps \\n(ps \" just reset the point size
- ..
- .\" **********
- .\" handy force space/inhibit more space macros
- .de sn \" space, then turn on nospace mode
- .sp \\$1 \" space
- .ns \" ignore any more space requests
- ..
- .de sr \" force out space
- .rs \" turn on spacing mode
- .sp \\$1 \" space
- ..
- .\" **********
- .\" end of text and error macros
- .de et \" end of text macro
- . \" this: (1) flushes rest of line
- . \" (2) trips the footer, taking
- . \" care of footnotes
- .sp \\n(.pu
- . \" check for open displays or footnotes
- .if \\n(id>0 .er "unfinished display"
- .if \\n(if>0 .er "unfinished footnote"
- . \" this one means an -mn bug (*sigh*)
- .if !'\\n(.z'' .er "diversion \\n(.z not closed"
- ..
- .de er \" print error message
- . \" flag it as an error
- .ds ws "** ERROR **
- . \" if you have it, give the file name
- .if !'\\*(.f'' .as ws " file \\*(.f,
- . \" put out the line number
- .as ws " line \\n(.c
- . \" and finally the error message
- .tm \\*(ws: \\$1
- ..
- .\" **********
- .\" macros in this section are VERY specific to the news documentation
- .de pa \" protocol appellation (darn names!)
- \\&\\$3\\f2\\$1\\fP\\$2
- ..
- .de ng \" news group name
- \\&\\$3\\f3\\$1\\fP\\$2
- ..
- .de cn \" computer name
- \\&\\$3\\f2\\$1\\fP\\$2
- ..
- .de hf \" header field
- \\&\\$3\\*(lq\\$1\\*(rq\\$2
- ..
- .de cf \" contents of field
- \\&\\$3\\*(lq\\$1\\*(rq\\$2
- ..
- .de qc \" quote control char (command)
- \\&\\$3\\f3<\\s-2\\$1\\s0>\\fP\\$2
- ..
- .de qp \" quote printing char (command)
- \\&\\$3\\f3\\$1\\fP\\$2
- ..
- .de op \" option
- \\&\\$3\\f3\\$1\\fP\\$2
- ..
- .\" **********
- .\" trademarked names
- .de pd \" print "PDP-11"
- .ie \\n(p1 \\&\\$2\\s-1PDP\\s0-11\\$1
- .el \{\
- . nr p1 +1 \" mark footnote as dropped
- \\&\\$2\\s-1PDP\\s0-11\\*(rg\\$1
- . fn \" put out the footnote
- \\&\\*(rgPDP-11 is a registered trademark of Digital Equipment Corporation.
- . ef \" short and sweet ...
- .\}
- ..
- .de ux \" print "UNIX"
- .ie \\n(ux \\&\\$2\\s-1UNIX\\s0\\$1
- .el \{\
- . nr ux +1 \" mark footnote as dropped
- \\&\\$2\\s-1UNIX\\s0\\*(rg\\$1
- . fn \" put out the footnote
- \\&\\*(rgUNIX is a registered trademark of UNIX Systems Laboratories.
- . ef \" short and sweet ...
- .\}
- ..
- .de xw \" print "X Window System"
- .ie \\n(xw \\&\\$2X Window System\\$1
- .el \{\
- . nr xw +1 \" mark footnote as dropped
- \\&\\$2X Window System\\*(TM\\$1
- . fn \" put out the footnote
- \\&\\*(TMX Window System is a trademark of the Massachusetts Institute of Technology.
- . ef \" short and sweet ...
- .\}
- ..
- .de vx \" print "VAX"
- .ie \\n(vx \\&\\$2\\s-1VAX\\s0\\$1
- .el \{\
- . nr vx +1 \" mark footnote as dropped
- \\&\\$2\\s-1VAX\\s0\\*(rg\\$1
- . fn \" put out the footnote
- \\&\\*(rgVAX is a trademark of Digital Equipment Corporation.
- . ef \" short and sweet ...
- .\}
- ..
- .\" **********
- .\" set up string and number registers
- . \" set up for the date
- .if \n(mo=1 .ds mo January
- .if \n(mo=2 .ds mo February
- .if \n(mo=3 .ds mo March
- .if \n(mo=4 .ds mo April
- .if \n(mo=5 .ds mo May
- .if \n(mo=6 .ds mo June
- .if \n(mo=7 .ds mo July
- .if \n(mo=8 .ds mo August
- .if \n(mo=9 .ds mo September
- .if \n(mo=10 .ds mo October
- .if \n(mo=11 .ds mo November
- .if \n(mo=12 .ds mo December
- .ds dy "\*(mo \n(dy, 19\n(yr
- .if \n(dw=1 .ds dw Sunday
- .if \n(dw=2 .ds dw Monday
- .if \n(dw=3 .ds dw Tuesday
- .if \n(dw=4 .ds dw Wednesday
- .if \n(dw=5 .ds dw Thursday
- .if \n(dw=6 .ds dw Friday
- .if \n(dw=7 .ds dw Saturday
- . \" NROFF dependencies
- .if n \{\
- . \" string registers
- . ds rg (R)
- . ds TM (tm)
- . ds ct "
- . ds lq "
- . ds rq "
- . ds Q \&"
- . ds U \&"
- . ds q \&'
- . ds u \&'
- . ds f1 "\*(dy
- . \" number registers
- . nr hs 1v \" space before section header
- . nr pd 1v \" inter-paragraph spacing
- . nr bm 1.0i \" height of bottom margin
- .\}
- . \" NROFF dependencies
- .if t \{\
- . \" string registers
- . ds rg \\u\\s-2\\(rg\\s0\\d
- . ds TM \\u\\s-4\\f1TM\\fP\\s0\\d
- . ds ct \\(co
- . ds lq ``
- . ds rq ''
- . ds Q ``
- . ds U ''
- . ds q `
- . ds u '
- . \" number registers
- . nr hs 1v \" space before section header
- . nr pd 0.3v \" inter-paragraph spacing
- . nr bm 1.0i+1v \" height of bottom margin (wacky laser)
- .\}
- . \" these are the same for [NT]ROFF
- .ds dg \(dg
- .ds vr "News Version B2.11
- .ds pv "News macros 1.5
- .ds h1 - % -
- .nr bt 0.5i+1v \" bottom of page to footer
- .nr cm 0 \" no cut marks
- .nr fc 0 1 \" init footnote count
- .nr fl 5.5i \" footnote line length
- .nr fp 0-\n(bmu \" fo macro trap location
- .nr h0 0 \" init section header level 0
- .nr h1 0 \" init section header level 1
- .nr h2 0 \" init section header level 2
- .nr h3 0 \" init section header level 3
- .nr id 0 \" 1 in display
- .nr if 0 \" 1 in keep
- .nr it 0 \" 1 when beyond title, etc.
- .nr li 5n \" indent for labelled paragraph
- .nr ll 6.5i \" line length
- .nr lm 0 \" left margin
- .nr l0 0 \" first indent level
- .nr mt 1.5i+1v \" title goes down this far
- .nr pi 5n \" regular paragraph indent
- .nr po 1.0i \" page offset
- .nr ps 10 \" point size
- .nr tm 1.0i \" height of top margin
- .nr tt 0.5i-0.5v \" top of page to header
- .nr p1 0 \" no PDP-TM message yet
- .nr ux 0 \" no UNIX-TM message yet
- .nr vx 0 \" no VAX-TM message yet
- .nr xw 0 \" no XWindow-TM message yet
- .nr vs 12 \" vertical spacing
- .\" set things up
- .\" DSINC changes for XROFF
- .nr f1 1
- .nr f2 1
- .nr s1 10
- .nr s2 10
- .nr v1 12
- .nr v2 12
- .ps 10
- .vs 12
- .\" DSINC end changes for XROFF
- .po \n(pou \" set page offset
- .ps \n(ps \" set previous, current
- .ps \n(ps \" point sizes
- .vs \n(vs \" set previous, current
- .vs \n(vs \" vertical spacings
- .ll \n(llu \" set line length
- .lt \n(llu \" set title line length
- .ev 1 \" *** footnote environment
- .ps \n(ps-2p \" set previous, current
- .ps \n(ps-2p \" point sizes
- .vs \n(vs-2p \" set previous, current
- .vs \n(vs-2p \" vertical spacings
- .ll \n(flu \" set line length
- .lt \n(flu \" set title line length
- .ev \" *** pop environment
- .ev 2 \" *** footnote environment
- .ps \n(ps \" set previous, current
- .ps \n(ps \" point sizes
- .vs \n(vs \" set previous, current
- .vs \n(vs \" vertical spacings
- .ll \n(llu \" set line length
- .lt \n(llu \" set title line length
- .ev \" *** pop environment
- .\" now set internal registers (for the first header section)
- .nr f1 \n(.f \" saved font #1
- .nr f2 \n(.f \" saved font #2
- .nr s1 \n(.s \" saved point size #1
- .nr s2 \n(.s \" saved point size #2
- .nr v1 \n(.v \" saved vertical spacing #1
- .nr v2 \n(.v \" saved vertical spacing #2
- .\" install traps
- .wh 0i hd \" position header trap
- .wh -\n(bmu fo \" position footer trap
- .wh \n(.pu+1i fx \" put footnote overflow trap here
- .ch fx -\n(bmu \" move it over fo
- .wh -\n(btu pf \" print the bottom margin here
- .em et \" at end of file, call et
- .\" couple of miscellaneous requests
- .bd S 3 3 \" embolden special font chars if B
- .hy 2 \" don't hyphenate last lines
--- 0 ----
Index: elm2.4.ME+.122-cvs/doc/Users.guide
*** elm2.4.ME+.121/doc/Users.guide 2002-01-26 13:14:45.000000000 +0200
--- /tmp/5240-very-long-file-name-NULL-comes-in-here--XXXXXXXXX 2005-07-09 12:57:23.000000000 +0300
***************
*** 1,1102 ****
- .\" @(#)$Id: Users.guide,v 1.2 1998/10/20 19:57:20 hurtta Exp $
- .\"
- .\" Users guide to the ELM mail system.
- .\" format with:
- .\" 'tbl Users.guide | troff tmac.n - > Users.fmtd'


- .\"
- .\" Elm is now in the public trust.
- .\"

- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust

- .\"
- .\"
- .tm I trust we've run this through "tbl" first...


- .\" Define the big box macro for troff
- .de eb
- .sp -1
- .nf
- .ie t \{\
- \h'-.5n'\L'|\\nau-1'\l'\\n(.lu+1n\(ul'\L'-|\\nau+1'\l'|0u-.5n\(ul'
- .\}
- .el \{\
- \h'-.5n'\l'\\n(.lu+1n'
- .\}
- .fi
- ..

- .\" Define break line for user interaction displays
- .de bl
- .ie t .tl '\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-'''
- .el .tl '-----------------------------------------------------------------'''
- ..


- .po 1i
- .ds h0
- .ds h1
- .ds h2
- .ds f0
- .ds f1
- .ds f2
- .nr Hy 1
- .nr Pt 1
- .nr Pi 0
- .lg 0
- .nf
- .na
- .rs
- .za

- .\" This will keep the nroff version of the title page on one sheet.
- .if t .sv |2.0i
- .ce 99


- .ps 20
- .ss 18
- .vs 12

- \f3The Elm Users Guide\f1


- .sp 3
- .ps 12
- .ss 14
- .vs 14

- \f2A painless introduction to electronic mail
- using the \f3Elm\fP mail system\f1


- .sp 3
- The Elm Mail System
- (Version 2.4)
- .sp 2
- Syd Weinstein, Elm Coordinator
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm

- .fi
- .ad
- .ps 8
- .if t .vs 9
- .sp 4
- \f3ABSTRACT\f1


- .ce 0
- .sp

- .in +1i
- .ll -1i
- While various UNIX utilities have been designed to
- take advantage of the CRT screen
- (rather than line-oriented systems)
- electronic mail systems haven't \*Qcaught the wave\*U.
- This document
- presents Elm, a sophisticated
- full-screen mail system for interactive use.
- Elm offers all the features of
- \f2/bin/mail\f1, \f2Berkeley Mail\f1, \f2uumail\f1, \f2NMail\f1 and
- the AT&T Mail family of UNIX mailers (namely \f2PMX/TERM\f1) in a
- unified and intuitive fashion.
- .br
- .ll +1i
- .in -1i
- .sp |9.0i
- .ce 99


- .ps 12
- .ss 14
- .vs 14

- \s18\f3\*(ct\f1\s12 Copyright 1986,1987 by Dave Taylor
- \s18\f3\*(ct\f1\s12 Copyright 1988-1992 by The USENET Community Trust
- .fi
- .ad
- .bp 1
- .sv 5v
- .ps 14
- .ss 12
- .vs 16

- \f3Elm Users Guide\f1
- .ds h0 "Elm Users Guide


- .ds h1
- .ds h2 "Version 2.4
- .ds f0 "October 1, 1992
- .ds f1
- .ds f2 "Page %
- .sp
- .ps 10
- .ss 12
- .vs 12
- (The Elm Mail System, \*(h2)
- .sp
- \*(f0
- .sp 2
- Syd Weinstein
- Datacomp Systems, Inc.
- 3837 Byron Road
- Huntingdon Valley, PA 19006-2320
- .sp
- email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm
- .sp 2
- Derived from
- \*QThe Elm Mail System, Version 2.0\*U
- by

- Dave Taylor
- Intuitive Systems
- Mountain View, California
- email: taylor\s-1@\s+1intuitive.com or limbo\s-1!\s+1taylor
- .ce 0
- .sp 3
- .hn 1 Introduction
-
- The

- .ux
- operating system was originally written on a small PDP machine,
- to work with teletypewriters. Consequently, all the original software for
- the operating system was written with a \*Qtty\*U in mind;
- with line oriented interfaces, rather than screen oriented.
-
- Gradually this began to change, and, with the addition of the Berkeley \f2vi\f1
- visual shell to the \f2ed\f1
- line editor, the trend began to be brought to the attention of
- .ux
- systems designers.
- And yet, this transition has seemed
- too subtle for many software engineers,
- and so precious few
- .ux
- programs are available
- designed to exploit the entire CRT screen.
-
- Consequently, after becoming more and more disenchanted
- with the existing electronic mail facilities (\f2binmail\f1
- and \f2Berkeley Mail\f1)
- Dave Taylor decided to undertake creating his own system.
- Once the ball was rolling it became quite
- difficult not to keep enhancing it, especially as he and
- the Elm Development Group
- became more and more familiar with various different mail
- systems, but the result, we hope, is a solid, unified interface
- to electronic mail suitable for almost any environment.
-
- One thing that sets the Elm mail system off from
- other packages is that it
- comes with an extensive documentation set, including;
- \f2The Elm Users Guide\f1, which you're holding,
- \f2The Elm Reference Guide\f1,
- \f2The Elm Alias Users Guide\f1,
- \f2The Elm Filter System Users Guide\f1,
- \f2The Elm Forms Mode Guide\f1,
- and \f2The Elm Configuration Guide\f1.
- The names of each indicate
- what they discuss (not unreasonably).
-
- This particular document contains;
- this introduction, a tutorial session with the mailer, a
- discussion of non-interactive uses of Elm,
- a brief foray into the Elm utilities,
- and finally, credits and references.
-
- \f2The Elm Reference Guide\f1 contains a
- much more in-depth discussion of all the possible options
- available within the Elm environment, including


- the \f2.elm/elmrc\f1 file,

- the available outbound mail processing features,
- a section for expert users, suggestions
- on debugging strange installations, and
- many other useful topics.
-
- \f2The Elm Alias Users Guide\f1 is the place
- to go to learn about the format of the \f2.elm/aliases.text\f1
- file and the associated data files, system aliases, and other
- related topics.
-
- One of the more innovative features of Elm is
- the ability to transmit and receive \*Qforms\*U (as
- defined by the AT&T Mail system). To learn about
- how to create and reply to forms you should refer
- to \f2The Elm Forms Mode Guide\f1.
-
- If you find yourself getting too much mail delivered in
- your mailbox, you might be a good candidate for the
- \f2filter\f1 program. To learn more about what
- this program is and how to use it please
- consult \f2The Elm Filter System Users Guide\f1.
-
- Finally, if you're working with the actual source code
- and are interested in what all the locally configured
- options are and mean, please see
- \f2The Elm Configuration Guide\f1. It is
- strongly suggested that all system administrators
- and people installing the system print out the
- local \f2sysdefs.h\f1 file and have it handy while
- reading the configuration guide.
-
- The recommended order of learning the Elm
- system is to skim this guide until you feel
- confident enough to start up the program. Once
- that's reached, \f2use it!\f1 Soon you'll find
- areas that you need to expand into, and you can
- achieve that by going into the options
- screen within Elm and changing your
- user level accordingly.
- After a while, sit down again and read through this
- guide. You should have a couple of \*Qaha!\*U intuitive
- flashes. After another period of time, you're
- ready to delve into the real power of the system
- and read the reference guide. The other manuals
- should be read as the need arises.
-
- In any case, the system should be usable without reading
- \f2any\f1 of the documentation!
-
- Any comments or problems with any of the documentation or the program
- itself are welcome; if you can't get electronic mail to the Elm
- Development Group, please feel free instead to drop me a note via the
- overland mail address in the title page.
- .br
- .ne 20
- .sp
- .hn 1 The Main System
-
- Upon entry to the program, the main screen will be
- displayed as below:
-
- .\" display start, constant width, remember loc for BOX


- .ft CW
- .zf

- .ps 9


- .mk a
- .sp

- .ce
- Mailbox is \'/usr/mail/mymail\' with 15 messages [Elm 2.4PL22]
- .TS
- r l n l l l l.
- \-> N 1 Apr 24 Larry Fenske (49) Hello there
- N 2 Apr 24 jad@hpcnoe (84) Chico? Why go there?
- E 3 Apr 23 Carl Smith (53) Dinner tonight?
- NU 4 Apr 18 Don Knuth (354) Your version of TeX...
- N 5 Apr 18 games (26) Bug in cribbage game
- A 6 Apr 15 kevin (27) More software requests
- 7 Apr 13 John Jacobs (194) How can you hate RUSH?
- U 8 Apr 8 decvax!mouse (68) Re: your Usenet article
- 9 Apr 6 root (7)
- O 10 Apr 5 root (13)
- .TE
- .sp
- .ce 3
- You can use any of the following commands by pressing the first character;
- d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit
- To read a message, press <return>. j = move down, k = move up, ? = help
- Command : @
- .sp
- .\" draw box, proportional Roman font back, display end
- .eb
- .ps 10
- .ft 1
-
- There are a number of things to notice about this, the main screen;
-
- .lp \h'12p'\(bu 20p
- Most likely, on your computer the message currently \*Qactive\*U will be
- displayed in an inverse bar rather than being delimited by the two
- character arrow as here. It's nothing to worry about; displaying
- inverse video is just quite difficult on printable guides!
-
- .lp \h'12p'\(bu 20p
- The first line on the screen always displays the name of the current folder,
- the number of messages in the folder, and the current Elm version number.
-
- .lp \h'12p'\(bu 20p
- The arrow (\*Q\->\*U) or inverse video bar will always
- indicate which is the current message.
-
- .lp \h'12p'\(bu 20p
- The first field that appears associated with each message is
- the status field. This can be blank (as with most of the
- ones above, or can have any combination of the following:
-
- The first character signifies temporary status:
-
- .ta .75iC 102p
- .nf
- E for an \f2expired\f1 message
- N for a \f2new\f1 message
- O for an \f2old\f1 (i.e. not new but not read) message
- D for a \f2deleted\f1 message
-
- The second character which signifies permanent status:
-
- C for \f2confidential\f1 mail
- U for \f2urgent\f1 mail
- P for a \f2private\f1 message
- A for messages that have an \f2action\f1 associated with them
- F for a \f2form\f1 letter
- M for a \f2MIME\f1 compliant message
- .fi
-
- The third character of the status field can be a \*q+\*u to
- indicate that the message is \f2tagged\f1 too.
-
- .lp \h'12p'\(bu 20p
- Continuing from left to right, the next field is the message
- number. For the most part you can ignore these unless you want
- to quickly move to a specific message (as we'll see later).
-
- .lp \h'12p'\(bu 20p
- The date associated with each message is typically
- the date the person actually \f2sent\f1 the message.
-
- .lp \h'12p'\(bu 20p
- The next field displayed indicates whom the message is from.
- Elm will try to display the \f2full name\f1 of the person who
- sent the message, rather than the their return address or computer login.
- Some systems don't generate the correct headers, though, hence
- messages like numbers 2 and 8, where it's their return address.
-
- .lp \h'12p'\(bu 20p
- The number in parentheses is the total number of lines in the message.
-
- .lp \h'12p'\(bu 20p
- The final field is the subject of the message. Notice
- that messages might not have any subject, as in messages #9 and #10.
-
- .lp \h'12p'\(bu 20p
- A maximum of ten messages are displayed at one time.\s-2\u1\d\s0
- .fn
- 1. On screens with more than 24 lines, additional messages are
- displayed automatically. Furthermore, if you choose to turn off
- the menu display, you can have an even greater number
- displayed.
- .ef
- Further into the document we'll learn how to change \*Qpages\*U in the folder.
-
- .lp \h'12p'\(bu 20p
- The three line menu display will always
- indicate the relevant commands. There are actually two possible
- menus that can be displayed, based
- on the \f2user level\f1 as set from either the options screen or
- the \f2.elm/elmrc\f1
- file. The alternate menu, for more advanced users,
- lists more options;


- .sp
- .ft CW
- .zf

- .ps 9
- .ce 3
- |=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
- a)lias, C)copy, c)hange folder, d)elete, e)dit, f)orward, g)roup reply, m)ail,
- n)ext, o)ptions, p)rint, r)eply, s)ave, t)ag, q)uit, u)ndelete, or e(x)it
- .ps 10
- .ft 1
-
- .lp \h'12p'\(bu 20p
- Finally, the \*q@\*u character indicates where the cursor would be, awaiting
- your input.
-
- .sp
- .in 0
- The typical action at this point is to use the \f2<return>\f1
- key to read the current message, which will clear the
- screen and display the current message:
-
- .ne 10


- .ft CW
- .zf

- .ps 9
- .mk a
- .tl ' Message 1/15 from Larry Fenske''Apr 24 \'87 at 8:45 pm edt'
- .tl ''Hello there''
- .nf
- Dave,
- Just wanted to drop you a brief note to see what was going on with
- you this afternoon. Life here has been the usual fun and games...
- Ah well, off to the great wilds beyond the desk!
- Larry
- Command (\'i\' to return to index): @
- .fi


- .eb
- .ft 1

- .ps 10
-
- Before we go further with our example, however, let's very
- quickly look at all the functions available from the main
- screen:
- .\" ensure we get a reasonable chunk of this table on the page...
- .br
- .ne 10
- .lp \h'18p'\f3Command 90p
- Action\f1
-
- .lp "\h'18p'<return> or <space>" 90p
- Read current message.
- .lp \h'18p'| 90p
- Pipe current message or tagged messages to specified system command.
- .lp \h'18p'! 90p
- Shell escape.
- .lp \h'18p'$ 90p
- Resynchronize folder.
- .lp \h'18p'? 90p
- Help mode \(em any key pressed will be explained.
- .lp "\h'18p'+ or <right>" 90p
- Display next page of subjects.
- .lp "\h'18p'\- or <left>" 90p
- Display previous page of subjects.
- .lp \h'18p'= 90p
- Set current message to 1.
- .lp \h'18p'* 90p
- Set current to last message.
- .lp \h'18p'<number><return> 90p
- Set current message to number \f2number\f1.
- .lp \h'18p'/ 90p
- Search for pattern in subject/from lines.
- .lp \h'18p'// 90p
- Search for pattern in entire folder.
- .lp \h'18p'< 90p
- Scan message for calendar entries.\s-2\u2\d\s0
- .fn
- 2. Some sites might opt not to have the calendar feature available.
- .ef
- .lp \h'18p'> 90p
- A synonym for \f3s\f1 \(em \f3save\f1 message or messages.
- .sp
- .lp \h'18p'a 90p
- Alias, change to \*Qalias\*U mode.
- .lp \h'18p'b 90p
- Bounce \(em remail message (see \f3f\f1 \(em \f3forward\f1 too).
- .lp \h'18p'C 90p
- Copy current message or tagged messages to folder.
- .lp \h'18p'c 90p
- Change to another folder.
- .lp \h'18p'd 90p
- Delete current message.
- .lp \h'18p'<control>-D 90p
- Delete all messages matching specified pattern.
- .lp \h'18p'e 90p
- Edit current folder, resyncing upon re-entry.\s-2\u3\d\s0
- .fn
- 3. Some sites might opt not to have the edit folder feature available.
- .ef
- .lp \h'18p'f 90p
- Forward message to specified user.\s-2\u4\d\s0
- .fn
- 4. The difference between \f3forward\f1 and \f3bounce\f1 is rather
- subtle \(em a forwarded message is \f2from\f1 you, with the
- original message included, whereas a bounced message
- is still from the original sender.
- .ef
- .lp \h'18p'g 90p
- Group reply \(em reply to everyone who received the current message.
- .lp \h'18p'h 90p
- Display message with headers.
- .lp \h'18p'i 90p
- Return to index screen after displaying message.
- .lp \h'18p'J 90p
- Set current to next message.
- .lp "\h'18p'j or <down>" 90p
- Set current to next message not marked deleted.
- .lp \h'18p'K 90p
- Set current to previous message.
- .lp "\h'18p'k or <up>" 90p
- Set current to previous message not marked deleted.
- .lp \h'18p'l 90p
- Limit displayed messages based on the specified criteria.
- .lp \h'18p'<control>-L 90p
- Rewrite screen.
- .lp \h'18p'm 90p
- Mail to arbitrary user(s).
- .lp \h'18p'n 90p
- Read current message, then increment to next message not marked deleted.
- .lp \h'18p'o 90p
- Alter current system options.
- .lp \h'18p'p 90p
- Print current message or tagged messages.
- .lp \h'18p'q 90p
- Quit \(em maybe prompting for messages to delete, store, or keep.
- .lp \h'18p'Q 90p
- Quick quit \(em like quit but without prompting.
- .lp \h'18p'r 90p
- Reply to the author of current message.
- .lp \h'18p's 90p
- Save current message or tagged messages to folder.
- .lp \h'18p't 90p
- Tag current message.
- .lp \h'18p'<control>-T 90p
- Tag all messages matching specified pattern.
- .lp \h'18p'u 90p
- Undelete current message.
- .lp \h'18p'<control>-U 90p
- Undelete all messages matching specified pattern.
- .lp \h'18p'x 90p
- Exit \(em prompt if mailbox changed, don't record as read, don't save.
- .lp \h'18p'X 90p
- Exit immediately \(em don't record as read, don't save.
- .in 0
- .sp
- .ne 10
- But let's go back to our example and see some of this at
- work, shall we?
- .sp
- We were reading the message from Larry and the screen looked
- like:
-
- .ne 10


- .ft CW
- .zf

- .ps 9
- .mk a
- .tl ' Message 1/15 from Larry Fenske''Apr 24 \'87 at 8:45 pm edt'
- .tl ''Hello there''
- .nf
- Dave,
- Just wanted to drop you a brief note to see what was going on with
- you this afternoon. Life here has been the usual fun and games...
- Ah well, off to the great wilds beyond the desk!
- Larry
- Command (\'i\' to return to index): @
- .fi


- .eb
- .ft 1

- .ps 10
-
- From this point let's go ahead and reply to the message. To
- do this, we can use the \f3reply\f1 command.
- To do this, we type \*qr\*u and the last few lines change to
- something like:


- .ft CW
- .zf

- .ps 9
- .sp
- .bl
- .tl 'Command: Reply to message''Copy message? (y/n) @ '
- .sp 2
- .ft 1
- .ps 10
- To which we decide that we don't need the text of this message in
- our new one, so we reply \f2no\f1 by pressing the \*qn\*u key. The
- bottom part of the window then changes to:


- .ft CW
- .zf

- .ps 9
- .sp
- .bl
- .ie t .tl 'Command: Reply to message'To: Larry Fenske ''
- .el .tl 'Command: Reply to message''To: Larry Fenske '
- .tl 'Subject: Re: Hello there@'''
- .ft 1
- .ps 10
- .sp 2
- At this point we can either decide to enter a new subject (you could
- use either \f2backup word\f1 (\f2<control>-W\f1) or \f2backup line\f1 (this
- is the same as your \*Qline kill\*U character,
- \f2<control>-X\f1 or \f2<control>-U\f1
- usually)) or go with this one by pressing \f2<return>\f1. We'll
- just leave it as it is and press \f2<return>\f1, changing the
- screen to:
- .ps 9


- .ft CW
- .zf

- .sp
- .bl
- .ie t .tl 'Command: reply to message'To: Larry Fenske ''
- .el .tl 'Command: reply to message''To: Larry Fenske '
- .tl 'Subject: Re: Hello there'''
- .tl 'Copies to: @'''
- .ps 10


- .ft 1
- .sp

- There's no one we want to have receive copies of this message, so we'll
- just press \f2<return>\f1 again to indicate this.
-
- Once you've answered these questions the program will put you into
- your favorite editor and let you compose a response. When you're
- done it then asks:
- .ps 9


- .ft CW
- .zf

- .sp
- .tl 'Please choose one of the following options by parenthesized letter: @'''
- .tl ''e)dit message, edit h)eaders, s)end it, or f)orget it.''
- .ft 1
- .ps 10
- .sp
- Since we're just interested in sending the message out, we'll
- choose the \f3send\f1 option and press \*qs\*u. The program
- then sends the message, indicating that by the line below
- saying:
- .sp
- .ps 9


- .ft CW
- .zf

- Sending mail...
- .ft 1
- .ps 10
- .sp
- then putting at the bottom of the screen ``Mail sent!'' and giving us
- the prompt:
- .ps 9


- .ft CW
- .zf

- .sp
- .bl
- .tl 'Command:''(Use \'i\' to return to index.)''


- .sp
- .ps 10

- .ft 1
- Pretty easy, isn't it? Let's continue by going back to the main
- screen pressing the \*qi\*u key to request the \f2index\f1. The
- screen is then:
-
- .ne 20


- .ft CW
- .zf

- .ps 9


- .mk a
- .sp

- .ce
- Mailbox is \'/usr/mail/mymail\' with 15 messages [Elm 2.4PL22]
- .TS
- r l r l l l l.
- \-> 1 Apr 24 Larry Fenske (49) Hello there
- N 2 Apr 24 jad@hpcnoe (84) Chico? Why go there?
- E 3 Apr 23 Carl Smith (53) Dinner tonight?
- NU 4 Apr 18 Don Knuth (354) Your version of TeX...
- N 5 Apr 18 games (26) Bug in cribbage game
- A 6 Apr 15 kevin (27) More software requests
- 7 Apr 13 John Jacobs (194) How can you hate RUSH?
- U 8 Apr 8 decvax!mouse (68) Re: your Usenet article
- 9 Apr 6 root (7)
- O 10 Apr 5 root (13)
- .TE
- .sp
- .ce 3
- You can use any of the following commands by pressing the first character;
- d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit
- To read a message, press <return>. j = move down, k = move up, ? = help
- Command : @
- .sp
- .\" draw box, proportional Roman font back, display end


- .eb
- .ft 1

- .ps 10
-
- Notice that the first message is no longer marked as \f2new\f1
- since we've now read it.
- .sp
- Let's go ahead and read the message from kevin (message #6) since
- it has some sort of \f2action\f1 associated with it anyway. To
- do this, we simply press the \*q6\*u key, which will change the
- bottom of the screen to:
- .sp
- .ps 9


- .ft CW
- .zf

- .tl 'Command: New Current Message''Set current message to : 6@'
- .ft 1
- .ps 10
- .sp
- We'll just press \f2<return>\f1 to move the active message
- pointer (the arrow).
- .sp
- Now we're pointing at the new message, so let's go ahead and read
- it by pressing \f2<return>\f1 again, giving us:
-
- .ne 10


- .ft CW
- .zf

- .ps 9
- .mk a
- .tl ' Message 6/15 from kevin''Apr 15 \'87 at 11:36 am pst'
- .tl ''More software requests''
- Action: please acknowledge receipt
- I don\'t suppose you have a nifty netnews reader around too, do you??
- \-\-
- kevin
- Command (\'i\' to return to index): @
- .eb


- .sp
- .ps 10

- .ft 1
-

- .br
- .ne 5

- Well, it turns out that we don't, but a friend of ours does, so
- let's \f3forward\f1 the message to them by pressing \*qf\*u:
- .ps 9


- .ft CW
- .zf

- .sp
- .tl 'Command: Forward message''Edit outgoing message (y/n) ? @ '
- .ft 1
- .ps 10
- .sp 2
- No need to edit it, so let's answer \f2no\f1 with \*qn\*u:
- .sp
- .ps 9


- .ft CW
- .zf

- .tl 'Command: Forward message''Edit outgoing message (y/n) ? No '
- .tl 'To: @'''
- .ps 10


- .ft 1
- .sp

- We type in the address of the person we're forwarding to (in
- this case


- .ft CW
- .zf

- usenet\f1) and press
- \f2<return>\f1:


- .ft CW
- .zf

- .ps 9
- .sp
- .ie t .tl 'Command: Forward message'To: usenet ''
- .el .tl 'Command: Forward message''To: usenet '
- .tl 'Subject: More software requests (fwd)@'''
- .ft 1
- .ps 10
- .sp
- To which we again press \f2<return>\f1 to take the default subject.
- Elm asks for any possible copy recipients, asks us if we're
- sure we want to send it, and shoots it off.
- .sp
- Enough mail for now, however, so we just \f3exit\f1 by pressing
- the \*qx\*u key at the \*QCommand:\*U prompt and the program drops us
- back into our shell.
- .sp
- As you can see, it's quite easy to use the Elm system, so
- rather than continue with our example, let's
- look at some other aspects of the program.


- .br
- .ne 5

- .sp
- .hn 1 Non-Interactive Uses of Elm
-
- Before we go ahead and discuss the Elm utilities, it's worth
- noting that
- there are a couple of other ways to use the main mail
- system, namely to \*Qsend only\*U and to send files (batchmail).
-
- To send a message to someone without any of the associated
- overhead of reading in a mail folder, you can invoke the
- mailer with the name(s) of the people to send to. For example:
-
- .nf
- .ti +.5i
- $ \f3elm dave_taylor\f1
- .fi
-
- Elm then prompts for Subject, Copies, and then drops
- you in your editor (defined in the \f2.elm/elmrc\f1 file) to compose
- the message. When composition is complete, the program
- verifies transmission then terminates.
-
- .ne 6
- Elm also supports batch type mailing, of files and so on,
- by using the following command:
-
- .nf
- .ti +.5i
- $ \f3elm dave_taylor < help.c\f1
- .fi
-
- which reads in the file and transmits it to the specified user.
-
- .ne 3
- A subject may be specified with \*Q\-s \f2subject\f1\*U as an option
- to Elm in either \*Qsend only\*U or \*Qbatch\*U modes, as in:
-
- .nf
- .ti +.5i
- $ \f3elm \-s "File help.c, as promised" dave_taylor < help.c\f1
- .fi
-
- .ne 3
- Elm also has an option to specify that a certain file be used as the
- initial text of the message. This makes it easier to use Elm with
- other programs that interface with a mailer. Use \*Q\-i \f2file\f1\*U as an
- option to Elm in \*Qsend only\*U mode. For example, to specify to \f2rn\f1
- to use Elm as the mailer, define the following in \f3RNINIT\f1:


-
- .ft CW
- .zf
- .nf

- .ti +.5i
- \-EMAILPOSTER="elm \-i %h \-s \\"Re: %S\\" %t"
- .fi
- .ft 1
-
- See the man page for \f2rn\f1(1) or the newsreader you use for more specific
- information.
-

- .br
- .ne 5

- .sp
- .hn 1 The Elm Utilities
-
- The Elm mail system is really much more than a single
- program for reading and writing mail. It's a unified
- environment for intelligently dealing with electronic
- correspondence. As a consequence, it contains a number of other
- programs to aid in the easy processing of \*Qemail\*U,
- including the following;
-
- .lp \h'10p'answer 1.0i
- An answering-machine transcription program. Please see the
- manual entry for more information on how to use this program.
-
- .lp \h'10p'checkalias 1.0i
- A script for checking aliases simply.
-
- .lp \h'10p'elmalias 1.0i
- A tool to obtain information on defined aliases.
-
- .lp \h'10p'listalias 1.0i
- A script to produce sorted listings of aliases.
-
- .lp \h'10p'messages 1.0i
- A script that lists the number of messages in the specified
- folder. Suitable for login scripts and such.
-
- .lp \h'10p'newmail 1.0i
- This program monitors a mailbox or set of mailboxes and can
- output notification of new mail in one of two possible
- formats; either:
-
- .ne 6


- .nf
- .ft CW
- .zf

- .ps 9
- .ti +.5i
- >> New mail from Jimmy Carter \-\- Urgent matters of state
- .br
- .ti +.5i
- >> New mail from j...@ucbvax.arpa \-\- Did I hear someone say PARTY??
- .ft 1
- .ps 10
-
- if running as \f2newmail\f1 or:


-
- .ft CW
- .zf

- .ps 9
- .ti +.5i
- Jimmy Carter \-\- Urgent matters of state
- .br
- .ti +.5i
- j...@ucbvax.arpa \-\- Did I hear someone say PARTY??
- .ft 1
- .ps 10
- .fi
-
- if running as \f2wnewmail\f1. BSD Users will find this is
- a far superior \f2biff\f1 program.
-
- .lp \h'10p'wnewmail 1.0i
- This is the same program as \f2newmail\f1, but has different
- defaults if invoked this way.
-
- .lp \h'10p'readmsg 1.0i
- This handy little program can be used in two ways. First off,
- it can be used to easily read a specific message in the
- incoming mailbox, specified by ordinal number, by a string that
- the message contains, by the metacharacter \*q$\*u which
- represents the last message in the folder, or \*q*\*u which matches
- all the messages in the folder.
-
- For example;
-
- .ti +.5i
- $ \f3readmsg 4 5 9 | lpr\f1
-
- would generate a printout, \f2sans\f1 superfluous headers, of the fourth,
- fifth and ninth messages in your mailbox.
-
- .ti +.5i
- $ \f3readmsg Carter | page\f1
-
- would be a fast way to read what \*uole Jimmy has to say, and
-
- .ti +.5i
- $ \f3readmsg \-h hear someone say\f1
-
- would list, including all the message headers, the message
- containing the string \*Qhear someone say\*U.
-
- .lp \h'10p'frm 1.0i
- Similar to the Berkeley \f2from\f1 command, this will
- give you a \*Qtable of contents\*U or a summary of either the current
- mailbox or a mailbox of your choice. It's useful to
- see what mail is pending, or what's in a mailbox.
- If used with the \*Q\-n\*U option, it will number each message
- in a way compatible with the arguments \f2readmsg\f1
- expects to get, too!
-
- .lp \h'10p'newalias 1.0i
- This is used to install new user/group aliases. Please see
- \f2The Elm Alias Users Guide\f1 for further information.
-
- .lp \h'10p'fastmail 1.0i
- Sometimes you want to have a batchmailing system that works as
- quickly as possible, not bothering with aliases or any of the
- other \*Qdeluxe\*U features of Elm. An example of this would
- be if you have a large mailing list for a newsletter, say.
- This command, \f2fastmail\f1, is designed just for that purpose.
- It avoids the lengthy startup time of Elm while still
- generating valid RFC-822\s-2\u5\d\s0 mail.
- .fn
- 5. If you don't know what RFC-822 is, don't worry about it!
- .ef
- Please see the manual entry for more information on this
- command.
- .in 0


- .br
- .ne 5

- .sp
- .hn 1 "Credits and So on \(em Elm's early years from Dave Taylor"
-
- This mailer has been evolving over the past few years with
- invaluable comments on the interface and general mail
- issues from the following people;
- Jim Davis, Steve Wolf (or should that say Steve!! Wolf!!!! perhaps?),
- Larry Fenske, Rob Sartin,
- John Dilley and Carl Dierschow.
- .sp
- For the Berkeley implementation, lots of help came from
- both John Lebovitz and Ken Stone.
- .sp
- For the Amdahl/UTS implementation, thanks to Scott McGregor and
- Stan Isaacs.
- .sp
- For the Sun problems, Dave England in Lancaster (UK) turned out to be
- \*Qbloody useful\*U, as he would no doubt say.
- .sp
- The Pyramid version is due to the work of Steve Malone
- of the University of Washington.
- .sp
- A number of other people have been amazingly disciplined at reporting
- problems and (usually, much to my relief) indicating the fixes needed,
- especially Guy Hillyer, Bruce Townsend and Eric Negaard.
- .sp
- There have been many, many others, too numerous to mention, that
- have inspired me with questions like \*QWhy can't Elm...\*U or
- \*QWhy does it ...\*U or \*QCan we make it...\*U too. A loud round of
- applause and an enthusiastic THANK YOU to you all!!
- .sp
- Also helpful was the ability to have my \*Qown\*U machine to
- close up the many many iterative loops that this software
- has gone through \(em since being on a big multi-user machine
- tends to slow it down to a standstill.
- For that, I thank Hewlett-Packard Colorado Networks Division for their
- initial support, and now HP Laboratories for the wonderful working
- environment that I have here (more than any one person is safe having,
- I suspect).
- .sp
- Mailers that have influenced the design and implementation of Elm,
- for better or worse, include the following;
-
- .lp \h'4p'\f2/bin/mail\f1 1.0i
- The most basic of mailers, this one was simply the example of how \f2not\f1
- to force the user to interact with a program.
-
- .lp "\h'4p'\f2Berkeley Mail\f1" 1.0i
- A surprisingly sophisticated mailer, especially the version with 4.3 BSD,
- \f2Berkeley Mail\f1 still suffers from the tendency to force the user to
- know too much about the system, and also lacks a friendly, non-cryptic
- interface for the large subset of the population that use
- .ux
- but aren't
- interested in becoming a \*Qhacker\*U.
-
- .lp \h'4p'\f2MH\f1 1.0i
- This is another nifty mailer. The main difference between this and the
- other mailers about is that it is a discrete set of programs rather than
- a single unified interface. This is quite useful for those people that
- receive \f2lots\f1 of mail and are willing to spend some time learning
- the intricacies of the program. It's quite powerful, but again, misses some
- of the basic friendly features the majority of users are interested in.
-
- .lp \h'4p'\f2dmail\f1 1.0i
- A sort of mutated cross between \f2MH\f1 and \f2Berkeley Mail\f1, it was
- this program that convinced me to implement the \f3limit\f1 functions.
-
- .lp \h'4p'\f2NMail\f1 1.0i
- A part of the HP AI Workstation Software Environment, this program hints
- at the power that mailers could be given to help deal with mail in a quick
- and intelligent fashion. Most of what it can do, and a lot more, are
- therefore part of Elm. Indubitably. And quite fast too!
-
- .lp \h'4p'\f2PMX/TERM\f1 1.0i
- Part of the AT&T Mail package, a single glance at this interface convinced
- me that a PC interface, with almost half of the screen taken up by a silly
- function key mapping, is most certainly \f2not\f1 the way to do things!!
- On the other hand, it also shows that the \*Qforms\*U mode can be quite
- nicely integrated into a more sophisticated mailer.
-
- .lp \h'4p'\f2fmail\f1 1.0i
- A nickel addition to the \f2/bin/mail\f1 program to add some rudimentary
- screen interface stuff, this nonetheless interesting mailer is part of
- the AT&T Toolchest.
-
- .lp \h'4p'\f2Laurel\f1 1.0i
- A program only available within Xerox PARC, this was an interesting
- early attempt at a graphics based full-screen mail program. The one,
- perhaps trivial, part of the interface I really like was the fact that
- it would \f2cross out\f1 a message that was marked for deletion. One
- day when we get real graphics and the ability to use them in
- a facility (not too) like \f2termcap\f1, perhaps Elm will do
- this too!
-
- .lp \h'4p'\f2Mailtool\f1 1.0i
- Part of the Sun distribution package, this program is a really nice
- example of what can be done by putting a smart shell on top of a dumb
- program \(em it uses \f2/bin/mail\f1 for all the \*Qdirty work\*U. Other than
- that, it's not a particularly interesting interface or mailer, and it
- certainly doesn't add much functionality!
-
- .lp \h'4p'\f2Metamail\f1 1.0i
- What can I say? This isn't even a real mailer,\s-2\u6\d\s0
- .fn
- 6. Not to be confused with the multi-media mailer, \f2metamail\f1, from
- Nathaniel Borenstein of Bellcore.
- .ef
- but is just what I dream
- of as an interface to mail in the future. A program that works sort of
- like HAL did in \f22001: A Space Odyssey\f1 \(em where it interrupts
- me as appropriate for important mail, and can answer inane and other
- queries itself according to what I teach it. Maybe Elm, by some sort
- of groupmind metamorphosis, will change into that someday. Maybe not. Maybe
- no one bothers to read this far into the document!!
-
- .in 0
- Finally, it's also been a very useful experience overall,
- confirming my beliefs that iterative software design and
- keeping a close watch on users (not to mention an open
- mind and mailbox!) improves a product manyfold. Comments,
- feedback and bug reports (and fixes!) are, of course, always welcome!


- .br
- .ne 5

- .sp
- .hn 1 "Credits and So on Part II \(em The Usenet Elm Development Group"
-
- As coordinator of the Elm Development Group, I must add to the credits.
- This group of volunteers has taken the Elm code from Dave Taylor and
- added features, made it more robust, and more portable.
- .sp
- For getting the Usenet Elm group going, for without which I wouldn't be
- writing this, thanks to Greg Hackney at Southwestern Bell Telephone Co.
- .sp
- For the Configuration system and its newer Dist 2.0 version, thanks are
- due to Larry Wall of JPL-NASA.
- .sp
- For his over two hundred sets of changes to version 2.2, Elm owes a lot
- to Rob Bernardo who was at Pacbell at that time.
- .sp
- The ability to run Elm at all on Intel 286 machines owes a lot to the
- insistent nudging of the coordinator by Chip Salzenberg,
- Chip Rosenthal, and Tim Evans.
- .sp
- For getting us the rights to use the news macros and converting all
- the documentation over to those macros, thanks to Mike Brown.
- .sp
- For pushing us into the \*u90s and forcing the issues of
- NLS and foreign language support, I thank Jan Saell of Administration & Systemkonsult AB
- along with Larry Philps of SCO Canada.
- .P
- I'd also like to thank the many current and prior members of the Elm
- development and testing groups. The list varies from time to time
- as people come and go. Also, to all the Elm users out there who
- send in patches. The group can use all the extra help it gets.
- As a postScript, if you wish to join the group, all it takes is some
- time to work on things, and to ask.
-
- Syd Weinstein, Elm Coordinator.
--- 0 ----
Index: elm2.4.ME+.122-cvs/hdrs/cs_imp.h
*** elm2.4.ME+.121/hdrs/cs_imp.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/cs_imp.h 2005-07-01 12:15:03.000000000 +0300
***************
*** 1,5 ****


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,5 ----
/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.114 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 23,29 ****
typedef void cs_add_unicodedata_to_string P_((struct string *str,


int len, const uint16 *data));

! typedef int cs_cmp_string P_((struct string *str1,struct string *str2));

typedef unsigned char *cs_stream_from_string P_((const struct string *str,
int printable,
--- 23,30 ----
typedef void cs_add_unicodedata_to_string P_((struct string *str,


int len, const uint16 *data));

! typedef int cs_cmp_string P_((const struct string *str1,
! const struct string *str2));

typedef unsigned char *cs_stream_from_string P_((const struct string *str,
int printable,
***************
*** 48,54 ****

typedef int cs_add_streambytes_to_string P_((struct string *str,

int count,
! const unsigned char *data));

typedef struct map_info * cs_find_map_type P_((const char * map_name));

--- 49,56 ----

typedef int cs_add_streambytes_to_string P_((struct string *str,

int count,
! const unsigned char *data,
! int *errors));

typedef struct map_info * cs_find_map_type P_((const char * map_name));

***************
*** 118,123 ****
--- 120,146 ----

} * cs_first_type;



+
+ #if defined(WCHAR) && defined(__STDC_ISO_10646__)

+ extern void change_system_charset P_((void));
+ extern void change_system_charset_1 P_((void));


+ #endif
+
+
+

+ extern unsigned char map_fallback_rev P_((unsigned int val, int *found));
+ extern uint16 map_fallback P_((unsigned int c));
+
+ #ifdef WCHAR
+ #include <wctype.h>
+ #include <wchar.h>
+
+ extern uint16 map_wfallback P_((wint_t c));
+ extern wchar_t map_wfallback_rev P_((unsigned int val, int *found));


+ #endif
+
+
+

#define CS_str_magic 0xF300

struct str_private_data {
***************
*** 129,135 ****
--- 152,162 ----
unsigned char *bytes;
uint16 *words;
struct mb_data *data; /* NOT VECTOR, just one structure */
+ #ifdef WCHAR
+ wchar_t *wchars;
+ #endif
} a;
+ char *lang;
};

struct state_utf8 {
***************
*** 145,150 ****
--- 172,187 ----
long value;
};

+ #ifdef WCHAR
+ #define STATE_WCHAR_magic 0xF305
+
+ struct state_wchar {
+ unsigned short magic; /* STATE_WCHAR_magic */
+
+ mbstate_t s;
+ wchar_t value;
+ };
+ #endif

struct state_private_data {
unsigned char ready;
***************
*** 152,157 ****
--- 189,197 ----
unsigned char byte;
struct state_utf8 utf8;
struct state_utf7 utf7;
+ #ifdef WCHAR
+ struct state_wchar wchar;
+ #endif
struct state_generic_1 *g1;
struct state_iso2022 *iso2022;
} a;
***************
*** 241,248 ****
map_ISO2022_ascii, map_ISO2022_ascii_latin1,
map_EUC_ascii, map_EUC_ascii_latin1;

- extern unsigned char map_fallback_rev P_((unsigned int val, int *found));
- extern uint16 map_fallback P_((unsigned int c));
extern int charset_valid_magic P_((charset_t magic));
extern void free_state_internal P_((struct charset_state **state));

--- 281,286 ----
***************
*** 282,288 ****
set_utf8, set_latin7, set_latin8, set_latin9, set_iso885916,
set_ISO2022KR, set_EUCKR,
set_ISO2022JP, set_ISO646JP, set_ISO2022JP2, set_EUCJP,
! set_ISO2022CN, set_ISO2022CNEXT, set_EUCCN;


extern void iso2022_clear_setlist P_((struct setlist *X));
--- 320,344 ----
set_utf8, set_latin7, set_latin8, set_latin9, set_iso885916,
set_ISO2022KR, set_EUCKR,
set_ISO2022JP, set_ISO646JP, set_ISO2022JP2, set_EUCJP,
! set_ISO2022CN, set_ISO2022CNEXT, set_EUCCN, set_koi8e,
! set_iso_ir_2, set_iso_ir_4, set_iso_ir_8_1, set_iso_ir_8_2,
! set_iso_ir_9_1, set_iso_ir_9_2, set_iso_ir_10, set_iso_ir_11,
! set_iso_ir_149, set_iso_ir_13, set_iso_ir_15, set_iso_ir_16,
! set_iso_ir_17, set_iso_ir_18, set_iso_ir_19, set_iso_ir_21,
! set_iso_ir_25, set_iso_ir_27, set_iso_ir_37, set_iso_ir_42,
! set_iso_ir_47, set_iso_ir_49, set_iso_ir_50, set_iso_ir_51,
! set_iso_ir_54, set_iso_ir_55, set_iso_ir_57, set_iso_ir_58,
! set_iso_ir_60, set_iso_ir_61, set_iso_ir_69, set_iso_ir_70,
! set_iso_ir_84, set_iso_ir_85, set_iso_ir_86, set_iso_ir_87,
! set_iso_ir_89, set_iso_ir_90, set_iso_ir_91, set_iso_ir_92,
! set_iso_ir_93, set_iso_ir_94, set_iso_ir_95, set_iso_ir_96,
! set_iso_ir_98, set_iso_ir_99, set_iso_ir_102, set_iso_ir_103,
! set_iso_ir_121, set_iso_ir_122, set_iso_ir_123,
! set_iso_ir_128, set_iso_ir_139, set_iso_ir_141,
! set_iso_ir_142, set_iso_ir_143, set_iso_ir_146,
! set_iso_ir_147, set_iso_ir_150, set_iso_ir_151,
! set_iso_ir_152, set_iso_ir_153, set_iso_ir_154,
! set_iso_ir_155, set_iso_ir_158, set_iso_ir_159;


extern void iso2022_clear_setlist P_((struct setlist *X));
***************
*** 475,485 ****
extern void iso2022_merge_old_info P_((struct setlist *new_setlist,
int setcount,
struct setlist *old_info));
-
/* bindata.c */

extern struct bindata_mapped_data * default_bindata P_((void));



/*
* Local Variables:
* mode:c

--- 531,555 ----
extern void iso2022_merge_old_info P_((struct setlist *new_setlist,
int setcount,
struct setlist *old_info));
/* bindata.c */

extern struct bindata_mapped_data * default_bindata P_((void));

+ /* cs_binary.c */
+
+ #ifndef ASCII_CTYPE
+ extern void cs_remove_control_locale P_((const struct string *str,
+ unsigned int repl));
+ extern unsigned char *cs_stream_from_locale P_((const struct string *str,
+ int *reslen));
+ extern int cs_s_locale_printable P_((struct charset_state *st));
+ extern unsigned char *cs_streamclip_from_locale P_((const struct string *str,
+ int *pos, int len));
+ extern int cs_find_pattern_from_locale P_((const struct string *str,
+ const struct string *pattern));
+
+ #endif
+

/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.122-cvs/hdrs/cs_terminal.h
*** elm2.4.ME+.121/hdrs/cs_terminal.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/cs_terminal.h 2005-03-13 20:37:35.000000000 +0200
***************
*** 1,4 ****
! /* $Id: cs_terminal.h,v 1.5 2004/03/27 18:31:35 hurtta Exp $ */

#define DISPLAY_STATE_magic 0xF304

--- 1,4 ----
! /* $Id: cs_terminal.h,v 1.6 2005/03/13 18:37:35 hurtta Exp $ */

#define DISPLAY_STATE_magic 0xF304

***************
*** 16,21 ****
--- 16,25 ----
enum iso2022_bank current_L; /* 32-127 */
enum iso2022_bank current_R; /* 160-255 */

+ #ifdef WCHAR
+ int wcwidth;
+ #endif
+
};

extern void free_terminal_info P_((struct display_settings **p));
Index: elm2.4.ME+.122-cvs/hdrs/defs.h
*** elm2.4.ME+.121/hdrs/defs.h 2004-08-04 20:07:34.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/defs.h 2005-07-01 12:15:03.000000000 +0300
***************
*** 1,7 ****
! /* $Id: defs.h,v 1.51 2004/07/28 17:10:12 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: defs.h,v 1.55 2005/07/01 09:15:03 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.55 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 206,211 ****
--- 206,215 ----
#define PGP_PUBLIC_KEY 4
#endif

+ /* Defineds for status1 */
+
+ #define S1_FLAGGED (1<<0)
+
/** some defines for the "type" field of the alias record **/

#define SYSTEM 1 /* bit masks, of course */
***************
*** 279,285 ****
--- 283,293 ----

#ifdef I_TIME
# include <time.h>
+ #else
+ char *ctime();
+ char *ctime();
#endif
+
#ifdef I_SYSTIME
# include <sys/time.h>
#endif
***************
*** 332,338 ****

#define first_word(s,w) (strncmp(s,w, strlen(w)) == 0)
#define first_word_nc(s,w) (strincmp(s,w, strlen(w)) == 0)
- #define ClearLine(n) MoveCursor(n,0); CleartoEOLN()
#define whitespace(c) (c == ' ' || c == '\t')
#define ok_rc_char(c) (isalnum(c) || c == '-' || c == '_')
#define ok_alias_char(c) (isalnum(c) || c == '-' || c == '_' || c == '.')
--- 340,345 ----
***************
*** 448,460 ****
NOTPLAIN_is_fallback 0x08
*/

! unsigned int unlink : 1; /* used to mark that the file should be
* unlinked after sending the attachment
*/

struct media_type * TYPE;
! char *type_opts;
! char *disposition_opts;
struct string *description;

int encoding; /* Notice: ENCODING_ILLEGAL == -1, ENCODING_* in mime.h */
--- 455,467 ----
NOTPLAIN_is_fallback 0x08
*/

! unsigned int unlink : 2; /* used to mark that the file should be
* unlinked after sending the attachment
*/

struct media_type * TYPE;
! struct mime_param * TYPE_opts;


! struct mime_param * DISPOSITION_opts;
struct string *description;

int encoding; /* Notice: ENCODING_ILLEGAL == -1, ENCODING_* in mime.h */
***************
*** 467,473 ****
struct mime_selected_handler * handler_data;

/* These next fields are only used when sending multipart messages. */
! char * pathname;
struct string * dispname;

} mime_t;
--- 474,480 ----
struct mime_selected_handler * handler_data;

/* These next fields are only used when sending multipart messages. */
! char * pathname0;
struct string * dispname;

} mime_t;
***************
*** 475,480 ****
--- 482,488 ----
struct header_rec {
int lines; /** # of lines in the message **/
int status; /** Urgent, Deleted, Expired? **/
+ int status1; /** Flagged? **/
int index_number_X; /** relative loc in file... **/
int encrypted; /** whether msg has encryption **/
int exit_disposition; /** whether to keep, store, delete **/
***************
*** 690,727 ****
* vector may be changed to install a different error handler.
*/

- char *ctime();
- char *error_description();
- char *expand_system();
- char *format_long();
- char *get_alias_address();
- char *get_arpa_date();
- char *get_ctime_date();
- char *get_date();
- char *get_token();
- char *getlogin();
- char *level_name();
- char *shift_lower();
- char *strip_commas();
- char *strip_parens();
- char *qstrpbrk();
- char *strfcpy();
- char *strtok();
- char *tail_of_string();
- char *tgetstr();
- char *pmalloc();
- char *header_cmp();
- char *safe_strdup();
-
- FILE *safeopen();
- FILE *safeopen_rdwr();
- FILE *open_end_update();
-
- malloc_t safe_malloc();
- malloc_t safe_realloc();
-
- long times();
- long ulimit();

/*
* Local Variables:
--- 698,703 ----
Index: elm2.4.ME+.122-cvs/hdrs/defs_major.h
*** elm2.4.ME+.121/hdrs/defs_major.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/defs_major.h 2005-07-06 11:52:38.000000000 +0300
***************
*** 1,7 ****
! /* $Id: defs_major.h,v 1.5 2004/03/27 18:31:35 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: defs_major.h,v 1.8 2005/07/06 08:52:38 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 55,60 ****
--- 55,61 ----
extern malloc_t realloc();
extern void exit();
extern char *getenv();
+ extern long atol();
#endif

#ifdef STRINGS
***************
*** 75,87 ****

#ifdef I_UNISTD
#include <unistd.h>
! #else
unsigned sleep();
char *index(), *rindex(); /* names will be traslated by define in config.h */
char *strcpy(), *strcat(), *strncpy(); /* more in string.h in ANSI */
long lseek();
int fseek();
#endif

/*
* Local Variables:
--- 76,97 ----

#ifdef I_UNISTD
#include <unistd.h>
! #endif
!
! #ifndef ANSI_C
unsigned sleep();
char *index(), *rindex(); /* names will be traslated by define in config.h */
char *strcpy(), *strcat(), *strncpy(); /* more in string.h in ANSI */
long lseek();
int fseek();
+ char *getlogin();
+ unsigned alarm();
+ #ifndef I_UNISTD
+ unsigned short getgid(), getuid();
#endif
+ char *cuserid();
+ #endif
+

/*
* Local Variables:
Index: elm2.4.ME+.122-cvs/hdrs/elm.h
*** elm2.4.ME+.121/hdrs/elm.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/elm.h 2005-07-01 19:05:29.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elm.h,v 1.23 2004/07/11 11:36:07 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: elm.h,v 1.26 2005/07/01 16:05:29 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 37,58 ****


static char copyright[] = {
"@(#) (C) Copyright 1986,1987, Dave Taylor\n\
@(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
! @(#) (C) Copyright 1996-2004, Kari Hurtta\n" };

/******** global variables accessable by all pieces of the program *******/


- int check_size = 0; /* don't start mailer if no mail */
-
-
- int inalias = 0; /* TRUE if in the alias menu */
- int last_current = -1; /* previous current message */
- int last_header_page = -1; /* last header page */
- int headers_per_page = 0; /* number of headers/page */
int original_umask = 0; /* original umask, for restore before subshell */
int sendmail_verbose = 0; /* Extended mail debugging */

- int nucurr = 0; /* change list or just the current pointer... */
char cur_editfile[SLEN] = {0}; /* editor buffer */

char batch_subject[SLEN] = {0}; /* subject buffer for batchmail */
--- 37,50 ----


static char copyright[] = {
"@(#) (C) Copyright 1986,1987, Dave Taylor\n\
@(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
! @(#) (C) Copyright 1996-2005, Kari Hurtta\n" };

/******** global variables accessable by all pieces of the program *******/


int original_umask = 0; /* original umask, for restore before subshell */
int sendmail_verbose = 0; /* Extended mail debugging */

char cur_editfile[SLEN] = {0}; /* editor buffer */

char batch_subject[SLEN] = {0}; /* subject buffer for batchmail */
Index: elm2.4.ME+.122-cvs/hdrs/elmlib.h
*** elm2.4.ME+.121/hdrs/elmlib.h 2004-08-30 20:28:48.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/elmlib.h 2005-07-05 20:53:37.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmlib.h,v 1.218 2004/08/24 13:06:10 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.218 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: elmlib.h,v 1.243 2005/07/05 17:53:37 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.243 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 44,50 ****
--- 44,55 ----
/* aliasdb.c */

/* fetch_alias */
+
+ #if ANSI_C
+ struct dbz;
+ #endif
extern char *next_addr_in_list P_((char **));
+ extern struct alias_rec *fetch_alias P_((struct dbz *db, char *alias));

/* mk_lockname */

***************
*** 459,466 ****
int lineno, char *filename));
extern int charset_ok_p P_((charset_t ptr));
extern int load_charset_map_info P_((charset_t *buffer, const char *data));
- extern int get_charset_map_info P_((char *buffer, const char *data,
- int size));
extern int charset_superset_of P_((charset_t charset, charset_t subset));
extern void dump_by_MIBenum P_((FILE *f));

--- 464,469 ----
***************
*** 520,527 ****
--- 523,533 ----
};

extern struct string * new_string P_((charset_t set));
+ extern struct string * new_langstring P_((charset_t set, char *lang));
extern void free_string P_((struct string **str));
extern int verify_string P_((struct string *str));
+ extern CONST char * get_string_lang P_((const struct string *str));
+ extern CONST char * get_string_MIME_name P_((const struct string *str));

extern struct string * new_string2 P_((charset_t set,
const unsigned char *data));
***************
*** 529,535 ****
extern int add_streambyte_to_string P_((struct string *str, int ch));
extern int add_streambytes_to_string P_((struct string *str,

int count,
! const unsigned char *data));

extern void add_state_to_string P_((struct string *str,
struct charset_state *ch));

--- 535,542 ----
extern int add_streambyte_to_string P_((struct string *str, int ch));
extern int add_streambytes_to_string P_((struct string *str,

int count,
! const unsigned char *data,
! int *errors));

extern void add_state_to_string P_((struct string *str,
struct charset_state *ch));

***************
*** 537,543 ****
const struct string *str2,
int printind));
extern int string_len P_((const struct string *str));
! extern int string_cmp P_((struct string *str1, struct string *str2,
int unknown_val));
extern struct string * dup_string P_((const struct string *str));
extern struct string * convert_string P_((charset_t set,
--- 544,551 ----
const struct string *str2,
int printind));
extern int string_len P_((const struct string *str));
! extern int string_cmp P_((const struct string *str1,
! const struct string *str2,
int unknown_val));
extern struct string * dup_string P_((const struct string *str));
extern struct string * convert_string P_((charset_t set,
***************
*** 588,593 ****
--- 596,603 ----
extern int can_ascii_string P_((const struct string *str));
extern void add_ascii_to_string P_((struct string *str,
const unsigned char *ascii));
+
+ #define UNICODE_BAD_CHAR 0xFFFF
extern void add_unicode_to_string P_((struct string *str,
int len,
const uint16 *vector));
***************
*** 670,677 ****
--- 680,717 ----
CONST char *const_val,
char *def_env));

+ typedef struct dt_enumerate_info ENUMERATE;
+
+ extern int give_dt_enumerate_as_int P_((struct dt_enumerate_info *ptr));
+ extern CONST char * give_dt_enumerate_as_str P_((struct dt_enumerate_info *ptr));
+ extern int set_dt_enumerate_as_str P_((struct dt_enumerate_info *ptr,
+ char *str));
+
+
+ typedef struct dt_sort_info SORT;
+
+ extern CONST char * give_dt_sort_as_str P_((struct dt_sort_info *ptr));
+ extern int give_dt_sort_as_int P_((struct dt_sort_info *ptr));
+ extern void set_dt_sort_as_int P_((struct dt_sort_info *ptr, int val));
+
/* lib/read_rc.c */

+ enum record_mode { SYSTEM_RC = 0, LOCAL_RC = 1, RC_MODE_COUNT };
+
+ extern struct elmrc_recorder * enable_recorder P_((enum record_mode mode));
+ extern int seed_history P_((FILE *F, char * filename,
+ struct elmrc_recorder *recorder));
+ extern void print_history_changed P_((FILE *F,
+ struct elmrc_recorder *recorder));
+
+
+ typedef int option_func P_((char **value, int enter,


+ int lineno, char *filename));
+

+ extern void mark_local_changed P_((void *A));
+ extern void mark_flocal_changed P_((option_func *A));
+
+
#define SLEN 256 /* length for elmrc variables ... */

extern struct locale_map_item * system_locale_map;
***************
*** 701,712 ****
extern char system_iso2022_sets[SLEN]; /* $etc/elm.iso2022sets */
extern char system_terminal_info[SLEN]; /* $etc/elm.terminalinfo */
extern char system_mail_services[SLEN]; /* $etc/elm.mailservices */
! extern char map_txtdir[SLEN]; /* $lib/elm.map.txt */
! extern char raw_map_txtdir[SLEN]; /* $lib/elm.map.txt */
! extern char map_bindir[SLEN]; /* $lib/elm.map.bin */
! extern char raw_map_bindir[SLEN]; /* $lib/elm.map.bin */
! extern char unidata_path[SLEN]; /* $lib/elm.map.bin */
! extern char raw_unidata_path[SLEN]; /* $lib/elm.map.bin */

extern char bindata_path[SLEN]; /* $lib/elm.map.bin */
extern char bindata_path_global[SLEN]; /* Used before user elm.rc is read */
--- 741,752 ----
extern char system_iso2022_sets[SLEN]; /* $etc/elm.iso2022sets */
extern char system_terminal_info[SLEN]; /* $etc/elm.terminalinfo */
extern char system_mail_services[SLEN]; /* $etc/elm.mailservices */
! extern ESTR map_txtdir_e; /* $lib/elm.map.txt */
! extern ESTR map_bindir_e; /* $lib/elm.map.bin */
! extern char unidata_path[SLEN]; /* $lib/elm.map.bin */
! extern char raw_unidata_path[SLEN]; /* $lib/elm.map.bin */
!
! extern int unstable_reverse_thread;

extern char bindata_path[SLEN]; /* $lib/elm.map.bin */
extern char bindata_path_global[SLEN]; /* Used before user elm.rc is read */
***************
*** 736,742 ****

/* *** Read from elmrc: */

! extern int alias_sortby; /* how to sort aliases */
extern int add_irt_phrase; /* In-reply-to: Add phare to in-reply-to ?
True = Do not follow RFC 2822 */
extern int add_sender_header; /* If set add Sender: header if user specifies
--- 776,782 ----

/* *** Read from elmrc: */

! extern SORT alias_sortby; /* how to sort aliases */
extern int add_irt_phrase; /* In-reply-to: Add phare to in-reply-to ?
True = Do not follow RFC 2822 */
extern int add_sender_header; /* If set add Sender: header if user specifies
***************
*** 754,769 ****
extern int pgp_askpgpsig; /* Should pgp ask userid to sign messages with? */
extern int pgp_interactive; /* Should pgp/gpg encryption/signing to be


run always on interactive mode */

! extern int pgp_sign_type; /* 0 = application/pgp


! 1 = text/plain
! 2 = text/x-pgp
! */

enum pgp_version { pgp_none = 0, pgp2 = 1, pgp5 = 2, gpg = 3,
PGP_NUM };
! extern enum pgp_version send_pgp_version; /* preferred pgp version*/
#endif
extern char attribution[SLEN]; /* attribution string for replies */
! extern int auto_attachment; /* 0 = none,
1 = application,
2 = non-text
*/
--- 794,813 ----
extern int pgp_askpgpsig; /* Should pgp ask userid to sign messages with? */
extern int pgp_interactive; /* Should pgp/gpg encryption/signing to be


run always on interactive mode */

! extern ENUMERATE pgp_sign_type; /* 0 = application/pgp


! 1 = text/plain
! 2 = text/x-pgp
! */

! extern ENUMERATE pgp_encrypt_type; /* 0 = application/pgp


! 1 = text/plain
! 2 = text/x-pgp
! */

enum pgp_version { pgp_none = 0, pgp2 = 1, pgp5 = 2, gpg = 3,
PGP_NUM };
! extern ENUMERATE send_pgp_version; /* preferred pgp version*/
#endif
extern char attribution[SLEN]; /* attribution string for replies */
! extern ENUMERATE auto_attachment; /* 0 = none,
1 = application,
2 = non-text
*/
***************
*** 788,797 ****
extern charset_t default_mimetext_charset; /* pointer to character set */
extern char raw_default_nomime_charset[SLEN]; /* name of character set */
extern charset_t default_nomime_charset; /* pointer to character set */
! extern int def_folder_status; /* 0 = Read
1 = Old


2 = New
! */

extern char config_options[SLEN]; /* which options are in o)ptions */
extern int confirm_append; /* flag: confirm append to folder? */
extern int confirm_create; /* flag: confirm create new folder? */
--- 832,841 ----
extern charset_t default_mimetext_charset; /* pointer to character set */
extern char raw_default_nomime_charset[SLEN]; /* name of character set */
extern charset_t default_nomime_charset; /* pointer to character set */
! extern ENUMERATE def_folder_status; /* 0 = Read
1 = Old


2 = New
! */

extern char config_options[SLEN]; /* which options are in o)ptions */
extern int confirm_append; /* flag: confirm append to folder? */
extern int confirm_create; /* flag: confirm create new folder? */
***************
*** 808,826 ****
extern int DSN_success; /* flag: Ask successfull DSNes */
extern char e_editor[SLEN]; /* "~e" editor... */
extern ESTR editor_e; /* editor for outgoing mail*/
! extern int env_from_source; /* 0 == forward-from,


! 1 == from,
! 2 == return-path
! */

extern char escape_char; /* '~' or something else... */
extern int force_name; /* flag: save by name forced? */
! extern int fragment_handling; /* 0 == none,


! 1 == manual,
! 2 == auto */

extern int allow_forms; /* flag: are AT&T Mail forms okay? */
extern char full_username[SLEN];/* Full username - gecos */
! extern int phrase_display_mode; /* 0 == plain, 1 = quoted */
extern char hostdomain[SLEN]; /* name of domain we're in */
extern char hostfullname[SLEN]; /* name of FQDN we're in */
extern char hostname[SLEN]; /* name of machine we're on*/
--- 852,874 ----
extern int DSN_success; /* flag: Ask successfull DSNes */
extern char e_editor[SLEN]; /* "~e" editor... */
extern ESTR editor_e; /* editor for outgoing mail*/
! extern ENUMERATE mime_parameters; /* 0 == plain


! 1 == encoded
! 2 == ascii-and-encoded
! */

! extern ENUMERATE env_from_source; /* 0 == forward-from,


! 1 == from,
! 2 == return-path
! */

extern char escape_char; /* '~' or something else... */
extern int force_name; /* flag: save by name forced? */
! extern ENUMERATE fragment_handling; /* 0 == none,


! 1 == manual,
! 2 == auto */

extern int allow_forms; /* flag: are AT&T Mail forms okay? */
extern char full_username[SLEN];/* Full username - gecos */
! extern ENUMERATE phrase_display_mode; /* 0 == plain, 1 = quoted */
extern char hostdomain[SLEN]; /* name of domain we're in */
extern char hostfullname[SLEN]; /* name of FQDN we're in */
extern char hostname[SLEN]; /* name of machine we're on*/
***************
*** 830,856 ****
extern int pgp_keeppass; /* should Elm keep the passphrase? */
#endif

extern int local_fast_lookup; /* flag: directory listing not needed
for lookup */
extern char local_sessionlock_dir[SLEN];
! extern int local_sessionlock_use_home; /* 0 == newer,


! 1 == spool
! 2 == always

! 3 == non-spool */
extern char raw_local_fs_charset[SLEN]; /* filesystem charset */
extern charset_t local_fs_charset; /* filesystem charset */
extern ESTR local_signature_e; /* local msg signature file */
extern int lockfolders; /* Lock folder when open */
extern int lock_in_copy; /* Lock folder when copied to it */
! extern char folders[SLEN]; /* folder home directory */
! extern char raw_folders[SLEN]; /* unexpanded folder home directory */
extern char extra_mailbox_dir[SLEN];
extern char raw_extra_mailbox_dir[SLEN];
extern char raw_attachment_dir[SLEN];
extern char attachment_dir[SLEN];
extern int mail_permissions; /* int: permissions for mailbox files */
extern int mini_menu; /* flag: display menu? */
! extern int message_hide_hack; /* 0 == none */


/* 1 = FOLDER INTERNAL DATA */

extern char raw_metamail_path[SLEN];
extern char metamail_path[SLEN]; /* Metamail path or "none" if no metamail */
--- 878,912 ----
extern int pgp_keeppass; /* should Elm keep the passphrase? */
#endif

+ enum { LD_NONE = 0, LD_NAME_SORT, LD_MTIME_SORT };
+ extern SORT local_dir_sortby; /* how to sort local directories */
extern int local_fast_lookup; /* flag: directory listing not needed
for lookup */
extern char local_sessionlock_dir[SLEN];
! extern ENUMERATE local_sessionlock_use_home; /* 0 == newer,


! 1 == spool
! 2 == always

! 3 == non-spool */
extern char raw_local_fs_charset[SLEN]; /* filesystem charset */
extern charset_t local_fs_charset; /* filesystem charset */
extern ESTR local_signature_e; /* local msg signature file */
extern int lockfolders; /* Lock folder when open */
extern int lock_in_copy; /* Lock folder when copied to it */
!

! #if defined(WCHAR) && defined(__STDC_ISO_10646__)

! extern PATH locale_charsets; /* Use type=unknown for these charsets
! * if system charset
! */
! #endif
!
! extern ESTR folders_e; /* folder home directory */
extern char extra_mailbox_dir[SLEN];
extern char raw_extra_mailbox_dir[SLEN];
extern char raw_attachment_dir[SLEN];
extern char attachment_dir[SLEN];
extern int mail_permissions; /* int: permissions for mailbox files */
extern int mini_menu; /* flag: display menu? */
! extern ENUMERATE message_hide_hack; /* 0 == none */


/* 1 = FOLDER INTERNAL DATA */

extern char raw_metamail_path[SLEN];
extern char metamail_path[SLEN]; /* Metamail path or "none" if no metamail */
***************
*** 864,870 ****
extern int mime_body_keywords; /* flag: if false the body is not parsed for keywords */
extern int move_when_paged; /* flag: move when '+' or '-' used? */
extern int names_only; /* flag: display names but no addrs? */
! extern int allow_no_encoding; /* 1: Allow 8bit without -B8BITMIME


* 2: Allow binary without -BBINARYMIME

* and 8bit without -B8BITMIME */

extern int allow_no_hdrencoding; /* TRUE, if header encoding is
--- 920,926 ----
extern int mime_body_keywords; /* flag: if false the body is not parsed for keywords */
extern int move_when_paged; /* flag: move when '+' or '-' used? */
extern int names_only; /* flag: display names but no addrs? */
! extern ENUMERATE allow_no_encoding; /* 1: Allow 8bit without -B8BITMIME


* 2: Allow binary without -BBINARYMIME

* and 8bit without -B8BITMIME */

extern int allow_no_hdrencoding; /* TRUE, if header encoding is
***************
*** 891,896 ****
--- 947,953 ----
extern char raw_printout[SLEN]; /* unexpanded how to print messages */
extern int prompt_after_pager; /* flag: prompt after pager exits */
extern int prompt_after_metamail; /* flag: prompt after metamail exits */
+ extern int prompt_metamail; /* flag: prompt for calling of metamil */
extern int quote_forward; /* flag: fwd'd msgs quoted like replies */
extern int readdatapercentinc; /* data percent increment during new mbox read */
extern int readmsginc; /* msg cnt increment during new mbox read */
***************
*** 903,910 ****
extern ESTR sent_mail_e; /* name of file to save copies to */
extern int set_window_title; /* flag: set (xterm?) window title and
icon name */
! extern char shell[SLEN]; /* default system shell */
! extern char raw_shell[SLEN]; /* unexpanded default system shell */
#ifdef USE_PGP
extern int pgp_noarmor; /* Should Elm display text before PGP armor */
#endif
--- 960,966 ----
extern ESTR sent_mail_e; /* name of file to save copies to */
extern int set_window_title; /* flag: set (xterm?) window title and
icon name */
! extern ESTR shell_e; /* default system shell */
#ifdef USE_PGP
extern int pgp_noarmor; /* Should Elm display text before PGP armor */
#endif
***************
*** 913,938 ****
extern int sig_dashes; /* flag: put dashes above signature? */
extern int sleepmsg; /* time to sleep for messages being overwritten on screen */

! extern int sortby; /* how to sort folders */
extern long elm_timeout; /* seconds for main level timeout */
extern int sort_thread_max_time; /* Number of days which can considered
be same thread */
! extern char temp_dir[SLEN]; /* name of temp directory */
! extern char raw_temp_dir[SLEN]; /* unexpanded name of temp directory */
#ifdef USE_PGP
extern int pgp_keeppass; /* should Elm keep the passphrase in*/
#endif
! extern int user_level; /* flag: how knowledgable is user? */
extern int use_tite; /* flag: use termcap/terminfo ti/te? */
extern int utf7_encode_optional; /* flag: Should utf7 optional direct

characters to be encoded? */

extern char v_editor[SLEN]; /* "~v" editor... */
extern int elm_filter; /* flag: weed out header lines? */
extern int send_mime_plain; /* Send text/plain US-ASCII as MIME? */
extern PATH weedlist;

#ifdef REMOTE_MBX
extern char raw_imap_charset[SLEN]; /* IMAP foldername charset */
extern int imap_fast_lookup; /* flag: skip directory listing */
extern int imap_max_dl_size; /* Maximum size of message to be
downloaded */
--- 969,1004 ----
extern int sig_dashes; /* flag: put dashes above signature? */
extern int sleepmsg; /* time to sleep for messages being overwritten on screen */

! extern SORT sortby; /* how to sort folders */
extern long elm_timeout; /* seconds for main level timeout */
extern int sort_thread_max_time; /* Number of days which can considered
be same thread */
! extern ESTR temp_dir_e; /* name of temp directory */
#ifdef USE_PGP
extern int pgp_keeppass; /* should Elm keep the passphrase in*/
#endif
! extern ENUMERATE user_level; /* flag: how knowledgable is user? */
extern int use_tite; /* flag: use termcap/terminfo ti/te? */
extern int utf7_encode_optional; /* flag: Should utf7 optional direct

characters to be encoded? */
+ #ifdef I_NETDB

+ extern int verify_domain; /* flag: Should we try check existence


+ of mail domain
+ */
+ #endif

+ extern int verify_local_address; /* flag: Should we try check existence


+ of local user
+ */

extern char v_editor[SLEN]; /* "~v" editor... */
extern int elm_filter; /* flag: weed out header lines? */
extern int send_mime_plain; /* Send text/plain US-ASCII as MIME? */
extern PATH weedlist;

+
#ifdef REMOTE_MBX
extern char raw_imap_charset[SLEN]; /* IMAP foldername charset */
+ enum { ID_NONE = 0, ID_NAME_SORT };
+ extern SORT imap_dir_sortby; /* how to sort local directories */
extern int imap_fast_lookup; /* flag: skip directory listing */
extern int imap_max_dl_size; /* Maximum size of message to be
downloaded */
***************
*** 1078,1083 ****
--- 1144,1156 ----

extern struct string * give_title_dir P_((struct folder_browser *dir,
int *entry_count));
+
+
+ /* NULL == clear message */
+ typedef void print_sort_message P_((struct string *message));
+ extern void folder_sort_dir P_((struct folder_browser *dir,


+ print_sort_message * print));
+

extern int give_edit_buffer P_((struct folder_browser *dir,
int entry, struct string **buffer,
int fill_with_entry));
***************
*** 1153,1166 ****

/* helper routines for fileio.c */
extern void start_fd_write_state P_((FILE *fd,
! struct folder_browser **dir,
! WRITE_STATE *write_state_ptr));
extern void end_fd_write_state P_((struct folder_browser **dir,
! WRITE_STATE *write_state_ptr));


/* lib/mbox.c */

#define OFF 0
#define ON 1

--- 1226,1241 ----

/* helper routines for fileio.c */
extern void start_fd_write_state P_((FILE *fd,
! struct folder_browser **dir,
! WRITE_STATE *write_state_ptr));
extern void end_fd_write_state P_((struct folder_browser **dir,
! WRITE_STATE *write_state_ptr));


/* lib/mbox.c */

+ extern int same_file P_((char *,char *));
+
#define OFF 0
#define ON 1

***************
*** 1396,1401 ****
--- 1471,1477 ----
/* lib/hdrdecode.c */

extern char * blstrpbrk P_((char *string, CONST char *set));
+ extern void append_string P_((struct string ** res, struct string *s));
extern struct string * hdr_to_string P_((int class,CONST char *buffer,
charset_t defcharset, int demime));

***************
*** 1415,1420 ****
--- 1491,1497 ----

/* lib/terminal.c */

+ extern int match_charset_name P_((charset_t cs1, charset_t cs2));
extern struct terminal_map_item * load_terminal_map P_((const char *filename, int *errors));

extern void dump_terminal_map P_((FILE *f, struct terminal_map_item *map));
***************
*** 1424,1443 ****
extern void terminal_can_switch P_((const char *terminal,
charset_t *storage,
int *n,
! int max));
!

extern screen_info_p create_terminal_info P_((void));



/* May be called from signal handler -- on that situation use
buffer specified as argument -- otherwise result is malloced

! -- *terminal_info must be alloced with create_terminal_info()
! beforehand
*/
extern char * terminal_switch_to P_((char *terminal, charset_t set,
! screen_info_p *terminal_info,
! char * buffer, int size));




/* May be called from signal handler -- on that situation use

--- 1501,1523 ----
extern void terminal_can_switch P_((const char *terminal,
charset_t *storage,
int *n,
! int max));
! extern char * terminal_set_info P_((char *terminal,
! charset_t set,
! screen_info_p terminal_info));

extern screen_info_p create_terminal_info P_((void));



/* May be called from signal handler -- on that situation use
buffer specified as argument -- otherwise result is malloced

! -- terminal_info must be alloced with create_terminal_info()
! beforehand
*/
extern char * terminal_switch_to P_((char *terminal, charset_t set,
! screen_info_p terminal_info,
! char * buffer, int size,
! int silent));




/* May be called from signal handler -- on that situation use

***************
*** 1449,1454 ****
--- 1529,1536 ----
char * buffer,
int size));

+ extern void terminal_change_system_charset P_((char *terminal));
+

/* lib/remote_mbx.c */

***************
*** 1865,1870 ****
--- 1947,1957 ----

/* syscall.c */

+ #ifdef BACKGROUD_PROCESSES
+ extern VOLATILE int handle_sigchld; /* got SIGCHLD */
+
+ #endif
+
/* options to the system_call() and start_run() procedure */
#define SY_USER_SHELL (1<<0) /* use user shell instead of /bin/sh */
#define SY_ENV_SHELL (1<<1) /* put SHELL=[shell] into environ */
***************
*** 1938,1944 ****
typedef int SR_RawState P_((void));
typedef void SR_Raw P_((int state));
typedef void SR_tty_init P_((void));
! typedef int SR_ClearScreen P_((void));
typedef void SR_PutLineS P_((struct string *S));


--- 2025,2031 ----
typedef int SR_RawState P_((void));
typedef void SR_Raw P_((int state));
typedef void SR_tty_init P_((void));
! typedef void SR_ClearScreen P_((void));
typedef void SR_PutLineS P_((struct string *S));


***************
*** 1959,2044 ****
));
extern void call_print_status_cooked P_((struct run_state *rs,int sig,int exit_code));

- /* mailer.c */
-
- extern int mailerfunc P_((char **value, int enter,
- int lineno, char *filename));
-
- typedef void sending_message_func P_((int background));
-
- extern struct mailer_info *get_mailer_info P_((void));
- extern void free_mailer_info P_((struct mailer_info **S));
-
- enum MI_query { MI_HAVE_8BITMIME = 1, MI_HAVE_BINARYMIME = 2,
- MI_HAVE_DSN = 3, MI_DONT_ADD_FROM = 4,
- MI_USE_DOMAIN = 5
- };
-
-
- extern int query_mailer_info P_((struct mailer_info *I,
- enum MI_query query));
-

- /* -1 if connection lost
- 0 if OK
- 1 if mailer reinitialized and query_mailer_info()
- need to be called again
- */

- extern int mailer_restarted P_((struct mailer_info *I));


-
- /* Should return 1 if verify succees and fields of result to be filled
- -- caller should free fields of result
- Returns 0 on failure
- */

- int verify_mailer_addr P_((struct mailer_info *I,
- CONST char *text,
- struct addr_item *result));


-
-
- /* Return NULL if no editor (and no value either) */

- extern struct mailer_env_from * mailer_get_env_from P_((struct mailer_info *I));
- extern void mailer_free_env_from P_((struct mailer_env_from **X));
- extern int env_from_changed P_((struct mailer_env_from *X));


-
- /* return temporary pointer value -- do not free
- return NULL if currently no value set (use implicit default)
- */

- extern CONST char * mailer_env_from_value P_((struct mailer_env_from *X,
- int *can_edit));
-
- extern void mailer_env_from_change P_((struct mailer_env_from *X,
- const char * value));
-
- extern struct mail_send_state *mailer_init P_((char **addr_args,
- int dsn,
- int verbose,
- struct mailer_info *info,
- struct mailer_env_from *env_from));
-
- /* Note that also mail_backend2 does freeing ... */
- extern void free_mail_send_state P_((struct mail_send_state **S));
-
-
- extern out_state_t *get_mail_outfd P_((struct mail_send_state *X));
-
- /* mail_backend2 may free pointer ... */
- extern int mail_backend2 P_((struct mail_send_state **mail_fd,
- end_handler *func,
- int encoding_top,
- char * title,
- sending_message_func *sm));
-
- /* Return mailer path or type ... */
- extern CONST char *get_mailer_path P_((struct mail_send_state *mail_fd));
-
- void init_default_mailer P_((void));
-
- #ifdef BACKGROUD_PROCESSES
- extern VOLATILE int handle_sigchld; /* got SIGCHLD */
-
- #endif
-
- extern char * kludge_addr P_((char **addr));
- extern char **argv_from_headers P_((struct mailing_headers * headers));

/* lib/id_phrase.c */

--- 2046,2051 ----
***************
*** 2081,2088 ****

/* lib/outheaders.c */

- extern char * from_addr_literal P_((struct mailer_info *mailer_info));
-
struct textual {
struct string *Textual;
int pos;
--- 2088,2093 ----
***************
*** 2098,2105 ****
int surface_len;
};

- extern void make_from_addr P_((struct expanded_address *expanded,
- struct mailer_info *mailer_info));
extern void dump_expanded_address P_((int debuglevel, const char *text,
struct expanded_address expanded));

--- 2103,2108 ----
***************
*** 2137,2145 ****
struct mailer_env_from *env_from;
};

- extern void zero_mailing_headers P_((struct mailing_headers *hdrs));
- extern void free_mailing_headers P_((struct mailing_headers *hdrs));
-
extern void import_mailheaders P_((struct mailing_headers * headers));

extern int add_expanded_addr_ P_((struct expanded_address *x,
--- 2140,2145 ----
***************
*** 2163,2168 ****
--- 2163,2171 ----
extern struct string * make_surface_addr P_((struct addr_item ITEM));
extern int check_8bit_str P_((char *str));

+
+
+
/* lib/write_hdr.c */

extern void print_EOLN P_((out_state_t *mailer,
***************
*** 2268,2285 ****

/* stringtok.c */

extern struct string_token {
uint16 special; /* unicode of special or 0 */
struct string *token;
! } * string_tokenize P_((const struct string *line));

extern void free_string_tokenized P_((struct string_token **ptr));


/* cancel.c */

! typedef void cancel_set_ttysig_f P_(());
! typedef void cancel_reset_ttysig_f P_(());
typedef void cancel_transient_f P_((struct string *x));
typedef void cancel_clear_f P_((void));

--- 2271,2292 ----

/* stringtok.c */

+ #define TOK_mail 1
+ #define TOK_mime 2
+
extern struct string_token {
uint16 special; /* unicode of special or 0 */
struct string *token;
! } * string_tokenize P_((const struct string *line,
! int flags));

extern void free_string_tokenized P_((struct string_token **ptr));


/* cancel.c */

! typedef void cancel_set_ttysig_f P_((void));
! typedef void cancel_reset_ttysig_f P_((void));
typedef void cancel_transient_f P_((struct string *x));
typedef void cancel_clear_f P_((void));

***************
*** 2297,2302 ****
--- 2304,2326 ----
extern void free_cancel P_((struct chancel_data **cd));


+ /* localmbx.c */
+
+ extern void remove_possible_trailing_spaces P_((char *string));
+ extern void mailbox_2_status P_((char * status, struct header_rec *entry));
+ extern int status_2_mailbox P_((struct header_rec *entry, char *buffer,
+ int size));
+
+ /* pmalloc.c */
+
+ extern char *pmalloc P_((int size));
+
+ /* write_rc.c */
+
+ extern int write_rc P_((char *targetfile, FILE * commentfile, int global,
+ char *actor,char *username));
+
+

/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.122-cvs/hdrs/elmutil.h
*** elm2.4.ME+.121/hdrs/elmutil.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/elmutil.h 2005-06-18 00:02:53.000000000 +0300
***************
*** 1,7 ****
! /* $Id: elmutil.h,v 1.13 2004/03/27 18:31:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! /* $Id: elmutil.h,v 1.15 2005/06/17 21:02:53 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 34,47 ****


static char copyright[] = {
"@(#) (C) Copyright 1986,1987, Dave Taylor\n@(#)\n\
@(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
! @(#) (C) Copyright 1996-2003, Kari Hurtta\n" };

/******** global variables accessable by all pieces of the program *******/

char version_buff[NLEN] = {0}; /* version buffer */

- extern char *gcos_name();
- extern char *get_full_name();

/*
* Local Variables:
--- 34,45 ----


static char copyright[] = {
"@(#) (C) Copyright 1986,1987, Dave Taylor\n@(#)\n\
@(#) (C) Copyright 1988-1992, The Usenet Community Trust\n\
! @(#) (C) Copyright 1996-2005, Kari Hurtta\n" };

/******** global variables accessable by all pieces of the program *******/

char version_buff[NLEN] = {0}; /* version buffer */


/*
* Local Variables:
Index: elm2.4.ME+.122-cvs/hdrs/hdr_imp.h
*** elm2.4.ME+.121/hdrs/hdr_imp.h 2004-03-30 19:38:43.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/hdr_imp.h 2005-05-21 20:58:30.000000000 +0300
***************
*** 71,76 ****
--- 71,82 ----
charset_t defcharset,
int replace));

+ /* ---- */
+
+ typedef int env_from_change_hook P_((struct mailer_env_from *X,


+ const char * value));

+ extern void set_env_from_change_hook P_((env_from_change_hook *hook));
+

/*
* Local Variables:
* mode:c

Index: elm2.4.ME+.122-cvs/hdrs/headers.h
*** elm2.4.ME+.121/hdrs/headers.h 2004-07-21 19:36:33.000000000 +0300
--- elm2.4.ME+.122-cvs/hdrs/headers.h 2005-07-01 19:05:29.000000000 +0300
***************
*** 1,7 ****
! /* $Id: headers.h,v 1.26 2004/07/11 11:36:07 hurtta Exp $ */

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.26 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! /* $Id: headers.h,v 1.28 2005/07/01 16:05:29 hurtta Exp $ */

/******************************************************************************

Kari E. Hurtta

unread,
Jul 22, 2005, 6:10:21 AM7/22/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122a

Elm 2.4ME+ PL122 (25)


- Is be available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

file elm-2.4ME+PL122a.patch.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-2.4ME+/elm-2.4ME+PL122a.patch.gz >
via WWW.

- Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

files elm-2.4ME+PL122a.patch.gz
for a moment.

- Is available with (3)

<URL: http://www.elmme-mailer.org/elm-2.4ME+PL122a.patch.gz >
via WWW.

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL122a.patch.gz >
via WWW.


- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL122a.patch.gz >
via WWW.

- Will available on ftp.funet.fi (or ftp.ipv6.funet.fi) (4)
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+

file elm-2.4ME+PL122a.patch.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-2.4ME+/elm-2.4ME+PL122a.patch.gz >
via WWW.

(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire. Actually
ozone.fmi.fi was scheduled to retire one year ago...

Finnish Meteorological Institute will move in September 2005 to
new house. These machines ozone2.fmi.fi (www.ozone.fmi.fi)
and ozone.fmi.fi (ftp.ozone.fmi.fi) are most likely not moved...

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)
are now on site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.

(4) Is submitted to ftp.funet.fi, directory pub/unix/incoming/elm-2.4ME+/

Changes of Elm 2.4ME+ PL122a (25) compared with Elm 2.4ME+ PL122 (25)
---------------------------------------------------------------------

- Fix initialization error on lib/read_rc.c (uses $USER
instead of $HOME) when pw_dir is NULL.

- "tried PL122 - and compiled with new openssl-0.9.8 !:

cc -I../include -I/opt/ssl/include -fPIC -O3 -c pop.c -o pop.o
In file included from /opt/ssl/include/openssl/crypto.h:131,
from /opt/ssl/include/openssl/comp.h:5,
from /opt/ssl/include/openssl/ssl.h:176,
from elmtls.h:11,
from pop.c:10:
/opt/ssl/include/openssl/ossl_typ.h:146: parse error before `2'"
"a define collision between elm and openssl seams to be
occurring! The token "STORE" is used on both sources!"
Problem noted by: Axel Reinhold <ax...@freakout.de>
> Changed order of includes.

- Do not add addresses parsed (to, from, cc) addresses twice
to header_rec. That occured when mail was not downloaded
IMAP mailbox was opened and headers was parsed second time
when mail was opened.

- Create elm.filelist and parent directories of elm.filelist
before starting subprocess on "elmregister master".

This patch is agaist Elm 2.4ME+ PL122 (25)
=========================================================================
Index: elm2.4.ME+.122a-cvs/hdrs/patchlevel.h
Prereq: 1152000000
*** elm2.4.ME+.122/hdrs/patchlevel.h 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/hdrs/patchlevel.h 2005-07-19 11:57:31.000000000 +0300
***************
*** 1,8 ****


! #define PATCHLEVEL "122 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.122
*/
! #define LAST_REPORT_TIME 1152000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Jul, 2005" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "122a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.122
*/
! #define LAST_REPORT_TIME 1153000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Jul, 2005" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.122a-cvs/README.ME+
*** elm2.4.ME+.122/README.ME+ 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/README.ME+ 2005-07-20 21:20:24.000000000 +0300
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.993 2005/07/09 08:27:49 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.999 2005/07/20 18:20:24 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.

***************
*** 13,18 ****
--- 13,46 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL122a (25) compared with Elm 2.4ME+ PL122 (25)
+ ---------------------------------------------------------------------
+
+ - Fix initialization error on lib/read_rc.c (uses $USER
+ instead of $HOME) when pw_dir is NULL.
+
+ - "tried PL122 - and compiled with new openssl-0.9.8 !:
+
+ cc -I../include -I/opt/ssl/include -fPIC -O3 -c pop.c -o pop.o
+ In file included from /opt/ssl/include/openssl/crypto.h:131,
+ from /opt/ssl/include/openssl/comp.h:5,
+ from /opt/ssl/include/openssl/ssl.h:176,
+ from elmtls.h:11,
+ from pop.c:10:
+ /opt/ssl/include/openssl/ossl_typ.h:146: parse error before `2'"
+ "a define collision between elm and openssl seams to be
+ occurring! The token "STORE" is used on both sources!"
+ Problem noted by: Axel Reinhold <ax...@freakout.de>
+ > Changed order of includes.
+
+ - Do not add addresses parsed (to, from, cc) addresses twice
+ to header_rec. That occured when mail was not downloaded
+ IMAP mailbox was opened and headers was parsed second time
+ when mail was opened.
+
+ - Create elm.filelist and parent directories of elm.filelist
+ before starting subprocess on "elmregister master".


+
Changes of Elm 2.4ME+ PL122 (25) compared with Elm 2.4ME+ PL121 (25)

--------------------------------------------------------------------

***************
*** 20,25 ****
--- 48,56 ----


lib/mailer
before applying this patch!

+ Undo Elm 2.4ME+ PL121a (25) - Elm 2.4ME+ PL121h (25)
+ patches before applying this patch.


+
WARNING: Quite lot of changes in many areas. So

please report new bugs which you observe...

Index: elm2.4.ME+.122a-cvs/doc/elmlibregister.1
*** elm2.4.ME+.122/doc/elmlibregister.1 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/doc/elmlibregister.1 2005-07-16 21:26:45.000000000 +0300
***************
*** 65,68 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003,2005 by Kari Hurtta


--- 65,68 ----
.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003-2005 by Kari Hurtta

Index: elm2.4.ME+.122a-cvs/lib/read_rc.c
*** elm2.4.ME+.122/lib/read_rc.c 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/lib/read_rc.c 2005-07-16 21:26:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.168 2005/07/05 20:44:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.168 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.169 2005/07/16 18:26:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.169 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1558,1564 ****

if (pass->pw_dir)


strfcpy(home, pass->pw_dir, sizeof home);
! else if (NULL != (cp = getenv("USER")))

strfcpy(home,cp,sizeof home);
else
strfcpy(home,"/",sizeof home);
--- 1558,1564 ----

if (pass->pw_dir)


strfcpy(home, pass->pw_dir, sizeof home);

! else if (NULL != (cp = getenv("HOME")))
strfcpy(home,cp,sizeof home);
else
strfcpy(home,"/",sizeof home);
Index: elm2.4.ME+.122a-cvs/shared_libs/tls/elmtls.h
*** elm2.4.ME+.122/shared_libs/tls/elmtls.h 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122a-cvs/shared_libs/tls/elmtls.h 2005-07-16 21:47:05.000000000 +0300
***************
*** 1,18 ****
! /* $Id: elmtls.h,v 1.17 2004/03/27 18:31:43 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

- #include "elmshared.h"
-
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/rand.h>

#ifdef REMOTE_MBX

extern struct stream_type TLS_STREAM;
--- 1,20 ----
! /* $Id: elmtls.h,v 1.18 2005/07/16 18:47:05 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/rand.h>

+
+ #include "elmshared.h"
+
+
#ifdef REMOTE_MBX

extern struct stream_type TLS_STREAM;
Index: elm2.4.ME+.122a-cvs/src/messages/header_alloc.c
*** elm2.4.ME+.122/src/messages/header_alloc.c 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/src/messages/header_alloc.c 2005-07-17 11:44:13.000000000 +0300
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.15 2005/07/01 09:15:06 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,8 ----
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.16 2005/07/17 08:44:13 hurtta Exp $";




/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 258,263 ****
--- 258,268 ----
current_header->subject = new_string(display_charset);


+
+ if (current_header->from)
+ free_addr_items(current_header->from);
+ current_header->from = NULL;
+
for (tmphdr = locate_header_by_name(parsed_headers,
"From");
tmphdr;
***************
*** 282,287 ****
--- 287,297 ----
}
}

+
+ if (current_header->to)
+ free_addr_items(current_header->to);
+ current_header->to = NULL;
+
for (tmphdr = locate_header_by_name(parsed_headers,
"To");
tmphdr;
***************
*** 304,309 ****
--- 314,323 ----
}
}

+ if (current_header->cc)
+ free_addr_items(current_header->cc);
+ current_header->cc = NULL;
+
for (tmphdr = locate_header_by_name(parsed_headers,
"Cc");
tmphdr;
Index: elm2.4.ME+.122a-cvs/src/options.c
*** elm2.4.ME+.122/src/options.c 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/src/options.c 2005-07-17 18:07:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: options.c,v 1.41 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.42 2005/07/17 15:07:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 721,737 ****
case 'r' :

var->val = - var->val;

! #if 0
! if (val == &sortby) {

PutLine0(x, y, sort_name(PAD));
! sort_one_liner(sortby->val, page);
}
! else if (var == alias_sortby) {

PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(alias_sortby,page);
}

else
- #endif
{
PutLine0(x, y, give_dt_sort_as_str(var));
menu_CleartoEOLN(page);
--- 721,735 ----
case 'r' :

var->val = - var->val;

! if (var == &sortby) {


PutLine0(x, y, sort_name(PAD));
! sort_one_liner(var->val, page);
}
! else if (var == &alias_sortby) {

PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(var->val,page);
}

else
{
PutLine0(x, y, give_dt_sort_as_str(var));
menu_CleartoEOLN(page);
Index: elm2.4.ME+.122a-cvs/utils/elmregister.c
*** elm2.4.ME+.122/utils/elmregister.c 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/utils/elmregister.c 2005-07-18 09:55:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.28 2005/07/06 11:20:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.29 2005/07/18 06:55:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1054,1060 ****
int w;
S__ status;

! FILE *fd;


struct log_entries * last = NULL;

struct stat X;
--- 1054,1060 ----
int w;
S__ status;

! FILE *fd = NULL;


struct log_entries * last = NULL;

struct stat X;
***************
*** 1120,1133 ****

}

- read_pipe = create_pipe(argc,argv,x,&PID,installer_root,register_module);
-
- fd = fdopen(read_pipe,"r");
- if (!fd) {
- fprintf(stderr,"%s: fdopen() failed\n",program_name);
- close(read_pipe);
- return 1; /* FAILURE */
- }

/* We use open instead of fopen so that we can create file
and not truncate existing file
--- 1120,1125 ----
***************
*** 1176,1182 ****
fprintf(stderr,
"%s: Failed to create or open file %s on %s: %s\n",
program_name,filelist,installer_root, LI.filename);
- fclose(fd);


return 1; /* FAILURE */

}

--- 1168,1173 ----
***************
*** 1187,1193 ****
if (! LI.file) {
fprintf(stderr,"%s: fdopen() failed\n",program_name);
close(t);
- fclose(fd);


return 1; /* FAILURE */
}

--- 1178,1183 ----
***************
*** 1200,1206 ****
"%s: File %s is not elmregister filelist\n",
program_name,LI.filename);
close(t);
- fclose(fd);


return 1; /* FAILURE */
}

--- 1190,1195 ----
***************
*** 1210,1215 ****
--- 1199,1218 ----

last = add_last(&LI);

+
+
+
+ read_pipe = create_pipe(argc,argv,x,&PID,installer_root,register_module);
+
+ fd = fdopen(read_pipe,"r");
+ if (!fd) {
+ fprintf(stderr,"%s: fdopen() failed\n",program_name);
+ close(read_pipe);


+ return 1; /* FAILURE */
+ }
+
+
+

log_copy_loop(fd,&LI,last);

remove_unlinked(&LI,installer_root,&remove_count);
***************
*** 1220,1226 ****
fprintf(stderr,


"%s: Write(?) failed on closing of file: %s\n",

program_name,LI.filename);
- fclose(fd);


return 1; /* FAILURE */
}

--- 1223,1228 ----
Index: elm2.4.ME+.122a-cvs/utils/Makefile.SH
*** elm2.4.ME+.122/utils/Makefile.SH 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/utils/Makefile.SH 2005-07-19 10:42:51.000000000 +0300
***************
*** 19,25 ****


echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.38 2005/05/21 17:58:33 hurtta Exp $
#
# Makefile for the Elm system utilities
#

--- 19,25 ----


echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.39 2005/07/19 07:42:51 hurtta Exp $


#
# Makefile for the Elm system utilities
#

***************
*** 283,289 ****


# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
.PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h \

! $(INCLDIR)/headers.h $(LIBX)


checkalias: checkalias.SH ; sh $?

--- 283,289 ----


# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
.PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h \
! $(INCLDIR)/headers.h


checkalias: checkalias.SH ; sh $?

Kari E. Hurtta

unread,
Jul 22, 2005, 6:12:06 AM7/22/05
to @posti.fmi.fi Archive
Archive-name: elm2.4ME+/PL122a.fixed

Elm 2.4ME+ PL122a (25)

- Is be available on ftp.elmme-mailer.org (or ftp.kapsi.fi)
via anonymous ftp (2)
directory elmme-mailer.org/src/elm-2.4ME+/

via WWW.

- Is available on ozone.FMI.FI (1)
via anonymous ftp
directory KEH/

files elm-2.4ME+PL122a.patch.gz
for a moment.

- Is available with (3)

<URL: http://www.elmme-mailer.org/elm-2.4ME+PL122a.patch.gz >
via WWW.

- Is available with
<URL: http://www.ozone.FMI.FI/KEH/elm-2.4ME+PL122a.patch.gz >
via WWW.


- Is available with
<URL: http://koti.welho.com/khurtta/elm-2.4ME+PL122a.patch.gz >
via WWW.

- Will available on ftp.funet.fi (or ftp.ipv6.funet.fi) (4)
via anonymous ftp
directory pub/unix/mail/elm/elm-2.4ME+

via WWW.

(1) It is currently unknown what will be done for ftp.ozone.fmi.fi
and www.ozone.fmi.fi. Also ozone.fmi.fi will retire. Actually
ozone.fmi.fi was scheduled to retire one year ago...

Finnish Meteorological Institute will move in September 2005 to
new house. These machines ozone2.fmi.fi (www.ozone.fmi.fi)
and ozone.fmi.fi (ftp.ozone.fmi.fi) are most likely not moved...

(2) Paths of ftp.elmme-mailer.org directories are subject of change.

(3) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)
are now on site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.

(4) Is submitted to ftp.funet.fi, directory pub/unix/incoming/elm-2.4ME+/

--- elm2.4.ME+.122a-cvs/hdrs/patchlevel.h 2005-07-19 11:57:31.000000000 +0300
***************
*** 1,8 ****


! #define PATCHLEVEL "122 (25)"
/* Used by Configure:

SHAREDTAG: .1.0.122
*/
! #define LAST_REPORT_TIME 1152000000
#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Jul, 2005" /* for elm -v option */
#define WHAT_STRING \

--- 1,8 ----
! #define PATCHLEVEL "122a (25)"
/* Used by Configure:
SHAREDTAG: .1.0.122
*/
! #define LAST_REPORT_TIME 1153000000


#define BUG_REPORT_ADDR "Kari Hurtta <e...@elmme-mailer.org>"

#define VERS_DATE "Jul, 2005" /* for elm -v option */
#define WHAT_STRING \

Index: elm2.4.ME+.122a-cvs/README.ME+
*** elm2.4.ME+.122/README.ME+ 2005-07-09 13:03:15.000000000 +0300

--- elm2.4.ME+.122a-cvs/README.ME+ 2005-07-20 21:20:24.000000000 +0300
***************
*** 1,4 ****
! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.993 2005/07/09 08:27:49 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.
--- 1,4 ----

! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.999 2005/07/20 18:20:24 hurtta Exp $



Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+.
Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b.

***************
*** 13,18 ****
--- 13,46 ----


Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24.
Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25.

+ Changes of Elm 2.4ME+ PL122a (25) compared with Elm 2.4ME+ PL122 (25)
+ ---------------------------------------------------------------------
+

+ - Fix initialization error on lib/read_rc.c (uses $USER
+ instead of $HOME) when pw_dir is NULL.
+
+ - "tried PL122 - and compiled with new openssl-0.9.8 !:
+
+ cc -I../include -I/opt/ssl/include -fPIC -O3 -c pop.c -o pop.o
+ In file included from /opt/ssl/include/openssl/crypto.h:131,
+ from /opt/ssl/include/openssl/comp.h:5,
+ from /opt/ssl/include/openssl/ssl.h:176,
+ from elmtls.h:11,
+ from pop.c:10:
+ /opt/ssl/include/openssl/ossl_typ.h:146: parse error before `2'"
+ "a define collision between elm and openssl seams to be
+ occurring! The token "STORE" is used on both sources!"

+ Problem noted by: Axel Reinhold <ax...@freakout.de>
+ > Changed order of includes.
+

+ - Do not add addresses parsed (to, from, cc) addresses twice
+ to header_rec. That occured when mail was not downloaded
+ IMAP mailbox was opened and headers was parsed second time
+ when mail was opened.
+
+ - Create elm.filelist and parent directories of elm.filelist
+ before starting subprocess on "elmregister master".

+
Changes of Elm 2.4ME+ PL122 (25) compared with Elm 2.4ME+ PL121 (25)

--------------------------------------------------------------------

***************
*** 20,25 ****
--- 48,56 ----


lib/mailer
before applying this patch!

+ Undo Elm 2.4ME+ PL121a (25) - Elm 2.4ME+ PL121h (25)
+ patches before applying this patch.

+
WARNING: Quite lot of changes in many areas. So

please report new bugs which you observe...

Index: elm2.4.ME+.122a-cvs/doc/elmlibregister.1
*** elm2.4.ME+.122/doc/elmlibregister.1 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/doc/elmlibregister.1 2005-07-16 21:26:45.000000000 +0300
***************

*** 65,68 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003,2005 by Kari Hurtta


--- 65,68 ----
.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003-2005 by Kari Hurtta

Index: elm2.4.ME+.122a-cvs/lib/read_rc.c
*** elm2.4.ME+.122/lib/read_rc.c 2005-07-09 13:03:15.000000000 +0300

--- elm2.4.ME+.122a-cvs/lib/read_rc.c 2005-07-16 21:26:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.168 2005/07/05 20:44:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.168 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.169 2005/07/16 18:26:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.169 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 1558,1564 ****

if (pass->pw_dir)

strfcpy(home, pass->pw_dir, sizeof home);
! else if (NULL != (cp = getenv("USER")))

strfcpy(home,cp,sizeof home);
else
strfcpy(home,"/",sizeof home);
--- 1558,1564 ----

if (pass->pw_dir)

strfcpy(home, pass->pw_dir, sizeof home);

! else if (NULL != (cp = getenv("HOME")))
strfcpy(home,cp,sizeof home);
else
strfcpy(home,"/",sizeof home);
Index: elm2.4.ME+.122a-cvs/shared_libs/tls/elmtls.h
*** elm2.4.ME+.122/shared_libs/tls/elmtls.h 2004-03-30 19:38:44.000000000 +0300
--- elm2.4.ME+.122a-cvs/shared_libs/tls/elmtls.h 2005-07-16 21:47:05.000000000 +0300
***************
*** 1,18 ****

! /* $Id: elmtls.h,v 1.17 2004/03/27 18:31:43 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

- #include "elmshared.h"
-
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/rand.h>

#ifdef REMOTE_MBX

extern struct stream_type TLS_STREAM;
--- 1,20 ----
! /* $Id: elmtls.h,v 1.18 2005/07/16 18:47:05 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/rand.h>

+
+ #include "elmshared.h"
+
+
#ifdef REMOTE_MBX

extern struct stream_type TLS_STREAM;
Index: elm2.4.ME+.122a-cvs/src/messages/header_alloc.c
*** elm2.4.ME+.122/src/messages/header_alloc.c 2005-07-09 13:03:15.000000000 +0300
--- elm2.4.ME+.122a-cvs/src/messages/header_alloc.c 2005-07-17 11:44:13.000000000 +0300
***************

*** 1,8 ****
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.15 2005/07/01 09:15:06 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,8 ----
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.16 2005/07/17 08:44:13 hurtta Exp $";




/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 258,263 ****


--- 258,268 ----
current_header->subject = new_string(display_charset);


+
+ if (current_header->from)
+ free_addr_items(current_header->from);
+ current_header->from = NULL;
+
for (tmphdr = locate_header_by_name(parsed_headers,
"From");
tmphdr;
***************
*** 282,287 ****
--- 287,297 ----
}
}

+
+ if (current_header->to)
+ free_addr_items(current_header->to);
+ current_header->to = NULL;
+
for (tmphdr = locate_header_by_name(parsed_headers,
"To");
tmphdr;

***************
*** 304,309 ****


--- 314,323 ----
}
}

+ if (current_header->cc)
+ free_addr_items(current_header->cc);
+ current_header->cc = NULL;
+
for (tmphdr = locate_header_by_name(parsed_headers,
"Cc");
tmphdr;
Index: elm2.4.ME+.122a-cvs/src/options.c
*** elm2.4.ME+.122/src/options.c 2005-07-09 13:03:15.000000000 +0300

--- elm2.4.ME+.122a-cvs/src/options.c 2005-07-17 18:07:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: options.c,v 1.41 2005/07/06 08:42:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.41 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.42 2005/07/17 15:07:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 721,737 ****
case 'r' :

var->val = - var->val;

! #if 0
! if (val == &sortby) {

PutLine0(x, y, sort_name(PAD));
! sort_one_liner(sortby->val, page);
}
! else if (var == alias_sortby) {

PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(alias_sortby,page);
}

else
- #endif
{
PutLine0(x, y, give_dt_sort_as_str(var));
menu_CleartoEOLN(page);
--- 721,735 ----
case 'r' :

var->val = - var->val;

! if (var == &sortby) {


PutLine0(x, y, sort_name(PAD));
! sort_one_liner(var->val, page);
}
! else if (var == &alias_sortby) {

PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(var->val,page);
}

else
{
PutLine0(x, y, give_dt_sort_as_str(var));
menu_CleartoEOLN(page);
Index: elm2.4.ME+.122a-cvs/utils/elmregister.c
*** elm2.4.ME+.122/utils/elmregister.c 2005-07-09 13:03:15.000000000 +0300

--- elm2.4.ME+.122a-cvs/utils/elmregister.c 2005-07-18 09:55:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.28 2005/07/06 11:20:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.29 2005/07/18 06:55:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 1054,1060 ****
int w;
S__ status;

! FILE *fd;

struct log_entries * last = NULL;

struct stat X;
--- 1054,1060 ----
int w;
S__ status;

! FILE *fd = NULL;

struct log_entries * last = NULL;

struct stat X;
***************


*** 1120,1133 ****

}

- read_pipe = create_pipe(argc,argv,x,&PID,installer_root,register_module);
-
- fd = fdopen(read_pipe,"r");
- if (!fd) {
- fprintf(stderr,"%s: fdopen() failed\n",program_name);
- close(read_pipe);
- return 1; /* FAILURE */
- }

/* We use open instead of fopen so that we can create file
and not truncate existing file
--- 1120,1125 ----
***************
*** 1176,1182 ****
fprintf(stderr,
"%s: Failed to create or open file %s on %s: %s\n",
program_name,filelist,installer_root, LI.filename);
- fclose(fd);

return 1; /* FAILURE */

}

--- 1168,1173 ----
***************
*** 1187,1193 ****
if (! LI.file) {
fprintf(stderr,"%s: fdopen() failed\n",program_name);
close(t);
- fclose(fd);

return 1; /* FAILURE */
}

--- 1178,1183 ----
***************
*** 1200,1206 ****
"%s: File %s is not elmregister filelist\n",
program_name,LI.filename);
close(t);
- fclose(fd);

return 1; /* FAILURE */
}

--- 1190,1195 ----
***************
*** 1210,1215 ****
--- 1199,1218 ----

last = add_last(&LI);

+
+
+
+ read_pipe = create_pipe(argc,argv,x,&PID,installer_root,register_module);
+
+ fd = fdopen(read_pipe,"r");
+ if (!fd) {
+ fprintf(stderr,"%s: fdopen() failed\n",program_name);
+ close(read_pipe);

+ return 1; /* FAILURE */
+ }
+
+
+

log_copy_loop(fd,&LI,last);

remove_unlinked(&LI,installer_root,&remove_count);
***************
*** 1220,1226 ****
fprintf(stderr,

"%s: Write(?) failed on closing of file: %s\n",

program_name,LI.filename);
- fclose(fd);


return 1; /* FAILURE */
}

--- 1223,1228 ----
Index: elm2.4.ME+.122a-cvs/utils/Makefile.SH
*** elm2.4.ME+.122/utils/Makefile.SH 2005-07-09 13:03:15.000000000 +0300

--- elm2.4.ME+.122a-cvs/utils/Makefile.SH 2005-07-19 10:42:51.000000000 +0300
***************
*** 19,25 ****


echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.38 2005/05/21 17:58:33 hurtta Exp $
#
# Makefile for the Elm system utilities
#

--- 19,25 ----


echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make

! # @(#)$Id: Makefile.SH,v 1.39 2005/07/19 07:42:51 hurtta Exp $


#
# Makefile for the Elm system utilities
#

***************
*** 283,289 ****


# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
.PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h \

! $(INCLDIR)/headers.h $(LIBX)


checkalias: checkalias.SH ; sh $?

--- 283,289 ----


# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
.PRECIOUS: $(INCLDIR)/defs.h $(INCLDIR)/elm.h \
! $(INCLDIR)/headers.h


checkalias: checkalias.SH ; sh $?

Message has been deleted

Kari E. Hurtta

unread,
Jul 28, 2005, 12:24:48 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.0

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 0/20 ) =========

Elm ME+ 2.5 PLalpha5

- Is be available on ftp.elmme-mailer.org (or ftp.kapsi.fi)

via anonymous ftp (1)
directory elmme-mailer.org/src/elm-ME+2.5/
files elm-ME+2.5.PLalpha5.patch.gz
and elm-ME+2.5.alpha5.tar.gz
or
<URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-ME+2.5/elm-ME+2.5.PLalpha5.patch.gz >
and <URL: http://ftp.elmme-mailer.org/elmme-mailer.org/src/elm-ME+2.5/elm-ME+2.5.alpha5.tar.gz >
via WWW.

- Will be available on ftp.funet.fi (or ftp.ipv6.funet.fi)
via anonymous ftp (4)
directory pub/unix/mail/elm/elm-ME+2.5/
files elm-ME+2.5.PLalpha5.patch.gz
and elm-ME+2.5.alpha5.tar.gz
or
<URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-ME+2.5/elm-ME+2.5.PLalpha5.patch.gz >
and <URL: http://www.nic.funet.fi/pub/unix/mail/elm/elm-ME+2.5/elm-ME+2.5.alpha5.tar.gz >
via WWW.

- Is available with (2)
<URL: http://www.elmme-mailer.org/elm-ME+2.5.PLalpha5.patch.gz >
and <URL: http://www.elmme-mailer.org/elm-ME+2.5.alpha5.tar.gz >
via WWW.

- Is available with (3)
<URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.PLalpha5.patch.gz >
and <URL: http://www.ozone.FMI.FI/KEH/elm-ME+2.5.alpha5.tar.gz >
via WWW.

(1) Paths of ftp.elmme-mailer.org directories are subject of change.

There seems to have some problems on ftp server
ftp.elmme-mailer.org (aka ftp.kapsi.fi), so perhaps that
do not work....

(2) ELM 2.4ME+ and ELM ME+ 2.5 pages (http://www.elmme-mailer.org/)


are now on site hosted by Kapsi.

On past http://www.elmme-mailer.org/ was redirected to
http://www.ozone.fmi.fi/KEH/ page. This old page still exist.

(3) It is currently unknown what will be done for ftp.ozone.fmi.fi


and www.ozone.fmi.fi. Also ozone.fmi.fi will retire. Actually
ozone.fmi.fi was scheduled to retire one year ago...

Finnish Meteorological Institute will move in September 2005 to
new house. These machines ozone2.fmi.fi (www.ozone.fmi.fi)
and ozone.fmi.fi (ftp.ozone.fmi.fi) are most likely not moved...

(4) Is submitted to pub/unix/incoming/elm-ME+2.5 -directory
on ftp.funet.fi or
<URL: http://www.nic.funet.fi/pub/unix/incoming/elm-ME+2.5/ >

For applying thich patch

Run (on directory where Configure is)

mkdir lib/mailer

Then use

patch -p1 < {this-catenated-patch}

Then check that removed files do not exists or are empty

ls -la `cat OBSOLETE `

If that lists non-empty files, patch failed.

Then remove emty files with command

rm `cat OBSOLETE `


Changes on Elm ME+ 2.5 PLalpha5 compared with Elm2.4ME+ PLalpha4
----------------------------------------------------------------

Note: You must create directory

lib/mailer
before applying this patch!

* Changes from Elm 2.4 PL122 (25)

- Removed pattern_enter()

order also when saved from Elm. [Partially E1]


- Removed offset from struct rc_save_info_rec. It is
no longer needed.

- Changed default so that term.h is only included on
Linux (and not curses.h)

- "unicode_value (uint16) can not possibly exceed 0xFFFF.
Remove the statement, that triggers a compiler warning."
From: From: Mikhail T. <m...@aldan.algebra.com>
* Patch removes ...->unicode_value > 0xFFFF -test
from cs_add_state_to_iconv() on shared_libs/iconv/iconv.c.

- utils/answer.c included some bogus aliases reading routines.
Replaced it fetch_alias(). It still is broken, but
that is little better...
Problem noted by: From: Mikhail T. <m...@aldan.algebra.com>

* Changes from Elm 2.4 PL122a (25)

- "tried PL122 - and compiled with new openssl-0.9.8 !:

cc -I../include -I/opt/ssl/include -fPIC -O3 -c pop.c -o pop.o
In file included from /opt/ssl/include/openssl/crypto.h:131,
from /opt/ssl/include/openssl/comp.h:5,
from /opt/ssl/include/openssl/ssl.h:176,
from elmtls.h:11,
from pop.c:10:
/opt/ssl/include/openssl/ossl_typ.h:146: parse error before `2'"
"a define collision between elm and openssl seams to be
occurring! The token "STORE" is used on both sources!"
Problem noted by: Axel Reinhold <ax...@freakout.de>
> Changed order of includes.

- Do not add addresses parsed (to, from, cc) addresses twice
to header_rec. That occured when mail was not downloaded
IMAP mailbox was opened and headers was parsed second time
when mail was opened.

- Create elm.filelist and parent directories of elm.filelist
before starting subprocess on "elmregister master".

- Change from Elm 2.5:
- Now "!!" on s)ave command means "last folder"
instead of ".". [E2]
- Removed some character name macros
(COMMA,SPACE,COLON) [E3]
- Added LOCK_ to INCOMING/OUTGOING -macros. [E4]
- Removed month -macros (JANUARY, ...) [E5]
- Replaced error_description() with strerror() [E7]
- Changed commands on "Mail Pre-Send Screen" and
added some headers to it: (!!) [E8]
send s => y
forget f => f, n
copy file c => p
cc header c
bcc header b
subject header s
- Added [attach ...] command similar than
[include ...]. (!2) [E9]
- Allow [include ...] to not specify encoding. [E10]
- Grouped elmrc options to sections. [E11]
- Changed CONST => const [E12]

(!!) Note that R)eply-to is not on "Mail Pre-Send Screen"
screen, because on it's place ther is R)eturn-path.
T)o was already on "Mail Pre-Send Screen" so on
it there is no change.
(!2) [attach ...] command just causes 'content-disposition:
attachment' instead of 'content-disposition: inline'.
Attachment do not go to end of mail as on Elm 2.5.

- Changed some commands on "Mail Pre-Send Screen":
dsn d => D
pgp p => P
return-path r => R
- Upper and lowercase letters do not have longer
same command on "Mail Pre-Send Screen"


- Bacause "." is no longer special on file browser
elm -f .
do not work now (actually elm -f '!!' works).
- However
elm -f ''
start folder selection (both on Elm ME+ 2.4 and
Elm ME+ 2.5).
- Replaced some catgets() with CATGETS() macro.

- Changed LOCK_(INCOMING,OUTGOING) to be
enum lock_direction instead of macro.

- Made some changes so that -Wall do not warn
so much. [Partially E6]

- Changed VOLATILE => volatile

* New elmrc options from Elm 2.4 PL122 (25)


mime-parameters
imap-dir-sortby
local-dir-sortby
locale-charsets
pgp-encrypt-type
prompt-metamail
unstable-reverse-thread
verify-domain
verify-local-address
use-mailer-library

* Removed files correspond Elm 2.4 PL122 (25) files
2.4/doc/Alias.guide
2.4/doc/Config.guid
2.4/doc/Elm.cover
2.4/doc/Form.guide
2.4/doc/Ref.guide
2.4/doc/Users.guide

* Removed files from Elm 2.4 PL122 (25)
doc/tmac.n
lib/add_site.c
lib/strtokq.c

* Added files from Elm 2.4 PL122 (25)


src/screen/subpage.c
src/screen/wrapper.c
src/screen/menu_param.c
src/screen/def_scommon.h
src/screen/scommon.c
src/screen/header.c
lib/cs_unknown.c
lib/cs_wfallback.c
charset/MAPPINGS/koi8-e.txt
lib/mailer/Makefile.SH
hdrs/mailerlib.h
lib/mailer/def_mailer.h

lib/mailer/shared_mailer.c
lib/mailer/init.c
lib/mailer/outheaders.c
lib/rc_delay.c
melib/mime_param.c
lib/write_rc.c

* Renamed file from Elm 2.4 PL122 (25)
lib/mailer.c => lib/mailer/mailer.c

Correspond quotes from Elm 2.5 PL7 Changes file:

[E1] Major change to $libdir/elmrc-info. Previously, this
was used simply as comments for annotating the elmrc.
Now, it directs the production of the elmrc.

[E2] Under the s)ave command, the cookie to mean "same as the
last folderI used" has been changed from "." to "!!".

[E3] I've dropped most of the happy macros for character
names. If you want to use ':' then say that, not COLON.

[E4] Renamed INCOMING/OUTGOING to LOCK_INCOMING/LOCK_OUTGOING.

[E5] Dropped JANUARY, FEBRUARY, ... definitions from elm_defs.h.

[E6] The entire library directory has been ANSIfied and
checked with "gcc -Wall".

[E7] The error_description() routine has been dropped, and the entire
package has been modified to use strerror(). lib/errno.c has
been modified to provide a strerror() for those systems that
lack it.

[E8] Add header fields to the send menu. Only list
to/cc/subject and any non-null fields (from Paul Close
<p...@lunch.engr.sgi.com>)

[E9] New [attach ...] command. Use exactly the same way as
[include ...]. Difference is inclusions appear in-line
with the message; attachments appear at the end.

[E10] If you omit the encoding from an [include ...] line,
Elm will guess an appropriate encoding rather than
assuming no encoding.

[E11] Major overhaul of the elmrc file. Options are now
grouped together logically rather than appearing in
alphabetical order.

[E12] The "elm_defs.h" provides for ANSI prototyping. It says:

#ifndef P_
# ifdef ANSI_C
# define P_(ARGS) ARGS
# else
# define P_(ARGS) ()
# define const
# endif
#endif


----------------------------------------------------------------------
diffstat:

2.4/doc/Alias.guide | 354 -----
2.4/doc/Config.guid | 390 ------
2.4/doc/Elm.cover | 69 -
2.4/doc/Form.guide | 402 ------
2.4/doc/Ref.guide | 2359 ------------------------------------
2.4/doc/Users.guide | 1102 -----------------
ConfTool/CharMap | 17
ConfTool/GenCharmap | 63
ConfTool/GenTerminalinfo | 4
ConfTool/LocaleMap | 12
ConfTool/Makefile | 3
ConfTool/mapfiles | 1
ConfTool/validcharset.c | 72 +
Configure | 325 -!!!
MANIFEST | 29
Makefile-1.SH | 17
Makefile.SH | 51
OBSOLETE | 10
README.ME+ | 2103 ++++++++++++++++++++++++++++++++
charset/MAPPINGS/koi8-e.txt | 226 +++
config.h.SH | 4
doc/answer.1 | 2
doc/elm.1 | 7
doc/elmlibregister.1 | 7
doc/elmrc-info | 1390 --!!!!!!!!!!!!!!!!!!!!
doc/elmrc-write.1 | 8
doc/elmregister.1 | 18
doc/terminal.info | 50
doc/tmac.n | 786 ------------
hdrs/bindata.h | 4
hdrs/cs_imp.h | 104 !
hdrs/cs_terminal.h | 6
hdrs/defs_major.h | 30
hdrs/elm_defs.h | 22
hdrs/elm_globals.h | 29
hdrs/elmlib.h | 445 +-!!!!
hdrs/hdr_imp.h | 6
hdrs/mailer_imp.h | 12
hdrs/mailerlib.h | 127 +
hdrs/mbx_imp.h | 39
hdrs/me.h | 675 ++!!!!!!!!
hdrs/melib.h | 70 !
hdrs/mime.h | 9
hdrs/ndbz.h | 14
hdrs/patchlevel.h | 11
hdrs/rc_imp.h | 30
hdrs/reghelper.h | 12
hdrs/s_aliases.h | 5
hdrs/s_elm.h | 64
hdrs/s_elmrc.h | 8
hdrs/s_me.h | 36
hdrs/save_opts.h | 593 !!!!!!!!
hdrs/shared_imp.h | 8
hdrs/unidata.h | 10
lib/MAGIC | 9
lib/Makefile.SH | 103 !
lib/add_site.c | 52
lib/aliasdb.c | 15
lib/bindata.c | 126 !
lib/can_access.c | 8
lib/can_open.c | 12
lib/cancel.c | 16
lib/charset.c | 260 +!!
lib/cs_binary.c | 592 ------!!
lib/cs_fallback.c | 5
lib/cs_iso2022.c | 85 !
lib/cs_unknown.c | 2035 +++++++++++++++++++++++++++++++
lib/cs_utf.c | 124 !
lib/cs_wfallback.c | 237 +++
lib/debug.c | 41
lib/errno.c | 56
lib/expand.c | 59
lib/file_util.c | 28
lib/forwarded.c | 9
lib/gcos_name.c | 10
lib/get_tz.c | 7
lib/getaddr.c | 106 +
lib/getarpdate.c | 8
lib/getfullnam.c | 10
lib/getword.c | 8
lib/hdrdecode.c | 107 !
lib/hdrencode.c | 102 !
lib/headers.c | 25
lib/imap.c | 204 +!!
lib/iso2022.c | 1029 +++++++++++!!!!!
lib/iso2022_map.c | 59
lib/istrcmp.c | 6
lib/ldstate.c | 9
lib/len_next.c | 8
lib/localmbx.c | 572 ++++!!!!
lib/mail_gets.c | 10
lib/mailer.c | 2131 ---------------------------------
lib/mailer/Makefile.SH | 153 ++
lib/mailer/def_mailer.h | 24
lib/mailer/init.c | 59
lib/mailer/mailer.c | 2274 +++++++++++++++++++++++++++++++++++
lib/mailer/outheaders.c | 193 +++
lib/mailer/shared_mailer.c | 154 ++
lib/mbox.c | 87 !
lib/mediatype.c | 51
lib/mmaputil.c | 8
lib/ndbz.c | 87 !
lib/okay_addr.c | 12
lib/outheaders.c | 261 ---!
lib/output.c | 80 !
lib/panic.c | 36
lib/parsarpdat.c | 6
lib/pop.c | 86 !
lib/posixsig.c | 8
lib/precompiled_sets.c | 340 !!!!!
lib/qstrings.c | 18
lib/rc_delay.c | 462 +++++++
lib/rc_handle.c | 571 +++---!!
lib/read_rc.c | 1448 ++-!!!!!!!!!!!!!!!!!!!
lib/realfrom.c | 14
lib/remote_mbx.c | 83 !
lib/rfc822tlen.c | 8
lib/safemalloc.c | 9
lib/safeopen.c | 6
lib/savefolder.c | 174 !!
lib/sb_file.c | 25
lib/sb_mem.c | 10
lib/schedule.c | 21
lib/service_list.c | 58
lib/shared.c | 133 +!
lib/shared_all.c | 59
lib/shared_base.c | 13
lib/shared_connect.c | 89
lib/shiftlower.c | 8
lib/state.c | 66 !
lib/streamsched.c | 12
lib/strfcpy.c | 16
lib/strftime.c | 32
lib/strincmp.c | 6
lib/string.c | 242 +!!
lib/stringbuffer.c | 12
lib/stringtok.c | 56
lib/striparens.c | 12
lib/strmcpy.c | 8
lib/strtokq.c | 83 -
lib/syscall.c | 53
lib/terminal.c | 414 +++!!!
lib/unicode.c | 8
lib/unidata.c | 206 !!!
lib/write_hdr.c | 16
lib/write_rc.c | 364 +++++
melib/Makefile.SH | 5
melib/def_melib.h | 31
melib/mailcap.c | 47
melib/mime_decode.c | 237 !!!
melib/mime_param.c | 2434 ++++++++++++++++++++++++++++++++++++++
melib/mime_parse.c | 166 !!
melib/mpar_multipart.c | 47
melib/mpar_rfc822.c | 6
melib/parse_util.c | 65
melib/partial.c | 48
melib/pgp_decode.c | 95 !
nls/C/C/C/s_aliases.m | 10
nls/C/C/C/s_elm.m | 152 -!!
nls/C/C/C/s_elmrc.m | 16
nls/C/C/C/s_me.m | 78 +
shared_libs/Makefile.SH | 2
shared_libs/iconv/Makefile.SH | 6
shared_libs/iconv/iconv.c | 51
shared_libs/smtp/Makefile.SH | 40
shared_libs/smtp/config | 11
shared_libs/smtp/elmsmtp.h | 5
shared_libs/smtp/smtp.c | 60
shared_libs/tls/Makefile.SH | 6
shared_libs/tls/elmtls.h | 10
shared_libs/tls/tls.c | 34
src/Makefile.SH | 44
src/a_edit.c | 10
src/a_quit.c | 41
src/a_screen.c | 152 !!
src/a_sort.c | 16
src/addr_util.c | 240 +!!
src/alias.c | 1413 ++--!!!!!!!!!!!!!!!!!
src/aliases/alias_alloc.c | 6
src/aliases/aliases.c | 9
src/aliases/astorage.c | 6
src/aliases/astorage_hash.c | 7
src/aliaslib.c | 39
src/args.c | 67 !
src/attach_menu.c | 1462 ++++++-!!!!!!!!!!!!!!!
src/browser.c | 512 +!!!!!!
src/builtin++.c | 93 !
src/calendar.c | 15
src/canceled.c | 307 +-!!!
src/date.c | 50
src/def_elm.h | 7
src/delete.c | 246 !!!
src/digest.c | 308 +!!!
src/edit.c | 18
src/editmsg.c | 68
src/elm.c | 1915 +-!!!!!!!!!!!!!!!!!!!!!!!!!!!
src/exitprog.c | 5
src/file.c | 287 !!!!
src/file_util.c | 17
src/fileio.c | 83
src/forms.c | 81 !
src/hdrconfg.c | 364 -!!!!!
src/help.c | 104 !
src/in_utils.c | 157 !!
src/init.c | 385 -!!!!!
src/leavembox.c | 21
src/limit.c | 228 !!!
src/lock.c | 15
src/mailmsg1.c | 524 +!!!!!!
src/mailmsg2.c | 681 +!!!!!!!!!
src/menu.c | 8
src/menu2.c | 122 !
src/menu_common/Makefile.SH | 7
src/menu_common/alias.c | 78 !
src/menu_common/alias_item.c | 7
src/menu_common/alias_pattern.c | 8
src/menu_common/alias_screen.c | 12
src/menu_common/def_mcommon.h | 32
src/menu_common/mailbox.c | 151 !!
src/menu_common/mailbox_item.c | 6
src/menu_common/mcommon.c | 49
src/menu_common/message_limit.c | 10
src/menu_common/message_pattern.c | 45
src/menu_common/message_screen.c | 53
src/messages/Makefile.SH | 5
src/messages/canceled_mail.c | 29
src/messages/def_messages.h | 5
src/messages/digest.c | 8
src/messages/header_alloc.c | 63
src/messages/messages.c | 6
src/messages/partial.c | 39
src/messages/storage.c | 6
src/metapager.c | 468 --!!!!!
src/mime.c | 474 -!!!!!!!
src/mime_encode.c | 113 !
src/mkhdrs.c | 6
src/newmbox.c | 89 !
src/options.c | 507 --!!!!!
src/out_utils.c | 85 !
src/partial.c | 353 +!!!!
src/pattern.c | 376 !!!!!
src/pgp.c | 135 !!
src/quit.c | 87 !
src/read_rc.c | 135 !
src/remail.c | 88 !
src/reply.c | 180 !!
src/save_opts.c | 206 --
src/savecopy.c | 25
src/screen.c | 579 !!!!!!!!
src/screen/Makefile.SH | 13
src/screen/context.c | 448 ++++!!
src/screen/curs_input.c | 115 !
src/screen/curses.c | 450 ++!!!!
src/screen/def_scommon.h | 107 +
src/screen/def_screen.h | 174 !!
src/screen/header.c | 333 +++++
src/screen/init.c | 7
src/screen/menu_param.c | 78 +
src/screen/scommon.c | 726 +++++++++++
src/screen/screen.c | 683 +++++-!!!!!
src/screen/subpage.c | 181 ++
src/screen/termbuffer.c | 8
src/screen/termcharset.c | 78 !
src/screen/termtitle.c | 8
src/screen/wrapper.c | 280 ++++
src/showmsg.c | 852 +!!!!!!!!!!!!
src/showmsg_c.c | 714 -!!!!!!!!!
src/signals.c | 14
src/sort.c | 174 !!
src/string2.c | 44
src/strings.c | 92
src/syscall.c | 249 !!!
src/utils.c | 98 !
utils/Makefile.SH | 113 !
utils/answer.c | 115 !
utils/charmapcopy.c | 11
utils/elmalias.c | 64
utils/elmbindata.c | 12
utils/elmcharset.c | 22
utils/elmlibregister.c | 286 -!!!
utils/elmrc-write.c | 287 -!!!
utils/elmregister.c | 1476 +++++++++++++-!!!!!!!!!
utils/elmstringconvert.c | 29
utils/elmterminal.c | 23
utils/elmunidata.c | 20
utils/fastmail.c | 17
utils/from.c | 141 !!
utils/newalias.c | 15
utils/newmail.c | 30
utils/prlong.c | 20
utils/readmsg.c | 49
utils/reghelper.c | 31
292 files changed, 20404 insertions(+), 10918 deletions(-), 24952 modifications(!)

Kari E. Hurtta

unread,
Jul 28, 2005, 12:29:41 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.8

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 8/20 ) =========
Index: elmME+.2.5.alpha5-cvs/lib/read_rc.c
*** elmME+.2.5.alpha4/lib/read_rc.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/read_rc.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133.4.22 2004/08/15 08:28:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133.4.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.133.4.27 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.133.4.27 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 47,56 ****
# include <sys/utsname.h>
# endif

! #define ASSIGNMENT 0

- #define SYSTEM_RC 0
- #define LOCAL_RC 1

#ifdef HAVE_CODESET
#include <langinfo.h>

--- 47,503 ----

! }
!
!

! return recorders[mode];
! }
!
! static struct hist_record * record1 P_((struct elmrc_recorder *recorder,
! struct rc_save_info_rec *X,
! char *tag));
!
! static struct hist_record * record1(recorder,X,tag)
! struct elmrc_recorder *recorder;
! struct rc_save_info_rec *X;
! char *tag;
! {
! struct hist_record *r;
!
!
! recorder->recs = safe_realloc(recorder->recs,
! sizeof (recorder->recs[0]) *
! ( recorder->rec_count + 1 ));
!
! r = & (recorder->recs[recorder->rec_count]);
!
! bzero((void *)r, sizeof (*r));
!
! r->entry = X;

! r->tag = NULL;
!

! if (tag)
! r->tag = safe_strdup(tag);
!
! r->old_line = 0;
! r->line_count = 0;
! r->changed = 0;
!
! recorder->rec_count++;
!
! return r;
! }
!
! static struct hist_record * need_record P_((enum record_mode mode,
! struct rc_save_info_rec *X,
! char *tag));
! static struct hist_record * need_record(mode,X,tag)
! enum record_mode mode;
! struct rc_save_info_rec * X;
! char *tag;
! {
! int i;
!

! char keyword[SLEN];


! char * rest = NULL;
! int assig = 0;
!
! int negate = 0;
!
! lineno++;
!
! if (!buffer) /* EOF */

! break;
!

! if (buffer[0] == '#' /* comment */
! || r < 1) /* empty line */
! continue;
!
! rest = split_keyword(buffer,r,keyword, sizeof keyword,
! &tag,&assig);
!
!
! if (tag && !keyword[0]) {
! strfcpy(current_tag, tag, sizeof current_tag);
!
! if (rest[0] && '#' != rest[0]) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIgnoredLine,
! "Rest of line ignored after \"%s:\" on line %d on file %s"),
! tag, lineno,filename);
! ok = 0;

! }
!

! } else if (!keyword[0]) {
! if (prev_type != NULL) {
!
! if (RCTYPE_magic != prev_type->dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"do_rc",
! "Bad prev_type",0);
!
! if (rec) {
! rec->old_line = safe_realloc(rec->old_line,
! sizeof(rec->old_line[0]) *
! ( rec->line_count + 1));
!
! rec->old_line [ rec->line_count ] = safe_strdup(rest);
! rec->line_count++;
!
! /* Preserve seeded data when printing again */
! rec->changed++;
! }

! }
!

! } else if (assig) {
!
! if (tag || current_tag[0]) {
! struct rc_save_info_rec * rc_options = NULL;

! int rc_option_count = 0;
!

! if (!tag)
! tag = current_tag;
! else
! ignored = 0;
!
! #ifdef USE_DLOPEN
! if (give_options(tag,&rc_options,&rc_option_count)) {
!
! prev_type = locate_option(rc_options,rc_option_count,
! keyword,rest,filename,
! &negate);

! ignored = 0;
!

! if (!prev_type) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyTagInElmrc,
! "I can't understand keyword \"%s\" (section %s) in line %d in \"%s\" file"),
! keyword, tag,lineno,filename);
! ok = 0;
! continue;

! }
!

! } else if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIgnoredSection,
! "Keywords on section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);
! ok = 0;
! }
! #else
! if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSharedIgnoredSection,
! "Shared libraries not supported. Section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);
! ok = 0;
! }
! #endif

!
! } else {
!

! prev_type = locate_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
! keyword,rest,filename,&negate);
!
! if (!prev_type) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyInElmrc,
! "I can't understand keyword \"%s\" in line %d in \"%s\" file"),
! keyword, lineno,filename);
! ok = 0;
! continue;

! }
!
! }
!

! rec = record1(recorder,prev_type,tag);
! if (rec) {
! if (rec->line_count)
! panic("RC PANIC",__FILE__,__LINE__,"do_rc",
! "Bad prev_type",0);
!
! rec->old_line = safe_malloc(sizeof(rec->old_line[0]));
!
! rec->old_line[0] = safe_strdup(rest);
!
! rec->line_count = 1;
! rec->changed++;
! }
! } else {
! prev_type = NULL;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadLineInElmrc,
! "Keyword \"%s\" without = -character in line %d in \"%s\" file"),
! keyword, lineno,filename);
! ok = 0;

!
! }
! }
!

! if (-1 == r) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTooLongLine,
! "%30s: %d: Too long line: %.30s..."),
! filename,lineno+1,
! buffer ? buffer : "<not available>");
! ok = 0;
! }
!
! if (ferror(F)) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReading,
! "Error reading from %.50s"),
! filename);
! ok = 0;
! }
!
! if (buffer)
! free(buffer);
!
!
! return ok;

! }
!

! static void print_history_record P_((FILE *F,struct hist_record *x));
! static void print_history_record(F,x)
! FILE *F;
! struct hist_record *x;
! {
! int i;
!
! fprintf(F,"\n%s = %s\n",
! x->entry->name,
! x->old_line[0]);

!

! for (i = 1; i < x->line_count; i++) {
! fprintf(F,"\t%s\n",
! x->old_line[i]);

! }
!
!
! }
!

! void print_history_changed(F,recorder)
! FILE *F;
! struct elmrc_recorder *recorder;
! {
! int i;
!
! /* First print lines without tag */

! char * last_tag = NULL;
!
!

! for (i = 0; i < recorder->rec_count; i++) {
!
! if (recorder->recs[i].changed &&
! NULL == recorder->recs[i].tag) {
! print_history_record(F,& (recorder->recs[i]));

! }
!
! }
!

! /* Then print values with tag */
!
! for (i = 0; i < recorder->rec_count; i++) {
!
! if (recorder->recs[i].changed &&
! NULL != recorder->recs[i].tag) {
!
! if (!last_tag ||
! 0 != strcmp(last_tag,
! recorder->recs[i].tag)) {
! last_tag = recorder->recs[i].tag;
!
! fprintf(F,"\n\n%s:\n",
! last_tag);
!
! print_history_record(F,& (recorder->recs[i]));

!
! }
! }
! }
! }

!
! void mark_XX(x)
! struct rc_save_info_rec *x;
! {
! enum record_mode mode;
!
! int found = 0;
!
! x->flags |= FL_LOCAL;
! x->flags |= FL_CHANGED;
!
! DPRINT(Debug,10,(&Debug,
! "mark_XX: Setting %p %s changed\n",
! x,x->name));
!
! for (mode = SYSTEM_RC; mode < RC_MODE_COUNT; mode++) {
!
! if (recorders[mode]) {

! int i;
!

! for (i = 0; i < recorders[mode]->rec_count; i++)
! if (recorders[mode]->recs[i].entry == x) {
! recorders[mode]->recs[i].changed++;
! found++;
!
! DPRINT(Debug,10,(&Debug,
! "mark_XX: recorders[%d]->recs[%d].entry == %p\n",
! mode,i,x));
!
! }
! } else {
! DPRINT(Debug,10,(&Debug,
! "mark_XX: no mode=%d\n",mode));

! }
! }
!

! if (!found) {
! DPRINT(Debug,10,(&Debug,
! "mark_XX: no change record\n"));

! }
!
! }
!

! void mark_local_changed(A)
! void *A;
! {
! int x;
!
!
! for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
! if (save_info[x].val.dummy == A) {
!
! DPRINT(Debug,10,(&Debug,
! "mark_local_changed: %d: %p\n",
! x,A));
!

! mark_XX(& (save_info[x]));

!
! }
! }
!

! #ifdef USE_DLOPEN
! mark_shared_changed(A);
! #endif
!
! mark_delayed_changed(A);

!
! }
!
!
!

!
! void mark_flocal_changed(A)
! option_func *A;
! {
! int x;
!
!
! for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
! if (save_info[x].func_val == A) {
!
! DPRINT(Debug,10,(&Debug,
! "mark_flocal_changed: %d: %p\n",
! x,A));
!

! mark_XX(& (save_info[x]));

!
! }
! }
!

! #ifdef USE_DLOPEN
! mark_fshared_changed(A);
! #endif
!
! mark_fdelayed_changed(A);
! }
!


#ifdef HAVE_CODESET
#include <langinfo.h>
***************
*** 60,66 ****
static int errors = 0;

static void do_expand_env P_((char *, char *, char *, unsigned));
! static void do_rc P_((FILE *file,int lcl, char *filaname));

int parse_elmrc(F,global,filename)
FILE *F;

--- 507,513 ----


static int errors = 0;

static void do_expand_env P_((char *, char *, char *, unsigned));
! static void do_rc P_((FILE *file,enum record_mode lcl, char *filaname));

int parse_elmrc(F,global,filename)
FILE *F;
***************
*** 86,95 ****
char system_mail_services[SLEN] = SYSTEM_MAIL_SERVICES;
char hostdomfile[SLEN] = HOSTDOMFILE;
char system_mime_charsets[SLEN] = SYSTEM_MIME_CHARSETS;

! char map_txtdir[SLEN]; /* init_defaults */


! char raw_map_txtdir[SLEN] = "{lib}/elm.map.txt";

! char map_bindir[SLEN]; /* init_defaults */


! char raw_map_bindir[SLEN] = "{lib}/elm.map.bin";

char unidata_path[SLEN]; /* init_defaults */


char raw_unidata_path[SLEN] = "unidata.bin"; /* init_defaults */

--- 533,550 ----


char system_mail_services[SLEN] = SYSTEM_MAIL_SERVICES;
char hostdomfile[SLEN] = HOSTDOMFILE;
char system_mime_charsets[SLEN] = SYSTEM_MIME_CHARSETS;
!
! ESTR map_txtdir_e = { /* init_defaults */
! ESTR_meta|ESTR_slash,
! NULL,
! NULL
! };
! ESTR map_bindir_e = { /* init_defaults */
! ESTR_meta|ESTR_slash,
! NULL,
! NULL
! };

!
char unidata_path[SLEN]; /* init_defaults */


char raw_unidata_path[SLEN] = "unidata.bin"; /* init_defaults */

***************
*** 97,103 ****

char bindata_path[SLEN]; /* init_defaults */


char raw_bindata_path[SLEN] = "bindata.bin"; /* init_defaults */

!

char user_rc_file[SLEN] = ELMRCFILE; /* user_init fixes */
char user_text_file[SLEN] = USER_ALIAS_TEXT; /* user_init fixes */

--- 552,558 ----
char bindata_path[SLEN]; /* init_defaults */


char raw_bindata_path[SLEN] = "bindata.bin"; /* init_defaults */

! int unstable_reverse_thread = 0;

char user_rc_file[SLEN] = ELMRCFILE; /* user_init fixes */
char user_text_file[SLEN] = USER_ALIAS_TEXT; /* user_init fixes */
***************

*** 140,146 ****
int allow_charset_switching; /* flag: allow changing charset of */


/* terminal if terminal supports */

int allow_setuid;


! int alias_sortby = NAME_SORT; /* how to sort aliases... */
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */
PATH alternative_addresses = { /* how else do we get mail? */
PATH_sep_comma,

--- 595,614 ----
int allow_charset_switching; /* flag: allow changing charset of */


/* terminal if terminal supports */

int allow_setuid;


!
! static struct sortval ASR_srtval[]={
! {"alias", ALIAS_SORT},
! {"name", NAME_SORT},
! {"text", TEXT_SORT},
! {NULL, 0}
! };
!
! SORT alias_sortby = { /* how to sort aliases... */
! NAME_SORT,
!
! ASR_srtval
! };
!
char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */
PATH alternative_addresses = { /* how else do we get mail? */
PATH_sep_comma,
***************

*** 150,188 ****
int always_del; /* flag: always delete marked msgs? */
int always_keep = 1; /* flag: always keep unread msgs? */
int always_store; /* flag: always store read msgs? */
-
int ask_delete = 1; /* confirm delete on resync? */
int ask_keep = 1; /* ask to keep unread msgs? */
int ask_reply_copy = 1; /* ask to copy mssg into reply? */
int ask_store = 1; /* ask to store read mail? */
-
int arrow_cursor; /* flag: use "->" cursor regardless?*/
-
int prompt_for_cc = 1; /* flag: ask user for "cc:" value? */
#ifdef USE_PGP


int pgp_askpgpsig; /* Should pgp ask userid to sign messages with? */

! int pgp_sign_type; /* 0 = application/pgp


! 1 = text/plain
! 2 = text/x-pgp
! */

! int pgp_interactive=0; /* Should pgp/gpg encryption/signing to be
! run always on interactive mode */
! enum pgp_version send_pgp_version = pgp_none; /* preferred pgp version*/
#endif


char attribution[SLEN]; /* attribution string for replies */

char fwdattribution[SLEN]; /* attribution string for forwarded mssgs */


! int auto_attachment = 1; /* 0 = none,
! 1 = application,
! 2 = non-text
! */

int reply_copy = 1; /* flag: copy message into reply */


int auto_iso_8859 = 1; /* flag: Should ISO-8859-X charsets defined
on demand ? */

#ifdef BACKGROUD_PROCESSES

int background_wait_time = 2; /* If > 0 background mailer after */
/* this number of seconds */
#endif

! /* int bounceback; */ /* flag: bounce copy off remote? */


int browser_wildcards = 1; /* flag: do wildcard match? */
int builtin_lines= -3; /* int: if < 0 use builtin if message*/
/* shorter than LINES+builtin_lines */

--- 618,680 ----
int always_del; /* flag: always delete marked msgs? */
int always_keep = 1; /* flag: always keep unread msgs? */
int always_store; /* flag: always store read msgs? */
int ask_delete = 1; /* confirm delete on resync? */
int ask_keep = 1; /* ask to keep unread msgs? */
int ask_reply_copy = 1; /* ask to copy mssg into reply? */
int ask_store = 1; /* ask to store read mail? */
int arrow_cursor; /* flag: use "->" cursor regardless?*/
int prompt_for_cc = 1; /* flag: ask user for "cc:" value? */
+
#ifdef USE_PGP


int pgp_askpgpsig; /* Should pgp ask userid to sign messages with? */

!
! static char * PGP_SIGN_TYPES[] = { "application/pgp", "text/plain",
! "text/x-pgp", NULL };
!
!
! ENUMERATE pgp_sign_type= { /* 0 = application/pgp */
! 0, /* 1 = text/plain */
! 3, &(PGP_SIGN_TYPES[0]) /* 2 = text/x-pgp */
! };
!
! static char * PGP_ENCRYPT_TYPES[] = { "application/pgp", "text/plain",
! "text/x-pgp", NULL };
!
! ENUMERATE pgp_encrypt_type= { /* 0 = application/pgp */
! 0, /* 1 = text/plain */
! 3, &(PGP_ENCRYPT_TYPES[0]) /* 2 = text/x-pgp */
! };
!

! int pgp_interactive; /* Should pgp/gpg encryption/signing to be
! run always on interactive mode */
!

! static char * PGP_VERSIONS[] = { "default", "pgp2", "pgp5", "gpg", NULL };
! ENUMERATE send_pgp_version = { /* preferred pgp version*/
! pgp_none,
! 4, &(PGP_VERSIONS[0])
! };
!
#endif

+

char attribution[SLEN]; /* attribution string for replies */

char fwdattribution[SLEN]; /* attribution string for forwarded mssgs */


!
! static char * AUTO_ATTACH[] = { "none", "application", "non-text", NULL };
! ENUMERATE auto_attachment = { /* 0 = none, */
! 1, /* 1 = application, */
! 3, &(AUTO_ATTACH[0]) /* 2 = non-text */
! };
!

! int auto_copy; /* flag: automatically copy source? */
int reply_copy = 1; /* flag: copy message into reply */
+

int auto_iso_8859 = 1; /* flag: Should ISO-8859-X charsets defined
on demand ? */

#ifdef BACKGROUD_PROCESSES

int background_wait_time = 2; /* If > 0 background mailer after */
/* this number of seconds */
#endif
!
int browser_wildcards = 1; /* flag: do wildcard match? */
int builtin_lines= -3; /* int: if < 0 use builtin if message*/
/* shorter than LINES+builtin_lines */
***************

*** 196,206 ****


charset_t default_mimetext_charset; /* pointer to character set */

char raw_default_nomime_charset[SLEN] = "SYSTEM"; /* name of character set */


charset_t default_nomime_charset; /* pointer to character set */

! int def_folder_status = FOLDER_STATUS_OLD; /* 0 = Read
! 1 = Old

! 2 = New
! */


char config_options[SLEN];/* which options are in o)ptions */

int confirm_append; /* flag: confirm append to folder? */

int confirm_create; /* flag: confirm create new folder? */

int confirm_files; /* flag: confirm files for append? */
--- 688,702 ----


charset_t default_mimetext_charset; /* pointer to character set */

char raw_default_nomime_charset[SLEN] = "SYSTEM"; /* name of character set */


charset_t default_nomime_charset; /* pointer to character set */
!

! static char * FOLDER_STATUS[] = { "Read", "Old", "New", NULL };
! ENUMERATE def_folder_status = { /* 0 = Read */
! FOLDER_STATUS_OLD, /* 1 = Old */
! 3, &(FOLDER_STATUS[0]) /* 2 = New */
! };
!

char config_options[SLEN];/* which options are in o)ptions */

+

int confirm_append; /* flag: confirm append to folder? */

int confirm_create; /* flag: confirm create new folder? */

int confirm_files; /* flag: confirm files for append? */
***************
*** 222,241 ****


char e_editor[SLEN]; /* "~e" editor... */

ESTR editor_e; /* editor for outgoing mail */

! int env_from_source; /* 0 == forward-from,


! 1 == from,
! 2 == return-path
! */

char escape_char = TILDE_ESCAPE;/* '~' or something else.. */

int force_name; /* flag: save by name forced? */

! int fragment_handling = 1; /* 0 == none,


! 1 == manual,
! 2 == auto */

int allow_forms = NO; /* flag: are AT&T Mail forms okay? */


char full_username[SLEN]; /* Full username - gecos */

! int phrase_display_mode; /* 0 == plain, 1 = quoted */


char hostdomain[SLEN]; /* name of domain we're in */

char hostfullname[SLEN]; /* name of FQDN we're in */

char hostname[SLEN]; /* name of machine we're on */

--- 718,753 ----


char e_editor[SLEN]; /* "~e" editor... */

ESTR editor_e; /* editor for outgoing mail */

+ static char * MPAR[] = { "plain", "encoded", "plain-and-encoded" };
+ ENUMERATE mime_parameters = {
+ 2,
+ 3, &(MPAR[0])
+ };



! static char * ENV_FROM_SOURCES[] = { "forward-from", "from", "return-path",
! NULL };
! ENUMERATE env_from_source = { /* 0 == forward-from, */
! 0, /* 1 == from, */
! 3, &(ENV_FROM_SOURCES[0]) /* 2 == return-path */
! };

char escape_char = TILDE_ESCAPE;/* '~' or something else.. */

int force_name; /* flag: save by name forced? */
!

! static char * FRAGMENTH_list[] = { "none", "manual", "auto" };
! ENUMERATE fragment_handling = { /* 0 == none, */
! 1, /* 1 == manual, */
! 3, &(FRAGMENTH_list[0]) /* 2 == auto */
! };

int allow_forms = NO; /* flag: are AT&T Mail forms okay? */


char full_username[SLEN]; /* Full username - gecos */
!

! static char * HDR_PHRASE_DISPLAY_MODES[] = { "plain", "quoted", NULL };
! ENUMERATE phrase_display_mode = { /* 0 == plain, 1 = quoted */
! 0,
! 2, &(HDR_PHRASE_DISPLAY_MODES[0])
! };
!

char hostdomain[SLEN]; /* name of domain we're in */

char hostfullname[SLEN]; /* name of FQDN we're in */

char hostname[SLEN]; /* name of machine we're on */

***************
*** 249,267 ****


int pgp_keeppassfor = 300; /* 5 minutes */
#endif

int local_fast_lookup; /* flag: directory listing not needed
for lookup */

char local_sessionlock_dir[SLEN] = default_temp;

! int local_sessionlock_use_home; /* 0 == newer,


! 1 == spool
! 2 == always
! 3 == non-spool

! */
char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */

charset_t local_fs_charset; /* filesystem charset */

-

ESTR local_signature_e; /* local msg signature file */

#ifdef SYSCALL_LOCKING
int lockfolders = 1; /* Lock folder when open */
int lock_in_copy = 1; /* Lock folder when copied to it */
--- 761,798 ----


int pgp_keeppassfor = 300; /* 5 minutes */
#endif

+ static struct sortval DIR_srtval[]={
+ {"none", LD_NONE},
+ {"name", LD_NAME_SORT},
+ {"mtime", LD_MTIME_SORT},
+ {NULL, 0}
+ };
+
+ SORT local_dir_sortby = { /* how to sort files... */
+ LD_NAME_SORT,
+ DIR_srtval
+ };
+

int local_fast_lookup; /* flag: directory listing not needed
for lookup */

char local_sessionlock_dir[SLEN] = default_temp;
!
! static char * LSL_list[] = { "never", "spool", "always", "non-spool", NULL };
! ENUMERATE local_sessionlock_use_home = { /* 0 == newer, */
! 0, /* 1 == spool */
! 4, &(LSL_list[0]) /* 2 == always */
! }; /* 3 == non-spool */
!
char raw_local_fs_charset[SLEN] = "SYSTEM"; /* filesystem charset */

charset_t local_fs_charset; /* filesystem charset */

ESTR local_signature_e; /* local msg signature file */

+ #if defined(WCHAR) && defined(__STDC_ISO_10646__)

+ PATH locale_charsets; /* Use type=unknown for these charsets


+ * if system charset

+ */
+ #endif
+

#ifdef SYSCALL_LOCKING
int lockfolders = 1; /* Lock folder when open */
int lock_in_copy = 1; /* Lock folder when copied to it */
***************
*** 269,285 ****


int lockfolders; /* Lock folder when open */

int lock_in_copy; /* Lock folder when copied to it */

#endif
! char folders[SLEN]; /* folder home directory */
! char raw_folders[SLEN]; /* unexpanded folder home directory */
char extra_mailbox_dir[SLEN];
char raw_extra_mailbox_dir[SLEN];
char raw_attachment_dir[SLEN];
char attachment_dir[SLEN]; /* {doc} -prefix */
-

int mail_permissions = 0600; /* int: permissions for mailbox files */
int mini_menu = 1; /* flag: menu specified? */

! int message_hide_hack; /* 0 == none */


! /* 1 = FOLDER INTERNAL DATA */
char raw_metamail_path[SLEN] = METAMAIL_PATH;

char metamail_path[SLEN] = "metamail"; /* Metamail path or "none" */
/* if no metamail */
--- 800,825 ----


int lockfolders; /* Lock folder when open */

int lock_in_copy; /* Lock folder when copied to it */

#endif
!
! ESTR folders_e = { /* folder home directory */
! ESTR_slash,


! NULL,
! NULL
! };
!

char extra_mailbox_dir[SLEN];
char raw_extra_mailbox_dir[SLEN];
char raw_attachment_dir[SLEN];
char attachment_dir[SLEN]; /* {doc} -prefix */


int mail_permissions = 0600; /* int: permissions for mailbox files */
int mini_menu = 1; /* flag: menu specified? */
!
! static char * hide_hacks[] = { "none", "FOLDER INTERNAL DATA", NULL };
! ENUMERATE message_hide_hack = { /* 0 == none */
! 0, /* 1 = FOLDER INTERNAL DATA */
! 2, &(hide_hacks[0])
! };
!
char raw_metamail_path[SLEN] = METAMAIL_PATH;

char metamail_path[SLEN] = "metamail"; /* Metamail path or "none" */
/* if no metamail */
***************
*** 309,317 ****


int move_when_paged; /* flag: move when '+' or '-' used? */

int names_only = 1; /* flag: display user names only? */

! int allow_no_encoding; /* 1: Allow 8bit without -B8BITMIME */
! /* 2: Allow binary without -BBINARYMIME and */
! /* and 8bit without -B8BITMIME */
int allow_no_hdrencoding; /* TRUE, if header encoding is */


/* not required */
int noheader = 1; /* flag: copy + header to file? */

--- 849,862 ----


int move_when_paged; /* flag: move when '+' or '-' used? */

int names_only = 1; /* flag: display user names only? */
!
! static char * NOENCODINGS[] = { "pass-7bit", "pass-8bit", "pass-binary",
! NULL };
! ENUMERATE allow_no_encoding = { /* 1: Allow 8bit without -B8BITMIME */
! 0, /* 2: Allow binary without -BBINARYMIME and */

! 3, &(NOENCODINGS[0]) /* and 8bit without -B8BITMIME */
! };
!
int allow_no_hdrencoding; /* TRUE, if header encoding is */


/* not required */
int noheader = 1; /* flag: copy + header to file? */
***************

*** 340,345 ****
--- 885,891 ----
char printhdrs[SLEN];
int prompt_after_pager = 1; /* flag: prompt after pager exits */
int prompt_after_metamail = 1; /* flag: prompt after metamail exits */
+ int prompt_metamail = 1; /* flag: prompt for calling of metamil */


int quote_forward; /* flag: fwd'd msgs quoted like replies */

int readdatapercentinc = 5; /* data percent increment during new mbox read */
int readmsginc = 100; /* increment of msg cnt when reading*/
***************

*** 364,371 ****


};

int send_mime_plain = 1; /* flag: send plain text as MIME? */

! char shell[SLEN]; /* current system shell */
! char raw_shell[SLEN]; /* unexpanded current system shell */


int set_window_title; /* flag: set (xterm?) window title and
icon name */

#ifdef USE_PGP
--- 910,922 ----


};

int send_mime_plain = 1; /* flag: send plain text as MIME? */
!
! ESTR shell_e = { /* current system shell */
! ESTR_bin,
! NULL,
! NULL
! };
!

int set_window_title; /* flag: set (xterm?) window title and
icon name */

#ifdef USE_PGP
***************
*** 379,408 ****


int sleepmsg = 2; /* time to sleep for messages being */
/* overwritten on screen */

! int sortby = REVERSE SENT_DATE; /* how to sort incoming mail... */
long elm_timeout = 600L; /* timeout (secs) on main prompt */

int sort_thread_max_time = 30; /* Number of days which can considered
be same thread */
char to_chars[SLEN] = DEFAULT_TO_CHARS; /* chars to indicate who mail is to */
! char temp_dir[SLEN]; /* name of temp directory */
! char raw_temp_dir[SLEN]; /* unexpanded name of temp directory*/
#ifdef USE_PGP


int pgp_keeppass; /* should Elm keep the passphrase in*/

/* memory? */
#endif
! int user_level; /* flag: how good is the user? */


int use_tite = 1; /* flag: use termcap/terminfo ti/te?*/

int utf7_encode_optional = 1; /* flag: Should utf7 optional direct

characters to be encoded? */

! char v_editor[SLEN]; /* "~v" editor... */
int elm_filter = 1; /* flag: weed out header lines? */
PATH weedlist = {
PATH_sep_comma|PATH_quote|PATH_convert_underline,
NULL, 0,NULL
};

-
#ifdef REMOTE_MBX
char raw_imap_charset[SLEN] = "SYSTEM"; /* IMAP foldername charset */
int imap_fast_lookup; /* flag: skip some directory listing */
int imap_max_dl_size = 4*1024; /* Maximum size of message to be
--- 930,1011 ----
int sleepmsg = 2; /* time to sleep for messages being */
/* overwritten on screen */



! static struct sortval SRT_srtval[]={
! {"sent", SENT_DATE},
! {"thread", THREAD},
! {"received", RECEIVED_DATE},
! {"recieved", RECEIVED_DATE},
! {"rec", RECEIVED_DATE},
! {"from", SENDER},
! {"sender", SENDER},
! {"size", SIZE},
! {"lines", SIZE},
! {"subject", SUBJECT},
! {"mailbox", MAILBOX_ORDER},
! {"folder", MAILBOX_ORDER},

! {"status", STATUS},


! {NULL, 0}
! };
!

! SORT sortby = { /* how to sort incoming mail... */
! REVERSE SENT_DATE,
!
! SRT_srtval
! };
!

long elm_timeout = 600L; /* timeout (secs) on main prompt */

int sort_thread_max_time = 30; /* Number of days which can considered
be same thread */
char to_chars[SLEN] = DEFAULT_TO_CHARS; /* chars to indicate who mail is to */
!
! ESTR temp_dir_e = { /* name of temp directory */
! ESTR_slash,


! NULL,
! NULL
! };
!

#ifdef USE_PGP


int pgp_keeppass; /* should Elm keep the passphrase in*/

/* memory? */
#endif
!

! static char * USERLEVELS[] = { "beginner", "intermediate", "expert", NULL };
! ENUMERATE user_level = { /* flag: how good is the user? */
! 0,
! 3, &(USERLEVELS[0])
! };
!
int use_tite = 1; /* flag: use termcap/terminfo ti/te?*/

int utf7_encode_optional = 1; /* flag: Should utf7 optional direct

characters to be encoded? */

! #ifdef I_NETDB
! int verify_domain; /* flag: Should we try check existence
! of mail domain
! */
! #endif
! int verify_local_address; /* flag: Should we try check existence
! of local user
! */
!
! char v_editor[SLEN]; /* "~v" editor... */
int elm_filter = 1; /* flag: weed out header lines? */
PATH weedlist = {
PATH_sep_comma|PATH_quote|PATH_convert_underline,
NULL, 0,NULL
};



#ifdef REMOTE_MBX
+ static struct sortval IMAP_srtval[]={
+ {"none", ID_NONE},

+ {"name", ID_NAME_SORT},


+ {NULL, 0}
+ };
+

+ SORT imap_dir_sortby = { /* how to sort imap folders... */
+ ID_NONE,
+ IMAP_srtval
+ };
+

char raw_imap_charset[SLEN] = "SYSTEM"; /* IMAP foldername charset */
int imap_fast_lookup; /* flag: skip some directory listing */
int imap_max_dl_size = 4*1024; /* Maximum size of message to be
***************
*** 465,476 ****


strfcpy(dest,"none",destlen);

} else if (NULL == strpbrk(src,"/$\\;{}()")) {
! if (0 != access(map_bindir,ACCESS_EXISTS)) {

int err = errno;


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmNoBinMapDirX,
"%s: no map-bin-dir exist: %s: %s"),
descr,
! map_bindir,error_description(err));

/* No error counter incrementging because
map-bin-dir can be modified only on system

--- 1068,1089 ----


strfcpy(dest,"none",destlen);

} else if (NULL == strpbrk(src,"/$\\;{}()")) {

!
! /* give_dt_estr_as_str adds / to end */

! char * map_bindir_val = give_dt_estr_as_str(&map_bindir_e,
! "map-bin-dir");
!
! if (!map_bindir_val) {

! dest[0] = '\0';
! return;
! }
!
! if (0 != access(map_bindir_val,ACCESS_EXISTS)) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, ElmSet,ElmNoBinMapDirX,
"%s: no map-bin-dir exist: %s: %s"),
descr,

! map_bindir_val,strerror(err));



/* No error counter incrementging because
map-bin-dir can be modified only on system
***************

*** 479,485 ****


}
elm_sfprintf(dest,destlen,
FRM("%s/%s"),
! map_bindir,src);

} else
do_expand_meta(descr, dest, src, destlen);

--- 1092,1098 ----


}
elm_sfprintf(dest,destlen,
FRM("%s/%s"),
! map_bindir_val,src);

} else
do_expand_meta(descr, dest, src, destlen);
***************

*** 495,500 ****
--- 1108,1114 ----


static int locale_init_called = 0;
static int locale_error = 0;

+
void locale_init () {
#ifdef I_LOCALE
char *res;
***************

*** 560,573 ****
struct locale_map_item * system_locale_map = NULL;
struct locale_map_item * user_locale_map = NULL;

! static void map_system_charset P_((CONST char * lc_ctype, CONST char * codeset));
static void map_system_charset(lc_ctype, codeset)
! CONST char * lc_ctype;
! CONST char * codeset;
{
! CONST char *lang = NULL;
! CONST char *lang_country = NULL;
! CONST char *charset = NULL;
charset_t d_matches[MATCH_COUNT];
int i,j;

--- 1174,1187 ----
struct locale_map_item * system_locale_map = NULL;
struct locale_map_item * user_locale_map = NULL;

! static void map_system_charset P_((const char * lc_ctype, const char * codeset));
static void map_system_charset(lc_ctype, codeset)
! const char * lc_ctype;
! const char * codeset;
{
! const char *lang = NULL;
! const char *lang_country = NULL;
! const char *charset = NULL;
charset_t d_matches[MATCH_COUNT];
int i,j;

***************
*** 702,708 ****


system_charset = d_matches[j];

DPRINT(Debug,3,(&Debug,
! "map_display_charset: using match %d: \"%s\" (codeset \"%s\") as %s\n",
j,lc_ctype,codeset,
system_charset->MIME_name ?
system_charset->MIME_name :

--- 1316,1322 ----


system_charset = d_matches[j];

DPRINT(Debug,3,(&Debug,
! "map_system_charset: using match %d: \"%s\" (codeset \"%s\") as %s\n",
j,lc_ctype,codeset,
system_charset->MIME_name ?
system_charset->MIME_name :
***************

*** 858,863 ****
--- 1472,1479 ----
}

static int user_rc_set = 0;


+ /* shell value from passwd */
+ static char shell0[STRING] = "";

void user_init()
{
***************
*** 866,872 ****



/** initialize the whole ball of wax.
**/
! struct passwd *pass, *getpwnam();

if (!locale_init_called)
locale_init ();

--- 1482,1488 ----



/** initialize the whole ball of wax.
**/
! struct passwd *pass;

if (!locale_init_called)
locale_init ();
***************

*** 885,891 ****
int err = errno;
DPRINT(Debug,1,(&Debug,
"sysconf(_SC_SAVED_IDS) failed: (errno=%d) %s\n",
! err,error_description(err)));

have_saved_ids = 0;
} else {
--- 1501,1507 ----
int err = errno;
DPRINT(Debug,1,(&Debug,
"sysconf(_SC_SAVED_IDS) failed: (errno=%d) %s\n",
! err,strerror(err)));

have_saved_ids = 0;
} else {
***************
*** 918,929 ****


"You have no password entry!"));
exit(1);
}
strfcpy(username, pass->pw_name, sizeof username);
! strfcpy(home, pass->pw_dir, sizeof home);
! strfcpy(shell, pass->pw_shell, sizeof shell);
! /* Null shell in /etc/passwd means /bin/sh */
! if ('\0' == shell[0])
! strfcpy(shell, "/bin/sh", sizeof shell);

if((cp = get_full_name(username)) != NULL)
strfcpy(full_username, cp, sizeof full_username);

--- 1534,1556 ----


"You have no password entry!"));
exit(1);
}
+
strfcpy(username, pass->pw_name, sizeof username);
!
! if (pass->pw_dir)

! strfcpy(home, pass->pw_dir, sizeof home);


! else if (NULL != (cp = getenv("HOME")))

! strfcpy(home,cp,sizeof home);
! else
! strfcpy(home,"/",sizeof home);
!
! if (pass->pw_shell)
! strfcpy(shell0, pass->pw_shell, sizeof shell0);
!
! /* Null shell in /etc/passwd means /bin/sh */
! if ('\0' == shell0[0])
! strfcpy(shell0, "/bin/sh", sizeof shell0);
!

if((cp = get_full_name(username)) != NULL)
strfcpy(full_username, cp, sizeof full_username);
***************

*** 1107,1113 ****
int err = errno;
DPRINT(Debug,1,(&Debug,
"gethostname failed: (errno=%d) %s\n",
! err,error_description(err)));
} else {
DPRINT(Debug,3,(&Debug,
"gethostname: Setting hostname to %s\n",
--- 1734,1740 ----
int err = errno;
DPRINT(Debug,1,(&Debug,
"gethostname failed: (errno=%d) %s\n",
! err,strerror(err)));
} else {
DPRINT(Debug,3,(&Debug,
"gethostname: Setting hostname to %s\n",
***************
*** 1120,1126 ****
int err = errno;
DPRINT(Debug,1,(&Debug,
"uname failed: (errno=%d) %s\n",
! err,error_description(err)));

} else if (!hostname[0]) {
strfcpy(hostname, u_name.nodename, sizeof hostname);
--- 1747,1753 ----
int err = errno;
DPRINT(Debug,1,(&Debug,
"uname failed: (errno=%d) %s\n",
! err,strerror(err)));

} else if (!hostname[0]) {
strfcpy(hostname, u_name.nodename, sizeof hostname);
***************
*** 1162,1190 ****

--- 1789,1806 ----



allowed_precedences[0] = '\0';
/* no defaults for those */

+
+ set_dt_estr(&shell_e,shell0,"SHELL");
+ /* Shell is set from /etc/passwd in user_init () */
+
#ifdef USE_BUILTIN_PAGER
set_dt_estr(&pager_e, "builtin++", NULL);
#else
set_dt_estr(&pager_e,default_pager,"PAGER");
#endif

! set_dt_estr(&temp_dir_e,default_temp,"TMPDIR");
set_dt_estr(&editor_e,default_editor,"EDITOR");

if ((cp = getenv("MAILCAPS")) == NULL) {
***************

*** 1247,1261 ****


internal_mailcaps.unexpanded = safe_strdup("$MAILCAPS");
}

! elm_sfprintf(raw_folders, sizeof raw_folders, FRM("~/%s"),
! default_folders);
! do_expand_env("folders", folders, raw_folders, sizeof(folders));
!
! do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
! sizeof(map_txtdir));
!
! do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
! sizeof(map_bindir));

calendar_file_e.unexpanded =
elm_message(FRM("~/%s"), dflt_calendar_file);

--- 1863,1871 ----


internal_mailcaps.unexpanded = safe_strdup("$MAILCAPS");
}

! folders_e.unexpanded = elm_message(FRM("~/%s"), default_folders);
! map_txtdir_e.unexpanded = safe_strdup("{lib}/elm.map.txt");
! map_bindir_e.unexpanded = safe_strdup("{lib}/elm.map.bin");

calendar_file_e.unexpanded =
elm_message(FRM("~/%s"), dflt_calendar_file);
***************

*** 1265,1275 ****


strfcpy(e_editor, emacs_editor, sizeof e_editor);
strfcpy(v_editor, default_editor, sizeof v_editor);

- elm_sfprintf(raw_folders, sizeof raw_folders,
- FRM("%s/%s"), home, default_folders);
- strfcpy(folders, raw_folders, sizeof folders);
-
-

/* try system-wide rc file */
file = fopen(system_rc_file, "r");
if ( file != NULL ) {

--- 1875,1880 ----
***************
*** 1279,1285 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedSystemRC,
"Failed to open RC file %s: %s"),
! system_rc_file,error_description(err));
errors++;
}
if (figure_domain()) {
--- 1884,1890 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedSystemRC,
"Failed to open RC file %s: %s"),
! system_rc_file,strerror(err));
errors++;
}
if (figure_domain()) {
***************
*** 1320,1333 ****


generate_hostfullname();
}

- /* load_locale_map may refer to map-text-dir ... */
- do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
- sizeof(map_txtdir));
-
- /* Also map-bin-dir used by expand_map_bin() ... */
- do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
- sizeof(map_bindir));
-
/* Also bindata ... notice temorary variable */
expand_map_bin("bindata", bindata_path_global, raw_bindata_path,
sizeof(bindata_path));

--- 1925,1930 ----
***************
*** 1340,1347 ****


parse_service_entries(system_mail_services,1 /* SYSTEM */,&errors);
#endif

- init_default_mailer();
-
DPRINT(Debug,3,(&Debug,
"init_defaults=%d (errors)\n",errors));

--- 1937,1942 ----
***************
*** 1352,1358 ****

static enum charset_keyword special_charset_keyword P_((const char *value));
static enum charset_keyword special_charset_keyword(value)
! CONST char *value;
{
if (0 == strcmp(value,"SYSTEM"))
return cskw_SYSTEM;
--- 1947,1953 ----

static enum charset_keyword special_charset_keyword P_((const char *value));
static enum charset_keyword special_charset_keyword(value)
! const char *value;
{
if (0 == strcmp(value,"SYSTEM"))
return cskw_SYSTEM;
***************
*** 1373,1384 ****
--- 1968,1982 ----
text_charset = display_charset;
strfcpy(raw_text_charset,"DISPLAY",sizeof raw_text_charset);
break;
+ default:
+ break;
}

switch (special_charset_keyword(raw_display_charset)) {
case cskw_SYSTEM: wanted_display_charset = system_charset; break;
case cskw_DISPLAY: wanted_display_charset = display_charset; break;
case cskw_TEXT: wanted_display_charset = text_charset; break;
+ default: break;
}

if (!wanted_display_charset ||
***************
*** 1407,1424 ****
--- 2005,2025 ----
case cskw_SYSTEM: local_fs_charset = system_charset; break;
case cskw_DISPLAY: local_fs_charset = display_charset; break;
case cskw_TEXT: local_fs_charset = text_charset; break;
+ default: break;
}

switch (special_charset_keyword(raw_default_nomime_charset)) {
case cskw_SYSTEM: default_nomime_charset = system_charset; break;
case cskw_DISPLAY: default_nomime_charset = display_charset; break;
case cskw_TEXT: default_nomime_charset = text_charset; break;
+ default: break;
}

switch (special_charset_keyword(raw_default_mimetext_charset)) {
case cskw_SYSTEM: default_mimetext_charset = system_charset; break;
case cskw_DISPLAY: default_mimetext_charset = display_charset; break;
case cskw_TEXT: default_mimetext_charset = text_charset; break;
+ default: break;
}

#ifdef REMOTE_MBX
***************
*** 1426,1431 ****
--- 2027,2033 ----
case cskw_SYSTEM: imap_charset = system_charset; break;
case cskw_DISPLAY: imap_charset = display_charset; break;
case cskw_TEXT: imap_charset = text_charset; break;
+ default: break;
}
#endif

***************
*** 1451,1457 ****
if (user_rc_set)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedUserRC,
"Failed to open RC file %s: %s"),
! user_rc_file,error_description(err));

DPRINT(Debug,2,(&Debug,
"Warning:User has no \"%s\" file (can_open)\n\n",
--- 2053,2059 ----
if (user_rc_set)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedUserRC,
"Failed to open RC file %s: %s"),
! user_rc_file,strerror(err));

DPRINT(Debug,2,(&Debug,
"Warning:User has no \"%s\" file (can_open)\n\n",
***************
*** 1474,1486 ****


}
}

- /* load_locale_map may refer to map-text-dir ... */
- do_expand_meta("map-text-dir", map_txtdir, raw_map_txtdir,
- sizeof(map_txtdir));
-
- /* Also map-bin-dir used by expand_map_bin() ... */
- do_expand_meta("map-bin-dir", map_bindir, raw_map_bindir,
- sizeof(map_bindir));

/* Also bindata ... */
expand_map_bin("bindata", bindata_path, raw_bindata_path,

--- 2076,2081 ----
***************
*** 1502,1523 ****


return errors;
}

! void post_init_check(int flag) {

struct stat st_buffer;
char *t;

- do_expand_env("folders", folders, raw_folders, sizeof(folders));
-
do_expand_env("extra-mailbox-dir", extra_mailbox_dir,
raw_extra_mailbox_dir, sizeof(extra_mailbox_dir));

! if (raw_extra_mailbox_dir[0] &&
! 0 == strcmp(extra_mailbox_dir,folders)) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmExtraNoFolders,
"\"extra-mailbox-dir\" should not be \"folders\" or \"maildir\" directory."));
raw_extra_mailbox_dir[0] = '\0';
}

t = give_dt_estr_as_str(&dead_letter_dir_e,"dead-letter-dir");

--- 2097,2123 ----


return errors;
}

! void post_init_check(flag)
! int flag;
! {

struct stat st_buffer;
char *t;

do_expand_env("extra-mailbox-dir", extra_mailbox_dir,
raw_extra_mailbox_dir, sizeof(extra_mailbox_dir));
+
+ t = give_dt_estr_as_str(&folders_e,"maildir");

! if (raw_extra_mailbox_dir[0] &&
! t &&
! 0 == strcmp(extra_mailbox_dir,t)) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmExtraNoFolders,
"\"extra-mailbox-dir\" should not be \"folders\" or \"maildir\" directory."));
raw_extra_mailbox_dir[0] = '\0';
+
+ mark_local_changed(& raw_extra_mailbox_dir);
}

t = give_dt_estr_as_str(&dead_letter_dir_e,"dead-letter-dir");
***************

*** 1537,1542 ****
--- 2137,2144 ----



free(dead_letter_dir_e.unexpanded);
dead_letter_dir_e.unexpanded = NULL;
+
+ mark_local_changed(& dead_letter_dir_e);
}

if (!raw_attachment_dir[0]) {
***************

*** 1552,1569 ****


} else
do_expand_env("attachment-dir", attachment_dir,
raw_attachment_dir, sizeof(attachment_dir));
!
! do_expand_env("temp_dir", temp_dir, raw_temp_dir, sizeof(temp_dir));
! if ('\0' == temp_dir[0])
! strfcpy(temp_dir,"/tmp/", sizeof temp_dir);
! else if (temp_dir[strlen (temp_dir)-1] != '/')
! strfcat(temp_dir, "/", sizeof temp_dir);
!
! if (raw_shell[0] != '\0') {
! /* shell is taken from /etc/passwd in initialize() */
! do_expand_env("shell", shell, raw_shell, sizeof(shell));
! }
!
if (strcmp(raw_printout,"none") == 0 ||
raw_printout[0] == '\0') {
strfcpy(raw_printout,"none", sizeof raw_printout);

--- 2154,2160 ----


} else
do_expand_env("attachment-dir", attachment_dir,
raw_attachment_dir, sizeof(attachment_dir));
!
if (strcmp(raw_printout,"none") == 0 ||
raw_printout[0] == '\0') {
strfcpy(raw_printout,"none", sizeof raw_printout);
***************

*** 1586,1591 ****
--- 2177,2184 ----


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReadDataIncrement,
"Warning: readdatapercentinc is set to less than 1. Ignored."));
readdatapercentinc = 1;
+
+ mark_local_changed(& readdatapercentinc);
}

if (readmsginc < 1) {
***************

*** 1593,1598 ****
--- 2186,2193 ----


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReadMessageIncrement,
"Warning: readmsginc is set to less than 1. Ignored."));
readmsginc = 1;
+
+ mark_local_changed(& readmsginc);
}

if (sleepmsg < 0) {
***************

*** 1600,1605 ****
--- 2195,2202 ----


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSleepMessageInvalid,
"Warning: sleepmsg is set to less than 0. Setting to 0."));
sleepmsg = 0;
+
+ mark_local_changed(& sleepmsg);
}

#ifdef BACKGROUD_PROCESSES
***************

*** 1608,1613 ****
--- 2205,2212 ----


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBackgroundLLT,
"Warning: background_wait_time is set less than 0. Setting to 0."));
background_wait_time = 0;
+
+ mark_local_changed(& background_wait_time);
}
#endif

***************

*** 1634,1668 ****

--- 2233,2284 ----

map_system_charset(display_locale,display_codeset);



+ #if defined(WCHAR) && defined(__STDC_ISO_10646__)

*** 1670,1690 ****


"display-charset %s is unsupported, charset switching does not work"),
wanted_display_charset->MIME_name ?
wanted_display_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_display_charset,"SYSTEM",
sizeof raw_display_charset);
! wanted_display_charset = system_charset;
}
}

if (!special_charset_keyword(raw_local_fs_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_local_fs_charset,
! sizeof buffer))
do_expand_env("local-fs-charset", buffer,
raw_local_fs_charset,
sizeof(buffer));
! local_fs_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(local_fs_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,

--- 2286,2311 ----


"display-charset %s is unsupported, charset switching does not work"),
wanted_display_charset->MIME_name ?
wanted_display_charset->MIME_name :
! raw_display_charset);
strfcpy(raw_display_charset,"SYSTEM",
sizeof raw_display_charset);
! wanted_display_charset = system_charset;
!
! mark_local_changed(& raw_display_charset);
}
}

if (!special_charset_keyword(raw_local_fs_charset)) {
!
! if (! load_charset_map_info(&local_fs_charset,
! raw_local_fs_charset) ) {
! char buffer[LONG_STRING];
do_expand_env("local-fs-charset", buffer,
raw_local_fs_charset,
sizeof(buffer));
! local_fs_charset = MIME_name_to_charset(buffer,CHARSET_create);
! }
!
if (!(CS_mapping & charset_properties(local_fs_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************

*** 1692,1712 ****


"local-fs-charset %s is unsupported, file access does not work"),
local_fs_charset->MIME_name ?
local_fs_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_local_fs_charset,"SYSTEM",
sizeof raw_local_fs_charset);
local_fs_charset = system_charset;
}
}

if (!special_charset_keyword(raw_default_nomime_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_default_nomime_charset,
! sizeof buffer))
do_expand_env("default-nomime-charset", buffer,
raw_default_nomime_charset,
sizeof(buffer));
! default_nomime_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(default_nomime_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,

--- 2313,2339 ----

*** 1714,1734 ****


"default-nomime-charset %s is unsupported"),
default_nomime_charset->MIME_name ?
default_nomime_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_default_nomime_charset,"SYSTEM",
sizeof raw_default_nomime_charset);
default_nomime_charset = system_charset;
}
}

if (!special_charset_keyword(raw_default_mimetext_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_default_mimetext_charset,
! sizeof buffer))
do_expand_env("default-mime-text-charset", buffer,
raw_default_mimetext_charset,
sizeof(buffer));
! default_mimetext_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(default_mimetext_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,

--- 2341,2368 ----

*** 1736,1758 ****


"default-mime-text-charset %s is unsupported"),
default_mimetext_charset->MIME_name ?
default_mimetext_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_default_mimetext_charset,"US-ASCII",
sizeof raw_default_mimetext_charset);
default_mimetext_charset = ASCII_SET;
}
}


#ifdef REMOTE_MBX
if (!special_charset_keyword(raw_imap_charset)) {
! char buffer[LONG_STRING];
! if (!get_charset_map_info(buffer,raw_imap_charset,
! sizeof buffer))
do_expand_env("imap-charset", buffer,
raw_imap_charset,
sizeof(buffer));
! imap_charset = MIME_name_to_charset(buffer,CHARSET_create);
if (!(CS_mapping & charset_properties(imap_charset))) {
errors++;
lib_error(CATGETS(elm_msg_cat, ElmSet,

--- 2370,2399 ----

*** 1760,1769 ****


"imap-charset %s is unsupported"),
imap_charset->MIME_name ?
imap_charset->MIME_name :
! "<no MIME name>");
strfcpy(raw_imap_charset,"SYSTEM",
sizeof raw_imap_charset);
imap_charset = system_charset;
}
}
#endif

--- 2401,2413 ----


"imap-charset %s is unsupported"),
imap_charset->MIME_name ?
imap_charset->MIME_name :
! raw_imap_charset);
!
strfcpy(raw_imap_charset,"SYSTEM",
sizeof raw_imap_charset);
imap_charset = system_charset;
+
+ mark_local_changed(& raw_imap_charset);
}
}
#endif
***************

*** 1840,1845 ****
--- 2484,2494 ----


wanted_display_charset = system_charset;

allow_charset_switching = 0;
+
+ mark_local_changed(& raw_unidata_path);
+ mark_local_changed(& raw_display_charset);
+ mark_local_changed(& allow_charset_switching);
+
}

}
***************

*** 1860,1865 ****
--- 2509,2515 ----


strfcpy(raw_bindata_path,"none",sizeof raw_bindata_path);
strfcpy(bindata_path,"none",sizeof bindata_path);

+ mark_local_changed(& raw_bindata_path);
}
}

***************

*** 1902,1911 ****


do_expand_env("gpg", gpg_path, raw_gpg_path,
sizeof(gpg_path));
}
! if (pgp_none == send_pgp_version) {
! if ('/' == gpg_path[0]) send_pgp_version = gpg;
! if ('/' == pgp5_dir[0]) send_pgp_version = pgp5;
! if ('/' == pgp2_path[0]) send_pgp_version = pgp2;
}
#endif

--- 2552,2561 ----


do_expand_env("gpg", gpg_path, raw_gpg_path,
sizeof(gpg_path));
}
! if (pgp_none == give_dt_enumerate_as_int(&send_pgp_version)) {
! if ('/' == gpg_path[0]) send_pgp_version.val = gpg;
! if ('/' == pgp5_dir[0]) send_pgp_version.val = pgp5;
! if ('/' == pgp2_path[0]) send_pgp_version.val = pgp2;
}
#endif

***************

*** 1914,1940 ****


#endif
}

- static struct rc_save_info_rec * eval_option P_((struct rc_save_info_rec *
- rc_options,
- int rc_option_count,
- int lcl,
- char *word1,
- char *word2,
- char *filename));

! void do_rc(file, lcl, filename)
FILE *file;
! int lcl;
char *filename;
{

struct rc_save_info_rec * prev_type = NULL;

char current_tag[SLEN];



int ignored = 0;
!

! int x;
!
! char buffer[LONG_STRING];

if (!file)
return;

--- 2564,2650 ----
#endif
}


!
! /* Return rest */
!

! static char * split_keyword(buffer,line_len,keyword,size,tag,
! assig)
! char *buffer;
! int line_len;
! char *keyword;
! int size;
! char **tag;
! int *assig;

! {
! int i;

! keyword[i] = '\0';
!

! while (whitespace(*c))
! c++;
!
! if ('=' == *c) {
! c++;
! *assig = 1;
! }
! while (whitespace(*c))
! c++;
!
! DPRINT(Debug,10,(&Debug,
! "split_keyword: keyword(i=%d)=%s\n",
! i,keyword));
!
! if (*tag) {
! DPRINT(Debug,10,(&Debug,
! "split_keyword: tag=%s\n",*tag));
! }
!
! DPRINT(Debug,10,(&Debug,
! "split_keyword=%s\n",c));
!
! return c;

! }
!

! static void do_rc(file, lcl, filename)
FILE *file;
! enum record_mode lcl;
char *filename;
{

struct rc_save_info_rec * prev_type = NULL;

+ struct hist_record * rec = NULL;
+
char current_tag[SLEN];



int ignored = 0;
!

! char * buffer = NULL;
! int r; /* length of line or error/eof status */

if (!file)
return;
***************
*** 1942,2000 ****

current_tag[0] = '\0';


! while (0 < (x =
! mail_gets(buffer, sizeof buffer, file))) {

char * tag = NULL;
! char keyword[SLEN], *c;

char * rest = NULL;

! int i;



lineno++;

! /* remove return */
! if ('\n' == buffer[x -1])
! buffer[x - 1] = '\0';
! else {

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTooLongLine,
! "%30s: %d: Too long line: %.30s..."),

! filename,lineno,buffer);
! errors ++;
break;
! }
!

! if (buffer[0] == '#' /* comment */

--- 2652,2679 ----

current_tag[0] = '\0';

! while (0 <= ( r = malloc_gets(&buffer,MAX_LINE,file))) {


!
char * tag = NULL;

! char keyword[SLEN];
char * rest = NULL;


!
! int negate = 0;

! int assig = 0;

lineno++;



! if (!buffer) /* EOF */

break;
!
! if (buffer[0] == '#' /* comment */
! || r < 1) /* empty line */

continue;


! rest = split_keyword(buffer,r,keyword, sizeof keyword,&tag,
! &assig);



if (tag && !keyword[0]) {

strfcpy(current_tag, tag, sizeof current_tag);

***************

*** 2012,2080 ****


panic("RC PANIC",__FILE__,__LINE__,"do_rc",

"Bad prev_type",0);

if (!prev_type->dt_type ->
parse_cline(prev_type,
lcl,
rest,
lineno,
! filename))
errors++;
}

! } else if (tag || current_tag[0]) {


! struct rc_save_info_rec * rc_options = NULL;
! int rc_option_count = 0;

! if (!tag)
! tag = current_tag;
! else
! ignored = 0;


#ifdef USE_DLOPEN
! if (give_options(tag,&rc_options,&rc_option_count)) {
!

! prev_type = eval_option(rc_options,rc_option_count,
! lcl,keyword,rest,filename);
! ignored = 0;

if (!prev_type) {
errors++;

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyTagInElmrc,
! "I can't understand keyword \"%s\" (section %s) in line %d in \"%s\" file"),
! keyword, tag,lineno,filename);
}
!

! } else if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIgnoredSection,
! "Keywords on section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);
!
}

! #else
! if (!ignored) {
! ignored = 1;

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSharedIgnoredSection,
! "Shared libraries not supported. Section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);

! errors++;
}
! #endif

! } else {


! prev_type = do_set(lcl, keyword, rest, filename);
! if (!prev_type) {
errors++;

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyInElmrc,
! "I can't understand keyword \"%s\" in line %d in \"%s\" file"),
! keyword, lineno,filename);
}
}
!

}
}

/*
--- 2691,2852 ----


panic("RC PANIC",__FILE__,__LINE__,"do_rc",

"Bad prev_type",0);

+ if (rec) {
+ rec->old_line = safe_realloc(rec->old_line,
+ sizeof(rec->old_line[0]) *
+ ( rec->line_count + 1));
+
+ rec->old_line [ rec->line_count ] = safe_strdup(rest);
+ rec->line_count++;
+ }
+
if (!prev_type->dt_type ->
parse_cline(prev_type,
lcl,
rest,
lineno,
! filename)) {
errors++;
+
+ /* If there was errors, then assume that rewriting
+ of elmrc entry causes it to be rewritten
+ */
+ if (rec)
+ rec->changed++;
+ }
}

! } else if (assig) {

! if (tag || current_tag[0]) {
! struct rc_save_info_rec * rc_options = NULL;

! int rc_option_count = 0;
!

! if (!tag)
! tag = current_tag;
! else
! ignored = 0;


#ifdef USE_DLOPEN
! if (give_options(tag,&rc_options,&rc_option_count)) {
!
! prev_type = locate_option(rc_options,rc_option_count,
! keyword,rest,filename,
! &negate);

! ignored = 0;
!
! if (!prev_type) {
! errors++;


! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyTagInElmrc,
! "I can't understand keyword \"%s\" (section %s) in line %d in \"%s\" file"),
! keyword, tag,lineno,filename);

! continue;
! }
!
!

! } else if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIgnoredSection,
! "Keywords on section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);
!

! }
! #else
! if (!ignored) {
! ignored = 1;
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSharedIgnoredSection,
! "Shared libraries not supported. Section \"%s\" ignored starting from line %d on file %s"),
! tag, lineno,filename);

! errors++;
! }
! #endif
!
! } else {
!

! prev_type = locate_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
! keyword,rest,filename,&negate);
!
!

if (!prev_type) {

errors++;


! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyInElmrc,
! "I can't understand keyword \"%s\" in line %d in \"%s\" file"),
! keyword, lineno,filename);
!

! continue;
}
!
}
!
! if (!prev_type)
! continue;
!
! rec = need_record(lcl,prev_type,tag);


! if (rec) {
! if (rec->line_count)
! panic("RC PANIC",__FILE__,__LINE__,"do_rc",
! "Bad prev_type",0);

! rec->old_line = safe_malloc(sizeof(rec->old_line[0]));
!
! rec->old_line[0] = safe_strdup(rest);
!
! rec->line_count = 1;
}
!

! if (ignored)
! continue;

! if (prev_type->flags & FL_SYS && lcl == LOCAL_RC) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmBadLocalKeyInElmrc,
! "Keyword \"%s\" is not valid on user file %s"),
! prev_type->name,filename);
! continue;

! }
!
!

! if (!rc_eval_tail(prev_type,lcl,rest,lineno,filename,negate)) {
errors++;
!
! /* If there was errors, then assume that rewriting
! of elmrc entry causes it to be rewritten
! */

! if (rec)


! rec->changed++;
!
}
+ } else {
+ prev_type = NULL;
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadLineInElmrc,
+ "Keyword \"%s\" without = -character in line %d in \"%s\" file"),
+ keyword, lineno,filename);
+ errors++;
}

! }
!
! if (-1 == r) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTooLongLine,
! "%30s: %d: Too long line: %.30s..."),
! filename,lineno+1,
! buffer ? buffer : "<not available>");

! errors++;
! }



+ if (ferror(file)) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReading,

+ "Error reading from %.50s"),
+ filename);
+ errors++;


}
+
+ if (buffer)
+ free(buffer);
+
}

/*
***************
*** 2091,2112 ****


*/


! static struct rc_save_info_rec * eval_option (rc_options,rc_option_count,lcl,
! word1,word2,filename)
struct rc_save_info_rec * rc_options;
int rc_option_count;
- int lcl;
char *word1;
char *word2;
char *filename;
{
- int negate = 0;
-
int x, y = 0;
! int e_val = 0;
!
if ('!' == *word1) {
! negate++;
word1++;
}

--- 2863,2882 ----


*/


! static struct rc_save_info_rec *locate_option(rc_options,rc_option_count,
! word1,word2,filename,negate)
struct rc_save_info_rec * rc_options;
int rc_option_count;
char *word1;
char *word2;
char *filename;
+ int *negate;
{

int x, y = 0;
!
!

if ('!' == *word1) {
! (*negate)++;
word1++;
}

***************

*** 2119,2185 ****


if (y != 0)
return NULL;

! if (rc_options[x].flags & FL_SYS && lcl == LOCAL_RC) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmBadLocalKeyInElmrc,
! "Keyword \"%s\" is not valid on user file %s"),
! rc_options[x].name,filename);

! return NULL;
! }
!

! rc_options[x].e_ptr->list[i]);
! }
! }


! } else
! e_val = 0;

! if (RCTYPE_magic != rc_options[x].dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"do_set",


"Bad config item type",0);

! if (!rc_options[x].dt_type->parse_line(& (rc_options[x]),
! lcl,
! word2,
! lineno,
! filename,
! e_val,
! negate))
! errors++;
!
! return & (rc_options[x]);
}

struct rc_save_info_rec * do_set(lcl, word1, word2, filename)

--- 2889,2923 ----


if (y != 0)
return NULL;

! return & (rc_options[x]);
! }

! int rc_eval_tail(ret,lcl,value,lineno,filename,negate)
! struct rc_save_info_rec *ret;
! int lcl;
! char *value;
! int lineno;

! char *filename;
! int negate;


! {

! if (lcl == LOCAL_RC)
! ret->flags |= FL_LOCAL;

! ret->flags |= FL_CHANGED;
!
! if (RCTYPE_magic != ret->dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"rc_eval_tail",


"Bad config item type",0);
+

+ if (! ret->dt_type->parse_line(ret,
+ lcl,
+ value,
+ lineno,
+ filename,
+ negate))

+ return 0;

! return 1;
}


struct rc_save_info_rec * do_set(lcl, word1, word2, filename)
***************

*** 2187,2197 ****


char *word1, *word2;
char *filename;
{
! return eval_option(save_info,NUMBER_OF_SAVEABLE_OPTIONS,
! lcl,word1,word2,filename);
}

! static CONST char WEED_NO_DEFAULT[] = "*clear-weed-list*";


int matches_weedlist(buffer)
--- 2925,2953 ----
char *word1, *word2;
char *filename;
{
! int negate = 0;
!

! struct rc_save_info_rec * ret = locate_option(save_info,
! NUMBER_OF_SAVEABLE_OPTIONS,
! word1,word2,filename,
! &negate);
!
! if (!ret) {

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadKeyInElmrc,
! "I can't understand keyword \"%s\" in line %d in \"%s\" file"),

! word1, lineno,filename);
!
! return NULL;

! }
!
!
! if (!rc_eval_tail(ret,lcl,word2,lineno,filename,negate))
! return NULL;
!
! return ret;
}

! static const char WEED_NO_DEFAULT[] = "*clear-weed-list*";


int matches_weedlist(buffer)
Index: elmME+.2.5.alpha5-cvs/lib/realfrom.c
*** elmME+.2.5.alpha4/lib/realfrom.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/lib/realfrom.c 2005-07-20 19:49:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.12.8.2 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: realfrom.c,v 1.12.8.3 2005/07/20 16:49:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 15,22 ****

DEBUG_VAR(Debug,__FILE__,"addr");

- extern long make_gmttime();
-
int real_from(buffer, entry)
char *buffer;
struct header_rec *entry;
--- 15,20 ----
***************
*** 46,51 ****
--- 44,51 ----
int len=0; /* length of current field */
int month, day, year, hours, mins, secs, tz, i;

+ int ef = give_dt_enumerate_as_int(&env_from_source);
+

/*
* Zero out the portions of the record we fill in.
*/
***************
*** 64,70 ****
*/

DPRINT(Debug,9,(&Debug,

! "env_from_source=%d\n",env_from_source));


/* From */
if (strncmp(buffer, "From ", 5) != 0) {
--- 64,70 ----
*/

DPRINT(Debug,9,(&Debug,

! "env_from_source=%d\n",ef));

Index: elmME+.2.5.alpha5-cvs/lib/remote_mbx.c
*** elmME+.2.5.alpha4/lib/remote_mbx.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/remote_mbx.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.49.4.3 2004/07/19 09:20:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.4.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remote_mbx.c,v 1.49.4.6 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.4.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 177,188 ****
--- 177,192 ----
extern int errno;
#endif


+ #define REMOTE_ACCOUNT_magic 0xF504
+
void zero_remote_account(ra)
struct remote_account *ra;
{

/* bzero is defined hdrs/defs.h */

bzero ((void *)ra, sizeof (struct remote_account));

+ ra->magic = REMOTE_ACCOUNT_magic;
+
ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = 0;
ra->stream = NULL;
***************

*** 194,200 ****
FILE * transaction_file = NULL;

int set_transaction_file(filename)
! CONST char *filename;
{
FILE * f;
int err;
--- 198,204 ----
FILE * transaction_file = NULL;

int set_transaction_file(filename)
! const char *filename;
{
FILE * f;
int err;
***************
*** 215,221 ****
if (0 != err) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));
return 0;
}

--- 219,225 ----
if (0 != err) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));
return 0;
}

***************
*** 224,230 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));
return 0;
}
elm_chown(filename, userid, groupid); /* file owned by user */
--- 228,234 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));
return 0;
}
elm_chown(filename, userid, groupid); /* file owned by user */
***************
*** 258,263 ****


--- 262,272 ----
void free_remote_account(ra)
struct remote_account *ra;
{
+ if (ra->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,

+ "free_remote_account",


+ "Bad magic number",0);
+

ra->hostaddr.sa.sa_family = AF_UNSPEC;
ra->service_idx = -1;

***************

*** 313,319 ****
int err =errno;
lib_error(CATGETS(elm_msg_cat, MeSet,MeFailedToCreate,
"Failed to create socket: %s"),
! error_description(err));
r = -1;
goto clean;
}
--- 322,328 ----
int err =errno;
lib_error(CATGETS(elm_msg_cat, MeSet,MeFailedToCreate,
"Failed to create socket: %s"),
! strerror(err));
r = -1;
goto clean;
}
***************
*** 328,334 ****
(*last_error) = errno;
DPRINT(Debug,12,(&Debug,
"connect_one_IN: connect failed: %s\n",
! error_description(*last_error)));

if (errno == EINVAL) {
/* Seems that it is not not allowed several connect
--- 337,343 ----
(*last_error) = errno;
DPRINT(Debug,12,(&Debug,
"connect_one_IN: connect failed: %s\n",
! strerror(*last_error)));

if (errno == EINVAL) {
/* Seems that it is not not allowed several connect
***************
*** 351,357 ****
(*last_error) = errno;
DPRINT(Debug,12,(&Debug,
"connect_one_IN: connect failed: %s\n",
! error_description(*last_error)));
} else
r = 1;
}
--- 360,366 ----
(*last_error) = errno;
DPRINT(Debug,12,(&Debug,
"connect_one_IN: connect failed: %s\n",
! strerror(*last_error)));
} else
r = 1;


}
***************
*** 397,402 ****
--- 406,416 ----

int idx;

+ if (ra->magic != REMOTE_ACCOUNT_magic)
+ panic("CONNECTION PANIC",__FILE__,__LINE__,

+ "connect_remote_account",


+ "Bad magic number",0);
+

if(ra->stream) {
DPRINT(Debug,12,(&Debug,
"connect_remote_account: Closing for reopening\n"));
***************

*** 536,542 ****
else
lib_error(CATGETS(elm_msg_cat, MeSet,MeConnectFailed,
"Failed to connect %s: %s"),
! se->official_name,error_description(last_error));
ok = 0;
goto clean;
}
--- 550,556 ----
else
lib_error(CATGETS(elm_msg_cat, MeSet,MeConnectFailed,
"Failed to connect %s: %s"),
! se->official_name,strerror(last_error));
ok = 0;
goto clean;
}
***************
*** 549,555 ****
int err = errno;
DPRINT(Debug,12,(&Debug,
"connect_remote_account: fcntl [O_NONBLOCK] failed: %s\n",
! error_description(err)));
}

ra->stream = returnSimpleStream(cur_socket);
--- 563,569 ----
int err = errno;
DPRINT(Debug,12,(&Debug,
"connect_remote_account: fcntl [O_NONBLOCK] failed: %s\n",
! strerror(err)));
}

ra->stream = returnSimpleStream(cur_socket);


***************
*** 600,605 ****
--- 614,621 ----
sep = strchr(name,'@');

if (sep && (!*rest || *rest > sep)) {
+ char * sep2;
+
if (sep == name || sep[1] == '\0' ||
*rest == sep+1) {
lib_error(CATGETS(elm_msg_cat, MeSet,MeBadRemoteMailbox,
***************

*** 608,616 ****


ret = -1;
goto clean;
}

if (*rest) {
! CONST char * START = sep+1;
X->host = safe_malloc(*rest - START+1);
memcpy(X->host,START,*rest - START);
X->host[*rest - START] = '\0';
--- 624,642 ----


ret = -1;
goto clean;
}
+
+ /* Test for '@' on hostname -- if there is, then
+ assume that first '@' was on username
+ */
+ sep2 = strchr(sep+1,'@');
+ if (sep2 && (!*rest || *rest > sep2+1)) {
+ DPRINT(Debug,12,(&Debug,
+ "split_remote_name: Found second '@' from hostname, Assuming that first '@' was on username\n"));
+ sep = sep2;
+ }

if (*rest) {

! const char * START = sep+1;
X->host = safe_malloc(*rest - START+1);
memcpy(X->host,START,*rest - START);
X->host[*rest - START] = '\0';

+ "set_remote_tempmbox",


+ "Bad magic number",0);
+

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ "make_remote_mbox",


+ "Bad magic number",0);
+

DPRINT(Debug,10,(&Debug,
"make_remote_mbox: fh=%X, rest=%s, rewrite=%d\n",
fh,rest ? rest : "<NULL>", rewrite));
***************
*** 764,770 ****
else
fh->p->a.imap_mbx.folder = safe_strdup(imap_only);

- free_remote_account(X);
} else {
PORTS ports[] = { PORT_imap4, PORT_pop3, PORT_end };
PORTS ports_imaponly[] = { PORT_imap4, PORT_end };
--- 808,813 ----
***************
*** 789,794 ****
--- 832,839 ----
fh->folder_type->init_it(fh);
free_remote_account(&(fh->p->a.pop_mbx.C));
fh->p->a.pop_mbx.C = *X;

+ zero_remote_account(X); /* Avoid double free */
+

status = &(fh->p->a.pop_mbx.C);

break;
***************
*** 845,850 ****
--- 890,897 ----

fail:

+ free_remote_account(X);
+
if (imap_only)
free(imap_only);

***************
*** 924,932 ****
static struct connection_cache * CACHE_LIST = NULL;

struct connection_cache * locate_from_cache(username,host,con_type)
! CONST char * username;
! CONST char * host;
! CONST struct connection_type *con_type;
{
struct connection_cache * ptr;

--- 971,979 ----
static struct connection_cache * CACHE_LIST = NULL;

struct connection_cache * locate_from_cache(username,host,con_type)
! const char * username;
! const char * host;
! const struct connection_type *con_type;
{
struct connection_cache * ptr;

Index: elmME+.2.5.alpha5-cvs/lib/rfc822tlen.c
*** elmME+.2.5.alpha4/lib/rfc822tlen.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/rfc822tlen.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rfc822tlen.c,v 1.6.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: rfc822tlen.c,v 1.6.8.2 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 47,55 ****
#define IS822_ATOMCH(c) (!IS822_SPECIAL(c) && !IS822_SPACE(c) && !IS822_CTL(c))

int rfc822_toklen(str)
! CONST char *str;
{
! CONST char *str0;
int depth;

str0 = str;
--- 47,55 ----
#define IS822_ATOMCH(c) (!IS822_SPECIAL(c) && !IS822_SPACE(c) && !IS822_CTL(c))

int rfc822_toklen(str)
! const char *str;
{
! const char *str0;
int depth;

str0 = str;
Index: elmME+.2.5.alpha5-cvs/lib/safemalloc.c
*** elmME+.2.5.alpha4/lib/safemalloc.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/safemalloc.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: safemalloc.c,v 1.13.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: safemalloc.c,v 1.13.8.3 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 38,44 ****
exit(1);
}

! void (*safe_malloc_fail_handler)() = dflt_safe_malloc_fail_handler;

malloc_t safe_malloc(len)
unsigned len;
--- 38,45 ----
exit(1);
}

! void (*safe_malloc_fail_handler) P_((char *proc,
! unsigned len)) = dflt_safe_malloc_fail_handler;

malloc_t safe_malloc(len)
unsigned len;

***************
*** 72,78 ****
}

char *safe_strdup(s)
! CONST char *s;
{
char *p;
int Len = strlen(s)+1;
--- 73,79 ----
}

char *safe_strdup(s)
! const char *s;
{
char *p;
int Len = strlen(s)+1;
Index: elmME+.2.5.alpha5-cvs/lib/safeopen.c
*** elmME+.2.5.alpha4/lib/safeopen.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/safeopen.c 2005-07-22 23:55:55.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "$Id: safeopen.c,v 1.4.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "$Id: safeopen.c,v 1.4.8.2 2005/07/22 20:55:55 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 9,15 ****
* Initially written by: Zoltan Hidvegi <hz...@cs.elte.hu>
*****************************************************************************/

! #include "defs_major.h"

FILE *safeopen(name)
char *name;
--- 9,15 ----
* Initially written by: Zoltan Hidvegi <hz...@cs.elte.hu>
*****************************************************************************/

! #include "elm_defs.h"

FILE *safeopen(name)
char *name;
Index: elmME+.2.5.alpha5-cvs/lib/savefolder.c
*** elmME+.2.5.alpha4/lib/savefolder.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/savefolder.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75.8.4 2004/08/14 12:06:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: savefolder.c,v 1.75.8.9 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.75.8.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************
***************

*** 22,27 ****
--- 22,33 ----

DEBUG_VAR(Debug,__FILE__,"mbox");

+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

static unsigned char * s2us P_((char *str));
static unsigned char * s2us(str)
char *str;
***************

*** 301,307 ****
dir->sys_dir = NULL;
}

! /* Local default directory (also the last folder used on src/file.c) */
if (0 == access(".",READ_ACCESS)) {


/* WARNING: add_dir_vector does not allocate strings --

* it just assign pointers!

--- 307,314 ----
dir->sys_dir = NULL;
}

! /* Local default directory (also was the last folder used on src/file.c,
! -- now !! is last folder used) */
if (0 == access(".",READ_ACCESS)) {


/* WARNING: add_dir_vector does not allocate strings --

* it just assign pointers!
***************
*** 314,331 ****

switch(dir->sel_type) {
case selection_folder:
- /* Local folders directory */
- if (folders[0] && 0 == access(folders,READ_ACCESS)) {
- char * str = safe_strdup(folders);
- int l = strlen(str);
- if (str[l-1] != '/')
- str = strmcat(str,"/");

! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,str,new_string2(system_charset,s2us("=")),
! BROWSER_NOFOLDER);
}

{

--- 321,341 ----

switch(dir->sel_type) {
case selection_folder:


! {
! /* give_dt_estr_as_str adds / to end */

! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
!

! /* Local folders directory */
! if (folders_val && 0 == access(folders_val,READ_ACCESS)) {
! char * str = safe_strdup(folders_val);
!
! /* WARNING: add_dir_vector does not allocate strings --
! * it just assign pointers!
! */
! add_dir_vector(dir,str,new_string2(system_charset,s2us("=")),
! BROWSER_NOFOLDER);
! }
}

{
***************

*** 541,547 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeDirError,
"Directory %S: %s"),
! Lstr, error_description(err));
#ifdef S_ISDIR
} else if (!S_ISDIR(buf.st_mode)) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeNoDirError,
--- 551,557 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeDirError,
"Directory %S: %s"),
! Lstr, strerror(err));
#ifdef S_ISDIR
} else if (!S_ISDIR(buf.st_mode)) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeNoDirError,
***************
*** 700,705 ****
--- 710,719 ----


int F = 0;
struct stat bufX, *buf = NULL; /* stat command */
int idx;
+
+ /* give_dt_estr_as_str adds / to end */
+ char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
+

idx = browser_select_generic(dir,dir->dirname,
rel_itemname,relative,&Lstr,&str,'/',
***************
*** 722,729 ****
else if (extra_mailbox_dir[0] &&
in_directory(buf,str,extra_mailbox_dir))
F |= BROWSER_MAILFILE;
! else if (folders[0] &&
! in_directory(buf,str,folders))
F |= BROWSER_MAILFILE;

if (idx >= 0) {

--- 736,743 ----


else if (extra_mailbox_dir[0] &&
in_directory(buf,str,extra_mailbox_dir))
F |= BROWSER_MAILFILE;
! else if (folders_val &&
! in_directory(buf,str,folders_val))
F |= BROWSER_MAILFILE;

if (idx >= 0) {
***************

*** 1024,1029 ****
--- 1038,1046 ----
res -> cur_folder_disp = format_string(FRM("=%S"),
dir->selection->disp_name);
break;
+
+ default:
+ break;
}

res-> folder_type->init_it(res);
***************
*** 1080,1086 ****


*/
if (0 <= (code = split_remote_name(dir->a.dummy_browser.remote,
&X,&se,&rest,
! 0 /* Both POP adn IMAP are OK */
))) {

if (code == 0 || rest)

--- 1097,1103 ----


*/
if (0 <= (code = split_remote_name(dir->a.dummy_browser.remote,
&X,&se,&rest,
! 0 /* Both POP and IMAP are OK */
))) {

if (code == 0 || rest)
***************

*** 1096,1112 ****


new_string2(display_charset,
s2us(dir->a.dummy_browser.remote));

! /* May free X (if succeed) or copy */
if (!make_remote_mbox(res,&X,se,NULL,1)) {
- free_remote_account(&X);

res -> folder_type = NO_NAME;
res->folder_type->init_it(res);
}
free_temporary_service_entry(&se);
goto clean;
}
free_temporary_service_entry(&se);
}
#endif
lib_error(CATGETS(elm_msg_cat, MeSet, MeRemoteFolderNotAvail,

--- 1113,1133 ----


new_string2(display_charset,
s2us(dir->a.dummy_browser.remote));

! /* May free X (if succeed) or copy
! If make copy of X, then X is zeroed
! */
if (!make_remote_mbox(res,&X,se,NULL,1)) {

res -> folder_type = NO_NAME;
res->folder_type->init_it(res);
}
free_temporary_service_entry(&se);
+ free_remote_account(&X);
+
goto clean;
}
free_temporary_service_entry(&se);
+ free_remote_account(&X);
}
#endif
lib_error(CATGETS(elm_msg_cat, MeSet, MeRemoteFolderNotAvail,
***************

*** 1163,1169 ****
DPRINT(Debug,11,(&Debug,
"real_selection_is_local: Failed to stat %s: %s\n",
name,
! error_description(err)));
err = 0;
} else if ((NULL != folder ->p->fh_folder &&
0 == fstat(fileno(folder ->p->fh_folder),&XX))
--- 1184,1190 ----
DPRINT(Debug,11,(&Debug,
"real_selection_is_local: Failed to stat %s: %s\n",
name,
! strerror(err)));
err = 0;
} else if ((NULL != folder ->p->fh_folder &&
0 == fstat(fileno(folder ->p->fh_folder),&XX))
***************
*** 1179,1185 ****
int err = errno;
DPRINT(Debug,11,(&Debug,
"real_selection_is_local: Both fstat and stat failed: %s\n",
! error_description(err)));
ret = 0;
}
}
--- 1200,1206 ----
int err = errno;
DPRINT(Debug,11,(&Debug,
"real_selection_is_local: Both fstat and stat failed: %s\n",
! strerror(err)));
ret = 0;
}
}
***************
*** 1245,1254 ****
}

int create_as_user(name)
! CONST char *name;
{
int the_stat = 0, pid, w, sig;
! VOLATILE int ret = 0;

S__ status;

--- 1266,1275 ----
}

int create_as_user(name)
! const char *name;
{
int the_stat = 0, pid, w, sig;
! volatile int ret = 0;

S__ status;

***************
*** 1264,1277 ****
if (-1 == setgid(groupid)) {
int err = errno;
fprintf(stderr,"create_as_user: setgid(%d) FAILED: %s\n",
! groupid,error_description(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}
if (-1 == setuid(userid)) { /** back to normal userid **/
int err = errno;
fprintf(stderr,"create_as_user: setuid(%d) FAILED: %s\n",
! userid,error_description(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}
--- 1285,1298 ----
if (-1 == setgid(groupid)) {
int err = errno;
fprintf(stderr,"create_as_user: setgid(%d) FAILED: %s\n",
! groupid,strerror(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}
if (-1 == setuid(userid)) { /** back to normal userid **/
int err = errno;
fprintf(stderr,"create_as_user: setuid(%d) FAILED: %s\n",
! userid,strerror(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}
***************
*** 1299,1305 ****
else
lib_error(CATGETS(elm_msg_cat, MeSet, MeCreatingFileFailed,
"Creating of file %s failed: %s"),
! name,error_description(the_stat));

return ret;
}
--- 1320,1326 ----
else
lib_error(CATGETS(elm_msg_cat, MeSet, MeCreatingFileFailed,
"Creating of file %s failed: %s"),
! name,strerror(the_stat));

return ret;
}
***************
*** 1374,1380 ****
int real_prepare_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! CONST char *filename;
{
int ret = 0;
int err = 0;
--- 1395,1401 ----
int real_prepare_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! const char *filename;
{
int ret = 0;
int err = 0;
***************
*** 1384,1390 ****
if (0 != (err = can_open(filename, "w"))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldnWriteFile,
"Couldn't write to file %s: %s"),
! filename,error_description(err));
goto fail;
}

--- 1405,1411 ----
if (0 != (err = can_open(filename, "w"))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldnWriteFile,
"Couldn't write to file %s: %s"),
! filename,strerror(err));
goto fail;
}

***************
*** 1400,1406 ****

lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldnWriteFile,
"Couldn't write to file %s: %s"),
! filename,error_description(err));
goto fail;
}
ret = 1;
--- 1421,1427 ----

lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldnWriteFile,
"Couldn't write to file %s: %s"),
! filename,strerror(err));
goto fail;
}
ret = 1;
***************
*** 1410,1416 ****
if (0 != (err = can_open(filename, "a"))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldntAppendFolder,
"Couldn't append to folder %s: %s"),
! filename,error_description(err));
goto fail;
}

--- 1431,1437 ----
if (0 != (err = can_open(filename, "a"))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldntAppendFolder,
"Couldn't append to folder %s: %s"),
! filename,strerror(err));
goto fail;
}

***************
*** 1427,1433 ****
filename));
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldntAppendFolder,
"Couldn't append to folder %s: %s"),
! filename,error_description(err));
goto fail;
}

--- 1448,1454 ----
filename));
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldntAppendFolder,
"Couldn't append to folder %s: %s"),
! filename,strerror(err));
goto fail;
}

***************
*** 1449,1455 ****
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldntLockFolder,
"Couldn't lock folder %s: %s"),
filename,
! error_description(err));
goto fail;
}
}
--- 1470,1476 ----
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldntLockFolder,
"Couldn't lock folder %s: %s"),
filename,
! strerror(err));
goto fail;
}
}
***************
*** 1469,1475 ****
filename));
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldntAppendFolder,
"Couldn't append to folder %s: %s"),
! filename,error_description(err));

goto fail;
}
--- 1490,1496 ----
filename));
lib_error(CATGETS(elm_msg_cat, MeSet, MeCouldntAppendFolder,
"Couldn't append to folder %s: %s"),
! filename,strerror(err));

goto fail;
}
***************
*** 1488,1494 ****
int real_end_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! CONST char *filename;
{
int ret = 0;

--- 1509,1515 ----
int real_end_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! const char *filename;


{
int ret = 0;

***************

*** 1522,1528 ****
int real_sync_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! CONST char *filename;
{
int ret = 0;

--- 1543,1549 ----
int real_sync_write_local(dir,ptr,filename)
struct folder_browser *dir;
WRITE_STATE ptr;
! const char *filename;


{
int ret = 0;

***************

*** 1567,1573 ****
int err = errno;
DPRINT(Debug,12,(&Debug,
"real_browser_tell_ws: ERROR (errno=%d): %s\n",
! err,error_description(err)));
}

DPRINT(Debug,12,(&Debug,
--- 1588,1594 ----
int err = errno;
DPRINT(Debug,12,(&Debug,
"real_browser_tell_ws: ERROR (errno=%d): %s\n",
! err,strerror(err)));
}

DPRINT(Debug,12,(&Debug,
***************
*** 1590,1596 ****
int err = errno;
DPRINT(Debug,12,(&Debug,
"real_browser_seek_ws: ERROR (errno=%d): %s\n",
! err,error_description(err)));
}

DPRINT(Debug,12,(&Debug,
--- 1611,1617 ----
int err = errno;
DPRINT(Debug,12,(&Debug,
"real_browser_seek_ws: ERROR (errno=%d): %s\n",
! err,strerror(err)));
}

DPRINT(Debug,12,(&Debug,
***************
*** 1603,1609 ****
struct folder_browser *dir;
WRITE_STATE ptr;
int l;
! CONST char *buffer;
{
int ret = 1;
int count = 0;
--- 1624,1630 ----
struct folder_browser *dir;
WRITE_STATE ptr;
int l;
! const char *buffer;
{
int ret = 1;
int count = 0;
***************
*** 1619,1625 ****
if (err != EINTR) {
DPRINT(Debug,12,(&Debug,
"real_browser_write_ws: ERROR (errno=%d): %s\n",
! err,error_description(err)));
ret = 0;
} else {
clearerr(ptr->a.local.save_file);
--- 1640,1646 ----
if (err != EINTR) {
DPRINT(Debug,12,(&Debug,
"real_browser_write_ws: ERROR (errno=%d): %s\n",
! err,strerror(err)));
ret = 0;
} else {
clearerr(ptr->a.local.save_file);
***************
*** 1824,1830 ****
struct folder_browser *dir;
WRITE_STATE ptr;
int l;
! CONST char *buffer;
{
int ret = 0;

--- 1845,1851 ----
struct folder_browser *dir;
WRITE_STATE ptr;
int l;
! const char *buffer;


{
int ret = 0;

***************

*** 2057,2063 ****
lib_error(CATGETS(elm_msg_cat, MeSet,
MeErrorRead,
"Can't read %S: %s"),
! dir->selection->disp_name,error_description(err));
ret = 0;
free(name);
name = NULL;
--- 2078,2084 ----
lib_error(CATGETS(elm_msg_cat, MeSet,
MeErrorRead,
"Can't read %S: %s"),
! dir->selection->disp_name,strerror(err));
ret = 0;
free(name);
name = NULL;
***************
*** 2131,2136 ****
--- 2152,2168 ----


"browser_update_dummy() called",0);
}

+
+ S_(browser_folder_sort_dir browser_folder_sort_dummy)

+ static void browser_folder_sort_dummy P_((struct folder_browser *dir,
+ print_sort_message * print));
+ static void browser_folder_sort_dummy(dir,print)


+ struct folder_browser *dir;
+ print_sort_message * print;
+ {

+ /* Nothing */
+ }
+
static struct browser_type dummy_browser = { browser_zero_dummy,
browser_free_dummy,
browser_change_dummy,
***************

*** 2156,2162 ****


browser_make_ref_dummy,
browser_update_dummy,
browser_dummy_do_stat,
! browser_sync_write_dummy
};


--- 2188,2195 ----


browser_make_ref_dummy,
browser_update_dummy,
browser_dummy_do_stat,
! browser_sync_write_dummy,
! browser_folder_sort_dummy,
};


***************

*** 2308,2318 ****


flags & BROWSER_NEEDSTAT ? " (need stat)" : ""));

dir->vector = safe_realloc (dir->vector,
! (dir->vector_len+1) *
! sizeof (struct name_vector));
dir->vector[dir->vector_len].sys_name = sys_name;
dir->vector[dir->vector_len].disp_name = disp_name;
dir->vector[dir->vector_len].flags = flags;
dir->vector_len++;
}

--- 2341,2351 ----


flags & BROWSER_NEEDSTAT ? " (need stat)" : ""));

dir->vector = safe_realloc (dir->vector,
! (dir->vector_len+1) * sizeof (dir->vector[0]));
dir->vector[dir->vector_len].sys_name = sys_name;
dir->vector[dir->vector_len].disp_name = disp_name;
dir->vector[dir->vector_len].flags = flags;
+ dir->vector[dir->vector_len].mtime = 0;
dir->vector_len++;
}

***************

*** 2714,2720 ****
*relative_to_type = NULL;

if (len > 0) {
! /* "." as last folder used,
"@alias" as default folder for user,
"=" as save by name and
"=?" as conditionally save by name
--- 2747,2753 ----
*relative_to_type = NULL;

if (len > 0) {
! /* "!!" was as last folder used (was "." as last folder used)
"@alias" as default folder for user,
"=" as save by name and
"=?" as conditionally save by name
***************
*** 2784,2800 ****



/* Local folder directory */
if (1 == len) {
! if (change_type(dir,
#ifdef DIROPS
! &local_browser
#else
! &dummy_browser
#endif
! ))
! clear_dir_vector(dir);
! *relative_to_type = new_string2(local_fs_charset,
! s2us(folders));
! ret = 1;
break;
}

--- 2817,2842 ----



/* Local folder directory */
if (1 == len) {

!
! /* give_dt_estr_as_str adds / to end */

! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
!
! if (!folders_val)
! ret = 0;


! else {
! if (change_type(dir,
#ifdef DIROPS
! &local_browser
#else
! &dummy_browser
#endif
! ))
! clear_dir_vector(dir);
!
! *relative_to_type = new_string2(local_fs_charset,
! s2us(folders_val));

! ret = 1;
! }

break;
}

***************
*** 3344,3349 ****
--- 3386,3413 ----


return ret;
}

+
+ void folder_sort_dir(dir,print)

+ struct folder_browser *dir;
+ print_sort_message * print;
+ {
+

+ if (!valid_browser(dir->type))
+ panic("BROWSER PANIC",__FILE__,__LINE__,"folder_sort_dir",
+ "Bad browser (type)",0);
+
+ DPRINT(Debug,10,(&Debug,
+ "folder_sort_dir: dir=%p (%s); type=%p\n",
+ dir,dir->sys_dir ? dir->sys_dir : "<NULL>",
+ dir->type));
+
+ /* browser_vector_len() will update cache */
+ browser_vector_len(dir);
+
+ dir->type->browser_folder_sort_it(dir,print);
+ }
+
+
/* return reference to array -- do not free_string() result !!! */
struct string * give_line_dir(dir,idx,flags)

struct folder_browser *dir;
***************
*** 4063,4069 ****
struct folder_browser *dir;
WRITE_STATE write_state_ptr;
int l;
! CONST char *buffer;
{
int ret = 0;

--- 4127,4133 ----
struct folder_browser *dir;
WRITE_STATE write_state_ptr;
int l;
! const char *buffer;
{
int ret = 0;

Index: elmME+.2.5.alpha5-cvs/lib/sb_file.c
*** elmME+.2.5.alpha4/lib/sb_file.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/sb_file.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: sb_file.c,v 1.10.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: sb_file.c,v 1.10.8.4 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 36,42 ****
{
static int count = 0;
int i;
!
buffer->p->a.file.offset_count = 0;
buffer->p->a.file.offsets = NULL;
buffer->p->a.file.filename = NULL;
--- 36,47 ----
{
static int count = 0;
int i;

! char *tmp;
!
! tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
! if (!tmp)
! tmp = "/tmp/";
!

buffer->p->a.file.offset_count = 0;
buffer->p->a.file.offsets = NULL;
buffer->p->a.file.filename = NULL;
***************
*** 46,52 ****
count++;

buffer->p->a.file.filename = elm_message(FRM("%selmsb-%d-%d"),
! temp_dir, getpid (),


count);

buffer->p->a.file.fh = safeopen_rdwr(buffer->p->a.file.filename);
--- 51,57 ----
count++;

buffer->p->a.file.filename = elm_message(FRM("%selmsb-%d-%d"),
! tmp, getpid (),


count);

buffer->p->a.file.fh = safeopen_rdwr(buffer->p->a.file.filename);

***************
*** 55,61 ****
DPRINT(Debug,25,(&Debug,
"stringbuffer: safeopen_rdwr: %s: %s (errno %d)\n",
buffer->p->a.file.filename,
! error_description(err),err));
free(buffer->p->a.file.filename);


buffer->p->a.file.filename = NULL;

} else
--- 60,66 ----
DPRINT(Debug,25,(&Debug,
"stringbuffer: safeopen_rdwr: %s: %s (errno %d)\n",
buffer->p->a.file.filename,
! strerror(err),err));
free(buffer->p->a.file.filename);


buffer->p->a.file.filename = NULL;

} else
***************
*** 98,104 ****
const struct string *string));
static void sb_add_line_to_file(buffer,string)
struct stringbuffer *buffer;
! CONST struct string *string;
{
int ptr = buffer->p->a.file.offset_count;

--- 103,109 ----
const struct string *string));
static void sb_add_line_to_file(buffer,string)
struct stringbuffer *buffer;
! const struct string *string;
{
int ptr = buffer->p->a.file.offset_count;

***************
*** 107,113 ****
DPRINT(Debug,1,(&Debug,
"stringbuffer: fseek (flush) failure: %s: %s (errno %d)\n",
buffer->p->a.file.filename,
! error_description(err),err));

return;
}
--- 112,118 ----
DPRINT(Debug,1,(&Debug,
"stringbuffer: fseek (flush) failure: %s: %s (errno %d)\n",
buffer->p->a.file.filename,
! strerror(err),err));

return;
}
***************
*** 146,152 ****

static int sb_linecount_file P_((const struct stringbuffer *ptr));
static int sb_linecount_file(ptr)
! CONST struct stringbuffer *ptr;
{
return ptr->p->a.file.offset_count;
}
--- 151,157 ----

static int sb_linecount_file P_((const struct stringbuffer *ptr));
static int sb_linecount_file(ptr)
! const struct stringbuffer *ptr;
{
return ptr->p->a.file.offset_count;
}
***************
*** 155,161 ****
stringbuffer *buffer,
int ptr));
static struct string *sb_get_line_from_file(buffer,ptr)
! CONST struct stringbuffer *buffer;
int ptr;
{
int setlen = 0;
--- 160,166 ----
stringbuffer *buffer,
int ptr));
static struct string *sb_get_line_from_file(buffer,ptr)
! const struct stringbuffer *buffer;
int ptr;
{
int setlen = 0;
***************
*** 175,181 ****
DPRINT(Debug,1,(&Debug,
"stringbuffer: fseek (flush) failure: %s: %s (errno %d)\n",
buffer->p->a.file.filename,
! error_description(err),err));
panic("STRINGBUFFER PANIC",__FILE__,__LINE__,"sb_get_line_from_file",
"Failed to flush or seek file",0);
}
--- 180,186 ----
DPRINT(Debug,1,(&Debug,
"stringbuffer: fseek (flush) failure: %s: %s (errno %d)\n",
buffer->p->a.file.filename,
! strerror(err),err));
panic("STRINGBUFFER PANIC",__FILE__,__LINE__,"sb_get_line_from_file",
"Failed to flush or seek file",0);
}
Index: elmME+.2.5.alpha5-cvs/lib/sb_mem.c
*** elmME+.2.5.alpha4/lib/sb_mem.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/sb_mem.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: sb_mem.c,v 1.5.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: sb_mem.c,v 1.5.8.2 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 38,44 ****
const struct string *string));
static void sb_add_line_to_mem(buffer,string)
struct stringbuffer *buffer;
! CONST struct string *string;
{
int ptr = buffer->p->a.mem.string_count;

--- 38,44 ----
const struct string *string));
static void sb_add_line_to_mem(buffer,string)
struct stringbuffer *buffer;
! const struct string *string;
{
int ptr = buffer->p->a.mem.string_count;

***************
*** 51,57 ****

static int sb_linecount_mem P_((const struct stringbuffer *ptr));
static int sb_linecount_mem(ptr)
! CONST struct stringbuffer *ptr;
{
return ptr->p->a.mem.string_count;
}
--- 51,57 ----

static int sb_linecount_mem P_((const struct stringbuffer *ptr));
static int sb_linecount_mem(ptr)
! const struct stringbuffer *ptr;
{
return ptr->p->a.mem.string_count;
}
***************
*** 60,66 ****
stringbuffer *buffer,
int ptr));
static struct string *sb_get_line_from_mem(buffer,ptr)
! CONST struct stringbuffer *buffer;
int ptr;
{
if (ptr < 0 || ptr >= buffer->p->a.mem.string_count)
--- 60,66 ----
stringbuffer *buffer,
int ptr));
static struct string *sb_get_line_from_mem(buffer,ptr)
! const struct stringbuffer *buffer;
int ptr;
{
if (ptr < 0 || ptr >= buffer->p->a.mem.string_count)
Index: elmME+.2.5.alpha5-cvs/lib/schedule.c
*** elmME+.2.5.alpha4/lib/schedule.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/schedule.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: schedule.c,v 1.18.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: schedule.c,v 1.18.8.4 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 15,21 ****
extern int errno;
#endif

! VOLATILE int wait_can_signal = 0;

int no_action_routine(fd,data)
int fd;
--- 15,21 ----
extern int errno;
#endif

! volatile int wait_can_signal = 0;

int no_action_routine(fd,data)
int fd;
***************
*** 336,342 ****
err = errno;
DPRINT(Debug,20,(&Debug,
"select: %s (errno %d)\n",
! error_description(err),err));
result = 0;
break;
}
--- 336,342 ----
err = errno;
DPRINT(Debug,20,(&Debug,
"select: %s (errno %d)\n",
! strerror(err),err));
result = 0;
break;
}
***************
*** 596,602 ****
err = errno;
DPRINT(Debug,20,(&Debug,
"select: %s (errno %d)\n",
! error_description(err),err));
result = 0;
break;
}
--- 596,602 ----
err = errno;
DPRINT(Debug,20,(&Debug,
"select: %s (errno %d)\n",
! strerror(err),err));
result = 0;
break;
}
***************
*** 793,802 ****
i,actions[i].fd));
next_timeout = time(NULL);
if (ANY_ACTION == action ||
! no_action_routine != action &&
! (action == actions[i].read_act ||
! action == actions[i].write_act ||
! action == actions[i].timeout_act)
) {
DPRINT(Debug,4,(&Debug,
"** Schedule action %d (fd=%d): Ready\n",
--- 793,803 ----
i,actions[i].fd));
next_timeout = time(NULL);
if (ANY_ACTION == action ||
! ( no_action_routine != action &&
! (action == actions[i].read_act ||
! action == actions[i].write_act ||
! action == actions[i].timeout_act)
! )
) {
DPRINT(Debug,4,(&Debug,
"** Schedule action %d (fd=%d): Ready\n",
***************
*** 804,809 ****
--- 805,812 ----
done = 1;
}
break;
+ default:
+ break;
}

actions[i].busy = 0;
Index: elmME+.2.5.alpha5-cvs/lib/service_list.c
*** elmME+.2.5.alpha4/lib/service_list.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/service_list.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: service_list.c,v 1.26.8.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: service_list.c,v 1.26.8.5 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 68,77 ****
};


! CONST struct service_type * IMAP_SERVICE = & SERVICE_TYPES[1];
! CONST struct service_type * POP_SERVICE = & SERVICE_TYPES[2];
! CONST struct service_type * SUBMISSION_SERVICE = & SERVICE_TYPES[3];
! CONST struct service_type * SMTP_SERVICE = & SERVICE_TYPES[4];


static void zero_service_entry P_((struct service_entry *entry,
--- 68,77 ----
};


! const struct service_type * IMAP_SERVICE = & SERVICE_TYPES[1];
! const struct service_type * POP_SERVICE = & SERVICE_TYPES[2];
! const struct service_type * SUBMISSION_SERVICE = & SERVICE_TYPES[3];
! const struct service_type * SMTP_SERVICE = & SERVICE_TYPES[4];


static void zero_service_entry P_((struct service_entry *entry,
***************
*** 80,87 ****
int flags));
static void zero_service_entry(entry,name,st,flags)
struct service_entry *entry;
! CONST char *name;
! CONST struct service_type *st;
int flags;
{
bzero((void *)entry,sizeof (*entry));
--- 80,87 ----
int flags));
static void zero_service_entry(entry,name,st,flags)
struct service_entry *entry;
! const char *name;
! const struct service_type *st;
int flags;
{
bzero((void *)entry,sizeof (*entry));
***************
*** 126,132 ****
const char *name));
static void add_alias_to_entry(entry,name)
struct service_entry *entry;
! CONST char *name;
{
entry->aliases_list =
safe_realloc(entry->aliases_list,
--- 126,132 ----
const char *name));
static void add_alias_to_entry(entry,name)
struct service_entry *entry;
! const char *name;
{
entry->aliases_list =
safe_realloc(entry->aliases_list,
***************
*** 173,179 ****
static int add_option_type_to_entry(entry,Y,prefix)
struct service_entry *entry;
struct SE_option_type * Y;
! CONST char * prefix;
{
entry->option_list =
safe_realloc(entry->option_list,
--- 173,179 ----
static int add_option_type_to_entry(entry,Y,prefix)
struct service_entry *entry;
struct SE_option_type * Y;
! const char * prefix;
{
entry->option_list =
safe_realloc(entry->option_list,
***************
*** 194,201 ****
const struct
service_type *st));
static struct service_entry *malloc_service_entry(name,st)
! CONST char * name;
! CONST struct service_type *st;
{
struct service_entry *ret = safe_malloc (sizeof (struct service_entry));

--- 194,201 ----
const struct
service_type *st));
static struct service_entry *malloc_service_entry(name,st)
! const char * name;
! const struct service_type *st;
{
struct service_entry *ret = safe_malloc (sizeof (struct service_entry));

***************
*** 401,409 ****
}
}

! static int name_ok P_((CONST char *name));
static int name_ok(name)
! CONST char *name;
{


if ('\0' == *name)

return 0;
--- 401,409 ----
}
}

! static int name_ok P_((const char *name));
static int name_ok(name)
! const char *name;
{


if ('\0' == *name)

return 0;
***************
*** 509,515 ****
static struct service_entry *scan_list P_((const char *hostname,
int flag));
static struct service_entry *scan_list(hostname,flag)
! CONST char *hostname;
int flag;
{
struct service_entry *ret = NULL;
--- 509,515 ----
static struct service_entry *scan_list P_((const char *hostname,
int flag));
static struct service_entry *scan_list(hostname,flag)
! const char *hostname;
int flag;
{
struct service_entry *ret = NULL;
***************
*** 579,585 ****

static struct hostent * lookup_name P_((const char *hostname,int silent));
static struct hostent * lookup_name(hostname,silent)
! CONST char *hostname;
int silent;
{


struct hostent *he = NULL;

--- 579,585 ----

static struct hostent * lookup_name P_((const char *hostname,int silent));
static struct hostent * lookup_name(hostname,silent)
! const char *hostname;
int silent;
{


struct hostent *he = NULL;

***************
*** 678,684 ****


struct service_entry * give_service_entry(hostname,flag)
! CONST char *hostname;
int flag;
{
struct service_entry *ret;
--- 678,684 ----


struct service_entry * give_service_entry(hostname,flag)
! const char *hostname;
int flag;
{
struct service_entry *ret;
***************
*** 699,707 ****
if (ret)
hostname = ret->official_name;

! if (ret && (0 != (ret->flags & SE_given_name_addr) &&
! ret->addr_count == 0 ||
! 0 != (ret->flags & SE_rescan_name_addr))) {
int x;

/* Clear data on case of rescan */
--- 699,711 ----
if (ret)
hostname = ret->official_name;

! if (ret && (
! ( 0 != (ret->flags & SE_given_name_addr) &&
! ret->addr_count == 0 )
! ||
! 0 != (ret->flags & SE_rescan_name_addr)
! )
! ) {
int x;

/* Clear data on case of rescan */
***************
*** 723,731 ****
}
}

! if (!ret ||
! 0 == (ret->flags & SE_given_addr) &&
! 0 == (ret->flags & SE_given_name_addr)) {

struct hostent *he = lookup_name(hostname,
/* Silent: */
--- 727,737 ----
}
}

! if (!ret || (
! 0 == (ret->flags & SE_given_addr) &&
! 0 == (ret->flags & SE_given_name_addr)
! )
! ) {

struct hostent *he = lookup_name(hostname,
/* Silent: */
***************
*** 923,929 ****
}

int parse_service_entries (filename,system, errors)
! CONST char *filename;
int system;
int *errors;
{
--- 929,935 ----
}

int parse_service_entries (filename,system, errors)
! const char *filename;
int system;
int *errors;
{
***************
*** 940,946 ****
if (err) {
DPRINT(Debug,2,(&Debug,
"parse_service_entries=0: %s: %s (can_open)\n",
! filename,error_description(err)));
return 0;
}
}
--- 946,952 ----
if (err) {
DPRINT(Debug,2,(&Debug,
"parse_service_entries=0: %s: %s (can_open)\n",
! filename,strerror(err)));
return 0;
}
}
***************
*** 950,956 ****
int err = errno;
DPRINT(Debug,2,(&Debug,
"parse_service_entries=0: %s: %s\n",
! filename,error_description(err)));
return 0;
}

--- 956,962 ----
int err = errno;
DPRINT(Debug,2,(&Debug,
"parse_service_entries=0: %s: %s\n",
! filename,strerror(err)));
return 0;
}

Index: elmME+.2.5.alpha5-cvs/lib/shared_all.c
*** elmME+.2.5.alpha4/lib/shared_all.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/shared_all.c 2005-07-23 20:14:14.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.2.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_all.c,v 1.2.8.4 2005/07/23 17:14:14 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 16,24 ****
--- 16,29 ----
DEBUG_VAR(Debug,__FILE__,"dl");

#include "shared_imp.h"
+ #include "rc_imp.h"
#include "save_opts.h"
#include "cs_imp.h"

+
+
+
+
#include "s_me.h"

#if ANSI_C
***************

*** 27,50 ****
#define S_(x)
#endif


- static void mark_changed P_((void *A));
- static void mark_changed(A)
- void *A;
- {
- int x;
-
- for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
- if (save_info[x].val.dummy == A)
- save_info[x].flags |= FL_CHANGED | FL_LOCAL;
- }
- }

! static SHAREDLIB * shared_lib_lists[] = {
&use_shared_base,
&use_shared_connect,
- NULL
};

S_(sl_reg_functions sl_reg_all)

static int sl_reg_all P_((struct ImpInfo *i,
int reg_idx));

static int sl_reg_all P_((struct ImpInfo *i,
int reg_idx));

*** 127,134 ****
struct ImpInfo *i;
int reg_idx;
{


struct reg_list *r = & (i->regs[reg_idx]);

!
}


--- 143,151 ----
struct ImpInfo *i;
int reg_idx;
{
+ #if 0


struct reg_list *r = & (i->regs[reg_idx]);

! #endif


}


***************
*** 188,194 ****
int found = 0;
int k;

! for (k = 0; shared_lib_lists[k]; k++) {

int m = give_rnum(I,shared_lib_lists[k]);

/* First assume validity ... */
--- 205,211 ----


int found = 0;
int k;

! for (k = 0; k < shared_lib_lists_count; k++) {
int m = give_rnum(I,shared_lib_lists[k]);

/* First assume validity ... */
***************
*** 196,202 ****

if (reg_code1(I,m)) {
found++;
! mark_changed((void *)shared_lib_lists[k]);

shared_lib_lists[k]->libraries_loaded = 0;
} else {

--- 213,219 ----



if (reg_code1(I,m)) {
found++;
! mark_local_changed((void *)shared_lib_lists[k]);

shared_lib_lists[k]->libraries_loaded = 0;
} else {

Index: elmME+.2.5.alpha5-cvs/lib/shared_base.c
*** elmME+.2.5.alpha4/lib/shared_base.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/shared_base.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_base.c,v 1.2.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_base.c,v 1.2.8.4 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 16,21 ****


--- 16,22 ----
DEBUG_VAR(Debug,__FILE__,"dl");

#include "shared_imp.h"
+ #include "rc_imp.h"
#include "save_opts.h"
#include "cs_imp.h"

***************
*** 28,34 ****

S_(CS_auto_charset_f no_cs_auto_charset)
static int no_cs_auto_charset(name,type,map)
! CONST char *name;
struct charset_type **type;
struct map_info **map;
{
--- 29,35 ----

S_(CS_auto_charset_f no_cs_auto_charset)
static int no_cs_auto_charset(name,type,map)
! const char *name;
struct charset_type **type;
struct map_info **map;
{
***************
*** 174,180 ****
--- 175,183 ----
struct ImpInfo *i;
int reg_idx;
{
+ #if 0


struct reg_list *r = & (i->regs[reg_idx] );

+ #endif

}

***************
*** 197,203 ****


struct charset_type * find_shared_CS_type(val)
! CONST char *val;
{
int i;

--- 200,206 ----


struct charset_type * find_shared_CS_type(val)
! const char *val;
{
int i;

***************
*** 242,248 ****
}

int cs_auto_charset(name,type,map)
! CONST char *name;
struct charset_type **type;
struct map_info **map;
{
--- 245,251 ----
}

int cs_auto_charset(name,type,map)
! const char *name;
struct charset_type **type;
struct map_info **map;
{
Index: elmME+.2.5.alpha5-cvs/lib/shared.c
*** elmME+.2.5.alpha4/lib/shared.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/shared.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared.c,v 1.54.8.3 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: shared.c,v 1.54.8.7 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.54.8.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 17,28 ****

#include "shared_imp.h"
#include "mbx_imp.h"
- #include "save_opts.h"
#include "rc_imp.h"
#include "s_me.h"
#include "cs_imp.h"
#include "ss_imp.h"
- #include "mailer_imp.h"

#include "s_elm.h"

--- 17,27 ----

#include "shared_imp.h"
#include "mbx_imp.h"

#include "rc_imp.h"
+ #include "save_opts.h"

#include "s_me.h"
#include "cs_imp.h"
#include "ss_imp.h"

#include "s_elm.h"

***************

*** 65,71 ****
static char * give_shname P_((const char *tag));

static char * give_shname(tag)
! CONST char *tag;
{
char * ret = elm_message(FRM("%s/%s%s%s"),
SHARED_DIR,
--- 64,70 ----
static char * give_shname P_((const char *tag));

static char * give_shname(tag)
! const char *tag;
{
char * ret = elm_message(FRM("%s/%s%s%s"),
SHARED_DIR,
***************
*** 88,94 ****

static wants_rand_bits_f no_wants_rand_bits;
static void no_wants_rand_bits (buf,size,entropy_bits)
! CONST char *buf;
int size;
int entropy_bits;
{
--- 87,93 ----

static wants_rand_bits_f no_wants_rand_bits;
static void no_wants_rand_bits (buf,size,entropy_bits)
! const char *buf;
int size;
int entropy_bits;
{
***************
*** 96,102 ****
}

struct ImpInfo * give_impinfo(tag)
! CONST char * tag;
{
int i;

--- 95,101 ----
}

struct ImpInfo * give_impinfo(tag)
! const char * tag;
{
int i;

***************
*** 143,148 ****

*** 418,424 ****
}

int tag_ok(name)
! CONST char *name;
{


if ('\0' == *name)

return 0;
--- 446,452 ----
}

int tag_ok(name)
! const char *name;
{


if ('\0' == *name)

return 0;
***************
*** 436,442 ****

static int locate_and_load_library P_((const char *prefix));
static int locate_and_load_library(prefix)
! CONST char *prefix;
{
int i;

--- 464,470 ----

static int locate_and_load_library P_((const char *prefix));
static int locate_and_load_library(prefix)
! const char *prefix;
{
int i;



***************
*** 499,506 ****
--- 527,550 ----
if (var->shared_list[i]->valid) {

int r = give_rnum(var->shared_list[i],var);

+ DPRINT(Debug,7,(&Debug,


+ "Prosessing [var %p] %d, %s : valid=%d => r=%d\n",
+ var, i,
+ var->shared_list[i]->shname,
+ var->shared_list[i]->valid,
+ r));
+
reg_code1(var->shared_list[i],r);

+ } else {
+
+ DPRINT(Debug,7,(&Debug,
+ "Skipping [var %p] %d, %s : valid=%d\n",
+ var, i,
+ var->shared_list[i]->shname,
+ var->shared_list[i]->valid));
+
+
}
}

***************
*** 553,558 ****
--- 597,606 ----
I->regs[rnum].valid = 1;
S->libraries_loaded = 0;

+ DPRINT(Debug,10,(&Debug,
+ "process_lib_reg: [%p]->regs[%d].valid=%d\n",

+ I,rnum,I->regs[rnum].valid));
+
} else {
int err = errno;

***************
*** 560,566 ****
MeNonExistUseXLib,
"%s: %s: %s: %s"),
r->name,I->tag,I->shname,
! error_description(err));
ret = 0;
}
}
--- 608,614 ----
MeNonExistUseXLib,
"%s: %s: %s: %s"),
r->name,I->tag,I->shname,
! strerror(err));
ret = 0;
}
}
***************


*** 572,584 ****
}

S_(rc_parse_line dt_SHARED_parse_line)

! static int dt_SHARED_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;
{

int i;

--- 620,631 ----
}

S_(rc_parse_line dt_SHARED_parse_line)

! static int dt_SHARED_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
{

int i;

***************
*** 606,611 ****
--- 653,667 ----

if (r->val.shared == r->val.shared->shared_list[i]->regs[j].var) {

r->val.shared->shared_list[i]->regs[j].valid = 0;
+
+

+ DPRINT(Debug,10,(&Debug,
+ "dt_SHARED_parse_line: [%p]->regs[%d].valid=%d\n",
+ r->val.shared->shared_list[i],
+ j,
+ r->val.shared->shared_list[i]->regs[j].valid));
+
+
goto found1;
}

***************

*** 706,712 ****


/* static pointer to buffer accross invocations */

static char * return_buffer = NULL;

int i;
- int len=0;

return_buffer = strmcpy(return_buffer,""); /* Reset result */

--- 762,767 ----
***************
*** 769,775 ****
}

struct SE_option_type * get_option_type(prefix)
! CONST char *prefix;
{
int i;
int idx1 = locate_and_load_library(prefix);
--- 824,830 ----
}

struct SE_option_type * get_option_type(prefix)
! const char *prefix;
{
int i;
int idx1 = locate_and_load_library(prefix);
***************
*** 796,801 ****
--- 851,900 ----


return NULL;
}

+ void mark_shared_changed(A)
+ void *A;

+ {
+ int i;
+

+ for (i = 0; i < library_list_count; i++) {
+ int x;
+

+ if (!library_list[i]->handle)
+ continue;

+

+ for (x = 0; x < library_list[i]->rc_option_count; x++) {
+
+ if (library_list[i]->rc_options[x].val.dummy == A) {

+ mark_XX(& (library_list[i]->rc_options[x]));
+ }
+
+ }
+ }
+ }
+
+
+ void mark_fshared_changed(A)
+ option_func *A;


+ {
+ int i;
+

+ for (i = 0; i < library_list_count; i++) {
+ int x;
+

+ if (!library_list[i]->handle)
+ continue;

+

+ for (x = 0; x < library_list[i]->rc_option_count; x++) {
+
+ if (library_list[i]->rc_options[x].func_val == A) {
+ mark_XX(& (library_list[i]->rc_options[x]));

+ }
+
+ }
+ }
+ }

+
+

int give_options(tag,rc_options,rc_option_count)
char *tag;

***************
*** 821,827 ****
int entropy_bits);

static void seed_rand_bits1(buf,size,entropy_bits)
! CONST char *buf;
int size;
int entropy_bits;
{
--- 920,926 ----
int entropy_bits);

static void seed_rand_bits1(buf,size,entropy_bits)
! const char *buf;
int size;
int entropy_bits;
{
***************
*** 849,855 ****
}

void seed_rand_bits(buf,size,entropy_bits)
! CONST char *buf;
int size;
int entropy_bits;
{
--- 948,954 ----
}

void seed_rand_bits(buf,size,entropy_bits)
! const char *buf;
int size;
int entropy_bits;
{

Kari E. Hurtta

unread,
Jul 28, 2005, 12:27:59 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.5

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 5/20 ) =========
Index: elmME+.2.5.alpha5-cvs/lib/cs_utf.c
*** elmME+.2.5.alpha4/lib/cs_utf.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/cs_utf.c 2005-07-26 11:28:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_utf.c,v 1.27.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cs_utf.c,v 1.27.8.4 2005/07/26 08:28:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27.8.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************
*** 131,153 ****
"Map %s initialized\n",map->map_name));
}

! struct map_info map_utf8 = { &cs_utf8, "UNICODE", 0, map_init_utfX, 0 };
! struct map_info map_utf7 = { &cs_utf7, "UNICODE", 0, map_init_utfX, 0 };

! static struct map_info map_imap = { &cs_imap, "UNICODE", 0, map_init_utfX, 0 };

/* 'imap' charset -- used for IMAP_name_convention */

static struct charcode_info imap_encoding = {
&cs_imap, &map_imap, SET_valid, "*IMAP*", NULL, NULL
};
! CONST charset_t IMAP_ENCODING = &imap_encoding;

static int read_elemlist P_((const char *name,
struct utfelem ** elems,
int *elemcount));
static int read_elemlist(name,elems,elemcount)
! CONST char *name;
struct utfelem ** elems;
int *elemcount;
{
--- 131,159 ----
"Map %s initialized\n",map->map_name));
}

! struct map_info map_utf8 = { &cs_utf8, "UNICODE", 0, map_init_utfX,
! { NULL }, { NULL }, { NULL }
! };
! struct map_info map_utf7 = { &cs_utf7, "UNICODE", 0, map_init_utfX,
! { NULL }, { NULL }, { NULL }
! };

! static struct map_info map_imap = { &cs_imap, "UNICODE", 0, map_init_utfX,
! { NULL }, { NULL }, { NULL }
! };

/* 'imap' charset -- used for IMAP_name_convention */

static struct charcode_info imap_encoding = {
&cs_imap, &map_imap, SET_valid, "*IMAP*", NULL, NULL
};
! const charset_t IMAP_ENCODING = &imap_encoding;

static int read_elemlist P_((const char *name,
struct utfelem ** elems,
int *elemcount));
static int read_elemlist(name,elems,elemcount)
! const char *name;
struct utfelem ** elems;
int *elemcount;
{
***************
*** 250,256 ****

static struct map_info * open_utf8_map P_((const char * map_name));
static struct map_info * open_utf8_map(map_name)
! CONST char * map_name;
{
struct map_info *ret = NULL;
struct utfelem * elems;
--- 256,262 ----

static struct map_info * open_utf8_map P_((const char * map_name));
static struct map_info * open_utf8_map(map_name)
! const char * map_name;
{
struct map_info *ret = NULL;
struct utfelem * elems;
***************
*** 272,278 ****

static struct map_info * open_utf7_map P_((const char * map_name));
static struct map_info * open_utf7_map(map_name)
! CONST char * map_name;
{
struct map_info *ret = NULL;
struct utfelem * elems;
--- 278,284 ----

static struct map_info * open_utf7_map P_((const char * map_name));
static struct map_info * open_utf7_map(map_name)
! const char * map_name;
{
struct map_info *ret = NULL;
struct utfelem * elems;
***************
*** 295,301 ****

static struct map_info * open_imap_map P_((const char * map_name));
static struct map_info * open_imap_map(map_name)
! CONST char * map_name;
{
struct map_info *ret = NULL;
struct utfelem * elems;
--- 301,307 ----

static struct map_info * open_imap_map P_((const char * map_name));
static struct map_info * open_imap_map(map_name)
! const char * map_name;
{
struct map_info *ret = NULL;
struct utfelem * elems;
***************
*** 450,456 ****
const struct string *data));
static void cs_add_intdata_to_utf(str,data)
struct string *str;
! CONST struct string *data;
{


if (data->p->len > 0) {

int i;
--- 456,462 ----
const struct string *data));
static void cs_add_intdata_to_utf(str,data)
struct string *str;
! const struct string *data;
{


if (data->p->len > 0) {

int i;
***************
*** 474,480 ****
*/
static void cs_check_length_utf P_((const struct string *str));
static void cs_check_length_utf(str)
! CONST struct string *str;
{
if (str->p->len > 0) {
int L = str->p->len;
--- 480,486 ----
*/
static void cs_check_length_utf P_((const struct string *str));
static void cs_check_length_utf(str)
! const struct string *str;
{
if (str->p->len > 0) {
int L = str->p->len;
***************
*** 532,538 ****
static uint16 cs_give_unicode_from_utf P_((const struct string *str,
int pos, int *found));
static uint16 cs_give_unicode_from_utf(str,pos,found)
! CONST struct string *str;
int pos;
int *found;
{
--- 538,544 ----
static uint16 cs_give_unicode_from_utf P_((const struct string *str,
int pos, int *found));
static uint16 cs_give_unicode_from_utf(str,pos,found)
! const struct string *str;
int pos;
int *found;
{
***************
*** 556,562 ****
static void cs_add_unicodedata_to_utf(str,len,data)
struct string *str;
int len;
! CONST uint16 *data;
{
if (len > 0) {
int i;
--- 562,568 ----
static void cs_add_unicodedata_to_utf(str,len,data)
struct string *str;
int len;
! const uint16 *data;
{
if (len > 0) {
int i;
***************
*** 576,585 ****
}
}

! static int cs_cmp_utf P_((struct string *str1,struct string *str2));
static int cs_cmp_utf(str1,str2)


! struct string *str1;
! struct string *str2;
{
int i;

--- 582,591 ----


}
}

! static int cs_cmp_utf P_((const struct string *str1,const struct string *str2));
static int cs_cmp_utf(str1,str2)

! const struct string *str1;
! const struct string *str2;
{
int i;

***************
*** 642,648 ****
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_utf8(str,printable,terminal,reslen)
! CONST struct string *str;
int printable;
screen_info_p terminal;
int *reslen;
--- 648,654 ----
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_utf8(str,printable,terminal,reslen)
! const struct string *str;
int printable;
screen_info_p terminal;
int *reslen;
***************
*** 973,979 ****
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_utf7(str,printable,terminal,reslen)
! CONST struct string *str;
int printable;
screen_info_p terminal;
int *reslen;
--- 979,985 ----
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_utf7(str,printable,terminal,reslen)
! const struct string *str;
int printable;
screen_info_p terminal;
int *reslen;
***************
*** 1011,1017 ****
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_imap(str,printable,terminal,reslen)
! CONST struct string *str;
int printable;
screen_info_p terminal;
int *reslen;
--- 1017,1023 ----
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_imap(str,printable,terminal,reslen)
! const struct string *str;
int printable;
screen_info_p terminal;
int *reslen;
***************
*** 1045,1051 ****

static int cs_can_ascii_utf P_((const struct string *str));
static int cs_can_ascii_utf(str)
! CONST struct string *str;
{
int i;
for (i = 0; i < str->p->len; i++) {
--- 1051,1057 ----

static int cs_can_ascii_utf P_((const struct string *str));
static int cs_can_ascii_utf(str)
! const struct string *str;
{
int i;
for (i = 0; i < str->p->len; i++) {
***************
*** 1061,1067 ****
screen_info_p terminal,
struct cs_printable_len *printable_len));
static unsigned char *cs_streamclip_from_utf8(str,pos,len,terminal,printable_len)
! CONST struct string *str;
int *pos;
int len;


screen_info_p terminal; /* NOT USED */

--- 1067,1073 ----
screen_info_p terminal,
struct cs_printable_len *printable_len));
static unsigned char *cs_streamclip_from_utf8(str,pos,len,terminal,printable_len)
! const struct string *str;
int *pos;
int len;


screen_info_p terminal; /* NOT USED */

***************
*** 1096,1102 ****
screen_info_p terminal,
struct cs_printable_len *printable_len));
static unsigned char *cs_streamclip_from_utf7(str,pos,len,terminal,printable_len)
! CONST struct string *str;
int *pos;
int len;


screen_info_p terminal; /* NOT USED */

--- 1102,1108 ----
screen_info_p terminal,
struct cs_printable_len *printable_len));
static unsigned char *cs_streamclip_from_utf7(str,pos,len,terminal,printable_len)
! const struct string *str;
int *pos;
int len;


screen_info_p terminal; /* NOT USED */

***************
*** 1138,1144 ****
screen_info_p terminal,
struct cs_printable_len *printable_len));
static unsigned char *cs_streamclip_from_imap(str,pos,len,terminal,printable_len)
! CONST struct string *str;
int *pos;
int len;


screen_info_p terminal; /* NOT USED */

--- 1144,1150 ----
screen_info_p terminal,
struct cs_printable_len *printable_len));
static unsigned char *cs_streamclip_from_imap(str,pos,len,terminal,printable_len)
! const struct string *str;
int *pos;
int len;


screen_info_p terminal; /* NOT USED */

***************
*** 1179,1185 ****
int *pos, int len));
static void cs_clip_from_utf(ret,str,pos,len)
struct string *ret;
! CONST struct string *str;
int *pos;
int len;
{
--- 1185,1191 ----
int *pos, int len));
static void cs_clip_from_utf(ret,str,pos,len)
struct string *ret;
! const struct string *str;


int *pos;
int len;
{
***************

*** 1225,1232 ****


const struct string *pattern,
int ignore_case));

static int cs_find_pattern_from_utf(str,pattern,ignore_case)
! CONST struct string *str;
! CONST struct string *pattern;
int ignore_case;
{
int ret = 0;
--- 1231,1238 ----


const struct string *pattern,
int ignore_case));

static int cs_find_pattern_from_utf(str,pattern,ignore_case)
! const struct string *str;
! const struct string *pattern;
int ignore_case;


{
int ret = 0;
***************

*** 1244,1250 ****
}

for (i = 0; i < str->p->len; ) {
! CONST int s = i + 1;



for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {

uint16 c2 = pattern->p->a.words[j];
--- 1250,1256 ----
}

for (i = 0; i < str->p->len; ) {
! const int s = i + 1;



for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {

uint16 c2 = pattern->p->a.words[j];


***************
*** 1271,1282 ****
/* Returns number of bytes added */

static int cs_add_streambytes_to_utf8 P_((struct string *str,

int count,
! const unsigned char *data));

! static int cs_add_streambytes_to_utf8(str,count,data)


struct string *str;
int count;

! CONST unsigned char *data;


{
if (count > 0) {
int i;
/* realloc with size 0 is equivalent of free and may

--- 1277,1292 ----


/* Returns number of bytes added */

static int cs_add_streambytes_to_utf8 P_((struct string *str,

int count,
! const unsigned char *data,
! int *errors));

! static int cs_add_streambytes_to_utf8(str,count,data, errors)

struct string *str;
int count;

! const unsigned char *data;
! int *errors;
{


+ *errors = 0;
+

if (count > 0) {
int i;
/* realloc with size 0 is equivalent of free and may
***************
*** 1302,1308 ****
"cs_add_streambytes_to_utf8: Failed to add byte, idx=%d\n",
i));

! break;
}

if (str->p->state->p->ready) {

--- 1312,1322 ----


"cs_add_streambytes_to_utf8: Failed to add byte, idx=%d\n",
i));

! handle_error:
! (*errors)++;
! str->p->a.words[str->p->len++] = MAPPING_NONE;
! cs_soft_reset_s_utf8(str->p->state);
! continue;
}

if (str->p->state->p->ready) {
***************
*** 1310,1316 ****
DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_utf8: Value (%X) out of range\n",
str->p->state->p->a.utf8.value));
! break;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf8.value;

--- 1324,1330 ----


DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_utf8: Value (%X) out of range\n",
str->p->state->p->a.utf8.value));
! goto handle_error;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf8.value;
***************
*** 1324,1335 ****

static int cs_add_streambytes_to_utf7 P_((struct string *str,

int count,
! const unsigned char *data));

! static int cs_add_streambytes_to_utf7(str,count,data)


struct string *str;
int count;

! CONST unsigned char *data;


{
if (count > 0) {
int i;
/* realloc with size 0 is equivalent of free and may

--- 1338,1353 ----

static int cs_add_streambytes_to_utf7 P_((struct string *str,

int count,
! const unsigned char *data,
! int *errors));

! static int cs_add_streambytes_to_utf7(str,count,data,errors)


struct string *str;
int count;

! const unsigned char *data;
! int *errors;
{


+ *errors = 0;
+

if (count > 0) {
int i;
/* realloc with size 0 is equivalent of free and may
***************
*** 1355,1361 ****
DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_utf7: Failed to add byte, idx=%d\n",
i));
! break;
}

if (str->p->state->p->ready) {

--- 1373,1383 ----


DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_utf7: Failed to add byte, idx=%d\n",
i));
! handle_error:
! (*errors) ++;
! str->p->a.words[str->p->len++] = MAPPING_NONE;
! cs_soft_reset_s_utf7(str->p->state);
! continue;
}

if (str->p->state->p->ready) {
***************
*** 1364,1370 ****
"cs_add_streambytes_to_utf7: Value (%X) out of range\n",
str->p->state->p->a.utf7.value));

! break;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf7.value;

--- 1386,1392 ----


"cs_add_streambytes_to_utf7: Value (%X) out of range\n",
str->p->state->p->a.utf7.value));

! goto handle_error;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf7.value;
***************
*** 1378,1389 ****

static int cs_add_streambytes_to_imap P_((struct string *str,

int count,
! const unsigned char *data));

! static int cs_add_streambytes_to_imap(str,count,data)


struct string *str;
int count;

! CONST unsigned char *data;


{
if (count > 0) {
int i;
/* realloc with size 0 is equivalent of free and may

--- 1400,1414 ----

static int cs_add_streambytes_to_imap P_((struct string *str,

int count,
! const unsigned char *data,
! int *errors));

! static int cs_add_streambytes_to_imap(str,count,data,errors)


struct string *str;
int count;

! const unsigned char *data;
! int *errors;


{
+ *errors = 0;
if (count > 0) {
int i;
/* realloc with size 0 is equivalent of free and may
***************
*** 1408,1414 ****
DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_imap: Failed to add byte, idx=%d\n",
i));
! break;
}

if (str->p->state->p->ready) {

--- 1433,1442 ----


DPRINT(Debug,10,(&Debug,
"cs_add_streambytes_to_imap: Failed to add byte, idx=%d\n",
i));
! handle_error:
! (*errors)++;
! str->p->a.words[str->p->len++] = MAPPING_NONE;
! continue;
}

if (str->p->state->p->ready) {
***************
*** 1417,1423 ****
"cs_add_streambytes_to_imap: Value (%X) out of range\n",
str->p->state->p->a.utf7.value));

! break;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf7.value;

--- 1445,1451 ----


"cs_add_streambytes_to_imap: Value (%X) out of range\n",
str->p->state->p->a.utf7.value));

! goto handle_error;
}
str->p->a.words[str->p->len++] =
str->p->state->p->a.utf7.value;

***************
*** 1431,1437 ****

static struct map_info * cs_find_utf8 P_((const char * map_name));
static struct map_info * cs_find_utf8(map_name)
! CONST char * map_name;
{
int i;
struct map_info *ret;
--- 1459,1465 ----

static struct map_info * cs_find_utf8 P_((const char * map_name));
static struct map_info * cs_find_utf8(map_name)
! const char * map_name;
{
int i;
struct map_info *ret;
***************
*** 1458,1464 ****

static struct map_info * cs_find_utf7 P_((const char * map_name));
static struct map_info * cs_find_utf7(map_name)
! CONST char * map_name;
{
int i;
struct map_info *ret;
--- 1486,1492 ----

static struct map_info * cs_find_utf7 P_((const char * map_name));
static struct map_info * cs_find_utf7(map_name)
! const char * map_name;
{
int i;
struct map_info *ret;
***************
*** 1485,1491 ****

static struct map_info * cs_find_imap P_((const char * map_name));
static struct map_info * cs_find_imap(map_name)
! CONST char * map_name;
{
int i;
struct map_info *ret;
--- 1513,1519 ----

static struct map_info * cs_find_imap P_((const char * map_name));
static struct map_info * cs_find_imap(map_name)
! const char * map_name;
{
int i;
struct map_info *ret;
***************
*** 1512,1518 ****

static void cs_remove_control_utf P_((const struct string *str));
static void cs_remove_control_utf(str)
! CONST struct string *str;
{
int i;

--- 1540,1546 ----

static void cs_remove_control_utf P_((const struct string *str));
static void cs_remove_control_utf(str)
! const struct string *str;
{
int i;

***************
*** 1974,1980 ****

S_(cs_estimate_clip_string cs_estimate_clip_unsupported)
static int cs_estimate_clip_unsupported(str,pos,len,terminal,printable_len)
! CONST struct string *str;
int pos;

int len; /* UPPER LIMIT */

screen_info_p terminal;
--- 2002,2008 ----

S_(cs_estimate_clip_string cs_estimate_clip_unsupported)
static int cs_estimate_clip_unsupported(str,pos,len,terminal,printable_len)
! const struct string *str;
int pos;

int len; /* UPPER LIMIT */

screen_info_p terminal;
Index: elmME+.2.5.alpha5-cvs/lib/cs_wfallback.c
*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/cs_wfallback.c 2005-07-23 20:14:12.000000000 +0300
***************
*** 0 ****
--- 1,237 ----
+ static char rcsid[] = "@(#)$Id: cs_wfallback.c,v 1.2.26.2 2005/07/23 17:14:12 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2.26.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+
+ #include "elm_defs.h"


+ #include "s_me.h"
+ #include "cs_imp.h"

+
+ #if 0
+ DEBUG_VAR(Debug,__FILE__,"charset");
+ #endif

+ { L'z', 0x007A /* ;*;LATIN SMALL LETTER Z;;; */ }
+ };
+

+ struct wfallback *wchar2unicode_hash[MAP_REV_MAP_DIV],
+ *unicode2wchar_hash[MAP_REV_MAP_DIV];

+
+

+ static int initialized = 0;
+
+ static void init_fallback() {

+ int i;
+

+ int col1 = 0, col2 = 0;

+

+ for (i = 0; i < MAP_REV_MAP_DIV; i++) {

+ wchar2unicode_hash[i] = NULL;
+ unicode2wchar_hash[i] = NULL;
+ }
+

+ for (i = 0; i < sizeof fallback_table / sizeof fallback_table[0]; i++) {
+ int x1 = fallback_table[i].c % MAP_REV_MAP_DIV;
+ int x2 = fallback_table[i].c1 % MAP_REV_MAP_DIV;
+
+ if (wchar2unicode_hash[x1])
+ col1++;
+ else
+ wchar2unicode_hash[x1] = & (fallback_table[i]);
+
+ if (unicode2wchar_hash[x1])
+ col2++;
+ else

+ unicode2wchar_hash[x1] = & (fallback_table[i]);
+
+ }
+

+ DPRINT(Debug,4,(&Debug,
+ "Wide fallback map initialized: wchar2unicode_hash %d collisions, unicode2wchar_hash %d collisions\n",
+ col1,col2));
+

+ initialized = 1;
+ }
+

+ uint16 map_wfallback(c)
+ wint_t c;
+ {
+ int x,i;
+
+ if (!initialized)
+ init_fallback();
+
+ x = c % MAP_REV_MAP_DIV;
+
+ if (!wchar2unicode_hash[x])
+ return MAPPING_NONE;
+
+ if (wchar2unicode_hash[x]->c == c)
+ return wchar2unicode_hash[x]->c1;

+

+ for (i = 0; i < sizeof fallback_table / sizeof fallback_table[0]; i++) {
+ if (fallback_table[i].c == c) {
+ return fallback_table[i].c1;
+ }
+ }
+ return MAPPING_NONE;
+ }
+
+ wchar_t map_wfallback_rev(val, found)
+ unsigned int val;
+ int *found;
+ {
+ int x,i;
+
+ if (!initialized)
+ init_fallback();
+
+ x = val % MAP_REV_MAP_DIV;
+
+ if (! unicode2wchar_hash[x]) {

+ *found = 0;
+

+ return L'?';
+ }
+
+ if (unicode2wchar_hash[x]->c1 == val) {
+ *found = 1;
+ return unicode2wchar_hash[x]->c;
+ }

+

+ for (i = 0; i < sizeof fallback_table / sizeof fallback_table[0]; i++) {
+ if (fallback_table[i].c1 == val) {
+ *found = 1;
+ return fallback_table[i].c;
+ }
+ }
+
+ *found = 0;
+ return L'?'; /* Not found */
+ }

+
+ #endif
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/lib/debug.c
*** elmME+.2.5.alpha4/lib/debug.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/debug.c 2005-07-26 11:28:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: debug.c,v 1.21.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: debug.c,v 1.21.8.4 2005/07/26 08:28:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.21.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 21,30 ****

struct debug_target {
int debug_fd;
! CONST char * file;

struct class_level_pair {
! CONST char * class;
int level;
} * match;
int match_count;
--- 21,30 ----

struct debug_target {
int debug_fd;
! const char * file;

struct class_level_pair {
! const char * class;
int level;
} * match;
int match_count;
***************
*** 35,49 ****
/* In startup quite huge number of debug output can be
needed to be buffered */
char buffer[4000];
! VOLATILE int buffer_ptr;

} * debug_list = NULL;

! static CONST char * DEBUG_base = "ELMLIB";

/* Given arhument must be statically alloced */
void init_debugfile(progname)
! CONST char *progname;
{
DEBUG_base = progname;
}
--- 35,49 ----
/* In startup quite huge number of debug output can be
needed to be buffered */
char buffer[4000];
! volatile int buffer_ptr;

} * debug_list = NULL;

! static const char * DEBUG_base = "ELMLIB";

/* Given arhument must be statically alloced */
void init_debugfile(progname)
! const char *progname;
{
DEBUG_base = progname;

***************
*** 128,134 ****
}

int set_debugging(arg)
! CONST char *arg;
{
struct debug_target * X = NULL;
char * match_filename = NULL;
--- 130,136 ----
}

int set_debugging(arg)
! const char *arg;
{
struct debug_target * X = NULL;
char * match_filename = NULL;
***************
*** 366,374 ****
{
/* Prefix with file name */
if (0 == a->target->buffer_ptr ||
! a->target->buffer_ptr > 0 &&
! a->target->buffer_ptr < sizeof (a->target->buffer) &&
! '\n' == a->target->buffer[a->target->buffer_ptr-1]) {
int i;

for (i = 0; i < 10 && a->file[i]; i++) {
--- 368,377 ----
{
/* Prefix with file name */
if (0 == a->target->buffer_ptr ||
! ( a->target->buffer_ptr > 0 &&
! a->target->buffer_ptr < sizeof (a->target->buffer) &&
! '\n' == a->target->buffer[a->target->buffer_ptr-1] )
! ) {
int i;

for (i = 0; i < 10 && a->file[i]; i++) {
***************
*** 528,534 ****
)
#if !ANSI_C
struct debug_struct *a;

! CONST char * format;

va_dcl
#endif
{
--- 531,537 ----
)
#if !ANSI_C
struct debug_struct *a;
! const char * format;
va_dcl
#endif
{
***************
*** 537,543 ****
int pos;

struct format_elem A[MAX_ARGS], *elems;
! CONST char * s;

va_list vl;

--- 540,546 ----
int pos;

struct format_elem A[MAX_ARGS], *elems;
! const char * s;

va_list vl;

***************
*** 720,732 ****
)
#if !ANSI_C
struct debug_struct *a;

! CONST char * format;

va_dcl
#endif
{
int count, pos;
char * format_error = NULL;
! CONST char *s;

struct format_elem A[MAX_ARGS];

--- 723,735 ----
)
#if !ANSI_C
struct debug_struct *a;
! const char * format;
va_dcl
#endif
{
int count, pos;
char * format_error = NULL;
! const char *s;

struct format_elem A[MAX_ARGS];

***************
*** 793,799 ****
#endif
)
#if !ANSI_C
! CONST char * format;
va_dcl
#endif
{
--- 796,802 ----
#endif
)
#if !ANSI_C
! const char * format;
va_dcl
#endif
{
***************
*** 812,818 ****

for (ptr = debug_list; ptr; ptr= ptr-> next) {
int i;
! CONST char *s;
int pos;

DEBUG_VAR(temp,__FILE__,"");
--- 815,821 ----

for (ptr = debug_list; ptr; ptr= ptr-> next) {
int i;
! const char *s;
int pos;

DEBUG_VAR(temp,__FILE__,"");
Index: elmME+.2.5.alpha5-cvs/lib/errno.c
*** elmME+.2.5.alpha4/lib/errno.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/errno.c 2005-07-23 22:01:34.000000000 +0300
***************
*** 1,15 ****
! static char rcsid[] = "@(#)$Id: errno.c,v 1.6.8.1 2004/04/18 16:55:37 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************


* The Elm Mail System

*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This routine maps error numbers to error names and error messages.
--- 1,25 ----
! static char rcsid[] = "@(#)$Id: errno.c,v 1.6.8.3 2005/07/23 19:01:34 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

******************************************************************************
+ * Based on Elm 2.4 src/erno.c. That code was following copyright:
+ *


* The Elm Mail System

*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
+ *****************************************************************************
+ * Incorparated Elm 2.5 code from lib/errno.c


+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *

+ * Copyright (c) 1988-1995 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor
*****************************************************************************/

/** This routine maps error numbers to error names and error messages.
***************
*** 23,31 ****

#include "elm_defs.h"

! #ifndef STRERROR
#ifdef ERRLST
! extern char *sys_errlist[];
extern int sys_nerr;
#else
static char *sys_errlist[] = {
--- 33,42 ----

#include "elm_defs.h"

! #ifndef STRERROR
!
#ifdef ERRLST
! extern char * sys_errlist[];
extern int sys_nerr;
#else
static char *sys_errlist[] = {
***************
*** 69,100 ****
};
static int sys_nerr = 37;
#endif /* ERRLST */
- #endif /* STRERROR */
-
- char *error_description(errnumber)
- int errnumber;
- {
- #ifdef STRERROR



! extern char *strerror();

! return strerror(errnumber);

!
! #else /* !STRERROR */
!
! static char buffer[50];
!
! if (errnumber < 0 || errnumber >= sys_nerr) {
! elm_sfprintf(buffer,sizeof buffer,
! FRM("ERR-UNKNOWN (%d)"), errnumber);
! return(buffer);
! }
!
! return( sys_errlist[errnumber] );
!
! #endif /* !STRERROR */
}

/*
* Local Variables:
* mode:c
--- 80,104 ----
};
static int sys_nerr = 37;
#endif /* ERRLST */

! #ifdef strerror
! # undef strerror
! #endif

! char *strerror(errnumber)
! int errnumber;
! {
! static char buffer[50];
! if (errnumber < 0 || errnumber >= sys_nerr) {
! elm_sfprintf(buffer,sizeof buffer,
! FRM("ERR-UNKNOWN (%d)"), errnumber);
! return(buffer);
! }
! return( sys_errlist[errnumber] );
}

+ #endif /* STRERROR */


+
/*
* Local Variables:
* mode:c

Index: elmME+.2.5.alpha5-cvs/lib/expand.c
*** elmME+.2.5.alpha4/lib/expand.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/expand.c 2005-07-26 11:28:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: expand.c,v 1.18.8.5 2004/05/16 07:42:23 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: expand.c,v 1.18.8.7 2005/07/26 08:28:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 42,53 ****


{
if (filename[0] == '+' || filename[0] == '%' || filename[0] == '=') {
char buffer[SLEN];
!
! strfcpy(buffer,folders, sizeof buffer);
! if (folders[0] && folders[strlen(folders)-1] != '/' &&
! filename[0] != '/')
! strfcat(buffer, "/", sizeof buffer);
!
strfcat(buffer,filename+1, sizeof buffer);

strfcpy(filename, buffer, size);

--- 42,56 ----


{
if (filename[0] == '+' || filename[0] == '%' || filename[0] == '=') {
char buffer[SLEN];

!
! /* give_dt_estr_as_str adds / to end */

! char * str = give_dt_estr_as_str(&folders_e,"maildir");
!
! if (!str)
! return 0;
!

! strfcpy(buffer,str, sizeof buffer);
!
strfcat(buffer,filename+1, sizeof buffer);

strfcpy(filename, buffer, size);
***************

*** 70,79 ****
*/
int expand_path(dest, src, destlen)
char *dest; /* pointer to space to hold the result */
! CONST char *src; /* pointer to string to expand */
unsigned destlen; /* size of the destination buffer */
{
! CONST char *src0 = src;
char *dest0 = dest;
int ret = 0; /* assume success */

--- 73,82 ----
*/
int expand_path(dest, src, destlen)
char *dest; /* pointer to space to hold the result */
! const char *src; /* pointer to string to expand */
unsigned destlen; /* size of the destination buffer */
{
! const char *src0 = src;
char *dest0 = dest;
int ret = 0; /* assume success */

***************
*** 116,123 ****
* Get the environment parameter name into "envname_buf"
* and advance "src" to the next path component.
*/
! CONST char *envname_front = ++src;
! CONST char *expval;
int len, p;
char envname_buf[SLEN];

--- 119,126 ----
* Get the environment parameter name into "envname_buf"
* and advance "src" to the next path component.
*/
! const char *envname_front = ++src;
! const char *expval;
int len, p;
char envname_buf[SLEN];

***************
*** 275,286 ****

int expand_meta(dest, src, destlen)
char *dest; /* pointer to space to hold the result */
! CONST char *src; /* pointer to string to expand */
unsigned destlen; /* size of the destination buffer */
{
! CONST char *src0 = src;
char *dest0 = dest;
! CONST char * c;
int ret = 0;

if (destlen < 1) {
--- 278,289 ----

int expand_meta(dest, src, destlen)
char *dest; /* pointer to space to hold the result */
! const char *src; /* pointer to string to expand */
unsigned destlen; /* size of the destination buffer */
{
! const char *src0 = src;
char *dest0 = dest;
! const char * c;
int ret = 0;

if (destlen < 1) {
***************
*** 293,317 ****
--destlen; /* reserve space for trailing '\0' */



if (src[0] == '+' || src[0] == '%' || src[0] == '=') {

! CONST char * expval;


int len,p;
! if (folders[0] == '\0') {
expval = "=";
ret = -1;
len = 1;
} else {
! expval = folders;
! len = strlen(folders);
}
strnfcpy(dest, expval, len, destlen,&p);
dest += p;
destlen -= p;
++src;
! if (folders[0] && folders[strlen(folders)-1] != '/' &&
! src[0] != '/' && destlen > 0) {
! *dest++ = '/';
! destlen--;
! }

if (expand_path(dest,src,destlen+1) < 0)
ret = -1;

--- 296,322 ----
--destlen; /* reserve space for trailing '\0' */



if (src[0] == '+' || src[0] == '%' || src[0] == '=') {

! const char * expval;
int len,p;


!
! /* give_dt_estr_as_str adds / to end */

! char * str = give_dt_estr_as_str(&folders_e,"maildir");
!

! if (!str) {
expval = "=";
ret = -1;
len = 1;
} else {
! expval = str;
! len = strlen(str);
}
strnfcpy(dest, expval, len, destlen,&p);
dest += p;
destlen -= p;
++src;
!
! if ('/' == src[0] && str)
! src++;

if (expand_path(dest,src,destlen+1) < 0)
ret = -1;

***************
*** 413,423 ****
*/
int expand_env(dest, src, destlen)
char *dest; /* pointer to space to hold the result */
! CONST char *src; /* pointer to string to expand */
unsigned destlen; /* size of the destination buffer */
{
int ret = 0; /* assume success */
! CONST char *src0 = src;

if (destlen < 1) {
DPRINT(Debug,1,(&Debug,
--- 418,428 ----
*/
int expand_env(dest, src, destlen)
char *dest; /* pointer to space to hold the result */
! const char *src; /* pointer to string to expand */
unsigned destlen; /* size of the destination buffer */
{
int ret = 0; /* assume success */
! const char *src0 = src;

if (destlen < 1) {
DPRINT(Debug,1,(&Debug,
***************
*** 431,437 ****
* Replace "~" at front with user's home directory.
*/
if (src[0] == '~' && (src[1] == '\0' || src[1] == '/')) {
! CONST char *expval;
int len, p;
if (home[0] == '\0') {
expval = "~";
--- 436,442 ----
* Replace "~" at front with user's home directory.
*/
if (src[0] == '~' && (src[1] == '\0' || src[1] == '/')) {
! const char *expval;
int len, p;
if (home[0] == '\0') {
expval = "~";
Index: elmME+.2.5.alpha5-cvs/lib/file_util.c
*** elmME+.2.5.alpha4/lib/file_util.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/file_util.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.9.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.9.8.3 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 25,31 ****
DEBUG_VAR(Debug,__FILE__,"file");

long file_bytes(name)
! CONST char *name;
{


/** return the number of bytes in the specified file. This

is to check to see if new mail has arrived.... (also
--- 25,31 ----
DEBUG_VAR(Debug,__FILE__,"file");

long file_bytes(name)
! const char *name;
{


/** return the number of bytes in the specified file. This

is to check to see if new mail has arrived.... (also
***************
*** 41,51 ****
if (err != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNoStat,
"File %.30s: %.40s"),
! name,error_description(err));

DPRINT(Debug,1,(&Debug,
"file_bytes: errno %s on fstat of file %s\n",
! error_description(err), name));
return -1L;
}
else
--- 41,51 ----
if (err != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNoStat,
"File %.30s: %.40s"),
! name,strerror(err));

DPRINT(Debug,1,(&Debug,
"file_bytes: errno %s on fstat of file %s\n",
! strerror(err), name));
return -1L;
}
else
***************
*** 66,72 ****
static char saved_fname[VERY_LONG_STRING];

int save_file_stats(fname)
! CONST char *fname;
{
/* if fname exists, save the owner, group, mode and filename.
* otherwise flag nothing saved. Return 0 if saved, else -1.
--- 66,72 ----
static char saved_fname[VERY_LONG_STRING];

int save_file_stats(fname)
! const char *fname;
{
/* if fname exists, save the owner, group, mode and filename.
* otherwise flag nothing saved. Return 0 if saved, else -1.
***************
*** 86,92 ****
}

int restore_file_stats(fname)
! CONST char *fname;
{
/* if fname matches the saved file name, set the owner and group
* of fname to the saved owner, group and mode,
--- 86,92 ----
}

int restore_file_stats(fname)
! const char *fname;
{
/* if fname matches the saved file name, set the owner and group
* of fname to the saved owner, group and mode,
***************
*** 192,198 ****
/* Open and possible creates file for updates */

FILE *open_or_create(name)
! CONST char *name;
{
FILE *fp;
int fd = open(name, O_RDWR | O_CREAT,0600);
--- 192,198 ----
/* Open and possible creates file for updates */

FILE *open_or_create(name)
! const char *name;
{
FILE *fp;
int fd = open(name, O_RDWR | O_CREAT,0600);
***************
*** 201,207 ****


int err = errno;
DPRINT(Debug,1,(&Debug,

"open_or_create: could not open file %s\n\tError: %s\n",
! name, error_description(err)));

return NULL;
}
--- 201,207 ----


int err = errno;
DPRINT(Debug,1,(&Debug,

"open_or_create: could not open file %s\n\tError: %s\n",
! name, strerror(err)));

return NULL;
}
***************
*** 230,236 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWriteFailedCopy,
"Write failed in copy: %s: %s"),
! to, error_description(err));
/*
* NEVER close anything just at whim!!
* If the file has been locked using fcntl() or lockf()
--- 230,236 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWriteFailedCopy,
"Write failed in copy: %s: %s"),
! to, strerror(err));
/*
* NEVER close anything just at whim!!
* If the file has been locked using fcntl() or lockf()
***************
*** 245,251 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReadFailedCopy2,
"Read failed in copy: %s"),
! error_description(err));
fflush(to);
return(1);
}
--- 245,251 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReadFailedCopy2,
"Read failed in copy: %s"),
! strerror(err));
fflush(to);
return(1);
}
***************
*** 254,260 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFlushFailedCopy,
"Flush failed in copy: %s"),
! error_description(err));
return(1);
}
return 0;
--- 254,260 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFlushFailedCopy,
"Flush failed in copy: %s"),
! strerror(err));
return(1);
}
return 0;
***************
*** 306,312 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCloseFailedCopy,
"Close failed in copy: %s: %s"),
! to, error_description(err));
return(1);
}
if (!isspool)
--- 306,312 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCloseFailedCopy,
"Close failed in copy: %s: %s"),
! to, strerror(err));
return(1);
}
if (!isspool)
***************
*** 316,322 ****
}

int elm_chown(file, userid, groupid)
! CONST char *file;
int userid, groupid;
{
#ifdef CHOWN_NEG1
--- 316,322 ----
}

int elm_chown(file, userid, groupid)
! const char *file;
int userid, groupid;
{
#ifdef CHOWN_NEG1
Index: elmME+.2.5.alpha5-cvs/lib/forwarded.c
*** elmME+.2.5.alpha4/lib/forwarded.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/forwarded.c 2005-07-20 19:49:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forwarded.c,v 1.6.8.1 2004/04/18 16:55:37 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forwarded.c,v 1.6.8.2 2005/07/20 16:49:40 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 29,41 ****

char machine[SLEN], who[SLEN], work[SLEN];
int count, pointer;

machine[0] = '\0';
who[0]='\0';

DPRINT(Debug,7,(&Debug,
"forwarded: buffer=%s, env_from_source=%d\n",
! buffer,env_from_source));

/* env_from_source:
0 == forward-from,

--- 29,42 ----

char machine[SLEN], who[SLEN], work[SLEN];
int count, pointer;
+ int e = give_dt_enumerate_as_int(&env_from_source);

machine[0] = '\0';
who[0]='\0';

DPRINT(Debug,7,(&Debug,
"forwarded: buffer=%s, env_from_source=%d\n",
! buffer,e));

/* env_from_source:
0 == forward-from,
***************

*** 43,49 ****
2 == return-path
*/


! if (env_from_source < 1) {
for (count = 0, pointer=0;
count < 10;
count++) {
--- 44,50 ----

2 == return-path
*/


! if (e < 1) {
for (count = 0, pointer=0;
count < 10;
count++) {

Index: elmME+.2.5.alpha5-cvs/lib/gcos_name.c
*** elmME+.2.5.alpha4/lib/gcos_name.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/gcos_name.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: gcos_name.c,v 1.9.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: gcos_name.c,v 1.9.8.2 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 15,21 ****
#include "elm_defs.h"

char * gcos_name(gcos_field, logname)
! CONST char *logname, *gcos_field;
{
/** Return the full name found in a passwd file gcos field **/

--- 15,21 ----
#include "elm_defs.h"

char * gcos_name(gcos_field, logname)
! const char *logname, *gcos_field;
{
/** Return the full name found in a passwd file gcos field **/

***************
*** 23,29 ****

static char fullname[SLEN];
char *fncp, *end;
! CONST char *gcoscp;
int first;

/* full name is all chars up to first ',' (or whole gcos, if no ',') */
--- 23,29 ----

static char fullname[SLEN];
char *fncp, *end;
! const char *gcoscp;
int first;

/* full name is all chars up to first ',' (or whole gcos, if no ',') */
***************
*** 34,40 ****
gcoscp++) {

if(*gcoscp == '&') {
! CONST char *lncp;

first = 1;
for(lncp = logname; *lncp && fncp < end; fncp++, lncp++)
--- 34,40 ----
gcoscp++) {

if(*gcoscp == '&') {
! const char *lncp;

first = 1;
for(lncp = logname; *lncp && fncp < end; fncp++, lncp++)
Index: elmME+.2.5.alpha5-cvs/lib/getaddr.c
*** elmME+.2.5.alpha4/lib/getaddr.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/lib/getaddr.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.22.8.2 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: getaddr.c,v 1.22.8.4 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 13,21 ****
DEBUG_VAR(Debug,__FILE__,"addr");

char **rfc822_tokenize(line)
! CONST char *line;
{
! CONST char * ptr;
char **res;
int len, count = 0,i;

--- 13,21 ----
DEBUG_VAR(Debug,__FILE__,"addr");

char **rfc822_tokenize(line)
! const char *line;
{
! const char * ptr;
char **res;
int len, count = 0,i;



***************
*** 40,48 ****
DPRINT(Debug,25,(&Debug,
" : [%i]=\"%s\"\n",i,res[i]));
}
! res[count] = NULL;
DPRINT(Debug,25,(&Debug,
! " : [%i]=NULL\n",count));
return res;
}

--- 40,48 ----
DPRINT(Debug,25,(&Debug,
" : [%i]=\"%s\"\n",i,res[i]));
}
! res[i] = NULL;
DPRINT(Debug,25,(&Debug,
! " : [%i]=NULL\n",i));
return res;
}

***************

*** 99,109 ****
free(res);
}

! static CONST unsigned char * csUs P_((const char *str));
! static CONST unsigned char * csUs(str)
! CONST char *str;
{
! return (CONST unsigned char *)str;
}


--- 99,109 ----
free(res);
}

! static const unsigned char * csUs P_((const char *str));
! static const unsigned char * csUs(str)
! const char *str;
{
! return (const unsigned char *)str;
}


***************
*** 111,117 ****
start,ended,demime,set,
comments,scanned)
char **tokenized;
! CONST char *tok_chars;
int start;
int *ended;
int demime;
--- 111,117 ----
start,ended,demime,set,
comments,scanned)
char **tokenized;
! const char *tok_chars;
int start;
int *ended;
int demime;
***************
*** 219,225 ****
struct string * res = NULL;


char * buffer = NULL;

int idx, max_idx;
!
DPRINT(Debug,25,(&Debug,
"scanned_to_phrase:"));
for (max_idx = 0; scanned[max_idx]; max_idx++) {
--- 219,226 ----

struct string * res = NULL;


char * buffer = NULL;

int idx, max_idx;
! const char *A,*B;


!
DPRINT(Debug,25,(&Debug,
"scanned_to_phrase:"));
for (max_idx = 0; scanned[max_idx]; max_idx++) {
***************
*** 242,247 ****
--- 243,253 ----
res = new_string(set);

DPRINT(Debug,25,(&Debug, "scanned_to_phrase=%S\n",res));
+ A = get_string_MIME_name(res);
+ B = get_string_lang(res);

+ DPRINT(Debug,25,(&Debug, " cs=%s lang=%s\n",
+ A ? A : "<none>", B ? B : "<none>"));
+
return res;
}

***************
*** 266,272 ****
}

struct addr_item * break_down_address (buffer, demime, defcharset)
! CONST char *buffer;
int demime;
charset_t defcharset;
{
--- 272,278 ----
}

struct addr_item * break_down_address (buffer, demime, defcharset)
! const char *buffer;
int demime;
charset_t defcharset;
{


***************
*** 402,407 ****
--- 408,416 ----
}
if (res[res_idx].addr || res[res_idx].fullname ||
res[res_idx].comment) {
+

+ const char *A,*B;


+
res[res_idx].addr = strmcat(res[res_idx].addr,"");
if (!res[res_idx].fullname)
res[res_idx].fullname = new_string(defcharset);
***************
*** 411,422 ****
--- 420,448 ----

"break_down_address: [%d].addr =%.100s\n",
res_idx,res[res_idx].addr));
+
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
+ A = get_string_MIME_name(res[res_idx].fullname);
+ B = get_string_lang(res[res_idx].fullname);
+ DPRINT(Debug,11,(&Debug,

+ " cs=%s lang=%s\n",


+ A ? A : "<none>",
+ B ? B : "<none>"));
+

+
DPRINT(Debug,11,(&Debug,
" .comment =%.100S\n",
res[res_idx].comment));
+
+ A = get_string_MIME_name(res[res_idx].comment);
+ B = get_string_lang(res[res_idx].comment);
+ DPRINT(Debug,11,(&Debug,

+ " cs=%s lang=%s\n",


+ A ? A : "<none>",
+ B ? B : "<none>"));
+

res_idx++;
}
break;
***************
*** 439,444 ****
--- 465,473 ----
}
if (res[res_idx].addr || res[res_idx].fullname
|| res[res_idx].comment) {
+

+ const char *A, *B;


+
res[res_idx].addr = strmcat(res[res_idx].addr,"");
if (!res[res_idx].fullname)
res[res_idx].fullname = new_string(defcharset);
***************
*** 452,461 ****
--- 481,507 ----
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
+
+ A = get_string_MIME_name(res[res_idx].fullname);
+ B = get_string_lang(res[res_idx].fullname);
+ DPRINT(Debug,11,(&Debug,

+ " cs=%s lang=%s\n",


+ A ? A : "<none>",
+ B ? B : "<none>"));
+

+
DPRINT(Debug,11,(&Debug,

" .comment =%.100S\n",
res[res_idx].comment));
+
+ A = get_string_MIME_name(res[res_idx].comment);
+ B = get_string_lang(res[res_idx].comment);
+ DPRINT(Debug,11,(&Debug,

+ " cs=%s lang=%s\n",


+ A ? A : "<none>",
+ B ? B : "<none>"));
+

res_idx++;
}
***************
*** 538,543 ****


--- 584,592 ----
}
if (res[res_idx].addr || res[res_idx].fullname
|| res[res_idx].comment) {
+

+ const char *A,*B;


+
res[res_idx].addr = strmcat(res[res_idx].addr,"");
if (!res[res_idx].fullname)
res[res_idx].fullname = new_string(defcharset);
***************
*** 550,559 ****
--- 599,622 ----
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
+ A = get_string_MIME_name(res[res_idx].fullname);
+ B = get_string_lang(res[res_idx].fullname);
+ DPRINT(Debug,11,(&Debug,

+ " cs=%s lang=%s\n",


+ A ? A : "<none>",
+ B ? B : "<none>"));
+

DPRINT(Debug,11,(&Debug,
" .comment =%.100S\n",
res[res_idx].comment));

+ A = get_string_MIME_name(res[res_idx].comment);
+ B = get_string_lang(res[res_idx].comment);
+ DPRINT(Debug,11,(&Debug,

+ " cs=%s lang=%s\n",


+ A ? A : "<none>",
+ B ? B : "<none>"));
+

res_idx++;
}
break;
***************
*** 585,590 ****
--- 648,655 ----
}
if (res[res_idx].addr || res[res_idx].fullname
|| res[res_idx].comment) {

+ const char *A, *B;


+
res[res_idx].addr = strmcat(res[res_idx].addr,"");
if (!res[res_idx].fullname)
res[res_idx].fullname = new_string(defcharset);
***************
*** 597,606 ****
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
DPRINT(Debug,11,(&Debug,
" .comment =%.100S\n",
res[res_idx].comment));
!

res_idx++;
}
--- 662,684 ----
DPRINT(Debug,11,(&Debug,
" .fullname=%.100S\n",
res[res_idx].fullname));
+ A = get_string_MIME_name(res[res_idx].fullname);
+ B = get_string_lang(res[res_idx].fullname);
+ DPRINT(Debug,11,(&Debug,

+ " cs=%s lang=%s\n",


+ A ? A : "<none>",
+ B ? B : "<none>"));
+

DPRINT(Debug,11,(&Debug,
" .comment =%.100S\n",
res[res_idx].comment));
! A = get_string_MIME_name(res[res_idx].comment);
! B = get_string_lang(res[res_idx].comment);
! DPRINT(Debug,11,(&Debug,
! " cs=%s lang=%s\n",

! A ? A : "<none>",
! B ? B : "<none>"));
!

res_idx++;
}
Index: elmME+.2.5.alpha5-cvs/lib/getarpdate.c
*** elmME+.2.5.alpha4/lib/getarpdate.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/getarpdate.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getarpdate.c,v 1.8.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: getarpdate.c,v 1.8.8.2 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 14,23 ****

#include "elm_defs.h"

! CONST char *arpa_dayname[8] = { "Sun", "Mon", "Tue", "Wed", "Thu",
"Fri", "Sat", "" };

! CONST char *arpa_monname[13] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};

char * get_arpa_date()
--- 14,23 ----

#include "elm_defs.h"

! const char *arpa_dayname[8] = { "Sun", "Mon", "Tue", "Wed", "Thu",
"Fri", "Sat", "" };

! const char *arpa_monname[13] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};

char * get_arpa_date()
Index: elmME+.2.5.alpha5-cvs/lib/getfullnam.c
*** elmME+.2.5.alpha4/lib/getfullnam.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/getfullnam.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getfullnam.c,v 1.6.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: getfullnam.c,v 1.6.8.3 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 23,30 ****
# include <pwd.h>
#endif

- char *gcos_name();
-
char * get_full_name(logname)
char *logname;
{
--- 23,28 ----
***************
*** 34,40 ****
* from ~/.fullname.
*/

! struct passwd *getpwnam(), *pass;

if((pass = getpwnam(logname)) == NULL)
return(NULL);
--- 32,38 ----
* from ~/.fullname.
*/

! struct passwd *pass;

if((pass = getpwnam(logname)) == NULL)
return(NULL);

***************
*** 44,50 ****

char * get_fullname1(pass,logname)
struct passwd *pass;
! CONST char *logname;
{
#ifndef PASSNAMES
FILE *fp;
--- 42,48 ----

char * get_fullname1(pass,logname)
struct passwd *pass;
! const char *logname;
{
#ifndef PASSNAMES
FILE *fp;
Index: elmME+.2.5.alpha5-cvs/lib/get_tz.c
*** elmME+.2.5.alpha4/lib/get_tz.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/get_tz.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: get_tz.c,v 1.11.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: get_tz.c,v 1.11.8.3 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 46,52 ****
{
struct tm *tm;
long t2, t1;
- extern long make_gmttime(); /* from date_util.c */

tm = localtime(&tval);
t1 = make_gmttime(1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday,
--- 46,51 ----

***************
*** 81,87 ****
* is a configuration problem.
*/

! CONST char *get_tz_name(tm)
struct tm *tm;
{

--- 80,86 ----
* is a configuration problem.
*/

! const char *get_tz_name(tm)
struct tm *tm;
{

Index: elmME+.2.5.alpha5-cvs/lib/getword.c
*** elmME+.2.5.alpha4/lib/getword.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/getword.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: getword.c,v 1.5.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: getword.c,v 1.5.8.2 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.5.8.2 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 14,20 ****
#include "elm_defs.h"

int get_word(buffer, start, word, wordlen)
! CONST char *buffer;
int start;
char *word;
int wordlen;
--- 14,20 ----
#include "elm_defs.h"

int get_word(buffer, start, word, wordlen)
! const char *buffer;
int start;
char *word;
int wordlen;
***************
*** 31,37 ****
*/

int len;
! CONST char *p;

for (p = buffer+start ; isspace(*p) ; ++p)
;
--- 31,37 ----
*/

int len;
! const char *p;

for (p = buffer+start ; isspace(*p) ; ++p)
;
Index: elmME+.2.5.alpha5-cvs/lib/hdrdecode.c
*** elmME+.2.5.alpha4/lib/hdrdecode.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/hdrdecode.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrdecode.c,v 1.13.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrdecode.c,v 1.13.8.3 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.13.8.3 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 38,44 ****

char * blstrpbrk (string, set)
char *string;
! CONST char *set;
{
char *p;

--- 38,44 ----

char * blstrpbrk (string, set)
char *string;
! const char *set;
{
char *p;

! }
! }
!

! static unsigned char * us_str P_((char *str));
! static unsigned char * us_str(str)
! char *str;
! {
! return (unsigned char *)str;
! }

!
!

***************
*** 143,148 ****


--- 168,174 ----
char * temp = safe_strdup(buffer);
char *p = temp;
char *sn = NULL;
+ char *lang = NULL;
char E = '\0';
char *encoded = NULL;

struct string *ret = NULL;
***************

- char *str;
- {
- return (unsigned char *)str;
- }

walk = strpbrk(ptr," \t\r\n");
--- 405,418 ----
charset_t defcharset;
int demime;
{
! struct string * ret = NULL;

char * walk, *ptr;
unsigned char last_char = 0;

for (ptr = buffer; ptr && *ptr; ptr = walk) {

unsigned char safe = 0;
! struct string * ok = NULL;
int nostore = 0;

*** 444,450 ****

struct string * hdr_to_string(class,buffer,defcharset, demime)
int class;
! CONST char *buffer;
charset_t defcharset;
int demime;
{
--- 471,477 ----

struct string * hdr_to_string(class,buffer,defcharset, demime)
int class;
! const char *buffer;
charset_t defcharset;
int demime;
{


***************
*** 465,470 ****
--- 492,503 ----

free(temp);

+ if (!ret) {
+ ret = new_string(defcharset);
+ DPRINT(Debug,30,(&Debug,
+ "hdr_to_string: Returning empty header...\n"));
+ }
+
DPRINT(Debug,30,(&Debug,
"hdr_to_string=%p (class=%d, buffer='%s', defcharset=%p '%s', demime=%d)\n",
ret,

Index: elmME+.2.5.alpha5-cvs/lib/hdrencode.c
*** elmME+.2.5.alpha4/lib/hdrencode.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/hdrencode.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrencode.c,v 1.11.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: hdrencode.c,v 1.11.8.4 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*
***************
*** 30,52 ****
/* Need also encode special characters is comments and phrases:
\ " ( ) < > and so on
*/
! static char * hdr_tencode P_((char *buffer, const char *cs, int *Elen));
! static char * hdr_tencode(buffer,cs,Elen)
char *buffer;

! CONST char *cs;


int *Elen;
{
char * ret = NULL;
int bad = 0;
char * p1, *work;
! int clen;
int l;
int i = 0;

! if (!cs || 0 != strpbrk(cs," \t\r\n()\""))
cs = "UNKNOWN-8BIT";
clen = strlen(cs);

for (p1 = buffer; *p1; p1++) {
if ((*p1 < '0' || *p1 > '9') &&
(*p1 < 'a' || *p1 > 'z') &&
--- 30,59 ----
/* Need also encode special characters is comments and phrases:
\ " ( ) < > and so on
*/
! static char * hdr_tencode P_((char *buffer, const char *cs, int *Elen,
! const char *lang));
! static char * hdr_tencode(buffer,cs,Elen,lang)
char *buffer;

! const char *cs;
int *Elen;
+ const char *lang;

*** 101,117 ****

static char * hdr_encode P_((const struct string *buffer));
static char * hdr_encode(buffer)
! CONST struct string *buffer;
{


char * cname = buffer->string_type->MIME_name ?
buffer->string_type->MIME_name :
"UNKNOWN-8BIT";
! int overhead = strlen(cname) +8;
int splitlen = 75 - overhead;
int blen = string_len(buffer);
char * ret = NULL;
int X;

splitlen -= splitlen/8; /* Rough estimate */

if (splitlen < 1) /* Should not happen .... */

--- 115,137 ----

static char * hdr_encode P_((const struct string *buffer));
static char * hdr_encode(buffer)
! const struct string *buffer;
{


char * cname = buffer->string_type->MIME_name ?
buffer->string_type->MIME_name :
"UNKNOWN-8BIT";

! const char * lang = get_string_lang(buffer);

*** 220,236 ****
static char * hdr_phrase P_((const struct string *buffer,
charset_t defcharset, int enmime));
static char * hdr_phrase(buffer,defcharset,enmime)
! CONST struct string *buffer;
charset_t defcharset;
int enmime;
{
char * ret = NULL;


struct string *temp;
char * tmp;
int bad = 0;
int hi = 0;
char * p1;

if (!enmime)
temp = convert_string(defcharset,buffer,1);
else

--- 240,263 ----
static char * hdr_phrase P_((const struct string *buffer,
charset_t defcharset, int enmime));
static char * hdr_phrase(buffer,defcharset,enmime)
! const struct string *buffer;
charset_t defcharset;
int enmime;
{
char * ret = NULL;
+ const char * lang = get_string_lang(buffer);


struct string *temp;
char * tmp;
int bad = 0;
int hi = 0;
char * p1;

+ const char * A = get_string_MIME_name(buffer);
+
+ DPRINT(Debug,32,(&Debug," (hdr_phrase cs=%s lang=%s) ",


+ A ? A : "<none>",

+ lang ? lang : "<none>"));
+
if (!enmime)
temp = convert_string(defcharset,buffer,1);
else
***************

*** 246,262 ****
if (*p1 & 128)
hi++;
}
!

if (!bad && ( !enmime ||
! (temp->string_type->MIME_name &&

! 0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) ||


! charset_ok_p(temp->string_type)))
ret = strmcat(ret,tmp);
else if (!enmime ||

! (!hi && ( (temp->string_type->MIME_name &&
! 0 == istrcmp(temp->string_type->MIME_name,
! "US-ASCII")) ||
! charset_ok_p(temp->string_type)))) {
int l = (p1-tmp) + bad + 2;
int i = 0;
char * work = safe_malloc(l+1);
--- 273,295 ----
if (*p1 & 128)
hi++;
}
!

if (!bad && ( !enmime ||
! (

! !lang &&
! ( (temp->string_type->MIME_name &&
! 0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) ||
! charset_ok_p(temp->string_type))
! )
! ))


ret = strmcat(ret,tmp);
else if (!enmime ||

! ( !lang &&
! (!hi && ( (temp->string_type->MIME_name &&
! 0 == istrcmp(temp->string_type->MIME_name,
! "US-ASCII")) ||
! charset_ok_p(temp->string_type))
! ))) {
int l = (p1-tmp) + bad + 2;
int i = 0;
char * work = safe_malloc(l+1);


***************
*** 288,300 ****
}

static char * hdr_comment P_((const struct string *buffer,
! charset_t defcharset, int enmime));
static char * hdr_comment(buffer,defcharset,enmime)

! CONST struct string *buffer;


charset_t defcharset;
int enmime;
{
char * ret;

if (!enmime) {
struct string *temp = convert_string(defcharset,buffer,1);

--- 321,339 ----


}

static char * hdr_comment P_((const struct string *buffer,
! charset_t defcharset, int enmime));
static char * hdr_comment(buffer,defcharset,enmime)

! const struct string *buffer;


charset_t defcharset;
int enmime;
{
char * ret;

+ const char * lang = get_string_lang(buffer);
+ const char * A = get_string_MIME_name(buffer);
+
+ DPRINT(Debug,32,(&Debug," (hdr_comment cs=%s lang=%s) ",


+ A ? A : "<none>",

+ lang ? lang : "<none>"));

if (!enmime) {
struct string *temp = convert_string(defcharset,buffer,1);
***************
*** 309,315 ****
struct string *temp = ascify_string(buffer);
ret = NULL;

! if (temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) {
char *tmp = us2s(stream_from_string(temp,0,NULL));

--- 348,355 ----


struct string *temp = ascify_string(buffer);
ret = NULL;

! if (!lang &&
! temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) {
char *tmp = us2s(stream_from_string(temp,0,NULL));

***************

*** 333,343 ****
static char * hdr_text P_((const struct string *buffer,
charset_t defcharset, int enmime));
static char * hdr_text(buffer,defcharset,enmime)
! CONST struct string *buffer;


charset_t defcharset;
int enmime;
{
char * ret;
if (!enmime) {
struct string *temp = convert_string(defcharset,buffer,1);

ret = us2s(stream_from_string(temp,0,NULL));
--- 373,390 ----
static char * hdr_text P_((const struct string *buffer,
charset_t defcharset, int enmime));
static char * hdr_text(buffer,defcharset,enmime)
! const struct string *buffer;


charset_t defcharset;
int enmime;
{
char * ret;

+ const char * lang = get_string_lang(buffer);
+ const char * A = get_string_MIME_name(buffer);
+
+ DPRINT(Debug,32,(&Debug," (hdr_text cs=%s lang=%s) ",


+ A ? A : "<none>",

+ lang ? lang : "<none>"));
+
if (!enmime) {
struct string *temp = convert_string(defcharset,buffer,1);
ret = us2s(stream_from_string(temp,0,NULL));
***************
*** 347,353 ****
struct string *temp = ascify_string(buffer);
ret = NULL;

! if (temp->string_type->MIME_name &&
0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) {
ret = us2s(stream_from_string(temp,0,NULL));

--- 394,401 ----


struct string *temp = ascify_string(buffer);
ret = NULL;

! if (!lang &&

! temp->string_type->MIME_name &&


0 == istrcmp(temp->string_type->MIME_name,"US-ASCII")) {
ret = us2s(stream_from_string(temp,0,NULL));

***************
*** 370,376 ****
/* class is one of HDR_PHRASE, HDR_COMMENT, HDR_TEXT */
char * string_to_hdr(class,buffer,defcharset,enmime)
int class;
! CONST struct string *buffer;
charset_t defcharset;
int enmime;
{
--- 418,424 ----
/* class is one of HDR_PHRASE, HDR_COMMENT, HDR_TEXT */
char * string_to_hdr(class,buffer,defcharset,enmime)
int class;
! const struct string *buffer;
charset_t defcharset;
int enmime;
{
Index: elmME+.2.5.alpha5-cvs/lib/headers.c
*** elmME+.2.5.alpha4/lib/headers.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/headers.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: headers.c,v 1.29.8.3 2004/05/15 20:11:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: headers.c,v 1.29.8.5 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 189,195 ****
} else {


char * buffer = NULL;

int j;
!
for (j = i; tokens[j]; j++) {
if ('(' == tokens[j][0])
break;
--- 189,197 ----
} else {

char * buffer = NULL;

***************
*** 404,410 ****
static int no_add_to_mail_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;
--- 409,415 ----
static int no_add_to_mail_hdr(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
***************
*** 496,502 ****
static int extra_header_count = 0;

header_ptr find_header(name, create_flag)
! CONST char *name;
int create_flag;
{
int i;
--- 501,507 ----
static int extra_header_count = 0;

header_ptr find_header(name, create_flag)
! const char *name;
int create_flag;
{
int i;
***************
*** 562,569 ****
void update_header_list(list,last1, name, value)
header_list_ptr *list;
header_list_ptr *last1;


! CONST char * name;

! CONST char * value;
{
header_list_ptr result = *list, last = *last1;
header_list_ptr item, last_this = NULL, walk;
--- 567,574 ----
void update_header_list(list,last1, name, value)
header_list_ptr *list;
header_list_ptr *last1;


! const char * name;

! const char * value;
{
header_list_ptr result = *list, last = *last1;
header_list_ptr item, last_this = NULL, walk;
***************
*** 838,844 ****
int add_to_mailing_header(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;
--- 843,849 ----
int add_to_mailing_header(headers,X,value,demime,defcharset,replace)
struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
Index: elmME+.2.5.alpha5-cvs/lib/imap.c
*** elmME+.2.5.alpha4/lib/imap.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/imap.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: imap.c,v 1.104.4.3 2004/08/14 12:06:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.104.4.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: imap.c,v 1.104.4.8 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.104.4.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 14,19 ****
--- 14,25 ----

DEBUG_VAR(Debug,__FILE__,"imap");



+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

#ifdef REMOTE_MBX

/* Seems that h_errno is macro on AIX */
***************

*** 35,45 ****
return (unsigned char *)str;
}

! static CONST unsigned char *cs2us P_((const char *str));
! static CONST unsigned char *cs2us(str)
! CONST char *str;
{
! return (CONST unsigned char *)str;
}

#include <errno.h>
--- 41,51 ----
return (unsigned char *)str;
}

! static const unsigned char *cs2us P_((const char *str));
! static const unsigned char *cs2us(str)
! const char *str;
{
! return (const unsigned char *)str;
}

#include <errno.h>


***************
*** 175,188 ****
static struct imap_flag {
char * flag;
int mask_elm;
long mask_imap;
} IMAP_flags[] = {
! { "\\Seen", 0, IMAP_Seen },

! { "\\Answered", REPLIED_TO, IMAP_Answered },


! { "\\Flagged", TAGGED, IMAP_Flagged },
! { "\\Deleted", DELETED, IMAP_Deleted },
! { "\\Draft", 0, IMAP_Draft },
! { "\\Recent", NEW, IMAP_Recent },
} ;

static struct browser_flag {
--- 181,195 ----
static struct imap_flag {
char * flag;
int mask_elm;
+ int mask_elm1;
long mask_imap;
} IMAP_flags[] = {
! { "\\Seen", 0, 0, IMAP_Seen },

! { "\\Answered", REPLIED_TO, 0, IMAP_Answered },


! { "\\Flagged", 0, S1_FLAGGED, IMAP_Flagged },
! { "\\Deleted", DELETED, 0, IMAP_Deleted },
! { "\\Draft", 0, 0, IMAP_Draft },
! { "\\Recent", NEW, 0, IMAP_Recent },
} ;

static struct browser_flag {
***************

*** 805,810 ****
--- 812,818 ----
free(item->header);
item->header = NULL;
}
+
switch(lst->imap_token) {
case imap_atom:
if (0 == istrcmp(lst->str,"NIL")) {
***************
*** 822,829 ****
* it
*/
return 1; /* OK */
}
- return 0; /* Bad */
}

static int got_body P_((struct imap_reference * item,
--- 830,838 ----
* it
*/


return 1; /* OK */

+ default:
+ return 0; /* Bad */
}
}

static int got_body P_((struct imap_reference * item,
***************
*** 837,842 ****
--- 846,852 ----
free(item->body);
item->body = NULL;
}
+
switch(lst->imap_token) {
case imap_atom:
if (0 == istrcmp(lst->str,"NIL")) {
***************
*** 854,861 ****
* it
*/


return 1; /* OK */
}

! return 0; /* Bad */
}

static void process_list_flags P_((struct imap_dir_entry * item,
--- 864,873 ----
* it
*/


return 1; /* OK */

+ default:
+ return 0; /* Bad */
}
!
}

static void process_list_flags P_((struct imap_dir_entry * item,
***************
*** 1113,1119 ****
static void imap_clear_command(con)
struct connection_cache *con;
{
! struct IMAP_CON * CONST M = con->a.imap_con;

DPRINT(Debug,7,(&Debug,
"imap_clear_command: con=%p (%s@%s)\n",
--- 1125,1131 ----
static void imap_clear_command(con)
struct connection_cache *con;
{
! struct IMAP_CON * const M = con->a.imap_con;

DPRINT(Debug,7,(&Debug,
"imap_clear_command: con=%p (%s@%s)\n",
***************
*** 1311,1317 ****

struct string *conv_from_imap_name P_((const char *name));
struct string *conv_from_imap_name(name)
! CONST char *name;
{
struct string *ret = NULL;
int L;
--- 1323,1329 ----

struct string *conv_from_imap_name P_((const char *name));
struct string *conv_from_imap_name(name)
! const char *name;
{
struct string *ret = NULL;
int L;
***************
*** 1326,1332 ****
if (IMAP_name_convention && name[0] && 0 < (L = strlen(name))) {
struct charset_state * P = new_state(IMAP_ENCODING);
uint16 * vector = safe_malloc(L * sizeof (uint16));
! CONST char *s;
int X = 0;
int ok = 1;
charset_t utf7 = NULL;
--- 1338,1344 ----
if (IMAP_name_convention && name[0] && 0 < (L = strlen(name))) {
struct charset_state * P = new_state(IMAP_ENCODING);
uint16 * vector = safe_malloc(L * sizeof (uint16));
! const char *s;
int X = 0;
int ok = 1;
charset_t utf7 = NULL;
***************
*** 2444,2450 ****

static void imap_command_push_atom(con,st)
struct connection_cache *con;
! CONST char *st;
{
struct imap_token T;

--- 2456,2462 ----

static void imap_command_push_atom(con,st)
struct connection_cache *con;
! const char *st;
{
struct imap_token T;

***************
*** 2459,2465 ****
static void imap_command_push_literal(con,len,st)
struct connection_cache *con;
int len;
! CONST char *st;
{
struct imap_token T;

--- 2471,2477 ----
static void imap_command_push_literal(con,len,st)
struct connection_cache *con;
int len;
! const char *st;
{
struct imap_token T;

***************
*** 2480,2486 ****
const char *st));
static void imap_command_push_string(con,st)
struct connection_cache *con;
! CONST char *st;
{
struct imap_token T;

--- 2492,2498 ----
const char *st));
static void imap_command_push_string(con,st)
struct connection_cache *con;
! const char *st;
{
struct imap_token T;

***************
*** 2494,2500 ****
const char *st));
static void imap_command_push_astring(con,st)
struct connection_cache *con;
! CONST char *st;
{
if ('\0' == st[0] ||
strspn(st,"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz")
--- 2506,2512 ----
const char *st));
static void imap_command_push_astring(con,st)
struct connection_cache *con;
! const char *st;
{
if ('\0' == st[0] ||
strspn(st,"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz")
***************
*** 2508,2514 ****
const char *st));
static void imap_command_push_aliteral(con,st)
struct connection_cache *con;
! CONST char *st;
{
int len = strlen(st);

--- 2520,2526 ----
const char *st));
static void imap_command_push_aliteral(con,st)
struct connection_cache *con;
! const char *st;
{
int len = strlen(st);

***************
*** 2547,2553 ****
const char **l));
static void imap_command_push_list(con,l)
struct connection_cache *con;
! CONST char **l;
{
int i;
struct imap_token T;
--- 2559,2565 ----
const char **l));
static void imap_command_push_list(con,l)
struct connection_cache *con;
! const char **l;
{
int i;
struct imap_token T;
***************
*** 2827,2832 ****
--- 2839,2846 ----
case capa_logged:
con->state = CON_logged;


break;
+ default:
+ break;
}

}

***************
*** 3023,3028 ****
--- 3037,3043 ----



/* IMAP browser */

+ static void browser_zero_imap P_((struct folder_browser *dir));
static void browser_zero_imap(dir)

struct folder_browser *dir;
{
***************
*** 3064,3069 ****
--- 3079,3085 ----


}
}

+ static void browser_free_imap P_((struct folder_browser *dir));
static void browser_free_imap(dir)

struct folder_browser *dir;
{
***************
*** 4457,4463 ****


struct folder_browser *dir;
WRITE_STATE ptr;
int l;
! CONST char *buffer;
{
int ret = 0;

--- 4473,4479 ----


struct folder_browser *dir;
WRITE_STATE ptr;
int l;
! const char *buffer;
{
int ret = 0;

***************

*** 4503,4509 ****
struct string * Lstr = NULL;
char * str = NULL;
long flags = 0;
! CONST char * LIST[ sizeof IMAP_flags /
sizeof (struct imap_flag) +1];
int j;
int X;
--- 4519,4525 ----
struct string * Lstr = NULL;
char * str = NULL;
long flags = 0;
! const char * LIST[ sizeof IMAP_flags /
sizeof (struct imap_flag) +1];
int j;
int X;
***************
*** 4547,4552 ****
--- 4563,4572 ----



if (0 != (IMAP_flags[j].mask_elm & current_header->status))
flags |= IMAP_flags[j].mask_imap;

+
+

+ if (0 != (IMAP_flags[j].mask_elm1 & current_header->status1))
+ flags |= IMAP_flags[j].mask_imap;
}

DPRINT(Debug,9,(&Debug,
***************

*** 4747,4752 ****
--- 4767,4844 ----


"browser_update_imap() called",0);
}

+ static int sort_by_name P_((const void *A, const void *B));
+ static int sort_by_name(A,B)

+ const void *A;
+ const void *B;
+ {
+ const struct name_vector * A1 = A;
+ const struct name_vector * B1 = B;


+
+ int r = string_cmp(A1->disp_name,
+ B1->disp_name,
+ 0 /* compare fialure */);

+

+ if (0 == r)
+ r = strcmp(A1->sys_name,B1->sys_name);
+
+ return r;

+ }
+

+ static int sort_by_revname P_((const void *A, const void *B));
+ static int sort_by_revname(A,B)

+ const void *A;
+ const void *B;


+ {
+ return -sort_by_name(A,B);
+ }
+
+ S_(browser_folder_sort_dir browser_folder_sort_imap)

+ static void browser_folder_sort_imap P_((struct folder_browser *dir,
+ print_sort_message * print));
+ static void browser_folder_sort_imap(dir,print)


+ struct folder_browser *dir;
+ print_sort_message * print;
+ {

+ struct string * msg = NULL;
+

+ if (dir->vector_len < 2)
+ return;
+
+ switch (give_dt_sort_as_int(&imap_dir_sortby)) {
+ case ID_NONE: return;
+ case ID_NAME_SORT:
+
+ if (dir->vector_len > 10) {
+ msg = format_string(CATGETS(elm_msg_cat, MeSet, MeSortingDirByName,

+ "Sorting directory %S by Name"),
+ dir->dirname);


+ print(msg);
+ }
+ qsort(dir->vector,dir->vector_len,sizeof (dir->vector[0]),
+ sort_by_name);
+ break;
+ case REVERSE ID_NAME_SORT:
+
+ if (dir->vector_len > 10) {
+ msg = format_string(CATGETS(elm_msg_cat, MeSet, MeSortingDirByRevName,

+ "Sorting directory %S by Reverse Name"),
+ dir->dirname);


+ print(msg);
+ }
+ qsort(dir->vector,dir->vector_len,sizeof (dir->vector[0]),
+ sort_by_revname);

+ break;
+
+ }
+

+ if (msg) {
+ print(NULL);
+ free_string(&msg);

+ }
+ }
+
+

struct browser_type imap_browser = { browser_zero_imap,
browser_free_imap,
browser_change_imap,
***************

*** 4772,4778 ****


browser_make_ref_imap,
browser_update_imap,
browser_imap_do_stat,
! browser_sync_write_imap
};

/* ----------------------------------------------------------------------- */

--- 4864,4871 ----


browser_make_ref_imap,
browser_update_imap,
browser_imap_do_stat,
! browser_sync_write_imap,
! browser_folder_sort_imap
};

/* ----------------------------------------------------------------------- */
***************

*** 4846,4852 ****
if (errno != ENOENT) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantUnlinkTemp,
"Sorry, can't unlink the temp file %s [%s]!\n\r"),
! folder -> cur_tempfolder, error_description(errno));
}
} else {
DPRINT(Debug,1,(&Debug,
--- 4939,4945 ----
if (errno != ENOENT) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantUnlinkTemp,
"Sorry, can't unlink the temp file %s [%s]!\n\r"),
! folder -> cur_tempfolder, strerror(errno));
}
} else {
DPRINT(Debug,1,(&Debug,
***************
*** 4858,4866 ****
return;
}

! static int mbx_lock_imap P_((int direction,struct folder_info *folder));
static int mbx_lock_imap(direction,folder)
! int direction;
struct folder_info *folder;
{
int status;
--- 4951,4959 ----
return;
}

! static int mbx_lock_imap P_((enum lock_direction direction,struct folder_info *folder));
static int mbx_lock_imap(direction,folder)
! enum lock_direction direction;
struct folder_info *folder;
{
int status;
***************
*** 5090,5096 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmSorryCantTruncateTemp,
"Sorry, can't truncate the temp file %s [%s]!"),
! folder -> cur_tempfolder, error_description(errno));
/* IF FAIL REOPEN IT INSTEAD */
}
#endif
--- 5183,5189 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmSorryCantTruncateTemp,
"Sorry, can't truncate the temp file %s [%s]!"),
! folder -> cur_tempfolder, strerror(errno));
/* IF FAIL REOPEN IT INSTEAD */
}
#endif
***************
*** 5105,5111 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantTruncateTemp,
"Sorry, can't truncate the temp file %s [%s]!"),
! folder -> cur_tempfolder, error_description(err));
status = 0;
goto clean;
}
--- 5198,5204 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantTruncateTemp,
"Sorry, can't truncate the temp file %s [%s]!"),
! folder -> cur_tempfolder, strerror(err));
status = 0;
goto clean;
}
***************
*** 5124,5130 ****

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantReopenTemp,
"Sorry, can't reopen the temp file %s [%s]!"),
! folder -> cur_tempfolder, error_description(err));

if (-1 != temp_handle)
close(temp_handle);
--- 5217,5223 ----

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantReopenTemp,
"Sorry, can't reopen the temp file %s [%s]!"),
! folder -> cur_tempfolder, strerror(err));

if (-1 != temp_handle)
close(temp_handle);
***************
*** 5171,5177 ****
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedCreateTmpFolder,
"Failed to create %.50s: %.60s"),
folder -> cur_tempfolder,
! error_description(err));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIGiveUp,
"Ahhhh... I give up."));

--- 5264,5270 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedCreateTmpFolder,
"Failed to create %.50s: %.60s"),
folder -> cur_tempfolder,
! strerror(err));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIGiveUp,
"Ahhhh... I give up."));

***************
*** 5191,5196 ****
--- 5284,5291 ----
/* shut off file for other people! */

}
break;
+ default:
+ break;
}

status = 1;

***************
*** 5361,5371 ****

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldntSeekTempEnd,
"\nCouldn't fseek to end of temp mbox.\n"));
! lib_error(FRM("** %s. **\n"), error_description(err));

DPRINT(Debug,1,(&Debug,
"Error: Couldn't fseek to end of reopened temp mbox. errno %s (%s)\n",
! error_description(err), "mbx_prepare_read_imap"));
status = 0;
goto clean;
}
--- 5456,5466 ----

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldntSeekTempEnd,
"\nCouldn't fseek to end of temp mbox.\n"));
! lib_error(FRM("** %s. **\n"), strerror(err));

DPRINT(Debug,1,(&Debug,
"Error: Couldn't fseek to end of reopened temp mbox. errno %s (%s)\n",
! strerror(err), "mbx_prepare_read_imap"));
status = 0;
goto clean;
}
***************
*** 5383,5389 ****

if (start <= folder -> p->a.imap_mbx.reference_count-1) {

! CONST char * L[] = { "RFC822.SIZE", "UID", NULL };
imap_states res;

if (!start_imap_command(con,"FETCH")) {
--- 5478,5484 ----

if (start <= folder -> p->a.imap_mbx.reference_count-1) {

! const char * L[] = { "RFC822.SIZE", "UID", NULL };
imap_states res;

if (!start_imap_command(con,"FETCH")) {
***************
*** 5473,5479 ****
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFlushOnTempFailed,
"Flush on temp file %s failed: %s"),
folder -> cur_tempfolder,
! error_description(err));
}
DPRINT(Debug,1,(&Debug, "Can't flush on temp file %s!!\n",
folder -> cur_tempfolder));
--- 5568,5574 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFlushOnTempFailed,
"Flush on temp file %s failed: %s"),
folder -> cur_tempfolder,
! strerror(err));
}
DPRINT(Debug,1,(&Debug, "Can't flush on temp file %s!!\n",
folder -> cur_tempfolder));
***************
*** 5544,5550 ****

int l,j;

! CONST char * L[] = { "FLAGS", "INTERNALDATE", "BODY.PEEK[HEADER]", NULL };

DPRINT(Debug,11,(&Debug,
"mbx_copy_envelope_imap: folder=%p (%s)\n",
--- 5639,5645 ----

int l,j;

! const char * L[] = { "FLAGS", "INTERNALDATE", "BODY.PEEK[HEADER]", NULL };

DPRINT(Debug,11,(&Debug,
"mbx_copy_envelope_imap: folder=%p (%s)\n",
***************
*** 5587,5593 ****
ref = find_reference(& (folder -> p->a.imap_mbx),
& (read_state_ptr->a.imap_mbx.current_message));
if (!ref) {
! CONST int count = folder -> p->a.imap_mbx.reference_count;
if (count <= 1 ||
folder-> p->a.imap_mbx.references[count-1].uid_number <
read_state_ptr->a.imap_mbx.current_message.uid_number) {
--- 5682,5688 ----
ref = find_reference(& (folder -> p->a.imap_mbx),
& (read_state_ptr->a.imap_mbx.current_message));
if (!ref) {
! const int count = folder -> p->a.imap_mbx.reference_count;
if (count <= 1 ||
folder-> p->a.imap_mbx.references[count-1].uid_number <
read_state_ptr->a.imap_mbx.current_message.uid_number) {
***************
*** 5672,5678 ****


"mbx_copy_envelope_imap: Flags"));
for (j = 0; j < sizeof IMAP_flags / sizeof (struct imap_flag); j++)
if (0 != (ref->imap_flags & IMAP_flags[j].mask_imap)) {
! entry->status |= IMAP_flags[j].mask_elm;
DPRINT(Debug,14,(&Debug, " %s", IMAP_flags[j].flag));
}
DPRINT(Debug,14,(&Debug, "\n"));

--- 5767,5774 ----


"mbx_copy_envelope_imap: Flags"));
for (j = 0; j < sizeof IMAP_flags / sizeof (struct imap_flag); j++)
if (0 != (ref->imap_flags & IMAP_flags[j].mask_imap)) {
! entry->status |= IMAP_flags[j].mask_elm;
! entry->status1 |= IMAP_flags[j].mask_elm1;
DPRINT(Debug,14,(&Debug, " %s", IMAP_flags[j].flag));
}
DPRINT(Debug,14,(&Debug, "\n"));
***************

*** 5773,5781 ****
return status;
}

! static CONST char * mbx_is_forwarded_imap P_((struct folder_info *folder,
READ_STATE read_state_ptr));
! static CONST char * mbx_is_forwarded_imap(folder,read_state_ptr)
struct folder_info *folder;
READ_STATE read_state_ptr;
{
--- 5869,5877 ----
return status;
}

! static const char * mbx_is_forwarded_imap P_((struct folder_info *folder,
READ_STATE read_state_ptr));
! static const char * mbx_is_forwarded_imap(folder,read_state_ptr)
struct folder_info *folder;
READ_STATE read_state_ptr;
{
***************
*** 5930,5936 ****
int len1;
struct imap_reference *ref = NULL;

! CONST char * L[] = { "BODY.PEEK[TEXT]", NULL };

DPRINT(Debug,11,(&Debug,
"mbx_copy_header_imap: folder=%p (%s)\n",
--- 6026,6032 ----
int len1;
struct imap_reference *ref = NULL;

! const char * L[] = { "BODY.PEEK[TEXT]", NULL };

DPRINT(Debug,11,(&Debug,
"mbx_copy_header_imap: folder=%p (%s)\n",
***************
*** 6273,6284 ****
ElmCouldntSeekBytesIntoFolder,
"\nCouldn't seek %ld bytes into folder.\n"),
offset);
! lib_error(FRM("** %s. **\n"), error_description(err));

DPRINT(Debug,1,(&Debug,
"Error: Couldn't seek folder %s: (offset %ld) Errno %s (%s)\n",
folder->cur_tempfolder, offset,
! error_description(err), "mbx_imap_to_fd"));

status = NULL;
goto clean;
--- 6369,6380 ----
ElmCouldntSeekBytesIntoFolder,
"\nCouldn't seek %ld bytes into folder.\n"),
offset);
! lib_error(FRM("** %s. **\n"), strerror(err));

DPRINT(Debug,1,(&Debug,
"Error: Couldn't seek folder %s: (offset %ld) Errno %s (%s)\n",
folder->cur_tempfolder, offset,
! strerror(err), "mbx_imap_to_fd"));

status = NULL;
goto clean;
***************
*** 6339,6345 ****

if (start <= folder -> p->a.imap_mbx.reference_count-1) {

! CONST char * L[] = { "RFC822.SIZE", "UID", NULL };

if (!start_imap_command(con,"FETCH")) {
status = 0;
--- 6435,6441 ----

if (start <= folder -> p->a.imap_mbx.reference_count-1) {

! const char * L[] = { "RFC822.SIZE", "UID", NULL };

if (!start_imap_command(con,"FETCH")) {
status = 0;
***************
*** 6497,6503 ****

int j;

! CONST char * LIST[ sizeof IMAP_flags /
sizeof (struct imap_flag) +1];
imap_states res;

--- 6593,6599 ----

int j;

! const char * LIST[ sizeof IMAP_flags /
sizeof (struct imap_flag) +1];
imap_states res;

***************
*** 6514,6526 ****


j < sizeof IMAP_flags / sizeof (struct imap_flag);
j++) {

! if (0 != (IMAP_flags[j].mask_elm & entry->status))
ref->imap_flags |= IMAP_flags[j].mask_imap;

/* So that 't' (tag / untag) works:
* Note that IMAP_flags[j].mask_elm == 0 for \Seen !!!
*/
! else if (0 != IMAP_flags[j].mask_elm)
ref->imap_flags &= ~IMAP_flags[j].mask_imap;
}
if (keep)

--- 6610,6624 ----


j < sizeof IMAP_flags / sizeof (struct imap_flag);
j++) {

! if (0 != (IMAP_flags[j].mask_elm & entry->status) ||
! 0 != (IMAP_flags[j].mask_elm1 & entry->status1))
ref->imap_flags |= IMAP_flags[j].mask_imap;

/* So that 't' (tag / untag) works:
* Note that IMAP_flags[j].mask_elm == 0 for \Seen !!!
*/
! else if (0 != IMAP_flags[j].mask_elm ||
! 0 != IMAP_flags[j].mask_elm1)
ref->imap_flags &= ~IMAP_flags[j].mask_imap;
}
if (keep)

***************
*** 6607,6614 ****
imap_clear_command(con);
}

! CONST char * mbx_imap_type P_((struct folder_info *folder));
! CONST char * mbx_imap_type(folder)
struct folder_info *folder;
{
char *result = NULL;
--- 6705,6712 ----
imap_clear_command(con);
}

! const char * mbx_imap_type P_((struct folder_info *folder));
! const char * mbx_imap_type(folder)
struct folder_info *folder;
{
char *result = NULL;
***************
*** 6652,6661 ****


static int mbx_start_edit_imap P_((struct folder_info *folder,
! CONST char **buffer));
static int mbx_start_edit_imap(folder,buffer)
struct folder_info *folder;
! CONST char **buffer;
{
DPRINT(Debug,11,(&Debug,
"mbx_start_edit_imap: folder=%p (%s)\n",
--- 6750,6759 ----


static int mbx_start_edit_imap P_((struct folder_info *folder,
! const char **buffer));
static int mbx_start_edit_imap(folder,buffer)
struct folder_info *folder;
! const char **buffer;
{
DPRINT(Debug,11,(&Debug,
"mbx_start_edit_imap: folder=%p (%s)\n",
Index: elmME+.2.5.alpha5-cvs/lib/iso2022.c
*** elmME+.2.5.alpha4/lib/iso2022.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/iso2022.c 2005-07-26 11:28:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.29.8.1 2004/04/18 16:55:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: iso2022.c,v 1.29.8.5 2005/07/26 08:28:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

+
+

!
!

*** 160,167 ****
{ bank_unspecified, iso2022_96, { 0x54, 0x00, 0x00, 0x00 } }, /* 11 */
};

! struct iso2022_setid * CONST ASCII_BANK = &latin_banks[0];
! struct iso2022_setid * CONST LATIN1_BANK = &latin_banks[1];

struct iso2022_map_list INITIAL_iso2022_map_list[] = {
{ &return_to_iso2022, NULL, ml_system },
--- 398,405 ----
{ bank_unspecified, iso2022_96, { 0x54, 0x00, 0x00, 0x00 } }, /* 11 */
};

! struct iso2022_setid * const ASCII_BANK = &latin_banks[0];
! struct iso2022_setid * const LATIN1_BANK = &latin_banks[1];

struct iso2022_map_list INITIAL_iso2022_map_list[] = {
{ &return_to_iso2022, NULL, ml_system },
***************
*** 182,187 ****

***************
*** 274,280 ****
}

static struct iso2022_keyword {
! CONST char * keyword;
enum iso2022_bank bank;
enum iso2022_settype type;
} iso2022_keywords[] = {
--- 573,579 ----
}

static struct iso2022_keyword {
! const char * keyword;
enum iso2022_bank bank;
enum iso2022_settype type;
} iso2022_keywords[] = {
***************
*** 473,479 ****


int parse_iso2022_map(filename,errors,mode)
! CONST char *filename;
int *errors;
enum map_list_mode mode;
{
--- 772,778 ----


int parse_iso2022_map(filename,errors,mode)
! const char *filename;
int *errors;
enum map_list_mode mode;
{
***************
*** 490,496 ****
if (err) {
DPRINT(Debug,2,(&Debug,
"parse_iso2022_map=0: %s: %s (can_open)\n",
! filename,error_description(err)));
return 0;
}

--- 789,795 ----
if (err) {
DPRINT(Debug,2,(&Debug,
"parse_iso2022_map=0: %s: %s (can_open)\n",


! filename,strerror(err)));
return 0;
}

***************

*** 499,505 ****


int err = errno;
DPRINT(Debug,2,(&Debug,

"parse_iso2022_map=0: %s: %s\n",
! filename,error_description(err)));
return 0;
}

--- 798,804 ----


int err = errno;
DPRINT(Debug,2,(&Debug,

"parse_iso2022_map=0: %s: %s\n",
! filename,strerror(err)));
return 0;
}

***************
*** 725,731 ****
bytes);

if (t) {
! CONST char *X;

if (0 == strchr(t,' '))
elm_fprintf(f,FRM("%s\t%s\t%s"),
--- 1024,1030 ----
bytes);

if (t) {
! const char *X;

if (0 == strchr(t,' '))
elm_fprintf(f,FRM("%s\t%s\t%s"),
***************
*** 753,760 ****
}

static int same_setid_bytes(A,B)
! CONST struct iso2022_setid A;
! CONST struct iso2022_setid B;
{
int i;

--- 1052,1059 ----
}

static int same_setid_bytes(A,B)
! const struct iso2022_setid A;
! const struct iso2022_setid B;
{
int i;

***************
*** 765,772 ****
}

int same_setid(A,B)
! CONST struct iso2022_setid A;
! CONST struct iso2022_setid B;
{
if (A.bank != B.bank)
return 0;
--- 1064,1071 ----
}

int same_setid(A,B)
! const struct iso2022_setid A;
! const struct iso2022_setid B;
{
if (A.bank != B.bank)
return 0;
***************
*** 780,804 ****

static struct iso2022_setid * loc_setid P_((const struct iso2022_setid c));
static struct iso2022_setid * loc_setid(c)
! CONST struct iso2022_setid c;
{
! struct iso2022_setid * ret;

int i;
- int found_it = 0;

/* May have several given on {lib}/elm.iso2022sets and
~/.elm/iso2022.sets ...
*/

! for (i = 0; i < iso2022_map_list_count; i++)
if (same_setid(*(iso2022_map_list[i].setid),c)) {
ret = iso2022_map_list[i].setid;
! found_it++;
}

- if (found_it)
- goto found;

/* Create new setid */

--- 1079,1102 ----

static struct iso2022_setid * loc_setid P_((const struct iso2022_setid c));
static struct iso2022_setid * loc_setid(c)
! const struct iso2022_setid c;
{
! struct iso2022_setid * ret = NULL;

int i;

/* May have several given on {lib}/elm.iso2022sets and
~/.elm/iso2022.sets ...
*/

! for (i = 0; i < iso2022_map_list_count; i++) {
if (same_setid(*(iso2022_map_list[i].setid),c)) {
ret = iso2022_map_list[i].setid;
!
! goto found;
}
+ }


/* Create new setid */

***************
*** 860,865 ****
--- 1158,1709 ----


bank_G0, bank_G2
};

+ struct setlist set_koi8e = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_koi8e, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G2

+ };
+
+

+ };
+
+

+ /* ISO646-SE2, codeset SEN_850200_C -- iso-ir-11 */
+ struct setlist set_iso_ir_11 = {
+ { -1, -1, -1, -1 },
+ { &set1_iso_ir_11, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified

+ };
+
+

+ };
+
+

+ };
+
+

+ };
+
+

+ /* codeset "ISO_10367-box ", ISO-IR-155
+ * Assumed to be like ISO-8859-*
+ * This is likely to be incorrect
+ */
+ struct setlist set_iso_ir_155 = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_iso_ir_155, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G1

+ };
+
+

+ /* codeset "latin-lap", ISO-IR-158
+ * Assumed to be like ISO-8859-*
+ * This is likely to be incorrect
+ */
+ struct setlist set_iso_ir_158 = {
+ { -1, -1, -1, -1 },
+ { &(latin_banks[0]), &set1_iso_ir_158, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_G3
+ };
+
+

/* ISO-2022-KR - RFC 1557 --- ASCII
KSC 5601
***************
*** 896,901 ****

--- 1740,1762 ----


bank_G0, bank_unspecified
};

+ /* iso-ir-42 -- must likely incorrenct */
+ struct setlist set_iso_ir_42 = {
+ { -1, -1, -1, -1 },
+ { &set_JISC6226a, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* iso-ir-87 -- must likely incorrenct */
+ struct setlist set_iso_ir_87 = {
+ { -1, -1, -1, -1 },
+ { &set_JISC6226b, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+
/* EUC-JP - G0 ASCII
G1 JIS X 0208-1983
G2 JIS X 0201:1976/1997
***************
*** 938,943 ****

--- 1799,1825 ----


&set_ISO88597, NULL },
bank_G0, bank_G2
};
+
+ /* GB_2312-80, iso-ir-58 */
+ struct setlist set_iso_ir_58 = {
+ { -1, -1, -1, -1 },
+ { &set_GB2312jp , NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified
+ };
+
+ /* codeset JIS_X0212-1990, iso-ir-159
+ * This is likely be incorrect
+ */
+ struct setlist set_iso_ir_159 = {
+ { -1, -1, -1, -1 },
+ { &set_JISX0212, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL },
+ bank_G0, bank_unspecified

+ };
+
+
+


/* ISO-2022-CN -- RFC 1922, ASCII,
GB 2312,
***************
*** 1006,1020 ****

static struct setlist * INITIAL_setlists[] = {
&set_utf8,
&set_latin8,
&set_ISO2022KR,
&set_EUCKR,
&set_ISO2022JP,
&set_EUCJP,
&set_ISO646JP,
&set_ISO2022JP2,
&set_ISO2022CN,
! &set_ISO2022CNEXT
};

struct setlist sets_iso_8859_X [] = {

--- 1888,1972 ----

***************
*** 1095,1102 ****
static int same_setlist P_((const struct setlist A,
const struct setlist B));
static int same_setlist(A,B)
! CONST struct setlist A;
! CONST struct setlist B;
{
int i;

--- 2047,2054 ----
static int same_setlist P_((const struct setlist A,
const struct setlist B));
static int same_setlist(A,B)
! const struct setlist A;
! const struct setlist B;
{
int i;

***************
*** 1121,1127 ****
}

struct setlist *loc_setlist(l)
! CONST struct setlist l;
{
static struct setlist ** setlists = INITIAL_setlists;
static int setlist_count =
--- 2073,2079 ----
}

struct setlist *loc_setlist(l)
! const struct setlist l;
{
static struct setlist ** setlists = INITIAL_setlists;
static int setlist_count =
***************
*** 1175,1181 ****


buffer specified as argument -- otherwise result is malloced

*/
char * iso2022_setid_stream(c,buffer,size)
! CONST struct iso2022_setid c;
char *buffer;
int size;
{
--- 2127,2133 ----


buffer specified as argument -- otherwise result is malloced

*/
char * iso2022_setid_stream(c,buffer,size)
! const struct iso2022_setid c;
char *buffer;
int size;
{
***************
*** 1225,1230 ****
--- 2177,2184 ----
case bank_G1: ADD(0x29); break;
case bank_G2: ADD(0x2A); break;
case bank_G3: ADD(0x2B); break;
+ default: break;
+
}
break;
case iso2022_96x96:
***************
*** 1235,1240 ****
--- 2189,2195 ----
case bank_G1: ADD(0x2D); break;
case bank_G2: ADD(0x2E); break;
case bank_G3: ADD(0x2F); break;
+ default: break;
}
break;
}
***************
*** 1258,1269 ****
* -1 Incomplete setid
* > 0 len of setid
*/
! static int eat_iso2022_ident P_((CONST unsigned char *buffer, int len));
int eat_iso2022_setid P_((struct iso2022_setid *result,
const unsigned char *buffer, int len));
int eat_iso2022_setid(result,buffer,len)
struct iso2022_setid *result;
! CONST unsigned char *buffer;
int len;
{

--- 2213,2224 ----
* -1 Incomplete setid
* > 0 len of setid
*/
! static int eat_iso2022_ident P_((const unsigned char *buffer, int len));
int eat_iso2022_setid P_((struct iso2022_setid *result,
const unsigned char *buffer, int len));
int eat_iso2022_setid(result,buffer,len)
struct iso2022_setid *result;
! const unsigned char *buffer;
int len;
{

***************
*** 1461,1466 ****
--- 2416,2422 ----
case bank_G1: ADD(0x0E); /* SO */ break;
case bank_G2: ADD(0x1B); ADD(0x6E); break;
case bank_G3: ADD(0x1B); ADD(0x6F); break;
+ default: break;
}
break;
default:
***************
*** 1468,1473 ****
--- 2424,2430 ----
case bank_G1: ADD(0x1B); ADD(0x7E); break;
case bank_G2: ADD(0x1B); ADD(0x7D); break;
case bank_G3: ADD(0x1B); ADD(0x7C); break;
+ default: break;
}
}
#undef ADD
***************
*** 1488,1499 ****
*/
int eat_iso2022_bank_switch P_((enum iso2022_bank *bank,
enum shift_mode *left_right,
! CONST unsigned char *buffer,
int len));
int eat_iso2022_bank_switch(bank,left_right,buffer,len)
enum iso2022_bank *bank;
enum shift_mode *left_right;
! CONST unsigned char *buffer;
int len;
{
int i = 0;
--- 2445,2456 ----
*/
int eat_iso2022_bank_switch P_((enum iso2022_bank *bank,
enum shift_mode *left_right,
! const unsigned char *buffer,
int len));
int eat_iso2022_bank_switch(bank,left_right,buffer,len)
enum iso2022_bank *bank;
enum shift_mode *left_right;
! const unsigned char *buffer;
int len;
{
int i = 0;
***************
*** 1653,1659 ****
*/

static int eat_iso2022_ident(buffer,len)
! CONST unsigned char *buffer;
int len;
{
int i = 0;
--- 2610,2616 ----
*/

static int eat_iso2022_ident(buffer,len)
! const unsigned char *buffer;
int len;
{
int i = 0;
***************
*** 1707,1713 ****
}

int parse_gen_spec(val,bytes,size)
! CONST char *val;
unsigned char *bytes;
int size;
{
--- 2664,2670 ----
}

int parse_gen_spec(val,bytes,size)
! const char *val;
unsigned char *bytes;
int size;
{
***************
*** 1785,1791 ****
}

static int parse_ISO2022_ident_spec(val,bytes,size)
! CONST char *val;
unsigned char * bytes;
int size;
{
--- 2742,2748 ----
}

static int parse_ISO2022_ident_spec(val,bytes,size)
! const char *val;
unsigned char * bytes;
int size;
{
***************
*** 1816,1822 ****
}

static struct iso2022_banks {
! CONST char * keyword;
enum iso2022_bank bank;
} iso2022_banks[] = {
{ "none", bank_unspecified },
--- 2773,2779 ----
}

static struct iso2022_banks {
! const char * keyword;
enum iso2022_bank bank;
} iso2022_banks[] = {
{ "none", bank_unspecified },
***************
*** 1867,1874 ****
}

int parse_iso2022_specification(param,value,count,list)
! CONST char *param;
! CONST char *value;
int *count;
struct setlist *list;
{
--- 2824,2831 ----
}

int parse_iso2022_specification(param,value,count,list)
! const char *param;
! const char *value;
int *count;
struct setlist *list;
{

Kari E. Hurtta

unread,
Jul 28, 2005, 12:29:06 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.7

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 7/20 ) =========
Index: elmME+.2.5.alpha5-cvs/lib/mailer/Makefile.SH


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/lib/mailer/Makefile.SH 2005-07-20 19:49:44.000000000 +0300
***************
*** 0 ****
--- 1,153 ----

+ # $Id: Makefile.SH,v 1.2.10.1 2005/07/20 16:49:44 hurtta Exp $

+ .PRECIOUS: $(INCLDIR)/elm_defs.h $(INCLDIR)/defs_major.h def_mailer.h
+
+ $(INCLDIR)/elm_defs.h: $(INCLDIR)/defs_major.h $(INCLDIR)/elm_nl_types.h \
+ $(INCLDIR)/elmlib.h


+ $(CHMOD) u+w $@
+ $(TOUCH) $@
+

+ $(INCLDIR)/defs_major.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h


+ $(CHMOD) u+w $@
+ $(TOUCH) $@
+

+ def_mailer.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/mailerlib.h

Index: elmME+.2.5.alpha5-cvs/lib/mailer/outheaders.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/lib/mailer/outheaders.c 2005-07-20 19:49:44.000000000 +0300
***************
*** 0 ****
--- 1,193 ----
+ static char rcsid[] = "@(#)$Id: outheaders.c,v 1.3.2.1 2005/07/20 16:49:44 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3.2.1 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
+ *****************************************************************************/
+

+ #include "def_mailer.h"
+ #include "hdr_imp.h"
+ #include "s_me.h"
+
+ #include <errno.h>
+ #ifndef ANSI_C

+ extern int errno;
+ #endif
+

+ DEBUG_VAR(Debug,__FILE__,"header");
+
+
+ static unsigned char *s2us P_((char *str));
+ static unsigned char *s2us(str)

+ char *str;
+ {

+ break;
+ }
+ }
+

+ s1 = new_string2(display_charset,s2us(s));
+
+ add_textual_addr_(expanded,s1,pos,1);
+ free(s); s = NULL;
+
+ free_string(&s1);
+
+ free_string(&name);
+ free_string(&comment);

+ }
+
+
+

+ void zero_mailing_headers (hdrs)
+ struct mailing_headers *hdrs;
+ {
+ /* bzero is defined hdrs/defs.h */
+ bzero((void *)hdrs,sizeof (*hdrs));
+
+ hdrs->magic = MAIL_HDR_magic;
+
+ hdrs->subject = NULL;
+ zero_expanded_address(&(hdrs->from));
+ zero_id_phrase(&(hdrs->in_reply_to));
+ hdrs->expires = NULL;
+ hdrs->action = NULL;
+ hdrs->priority = NULL;
+ hdrs->sender = NULL;
+ zero_expanded_address(&(hdrs->reply_to));
+ zero_expanded_address(&(hdrs->to));
+ zero_expanded_address(&(hdrs->cc));
+ hdrs->user_header = NULL;
+ hdrs->user_header_count = 0;
+ zero_expanded_address(&(hdrs->bcc));
+ hdrs->precedence = NULL;
+ hdrs->expires_days = NULL;

+ hdrs->env_from = NULL;
+ }
+

+ void free_mailing_headers (hdrs)
+ struct mailing_headers *hdrs;
+ {
+ if (hdrs->magic != MAIL_HDR_magic)

+ panic("HEADERS PANIC",__FILE__,__LINE__,"free_mailing_headers",


+ "Bad magic number",0);
+

+ if (hdrs->subject)
+ free_string(&(hdrs->subject));
+ hdrs->subject = NULL;
+ free_expanded_address(&(hdrs->from));
+ free_id_phrase(&(hdrs->in_reply_to));
+ if (hdrs->expires)
+ free(hdrs->expires);
+ hdrs->expires = NULL;
+ if (hdrs->action)
+ free(hdrs->action);
+ hdrs->action = NULL;
+ if (hdrs->priority)
+ free(hdrs->priority);
+ hdrs->priority = NULL;
+ if (hdrs->sender)
+ free(hdrs->sender);
+ hdrs->sender = NULL;
+ free_expanded_address(&(hdrs->reply_to));
+ free_expanded_address(&(hdrs->to));
+ free_expanded_address(&(hdrs->cc));
+
+ if (hdrs->user_header) {

+ int i;
+

+ for (i = 0; i < hdrs->user_header_count; i++) {
+ if (hdrs->user_header[i].value)
+ free_string(&(hdrs->user_header[i].value));
+ hdrs->user_header[i].name = NULL;
+ }
+ free(hdrs->user_header);
+ hdrs->user_header = NULL;
+ }
+ hdrs->user_header_count = 0;
+
+ free_expanded_address(&(hdrs->bcc));
+ if (hdrs->precedence)
+ free(hdrs->precedence);
+ hdrs->precedence = NULL;
+ if (hdrs->expires_days)
+ free(hdrs->expires_days);

+ hdrs->expires_days = NULL;
+

+ if (hdrs->env_from)
+ mailer_free_env_from( &(hdrs->env_from) );
+
+ /* Make sure that dangling pointters are catched */

+ /* bzero is defined hdrs/defs.h */
+ bzero((void *)hdrs,sizeof (*hdrs));
+

+ }
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/lib/mailer/shared_mailer.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/lib/mailer/shared_mailer.c 2005-07-20 19:49:44.000000000 +0300
***************
*** 0 ****
--- 1,154 ----
+ static char rcsid[] = "@(#)$Id: shared_mailer.c,v 1.2.10.1 2005/07/20 16:49:44 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2.10.1 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
+ *****************************************************************************/
+
+ /*


+ * This file is compiled only if dlopen() is available, so
+ * that file does not need to be guarded with #ifdef
+ */
+
+ #include "def_mailer.h"
+
+ DEBUG_VAR(Debug,__FILE__,"dl");
+
+ #include "shared_imp.h"
+ #include "mailer_imp.h"
+

+ #include "rc_imp.h"
+ #include "save_opts.h"
+
+

+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ #define SHARED_MAILER_magic 0xF904
+
+ struct sl_mailer_data {
+ uint16 magic;

+
+ };
+
+

+ S_(sl_reg_functions sl_reg_mailer)
+ static int sl_reg_mailer P_((struct ImpInfo *i,
+ int reg_idx));
+ static int sl_reg_mailer(i,reg_idx)
+ struct ImpInfo *i;
+ int reg_idx;
+ {
+ /* union hack to avoid warnings about casting
+ * between pointer-to-object and pointer-to-function
+ */
+
+ int res = 0;
+
+ union F14 {
+ void * ptr;
+ provides_shared_MCF_f * f14;
+ } f14;
+
+ f14.ptr = dlsym(i->handle, "provides_shared_MCF");
+
+ if (!f14.f14) {

+ DPRINT(Debug,7,(&Debug, " ... NO provides_shared_MCF\n"));
+ }
+

+ if (f14.f14) {
+ int count;
+ size_t s_res14, s_opt_size;
+
+ struct mailer_config *res14 = f14.f14(&count,&s_res14,
+ &s_opt_size);
+
+ if (s_res14 != sizeof (*res14)) {
+ DPRINT(Debug,1,(&Debug,
+ "... struct mailer_config mismatch: %d should be %d\n",
+ s_res14,sizeof (*res14)));
+ } else if (s_opt_size != sizeof (struct mailer_option_list)) {
+ DPRINT(Debug,1,(&Debug,
+ "... struct mailer_option_list mismatch: %d should be %d\n",
+ s_opt_size,sizeof (struct mailer_option_list)));
+ } else {

+ int x;
+

+ shared_MCF_types =
+ safe_realloc(shared_MCF_types,
+ sizeof (shared_MCF_types[0]) *
+ (shared_MCF_type_count + count));
+
+ DPRINT(Debug,7,(&Debug," ... provides_shared_MCF: (shared_MCF_types) count %d\n",
+ count));
+ res = 1;

+

+ struct reg_list *r = & (i->regs[reg_idx] );


+ r->valid = 0;
+

+ }
+

+ static struct shared_loader mailer_loader = {
+ SHARED_LOADER_magic,
+ sl_reg_mailer,
+ sl_zero_mailer,
+ sl_unreg_mailer
+ };
+
+ SHAREDLIB use_shared_mailer = {
+ &mailer_loader /* loader */,
+ 0,

+ NULL, 0
+ };
+

+ struct mailer_config * loc_mailer_type(f)
+ char *f;
+ {

+ int x;
+

+ /* We must load all mailer libraries */
+ load_shared_libs1(&use_shared_mailer);
+

+

+ for (x = 0; x < shared_MCF_type_count; x++)
+ if (0 == strcmp(shared_MCF_types[x].T->mailer_type,f)) {
+ return shared_MCF_types[x].T;
+ }
+ return NULL;
+ }

Index: elmME+.2.5.alpha5-cvs/lib/mail_gets.c
*** elmME+.2.5.alpha4/lib/mail_gets.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/mail_gets.c 2005-07-23 20:14:13.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.8.8.2 2004/07/03 15:23:04 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mail_gets.c,v 1.8.8.4 2005/07/23 17:14:13 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 66,72 ****
FILE *mailfile;
{
char * buf = *buffer;
! int line_bytes = 0, ch;
int alloced = 0;

if (feof(mailfile))
--- 66,72 ----
FILE *mailfile;
{
char * buf = *buffer;
! int line_bytes = 0;
int alloced = 0;

if (feof(mailfile))
***************
*** 93,99 ****
}

if (line_bytes > 0 ||
! !feof(mailfile) && !ferror(mailfile)) {

buf = safe_realloc(buf,line_bytes+1);
buf[line_bytes] = '\0';
--- 93,99 ----
}

if (line_bytes > 0 ||
! ( !feof(mailfile) && !ferror(mailfile))) {

buf = safe_realloc(buf,line_bytes+1);
buf[line_bytes] = '\0';


***************
*** 105,111 ****
return -1;

if (ferror(mailfile))
! return-2;

return line_bytes;
}
--- 105,111 ----
return -1;

if (ferror(mailfile))
! return -2;

return line_bytes;
}

Index: elmME+.2.5.alpha5-cvs/lib/Makefile.SH
*** elmME+.2.5.alpha4/lib/Makefile.SH 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/lib/Makefile.SH 2005-07-22 23:55:55.000000000 +0300
***************
*** 43,52 ****
;;
esac

echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.89.8.4 2004/11/02 19:36:17 hurtta Exp $
#
# Makefile for the ELM mail program.
#
--- 43,61 ----


;;
esac

+ case "$d_wchar" in
+ define) widesrc="cs_wfallback.c"
+ wideobj="cs_wfallback.o"
+ ;;
+ *) widesrc=
+ wideobj=
+ ;;
+ esac
+

echo "Extracting lib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.89.8.6 2005/07/22 20:55:55 hurtta Exp $
#
# Makefile for the ELM mail program.
#
***************
*** 90,95 ****


--- 99,107 ----
SHAREDSRC = $sharedsrc
SHAREDOBJ = $sharedobj

+ WIDESRC = $widesrc
+ WIDEOBJ = $wideobj
+
!GROK!THIS!

case "$ccflags" in
***************

*** 116,122 ****



cat >>Makefile <<SUBSTITUTE
SHLIST = ../shlib/libelmme-base.so
! INSTLIB = $shlib/libelmme-base.so$d_shared_rev
SONAME = ${soname_opt}${A}libelmme-base.so$d_shared_rev
SHLIB = $shlib
SUBSTITUTE
--- 128,134 ----

cat >>Makefile <<SUBSTITUTE
SHLIST = ../shlib/libelmme-base.so
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-base.so$d_shared_rev
SONAME = ${soname_opt}${A}libelmme-base.so$d_shared_rev
SHLIB = $shlib
SUBSTITUTE
***************

*** 142,149 ****


REG = ../bin/elmregister

# Lists
! LIB_SRC = add_site.c \
! atonum.c \
bindata.c \
mmaputil.c \
mk_aliases.c \
--- 154,160 ----
REG = ../bin/elmregister

# Lists
! LIB_SRC = atonum.c \
bindata.c \
mmaputil.c \
mk_aliases.c \

***************
*** 160,165 ****


--- 171,178 ----
cs_iso2022.c \
cs_fallback.c \
cs_utf.c \
+ cs_unknown.c \
+ $(WIDESRC) \
date_util.c \
$(DEBUGSRC) \
dispaddr.c \
***************

*** 191,197 ****


len_next.c \
localmbx.c \
mail_gets.c \
- mailer.c \
mediatype.c \
mbox.c \
move_left.c \
--- 204,209 ----
***************

*** 210,215 ****


--- 222,228 ----
realfrom.c \
remote_mbx.c \
qstrings.c \
+ rc_delay.c \
rc_handle.c \
read_rc.c \
reverse.c \
***************

*** 233,248 ****

*** 259,264 ****


--- 271,278 ----
cs_iso2022.o \
cs_fallback.o \
cs_utf.o \
+ cs_unknown.o \
+ $(WIDEOBJ) \
date_util.o \
$(DEBUGOBJ) \
dispaddr.o \
***************

*** 289,295 ****


len_next.o \
localmbx.o \
mail_gets.o \
- mailer.o \
mediatype.o \
mbox.o \
move_left.o \
--- 303,308 ----
***************

*** 306,311 ****


--- 319,325 ----
pop.o \
putenv.o \
qstrings.o \
+ rc_delay.o \
rc_handle.o \
read_rc.o \
realfrom.o \
***************

*** 331,352 ****

*** 372,378 ****


$(TAGS) $(LIB_SRC)

clean:
! $(RM) $(LIB_OBJ) libutil.a

# Dependencies and rules


# Dependencies of header files upon other header files they include

--- 386,392 ----
$(TAGS) $(LIB_SRC)

clean:
! $(RM) $(LIB_OBJ) ../libs/libelmme-base.a

# Dependencies and rules


# Dependencies of header files upon other header files they include

***************
*** 393,405 ****
$(TOUCH) $@

# Dependencies of C object files
! # Simple files ...
putenv.o: $(INCLDIR)/defs_major.h
strstr.o: $(INCLDIR)/defs_major.h
! safeopen.o: $(INCLDIR)/defs_major.h

- # --- Dependencies of C object files
- add_site.o: $(INCLDIR)/elm_defs.h
atonum.o: $(INCLDIR)/elm_defs.h
bindata.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/mmaputil.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/s_me.h $(INCLDIR)/bindata.h
--- 407,417 ----
$(TOUCH) $@

# Dependencies of C object files
!
putenv.o: $(INCLDIR)/defs_major.h
strstr.o: $(INCLDIR)/defs_major.h
! safeopen.o: $(INCLDIR)/elm_defs.h

atonum.o: $(INCLDIR)/elm_defs.h
bindata.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/mmaputil.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/s_me.h $(INCLDIR)/bindata.h
***************
*** 419,435 ****
charset_input.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_binary.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/bindata.h
cs_fallback.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_utf.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_iso2022.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
date_util.o: $(INCLDIR)/elm_defs.h
! debug.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/patchlevel.h
dispaddr.o: $(INCLDIR)/elm_defs.h
errno.o: $(INCLDIR)/elm_defs.h
expand.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elmrc.h
expires.o: $(INCLDIR)/elm_defs.h
forwarded.o: $(INCLDIR)/elm_defs.h
! file_util.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h
gcos_name.o: $(INCLDIR)/elm_defs.h
get_tz.o: $(INCLDIR)/elm_defs.h
getaddr.o: $(INCLDIR)/elm_defs.h
--- 431,454 ----
charset_input.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_binary.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/bindata.h
+
cs_fallback.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
+ cs_wfallback.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
cs_utf.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! cs_unknown.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
! cs_iso2022.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
date_util.o: $(INCLDIR)/elm_defs.h
! debug.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/patchlevel.h
dispaddr.o: $(INCLDIR)/elm_defs.h
errno.o: $(INCLDIR)/elm_defs.h
expand.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elmrc.h
expires.o: $(INCLDIR)/elm_defs.h
forwarded.o: $(INCLDIR)/elm_defs.h
! file_util.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/s_me.h
gcos_name.o: $(INCLDIR)/elm_defs.h
get_tz.o: $(INCLDIR)/elm_defs.h
getaddr.o: $(INCLDIR)/elm_defs.h
***************
*** 440,450 ****
hdrdecode.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
hdrencode.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
header_cmp.o: $(INCLDIR)/elm_defs.h
! headers.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/hdr_imp.h
in_string.o: $(INCLDIR)/elm_defs.h
! iso2022.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! iso2022_map.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h
! imap.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h
istrcmp.o: $(INCLDIR)/elm_defs.h
ldstate.o: $(INCLDIR)/elm_defs.h
--- 459,473 ----
hdrdecode.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
hdrencode.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
header_cmp.o: $(INCLDIR)/elm_defs.h
! headers.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/hdr_imp.h
in_string.o: $(INCLDIR)/elm_defs.h
! iso2022.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/cs_imp.h
! iso2022_map.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/cs_imp.h
! imap.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h
istrcmp.o: $(INCLDIR)/elm_defs.h
ldstate.o: $(INCLDIR)/elm_defs.h
***************
*** 452,461 ****
localmbx.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h
mail_gets.o: $(INCLDIR)/elm_defs.h
- mailer.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h \
- $(INCLDIR)/mailer_imp.h $(INCLDIR)/shared_imp.h
mediatype.o: $(INCLDIR)/elm_defs.h
! mbox.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h
move_left.o: $(INCLDIR)/elm_defs.h
msgcat.o: $(INCLDIR)/msgcat.h $(INCLDIR)/elm_defs.h
--- 475,483 ----
localmbx.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h
mail_gets.o: $(INCLDIR)/elm_defs.h
mediatype.o: $(INCLDIR)/elm_defs.h
! mbox.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h
move_left.o: $(INCLDIR)/elm_defs.h
msgcat.o: $(INCLDIR)/msgcat.h $(INCLDIR)/elm_defs.h
***************
*** 471,476 ****
--- 493,500 ----
pop.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h
posixsig.o: $(INCLDIR)/elm_defs.h
+ rc_delay.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/save_opts.h \
+ $(INCLDIR)/rc_imp.h
rc_handle.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/save_opts.h \
$(INCLDIR)/s_elm.h $(INCLDIR)/rc_imp.h $(INCLDIR)/shared_imp.h
read_rc.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/save_opts.h \
***************
*** 490,505 ****
$(INCLDIR)/rc_imp.h $(INCLDIR)/cs_imp.h $(INCLDIR)/ss_imp.h \
$(INCLDIR)/mailer_imp.h
shared_connect.o: $(INCLDIR)/elm_defs.h \


! $(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h $(INCLDIR)/mailer_imp.h

shared_base.o: $(INCLDIR)/elm_defs.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
shared_all.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
! sb_file.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
! sb_mem.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/sb_imp.h
schedule.o: $(INCLDIR)/elm_defs.h
! service_list.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h $(INCLDIR)/ss_imp.h
shiftlower.o: $(INCLDIR)/elm_defs.h
state.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
--- 514,535 ----
$(INCLDIR)/rc_imp.h $(INCLDIR)/cs_imp.h $(INCLDIR)/ss_imp.h \
$(INCLDIR)/mailer_imp.h
shared_connect.o: $(INCLDIR)/elm_defs.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h \
! $(INCLDIR)/cs_imp.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/ss_imp.h $(INCLDIR)/mailer_imp.h
shared_base.o: $(INCLDIR)/elm_defs.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/rc_imp.h \
! $(INCLDIR)/save_opts.h $(INCLDIR)/cs_imp.h
shared_all.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/shared_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/rc_imp.h \
! $(INCLDIR)/cs_imp.h
! sb_file.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/sb_imp.h
! sb_mem.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/sb_imp.h
schedule.o: $(INCLDIR)/elm_defs.h
! service_list.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h \
! $(INCLDIR)/s_me.h \
$(INCLDIR)/mbx_imp.h $(INCLDIR)/shared_imp.h $(INCLDIR)/ss_imp.h
shiftlower.o: $(INCLDIR)/elm_defs.h
state.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h
***************
*** 513,524 ****
strmcpy.o: $(INCLDIR)/elm_defs.h
strincmp.o: $(INCLDIR)/elm_defs.h
striparens.o: $(INCLDIR)/elm_defs.h
- strtokq.o: $(INCLDIR)/elm_defs.h
syscall.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h
terminal.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
unicode.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/unidata.h
! unidata.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/unidata.h
write_hdr.o: $(INCLDIR)/elm_defs.h
!NO!SUBS!

--- 543,555 ----
strmcpy.o: $(INCLDIR)/elm_defs.h
strincmp.o: $(INCLDIR)/elm_defs.h
striparens.o: $(INCLDIR)/elm_defs.h
syscall.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_elm.h
terminal.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h $(INCLDIR)/cs_terminal.h
unicode.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/cs_imp.h \
$(INCLDIR)/unidata.h
! unidata.o: $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h \
! $(INCLDIR)/unidata.h
! write_rc.o: $(INCLDIR)/elm_defs.h
write_hdr.o: $(INCLDIR)/elm_defs.h
!NO!SUBS!

Index: elmME+.2.5.alpha5-cvs/lib/mbox.c
*** elmME+.2.5.alpha4/lib/mbox.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/mbox.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51.8.6 2004/08/14 12:06:09 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.8.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mbox.c,v 1.51.8.11 2005/07/26 08:28:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.51.8.11 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 17,23 ****
* Incorparated Elm 2.5 code from src/screen.c (show_message_status()):


* That code was following copyright:

*
! * The Elm Mail System - $Revision: 1.51.8.6 $ $State: Exp $
*


* Copyright (c) 1988-1995 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor

--- 17,23 ----
* Incorparated Elm 2.5 code from src/screen.c (show_message_status()):


* That code was following copyright:

*
! * The Elm Mail System - $Revision: 1.51.8.11 $ $State: Exp $
*


* Copyright (c) 1988-1995 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor
***************

*** 60,68 ****
return;
}

! static int mbx_lock_no_name P_((int direction,struct folder_info *folder));
static int mbx_lock_no_name(direction,folder)


! int direction;
struct folder_info *folder;
{

DPRINT(Debug,11,(&Debug,
--- 60,68 ----
return;
}

! static int mbx_lock_no_name P_((enum lock_direction direction,struct folder_info *folder));
static int mbx_lock_no_name(direction,folder)


! enum lock_direction direction;
struct folder_info *folder;
{

DPRINT(Debug,11,(&Debug,
***************
*** 245,253 ****
return 0;
}

! static CONST char * mbx_is_forwarded_null P_((struct folder_info *folder,
READ_STATE read_state_ptr));
! static CONST char * mbx_is_forwarded_null(folder,read_state_ptr)


struct folder_info *folder;
READ_STATE read_state_ptr;
{

--- 245,253 ----
return 0;
}

! static const char * mbx_is_forwarded_null P_((struct folder_info *folder,
READ_STATE read_state_ptr));
! static const char * mbx_is_forwarded_null(folder,read_state_ptr)


struct folder_info *folder;
READ_STATE read_state_ptr;
{
***************

*** 440,447 ****
}


! CONST char * mbx_no_name_type P_((struct folder_info *folder));
! CONST char * mbx_no_name_type(folder)
struct folder_info *folder;
{
char * status = "NULL";
--- 440,447 ----
}


! const char * mbx_no_name_type P_((struct folder_info *folder));
! const char * mbx_no_name_type(folder)
struct folder_info *folder;
{
char * status = "NULL";
***************
*** 457,466 ****


static int mbx_start_edit_no_name P_((struct folder_info *folder,
! CONST char **buffer));
static int mbx_start_edit_no_name(folder,buffer)


struct folder_info *folder;
! CONST char **buffer;
{
DPRINT(Debug,11,(&Debug,

"mbx_start_edit_no_name=0 (dummy): folder=%p (%s)\n",
--- 457,466 ----


static int mbx_start_edit_no_name P_((struct folder_info *folder,
! const char **buffer));
static int mbx_start_edit_no_name(folder,buffer)


struct folder_info *folder;
! const char **buffer;
{
DPRINT(Debug,11,(&Debug,

"mbx_start_edit_no_name=0 (dummy): folder=%p (%s)\n",
***************
*** 562,574 ****
mbx_free_ks_fields_null,
mbx_get_no_name_mode};

! CONST folder_type_p NO_NAME = &no_name;
! CONST folder_type_p NON_SPOOL = &non_spool; /* mailfile -- not mailbox */
! CONST folder_type_p SPOOL = &spool; /* normal mailbox */
! CONST folder_type_p READ_ONLY = &read_only; /* read only mailfile */
#ifdef REMOTE_MBX
! CONST folder_type_p POP_MBX = &pop_mbx; /* POP mailbox */
! CONST folder_type_p IMAP_MBX = &imap_mbx; /* IMAP mailbox */
#endif


--- 562,574 ----
mbx_free_ks_fields_null,
mbx_get_no_name_mode};

! const folder_type_p NO_NAME = &no_name;
! const folder_type_p NON_SPOOL = &non_spool; /* mailfile -- not mailbox */
! const folder_type_p SPOOL = &spool; /* normal mailbox */
! const folder_type_p READ_ONLY = &read_only; /* read only mailfile */
#ifdef REMOTE_MBX
! const folder_type_p POP_MBX = &pop_mbx; /* POP mailbox */
! const folder_type_p IMAP_MBX = &imap_mbx; /* IMAP mailbox */
#endif


***************
*** 601,607 ****
/* General routines -------------------------------------------------------- */

folder_type_p get_folder_type(filename, in_mail,treat_as_spooled)
! CONST char *filename;
enum folder_place *in_mail;
int treat_as_spooled;
{
--- 601,607 ----
/* General routines -------------------------------------------------------- */

folder_type_p get_folder_type(filename, in_mail,treat_as_spooled)
! const char *filename;
enum folder_place *in_mail;
int treat_as_spooled;
{
***************
*** 633,639 ****
int err = errno;
DPRINT(Debug,8,(&Debug,
"get_folder_type: errno %d (%s) attempting to stat file %s\n",
! err, error_description(err), filename));
} else
buf = &bufX;

--- 633,639 ----
int err = errno;
DPRINT(Debug,8,(&Debug,
"get_folder_type: errno %d (%s) attempting to stat file %s\n",
! err, strerror(err), filename));
} else
buf = &bufX;

***************
*** 653,663 ****


}

if (in_mail) {
! if (folders[0]) {
! if (in_directory(buf,filename,folders)) {
DPRINT(Debug,8,(&Debug,
"get_folder_type: On folders directory: %s\n",
! folders));
*in_mail = in_folders;
}
}

--- 653,666 ----
}

if (in_mail) {


! /* give_dt_estr_as_str adds / to end */
! char * str = give_dt_estr_as_str(&folders_e,"maildir");
!

! if (str) {
! if (in_directory(buf,filename,str)) {
DPRINT(Debug,8,(&Debug,
"get_folder_type: On folders directory: %s\n",
! str));
*in_mail = in_folders;
}
}
***************

*** 730,736 ****

DPRINT(Debug,8,(&Debug,
"get_folder_type=READ_ONLY; no write access: %s (errno %d)\n",
! error_description(err),err));
return(READ_ONLY);
}

--- 733,739 ----

DPRINT(Debug,8,(&Debug,
"get_folder_type=READ_ONLY; no write access: %s (errno %d)\n",
! strerror(err),err));
return(READ_ONLY);
}

***************
*** 748,758 ****

int in_directory(buf1,name,dir)
struct stat *buf1;
! CONST char *name;
! CONST char * dir;
{
! CONST char * ptr = strrchr(name,'/');
! CONST char * X = name;
int l1 = strlen(dir);

if (buf1) {
--- 751,761 ----

int in_directory(buf1,name,dir)
struct stat *buf1;
! const char *name;
! const char * dir;
{
! const char * ptr = strrchr(name,'/');
! const char * X = name;
int l1 = strlen(dir);

if (buf1) {
***************
*** 794,800 ****
int err = errno;
DPRINT(Debug,8,(&Debug,
"in_directory=1: %s (errno=%d) attempting to stat file %s\n",
! error_description(err), err, cmp));
free(cmp);
return 0;
}
--- 797,803 ----
int err = errno;
DPRINT(Debug,8,(&Debug,
"in_directory=1: %s (errno=%d) attempting to stat file %s\n",
! strerror(err), err, cmp));
free(cmp);
return 0;
}
***************
*** 830,836 ****
int err = errno;
DPRINT(Debug,8,(&Debug,
"same_file(%s,%s)=FALSE: %s (errno=%d) attempting to stat file %s\n",
! name1,name2,error_description(err), err, name1));
return FALSE;
}

--- 833,839 ----
int err = errno;
DPRINT(Debug,8,(&Debug,
"same_file(%s,%s)=FALSE: %s (errno=%d) attempting to stat file %s\n",
! name1,name2,strerror(err), err, name1));
return FALSE;
}

***************
*** 838,844 ****
int err = errno;
DPRINT(Debug,8,(&Debug,
"same_file(%s,%s)=FALSE: %s (errno=%d) attempting to stat file %s\n",
! name1,name2,error_description(err), err, name2));
return FALSE;
}

--- 841,847 ----
int err = errno;
DPRINT(Debug,8,(&Debug,
"same_file(%s,%s)=FALSE: %s (errno=%d) attempting to stat file %s\n",
! name1,name2,strerror(err), err, name2));
return FALSE;
}

***************
*** 970,976 ****
}

int lock_folder(direction, folder)


! int direction;
struct folder_info *folder;
{

int ret;
--- 973,979 ----
}

int lock_folder(direction, folder)


! enum lock_direction direction;
struct folder_info *folder;
{

int ret;
***************
*** 1059,1064 ****
--- 1062,1069 ----

mode = SESSIONLOCK_NONE;


break;
+ default:
+ break;
}

ret = folder->folder_type->sessionlock_it(folder,mode);
***************
*** 1495,1505 ****
return status;
}

! CONST char * is_forwarded_folder(folder,read_state_ptr)


struct folder_info *folder;
READ_STATE read_state_ptr;
{

! CONST char *ret;

if (!valid_magic(folder->folder_type))
panic("MBX PANIC",__FILE__,__LINE__,"is_forwarded_folder",
--- 1500,1510 ----
return status;
}

! const char * is_forwarded_folder(folder,read_state_ptr)


struct folder_info *folder;
READ_STATE read_state_ptr;
{

! const char *ret;

if (!valid_magic(folder->folder_type))
panic("MBX PANIC",__FILE__,__LINE__,"is_forwarded_folder",
***************
*** 1873,1882 ****
folder->folder_type->mark_keep_it(folder,keep_state_ptr,entry,keep);
}

! CONST char * folder_type(folder)
struct folder_info *folder;
{
! CONST char *ret;

if (!valid_magic(folder->folder_type))
panic("MBX PANIC",__FILE__,__LINE__,"folder_type",
--- 1878,1887 ----
folder->folder_type->mark_keep_it(folder,keep_state_ptr,entry,keep);
}

! const char * folder_type(folder)
struct folder_info *folder;
{
! const char *ret;

if (!valid_magic(folder->folder_type))
panic("MBX PANIC",__FILE__,__LINE__,"folder_type",
***************
*** 1918,1924 ****

int start_edit_folder(folder,buffer)


struct folder_info *folder;
! CONST char **buffer;
{

int ret;
if (!valid_magic(folder->folder_type))
--- 1923,1929 ----

int start_edit_folder(folder,buffer)


struct folder_info *folder;
! const char **buffer;
{

int ret;
if (!valid_magic(folder->folder_type))
***************
*** 2179,2185 ****

/* result MALLOCED */
char * return_path_to_env_from_1(value)
! CONST char *value;
{
char * temp = NULL;

--- 2184,2190 ----

/* result MALLOCED */
char * return_path_to_env_from_1(value)
! const char *value;
{
char * temp = NULL;

***************
*** 2228,2239 ****

void return_path_to_env_from(entry,value)
struct header_rec *entry;
! CONST char *value;


{
DPRINT(Debug,20,(&Debug,
"return_path_to_env_from- value=%s\n",value));
DPRINT(Debug,20,(&Debug,
! "env_from_source=%d\n",env_from_source));

/* env_from_source:
0 == forward-from,

--- 2233,2246 ----

void return_path_to_env_from(entry,value)
struct header_rec *entry;
! const char *value;
{


+ int ef = give_dt_enumerate_as_int(&env_from_source);
+

DPRINT(Debug,20,(&Debug,
"return_path_to_env_from- value=%s\n",value));
DPRINT(Debug,20,(&Debug,
! "env_from_source=%d\n",ef));

/* env_from_source:
0 == forward-from,
***************

*** 2241,2247 ****
2 == return-path
*/


! if (env_from_source <3) {
char * temp = return_path_to_env_from_1(value);

if (temp) {

--- 2248,2254 ----
2 == return-path
*/


! if (ef <3) {
char * temp = return_path_to_env_from_1(value);

if (temp) {

Index: elmME+.2.5.alpha5-cvs/lib/mediatype.c
*** elmME+.2.5.alpha4/lib/mediatype.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/mediatype.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.12.8.2 2004/04/25 14:52:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mediatype.c,v 1.12.8.4 2005/07/26 08:28:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 21,27 ****
struct media_type {
unsigned short magic; /* MEDIA_TYPE_magic */
enum mime_major_type major_type_index;
! CONST char * subtype;
int flags; /* MIME_xxx */

struct media_type_handle **handles;
--- 21,27 ----
struct media_type {
unsigned short magic; /* MEDIA_TYPE_magic */
enum mime_major_type major_type_index;
! const char * subtype;
int flags; /* MIME_xxx */

struct media_type_handle **handles;
***************
*** 76,82 ****
NULL, 0, NULL };

static struct major_type {


! CONST char * name;

struct media_type * list;

int flags; /* MIME_xxx */
--- 76,82 ----
NULL, 0, NULL };

static struct major_type {


! const char * name;

struct media_type * list;

int flags; /* MIME_xxx */


***************
*** 109,114 ****
--- 109,117 ----
enum mime_major_type get_major_type_code(T)
media_type_t T;
{
+ if (!T)
+ return MIME_TYPE_UNKNOWN;
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_major_type_code",
"Bad magic number",0);
***************

*** 121,129 ****
return T->major_type_index;
}

! CONST char * get_major_type_name(T)
media_type_t T;
{


if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_major_type_name",
"Bad magic number",0);

--- 124,135 ----
return T->major_type_index;
}

! const char * get_major_type_name(T)


media_type_t T;
{
+ if (!T)
+ return "?unknown?";
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_major_type_name",
"Bad magic number",0);
***************

*** 136,142 ****
return major_type_list[T->major_type_index].name;
}

! CONST char * get_major_type_name2(m)
enum mime_major_type m;
{
if (m < 0 || m >= major_type_count)
--- 142,148 ----
return major_type_list[T->major_type_index].name;
}

! const char * get_major_type_name2(m)
enum mime_major_type m;
{
if (m < 0 || m >= major_type_count)
***************
*** 152,157 ****


--- 158,167 ----
media_type_t T;
{
int ret;
+
+ if (!T)

+ return 0;
+

if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_type_flags",
"Bad magic number",0);
***************

*** 172,190 ****
return ret;
}

! CONST char * get_subtype_name(T)
media_type_t T;
{


if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_subtype_name",
"Bad magic number",0);


return T->subtype;
}

enum mime_major_type give_major_type(major,create)
! CONST char * major;
int create;
{
int i;
--- 182,206 ----
return ret;
}

! const char * get_subtype_name(T)


media_type_t T;
{
+
+ if (!T)
+ return "?unknown?";
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"get_subtype_name",

"Bad magic number",0);


+ if (! T->subtype)
+ return "?unknown?";

return T->subtype;
}

enum mime_major_type give_major_type(major,create)
! const char * major;
int create;
{
int i;
***************
*** 228,241 ****
}

media_type_t give_media_type(major,minor,create)
! CONST char * major;
! CONST char * minor;
int create;
{



enum mime_major_type I1 = give_major_type(major,create);

! if (MIME_TYPE_UNKNOWN == I1)
return NULL;

return give_media_type2(I1,minor,create);

--- 244,257 ----
}

media_type_t give_media_type(major,minor,create)
! const char * major;
! const char * minor;
int create;
{



enum mime_major_type I1 = give_major_type(major,create);

! if (MIME_TYPE_UNKNOWN == I1 && !create)
return NULL;

return give_media_type2(I1,minor,create);
***************

*** 243,249 ****

media_type_t give_media_type2(major_type_code,minor,create)
enum mime_major_type major_type_code;
! CONST char * minor;
int create;
{
struct media_type * p;
--- 259,265 ----

media_type_t give_media_type2(major_type_code,minor,create)
enum mime_major_type major_type_code;
! const char * minor;
int create;
{
struct media_type * p;
***************
*** 300,305 ****
--- 316,324 ----


int give_text_type_code(T)
media_type_t T;
{
+ if (!T)
+ return -1;
+
if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"give_text_type_code",
"Bad magic number",0);

***************
*** 397,402 ****
--- 416,427 ----


int *is_default;
enum mt_handle_type kind;
{
+ if (!T) {
+ *H = NULL;

+ return 0;
+ }
+
+

if (MEDIA_TYPE_magic != T->magic)
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"walk_mt_handler",
"Bad magic number",0);
***************

*** 425,431 ****


}
if (i >= T->handle_count) {
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"walk_mt_handler",
! "previous non defualt handler not found",0);
return 0; /* NOT REACHED */
}

--- 450,456 ----


}
if (i >= T->handle_count) {
panic("MEDIA TYPE PANIC",__FILE__,__LINE__,"walk_mt_handler",
! "previous non-default handler not found",0);
return 0; /* NOT REACHED */
}

Index: elmME+.2.5.alpha5-cvs/lib/mmaputil.c
*** elmME+.2.5.alpha4/lib/mmaputil.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/mmaputil.c 2005-07-23 22:01:35.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mmaputil.c,v 1.5.8.1 2004/04/18 16:55:39 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mmaputil.c,v 1.5.8.2 2005/07/23 19:01:35 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.2 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 58,64 ****
status = 0;

DPRINT(Debug,5,(&Debug,"unidata: lseek failed: errno=%d (%s)\n", \
! err,error_description(err)));

goto fail;
}
--- 58,64 ----
status = 0;

DPRINT(Debug,5,(&Debug,"unidata: lseek failed: errno=%d (%s)\n", \
! err,strerror(err)));

goto fail;
}
***************
*** 71,77 ****
status = 0;

DPRINT(Debug,5,(&Debug,"unidata: write failed: errno=%d (%s)\n", \
! err,error_description(err)));

goto fail;
}
--- 71,77 ----
status = 0;

DPRINT(Debug,5,(&Debug,"unidata: write failed: errno=%d (%s)\n", \
! err,strerror(err)));

goto fail;
}
Index: elmME+.2.5.alpha5-cvs/lib/ndbz.c
*** elmME+.2.5.alpha4/lib/ndbz.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/ndbz.c 2005-07-20 19:49:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.7.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: ndbz.c,v 1.7.8.2 2005/07/20 16:49:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

!

! static char * /* NULL if malloc fails */
! enstring P_((char *s1,char *s2));
!

/* central data structures */
! static of_t * /* pointer to copy, or NULL */
! getcore P_((DBZ *db));
!
! static int /* 0 okay, -1 fail */
! putcore P_((DBZ *db));

/*
- dbz_fresh - set up a new database, no historical info

***************
*** 344,349 ****

#ifdef DBZDEBUG
register int old = debug;
Index: elmME+.2.5.alpha5-cvs/lib/okay_addr.c
*** elmME+.2.5.alpha4/lib/okay_addr.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/okay_addr.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: okay_addr.c,v 1.17.8.3 2004/05/01 20:07:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.3 $ $State: Exp $
*
* Reimplemented by: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: okay_addr.c,v 1.17.8.4 2005/07/26 08:28:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.4 $ $State: Exp $
*
* Reimplemented by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 31,43 ****
static int strcpy_dequote P_((char * target, const char * source, int size));
static int strcpy_dequote(target,source,size)
char * target;
! CONST char * source;
int size;
{
int r = 0;

int q = 0;
! CONST char *s;
char *t;
int overflow = 0;
int syntax_error = 0;
--- 31,43 ----
static int strcpy_dequote P_((char * target, const char * source, int size));
static int strcpy_dequote(target,source,size)
char * target;
! const char * source;
int size;
{
int r = 0;

int q = 0;
! const char *s;
char *t;
int overflow = 0;
int syntax_error = 0;
***************
*** 245,258 ****
}

int okay_address_l(address, return_address)
! CONST struct addr_item *address, *return_address;
{

/** This routine checks to ensure that the address we just got
from the "To:" or "Cc:" line isn't us AND isn't the person
who sent the message. Returns true iff neither is the case **/

! CONST struct addr_item *ptr;

for (ptr = return_address; ptr && ptr -> addr && ptr->fullname; ptr++) {
if (0 == strcmp(ptr -> addr, address -> addr)) {
--- 245,258 ----
}

int okay_address_l(address, return_address)
! const struct addr_item *address, *return_address;
{

/** This routine checks to ensure that the address we just got
from the "To:" or "Cc:" line isn't us AND isn't the person
who sent the message. Returns true iff neither is the case **/

! const struct addr_item *ptr;

for (ptr = return_address; ptr && ptr -> addr && ptr->fullname; ptr++) {
if (0 == strcmp(ptr -> addr, address -> addr)) {
Index: elmME+.2.5.alpha5-cvs/lib/outheaders.c
*** elmME+.2.5.alpha4/lib/outheaders.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/outheaders.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14.8.6 2004/08/07 18:07:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: outheaders.c,v 1.14.8.10 2005/07/26 08:28:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.10 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 25,128 ****
return (unsigned char *)str;
}


- static char *us2s P_((unsigned char *str));
- static char *us2s(str)

- unsigned char *str;
- {
- return (char *)str;
- }
-
-
-

- int i;
-

! CONST char *ADR;
! CONST struct string *FN;
! CONST struct string *COM;
{
if (x->magic != EXP_ADDR_magic)
panic("HEADERS PANIC",__FILE__,__LINE__,"add_expanded_addr_",
--- 25,35 ----
return (unsigned char *)str;
}


int add_expanded_addr_ (x,ADR,FN,COM)
struct expanded_address *x;

! const char *ADR;
! const struct string *FN;
! const struct string *COM;
{
if (x->magic != EXP_ADDR_magic)
panic("HEADERS PANIC",__FILE__,__LINE__,"add_expanded_addr_",
***************
*** 141,147 ****

int add_textual_addr_ (x,TEXTUAL,POS,LEN)
struct expanded_address *x;
! CONST struct string *TEXTUAL;
int POS, LEN;
{
if (x->magic != EXP_ADDR_magic)
--- 48,54 ----

int add_textual_addr_ (x,TEXTUAL,POS,LEN)
struct expanded_address *x;
! const struct string *TEXTUAL;
int POS, LEN;
{
if (x->magic != EXP_ADDR_magic)
***************
*** 191,197 ****
int pos = result->addrs_len;
int j;
for (j = 0; j < source.surface[i].len; j++) {
! CONST struct addr_item *ptr1 = &
(source.addrs[source.surface[i].pos+j]);
int p = add_expanded_addr_(result,ptr1->addr,ptr1->fullname,
ptr1->comment);
--- 98,104 ----
int pos = result->addrs_len;
int j;
for (j = 0; j < source.surface[i].len; j++) {
! const struct addr_item *ptr1 = &
(source.addrs[source.surface[i].pos+j]);
int p = add_expanded_addr_(result,ptr1->addr,ptr1->fullname,
ptr1->comment);


***************
*** 294,371 ****
return result;
}

- char * from_addr_literal(mailer_info)
- struct mailer_info *mailer_info;
- {
- char * Q = NULL;
-
- /* If on username is strange characters (specially if username
- is from some other user database backend than from /etc/passwd)
- then quote it...

- */
-

- break;
- }
- }
-

- s1 = new_string2(display_charset,s2us(s));
-
- add_textual_addr_(expanded,s1,pos,1);
- free(s); s = NULL;
-
- free_string(&s1);
-
- free_string(&name);
- free_string(&comment);
- }
-
void expanded_address_from_items(result,TMP)
struct expanded_address *result;
struct addr_item *TMP;
--- 201,206 ----
***************

*** 393,399 ****
int add_from_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;

--- 228,234 ----
int add_from_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
***************

*** 419,425 ****
int add_to_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;

--- 254,260 ----
int add_to_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
***************

*** 445,451 ****
int add_cc_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;

--- 280,286 ----
int add_cc_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
***************

*** 471,483 ****
int add_bcc_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;

{
- int j;
-
struct addr_item * TMP;

TMP = break_down_address(value,demime,defcharset);
--- 306,316 ----
int add_bcc_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;

{
struct addr_item * TMP;

TMP = break_down_address(value,demime,defcharset);
***************
*** 500,512 ****
int add_replyto_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;

{
- int j;
-
struct addr_item * TMP;

TMP = break_down_address(value,demime,defcharset);
--- 333,343 ----
int add_replyto_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;

{
struct addr_item * TMP;

TMP = break_down_address(value,demime,defcharset);
***************
*** 521,526 ****
--- 352,378 ----


return 1;
}

+ #if ANSI_C
+ static env_from_change_hook dummy_env_from_change;
+ #endif

+ static int dummy_env_from_change P_((struct mailer_env_from *X,


+ const char * value));
+

+ static int dummy_env_from_change(X,value)
+ struct mailer_env_from *X;
+ const char * value;

+ {
+ return 0;
+
+ }
+

+ static env_from_change_hook * ef_hook = &dummy_env_from_change;
+
+ void set_env_from_change_hook(hook)
+ env_from_change_hook *hook;
+ {
+ ef_hook = hook;
+ }

#ifdef ANSI_C
hdr_add_to_mailing_hdr add_env_from_hdr;
***************

*** 528,534 ****
int add_env_from_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;

--- 380,386 ----
int add_env_from_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
***************

*** 536,543 ****
int ret = 0;


if (0 == strcmp(value,"<>")) {
! mailer_env_from_change(headers->env_from,value);
! ret = 1;
} else {
struct addr_item * TMP;

--- 388,394 ----
int ret = 0;


if (0 == strcmp(value,"<>")) {
! ret = ef_hook(headers->env_from,value);
} else {
struct addr_item * TMP;

***************
*** 545,552 ****

if (TMP[0].addr && headers->env_from) {
char * t = elm_message(FRM("<%s>"),TMP[0].addr);
! mailer_env_from_change(headers->env_from,t);
! ret = 1;
free(t);
}

--- 396,402 ----



if (TMP[0].addr && headers->env_from) {
char * t = elm_message(FRM("<%s>"),TMP[0].addr);
! ret = ef_hook(headers->env_from,t);
free(t);
}

***************

*** 565,571 ****
int add_subject_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;

--- 415,421 ----
int add_subject_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
***************

*** 588,594 ****
int add_user_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! CONST char *value;
int demime;
charset_t defcharset;
int replace;

--- 438,444 ----
int add_user_hdr(headers,X,value,demime,defcharset,replace)


struct mailing_headers * headers;
header_ptr X;
! const char *value;
int demime;
charset_t defcharset;
int replace;
***************

*** 634,640 ****

void dump_expanded_address(debuglevel,text,expanded)
int debuglevel;
! CONST char *text;
struct expanded_address expanded;

{
--- 484,490 ----

void dump_expanded_address(debuglevel,text,expanded)
int debuglevel;
! const char *text;
struct expanded_address expanded;

{
***************
*** 677,695 ****
l,"",j,ptr->pos,
expanded.addrs_len-1));
} else {
! CONST struct addr_item *ptr1 = & (expanded.addrs[ptr->pos+j]);
if (!ptr1->addr || !ptr1->fullname || !ptr1->comment) {
DPRINT(Debug,debuglevel,
(&Debug,

"%*s %d [%d] ERROR! NULL element!\n",
l,"",j,ptr->pos+j));
} else {

DPRINT(Debug,debuglevel,
(&Debug,
"%*s %d [%d] addr=%s \tfullname=%S\tcomment=%S\n",
l,"",j,ptr->pos+j,
ptr1->addr,ptr1->fullname,
ptr1->comment));
}

LASTPOS = ptr->pos+j;
}
--- 527,566 ----
l,"",j,ptr->pos,
expanded.addrs_len-1));
} else {
! const struct addr_item *ptr1 = & (expanded.addrs[ptr->pos+j]);
if (!ptr1->addr || !ptr1->fullname || !ptr1->comment) {
DPRINT(Debug,debuglevel,
(&Debug,

"%*s %d [%d] ERROR! NULL element!\n",
l,"",j,ptr->pos+j));
} else {

+ const char *A, *B;
+

DPRINT(Debug,debuglevel,
(&Debug,
"%*s %d [%d] addr=%s \tfullname=%S\tcomment=%S\n",
l,"",j,ptr->pos+j,
ptr1->addr,ptr1->fullname,
ptr1->comment));
+
+ A = get_string_MIME_name(ptr1->fullname);
+ B = get_string_lang(ptr1->fullname);
+
+ DPRINT(Debug,debuglevel,
+ (&Debug,
+ "%*s fullname cs=%s lang=%s, ",

+ l,"",


+ A ? A : "<none>",
+ B ? B : "<none>"));
+

+ A = get_string_MIME_name(ptr1->comment);
+ B = get_string_lang(ptr1->comment);
+
+ DPRINT(Debug,debuglevel,

+ (&Debug,"comment cs=%s lang=%s\n",


+ A ? A : "<none>",
+ B ? B : "<none>"));
+
}

LASTPOS = ptr->pos+j;
}
***************

*** 757,774 ****

if (len > 0) {
struct run_state RS;
! CONST char * argv[4];


int retcode;

char local_buffer[80];
int n;

int res;

DPRINT(Debug,5,(&Debug, "eval_backquote: command: %s\n",
clip));

! argv[0] = shell;
argv[1] = "-c";
argv[2] = clip;
argv[3] = NULL;

--- 628,649 ----

if (len > 0) {
struct run_state RS;
! const char * argv[4];


int retcode;

char local_buffer[80];
+ char * sh = give_dt_estr_as_str(&shell_e,"shell");
int n;

int res;

+ if (!sh)
+ sh = "/bin/sh";
+
DPRINT(Debug,5,(&Debug, "eval_backquote: command: %s\n",
clip));

! argv[0] = sh;
argv[1] = "-c";
argv[2] = clip;
argv[3] = NULL;

***************
*** 852,858 ****

if (0 != (err = can_open(user_mailheaders,"r"))) {
DPRINT(Debug,5,(&Debug, "%s not available: %s (errno=%d)\n",
! user_mailheaders,error_description(err),err));
return;
}

--- 727,733 ----

if (0 != (err = can_open(user_mailheaders,"r"))) {
DPRINT(Debug,5,(&Debug, "%s not available: %s (errno=%d)\n",
! user_mailheaders,strerror(err),err));
return;
}

Index: elmME+.2.5.alpha5-cvs/lib/output.c
*** elmME+.2.5.alpha4/lib/output.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/output.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: output.c,v 1.32.8.2 2004/07/19 09:20:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: output.c,v 1.32.8.3 2005/07/26 08:28:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 23,31 ****
return (char *)str;
}

! static int def_err_handler P_((CONST char *str));
static int def_err_handler (str)
! CONST char *str;
{
int ret;
int l = strlen(str);
--- 23,31 ----
return (char *)str;
}

! static int def_err_handler P_((const char *str));
static int def_err_handler (str)
! const char *str;
{
int ret;
int l = strlen(str);
***************
*** 51,57 ****

static char * def_prompt_handler P_((const char *str, int pass));
static char * def_prompt_handler (str,pass)
! CONST char *str;
int pass;
{
int l = strlen(str);
--- 51,57 ----

static char * def_prompt_handler P_((const char *str, int pass));
static char * def_prompt_handler (str,pass)
! const char *str;
int pass;
{
int l = strlen(str);
***************
*** 95,105 ****
int parse_format_args (elems,max_elems,format,args,format_error)
struct format_elem *elems;
int max_elems;


! CONST char * format;

va_list args;
char **format_error;
{


! CONST char * s;

int idx;

#define INC(p) { (p)++; if (!*(p)) break; }
--- 95,105 ----
int parse_format_args (elems,max_elems,format,args,format_error)
struct format_elem *elems;
int max_elems;


! const char * format;

va_list args;
char **format_error;
{


! const char * s;

int idx;

#define INC(p) { (p)++; if (!*(p)) break; }
***************
*** 416,426 ****

struct string * elm_smessage(max_alloc,format,msg,args)
int max_alloc;
! CONST char *format;
! CONST char *msg;
va_list args;
{


! CONST char * s;

struct string * store1 = NULL, * msg1 = NULL;
charset_t msg_charset = display_charset;

--- 416,426 ----

struct string * elm_smessage(max_alloc,format,msg,args)
int max_alloc;
! const char *format;
! const char *msg;
va_list args;
{


! const char * s;

struct string * store1 = NULL, * msg1 = NULL;
charset_t msg_charset = display_charset;

***************
*** 470,476 ****


switch(elems[idx].format_chr) {
! CONST char *str, *a;

int l,c;

--- 470,476 ----


switch(elems[idx].format_chr) {
! const char *str, *a;

int l,c;

***************
*** 808,814 ****
}

switch(*s) {


! CONST struct string *str;

case 's': case 'Q': case 'd': case 'c': case 'C':
case 'x': case 'X': case 'S': case 'p': case 'o':
case 'i': case 'u': case 'f':
--- 808,814 ----
}

switch(*s) {


! const struct string *str;

case 's': case 'Q': case 'd': case 'c': case 'C':
case 'x': case 'X': case 'S': case 'p': case 'o':
case 'i': case 'u': case 'f':
***************
*** 880,887 ****

char *elm_vmessage (max_alloc,format,msg,vl)
int max_alloc;
! CONST char *format;
! CONST char *msg;
va_list vl;
{
char * store1 = NULL;
--- 880,887 ----

char *elm_vmessage (max_alloc,format,msg,vl)
int max_alloc;
! const char *format;
! const char *msg;
va_list vl;
{
char * store1 = NULL;
***************
*** 908,914 ****
int elem_count, idx;


char * format_error = NULL;

! CONST char * s;

int ptr1 = 0, alloced1 = 0;

struct store2 {
--- 908,914 ----
int elem_count, idx;


char * format_error = NULL;

! const char * s;

int ptr1 = 0, alloced1 = 0;

struct store2 {
***************
*** 983,989 ****
elems[idx].format_chr));

switch(elems[idx].format_chr) {
! CONST char *str, *a;

int l,c;
int quote,X;
--- 983,989 ----
elems[idx].format_chr));

switch(elems[idx].format_chr) {
! const char *str, *a;

int l,c;
int quote,X;
***************
*** 1266,1272 ****
}

switch(*s) {
! CONST char *str,*a;
case 's': case 'Q': case 'd': case 'c': case 'C': case 'x':
case 'X': case 'S': case 'p': case 'o':
case 'i': case 'u': case 'f':
--- 1266,1272 ----
}

switch(*s) {
! const char *str,*a;
case 's': case 'Q': case 'd': case 'c': case 'C': case 'x':
case 'X': case 'S': case 'p': case 'o':
case 'i': case 'u': case 'f':
***************
*** 1322,1329 ****


#endif
)
#if !ANSI_C
! CONST char * format;

! CONST char *msg;
va_dcl
#endif
{
--- 1322,1329 ----


#endif
)
#if !ANSI_C
! const char * format;

! const char *msg;
va_dcl
#endif
{
***************
*** 1363,1370 ****


#endif
)
#if !ANSI_C
! CONST char * format;

! CONST char *msg;
va_dcl
#endif
{
--- 1363,1370 ----


#endif
)
#if !ANSI_C
! const char * format;

! const char *msg;
va_dcl
#endif
{
***************
*** 1392,1409 ****
return ret;
}

! char * lib_prompt P_((int prompt, CONST char * format, CONST char *msg, ...));
char * lib_prompt (
#if ANSI_C
! int prompt, CONST char * format, CONST char *msg, ...
#else
prompt,format,msg,va_alist
#endif
)
#if !ANSI_C
int prompt;


! CONST char * format;

! CONST char *msg;
va_dcl
#endif
{
--- 1392,1409 ----
return ret;
}

! char * lib_prompt P_((int prompt, const char * format, const char *msg, ...));
char * lib_prompt (
#if ANSI_C
! int prompt, const char * format, const char *msg, ...
#else
prompt,format,msg,va_alist
#endif
)
#if !ANSI_C
int prompt;


! const char * format;

! const char *msg;
va_dcl
#endif
{
***************
*** 1435,1449 ****

char *elm_message (
#if ANSI_C
! CONST char * format,
! CONST char *msg, ...
#else
format, msg, va_alist


#endif
)
#if !ANSI_C
! CONST char * format;

! CONST char *msg;
va_dcl
#endif
{
--- 1435,1449 ----

char *elm_message (
#if ANSI_C
! const char * format,
! const char *msg, ...
#else
format, msg, va_alist


#endif
)
#if !ANSI_C
! const char * format;

! const char *msg;
va_dcl
#endif
{
***************
*** 1468,1482 ****

struct string * format_string (
#if ANSI_C
! CONST char * format,
! CONST char *msg, ...
#else
format, msg, va_alist


#endif
)
#if !ANSI_C
! CONST char * format;

! CONST char *msg;
va_dcl
#endif
{
--- 1468,1482 ----

struct string * format_string (
#if ANSI_C
! const char * format,
! const char *msg, ...
#else
format, msg, va_alist


#endif
)
#if !ANSI_C
! const char * format;

! const char *msg;
va_dcl
#endif
{
***************
*** 1501,1508 ****
int elm_sfprintf (
#if ANSI_C


char * buffer, int size,

! CONST char * format,
! CONST char *msg, ...
#else
buffer, size, format, msg, va_alist
#endif
--- 1501,1508 ----
int elm_sfprintf (
#if ANSI_C


char * buffer, int size,

! const char * format,
! const char *msg, ...
#else
buffer, size, format, msg, va_alist
#endif
***************
*** 1510,1517 ****
#if !ANSI_C


char * buffer;
int size;

! CONST char * format;

! CONST char *msg;
va_dcl
#endif
{
--- 1510,1517 ----
#if !ANSI_C


char * buffer;
int size;

! const char * format;

! const char *msg;
va_dcl
#endif
{
***************
*** 1536,1550 ****

int elm_fprintf (
#if ANSI_C
! FILE *f, CONST char * format, CONST char *msg, ...
#else
f, format,msg, va_alist
#endif
)
#if !ANSI_C
FILE *f;


! CONST char * format;

! CONST char *msg;
va_dcl
#endif
{
--- 1536,1550 ----

int elm_fprintf (
#if ANSI_C
! FILE *f, const char * format, const char *msg, ...
#else
f, format,msg, va_alist
#endif
)
#if !ANSI_C
FILE *f;


! const char * format;

! const char *msg;
va_dcl
#endif
{
Index: elmME+.2.5.alpha5-cvs/lib/panic.c
*** elmME+.2.5.alpha4/lib/panic.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/panic.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: panic.c,v 1.12.8.1 2004/04/18 16:55:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: panic.c,v 1.12.8.2 2005/07/26 08:28:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 9,22 ****
#include "elm_defs.h"
#include "s_me.h"

! static void def_panic_prepare P_((CONST int interrupt,
! CONST char * title,
! CONST char * ms));

static void def_panic_prepare(interrupt,title,ms)
! CONST int interrupt;
! CONST char * title;
! CONST char * ms;
{
/* NULL */
}
--- 9,22 ----
#include "elm_defs.h"
#include "s_me.h"

! static void def_panic_prepare P_((const int interrupt,
! const char * title,
! const char * ms));

static void def_panic_prepare(interrupt,title,ms)
! const int interrupt;
! const char * title;
! const char * ms;
{
/* NULL */
}
***************
*** 28,36 ****
prepare = fn;
}

! static void def_panic_exit P_((CONST int interrupt));
static void def_panic_exit(interrupt)
! CONST int interrupt;
{
if (interrupt)
abort();
--- 28,36 ----
prepare = fn;
}

! static void def_panic_exit P_((const int interrupt));
static void def_panic_exit(interrupt)
! const int interrupt;
{
if (interrupt)
abort();
***************
*** 46,52 ****

static void print_str_err P_((const char * ptr));
static void print_str_err(ptr)


! CONST char * ptr;

{
int l = strlen(ptr);
write(2,ptr,l);
--- 46,52 ----

static void print_str_err P_((const char * ptr));
static void print_str_err(ptr)


! const char * ptr;

{
int l = strlen(ptr);
write(2,ptr,l);
***************
*** 68,82 ****
}

void panic(title,f,ln,pr,ms,interrupt)
! CONST char * title;
! CONST char * f;
! CONST int ln;
! CONST char * pr;
! CONST char * ms;
! CONST int interrupt;
{

! static VOLATILE int in_panic = 0;
static char ABORTING[] = "ABORTING...\n";

#if DEBUG
--- 68,82 ----
}

void panic(title,f,ln,pr,ms,interrupt)
! const char * title;
! const char * f;
! const int ln;
! const char * pr;
! const char * ms;
! const int interrupt;
{

! static volatile int in_panic = 0;
static char ABORTING[] = "ABORTING...\n";

#if DEBUG
Index: elmME+.2.5.alpha5-cvs/lib/parsarpdat.c
*** elmME+.2.5.alpha4/lib/parsarpdat.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/parsarpdat.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: parsarpdat.c,v 1.9.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: parsarpdat.c,v 1.9.8.2 2005/07/26 08:28:39 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 55,61 ****
*/

int parse_date_time(str,time_zone,size_time_zone,tz_offset, time_result)
! CONST char *str;
char *time_zone;
int size_time_zone;
time_t *tz_offset;
--- 55,61 ----
*/

int parse_date_time(str,time_zone,size_time_zone,tz_offset, time_result)
! const char *str;
char *time_zone;
int size_time_zone;
time_t *tz_offset;
Index: elmME+.2.5.alpha5-cvs/lib/pop.c
*** elmME+.2.5.alpha4/lib/pop.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/pop.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pop.c,v 1.46.8.2 2004/05/01 07:41:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pop.c,v 1.46.8.7 2005/07/26 08:28:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.46.8.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 68,77 ****
/* Returns existing entry or creates new */

static struct uidl_entry * give_uidl P_((struct uidl_entry **root,
! CONST char * uidl));
static struct uidl_entry * give_uidl(root,uidl)
struct uidl_entry **root;
! CONST char * uidl;
{
struct uidl_entry *ptr = *root;
int r;
--- 68,77 ----
/* Returns existing entry or creates new */

static struct uidl_entry * give_uidl P_((struct uidl_entry **root,
! const char * uidl));
static struct uidl_entry * give_uidl(root,uidl)
struct uidl_entry **root;
! const char * uidl;
{
struct uidl_entry *ptr = *root;
int r;
***************
*** 138,146 ****
print_uidls(F,root->bigger);
}

! static void update_uidls P_((CONST char *name, struct uidl_entry **root));
static void update_uidls(name, root)
! CONST char *name;
struct uidl_entry **root;
{
FILE * F;
--- 138,146 ----
print_uidls(F,root->bigger);
}

! static void update_uidls P_((const char *name, struct uidl_entry **root));
static void update_uidls(name, root)
! const char *name;
struct uidl_entry **root;
{
FILE * F;
***************
*** 426,431 ****
--- 426,434 ----
lib_error(CATGETS(elm_msg_cat, MeSet,MeUnexpextedResponse,
"Unexpected response from POP server"));
close_it = 1;
+ break;


+ default:
+ break;
}
}

***************

*** 830,836 ****


if (errno != ENOENT) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantUnlinkTemp,
"Sorry, can't unlink the temp file %s [%s]!\n\r"),
! folder -> cur_tempfolder, error_description(errno));
}
} else {
DPRINT(Debug,1,(&Debug,

--- 833,839 ----


if (errno != ENOENT) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantUnlinkTemp,
"Sorry, can't unlink the temp file %s [%s]!\n\r"),
! folder -> cur_tempfolder, strerror(errno));
}
} else {
DPRINT(Debug,1,(&Debug,
***************

*** 842,850 ****
return;
}

! static int mbx_lock_pop P_((int direction,struct folder_info *folder));
static int mbx_lock_pop(direction,folder)


! int direction;
struct folder_info *folder;
{

int status=1;
--- 845,853 ----
return;
}

! static int mbx_lock_pop P_((enum lock_direction direction,struct folder_info *folder));
static int mbx_lock_pop(direction,folder)


! enum lock_direction direction;
struct folder_info *folder;
{

int status=1;
***************
*** 1124,1129 ****
--- 1127,1134 ----
goto retry_prelogin_capa;
case capa_logged:
goto is_already_logged;
+ default:
+ break;
}

#endif
***************
*** 1200,1205 ****
--- 1205,1213 ----


return status;
}

+ static int mbx_sessionlock_pop P_((struct folder_info *folder,
+ enum sessionlock_mode mode));
+
static int mbx_sessionlock_pop(folder,mode)
struct folder_info *folder;
enum sessionlock_mode mode;
***************

*** 1252,1258 ****


lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmSorryCantTruncateTemp,
"Sorry, can't truncate the temp file %s [%s]!"),
! folder -> cur_tempfolder, error_description(errno));
/* IF FAIL REOPEN IT INSTEAD */
}
#endif

--- 1260,1266 ----


lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmSorryCantTruncateTemp,
"Sorry, can't truncate the temp file %s [%s]!"),
! folder -> cur_tempfolder, strerror(errno));
/* IF FAIL REOPEN IT INSTEAD */
}
#endif
***************

*** 1267,1273 ****


int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantTruncateTemp,
"Sorry, can't truncate the temp file %s [%s]!"),
! folder -> cur_tempfolder, error_description(err));
status = 0;
goto clean;
}

--- 1275,1281 ----


int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantTruncateTemp,
"Sorry, can't truncate the temp file %s [%s]!"),
! folder -> cur_tempfolder, strerror(err));
status = 0;
goto clean;
}
***************

*** 1286,1292 ****



lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantReopenTemp,
"Sorry, can't reopen the temp file %s [%s]!"),
! folder -> cur_tempfolder, error_description(err));

if (-1 != temp_handle)
close(temp_handle);

--- 1294,1300 ----



lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSorryCantReopenTemp,
"Sorry, can't reopen the temp file %s [%s]!"),
! folder -> cur_tempfolder, strerror(err));

if (-1 != temp_handle)
close(temp_handle);
***************

*** 1332,1338 ****


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedCreateTmpFolder,
"Failed to create %.50s: %.60s"),
folder -> cur_tempfolder,
! error_description(err));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIGiveUp,
"Ahhhh... I give up."));

--- 1340,1346 ----


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedCreateTmpFolder,
"Failed to create %.50s: %.60s"),
folder -> cur_tempfolder,
! strerror(err));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIGiveUp,
"Ahhhh... I give up."));

***************

*** 1352,1357 ****
--- 1360,1367 ----


/* shut off file for other people! */
}
break;
+ default:
+ break;
}
status = 1;

***************

*** 1435,1444 ****



lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldntSeekTempEnd,
"\nCouldn't fseek to end of temp mbox.\n"));
! lib_error(FRM("** %s. **\n"), error_description(err));
DPRINT(Debug,1,(&Debug,
"Error: Couldn't fseek to end of reopened temp mbox. errno %s (%s)\n",

! error_description(err), "mbx_prepare_read_spool"));


status = 0;
goto clean;
}

--- 1445,1454 ----



lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldntSeekTempEnd,
"\nCouldn't fseek to end of temp mbox.\n"));
! lib_error(FRM("** %s. **\n"), strerror(err));
DPRINT(Debug,1,(&Debug,
"Error: Couldn't fseek to end of reopened temp mbox. errno %s (%s)\n",

! strerror(err), "mbx_prepare_read_spool"));


status = 0;
goto clean;
}
***************

*** 1495,1504 ****


status = 0;
goto clean;
}

! if (pop_command_ok(folder)) {
! char * fname;

char * buffer = NULL;

int buffer_len = 0;

/* If command is unimplemeted that is OK ... */

--- 1505,1514 ----


status = 0;
goto clean;
}

! if (pop_command_ok(folder)) {

char * buffer = NULL;

int buffer_len = 0;
+ char * str;

/* If command is unimplemeted that is OK ... */

***************
*** 1556,1564 ****
buffer = NULL;
}

! fname = elm_message(FRM("%s/.%s"),folders,folder->cur_folder_sys);
! update_uidls(fname,&(folder -> p->a.pop_mbx.uidl_root));
! free(fname);
}


--- 1566,1580 ----
buffer = NULL;


}

!
! /* give_dt_estr_as_str adds / to end */

! str = give_dt_estr_as_str(&folders_e,"maildir");
!

! if (str) {
! char * fname = elm_message(FRM("%s.%s"),str,folder->cur_folder_sys);
! update_uidls(fname,&(folder -> p->a.pop_mbx.uidl_root));
! free(fname);
! }
}


***************

*** 1694,1700 ****


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFlushOnTempFailed,
"Flush on temp file %s failed: %s"),
folder -> cur_tempfolder,
! error_description(err));
}
DPRINT(Debug,1,(&Debug,
"Can't flush on temp file %s!!\n",

--- 1710,1716 ----


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFlushOnTempFailed,
"Flush on temp file %s failed: %s"),
folder -> cur_tempfolder,
! strerror(err));
}
DPRINT(Debug,1,(&Debug,
"Can't flush on temp file %s!!\n",

***************
*** 1942,1950 ****
return status;
}

! static CONST char * mbx_is_forwarded_pop P_((struct folder_info *folder,
READ_STATE read_state_ptr));
! static CONST char * mbx_is_forwarded_pop(folder,read_state_ptr)


struct folder_info *folder;
READ_STATE read_state_ptr;
{

--- 1958,1966 ----
return status;
}

! static const char * mbx_is_forwarded_pop P_((struct folder_info *folder,
READ_STATE read_state_ptr));
! static const char * mbx_is_forwarded_pop(folder,read_state_ptr)


struct folder_info *folder;
READ_STATE read_state_ptr;
{
***************

*** 2277,2287 ****


ElmCouldntSeekBytesIntoFolder,
"\nCouldn't seek %ld bytes into folder.\n"),
offset);
! lib_error(FRM("** %s. **\n"), error_description(err));
DPRINT(Debug,1,(&Debug,
"Error: Couldn't seek folder %s: (offset %ld) Errno %s (%s)\n",
folder->cur_tempfolder, offset,

! error_description(err), "mbx_pop_to_fd"));


status = NULL;
goto clean;
}

--- 2293,2303 ----


ElmCouldntSeekBytesIntoFolder,
"\nCouldn't seek %ld bytes into folder.\n"),
offset);
! lib_error(FRM("** %s. **\n"), strerror(err));
DPRINT(Debug,1,(&Debug,
"Error: Couldn't seek folder %s: (offset %ld) Errno %s (%s)\n",
folder->cur_tempfolder, offset,

! strerror(err), "mbx_pop_to_fd"));


status = NULL;
goto clean;
}
***************

*** 2372,2378 ****
struct folder_info *folder;
KEEP_STATE keep_state_ptr;
{
! char *fname;
int status = 0;

DPRINT(Debug,11,(&Debug,

--- 2388,2394 ----


struct folder_info *folder;
KEEP_STATE keep_state_ptr;
{
! char *str;
int status = 0;

DPRINT(Debug,11,(&Debug,
***************
*** 2397,2405 ****
FreeStreamStack( &(folder -> p->a.pop_mbx.C.stream));
}

! fname = elm_message(FRM("%s/.%s"),folders,folder->cur_folder_sys);
! update_uidls(fname,&(folder -> p->a.pop_mbx.uidl_root));
! free(fname);

clean:
DPRINT(Debug,11,(&Debug,

--- 2413,2425 ----


FreeStreamStack( &(folder -> p->a.pop_mbx.C.stream));
}

! /* give_dt_estr_as_str adds / to end */

! str = give_dt_estr_as_str(&folders_e,"maildir");
! if (str) {
! char * fname = elm_message(FRM("%s.%s"),str,folder->cur_folder_sys);
! update_uidls(fname,&(folder -> p->a.pop_mbx.uidl_root));
! free(fname);
! }

clean:
DPRINT(Debug,11,(&Debug,

***************
*** 2452,2459 ****
}
}

! CONST char * mbx_pop_type P_((struct folder_info *folder));
! CONST char * mbx_pop_type(folder)
struct folder_info *folder;
{
static char *mailbox = NULL;
--- 2472,2479 ----
}
}

! const char * mbx_pop_type P_((struct folder_info *folder));
! const char * mbx_pop_type(folder)
struct folder_info *folder;
{
static char *mailbox = NULL;
***************
*** 2470,2479 ****
}

static int mbx_start_edit_pop P_((struct folder_info *folder,
! CONST char **buffer));
static int mbx_start_edit_pop(folder,buffer)


struct folder_info *folder;
! CONST char **buffer;
{
DPRINT(Debug,11,(&Debug,

"mbx_start_edit_pop=0 (dummy): folder=%p (%s)\n",
--- 2490,2499 ----
}

static int mbx_start_edit_pop P_((struct folder_info *folder,
! const char **buffer));
static int mbx_start_edit_pop(folder,buffer)


struct folder_info *folder;
! const char **buffer;
{
DPRINT(Debug,11,(&Debug,

"mbx_start_edit_pop=0 (dummy): folder=%p (%s)\n",
Index: elmME+.2.5.alpha5-cvs/lib/posixsig.c
*** elmME+.2.5.alpha4/lib/posixsig.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/posixsig.c 2005-07-23 22:01:35.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: posixsig.c,v 1.10.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: posixsig.c,v 1.10.8.2 2005/07/23 19:01:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 118,124 ****
if (err) {
DPRINT(Debug,10,(&Debug,
" *** errno=%d (%s)\n",err,
! error_description(err)));
}
errno = err;
return ret;
--- 118,124 ----
if (err) {
DPRINT(Debug,10,(&Debug,
" *** errno=%d (%s)\n",err,
! strerror(err)));
}
errno = err;
return ret;
***************
*** 160,166 ****
if (err) {
DPRINT(Debug,10,(&Debug,
" *** errno=%d (%s)\n",err,
! error_description(err)));
}
errno = err;

--- 160,166 ----
if (err) {
DPRINT(Debug,10,(&Debug,
" *** errno=%d (%s)\n",err,
! strerror(err)));
}
errno = err;

Index: elmME+.2.5.alpha5-cvs/lib/precompiled_sets.c
*** elmME+.2.5.alpha4/lib/precompiled_sets.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/precompiled_sets.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: precompiled_sets.c,v 1.23.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: precompiled_sets.c,v 1.23.8.3 2005/07/26 08:28:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 19,59 ****

--- 19,88 ----

*** 78,97 ****



/* Multibyte character set so cs_ascii does not work .... */
{ &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 27, "ISO-10646-UTF-1" },
! { &cs_iso646, NULL, SET_valid, NULL, NULL, NULL,
28, "ISO_646.basic:1983" },
! { &cs_iso646, NULL, SET_valid, "IRV", NULL, NULL, 30, "ISO_646.irv:1983" },
! { &cs_iso646, NULL, SET_valid, "ISO646-GB", NULL, NULL,
20, "BS_4730" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 31, "NATS-SEFI" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 32, "NATS-SEFI-ADD" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 33, "NATS-DANO" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 34, "NATS-DANO-ADD" },
! { &cs_iso646, NULL, SET_valid, "ISO646-FI", NULL, NULL,
35, "SEN_850200_B" },
! { &cs_iso646, NULL, SET_valid, "ISO646-SE2", NULL, NULL,
21, "SEN_850200_C" },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 36, "KS_C_5601-1987" },
{ &cs_iso2022, &map_ISO2022_ascii, SET_valid, "ISO-2022-KR", NULL,
&set_ISO2022KR, 37, NULL }, /* RFC 1557 */
{ &cs_euc, &map_EUC_ascii, SET_valid, "EUC-KR", NULL,

--- 107,143 ----

*** 104,176 ****

--- 150,346 ----

! { &cs_unknown, NULL, SET_valid, NULL, NULL, &set_iso_ir_96, 72, "JIS_C6229-1984-kana" },
!

*** 233,243 ****


{ &cs_ascii, NULL, SET_valid, "windows-1250", ASCII, NULL, 2250, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1253", ASCII, NULL, 2253, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1254", ASCII ,NULL, 2254, NULL },
! { &cs_ascii, NULL, SET_valid, "windows-1255", ASCII ,NULL, 2255, NULL },
! { &cs_ascii, NULL, SET_valid, "windows-1256", ASCII ,NULL, 2256, NULL },
! { &cs_ascii, NULL, SET_valid, "windows-1257", ASCII ,NULL, 2257, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1258", ASCII ,NULL, 2258, NULL },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 2085, "HZ-GB-2312" },

/* How this compares to windows-1252 ... ?? */
{ &cs_ascii, NULL, SET_valid, NULL, LATIN1, NULL, 2000, "ISO-8859-1-Windows-3.0-Latin-1" },

--- 403,413 ----


{ &cs_ascii, NULL, SET_valid, "windows-1250", ASCII, NULL, 2250, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1253", ASCII, NULL, 2253, NULL },
{ &cs_ascii, NULL, SET_valid, "windows-1254", ASCII ,NULL, 2254, NULL },
! { &cs_ascii, NULL, SET_valid, "windows-1255", ASCII ,NULL, 2255, "CP1255" },
! { &cs_ascii, NULL, SET_valid, "windows-1256", ASCII ,NULL, 2256, "CP1256" },
! { &cs_ascii, NULL, SET_valid, "windows-1257", ASCII ,NULL, 2257, "CP1257" },
{ &cs_ascii, NULL, SET_valid, "windows-1258", ASCII ,NULL, 2258, NULL },
! { &cs_unknown, NULL, SET_valid, NULL, NULL, NULL, 2085, "HZ-GB-2312" },

/* How this compares to windows-1252 ... ?? */
{ &cs_ascii, NULL, SET_valid, NULL, LATIN1, NULL, 2000, "ISO-8859-1-Windows-3.0-Latin-1" },

***************
*** 314,321 ****

};

! CONST charset_t ASCII_SET = ASCII;
! CONST charset_t INVARIANT_SET = INVARIANT;
charset_t display_charset = ASCII; /* current charset used by terminal */
charset_t system_charset = ASCII; /* the charset, the locale supports */

--- 484,491 ----

};

! const charset_t ASCII_SET = ASCII;
! const charset_t INVARIANT_SET = INVARIANT;
charset_t display_charset = ASCII; /* current charset used by terminal */
charset_t system_charset = ASCII; /* the charset, the locale supports */

***************
*** 324,335 ****
static struct charcode_info raw_buffer = {
&cs_ascii, &map_ascii, SET_valid, "*RAW*", ASCII, &(sets_iso_8859_X[0]), 0, NULL
};
! CONST charset_t RAW_BUFFER = &raw_buffer;

#define ARRSIZE(SET) sizeof SET / sizeof (struct charcode_info)


! CONST int precompiled_size = ARRSIZE(precompiled_sets);

/*
* Local Variables:
--- 494,505 ----
static struct charcode_info raw_buffer = {
&cs_ascii, &map_ascii, SET_valid, "*RAW*", ASCII, &(sets_iso_8859_X[0]), 0, NULL
};
! const charset_t RAW_BUFFER = &raw_buffer;

#define ARRSIZE(SET) sizeof SET / sizeof (struct charcode_info)


! const int precompiled_size = ARRSIZE(precompiled_sets);

/*
* Local Variables:
Index: elmME+.2.5.alpha5-cvs/lib/qstrings.c
*** elmME+.2.5.alpha4/lib/qstrings.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/qstrings.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: qstrings.c,v 1.6.8.1 2004/04/18 16:55:40 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: qstrings.c,v 1.6.8.3 2005/07/26 08:28:39 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 20,42 ****
#include "elm_defs.h"

char *qstrpbrk(source, keys)
! char *source, *keys;
{
/** Returns a pointer to the first character of source that is any
of the specified keys, or NULL if none of the keys are present
in the source string.
**/

! register char *s, *k;
! register int len;

s = source;


while (*s != '\0') {

len = len_next_part(s);
if (len == 1) {
! for (k = keys; *k; k++)
! if (*k == *s)
! return(s);
}
s += len;
}
--- 20,44 ----
#include "elm_defs.h"

char *qstrpbrk(source, keys)
! char *source;
! const char *keys;
{
/** Returns a pointer to the first character of source that is any
of the specified keys, or NULL if none of the keys are present
in the source string.
**/

! char *s;
! const char *k;
! int len;

s = source;


while (*s != '\0') {

len = len_next_part(s);
if (len == 1) {
! for (k = keys; *k; k++)
! if (*k == *s)
! return(s);
}
s += len;
}
Index: elmME+.2.5.alpha5-cvs/lib/rc_delay.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/lib/rc_delay.c 2005-07-20 19:49:42.000000000 +0300
***************
*** 0 ****
--- 1,462 ----
+ static char rcsid[] = "@(#)$Id: rc_delay.c,v 1.4.2.1 2005/07/20 16:49:42 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.4.2.1 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>

+ * or Kari Hurtta <e...@elmme-mailer.org>

+ *****************************************************************************/
+
+ #include "elm_defs.h"

+ #include "rc_imp.h"
+ #include "save_opts.h"
+
+ DEBUG_VAR(Debug,__FILE__,"config");
+
+ enum xx { line_normal, line_negate, line_continue };
+
+ struct rec1 {
+ int lcl;
+ char *value;
+ int lineno;
+ char *filename;
+ enum xx negate_continue;

+ };
+

+ static void replay_rec P_((struct rec1 *rec,
+ struct rc_save_info_rec * real));
+ static void replay_rec(rec,real)
+ struct rec1 *rec;
+ struct rc_save_info_rec * real;
+ {
+ switch (rec->negate_continue) {
+
+ case line_normal:
+ rc_eval_tail(real,rec->lcl,rec->value,rec->lineno,rec->filename,0);
+ break;
+
+ case line_negate:
+ rc_eval_tail(real,rec->lcl,rec->value,rec->lineno,rec->filename,1);
+ break;
+
+ case line_continue:
+
+ if (RCTYPE_magic != real->dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"replay_rec",

+ "Bad config item type",0);
+

+ real->dt_type->parse_cline(real,rec->lcl,rec->value,rec->lineno,
+ rec->filename);

+ break;
+ }
+ }
+

+ static struct rc_save {
+ struct rc_save_info_rec * real;
+ struct rc_save_info_rec * delayed;
+
+ struct rec1 * lines;
+ int line_count;
+
+ struct rc_save * next;
+ } * root = NULL;
+
+ void mark_delayed_changed(A)

+ void *A;
+ {
+ struct rc_save *x;
+

+ for (x = root; x; x = x->next) {
+ if (x->real && x->real->val.dummy == A) {
+
+ DPRINT(Debug,10,(&Debug,
+ "mark_delayed_changed: %p: %p\n",
+ x,A));
+
+ mark_XX(x->real);
+
+ if (x->delayed)
+ mark_XX(x->delayed);
+ else {
+ DPRINT(Debug,10,(&Debug,
+ "mark_delayed_changed: %p: %p -- no delayed registered\n",
+ x,A));

+
+ }
+
+ }
+ }
+
+ }
+

+ void mark_fdelayed_changed(A)
+ option_func *A;
+ {
+ struct rc_save *x;
+

+ for (x = root; x; x = x->next) {
+ if (x->real && x->real->func_val == A) {
+
+ DPRINT(Debug,10,(&Debug,
+ "mark_fdelayed_changed: %p: %p\n",
+ x,A));
+
+ mark_XX(x->real);
+
+ if (x->delayed)
+ mark_XX(x->delayed);
+ else {
+ DPRINT(Debug,10,(&Debug,
+ "mark_fdelayed_changed: %p: %p -- no delayed registered\n",
+ x,A));

+ }
+ }
+ }
+
+ }
+

+
+

+ static struct rc_save * new_record P_((void));
+ static struct rc_save * new_record()
+ {
+ struct rc_save * x = safe_malloc(sizeof (*x));
+
+ bzero((void *)x,sizeof (*x));
+
+ x->real = NULL;
+ x->delayed = NULL;
+
+ x->next = root;
+ root = x;
+
+ return x;

+ }
+

+ static void replay_saved P_((struct rc_save *p));
+ static void replay_saved(p)
+ struct rc_save *p;
+ {

+ int i;
+

+ for (i = 0; i < p->line_count; i++) {
+ replay_rec(& (p->lines[i]), p->real);

+ }
+

+ for (i = 0; i < p->line_count; i++) {
+ if (p->lines[i].value)
+ free(p->lines[i].value);

+ p->lines[i].value = NULL;
+

+ if (p->lines[i].filename)
+ free(p->lines[i].filename);

+ p->lines[i].filename = NULL;
+ }
+

+ if (p->lines)
+ free(p->lines);
+ p->lines = NULL;

+ p->line_count = 0;
+ }
+

+ static void add_delayed P_((struct rc_save *p));
+ static void add_delayed(p)
+ struct rc_save *p;
+ {

+ int x;
+

+ for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
+ if (0 == strcmp(save_info[x].name,p->real->name)) {
+
+ if (save_info[x].dt_type != &rc_DT_DELAY)
+ panic("RC PANIC",__FILE__,__LINE__,"add_delayed",
+ "Option is not delayed",0);
+
+ p->delayed = & (save_info[x]);
+ return;

+ }
+
+ }
+

+ panic("RC PANIC",__FILE__,__LINE__,"add_delayed",
+ "Deleayed option not found",0);

+ }
+

+ static void register_delayed1 P_((struct rc_save_info_rec *option_real));
+ static void register_delayed1(option_real)

+ struct rc_save_info_rec *option_real;
+ {
+ struct rc_save *p;
+

+ for (p = root; p; p = p->next) {
+ if (option_real == p->real)
+ panic("RC PANIC",__FILE__,__LINE__,"register_delayed1",
+ "Duplicate registeration",0);
+ if (p->delayed &&
+ 0 == strcmp(option_real->name,p->delayed->name)) {
+
+ if (p->real)
+ panic("RC PANIC",__FILE__,__LINE__,"register_delayed1",
+ "Duplicate name",0);
+ p->real = option_real;
+
+ replay_saved(p);

+
+ return;
+ }
+ }

+ p = new_record();
+ p->real = option_real;
+
+ add_delayed(p);

+ }
+
+

+ void register_delayed(rc_options,rc_option_count)
+ struct rc_save_info_rec * rc_options;
+ int rc_option_count;
+ {

+ int i;
+

+ for (i = 0; i < rc_option_count; i++) {

+ register_delayed1(& (rc_options[i]) );
+ }
+ }
+

+ static struct rc_save * register_delayed2 P_((struct rc_save_info_rec *option_proxy));
+ static struct rc_save * register_delayed2(option_proxy)
+ struct rc_save_info_rec *option_proxy;
+ {

+ struct rc_save *p;
+

+ ret = 1;
+
+ }


+ return ret;
+ }
+

+ #ifdef ANSI_C
+ static rc_parse_cline dt_DELAY_parse_cline;
+ #endif
+ static int dt_DELAY_parse_cline(r,lcl,value,lineno,filename)
+ struct rc_save_info_rec *r;
+ int lcl;
+ char *value;
+ int lineno;
+ char *filename;
+ {
+ int ret = 1;
+ struct rc_save *p = register_delayed2(r);
+
+ if (p->real && p->line_count)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_parse_cline",
+ "Bad state",0);
+
+ if (p->real) {
+
+ if (RCTYPE_magic != p->real->dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_parse_cline",

+ "Bad config item type",0);
+
+

+ ret = p->real->dt_type->parse_cline(p->real,lcl,value,lineno,
+ filename);
+
+ } else {
+
+ if (!p->line_count)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_parse_cline",
+ "Bad state",0);
+
+
+ p->lines = safe_realloc(p->lines,
+ (p->line_count + 1) * sizeof (p->lines[0]));
+
+ bzero((void *)& (p->lines[p->line_count]),
+ sizeof (p->lines[p->line_count]) );
+
+ p->lines[p->line_count].lcl = lcl;
+ p->lines[p->line_count].value = safe_strdup(value);
+ p->lines[p->line_count].lineno = lineno;
+ p->lines[p->line_count].filename = safe_strdup(filename);
+ p->lines[p->line_count].negate_continue = line_continue;
+
+ p->line_count++;

+ ret = 1;
+
+ }
+ return ret;
+
+ }
+
+ #if ANSI_C


+ static rc_print_value dt_DELAY_print_value;
+ #endif
+ static void dt_DELAY_print_value(F,r,comment)
+ FILE *F;
+ struct rc_save_info_rec *r;
+ int comment;
+ {
+ struct rc_save *p = register_delayed2(r);
+
+ if (p->real && p->line_count)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_print_value",
+ "Bad state",0);
+
+ if (p->real) {
+
+ if (RCTYPE_magic != p->real->dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_print_value",

+ "Bad config item type",0);
+
+

+ p->real->dt_type->print_value(F,p->real,comment);
+
+ } else if (p->line_count) {

+ int i,start = 0;
+

+ for (i = 0; i < p->line_count; i++) {
+ if (line_normal == p->lines[i].negate_continue)
+ start = i;

+ }
+

+ for (i = start; i < p->line_count; i++) {
+
+ if (comment)
+ fprintf(F, "### ");
+
+ switch (p->lines[i].negate_continue) {
+ case line_normal:
+ fprintf(F, "%s = %s\n", r->name, p->lines[i].value);
+
+ break;
+
+ case line_continue:
+ if (0 == i)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_print_value",
+ "Bad state",0);
+
+ fprintf(F, "\t%s\n", p->lines[i].value);
+
+ break;
+
+ case line_negate:
+ /* unsupported */
+ fprintf(F, "# !%s = %s\n", r->name, p->lines[i].value);

+ break;
+ }
+ }
+
+ }

+ }
+
+ #if ANSI_C


+ static rc_get_value dt_DELAY_get_value;
+ #endif
+ static char * dt_DELAY_get_value(r)
+ struct rc_save_info_rec *r;
+ {
+ struct rc_save *p = register_delayed2(r);
+
+ if (p->real && p->line_count)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_get_value",
+ "Bad state",0);
+
+ if (p->real) {
+
+ if (RCTYPE_magic != p->real->dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"dt_DELAY_get_value",

+ "Bad config item type",0);
+

+ return p->real->dt_type->get_value(p->real);
+ } else if (p->line_count) {
+

+ int i,start = 0;
+

+ for (i = 0; i < p->line_count; i++) {
+ if (line_normal == p->lines[i].negate_continue)
+ start = i;
+ }
+
+ if (start == p->line_count-1 &&
+ line_normal == p->lines[start].negate_continue)
+ return p->lines[start].value;
+ }
+
+
+ return "*bad*";
+ }

+
+
+

+ struct rc_type rc_DT_DELAY = { RCTYPE_magic,
+ dt_DELAY_parse_line, dt_DELAY_parse_cline,
+ dt_DELAY_print_value, dt_DELAY_get_value };

+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/lib/rc_handle.c
*** elmME+.2.5.alpha4/lib/rc_handle.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/lib/rc_handle.c 2005-07-26 11:28:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17.8.9 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.17.8.12 2005/07/26 08:28:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

****************************************************************************
***************
*** 26,38 ****
#ifdef ANSI_C
static rc_parse_line dt_SYN_parse_line;
#endif

! static int dt_SYN_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

! int e_val;
{
if (negate) {
char buffer[SLEN];
--- 26,38 ----
#ifdef ANSI_C
static rc_parse_line dt_SYN_parse_line;
#endif

! static int dt_SYN_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

! int negate;
{
if (negate) {
char buffer[SLEN];
***************
*** 93,105 ****
#ifdef ANSI_C
static rc_parse_line dt_STR_parse_line;
#endif

! static int dt_STR_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 93,104 ----
#ifdef ANSI_C
static rc_parse_line dt_STR_parse_line;
#endif

! static int dt_STR_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 178,190 ****
#ifdef ANSI_C
static rc_parse_line dt_NUM_parse_line;
#endif

! static int dt_NUM_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
char *p;
--- 177,188 ----
#ifdef ANSI_C
static rc_parse_line dt_NUM_parse_line;
#endif

! static int dt_NUM_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

! r->name,s ));
!
! } else {

! static int dt_BOL_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 244,255 ----
#ifdef ANSI_C
static rc_parse_line dt_BOL_parse_line;
#endif

! static int dt_BOL_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 330,342 ****
#ifdef ANSI_C
static rc_parse_line dt_CHR_parse_line;
#endif

! static int dt_CHR_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 307,318 ----
#ifdef ANSI_C
static rc_parse_line dt_CHR_parse_line;
#endif

! static int dt_CHR_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

! static int dt_SRT_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
char buffer[SLEN];
--- 362,376 ----
dt_CHR_parse_line, BAD_parse_cline,
dt_CHR_print_value, dt_CHR_get_value };

#ifdef ANSI_C
! static rc_parse_line dt_SORT_parse_line;
#endif

! static int dt_SORT_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
char buffer[SLEN];
***************
*** 434,445 ****

! #if ANSI_C

+ }
+
+ #if ANSI_C
+ static rc_get_value dt_SORT_get_value;
+ #endif
+ static char * dt_SORT_get_value(r)


+ struct rc_save_info_rec *r;
+ {

+ return give_sort_value(r->val.sort);
+ }
+
+ const char * give_dt_sort_as_str(ptr)
+ struct dt_sort_info *ptr;
+ {
+ return give_sort_value(ptr);
+ }
+
+ int give_dt_sort_as_int(ptr)
+ struct dt_sort_info *ptr;


+ {
+ return ptr->val;
+ }
+

+ void set_dt_sort_as_int(ptr,val)
+ struct dt_sort_info *ptr;
+ int val;
+ {
+ ptr->val = val;


}

#if ANSI_C
! static rc_print_value dt_SORT_print_value;

#endif
! static void dt_SORT_print_value(F,r,comment)
FILE *F;
struct rc_save_info_rec *r;
int comment;
***************
*** 486,508 ****
fprintf(F, "### ");

fprintf(F, "%s = %s\n", r->name,
! dt_SRT_get_value(r));
}

! struct rc_type rc_DT_SRT = { RCTYPE_magic,
! dt_SRT_parse_line, BAD_parse_cline,
! dt_SRT_print_value, dt_SRT_get_value };

#ifdef ANSI_C
static rc_parse_line dt_MLT_parse_line;
#endif

! static int dt_MLT_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
int ok = 1;
--- 470,491 ----
fprintf(F, "### ");

fprintf(F, "%s = %s\n", r->name,
! dt_SORT_get_value(r));
}

! struct rc_type rc_DT_SORT = { RCTYPE_magic,
! dt_SORT_parse_line, BAD_parse_cline,
! dt_SORT_print_value, dt_SORT_get_value };

#ifdef ANSI_C
static rc_parse_line dt_MLT_parse_line;
#endif

! static int dt_MLT_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
int ok = 1;
***************
*** 527,640 ****
dt_MLT_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };

- static struct {
- char *kw;
- int sv;
- } ASR_srtval[]={
- {"alias", ALIAS_SORT},
- {"name", NAME_SORT},
- {"text", TEXT_SORT},
- {NULL, 0}
- };
-
- #ifdef ANSI_C
- static rc_parse_line dt_ASR_parse_line;
- #endif
- static int dt_ASR_parse_line(r,lcl,value,lineno,filename, e_val, negate)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;

- char *filename;
- int e_val;


- int negate;
- {
- char buffer[SLEN];
- char *s = buffer;
- int f, y;
-
- f = 1;
- strfcpy(buffer, shift_lower(value), sizeof buffer);
-
- if (strncmp(s, "rev-", 4) == 0 ||
- strncmp(s, "reverse-", 8) == 0) {
- f = -f;

- s = index(s, '-') + 1;
- }
-

- if (negate)
- f = -f;
-
- for (y= 0; ASR_srtval[y].kw; y++) {
- if (equal(s, ASR_srtval[y].kw))
- break;
- }
- if (ASR_srtval[y].kw) {
- *(r->val.sort) = f > 0 ? ASR_srtval[y].sv : -ASR_srtval[y].sv;
- } else {
- lib_error(CATGETS(elm_msg_cat, ElmSet,
- ElmBadAliasSortInElmrc,

- "I can't understand alias sort key \"%s\" in line %d in \"%s\" file"),
- value, lineno,filename);


- return 0;
- }
-

! static int dt_PRM_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
char *s = value;
--- 510,524 ----
dt_MLT_parse_line, BAD_parse_cline,
NO_print_value, NO_get_value };

#ifdef ANSI_C
static rc_parse_line dt_PRM_parse_line;
#endif

! static int dt_PRM_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
char *s = value;
***************
*** 707,719 ****
#ifdef ANSI_C
static rc_parse_line dt_FUNC_parse_line;
#endif

! static int dt_FUNC_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 591,602 ----
#ifdef ANSI_C
static rc_parse_line dt_FUNC_parse_line;
#endif

! static int dt_FUNC_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 773,785 ****
#ifdef ANSI_C
static rc_parse_line dt_LONG_parse_line;
#endif

! static int dt_LONG_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
char *p;
--- 656,667 ----
#ifdef ANSI_C
static rc_parse_line dt_LONG_parse_line;
#endif

! static int dt_LONG_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
char *p;
***************

*** 832,903 ****


dt_LONG_parse_line, BAD_parse_cline,
dt_LONG_print_value, dt_LONG_get_value };

- #ifdef USE_PGP
-
- #ifdef ANSI_C
- static rc_parse_line dt_PGPVER_parse_line;
- #endif
- static int dt_PGPVER_parse_line(r,lcl,value,lineno,filename, e_val, negate)
- struct rc_save_info_rec *r;
- int lcl;
- char *value;
- int lineno;

- char *filename;
- int e_val;


- int negate;
- {
- if (negate) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadNegate,

- "!%s is not supported in line %d in \"%s\" file"),
- r->name,lineno,filename);


- return 0;
- }
-

1 == succeed


--- 714,719 ----
***************
*** 929,934 ****

--- 745,762 ----


if (!recursive) {
DPRINT(Debug,8,(&Debug, "expand_dt_path: %s: %s\n",
fieldname,val));

+

+ if (0 == strcmp(val,"none") && 0 == ptr->nlen) {
+
+ /* Set dummy value indicating none ... */
+ ptr->list = safe_realloc(ptr->list,sizeof (ptr->list[0]));
+ ptr->list[0] = NULL;

+ ptr->nlen = 0;
+

+ return ret;
+ }
+
+
} else {
DPRINT(Debug,11,(&Debug, "expand_dt_path: %s: %s (recursive=%d)\n",
fieldname,val,recursive));
***************

*** 972,981 ****
}

/* Empty values not allowed */
! if (is_sep_comma && ',' == *p ||
! is_sep_colon && ':' == *p ||
! is_sep_space && ' ' == *p ||
! is_sep_space && '\t' == *p)
continue;

start_val = p;
--- 800,809 ----
}

/* Empty values not allowed */
! if ( (is_sep_comma && ',' == *p) ||
! (is_sep_colon && ':' == *p) ||
! (is_sep_space && ' ' == *p) ||
! (is_sep_space && '\t' == *p) )
continue;

start_val = p;
***************
*** 1020,1029 ****

} else {

! if (is_sep_comma && ',' == *p ||
! is_sep_colon && ':' == *p ||
! is_sep_space && ' ' == *p ||
! is_sep_space && '\t' == *p ||
'\0' == *p ) {

int Len = p - start_val;
--- 848,857 ----

} else {

! if ( (is_sep_comma && ',' == *p) ||
! (is_sep_colon && ':' == *p) ||
! (is_sep_space && ' ' == *p) ||
! (is_sep_space && '\t' == *p) ||
'\0' == *p ) {

int Len = p - start_val;
***************
*** 1105,1119 ****
*/
if ('=' == value[0]) {

! char * t = safe_strdup(folders);
! int l = strlen(t);
!
! if (l > 0 && t[l-1] != '/' && value[1] != '/')
! t = strmcat(t,"/");

! t = strmcat(t,value+1);
! free(value);
! value = t;
}
}

--- 933,952 ----
*/
if ('=' == value[0]) {

! char * t = give_dt_estr_as_str(&folders_e,"maildir");
!
! if (t) {
! int l = strlen(t);
!
! if (l > 0 && t[l-1] != '/' && value[1] != '/')
! t = strmcat(t,"/");

! t = strmcat(t,value+1);
! free(value);
! value = t;
! } else {


! ret = 0;
! }
}
}

***************
*** 1299,1304 ****
--- 1132,1147 ----


if (!ptr->list)
return NULL;

+ if (ptr->list && 0 == ptr->nlen) {
+ res = safe_strdup("none");
+
+ DPRINT(Debug,9,(&Debug,
+ "give_dt_path_as_str=%s\n",res));
+
+ return res;

+ }
+
+

for (i = 0; i < ptr->nlen; i++)
L += strlen(ptr->list[i]) +1;

***************

*** 1347,1359 ****


static rc_parse_line dt_PATH_parse_line;
#endif

! static int dt_PATH_parse_line(r,lcl,value,lineno,filename,e_val,negate)

struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 1190,1201 ----


static rc_parse_line dt_PATH_parse_line;
#endif

! static int dt_PATH_parse_line(r,lcl,value,lineno,filename,negate)

struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************
*** 1444,1449 ****
--- 1286,1295 ----



fprintf(F, "%s = ",r->name);

+ if (r->val.path->list && 0 == r->val.path->nlen) {
+ fprintf(F, "none");

+ }
+

for (i = 0; i < r->val.path->nlen; i++) {
/* NOTE: space is always valid separator even when
PATH_sep_comma or PATH_sep_colon is set */
***************

*** 1469,1474 ****
--- 1315,1321 ----


fputs(r->val.path->list[i],F);

len += strlen(r->val.path->list[i]) + 1;
}
+
fprintf(F, "\n");
}
}
***************
*** 1481,1493 ****


#ifdef ANSI_C
static rc_parse_line dt_OBS_parse_line;
#endif

! static int dt_OBS_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
/* This message is not perhaps very visible, because

--- 1328,1339 ----


#ifdef ANSI_C
static rc_parse_line dt_OBS_parse_line;
#endif

! static int dt_OBS_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
/* This message is not perhaps very visible, because
***************

*** 1534,1539 ****
--- 1380,1405 ----


return 0;
}

+ /* Fix shell if needed */
+ if (ptr->flags & ESTR_bin) {
+ if (buffer[0] != '/') {
+ char * A = elm_message(FRM("/bin/%s"), buffer);
+
+ if (ptr->expanded)
+ free(ptr->expanded);
+ ptr->expanded = A;
+ return 1;

+ }
+ }
+

+ /* Fix temp_dir if needed */
+ if (ptr->flags & ESTR_slash) {
+ int l = strlen(buffer);

+

+ if (0 == l || buffer[l-1] != '/')
+ strfcat(buffer,"/",sizeof buffer);
+ }
+
ptr->expanded = strmcpy(ptr->expanded,buffer);

return 1;
***************

*** 1552,1558 ****
/* Set initial value */
extern void set_dt_estr(ptr, const_val, def_env)
struct dt_estr_info *ptr;
! CONST char *const_val;
char *def_env;
{
char *cp;
--- 1418,1424 ----
/* Set initial value */
extern void set_dt_estr(ptr, const_val, def_env)
struct dt_estr_info *ptr;
! const char *const_val;
char *def_env;
{
char *cp;
***************
*** 1576,1588 ****


#ifdef ANSI_C
static rc_parse_line dt_ESTR_parse_line;
#endif

! static int dt_ESTR_parse_line(r,lcl,value,lineno,filename, e_val, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;
- int e_val;

int negate;
{
if (negate) {
--- 1442,1453 ----


#ifdef ANSI_C
static rc_parse_line dt_ESTR_parse_line;
#endif

! static int dt_ESTR_parse_line(r,lcl,value,lineno,filename, negate)


struct rc_save_info_rec *r;
int lcl;
char *value;
int lineno;
char *filename;

int negate;
{
if (negate) {
***************

*** 1634,1639 ****
--- 1499,1656 ----


dt_ESTR_print_value, dt_ESTR_get_value };


+ int give_dt_enumerate_as_int(ptr)
+ struct dt_enumerate_info *ptr;
+ {
+ return ptr->val;
+ }
+

+ const char * give_dt_enumerate_as_str(ptr)


+ struct dt_enumerate_info *ptr;
+ {
+ static char * buffer = NULL;
+
+ if (ptr->val >= 0 &&
+ ptr->val < ptr->nlen)
+ return ptr->list[ptr->val];

+
+ if (buffer)
+ free(buffer);

+ buffer = elm_message(FRM("%d"), ptr->val);
+
+ return buffer;
+ }
+
+ int set_dt_enumerate_as_str(ptr,str)
+ struct dt_enumerate_info *ptr;

+ char *str;
+ {


+ int ci = -1, i;
+
+ int e_val;
+

+ e_val = 0; /* First value is 'unknown' */
+

+ for (i = 0; i < ptr->nlen; i++)
+ if (0 == strcmp(ptr->list[i],str)) {
+ e_val = i;
+ break;
+ } else if (0 == istrcmp(ptr->list[i],str))
+ ci = i;
+
+ if (!e_val && ci >= 0)
+ e_val = ci;
+
+ if (i == ptr->nlen) {
+ char *p;
+
+ if ((e_val = strtol(str,&p,10)) < 0 || *p != '\0')

+ return 0;
+
+ }
+

+ ptr->val = e_val;
+
+ return 1;

+ }
+
+
+

+ #ifdef ANSI_C
+ static rc_parse_line dt_ENUM_parse_line;
+ #endif
+ static int dt_ENUM_parse_line(r,lcl,value,lineno,filename, negate)
+ struct rc_save_info_rec *r;
+ int lcl;
+ char *value;
+ int lineno;
+ char *filename;
+ int negate;
+ {
+ if (negate) {
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadNegate,

+ "!%s is not supported in line %d in \"%s\" file"),
+ r->name,lineno,filename);


+ return 0;
+ }
+

+ if (!set_dt_enumerate_as_str(r->val.enumerate,value)) {
+ int i;
+

+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadEKeyInElmrc,
+ "I can't understand %s key \"%s\" in line %d in \"%s\" file"),
+ r->name,value, lineno,filename);
+
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadEKeyValues,
+ "Possible values are:"));
+ for (i = 0; i < r->val.enumerate->nlen; i++)
+ lib_error(FRM(" - %s"),
+ r->val.enumerate->list[i]);

+
+ return 0;
+ }
+

+ return 1;
+ }
+
+ #if ANSI_C


+ static rc_get_value dt_ENUM_get_value;
+ #endif
+ static char * dt_ENUM_get_value(r)
+ struct rc_save_info_rec *r;
+ {
+ static char * buffer = NULL;
+
+ if (r->val.enumerate->val >= 0 &&
+ r->val.enumerate->val < r->val.enumerate->nlen)
+ return r->val.enumerate->list[r->val.enumerate->val];

+
+ if (buffer)
+ free(buffer);

+ buffer = elm_message(FRM("%d"), r->val.enumerate->val);
+
+ return buffer;
+ }

+
+ #if ANSI_C

+ }
+
+

Kari E. Hurtta

unread,
Jul 28, 2005, 12:27:23 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.4

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 4/20 ) =========
Index: elmME+.2.5.alpha5-cvs/hdrs/s_elm.h
*** elmME+.2.5.alpha4/hdrs/s_elm.h 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/hdrs/s_elm.h 2005-07-24 16:04:30.000000000 +0300
***************
*** 499,505 ****


#define ElmListFoldersHelp1 0x24f
#define ElmListFoldersHelp2 0x250
#define ElmShownXWithSelect 0x251
- #define ElmShownXNoSelect 0x252
#define ElmFolderWord 0x253
#define ElmMailboxWord 0x254
#define ElmLevel0MenuLine1 0x255

--- 499,504 ----
***************
*** 542,548 ****


#define ElmSegmentViolationSignal 0x280
#define ElmStoppedUseFGToReturn 0x281
#define ElmBackInElmRedraw 0x282
- #define ElmShownXNoSelectPlural 0x283
#define ElmKeyF1 0x284
#define ElmKeyF2 0x285
#define ElmKeyF3 0x286

--- 541,546 ----
***************
*** 712,727 ****
#define ElmOptionReturnHelp 0x342
#define ElmReadMessageIncrement 0x343
#define ElmSleepMessageInvalid 0x344
! #define ElmVfyPromptPleaseChoose 0x345
! #define ElmVfyMenuUser0 0x346
! #define ElmVfyPromptAndNow 0x347
#define ElmVfyMenuEditForm 0x348
#define ElmVfyMenuEditMake 0x349
#define ElmVfyMenuEditMsg 0x34a
#define ElmVfyMenuVfyCpy 0x34b
#define ElmVfyMenuIspell 0x34c
#define ElmVfyMenuShell 0x34d
! #define ElmVfyMenuSndFgt 0x34e
#define ElmVfyNoFieldsInForm 0x350
#define ElmHelpViewAttach 0x351
#define ElmBadModeInElmrc 0x352
--- 710,725 ----
#define ElmOptionReturnHelp 0x342
#define ElmReadMessageIncrement 0x343
#define ElmSleepMessageInvalid 0x344
! #define ElmVfyPromptSendTheMsg 0x345
! #define ElmVfyMenu1User0 0x346
! #define ElmVfyMenu2User0 0x347
#define ElmVfyMenuEditForm 0x348
#define ElmVfyMenuEditMake 0x349
#define ElmVfyMenuEditMsg 0x34a
#define ElmVfyMenuVfyCpy 0x34b
#define ElmVfyMenuIspell 0x34c
#define ElmVfyMenuShell 0x34d
! #define ElmVfyMenuForgetOr 0x34e
#define ElmVfyNoFieldsInForm 0x350
#define ElmHelpViewAttach 0x351
#define ElmBadModeInElmrc 0x352
***************
*** 776,785 ****


#define ElmStructuredNoencoding 0x384
#define ElmStructuredLeaf 0x385
#define ElmUnknownCommand2 0x386
! #define ElmFileNotExist 0x387
! #define ElmCantStatFile 0x388
! #define ElmNotReadableByUser 0x389
! #define ElmCheckingEncoding 0x38a
#define ElmCantOpenFile 0x38b
#define ElmNoAttachments 0x38c
#define ElmLastAttachment 0x38d

--- 774,783 ----


#define ElmStructuredNoencoding 0x384
#define ElmStructuredLeaf 0x385
#define ElmUnknownCommand2 0x386
! #define ElmFileNotExistS 0x387
! #define ElmCantStatFileS 0x388
! #define ElmNotReadableByUserS 0x389
! #define ElmCheckingEncodingS 0x38a
#define ElmCantOpenFile 0x38b
#define ElmNoAttachments 0x38c
#define ElmLastAttachment 0x38d
***************

*** 809,815 ****


#define ElmPgpNoMatch 0x3a5
#define ElmHeaderUsingUNKNOWN8BIT 0x3a6
#define ElmHeaderBadCharset 0x3a7
! #define ElmErrorOpeningName 0x3a8
#define ElmErrorWhenReading 0x3a9
#define ElmFailedLeaveFolder 0x3aa
#define ElmFailedResyncFolder 0x3ab

--- 807,813 ----


#define ElmPgpNoMatch 0x3a5
#define ElmHeaderUsingUNKNOWN8BIT 0x3a6
#define ElmHeaderBadCharset 0x3a7
! #define ElmErrorOpeningNameS 0x3a8
#define ElmErrorWhenReading 0x3a9
#define ElmFailedLeaveFolder 0x3aa
#define ElmFailedResyncFolder 0x3ab
***************

*** 865,871 ****


#define ElmPgpP 0x3eb
#define ElmPgpEntUser 0x3ec
#define ElmDbxCurrMsgNum 0x3ed
- #define ElmDbxHdrPage 0x3ee
#define ElmDbxCurrMailFile 0x3ef
#define ElmDbxPressAnyKey 0x3f0
#define ElmTerminatedWithSignal 0x3f1

--- 863,868 ----
***************
*** 1032,1038 ****


#define ElmMailcapMenu 0x82d
#define ElmUseMailcap 0x82e
#define ElmMetamail 0x82f
! #define ElmMailcapQuit 0x830
#define ElmTitleQuit 0x831
#define ElmIconQuit 0x832
#define ElmTitleSusp 0x833

--- 1029,1035 ----


#define ElmMailcapMenu 0x82d
#define ElmUseMailcap 0x82e
#define ElmMetamail 0x82f
! #define ElmMailcapDone 0x830
#define ElmTitleQuit 0x831
#define ElmIconQuit 0x832
#define ElmTitleSusp 0x833
***************

*** 1113,1120 ****
#define ElmCancelMenuLine2 0x87f
#define ElmCancelMenuLine3 0x880
#define ElmVfyMessageKept1 0x881
! #define ElmFailedUserRC 0x882
! #define ElmArgsNoFileBatch 0x883
! #define ElmMagicOn 0x884
! #define ElmMagicOff 0x88f
! #define ElmChangeMailbox 0x890
--- 1110,1148 ----
#define ElmCancelMenuLine2 0x87f
#define ElmCancelMenuLine3 0x880
#define ElmVfyMessageKept1 0x881
! #define ElmShownXNoSelectItem 0x882
! #define ElmMailcapPage 0x883
! #define ElmMetamailMenu1 0x884
! #define ElmMetamailMenu2 0x885
! #define ElmMetamailMenu 0x886
! #define ElmMailcapMenu1 0x887
! #define ElmMailcapMenu2 0x888
! #define ElmDone 0x889
! #define ElmShownTitleNoMailbox 0x88a
! #define ElmNoItemToFlag 0x88b
! #define ElmLimitReturnToLastSelection 0x88c
! #define ElmReverseUnstable 0x88d
! #define ElmPadUnsThread 0x88e
! #define ElmAbrUnsThread 0x88f
! #define ElmLongUnsThread 0x890
! #define ElmBadLineInElmrc 0x891
! #define ElmDomainUnknown 0x892
! #define ElmVerifyNot 0x893
! #define ElmVerifyBad 0x894
! #define ElmVerifyBad1 0x895
! #define ElmVerifyNot1 0x896
! #define ElmErrorReadingS 0x897
! #define ElmCantOpenFileS 0x898
! #define ElmFailErrnoS 0x899
! #define ElmArgsBadZoption 0x89a
! #define ElmArgsBadYoption 0x89b
! #define ElmNoUnreadMail 0x89c
! #define ElmFailedUserRC 0x89d
! #define ElmArgsNoFileBatch 0x89e
! #define ElmMagicOn 0x89f
! #define ElmMagicOff 0x8a0
! #define ElmChangeMailbox 0x8a1
! #define ElmVfyMenuDSN 0x8a2
! #define ElmVfyMenuPGP 0x8a3
! #define ElmVfyPromptSendMessage 0x8a4
! #define ElmVfySelectLetter 0x8a5
Index: elmME+.2.5.alpha5-cvs/hdrs/s_elmrc.h
*** elmME+.2.5.alpha4/hdrs/s_elmrc.h 2003-05-28 21:49:27.000000000 +0300
--- elmME+.2.5.alpha5-cvs/hdrs/s_elmrc.h 2005-07-20 19:49:39.000000000 +0300


***************
*** 7,14 ****
#define ElmrcCantSaveConfig 0x5
#define ElmrcOptionsSavedIn 0x6
#define ElmrcOptionsFile 0x7
- #define ElmrcSavedAutoFor 0x8
- #define ElmrcSavedAuto 0x9
#define ElmrcNoBothwI 0xa
! #define ElmrcSavedAutoWrite 0xb
! #define ElmrcSavedAutoLIB 0xc
--- 7,14 ----
#define ElmrcCantSaveConfig 0x5
#define ElmrcOptionsSavedIn 0x6
#define ElmrcOptionsFile 0x7
#define ElmrcNoBothwI 0xa
! #define ElmrcSavedAutoWrite1 0xd
! #define ElmrcFileNotWriteable 0xe
! #define ElmrcFileNotRenamed 0xf
! #define ElmrcSavedAutoFor1 0x10

Index: elmME+.2.5.alpha5-cvs/hdrs/shared_imp.h
*** elmME+.2.5.alpha4/hdrs/shared_imp.h 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha5-cvs/hdrs/shared_imp.h 2005-07-26 11:28:36.000000000 +0300
***************
*** 1,7 ****
! /* $Id: shared_imp.h,v 1.16.8.1 2004/07/03 15:23:04 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: shared_imp.h,v 1.16.8.3 2005/07/26 08:28:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 70,75 ****
--- 70,76 ----

struct sl_base_data * base;
struct sl_connect_data * connect;
+ struct sl_mailer_data * mailer;
} r;
} * regs;
int regs_count;

***************
*** 112,119 ****
extern struct ImpInfo * give_impinfo P_((const char * tag));
extern int reg_code1 P_((struct ImpInfo *I, int r));
extern void load_shared_libs P_((void));
! extern int tag_ok P_((CONST char *name));


extern void load_code0 P_((struct ImpInfo *I));

/*
* Local Variables:
--- 113,121 ----
extern struct ImpInfo * give_impinfo P_((const char * tag));
extern int reg_code1 P_((struct ImpInfo *I, int r));
extern void load_shared_libs P_((void));
! extern int tag_ok P_((const char *name));


extern void load_code0 P_((struct ImpInfo *I));
+ extern void register_list P_((SHAREDLIB *Z));

/*
* Local Variables:
Index: elmME+.2.5.alpha5-cvs/hdrs/s_me.h
*** elmME+.2.5.alpha4/hdrs/s_me.h 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/hdrs/s_me.h 2005-07-20 19:49:39.000000000 +0300

Index: elmME+.2.5.alpha5-cvs/hdrs/unidata.h
*** elmME+.2.5.alpha4/hdrs/unidata.h 2004-03-30 19:38:43.000000000 +0300
--- elmME+.2.5.alpha5-cvs/hdrs/unidata.h 2005-07-26 11:28:36.000000000 +0300
***************
*** 1,7 ****
! /* $Id: unidata.h,v 1.8 2004/03/27 18:31:37 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! /* $Id: unidata.h,v 1.8.8.1 2005/07/26 08:28:36 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 14,25 ****
struct unidata_mapped_data; /* Needed for prototype */
#endif

! extern int get_unidata P_((struct unidata_mapped_data ** ptr, CONST char *filename));
extern int read_unidata_text P_((struct unidata_mapped_data **ptr,
! CONST char *filename, FILE *logfile,
int silent_gaps));
extern void free_unidata P_((struct unidata_mapped_data * v));
! extern int write_unidata P_((struct unidata_mapped_data *v,CONST char *filename));
extern int write_unidata_text P_((struct unidata_mapped_data *v, FILE *f));

/* UNICODE character types */
--- 14,25 ----
struct unidata_mapped_data; /* Needed for prototype */
#endif

! extern int get_unidata P_((struct unidata_mapped_data ** ptr, const char *filename));
extern int read_unidata_text P_((struct unidata_mapped_data **ptr,
! const char *filename, FILE *logfile,
int silent_gaps));
extern void free_unidata P_((struct unidata_mapped_data * v));
! extern int write_unidata P_((struct unidata_mapped_data *v,const char *filename));
extern int write_unidata_text P_((struct unidata_mapped_data *v, FILE *f));

/* UNICODE character types */
Index: elmME+.2.5.alpha5-cvs/lib/add_site.c
*** elmME+.2.5.alpha4/lib/add_site.c 2004-05-16 17:43:45.000000000 +0300
--- /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300
***************
*** 1,52 ****
- static char rcsid[] = "@(#)$Id: add_site.c,v 1.5.8.1 2004/04/18 16:55:36 hurtta Exp $";
-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


- *
- * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
- * (was hurtt...@ozone.FMI.FI)
- ******************************************************************************

- * The Elm Mail System
- *
- * Copyright (c) 1988-1992 USENET Community Trust
- * Copyright (c) 1986,1987 Dave Taylor
- *****************************************************************************/
-
- #include "elm_defs.h"


-
- int add_site(buffer, site, lastsite, size)
- char *buffer, *site, *lastsite;
- int size;
- {
- /** add site to buffer, unless site is 'uucp' or site is
- the same as lastsite. If not, set lastsite to site.

- **/
-

- char local_buffer[SLEN], *stripped;
- char *strip_parens();
-
- stripped = strip_parens(site);
-
- if (istrcmp(stripped, "uucp") != 0)
- if (strcmp(stripped, lastsite) != 0) {
- if (buffer[0] == '\0')
- strfcpy(buffer, stripped, size); /* first in list! */
- else {
- elm_sfprintf(local_buffer,sizeof local_buffer,
- FRM("%.*s!%.*s"),
- sizeof local_buffer /2 -2, buffer,
- sizeof local_buffer /2 -2, stripped);
- strfcpy(buffer, local_buffer, size);
- }
- strfcpy(lastsite, stripped, size); /* don't want THIS twice! */
- }

- return 0;
- }
-

- /*
- * Local Variables:
- * mode:c
- * c-basic-offset:4
- * buffer-file-coding-system: iso-8859-1
- * End:
- */

--- 0 ----
Index: elmME+.2.5.alpha5-cvs/lib/aliasdb.c
*** elmME+.2.5.alpha4/lib/aliasdb.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/aliasdb.c 2005-07-20 19:49:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: aliasdb.c,v 1.8.8.1 2004/04/18 16:55:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: aliasdb.c,v 1.8.8.2 2005/07/20 16:49:39 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.8.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 32,37 ****


--- 32,42 ----
#define MAPIN(o) ((db->dbz_bytesame) ? (of_t) (o) : bytemap((of_t)(o), db->dbz_conf.bytemap, db->dbz_mybmap))
#define MAPOUT(o) ((db->dbz_bytesame) ? (of_t) (o) : bytemap((of_t)(o), db->dbz_mybmap, db->dbz_conf.bytemap))

+ static of_t bytemap P_((of_t ino,
+ int *map1,
+ int *map2));
+
+

static of_t /* transformed result */

bytemap(ino, map1, map2)
of_t ino;
***************
*** 52,57 ****
--- 57,66 ----
return(out.o);
}

+ int read_one_alias P_((DBZ *db,
+ struct alias_disk_rec *adr));
+
+
int read_one_alias(db, adr)
DBZ *db;
struct alias_disk_rec *adr;
***************
*** 96,101 ****
--- 105,112 ----
* dynamically allocated memory is returned. When the end of file is
* reached, a NULL is returned.
*/
+
+
struct alias_rec *fetch_alias(db, alias)
DBZ *db;
char *alias;

Index: elmME+.2.5.alpha5-cvs/lib/bindata.c
*** elmME+.2.5.alpha4/lib/bindata.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/bindata.c 2005-07-26 11:28:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: bindata.c,v 1.4.8.2 2004/04/25 14:52:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: bindata.c,v 1.4.8.5 2005/07/26 08:28:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.5 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@ozone.FMI.FI>
*****************************************************************************/
***************
*** 83,89 ****
#define SYSCALL(x) { int ret_=x; int err_=errno;\
if (ret_ == -1) \
DPRINT(Debug,1,(&Debug,"bindata: syscall %s failed: errno=%d (%s)\n", \
! #x,err_,error_description(err_))); }
#else
#define SYSCALL(x) x
#endif
--- 83,89 ----
#define SYSCALL(x) { int ret_=x; int err_=errno;\
if (ret_ == -1) \
DPRINT(Debug,1,(&Debug,"bindata: syscall %s failed: errno=%d (%s)\n", \
! #x,err_,strerror(err_))); }
#else
#define SYSCALL(x) x
#endif
***************
*** 157,170 ****

static void dump_header P_((struct bindata_format_1 *v,
int byte_swapped,
! CONST char *filename));

static int write_bindata_1 P_((struct bindata_format_1 *v, int fd,
! CONST char *filename));
static int write_bindata_1(v, fd, filename)
struct bindata_format_1 *v;
int fd;
! CONST char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
uint16 csets_pages = READ_VALUE(v->header->csets_pagecount,
--- 157,170 ----

static void dump_header P_((struct bindata_format_1 *v,
int byte_swapped,
! const char *filename));

static int write_bindata_1 P_((struct bindata_format_1 *v, int fd,
! const char *filename));
static int write_bindata_1(v, fd, filename)
struct bindata_format_1 *v;
int fd;
! const char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
uint16 csets_pages = READ_VALUE(v->header->csets_pagecount,
***************
*** 175,185 ****

DPRINT(Debug,1,(&Debug,
"bindata: write_range failed: errno=%d (%s)\n", \
! err,error_description(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}

--- 175,185 ----

DPRINT(Debug,1,(&Debug,
"bindata: write_range failed: errno=%d (%s)\n", \
! err,strerror(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 190,200 ****

DPRINT(Debug,1,(&Debug,
"bindata: write_range failed: errno=%d (%s)\n", \
! err,error_description(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}

--- 190,200 ----

DPRINT(Debug,1,(&Debug,
"bindata: write_range failed: errno=%d (%s)\n", \
! err,strerror(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 210,220 ****

DPRINT(Debug,1,(&Debug,
"bindata: write_range failed: errno=%d (%s)\n", \
! err,error_description(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));
return 0;
}
}

--- 210,220 ----

DPRINT(Debug,1,(&Debug,
"bindata: write_range failed: errno=%d (%s)\n", \
! err,strerror(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
}
***************
*** 225,231 ****

static void dump_header(v,byte_swapped,filename)
struct bindata_format_1 *v;
int byte_swapped;
! CONST char *filename;
{
if (v->header) {
DPRINT(Debug,40,(&Debug,"============ Header dump: %-15s =======\n",
--- 225,231 ----
static void dump_header(v,byte_swapped,filename)
struct bindata_format_1 *v;
int byte_swapped;
! const char *filename;
{
if (v->header) {
DPRINT(Debug,40,(&Debug,"============ Header dump: %-15s =======\n",
***************
*** 251,261 ****


static int calculate_sizes P_((struct bindata_format_1 *v,
! CONST char *filename));

static int calculate_sizes (v,filename)
struct bindata_format_1 *v;
! CONST char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
uint16 header_pages, csets_pages;
--- 251,261 ----


static int calculate_sizes P_((struct bindata_format_1 *v,
! const char *filename));

static int calculate_sizes (v,filename)
struct bindata_format_1 *v;
! const char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);
uint16 header_pages, csets_pages;
***************
*** 295,307 ****

static void debug_output P_((struct bindata_format_1 *v,
int status, int pagesize, char *str,
! CONST char *filename));
static void debug_output(v,status,pagesize,str,filename)
struct bindata_format_1 *v;
int status;
int pagesize;
char *str;
! CONST char *filename;
{
DPRINT(Debug,1,(&Debug,
"%s: %s: status=%d, csets_count=%d, pagesize=%d\n",
--- 295,307 ----

static void debug_output P_((struct bindata_format_1 *v,
int status, int pagesize, char *str,
! const char *filename));
static void debug_output(v,status,pagesize,str,filename)
struct bindata_format_1 *v;
int status;
int pagesize;
char *str;
! const char *filename;
{
DPRINT(Debug,1,(&Debug,
"%s: %s: status=%d, csets_count=%d, pagesize=%d\n",
***************
*** 323,337 ****


static int read_bindata_1 P_((struct bindata_format_1 *v, int fd,
! int byte_swapped, CONST char *filename));
static int read_bindata_1(v, fd, byte_swapped, filename)
struct bindata_format_1 *v;
int fd;
int byte_swapped;
! CONST char *filename;
{
int status = 0;
! uint16 pagesize;

v->byte_swapped = byte_swapped;
v->mmapped = 0;
--- 323,337 ----


static int read_bindata_1 P_((struct bindata_format_1 *v, int fd,
! int byte_swapped, const char *filename));
static int read_bindata_1(v, fd, byte_swapped, filename)
struct bindata_format_1 *v;
int fd;
int byte_swapped;
! const char *filename;
{
int status = 0;
! uint16 pagesize = 0;

v->byte_swapped = byte_swapped;
v->mmapped = 0;
***************
*** 344,350 ****

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));

status = 0;
goto fail_1;
--- 344,350 ----

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));

status = 0;
goto fail_1;
***************
*** 365,371 ****

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));

status = 0;
goto fail_2;
--- 365,371 ----

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));

status = 0;
goto fail_2;
***************
*** 394,405 ****


static int mmap_bindata_1 P_((struct bindata_format_1 *v, int fd,
! int byte_swapped, CONST char *filename));
static int mmap_bindata_1(v, fd, byte_swapped, filename)
struct bindata_format_1 *v;
int fd;
int byte_swapped;
! CONST char *filename;
{
int status = 0;
#ifdef MMAP
--- 394,405 ----


static int mmap_bindata_1 P_((struct bindata_format_1 *v, int fd,
! int byte_swapped, const char *filename));
static int mmap_bindata_1(v, fd, byte_swapped, filename)
struct bindata_format_1 *v;
int fd;
int byte_swapped;
! const char *filename;
{
int status = 0;
#ifdef MMAP
***************
*** 417,423 ****

lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, error_description(err));

v->header = NULL;
v->header_length = 0;
--- 417,423 ----

lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, strerror(err));

v->header = NULL;
v->header_length = 0;
***************
*** 449,455 ****

lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, error_description(err));

v->csets = NULL;
v->csets_length = 0;
--- 449,455 ----

lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, strerror(err));

v->csets = NULL;
v->csets_length = 0;
***************
*** 520,534 ****
switch(v->format) {
case bindata_format_1: free_bindata_1(&(v->v.f1));
break;
}
- v->format = bindata_bad;
- free(v);
}


int write_bindata(v,filename)
struct bindata_mapped_data *v;
! CONST char *filename;
{
char *tmpname;
int fd, err;
--- 520,536 ----
switch(v->format) {
case bindata_format_1: free_bindata_1(&(v->v.f1));
break;
+ default:
+ v->format = bindata_bad;
+ free(v);
+ break;
}
}


int write_bindata(v,filename)
struct bindata_mapped_data *v;
! const char *filename;
{
char *tmpname;
int fd, err;
***************
*** 539,550 ****

DPRINT(Debug,1,(&Debug,
"bindata: access failed: errno=%d (%s)\n", \
! err,error_description(err)));

if (err != ENOENT) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}

--- 541,552 ----

DPRINT(Debug,1,(&Debug,
"bindata: access failed: errno=%d (%s)\n", \
! err,strerror(err)));

if (err != ENOENT) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 557,567 ****
if (err) {
DPRINT(Debug,1,(&Debug,
"bindata: can_open failed: code=%d (%s)\n", \
! err,error_description(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmpname, error_description(err));

status = 0;
goto fail;
--- 559,569 ----
if (err) {
DPRINT(Debug,1,(&Debug,
"bindata: can_open failed: code=%d (%s)\n", \
! err,strerror(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmpname, strerror(err));

status = 0;
goto fail;
***************
*** 573,583 ****

DPRINT(Debug,1,(&Debug,
"bindata: open failed: errno=%d (%s)\n", \
! err,error_description(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmpname, error_description(err));
status = 0;
goto fail;
}
--- 575,585 ----

DPRINT(Debug,1,(&Debug,
"bindata: open failed: errno=%d (%s)\n", \
! err,strerror(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmpname, strerror(err));
status = 0;
goto fail;
}
***************
*** 586,591 ****
--- 588,596 ----
case bindata_format_1:
status = write_bindata_1(&(v->v.f1),fd,tmpname);
break;
+ default:
+ status = 0;
+ break;
}

if (-1 == close(fd)) {
***************
*** 593,603 ****

DPRINT(Debug,1,(&Debug,
"bindata: close failed: errno=%d (%s)\n", \
! err,error_description(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmpname, error_description(err));
status = 0;
goto fail;
}
--- 598,608 ----

DPRINT(Debug,1,(&Debug,
"bindata: close failed: errno=%d (%s)\n", \
! err,strerror(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmpname, strerror(err));
status = 0;
goto fail;
}
***************
*** 607,613 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! filename, error_description(err));
status = 0;
goto fail;
}
--- 612,618 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! filename, strerror(err));
status = 0;
goto fail;
}
***************
*** 623,629 ****

int get_bindata(ptr,filename)
struct bindata_mapped_data **ptr;
! CONST char *filename;
{
struct bindata_mapped_data * res = *ptr;
int status = 0;
--- 628,634 ----

int get_bindata(ptr,filename)
struct bindata_mapped_data **ptr;
! const char *filename;
{
struct bindata_mapped_data * res = *ptr;
int status = 0;
***************
*** 637,643 ****
if (err) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),


! filename, error_description(err));
return 0;
}

--- 642,648 ----
if (err) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),


! filename, strerror(err));
return 0;
}

***************

*** 647,653 ****

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),


! filename, error_description(err));
return 0;
}

--- 652,658 ----

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),


! filename, strerror(err));
return 0;
}

***************

*** 745,751 ****
struct bindata_format_1 *v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! CONST char *filename;
{
int status = 0,i;
struct csets_1 *y;
--- 750,756 ----
struct bindata_format_1 *v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! const char *filename;
{
int status = 0,i;
struct csets_1 *y;
***************
*** 794,800 ****
struct bindata_mapped_data * v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! CONST char *filename;
{
int r = 0;

--- 799,805 ----
struct bindata_mapped_data * v;
uint16 bytevector[256];
unsigned char revvector[MAP_REV_MAP_DIV];
! const char *filename;
{
int r = 0;

***************
*** 803,808 ****
--- 808,816 ----
r = add_bindata_1_map(&(v->v.f1),
bytevector,revvector,filename);
break;
+ default:
+ r = 0;
+ break;
}

return r;
***************
*** 828,833 ****
--- 836,843 ----
case bindata_format_1:
trim_bindata_1(&(v->v.f1));


break;
+ default:
+ break;
}
}

***************

*** 836,842 ****
const char *dir, char ***filelist));
static int write_bindata_text_1(v, dir, filelist)
struct bindata_format_1 *v;
! CONST char *dir;
char ***filelist;
{
int status = 0;
--- 846,852 ----
const char *dir, char ***filelist));
static int write_bindata_text_1(v, dir, filelist)
struct bindata_format_1 *v;
! const char *dir;
char ***filelist;
{
int status = 0;
***************
*** 865,875 ****
if (err) {
DPRINT(Debug,1,(&Debug,
"bindata: can_open failed: code=%d (%s)\n", \
! err,error_description(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! name, error_description(err));

status = 0;
goto fail;
--- 875,885 ----
if (err) {
DPRINT(Debug,1,(&Debug,
"bindata: can_open failed: code=%d (%s)\n", \
! err,strerror(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! name, strerror(err));

status = 0;
goto fail;
***************
*** 880,890 ****
int err = errno;
DPRINT(Debug,1,(&Debug,
"bindata: fopen failed: code=%d (%s)\n",
! err,error_description(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! name, error_description(err));

status = 0;
goto fail;
--- 890,900 ----
int err = errno;
DPRINT(Debug,1,(&Debug,
"bindata: fopen failed: code=%d (%s)\n",
! err,strerror(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! name, strerror(err));

status = 0;
goto fail;
***************
*** 911,921 ****
int err = errno;
DPRINT(Debug,1,(&Debug,
"bindata: fflush failed: code=%d (%s)\n", \
! err,error_description(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! name, error_description(err));

status = 0;
}
--- 921,931 ----
int err = errno;
DPRINT(Debug,1,(&Debug,
"bindata: fflush failed: code=%d (%s)\n", \
! err,strerror(err)));


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! name, strerror(err));

status = 0;
}
***************
*** 940,946 ****

int write_bindata_text(v,dir,filelist)
struct bindata_mapped_data *v;

! CONST char * dir;

char ***filelist;
{
int status = 0;
--- 950,956 ----

int write_bindata_text(v,dir,filelist)
struct bindata_mapped_data *v;

! const char * dir;

char ***filelist;
{
int status = 0;
***************
*** 950,955 ****
--- 960,968 ----
case bindata_format_1:
status = write_bindata_text_1(&(v->v.f1),dir,&list);
break;
+ default:
+ status = 0;
+ break;
}

*filelist = list;
***************
*** 972,978 ****
const char *mapname));
struct bindata_map * give_mapping_1(v, mapname)
struct bindata_format_1 *v;
! CONST char *mapname;
{
struct bindata_map *ret = NULL;
int m;
--- 985,991 ----
const char *mapname));
struct bindata_map * give_mapping_1(v, mapname)
struct bindata_format_1 *v;
! const char *mapname;
{
struct bindata_map *ret = NULL;
int m;
***************
*** 1000,1006 ****

struct bindata_map * give_mapping(v,mapname)
struct bindata_mapped_data *v;
! CONST char *mapname;
{
struct bindata_map *ret = NULL;

--- 1013,1019 ----

struct bindata_map * give_mapping(v,mapname)
struct bindata_mapped_data *v;
! const char *mapname;
{
struct bindata_map *ret = NULL;

***************
*** 1008,1013 ****
--- 1021,1029 ----
case bindata_format_1:
ret = give_mapping_1(&(v->v.f1),mapname);
break;
+ default:
+ ret = NULL;
+ break;
}


***************
*** 1091,1096 ****
--- 1107,1114 ----
switch(map->format) {
case bindata_format_1:
return lookup_binmap_rev_1(& (map->v.f1),val,found);
+ default:
+ break;
}

return 0;
***************
*** 1106,1111 ****
--- 1124,1131 ----
switch(map->format) {
case bindata_format_1:
return lookup_binmap_1(ch,& (map->v.f1),found);
+ default:
+ break;


}

return 0x003F; /* '?' */

Index: elmME+.2.5.alpha5-cvs/lib/can_access.c
*** elmME+.2.5.alpha4/lib/can_access.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/can_access.c 2005-07-23 22:01:33.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: can_access.c,v 1.10.8.1 2004/04/18 16:55:36 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: can_access.c,v 1.10.8.2 2005/07/23 19:01:33 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.10.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 62,75 ****


if (-1 == setgid(groupid)) {
int err = errno;

fprintf(stderr,"can_access: setgid(%d) FAILED: %s\n",


! groupid,error_description(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}
if (-1 == setuid(userid)) { /** back to normal userid **/
int err = errno;

fprintf(stderr,"can_access: setuid(%d) FAILED: %s\n",


! userid,error_description(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}

--- 62,75 ----


if (-1 == setgid(groupid)) {
int err = errno;

fprintf(stderr,"can_access: setgid(%d) FAILED: %s\n",


! groupid,strerror(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}
if (-1 == setuid(userid)) { /** back to normal userid **/
int err = errno;

fprintf(stderr,"can_access: setuid(%d) FAILED: %s\n",


! userid,strerror(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}

Index: elmME+.2.5.alpha5-cvs/lib/cancel.c
*** elmME+.2.5.alpha4/lib/cancel.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/cancel.c 2005-07-26 11:28:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cancel.c,v 1.2.8.1 2004/07/19 09:19:59 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cancel.c,v 1.2.8.3 2005/07/26 08:28:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 12,17 ****
--- 12,18 ----

DEBUG_VAR(Debug,__FILE__,"ui");

+ static void cancel_set_ttysig_d P_((void));
static void cancel_set_ttysig_d()
{

/* NULL */
***************


*** 19,24 ****
--- 20,26 ----

static cancel_set_ttysig_f * SET_TTYSIG = &cancel_set_ttysig_d;

+ static void cancel_reset_ttysig_d P_((void));
static void cancel_reset_ttysig_d()
{

/* NULL */
***************


*** 26,31 ****
--- 28,34 ----

static cancel_reset_ttysig_f * RESET_TTYSIG = &cancel_reset_ttysig_d;

+ static void cancel_transient_d P_((struct string *x));
static void cancel_transient_d(x)
struct string *x;
{
***************
*** 34,39 ****
--- 37,43 ----

static cancel_transient_f * TRANSIENT = &cancel_transient_d;

+ static void cancel_clear_d P_((void));
static void cancel_clear_d()
{
lib_transient(FRM(""));

***************
*** 60,71 ****
unsigned short magic; /* CANCEL_magic */

struct string *msg;
! VOLATILE int is_canceled;
struct chancel_data * previous;

} * new_cancel P_((const char * format, const char *msg, ...));

! static struct chancel_data * VOLATILE current = NULL;

#ifdef POSIX_SIGNALS
static struct sigaction saved_state;
--- 64,75 ----
unsigned short magic; /* CANCEL_magic */

struct string *msg;
! volatile int is_canceled;
struct chancel_data * previous;

} * new_cancel P_((const char * format, const char *msg, ...));

! static struct chancel_data * volatile current = NULL;

#ifdef POSIX_SIGNALS
static struct sigaction saved_state;
***************
*** 104,111 ****


#endif
)
#if !ANSI_C
! CONST char * format;
! CONST char *msg;
va_dcl
#endif
{

--- 108,115 ----


#endif
)
#if !ANSI_C
! const char * format;
! const char *msg;
va_dcl
#endif
{

Index: elmME+.2.5.alpha5-cvs/lib/can_open.c
*** elmME+.2.5.alpha4/lib/can_open.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/can_open.c 2005-07-26 11:28:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: can_open.c,v 1.12.8.1 2004/04/18 16:55:37 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.1 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@poasti.FMI.FI>


* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: can_open.c,v 1.12.8.3 2005/07/26 08:28:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.3 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@poasti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 31,37 ****


int can_open(file, mode)
! CONST char *file, *mode;
{
/** Returns 0 iff user can open the file. This is not
the same as can_access - it's used for when the file might
--- 31,37 ----


int can_open(file, mode)
! const char *file, *mode;
{
/** Returns 0 iff user can open the file. This is not
the same as can_access - it's used for when the file might
***************
*** 39,45 ****

FILE *fd;


int the_stat = 0, pid, w, sig;

! VOLATILE int preexisted = 0;
S__ status;

#ifdef VFORK
--- 39,45 ----

FILE *fd;


int the_stat = 0, pid, w, sig;

! volatile int preexisted = 0;
S__ status;

#ifdef VFORK
***************
*** 50,63 ****


if (-1 == setgid(groupid)) {
int err = errno;

fprintf(stderr,"can_open: setgid(%d) FAILED: %s\n",


! groupid,error_description(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}
if (-1 == setuid(userid)) { /** back to normal userid **/
int err = errno;

fprintf(stderr,"can_open: setuid(%d) FAILED: %s\n",


! userid,error_description(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}

--- 50,63 ----


if (-1 == setgid(groupid)) {
int err = errno;

fprintf(stderr,"can_open: setgid(%d) FAILED: %s\n",


! groupid,strerror(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}
if (-1 == setuid(userid)) { /** back to normal userid **/
int err = errno;

fprintf(stderr,"can_open: setuid(%d) FAILED: %s\n",


! userid,strerror(err));
fflush(stderr);
_exit(err != 0? err : 1); /* never return zero! */
}

Index: elmME+.2.5.alpha5-cvs/lib/charset.c
*** elmME+.2.5.alpha4/lib/charset.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/charset.c 2005-07-26 11:28:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: charset.c,v 1.76.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: charset.c,v 1.76.8.5 2005/07/26 08:28:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
***************
*** 35,41 ****
static int extra_sets_count = 0;

union compare_info {
! CONST char *name;
struct charcode_info * part;
};

--- 35,41 ----
static int extra_sets_count = 0;

union compare_info {
! const char *name;
struct charcode_info * part;
};

***************
*** 112,118 ****
static int add_MIBenum(ptr)
struct charcode_info *ptr;
{
! CONST int MIBenum = ptr->MIBenum;
int MIBenum_class;
int val;

--- 112,118 ----
static int add_MIBenum(ptr)
struct charcode_info *ptr;
{
! const int MIBenum = ptr->MIBenum;
int MIBenum_class;
int val;



***************
*** 222,227 ****
--- 222,295 ----
return &(tmp->set);
}

+ #if defined(WCHAR) && defined(__STDC_ISO_10646__)
+

+ void change_system_charset_1 P_((void));
+
+ void change_system_charset()
+ {
+ char ** cs;

+ int i;
+
+

+ if (system_charset->charset_type == &cs_unknown) {

+ DPRINT(Debug,9,(&Debug,"change_system_charset: System charset is already type unknown\n"));
+ return;
+ }
+

+ if (!system_charset->MIME_name) {
+ DPRINT(Debug,9,(&Debug,"change_system_charset: System charset have no MIME name\n"));

+ return;
+ }
+

+ cs = give_dt_path_as_elems(&locale_charsets,"locale-charsets");
+ if (!cs) {
+ DPRINT(Debug,9,(&Debug,
+ "change_system_charset: No change: locale-charsets list empty\n"));

+ return;
+ }
+

+ for (i = 0; cs[i]; i++) {
+ if (0 == istrcmp(cs[i],system_charset->MIME_name)) {
+ DPRINT(Debug,9,(&Debug,
+ "change_system_charset: Found system charset %s from list, item #%d\n",
+ system_charset->MIME_name,i));

+ break;
+ }
+ }
+

+ if (!cs[i]) {
+ DPRINT(Debug,9,(&Debug,
+ "change_system_charset: No change\n"));

+ return;
+ }
+

+ change_system_charset_1();
+ }
+
+ void change_system_charset_1() {
+ struct charcode_info new_vals;
+ charset_t x;
+
+
+ new_vals = *system_charset;
+ new_vals.charset_type = &cs_unknown;
+ new_vals.map_info = NULL;
+ new_vals.flags |= SET_nodata;
+
+ system_charset->flags &= ~SET_valid;
+
+ x = add_set(new_vals);
+
+ DPRINT(Debug,9,(&Debug,
+ "change_system_charset_1: Changed system charset %s (type %s) to type unknown\n",
+ system_charset->MIME_name,
+ system_charset->charset_type->type_name));
+
+ system_charset = x;
+ }

+ #endif
+

static int same_name P_((struct charcode_info *set, union compare_info data));
static int same_name (set,data)
struct charcode_info *set;

***************
*** 250,256 ****

static int locate_charset_alias P_((const char * name));
static int locate_charset_alias(name)


! CONST char * name;

{
int i;

--- 318,324 ----

static int locate_charset_alias P_((const char * name));
static int locate_charset_alias(name)


! const char * name;

{
int i;

***************
*** 262,268 ****

static int add_charset_alias P_((const char * name, charset_t set));
static int add_charset_alias(name,set)


! CONST char * name;

charset_t set;
{
charset_alias_list = safe_realloc(charset_alias_list,
--- 330,336 ----

static int add_charset_alias P_((const char * name, charset_t set));
static int add_charset_alias(name,set)


! const char * name;

charset_t set;
{
charset_alias_list = safe_realloc(charset_alias_list,
***************
*** 274,280 ****
}

charset_t codeset_name_to_charset (name)
! CONST char *name;
{
charset_t ret;
union compare_info D;
--- 342,348 ----
}

charset_t codeset_name_to_charset (name)
! const char *name;
{
charset_t ret;
union compare_info D;
***************
*** 286,296 ****
}

charset_t MIME_name_to_charset (name,flag)
! CONST char *name;
int flag;
{
int create = flag & CHARSET_create;
! CONST int noautodef = flag & CHARSET_noautodef;
int i;
charset_t ret;
struct charcode_info new;
--- 354,364 ----
}

charset_t MIME_name_to_charset (name,flag)
! const char *name;
int flag;
{
int create = flag & CHARSET_create;
! const int noautodef = flag & CHARSET_noautodef;
int i;
charset_t ret;
struct charcode_info new;


***************
*** 312,318 ****
ret = ASCII_SET;
}

! if (ret && &cs_unknown == ret->charset_type) {
DPRINT(Debug,9,(&Debug, "MIME_name_to_charset(%s), found=%p as unknown\n",
name,ret));

--- 380,387 ----
ret = ASCII_SET;
}

! if (ret && &cs_unknown == ret->charset_type &&
! 0 == (charset_properties(ret) & CS_mapping)) {
DPRINT(Debug,9,(&Debug, "MIME_name_to_charset(%s), found=%p as unknown\n",
name,ret));

***************

*** 346,352 ****
DPRINT(Debug,9,(&Debug, "\n",ret->codeset));

if (!ret->MIME_name && create) {
! CONST char * X = ret->codeset ? ret->codeset : name; /* Should be unnecessary */
DPRINT(Debug,1,(&Debug,"*** No MIME name for charset %s, using %s as MIME name\n",
name,X));
ret->MIME_name = safe_strdup(X);
--- 415,421 ----
DPRINT(Debug,9,(&Debug, "\n",ret->codeset));

if (!ret->MIME_name && create) {
! const char * X = ret->codeset ? ret->codeset : name; /* Should be unnecessary */
DPRINT(Debug,1,(&Debug,"*** No MIME name for charset %s, using %s as MIME name\n",
name,X));
ret->MIME_name = safe_strdup(X);
***************
*** 462,476 ****
{
/* Pick only MIME charsets ... */

! if (item->MIME_name)
! if (item->subtype == ascii_ptr)
if (*count < max)
list[(*count)++] = item;
else {
lib_error(FRM("charset: Internal error -- overflow"));

return 0;
}
!
return 1;
}

--- 531,547 ----
{
/* Pick only MIME charsets ... */

! if (item->MIME_name) {
! if (item->subtype == ascii_ptr) {
if (*count < max)
list[(*count)++] = item;
else {
lib_error(FRM("charset: Internal error -- overflow"));
return 0;
}
! }


! }
!
return 1;
}

***************

*** 499,507 ****
return 1;


}

! static int name_ok P_((CONST char *name));
static int name_ok(name)
! CONST char *name;
{
if ('\0' == *name)
return 0;

--- 570,578 ----
return 1;
}


! static int name_ok P_((const char *name));
static int name_ok(name)
! const char *name;
{
if ('\0' == *name)
return 0;
***************

*** 511,516 ****
--- 582,591 ----
"ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789abcdefghijklmnopqrstuvwxyz");
}

+
+ #ifdef ANSI_C


+ option_func charset_compatfunc;
+ #endif
int charset_compatfunc (value,enter, lineno,filename)
char **value;
int enter;
***************

*** 521,527 ****
int ret = 0;


charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);

! CONST int size = precompiled_size + extra_sets_count;

struct charcode_info **need_modify_list =
safe_malloc(size * sizeof(struct charcode_info *));
--- 596,602 ----
int ret = 0;


charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);

! const int size = precompiled_size + extra_sets_count;

struct charcode_info **need_modify_list =
safe_malloc(size * sizeof(struct charcode_info *));
***************
*** 669,674 ****
--- 744,752 ----
#undef ADD_IT
#undef HANDLE

+ #ifdef ANSI_C


+ option_func charset_iso646func;
+ #endif
int charset_iso646func (value,enter, lineno,filename)
char **value;
int enter;
***************

*** 679,685 ****
int ret = 0;
charset_t invariant_ptr = MIME_name_to_charset("INVARIANT",0);

! CONST int size = precompiled_size + extra_sets_count;

struct charcode_info **need_modify_list =
safe_malloc(size * sizeof(struct charcode_info *));
--- 757,763 ----
int ret = 0;
charset_t invariant_ptr = MIME_name_to_charset("INVARIANT",0);

! const int size = precompiled_size + extra_sets_count;

struct charcode_info **need_modify_list =
safe_malloc(size * sizeof(struct charcode_info *));
***************
*** 826,838 ****
#undef ARRSIZE

char * dequote_opt(source,len)
! CONST char *source;
int len;
{
int size = len + 1;
int ptr = 0;
char * store = safe_malloc(size);
! CONST char *p;
int q = 0;

for (p = source; p - source < len && ptr < size-1; p++) {
--- 904,916 ----
#undef ARRSIZE

char * dequote_opt(source,len)
! const char *source;
int len;
{
int size = len + 1;
int ptr = 0;
char * store = safe_malloc(size);
! const char *p;
int q = 0;

for (p = source; p - source < len && ptr < size-1; p++) {
***************
*** 878,884 ****

int load_charset_map_info(buffer,data)
charset_t *buffer;
! CONST char *data;
{
char * temp = safe_strdup(data);
char *c;
--- 956,962 ----

int load_charset_map_info(buffer,data)
charset_t *buffer;
! const char *data;
{
char * temp = safe_strdup(data);
char *c;


***************
*** 1222,1231 ****
}
*buffer = add_set(new_vals);
DPRINT(Debug,9,(&Debug,
! "charset: Adding charset %s (type %s)\n",
! (*buffer)->MIME_name ?
! (*buffer)->MIME_name : "<no MIME name>",
! (*buffer)->charset_type->type_name));
}

if (alias_vector) {

--- 1300,1321 ----


}
*buffer = add_set(new_vals);
DPRINT(Debug,9,(&Debug,
! "charset: Adding "));
!
! if ((*buffer)->MIME_name) {
! DPRINT(Debug,9,(&Debug,
! "charset %s ",
! (*buffer)->MIME_name));
! }
! if ((*buffer)->codeset) {
! DPRINT(Debug,9,(&Debug,
! "codeset %s ",
! (*buffer)->codeset));
! }
! DPRINT(Debug,9,(&Debug,
! "(type %s) = %p\n",
! (*buffer)->charset_type->type_name,
! *buffer));
}

if (alias_vector) {
***************

*** 1329,1412 ****


}
}

- int get_charset_map_info (buffer,data,size)
- char *buffer;
- CONST char *data;
- int size;
- {
- charset_t set;

! if (!load_charset_map_info(&set,data) ||
! !set->MIME_name) {
! buffer[0] = '\0';

! DPRINT(Debug,7,(&Debug,
! "get_charset_map_info(\"%s\") = 0 (FAIL)\n",
! data));

! return 0;
! }


! strfcpy(buffer,set->MIME_name,size);

! DPRINT(Debug,11,(&Debug,
! "get_charset_map_info(\"%s\") = 1 (SUCCEED)\n",
! data));
! return 1;
! }

- static int charset_superset_of_p P_((charset_t charset,
- charset_t subset,
- int level));

- static int charset_superset_of_p(charset,subset,level)
- charset_t charset,subset;
- int level;
- {

! if (level > 10) {
! lib_error(CATGETS(elm_msg_cat, MeSet, MeCharsetSubsetLoop,
! "Charset subset defination loop detected for %s"),
! charset->MIME_name ? charset->MIME_name : "<no MIME name>");
! return 0;
}

- if (charset->subtype == subset)

- return 1;
-

- if (charset->subtype &&
- charset_superset_of_p(charset->subtype,subset,level+1))
- return 1;

- return 0;
- }
-

- int charset_superset_of(charset,subset)
- charset_t charset,subset;
- {
- int res = charset_superset_of_p(charset,subset,0);

DPRINT(Debug,6,(&Debug,
! "charset_superset_of(%p (%s),%p (%s))=%d\n",
! charset,
! charset->MIME_name ? charset->MIME_name :"<no MIME name>",
! subset,subset->MIME_name ? subset->MIME_name :"<no MIME name>",
! res));
return res;
}

int charset_ok_p(ptr)
charset_t ptr;
{

charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);

if (!ascii_ptr)
panic("CHARSET PANIC",__FILE__,__LINE__,"charset_ok_p",
"US-ASCII not found",0);
! return charset_superset_of(ptr,ascii_ptr);
}

struct locale_map_item * load_locale_map(filename,errors)

! CONST char *filename;
int *errors;

{
struct locale_map_item *result;
--- 1419,1512 ----


}
}


! int charset_superset_of(charset,subset)
! charset_t charset,subset;
! {
! int res = 0;
! int loop = 0;
! charset_t p;
!
! DPRINT(Debug,6,(&Debug,
! "charset_superset_of(%p (%s),%p (%s))\n",
! charset,

! charset->MIME_name ? charset->MIME_name :"<no MIME name>",

! subset,subset->MIME_name ? subset->MIME_name :"<no MIME name>"));

! for (p = charset; p; p = p->subtype) {

! DPRINT(Debug,6,(&Debug, " subset: %p (%s)\n",
! p,


! p->MIME_name ? p->MIME_name :"<no MIME name>"));
!

! if (p == subset) {
! DPRINT(Debug,6,(&Debug, " subset found\n"));

! res = 1;
! }


! if (p->subtype == charset) {

! DPRINT(Debug,6,(&Debug, " loop found\n"));



! lib_error(CATGETS(elm_msg_cat, MeSet, MeCharsetSubsetLoop,
! "Charset subset defination loop detected for %s"),
! charset->MIME_name ? charset->MIME_name : "<no MIME name>");

! break;
! }



! if (loop++ > 20) {
! /* Catch other loop which do not go tgrough original set */
! lib_error(CATGETS(elm_msg_cat, MeSet, MeCharsetSubsetLoop,
! "Charset subset defination loop detected for %s"),
! p->MIME_name ? p->MIME_name : "<no MIME name>");
! break;
! }
}


DPRINT(Debug,6,(&Debug,
! "charset_superset_of=%d\n",
! res));
return res;
}

int charset_ok_p(ptr)

charset_t ptr;
{
+ int r;


charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);

if (!ascii_ptr)
panic("CHARSET PANIC",__FILE__,__LINE__,"charset_ok_p",
"US-ASCII not found",0);
! r = charset_superset_of(ptr,ascii_ptr);
!
! if (r && &cs_ascii != ptr->charset_type) {
! DPRINT(Debug,6,(&Debug,
! "charset_ok_p: charset %p (%s) is superset of ascii %p (%s) but is not type cs_ascii (type = %p)\n",
! ptr,
! ptr->MIME_name ? ptr->MIME_name :"<no MIME name>",
! ascii_ptr,
! ascii_ptr->MIME_name ? ascii_ptr->MIME_name :"<no MIME name>",
! ptr->charset_type));
! }
!
! if (!r && &cs_ascii == ptr->charset_type) { /* Hack !! */
! DPRINT(Debug,6,(&Debug,
! "charset_ok_p: charset %p (%s) is not superset of ascii %p (%s) but is type cs_ascii (type = %p), returning OK\n",
! ptr,
! ptr->MIME_name ? ptr->MIME_name :"<no MIME name>",
! ascii_ptr,

! ascii_ptr->MIME_name ? ascii_ptr->MIME_name :"<no MIME name>"));
! r = 1;
! }
!

! return r;
}

struct locale_map_item * load_locale_map(filename,errors)

! const char *filename;
int *errors;

{
struct locale_map_item *result;
***************
*** 1420,1426 ****
if(err) {
DPRINT(Debug,2,(&Debug,
"load_locale_map: %s: %s (can_open)\n",
! filename,error_description(err)));
return NULL;
}

--- 1520,1526 ----
if(err) {
DPRINT(Debug,2,(&Debug,
"load_locale_map: %s: %s (can_open)\n",
! filename,strerror(err)));
return NULL;

}

***************
*** 1429,1435 ****
int err = errno;

DPRINT(Debug,2,(&Debug,
"load_locale_map: %s: %s\n",
! filename,error_description(err)));
return NULL;
}

--- 1529,1535 ----
int err = errno;
DPRINT(Debug,2,(&Debug,
"load_locale_map: %s: %s\n",
! filename,strerror(err)));
return NULL;
}

***************
*** 1749,1755 ****
/* Used to get charset argument */
int mime_get_param (name, value, opts, size)
char *value;
! CONST char *opts, *name;
int size;
{
char *c, tmp[VERY_LONG_STRING];
--- 1849,1855 ----
/* Used to get charset argument */
int mime_get_param (name, value, opts, size)
char *value;
! const char *opts, *name;
int size;
{
char *c, tmp[VERY_LONG_STRING];
Index: elmME+.2.5.alpha5-cvs/lib/cs_binary.c
*** elmME+.2.5.alpha4/lib/cs_binary.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/cs_binary.c 2005-07-26 11:28:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_binary.c,v 1.42.8.1 2004/04/18 16:55:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: cs_binary.c,v 1.42.8.4 2005/07/26 08:28:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 37,48 ****
extern int errno;
#endif


- static unsigned char *s2us P_((char *str));
- static unsigned char *s2us(str)

- char *str;
- {


- return (unsigned char *)str;
- }

/* bindata ---------------------------------------------------------------- */

--- 37,42 ----
***************

*** 216,224 ****
unsigned int val;
int *found;
{
- unsigned char c;
- int i;
-
*found = 0;

if (val < 128) {
--- 210,215 ----
***************
*** 245,255 ****
static set_map_callmap set_asciimap_value;
#endif
static int set_asciimap_value(name,map_info,l1,l2,fn)
! CONST char *name;
struct map_info *map_info;
long l1;
long l2;
! CONST char *fn;
{
if (map_info -> map_type != &cs_ascii)
panic("STRING PANIC",__FILE__,__LINE__,"set_asciimap_value",
--- 236,246 ----
static set_map_callmap set_asciimap_value;
#endif
static int set_asciimap_value(name,map_info,l1,l2,fn)
! const char *name;
struct map_info *map_info;
long l1;
long l2;
! const char *fn;
{
if (map_info -> map_type != &cs_ascii)
panic("STRING PANIC",__FILE__,__LINE__,"set_asciimap_value",
***************
*** 284,294 ****
return 1;
}

! static void add_text_to_asciimap P_((CONST char *name,
struct map_info *map,
FILE *F, char *fn));
static void add_text_to_asciimap(name,map,F,fn)
! CONST char *name;
struct map_info *map;
FILE *F;
char *fn;
--- 275,285 ----
return 1;
}

! static void add_text_to_asciimap P_((const char *name,
struct map_info *map,
FILE *F, char *fn));
static void add_text_to_asciimap(name,map,F,fn)
! const char *name;
struct map_info *map;
FILE *F;
char *fn;
***************
*** 319,325 ****

static struct map_info * open_asciimap P_((const char *name));
static struct map_info * open_asciimap(name)
! CONST char *name;
{
struct map_info *ret = NULL;
char *fn = NULL;
--- 310,316 ----

static struct map_info * open_asciimap P_((const char *name));
static struct map_info * open_asciimap(name)
! const char *name;
{
struct map_info *ret = NULL;
char *fn = NULL;
***************
*** 396,402 ****


struct map_info map_ascii = {
! &cs_ascii, "US-ASCII", 0, map_init_us_ascii, NULL, NULL, &ascii_ops };

/* ISO-8859-1 ------------------------------------------------------------ */

--- 387,394 ----


struct map_info map_ascii = {
! &cs_ascii, "US-ASCII", 0, map_init_us_ascii, { NULL }, { NULL },
! { &ascii_ops } };

/* ISO-8859-1 ------------------------------------------------------------ */

***************
*** 419,425 ****
}

struct map_info map_latin1 = {
! &cs_ascii, "ISO-8859-1", 0, map_init_latin1, NULL, NULL, &ascii_ops };


/* KOI8-R ------------------------------------------------------------ */
--- 411,418 ----
}

struct map_info map_latin1 = {
! &cs_ascii, "ISO-8859-1", 0, map_init_latin1, { NULL }, { NULL },
! { &ascii_ops } };


/* KOI8-R ------------------------------------------------------------ */
***************
*** 465,471 ****
}

struct map_info map_koi8r = {
! &cs_ascii, "KOI8-R", 0, map_init_koi8r, NULL, NULL, &ascii_ops };

/* KOI8-U ------------------------------------------------------------ */

--- 458,465 ----
}

struct map_info map_koi8r = {
! &cs_ascii, "KOI8-R", 0, map_init_koi8r, { NULL }, { NULL },
! { &ascii_ops } };

/* KOI8-U ------------------------------------------------------------ */

***************
*** 519,525 ****
}

struct map_info map_koi8u = {
! &cs_ascii, "KOI8-U", 0, map_init_koi8u, NULL, NULL, &ascii_ops };

/* CP1251 ------------------------------------------------------------ */

--- 513,520 ----
}

struct map_info map_koi8u = {
! &cs_ascii, "KOI8-U", 0, map_init_koi8u, { NULL }, { NULL},
! { &ascii_ops } };

/* CP1251 ------------------------------------------------------------ */

***************
*** 563,569 ****
}

struct map_info map_cp1251 = {
! &cs_ascii, "CP1251", 0, map_init_cp1251, NULL, NULL, &ascii_ops };

/* CP1252 ------------------------------------------------------------ */

--- 558,565 ----
}

struct map_info map_cp1251 = {
! &cs_ascii, "CP1251", 0, map_init_cp1251, { NULL }, { NULL },
! { &ascii_ops } };

/* CP1252 ------------------------------------------------------------ */

***************
*** 616,622 ****
}

struct map_info map_cp1252 = { &cs_ascii, "CP1252", 0,
! map_init_cp1252, NULL, NULL, &ascii_ops };


/* ISO-8859-15 ---------------------------------------------------------- */
--- 612,619 ----
}

struct map_info map_cp1252 = { &cs_ascii, "CP1252", 0,
! map_init_cp1252, { NULL }, { NULL },
! { &ascii_ops } };


/* ISO-8859-15 ---------------------------------------------------------- */
***************
*** 660,666 ****


struct map_info map_885915 = { &cs_ascii, "ISO-8859-15", 0, map_init_885915,
! NULL, NULL, &ascii_ops };

/* bytemap --------------------------------------------------------------- */

--- 657,663 ----


struct map_info map_885915 = { &cs_ascii, "ISO-8859-15", 0, map_init_885915,
! { NULL }, { NULL }, { &ascii_ops } };

/* bytemap --------------------------------------------------------------- */

***************
*** 774,782 ****
unsigned int val;
int * found;
{
- unsigned char c;
- int i;
-
if (&cs_onebyte != map->map_type)
panic("STRING PANIC",__FILE__,__LINE__," cs_map_bytemap_rev",
"Bad maptype",0);
--- 771,776 ----
***************
*** 789,799 ****
static set_map_callmap set_bytemap_value;
#endif
static int set_bytemap_value(name,map_info,l1,l2,fn)
! CONST char *name;
struct map_info *map_info;
long l1;
long l2;
! CONST char *fn;
{
if (map_info -> map_type != &cs_onebyte)
panic("STRING PANIC",__FILE__,__LINE__,"set_bytemap_value",
--- 783,793 ----
static set_map_callmap set_bytemap_value;
#endif
static int set_bytemap_value(name,map_info,l1,l2,fn)
! const char *name;
struct map_info *map_info;
long l1;
long l2;
! const char *fn;
{
if (map_info -> map_type != &cs_onebyte)
panic("STRING PANIC",__FILE__,__LINE__,"set_bytemap_value",
***************
*** 818,828 ****
return 1;
}

! static void add_text_to_bytemap P_((CONST char *name,
struct map_info *map,
FILE *F, char *fn));
static void add_text_to_bytemap(name,map,F,fn)
! CONST char *name;
struct map_info *map;
FILE *F;
char *fn;
--- 812,822 ----
return 1;
}

! static void add_text_to_bytemap P_((const char *name,
struct map_info *map,
FILE *F, char *fn));
static void add_text_to_bytemap(name,map,F,fn)
! const char *name;
struct map_info *map;
FILE *F;
char *fn;
***************
*** 862,868 ****

static struct map_info * open_bytemap P_((const char *name));
static struct map_info * open_bytemap(name)
! CONST char *name;
{
struct map_info *ret = NULL;
char *fn = NULL;
--- 856,862 ----

static struct map_info * open_bytemap P_((const char *name));
static struct map_info * open_bytemap(name)
! const char *name;
{
struct map_info *ret = NULL;
char *fn = NULL;
***************
*** 1021,1027 ****


struct map_info map_invariant = { &cs_iso646, "INVARIANT", 0,
! map_init_invariant, NULL, NULL, NULL };

/* ----------------------------------------------------------------------- */

--- 1015,1022 ----


struct map_info map_invariant = { &cs_iso646, "INVARIANT", 0,
! map_init_invariant, { NULL } , { NULL },
! { NULL } };

/* ----------------------------------------------------------------------- */

***************
*** 1144,1149 ****
--- 1139,1145 ----



/* ======================================================================== */

+
static void cs_init_binary P_((struct string *str));
static void cs_init_binary(str)
struct string *str;
***************

*** 1252,1263 ****


/* Returns number of bytes added */

static int cs_add_streambytes_to_binary P_((struct string *str,

int count,
! const unsigned char *data));

! static int cs_add_streambytes_to_binary(str,count,data)


struct string *str;
int count;
! CONST unsigned char *data;
{

int i;

--- 1248,1261 ----


/* Returns number of bytes added */

static int cs_add_streambytes_to_binary P_((struct string *str,

int count,
! const unsigned char *data,
! int *errors));

! static int cs_add_streambytes_to_binary(str,count,data, errors)


struct string *str;
int count;
! const unsigned char *data;
! int *errors;
{

int i;

***************
*** 1265,1270 ****

--- 1263,1270 ----


panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",
"Negative length",0);

+ *errors = 0;
+
if (count > 0) {

/* realloc with size 0 is equivalent of free and may

corrupt memory ...
***************
*** 1283,1289 ****
const struct string *data));
static void cs_add_intdata_to_binary(str,data)


struct string *str;
! CONST struct string *data;
{

int i;

--- 1283,1289 ----
const struct string *data));
static void cs_add_intdata_to_binary(str,data)


struct string *str;
! const struct string *data;
{

int i;

***************
*** 1337,1343 ****
*/
static void cs_check_length_binary P_((const struct string *str));
static void cs_check_length_binary(str)


! CONST struct string *str;

{
/* No compression */
}
--- 1337,1343 ----
*/
static void cs_check_length_binary P_((const struct string *str));
static void cs_check_length_binary(str)


! const struct string *str;

{
/* No compression */
}
***************
*** 1345,1351 ****
static uint16 cs_give_unicode_from_bytemap P_((const struct string *str,
int pos, int *found));
static uint16 cs_give_unicode_from_bytemap(str,pos, found)


! CONST struct string *str;

int pos;
int *found;
{
--- 1345,1351 ----
static uint16 cs_give_unicode_from_bytemap P_((const struct string *str,
int pos, int *found));
static uint16 cs_give_unicode_from_bytemap(str,pos, found)


! const struct string *str;

int pos;
int *found;
{
***************

*** 1398,1404 ****
static uint16 cs_give_unicode_from_ascii P_((const struct string *str,
int pos, int *found));
static uint16 cs_give_unicode_from_ascii(str,pos, found)


! CONST struct string *str;

int pos;
int *found;
{
--- 1398,1404 ----
static uint16 cs_give_unicode_from_ascii P_((const struct string *str,
int pos, int *found));
static uint16 cs_give_unicode_from_ascii(str,pos, found)


! const struct string *str;

int pos;
int *found;
{
***************

*** 1424,1496 ****


return cs_unicode_ascii_helper(ch,st->charset,found);
}

- static uint16 cs_unicode_unknown_helper P_((unsigned int ch,
- charset_t set, int *found));
- static uint16 cs_unicode_unknown_helper(ch,set, found)
- unsigned int ch;
- charset_t set;

- int *found;
- {


- *found = 0;
-

- /* We assume that values < 32 are same control characters
- * on all sets -- after all MIME requires that on all
- * character sets characters CR and LF are on same position
- */
-

- /* If charset is system character set then assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
- if (set == system_charset) {
- uint16 val = map_fallback(ch);
- if (val != MAPPING_NONE) {
- *found = 1;
- return val;

- }
- }
-

- if (ch < 32) {
- *found = 1;
- return ch;
- }

- return 0x003F; /* '?' */
-
- }
-

- static uint16 cs_give_unicode_from_unknown P_((const struct string *str,
- int pos, int *found));
- static uint16 cs_give_unicode_from_unknown(str,pos,found)
- CONST struct string *str;
- int pos;

- int *found;
- {


- unsigned char ch;
-
- if (pos < 0 || pos >= str->p->len)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_give_unicode_from_unknown",
- "Index out of array",0);
-
- ch = str->p->a.bytes[pos];
- return cs_unicode_unknown_helper(ch,str->string_type,found);
- }
-
- static uint16 cs_give_unicode_from_s_unknown P_((struct charset_state *st,
- int *found));
- static uint16 cs_give_unicode_from_s_unknown(st,found)
- struct charset_state *st;

- int *found;
- {


- unsigned char ch;
-

- ch = st->p->a.byte;
- return cs_unicode_unknown_helper(ch,st->charset,found);
- }

static uint16 cs_give_unicode_from_iso646 P_((const struct string *str,
int pos, int *found));
static uint16 cs_give_unicode_from_iso646(str,pos, found)


! CONST struct string *str;

int pos;
int *found;
{
--- 1424,1434 ----
return cs_unicode_ascii_helper(ch,st->charset,found);
}


static uint16 cs_give_unicode_from_iso646 P_((const struct string *str,
int pos, int *found));
static uint16 cs_give_unicode_from_iso646(str,pos, found)


! const struct string *str;

int pos;
int *found;
{
***************

*** 1538,1544 ****
static void cs_add_unicodedata_to_bytemap(str,len,data)


struct string *str;
int len;
! CONST uint16 *data;
{

int i;

--- 1476,1482 ----
static void cs_add_unicodedata_to_bytemap(str,len,data)


struct string *str;
int len;
! const uint16 *data;
{

int i;

***************
*** 1592,1598 ****
static void cs_add_unicodedata_to_ascii(str,len,data)


struct string *str;
int len;
! CONST uint16 *data;
{

int i;

--- 1530,1536 ----
static void cs_add_unicodedata_to_ascii(str,len,data)


struct string *str;
int len;
! const uint16 *data;
{

int i;

***************
*** 1629,1695 ****


}
}

- static void cs_add_unicodedata_to_unknown P_((struct string *str,
- int len, const uint16 *data));
- static void cs_add_unicodedata_to_unknown(str,len,data)
- struct string *str;
- int len;
- CONST uint16 *data;
- {

- int i;
-
- if (len > 0) {
- /* realloc with size 0 is equivalent of free and may
- corrupt memory ...
- */
-
- /* NOTE: str->p->a.bytes is not NUL terminated */
- str->p->a.bytes = safe_realloc(str->p->a.bytes,len+str->p->len);
-

- for (i = 0; i < len; i++) {
- unsigned char ch = 0;
- int found = 0;
-

- /* If charset is system character set assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
-

- if (str->string_type == system_charset) {

- ch = map_fallback_rev(data[i],&found);
- if (found)
- str->p->a.bytes[str->p->len++] = ch;
- }
-
- /* We assume that values < 32 are same control characters
- * on all sets -- after all MIME requires that on all
- * character sets characters CR and LF are on same position
- */
-

- if (!found && data[i] < 32)
- str->p->a.bytes[str->p->len++] = data[i];
-
- /* Because character set is unknow we do not know any
- * replacement character what we can use, therefore
- * we add nothing.
- *
- * If however map_fallback_rev() is given replacement character
- * we use it.
- */
-

- else if (ch && !found)
- str->p->a.bytes[str->p->len++] = ch;


-
- }
- }
- }
-

static void cs_add_unicodedata_to_iso646 P_((struct string *str,


int len, const uint16 *data));

static void cs_add_unicodedata_to_iso646(str,len,data)


struct string *str;
int len;
! CONST uint16 *data;
{

int i;

--- 1567,1578 ----
}
}

static void cs_add_unicodedata_to_iso646 P_((struct string *str,


int len, const uint16 *data));

static void cs_add_unicodedata_to_iso646(str,len,data)


struct string *str;
int len;
! const uint16 *data;
{

int i;

***************
*** 1714,1723 ****
}
}

! static int cs_cmp_binary P_((struct string *str1,struct string *str2));
static int cs_cmp_binary(str1,str2)


! struct string *str1;
! struct string *str2;
{
int i;

--- 1597,1606 ----
}
}

! static int cs_cmp_binary P_((const struct string *str1,const struct string *str2));
static int cs_cmp_binary(str1,str2)


! const struct string *str1;
! const struct string *str2;
{
int i;

***************

*** 1741,1750 ****


}

#ifndef ASCII_CTYPE
! static unsigned char *cs_stream_from_locale P_((const struct string *str,
! int *reslen));
! static unsigned char *cs_stream_from_locale(str,reslen)

! CONST struct string *str;

int *reslen;
{
unsigned char * ret;
--- 1624,1633 ----


}

#ifndef ASCII_CTYPE
! unsigned char *cs_stream_from_locale P_((const struct string *str,
! int *reslen));
! unsigned char *cs_stream_from_locale(str,reslen)

! const struct string *str;

int *reslen;
{
unsigned char * ret;
***************
*** 1763,1770 ****
return ret;
}


! static int cs_s_locale_printable P_((struct charset_state *st));
! static int cs_s_locale_printable(st)
struct charset_state *st;
{

unsigned char c1 = st->p->a.byte;

--- 1646,1653 ----


return ret;
}

! int cs_s_locale_printable P_((struct charset_state *st));
! int cs_s_locale_printable(st)
struct charset_state *st;
{

unsigned char c1 = st->p->a.byte;

***************
*** 1799,1805 ****
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_bytemap(str,printable,terminal,reslen)


! CONST struct string *str;

int printable;


screen_info_p terminal; /* NOT USED */

int *reslen;
--- 1682,1688 ----
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_bytemap(str,printable,terminal,reslen)


! const struct string *str;

int printable;


screen_info_p terminal; /* NOT USED */

int *reslen;
***************
*** 1857,1863 ****
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_ascii(str,printable,terminal,reslen)


! CONST struct string *str;

int printable;


screen_info_p terminal; /* NOT USED */

int *reslen;
--- 1740,1746 ----
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_ascii(str,printable,terminal,reslen)


! const struct string *str;

int printable;


screen_info_p terminal; /* NOT USED */

int *reslen;
***************
*** 1898,1904 ****
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_iso646(str,printable,terminal,reslen)


! CONST struct string *str;

int printable;


screen_info_p terminal; /* NOT USED */

int *reslen;
--- 1781,1787 ----
screen_info_p terminal,
int *reslen));
static unsigned char *cs_stream_from_iso646(str,printable,terminal,reslen)


! const struct string *str;

int printable;


screen_info_p terminal; /* NOT USED */

int *reslen;
***************
*** 1936,1945 ****
}

#ifndef ASCII_CTYPE


! static unsigned char *cs_streamclip_from_locale P_((const struct string *str,
! int *pos, int len));
! static unsigned char *cs_streamclip_from_locale(str,pos,len)

! CONST struct string *str;

int *pos;
int len;
{
--- 1819,1826 ----


}

#ifndef ASCII_CTYPE
! unsigned char *cs_streamclip_from_locale(str,pos,len)

! const struct string *str;

int *pos;
int len;
{
***************

*** 1966,1972 ****


screen_info_p terminal,
struct cs_printable_len *printable_len));

static unsigned char *cs_streamclip_from_bytemap(str,pos,len,terminal,printable_len)


! CONST struct string *str;

int *pos;
int len;
screen_info_p terminal; /* NOT USED */

--- 1847,1853 ----


screen_info_p terminal,
struct cs_printable_len *printable_len));

static unsigned char *cs_streamclip_from_bytemap(str,pos,len,terminal,printable_len)


! const struct string *str;

int *pos;
int len;
screen_info_p terminal; /* NOT USED */
***************

*** 2022,2028 ****


screen_info_p terminal,
struct cs_printable_len *printable_len));

static unsigned char *cs_streamclip_from_ascii(str,pos,len,terminal,printable_len)


! CONST struct string *str;

int *pos;
int len;
screen_info_p terminal; /* NOT USED */

--- 1903,1909 ----


screen_info_p terminal,
struct cs_printable_len *printable_len));

static unsigned char *cs_streamclip_from_ascii(str,pos,len,terminal,printable_len)


! const struct string *str;

int *pos;
int len;
screen_info_p terminal; /* NOT USED */
***************

*** 2067,2203 ****
return ret;
}


- static unsigned char *cs_stream_from_unknown P_((const struct string *str,
- int printable,
- screen_info_p terminal,
- int *reslen));
- static unsigned char *cs_stream_from_unknown(str,printable,terminal,reslen)
- CONST struct string *str;
- int printable;
- screen_info_p terminal; /* NOT USED */
- int *reslen;
- {
- unsigned char * ret;
-
- #ifndef ASCII_CTYPE
- if (printable &&
- str->string_type == system_charset)
- return cs_stream_from_locale(str,reslen);
- #endif
-
- if (!printable) {
- int l = 0,i;
-

- ret = safe_malloc(str->p->len+1);
-

- for (i = 0; i < str->p->len; i++)
- ret[l++] = str->p->a.bytes[i];
- ret[l] = '\0';
- *reslen = l;
-

- } else if (str->string_type == system_charset) {


- int l = 0,i;

- ret = safe_malloc(str->p->len+1);
-
- /* If charset is system character set assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
-

- for (i = 0; i < str->p->len; i++) {

- uint16 val = map_fallback(str->p->a.bytes[i]);
-
- if (val != MAPPING_NONE &&
- val >= 0x0020)
- ret[l++] = str->p->a.bytes[i];
- else
- ret[l++] = '?'; /* See above ... */
- }
- ret[l] = '\0';
- *reslen = l;
-
- } else {

- /* Because charset is unknown we do not have able to print
- * printable characters -- also we do not know replacement
- * characters...
- */
-

- ret = s2us(safe_strdup(""));

- *reslen = 0;
- }
-
- return ret;
- }
-
-

- static unsigned char *cs_streamclip_from_unknown P_((const struct string *str,
- int *pos, int len,
- screen_info_p terminal,
- struct cs_printable_len *printable_len));
- static unsigned char *cs_streamclip_from_unknown(str,pos,len,terminal,printable_len)
- CONST struct string *str;
- int *pos;
- int len;
- screen_info_p terminal; /* NOT USED */
- struct cs_printable_len *printable_len; /* NOT USED */
- {

- unsigned char * ret;
-

- if (*pos < 0)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
- "Index out of array",0);
-
- if (len < 0)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_UNKNOWN",
- "Negative size",0);
-
- #ifndef ASCII_CTYPE
- if (str->string_type == system_charset)
- return cs_streamclip_from_locale(str,pos,len);
- #endif
-

- if (str->string_type == system_charset) {
- int l = 0,i;
- ret = safe_malloc(len+1);
-
- /* If charset is system character set then assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
-
- for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {
- uint16 val = map_fallback(str->p->a.bytes[*pos]);


-
- if (val != MAPPING_NONE &&
- val >= 0x0020)

- ret[l++] = str->p->a.bytes[*pos];


- else
- ret[l++] = '?'; /* See above ... */
- }

- ret[l] = '\0';
-
- } else {
-

- ret = s2us(safe_strdup(""));

- /* Because charset is unknown we do not have able to print
- * printable characters -- also we not know replacement
- * characters...
- */
-
- /* Indicate that we are 'clipped' whole string */
- if (*pos < str->p->len)
- *pos = str->p->len;


-
- }
- return ret;
- }
-

static unsigned char *cs_streamclip_from_iso646 P_((const struct string *str,
int *pos, int len,


screen_info_p terminal,
struct cs_printable_len *printable_len));

static unsigned char *cs_streamclip_from_iso646(str,pos,len,terminal,printable_len)


! CONST struct string *str;

int *pos;
int len;
screen_info_p terminal; /* NOT USED */

--- 1948,1959 ----
return ret;
}

static unsigned char *cs_streamclip_from_iso646 P_((const struct string *str,
int *pos, int len,


screen_info_p terminal,
struct cs_printable_len *printable_len));

static unsigned char *cs_streamclip_from_iso646(str,pos,len,terminal,printable_len)


! const struct string *str;

int *pos;
int len;
screen_info_p terminal; /* NOT USED */
***************

*** 2241,2247 ****

static void cs_clip_from_binary(ret,str,pos,len)
struct string *ret;


! CONST struct string *str;

int *pos;
int len;
{
--- 1997,2003 ----

static void cs_clip_from_binary(ret,str,pos,len)
struct string *ret;


! const struct string *str;

int *pos;
int len;
{
***************

*** 2284,2290 ****

static int cs_can_ascii_bytemap P_((const struct string *str));
static int cs_can_ascii_bytemap(str)


! CONST struct string *str;

{
if (str->string_type->map_info) {
int i;
--- 2040,2046 ----

static int cs_can_ascii_bytemap P_((const struct string *str));
static int cs_can_ascii_bytemap(str)


! const struct string *str;

{
if (str->string_type->map_info) {
int i;
***************
*** 2307,2313 ****

static int cs_can_ascii_ascii P_((const struct string *str));
static int cs_can_ascii_ascii(str)


! CONST struct string *str;

{
int i;

--- 2063,2069 ----

static int cs_can_ascii_ascii P_((const struct string *str));
static int cs_can_ascii_ascii(str)


! const struct string *str;

{
int i;

***************
*** 2319,2351 ****


return 1;
}

- static int cs_can_ascii_unknown P_((const struct string *str));
- static int cs_can_ascii_unknown(str)
- CONST struct string *str;
- {
-

- if (str->string_type == system_charset) {
- int i;
- /* If charset is system character set then assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
-

- for (i = 0; i < str->p->len; i++) {

- uint16 val = map_fallback(str->p->a.bytes[i]);
-
- /* MAPPING_NONE is > 127 */
- if (val > 127)
- return 0;
- }
- return 1;


- } else
- return 0;

- }

static int cs_can_ascii_iso646 P_((const struct string *str));
static int cs_can_ascii_iso646(str)


! CONST struct string *str;

{
int i;

--- 2075,2084 ----
return 1;
}


static int cs_can_ascii_iso646 P_((const struct string *str));
static int cs_can_ascii_iso646(str)


! const struct string *str;

{
int i;

***************
*** 2362,2379 ****


}

#ifndef ASCII_CTYPE
- static int cs_find_pattern_from_locale P_((const struct string *str,
- const struct string *pattern));

! static int cs_find_pattern_from_locale(str,pattern)

! CONST struct string *str;

! CONST struct string *pattern;
{

int ret = 0;
int i, j;



for (i = 0; i < str->p->len; ) {
! CONST int s = i + 1;

for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {

unsigned char c2 = pattern->p->a.bytes[j];

--- 2095,2110 ----


}

#ifndef ASCII_CTYPE

! int cs_find_pattern_from_locale(str,pattern)

! const struct string *str;

! const struct string *pattern;
{

int ret = 0;
int i, j;



for (i = 0; i < str->p->len; ) {
! const int s = i + 1;

for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {

unsigned char c2 = pattern->p->a.bytes[j];

***************
*** 2410,2417 ****


const struct string *pattern,
int ignore_case));

static int cs_find_pattern_from_bytemap(str,pattern,ignore_case)


! CONST struct string *str;

! CONST struct string *pattern;
int ignore_case;
{

if (pattern->string_type != str->string_type)
--- 2141,2148 ----


const struct string *pattern,
int ignore_case));

static int cs_find_pattern_from_bytemap(str,pattern,ignore_case)


! const struct string *str;

! const struct string *pattern;
int ignore_case;
{

if (pattern->string_type != str->string_type)
***************
*** 2431,2438 ****
int ignore_case));

static int cs_find_pattern_from_ascii(str,pattern,ignore_case)


! CONST struct string *str;

! CONST struct string *pattern;
int ignore_case;
{
int ret = 0;

--- 2162,2169 ----
int ignore_case));

static int cs_find_pattern_from_ascii(str,pattern,ignore_case)


! const struct string *str;

! const struct string *pattern;
int ignore_case;
{
int ret = 0;
***************

*** 2449,2455 ****
#endif



for (i = 0; i < str->p->len; ) {
! CONST int s = i + 1;

for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {

unsigned char c2 = pattern->p->a.bytes[j];

--- 2180,2186 ----
#endif



for (i = 0; i < str->p->len; ) {
! const int s = i + 1;

for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {

unsigned char c2 = pattern->p->a.bytes[j];

***************
*** 2490,2547 ****


}
return ret;
}
-
- static int cs_find_pattern_from_unknown P_((const struct string *str,
- const struct string *pattern,
- int ignore_case));
-
- static int cs_find_pattern_from_unknown(str,pattern,ignore_case)
- CONST struct string *str;
- CONST struct string *pattern;
- int ignore_case;

- {
- int ret = 0;

- int i, j;
-

- if (pattern->string_type->charset_type !=
- str->string_type->charset_type)
- panic("STRING PANIC",__FILE__,__LINE__,"cs_find_pattern_from_unknown",
- "String type mismatch",0);
-
- #ifndef ASCII_CTYPE
- if (ignore_case && str->string_type == system_charset)
- return cs_find_pattern_from_locale(str,pattern);
- #endif

-

- for (i = 0; i < str->p->len; ) {
- CONST int s = i + 1;
-
- for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {
- unsigned char c2 = pattern->p->a.bytes[j];
- unsigned char c1 = str->p->a.bytes[i];
-
- /* We can not convert characters lowercase because
- * charset is unknown

- */
-
- if (c1 != c2)
- break;
- }
- if (j >= pattern->p->len) {
- ret = 1;
- break;
- }
- i = s;


- }
- return ret;
- }
-

static int cs_find_pattern_from_iso646 P_((const struct string *str,

const struct string *pattern,
int ignore_case));

static int cs_find_pattern_from_iso646(str,pattern,ignore_case)


! CONST struct string *str;

! CONST struct string *pattern;
int ignore_case;
{
int ret = 0;

--- 2221,2232 ----
}
return ret;


}
static int cs_find_pattern_from_iso646 P_((const struct string *str,

const struct string *pattern,
int ignore_case));

static int cs_find_pattern_from_iso646(str,pattern,ignore_case)


! const struct string *str;

! const struct string *pattern;
int ignore_case;
{
int ret = 0;
***************

*** 2558,2564 ****
#endif



for (i = 0; i < str->p->len; ) {
! CONST int s = i + 1;

for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {

--- 2243,2249 ----
#endif



for (i = 0; i < str->p->len; ) {
! const int s = i + 1;

for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {

***************
*** 2598,2607 ****
}

#ifndef ASCII_CTYPE


! static void cs_remove_control_locale P_((const struct string *str,
! unsigned int repl));
! static void cs_remove_control_locale(str,repl)

! CONST struct string *str;

unsigned int repl;
{
int i;
--- 2283,2290 ----


}

#ifndef ASCII_CTYPE
! void cs_remove_control_locale(str,repl)

! const struct string *str;

unsigned int repl;
{
int i;
***************
*** 2614,2659 ****



#endif

- static void cs_remove_control_unknown P_((const struct string *str));
- static void cs_remove_control_unknown(str)
- CONST struct string *str;
- {

- int i;
-

- #ifndef ASCII_CTYPE
- if (str->string_type == system_charset) {
- cs_remove_control_locale(str,' ');
- return;
- }
- #endif

-

- for (i = 0; i < str->p->len; i++) {

- /* We assume that values < 32 are same control characters
- * on all sets -- after all MIME requires that on all
- * character sets characters CR and LF are on same position
- */
-
-

- if (str->p->a.bytes[i] < 32) {
- if (str->string_type == system_charset)
- /* If charset is system character set then assume that
- * invariant part is on same position than on character
- * set used by code (ie compiler)
- */
- str->p->a.bytes[i] = ' ';
-
- else
- /* We HOPE that 32 is printable character... */
- str->p->a.bytes[i] = 32;


- }
- }
-
- }
-

static void cs_remove_control_ascii P_((const struct string *str));
static void cs_remove_control_ascii(str)


! CONST struct string *str;

{
int i;

--- 2297,2306 ----

#endif


static void cs_remove_control_ascii P_((const struct string *str));
static void cs_remove_control_ascii(str)


! const struct string *str;

{
int i;

***************
*** 2684,2690 ****

static void cs_remove_control_bytemap P_((const struct string *str));
static void cs_remove_control_bytemap(str)


! CONST struct string *str;

{
int i;
int found;
--- 2331,2337 ----

static void cs_remove_control_bytemap P_((const struct string *str));
static void cs_remove_control_bytemap(str)


! const struct string *str;

{
int i;
int found;
***************
*** 2723,2729 ****

static void cs_remove_control_iso646 P_((const struct string *str));
static void cs_remove_control_iso646(str)


! CONST struct string *str;

{
int i;
for (i = 0; i < str->p->len; i++) {

--- 2370,2376 ----

static void cs_remove_control_iso646 P_((const struct string *str));
static void cs_remove_control_iso646(str)


! const struct string *str;

{
int i;
for (i = 0; i < str->p->len; i++) {
***************

*** 2740,2746 ****

static struct map_info * cs_find_bytemap P_((const char * map_name));
static struct map_info * cs_find_bytemap(map_name)


! CONST char * map_name;
{
int i;
struct map_info *ret;

--- 2387,2393 ----

static struct map_info * cs_find_bytemap P_((const char * map_name));
static struct map_info * cs_find_bytemap(map_name)


! const char * map_name;
{
int i;
struct map_info *ret;
***************

*** 2761,2767 ****

static struct map_info * cs_find_ascii P_((const char * map_name));
static struct map_info * cs_find_ascii(map_name)


! CONST char * map_name;
{

struct map_info *ret;

--- 2408,2414 ----

static struct map_info * cs_find_ascii P_((const char * map_name));
static struct map_info * cs_find_ascii(map_name)


! const char * map_name;
{

struct map_info *ret;

***************
*** 2791,2806 ****
return ret;
}


- static struct map_info * cs_find_unknown P_((const char * map_name));
- static struct map_info * cs_find_unknown(map_name)
- CONST char * map_name;

- {
- return NULL;
- }

static struct map_info * cs_find_iso646 P_((const char * map_name));
static struct map_info * cs_find_iso646(map_name)


! CONST char * map_name;
{

int vector[12];
char * str, *p;
--- 2438,2447 ----
return ret;
}


static struct map_info * cs_find_iso646 P_((const char * map_name));
static struct map_info * cs_find_iso646(map_name)


! const char * map_name;
{

int vector[12];
char * str, *p;
***************
*** 2935,2941 ****



S_(cs_estimate_clip_string cs_estimate_clip_unsupported)
static int cs_estimate_clip_unsupported(str,pos,len,terminal,printable_len)

! CONST struct string *str;

int pos;
int len; /* UPPER LIMIT */
screen_info_p terminal;

--- 2576,2582 ----



S_(cs_estimate_clip_string cs_estimate_clip_unsupported)
static int cs_estimate_clip_unsupported(str,pos,len,terminal,printable_len)

! const struct string *str;

int pos;
int len; /* UPPER LIMIT */
screen_info_p terminal;

***************
*** 2989,2994 ****
--- 2630,2639 ----
return 0; /* Discard bank defination */


}
break;
+
+ default:
+ break;

+
}

if (new_setlist->sets[i]->bank >= 0 &&
***************
*** 3043,3048 ****
--- 2688,2695 ----
"Charset type %s does not allow multibyte bank specifications."),
new_vals->charset_type->type_name);
return 0;


+ default:
+ break;
}
}

***************

*** 3092,3097 ****
--- 2739,2746 ----
"Charset type %s does not allow multibyte bank specifications."),
new_vals->charset_type->type_name);
return 0;


+ default:
+ break;
}
}

***************

*** 3101,3129 ****
return 0;
}

- static int cs_iso2022_info_set_unknown P_((struct charcode_info *new_vals,
- struct setlist *new_setlist,
- int setcount));
- static int cs_iso2022_info_set_unknown(new_vals, new_setlist,setcount)
- struct charcode_info *new_vals;
- struct setlist *new_setlist;
- int setcount;
- {
- int ptr_94 = -1;
- int ptr_96 = -1;
- int banks[ISO2022_BANK_NUM];
-
- if (!cs_info_set_scan(new_vals,new_setlist,setcount,&ptr_94,&ptr_96,
- banks)) {

- return 0;
- }
-

- new_vals->iso2022_info = loc_setlist(*new_setlist);
- new_vals->flags &= ~SET_nodata;

-
- return 1;
- }
-



--- 2750,2755 ----

/*
* Local Variables:
* mode:c

--- 2851,2856 ----
Index: elmME+.2.5.alpha5-cvs/lib/cs_fallback.c
*** elmME+.2.5.alpha4/lib/cs_fallback.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/cs_fallback.c 2005-07-20 19:49:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_fallback.c,v 1.6.8.1 2004/04/18 16:55:37 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: cs_fallback.c,v 1.6.8.2 2005/07/20 16:49:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 110,115 ****
--- 110,116 ----
static uint16 from_fallback_cs[256] = { 0 };

static int initialized = 0;

+ static void init_fallback P_((void));
static void init_fallback() {
int i;

Index: elmME+.2.5.alpha5-cvs/lib/cs_iso2022.c
*** elmME+.2.5.alpha4/lib/cs_iso2022.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/cs_iso2022.c 2005-07-26 11:28:37.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.35.8.2 2004/04/25 14:52:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: cs_iso2022.c,v 1.35.8.5 2005/07/26 08:28:37 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 43,49 ****

static struct map_info * open_iso2022_mapset P_((const char * map_name));
static struct map_info * open_iso2022_mapset(map_name)


! CONST char * map_name;
{

/* Indexes to iso2022_map_list[] */

--- 43,49 ----

static struct map_info * open_iso2022_mapset P_((const char * map_name));
static struct map_info * open_iso2022_mapset(map_name)


! const char * map_name;
{

/* Indexes to iso2022_map_list[] */



***************
*** 64,71 ****
break;
}
setlist[count] = find_iso2022_map_spec(X1);
! if (-1 == setlist[count])
return NULL;
count++;
}
free(X);
--- 64,73 ----
break;
}
setlist[count] = find_iso2022_map_spec(X1);
! if (-1 == setlist[count]) {
! free(X);
return NULL;
+ }
count++;
}
free(X);
***************

*** 91,97 ****

static struct map_info * open_euc_mapset P_((const char * map_name));
static struct map_info * open_euc_mapset(map_name)


! CONST char * map_name;
{

/* Indexes to iso2022_map_list[] */

--- 93,99 ----

static struct map_info * open_euc_mapset P_((const char * map_name));
static struct map_info * open_euc_mapset(map_name)


! const char * map_name;
{

/* Indexes to iso2022_map_list[] */

***************
*** 200,210 ****
}

struct map_info map_ISO2022_ascii = {
! &cs_iso2022, "US-ASCII", 0, map_init_ASCII, 0
};

struct map_info map_EUC_ascii = {
! &cs_euc, "US-ASCII", 0, map_init_ASCII, 0
};


--- 202,212 ----
}

struct map_info map_ISO2022_ascii = {
! &cs_iso2022, "US-ASCII", 0, map_init_ASCII, { NULL }, { NULL }, { NULL }
};

struct map_info map_EUC_ascii = {
! &cs_euc, "US-ASCII", 0, map_init_ASCII, { NULL }, { NULL }, { NULL }
};


***************
*** 233,243 ****
}

struct map_info map_ISO2022_ascii_latin1 = {
! &cs_iso2022, "ISO-8859-1", 0, map_init_ASCII_latin1, 0
};

struct map_info map_EUC_ascii_latin1 = {
! &cs_euc, "ISO-8859-1", 0, map_init_ASCII_latin1, 0
};

/* ====================================================================== */
--- 235,247 ----
}

struct map_info map_ISO2022_ascii_latin1 = {
! &cs_iso2022, "ISO-8859-1", 0, map_init_ASCII_latin1, { NULL }, { NULL },
! { NULL }
};

struct map_info map_EUC_ascii_latin1 = {
! &cs_euc, "ISO-8859-1", 0, map_init_ASCII_latin1, { NULL }, { NULL },
! { NULL }
};

/* ====================================================================== */
***************
*** 739,745 ****
if (X->raw_bytes_count > 1) {
unsigned char ch2;

! if (upper != X->raw_bytes[1] & 128) {
/* BAD */
goto add_control;
}
--- 743,749 ----
if (X->raw_bytes_count > 1) {
unsigned char ch2;

! if (upper != (X->raw_bytes[1] & 128)) {
/* BAD */
goto add_control;


}
***************
*** 1010,1017 ****
return 1;
}

- static int cs_add_streambyte_to_s_iso2022 P_((struct charset_state *str,
- int ch));
static void cs_soft_reset_s_iso2022_gen P_((struct charset_state *str));

S_(cs_add_streambyte_to_string cs_add_streambyte_to_iso2022_gen)

--- 1014,1019 ----
***************
*** 1078,1084 ****
S_(cs_add_intdata_to_string cs_add_intdata_to_iso2022_gen)
static void cs_add_intdata_to_iso2022_gen(str,data)


struct string *str;
! CONST struct string *data;
{

int i;
struct mb_data * X1 = str->p->a.data;
--- 1080,1086 ----
S_(cs_add_intdata_to_string cs_add_intdata_to_iso2022_gen)
static void cs_add_intdata_to_iso2022_gen(str,data)


struct string *str;
! const struct string *data;
{

int i;
struct mb_data * X1 = str->p->a.data;
***************
*** 1172,1178 ****
*/
S_(cs_check_length_string cs_check_length_iso2022_gen)
static void cs_check_length_iso2022_gen(str)


! CONST struct string *str;

{
int len = 0;

--- 1174,1180 ----
*/
S_(cs_check_length_string cs_check_length_iso2022_gen)
static void cs_check_length_iso2022_gen(str)


! const struct string *str;

{
int len = 0;

***************
*** 1229,1235 ****

S_(cs_give_unicode_from_string cs_give_unicode_from_iso2022_gen)
static uint16 cs_give_unicode_from_iso2022_gen(str,pos,found)


! CONST struct string *str;

int pos;
int *found;
{
--- 1231,1237 ----

S_(cs_give_unicode_from_string cs_give_unicode_from_iso2022_gen)
static uint16 cs_give_unicode_from_iso2022_gen(str,pos,found)


! const struct string *str;

int pos;
int *found;
{
***************

*** 1421,1427 ****
static void cs_add_unicodedata_to_iso2022_gen(str,len,data)


struct string *str;
int len;
! CONST uint16 *data;
{

int i;

--- 1423,1429 ----
static void cs_add_unicodedata_to_iso2022_gen(str,len,data)


struct string *str;
int len;
! const uint16 *data;
{

int i;

***************
*** 1439,1445 ****
*/

if (data[i] < 32 ||
! data[i] > 127 && data[i] < 160 ) {
struct mb_data_part * X3 = get_part(X1,-1,iso2022_other);

add_iso2022_word(X3, data[i]);
--- 1441,1448 ----
*/

if (data[i] < 32 ||
! (data[i] > 127 && data[i] < 160)
! ) {
struct mb_data_part * X3 = get_part(X1,-1,iso2022_other);

add_iso2022_word(X3, data[i]);


***************
*** 1499,1506 ****

S_(cs_cmp_string cs_cmp_iso2022_gen)
static int cs_cmp_iso2022_gen(str1,str2)

! struct string *str1;
! struct string *str2;
{

struct mb_data * X1 = str1->p->a.data;

struct mb_data * X2 = str1->p->a.data;
--- 1502,1509 ----



S_(cs_cmp_string cs_cmp_iso2022_gen)
static int cs_cmp_iso2022_gen(str1,str2)

! const struct string *str1;
! const struct string *str2;
{

struct mb_data * X1 = str1->p->a.data;

struct mb_data * X2 = str1->p->a.data;
***************
*** 2512,2518 ****

S_(cs_stream_from_string cs_stream_from_euc)
static unsigned char * cs_stream_from_euc(str,printable,terminal,reslen)


! CONST struct string *str;

int printable;
screen_info_p terminal;
int *reslen;

--- 2515,2521 ----

S_(cs_stream_from_string cs_stream_from_euc)
static unsigned char * cs_stream_from_euc(str,printable,terminal,reslen)


! const struct string *str;

int printable;
screen_info_p terminal;
int *reslen;
***************

*** 2651,2657 ****

S_(cs_stream_from_string cs_stream_from_iso2022)
static unsigned char * cs_stream_from_iso2022(str,printable,terminal,reslen)


! CONST struct string *str;

int printable;
screen_info_p terminal;
int *reslen;

--- 2654,2660 ----

S_(cs_stream_from_string cs_stream_from_iso2022)
static unsigned char * cs_stream_from_iso2022(str,printable,terminal,reslen)


! const struct string *str;

int printable;
screen_info_p terminal;
int *reslen;
***************

*** 2782,2788 ****

S_(cs_can_ascii_string cs_can_ascii_iso2022_gen)
static int cs_can_ascii_iso2022_gen(str)


! CONST struct string *str;

{
struct mb_data * X1 = str->p->a.data;
int i;
--- 2785,2791 ----

S_(cs_can_ascii_string cs_can_ascii_iso2022_gen)
static int cs_can_ascii_iso2022_gen(str)


! const struct string *str;

{
struct mb_data * X1 = str->p->a.data;
int i;
***************
*** 2911,2917 ****


/* Return number of characters consumed */

S_(cs_estimate_clip_string cs_estimate_clip_iso2022)
static int cs_estimate_clip_iso2022(str,pos,len,terminal,printable_len)


! CONST struct string *str;

int pos;
int len; /* UPPER LIMIT */
screen_info_p terminal;

--- 2914,2920 ----


/* Return number of characters consumed */

S_(cs_estimate_clip_string cs_estimate_clip_iso2022)
static int cs_estimate_clip_iso2022(str,pos,len,terminal,printable_len)


! const struct string *str;

int pos;
int len; /* UPPER LIMIT */
screen_info_p terminal;

***************
*** 3084,3090 ****

S_(cs_streamclip_from_string cs_streamclip_from_euc)
static unsigned char * cs_streamclip_from_euc(str,pos,len,terminal,printable_len)


! CONST struct string *str;

int *pos;
int len;
screen_info_p terminal;

--- 3087,3093 ----

S_(cs_streamclip_from_string cs_streamclip_from_euc)
static unsigned char * cs_streamclip_from_euc(str,pos,len,terminal,printable_len)


! const struct string *str;

int *pos;
int len;
screen_info_p terminal;

***************
*** 3265,3271 ****

S_(cs_streamclip_from_string cs_streamclip_from_iso2022)
static unsigned char * cs_streamclip_from_iso2022(str,pos,len,terminal,printable_len)


! CONST struct string *str;

int *pos;
int len;
screen_info_p terminal;

--- 3268,3274 ----

S_(cs_streamclip_from_string cs_streamclip_from_iso2022)
static unsigned char * cs_streamclip_from_iso2022(str,pos,len,terminal,printable_len)


! const struct string *str;

int *pos;
int len;
screen_info_p terminal;

***************
*** 3436,3442 ****
S_(cs_clip_from_string cs_clip_from_iso2022_gen)
static void cs_clip_from_iso2022_gen(ret,str,pos,len)
struct string *ret;


! CONST struct string *str;

int *pos;
int len;
{
--- 3439,3445 ----
S_(cs_clip_from_string cs_clip_from_iso2022_gen)
static void cs_clip_from_iso2022_gen(ret,str,pos,len)
struct string *ret;


! const struct string *str;

int *pos;
int len;
{
***************

*** 3528,3535 ****

S_(cs_find_pattern_from_string cs_find_pattern_from_iso2022_gen)
static int cs_find_pattern_from_iso2022_gen(str,pattern,ignore_case)


! CONST struct string *str;

! CONST struct string *pattern;
int ignore_case;
{

/* FIXME: pattern match should be done on here */
--- 3531,3538 ----

S_(cs_find_pattern_from_string cs_find_pattern_from_iso2022_gen)
static int cs_find_pattern_from_iso2022_gen(str,pattern,ignore_case)


! const struct string *str;

! const struct string *pattern;
int ignore_case;
{

/* FIXME: pattern match should be done on here */
***************
*** 3541,3554 ****



/* Returns number of bytes added */

S_(cs_add_streambytes_to_string cs_add_streambytes_to_iso2022_gen)
! static int cs_add_streambytes_to_iso2022_gen(str,count,data)

struct string *str;
int count;
! CONST unsigned char *data;
{

int i = 0;
struct state_iso2022 * X ;

if (!str->p->state)

str->p->state = new_state_1(str->string_type);

--- 3544,3560 ----



/* Returns number of bytes added */

S_(cs_add_streambytes_to_string cs_add_streambytes_to_iso2022_gen)
! static int cs_add_streambytes_to_iso2022_gen(str,count,data,errors)

struct string *str;
int count;
! const unsigned char *data;
! int *errors;
{

int i = 0;
struct state_iso2022 * X ;

+ *errors = 0;
+

if (!str->p->state)


str->p->state = new_state_1(str->string_type);

***************
*** 3587,3596 ****
DPRINT(Debug,8,(&Debug,
"cs_add_streambytes_to_iso2022_gen: failed to add code\n"));

! return i; /* Failed to add character */
! } else {
! i++;
}
} else {
break; /* All characters entered */
}

--- 3593,3606 ----


DPRINT(Debug,8,(&Debug,
"cs_add_streambytes_to_iso2022_gen: failed to add code\n"));

! /* Failed to add character */
! (*errors)++;
! cs_soft_reset_s_iso2022_gen(str->p->state);
! X->raw_bytes_count = 0;
}
+
+ i++;
+
} else {
break; /* All characters entered */
}
***************
*** 3599,3605 ****
if (0 == c) {
DPRINT(Debug,8,(&Debug,
"cs_add_streambytes_to_iso2022_gen: bad code\n"));
! return i;
}
}
}

--- 3609,3616 ----


if (0 == c) {
DPRINT(Debug,8,(&Debug,
"cs_add_streambytes_to_iso2022_gen: bad code\n"));
! (*errors)++;
! cs_soft_reset_s_iso2022_gen(str->p->state);
}
}
}

***************
*** 3609,3615 ****

S_(cs_find_map_type cs_find_euc)
static struct map_info *cs_find_euc(map_name)


! CONST char * map_name;
{
int i;
struct map_info *ret;

--- 3620,3626 ----

S_(cs_find_map_type cs_find_euc)
static struct map_info *cs_find_euc(map_name)


! const char * map_name;
{
int i;
struct map_info *ret;
***************

*** 3643,3649 ****

S_(cs_find_map_type cs_find_iso2022)
static struct map_info *cs_find_iso2022(map_name)


! CONST char * map_name;
{
int i;
struct map_info *ret;

--- 3654,3660 ----

S_(cs_find_map_type cs_find_iso2022)
static struct map_info *cs_find_iso2022(map_name)


! const char * map_name;
{
int i;
struct map_info *ret;
***************

*** 3677,3683 ****

S_(cs_remove_control cs_remove_control_iso2022_gen)
static void cs_remove_control_iso2022_gen(str)


! CONST struct string *str;

{
struct mb_data * X1 = str->p->a.data;
struct mb_data * new_X1 = alloc_mb_data();
--- 3688,3694 ----

S_(cs_remove_control cs_remove_control_iso2022_gen)
static void cs_remove_control_iso2022_gen(str)


! const struct string *str;

{
struct mb_data * X1 = str->p->a.data;
struct mb_data * new_X1 = alloc_mb_data();
Index: elmME+.2.5.alpha5-cvs/lib/cs_unknown.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/lib/cs_unknown.c 2005-07-26 11:28:37.000000000 +0300
***************
*** 0 ****
--- 1,2035 ----
+ static char rcsid[] = "@(#)$Id: cs_unknown.c,v 1.13.6.3 2005/07/26 08:28:37 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.13.6.3 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>

+ *****************************************************************************/
+
+ #include "elm_defs.h"

+ #include "s_me.h"
+ #include "cs_imp.h"

+ #include "cs_terminal.h"


+
+ #include <errno.h>
+ #ifndef ANSI_C
+ extern int errno;
+ #endif
+

+ #ifdef WCWIDTH
+ int wcwidth(wchar_t c);

+ #endif
+
+
+ DEBUG_VAR(Debug,__FILE__,"charset");


+
+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ static unsigned char *s2us P_((char *str));
+ static unsigned char *s2us(str)
+ char *str;
+ {
+ return (unsigned char *)str;
+ }
+

+ /* ---------------------------------------------------------------- */
+
+ #ifdef WCHAR


+ static void convert_to_wchar P_((const struct string *str));
+ static void convert_to_wchar(str)

+ const struct string *str;
+ {


+ unsigned char *bytes;
+ int b_len;
+

+ if (str->p->private_flag)

+ panic("STRING PANIC",__FILE__,__LINE__,"convert_to_wchar",

+ "Not in raw form",0);
+

+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"convert_to_wchar",
+ "not a system charset",0);
+
+

+ bytes = str->p->a.bytes;
+ b_len = str->p->len;
+ str->p->a.bytes = NULL;
+
+ str->p->private_flag = 1; /* Indicate wchars */
+ str->p->a.wchars = NULL;

+ str->p->len = 0;
+
+ if (bytes) {
+ int x;
+ mbstate_t State;


+ wchar_t * dest = NULL;
+ int alloced;
+ int l = 0;
+ const char * src, * cbytes;

+
+ DPRINT(Debug,61,(&Debug,


+ "convert_to_wchar: raw="));
+ for (x = 0; x < b_len; x++) {
+ DPRINT(Debug,61,(&Debug," %02X",
+ bytes[x]));
+ }
+ DPRINT(Debug,61,(&Debug," (len=%d)\n",b_len));

+
+ memset(&State, 0, sizeof(State));
+

+ /* NOTE: str->p->a.bytes is not NUL terminated

+ *
+ * ! ! ! NOTE! this do not convert strings including \0
+ * characters
+ */
+

+ /* Add terminating \0 */
+ bytes = safe_realloc(bytes,b_len+1);
+ bytes[b_len] = '\0';
+
+ cbytes = (const char *) bytes;
+
+ alloced = b_len+1;

+ dest = safe_malloc(alloced * sizeof (dest[0]));
+

+ for (src = cbytes; src; ) {
+ int left = alloced-l;
+ size_t r = mbsrtowcs(dest+l,&src,left,&State);

+
+ if ((size_t)(-1) == r) {

+ int pos;
+
+ if ('?' == *src)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "convert_to_wchar",


+ "? not convertible",0);

+ if ('\0' == *src)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "convert_to_wchar",
+ "Ooops",0);
+
+ pos = src-cbytes;
+
+ DPRINT(Debug,61,(&Debug,


+ "convert_to_wchar: Failed to convert 0x%02x at %d: errno = %d\n",
+ *src,pos,errno));
+
+ bytes[pos] = '?';
+

+
+ } else {
+

+ if (l >= 0)
+ l += r;
+ else
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "convert_to_wchar",
+ "Unexpected return from mbsrtowcs()",0);
+
+ if (src) {
+ int x;
+
+ DPRINT(Debug,4,(&Debug,
+ "convert_to_wchar: wide character string longer than original???\n"));
+
+
+ x = b_len - (src-cbytes);
+

+ alloced += x + 10;
+

+ dest = safe_realloc(dest,alloced * sizeof (dest[0]));

+ }
+
+
+ }
+
+ }

+
+ if ('\0' != dest[l])


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "convert_to_wchar",


+ "\\0 not written",0);
+

+ free(bytes); bytes = NULL;
+

+ str->p->a.wchars = dest;
+ str->p->len = l;

+ }
+
+ }
+

+ #endif
+ /* ---------------------------------------------------------------- */
+
+ S_(cs_init_string cs_init_unknown)

+ static void cs_init_unknown P_((struct string *str));
+ static void cs_init_unknown(str)
+ struct string *str;
+ {
+ str->p->len = 0;
+ str->p->private_flag = 0;
+ str->p->a.bytes = 0;
+

+ /* private_flag = 0 : Use bytes (raw form)
+ private_flag = 1 : Use wchars (locale)
+ */

+
+
+ }
+
+ S_(cs_free_string cs_free_unknown)
+ static void cs_free_unknown P_((struct string *str));
+ static void cs_free_unknown(str)
+ struct string *str;
+ {


+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_free_unknown",


+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR


+ if (str->p->a.wchars) {
+ free(str->p->a.wchars);

+ str->p->a.wchars = NULL;
+ }
+ #else


+ panic("STRING PANIC",__FILE__,__LINE__,"cs_free_unknown",
+ "No wchar_t support",0);
+ #endif
+ } else {
+ /* Use bytes (raw form) */
+

+ if (str->p->a.bytes) {
+ free(str->p->a.bytes);

+ str->p->a.bytes = NULL;
+ }
+ }
+ str->p->len = 0;
+ str->p->private_flag = 0;
+ }
+
+ S_(cs_init_state cs_init_s_unknown)
+ static void cs_init_s_unknown P_((struct charset_state *st));
+ static void cs_init_s_unknown(st)


+ struct charset_state *st;
+ {

+ st->p->ready = 0;

+
+ #ifdef WCHAR


+ if (st->charset == system_charset) {

+ st->p->a.wchar.magic = STATE_WCHAR_magic;

+
+ memset(&(st->p->a.wchar.s), 0, sizeof(st->p->a.wchar.s));
+ st->p->a.wchar.value = L'\0';
+ }
+ else
+ #endif
+ {

+ st->p->a.byte = 0;
+ }
+
+
+

+ }
+
+ S_(cs_free_state cs_free_s_unknown)

+ static void cs_free_s_unknown P_((struct charset_state *st));
+ static void cs_free_s_unknown(st)


+ struct charset_state *st;
+ {

+ st->p->ready = 0;

+
+ #ifdef WCHAR


+ if (st->charset == system_charset) {

+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_free_s_unknown",


+ "Bad magic number",0);
+

+ memset(&(st->p->a.wchar.s), 0, sizeof(st->p->a.wchar.s));
+ st->p->a.wchar.value = L'\0';
+
+

+ st->p->a.wchar.magic = 0; /* Invalidate magic */

+ }
+ else
+ #endif
+ {

+ st->p->a.byte = 0;
+ }
+ }
+
+ S_(cs_soft_reset_state cs_soft_reset_s_unknown)
+ static void cs_soft_reset_s_unknown P_((struct charset_state *st));
+ static void cs_soft_reset_s_unknown(st)


+ struct charset_state *st;
+ {
+

+ st->p->ready = 0;
+

+ /* soft reset should reset only partially state, so ... */
+

+
+ #ifdef WCHAR


+ if (st->charset == system_charset) {

+ static int warned = 0;
+

+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)

+ panic("STRING PANIC",__FILE__,__LINE__,"cs_soft_reset_s_unknown",


+ "Bad magic number",0);
+

+ if (!warned &&
+ !mbsinit(&(st->p->a.wchar.s))) {
+ warned = 1;
+ lib_error(CATGETS(elm_msg_cat, MeSet,MeUnknownUnsupportedKB,
+ "Unknown charsets are unsupported as keyboard input!"));
+ }
+
+ memset(&(st->p->a.wchar.s), 0, sizeof(st->p->a.wchar.s));
+ st->p->a.wchar.value = L'\0';
+ }
+ else
+ #endif
+ {

+ st->p->a.byte = 0;
+ }
+
+ }
+

+ S_(cs_add_streambyte_to_state cs_add_streambyte_to_s_unknown)
+ static int cs_add_streambyte_to_s_unknown P_((struct charset_state *st,
+ int ch));
+ static int cs_add_streambyte_to_s_unknown(st,ch)
+ struct charset_state *st;
+ int ch;

+ {
+ #ifdef WCHAR


+ if (st->charset == system_charset) {
+ size_t x;

+ const char s = ch;


+
+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_streambyte_to_s_unknown",


+ "Bad magic number",0);
+

+ x = mbrtowc(& st->p->a.wchar.value, &s, 1, &(st->p->a.wchar.s));
+
+ if ((size_t)(-2) == x) {
+ DPRINT(Debug,62,(&Debug, "cs_add_streambyte_to_s_unknown: Incomplete sequence -- OK\n"));

+
+ return 1;
+ }
+

+ if ((size_t)(-1) == x) {
+ DPRINT(Debug,4,(&Debug,
+ "cs_add_streambyte_to_s_unknown: mbrtowc failed: errno = %d\n",
+ errno));
+
+ memset(&(st->p->a.wchar.s), 0, sizeof(st->p->a.wchar.s));
+ st->p->a.wchar.value = L'\0';

+
+ return 0;
+ }
+

+ st->p->ready = 1;
+ }
+ else
+ #endif
+ {
+ st->p->ready = 1;
+ st->p->a.byte = ch;

+ }
+ return 1;
+ }
+
+
+

+ S_(cs_add_streambyte_to_string cs_add_streambyte_to_unknown)
+ static int cs_add_streambyte_to_unknown P_((struct string *str,int ch));
+ static int cs_add_streambyte_to_unknown(str,ch)
+ struct string *str;
+ int ch;

+ {
+ #ifdef WCHAR


+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);

+
+ #endif
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambyte_to_unknown",
+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR
+

+ if (!str->p->state)
+ str->p->state = new_state_1(str->string_type);
+
+ if (str->p->state->charset->charset_type != &cs_unknown)
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_streambyte_to_unknown",


+ "Bad state",0);
+

+ if (!cs_add_streambyte_to_s_unknown(str->p->state,ch)) {
+ DPRINT(Debug,10,(&Debug,
+ "cs_add_streambyte_to_unknown: Failed to add byte\n"));

+ return 0;
+ }
+

+ if (str->p->state->p->ready) {
+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+1)*
+ sizeof (wchar_t));
+
+ str->p->a.wchars[str->p->len++] =
+ str->p->state->p->a.wchar.value;

+ str->p->state->p->ready = 0;
+ }


+ return 1;
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_free_unknown",
+ "No wchar_t support",0);
+ #endif
+ } else {
+ /* Use bytes (raw form) */
+

+ /* NOTE: str->p->a.bytes is not NUL terminated */
+

+ str->p->a.bytes = safe_realloc(str->p->a.bytes,str->p->len+1);
+ str->p->a.bytes[str->p->len++] = ch;

+ }
+ return 1;
+ }
+

+ S_(cs_add_state_to_string cs_add_state_to_unknown)
+ static void cs_add_state_to_unknown P_((struct string *str,
+ struct charset_state *ch));
+ static void cs_add_state_to_unknown(str,ch)
+ struct string *str;
+ struct charset_state *ch;
+ {
+ if (str->string_type->charset_type !=
+ ch->charset->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_state_to_unknown",
+ "String/state type mismatch",0);

+
+ #ifdef WCHAR


+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);

+
+ #endif
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_state_to_unknown",
+ "private_flag set for non-system charset",0);
+

+
+ #ifdef WCHAR


+ if (ch->charset != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "cs_add_state_to_unknown",
+ "Oops",0);
+
+ if (STATE_WCHAR_magic != ch->p->a.wchar.magic)
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_state_to_unknown",


+ "Bad magic number",0);
+
+

+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+1)*
+ sizeof (wchar_t));
+
+ str->p->a.wchars[str->p->len++] =
+ ch->p->a.wchar.value;
+
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_state_to_unknown",
+ "No wchar_t support",0);
+ #endif
+ } else {
+ /* Use bytes (raw form) */

+
+ #ifdef WCHAR


+ if (ch->charset == system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "cs_add_state_to_unknown",
+ "Oops",0);

+ #endif
+
+ /* NOTE: str->p->a.bytes is not NUL terminated */
+

+ str->p->a.bytes = safe_realloc(str->p->a.bytes,str->p->len+1);
+ str->p->a.bytes[str->p->len++] = ch->p->a.byte;
+ }
+ }
+
+ S_(cs_state_same_char cs_s_unknown_same_char)
+ static int cs_s_unknown_same_char P_((struct charset_state *A,
+ struct charset_state *B,
+ int ignore_case));
+ static int cs_s_unknown_same_char(A,B,ignore_case)
+ struct charset_state *A;
+ struct charset_state *B;
+ int ignore_case;
+ {
+
+ if (A->charset != B->charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_s_unknown_same_char",
+ "Oops",0);

+
+ #ifdef WCHAR


+ if (A->charset == system_charset) {
+ wchar_t c2;
+ wchar_t c1;
+
+ if (STATE_WCHAR_magic != A->p->a.wchar.magic)
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_s_unknown_same_char",


+ "Bad magic number",0);

+ if (STATE_WCHAR_magic != B->p->a.wchar.magic)
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_s_unknown_same_char",


+ "Bad magic number",0);
+

+ c1 = A->p->a.wchar.value ;
+ c2 = B->p->a.wchar.value ;
+ if (c1 == c2)

+ return 1;
+

+ if (ignore_case &&
+ towlower(c1) == towlower(c2))

+ return 1;
+

+ return 0;
+ }
+ else
+ #endif
+ {
+ unsigned char c2 = B->p->a.byte;
+ unsigned char c1 = A->p->a.byte;
+
+ if (c1 == c2)

+ return 1;
+
+ if (!ignore_case)
+ return 0;
+

+ return -1; /* Use UNICODE comparision on upper level instead */

+ }
+ }
+
+

+ S_(cs_add_streambytes_to_string cs_add_streambytes_to_unknown)
+ /* Returns number of bytes added */
+ static int cs_add_streambytes_to_unknown P_((struct string *str,
+ int count,
+ const unsigned char *data,
+ int *errors));
+ static int cs_add_streambytes_to_unknown(str,count,data,errors)
+ struct string *str;
+ int count;

+ const unsigned char *data;
+ int *errors;


+ {
+ int i;
+

+ if (count < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_unknown",
+ "Negative length",0);
+

+ *errors = 0;
+

+ #ifdef WCHAR
+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);
+ #endif
+
+ if (count > 0) {

+ /* realloc with size 0 is equivalent of free and may
+ corrupt memory ...
+ */
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_unknown",
+ "private_flag set for non-system charset",0);
+

+
+ #ifdef WCHAR
+

+ if (!str->p->state)
+ str->p->state = new_state_1(str->string_type);
+
+ if (str->p->state->charset->charset_type != &cs_unknown)
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_add_streambytes_to_unknown",


+ "Bad state",0);
+

+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+count)*
+ sizeof (wchar_t));

+
+

+ for (i = 0; i < count; i++) {
+ if (!cs_add_streambyte_to_s_unknown(str->p->state,data[i])) {
+ DPRINT(Debug,10,(&Debug,
+ "cs_add_streambytes_to_unknown: Failed to add byte, idx=%d\n",
+ i));
+
+ (*errors)++;
+ str->p->a.wchars[str->p->len++] = L'?';
+ continue;
+ }
+

+ if (str->p->state->p->ready) {


+ str->p->a.wchars[str->p->len++] =
+ str->p->state->p->a.wchar.value;

+ str->p->state->p->ready = 0;
+ }
+ }


+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",
+ "No wchar_t support",0);
+ #endif
+
+ } else {
+ /* Use bytes (raw form) */
+
+ /* NOTE: str->p->a.bytes is not NUL terminated */
+ str->p->a.bytes = safe_realloc(str->p->a.bytes,str->p->len+count);
+ for (i = 0; i < count; i++)
+ str->p->a.bytes[str->p->len++] = data[i];
+ return count;
+ }

+ }
+ return 0;
+ }
+

+ S_(cs_add_intdata_to_string cs_add_intdata_to_unknown)
+ static void cs_add_intdata_to_unknown P_((struct string *str,
+ const struct string *data));
+ static void cs_add_intdata_to_unknown(str,data)
+ struct string *str;

+ const struct string *data;


+ {
+ int i;
+

+ if (str->string_type->charset_type !=
+ data->string_type->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_intdata_to_unknown",
+ "String type mismatch",0);
+
+

+ if (data->p->len > 0) {


+ /* realloc with size 0 is equivalent of free and may
+ corrupt memory ...
+ */
+

+
+ #ifdef WCHAR


+ if (!str->p->private_flag &&
+ data->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);
+ if (!data->p->private_flag &&
+ str->p->private_flag &&
+ data->string_type == system_charset)
+ convert_to_wchar(data);
+ #endif
+
+ if (str->p->private_flag &&
+ data->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset ||
+ data->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_intdata_to_unknown",
+ "private_flag set for non-system charset",0);
+

+
+ #ifdef WCHAR
+

+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+data->p->len)*
+ sizeof (wchar_t));
+ for (i = 0; i < data->p->len; i++)
+ str->p->a.wchars[str->p->len++] = data->p->a.wchars[i];
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_intdata_to_unknown",
+ "No wchar_t support",0);
+ #endif

+
+ } else {
+

+ if (str->p->private_flag ||
+ data->p->private_flag)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_intdata_to_unknown",
+ "Ooops -- MIME subtypes of unknown charset is not supported",0);

+
+

+ /* NOTE: str->p->a.bytes is not NUL terminated */
+ str->p->a.bytes = safe_realloc(str->p->a.bytes,
+ data->p->len+str->p->len);

+

+ for (i = 0; i < data->p->len; i++)
+ str->p->a.bytes[str->p->len++] = data->p->a.bytes[i];

+
+ }
+ }
+ }
+
+
+

+ static uint16 cs_unicode_unknown_helper P_((unsigned int ch,
+ charset_t set, int *found));
+ static uint16 cs_unicode_unknown_helper(ch,set, found)
+ unsigned int ch;
+ charset_t set;

+ int *found;
+ {


+ *found = 0;
+
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position
+ */
+
+ /* If charset is system character set then assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+ if (set == system_charset) {
+ uint16 val = map_fallback(ch);
+ if (val != MAPPING_NONE) {

+ *found = 1;
+ return val;
+ }
+ }
+

+ if (ch < 32) {
+ *found = 1;


+ return ch;
+ }
+ return 0x003F; /* '?' */

+
+ }
+

+ #ifdef WCHAR
+ static uint16 cs_unicode_unknown_whelper P_((wint_t ch,
+ charset_t set, int *found));
+ static uint16 cs_unicode_unknown_whelper(ch,set, found)
+ wint_t ch;
+ charset_t set;

+ int *found;
+ {


+ uint16 val;
+ int c1;

+
+ *found = 0;
+

+ if (set != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_unicode_unknown_whelper",
+ "Not a system charset",0);
+
+ /* This function is used only for system charset
+ *
+ * Assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ val = map_wfallback(ch);
+ if (val != MAPPING_NONE) {

+ *found = 1;
+ return val;
+ }
+

+ /* returns EOF if character is not exactly one byte long */
+ c1 = wctob(ch);
+
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position
+ *

+ */
+

+ if (c1 < 32 && c1 >= 0) {

+ *found = 1;


+ return c1;
+ }
+
+ return 0x003F; /* '?' */

+ }
+ #endif
+
+

+ /* Does compression, recalculation and so on ...
+ so 'const' is not very const
+ */
+ S_(cs_check_length_string cs_check_length_unknown)

+ static void cs_check_length_unknown P_((const struct string *str));
+ static void cs_check_length_unknown(str)


+ const struct string *str;
+ {

+
+ #ifdef WCHAR


+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);

+ #endif
+

+ /* No compression */
+ }
+
+ S_(cs_give_unicode_from_string cs_give_unicode_from_unknown)
+ static uint16 cs_give_unicode_from_unknown P_((const struct string *str,
+ int pos, int *found));
+ static uint16 cs_give_unicode_from_unknown(str,pos,found)

+ const struct string *str;
+ int pos;
+ int *found;
+ {


+ if (pos < 0 || pos >= str->p->len)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_give_unicode_from_unknown",
+ "Index out of array",0);
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */

+
+ #ifdef WCHAR

+ int *found;
+ {
+

+ #ifdef WCHAR
+ if (st->charset == system_charset) {
+ wchar_t ch;
+
+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_give_unicode_from_s_unknown",


+ "Bad magic number",0);
+

+ ch = st->p->a.wchar.value;
+ return cs_unicode_unknown_whelper(ch,st->charset,found);
+ }
+ else

+ #endif
+ {
+

+ unsigned char ch;
+
+ ch = st->p->a.byte;
+ return cs_unicode_unknown_helper(ch,st->charset,found);
+ }
+ }
+
+ S_(cs_add_unicodedata_to_string cs_add_unicodedata_to_unknown)
+ static void cs_add_unicodedata_to_unknown P_((struct string *str,
+ int len, const uint16 *data));
+ static void cs_add_unicodedata_to_unknown(str,len,data)
+ struct string *str;
+ int len;

+ const uint16 *data;


+ {
+ int i;
+

+ if (len > 0) {


+ /* realloc with size 0 is equivalent of free and may
+ corrupt memory ...
+ */

+
+ #ifdef WCHAR


+ if (!str->p->private_flag &&
+ str->string_type == system_charset)
+ convert_to_wchar(str);
+ #endif
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_unicodedata_to_unknown",
+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR
+

+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ str->p->a.wchars = safe_realloc(str->p->a.wchars,
+ (str->p->len+len)*
+ sizeof (wchar_t));

+

+ for (i = 0; i < len; i++) {
+ wint_t ch = 0;

+ int found = 0;
+

+ /* str->p->private_flag is set only if charset
+ * is system character set.
+ *
+ * Assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ ch = map_wfallback_rev(data[i],&found);
+ if (found)
+ str->p->a.wchars[str->p->len++] = ch;
+
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position

+ */
+

+ if (!found && data[i] < 32)
+ str->p->a.wchars[str->p->len++] = btowc(data[i]);

+
+ /*

+ * If map_wfallback_rev() is given replacement character
+ * we use it.
+ */
+
+ else if (ch && !found)
+ str->p->a.wchars[str->p->len++] = ch;

+
+ }
+ #else


+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",
+ "No wchar_t support",0);
+ #endif
+
+ } else {
+ /* Use bytes (raw form) */
+

+ /* NOTE: str->p->a.bytes is not NUL terminated */
+ str->p->a.bytes = safe_realloc(str->p->a.bytes,len+str->p->len);

+

+ for (i = 0; i < len; i++) {
+ unsigned char ch = 0;

+ int found = 0;
+

+ /* If charset is system character set assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)

+ */
+

+ if (str->string_type == system_charset) {
+ ch = map_fallback_rev(data[i],&found);
+ if (found)
+ str->p->a.bytes[str->p->len++] = ch;
+ }
+
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position

+ */
+

+ if (!found && data[i] < 32)
+ str->p->a.bytes[str->p->len++] = data[i];
+
+ /* Because character set is unknow we do not know any
+ * replacement character what we can use, therefore
+ * we add nothing.
+ *
+ * If however map_fallback_rev() is given replacement character
+ * we use it.
+ */
+
+ else if (ch && !found)
+ str->p->a.bytes[str->p->len++] = ch;

+
+ }
+ }
+ }
+ }
+

+ S_(cs_cmp_string cs_cmp_unknown)
+ static int cs_cmp_unknown P_((const struct string *str1,const struct string *str2));
+ static int cs_cmp_unknown(str1,str2)

+ const struct string *str1;
+ const struct string *str2;


+ {
+ int i;
+

+ if (str1->string_type->charset_type !=
+ str2->string_type->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_cmp_unknown",
+ "String type mismatch",0);

+
+ #ifdef WCHAR


+ if (!str1->p->private_flag &&
+ str2->p->private_flag)
+ convert_to_wchar(str1);
+ if (!str2->p->private_flag &&
+ str1->p->private_flag)
+ convert_to_wchar(str2);

+ #endif
+
+

+ if (str1->p->private_flag &&
+ str2->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str1->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str1->string_type != system_charset ||
+ str2->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_cmp_unknown",
+ "private_flag set for non-system charset",0);
+
+ #ifdef WCHAR

+

+ for (i = 0; i < str1->p->len && i < str2->p->len; i++) {
+ if (str1->p->a.wchars[i] < str2->p->a.wchars[i])

+ return -1;


+ if (str1->p->a.wchars[i] > str2->p->a.wchars[i])

+ return 1;
+ }


+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_cmp_unknown",
+ "No wchar_t support",0);
+ #endif
+
+ } else {
+ /* Use bytes (raw form) */
+
+ if (str1->p->private_flag ||
+ str2->p->private_flag)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_cmp_unknown",
+ "Ooops",0);

+

+ for (i = 0; i < str1->p->len && i < str2->p->len; i++) {
+ if (str1->p->a.bytes[i] < str2->p->a.bytes[i])

+ return -1;


+ if (str1->p->a.bytes[i] > str2->p->a.bytes[i])

+ return 1;
+ }
+ }
+

+ if (i < str1->p->len)
+ return 1;
+ if (i < str2->p->len)
+ return -1;

+ return 0;
+ }
+

+ S_(cs_state_printable cs_s_unknown_printable)
+ static int cs_s_unknown_printable P_((struct charset_state *st));
+ static int cs_s_unknown_printable(st)
+ struct charset_state *st;

+ {
+ #ifdef WCHAR


+ if (st->charset == system_charset) {
+ wint_t ch;
+
+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_s_unknown_printable",


+ "Bad magic number",0);
+

+ ch = st->p->a.wchar.value;
+ return iswprint(ch);
+ }
+ else
+ #endif

+ {
+ #ifndef ASCII_CTYPE


+ if (st->charset == system_charset)
+ return cs_s_locale_printable(st);

+ #endif
+ }
+

+ return -1; /* Use unicode values */

+ }
+
+

+ /* If character corresponds one byte on stream, returns it.
+ * Otherwise returns 0. This is used implement ReadCh().
+ * It is assumed that returned character corresponds to
+ * code character set (and perhaps also US-ASCII)
+ */
+ S_(cs_state_is_onebyte cs_s_unknown_is_onebyte)
+ static int cs_s_unknown_is_onebyte P_((struct charset_state *st));
+ static int cs_s_unknown_is_onebyte(st)
+ struct charset_state *st;

+ {
+ #ifdef WCHAR


+ if (st->charset == system_charset) {
+ wint_t ch;
+ int c1;
+
+ if (STATE_WCHAR_magic != st->p->a.wchar.magic)
+ panic("STRING PANIC",__FILE__,__LINE__,

+ "cs_s_unknown_printable",


+ "Bad magic number",0);
+

+ ch = st->p->a.wchar.value;
+
+ /* returns EOF if character is not exactly one byte long */
+ c1 = wctob(ch);
+
+ if (EOF == c1)
+ return 0;
+ return c1;
+ }
+ else
+ #endif
+ {
+ unsigned char c1 = st->p->a.byte;
+ return c1;
+ }
+ }
+
+ S_(cs_stream_from_string cs_stream_from_unknown)
+ static unsigned char *cs_stream_from_unknown P_((const struct string *str,
+ int printable,
+ screen_info_p terminal,
+ int *reslen));
+ static unsigned char *cs_stream_from_unknown(str,printable,terminal,reslen)

+ const struct string *str;


+ int printable;
+ screen_info_p terminal; /* NOT USED */
+ int *reslen;
+ {

+ unsigned char * ret = NULL;
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */

+
+ #ifdef WCHAR
+

+ int alloced;
+ int l;
+ mbstate_t State;
+ wchar_t * tmp;
+ const wchar_t *src, *ctmp;

+ int i;
+

+
+ } else {
+

+ if (l >= 0)
+ l += r;
+ else
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "cs_stream_from_unknown",
+ "Unexpected return from wcsrtombs()",0);
+
+ if (src) {

+ int x;
+

+ x = str->p->len - (src-tmp);
+
+ alloced += x + MB_CUR_MAX;
+
+ ret = safe_realloc(ret,alloced);

+ }
+ }
+ }
+

+ if ('\0' != ret[l])
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "cs_stream_from_unknown",
+ "\\0 not written",0);
+
+ free(tmp); tmp = NULL;
+
+ *reslen = l;
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",
+ "No wchar_t support",0);
+ #endif
+
+ } else {

+ /* Use bytes (raw form) */
+
+ #ifndef ASCII_CTYPE


+ if (printable &&
+ str->string_type == system_charset)
+ return cs_stream_from_locale(str,reslen);
+ #endif
+
+ if (!printable) {
+ int l = 0,i;
+
+ ret = safe_malloc(str->p->len+1);

+

+ for (i = 0; i < str->p->len; i++)
+ ret[l++] = str->p->a.bytes[i];
+ ret[l] = '\0';
+ *reslen = l;
+
+ } else if (str->string_type == system_charset) {
+ int l = 0,i;
+ ret = safe_malloc(str->p->len+1);
+
+ /* If charset is system character set assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)

+ */
+

+ for (i = 0; i < str->p->len; i++) {

+ uint16 val = map_fallback(str->p->a.bytes[i]);
+

+ if (val != MAPPING_NONE &&
+ val >= 0x0020)
+ ret[l++] = str->p->a.bytes[i];
+ else
+ ret[l++] = '?'; /* See above ... */
+ }
+ ret[l] = '\0';
+ *reslen = l;
+
+ } else {
+ /* Because charset is unknown we do not have able to print
+ * printable characters -- also we do not know replacement
+ * characters...

+ */
+
+ ret = s2us(safe_strdup(""));
+ *reslen = 0;
+ }
+ }


+ return ret;
+ }
+
+

+ S_(cs_streamclip_from_string cs_streamclip_from_unknown)
+ static unsigned char *cs_streamclip_from_unknown P_((const struct string *str,
+ int *pos, int len,
+ screen_info_p terminal,
+ struct cs_printable_len *printable_len));
+ static unsigned char *cs_streamclip_from_unknown(str,pos,len,terminal,printable_len)

+ const struct string *str;


+ int *pos;
+ int len;
+ screen_info_p terminal;
+ struct cs_printable_len *printable_len;
+ {

+ unsigned char * ret = NULL;
+

+ if (*pos < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
+ "Index out of array",0);
+
+ if (len < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",

+ "Negative size",0);
+
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */

+
+ #ifdef WCHAR


+ int alloced;
+ int l;
+ mbstate_t State;
+ wchar_t * tmp;
+ const wchar_t *ctmp, *src;

+ int i;
+
+

+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",

+ "private_flag set for non-system charset",0);
+
+
+ if (printable_len)
+ printable_len->ret_len = 0;
+

+ /* NOTE: str->p->a.wchars is not NUL terminated
+ *
+ * ! ! ! NOTE! this do not convert strings including \0
+ * characters

+ */
+

+ if (len > str->p->len)
+ len = str->p->len;
+
+ if (len <= 0)
+ goto done;
+
+ tmp = safe_malloc((len + 1) * sizeof (tmp[0]));

+

+ for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {
+ wchar_t c = str->p->a.wchars[*pos];
+
+ if (!iswprint(c))
+ c = L'?';
+
+ if (printable_len) {
+ #ifdef WCWIDTH
+ int w = 1;
+
+ if (terminal->wcwidth)
+ w = wcwidth(c);
+
+ if (printable_len->max_len < printable_len->ret_len + w)
+ break;
+
+ printable_len->ret_len += w;
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
+ "printable_len not supported",0);

+ #endif
+ }
+
+

+
+ } else {
+

+ if (l >= 0)
+ l += r;
+ else
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "cs_stream_from_unknown",
+ "Unexpected return from wcsrtombs()",0);
+
+ if (src) {

+ int x;
+

+ x = len - (src-ctmp);
+
+ alloced += x + MB_CUR_MAX;
+
+ ret = safe_realloc(ret,alloced);

+ }
+ }
+ }
+

+ if ('\0' != ret[l])
+ panic("STRING PANIC",__FILE__,__LINE__,
+ "cs_stream_from_unknown",
+ "\\0 not written",0);
+
+ free(tmp); tmp = NULL;
+
+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_binary",
+ "No wchar_t support",0);
+ #endif
+
+ } else {
+ /* Use bytes (raw form) */
+
+ if (printable_len)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_streamclip_from_unknown",
+ "printable_len not supported",0);

+
+ #ifndef ASCII_CTYPE


+ if (str->string_type == system_charset)
+ return cs_streamclip_from_locale(str,pos,len);
+ #endif
+
+ if (str->string_type == system_charset) {
+ int l = 0,i;
+ ret = safe_malloc(len+1);
+
+ /* If charset is system character set then assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)

+ */
+

+ for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {
+ uint16 val = map_fallback(str->p->a.bytes[*pos]);
+
+ if (val != MAPPING_NONE &&
+ val >= 0x0020)
+ ret[l++] = str->p->a.bytes[*pos];
+ else
+ ret[l++] = '?'; /* See above ... */
+ }
+ ret[l] = '\0';

+
+ } else {
+

+ done:
+
+ ret = s2us(safe_strdup(""));
+ /* Because charset is unknown we do not have able to print
+ * printable characters -- also we not know replacement
+ * characters...
+ */
+
+ /* Indicate that we are 'clipped' whole string */
+ if (*pos < str->p->len)
+ *pos = str->p->len;

+
+ }
+ }


+ return ret;
+ }
+
+

+ S_(cs_clip_from_string cs_clip_from_unknown)
+ static void cs_clip_from_unknown P_((struct string *ret,

+ const struct string *str,


+ int *pos, int len));
+

+ static void cs_clip_from_unknown(ret,str,pos,len)
+ struct string *ret;

+ const struct string *str;


+ int *pos;
+ int len;

+ {
+ int i;
+

+ if (ret->string_type->charset_type !=
+ str->string_type->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_binary",
+ "String type mismatch",0);
+
+ if (*pos < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_binary",
+ "Index out of array",0);
+
+ if (len < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_binary",
+ "Negative size",0);
+
+ cs_free_unknown(ret);
+
+ if (len > str->p->len)
+ len = str->p->len;
+
+ if (len <= 0)
+ return;
+
+ /* realloc with len == 0 is equivalent of freeing and
+ may result corruption of memory ...

+ */
+

+ if (str->p->private_flag) {

+ /* Use wchars (locale) */
+
+

+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_unknown",
+ "private_flag set for non-system charset",0);

+
+ #ifdef WCHAR
+

+ ret->p->private_flag = 1;
+
+ /* NOTE: str->p->a.wchars is not NUL terminated */
+ ret->p->a.wchars = safe_malloc(len *

+ sizeof(ret->p->a.wchars[0]));
+ ret->p->len = 0;
+

+ for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {

+ ret->p->a.wchars[ret->p->len++] = str->p->a.wchars[*pos];
+ }
+
+ #else


+ panic("STRING PANIC",__FILE__,__LINE__,"cs_clip_from_unknown",
+ "No wchar_t support",0);
+ #endif
+
+ } else {
+ /* Use bytes (raw form) */
+

+ ret->p->private_flag = 0;
+

+ /* NOTE: str->p->a.bytes is not NUL terminated */
+ ret->p->a.bytes = safe_malloc(len);

+ ret->p->len = 0;
+

+ for (i = 0; i < len && *pos < str->p->len; i++, (*pos)++) {

+ ret->p->a.bytes[ret->p->len++] = str->p->a.bytes[*pos];


+ }
+ }
+ }
+
+
+

+ S_(cs_can_ascii_string cs_can_ascii_unknown)
+ static int cs_can_ascii_unknown P_((const struct string *str));
+ static int cs_can_ascii_unknown(str)
+ const struct string *str;
+ {
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ #ifdef WCHAR

+ int i;
+

+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_can_ascii_unknown",
+ "private_flag set for non-system charset",0);

+

+ for (i = 0; i < str->p->len; i++) {
+ wchar_t c = str->p->a.wchars[i];
+ int c1 = wctob(c);
+ uint16 val;
+

+ /* wctob returns unsigned char if character is representable
+ * as byte or EOF otehrwise
+ */
+
+ if (EOF == c1)
+ return 0;
+

+ /* Assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+
+ val = map_wfallback(c);
+
+ /* MAPPING_NONE is > 127 */
+ if (val > 127)

+ return 0;
+ }
+ return 1;
+

+ #else
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_can_ascii_unknown",
+ "No wchar_t support",0);
+
+ return 0; /* Not reached */
+ #endif
+
+ } else {
+ /* Use bytes (raw form) */
+
+ if (str->string_type == system_charset) {
+ int i;
+ /* If charset is system character set then assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)

+ */
+

+ for (i = 0; i < str->p->len; i++) {
+ uint16 val = map_fallback(str->p->a.bytes[i]);
+
+ /* MAPPING_NONE is > 127 */
+ if (val > 127)

+ return 0;
+ }
+ return 1;
+ } else


+ return 0;
+ }
+ }
+
+

+
+
+ S_(cs_find_pattern_from_string cs_find_pattern_from_unknown)
+ static int cs_find_pattern_from_unknown P_((const struct string *str,
+ const struct string *pattern,
+ int ignore_case));
+
+ static int cs_find_pattern_from_unknown(str,pattern,ignore_case)

+ const struct string *str;

+ const struct string *pattern;
+ int ignore_case;
+ {


+ int ret = 0;
+ int i, j;
+
+ if (pattern->string_type->charset_type !=
+ str->string_type->charset_type)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_find_pattern_from_unknown",
+ "String type mismatch",0);
+
+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_find_pattern_from_unknown",
+ "private_flag set for non-system charset",0);
+
+ #ifdef WCHAR

+
+

+ for (i = 0; i < str->p->len; ) {

+ const int s = i + 1;


+
+ for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {
+ wint_t c2 = pattern->p->a.wchars[j];
+ wint_t c1 = str->p->a.wchars[i];
+
+ if (ignore_case) {
+ c2 = tolower(c2);
+ c1 = tolower(c1);
+ }
+ if (c1 != c2)
+ break;
+ }
+ if (j >= pattern->p->len) {

+ ret = 1;


+ break;
+ }
+ i = s;

+ }
+
+ #else


+ panic("STRING PANIC",__FILE__,__LINE__,"cs_find_pattern_from_unknown",
+ "No wchar_t support",0);
+ #endif
+
+ } else {

+ /* Use bytes (raw form) */
+
+ #ifndef ASCII_CTYPE


+ if (ignore_case && str->string_type == system_charset)
+ return cs_find_pattern_from_locale(str,pattern);
+ #endif

+

+ for (i = 0; i < str->p->len; ) {

+ const int s = i + 1;


+
+ for (j = 0; j < pattern->p->len && i < str->p->len; j++,i++) {
+ unsigned char c2 = pattern->p->a.bytes[j];
+ unsigned char c1 = str->p->a.bytes[i];
+
+ /* We can not convert characters lowercase because
+ * charset is unknown

+ */
+

+ if (c1 != c2)
+ break;
+ }
+ if (j >= pattern->p->len) {

+ ret = 1;


+ break;
+ }
+ i = s;

+ }
+ }
+ return ret;
+ }
+

+ S_(cs_remove_control cs_remove_control_unknown)
+ static void cs_remove_control_unknown P_((const struct string *str));
+ static void cs_remove_control_unknown(str)


+ const struct string *str;

+ {
+ int i;
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */
+
+ /* If str->p->private_flag is set, charset is
+ * locale charset
+ */
+ if (str->string_type != system_charset)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_remove_control_unknown",
+ "private_flag set for non-system charset",0);
+
+ #ifdef WCHAR

+

+ for (i = 0; i < str->p->len; i++) {
+ wchar_t c1 = str->p->a.wchars[i];
+
+ if (!iswprint(c1))
+ str->p->a.wchars[i] = L' ';

+ }
+
+ #else


+ panic("STRING PANIC",__FILE__,__LINE__,"cs_remove_control_unknown",
+ "No wchar_t support",0);
+ #endif
+
+ } else {

+ /* Use bytes (raw form) */
+
+ #ifndef ASCII_CTYPE


+ if (str->string_type == system_charset) {

+ cs_remove_control_locale(str,' ');
+ return;
+ }
+ #endif
+

+ for (i = 0; i < str->p->len; i++) {
+ /* We assume that values < 32 are same control characters
+ * on all sets -- after all MIME requires that on all
+ * character sets characters CR and LF are on same position

+ */
+
+

+ if (str->p->a.bytes[i] < 32) {
+ if (str->string_type == system_charset)
+ /* If charset is system character set then assume that
+ * invariant part is on same position than on character
+ * set used by code (ie compiler)
+ */
+ str->p->a.bytes[i] = ' ';
+
+ else
+ /* We HOPE that 32 is printable character... */

+ str->p->a.bytes[i] = 32;


+ }
+ }
+ }
+ }
+

+ S_(cs_find_map_type cs_find_unknown)
+ static struct map_info * cs_find_unknown P_((const char * map_name));
+ static struct map_info * cs_find_unknown(map_name)

+ const char * map_name;


+ {
+ return NULL;
+ }

+
+ S_(cs_set_properties cs_unknown_properties)
+ static int cs_unknown_properties P_((charset_t st));
+ static int cs_unknown_properties(st)
+ charset_t st;
+ {

+ int prop = 0;
+

+ if (st->map_info)
+ prop |= CS_mapping | CS_printable;

+
+ #ifdef WCHAR


+ /* We know printable characters from locale */
+ if (system_charset == st) {
+ prop |= CS_printable;
+ #ifdef WCWIDTH
+ prop |= CS_printable_len;
+ #endif
+ #ifdef __STDC_ISO_10646__
+ prop |= CS_mapping;
+ #endif

+ }
+
+ #endif
+

+ #ifndef ASCII_CTYPE
+ /* We know printable characters from locale */
+ if (system_charset == st)
+ prop |= CS_printable;
+ #endif
+
+ return prop;

+ }
+
+
+

+ S_(cs_iso2022_info_set cs_iso2022_info_set_unknown)
+ static int cs_iso2022_info_set_unknown P_((struct charcode_info *new_vals,
+ struct setlist *new_setlist,
+ int setcount));
+ static int cs_iso2022_info_set_unknown(new_vals, new_setlist,setcount)
+ struct charcode_info *new_vals;
+ struct setlist *new_setlist;
+ int setcount;
+ {
+ int ptr_94 = -1;
+ int ptr_96 = -1;
+ int banks[ISO2022_BANK_NUM];
+
+ if (!cs_info_set_scan(new_vals,new_setlist,setcount,&ptr_94,&ptr_96,
+ banks)) {

+ return 0;
+ }
+

+ new_vals->iso2022_info = loc_setlist(*new_setlist);
+ new_vals->flags &= ~SET_nodata;

+
+ return 1;
+ }
+
+

+ /* Return number of characters consumed */
+ S_(cs_estimate_clip_string cs_estimate_clip_unknown)
+ static int cs_estimate_clip_unknown(str,pos,len,terminal,printable_len)

+ const struct string *str;
+ int pos;

+ int len; /* UPPER LIMIT */
+ screen_info_p terminal;
+ struct cs_printable_len *printable_len;
+ {
+
+ if (pos < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_estimate_clip_unknown",
+ "Index out of array",0);
+
+ if (len < 0)
+ panic("STRING PANIC",__FILE__,__LINE__,"cs_estimate_clip_unknown",
+ "Negative size",0);
+
+

+ printable_len->ret_len = 0;
+

+ if (str->p->private_flag) {
+ /* Use wchars (locale) */

+
+ #ifdef WCHAR
+ int counter = 0;
+

+
+ }
+
+
+ return -1;
+ }
+
+
+

+ };
+
+
+
+
+

Kari E. Hurtta

unread,
Jul 28, 2005, 12:26:17 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.2

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 2/20 ) =========
Index: elmME+.2.5.alpha5-cvs/2.4/doc/Users.guide
*** elmME+.2.5.alpha4/2.4/doc/Users.guide 2004-07-04 14:36:51.000000000 +0300


--- /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300
***************

*** 1,1102 ****
- .\" @(#)$Id: Users.guide,v 1.1.2.1 2004/07/03 17:46:54 hurtta Exp $


- .\"
- .\" Users guide to the ELM mail system.
- .\" format with:
- .\" 'tbl Users.guide | troff tmac.n - > Users.fmtd'
- .\"
- .\" Elm is now in the public trust.
- .\"
- .\" (C) Copyright 1986,1987 Dave Taylor
- .\" (C) Copyright 1988-1992 Usenet Community Trust

- .\"
- .\"

- the number of messages in the folder, and the current Elm version number.
-

- .ps 10
- .sp 2

- .ps 10
- .sp 2

Index: elmME+.2.5.alpha5-cvs/charset/MAPPINGS/koi8-e.txt


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/charset/MAPPINGS/koi8-e.txt 2005-07-20 19:49:38.000000000 +0300
***************
*** 0 ****

Index: elmME+.2.5.alpha5-cvs/config.h.SH
*** elmME+.2.5.alpha4/config.h.SH 2003-08-16 09:58:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/config.h.SH 2005-07-20 19:49:36.000000000 +0300
***************
*** 274,281 ****


--- 274,283 ----
* spelling checker that is available to Elm.
*/
#$d_ispell ISPELL /**/
+ #ifdef ISPELL
#define ISPELL_PATH "$ispell_path" /**/
#define ISPELL_OPTIONS "$ispell_options" /**/
+ #endif

/* I_LOCALE:
* This symbol, if defined, indicates that the file locale.h
***************
*** 289,294 ****
--- 291,298 ----
#$d_nl_types I_NL_TYPES /**/
#$d_msgcat MSGCAT /**/
#$have_codeset HAVE_CODESET /**/
+ #$d_wchar WCHAR /**/
+ #$d_wcwidth WCWIDTH /**/

/* MALLOCVOID:
* This symbol, if defined, indicates that the malloc_t type should

Index: elmME+.2.5.alpha5-cvs/Configure
*** elmME+.2.5.alpha4/Configure 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/Configure 2005-07-26 17:57:08.000000000 +0300
***************


*** 8,14 ****
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150.8.9 2004/09/25 10:14:30 hurtta Exp $


#

: sanity checks
--- 8,14 ----
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#

! # $Header: /data/cvsroot/mail/elmme+/Configure,v 1.150.8.11 2005/07/26 14:57:08 hurtta Exp $


#

: sanity checks
***************
*** 146,151 ****
--- 146,158 ----
echo "Found bin directory"
fi

+ if test ! -d ../libs; then
+ echo "Making libs directory"
+ mkdir ../libs
+ else
+ echo "Found libs directory"
+ fi
+
case "$extractsh" in
true)

***************

*** 439,445 ****
i_curses=''
i_term=''
d_index=''
- d_internet=''
d_ispell=''
ispell_path=''
ispell_options=''
--- 446,451 ----


***************
*** 542,549 ****
d_usgnames=''
# passcat=''
rmttape=''
- roff=''
- roffopts=''
sigtype=''
spitshell=''
shsharp=''

--- 548,553 ----
***************
*** 567,572 ****
--- 571,578 ----


special_path2=''
dirname=''
locale_dir=''
+ d_wchar=''
+ d_wcwidth=''
CONFIG=''
: set package name

package=elmme+2.5
***************
*** 1391,1491 ****
EOSS
chmod +x filexp

- : ############### >>> ================== Commented out ROFF section
- if true
- then
- roff=none
- else
-

- if $test "$fastread" = yes; then
- dflt=y


- else
- dflt=n
- fi
- echo "Text processor $ans doesn't exist."
- rp="Use that name anyway? [$dflt]"
- $echo $n "$rp $c"
- . myread
- dflt=''
- case "$ans" in
- y*) cont='';;

- esac
- fi


- fi
- done
-
- if $test "$roff" != none ; then
- # determine text processor flags to use.
- $cat <<EOM
-
- If this text processor requires any options for proper formatting, specify
- them here. To specify no options, enter the word "none". Some versions
- of troff require the -t option to write to standard out. This is the
- proper place to specify that option.
-
- EOM
- dflt="$roffopts"
- rp="What options should Elm use with $roff: [$dflt]"
- $echo $n "$rp $c"
- . myread
- roffopts=$ans
- case "$roffopts" in
- 'none') roffopts=''
- ;;
- esac
- fi
-

- fi
- : ############### <<< ==================== Commented out ROFF section


-
: default clear to no extra flags
xencf=
xenlf=

--- 1397,1402 ----
***************
*** 1688,1698 ****


$cat > trivial.c <<EOF
#include <stdio.h>

int main (argc,argv)
int argc;

char * argv;
{
! exit(0);
}
EOF
if $cc $ccflags -o trivial trivial.c && ./trivial ; then

--- 1599,1613 ----


$cat > trivial.c <<EOF
#include <stdio.h>

+ #if defined(__STDC__)
+ int main (int argc, char * argv);
+ #endif
+

int main (argc,argv)
int argc;

char * argv;
{
! return 0;
}
EOF
if $cc $ccflags -o trivial trivial.c && ./trivial ; then
***************

*** 3755,3761 ****



EOF

! if $cc $ccflags -o try_langinfo try_langinfo.c $A $libs > try.log 2>&1 &&
./try_langinfo > result_charset 2> try2.log
then
cs="`cat result_charset`"

--- 3670,3676 ----



EOF

! if $cc $ccflags -o try_langinfo try_langinfo.c $libs > try.log 2>&1 &&
./try_langinfo > result_charset 2> try2.log
then
cs="`cat result_charset`"
***************

*** 3774,3786 ****


fi

$rm -f try_langinfo try_langinfo.c try.log result_charset try2.log
! fi

else

# If we do not have local support, we can not have nl_langinfo(CODESET) support
have_codeset="$undef"

# check to see if the macros are 8-bit clean, ask the user
$cat <<EOM

--- 3689,3897 ----

! {
! int i;


! mbstate_t a;
!
! wchar_t c;
! size_t r;
!
! wchar_t buffer1[10];
! const char *ptr;
!
! char buffer2[10];
! const wchar_t *ptr2;
!
!
! i = iswprint(L'a');
! if (!i) {

! fprintf (stderr, "iswprint(L'a') returned 0\n");
! exit(1);
! }


! i = iswprint(L' ');
! if (!i) {
! fprintf (stderr, "iswprint(L' ') returned 0\n");

! exit(1);
! }
!

! i = iswprint(L'\n');
! if (i) {
! fprintf (stderr, "iswprint(L'\\n') returned %d\n",i);

! exit(1);
! }
!

! i = iswcntrl(L'\n');
! if (!i) {
! fprintf (stderr, "iswcntrl(L'\\n') returned 0\n");

! exit(1);
! }
!

! memset(&a, 0, sizeof(a));
!
! r = mbrtowc(&c,"E", 1, &a);
!
! if (1 != r) {
! fprintf (stderr, "mbrtowc(&c,\"E\", 1, &A); returned %d\n",r);
! exit(1);

! }


! if (c != L'E') {
! fprintf (stderr, "mbrtowc(&c,\"E\", 1, &A); converted to %lc\n",c);

! exit(1);
! }
!
!

! memset(&a, 0, sizeof(a));
!
! ptr = "ELM";
! r = mbsrtowcs(buffer1,&ptr,10,&a);
! if (r != 3) {
! fprintf (stderr, "mbsrtowcs(buffer1,&ptr,10,&a) returned %d\n",r);
! exit(1);
! }
! if (ptr != NULL) {
! fprintf (stderr, "mbsrtowcs(buffer1,&ptr,10,&a) did not set ptr to NULL\n");

! exit(1);
! }
!

! i = wcscmp(buffer1,L"ELM");
! if (0 != i) {
! fprintf (stderr, "wcscmp(buffer1,L\"ELM\") returned %d\n",i);

! exit(1);
! }
!

! memset(&a, 0, sizeof(a));
! ptr2 = L"ELM";
!
! r = wcsrtombs(buffer2,&ptr2,sizeof buffer2,&a);
! if (r != 3) {
! fprintf (stderr, "wcsrtombs(buffer2,&ptr2,sizeof buffer2,&a) returned %d\n",r);
! exit(1);
! }
! if (ptr2 != NULL) {
! fprintf (stderr, "wcsrtombs(buffer2,&ptr2,sizeof buffer2,&a) did not set ptr2 to NULL\n");

! exit(1);
! }
!

! i = strcmp(buffer2,"ELM");
! if (0 != i) {
! fprintf (stderr, "strcmp(buffer2,\"ELM\") returned %d\n",i);

! exit(1);
! }
!

! {
! int i;
!

! i = wcwidth(L'\0');

!

! if (0 != i) {
! fprintf (stderr, "wcwidth(L'\\0') returned %d (0 expected)\n",
! i);

! exit(1);
! }
!

! i = wcwidth(L'a');
!
! if (1 != i) {
! fprintf (stderr, "wcwidth(L'a') returned %d (1 expected)\n",
! i);

! exit(1);
! }
!
!

*** 6330,6336 ****



EOF
d_havetlib=''
! for A in '' '-ltermlib' '-lcurses' '-ltermcap'; do
case "$d_havetlib" in
'')
echo " Trying ${A:-system} library"

--- 6441,6447 ----



EOF
d_havetlib=''
! for A in '' '-ltermlib' '-lcurses' '-ltermcap' '-lncurses'; do
case "$d_havetlib" in
'')
echo " Trying ${A:-system} library"
***************

*** 6399,6407 ****


"$undef:$define") dflt=c;;
*)
case "$uname_os" in
- Linux)
- dflt=b
- ;;
AIX|IRIX*)
dflt=c
;;

--- 6510,6515 ----
***************
*** 6834,6840 ****
i_curses='$i_curses'
i_term='$i_term'
d_index='$d_index'
- d_internet='$d_internet'
d_ispell='$d_ispell'
ispell_path='$ispell_path'
ispell_options='$ispell_options'
--- 6942,6947 ----
***************
*** 6954,6961 ****


d_usgnames='$d_usgnames'
# passcat='$passcat'
rmttape='$rmttape'
- roff='$roff'
- roffopts='$roffopts'
sigtype='$sigtype'
spitshell='$spitshell'
shsharp='$shsharp'

--- 7061,7066 ----
***************
*** 6977,6982 ****
--- 7082,7089 ----


special_path='$special_path'
special_path2='$special_path2'
locale_dir='$locale_dir'
+ d_wchar='$d_wchar'
+ d_wcwidth='$d_wcwidth'
CONFIG=true
EOT

Index: elmME+.2.5.alpha5-cvs/ConfTool/CharMap
*** elmME+.2.5.alpha4/ConfTool/CharMap 2002-01-26 13:14:44.000000000 +0200
--- elmME+.2.5.alpha5-cvs/ConfTool/CharMap 2005-07-20 19:49:37.000000000 +0300
***************
*** 1,4 ****


! # $Header: /data/cvsroot/mail/elmme+/ConfTool/CharMap,v 1.12 2001/11/25 11:25:43 hurtta Exp $
result="(unsupported)"
extra=""

--- 1,4 ----

! # $Header: /data/cvsroot/mail/elmme+/ConfTool/CharMap,v 1.12.96.1 2005/07/20 16:49:37 hurtta Exp $

Index: elmME+.2.5.alpha5-cvs/ConfTool/GenCharmap
*** elmME+.2.5.alpha4/ConfTool/GenCharmap 2003-09-05 23:33:17.000000000 +0300
--- elmME+.2.5.alpha5-cvs/ConfTool/GenCharmap 2005-07-20 19:49:37.000000000 +0300


***************
*** 1,17 ****
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenCharmap,v 1.17 2003/08/26 17:07:29 hurtta Exp $

! is_validcharset=
! if (CC="$cc"; export CC; cd ConfTool; $make validcharset); then
! is_validcharset=y
! $echo "ConfTool/validcharset compiled"
! else
! $echo "Failed to generate ConfTool/validcharset ..."
! $echo "bin/elm.mimecharsets will be incorrent or incomplete"
! sleep 20
! is_validcharset=n
! fi
!
! if $test $new = y ; then
cat >bin/elm.mimecharsets <<'EOM'
# Mapping from LC_CTYPE locale to MIME's charset values
# Format is:
--- 1,6 ----

! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenCharmap,v 1.17.46.1 2005/07/20 16:49:37 hurtta Exp $

Index: elmME+.2.5.alpha5-cvs/ConfTool/GenTerminalinfo
*** elmME+.2.5.alpha4/ConfTool/GenTerminalinfo 2003-09-05 23:33:17.000000000 +0300
--- elmME+.2.5.alpha5-cvs/ConfTool/GenTerminalinfo 2005-07-20 19:49:37.000000000 +0300
***************
*** 1,4 ****


! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenTerminalinfo,v 1.5 2003/09/05 19:31:30 hurtta Exp $

if $test $new = y ; then
cat >bin/elm.terminalinfo <<'EOM'
--- 1,4 ----

! # $Header: /data/cvsroot/mail/elmme+/ConfTool/GenTerminalinfo,v 1.5.46.1 2005/07/20 16:49:37 hurtta Exp $



if $test $new = y ; then
cat >bin/elm.terminalinfo <<'EOM'
***************
*** 71,77 ****
else
termname=
case "$type" in
! "ISO-2022/DW"|ISO-2022|PRIVATE|FLAG|ISO-2022-LIKE)
# Does not work completely correctly
if $fgrep "$terminal" bin/elm.terminalinfo | \
$fgrep "$set" > /dev/null ;
--- 71,77 ----
else
termname=
case "$type" in
! "ISO-2022/DW"|ISO-2022|PRIVATE|FLAG|ISO-2022-LIKE|DW)
# Does not work completely correctly
if $fgrep "$terminal" bin/elm.terminalinfo | \
$fgrep "$set" > /dev/null ;

Index: elmME+.2.5.alpha5-cvs/ConfTool/LocaleMap
*** elmME+.2.5.alpha4/ConfTool/LocaleMap 2002-01-26 13:14:44.000000000 +0200
--- elmME+.2.5.alpha5-cvs/ConfTool/LocaleMap 2005-07-20 19:49:37.000000000 +0300


***************
*** 1,6 ****
! # $Header: /data/cvsroot/mail/elmme+/ConfTool/LocaleMap,v 1.4 2000/03/21 05:59:12 hurtta Exp $
result=""
! if $test "$locale_dir" != none ; then
if $test -f $locale_dir/locale.alias ; then
charmap="`$egrep \"^$lc_ctype[ ]+\" < $locale_dir/locale.alias| $head -1 | $sed \"s/^$lc_ctype[ ]+//;\"`"
case "$charmap" in
--- 1,12 ----

! # $Header: /data/cvsroot/mail/elmme+/ConfTool/LocaleMap,v 1.4.114.1 2005/07/20 16:49:37 hurtta Exp $


result=""
! source=""
!
! tmp=cs-$$
!
! if $test $is_validcharset = y && ConfTool/validcharset "$lc_ctype" > $tmp; then
! result="`cat $tmp`"
! elif $test "$locale_dir" != none ; then
if $test -f $locale_dir/locale.alias ; then
charmap="`$egrep \"^$lc_ctype[ ]+\" < $locale_dir/locale.alias| $head -1 | $sed \"s/^$lc_ctype[ ]+//;\"`"
case "$charmap" in
***************
*** 18,22 ****
--- 24,30 ----
if $test "$result" = "(unsupported)" ; then
result=
fi
+ source=" from $locale_dir/locale.alias"
fi
fi
+ $rm -f $tmp

\ No newline at end of file
Index: elmME+.2.5.alpha5-cvs/ConfTool/Makefile
*** elmME+.2.5.alpha4/ConfTool/Makefile 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/ConfTool/Makefile 2005-07-20 19:49:37.000000000 +0300


***************
*** 4,9 ****
--- 4,12 ----
validcharset: validcharset.o precompiled_sets.o istrcmp.o
$(CC) $(CFLAGS) -o $@ validcharset.o precompiled_sets.o istrcmp.o

+ clean:


+ rm -f validcharset.o precompiled_sets.o istrcmp.o precompiled_sets.c istrcmp.c validcharset
+

validcharset.o: ../hdrs/elm_defs.h ../hdrs/elmlib.h ../hdrs/cs_imp.h

precompiled_sets.o: ../hdrs/elm_defs.h ../hdrs/elmlib.h ../hdrs/cs_imp.h
Index: elmME+.2.5.alpha5-cvs/ConfTool/mapfiles
*** elmME+.2.5.alpha4/ConfTool/mapfiles 2003-09-05 23:33:17.000000000 +0300
--- elmME+.2.5.alpha5-cvs/ConfTool/mapfiles 2005-07-20 19:49:37.000000000 +0300


***************
*** 39,41 ****
--- 39,42 ----
viscii.txt VISCII ;type=one-byte-map
dec-mcs.txt DEC-MCS ;type=ascii-set
hp-roman8.txt hp-roman8 ;type=ascii-set
+ koi8-e.txt KOI8-E ;type=ascii-set

Index: elmME+.2.5.alpha5-cvs/ConfTool/validcharset.c
*** elmME+.2.5.alpha4/ConfTool/validcharset.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/ConfTool/validcharset.c 2005-07-20 19:49:37.000000000 +0300


***************
*** 1,3 ****
--- 1,8 ----

+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.10.8.2 $ $State: Exp $


+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/

#include <stdio.h>
#include "elm_defs.h"
***************
*** 43,48 ****
--- 48,120 ----

Index: elmME+.2.5.alpha5-cvs/doc/answer.1
*** elmME+.2.5.alpha4/doc/answer.1 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/doc/answer.1 2005-07-20 19:49:38.000000000 +0300
***************
*** 111,117 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br

Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
--- 111,117 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2005 by Kari Hurtta
.br

Based on Elm 2.4, \fB\*(ct\fRCopyright 1988-1992 by The USENET Community Trust
.br
Index: elmME+.2.5.alpha5-cvs/doc/elm.1
*** elmME+.2.5.alpha4/doc/elm.1 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/doc/elm.1 2005-07-20 19:49:38.000000000 +0300


***************
*** 6,12 ****
.\}

.TH ELM 1L "Elm Version ME+ 2.5" "Kari Hurtta"


.SH NAME
! elm - an interactive mail system
.SH SYNOPSIS
.B elm
[
--- 6,12 ----
.\}

.TH ELM 1L "Elm Version ME+ 2.5" "Kari Hurtta"
.SH NAME


! elm ME - an interactive mail system, Millenium Edition
.SH SYNOPSIS
.B elm
[
***************

*** 183,188 ****
--- 183,191 ----


Write .elm/elmrc and .elm/mime.options in startup. Useful if your .elm/elmrc
have errors.
.TP
+ .B " -y"

+ Don't enter \fBElm\fR if no unread mail is pending.
+ .TP
.B " -z"
Zero - don't enter \fBElm\fR if no mail is pending.
.TP
***************
*** 303,309 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2004 by Kari Hurtta
.br

Based on Elm 2.5, \fB\*(ct\fRCopyright 1988-1995 by The USENET Community Trust
.br
--- 306,312 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 1996-2005 by Kari Hurtta
.br

Based on Elm 2.5, \fB\*(ct\fRCopyright 1988-1995 by The USENET Community Trust
.br
Index: elmME+.2.5.alpha5-cvs/doc/elmlibregister.1
*** elmME+.2.5.alpha4/doc/elmlibregister.1 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/doc/elmlibregister.1 2005-07-20 21:21:33.000000000 +0300


***************
*** 36,41 ****
--- 36,46 ----
Read global configuration files only (by default user
configuration files are read.)
.TP
+ .B " -c \fIold-values\fR "
+ Records old values for options (which gives errors) to
+ -I old-values
+ file.
+ .TP
.B " -d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR "
Debug - set specified debug level - Output to "$HOME/ELMLIBREGISTER:debug.info"
if
***************

*** 64,67 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003,2004 by Kari Hurtta
--- 69,72 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 2003-2005 by Kari Hurtta

Index: elmME+.2.5.alpha5-cvs/doc/elmrc-info
*** elmME+.2.5.alpha4/doc/elmrc-info 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/doc/elmrc-info 2005-07-25 21:35:36.000000000 +0300
***************
*** 1,4 ****
! #@(#)$Id: elmrc-info,v 1.61.2.14 2004/09/25 10:14:32 hurtta Exp $
# Elm Version ME+ 2.5


#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
--- 1,4 ----

! #@(#)$Id: elmrc-info,v 1.61.2.16 2005/07/25 18:35:36 hurtta Exp $
# Elm Version ME+ 2.5


#
#$HDR - magic line to mark comments to put at top of user's elmrc file.
***************

*** 7,158 ****
#
# Lines beginning with "#" (like this one!) are comments.
#
! # The "###" lines mean that you do not have a value set and the system
! # default will be used. The value shown was the default at the time
! # this file was created. Yes...the default could have changed between
! # then and now.
#

! add-in-reply-to-phrase
! # RFC 2822 (obsoletes RFC 822) allows only message-id to be included
! # to in-reply-to.
! # When set, adds also phrase to in-reply-to (violates RFC 2822)

! add-sender
! # If set (default), Elm adds Sender: -header if user specifies From: -header
! # or envelope sender address (aka Return-Path).
! # If there is more than one address on From: -header,
! # Sender: -header is always added.
! # See also: mailer

! allow-charset-switching
! # When set, switch display charset between charsets supported by terminal
! #
! # See also: page-known-charsets, displaycharset, charset-convert-ok

! attachment-dir
! # From which or to which directory read/save attachments.
! # This is provided as {doc}/ prefix on correspond filename prompts.

! auto-attachment
! # Possible values are: none, application, non-text
! # This affect how mime-parts with no Content-Disposition header,
! # are treated.
! # * If auto-attachment is none, missing Content-Disposition is
! # treated as "Content-Disposition: inline".
! # That is what MIME requires.
! # * If auto-attachment is application, type is subtype of
! # application and Elm can not handle type without calling
! # metamail (or mailcap programs), missing Content-Disposition
! # is treated as "Content-Disposition: attachment".
! # * If auto-attachment is non-text, type is not subtype
! # of text or multipart, type is not message/rfc822
! # and Elm can not handle type without calling
! # metamail (or mailcap programs), missing Content-Disposition
! # is treated as "Content-Disposition: attachment".
! #
! # See also: charset-convert-ok, page-known-charsets, pagealternative,
! # pagemultipart

! auto-iso-8859
! # Autocreate undefined ISO-8859-X charsets as superset of US-ASCII.
! # RFC 2046 (MIME Part Two: Media Types) requires this.
! #
! # See also: compatcharsets, auto-attachment

! charset-convert-ok
! # Inhibit "[ Charset xxx converted... ]" message when charset
! # is converted (to unicode ie. without loss). Also use "pager"
! # to display charset (instead of metamail).
! #
! # See also: allow-charset-switching, displaycharset, page-known-charsets,
! # auto-attachment

! shell
! # The shell to use for shell escapes
! # If not set value from passwd is used

! fragment-handling
! # How fragmented (message/partial) should be handled?
! # none Call metamail (if available) for these
! # manual Let user give command 'A' to enter message
! # assembly mode
! # auto Go automatically message assembly mode

! fullname
! # The full user name for outbound mail

! maildir
! # where to save my mail to, default directory is "Mail"

- mailpermissions
- # permissions to be given to newly-created saved mail files, default rw-------
-
tmpdir
! # where to place temporary files, default directory is "/tmp"
#
# See also: local-sessionlock-dir

! receivedmail
! # where to save received messages to, default file is "=received"

! editor
! # what editor to use ("none" means simulate Berkeley Mail)
! # See also: alteditor

! alteditor
! # name of editor to use for replies that have text
! # Value EDITOR means that use value of "editor"
! # See also: editor

! easyeditor
! # name of editor for ~e command (when editor="builtin")

! visualeditor
! # name of editor for ~v command (when editor="builtin")

! escape
! # the character to use in the builtin editor for entering commands

! editflush
! # Flush the input buffer after returning from an external editor?

- extra-mailbox-dir
- # Folders on that directory is considered to be spool mailboxes
- # (ie. it is prepared that to they is arrived new mail when
- # they are open). This directory must be different than
- # folders or maildir directory (ie. ~/Mail).
- #
- # See also: incomingfolders

! incomingfolders
! # List of folders which are incoming folders. Incoming folders are
! # handled like your spool mailbox.
#
- # See also: extra-mailbox-dir

! send-mime-plain-text
! # When set, Text/Plain with charset US-ASCII is sent with MIME headers.
! # When unset, MIME headers are not included to plain US-ASCII text messages
! # when content-transfer-encoding is 7bit (identity). Default: True

! sentmail
! # where to save copies of outgoing mail to, default file is "=sent"

! calendar
! # where to save calendar entries

sortby


# how to sort folders, "Reverse Sent" by default

!
! sort-thread-max-time
! # What is maximum time in days between mails so that
! # they can considered to be same thread (when subject is same)

showmlists
# Should mailing list info be displayed for messages at startup?
# The "M" command toggles this on and off.

tochars
# When "showmlists" is off, a single-character mark is displayed
# to indicate who the message is to. This five-character string
--- 7,176 ----
#
# Lines beginning with "#" (like this one!) are comments.
#
! #
! # Some of the option settings are commented out with "###". This means
! # that you do NOT have a value set for the option, and the system default
! # will be used. (The value shown is the default at the time this file
! # was created.) If you wish to enable one of these options, you MUST
! # delete the "###" to de-comment the entry.
! #
! # For the yes/no settings, say ON for yes and OFF for no.
!
! $user
! # For more detailed description of these settings, see the Elm Reference Guide.
! #
! # --- Table of Contents ---
! #
! # 1. General Program Configuration Options
! # 2. Main Message Selection Screen Options
! # 3. Message Display/Pager Options
! # 4. Editor Options
! # 5. Message Composition Options
! # 6. Signature Options
! # 7. Program Termination/Folder Cleanup Options
! # 8. Folder Handling Options
! # 9. MIME and Character Set Options
#

! $usersection
! #-----------------------------------------------------------------------
! #
! # Section 1: General Program Configuration Options
! #

! userlevel
! # Are we good at it? 0=beginner, 1=intermediate, 2 and above=expert.
! # Lower levels give more verbose prompts. Higher levels make advanced
! # options available.

! sleepmsg
! # After displaying a transient message, Elm will pause this many seconds
! # before erasing it. Can be 0 or a positive integer.

! timeout
! # After this many seconds of inactivity, Elm will re-check the mailbox
! # for new messages.

! forms
! # Enable AT&T Mail forms support?

! usetite
! # Would you like to use termcap/terminfo ti/te (screen switch) entries?

! readmsginc
! # When initially reading in a mail folder, the status display is updated
! # whenever this many more messages are processed. A large number helps
! # avoid lots of output on slow terminal connecitons.

! readdatapercentinc
! # Value by which percent count is incremented while reading a new mailbox.
! # Actual increments depends both of readdatapercentinc and readmsginc
! # See also: readmsginc

! print
! # Command to print a message ('%s' is the filename)

! printhdrs
! # List of headers to select and weed when printing messages.
! #
! # NOTE: This is used with p)rint -command (disabled)
! # and not with P)rint text command

! shell
! # The shell to use for shell escapes. If not set value from passwd is used.

tmpdir
! # Directory to use for temporary files.
#
# See also: local-sessionlock-dir

! calendar
! # Pathname to the saved calendar entries file.

! aliassortby
! # How to sort the alias list, "Name" by default
! # Possible values: alias, reverse-alias
! # name, reverse-name
! # text, reverse-text

! alternatives
! # alternative addresses that I could receive mail from (usually a
! # forwarding mailbox) and don't want to have listed...
! #
! # See also: showto

! showto
! # if this variable is ON, Elm will show who the message is to rather than
! # who it is from in the headers display if the message is not
! # addressed to user.
! #
! # See also: alternatives

! configoptions
! # list of options that can be configured at the "o)ptions" screen

! set-window-title
! # Enables automatic updating of window's tile and incon name when
! # folder is changed. File ~/.elm/terminal.info or global elm.terminalinfo
! # must specify chnaging method used for given terminal.

! browser-wildcard-matching
! # If '*' or '?' are used on filename prompts, should these interprete
! # as wildcards?


! convert-comment-to-fullname
! # Elm 2.4ME+ PL55 parses addresses like:
! # fullname <address>
! # fullname <address> (comment)
! # address (comment)
! # When convert-comment-to-fullname is set, addresses are parsed like
! # address (fullname)
! # instead. That convert-comment-to-fullname is set by default for
! # compatibilty of older versions of Elm.
!
! verify-domain
! # If set mail domains are verified by gethostbyname().
! # Error HOST_NOT_FOUND is treated as nonexisting domain and error NO_ADDRESS
! # is treated as valid mail domain.
!
! verify-local-address
! # If set usernames of local addresses are verified. Using this option
! # requires that on global elm.rc have "verify=yes" on mailer -option.
!
! $usersection
! #-----------------------------------------------------------------------
! #
! # Section 2: Main Message Selection Screen Options
#

! arrow
! # Mark selected message with "->" rather than the inverse video bar?

! menu
! # Display the three-line "mini-menu" of commands?

! menu-display-host
! # Should we display host on mailbox menu?

sortby


# how to sort folders, "Reverse Sent" by default

! # Possible values: sent, reverse-sent
! # thread, reverse-thread
! # received, reverse-thread
! # sender, reverse-sender
! # size, reverse-size
! # subject, reverse-subject
! # mailbox, reverse-mailbox
! # status, reverse-status
! #
! # See also: unstable-reverse-thread

showmlists
# Should mailing list info be displayed for messages at startup?
# The "M" command toggles this on and off.

+
tochars
# When "showmlists" is off, a single-character mark is displayed
# to indicate who the message is to. This five-character string
***************
*** 164,210 ****
# - Mark for mail which have List-Id header (ie. mailing list identification)
# An underscore "_" in this list will display as a blank.
# the default value is _TC*L
- #



! aliassortby
! # how to sort the alias list, "Name" by default

! print
! # how to print a message ('%s' is the filename)

! printhdrs
! # List of headers to select and weed when printing messages.
#
- # NOTE: This is used with p)rint -command (disabled)
- # and not with P)rint text command

! attribution
! # Attribution string for replies. "%F" is the author of original message.

! fwdattribution
! # Attribution for forwarded messages. "%F" is original author.
! # Something like: "--- %[begin|end] forwarded message from %F ---"

! prefix
! # prefix sequence for indenting included message text in outgoing messages...

weedout
! # what headers I DON'T want to see, ever.
#
# If first element on list is "*clear-weed-list*" then builtin
# weedout list is not used.

! bounceback
! # threshold for bouncing copies of remote uucp messages...
! # zero = disable function.

! timeout
! # Set the main prompt timeout for resynching...

! autocopy
! # automatically copy message being replied to into buffer?

askreplycopy
# When replying to a message, ask "Copy message?" into editing buffer?
--- 182,293 ----
# - Mark for mail which have List-Id header (ie. mailing list identification)
# An underscore "_" in this list will display as a blank.
# the default value is _TC*L

+ showreply
+ # Should messages to which you've replied be shown with an "r" mark?

+ pointnew
+ # Start up by pointing to the first new message received, if possible?

! movepage
! # When moving to next or previous page of messages, should the current
! # message pointer also move onto that page?

! resolve
! # Increment the message pointer only after the message has been fully
! # disposed (saved or deleted)? If OFF, then the message pointer is
! # incremented after you do anything that touches the message.

!
! $usersection
! #-----------------------------------------------------------------------
! #
! # Section 3: Message Display/Pager Options
#

! pager
! # program to use for displaying messages ('builtin' is recommended)

! titles
! # display message title when displaying pages of message?

! builtinlines
! # This determines whether the builtin pager should be used instead of
! # an external pager (if you defined one above). If the value is greater
! # than zero, then the builtin pager is used for any message shorter than
! # that number of lines. If the value is less than zero, the builtin
! # pager is used if the message is that many lines shorter than the size
! # of the screen. If zero, the external pager always is used.
!
! prompt-after-metamail
! # prompt after the metamail exits?
!
! prompt-after-pager
! # prompt for a command after the external pager exits?
!
! prompt-metamail
! # Ask from user, should metamail be called?
!
! weed
! # Enable the weedout list to be read?

weedout
! # What headers I DON'T want to see, ever.
#
# If first element on list is "*clear-weed-list*" then builtin
# weedout list is not used.

! header-phrase-display-mode
! # plain: Show phrases as is (without quotation)
! # quoted: Show phrases on quoted form

! $usersection
! #-----------------------------------------------------------------------
! #
! # Section 4: Editor Options
! #

! editor
! # Name of editor to use for composing messages. "none" or "builtin"
! # uses the simple built-in editor.
!
! alteditor
! # name of editor to use for replies that have text
! # Value EDITOR means that use value of "editor"
! # See also: editor
!
!
! easyeditor
! # Name of editor for ~e command (when editor="builtin")
!
! visualeditor
! # Name of editor for ~v command (when editor="builtin")
!
!
! escape
! # The character to use in the builtin editor for entering commands
!
! editflush
! # Flush the input buffer after returning from an external editor?
!
! $usersection
! #-----------------------------------------------------------------------
! #
! # Section 5: Message Composition Options
! #
!
! fullname
! # The full user name for outbound mail. NOTE: Many mail systems add
! # From: lines on their own and this setting has no effect!!! If your
! # system is one of those, you might want to try things such as the
! # "chfn" command or setting the NAME environment parameter.
!
! askcc
! # would you like to be asked for Carbon-Copies information each msg?
!
! metoo
! # When you send a message to an alias that contains you, would you
! # like to receive a copy of the message?

askreplycopy
# When replying to a message, ask "Copy message?" into editing buffer?
***************
*** 213,418 ****
replycopy
# Should the default for the "Copy message?" question be "yes"?

! copy
! # save a copy of all outbound messages?
!
! resolve
! # emulate the mailx message increment mode (only increment after
! # something has been 'done' to a message, either saved or deleted,
! # as opposed to simply each time something is touched)?
!
! weed
! # enable the weedout list to be read?

! mailer
! # This tells type of mailer, value can be one of
! # unknown, sendmail, submitmail, execmail
! # After these parameters there can be following additional options
! # path= gives path of mailer
! # add-from=dont, add-from=yes,
! # use-domain=no, use-domain=yes,
! # supported-bodytype=7bit, supported-bodytype=8bit,
! # supported-bodytype=binary
! # supports-dsn=no, supports-dsn=yes
! # verify=no, verify=yes
! # allow-set-sender=no, allow-set-sender=yes
! # See also: add-sender

! metamail
! # This tells path of metamail program
#
! # That version (Elm 2.4ME+) does not use Metamail's companion programs
! # (suchs as mmencode) directly, but metamail package supposes that
! # companion programs are installed to search path.
! #
! # Special values: none Don't call metamail
! # metamail Don't call metamail if environment
! # variable $NOMETAMAIL is defined

! noencoding
! # This control makes it possible to send raw 8bit or binary data when the MTA
! # doesn't support 8BITMIME and the -B8BITMIME option or
! # BINARYMIME and the -BBINARYMIME option
! #
! # Possible values:
! # pass-7bit (0) : Always convert 8BIT and BINARY data to QUOTED-PRINTABLE
! # if the MTA doesn't support the -B8BITMIME and
! # -BBINARYMIME options.
! # pass-8bit (1) : Allow 8bit without -B8BITMIME, but binary data is
! # encoded
! # pass-binary (2) : Allow binary without -BBINARYMIME and and 8bit without
! # -B8BITMIME
! #
! # It is STRONGLY recommended that it be left set to pass-7bit unless you know
! # what you are doing!!
! #
! # Elm doesn't yet fully support BINARYMIME: it requires that text lines are
! # terminated with \r\n, Unix's \n isn't sufficient!
! # That is only partially implemented in this version of Elm.
! #
! # Quote from RFC 1830 (Experimental Protocol):
! # SMTP Service Extensions for Transmission of Large and Binary MIME Messages
#
! # It is important to note that when using BINARYMIME, it is
! # especially important to ensure that the MIME message itself is
! # properly formed. In particular, it is essential that text be
! # canonically encoded with each line properly terminated with <CR>
! # <LF>. Any transformation of text into non-canonical MIME to
! # observe local storage conventions must be reversed before sending
! # as BINARYMIME. The usual line-oriented shortcuts will break if
! # used with BINARYMIME.

! nohdrencoding
! # Don't do MIME part 2 (RFC 1522) encoding for 8-bit headers?
! # Because 8-bit data is not allowed in headers,
! # it is STRONGLY recommended that this is left set to OFF

! noheader
! # when messages are copied into the outbound buffer, don't include headers?
! # when replying

! noheaderfwd
! # when messages are copied into the outbound buffer, don't include headers?
! # when forwarding
! # (Notice that messages are not copiend to outbound buffer when
! # mimeworward = ON)


! titles
! # display message title when displaying pages of message?

! savebyalias
! # Save messages, incoming and outbound, by alias of sender/recipient?

! savename
! # save messages, incoming and outbound, by login name of sender/recipient?

! forcename
! # save outbound messages by login name of sender/recipient even if the
! # associated folder doesn't already exist?

- movepage


- # when using the page commands (+ - <NEXT> <PREV>) change the current
- # message pointer...?

! page-known-charsets
! # Should Elm use "pager" to display charsets (other than display charset)
! # if charset is known (ie. it probably can be converted to display charset).
! # This should be set, if mapping information is given to elm and metapager
! # can not do better.
#
- # See also: allow-charset-switching, displaycharset, charset-convert-ok,
- # auto-attachment

! pointnew
! # start up by pointing to the first new message received, if possible?

! showreply
! # Should messages to which you've replied be shown with an "r" mark?

! set-window-title
! # Enables automatic updating of window's tile and incon name when
! # folder is changed. File ~/.elm/terminal.info or global elm.terminalinfo
! # must specify chnaging method used for given terminal.

! signature
! # ".signature" file to append to outbound messages...

! localsignature
! # local ".signature" file to append to appropriate messages...

! remotesignature
! # remote ".signature" file to append to appropriate messages...

! sigdashes
! # do we want dashes above signatures? (News 2.11 compatibility and convention)

alwayskeep
! # should the default be to keep unread messages in the incoming mailbox?

alwaysstore
! # should the default be to store read messages to the "received" folder?

! alwaysdelete
! # should the default be to delete messages we've marked for deletion?

! pager
! # program to use for displaying messages ('builtin' is recommended)

! prompt-after-metamail
! # prompt after the metamail exits?

! prompt-after-pager
! # prompt for a command after the external pager exits?

! browser-wildcard-matching
! # If '*' or '?' are used on filename prompts, should these interprete
! # as wildcards?

! builtinlines
! # This is used to determine if the builtin pager should be used on some
! # messages even if you would usually use an external pager program.
! # There are two ways of determining whether the builtin pager should be
! # used. If you want any message that is shorter than "n" lines to use the
! # internal pager, set the parameter to "n". If you want the builtin
! # pager to be used if the message is "m" lines shorter than the number of
! # lines on your screen set the parameter to be "-m". Setting the
! # parameter to zero will result in the message always being sent through
! # your external pager.

! keepempty
! # should we keep folders from which all messages are deleted?

! keypad
! # are we running on an HP terminal and want HOME, PREV, NEXT, etc...?

! softkeys
! # are we running on an HP terminal and want softkeys available too?
! # (this implies "keypad=ON" too)

! alternatives
! # alternative addresses that I could receive mail from (usually a
! # forwarding mailbox) and don't want to have listed...
#
! # See also: showto

! forms
! # do we want to be able to mail out AT&T Mail Forms?

! userlevel
! # are we good at it? beginner (0), intermediate (1), expert (2)

! names
! # just show the names when expanding aliases?

! arrow
! # should we use the "->" rather than the inverse video bar?

- menu
- # should we display the three-line 'mini' menu?

! menu-display-host
! # Should we display host on mailbox menu?

message-hide-hack
# Possible values: none
--- 296,532 ----
replycopy
# Should the default for the "Copy message?" question be "yes"?

! noheader
! # when messages are copied into the outbound buffer, don't include headers?
! # when replying

! noheaderfwd
! # when messages are copied into the outbound buffer, don't include headers?
! # when forwarding
! # (Notice that messages are not copiend to outbound buffer when
! # mimeworward = ON)

! mimeforward
! # This option controls how Elm will forward messages when MIME is defined.
! # ON: Causes Elm to send the message as a MIME part of type
! # MESSAGE/RFC822. Highly recommended when forwarding MIME
! # messages so that the receiver can correctly view the message!
! # OFF: Elm will include the forwarded message in your editor instead
! # of making it an separate mime body part.
#
! # See also: askmimeforward

! askmimeforward
! # This option controls is forwarding as message/rfc822 prompted or not
! # if set, option mnimeforward controls only default value for prompt
#
! # See also: mimeforward

! quoteforward
! # Forwarded messages are quoted like replies, rather than included
! # with "Forwarded message" and "End of forwarded message" banners
! # above and below. This has no effect if "mimeforward" is TRUE.

! prefix
! # Prefix to mark included message text. Use "_" for a space.

! attribution
! # Attribution string for replies. "%F" is the author of original message.
!
! fwdattribution
! # Attribution for forwarded messages. "%F" is original author.
! # Something like: "--- %[begin|end] forwarded message from %F ---"

+ precedences
+ # list of delivery precedences allowed, or empty to allow anything
+ # precedence may be followed by optional ":priority" specification

! names
! # When showing To: addresses, just display the recipient name?
! # If OFF, show entire recipient address.

! send-mime-plain-text
! # When set, Text/Plain with charset US-ASCII is sent with MIME headers.
! # When unset, MIME headers are not included to plain US-ASCII text messages
! # when content-transfer-encoding is 7bit (identity). Default: True

! add-in-reply-to-phrase
! # RFC 2822 (obsoletes RFC 822) allows only message-id to be included
! # to in-reply-to.
! # When set, adds also phrase to in-reply-to (violates RFC 2822)

! dsn-success
! # If TRUE, success Delivery-Status-Notifications are asked by default.


! $usersection
! #-----------------------------------------------------------------------
! #
! # Section 6: Signature Options
#

! localsignature
! # Local ".signature" file to append to appropriate messages.

! remotesignature
! # Remote ".signature" file to append to appropriate messages.

! sigdashes
! # Place dashes line above signatures? (Usenet compatibility and convention)

! $usersection
! #-----------------------------------------------------------------------
! #
! # Section 7: Program Termination/Folder Cleanup Options
! #

! askdelete
! # Should the "Delete messages?" question be asked when you exit, resync,
! # or change folders? If OFF, then the "alwaysdelete" action is taken
! # without asking.

! askkeep
! # Should the "Keep unread messages in incoming mailbox?" question be
! # asked when you exit, resync, or change folders? If OFF, then the
! # "alwayskeep" action is taken without asking.

! askstore
! # Should the "Move read messages to received folder?" question be asked
! # when you exit, resync, or change folders? If OFF, then the "alwaysstore"
! # action is taken without asking.
!
! alwaysdelete
! # Should the default for the "Delete messages?" question be "yes"?

alwayskeep
! # Should the default for the "Keep unread messages in incoming mailbox?"
! # question be "yes"?

alwaysstore
! # Should the default for the "Move read messages to received folder?"
! # question be "yes"?

! keepempty
! # Should we keep folders from which all messages are deleted?
! # If OFF then the empty folder files are deleted.

! $section
! #-----------------------------------------------------------------------
! #
! # Section 8: Folder Handling Options
! #

! maildir
! # Where to save my mail to.

! mailpermissions
! # permissions to be given to newly-created saved mail files, default rw-------

! copy
! # save a copy of all outbound messages?

! sentmail
! # Name of folder in which copies of outgoing messages are saved.

! receivedmail
! # Name of folder in which received messages are saved.

! savebyalias
! # Save messages, incoming and outbound, by alias of sender/recipient?

! savename
! # Save messages, incoming and outbound, by login name of sender/recipient?

! forcename
! # Save outbound messages by login name of sender/recipient even if the
! # associated folder doesn't already exist?
!
! confirmappend
! # Should elm always ask the user to confirm before it appends
! # messages to any existing file?
! # This is used for both folders in the user's mail directory
! # and ordinary files.
!
! confirmcreate
! # Should elm always ask the user to confirm before it creates
! # any new files?
! # This is used for both folders in the user's mail directory
! # and ordinary files.
!
! confirmfiles
! # Should elm ask for confirmation before it appends a message
! # to an existing file that is not a folder in the user's Mail
! # directory?
! # This is used for ordinary files only and does not affect
! # folders in the user's mail directory.
!
! confirmfolders
! # Should elm ask for confirmation before it creates a new folder
! # in the user's Mail directory?
! # This is used only for folders in the user's mail directory and
! # does not affect ordinary files.
!
! confirmtagsave
! # Should Elm ask for confirmation before saving tagged messages to a
! # folder when the cursor is on an untagged message?
!
!
! extra-mailbox-dir
! # Folders on that directory is considered to be spool mailboxes
! # (ie. it is prepared that to they is arrived new mail when
! # they are open). This directory must be different than
! # folders or maildir directory (ie. ~/Mail).
#
! # See also: incomingfolders

! incomingfolders
! # List of folders which are incoming folders. Incoming folders are
! # handled like your spool mailbox.
! #
! # See also: extra-mailbox-dir

! dead-letter-dir
! # Name of Canceled.mail.dir

! unstable-reverse-thread
! # If set, reverse thread sorting is based on lastest message on thread.
! # Therefore thread moves to new location, when new message arrives to
! # thread.
! #
! # See also: sortby

! sort-thread-max-time
! # What is maximum time in days between mails so that
! # they can considered to be same thread (when subject is same)


! lock-in-copy
! # If set, elm will lock a folder when trying to save or copy to it.
! # NOTICE: Does not work with dot-locking
!
! lock-folders
! # if set, elm will lock a folder, when it is open.
! #
! # NOTICE: It is not possible to deliver mail to a locked folder. So
! # take care that incoming mail folders are treated as mailboxes.
! # This variable does not effect handling of mailboxes.
! #
! # NOTICE: Does not work with dot-locking
!
!
! env-from-source
! # Tells which information to use for envelope from address.
! # Possible values include:
! # forward-from (0) Use: "From " separator line
! # ">From " forwarded indicator
! # "Return-Path:" header
! # from (1) Use: "From " separator line
! # "Return-Path:" header
! # return-path (2) Use: "Return-Path:" header
! #
! # Setting this to value return-path requires that on every mail have
! # Return-Path: -header.
!

message-hide-hack
# Possible values: none
***************
*** 426,460 ****
# not effect to any tools of elm. In other words 'frm' shows that
# management mail.

- metoo
- # would you like a copy of a message you send to an alias you are on?
-
- ask


- # should the message disposition questions be displayed(ON) or

- # auto-answered(OFF) with the default answers when we resync or
- # change folders?
-
- askdelete
- # Should the "Delete messages?" question be asked when you exit, resync,
- # or change folders? If OFF, then the "alwaysdelete" action is taken
- # without asking.

! askkeep
! # Should the "Keep unread messages in incoming mailbox?" question be
! # asked when you exit, resync, or change folders? If OFF, then the
! # "alwayskeep" action is taken without asking.

! askstore
! # Should the "Move read messages to received folder?" question be asked
! # when you exit, resync, or change folders? If OFF, then the "alwaysstore"
! # action is taken without asking.

! askcc
! # would you like to be asked for Carbon-Copies information each msg?

! precedences
! # list of delivery precedences allowed, or empty to allow anything
! # precedence may be followed by optional ":priority" specification

text-charset
# Name of Character Set used with MIME text/plain Content-type
--- 540,640 ----
# not effect to any tools of elm. In other words 'frm' shows that
# management mail.


! default-folder-status
! # In folders, should messages without Status header be marked
! # Old (0)
! # New (1)
! # Read (2)

! local-dir-sortby
! # How to sort local files and folders on folder and file browser?
! # Possible values: none
! # name, reverse-name
! # mtive, reverse-mtime
! # See also: imap-dir-sortby

! local-sessionlock-use-home
! # This variable controls to where put temporary file when local
! # mailbox is opened.
! #
! # Possible values are:
! # never Temporray file is put according of
! # local-sessionlock-dir and tempdir
! # spool Temporary file for mailbox on spool
! # is put to home directory
! # always Temporary file for mailbox is put
! # to home directory
! # non-spool Temporary file for mailbox on not in spool
! # is put to home directory

! local-sessionlock-dir
! # If opened local mailbox is on spool directory, this setting tells
! # to where put temporary file mbox.{mailbox}. ( If opened local
! # mailbox is not on spool directory, location of temporary file
! # mbox.{mailbox}-{username} is given on tmpdir variable )
! #
! # See also: tmpdir, local-sessionlock-use-home
!
! show-header-errors
! # if this variable is ON, show certain header errors
!
!
! $usersection
! #-----------------------------------------------------------------------
! #
! # Section 9: MIME and Character Set Options
! #
!
! displaycharset
! # When set other that SYSTEM, specifies Character Set to which
! # display should be switch if supported by terminal. Character
! # Set of terminal is switched back to System Character Set (given
! # on elm.mimecharsets or ~/.elm/mime.charsets file) when running
! # external programs. This switching is done even when option
! # allow-charset-switching is not set.
! #
! # Needs information from elm.terminalinfo or ~/.elm/terminal.info file.
! #
! # NOTICE that this (or Character Sets provided by locale) must have
! # mapping tables available if "text-charset" value is not DISPLAY
! #
! #
! # See also: page-known-charsets, allow-charset-switching, local-fs-charset,
! # text-charset
!
! compatcharsets
! # List of (8-bit) Character Sets, which are byte-to-byte supersets of
! # US-ASCII.
! #
! # NOTE: That same information can be given on .elm/mime.charsets file with
! # ';MIME-subset=US-ASCII' qualifier -- that is preferred method.
! #
! # In fact this option should never be set explicity.
! #
! # See also: page-known-charsets, iso646-charsets, auto-iso-8859
!
! iso646-charsets
! # List of 7-bit Character Sets, which are byte-to-byte supersets of
! # INVARIANT.
! #
! # NOTE: That same information can be given on .elm/mime.charsets file with
! # ';MIME-subset=INVARIANT' qualifier -- that is preferred method.
! #
! # In fact this option should never be set explicity.
! #
! # See also: page-known-charsets, compatcharsets
!
! locale-charsets
! # For these charsets is type type unknown used for system (locale)
! # charset, even when Elm ME+ is builtin defination for charset.
! #
! # Available only if system supports wide characters and
! # __STDC_ISO_10646__ is defined.
! #
! # This option may cause error message
! # Unknown charsets are unsupported as keyboard input!
! # to be printed in that case this option can not be used for given charset.

text-charset
# Name of Character Set used with MIME text/plain Content-type
***************
*** 475,480 ****
--- 655,690 ----
# See also: displaycharset, local-fs-charset, allow-charset-switching,
# utf7-encode-optional

+ page-known-charsets
+ # Should Elm use "pager" to display charsets (other than display charset)
+ # if charset is known (ie. it probably can be converted to display charset).
+ # This should be set, if mapping information is given to elm and metapager
+ # can not do better.
+ #
+ # See also: allow-charset-switching, displaycharset, charset-convert-ok,
+ # auto-attachment
+
+ charset-convert-ok
+ # Inhibit "[ Charset xxx converted... ]" message when charset
+ # is converted (to unicode ie. without loss). Also use "pager"
+ # to display charset (instead of metamail).
+ #
+ # See also: allow-charset-switching, displaycharset, page-known-charsets,
+ # auto-attachment
+
+
+ allow-charset-switching
+ # When set, switch display charset between charsets supported by terminal
+ #
+ # See also: page-known-charsets, displaycharset, charset-convert-ok
+
+ auto-iso-8859
+ # Autocreate undefined ISO-8859-X charsets as superset of US-ASCII.
+ # RFC 2046 (MIME Part Two: Media Types) requires this.
+ #
+ # See also: compatcharsets, auto-attachment
+
+
default-mime-text-charset
# Name of (assumed) charset for text/plain MIME messages (if charset is
# not given):
***************
*** 491,519 ****
# TEXT value of text-charset
# US-ASCII charset is US-ASCII (required by standards)

- default-folder-status
- # In folders, should messages without Status header be marked
- # Old (0)
- # New (1)
- # Read (2)
-
- displaycharset
- # When set other that SYSTEM, specifies Character Set to which
- # display should be switch if supported by terminal. Character
- # Set of terminal is switched back to System Character Set (given
- # on elm.mimecharsets or ~/.elm/mime.charsets file) when running
- # external programs. This switching is done even when option
- # allow-charset-switching is not set.
- #
- # Needs information from elm.terminalinfo or ~/.elm/terminal.info file.
- #
- # NOTICE that this (or Character Sets provided by locale) must have
- # mapping tables available if "text-charset" value is not DISPLAY
- #
- #
- # See also: page-known-charsets, allow-charset-switching, local-fs-charset,
- # text-charset
-

local-fast-lookup
# If set indicates that directory listing not needed for lookup.
# Need to be unset, if same character on local-fs-charset has several

--- 701,706 ----
***************
*** 537,685 ****
# See also: allow-charset-switching, local-fast-lookup, displaycharset,
# text-charset, page-known-charsets

! local-sessionlock-dir
! # If opened local mailbox is on spool directory, this setting tells
! # to where put temporary file mbox.{mailbox}. ( If opened local
! # mailbox is not on spool directory, location of temporary file
! # mbox.{mailbox}-{username} is given on tmpdir variable )
! #
! # See also: tmpdir, local-sessionlock-use-home

! local-sessionlock-use-home
! # This variable controls to where put temporary file when local
! # mailbox is opened.
! #
! # Possible values are:
! # never Temporray file is put according of
! # local-sessionlock-dir and tempdir
! # spool Temporary file for mailbox on spool
! # is put to home directory
! # always Temporary file for mailbox is put
! # to home directory
! # non-spool Temporary file for mailbox on not in spool
! # is put to home directory

- dsn-success
- # If TRUE, success Delivery-Status-Notifications are asked by default.

! compatcharsets
! # List of (8-bit) Character Sets, which are byte-to-byte supersets of
! # US-ASCII.
#
! # NOTE: That same information can be given on .elm/mime.charsets file with
! # ';MIME-subset=US-ASCII' qualifier -- that is preferred method.
#
! # In fact this option should never be set explicity.
#
! # See also: page-known-charsets, iso646-charsets, auto-iso-8859

! iso646-charsets
! # List of 7-bit Character Sets, which are byte-to-byte supersets of
! # INVARIANT.
#
! # NOTE: That same information can be given on .elm/mime.charsets file with
! # ';MIME-subset=INVARIANT' qualifier -- that is preferred method.
#
! # In fact this option should never be set explicity.
#
! # See also: page-known-charsets, compatcharsets
!
! configoptions
! # list of options that can be configured at the "o)ptions" screen
!
! confirmappend
! # Should elm always ask the user to confirm before it appends
! # messages to any existing file?
! # This is used for both folders in the user's mail directory
! # and ordinary files.
!
! confirmcreate
! # Should elm always ask the user to confirm before it creates
! # any new files?
! # This is used for both folders in the user's mail directory
! # and ordinary files.
!
! confirmfiles
! # Should elm ask for confirmation before it appends a message
! # to an existing file that is not a folder in the user's Mail
! # directory?
! # This is used for ordinary files only and does not affect
! # folders in the user's mail directory.
!
! confirmfolders
! # Should elm ask for confirmation before it creates a new folder
! # in the user's Mail directory?
! # This is used only for folders in the user's mail directory and
! # does not affect ordinary files.
!
! confirmtagsave
! # Should Elm ask for confirmation before saving tagged messages to a
! # folder when the cursor is on an untagged message?
!
! convert-comment-to-fullname
! # Elm 2.4ME+ PL55 parses addresses like:
! # fullname <address>
! # fullname <address> (comment)
! # address (comment)
! # When convert-comment-to-fullname is set, addresses are parsed like
! # address (fullname)
! # instead. That convert-comment-to-fullname is set by default for
! # compatibilty of older versions of Elm.
!
! convert-utf-header
! # Convert utf-8 mime encoded words to utf-7 when sending?
!
! usetite
! # would you like to use termcap/terminfo ti/te entries?
!
! readdatapercentinc
! # Value by which percent count is incremented while reading a new mailbox.
! # Actual increments depends both of readdatapercentinc and readmsginc
! # See also: readmsginc
!
! readmsginc
! # Value by which message count is incremented while reading a new mailbox.
! # Setting this value to a number larger than one will speed up the time it
! # takes to read a large mailbox when using a slow terminal.
! # Actual increments depends both of readdatapercentinc and readmsginc
! # See also: readdatapercentinc
!
! sleepmsg
! # time in seconds which Elm will wait after displaying a transient message
! # and before erasing it. Can be 0 or positive integer.
!
! textencoding
! # Type of encoding to be put into the MIME Content-Transfer-Encoding header.
! # Usual values are 7bit or 8bit.
! #
! # -- NOT Used in this version of elm (2.4 PL24 ME7) or ELM 2.4ME+ PLxx (25)
! # Now elm analyzes mail when sending and does that encoding of quoted-printable
! # when necessary.
!
! show-header-errors
! # if this variable is ON, show certain header errors
!
! showpgppreamble
! # if this variable is ON, display text before PGP armor.
!
! showto
! # if this variable is ON, Elm will show who the message is to rather than
! # who it is from in the headers display if the message is not
! # addressed to user.
#
! # See also: alternatives
!
! usepgppass
! # If ON, Elm will prompt you for your PGP passphrase and use it whenever
! # necessary to make it more convenient to hand PGP messages.

! keeppassfor
! # The number of seconds Elm should remember your passphrase. -1 means never
! # expire it.

- askpgpsig
- # If ON, Elm will prompt you for a username with which to sign the pgp
- # message

pagealternative
# Should Elm use "pager" for display one part of multipart/alternative,
--- 724,849 ----
# See also: allow-charset-switching, local-fast-lookup, displaycharset,
# text-charset, page-known-charsets

! utf7-encode-optional
! # Should UTF-7 'optional direct characters' utf-7 encoded?
! # Optional direct characters are:
! # ! " # $ % & * ; < = > @ [ ] ^ _ ' { | }
! # See also: text-charset

! unidata
! # Binary unidata file, filename can be
! # filename File is read from directory
! # given on map-bin-dir directory
! # (normally $lib/elm.map.bin)
! # {rc}/filename File is readed from .elm subdirectory
! # of user's home
! # ~/filename File is readed from user's home
! # directory
! # See also: map-bin-dir


! bindata
! # Binary charset map file. Includes type=ascii and type=one-byte-map maps
! # from map-text-dir (and elsewhere). If that variable is set both
! # on global elm.rc and user's elm.rc then both files may be readed
! # or mmapped.
! # Filaname can be
! # filename File is read from directory
! # given on map-bin-dir directory
! # (normally $lib/elm.map.bin)
! # {rc}/filename File is readed from .elm subdirectory
! # of user's home
! # ~/filename File is readed from user's home
! # directory
! # See also: map-bin-dir
!
! attachment-dir
! # From which or to which directory read/save attachments.
! # This is provided as {doc}/ prefix on correspond filename prompts.
!
! auto-attachment
! # Possible values are: none, application, non-text
! # This affect how mime-parts with no Content-Disposition header,
! # are treated.
! # * If auto-attachment is none, missing Content-Disposition is
! # treated as "Content-Disposition: inline".
! # That is what MIME requires.
! # * If auto-attachment is application, type is subtype of
! # application and Elm can not handle type without calling
! # metamail (or mailcap programs), missing Content-Disposition
! # is treated as "Content-Disposition: attachment".
! # * If auto-attachment is non-text, type is not subtype
! # of text or multipart, type is not message/rfc822
! # and Elm can not handle type without calling
! # metamail (or mailcap programs), missing Content-Disposition
! # is treated as "Content-Disposition: attachment".
#
! # See also: charset-convert-ok, page-known-charsets, pagealternative,
! # pagemultipart
!
! fragment-handling
! # How fragmented (message/partial) should be handled?
! # none Call metamail (if available) for these
! # manual Let user give command 'A' to enter message
! # assembly mode
! # auto Go automatically message assembly mode
!
! mime-parameters
! # Handling of RFC 2231 encoded mime parameters.
! # Possible values: plain just use and generate plain
! # non-encoded parameters
! # encoded generate RFC 2231 encoded mime
! # parameters, if needed
! # plain-and-encoded Generate RFC 2231 encoded and
! # plain ascii parameter values
#
! # This parameter do not effect RFC 2231 language mark on mime encoded
! # words!
#
! # This is specially used for filename -parameter on content-disposition
!

! noencoding
! # This control makes it possible to send raw 8bit or binary data when the MTA
! # doesn't support 8BITMIME and the -B8BITMIME option or
! # BINARYMIME and the -BBINARYMIME option
#
! # Possible values:
! # pass-7bit (0) : Always convert 8BIT and BINARY data to QUOTED-PRINTABLE
! # if the MTA doesn't support the -B8BITMIME and
! # -BBINARYMIME options.
! # pass-8bit (1) : Allow 8bit without -B8BITMIME, but binary data is
! # encoded
! # pass-binary (2) : Allow binary without -BBINARYMIME and and 8bit without
! # -B8BITMIME
#
! # It is STRONGLY recommended that it be left set to pass-7bit unless you know
! # what you are doing!!
#
! # Elm doesn't yet fully support BINARYMIME: it requires that text lines are
! # terminated with \r\n, Unix's \n isn't sufficient!
! # That is only partially implemented in this version of Elm.
#
! # Quote from RFC 1830 (Experimental Protocol):
! # SMTP Service Extensions for Transmission of Large and Binary MIME Messages
! #
! # It is important to note that when using BINARYMIME, it is
! # especially important to ensure that the MIME message itself is
! # properly formed. In particular, it is essential that text be
! # canonically encoded with each line properly terminated with <CR>
! # <LF>. Any transformation of text into non-canonical MIME to
! # observe local storage conventions must be reversed before sending
! # as BINARYMIME. The usual line-oriented shortcuts will break if
! # used with BINARYMIME.

! nohdrencoding
! # Don't do MIME part 2 (RFC 1522) encoding for 8-bit headers?
! # Because 8-bit data is not allowed in headers,
! # it is STRONGLY recommended that this is left set to OFF
!
! convert-utf-header
! # Convert utf-8 mime encoded words to utf-7 when sending?


pagealternative
# Should Elm use "pager" for display one part of multipart/alternative,
***************
*** 704,733 ****
# [no save]
# [nosave]
# [include
# [[ (incidate line starting with [ )
# Unknown keywords gives error

- mimeforward
- # This option controls how Elm will forward messages when MIME is defined.
- # ON: Causes Elm to send the message as a MIME part of type
- # MESSAGE/RFC822. Highly recommended when forwarding MIME
- # messages so that the receiver can correctly view the message!
- # OFF: Elm will include the forwarded message in your editor instead
- # of making it an separate mime body part.
- #
- # See also: askmimeforward
-
- askmimeforward
- # This option controls is forwarding as message/rfc822 prompted or not
- # if set, option mnimeforward controls only default value for prompt
- #
- # See also: mimeforward
-
- quoteforward
- # Forwarded messages are quoted like replies, rather than included
- # with "Forwarded message" and "End of forwarded message" banners
- # above and below. This has no effect if "mimeforward" is TRUE.
-
require-mime-version-for-hdr-encoding
# If set MIME Part 2 (RFC 1522) decoding is only done when MIME-version
# header is present. Default: False
--- 868,877 ----
# [no save]
# [nosave]
# [include
+ # [attach
# [[ (incidate line starting with [ )
# Unknown keywords gives error

require-mime-version-for-hdr-encoding
# If set MIME Part 2 (RFC 1522) decoding is only done when MIME-version
# header is present. Default: False
***************
*** 736,803 ****
# If set MIME Part 1 (RFC 1521) decoding is only done when MIME-version
# header is present. Default: True

! background-wait-time
! # If = 0 wait mailer to completion
! # > 0 wait background_wait_time seconds for completion
! # if not completed in this time, let it go to background
#
- # (completion of mailing is still reported if user have
- # not exited in that time when mailer have completed)
-
- pgp2
- # What is the path for pgp 2?
- # Possible values include:
- # none Don't call pgp
- # /path Call pgp via that path, if it is executable
-
- pgp5-dir
- # What is the directory path for pgp 5 binaries?
- # Possible values include:
- # none Don't call pgp
- # /path Call pgp binaries from that directiry

! gpg
! # What is the path for gnupg?
! # Possible values include:
! # none Don't call gpg
! # /path Call gpg via that path, if it is executable

! pgp-interactive
! # Run pgp/gpg signing and encryption always on interactive mode

! pgp-sign-type
! # Specifies content-type for pgp signed messages.
! # Possible values are: application/pgp, text/plain, text/x-pgp

! pgp-version
! # What pgp use on sending of mail: pgp2, pgp5, gpg

! lock-in-copy
! # If set, elm will lock a folder when trying to save or copy to it.
! # NOTICE: Does not work with dot-locking

! lock-folders
! # if set, elm will lock a folder, when it is open.
! #
! # NOTICE: It is not possible to deliver mail to a locked folder. So
! # take care that incoming mail folders are treated as mailboxes.
! # This variable does not effect handling of mailboxes.
#
! # NOTICE: Does not work with dot-locking
!
!
! env-from-source
! # Tells which information to use for envelope from address.
! # Possible values include:
! # forward-from (0) Use: "From " separator line
! # ">From " forwarded indicator
! # "Return-Path:" header
! # from (1) Use: "From " separator line
! # "Return-Path:" header
! # return-path (2) Use: "Return-Path:" header
#
- # Setting this to value return-path requires that on every mail have
- # Return-Path: -header.

incoming-mailbox
# Name of incoming-mailbox, useful if POP or IMAP is used
--- 880,932 ----
# If set MIME Part 1 (RFC 1521) decoding is only done when MIME-version
# header is present. Default: True

! $usersection
! #-----------------------------------------------------------------------
! #
! # Metamail and mailcap options
#

! metamail
! # This tells path of metamail program
! #
! # That version (Elm 2.4ME+) does not use Metamail's companion programs
! # (suchs as mmencode) directly, but metamail package supposes that
! # companion programs are installed to search path.
! #
! # Special values: none Don't call metamail
! # metamail Don't call metamail if environment
! # variable $NOMETAMAIL is defined

! internal-mailcaps
! # List of mailcaps for internal mailcap support (without metmail).
! # List may be space or ':' seperated. Separate values may be quoted.

! # Set value to "none" (without quotes) to disable internal mailcap support.

! # See also: metamail-mailcaps, internal-mailcap-trusted-programs

! internal-mailcap-trusted-programs
! # List of programs which are executed by default when using internal
! # mailcap. Programs given on test= are always executed without
! # prompting.
! # See also: internal-mailcap-prompt-trusted, internal-mailcaps

! internal-mailcap-prompt-trusted
! # If set, Mailcap program selection -screen is shown even when
! # all programs asked on screen are executed by default
! # See also: internal-mailcap-trusted-programs

! metamail-mailcaps
! # List of mailcaps for metamail. List may be space or ':' seperated. Separate
! # values may be quoted. When metamail is called values are put to variable
! # $MAILCAPS (as ':' -separated list). metamail-mailcaps may include variables
! # (for example $MAILCAPS). Value of variables is splitted only from ':'
! # (quotes and spaces are not treated specially.)
! # See also: internal-mailcaps

! $usersection
! #-----------------------------------------------------------------------
#
! # IMAP and POP options
#

incoming-mailbox
# Name of incoming-mailbox, useful if POP or IMAP is used
***************
*** 815,820 ****
--- 944,954 ----


pop-show-greeting
# Show server greeting?

+ imap-dir-sortby
+ # How to sort IMAP folders on folder browser?
+ # Possible values: none
+ # name, reverse-name
+ # See also: local-dir-sortby

imap-charset
# Character set used with IMAP
***************

*** 872,886 ****
# However seems that (some?) IMAP servers does not report new mails
# when mailbox is opened as read-only.

! utf7-encode-optional
! # Should UTF-7 'optional direct characters' utf-7 encoded?
! # Optional direct characters are:
! # ! " # $ % & * ; < = > @ [ ] ^ _ ' { | }
! # See also: text-charset

! header-phrase-display-mode
! # plain: Show phrases as is (without quotation)
! # quoted: Show phrases on quoted form

map-text-dir
# Default directory for map files (text) (normally $lib/elm.map.txt)
--- 1006,1083 ----
# However seems that (some?) IMAP servers does not report new mails
# when mailbox is opened as read-only.

! $usersection
! #-----------------------------------------------------------------------
! #
! # PGP and GPG options
! #

! showpgppreamble
! # if this variable is ON, display text before PGP armor.
!
!
! usepgppass
! # If ON, Elm will prompt you for your PGP passphrase and use it whenever
! # necessary to make it more convenient to hand PGP messages.
!
! keeppassfor
! # The number of seconds Elm should remember your passphrase. -1 means never
! # expire it.
!
! askpgpsig
! # If ON, Elm will prompt you for a username with which to sign the pgp
! # message
!
! pgp2
! # What is the path for pgp 2?
! # Possible values include:
! # none Don't call pgp
! # /path Call pgp via that path, if it is executable
!
! pgp5-dir
! # What is the directory path for pgp 5 binaries?
! # Possible values include:
! # none Don't call pgp
! # /path Call pgp binaries from that directiry
!
! gpg
! # What is the path for gnupg?
! # Possible values include:
! # none Don't call gpg
! # /path Call gpg via that path, if it is executable
!
! pgp-encrypt-type
! # Specifies content-type for pgp encrypted messages.
! # Possible values are: application/pgp, text/plain, text/x-pgp
!
!
! pgp-interactive
! # Run pgp/gpg signing and encryption always on interactive mode
!
! pgp-sign-type
! # Specifies content-type for pgp signed messages.
! # Possible values are: application/pgp, text/plain, text/x-pgp
!
! pgp-version
! # What pgp use on sending of mail: pgp2, pgp5, gpg
!
! $globalsection
! #-----------------------------------------------------------------------
! #
! # General global options
! #
!
! allow-setuid
! # If set, running Elm as setuid is not prevented.
!
! hostdomain
! # Name of domain we're in
!
! hostfullname
! # Name of FQDN we're in
!
! hostname
! # Name of machine we're on

map-text-dir
# Default directory for map files (text) (normally $lib/elm.map.txt)
***************
*** 890,927 ****
# Default directory for map files (binary) (normally $lib/elm.map.bin)
# See also: unidata, bindata, map-text-dir

! unidata
! # Binary unidata file, filename can be
! # filename File is read from directory
! # given on map-bin-dir directory
! # (normally $lib/elm.map.bin)
! # {rc}/filename File is readed from .elm subdirectory
! # of user's home
! # ~/filename File is readed from user's home
! # directory
! # See also: map-bin-dir

! bindata
! # Binary charset map file. Includes type=ascii and type=one-byte-map maps
! # from map-text-dir (and elsewhere). If that variable is set both
! # on global elm.rc and user's elm.rc then both files may be readed
! # or mmapped.
! # Filaname can be
! # filename File is read from directory
! # given on map-bin-dir directory
! # (normally $lib/elm.map.bin)
! # {rc}/filename File is readed from .elm subdirectory
! # of user's home
! # ~/filename File is readed from user's home
! # directory
! # See also: map-bin-dir

use-library


# Specify tags for shared libraries, which should be loaded.
# These libraries are loaded on startup and relocated to variables
# use-base-library and use-connect-library
#
! # See also: use-base-library, use-connect-library

use-base-library
# Specify tags for shared libraries, which should be loaded.

--- 1087,1139 ----
# Default directory for map files (binary) (normally $lib/elm.map.bin)
# See also: unidata, bindata, map-text-dir

! $section
! #-----------------------------------------------------------------------
! #
! # Mailer options
! #

! background-wait-time
! # If = 0 wait mailer to completion
! # > 0 wait background_wait_time seconds for completion
! # if not completed in this time, let it go to background
! #
! # (completion of mailing is still reported if user have
! # not exited in that time when mailer have completed)
!
! mailer
! # This tells type of mailer, value can be one of
! # unknown, sendmail, submitmail, execmail
! # After these parameters there can be following additional options
! # path= gives path of mailer
! # add-from=dont, add-from=yes,
! # use-domain=no, use-domain=yes,
! # supported-bodytype=7bit, supported-bodytype=8bit,
! # supported-bodytype=binary
! # supports-dsn=no, supports-dsn=yes
! # verify=no, verify=yes
! # allow-set-sender=no, allow-set-sender=yes
! # See also: add-sender
!
! add-sender
! # If set (default), Elm adds Sender: -header if user specifies From: -header
! # or envelope sender address (aka Return-Path).
! # If there is more than one address on From: -header,
! # Sender: -header is always added.
! # See also: mailer
!
! $section
! #-----------------------------------------------------------------------
! #
! # Library options
! #

use-library


# Specify tags for shared libraries, which should be loaded.

# These libraries are loaded on startup and relocated to variables
# use-base-library and use-connect-library
#
! # See also: use-base-library, use-connect-library, use-mailer-library

use-base-library
# Specify tags for shared libraries, which should be loaded.
***************

*** 929,958 ****


use-connect-library
# Specify tags for shared libraries, which should be loaded.

! internal-mailcaps
! # List of mailcaps for internal mailcap support (without metmail).
! # List may be space or ':' seperated. Separate values may be quoted.

! # Set value to "none" to disable internal mailcap support.

! # See also: metamail-mailcaps, internal-mailcap-trusted-programs
!
! internal-mailcap-trusted-programs
! # List of programs which are executed by default when using internal
! # mailcap. Programs given on test= are always executed without
! # prompting.
! # See also: internal-mailcap-prompt-trusted, internal-mailcaps
!
! internal-mailcap-prompt-trusted
! # If set, Mailcap program selection -screen is shown even when
! # all programs asked on screen are executed by default
! # See also: internal-mailcap-trusted-programs
!
! metamail-mailcaps
! # List of mailcaps for metamail. List may be space or ':' seperated. Separate
! # values may be quoted. When metamail is called values are put to variable
! # $MAILCAPS (as ':' -separated list). metamail-mailcaps may include variables
! # (for example $MAILCAPS). Value of variables is splitted only from ':'
! # (quotes and spaces are not treated specially.)
! # See also: internal-mailcaps

- allow-setuid
- # If set, running Elm as setuid is not prevented.
--- 1141,1146 ----


use-connect-library
# Specify tags for shared libraries, which should be loaded.

! use-mailer-library
! # Specify tags for shared libraries, which should be loaded.

Index: elmME+.2.5.alpha5-cvs/doc/elmrc-write.1
*** elmME+.2.5.alpha4/doc/elmrc-write.1 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/doc/elmrc-write.1 2005-07-20 19:49:38.000000000 +0300


***************
*** 32,37 ****
--- 32,42 ----

Read global configuration files only (by default user
configuration files are read.)
.TP
+ .B " -c \fIold-values\fR "
+ Records old values for options (which gives errors) to
+ -I old-values
+ file.
+ .TP
.B " -d \fIclass\fR=\fIdebugfile\fR:\fIlevel\fR "
Debug - set specified debug level - Output to "$HOME/ELMRC-WRITE:debug.info"
if
***************

*** 60,64 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2001-2004 by Kari Hurtta

--- 65,70 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2001-2005 by Kari Hurtta
!

Index: elmME+.2.5.alpha5-cvs/doc/elmregister.1
*** elmME+.2.5.alpha4/doc/elmregister.1 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha5-cvs/doc/elmregister.1 2005-07-20 19:49:38.000000000 +0300

*** 107,110 ****


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS

! \fB\*(ct\fRCopyright 2003, 2004 by Kari Hurtta

--- 123,126 ----


.SH BUG REPORTS TO
Kari Hurtta e...@elmme-mailer.org
.SH COPYRIGHTS
! \fB\*(ct\fRCopyright 2003-2005 by Kari Hurtta

Index: elmME+.2.5.alpha5-cvs/doc/terminal.info
*** elmME+.2.5.alpha4/doc/terminal.info 2003-09-05 23:33:17.000000000 +0300
--- elmME+.2.5.alpha5-cvs/doc/terminal.info 2005-07-20 19:49:38.000000000 +0300
***************
*** 59,65 ****


# working font for *-iso8859-1
kterm ISO-2022 ISO-8859-1

! # These are for Linux Mandrake 7.1
#
# Following does not work, to geto these work change on /etc/profile.d/lang.sh
# unset SYSFONTACM SYSFONT
--- 59,65 ----


# working font for *-iso8859-1
kterm ISO-2022 ISO-8859-1

! # These are for Linux Mandrake 7.1 and 9.0
#
# Following does not work, to geto these work change on /etc/profile.d/lang.sh
# unset SYSFONTACM SYSFONT
***************
*** 75,77 ****
--- 75,125 ----

Index: elmME+.2.5.alpha5-cvs/doc/tmac.n
*** elmME+.2.5.alpha4/doc/tmac.n 2002-01-26 13:14:45.000000000 +0200


--- /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300
***************

- .\"
- .\"

- . \}
- . \}

- .nr id +1 \" increment level of display
- ..


- .de ed \" end display
- .br \" flush line
- .ie \\n(id<=0 .er "end display has no corresponding begin display"
- .el \{\
- . nr id -1 \" decrement level of display
- . if \\n(id=0 \{\
- . di \" end diversion
- . fi \" resume filling
- . in -\\n(piu \" dedent
- . ev \" pop environment
- . ne \\n(dnu \" be sure you have room
- . nf \" don't reprocess display
- . rs \" don't eat leading space
- . zi \" save indents
- . ie \\n(sf .in (\\n(llu-\\n(dlu)/2u \" center on the line length
- . el .in +\\n(piu \" indent the sucker
- . dd \" drop display
- . yi \" restore indents

- . \}
- .\}

Kari E. Hurtta

unread,
Jul 28, 2005, 12:31:53 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.12

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 12/20 ) =========
Index: elmME+.2.5.alpha5-cvs/src/aliases/alias_alloc.c
*** elmME+.2.5.alpha4/src/aliases/alias_alloc.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/aliases/alias_alloc.c 2005-07-23 20:14:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias_alloc.c,v 1.4 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias_alloc.c,v 1.4.8.1 2005/07/23 17:14:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************

*** 16,22 ****
--- 16,24 ----

#include "def_aliases.h"

+ #if 0
DEBUG_VAR(Debug,__FILE__,"alias");
+ #endif

void realloc_aliases(astorage,current_count)
struct current_astorage *astorage;
Index: elmME+.2.5.alpha5-cvs/src/aliases/aliases.c
*** elmME+.2.5.alpha4/src/aliases/aliases.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/aliases/aliases.c 2005-07-23 20:14:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: aliases.c,v 1.6.8.1 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: aliases.c,v 1.6.8.2 2005/07/23 17:14:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.6.8.2 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 426,434 ****

if (aview->aliasclass[i].atype->
at_update_it(& (aview->aliasclass[i]))) {
!
! int j,z;
!
r = 1;
}
}
--- 426,432 ----

if (aview->aliasclass[i].atype->
at_update_it(& (aview->aliasclass[i]))) {
!
r = 1;
}
}
***************
*** 484,490 ****



for (i = 0; i < len; i++) {

int cx = aview->view[i].classnum;
- int cindex = aview->view[i].index;

if (cx < 0 || cx >= aview->aliasclasscount)
panic("ALIAS VIEW PANIC",__FILE__,__LINE__,"sort_aview",
--- 482,487 ----
Index: elmME+.2.5.alpha5-cvs/src/aliases/astorage.c
*** elmME+.2.5.alpha4/src/aliases/astorage.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/aliases/astorage.c 2005-07-23 20:14:19.000000000 +0300
***************
*** 1,14 ****
! static char rcsid[] = "@(#)$Id: astorage.c,v 1.4 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

#include "def_aliases.h"

DEBUG_VAR(Debug,__FILE__,"alias");

struct current_astorage *current_astorage = NULL;

--- 1,16 ----
! static char rcsid[] = "@(#)$Id: astorage.c,v 1.4.8.1 2005/07/23 17:14:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

#include "def_aliases.h"

+ #if 0
DEBUG_VAR(Debug,__FILE__,"alias");
+ #endif

struct current_astorage *current_astorage = NULL;

Index: elmME+.2.5.alpha5-cvs/src/aliases/astorage_hash.c
*** elmME+.2.5.alpha4/src/aliases/astorage_hash.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/aliases/astorage_hash.c 2005-07-23 20:14:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: astorage_hash.c,v 1.4 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: astorage_hash.c,v 1.4.8.2 2005/07/23 17:14:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.4.8.2 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************

*** 47,53 ****
struct aliasclass *c;
{
struct stat hst;
- int dups = 0; /* Not really needed */
int ptr = 0;

/* Copied from open_system_alaises() on src/alias.c */
--- 47,52 ----


***************
*** 155,161 ****
*/

register struct alias_rec *a;
! extern struct alias_rec *fetch_alias();

if ((a = fetch_alias(db, (char *)NULL)) == NULL)
return 0;

--- 154,160 ----


*/

register struct alias_rec *a;
!

if ((a = fetch_alias(db, (char *)NULL)) == NULL)
return 0;

Index: elmME+.2.5.alpha5-cvs/src/aliaslib.c
*** elmME+.2.5.alpha4/src/aliaslib.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/aliaslib.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: aliaslib.c,v 1.27 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: aliaslib.c,v 1.27.8.3 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.27.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,27 ****

DEBUG_VAR(Debug,__FILE__,"alias");

- char *qstrpbrk();
extern int current_mail_message;

struct expand {
--- 21,26 ----
***************

*** 29,42 ****
int addrs_len;
};

! static int add_ P_((struct expand *x, CONST char *ADR,
! CONST struct string *FN,
! CONST struct string *COMMENT));
static int add_(x,ADR,FN,COMMENT)
struct expand *x;


! CONST char *ADR;
! CONST struct string *FN;

! CONST struct string *COMMENT;
{
x->addrs = safe_realloc(x->addrs,(x->addrs_len + 2) *
sizeof (struct addr_item));
--- 28,41 ----
int addrs_len;
};

! static int add_ P_((struct expand *x, const char *ADR,
! const struct string *FN,
! const struct string *COMMENT));
static int add_(x,ADR,FN,COMMENT)
struct expand *x;


! const char *ADR;
! const struct string *FN;

! const struct string *COMMENT;
{
x->addrs = safe_realloc(x->addrs,(x->addrs_len + 2) *
sizeof (struct addr_item));

! goto fail;
! }
!

/* verify it is a valid address */
if (mailer_info &&
verify_mailer_addr(mailer_info,name,
! &verify_result,&errcode)) {

DPRINT(Debug,7,
(&Debug,
***************
*** 199,208 ****
next++;
}

if (tokenized)
! free(tokenized);

! return TRUE;
}


--- 202,214 ----
next++;
}

+ result = 1;
+ fail:
+
if (tokenized)
! free_rfc822tokenized(tokenized);

! return result;
}


***************
*** 376,382 ****
{
struct expand result;
struct addr_item *bufptr = NULL;
- int dummy = 0; /* header_page */

result.addrs_len = 0;
result.addrs = NULL;
--- 382,387 ----
Index: elmME+.2.5.alpha5-cvs/src/a_quit.c
*** elmME+.2.5.alpha4/src/a_quit.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/a_quit.c 2005-07-20 19:49:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_quit.c,v 1.17.8.1 2004/04/25 16:59:27 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: a_quit.c,v 1.17.8.2 2005/07/20 16:49:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,36 ****
extern int errno; /* system error number on failure */
#endif

! int delete_aliases(newaliases, prompt, aview, page)
int newaliases, prompt;

struct AliasView *aview;


struct menu_context * page;
{
/*
* Update aliases by processing deletions. Prompting is

--- 27,37 ----


extern int errno; /* system error number on failure */
#endif

! int delete_aliases(newaliases, prompt, aview, page, prompt_area)
int newaliases, prompt;

struct AliasView *aview;
struct menu_context * page;

+ struct menu_context * prompt_area;

{
/*
* Update aliases by processing deletions. Prompting is
***************

*** 55,65 ****
char **list;



int to_delete = 0, to_keep = 0, i, marked_deleted = 0, ask_questions;

! char answer;
int ac = get_alias_count(aview);
- int LINES, COLUMNS;


- menu_get_sizes(page,&LINES,&COLUMNS);

DPRINT(Debug,1,
(&Debug, "\n\n-- leaving aliases --\n\n"));

--- 56,64 ----
char **list;



int to_delete = 0, to_keep = 0, i, marked_deleted = 0, ask_questions;

! int answer;
int ac = get_alias_count(aview);


DPRINT(Debug,1,
(&Debug, "\n\n-- leaving aliases --\n\n"));
***************
*** 94,112 ****
answer = (always_del ? *def_ans_yes : *def_ans_no); /* default answer */
if(ask_questions) {
if (marked_deleted == 1)
! elm_sfprintf(buffer, sizeof buffer,
! CATGETS(elm_msg_cat, AliasesSet, AliasesDelete,
! "Delete 1 alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
else
! elm_sfprintf(buffer, sizeof buffer,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesDeletePlural,
! "Delete %d aliases? (%c/%c) "),
! marked_deleted, *def_ans_yes, *def_ans_no);
!
! answer = want_to(buffer, answer, LINES-4, 0,
! page);
}

if(answer == *def_ans_yes) {
--- 93,117 ----
answer = (always_del ? *def_ans_yes : *def_ans_no); /* default answer */
if(ask_questions) {
if (marked_deleted == 1)
! answer = prompt_letter(0,"",answer,
! PROMPT_yesno|PROMPT_cancel,
! prompt_area,
! CATGETS(elm_msg_cat, AliasesSet, AliasesDelete,
! "Delete 1 alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
else
! answer = prompt_letter(0,"",answer,
! PROMPT_yesno|PROMPT_cancel,
! prompt_area,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesDeletePlural,
! "Delete %d aliases? (%c/%c) "),
! marked_deleted, *def_ans_yes, *def_ans_no);
!
!

! if (TERMCH_interrupt_char == answer) {
! return -1;
! }
}

if(answer == *def_ans_yes) {
Index: elmME+.2.5.alpha5-cvs/src/args.c
*** elmME+.2.5.alpha4/src/args.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/args.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: args.c,v 1.61.8.7 2004/08/14 12:06:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: args.c,v 1.61.8.9 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.61.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 16,22 ****
* Incorparated Elm 2.5 code from src/args.c.

* That code was following copyright:
*

! * The Elm Mail System - $Revision: 1.61.8.7 $ $State: Exp $
*


* Copyright (c) 1988-1995 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor

--- 16,22 ----
* Incorparated Elm 2.5 code from src/args.c.

* That code was following copyright:
*

! * The Elm Mail System - $Revision: 1.61.8.9 $ $State: Exp $
*


* Copyright (c) 1988-1995 USENET Community Trust

* Copyright (c) 1986,1987 Dave Taylor

***************
*** 36,42 ****

struct Attachments attach_files = { NULL, 0 };

! CONST struct Attachments NULL_Attachments = { NULL, 0 };

void add_Attachments(A,x)
struct Attachments *A;
--- 36,42 ----

struct Attachments attach_files = { NULL, 0 };

! const struct Attachments NULL_Attachments = { NULL, 0 };

void add_Attachments(A,x)
struct Attachments *A;
***************
*** 99,113 ****


Return req_mfile, which points to a named mail file or is empty.
**/

! int c = 0;
! int v = 0;
! char ** req_vector = NULL;
! int req_len = 0;
! *to_whom = NULL;
! batch_subject[0] = '\0';
! included_file[0] = '\0';

! while ((c = getopt(argc, argv, "?aA:cd:D:f:hi:kKms:tVvwX:z-:r:SM")) != EOF) {


switch (c) {
case 'a' : arrow_cursor++; break;
case 'A' :

--- 99,114 ----


Return req_mfile, which points to a named mail file or is empty.
**/

! int c = 0;
! int v = 0;
! char ** req_vector = NULL;
! int req_len = 0;
!
! *to_whom = NULL;
! batch_subject[0] = '\0';
! included_file[0] = '\0';

! while ((c = getopt(argc, argv, "?aA:cd:D:f:hi:kKms:tVvwX:yz-:r:SM")) != EOF) {


switch (c) {
case 'a' : arrow_cursor++; break;
case 'A' :
***************

*** 174,182 ****


exit(1);
#endif
break;
! case 'z' :

opmode = OPMODE_READ_NONEMPTY;
! use_tite = 0; break;


case '-':

if (0 == strncmp(optarg, "title-name=",11))

--- 175,200 ----


exit(1);
#endif
break;
!
! case 'y' :

! if (opmode != OPMODE_READ) {


! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsBadYoption,
! "Option -y incompatible with given other options."));
! exit(1);
! }

! opmode = OPMODE_READ_UNREAD;
! break;
!
! case 'z' :
! if (opmode != OPMODE_READ) {


! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmArgsBadZoption,
! "Option -z incompatible with given other options."));
! exit(1);
! }

opmode = OPMODE_READ_NONEMPTY;
!
! break;
!

case '-':

if (0 == strncmp(optarg, "title-name=",11))

***************
*** 267,272 ****
--- 285,291 ----


\t -V \t\tEnable sendmail voyeur mode.\n\r\
\t -v \t\tPrint out ELM version information.\n\r\
\t -w \t\tWrite .elm/elmrc and .elm/mime.charsets\n\r\

+ \t -y \t\tdon't enter ELM if no unread mail is pending\n\r\
\t -z \t\tZero - don't enter ELM if no mail is pending\n\r\
\n\n"));
/*
***************

*** 284,290 ****
--- 303,314 ----



/** print out version information **/

+
printf("\nElm Version and Identification Information:\n\n");

+

+ if (i == 1)
+ printf("\tElm Millenium Edition \n\n");
+
printf("\tElm %s PL%s, of %s\n",VERSION,PATCHLEVEL,VERS_DATE);

#ifdef BINARY_PACKAGE
***************

*** 308,314 ****


}

if (i < 3) {
! printf("\t(C) Copyright 1996-2004 Kari Hurtta\n");

printf("\tBased on Elm 2.5, (C) Copyright 1988-1999 USENET Community Trust\n");


printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");

printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
--- 332,338 ----


}

if (i < 3) {
! printf("\t(C) Copyright 1996-2005 Kari Hurtta\n");

printf("\tBased on Elm 2.5, (C) Copyright 1988-1999 USENET Community Trust\n");


printf("\tBased on Elm 2.4, (C) Copyright 1988-1992 USENET Community Trust\n");

printf("\tBased on Elm 2.0, (C) Copyright 1986,1987 Dave Taylor\n");
***************
*** 427,432 ****
--- 451,469 ----


#else
printf("\tSystem does not support nl_langinfo(CODESET) query: not HAVE_CODESET\n");
#endif
+ #ifdef WCHAR
+ printf("\tSystem have native wide character support: WCHAR\n");
+ #ifdef __STDC_ISO_10646__
+ printf("\t wchar_t is Unicode (the Universal Character Set): __STDC_ISO_10646__\n");
+ #endif
+ #ifdef WCWIDTH
+ printf("\t wcwidth() function is available: WCWIDTH\n");
+ #else
+ printf("\t Character width function is not available: not WCWIDTH\n");
+ #endif
+ #else
+ printf("\tSystem do not support wide characters: not WCHAR\n");
+ #endif

#ifdef MSGCAT
printf("\tUses system's msgcat() implementation: MSGCAT\n");

Index: elmME+.2.5.alpha5-cvs/src/a_screen.c
*** elmME+.2.5.alpha4/src/a_screen.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/a_screen.c 2005-07-23 20:14:15.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_screen.c,v 1.15.8.1 2004/05/01 07:41:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: a_screen.c,v 1.15.8.3 2005/07/23 17:14:15 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 19,26 ****
#include "def_elm.h"
#include "s_aliases.h"

- char *alias_type();
-
char *show_alias_status(entry)
struct alias_rec *entry;
{
--- 19,24 ----
***************
*** 64,180 ****
}


! void alias_screen(modified, aview, header_page, page)
! int modified;

struct AliasView *aview;
- int *header_page;


struct menu_context *page;
{
struct menu_common MENU;

! "(modified, resync needed) "));
! }
! else {


! modmsg = new_string(system_charset);
}

! if (alias_selected)
! buffer = format_string(CATGETS(elm_msg_cat, AliasesSet, AliasesSelect,
! "Alias mode: %d shown out of %d %S[ELM %s]"),
! alias_selected, ac, modmsg,
! version_buff);
! else if (ac == 1)
! buffer = format_string(CATGETS(elm_msg_cat, AliasesSet, AliasesSingle,
! "Alias mode: 1 alias %S[ELM %s]"),
! modmsg, version_buff);
! else
! buffer = format_string(CATGETS(elm_msg_cat, AliasesSet, AliasesPlural,
! "Alias mode: %d aliases %S[ELM %s]"),
! ac, modmsg, version_buff);
!
! ClearLine(1);
!
! print_center(1, buffer);
!
! free_string(&modmsg);
! free_string(&buffer);
! }
!
! void show_alias_menu(page)

! struct menu_context *page;
! {
! int LINES, COLUMNS;


! menu_get_sizes(page,&LINES,&COLUMNS);
!
! /** write alias menu... **/
! /* Moved from alias.c */
!

! if (user_level == RANK_AMATEUR) { /* Give less options */
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn1,


! "You can use any of the following commands by pressing the first character;"));
! print_format_center(LINES-7,

! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn2,

! "a)lias current message, n)ew alias, d)elete or u)ndelete an alias,"));
! print_format_center(LINES-6,

! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn3,
! "m)ail to alias, or r)eturn to main menu. To view an alias, press <return>."));
! print_format_center(LINES-5,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn4,

! "j = move down, k = move up, ? = help"));
! }
! else {


! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn1,

! "Alias commands: ?=help, <n>=set current to n, /=search pattern"));
! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn2,
! "a)lias current message, c)hange, d)elete, e)dit aliases.text, f)ully expand,"));
! print_format_center(LINES-6,

! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn3,
! "l)imit display, m)ail, n)ew alias, r)eturn, t)ag, u)ndelete, or e(x)it"));
! }
}

struct string *build_alias_line(entry, message_number, highlight, page)

--- 62,134 ----
}


! void alias_screen(aview, page)

struct AliasView *aview;
struct menu_context *page;
{

struct menu_common MENU;

set_mcommon_from_aliasview(&MENU,aview);
!
/* Stolen from showscreen() */

menu_ClearScreen(page);

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

show_last_error();

/* define_softkeys(ALIAS); */
}

! #if ANSI_C
! subpage_simple_redraw sb_alias_menu;
! #endif
! int sb_alias_menu(ptr,list)

! struct menu_context *ptr;
! struct menu_param *list;

! {


! int ul = give_dt_enumerate_as_int(&user_level);
!

! menu_ClearScreen(ptr);
!
! /** write alias menu... **/
! /* Moved from alias.c */

!
! if (ul == RANK_AMATEUR) { /* Give less options */
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn1,


! "You can use any of the following commands by pressing the first character;"));
! menu_print_format_center(ptr,1,

! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn2,

! "a)lias current message, n)ew alias, d)elete or u)ndelete an alias,"));
! menu_print_format_center(ptr,2,

! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn3,
! "m)ail to alias, or r)eturn to main menu. To view an alias, press <return>."));
! menu_print_format_center(ptr,3,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesRMenuLn4,

! "j = move down, k = move up, ? = help"));
! } else {
! menu_print_format_center(ptr,0,

! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn1,

! "Alias commands: ?=help, <n>=set current to n, /=search pattern"));
! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn2,
! "a)lias current message, c)hange, d)elete, e)dit aliases.text, f)ully expand,"));
! menu_print_format_center(ptr,2,

! CATGETS(elm_msg_cat, AliasesSet,
! AliasesMenuLn3,
! "l)imit display, m)ail, n)ew alias, r)eturn, t)ag, u)ndelete, or e(x)it"));
}

! return 1;
}

struct string *build_alias_line(entry, message_number, highlight, page)
***************
*** 219,225 ****
entry->address);

/* complete line with name, type and alias. */
! ret = format_string(FRM("%S%-*.*S %s %-18.18s"),
buffer,
/* give max and min width parameters for 'name' */
name_width, name_width, mybuffer,

--- 173,179 ----


entry->address);

/* complete line with name, type and alias. */
! ret = format_string(FRM("%S%-*.*S %s %-20.20s"),
buffer,
/* give max and min width parameters for 'name' */
name_width, name_width, mybuffer,

Index: elmME+.2.5.alpha5-cvs/src/a_sort.c
*** elmME+.2.5.alpha4/src/a_sort.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/a_sort.c 2005-07-20 19:49:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_sort.c,v 1.15 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: a_sort.c,v 1.15.8.1 2005/07/20 16:49:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 22,29 ****

DEBUG_VAR(Debug,__FILE__,"alias");

- char *alias_sort_name();
-
static void alias_old_current P_((long iindex,
struct AliasView *aview));

--- 22,27 ----
***************
*** 108,114 ****
return ret;
}

! switch (abs(alias_sortby)) {
case ALIAS_SORT:
ret = strcmp(first->alias, second->alias);
break;
--- 106,112 ----
return ret;
}

! switch (abs(give_dt_sort_as_int(&alias_sortby))) {
case ALIAS_SORT:
ret = strcmp(first->alias, second->alias);

break;
***************
*** 139,145 ****

break;
}

! if (alias_sortby < 0)
ret = -ret;

return ret;
--- 137,143 ----
break;
}

! if (give_dt_sort_as_int(&alias_sortby) < 0)
ret = -ret;

return ret;
***************
*** 156,163 ****
pad = (type == PAD);
abr = (type == SHORT);

! if (alias_sortby < 0) {
! switch (- alias_sortby) {
case ALIAS_SORT : return(
pad? "Reverse Alias Name " :
abr? "Reverse-Alias" :
--- 154,161 ----
pad = (type == PAD);
abr = (type == SHORT);

! if (give_dt_sort_as_int(&alias_sortby) < 0) {
! switch (- give_dt_sort_as_int(&alias_sortby)) {

case ALIAS_SORT : return(
pad? "Reverse Alias Name " :
abr? "Reverse-Alias" :

***************
*** 173,179 ****
}
}
else {
! switch (alias_sortby) {
case ALIAS_SORT : return(
pad? "Alias Name " :
abr? "Alias" :
--- 171,177 ----
}
}
else {
! switch (give_dt_sort_as_int(&alias_sortby)) {
case ALIAS_SORT : return(
pad? "Alias Name " :
abr? "Alias" :

Index: elmME+.2.5.alpha5-cvs/src/attach_menu.c
*** elmME+.2.5.alpha4/src/attach_menu.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/attach_menu.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.62.8.4 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: attach_menu.c,v 1.62.8.8 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.62.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,43 ****
return (unsigned char *)str;
}

- static int can_save(filename)
- char *filename;
- {


- if (access(filename,ACCESS_EXISTS) < 0) {
- if (errno == ENOENT)
- return 1; /* File not exists -- can save ! */
- return 0; /* Other error -- don't save with that name ! */

- } else


- return 0; /* File exits -- don't save over ! */
- }
-
static FILE * get_attachment P_((FILE *F,
mime_t *att));

--- 27,32 ----
***************
*** 51,70 ****

mime_panic(__FILE__,__LINE__,"get_attachment",
"Bad magic number");


! if (att->pathname) {
! if (can_open(att->pathname,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadableUser,
! "%.50s isn't readable by user!"),
! att->pathname);
sleep_message();
return NULL;
}

! result = fopen(att->pathname,"r");
if (!result) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenAttach,
! "Can't open attachment: %.50s"),
! att->pathname);
sleep_message();
}
} else {
--- 40,60 ----

mime_panic(__FILE__,__LINE__,"get_attachment",
"Bad magic number");


! if (att->pathname0) {
!
! if (can_open(att->pathname0,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadableUser,
! "%S isn't readable by user!"),
! att->dispname);
sleep_message();
return NULL;
}

! result = fopen(att->pathname0,"r");
if (!result) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenAttach,
! "Can't open attachment: %S"),
! att->dispname);
sleep_message();
}
} else {
***************
*** 105,111 ****

mime_panic(__FILE__,__LINE__,"attachment_copy",
"Bad magic number");


! if (att->pathname) { /* Already decoded */
char buf[VERY_LONG_STRING];
int len;
while (0 < (len = fread(buf,1,sizeof(buf),tmpfd))) {
--- 95,101 ----

mime_panic(__FILE__,__LINE__,"attachment_copy",
"Bad magic number");


! if (att->pathname0) { /* Already decoded */
char buf[VERY_LONG_STRING];
int len;
while (0 < (len = fread(buf,1,sizeof(buf),tmpfd))) {
***************
*** 117,125 ****
}
}
if (ferror(tmpfd)) {

! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReading,
! "Error reading from %.50s"),

! att->pathname);
sleep_message();
}
} else { /* Needs decode */
--- 107,115 ----
}
}
if (ferror(tmpfd)) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadingS,
! "Error reading from %S"),
! att->dispname);
sleep_message();
}

} else { /* Needs decode */
***************


*** 153,167 ****

static void attach_print P_((FILE *F,
mime_t *att,
! charset_t defcharset));
! static void attach_print (F,att, defcharset)
FILE *F;
mime_t *att;
charset_t defcharset;
{
char tempfile[STRING];
char buf1[VERY_LONG_STRING];
!
if (att->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"attach_print",
"Bad magic number");


--- 143,160 ----

static void attach_print P_((FILE *F,
mime_t *att,
! charset_t defcharset,

! struct menu_context *page));


! static void attach_print (F,att, defcharset,page)
FILE *F;
mime_t *att;
charset_t defcharset;
+ struct menu_context *page;
{
char tempfile[STRING];
char buf1[VERY_LONG_STRING];
! char *tmp;
!
if (att->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"attach_print",
"Bad magic number");


***************
*** 169,176 ****
if (!have_printout())
return;

elm_sfprintf(tempfile,sizeof tempfile,


! FRM("%selm.%d"), temp_dir, getpid());

if (get_major_type_code(att->TYPE) == MIME_TYPE_TEXT &&
istrcmp(get_subtype_name(att->TYPE),"plain") == 0) {
--- 162,173 ----
if (!have_printout())
return;

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ return;
+
elm_sfprintf(tempfile,sizeof tempfile,


! FRM("%selm.%d"), tmp, getpid());

***************
*** 278,283 ****


--- 275,281 ----
PressAnyKeyToContinue();

Raw(ON);
+ menu_trigger_redraw(page);
}
else
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNotKnowPrint,
***************
*** 285,302 ****

}

static void attach_save P_((FILE *F,
! mime_t *a, int *redraw,
struct AliasView *aview,

! struct menu_context *page));


! static void attach_save (F,a,redraw,aview, page)
FILE *F;
mime_t *a;
- int *redraw;

struct AliasView *aview;
struct menu_context *page;
{

! char buf[VERY_LONG_STRING], tmp[STRING];
int bytes=0, err, is_text;
in_state_t state_in;
FILE *f_in = NULL;

--- 283,345 ----



}

+ struct string * pick_name(str)

+ const struct string *str;
+ {

+ int L = string_len(str);
+ struct string *ret = NULL;
+
+ int i;
+ int pos = 0;
+

+ for (i = 0; i < L; i++) {
+ uint16 code = give_unicode_from_string(str,i);
+
+ if (0x002F /* / */ == code ||
+ code < 0x0020 ||
+ 0x005C /* \ */ == code)
+ pos = i+1;
+ }

+
+
+ ret = clip_from_string(str,&pos,L);


+
+ return ret;
+ }
+

+ static const char * pick_name_ascii P_((const char *str));
+ static const char * pick_name_ascii(str)

+ const char *str;
+ {
+ const char *ret = str;

+ const char *p;
+

+ for (p = str; *p; p++) {
+ if ('/' == *p ||

+ '\\' == *p ||
+ ( isascii(*p) && iscntrl(*p) )
+ )
+ ret = p+1;


+ }
+
+ return ret;
+ }
+
+
+

static void attach_save P_((FILE *F,
! mime_t *a,

struct AliasView *aview,
! struct menu_context *page,

! struct screen_parts *LOC));


! static void attach_save (F,a,aview, page, LOC)
FILE *F;
mime_t *a;

struct AliasView *aview;
struct menu_context *page;

+ struct screen_parts *LOC;
{

- char *p = strrchr (tmp, '/');


- if (p)
- p++;
- else

- p = tmp;

! if (use_attachment_dir) {
! char * work = elm_message(FRM("%s/%s"),
! attachment_dir,
! p);

! if (can_save(work)) {
! if (savefile)
! free_string(&savefile);
! savefile = format_string(FRM("{doc}/%s"),s2us(p));
}


! free(work);

!
! } else {


! if (can_save(p)) {
! if (savefile)
! free_string(&savefile);
! savefile = new_string2(system_charset,s2us(p));
}
}

}
!
!
if (!savefile && use_attachment_dir)
savefile = format_string(FRM("{doc}/"));

! code = file_browser(page,br,&savefile,redraw,word_save,
aview,
CATGETS(elm_msg_cat, MeSet, MeToFile,
"To file: "));

--- 372,507 ----



if (get_major_type_code(a->TYPE) == MIME_TYPE_APPLICATION &&
istrcmp (get_subtype_name(a->TYPE), "octet-stream") == 0) {

!
! int mp = give_dt_enumerate_as_int(&mime_parameters);

! const struct string *pv;
! const char * pva;
! struct string * testname = NULL;
!
! /* 0 == plain
! 1 == encoded


! 2 == plain-and-encoded
! */
!
!

!

/* See if there is a name=<...> field for the default filename */
!

! if ( mp &&
! (pv = get_mime_param(a->TYPE_opts,"name"))) {

!

! struct string * p = pick_name(pv);
!
! if (p) {
! if (use_attachment_dir) {
! testname = format_string(FRM("{doc}/%S"),p);
!
! } else {
! testname = format_string(FRM("./%S"),p);

}

+ free_string(&p);
+ }
+ } else if ((pva = get_mime_param_compat(a->TYPE_opts,"name"))) {

! const char * p = pick_name_ascii(pva);



+ if (use_attachment_dir) {
+ testname = format_string(FRM("{doc}/%s"),p);

+
} else {
! testname = format_string(FRM("./%s"),p);
!
! }
! }
!

! if (testname) {
! int ok = select_dir_item(br,&testname);
!
! if (ok) {
! int flags = give_dir_flags(br);

!

! if (0 == (flags & BROWSER_EXIST)) {
if (savefile)
free_string(&savefile);

! savefile = dup_string(testname);
}
}
!

! free_string(&testname);
}
+
}

+
/* See if there is a filename=<...> field for the default filename */

!
! {

!
! int mp = give_dt_enumerate_as_int(&mime_parameters);

! const struct string *pv;
! const char * pva;
! struct string * testname = NULL;
!
!
!

! if ( mp &&
! (pv = get_mime_param(a->DISPOSITION_opts,"filename"))) {

!

! struct string * p = pick_name(pv);
!
! if (p) {
! if (use_attachment_dir) {
! testname = format_string(FRM("{doc}/%S"),p);
!
! } else {
! testname = format_string(FRM("./%S"),p);
!
! }

! free_string(&p);
}

+ } else if ( (pva = get_mime_param_compat(a->DISPOSITION_opts,"filename"))) {

+
+ const char * p = pick_name_ascii(pva);


+
+ if (p) {
+ if (use_attachment_dir) {
+ testname = format_string(FRM("{doc}/%s"),p);
+
+ } else {
+ testname = format_string(FRM("./%s"),p);

+
+ }
+ }
+ }
+

+ if (testname) {
+ int ok = select_dir_item(br,&testname);

! if (ok) {
! int flags = give_dir_flags(br);

!

--- 598,614 ----


state_out.prefix = NULL;
state_out.displaying = 0;

! if (a->encoding == ENCODING_BASE64 && !a->pathname0)
base64_decode (&state_in, &state_out, a->length, is_text);
! else if (a->encoding == ENCODING_QUOTED && !a->pathname0)
quoted_printable_decode (&state_in, &state_out, a->length,
is_text);
! else if (a->encoding == ENCODING_UUENCODED && !a->pathname0)
uudecode (&state_in, &state_out, a->length, is_text);
else {
if (a->encoding != ENCODING_NONE && a->encoding != ENCODING_7BIT &&
a->encoding != ENCODING_8BIT && a->encoding != ENCODING_BINARY
! && !a->pathname0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmUnsupportedEncoding,
"Unsupported encoding! Decode manually!"));
sleep_message();

***************
*** 560,565 ****
--- 655,665 ----


if (savefile)
free_string(&savefile);
free_dir(&br);
+
+
+ menu_trigger_redraw(LOC->prompt_page);
+ menu_trigger_redraw(LOC->menu_page);
+
return;
}

***************
*** 580,589 ****

mime_panic(__FILE__,__LINE__,"attach_edit",
"Bad magic number");


! if (!ptr->pathname)
return;

! if (-1 == stat (ptr->pathname, &sb)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStat,
"Can't stat file!"));
sleep_message();

--- 680,689 ----
mime_panic(__FILE__,__LINE__,"attach_edit",
"Bad magic number");


! if (!ptr->pathname0)
return;

! if (-1 == stat (ptr->pathname0, &sb)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStat,
"Can't stat file!"));
sleep_message();
***************
*** 594,610 ****


if (!editor_val ||
! strlen(ptr->pathname) + strlen(editor_val) > STRING-5)
return;
savetime = sb.st_mtime;

Raw(OFF);
elm_sfprintf (buf, sizeof buf,
! FRM("%s %s"), editor_val, ptr->pathname);
system_call (buf, 0, NULL);
Raw(ON);

! if (stat (ptr->pathname, &sb) == -1 || sb.st_mtime != savetime)
(void) attach_info (ptr,mailer_info,0); /* update the information on this attachment */
return;
}

--- 694,710 ----




if (!editor_val ||
! strlen(ptr->pathname0) + strlen(editor_val) > STRING-5)
return;
savetime = sb.st_mtime;

Raw(OFF);
elm_sfprintf (buf, sizeof buf,
! FRM("%s %s"), editor_val, ptr->pathname0);
system_call (buf, 0, NULL);
Raw(ON);

! if (stat (ptr->pathname0, &sb) == -1 || sb.st_mtime != savetime)
(void) attach_info (ptr,mailer_info,0); /* update the information on this attachment */
return;
}
***************
*** 650,667 ****

tmp.pgp = 0;
#endif


! if (a->pathname) {
menu_ClearScreen(page); /* Extra clear for mime_parse_routine ... */

! if (can_open(a->pathname,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadableUser,
! "%.50s isn't readable by user!"),
! a->pathname);
sleep_message();
return;
}

! tmpfp = fopen (a->pathname, "r");
if (! tmpfp) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldOpenReading,

"Could not open file for reading!"));
--- 750,767 ----
tmp.pgp = 0;
#endif


! if (a->pathname0) {
menu_ClearScreen(page); /* Extra clear for mime_parse_routine ... */

! if (can_open(a->pathname0,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorReadableUser,
! "%S isn't readable by user!"),
! a->dispname);
sleep_message();
return;
}

! tmpfp = fopen (a->pathname0, "r");
if (! tmpfp) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldOpenReading,
"Could not open file for reading!"));
***************
*** 670,678 ****
}

tmp.mime_rec.TYPE = a->TYPE;
! if (a->type_opts) {
! tmp.mime_rec.type_opts = strmcpy(tmp.mime_rec.type_opts,
! a->type_opts);
}

tmp.mime_rec.mime_flags = a->mime_flags;

--- 770,777 ----


}

tmp.mime_rec.TYPE = a->TYPE;
! if (a->TYPE_opts) {
! tmp.mime_rec.TYPE_opts = copy_mime_param(a->TYPE_opts);
}

tmp.mime_rec.mime_flags = a->mime_flags;
***************
*** 684,695 ****
tmp.mime_rec.disposition = DISP_INLINE; /* Show it ! */
tmp.offset = tmp.mime_rec.offset = 0;
tmp.mime_rec.encoding = ENCODING_7BIT;
! stat(a->pathname, &sb);
tmp.content_length = tmp.mime_rec.length = sb.st_size;
mime_parse_routine(NULL,&tmp, tmpfp);

! }
! else {

/* Make copy of mime structure: */
mime_t_copy(&(tmp.mime_rec),a);

--- 783,793 ----

! FRM("%selm.%d"), temp_dir, getpid());

out = safeopen(tmpfile);

--- 824,863 ----


*/
mime_classify_media(&(tmp.mime_rec),&tmp);

! is_need_meta = need_meta(&tmp,0,0);
! if (is_need_meta < 0) {
! goto fail;
! }


if (!is_need_meta) {
! struct pager_page *PP = init_pager_page(NULL);
!
if (tmpfp)
! metapager (tmpfp, &tmp, FALSE, 0,0, PP);
else if (F)
! metapager (F, &tmp, FALSE, 0,0, PP);
!
! exit_pager_page(&PP,page);
} else {
struct menu_context *cpage;

/* otherwise call metamail */

! if (!a->pathname0) {
char tmpfile[STRING];
char copy_buf[VERY_LONG_STRING];
FILE *out;

out_state_t state_out;
+ char *tmp;

+
+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ goto fail;

elm_sfprintf (tmpfile, sizeof tmpfile,

! FRM("%selm.%d"), tmp, getpid());

out = safeopen(tmpfile);

***************
*** 796,807 ****
/* This is the case when we are viewing attachments for an outgoing
* message.
*/
elm_sfprintf(buf1,sizeof buf1,
FRM("%s -m Elm -p -b -c %s/%s %s"),
metamail_path,
get_major_type_name(a->TYPE),
get_subtype_name(a->TYPE),
! a->pathname);


/* Option -z causes that metamail deletes input file */

--- 905,917 ----


/* This is the case when we are viewing attachments for an outgoing
* message.
*/
+
elm_sfprintf(buf1,sizeof buf1,
FRM("%s -m Elm -p -b -c %s/%s %s"),
metamail_path,
get_major_type_name(a->TYPE),
get_subtype_name(a->TYPE),
! a->pathname0);


/* Option -z causes that metamail deletes input file */
***************
*** 845,851 ****
for (i = 0; i < attach_files.attachment_count; i++) {
int need_enc;
int is_text;
!
need_enc = attach_info (&(attach_files.attach_files[i]),
mailer_info,1);
if (need_enc < 0) {

--- 955,966 ----


for (i = 0; i < attach_files.attachment_count; i++) {
int need_enc;
int is_text;
!
! if (!attach_files.attach_files[i].dispname)
! attach_files.attach_files[i].dispname =
! new_string2(system_charset,
! s2us(attach_files.attach_files[i].pathname0));
!
need_enc = attach_info (&(attach_files.attach_files[i]),
mailer_info,1);
if (need_enc < 0) {
***************
*** 865,872 ****
attach_files.attach_files[i].encoding ==
ENCODING_BASE64)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmStrucredNoEncoding,
! "%.30s: Structured types don't allow encoding of data."),
! attach_files.attach_files[i].pathname);
sleep_message();

return 0;

--- 980,987 ----


attach_files.attach_files[i].encoding ==
ENCODING_BASE64)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmStrucredNoEncoding,
! "%S: Structured types don't allow encoding of data."),
! attach_files.attach_files[i].dispname);
sleep_message();

return 0;
***************

*** 889,902 ****
if (access(pathname,READ_ACCESS) < 0) {
int err = errno;
lib_error(FRM("%.45s: %.33s"),
! pathname,error_description(err));
return 0;


}

mime_t_zero(&tmp);

! tmp.pathname = safe_strdup(pathname);
!
/* Default disposition for attachments: attachment */
tmp.disposition = DISP_ATTACH;

--- 1004,1018 ----
if (access(pathname,READ_ACCESS) < 0) {
int err = errno;
lib_error(FRM("%.45s: %.33s"),
! pathname,strerror(err));
return 0;


}

mime_t_zero(&tmp);

! tmp.pathname0 = safe_strdup(pathname);
! tmp.dispname = NULL; /* Filled later */
!
/* Default disposition for attachments: attachment */
tmp.disposition = DISP_ATTACH;

***************
*** 909,928 ****
static void forgot_previous(att)
mime_t *att;
{
! if (att->pathname) {
if (att->unlink) {
! if (unlink(att->pathname) == 0) {
DPRINT(Debug,5, (&Debug,
"attach_modify: Unlinking cache %s\n",
! att->pathname));
}
}

! free (att->pathname);
! att->pathname = NULL;
}
}

static int attach_modify P_((mime_t *att, int new,
struct mailer_info *mailer_info,
struct AliasView *aview));

--- 1025,1048 ----


static void forgot_previous(att)
mime_t *att;
{
! if (att->pathname0) {
if (att->unlink) {
! if (unlink(att->pathname0) == 0) {
DPRINT(Debug,5, (&Debug,
"attach_modify: Unlinking cache %s\n",
! att->pathname0));
}
}

! free (att->pathname0);

! att->pathname0 = NULL;
}
+

+ if (att->dispname)
+ free_string(& (att->dispname));
}

+
static int attach_modify P_((mime_t *att, int new,
struct mailer_info *mailer_info,
struct AliasView *aview));
***************
*** 935,941 ****
{
int ret_value = FALSE;

! char buf[STRING];
int update = TRUE, prompt = TRUE, need_enc = 0;

int is_text = -1, ch = '\0';
struct folder_browser * br = new_browser(selection_file);
--- 1055,1061 ----
{
int ret_value = FALSE;

!

int update = TRUE, prompt = TRUE, need_enc = 0;

int is_text = -1, ch = '\0';
struct folder_browser * br = new_browser(selection_file);
***************
*** 946,953 ****
"Bad magic number");

DPRINT(Debug,6, (&Debug, "attach_modify: att=%p, new=%d\n",att,new));
!
! buf[0] = '\0';

if (new) {
/* Default disposition for attachments: attachment */

--- 1066,1072 ----

--- 1127,1147 ----

--- 1150,1193 ----

--- 1208,1218 ----


}

if (prompt) {
! menu_PutLineX (page,

! LINES-3, 0,

! CATGETS(elm_msg_cat, MeSet, MeAttachEnter1,
! "Enter letter or RETURN to quit: "));
! menu_CleartoEOS(page);
ch = menu_ReadCh(page,REDRAW_MARK|READCH_resize|READCH_sig_char);
clear_error();
}
***************
*** 1105,1111 ****

int code;

! if (att->unlink && !att->dispname) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCantChangeFilename,
"You can't change filename!"));

--- 1238,1244 ----



int code;

! if (att->unlink == 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCantChangeFilename,
"You can't change filename!"));
***************
*** 1121,1128 ****
}

if (!att->dispname) {
! if (att->pathname)
! tmpname = new_string2(system_charset,s2us(att->pathname));
} else
tmpname = dup_string(att->dispname);

--- 1254,1262 ----


}

if (!att->dispname) {
! DPRINT(Debug,15,(&Debug,
! "attach_modify: No dispname\n"));
!
} else
tmpname = dup_string(att->dispname);

***************
*** 1131,1137 ****

prompt = TRUE;

! code = file_browser(page,br,&tmpname,&update,word_read,
aview,
CATGETS(elm_msg_cat, MeSet,
MeAttachEnterFilename,

--- 1265,1271 ----



prompt = TRUE;

! code = file_browser(page,br,&tmpname,word_read,
aview,
CATGETS(elm_msg_cat, MeSet,
MeAttachEnterFilename,
***************
*** 1145,1153 ****

DPRINT(Debug,5, (&Debug,
"attach_modify: filename not given"));
! if (att->pathname) {
! DPRINT(Debug,5, (&Debug, " pathname=%s",
! att->pathname));
}
if (att->dispname) {
DPRINT(Debug,5, (&Debug, " dispname=%S",

--- 1279,1287 ----



DPRINT(Debug,5, (&Debug,
"attach_modify: filename not given"));
! if (att->pathname0) {
! DPRINT(Debug,5, (&Debug, " pathname0=%s",
! att->pathname0));
}
if (att->dispname) {
DPRINT(Debug,5, (&Debug, " dispname=%S",
***************
*** 1169,1186 ****

update = TRUE;

! if (att->pathname) {
if (att->unlink) {
! if (unlink(att->pathname) == 0) {
DPRINT(Debug,5,
(&Debug,
"attach_modify: Unlinking cache %s\n",
! att->pathname));
}
}

! free (att->pathname);
! att->pathname = NULL;
}
if (new) {
ret_value = FALSE;

--- 1303,1320 ----

--- 1357,1374 ----


goto attach_failure;
}

! /* Now forgot previous file ....
! forgot_previous: clears att->dispname
! and att->pathname0
! */
!
forgot_previous(att);

att->dispname = tmpname;
tmpname = NULL;

iscopy = att->unlink;
! if (!dir_make_ref(br, & (att->pathname0), & iscopy,
is_text)) {
att->unlink = iscopy;
goto attach_failure;
***************
*** 1279,1285 ****
update = TRUE;
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmStructuredNoencoding,

! "Structured types don't allow encoding of data."));
sleep_message();

break;
--- 1415,1422 ----

! if (0 != code)

continue;
!
! mime_get_content (buf, att);
if (get_major_type_code(att->TYPE) == MIME_TYPE_TEXT &&
(need_enc & HAVE_8BIT) &&
! !mime_get_param("charset",buf,att->type_opts,sizeof (buf)) &&
display_charset->MIME_name)
! add_parameter_t(att, "charset", display_charset->MIME_name,0);

do {
int iscopy;

--- 1453,1553 ----


int old_is_text = is_text;
int loop_count = 0;
int code;
! struct string *buf1 = NULL;
! char **X;
!

prompt = TRUE;
!

! "Content-Type: "));
!

if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
+
+ if (buf1)
+ free_string(&buf1);
+
continue;
}

!

! if (0 != code) {
! if (buf1)
! free_string(&buf1);

continue;
! }
!
!
! {

! int mp = give_dt_enumerate_as_int(&mime_parameters);

! /* 0 == plain


! 1 == encoded
! 2 == ascii-and-encoded
! */
!

! switch (mp) {
! case 0:
! X = split_mime_params(& (att->TYPE_opts),buf1,0,1);

! break;
! case 1:

! X = split_mime_params(& (att->TYPE_opts),buf1,0,0);
! break;
! default:


! X = split_mime_params(& (att->TYPE_opts),buf1,
! MAX_COMPAT_LEN,0);

! break;
! }
! }
!

! free_string(&buf1);
! if (X) {

! media_type_t T = NULL;
!

--- 1574,1610 ----

! "Structured types don't allow encoding of data."));
sleep_message();
}
}


else if (ch == 'p' || ch == 'P') {
int code;

prompt = TRUE;
! PutLineX (LINES-3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachEnterContentDisp,
! "Content-Disposition: "));
! strfcpy (buf, DISPOSITION(att->disposition), sizeof buf);
! if (att->disposition_opts) {
! int l;
!
! strfcat (buf,"; ", sizeof buf);
! l = strlen (buf);
! strfcpy (buf + l, att->disposition_opts, sizeof (buf) - l);
! }

! code = optionally_enter(buf, LINES-3, 21,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! sizeof buf, page);
if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
continue;
}

! if (0 != code)

continue;
! mime_get_disposition (buf, att);
update = TRUE;
}
else if (ch == 'e' || ch == 'E') {

--- 1626,1722 ----


prompt = FALSE;
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmStructuredNoencoding,
! "%S: Structured types don't allow encoding of data."),
! att->dispname);
sleep_message();
}
}
else if (ch == 'p' || ch == 'P') {
int code;
+
+ struct string *buf1 = NULL;
+ char **X;

prompt = TRUE;
!

! "Content-Disposition: "));
!

if (REDRAW_MARK == code) {
update = TRUE;
prompt = FALSE;
+
+ if (buf1)
+ free_string(&buf1);
+
continue;
}

!

! if (0 != code) {
! if (buf1)
! free_string(&buf1);

continue;
! }
!
! {


! int mp = give_dt_enumerate_as_int(&mime_parameters);

! /* 0 == plain


! 1 == encoded
! 2 == ascii-and-encoded
! */
!

! switch (mp) {
! case 0:
! X = split_mime_params(& (att->DISPOSITION_opts),buf1, 0,1);

! break;
! case 1:

! X = split_mime_params(& (att->DISPOSITION_opts),buf1, 0,0);

! break;
! default:


! X = split_mime_params(& (att->DISPOSITION_opts),buf1,
! MAX_COMPAT_LEN,0);
! }
! }
!
! free_string(&buf1);
!
! if (X) {
!

if (ch == '\n')

break;
--- 1822,1829 ----
again = 0;
}

! menu_Write_to_screen (page,
! FRM("%s"),ENCODING(att->encoding));
ch = menu_ReadCh(page,REDRAW_MARK|READCH_sig_char);

if (ch == '\n')

break;
***************
*** 1605,1610 ****

--- 1881,1917 ----
return ret_value;
}

+
+ char * compat_filename(orig,ok)
+ char * orig;
+ int *ok;
+ {
+ char * buf = safe_malloc(MAX_COMPAT_LEN+2);
+ char *x;

+ char *p;
+

+ *ok = 1;
+ for (p = buf, x=orig; *x; p++, x++) {
+
+ *p = *x;
+
+ if (p-buf > MAX_COMPAT_LEN) {
+ *ok = 0;

+ break;
+ }
+

+ if (!isascii(*p) || iscntrl(*p)) {
+ *ok = 0;
+ *p = '_';
+ }
+ }

+ *p = '\0';
+
+
+ return buf;
+ }
+

+ static void mime_guess_content_type P_((mime_t *ptr));
static void mime_guess_content_type (ptr)
mime_t *ptr;
{
***************
*** 1614,1641 ****
* that, to a small list of builtin definitions.
*/
int i, found = FALSE;
! char *p, *c, buf[LONG_STRING];
FILE *fp = NULL;

DPRINT(Debug,3, (&Debug, "mime_guess_content_type: pathname=%s\n",
! ptr->pathname));

if (ptr->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"mime_guess_content_type",
"Bad magic number");

+ */
+

+ int have_encoded = 0;

DPRINT(Debug,3, (&Debug, "mime_guess_content_type: pathname=%s\n",
! ptr->pathname0));

if (ptr->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"mime_guess_content_type",
"Bad magic number");


/* Set the "filename" field for content-disposition */
! p = strrchr (ptr->pathname0, '/');
if (p)
p++;
else
! p = ptr->pathname0;
!
! compat = compat_filename(p,&was_ok);
!

!
! if (mp > 0 &&

! (!was_ok || !can_ascii_string(ptr->dispname))) {
! struct string *p1 = pick_name(ptr->dispname);
!
! if (p1) {
! mime_params_add(& (ptr->DISPOSITION_opts),"filename", p1);


!
! free_string(&p1);
!
! have_encoded ++;

!
! }
! }
!

! if (0 == mp ||
! 2 == mp ||
! ! have_encoded) {
!

! mime_params_add_compat(& (ptr->DISPOSITION_opts),
! "filename", compat);

! free(compat); compat = NULL;
! }
!

/* Try to guess the content type of the data by the filename extension */
! p = strrchr (ptr->pathname0, '.');
if (! p)
return;
p++;
***************
*** 1676,1693 ****
mime_panic(__FILE__,__LINE__,
"mime_guess_content_type",
"application/postscript is not known");
! if (ptr->type_opts) {
! free (ptr->type_opts);

! ptr->type_opts = NULL;
! }
! }

mime_panic(__FILE__,__LINE__,"attach_info",
"Bad magic number");


! if (stat (ptr->pathname, &sb) == -1) {
if (errno == ENOENT)
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmFileNotExist,
! "That file %.20s does not exist!"),
! ptr->pathname);
else
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmCantStatFile,
! "Could not stat file %.20s!"),
! ptr->pathname);
sleep_message();
return (-1);
}

ptr->length = sb.st_size;

! if (can_open(ptr->pathname,"r") != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotReadableByUser,
! "%.50s isn't readable by user!"),
! ptr->pathname);
! ptr->pathname[0] = '\0';
sleep_message();
return (-1);
}
--- 2093,2120 ----

mime_panic(__FILE__,__LINE__,"attach_info",
"Bad magic number");

! const char *cs;

! else
! menu_Write_to_screen(page,

if (is_cur && has_highlighting && ! arrow_cursor)
! menu_EndXX(page,pg_INVERSE);
}


! static void write_num P_((int num, int is_cur, int offset,

! struct menu_context *page));


! static void write_num(num, is_cur, offset,page)
int num, is_cur,offset;
+ struct menu_context *page;
{
char buf[10];

***************
*** 2014,2046 ****
buf[0] = '-';
buf[1] = '>';
}
! PutLine0 (offset, 0, buf);

! }
!

! static void attach_low_menu P_((int rdonly, struct menu_context *page));
! static void attach_low_menu(rdonly, page)
! int rdonly;

! struct menu_context *page;


! {
! struct string * buf1 = NULL;

! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES,&COLUMNS);
!
! if (rdonly) {
! buf1 =
! format_string(CATGETS(elm_msg_cat, MeSet, MeAttachMenuLowRd,

! "p)rint, s)ave, v)iew subparts, q)uit"));
!
! } else {


! buf1 =
! format_string(CATGETS(elm_msg_cat, MeSet, MeAttachMenuLow,
! "a)dd, e)dit, d)elete, m)odify, p)rint, s)ave, v)iew subparts, q)uit"));
! }
!
! print_center(LINES-2, buf1);
!
! free_string(&buf1);
}

static void free_structure P_((struct attach_structure **structure,
--- 2368,2374 ----
buf[0] = '-';
buf[1] = '>';
}
! menu_PutLine0 (page,offset, 0, buf);
}

static void free_structure P_((struct attach_structure **structure,
***************
*** 2176,2193 ****
int cur,

int start,
int end,
- int offset,
int draw_cursor_only,
struct menu_context *page));


! static struct attach_structure * draw_loc (structure,len,cur,start,end,offset,
draw_cursor_only, page)
struct attach_structure *structure;
int len;
int cur;
int start;
int end;
- int offset;
int draw_cursor_only;
struct menu_context *page;
{
--- 2504,2519 ----
int cur,
int start,
int end,
int draw_cursor_only,

struct menu_context *page));


! static struct attach_structure * draw_loc (structure,len,cur,start,end,
draw_cursor_only, page)
struct attach_structure *structure;
int len;
int cur;
int start;
int end;
int draw_cursor_only;

struct menu_context *page;
{
***************

+
+ #if ANSI_C
+ static subpage_simple_redraw sb_update_attach_menu;
+ #endif
+ static int sb_update_attach_menu(ptr,list)
+ struct menu_context *ptr;


+ struct menu_param *list;
+ {

+ int rdonly = mp_lookup_integer(list,attach_mp_rdonly);
+
+ menu_ClearScreen(ptr);
+

+ if (rdonly)
+ menu_print_format_center(ptr,1,
+ CATGETS(elm_msg_cat, MeSet, MeAttachMenuLowRd,
+ "p)rint, s)ave, v)iew subparts, q)uit"));
+ else
+ menu_print_format_center(ptr,1,
+ CATGETS(elm_msg_cat, MeSet, MeAttachMenuLow,

+ "a)dd, e)dit, d)elete, m)odify, p)rint, s)ave, v)iew subparts, q)uit"));
+

+ return 1; /* menu completed */
+ }

+
+ #if ANSI_C
+ static subpage_simple_redraw sb_update_attach_title;
+ #endif
+ static int sb_update_attach_title(ptr,list)
+ struct menu_context *ptr;


+ struct menu_param *list;
+ {

+ int mime = mp_lookup_integer(list,attach_mp_mime_structure);
+ int LENGTH = mp_lookup_integer(list,attach_mp_LENGTH);

+
+ menu_ClearScreen(ptr);
+
+ if (!mime)
+ menu_print_format_center(ptr,1,


+ CATGETS(elm_msg_cat, ElmSet, ElmAttachMenu,
+ "Attachment Menu (%d attachments)"),
+ LENGTH);
+ else

+ menu_print_format_center(ptr,1,


+ CATGETS(elm_msg_cat, ElmSet, ElmAttachMenu2,
+ "MIME structure Menu (%d visible parts)"),
+ LENGTH);

+ return 1; /* title completed */
+ }
+
+

+ /* FIXME: this should be more close to hadling of main screen ... */
+

+ static void set_attach_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_attach_screen(page,LOC, LIST)


+ struct menu_context *page;
+ struct screen_parts *LOC;
+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ /* Title part */
+

+ if (! LOC->title_page)

+ LOC->title_page = new_menu_subpage(page,0,3,sb_update_attach_title,
+ LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,3);
+
+ /* Attachments part */
+

+ if (! LOC->header_page)

+ LOC->header_page = new_menu_subpage(page,3,LINES-10,
+ subpage_simple_noredraw,LIST);
+ else
+ menu_subpage_relocate(LOC->header_page,page,3,LINES-10);
+

+ /* Menu part */


+
+ if (LOC->menu_page)

+ menu_subpage_relocate(LOC->menu_page,page,LINES-7,3);
+ else
+ LOC->menu_page = new_menu_subpage(page,LINES-7,3,
+ sb_update_attach_menu,LIST);
+

+ /* Prompt part */
+

+ if (LOC->prompt_page)
+ menu_subpage_relocate(LOC->prompt_page,page,LINES-4,4);
+ else
+ LOC->prompt_page = new_menu_subpage(page,LINES-4,4,
+ subpage_simple_noredraw,LIST);

+
+ }
+

+ static void check_attach_screen P_((struct screen_parts *LOC,
+ struct menu_param *list,
+ struct attach_structure **current,
+ struct attach_structure *top_structure,
+ int top_len,
+ int cur,
+ int top));
+ static void check_attach_screen(LOC,list, current,top_structure, top_len,
+ cur, top)

+ struct screen_parts *LOC;
+ struct menu_param *list;

+ struct attach_structure ** current;
+ struct attach_structure *top_structure;
+ int top_len;
+ int cur;
+ int top;
+
+ {
+ /* Title area */

+
+ if (menu_resized(LOC->title_page)) {

+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }


+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));

+ sb_update_attach_title(LOC->title_page,list);
+ }
+
+ /* Menu area */
+

+ if (menu_resized(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->menu_page)) {


+ DPRINT(Debug,1, (&Debug, "menu page redraw\n"));
+ sb_update_attach_menu(LOC->menu_page,list);
+ }
+

+ /* Prompt area */


+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {

+ DPRINT(Debug,7, (&Debug, "prompt page redraw\n"));


+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.

+ */
+ }
+
+ /* Attachments part */
+
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "attachment page resized\n"));
+
+ menu_trigger_redraw(LOC->header_page);
+ }
+

+ if (menu_need_redraw(LOC->header_page)) {
+ int li, co;
+

+ menu_ClearScreen(LOC->header_page);
+

+ menu_get_sizes(LOC->header_page,&li, &co);
+
+ DPRINT(Debug,7, (&Debug,
+ "attachment page redraw (li = %d, co = %d, top = %d\n",
+ li, co, top));
+
+
+ *current = draw_loc(top_structure,top_len,cur,
+ top,top + li-1,
+ 0, LOC->header_page);

+
+ }
+
+
+ }
+

void attach_menu (F,T,A,defcharset, mailer_info,hdr, aview)
FILE *F;
mime_t *T;
***************
*** 2239,2251 ****

struct attach_structure * current = NULL;

! int cur = 0, offset = 3, ch;
int update = TRUE;
int top = 0;

int LENGTH = 0;


struct menu_context *page = new_menu_context();


if (A)
feed_attachments(A,&top_structure,&top_len);
--- 2749,2770 ----

struct attach_structure * current = NULL;

! int cur = 0, ch;
int update = TRUE;
int top = 0;

int LENGTH = 0;


struct menu_context *page = new_menu_context();

+ struct screen_parts LOC = { NULL, NULL, NULL, NULL };

+ struct menu_param PARAM[attach_mp_COUNT+1] = {
+ { mp_integer, { 0 } },
+ { mp_integer, { 0 } },
+ { mp_integer, { 0 } },
+ { mp_END, { 0 } }

- int LINES, COLUMNS;
-

resize_mark:
! menu_get_sizes(page,&LINES,&COLUMNS);
!
if (menu_resized(page)) {
! menu_get_sizes(page,&LINES,&COLUMNS);
!
update = TRUE;

! } else if (menu_need_redraw(page))
! update = TRUE;

! if (cur < top || cur >= top + LINES-4-offset) {
! if (cur < top)
! top -= LINES-4-offset;
! if (cur >= top + LINES-4-offset)
! top += LINES-4-offset;
! if (top >= LENGTH)
! top = LENGTH - LINES +4 +offset;

! if (top < 0)
! top = 0;

! update = TRUE;
}
! if (update) {
menu_ClearScreen(page);
-
- if (A)

- print_format_center(1,


- CATGETS(elm_msg_cat, ElmSet, ElmAttachMenu,
- "Attachment Menu (%d attachments)"),
- LENGTH);
- else

- print_format_center(1,


- CATGETS(elm_msg_cat, ElmSet, ElmAttachMenu2,
- "MIME structure Menu (%d visible parts)"),
- LENGTH);
-
- attach_low_menu(T != NULL, page);
-
- current = draw_loc(top_structure,top_len,cur,
- top,top + LINES -5 - offset,
- offset,0, page);

update = FALSE;
show_last_error();
! } else if (!current)
! current = draw_loc(top_structure,top_len,cur,-1,-1,offset,0,
! page);
!
! ClearLine (LINES-3);
! PutLineX (LINES-3, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachMenuPrompt,
! "Attachments: "));

! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);

! clear_error(); /* Clear the error message (from buffer also) */

switch (ch) {
case RESIZE_MARK:


--- 2802,2874 ----
#endif

for (;;) {
resize_mark:
!
if (menu_resized(page)) {
! set_attach_screen(page,&LOC,PARAM);
!
update = TRUE;
+ }

! {
! int li, co;
!
! menu_get_sizes(LOC.header_page,&li, &co);
!
! if (cur < top || cur >= top + li) {
! if (cur < top)

! top -= li;


! if (cur >= top + li)

! top += li;


! if (top >= LENGTH)

! top = LENGTH - li;


! if (top < 0)
! top = 0;

! update = TRUE;
! menu_trigger_redraw(LOC.header_page);
! }
}
!
! if (!current)
! menu_trigger_redraw(LOC.header_page);
!
! if (update || menu_need_redraw(page)) {
menu_ClearScreen(page);

+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+

update = FALSE;
show_last_error();
! }
!
! check_attach_screen(&LOC,PARAM,&current,top_structure,top_len,
! cur,top);
!
!

! {
! int lin,col;
!

! menu_ClearLine(LOC.prompt_page,0);
!
! menu_PutLineX (LOC.prompt_page,0, 0,
! CATGETS(elm_msg_cat, MeSet, MeAttachMenuPrompt,
! "Attachments: "));
! menu_GetXYLocation(LOC.prompt_page,&lin,&col);

!
! menu_CleartoEOS(LOC.prompt_page);
!
! show_last_error();
! menu_MoveCursor(LOC.prompt_page,lin,col);
!
! ch = menu_ReadCh(LOC.prompt_page,
! REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);
!
! menu_CleartoEOS(LOC.prompt_page);
! set_error(""); /* clear error buffer */


! }

switch (ch) {
case RESIZE_MARK:
***************

current = NULL;
***************
*** 2363,2373 ****


case RIGHT_MARK:
case PAGEDOWN_MARK:
if ( current ) {
attach_header (current, FALSE,
current->attachments_index == -1,
! offset + cur - top,
! page);
! cur += LINES -4;
if (cur > LENGTH - 1)
cur = LENGTH - 1;
current = NULL;

--- 2902,2916 ----
case RIGHT_MARK:

if (ask_delete) {


for(;;) {
! PutLine0(LINES-3, 0, "Are you sure? (y/n): y");
! MoveCursor(LINES-3, 21);
! ch = menu_ReadCh(page, 0);
if (ch == 'y' || ch == '\n' || ch == 'n')
break;
}
! ClearLine(LINES-3);

if (ch == 'n')

break;
}
--- 3013,3028 ----
}
if (ask_delete) {


for(;;) {
! /* FIXME */
! menu_PutLine0(LOC.prompt_page,
! 0, 0, "Are you sure? (y/n): y");
! menu_MoveCursor(LOC.prompt_page,
! 0, 21);
! ch = menu_ReadCh(LOC.prompt_page, 0);
if (ch == 'y' || ch == '\n' || ch == 'n')
break;
}
! menu_ClearLine(LOC.prompt_page,0);

if (ch == 'n')

break;
}
***************
*** 2479,2487 ****

LENGTH = 0;
count_len(top_structure,top_len,&LENGTH,0);
- }

! update = TRUE;
}
break;
case 'a':
--- 3046,3058 ----

LENGTH = 0;
count_len(top_structure,top_len,&LENGTH,0);

! mp_list_set_integer(PARAM,attach_mp_LENGTH,LENGTH);
!
! menu_trigger_redraw(LOC.title_page);
! menu_trigger_redraw(LOC.header_page);

! }
!
}
break;
case 'a':

! else

! else

case 'i':
***************
*** 2596,2607 ****
#ifdef ALLOW_SUBSHELL
case '!':


! subshell(NULL,page);

- if (menu_need_redraw(page)) {
- menu_ClearScreen(page);
- update = TRUE;
- }
break;
#endif
default:

--- 3182,3189 ----
#ifdef ALLOW_SUBSHELL
case '!':


! subshell(NULL,page,LOC.prompt_page);

break;
#endif
default:
***************
*** 2613,2619 ****
--- 3195,3207 ----
}

OUT:
+ if (top_structure)
+ free_structure(&top_structure,&top_len);
+
+ free_mailbox_screen(&LOC);
+
erase_menu_context(&page);
+
return;
}

Index: elmME+.2.5.alpha5-cvs/src/browser.c
*** elmME+.2.5.alpha4/src/browser.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/browser.c 2005-07-26 11:28:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: browser.c,v 1.29.8.4 2004/08/14 12:06:10 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.4 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: browser.c,v 1.29.8.9 2005/07/26 08:28:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.9 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 133,147 ****
free_addr_items(address);
goto out; /* Alias FAILED */

! case 0x002E: /* '.' */
! if (1 == s_len) {
if (prev_folder && *prev_folder &&
select_dir_item(XXX, prev_folder)) {

ret = 1;
DPRINT(Debug,4,
(&Debug,
! "-- browser_expand (. == previous folder) OK\n"));
goto out;
}
goto out; /* previous folder */
--- 136,154 ----
free_addr_items(address);
goto out; /* Alias FAILED */

!
!
! case 0x0021: /* ! */
!
! if (2 == s_len &&
! 0x0021 /* ! */ == give_unicode_from_string(*name,1)) {
if (prev_folder && *prev_folder &&
select_dir_item(XXX, prev_folder)) {

ret = 1;
DPRINT(Debug,4,
(&Debug,
! "-- browser_expand (!! == previous folder) OK\n"));
goto out;
}
goto out; /* previous folder */


***************
*** 176,210 ****

if (!I->pvector[0]) {

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoSave, "<no save>"));
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
return 1;

} else if ((s_len=string_len(I->pvector[0])) > 0) {
switch (give_unicode_from_string(I->pvector[0],0)) {
case 0x003D: /* '=' Handle save copy prompt! */
if (1 == s_len) {

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,

! ElmUncondSaveByName,
! "<unconditionally save by name>"));
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
return 1;

} else if (2 == s_len &&
give_unicode_from_string(I->pvector[0],1)
== 0x003F /* '?' */) {

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,

! ElmCondSaveByName,
! "<conditionally save by name>"));
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
return 1;

}

--- 183,229 ----



if (!I->pvector[0]) {

! menu_PutLineX(I->current_page,LINES-3,0, FRM("%S"),I->pvector[1]);
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmNoSave,
! "<no save>"));
! menu_CleartoEOLN(I->current_page);
! menu_MoveCursor(I->current_page,
! LINES-3,string_len(I->pvector[1]));
return 1;

} else if ((s_len=string_len(I->pvector[0])) > 0) {
+
switch (give_unicode_from_string(I->pvector[0],0)) {

+

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,

! ElmSentFolder, "<\"sent\" folder>"));
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
return -1; /* Special prompt but normal expansion */
-
}
break;
}

--- 231,245 ----


case 0x003C: /* '<' */
if (1 == s_len) {

! menu_PutLineX(I->current_page,
! LINES-3,0, FRM("%S"),I->pvector[1]);
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmSentFolder, "<\"sent\" folder>"));
! menu_CleartoEOLN(I->current_page);
! menu_MoveCursor(I->current_page,
! LINES-3,string_len(I->pvector[1]));
return -1; /* Special prompt but normal expansion */
}
break;
}
***************
*** 234,246 ****

menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! MoveCursor(LINES-4, 45);
! CleartoEOS();
show_last_error();

! PutLineX(LINES-4, 50,
! CATGETS(elm_msg_cat, ElmSet, ElmUseForHelp,
! "(Use '?' for help)"));
}

static void gb_initial_non_append P_((struct enter_info *I));

--- 255,270 ----



menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! menu_MoveCursor(I->current_page,
! LINES-4, 45);
! menu_CleartoEOS(I->current_page);
!
show_last_error();

! menu_PutLineX(I->current_page,
! LINES-4, 50,
! CATGETS(elm_msg_cat, ElmSet, ElmUseForHelp,
! "(Use '?' for help)"));
}

static void gb_initial_non_append P_((struct enter_info *I));
***************
*** 251,261 ****

menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! PutLineX(LINES-3,0, FRM("%S"),I->pvector[1]);
if (I->pvector[0]) {
! Write_to_screen(FRM("%S"),I->pvector[0]);
! CleartoEOLN();
! MoveCursor(LINES-3,string_len(I->pvector[1]));
}
}

--- 275,291 ----

--- 294,323 ----
struct enter_info *I;


struct string * buffer;
{
+

--- 328,352 ----

--- 356,373 ----


enum enter_mode em;
struct menu_context *base_page;
{
! int sort_it = 0;
int append_current = 0 != (I->flags & OE_APPEND_CURRENT);
int LINES,COLUMNS;

menu_get_sizes(I->current_page,&LINES,&COLUMNS);

! switch(em) {
! case em_redraw:
I->GB_FLAGS |= GB_REDRAW ;

+ default:
+ break;
+ }

switch(em) {
int s_len;
***************
*** 323,331 ****
so we re-print prompt every time ... */

if (0 != (GB_SAVE_COPY & I->GB_FLAGS)) {
! MoveCursor(LINES-3,0);
! CleartoEOS();
show_last_error();
} else {
gb_initial_text(I);
}

--- 377,387 ----


so we re-print prompt every time ... */

if (0 != (GB_SAVE_COPY & I->GB_FLAGS)) {
! menu_MoveCursor(I->current_page,LINES-3,0);
! menu_CleartoEOS(I->current_page);
!
show_last_error();
+
} else {
gb_initial_text(I);
}

***************
*** 345,351 ****
}


/* FALLTHRU */

! case em_redraw: repage:

if (0 != (I->GB_FLAGS & GB_MENU))
I->GB_FLAGS |= GB_REDRAW;

--- 401,408 ----


}
/* FALLTHRU */

! case em_redraw:
! repage:

if (0 != (I->GB_FLAGS & GB_MENU))
I->GB_FLAGS |= GB_REDRAW;

***************
*** 355,360 ****
--- 412,418 ----




if (0 != (I->GB_FLAGS & GB_REDRAW)) {

+

struct string * buffer =
format_string(CATGETS(elm_msg_cat, ElmSet,
ElmFolderSelection,
***************
*** 367,388 ****
free_string(&buffer);
}

! if (0 != (I->GB_FLAGS & GB_HELP)) {
! MoveCursor(3,0); CleartoEOS();

if (0 != (GB_SAVE_COPY & I->GB_FLAGS)) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmListFoldersHelp1,
"Enter: <nothing> to not save a copy of the message,\n\
\r '<' to save in your \"sent\" folder ("));

{
char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");

! Write_to_screen(FRM("%s"), sent_val);
}

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmListFoldersHelp2,
"),\n\
\r '=' to save by name (the folder name depends on whom the\n\
\r message is to, in the end),\n\

--- 425,463 ----

*** 391,449 ****


\r or a filename (a leading '=' denotes your folder directory).\n\r\n\r"

));
} else {
- Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg1,
- "\n\r\n\rYou must specify a file or folder to "));


! Write_to_screen(FRM("%S"),I->pvector[2]);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg2,
! " to. Several options\n\rare available:\n\r\
\n\r '!' will use your incoming mailbox ("));

{

char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");

--- 466,551 ----


\r or a filename (a leading '=' denotes your folder directory).\n\r\n\r"

));
} else {

+ menu_Write_to_screen(I->current_page,
+ CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg1,
+ "You must specify a file or folder to "));

! menu_Write_to_screen(I->current_page,
! FRM("%S"),I->pvector[2]);

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg2,

! " to. Several options\n\rare available:\n\r\
\n\r '!' will use your incoming mailbox ("));

{

char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");

if (default_val)
! menu_Write_to_screen(I->current_page,
! FRM("%s"),default_val);
}

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg3,
! ")\n\r '>' will use your \"received\" folder ("));
{
char * recvd_val = give_dt_estr_as_str(&recvd_mail_e,"receivedmail");
if (recvd_val)
! menu_Write_to_screen(I->current_page,
! FRM("%s"),recvd_val);
}
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg4,
! ")\n\r '<' will use your \"sent\" folder ("));

{
char * sent_val = give_dt_estr_as_str(&sent_mail_e,"sentmail");

if (sent_val)
! menu_Write_to_screen(I->current_page,
! FRM("%s"), sent_val);
}

if (I->pvector[3]) {
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg5,

! ")\n\r '!!' will use the previous folder ("));


! menu_Write_to_screen(I->current_page,
! FRM("%S"), I->pvector[3]);
}

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg6,
! ")\n\r '@alias' will use the default folder for \"alias\"\n\r\n\r\
If you enter a filename elm will use that file. If the file name begins\n\r\
with a '=', elm will look for the file in your folder directory\n\r\
(your folder directory is "));
!

! {
! /* give_dt_estr_as_str adds / to end */

! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
!

! menu_Write_to_screen(I->current_page,
! FRM("%s)\r\n\n"),
! folders_val ? folders_val : "???");
! }
!
if (browser_wildcards) {
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg7,
! "You may use wildcards (*?) in the name, similary as you do in the shell.\n\r"));
}
}

! /* FIXME */
! GetXYLocation(&line,&col);
! if (line < (LINES-3) - 4)
! browser_help(I);
! else
! I->GB_FLAGS |= GB_HELP2;
!
}

if (0 != (I->GB_FLAGS & GB_MENU)) {
***************
*** 453,458 ****

--- 555,565 ----



gb_dir_title(I,&entries);

+ if (sort_it) {
+ sort_it = 0;
+ folder_sort_dir(I->dir_p, sort_message);
+ }
+
if (I->GB_PAGE > entries / lines_per_page)
I->GB_PAGE = entries / lines_per_page;
if (I->GB_LINE > entries-1 && entries > 0)
***************
*** 467,478 ****

for (; i < I->GB_PAGE * lines_per_page + lines_per_page;
i++) {
! MoveCursor(5 + i % lines_per_page,0);
! CleartoEOLN();
}
}

break;
case em_enter:
clear_error();

--- 574,587 ----



for (; i < I->GB_PAGE * lines_per_page + lines_per_page;
i++) {
! menu_MoveCursor(I->current_page,
! 5 + i % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
}

break;
+
case em_enter:
clear_error();

***************
*** 517,525 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
}

goto repage;
}

--- 626,637 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,
! '\007');
}

+ sort_it++;
+
goto repage;
}

***************
*** 532,538 ****

--- 644,652 ----


"-- gb_browser(..,%d)=NULL\n",
em));
return NULL;
+
case em_prev:
+
clear_error();
if (0 != (I->GB_FLAGS & GB_MENU)) {
int lines_per_page = LINES-10;
***************
*** 552,558 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
goto repage;
}

--- 666,672 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}

***************
*** 564,577 ****


if (oldline < entries)
draw_line(I,oldline,lines_per_page);
else {
! MoveCursor(5 + oldline % lines_per_page,0);
! CleartoEOLN();
}
if (I->GB_LINE < entries)
draw_line(I,I->GB_LINE,lines_per_page);
}
break;
case em_next:
clear_error();
if (0 != (I->GB_FLAGS & GB_MENU)) {
int lines_per_page = LINES-10;

--- 678,694 ----


if (oldline < entries)
draw_line(I,oldline,lines_per_page);
else {
! menu_MoveCursor(I->current_page,
! 5 + oldline % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
if (I->GB_LINE < entries)
draw_line(I,I->GB_LINE,lines_per_page);
}
break;
+
case em_next:
+
clear_error();
if (0 != (I->GB_FLAGS & GB_MENU)) {
int lines_per_page = LINES-10;
***************

*** 592,598 ****


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
goto repage;
}
}

--- 709,715 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 605,617 ****
if (oldline < entries)
draw_line(I,oldline,lines_per_page);
else {
! MoveCursor(5 + oldline % lines_per_page,0);
! CleartoEOLN();
}
if (I->GB_LINE < entries)
draw_line(I,I->GB_LINE,lines_per_page);
}
break;
case em_tabaction:
DPRINT(Debug,8, (&Debug,
"-- gb_browser - tabaction: append_current=%d ch_count=%d\n",

--- 722,735 ----


if (oldline < entries)
draw_line(I,oldline,lines_per_page);
else {
! menu_MoveCursor(I->current_page,5 + oldline % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
if (I->GB_LINE < entries)
draw_line(I,I->GB_LINE,lines_per_page);
}
break;
+
case em_tabaction:
DPRINT(Debug,8, (&Debug,
"-- gb_browser - tabaction: append_current=%d ch_count=%d\n",
***************
*** 641,649 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
}

goto repage;
}

--- 759,769 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}

+ sort_it++;
+
goto repage;
}

***************
*** 658,685 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
}
goto repage;
} else {

/* Ring a bell */

! Writechar('\007');
goto repage;
}
/* NOT REACHED */

case em_left:
clear_error();
if (0 != (I->GB_FLAGS & GB_MENU)) {

if (0 == (I->GB_FLAGS & GB_FILL)) {

if (!change_dir_up(I->dir_p,&(I->pvector[0]))) {

/* Ring a bell */

! Writechar('\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
}
goto repage;
} else {

--- 778,811 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}
+
+ sort_it++;
+
goto repage;
} else {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
/* NOT REACHED */

case em_left:
clear_error();

+

if (0 != (I->GB_FLAGS & GB_MENU)) {

if (0 == (I->GB_FLAGS & GB_FILL)) {

if (!change_dir_up(I->dir_p,&(I->pvector[0]))) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
+
+ sort_it++;
}
goto repage;
} else {
***************
*** 689,695 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
goto repage;
}
}

--- 815,821 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 706,715 ****
if (!change_dir_to_entry(I->dir_p,I->GB_LINE,
&(I->pvector[0]))) {

/* Ring a bell */

! Writechar('\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
}

goto repage;

--- 832,843 ----


if (!change_dir_to_entry(I->dir_p,I->GB_LINE,
&(I->pvector[0]))) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
+
+ sort_it++;
}

goto repage;
***************

*** 721,732 ****


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
goto repage;
}
}
}

break;
}


--- 849,863 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
}

break;
+
+ default:
+ break;
}


***************
*** 742,748 ****
static int run_browser P_((struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
- int * redraw,
int save_copy,
struct string *word,
struct string * prev_fold,

--- 873,878 ----
***************
*** 750,763 ****


const char *format, const char *msg,

va_list args));
static int run_browser(page,
! p,buffer,redraw,save_copy,
word,prev_fold,
aview,
format,msg,args)
struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
- int * redraw;
int save_copy;
struct string *word;
struct string * prev_fold;

--- 880,892 ----


const char *format, const char *msg,
va_list args));
static int run_browser(page,
! p,buffer,save_copy,
word,prev_fold,
aview,
format,msg,args)
struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
int save_copy;
struct string *word;
struct string * prev_fold;
***************
*** 773,779 ****
struct string *vector[4];
struct enter_info INFO;
int LINES,COLUMNS;
!
DPRINT(Debug,4,
(&Debug, "run_browser: Entering [%s]\n",format));

--- 902,909 ----


struct string *vector[4];
struct enter_info INFO;
int LINES,COLUMNS;

! int delay_redraw = 0;
!

DPRINT(Debug,4,
(&Debug, "run_browser: Entering [%s]\n",format));

***************
*** 800,818 ****
INFO.dir_p = p;
INFO.aview = aview;
INFO.current_page = page;
!
if (save_copy)
INFO.GB_FLAGS |= GB_SAVE_COPY;

clear_selection_dir(p);
do {
code = enter_helper(&INFO,page);
} while (code == REDRAW_MARK);

menu_get_sizes(page,&LINES,&COLUMNS);

! MoveCursor(LINES-4,0);
! CleartoEOS();
show_last_error();

if (0 != code) {

--- 930,957 ----

--- 964,978 ----


ret = 1;
}

*buffer = vector[0];

free_string(&text);

+ if (delay_redraw || (INFO.GB_FLAGS & GB_REDRAW)) {
+ DPRINT(Debug,10, (&Debug, "run_browser: redraw set\n"));
+ menu_trigger_redraw(page);
+ }
+
DPRINT(Debug,10, (&Debug,
"run_browser=%d\n",ret));

***************
*** 844,850 ****
struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
- int * redraw,
struct AliasView *aview,

const char *format, const char *msg, ...
#else
--- 985,990 ----
***************
*** 856,865 ****


struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
- int * redraw;
struct AliasView *aview;

! CONST char *format;

! CONST char *msg;
va_dcl
#endif
{

--- 996,1004 ----


struct menu_context *page;
struct folder_browser *p;
struct string **buffer;

struct AliasView *aview;
! const char *format;

! const char *msg;
va_dcl
#endif
{

***************
*** 872,878 ****
"change"));

Va_start(vl, msg); /* defined in defs.h */
! if (run_browser(page,p,buffer,redraw,0,word,NULL,aview,format,msg,vl))

ret = folder_from_dir_item(p,TreatAsSpooled);
va_end(vl);

--- 1011,1017 ----


"change"));

Va_start(vl, msg); /* defined in defs.h */
! if (run_browser(page,p,buffer,0,word,NULL,aview,format,msg,vl))

ret = folder_from_dir_item(p,TreatAsSpooled);


va_end(vl);

***************
*** 914,929 ****
c = 'D';

if (current && !arrow_cursor)
! StartInverse();
! PutLineX(5 + i % lines_per_page,0,
! FRM("%.2s%c%c %-*.*S"),
! current && arrow_cursor ? "->" : " ",
! flags & BROWSER_MARKED ? 'N' : ' ',
! c,size,size,buffer);
if (current && !arrow_cursor)
! EndInverse();
}

static struct string **gb_filebrowser P_((struct enter_info *I,
enum enter_mode em,
struct menu_context *base_page));

--- 1053,1071 ----


c = 'D';

if (current && !arrow_cursor)
! menu_StartXX(I->current_page,pg_INVERSE);
!
! menu_PutLineX(I->current_page,
! 5 + i % lines_per_page,0,
! FRM("%.2s%c%c %-*.*S"),
! current && arrow_cursor ? "->" : " ",
! flags & BROWSER_MARKED ? 'N' : ' ',
! c,size,size,buffer);
if (current && !arrow_cursor)
! menu_EndXX(I->current_page,pg_INVERSE);
}

+
static struct string **gb_filebrowser P_((struct enter_info *I,
enum enter_mode em,
struct menu_context *base_page));
***************
*** 932,938 ****
enum enter_mode em;
struct menu_context *base_page;
{
!
int append_current = 0 != (I->flags & OE_APPEND_CURRENT);
int LINES,COLUMNS;

--- 1074,1080 ----


enum enter_mode em;
struct menu_context *base_page;
{
! int sort_it = 0;
int append_current = 0 != (I->flags & OE_APPEND_CURRENT);
int LINES,COLUMNS;

***************
*** 986,1006 ****
}

if (0 != (I->GB_FLAGS & GB_HELP)) {
! MoveCursor(3,0); CleartoEOS();

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileSpecify1,
! "\n\r\n\rYou must specify a file to "));

! Write_to_screen(FRM("%S"),I->pvector[2]);

! Write_to_screen(FRM(".\n\r"));

if (browser_wildcards) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg7,
! "You may use wildcards (*?) in the name, similary as you do in the shell.\n\r"));
}

! browser_help();
}

if (0 != (I->GB_FLAGS & GB_MENU)) {

--- 1128,1153 ----


}

if (0 != (I->GB_FLAGS & GB_HELP)) {
! menu_MoveCursor(I->current_page,3,0);
! menu_CleartoEOS(I->current_page);

! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileSpecify1,
! "\n\r\n\rYou must specify a file to "));

! menu_Write_to_screen(I->current_page,
! FRM("%S"),I->pvector[2]);

! menu_Write_to_screen(I->current_page,
! FRM(".\n\r"));

if (browser_wildcards) {
! menu_Write_to_screen(I->current_page,
! CATGETS(elm_msg_cat, ElmSet, ElmFileHelpmsg7,
! "You may use wildcards (*?) in the name, similary as you do in the shell.\n\r"));
}

! browser_help(I);
}

if (0 != (I->GB_FLAGS & GB_MENU)) {
***************
*** 1010,1015 ****

--- 1157,1167 ----



gb_dir_title(I,&entries);

+ if (sort_it) {
+ sort_it = 0;
+ folder_sort_dir(I->dir_p, sort_message);
+ }
+
if (I->GB_PAGE > entries / lines_per_page)
I->GB_PAGE = entries / lines_per_page;
if (I->GB_LINE > entries-1 && entries > 0)
***************
*** 1024,1031 ****

for (; i < I->GB_PAGE * lines_per_page + lines_per_page;
i++) {

! MoveCursor(5 + i % lines_per_page,0);
! CleartoEOLN();
}
}

--- 1176,1184 ----



for (; i < I->GB_PAGE * lines_per_page + lines_per_page;
i++) {
! menu_MoveCursor(I->current_page,

! 5 + i % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
}

***************
*** 1063,1071 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
}

goto repage;
}

--- 1216,1226 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}

+ sort_it++;
+
goto repage;
}

***************
*** 1098,1104 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
goto repage;
}

--- 1253,1259 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}

***************

*** 1110,1117 ****
if (oldline < entries)
draw_fileline(I,oldline,lines_per_page);
else {
! MoveCursor(5 + oldline % lines_per_page,0);
! CleartoEOLN();
}
if (I->GB_LINE < entries)
draw_fileline(I,I->GB_LINE,lines_per_page);

--- 1265,1273 ----


if (oldline < entries)
draw_fileline(I,oldline,lines_per_page);
else {
! menu_MoveCursor(I->current_page,
! 5 + oldline % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
if (I->GB_LINE < entries)
draw_fileline(I,I->GB_LINE,lines_per_page);
***************
*** 1138,1144 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
goto repage;
}
}

--- 1294,1300 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 1151,1158 ****
if (oldline < entries)
draw_fileline(I,oldline,lines_per_page);
else {
! MoveCursor(5 + oldline % lines_per_page,0);
! CleartoEOLN();
}
if (I->GB_LINE < entries)
draw_fileline(I,I->GB_LINE,lines_per_page);

--- 1307,1315 ----


if (oldline < entries)
draw_fileline(I,oldline,lines_per_page);
else {
! menu_MoveCursor(I->current_page,
! 5 + oldline % lines_per_page,0);
! menu_CleartoEOLN(I->current_page);
}
if (I->GB_LINE < entries)
draw_fileline(I,I->GB_LINE,lines_per_page);
***************
*** 1187,1195 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
}

goto repage;
}

--- 1344,1354 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}

+ sort_it++;
+
goto repage;
}

***************
*** 1204,1222 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
}
goto repage;
} else {

/* Ring a bell */

! Writechar('\007');
goto repage;
}
/* NOT REACHED */

-

! case em_left:
clear_error();
if (0 != (I->GB_FLAGS & GB_MENU)) {

--- 1363,1383 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
}
+
+ sort_it++;
+
goto repage;
} else {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
/* NOT REACHED */


! case em_left:
clear_error();
if (0 != (I->GB_FLAGS & GB_MENU)) {

***************
*** 1224,1233 ****

if (!change_dir_up(I->dir_p,&(I->pvector[0]))) {

/* Ring a bell */

! Writechar('\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
}
goto repage;
} else {

--- 1385,1396 ----



if (!change_dir_up(I->dir_p,&(I->pvector[0]))) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
+
+ sort_it++;
}
goto repage;
} else {
***************
*** 1237,1243 ****
&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
goto repage;
}
}

--- 1400,1406 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
***************
*** 1254,1263 ****
if (!change_dir_to_entry(I->dir_p,I->GB_LINE,
&(I->pvector[0]))) {

/* Ring a bell */

! Writechar('\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
}

goto repage;

--- 1417,1428 ----


if (!change_dir_to_entry(I->dir_p,I->GB_LINE,
&(I->pvector[0]))) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
} else {
I->GB_LINE = 0;
I->GB_PAGE = 0;
+
+ sort_it++;
}

goto repage;
***************

*** 1269,1280 ****


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! Writechar('\007');
goto repage;
}
}
}

break;
}

write_prompt(I);
--- 1434,1448 ----


&(I->pvector[0]),
I->GB_FLAGS & GB_FILL ? 1 : 0)) {

/* Ring a bell */

! menu_Writechar(I->current_page,'\007');
goto repage;
}
}
}

break;
+
+ default:
+ break;
}

write_prompt(I);

***************
*** 1290,1296 ****
struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
- int * redraw,
enum word_sel w,
struct string * prev_fold,
struct AliasView *aview,

--- 1458,1463 ----
***************
*** 1304,1315 ****


struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
- int * redraw;
enum word_sel w;
struct string * prev_fold;
struct AliasView *aview;

! CONST char *format;

! CONST char *msg;
va_dcl
#endif
{

--- 1471,1481 ----


struct menu_context *page;
struct folder_browser *p;
struct string **buffer;

enum word_sel w;
struct string * prev_fold;
struct AliasView *aview;

! const char *format;

! const char *msg;
va_dcl
#endif
{

***************
*** 1343,1349 ****

Va_start(vl, msg); /* defined in defs.h */

! r = run_browser(page,p,buffer,redraw,save_copy,word,prev_fold,
aview,format,msg,vl);
va_end(vl);

--- 1509,1515 ----



Va_start(vl, msg); /* defined in defs.h */

! r = run_browser(page,p,buffer,save_copy,word,prev_fold,
aview,format,msg,vl);
va_end(vl);

***************
*** 1361,1367 ****
struct menu_context *page,
struct folder_browser *p,
struct string **buffer,
- int * redraw,
enum word_sel w,
struct AliasView *aview,

const char *format, const char *msg, ...

--- 1527,1532 ----
***************
*** 1374,1384 ****


struct menu_context *page;
struct folder_browser *p;
struct string **buffer;
- int * redraw;
enum word_sel w;
struct AliasView *aview;

! CONST char *format;

! CONST char *msg;
va_dcl
#endif
{

--- 1539,1548 ----


struct menu_context *page;
struct folder_browser *p;
struct string **buffer;

enum word_sel w;
struct AliasView *aview;

! const char *format;

! const char *msg;
va_dcl
#endif
{

***************
*** 1392,1397 ****
--- 1556,1563 ----


*/
struct enter_info INFO;
struct string * word = NULL;

+ int delay_redraw = 0;
+

int LINES,COLUMNS;

Va_start(vl, msg); /* defined in defs.h */
***************
*** 1447,1452 ****
--- 1613,1624 ----


clear_selection_dir(p);
do {
code = enter_helper(&INFO,page);

+
+ menu_ClearScreen(page);
+

+ menu_redraw_children(page);
+
+ delay_redraw++;
} while (code == REDRAW_MARK);

menu_get_sizes(page,&LINES,&COLUMNS);
***************
*** 1471,1484 ****
ret = 1;
}

- if (INFO.GB_FLAGS & GB_REDRAW)
- *redraw = TRUE;
-
*buffer = vector[0];

free_string(&text);
free_string(&word);

DPRINT(Debug,10, (&Debug, "file_browser=%d\n",ret));

return ret;
--- 1643,1658 ----

Kari E. Hurtta

unread,
Jul 28, 2005, 12:30:14 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.9

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 9/20 ) =========
Index: elmME+.2.5.alpha5-cvs/lib/shared_connect.c
*** elmME+.2.5.alpha4/lib/shared_connect.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/shared_connect.c 2005-07-26 11:28:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.2.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: shared_connect.c,v 1.2.8.4 2005/07/26 08:28:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.2.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 16,26 ****

DEBUG_VAR(Debug,__FILE__,"dl");

#include "shared_imp.h"

#include "save_opts.h"
#include "cs_imp.h"
#include "mbx_imp.h"

#include "ss_imp.h"
- #include "mailer_imp.h"

#if ANSI_C
#define S_(x) static x;

--- 16,26 ----


DEBUG_VAR(Debug,__FILE__,"dl");

#include "shared_imp.h"
+ #include "rc_imp.h"
#include "save_opts.h"
#include "cs_imp.h"

#include "mbx_imp.h"
#include "ss_imp.h"

#if ANSI_C
#define S_(x) static x;
***************
*** 97,107 ****
} f6;


- union F14 {
- void * ptr;
- provides_shared_MCF_f * f14;
- } f14;
-

struct reg_list *r = & (i->regs[reg_idx]);

- int x;
-

- shared_MCF_types =
- safe_realloc(shared_MCF_types,
- sizeof (shared_MCF_types[0]) *
- (shared_MCF_type_count + count));
-
- DPRINT(Debug,7,(&Debug," ... provides_shared_MCF: (shared_MCF_types) count %d\n",
- count));
- res = 1;
-
- for (x = 0; x < count; x++) {
- shared_MCF_types[shared_MCF_type_count+x].T = &(res14[x]);
- shared_MCF_types[shared_MCF_type_count+x].imp_idx = i;
- }
- shared_MCF_type_count += count;
- }
- }
-

i->regs[reg_idx].valid = res;

return res;
--- 315,320 ----
***************
*** 402,423 ****
NULL, 0
};

- struct mailer_config * loc_mailer_type(f)
- char *f;

- {
- int x;
-

- /* We must load all connect libraries */
- load_shared_libs1(&use_shared_connect);
-
-
- for (x = 0; x < shared_MCF_type_count; x++)
- if (0 == strcmp(shared_MCF_types[x].T->mailer_type,f)) {
- return shared_MCF_types[x].T;

- }
- return NULL;
- }

-
/* ------------------------------------------------------------------------ */


--- 357,362 ----

***************
*** 449,456 ****
void probe_pop_capa_lib(pop_capa_libs,pop_capa_libcount,capa,capa_args)
struct POP_capa_libs * *pop_capa_libs;
int * pop_capa_libcount;
! CONST char *capa;
! CONST char *capa_args;
{
int i;

--- 388,395 ----
void probe_pop_capa_lib(pop_capa_libs,pop_capa_libcount,capa,capa_args)
struct POP_capa_libs * *pop_capa_libs;
int * pop_capa_libcount;
! const char *capa;
! const char *capa_args;
{
int i;

***************
*** 500,510 ****

static int pop_capa_compare P_((const void *A, const void *B));
static int pop_capa_compare(A,B)
! CONST void *A;
! CONST void *B;
{
! CONST struct POP_capa_libs *A1 = A;
! CONST struct POP_capa_libs *B1 = B;

if (A1->priority < B1->priority)
return -1;
--- 439,449 ----

static int pop_capa_compare P_((const void *A, const void *B));
static int pop_capa_compare(A,B)
! const void *A;
! const void *B;
{
! const struct POP_capa_libs *A1 = A;
! const struct POP_capa_libs *B1 = B;

if (A1->priority < B1->priority)
return -1;
***************
*** 622,628 ****
void probe_imap_capa_lib(imap_capa_libs,imap_capa_libcount,capa)
struct IMAP_capa_libs * *imap_capa_libs;
int * imap_capa_libcount;
! CONST char *capa;
{
int i;

--- 561,567 ----
void probe_imap_capa_lib(imap_capa_libs,imap_capa_libcount,capa)
struct IMAP_capa_libs * *imap_capa_libs;
int * imap_capa_libcount;
! const char *capa;
{
int i;

***************
*** 671,681 ****

static int imap_capa_compare P_((const void *A, const void *B));
static int imap_capa_compare(A,B)
! CONST void *A;
! CONST void *B;
{
! CONST struct IMAP_capa_libs *A1 = A;
! CONST struct IMAP_capa_libs *B1 = B;

if (A1->priority < B1->priority)
return -1;
--- 610,620 ----

static int imap_capa_compare P_((const void *A, const void *B));
static int imap_capa_compare(A,B)
! const void *A;
! const void *B;
{
! const struct IMAP_capa_libs *A1 = A;
! const struct IMAP_capa_libs *B1 = B;

if (A1->priority < B1->priority)
return -1;
Index: elmME+.2.5.alpha5-cvs/lib/shiftlower.c
*** elmME+.2.5.alpha4/lib/shiftlower.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/shiftlower.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: shiftlower.c,v 1.7.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: shiftlower.c,v 1.7.8.2 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 17,30 ****
DEBUG_VAR(Debug,__FILE__,"mem");

char *shift_lower(string)
! CONST char *string;
{
/** return 'string' shifted to lower case. Do NOT touch the
actual string handed to us! **/

static char buffer[VERY_LONG_STRING];
char *bufptr = buffer;
! CONST char *src0 = string;

if (string == NULL) {
buffer[0] = 0;
--- 17,30 ----
DEBUG_VAR(Debug,__FILE__,"mem");

char *shift_lower(string)
! const char *string;
{
/** return 'string' shifted to lower case. Do NOT touch the
actual string handed to us! **/

static char buffer[VERY_LONG_STRING];
char *bufptr = buffer;
! const char *src0 = string;

if (string == NULL) {
buffer[0] = 0;
Index: elmME+.2.5.alpha5-cvs/lib/state.c
*** elmME+.2.5.alpha4/lib/state.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/state.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: state.c,v 1.10.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: state.c,v 1.10.8.4 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 25,42 ****
panic("STATE PANIC",f,ln,pr,ms,0);
}

! static unsigned char *s2us P_((char *str));
! static unsigned char *s2us(str)
! char *str;


{
! return (unsigned char *)str;
! }
!

! static CONST unsigned char *cs2us P_((const char *str));
! static CONST unsigned char *cs2us(str)
! CONST char *str;

! {


! return (CONST unsigned char *)str;
}


--- 25,35 ----
panic("STATE PANIC",f,ln,pr,ms,0);


}

! static const unsigned char *cs2us P_((const char *str));
! static const unsigned char *cs2us(str)
! const char *str;
{
! return (const unsigned char *)str;
}


***************
*** 214,221 ****
return EOF;
}

! if (*s->u.string.inreadp)
! ret = (unsigned char) *s->u.string.inreadp++;
return ret;
}

--- 207,214 ----
return EOF;
}

! ret = (unsigned char) *s->u.string.inreadp++;
!
return ret;
}

***************


*** 862,867 ****
--- 855,862 ----
}
r = add_streambyte_to_string(s->filter_line,ch);
if (!r) {
+ uint16 BAD = UNICODE_BAD_CHAR;
+
DPRINT(Debug,10,(&Debug,
"state_putc: failed to add byte %d to charset %s\n",
ch,
***************
*** 869,874 ****
--- 864,871 ----
s->filter_line->string_type->MIME_name :
"<not set>"));

+ /* Indicate bad character */
+ add_unicode_to_string(s->filter_line,1,&BAD);
}

if ('\n' == ch) {
***************

*** 902,908 ****
static int put_so_file P_((out_state_t *, const char *,int)); /* Prototype */
static int put_so_file(s,string,len)
out_state_t *s;
! CONST char *string;
int len;
{
if (s->magic != STATE_out_file)
--- 899,905 ----
static int put_so_file P_((out_state_t *, const char *,int)); /* Prototype */
static int put_so_file(s,string,len)
out_state_t *s;
! const char *string;
int len;
{
if (s->magic != STATE_out_file)
***************
*** 916,922 ****
static int put_so_string P_((out_state_t *, const char *,int)); /* Prototype */
static int put_so_string(s,string,len)
out_state_t *s;
! CONST char *string;
int len;
{
int count;
--- 913,919 ----
static int put_so_string P_((out_state_t *, const char *,int)); /* Prototype */
static int put_so_string(s,string,len)
out_state_t *s;
! const char *string;
int len;
{
int count;
***************
*** 934,940 ****
}

int state_put (string, len, s)
! CONST char *string;
int len;
out_state_t *s;
{
--- 931,937 ----
}

int state_put (string, len, s)
! const char *string;
int len;
out_state_t *s;

"state_put: failed to add all streambytes to string (r=%d != %d=len), ret=%d, charset %s\n",
***************

return first + r; /* FAILURE */
}
+
+

+ if (errors) {
+ DPRINT(Debug,10,(&Debug,
+ "state_put: %d errors\n",
+ errors));
+ }
}

DPRINT(DebugIO,30,(&DebugIO,

***************
*** 1094,1109 ****
int state_printf (
#if ANSI_C
out_state_t *s,


! CONST char * format,
! CONST char *msg, ...
#else

s, format, msg, va_alist
#endif
)
#if !ANSI_C
out_state_t *s;


! CONST char * format;

! CONST char *msg;
va_dcl
#endif
{

--- 1110,1125 ----
int state_printf (
#if ANSI_C
out_state_t *s,


! const char * format,

! const char *msg, ...
#else
s, format, msg, va_alist
#endif
)
#if !ANSI_C
out_state_t *s;


! const char * format;

! const char *msg;
va_dcl
#endif
{
***************

*** 1329,1335 ****


int state_puts (string, state)
! CONST char *string;
out_state_t *state;
{
return state_put(string,strlen(string),state);
--- 1345,1351 ----


int state_puts (string, state)
! const char *string;
out_state_t *state;
{
return state_put(string,strlen(string),state);
Index: elmME+.2.5.alpha5-cvs/lib/streamsched.c
*** elmME+.2.5.alpha4/lib/streamsched.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/streamsched.c 2005-07-23 22:01:36.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.33.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: streamsched.c,v 1.33.8.3 2005/07/23 19:01:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 61,72 ****
err = errno;
DPRINT(Debug,8,(&Debug,
"ss_ReadFromSocket: read error %s (errno %d)\n",
! error_description(err),err));
}

if (n < 0 && err != EINTR && err != EAGAIN && err != EWOULDBLOCK) {
ss->error_state = strmcpy(ss->error_state,
! error_description(err));
}

if (n > 0 && ss->stack_len > 1 && transaction_file) {
--- 61,72 ----
err = errno;
DPRINT(Debug,8,(&Debug,
"ss_ReadFromSocket: read error %s (errno %d)\n",
! strerror(err),err));
}

if (n < 0 && err != EINTR && err != EAGAIN && err != EWOULDBLOCK) {
ss->error_state = strmcpy(ss->error_state,
! strerror(err));
}

if (n > 0 && ss->stack_len > 1 && transaction_file) {
***************
*** 124,135 ****
err = errno;
DPRINT(Debug,8,(&Debug,
"ss_WriteToSocket: read error %s (errno %d)\n",
! error_description(err),err));
}

if (n < 0 && err != EINTR && err != EAGAIN && err != EWOULDBLOCK) {
ss->error_state = strmcpy(ss->error_state,
! error_description(err));
}

if (n > 0 && ss->stack_len > 1 && transaction_file) {
--- 124,135 ----
err = errno;
DPRINT(Debug,8,(&Debug,
"ss_WriteToSocket: read error %s (errno %d)\n",
! strerror(err),err));
}

if (n < 0 && err != EINTR && err != EAGAIN && err != EWOULDBLOCK) {
ss->error_state = strmcpy(ss->error_state,
! strerror(err));
}

if (n > 0 && ss->stack_len > 1 && transaction_file) {
Index: elmME+.2.5.alpha5-cvs/lib/strfcpy.c
*** elmME+.2.5.alpha4/lib/strfcpy.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/strfcpy.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strfcpy.c,v 1.9.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strfcpy.c,v 1.9.8.2 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 28,38 ****

char *strfcpy(dest, src, len)
char *dest;
! CONST char *src;
int len;
{
int size = len;


! CONST char *src0 = src;

char *dest0 = dest;

--- 28,38 ----

char *strfcpy(dest, src, len)
char *dest;
! const char *src;
int len;
{
int size = len;


! const char *src0 = src;

char *dest0 = dest;

***************
*** 51,61 ****

char *strfcat(dest, src, len)
char *dest;
! CONST char *src;
int len;
{
int size = len;


! CONST char *src0 = src;

char *dest0 = dest;

while ('\0' != *dest && --len > 0)
--- 51,61 ----

char *strfcat(dest, src, len)
char *dest;
! const char *src;
int len;
{
int size = len;


! const char *src0 = src;

char *dest0 = dest;

while ('\0' != *dest && --len > 0)
***************
*** 75,85 ****

char *strnfcpy(dest, src, len, size, produced)
char *dest;
! CONST char *src;
int len,size, *produced;
{
int size0 = size;


! CONST char *src0 = src;

char *dest0 = dest;

--- 75,85 ----

char *strnfcpy(dest, src, len, size, produced)
char *dest;
! const char *src;
int len,size, *produced;
{
int size0 = size;


! const char *src0 = src;

char *dest0 = dest;

Index: elmME+.2.5.alpha5-cvs/lib/strftime.c
*** elmME+.2.5.alpha4/lib/strftime.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/strftime.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strftime.c,v 1.7.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strftime.c,v 1.7.8.2 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 57,63 ****
#ifndef BSD_TYPE
extern void tzset P_((void));
#endif
! static int weeknumber P_((CONST struct tm *timeptr, int firstweekday));

/* defaults: season to taste */
#define SYSV_EXT 1 /* stuff in System V ascftime routine */
--- 57,63 ----
#ifndef BSD_TYPE
extern void tzset P_((void));
#endif
! static int weeknumber P_((const struct tm *timeptr, int firstweekday));

/* defaults: season to taste */
#define SYSV_EXT 1 /* stuff in System V ascftime routine */
***************
*** 83,89 ****

#undef strchr /* avoid AIX weirdness */

! adddecl(static int iso8601wknum P_((CONST struct tm *timeptr));)

#ifdef __GNUC__
#define inline __inline__
--- 83,89 ----

#undef strchr /* avoid AIX weirdness */

! adddecl(static int iso8601wknum P_((const struct tm *timeptr));)

#ifdef __GNUC__
#define inline __inline__
***************
*** 133,143 ****
strftime(s, maxsize, format, timeptr)
char *s;
size_t maxsize;
! CONST char *format;
! CONST struct tm *timeptr;
#else
size_t
! strftime(char *s, size_t maxsize, CONST char *format, CONST struct tm *timeptr)
#endif
{
char *endp = s + maxsize;
--- 133,143 ----
strftime(s, maxsize, format, timeptr)
char *s;
size_t maxsize;
! const char *format;
! const struct tm *timeptr;
#else
size_t
! strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
#endif
{
char *endp = s + maxsize;
***************
*** 157,180 ****
#endif /* TZNAME_USE_TIMEZONE */

/* various tables, useful in North America */
! static CONST char *days_a[] = {


"Sun", "Mon", "Tue", "Wed",
"Thu", "Fri", "Sat",
};

! static CONST char *days_l[] = {
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday",
};
! static CONST char *months_a[] = {


"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
};

! static CONST char *months_l[] = {
"January", "February", "March", "April",
"May", "June", "July", "August", "September",
"October", "November", "December",
};
! static CONST char *ampm[] = { "AM", "PM", };

if (s == NULL || format == NULL || timeptr == NULL || maxsize == 0)


return 0;
--- 157,180 ----

#endif /* TZNAME_USE_TIMEZONE */

/* various tables, useful in North America */
! static const char *days_a[] = {


"Sun", "Mon", "Tue", "Wed",
"Thu", "Fri", "Sat",
};

! static const char *days_l[] = {
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday",
};
! static const char *months_a[] = {


"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
};

! static const char *months_l[] = {
"January", "February", "March", "April",
"May", "June", "July", "August", "September",
"October", "November", "December",
};
! static const char *ampm[] = { "AM", "PM", };

if (s == NULL || format == NULL || timeptr == NULL || maxsize == 0)
return 0;
***************
*** 542,551 ****
#if !ANSI_C
static int
iso8601wknum(timeptr)
! CONST struct tm *timeptr;
#else
static int
! iso8601wknum(CONST struct tm *timeptr)
#endif
{
/*
--- 542,551 ----
#if !ANSI_C
static int
iso8601wknum(timeptr)
! const struct tm *timeptr;
#else
static int
! iso8601wknum(const struct tm *timeptr)
#endif
{
/*
***************
*** 637,647 ****
#if !ANSI_C
static int
weeknumber(timeptr, firstweekday)
! CONST struct tm *timeptr;
int firstweekday;
#else
static int
! weeknumber(CONST struct tm *timeptr, int firstweekday)
#endif
{
int wday = timeptr->tm_wday;
--- 637,647 ----
#if !ANSI_C
static int
weeknumber(timeptr, firstweekday)
! const struct tm *timeptr;
int firstweekday;
#else
static int
! weeknumber(const struct tm *timeptr, int firstweekday)
#endif
{
int wday = timeptr->tm_wday;
Index: elmME+.2.5.alpha5-cvs/lib/strincmp.c
*** elmME+.2.5.alpha4/lib/strincmp.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/strincmp.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strincmp.c,v 1.8.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strincmp.c,v 1.8.8.2 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 22,28 ****
*/

int strincmp(s1,s2,n)
! CONST char *s1, *s2;
int n;
{
/* case insensitive comparison */
--- 22,28 ----
*/

int strincmp(s1,s2,n)
! const char *s1, *s2;
int n;
{
/* case insensitive comparison */
Index: elmME+.2.5.alpha5-cvs/lib/stringbuffer.c
*** elmME+.2.5.alpha4/lib/stringbuffer.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/stringbuffer.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: stringbuffer.c,v 1.9.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: stringbuffer.c,v 1.9.8.3 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 87,93 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeCantCreaTempFIleUsingMemory,
"Sorry, can't create temp file (error: %s) using memory"),
! error_description(err));
ret = malloc_buffer(&sb_in_mem);
if (!ret)
panic("STRINGBUFFER PANIC",__FILE__,__LINE__,"create_membuffer",
--- 87,93 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeCantCreaTempFIleUsingMemory,
"Sorry, can't create temp file (error: %s) using memory"),
! strerror(err));
ret = malloc_buffer(&sb_in_mem);
if (!ret)
panic("STRINGBUFFER PANIC",__FILE__,__LINE__,"create_membuffer",
***************
*** 125,131 ****

void add_line_to_stringbuffer(buffer,string)


struct stringbuffer *buffer;
! CONST struct string *string;
{

if (!valid_magic(buffer->buffer_type))
panic("STRINGBUFFER PANIC",__FILE__,__LINE__,
--- 125,131 ----

void add_line_to_stringbuffer(buffer,string)


struct stringbuffer *buffer;
! const struct string *string;
{

if (!valid_magic(buffer->buffer_type))
panic("STRINGBUFFER PANIC",__FILE__,__LINE__,
***************
*** 147,153 ****
}

int linecount_stringbuffer(ptr)


! CONST struct stringbuffer *ptr;
{

int ret;
if (!valid_magic(ptr->buffer_type))
--- 147,153 ----
}

int linecount_stringbuffer(ptr)


! const struct stringbuffer *ptr;
{

int ret;
if (!valid_magic(ptr->buffer_type))
***************
*** 164,170 ****
}

struct string *get_line_from_stringbuffer(buffer,ptr)


! CONST struct stringbuffer *buffer;
int ptr;
{

struct string *ret;
--- 164,170 ----
}

struct string *get_line_from_stringbuffer(buffer,ptr)


! const struct stringbuffer *buffer;
int ptr;
{

struct string *ret;
Index: elmME+.2.5.alpha5-cvs/lib/string.c
*** elmME+.2.5.alpha4/lib/string.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/string.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: string.c,v 1.38.8.2 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: string.c,v 1.38.8.4 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 27,37 ****
{
return (char *)str;
}
! static CONST char *cus2s P_((const unsigned char *str));
! static CONST char *cus2s(str)
! CONST unsigned char *str;
{
! return (CONST char *)str;
}


--- 27,37 ----
{
return (char *)str;
}
! static const char *cus2s P_((const unsigned char *str));
! static const char *cus2s(str)
! const unsigned char *str;
{
! return (const char *)str;
}


***************
*** 134,139 ****


--- 134,140 ----
res->p->len = 0;
res->p->state = NULL;
res->p->private_flag = 0; /* Mostly not used */
+ res->p->lang = NULL;

res->string_type->charset_type->cs_init_it(res);
return res;
***************

*** 160,172 ****
return res;


}

struct string * new_string2 P_((charset_t set,

! CONST unsigned char *data));
struct string * new_string2(set,data)
charset_t set;

! CONST unsigned char *data;
{

struct string * res;



DPRINT(Debug,60,(&Debug,
"new_string2: set=%p '%s'\n",

--- 161,196 ----


return res;
}

+ struct string * new_langstring(set,lang)
+ charset_t set;
+ char *lang;
+ {
+ struct string *res;
+
+ DPRINT(Debug,60,(&Debug,"new_langstring(set=%p '%s', lang=%s)\n",
+ set,
+ set->MIME_name ? set->MIME_name : "<none>",
+ lang));
+
+ res = malloc_string(set);
+ res->p->lang = safe_strdup(lang);
+
+ DPRINT(Debug,60,(&Debug,"new_langstring=%p (type=%p '%s')\n",
+ res,
+ res->string_type->charset_type,
+ res->string_type->charset_type->type_name));

+
+ return res;
+ }
+

struct string * new_string2 P_((charset_t set,

! const unsigned char *data));

struct string * new_string2(set,data)
charset_t set;

! const unsigned char *data;

{
struct string * res;
+ int ERRORS = 0;

DPRINT(Debug,60,(&Debug,

"new_string2: set=%p '%s'\n",
***************

***************
*** 226,231 ****
--- 260,289 ----
*str = NULL;
}

+ const char * get_string_lang(str)


+ const struct string *str;
+ {

+ if (!charset_valid_magic(str->string_type))
+ panic("STRING PANIC",__FILE__,__LINE__,"get_string_lang",
+ "Bad magic number (string type)",0);
+

+ if (str->p->magic != CS_str_magic)
+ panic("STRING PANIC",__FILE__,__LINE__,"get_string_lang",
+ "Bad magic number (str_private_data)",0);
+
+ return str->p->lang;
+ }

+
+ const char * get_string_MIME_name(str)


+ const struct string *str;
+ {

+ if (!charset_valid_magic(str->string_type))
+ panic("STRING PANIC",__FILE__,__LINE__,"get_string_MIME_name",
+ "Bad magic number (string type)",0);
+
+ return str->string_type->MIME_name;
+ }
+
int add_streambyte_to_string(str,ch)
struct string *str;
int ch;
***************
*** 272,284 ****
return r;
}

! int add_streambytes_to_string(str,count,data)

struct string *str;
int count;
! CONST unsigned char *data;
{

int r;

if (!charset_valid_magic(str->string_type))
panic("STRING PANIC",__FILE__,__LINE__,"add_streambytes_to_string",
"Bad magic number (string type)",0);
--- 330,345 ----
return r;
}

! int add_streambytes_to_string(str,count,data, errors)


struct string *str;
int count;
! const unsigned char *data;
! int *errors;
{

int r;

+ int ERRORS = 0;
+
if (!charset_valid_magic(str->string_type))
panic("STRING PANIC",__FILE__,__LINE__,"add_streambytes_to_string",
"Bad magic number (string type)",0);
***************

*** 307,340 ****
count,data));
}


! r = str->string_type->charset_type->cs_add_streambytes_to_it(str,
! count,data);

! DPRINT(Debug,60,(&Debug,"add_streambytes_to_string=%d\n",r));

return r;
}

! static CONST unsigned char * csUs P_((const char *str));
! static CONST unsigned char * csUs(str)
! CONST char *str;
{
! return (CONST unsigned char *)str;
}

! static CONST char * cUss P_((const unsigned char *str));
! static CONST char * cUss(str)
! CONST unsigned char *str;
{
! return (CONST char *)str;
}

static void add_name_to_string P_((struct string *str,
! CONST unsigned char *ascii));

static void add_name_to_string(str,ascii)
struct string *str;
! CONST unsigned char *ascii;
{
int l = strlen(cUss(ascii));
int i;
--- 368,404 ----
count,data));
}


! r = str->string_type->charset_type->cs_add_streambytes_to_it(str, count,data, &ERRORS);
!
! if (errors)
! *errors = ERRORS;

! DPRINT(Debug,60,(&Debug,"add_streambytes_to_string=%d ERRORS=%d\n",
! r,ERRORS));

return r;
}

! static const unsigned char * csUs P_((const char *str));
! static const unsigned char * csUs(str)
! const char *str;
{
! return (const unsigned char *)str;
}

! static const char * cUss P_((const unsigned char *str));
! static const char * cUss(str)
! const unsigned char *str;
{
! return (const char *)str;
}

static void add_name_to_string P_((struct string *str,
! const unsigned char *ascii));

static void add_name_to_string(str,ascii)
struct string *str;
! const unsigned char *ascii;
{
int l = strlen(cUss(ascii));
int i;
***************
*** 356,362 ****
void add_unicode_to_string(str,len,vector)


struct string *str;
int len;

! CONST uint16 *vector;
{
if (!charset_valid_magic(str->string_type))
panic("STRING PANIC",__FILE__,__LINE__,"add_unicode_to_string",
--- 420,426 ----
void add_unicode_to_string(str,len,vector)


struct string *str;
int len;

! const uint16 *vector;
{
if (!charset_valid_magic(str->string_type))
panic("STRING PANIC",__FILE__,__LINE__,"add_unicode_to_string",
***************
*** 385,392 ****
}

struct string * cat_strings(str1,str2,printind)


! CONST struct string *str1;
! CONST struct string *str2;

int printind;
{


struct string *ret = NULL;

--- 449,456 ----
}

struct string * cat_strings(str1,str2,printind)


! const struct string *str1;
! const struct string *str2;

int printind;
{


struct string *ret = NULL;

***************
*** 457,462 ****


--- 535,545 ----
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str1);
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str2);

+ if (str1->p->lang && str2->p->lang &&
+ 0 == strcmp(str1->p->lang, str2->p->lang)) {
+ ret->p->lang = safe_strdup(str1->p->lang);
+ }
+
} else if (str1 -> string_type -> charset_type ==
str2 -> string_type -> charset_type &&
charset_superset_of(str2 -> string_type,str1 -> string_type)) {
***************
*** 466,471 ****
--- 549,559 ----

ret->string_type->charset_type->cs_add_intdata_to_it(ret,str1);
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str2);

+

+ if (str1->p->lang && str2->p->lang &&
+ 0 == strcmp(str1->p->lang, str2->p->lang)) {
+ ret->p->lang = safe_strdup(str1->p->lang);
+ }

} else if (printind &&
0 != (charset_properties(str1 -> string_type) & CS_mapping) &&

***************
*** 491,496 ****


--- 579,588 ----
add_name_to_string(ret,csUs(str2 -> string_type -> MIME_name));
add_name_to_string(ret,csUs("?]"));
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str2);
+
+ } else if (0 == str1->p->len && 0 == str2->p->len) {
+ /* Avoid mallocing null vector */
+ ret = malloc_string(display_charset);
} else {
/* 4) Unrelated CHARSETs -- so we try use display charset instead */
int i;
***************
*** 526,531 ****
--- 618,629 ----

ret->string_type->charset_type->cs_add_unicodedata_to_it(ret,l,vector);
free(vector);

+

+ if (str1->p->lang && str2->p->lang &&
+ 0 == strcmp(str1->p->lang, str2->p->lang)) {
+ ret->p->lang = safe_strdup(str1->p->lang);
+ }
+
}

DPRINT(Debug,60,(&Debug,

***************
*** 541,547 ****
}

int string_len(str)


! CONST struct string *str;
{

if (!charset_valid_magic(str->string_type))
panic("STRING PANIC",__FILE__,__LINE__,"string_len",
--- 639,645 ----
}

int string_len(str)


! const struct string *str;
{

if (!charset_valid_magic(str->string_type))
panic("STRING PANIC",__FILE__,__LINE__,"string_len",


***************
*** 564,571 ****
}

int string_cmp(str1,str2,unknown_val)

! struct string *str1;
! struct string *str2;

int unknown_val;
{
int ret = 0;
--- 662,669 ----
}

int string_cmp(str1,str2,unknown_val)


! const struct string *str1;
! const struct string *str2;

int unknown_val;


{
int ret = 0;
***************

*** 660,666 ****
}

struct string * dup_string(str)


! CONST struct string *str;
{

struct string *ret;

--- 758,764 ----
}

struct string * dup_string(str)


! const struct string *str;
{

struct string *ret;



***************
*** 678,683 ****
--- 776,786 ----
ret = malloc_string(str -> string_type);
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str);

+ if (str->p->lang) {
+ ret->p->lang = safe_strdup(str->p->lang);
+ }
+
+
DPRINT(Debug,60,(&Debug,"dup_string=%p ('%s'; type=%p '%s')\n",
ret,
ret->string_type->MIME_name ?
***************

*** 690,696 ****

struct string * convert_string(set,str,printind)
charset_t set;


! CONST struct string *str;

int printind;
{
struct string *ret = malloc_string(set);
--- 793,799 ----

struct string * convert_string(set,str,printind)
charset_t set;


! const struct string *str;

int printind;
{
struct string *ret = malloc_string(set);


***************
*** 725,730 ****
--- 828,839 ----
} else if (set == str->string_type) {
/* 1) Same charset */
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str);

+

+ if (str->p->lang) {
+ ret->p->lang = safe_strdup(str->p->lang);
+ }
+
+
} else if (printind &&
0 != (charset_properties(set) & CS_mapping) &&
0 == (charset_properties(str -> string_type) & CS_mapping) &&
***************
*** 751,756 ****
--- 860,870 ----

ret->string_type->charset_type->cs_add_unicodedata_to_it(ret,l,vector);
free(vector);

+

+ if (str->p->lang) {
+ ret->p->lang = safe_strdup(str->p->lang);
+ }
+
}

DPRINT(Debug,60,(&Debug,
***************

*** 766,772 ****
}

unsigned char *stream_from_string(str, printable,terminal)


! CONST struct string *str;
int printable;
screen_info_p terminal;

{
--- 880,886 ----
}

unsigned char *stream_from_string(str, printable,terminal)


! const struct string *str;
int printable;
screen_info_p terminal;

{
***************
*** 838,844 ****

/* result is malloced */
void bytestream_from_string(str,res,reslen)


! CONST struct string *str;

char **res;
int *reslen;
{
--- 952,958 ----

/* result is malloced */
void bytestream_from_string(str,res,reslen)


! const struct string *str;

char **res;
int *reslen;
{
***************
*** 870,876 ****


unsigned char *streamclip_from_string(str,pos,len,terminal,printable_len)


! CONST struct string *str;
int *pos;
int len;
screen_info_p terminal;

--- 984,990 ----


unsigned char *streamclip_from_string(str,pos,len,terminal,printable_len)


! const struct string *str;
int *pos;
int len;
screen_info_p terminal;
***************

*** 964,970 ****
}

int estimate_clip_string(str,pos,len,terminal,printable_len)


! CONST struct string *str;
int pos;
int len; /* UPPER LIMIT */
screen_info_p terminal;

--- 1078,1084 ----
}

int estimate_clip_string(str,pos,len,terminal,printable_len)


! const struct string *str;
int pos;
int len; /* UPPER LIMIT */
screen_info_p terminal;
***************

*** 1014,1020 ****
}

struct string *clip_from_string(str,pos,len)


! CONST struct string *str;
int *pos;
int len;
{

--- 1128,1134 ----
}

struct string *clip_from_string(str,pos,len)


! const struct string *str;
int *pos;
int len;
{
***************

*** 1052,1058 ****
}

struct string *ascify_string(str)


! CONST struct string *str;
{

int can_ascii;


charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);

--- 1166,1172 ----
}

struct string *ascify_string(str)


! const struct string *str;
{

int can_ascii;


charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);

***************
*** 1107,1112 ****
--- 1221,1230 ----
ret->string_type->charset_type->cs_add_intdata_to_it(ret,str);
}

+ if (str->p->lang) {
+ ret->p->lang = safe_strdup(str->p->lang);
+ }
+
DPRINT(Debug,60,(&Debug,
"ascify_string=%p ('%s'; type=%p '%s'): len=%d\n",
ret,

***************
*** 1120,1126 ****
}

int can_ascii_string(str)


! CONST struct string *str;
{

int ret;

--- 1238,1244 ----
}

int can_ascii_string(str)


! const struct string *str;
{

int ret;

***************
*** 1148,1154 ****

void add_ascii_to_string(str,ascii)
struct string *str;
! CONST unsigned char *ascii;
{

if (!charset_valid_magic(str->string_type))
--- 1266,1272 ----

void add_ascii_to_string(str,ascii)
struct string *str;
! const unsigned char *ascii;
{

if (!charset_valid_magic(str->string_type))
***************
*** 1228,1235 ****
}

struct string *skip_ascii_head_from_string(str,ascii,ignore_case)


! CONST struct string *str;

! CONST unsigned char *ascii;
int ignore_case;
{
struct string *ret = malloc_string(str->string_type);
--- 1346,1353 ----
}

struct string *skip_ascii_head_from_string(str,ascii,ignore_case)


! const struct string *str;

! const unsigned char *ascii;
int ignore_case;
{
struct string *ret = malloc_string(str->string_type);
***************
*** 1260,1266 ****

while(1) {
int i;
! CONST unsigned char * p = ascii;

DPRINT(Debug,61,(&Debug,
"skip_ascii_head_from_string -- starting pos %d\n",
--- 1378,1384 ----

while(1) {
int i;
! const unsigned char * p = ascii;

DPRINT(Debug,61,(&Debug,
"skip_ascii_head_from_string -- starting pos %d\n",
***************
*** 1339,1349 ****
*/

int get_word_from_string(str,word,pos,flags,ascii_delim, found_delim)


! CONST struct string *str;

struct string **word;
int *pos;
int flags;
! CONST unsigned char *ascii_delim;
uint16 *found_delim;
{
int lowercase = flags & GWF_lowercase;
--- 1457,1467 ----
*/

int get_word_from_string(str,word,pos,flags,ascii_delim, found_delim)


! const struct string *str;

struct string **word;
int *pos;
int flags;
! const unsigned char *ascii_delim;
uint16 *found_delim;
{
int lowercase = flags & GWF_lowercase;
***************
*** 1395,1401 ****
cs_give_unicode_from_it(str,X,&found);

/* ascii string is unsigned ... */
! CONST unsigned char *y = NULL;

if (!found) {
DPRINT(Debug,61,(&Debug,
--- 1513,1519 ----
cs_give_unicode_from_it(str,X,&found);

/* ascii string is unsigned ... */
! const unsigned char *y = NULL;

if (!found) {
DPRINT(Debug,61,(&Debug,
***************
*** 1440,1446 ****

int sp;
/* ascii string is unsigned ... */
! CONST unsigned char *y = NULL;

if (!found) {
DPRINT(Debug,61,(&Debug,
--- 1558,1564 ----

int sp;
/* ascii string is unsigned ... */
! const unsigned char *y = NULL;

if (!found) {
DPRINT(Debug,61,(&Debug,
***************
*** 1500,1506 ****


int locate_unicode_from_string(str,unicode)


! CONST struct string *str;

int unicode;
{
/* NOTE: We can not trim string !!! */
--- 1618,1624 ----


int locate_unicode_from_string(str,unicode)


! const struct string *str;

int unicode;
{
/* NOTE: We can not trim string !!! */
***************
*** 1543,1550 ****
}

int find_pattern_from_string(str,pattern,ignore_case)


! CONST struct string *str;
! CONST struct string *pattern;
int ignore_case;
{

int ret = -1;
--- 1661,1668 ----
}

int find_pattern_from_string(str,pattern,ignore_case)


! const struct string *str;
! const struct string *pattern;
int ignore_case;
{

int ret = -1;
***************
*** 1646,1652 ****
}

for (i = 0; i < l1; ) {


! CONST int s = i + 1;

for (j = 0; j < l2 && i < l1; j++,i++) {
if (vector1[i] != vector2[j])
break;
--- 1764,1770 ----
}

for (i = 0; i < l1; ) {


! const int s = i + 1;

for (j = 0; j < l2 && i < l1; j++,i++) {
if (vector1[i] != vector2[j])
break;
***************
*** 1685,1693 ****
const struct string * pat, int pat_X));

static int string_match_part(name,name_X,pat,pat_X)
! CONST struct string * name;
int name_X;
! CONST struct string * pat;
int pat_X;
{
int r = 1;
--- 1803,1811 ----
const struct string * pat, int pat_X));

static int string_match_part(name,name_X,pat,pat_X)
! const struct string * name;
int name_X;
! const struct string * pat;
int pat_X;
{
int r = 1;
***************
*** 1774,1781 ****

/* return 1 on succeed and 0 on failure */
int string_match(name,pat)
! CONST struct string * name;
! CONST struct string * pat;
{
int r = 0;

--- 1892,1899 ----

/* return 1 on succeed and 0 on failure */
int string_match(name,pat)
! const struct string * name;
! const struct string * pat;


{
int r = 0;

***************

*** 1822,1828 ****


uint16 give_unicode_from_string(str,pos)


! CONST struct string *str;
int pos;
{

int found;
--- 1940,1946 ----


uint16 give_unicode_from_string(str,pos)


! const struct string *str;
int pos;
{

int found;
***************
*** 1857,1863 ****
}

void remove_control(str)


! CONST struct string *str;
{

if (!charset_valid_magic(str->string_type))
--- 1975,1981 ----
}

void remove_control(str)


! const struct string *str;
{

if (!charset_valid_magic(str->string_type))
***************
*** 1955,1961 ****

/* bad_pos is -1 if string is OK */
long string_to_long(str,bad_pos)


! CONST struct string *str;

int *bad_pos;
{
long val = 0L;
--- 2073,2079 ----

/* bad_pos is -1 if string is OK */
long string_to_long(str,bad_pos)


! const struct string *str;

int *bad_pos;
{
long val = 0L;
***************
*** 2041,2048 ****

/* Return 1 is matches, otherwise 0 */
int string_matches_ascii(str,ascii)


! CONST struct string *str;

! CONST unsigned char *ascii;
{
int i;

--- 2159,2166 ----

/* Return 1 is matches, otherwise 0 */
int string_matches_ascii(str,ascii)


! const struct string *str;

! const unsigned char *ascii;
{
int i;

Index: elmME+.2.5.alpha5-cvs/lib/stringtok.c
*** elmME+.2.5.alpha4/lib/stringtok.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/stringtok.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: stringtok.c,v 1.4.8.1 2004/04/18 16:55:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: stringtok.c,v 1.4.8.3 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

+ }
+ }
+
+

+ if (flags & TOK_mime) {
+ switch (x) {
+ case 0x003D /* = */ :
+ case 0x002F /* / */ :
+
+ return x;

+ }
+ }
+
return 0;
}

***************
*** 72,84 ****


#define NUM_pair ( sizeof pairs / sizeof (pairs[0]))


! struct string_token * string_tokenize(line)

! CONST struct string *line;


{
struct string_token * result = NULL;
int result_len = 0;

! CONST int linelen = string_len(line);

int i;

--- 91,104 ----


#define NUM_pair ( sizeof pairs / sizeof (pairs[0]))


! struct string_token * string_tokenize(line,flags)

! const struct string *line;
! int flags;


{
struct string_token * result = NULL;
int result_len = 0;

! const int linelen = string_len(line);

int i;

***************
*** 88,94 ****

for (i = 0; i < linelen; ) {

! CONST uint16 code = give_unicode_from_string(line,i);

struct pairs * mode = NULL;
struct string * token = NULL;
--- 108,114 ----

for (i = 0; i < linelen; ) {

! const uint16 code = give_unicode_from_string(line,i);

struct pairs * mode = NULL;
struct string * token = NULL;
***************
*** 109,115 ****
special = mode->start;

for (i++; i < linelen; i++) {
! CONST uint16 code = give_unicode_from_string(line,i);

if (unicode_backlash == code)
i++; /* skip next */
--- 129,135 ----
special = mode->start;

for (i++; i < linelen; i++) {
! const uint16 code = give_unicode_from_string(line,i);

if (unicode_backlash == code)
i++; /* skip next */
***************
*** 135,141 ****
special = 0x0020 /* SPACE */;

for (i++; i < linelen; i++) {
! CONST uint16 code = give_unicode_from_string(line,i);

if (!is_space(code))
break;
--- 155,161 ----
special = 0x0020 /* SPACE */;

for (i++; i < linelen; i++) {
! const uint16 code = give_unicode_from_string(line,i);

if (!is_space(code))
break;
***************
*** 147,163 ****


goto add_token;
}

! special = is_special(code);
if (!special) {
int start = i;
int len;

for (i++; i < linelen; i++) {
! CONST uint16 code = give_unicode_from_string(line,i);



if (is_space(code))
break;
! if (is_special(code))
break;
}
len = i - start;

--- 167,183 ----
goto add_token;
}


! special = is_special(code,flags);
if (!special) {
int start = i;
int len;

for (i++; i < linelen; i++) {
! const uint16 code = give_unicode_from_string(line,i);



if (is_space(code))
break;
! if (is_special(code,flags))
break;
}
len = i - start;

Index: elmME+.2.5.alpha5-cvs/lib/striparens.c
*** elmME+.2.5.alpha4/lib/striparens.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/striparens.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: striparens.c,v 1.6.8.1 2004/04/18 16:55:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.1 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: striparens.c,v 1.6.8.2 2005/07/26 08:28:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.2 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 29,39 ****
static char paren_buffer[VERY_LONG_STRING];

char *strip_parens(src)
! CONST char *src;
{
int len;
char *dest = paren_buffer;


! CONST char *src0 = src;

while (*src != '\0') {
len = rfc822_toklen(src);
--- 29,39 ----
static char paren_buffer[VERY_LONG_STRING];

char *strip_parens(src)
! const char *src;
{
int len;
char *dest = paren_buffer;


! const char *src0 = src;

while (*src != '\0') {
len = rfc822_toklen(src);
***************
*** 57,67 ****
}

char *get_parens(src)
! CONST char *src;
{
int len;
char *dest = paren_buffer;


! CONST char *src0 = src;

while (*src != '\0') {
len = rfc822_toklen(src);
--- 57,67 ----
}

char *get_parens(src)
! const char *src;
{
int len;
char *dest = paren_buffer;


! const char *src0 = src;

while (*src != '\0') {
len = rfc822_toklen(src);
Index: elmME+.2.5.alpha5-cvs/lib/strmcpy.c
*** elmME+.2.5.alpha4/lib/strmcpy.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/strmcpy.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strmcpy.c,v 1.5.8.1 2004/04/18 16:55:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strmcpy.c,v 1.5.8.2 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 13,19 ****

char * strmcpy (dest, src)
char *dest;
! CONST char *src;
{
int len = strlen (src) + 1;

--- 13,19 ----

char * strmcpy (dest, src)
char *dest;
! const char *src;
{
int len = strlen (src) + 1;

***************
*** 28,34 ****

char * strmcat (dest, src)
char *dest;
! CONST char *src;
{
int len;

--- 28,34 ----

char * strmcat (dest, src)
char *dest;
! const char *src;
{
int len;

Index: elmME+.2.5.alpha5-cvs/lib/strtokq.c
*** elmME+.2.5.alpha4/lib/strtokq.c 2004-05-16 17:43:45.000000000 +0300


--- /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300
***************

*** 1,83 ****
- static char rcsid[] = "@(#)$Id: strtokq.c,v 1.5.8.1 2004/04/18 16:55:42 hurtta Exp $";


-
- /******************************************************************************
- * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $
- *
- * Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
- * (was hurtt...@ozone.FMI.FI)
- ******************************************************************************
- * The Elm Mail System
- *
- * Copyright (c) 1988-1992 USENET Community Trust

- * Copyright (c) 1986,1987 Dave Taylor
- *****************************************************************************/
-
-
- /* Like strtok, but returns quoted strings as one token (quotes removed)
- * if flag is non-null. Quotes and backslahes can be escaped with backslash.
- */

-
- #include "elm_defs.h"
-

- }
-
- /*
- * Local Variables:
- * mode:c
- * c-basic-offset:4
- * buffer-file-coding-system: iso-8859-1
- * End:
- */

-
--- 0 ----
Index: elmME+.2.5.alpha5-cvs/lib/syscall.c
*** elmME+.2.5.alpha4/lib/syscall.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/syscall.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.12.8.2 2004/07/19 09:20:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.12.8.5 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 52,62 ****
DPRINT(Debug,5,(&Debug, "No run_tty_init_hook ...\n"));
}

! static int no_SR_ClearScreen P_((void));
! static int no_SR_ClearScreen()
{
DPRINT(Debug,5,(&Debug, "No ClearScreen_hook ...\n"));
- return 0;
}

static char *us2s P_((unsigned char *str));

--- 52,61 ----
DPRINT(Debug,5,(&Debug, "No run_tty_init_hook ...\n"));
}

! static void no_SR_ClearScreen P_((void));
! static void no_SR_ClearScreen()
{
DPRINT(Debug,5,(&Debug, "No ClearScreen_hook ...\n"));
}

static char *us2s P_((unsigned char *str));

***************
*** 185,194 ****
/* Optionally override the SHELL environment variable. */
if (options&SY_ENV_SHELL) {
static char sheq[] = "SHELL=";
! char * sh = ((options & SY_USER_SHELL) ? shell : "/bin/sh");
! int size = sizeof(sheq) + strlen(sh);

! char *p = malloc(size);
if (p) {
elm_sfprintf(p, size,
FRM("%s%s"), sheq, sh);
--- 184,202 ----
/* Optionally override the SHELL environment variable. */
if (options&SY_ENV_SHELL) {
static char sheq[] = "SHELL=";
! char * sh = "/bin/sh";

! int size;
! char *p;
!

! if (0 != (options & SY_USER_SHELL)) {
! char * s = give_dt_estr_as_str(&shell_e,"shell");
! if (s)
! sh = s;
! }

! size = sizeof(sheq) + strlen(sh);
!
! p = malloc(size);
if (p) {
elm_sfprintf(p, size,
FRM("%s%s"), sheq, sh);
***************
*** 202,207 ****
--- 210,217 ----

#ifdef BACKGROUD_PROCESSES /* We assume POSIX in here */

+ volatile int handle_sigchld = 0; /* got SIGCHLD */
+

static struct process_list {
union any_fd fd;
char * message;
***************
*** 216,221 ****
--- 226,232 ----
{
SIGDPRINT(Debug,2,(&Debug,
"got_sigchld: Setting handle_sigchld\n"));
+
handle_sigchld = 1;
}

***************

*** 281,287 ****
if (-1 == sigaction(SIGCHLD,&new_child,NULL)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSigaction,"sigaction: %s"),
! error_description(err));
exit (1);
}
}
--- 292,298 ----
if (-1 == sigaction(SIGCHLD,&new_child,NULL)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSigaction,"sigaction: %s"),
! strerror(err));
exit (1);
}
}
***************
*** 449,461 ****
return w != -1;
}

! CONST char ** join_argv(argv1,argv2)
char * argv1[];
char * argv2[];
{
int count1;
int count2;
! CONST char ** res;
int i;
for (count1 = 0; argv1[count1]; count1++);
for (count2 = 0; argv2[count2]; count2++);
--- 460,472 ----
return w != -1;
}

! const char ** join_argv(argv1,argv2)
char * argv1[];
char * argv2[];
{
int count1;
int count2;
! const char ** res;
int i;
for (count1 = 0; argv1[count1]; count1++);
for (count2 = 0; argv2[count2]; count2++);
***************
*** 492,505 ****
/* copied from curses.c */
void sr_call_Write_to_screen (
#if ANSI_C
! CONST char *format, CONST char *msg, ...


#else
format, msg, va_alist
#endif
)
#if !ANSI_C

! CONST char *format;
! CONST char *msg;
va_dcl
#endif
{

--- 503,516 ----
/* copied from curses.c */
void sr_call_Write_to_screen (
#if ANSI_C
! const char *format, const char *msg, ...
#else


format, msg, va_alist
#endif
)
#if !ANSI_C

! const char *format;
! const char *msg;
va_dcl
#endif
{
***************

*** 531,537 ****
int start_run(rs, options, argv, infd, outfd)
struct run_state *rs;
int options;
! CONST char * argv[];
int infd, outfd;
{
int count;
--- 542,548 ----
int start_run(rs, options, argv, infd, outfd)
struct run_state *rs;
int options;
! const char * argv[];
int infd, outfd;
{
int count;


***************
*** 602,610 ****
raw_exit(rs);
return 0;
}
fcntl(pfd[0], F_SETFD, 1);
fcntl(pfd[1], F_SETFD, 1);
!
rs->pid = fork();

if (rs->pid == -1) {
--- 613,627 ----
raw_exit(rs);
return 0;
}
+
+ #ifdef FD_CLOEXEC
+ fcntl(pfd[0], F_SETFD, FD_CLOEXEC);
+ fcntl(pfd[1], F_SETFD, FD_CLOEXEC);
+ #else
fcntl(pfd[0], F_SETFD, 1);
fcntl(pfd[1], F_SETFD, 1);
! #endif
!
rs->pid = fork();

if (rs->pid == -1) {

***************
*** 632,645 ****


if (-1 == setgid(groupid)) {
int err = errno;

fprintf(stderr,"start_run: setgid(%d) FAILED: %s\n",
! groupid,error_description(err));
fflush(stderr);
write(pfd[1],(void *)&err,sizeof err); _exit(127);
}
if (-1 == setuid(userid)) {
int err = errno;
fprintf(stderr,"start_run: setruid(%d) FAILED: %s\n",
! userid,error_description(err));
fflush(stderr);
write(pfd[1],(void *)&err,sizeof err); _exit(127);
}
--- 649,662 ----


if (-1 == setgid(groupid)) {
int err = errno;

fprintf(stderr,"start_run: setgid(%d) FAILED: %s\n",
! groupid,strerror(err));
fflush(stderr);
write(pfd[1],(void *)&err,sizeof err); _exit(127);
}
if (-1 == setuid(userid)) {
int err = errno;
fprintf(stderr,"start_run: setruid(%d) FAILED: %s\n",
! userid,strerror(err));
fflush(stderr);
write(pfd[1],(void *)&err,sizeof err); _exit(127);
}
Index: elmME+.2.5.alpha5-cvs/lib/terminal.c
*** elmME+.2.5.alpha4/lib/terminal.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/terminal.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: terminal.c,v 1.40.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: terminal.c,v 1.40.8.5 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.40.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 20,26 ****

enum terminal_map_keyword { terminal_bad = -1, terminal_iso2022 = 0,
terminal_private = 1, terminal_iso2022_mb = 2,
! terminal_flag = 3, terminal_iso2022_like = 4
};

enum terminal_flags { terminal_bad_flag = -1,
--- 20,27 ----

enum terminal_map_keyword { terminal_bad = -1, terminal_iso2022 = 0,
terminal_private = 1, terminal_iso2022_mb = 2,
! terminal_flag = 3, terminal_iso2022_like = 4,
! terminal_dw
};

enum terminal_flags { terminal_bad_flag = -1,
***************

*** 46,58 ****


charset_t charset;
struct setlist * iso2022_info;
} iso2022_like;

} value;
};

static enum terminal_map_keyword get_keyword P_((const char *word));

static enum terminal_map_keyword get_keyword(word)
! CONST char *word;
{
if (0 == istrcmp(word,"ISO-2022"))
return terminal_iso2022;
--- 47,60 ----


charset_t charset;
struct setlist * iso2022_info;
} iso2022_like;
+ char * dw_charset;
} value;
};

static enum terminal_map_keyword get_keyword P_((const char *word));

static enum terminal_map_keyword get_keyword(word)
! const char *word;
{
if (0 == istrcmp(word,"ISO-2022"))
return terminal_iso2022;


***************
*** 64,69 ****
--- 66,74 ----
return terminal_private;
if (0 == istrcmp(word,"FLAG"))
return terminal_flag;
+ if (0 == istrcmp(word,"DW"))
+ return terminal_dw;
+

return terminal_bad;
}
***************

*** 203,213 ****
r->X = tt_simple_var;
value = NULL;
break;
!
}

- err:
-
return r;
}

--- 208,218 ----
r->X = tt_simple_var;
value = NULL;
break;
! default:
! r = NULL;
! break;
}

return r;
}

***************
*** 347,352 ****
--- 352,360 ----
DPRINT(Debug,8,(&Debug,"eval_condition \"%s\" = \"%s\"\n",v1,v2));



break;
+
+ default:
+ break;
}

if (v1)
***************
*** 406,412 ****


struct terminal_map_item * load_terminal_map(filename,errors)


! CONST char *filename;
int *errors;
{

struct terminal_map_item *result;
--- 414,420 ----


struct terminal_map_item * load_terminal_map(filename,errors)


! const char *filename;
int *errors;
{

struct terminal_map_item *result;
***************
*** 419,425 ****

if (err) {
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s (can_open)\n",
! filename,error_description(err)));
return NULL;
}

--- 427,433 ----

if (err) {
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s (can_open)\n",


! filename,strerror(err)));
return NULL;
}

***************

*** 427,433 ****
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s\n",
! filename,error_description(err)));
return NULL;
}

--- 435,441 ----
if (!f) {
int err = errno;
DPRINT(Debug,2,(&Debug,"load_terminal_map: %s: %s\n",


! filename,strerror(err)));
return NULL;
}

***************

*** 535,540 ****
--- 543,555 ----


char * c3;
int size;
int i;
+ case terminal_dw:
+ result[result_len].keyword = kw;
+ result[result_len].value.dw_charset = safe_strdup(c2);
+ result[result_len].match = safe_strdup(c);
+ result_len++;
+ break;
+
case terminal_iso2022:
case terminal_iso2022_mb:
result[result_len].keyword = kw;
***************

*** 785,798 ****


result[result_len].match = safe_strdup(c);

result_len++;
break;
! }


}

result[result_len].match = NULL;
result[result_len].keyword = terminal_bad;

fclose(f);



DPRINT(Debug,10,(&Debug,
"load_terminal_map: %s, result_len=%d\n",
filename,result_len));

--- 800,825 ----
result[result_len].match = safe_strdup(c);
result_len++;
break;
!
! default:
! break;
! }

}

result[result_len].match = NULL;
result[result_len].keyword = terminal_bad;

+
+ if (!feof(f)) {
+ DPRINT(Debug,3,(&Debug,
+ "load_terminal_map: %s, All results not readed\n",
+ filename));
+ }
+
fclose(f);

+
+
DPRINT(Debug,10,(&Debug,
"load_terminal_map: %s, result_len=%d\n",
filename,result_len));
***************

*** 800,808 ****
return result;


}

! static int name_ok P_((CONST char *name));
static int name_ok(name)
! CONST char *name;
{
if ('\0' == *name)
return 0;

--- 827,835 ----
return result;


}

! static int name_ok P_((const char *name));
static int name_ok(name)
! const char *name;
{
if ('\0' == *name)
return 0;
***************

*** 822,827 ****
--- 849,863 ----


char *s;
int i;

+ case terminal_dw:
+ fputs(ptr->match,f);
+ fputc('\t',f);
+ fputs("DW",f);
+ fputc('\t',f);
+ fputs(ptr->value.dw_charset,f);
+ fputc('\n',f);
+ break;
+
case terminal_iso2022:
case terminal_iso2022_mb:
fputs(ptr->match,f);
***************

*** 887,892 ****
--- 923,931 ----


}
}
break;
+
+ default:
+ break;
}

fputc('\n',f);
}
***************
*** 901,907 ****
enum terminal_flags flags[]));

static enum terminal_flags find_terminal_flag(terminal,flags)
! CONST char *terminal;
enum terminal_flags flags[];
{

--- 940,946 ----
enum terminal_flags flags[]));

static enum terminal_flags find_terminal_flag(terminal,flags)
! const char *terminal;
enum terminal_flags flags[];
{



***************
*** 953,973 ****
return terminal_bad_flag;
}

!

/* Hopefully quite safe to be called from signal handler */
static struct terminal_map_item * loc_info P_((const char *terminal,
! charset_t set));

! static struct terminal_map_item * loc_info(terminal,set)

! CONST char *terminal;

charset_t set;
{
int i;

! SIGDPRINT(Debug,9,(&Debug,"** Looking terminal %s (set %s)\n",
terminal,
! set->MIME_name ? set->MIME_name : "<no MIME name>"));

for (i = 0; i < 2; i++) {
struct terminal_map_item *ptr = user_terminal_map;

--- 992,1036 ----


return terminal_bad_flag;
}

! int match_charset_name(cs1,cs2)
! charset_t cs1;
! charset_t cs2;
! {
!
! if (cs1 == cs2)

! return 1;
!
! if (!cs1 || !cs2)
! return 0;
!

! if (cs1->MIME_name && cs2->MIME_name &&
! 0 == istrcmp(cs1->MIME_name,cs2->MIME_name)) {
!
! SIGDPRINT(Debug,9,(&Debug,
! "** Matched charset by name %s (%p) == %s (%p)\n",
! cs1->MIME_name,cs1,
! cs2->MIME_name,cs2));

! return 1;
! }
! return 0;
! }


/* Hopefully quite safe to be called from signal handler */

static struct terminal_map_item * loc_info P_((const char *terminal,
! charset_t set,


! int only_switch));

! static struct terminal_map_item * loc_info(terminal,set, only_switch)

! const char *terminal;

charset_t set;
+ int only_switch;
{
int i;

! SIGDPRINT(Debug,9,(&Debug,"** Looking terminal %s (set %s)%s\n",
terminal,


! set->MIME_name ? set->MIME_name : "<no MIME name>",
! only_switch ? " charset switches only" : ""));

for (i = 0; i < 2; i++) {
struct terminal_map_item *ptr = user_terminal_map;
***************
*** 984,990 ****
0 == strncmp(ptr->match,terminal,c - ptr->match))) {

if (ptr->keyword == terminal_iso2022 &&
! ptr->value.iso2022.charset == set) {
SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 match %s\n",
ptr->match));

--- 1047,1053 ----


0 == strncmp(ptr->match,terminal,c - ptr->match))) {

if (ptr->keyword == terminal_iso2022 &&
! match_charset_name(ptr->value.iso2022.charset,set)) {
SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 match %s\n",
ptr->match));

***************
*** 992,998 ****
}

if (ptr->keyword == terminal_iso2022_mb &&
! ptr->value.iso2022.charset == set) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 MB match %s\n",
ptr->match));

--- 1055,1061 ----
}

if (ptr->keyword == terminal_iso2022_mb &&
! match_charset_name(ptr->value.iso2022.charset,set)) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022 MB match %s\n",
ptr->match));
***************
*** 1001,1007 ****
}

if (ptr->keyword == terminal_iso2022_like &&
! ptr->value.iso2022_like.charset == set) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022-LIKE match %s\n",
ptr->match));

--- 1064,1070 ----
}

if (ptr->keyword == terminal_iso2022_like &&
! match_charset_name(ptr->value.iso2022_like.charset,set)) {

SIGDPRINT(Debug,9,(&Debug,"-- Found ISO2022-LIKE match %s\n",
ptr->match));
***************
*** 1010,1016 ****
}

if (ptr->keyword == terminal_private &&
! ptr->value.private.charset == set) {
if (ptr->value.private.condition) {
if (!eval_condition(ptr->value.private.condition)) {
goto no_this;

--- 1073,1079 ----


}

if (ptr->keyword == terminal_private &&
! match_charset_name(ptr->value.private.charset, set)) {
if (ptr->value.private.condition) {
if (!eval_condition(ptr->value.private.condition)) {
goto no_this;
***************
*** 1022,1027 ****

--- 1085,1108 ----



return ptr;
}
+
+ if (ptr->keyword == terminal_dw && set->MIME_name &&
+ 0 == istrcmp(set->MIME_name,ptr->value.dw_charset)) {
+
+ if (only_switch) {
+
+ SIGDPRINT(Debug,9,(&Debug,"-- Found DW match %s (ignored)\n",
+ ptr->match));
+
+ goto no_this;
+
+ }
+ SIGDPRINT(Debug,9,(&Debug,"-- Found DW match %s\n",
+ ptr->match));
+
+ return ptr;
+ }
+
}
no_this:
ptr++;
***************

*** 1031,1050 ****
}

void terminal_can_switch(terminal,storage,n,max)
! CONST char *terminal;
charset_t *storage;
int *n;
int max;


{

int i;

/* Can not switch to other sets if can not
switch back to display_charset
*/
! if (!loc_info(terminal,display_charset))
return;

for (i = 0; i < 2; i++) {
struct terminal_map_item *ptr = user_terminal_map;

--- 1112,1134 ----
}

void terminal_can_switch(terminal,storage,n,max)
! const char *terminal;
charset_t *storage;
int *n;
int max;


{

int i;
+ struct terminal_map_item * back;

/* Can not switch to other sets if can not
switch back to display_charset
*/
! back = loc_info(terminal,display_charset,1);
! if (!back)
return;

+

for (i = 0; i < 2; i++) {
struct terminal_map_item *ptr = user_terminal_map;

***************

*** 1113,1118 ****
--- 1197,1204 ----
storage[(*n)++] = ptr->value.private.charset;


break;

+ default:
+ break;
}

for (j = 0; j < (*n) -1; j++)
***************
*** 1133,1144 ****
}

int terminal_can_switch_to(terminal,set,silent)
! CONST char *terminal;
charset_t set;


int silent;
{

! struct terminal_map_item * a = loc_info(terminal,set);

if (!a) {
if (!silent)

--- 1219,1230 ----
}

int terminal_can_switch_to(terminal,set,silent)
! const char *terminal;
charset_t set;


int silent;
{

! struct terminal_map_item * a = loc_info(terminal,set,1);

if (!a) {
if (!silent)
***************
*** 1151,1157 ****
return 0;
}

! a = loc_info(terminal,display_charset);

if (!a) {
if (!silent)

--- 1237,1243 ----


return 0;
}

! a = loc_info(terminal,display_charset,1);

if (!a) {
if (!silent)
***************
*** 1359,1364 ****

--- 1445,1455 ----



for (i = 0; i < sizeof (p->width) / sizeof (p->width[0]); i++)
p->width[i] = -1;

+
+ #ifdef WCHAR


+ p->wcwidth = 0;
+ #endif
+
}

void free_terminal_info(p)
***************

*** 1453,1464 ****
}

if (/* For ISO-8859-* charsets */
! terminal_info->current_R == bank_unspecified &&
! ID.type == iso2022_96 ||
/* For EUC-* charsets */
! terminal_info->current_R == bank_unspecified &&
! ID.type == iso2022_94x94 &&
! ID.bank == bank_G1
) {

terminal_info->current_R = ID.bank;
--- 1544,1556 ----
}

if (/* For ISO-8859-* charsets */
! ( terminal_info->current_R == bank_unspecified &&
! ID.type == iso2022_96 )
! ||
/* For EUC-* charsets */
! ( terminal_info->current_R == bank_unspecified &&
! ID.type == iso2022_94x94 &&
! ID.bank == bank_G1 )
) {

terminal_info->current_R = ID.bank;
***************
*** 1554,1559 ****
--- 1646,1677 ----


LAST_COMPLAIN = NULL;
LAST_COMPLAIN_b = NULL;

+ if (terminal_info->set_count > 0 &&
+ terminal_info->sets[0].type == iso2022_other) {
+
+ if (same_setid(terminal_info->sets[0],
+ *(iso2022_info->sets[0]))) {
+
+ DPRINT(Debug,8,(&Debug,

+ "terminal_charset_post_init: Terminal was on no ISO2022 mode ... NO change\n"));
+
+ return NULL;
+
+ } else {
+

+ char *c;
+
+ DPRINT(Debug,8,(&Debug,
+ "terminal_charset_post_init: Terminal was on no ISO2022 mode ... returning to ISO2022\n"));
+
+ c = iso2022_setid_stream(return_to_iso2022,NULL,0);
+ ret = strmcat(ret,c);
+ free(c);
+
+ reset_display_settings(terminal_info);
+ }
+ }
+
/* Remove assignments which does not belong to iso2022_info */
for (k = 0; k < 4; k++) {
if (terminal_info->bank[k] >= max) {
***************
*** 1565,1570 ****

--- 1683,1690 ----


}
}

+
+
if (bank_unspecified != iso2022_info->initial_L &&
terminal_info->current_L != iso2022_info->initial_L) {
char *c = lock_shift(0,terminal_info->current_L,NULL,0);
***************

*** 1660,1665 ****
--- 1780,1788 ----
ID->bank = bank_G2;
else
ID->bank = bank_G3;


+
+ default:
+ break;
}
}
}
***************

*** 1757,1763 ****
}

terminal_info->sets[setpos] = ID;
! terminal_info->width[setpos] = -1; /* Initially no with */
}

terminal_info->bank[ID.bank] = setpos;

--- 1880,1886 ----


}

terminal_info->sets[setpos] = ID;
! terminal_info->width[setpos] = -1; /* Initially no width */
}

terminal_info->bank[ID.bank] = setpos;
***************
*** 1895,1904 ****
iso2022_96x96 == ID.type))
terminal_info->width[n] = 2;
else
! terminal_info->width[n] = 1;
}
}

for (i = 0;

i < sizeof (iso2022_info->sets) /
sizeof (iso2022_info->sets[0]) &&

--- 2018,2032 ----


iso2022_96x96 == ID.type))
terminal_info->width[n] = 2;
else
! terminal_info->width[n] = 1;
!
}
}

+ #ifdef WCHAR
+ terminal_info->wcwidth = MB;
+ #endif

+
for (i = 0;

i < sizeof (iso2022_info->sets) /
sizeof (iso2022_info->sets[0]) &&
***************
*** 1926,1932 ****
change_helper_2(&ret,ID,terminal_info,buffer,size,
maybe_signal,setpos);

! /* Do not support varaiable width inside of bank */
if (MB &&
(iso2022_94x94 == ID.type ||
iso2022_96x96 == ID.type))

--- 2054,2060 ----


change_helper_2(&ret,ID,terminal_info,buffer,size,
maybe_signal,setpos);

! /* Do not support variable width inside of bank */
if (MB &&
(iso2022_94x94 == ID.type ||
iso2022_96x96 == ID.type))
***************
*** 1940,1983 ****
*RET = ret;
}

/* May be called from signal handler -- on that situation use

buffer specified as argument -- otherwise result is malloced
*/

! char * terminal_switch_to(terminal,set,terminal_info,buffer,size)
char *terminal;
charset_t set;
! screen_info_p *terminal_info;

char * buffer;
int size;

{
int maybe_signal = buffer != NULL;

char *ret = NULL;
! struct terminal_map_item * a = loc_info(terminal,set);
!
! if (!a)
! return NULL;

! if (maybe_signal) {
! SIGDPRINT(Debug,8,(&Debug,
! "terminal_switch_to: buffer=%p size=%d\n",
! buffer,size));
! }
!

! if (!*terminal_info) {
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",
! "*terminal_info not set",maybe_signal);
}
!
! if (DISPLAY_STATE_magic != (*terminal_info)->magic)
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",
"Bad terminal_info (bad magic)",
maybe_signal);

! if ((*terminal_info)->set_count > 0 &&
! (*terminal_info)->sets[0].type == iso2022_other) {
SIGDPRINT(Debug,8,(&Debug,
"Terminal was on no ISO2022 mode ... returning\n"));
if (maybe_signal)

--- 2068,2235 ----


*RET = ret;
}

+ void terminal_change_system_charset(terminal)
+ char *terminal;
+ {
+ struct terminal_map_item * a = loc_info(terminal,system_charset,0);

+
+ if (system_charset->charset_type == &cs_unknown) {

+ DPRINT(Debug,9,(&Debug,"terminal_change_system_charset: System charset is already type unknown\n"));
+ return;
+ }
+

+ #if defined(WCHAR) && defined(__STDC_ISO_10646__)

+ if (a && a->keyword == terminal_dw) {
+ change_system_charset_1();
+ }
+ #endif

+
+ }
+
+

+ char * terminal_set_info (terminal,set,terminal_info)
+ char *terminal;
+ charset_t set;
+ screen_info_p terminal_info;
+ {
+ char * ret = NULL;
+ struct terminal_map_item * a;
+
+ if (!terminal_info) {

+ panic("STRING PANIC",__FILE__,__LINE__,

+ "terminal_set_info",
+ "terminal_info not set",0);
+ }
+
+ if (DISPLAY_STATE_magic != terminal_info->magic)


+ panic("STRING PANIC",__FILE__,__LINE__,

+ "terminal_set_info",
+ "Bad terminal_info (bad magic)",
+ 0);
+
+ /* We do not reset bank settings on here */
+ #ifdef WCHAR
+ terminal_info->wcwidth = 0;
+ #endif
+

+ a = loc_info(terminal,set,0);
+ if (!a)

+ return ret;
+

+ switch (a->keyword) {
+ case terminal_dw: {

+ static int warned = 0;
+

+ #ifdef WCHAR
+ if (&cs_unknown != set->charset_type ||
+ 0 == (CS_printable_len & charset_properties(set))) {
+
+ if (!warned)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeUnsupportedDW,

+ "Double wide characters are not supported"));
+
+ warned = 1;


+ return NULL;
+ }
+

+ terminal_info->wcwidth = 1;
+
+ #else
+

+ if (!warned)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeUnsupportedDW,

+ "Double wide characters are not supported"));
+
+ warned = 1;
+ #endif
+ }
+ break;
+
+ case terminal_iso2022_mb: {


+ static int warned = 0;
+

+ if (0 == (CS_printable_len & charset_properties(set))) {
+
+ if (!warned)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeUnsupportedDW,

+ "Double wide characters are not supported"));
+
+ warned = 1;

+ return ret;
+ }
+

+ if (set->iso2022_info)
+ change_helper_3(&ret,set->iso2022_info,terminal_info,NULL,0,0,1);

+
+ #ifdef WCHAR


+ terminal_info->wcwidth = 1;
+ #endif
+ }

+ break;


+
+ default:
+ break;

+
+ }
+
+

+ #ifdef WCHAR
+ SIGDPRINT(Debug,8,(&Debug,
+ "terminal_set_info: wcwidth=%d\n",
+ terminal_info->wcwidth));
+ #endif
+

+
+
+ return ret;
+ }
+
+

/* May be called from signal handler -- on that situation use

buffer specified as argument -- otherwise result is malloced
*/

! char * terminal_switch_to(terminal,set,terminal_info,buffer,size,silent)
char *terminal;
charset_t set;
! screen_info_p terminal_info;

char * buffer;
int size;

+ int silent;
{
int maybe_signal = buffer != NULL;

char *ret = NULL;
! struct terminal_map_item * a = loc_info(terminal,set,1);

! if (!terminal_info) {
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",
! "terminal_info not set",maybe_signal);
}
!
! if (DISPLAY_STATE_magic != (terminal_info)->magic)
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",
"Bad terminal_info (bad magic)",
maybe_signal);
+
+
+ if (!a) {

+ return NULL;
+ }
+

--- 2238,2279 ----


ret = iso2022_setid_stream(return_to_iso2022,NULL,0);
}

! reset_display_settings(terminal_info);

switch(a->keyword) {
+ int mb;
case terminal_iso2022:
case terminal_iso2022_mb:
! if (set->iso2022_info) {
! SIGDPRINT(Debug,8,(&Debug,
! "Using ISO 2022 code for assignment\n"));
!

! mb = 0;
!

! if (a->keyword == terminal_iso2022_mb) {
! if (0 != (CS_printable_len & charset_properties(set)))
! mb = 1;
! else if (!silent) {
! static int warned = 0;
!
! if (!warned)
! lib_error(CATGETS(elm_msg_cat, MeSet,
! MeUnsupportedDW,

! "Double wide characters are not supported"));
!
! warned = 1;
! }
! }
!

! change_helper_3(&ret,set->iso2022_info,terminal_info,
! buffer,size,maybe_signal,
! mb);
! } else {
! SIGDPRINT(Debug,1,(&Debug,

! "No ISO 2022 code for changing charset!\n"));
!
! }


! break;

case terminal_iso2022_like:

***************
*** 2007,2013 ****
"Using ISO 2022 LIKE code for assignment\n"));

change_helper_3(&ret,a->value.iso2022_like.iso2022_info,
! *terminal_info,
buffer,size,maybe_signal,0);

break;

--- 2281,2287 ----


"Using ISO 2022 LIKE code for assignment\n"));

change_helper_3(&ret,a->value.iso2022_like.iso2022_info,
! terminal_info,
buffer,size,maybe_signal,0);

break;
***************

*** 2022,2030 ****
--- 2296,2312 ----

break;

+ default:
+ break;

}


+ #ifdef WCHAR
+ SIGDPRINT(Debug,8,(&Debug,
+ "terminal_switch_to: wcwidth=%d\n",
+ (terminal_info)->wcwidth));
+ #endif
+
if (maybe_signal && ret && ret != buffer)
panic("STRING PANIC",__FILE__,__LINE__,
"terminal_switch_to",

Index: elmME+.2.5.alpha5-cvs/lib/unicode.c
*** elmME+.2.5.alpha4/lib/unicode.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/unicode.c 2005-07-23 20:14:15.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: unicode.c,v 1.18.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: unicode.c,v 1.18.8.2 2005/07/23 17:14:15 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 138,143 ****
--- 138,147 ----
case UOP_noctrl: /* Consider invalid character as control */
case UOP_space: /* Invalid character is not space */
ch = 0;
+
+ break;
+ default:
+ break;
}
}

Index: elmME+.2.5.alpha5-cvs/lib/unidata.c
*** elmME+.2.5.alpha4/lib/unidata.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/unidata.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: unidata.c,v 1.28.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: unidata.c,v 1.28.8.6 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.28.8.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 84,90 ****
uint16 value; /* backpointer to character */
uint16 storage; /* pointer/index to decomp storage */
uint8 type_byte;
! uint8 len_byte; /* legth of decomposed data on storage */
};

static struct decomp_cell_1 unassigned_decomp_buffer = {
--- 84,90 ----
uint16 value; /* backpointer to character */
uint16 storage; /* pointer/index to decomp storage */
uint8 type_byte;
! uint8 len_byte; /* length of decomposed data on storage */
};

static struct decomp_cell_1 unassigned_decomp_buffer = {

***************
*** 134,140 ****


#define SYSCALL(x) { int ret_=x; int err_=errno;\
if (ret_ == -1) \

DPRINT(Debug,1,(&Debug,"unidata: syscall %s failed: errno=%d (%s)\n", \


! #x,err_,error_description(err_))); }
#else
#define SYSCALL(x) x
#endif

--- 134,140 ----


#define SYSCALL(x) { int ret_=x; int err_=errno;\
if (ret_ == -1) \

DPRINT(Debug,1,(&Debug,"unidata: syscall %s failed: errno=%d (%s)\n", \


! #x,err_,strerror(err_))); }
#else
#define SYSCALL(x) x
#endif
***************

*** 274,287 ****

static void dump_header P_((struct unidata_format_1 *v,


int byte_swapped,
! CONST char *filename));

static int write_unidata_1 P_((struct unidata_format_1 *v, int fd,
! CONST char *filename));
static int write_unidata_1(v, fd, filename)
struct unidata_format_1 *v;


int fd;
! CONST char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);

uint16 comp_vector_pages = READ_VALUE(v->header->comp_list_pagecount,
--- 274,287 ----

static void dump_header P_((struct unidata_format_1 *v,


int byte_swapped,
! const char *filename));

static int write_unidata_1 P_((struct unidata_format_1 *v, int fd,
! const char *filename));
static int write_unidata_1(v, fd, filename)
struct unidata_format_1 *v;


int fd;
! const char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);

uint16 comp_vector_pages = READ_VALUE(v->header->comp_list_pagecount,
***************
*** 292,302 ****

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}

--- 292,302 ----

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 307,317 ****

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}

--- 307,317 ----

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 322,332 ****

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}

--- 322,332 ----

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 337,347 ****

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}
--- 337,347 ----

DPRINT(Debug,1,(&Debug,

"unidata: write_range failed: errno=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 352,362 ****

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}

--- 352,362 ----

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 367,377 ****

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}

--- 367,377 ----

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 387,397 ****

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));
return 0;
}
}

--- 387,397 ----

DPRINT(Debug,1,(&Debug,
"unidata: write_range failed: errno=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));
return 0;
}
}
***************

*** 403,409 ****
static void dump_header (v,byte_swapped,filename)
struct unidata_format_1 *v;


int byte_swapped;
! CONST char *filename;
{
if (v->header) {
DPRINT(Debug,40,(&Debug,"============ Header dump: %-15s =======\n",

--- 403,409 ----
static void dump_header (v,byte_swapped,filename)
struct unidata_format_1 *v;


int byte_swapped;
! const char *filename;
{
if (v->header) {
DPRINT(Debug,40,(&Debug,"============ Header dump: %-15s =======\n",
***************

*** 435,445 ****
}

static int calculate_sizes P_((struct unidata_format_1 *v,


! CONST char *filename));

static int calculate_sizes (v,filename)

struct unidata_format_1 *v;


! CONST char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);

uint16 header_pages, vector_pages, cells_pages;
--- 435,445 ----
}

static int calculate_sizes P_((struct unidata_format_1 *v,


! const char *filename));

static int calculate_sizes (v,filename)

struct unidata_format_1 *v;


! const char *filename;
{
uint16 pagesize = READ_VALUE(v->header->page_size,v->byte_swapped);

uint16 header_pages, vector_pages, cells_pages;
***************
*** 501,513 ****

static void debug_output P_((struct unidata_format_1 *v,


int status, int pagesize, char *str,
! CONST char *filename));
static void debug_output(v,status,pagesize,str,filename)

struct unidata_format_1 *v;


int status;
int pagesize;
char *str;
! CONST char *filename;
{
DPRINT(Debug,1,(&Debug,

"%s: %s: status=%d, vector_count=%d, cells_count=%d, pagesize=%d\n",
--- 501,513 ----

static void debug_output P_((struct unidata_format_1 *v,


int status, int pagesize, char *str,
! const char *filename));
static void debug_output(v,status,pagesize,str,filename)

struct unidata_format_1 *v;


int status;
int pagesize;
char *str;
! const char *filename;
{
DPRINT(Debug,1,(&Debug,

"%s: %s: status=%d, vector_count=%d, cells_count=%d, pagesize=%d\n",
***************
*** 547,561 ****
}

static int read_unidata_1 P_((struct unidata_format_1 *v, int fd,

! int byte_swapped, CONST char *filename));

static int read_unidata_1(v, fd, byte_swapped, filename)
struct unidata_format_1 *v;


int fd;
int byte_swapped;
! CONST char *filename;
{
int status = 0;
! uint16 pagesize;

v->byte_swapped = byte_swapped;
v->mmapped = 0;

--- 547,561 ----
}

static int read_unidata_1 P_((struct unidata_format_1 *v, int fd,

! int byte_swapped, const char *filename));

static int read_unidata_1(v, fd, byte_swapped, filename)
struct unidata_format_1 *v;


int fd;
int byte_swapped;
! const char *filename;
{
int status = 0;
! uint16 pagesize = 0;

v->byte_swapped = byte_swapped;
v->mmapped = 0;
***************

*** 568,574 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));

status = 0;
goto fail_1;

--- 568,574 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));

status = 0;
goto fail_1;
***************

*** 589,595 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));

status = 0;
goto fail_2;

--- 589,595 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));

status = 0;
goto fail_2;
***************

*** 602,608 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));

status = 0;

goto fail_3;
--- 602,608 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));

status = 0;

goto fail_3;
***************
*** 615,621 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));

status = 0;

goto fail_4;
--- 615,621 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));

status = 0;

goto fail_4;
***************
*** 628,634 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));

status = 0;

goto fail_5;
--- 628,634 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));

status = 0;

goto fail_5;
***************
*** 641,647 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));

status = 0;

goto fail_6;
--- 641,647 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));

status = 0;

goto fail_6;
***************
*** 688,699 ****
}

static int mmap_unidata_1 P_((struct unidata_format_1 *v, int fd,

! int byte_swapped, CONST char *filename));

static int mmap_unidata_1(v, fd, byte_swapped, filename)
struct unidata_format_1 *v;


int fd;
int byte_swapped;
! CONST char *filename;
{
int status = 0;
#ifdef MMAP

--- 688,699 ----
}

static int mmap_unidata_1 P_((struct unidata_format_1 *v, int fd,

! int byte_swapped, const char *filename));

static int mmap_unidata_1(v, fd, byte_swapped, filename)
struct unidata_format_1 *v;


int fd;
int byte_swapped;
! const char *filename;
{
int status = 0;
#ifdef MMAP
***************

*** 711,717 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, error_description(err));

v->header = NULL;
v->header_length = 0;

--- 711,717 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, strerror(err));

v->header = NULL;
v->header_length = 0;
***************

*** 743,749 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, error_description(err));

v->vector = NULL;
v->vector_length = 0;
--- 743,749 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, strerror(err));

v->vector = NULL;
v->vector_length = 0;
***************
*** 759,765 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, error_description(err));

v->cells = NULL;
v->cells_length = 0;
--- 759,765 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, strerror(err));

v->cells = NULL;
v->cells_length = 0;
***************
*** 776,782 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, error_description(err));

v->decomp_cells = NULL;
v->decomp_cells_length = 0;
--- 776,782 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, strerror(err));

v->decomp_cells = NULL;
v->decomp_cells_length = 0;
***************
*** 792,798 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, error_description(err));

v->decomp_storage = NULL;
v->decomp_storage_length = 0;
--- 792,798 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, strerror(err));

v->decomp_storage = NULL;
v->decomp_storage_length = 0;
***************
*** 808,814 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, error_description(err));

v->cells = NULL;
v->cells_length = 0;
--- 808,814 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFailedMMap,
"Failed to mmap %.50s: %30s"),
! filename, strerror(err));

v->cells = NULL;
v->cells_length = 0;
***************
*** 976,981 ****
--- 976,983 ----
switch(v->format) {
case unidata_format_1: free_unidata_1(&(v->v.f1));

break;
+ default:
+ break;
}

v->format = unidata_bad;
free(v);
***************
*** 983,989 ****

int write_unidata(v,filename)
struct unidata_mapped_data *v;

! CONST char *filename;
{
char *tmpname;
int fd, err;

--- 985,991 ----

int write_unidata(v,filename)
struct unidata_mapped_data *v;

! const char *filename;
{
char *tmpname;
int fd, err;
***************

*** 994,1005 ****

DPRINT(Debug,1,(&Debug,
"unidata: access failed: errno=%d (%s)\n", \


! err,error_description(err)));

if (err != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, error_description(err));

return 0;
}

--- 996,1007 ----

DPRINT(Debug,1,(&Debug,
"unidata: access failed: errno=%d (%s)\n", \


! err,strerror(err)));

if (err != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! filename, strerror(err));

return 0;
}
***************

*** 1012,1022 ****
if (err) {
DPRINT(Debug,1,(&Debug,
"unidata: can_open failed: code=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmpname, error_description(err));

status = 0;
goto fail;

--- 1014,1024 ----
if (err) {
DPRINT(Debug,1,(&Debug,
"unidata: can_open failed: code=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmpname, strerror(err));

status = 0;
goto fail;
***************

*** 1028,1038 ****

DPRINT(Debug,1,(&Debug,
"unidata: open failed: errno=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmpname, error_description(err));
status = 0;
goto fail;
}

--- 1030,1040 ----

DPRINT(Debug,1,(&Debug,
"unidata: open failed: errno=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmpname, strerror(err));
status = 0;
goto fail;
}
***************

*** 1041,1046 ****
--- 1043,1050 ----
case unidata_format_1:
status = write_unidata_1(&(v->v.f1),fd,tmpname);
break;
+ default:


+ break;
}

if (-1 == close(fd)) {
***************

*** 1048,1058 ****

DPRINT(Debug,1,(&Debug,
"unidata: close failed: errno=%d (%s)\n", \


! err,error_description(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmpname, error_description(err));
status = 0;
goto fail;
}

--- 1052,1062 ----

DPRINT(Debug,1,(&Debug,
"unidata: close failed: errno=%d (%s)\n", \


! err,strerror(err)));

lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmpname, strerror(err));
status = 0;
goto fail;
}
***************

*** 1062,1068 ****


int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! filename, error_description(err));
status = 0;
goto fail;
}

--- 1066,1072 ----


int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! filename, strerror(err));
status = 0;
goto fail;
}
***************

*** 1077,1083 ****

int get_unidata(ptr,filename)
struct unidata_mapped_data **ptr;
! CONST char *filename;
{
struct unidata_mapped_data * res = *ptr;
int status = 0;
--- 1081,1087 ----

int get_unidata(ptr,filename)
struct unidata_mapped_data **ptr;
! const char *filename;
{
struct unidata_mapped_data * res = *ptr;


int status = 0;
***************

*** 1091,1097 ****


if (err) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));
return 0;
}

--- 1095,1101 ----


if (err) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));
return 0;
}

***************

*** 1101,1107 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, error_description(err));
return 0;
}

--- 1105,1111 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileUnreadable,
"File %.50s is unreadable: %s"),
! filename, strerror(err));
return 0;
}

***************

*** 1530,1535 ****
--- 1534,1541 ----
case unidata_format_1:
status = write_unidata_text_1(&(v->v.f1),f);

break;
+ default:
+ break;
}

return status;
***************
*** 1568,1578 ****
return ptr;
}

! static void format_error P_((FILE *logfile,CONST char *filename,
int *line_number,char *buffer, int c));
static void format_error(logfile,filename,line_number,buffer, c)
FILE *logfile;
! CONST char *filename;
int *line_number;
char *buffer;
int c;
--- 1574,1584 ----
return ptr;
}

! static void format_error P_((FILE *logfile,const char *filename,
int *line_number,char *buffer, int c));
static void format_error(logfile,filename,line_number,buffer, c)
FILE *logfile;
! const char *filename;
int *line_number;
char *buffer;
int c;
***************
*** 1582,1589 ****
filename,*line_number,buffer);
if (logfile) {
fprintf(logfile,"<-- [ERROR]\n");
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeFormatError,
! "Format error on %.50s, line %d: %s"),
filename,*line_number,buffer);
putc('\n',logfile);
if ('\n' != c)
--- 1588,1596 ----
filename,*line_number,buffer);
if (logfile) {
fprintf(logfile,"<-- [ERROR]\n");
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeFormatError,
! "Format error on %.50s, line %d: %s"),
filename,*line_number,buffer);
putc('\n',logfile);
if ('\n' != c)
***************
*** 1594,1600 ****
static int read_line P_((FILE *fp, struct char_cell_1 *buffer,
uint16 *code, char *name_buffer,
int name_buffer_size, int *line_number,


! CONST char *filename, FILE *logfile,

char * composition_buffer,
int composition_buffer_size));

--- 1601,1607 ----
static int read_line P_((FILE *fp, struct char_cell_1 *buffer,
uint16 *code, char *name_buffer,
int name_buffer_size, int *line_number,


! const char *filename, FILE *logfile,

char * composition_buffer,
int composition_buffer_size));

***************
*** 1607,1613 ****
char *name_buffer;
int name_buffer_size;
int *line_number;
! CONST char *filename;
FILE *logfile;
char *composition_buffer;
int composition_buffer_size;
--- 1614,1620 ----
char *name_buffer;
int name_buffer_size;
int *line_number;
! const char *filename;
FILE *logfile;
char *composition_buffer;
int composition_buffer_size;
***************
*** 1896,1907 ****
if (ferror(fp)) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeGotError,
"Unexpected error on %.50s, line %d: %.30s"),
! filename,*line_number,error_description(err));
if (logfile) {
fprintf(logfile,"<-- [ERROR]\n");
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeGotError,
! "Unexpected error on %.50s, line %d: %.30s"),
! filename,*line_number,error_description(err));
putc('\n',logfile);
}

--- 1903,1915 ----
if (ferror(fp)) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeGotError,
"Unexpected error on %.50s, line %d: %.30s"),
! filename,*line_number,strerror(err));
if (logfile) {
fprintf(logfile,"<-- [ERROR]\n");
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeGotError,
! "Unexpected error on %.50s, line %d: %.30s"),
! filename,*line_number,strerror(err));
putc('\n',logfile);
}

***************
*** 1911,1919 ****
filename,*line_number);
if (logfile) {
fprintf(logfile,"<-- [ERROR]\n");
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeGotEOF,
! "Unexpected end of %.50s, line %d"),
! filename,*line_number);
putc('\n',logfile);
}
}
--- 1919,1928 ----
filename,*line_number);
if (logfile) {
fprintf(logfile,"<-- [ERROR]\n");
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeGotEOF,
! "Unexpected end of %.50s, line %d"),
! filename,*line_number);
putc('\n',logfile);
}
}
***************
*** 2017,2023 ****

static int add_decomposition P_((char *decomposition_buffer,
int line_number,
! CONST char *filename,
struct unidata_format_1 *v,
uint16 *decomp, FILE *logfile,
unsigned int code1));
--- 2026,2032 ----

static int add_decomposition P_((char *decomposition_buffer,
int line_number,
! const char *filename,
struct unidata_format_1 *v,
uint16 *decomp, FILE *logfile,
unsigned int code1));
***************
*** 2028,2034 ****
logfile,code1)
char *decomposition_buffer;
int line_number;
! CONST char *filename;
struct unidata_format_1 *v;
uint16 *decomp;
FILE *logfile;
--- 2037,2043 ----
logfile,code1)
char *decomposition_buffer;
int line_number;
! const char *filename;
struct unidata_format_1 *v;
uint16 *decomp;
FILE *logfile;
***************
*** 2062,2070 ****
filename,line_number,ptr);

if (logfile) {
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeFormatError,
! "Format error on %.50s, line %d: %s"),
! filename,line_number,ptr);
putc('\n',logfile);
}
goto fail;
--- 2071,2080 ----
filename,line_number,ptr);

if (logfile) {
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeFormatError,
! "Format error on %.50s, line %d: %s"),
! filename,line_number,ptr);
putc('\n',logfile);
}
goto fail;
***************
*** 2094,2102 ****
filename,line_number,ptr);

if (logfile) {
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeFormatError,
! "Format error on %.50s, line %d: %s"),
! filename,line_number,ptr);
putc('\n',logfile);
}
goto fail;
--- 2104,2113 ----
filename,line_number,ptr);

if (logfile) {
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeFormatError,
! "Format error on %.50s, line %d: %s"),
! filename,line_number,ptr);
putc('\n',logfile);
}
goto fail;
***************
*** 2121,2127 ****

int read_unidata_text(ptr,filename,logfile, silent_gaps)
struct unidata_mapped_data **ptr;
! CONST char *filename;
FILE *logfile;
int silent_gaps;
{
--- 2132,2138 ----

int read_unidata_text(ptr,filename,logfile, silent_gaps)
struct unidata_mapped_data **ptr;
! const char *filename;
FILE *logfile;
int silent_gaps;
{
***************
*** 2141,2147 ****
if (err) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeUnidataCantOpen,
"Can't open UNIDATA2.TXT: %.50s: %.25s"),
! filename,error_description(err));
return 0;
}

--- 2152,2158 ----
if (err) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeUnidataCantOpen,
"Can't open UNIDATA2.TXT: %.50s: %.25s"),
! filename,strerror(err));
return 0;
}

***************
*** 2153,2159 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeUnidataCantOpen,
"Can't open UNIDATA2.TXT: %.50s: %.25s"),
! filename,error_description(err));
goto fail;
}

--- 2164,2170 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeUnidataCantOpen,
"Can't open UNIDATA2.TXT: %.50s: %.25s"),


! filename,strerror(err));
goto fail;
}

***************

*** 2203,2212 ****
last_processed+1,last_processed+1);
}
if (logfile) {
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeSequenceError,
! "%.50s, line %d: Got %d (%04X), exptected %d (%04X)"),
! filename,line_number-1,code,code,
! last_processed+1,last_processed+1);
putc('\n',logfile);
/* Do not log failure... */
}
--- 2214,2224 ----
last_processed+1,last_processed+1);
}
if (logfile) {
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeSequenceError,
! "%.50s, line %d: Got %d (%04X), exptected %d (%04X)"),
! filename,line_number-1,code,code,
! last_processed+1,last_processed+1);
putc('\n',logfile);
/* Do not log failure... */
}
***************
*** 2302,2312 ****
filename,line_number-1,
temp_name_buffer2,temp_name_buffer2);
if (logfile) {
! fprintf(logfile,
! catgets(elm_msg_cat, MeSet, MeNotEndRange,
! "%.50s: %d: %.25s is not end for %.25s"),
! filename,line_number-1,
! temp_name_buffer2,temp_name_buffer2);
putc('\n',logfile);
}
status = 0;
--- 2314,2324 ----
filename,line_number-1,
temp_name_buffer2,temp_name_buffer2);
if (logfile) {
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeNotEndRange,
! "%.50s: %d: %.25s is not end for %.25s"),
! filename,line_number-1,
! temp_name_buffer2,temp_name_buffer2);
putc('\n',logfile);
}
status = 0;
***************
*** 2319,2328 ****
"%.50s: Last processed was %d, should be %d"),
filename,last_processed,0xFFFF);
if (logfile) {
! fprintf(logfile,
! catgets(elm_msg_cat, MeSet, MeIncomplete,
! "%.50s: Last processed was %d, should be %d"),
! filename,last_processed,0xFFFF);
putc('\n',logfile);
}
}
--- 2331,2340 ----
"%.50s: Last processed was %d, should be %d"),
filename,last_processed,0xFFFF);
if (logfile) {
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeIncomplete,
! "%.50s: Last processed was %d, should be %d"),
! filename,last_processed,0xFFFF);
putc('\n',logfile);
}
}
***************
*** 2440,2449 ****
--- 2452,2465 ----
struct char_cell_1 *C = &(v->cells[ptr]);

uint16 chartype = READ_VALUE(C->chartype,v->byte_swapped);
+ #if 0
uint16 class = READ_VALUE(C->class,v->byte_swapped);
+ #endif
uint16 direction = READ_VALUE(C->direction,v->byte_swapped);
uint16 decomp = READ_VALUE(C->decomp,v->byte_swapped);
+ #if 0
uint16 decimal = READ_VALUE(C->decimal,v->byte_swapped);
+ #endif
uint16 flags = READ_VALUE(C->flags,v->byte_swapped);
uint16 upper = READ_VALUE(C->upper,v->byte_swapped);
uint16 lower = READ_VALUE(C->lower,v->byte_swapped);
***************
*** 2550,2555 ****
--- 2566,2573 ----
status = unicode_lookup_character_1(&(v->v.f1),unicode,info,
unicode_out, buffer_len);

break;
+ default:
+ break;
}

return status;
***************
*** 2574,2579 ****
--- 2592,2599 ----
unicode_res,unicode_inp,len,
comp_type);

break;
+ default:
+ break;
}

return status;
Index: elmME+.2.5.alpha5-cvs/lib/write_hdr.c
*** elmME+.2.5.alpha4/lib/write_hdr.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/lib/write_hdr.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: write_hdr.c,v 1.4.8.1 2004/04/18 16:55:42 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: write_hdr.c,v 1.4.8.2 2005/07/26 08:28:41 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 45,53 ****
enmime,hdr_name));

for (p = addr; p && p->fullname && p->addr && p->comment; p++) {
! CONST int al = strlen(p->addr);
! CONST int fn = string_len(p->fullname);
! CONST int cm = string_len(p->comment);

DPRINT(Debug,9,
(&Debug, "\n [%d] ",p-addr));
--- 45,53 ----
enmime,hdr_name));

for (p = addr; p && p->fullname && p->addr && p->comment; p++) {
! const int al = strlen(p->addr);
! const int fn = string_len(p->fullname);
! const int cm = string_len(p->comment);

DPRINT(Debug,9,
(&Debug, "\n [%d] ",p-addr));
***************
*** 164,175 ****

void write_text_header (mailer,hdr_name,text, top_encoding)
out_state_t *mailer;
! CONST char *hdr_name;
! CONST char * text;
int top_encoding;
{
long POS = out_state_ftell(mailer);
! CONST char *c;

state_puts(hdr_name,mailer);
state_puts(": ",mailer);
--- 164,175 ----

void write_text_header (mailer,hdr_name,text, top_encoding)
out_state_t *mailer;
! const char *hdr_name;
! const char * text;
int top_encoding;
{
long POS = out_state_ftell(mailer);
! const char *c;

state_puts(hdr_name,mailer);
state_puts(": ",mailer);
Index: elmME+.2.5.alpha5-cvs/lib/write_rc.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/lib/write_rc.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 0 ****
--- 1,364 ----
+ static char rcsid[] = "@(#)$Id: write_rc.c,v 1.2.2.5 2005/07/26 08:28:41 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2.2.5 $ $State: Exp $
+ *


+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
+ *****************************************************************************
+ * Some code based on ../src/save_opts.c

+ * That code was following copyright:
+ *
+ * The Elm Mail System
+ *
+ * Copyright (c) 1988-1992 USENET Community Trust
+ * Copyright (c) 1986,1987 Dave Taylor


+ *****************************************************************************/
+
+ #include "elm_defs.h"

+ #include "rc_imp.h"
+ #include "save_opts.h"

+ #include "s_elmrc.h"


+
+ #include <errno.h>
+ #ifndef ANSI_C
+ extern int errno;
+ #endif
+

+ DEBUG_VAR(Debug,__FILE__,"config");
+

+ int write_rc(targetfile,commentfile,global,actor,username,version_buff)


+ char *targetfile;
+ FILE * commentfile;
+ int global;

+ const char *actor;
+ char *username;
+ char *version_buff;


+ {
+ int close_comment_file = 0;
+ char *tmp = NULL;

+ int res = 0;

+ int errcode;
+
+ int x;
+ FILE *f;
+
+ if (!commentfile) {
+ commentfile = fopen(ELMRC_INFO,"r");
+ if (!commentfile)
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet,
+ ElmrcSavingWithoutComments,
+ "Warning: saving without comments! Can't get to %s."),
+ ELMRC_INFO);
+ else
+ close_comment_file++;

+
+ }
+
+

+ tmp = elm_message(FRM("%s.N"),targetfile);
+
+ errcode = can_open(tmp,"w");
+
+ if (errcode) {
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcFileNotWriteable,

+ "File %s is not writeable: %s"),
+ tmp, strerror(errcode));


+
+ res = 0;

+ goto fail;
+ }
+

+
+ f = fopen(tmp,"w");
+ if (!f) {
+ int errcode = errno;
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcFileNotWriteable,

+ "File %s is not writeable: %s"),
+ tmp, strerror(errcode));


+
+ res = 0;

+ goto fail;
+ }
+

+ if (username && username[0])
+ elm_fprintf(f,
+ CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoFor1,
+ "# Saved automatically by %s %s for %s\n#\n\n"),
+ actor, version_buff, username);
+ else
+ elm_fprintf(f,
+ CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoWrite1,
+ "# Saved automatically by %s %s\n#\n\n"),
+ actor,version_buff);
+
+
+ if (commentfile) {
+ char line_buffer[SLEN];

+ int x;


+ int len;
+ int local_value;
+ int skip = 1;
+

+ char * section = NULL;
+ int section_len = 0;


+
+ while (0 < (len =
+ mail_gets(line_buffer, sizeof line_buffer,
+ commentfile))) {
+

+ int y = 0;
+

+ if (line_buffer[len-1] != '\n') {
+ DPRINT(Debug,1,(&Debug,
+ "Too long line (read len=%d): %s\n",
+ len,line_buffer));
+ break;
+ }
+ line_buffer[--len] = '\0';
+ if (0 == len)
+ continue;
+
+ if ('#' == line_buffer[0] || whitespace(line_buffer[0])) {
+
+ if (strncmp(line_buffer, "#$HDR", 5) == 0) {
+ skip = 0;

+ continue;
+ }
+

+ if (skip)
+ continue;
+
+ /* Copy initial comments */
+
+ fprintf(f,"%s\n",line_buffer);
+ continue;
+ }

+ skip = 1;
+
+ /* get section header */
+ if ('$' == line_buffer[0]) {
+
+ if (section)
+ free(section);
+ section = NULL;
+ section_len = 0;
+
+
+ if (0 == strcmp(line_buffer,"$user")) {
+ /* User comment */
+
+ skip = global;
+ continue;
+ } else if (0 == strcmp(line_buffer,"$global")) {
+
+ skip = !global;
+ continue;
+ } else if (0 == strcmp(line_buffer,"$usersection")) {
+
+ if (global)
+ continue;
+ } else if (0 == strcmp(line_buffer,"$globalsection")) {
+
+ if (!global)
+ continue;
+ }
+

+ while (0 < (len =
+ mail_gets(line_buffer, sizeof line_buffer,
+ commentfile))) {
+ if ('#' != line_buffer[0])
+ break;
+

+ section = safe_realloc(section,section_len+len+1);
+
+ strfcpy(section+section_len,line_buffer,len+1);
+ section_len += len;
+
+ continue;
+ }
+
+ skip = 1;
+ continue;
+ }
+

+ for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
+ y = strcmp(line_buffer, save_info[x].name);
+ if (y <= 0)

+ break;
+ }
+

+ if (x >= NUMBER_OF_SAVEABLE_OPTIONS || y != 0) {
+
+ DPRINT(Debug,15,(&Debug,
+ "Skipping option %s ... \n",
+ line_buffer));
+

+ continue;
+ }
+

+ if (global &&
+ ! (save_info[x].flags & FL_CHANGED) &&
+ ! (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping user option %s ... \n",
+ line_buffer));
+

+ continue;
+ }
+

+ if (!global &&
+ (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping system option %s ... \n",
+ line_buffer));
+

+ continue;
+ }
+
+ if (section) {


+ fprintf(f,"\n");
+

+ fputs(section,f);
+
+ free(section);
+ section = NULL;
+
+ section_len = 0;
+ }
+

+ fprintf(f,"\n");
+
+ /* Copy comments */
+ while (0 < (len =
+ mail_gets(line_buffer, sizeof line_buffer,
+ commentfile))) {
+ if ('#' != line_buffer[0])
+ break;
+ fputs(line_buffer,f);
+ }
+
+ if (global)
+ local_value = save_info[x].flags & FL_CHANGED;
+ else
+ local_value = save_info[x].flags & FL_LOCAL;

+ if (RCTYPE_magic != save_info[x].dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"main",


+ "Bad config item type",0);
+

+ DPRINT(Debug,15,(&Debug,
+ "Writing option %s ... %s\n",
+ save_info[x].name,
+ local_value ? "(local value)" : ""));
+
+ save_info[x].dt_type->print_value(f,
+ & save_info[x],
+ !local_value);
+
+
+ save_info[x].flags |= FL_SAVED;
+

+ /* Copy extra comments */
+ skip = 0;
+ }
+
+ if (section)
+ free(section);
+ section = NULL;
+ section_len = 0;
+
+ }
+

+
+
+ for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
+ int local_value;
+

+

+ if (save_info[x].flags & FL_SAVED)
+ continue;
+
+ if (global &&
+ ! (save_info[x].flags & FL_CHANGED) &&
+ ! (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping user option %s ... \n",
+ save_info[x].name));
+

+ continue;
+ }
+

+ if (!global &&
+ (save_info[x].flags & FL_SYS)) {
+ DPRINT(Debug,15,(&Debug,
+ "Skipping system option %s ... \n",
+ save_info[x].name));
+

+ continue;
+ }
+
+ fprintf(f,"\n");
+

+ if (global)
+ local_value = save_info[x].flags & FL_CHANGED;
+ else
+ local_value = save_info[x].flags & FL_LOCAL;

+ if (RCTYPE_magic != save_info[x].dt_type->magic)
+ panic("RC PANIC",__FILE__,__LINE__,"main",


+ "Bad config item type",0);
+

+ DPRINT(Debug,15,(&Debug,
+ "Writing option %s ... %s (no comment)\n",
+ save_info[x].name,
+ local_value ? "(local value)" : ""));
+
+
+ save_info[x].dt_type->print_value(f,
+ & save_info[x],
+ !local_value);
+ }
+
+ #ifdef USE_DLOPEN
+ print_local_shared_options(f,global);

+ #endif
+

+ if (EOF == fclose(f)) {
+ int errcode = errno;
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcFileNotWriteable,

+ "File %s is not writeable: %s"),
+ tmp, strerror(errcode));


+
+ res = 0;

+ goto fail;
+ }
+

+ if (0 != rename(tmp,targetfile)) {
+ int errcode = errno;
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcFileNotRenamed,
+ "Failed to rename temporary file to %s: %s"),

+ targetfile, strerror(errcode));


+
+ res = 0;

+ goto fail;
+ }
+

+ res = 1;
+
+ fail:


+ if (tmp)
+ free(tmp);
+
+ if (close_comment_file)
+ fclose(commentfile);
+
+ return res;

+ }
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

+

Kari E. Hurtta

unread,
Jul 28, 2005, 12:31:24 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.11

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 11/20 ) =========
Index: elmME+.2.5.alpha5-cvs/melib/pgp_decode.c
*** elmME+.2.5.alpha4/melib/pgp_decode.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/melib/pgp_decode.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.38.8.1 2004/04/25 14:52:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp_decode.c,v 1.38.8.5 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 27,33 ****

char pgp_passphrase[PGP_NUM][STRING];
int pgp_expires;

! static CONST char * pgp_names[PGP_NUM] = {
"*none*",
"PGP 2",
"PGP 5",
--- 27,33 ----
char pgp_passphrase[PGP_NUM][STRING];
int pgp_expires;

! static const char * pgp_names[PGP_NUM] = {
"*none*",
"PGP 2",
"PGP 5",
***************
*** 54,64 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantExecute,
"Can't execute pgp: %.50s: %.30s"),
! pgp2_path, error_description(err));

DPRINT(Debug,5,(&Debug,
"have_pgp: no access %s: %s\n",pgp2_path,
! error_description(err)));
return_value = pgp_none;
}
} else {
--- 54,64 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantExecute,
"Can't execute pgp: %.50s: %.30s"),
! pgp2_path, strerror(err));

DPRINT(Debug,5,(&Debug,
"have_pgp: no access %s: %s\n",pgp2_path,
! strerror(err)));
return_value = pgp_none;
}
} else {
***************
*** 84,94 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantExecute,
"Can't execute pgp: %.50s: %.30s"),
! path, error_description(err));

DPRINT(Debug,5,(&Debug,
"have_pgp: no access %s: %s\n",path,
! error_description(err)));
return_value = pgp_none;
}
free(path);
--- 84,94 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantExecute,
"Can't execute pgp: %.50s: %.30s"),
! path, strerror(err));

DPRINT(Debug,5,(&Debug,
"have_pgp: no access %s: %s\n",path,
! strerror(err)));
return_value = pgp_none;
}
free(path);
***************
*** 110,120 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantExecute,
"Can't execute pgp: %.50s: %.30s"),
! gpg_path, error_description(err));

DPRINT(Debug,5,(&Debug,
"have_pgp: no access %s: %s\n",gpg_path,
! error_description(err)));
return_value = pgp_none;
}
} else {
--- 110,120 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantExecute,
"Can't execute pgp: %.50s: %.30s"),
! gpg_path, strerror(err));

DPRINT(Debug,5,(&Debug,
"have_pgp: no access %s: %s\n",gpg_path,
! strerror(err)));
return_value = pgp_none;
}
} else {
***************
*** 130,135 ****
--- 130,138 ----

return_value = pgp5;
goto try_pgp5;


+
+ default:
+ break;
}

DPRINT(Debug,5,(&Debug,
"have_pgp(%d)=%d\n",v,return_value));
***************
*** 231,237 ****
int pgp_child_in[2];
int pgp_child_out[2];
int array[3];
! CONST char * argv[10];
char * env[2];
int passpipe[2];
int usepass=FALSE;
--- 234,240 ----
int pgp_child_in[2];
int pgp_child_out[2];
int array[3];
! const char * argv[10];
char * env[2];
int passpipe[2];
int usepass=FALSE;
***************
*** 307,312 ****
--- 310,319 ----
array[2] = passpipe[1];
}
env[1] = NULL;


+
+ default:
+ break;
+
}

switch(v) {
***************
*** 354,359 ****
--- 361,369 ----
argv[n++] = "--decrypt";
argv[n] = NULL;


break;
+
+ default:
+ break;
}

code = start_run(rs, SY_RUN_STATE_INIT|SY_RUN_STATE_ENV , argv ,
***************
*** 410,435 ****
return(code);
}

! static int pgp_mime_opts P_((char *));

static int pgp_mime_opts (s)
! char *s;
! {
! char value[STRING];
!
if (s) {
! if (mime_get_param ("format", value, s, sizeof(value))) {
! if (istrcmp (value, "keys-only") == 0)
return PGP_PUBLIC_KEY;
}
! if (mime_get_param ("x-action", value, s, sizeof (value))) {
! if (istrcmp (value, "encryptsign") == 0)
return (PGP_MESSAGE | PGP_SIGNED_MESSAGE);
! else if (istrcmp (value, "encrypt") == 0)
return PGP_MESSAGE;
! else if (istrcmp (value, "sign") == 0)
return PGP_SIGNED_MESSAGE;
! else if (istrcmp (value, "signclear") == 0)
return PGP_SIGNED_MESSAGE;
}
}
--- 420,448 ----
return(code);
}

! static int pgp_mime_opts P_((struct mime_param *s));

static int pgp_mime_opts (s)
! struct mime_param *s;
! {
if (s) {
! const char *pv;
!
! pv = get_mime_param_compat(s,"format");
! if (pv) {
! if (istrcmp (pv, "keys-only") == 0)
return PGP_PUBLIC_KEY;
}
!
! pv = get_mime_param_compat(s,"x-action");
! if (pv) {
! if (istrcmp (pv, "encryptsign") == 0)
return (PGP_MESSAGE | PGP_SIGNED_MESSAGE);
! else if (istrcmp (pv, "encrypt") == 0)
return PGP_MESSAGE;
! else if (istrcmp (pv, "sign") == 0)
return PGP_SIGNED_MESSAGE;
! else if (istrcmp (pv, "signclear") == 0)
return PGP_SIGNED_MESSAGE;
}
}
***************
*** 439,444 ****
--- 452,459 ----
enum pgp_version decode_pgp_version(c)
char * c;
{
+ int se = give_dt_enumerate_as_int(&send_pgp_version);
+
if (0 == strncmp(c,"2.",2)) {
DPRINT(Debug,4,(&Debug,
"decode_pgp_version: Version -- PGP 2\n"));
***************
*** 453,459 ****


if ('/' == pgp5_dir[0])

return pgp5;
else
! return send_pgp_version;
}
}

--- 468,474 ----


if ('/' == pgp5_dir[0])

return pgp5;
else
! return (enum pgp_version) se;
}
}

***************
*** 537,551 ****
int was_binary = 0;
in_state_t newstate2;
enum pgp_version version;

in_state_clear(&newstate2,STATE_in_file);

raw = sr_call_RawState ();

! if (mime_get_param ("format", buffer, m->type_opts, sizeof (buffer)) &&
! (istrcmp (buffer, "mime") == 0)) {
char * tempfile = elm_message(FRM("%selmPT%d"),
! temp_dir, getpid ());

nested = TRUE;
DPRINT(Debug,3,(&Debug,
--- 552,574 ----
int was_binary = 0;
in_state_t newstate2;
enum pgp_version version;
+ char *tmp;
+ const char *pv;


+
+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ return;
+

in_state_clear(&newstate2,STATE_in_file);

raw = sr_call_RawState ();

! if (
! (pv = get_mime_param_compat(m->TYPE_opts,"format")) &&
! (istrcmp (pv, "mime") == 0)) {
char * tempfile = elm_message(FRM("%selmPT%d"),
! tmp, getpid ());

nested = TRUE;
DPRINT(Debug,3,(&Debug,
***************
*** 570,576 ****
else
tmpfp = NULL;

! opts = pgp_mime_opts (m->type_opts);

buffer[0] = '\0';
if (opts & PGP_PUBLIC_KEY) {
--- 593,599 ----
else
tmpfp = NULL;

! opts = pgp_mime_opts(m->TYPE_opts);

buffer[0] = '\0';
if (opts & PGP_PUBLIC_KEY) {
***************
*** 1022,1028 ****
mime_t *sign;
in_state_t *state_in;
out_state_t *state_out;
! char *micalg;
charset_t defcharset;
struct header_rec *mss;
{
--- 1045,1051 ----
mime_t *sign;
in_state_t *state_in;
out_state_t *state_out;
! const char *micalg;
charset_t defcharset;
struct header_rec *mss;
{
***************
*** 1096,1102 ****

struct run_state RS;
int stat;
! CONST char * argv[10];
int raw = sr_call_RawState ();


--- 1119,1125 ----

struct run_state RS;
int stat;
! const char * argv[10];
int raw = sr_call_RawState ();


***************
*** 1129,1134 ****
--- 1152,1161 ----
argv[4] = body_name;
argv[5] = NULL;
break;
+
+ default:
+ argv[0] = NULL;
+ break;
}

sr_call_Raw(OFF);
***************
*** 1168,1174 ****
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
"Failed: %.30s: %.40s"),
! argv[0],error_description(RS.save_errno));
} else
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStart,


"Can't start %.30s"),

--- 1195,1201 ----
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
"Failed: %.30s: %.40s"),
! argv[0],strerror(RS.save_errno));
} else
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStart,


"Can't start %.30s"),

***************
*** 1216,1221 ****
--- 1243,1252 ----
FILE *decode_fp;
FILE *tmpfp;
in_state_t newstate2;


+ char *tmp;
+
+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+

in_state_clear(&newstate2,STATE_in_file);

***************
*** 1230,1236 ****
}

tempfile = elm_message(FRM("%selmPT%d"),
! temp_dir, getpid ());

if (NULL == (tmpfp = safeopen_rdwr(tempfile))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantCreate,
--- 1261,1267 ----
}

tempfile = elm_message(FRM("%selmPT%d"),
! tmp, getpid ());

if (NULL == (tmpfp = safeopen_rdwr(tempfile))) {
lib_error(CATGETS(elm_msg_cat, MeSet, MePgpCantCreate,
***************
*** 1378,1384 ****

set_in_state_file(tmpfp,&s2_in);

! /* Pass NULL as message, because this is encryoted section */
mime_decode (tmpmt, &s2_in, state_out, defcharset, NULL);

mime_t_clear(tmpmt);
--- 1409,1415 ----

set_in_state_file(tmpfp,&s2_in);

! /* Pass NULL as message, because this is encrypted section */
mime_decode (tmpmt, &s2_in, state_out, defcharset, NULL);

mime_t_clear(tmpmt);
Index: elmME+.2.5.alpha5-cvs/nls/C/C/C/s_aliases.m
*** elmME+.2.5.alpha4/nls/C/C/C/s_aliases.m 2004-02-25 21:39:18.000000000 +0200
--- elmME+.2.5.alpha5-cvs/nls/C/C/C/s_aliases.m 2005-07-20 19:49:45.000000000 +0300
***************
*** 10,21 ****
4 [Keeping %d aliases and deleting %d.]
$ #DeleteAll
5 [Deleting all aliases.]
- $ #Select
- 7 Alias mode: %d shown out of %d %S[ELM %s]
- $ #Single
- 8 Alias mode: 1 alias %S[ELM %s]
- $ #Plural
- 9 Alias mode: %d aliases %S[ELM %s]
$ #RMenuLn1
10 You can use any of the following commands by pressing the first character;
$ #RMenuLn2
--- 10,15 ----
***************
*** 147,154 ****
92 Processed %d aliases. Re-reading the database...
$ #UpdatedOK
93 Aliases updated successfully.
- $ #ShortKey
- 95 "Key: "
$ #LongKey
96 "Key you want help for: "
$ #KeyMenu
--- 141,146 ----
***************
*** 245,247 ****
--- 237,241 ----
144 "(modified, resync needed) "
$ #AddressAs1
145 Messages addressed as: %s
+ $ #Mode
+ 146 Alias mode
Index: elmME+.2.5.alpha5-cvs/nls/C/C/C/s_elm.m
*** elmME+.2.5.alpha4/nls/C/C/C/s_elm.m 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/nls/C/C/C/s_elm.m 2005-07-24 16:04:31.000000000 +0300
***************
*** 321,327 ****
$ #NoMailToCheck
167 No mail to check.
$ #FileHelpmsg1
! 168 "\n\n\rYou must specify a file or folder to "
$quote
$ #FileHelpmsg2
169 to. Several options\n\rare available:\n\r\
--- 321,327 ----
$ #NoMailToCheck
167 No mail to check.
$ #FileHelpmsg1
! 168 "You must specify a file or folder to "
$quote
$ #FileHelpmsg2
169 to. Several options\n\rare available:\n\r\
***************
*** 331,337 ****
$ #FileHelpmsg4
171 )\n\r '<' will use your "sent" folder (
$ #FileHelpmsg5
! 172 )\n\r '.' will use the previous folder (
$quote {
$ #FileHelpmsg6
173 {)\n\r '@alias' will use the default folder for "alias"\n\r\n\r\
--- 331,337 ----
$ #FileHelpmsg4
171 )\n\r '<' will use your "sent" folder (
$ #FileHelpmsg5
! 172 )\n\r '!!' will use the previous folder (
$quote {
$ #FileHelpmsg6
173 {)\n\r '@alias' will use the default folder for "alias"\n\r\n\r\
***************
*** 391,397 ****
$ #NoPermRead
213 You have no permission to read %s!\n\r
$ #NoMail
! 214 You have no mail.\n\r
$ #MailBeingForwarded


215 Your mail is being forwarded to %s.\n\r
$ #SeekFailed

--- 391,397 ----
$ #NoPermRead
213 You have no permission to read %s!\n\r
$ #NoMail
! 214 You have no mail.
$ #MailBeingForwarded


215 Your mail is being forwarded to %s.\n\r
$ #SeekFailed
***************
*** 828,835 ****
455 (use <space> to toggle, any other key to leave)
$ #SpaceToChange
456 <space> to change
$ #SpaceForNext
! 457 (SPACE for next, or R)everse)
$ #ResortingFolder
458 Resorting folder...
$ #SortRSentDate
--- 828,837 ----
455 (use <space> to toggle, any other key to leave)
$ #SpaceToChange
456 <space> to change
+ $quote "
$ #SpaceForNext
! 457 " (SPACE for next, or R)everse)"
! $quote
$ #ResortingFolder
458 Resorting folder...
$ #SortRSentDate
***************

*** 959,964 ****
--- 961,967 ----


\t -V \t\tEnable sendmail voyeur mode.\n\r\
\t -v \t\tPrint out ELM version information.\n\r\
\t -w \t\tWrite .elm/elmrc and .elm/mime.charsets\n\r\
+ \t -y \t\tdon't enter ELM if no unread mail is pending\n\r\
\t -z \t\tZero - don't enter ELM if no mail is pending\n\r\
\n\n

$ #AlreadyReadingThatFolder
***************
*** 1073,1080 ****


\r or a filename (a leading '=' denotes your folder directory).\n\r\n\r

$ #ShownXWithSelect
593 %S with %d shown out of %d
- $ #ShownXNoSelect
- 594 %S with 1 message
$ #FolderWord
595 Folder
$ #MailboxWord

--- 1076,1081 ----
***************
*** 1163,1170 ****


641 \n\nStopped. Use "fg" to return to ELM\n\n
$ #BackInElmRedraw
642 \nBack in ELM. (You might need to explicitly request a redraw.)\n\n
- $ #ShownXNoSelectPlural
- 643 %S with %d messages
$quote '
$ #KeyF1
644 ' Display Msg'

--- 1164,1169 ----
***************
*** 1346,1354 ****


$ #SortUnknown
740 *UNKNOWN-SORT-PARAMETER*
$ #EnterLastSelected
! 741 Enter: {"subject","to","from","cc","header"} [pattern] OR {"thread","tagged","all"}
$ #EnterSelected
! 742 Enter: {"subject","to","from","header"} [pattern] OR {"thread","tagged"}
$ #HelpUndeletePattern
743 ^U = Undelete all messages with the specified pattern.
$ #NoIncludeFilename

--- 1345,1353 ----


$ #SortUnknown
740 *UNKNOWN-SORT-PARAMETER*
$ #EnterLastSelected
! 741 Enter: {"subject","to","from","cc","header"} [pattern] OR {"tagged","all",...}
$ #EnterSelected
! 742 Enter: {"subject","to","from","header"} [pattern] OR {"thread","tagged",...}
$ #HelpUndeletePattern
743 ^U = Undelete all messages with the specified pattern.
$ #NoIncludeFilename
***************

*** 1509,1520 ****
835 Warning: readmsginc is set to less than 1. Ignored.
$ #SleepMessageInvalid
836 Warning: sleepmsg is set to less than 0. Setting to 0.
! $ #VfyPromptPleaseChoose
! 837 Please choose one of the following options by parenthesized letter: s
! $ #VfyMenuUser0
! 838 e)dit message, edit h)eaders, s)end it, or f)orget it.
! $ #VfyPromptAndNow
! 839 And now: s
$quote "
$ #VfyMenuEditForm
840 "e)dit form, "
--- 1508,1519 ----
835 Warning: readmsginc is set to less than 1. Ignored.
$ #SleepMessageInvalid
836 Warning: sleepmsg is set to less than 0. Setting to 0.
! $ #VfyPromptSendTheMsg
! 837 Send the message now? y
! $ #VfyMenu1User0
! 838 Select letter of header to edit, 'e' to edit the message,
! $ #VfyMenu2User0
! 839 'a' to make attachments, 'y' to send message, or 'n' to cancel.
$quote "
$ #VfyMenuEditForm
840 "e)dit form, "
***************
*** 1523,1536 ****
$ #VfyMenuEditMsg
842 "e)dit message, "
$ #VfyMenuVfyCpy
! 843 "h)eaders, c)opy, "
$ #VfyMenuIspell
844 "i)spell, "
$ #VfyMenuShell
845 "!)shell, "
$quote
! $ #VfyMenuSndFgt
! 846 s)end, or f)orget
$ #VfyNoFieldsInForm
848 No fields in form!\007
$ #HelpViewAttach
--- 1522,1535 ----
$ #VfyMenuEditMsg
842 "e)dit message, "
$ #VfyMenuVfyCpy
! 843 "all h)eaders, a)ttachments, co(p)y, "
$ #VfyMenuIspell
844 "i)spell, "
$ #VfyMenuShell
845 "!)shell, "
$quote
! $ #VfyMenuForgetOr
! 846 f)orget, or:
$ #VfyNoFieldsInForm
848 No fields in form!\007
$ #HelpViewAttach
***************
*** 1570,1578 ****


$ #ErrorReading
866 Error reading from %.50s
$ #ErrorReadableUser
! 867 %.50s isn't readable by user!
$ #CantOpenAttach
! 868 Can't open attachment: %.50s
$ #InternalnoFD
869 Internal error: no parent fd!
$ #FailedSeekAttach

--- 1569,1577 ----


$ #ErrorReading
866 Error reading from %.50s
$ #ErrorReadableUser
! 867 %S isn't readable by user!
$ #CantOpenAttach
! 868 Can't open attachment: %S
$ #InternalnoFD
869 Internal error: no parent fd!
$ #FailedSeekAttach
***************

*** 1598,1604 ****


$ #CouldOpenReading
881 Could not open file for reading!
$ #StrucredNoEncoding
! 882 %.30s: Structured types don't allow encoding of data.
$ #NotKnowPrint
883 Don't know how to print this type of data!
$ #MailNotSaved

--- 1597,1603 ----


$ #CouldOpenReading
881 Could not open file for reading!
$ #StrucredNoEncoding
! 882 %S: Structured types don't allow encoding of data.
$ #NotKnowPrint
883 Don't know how to print this type of data!
$ #MailNotSaved
***************

*** 1639,1652 ****


901 Structured types must be encoded in leaf type!
$ #UnknownCommand2
902 Unknown command.
! $ #FileNotExist
! 903 That file %.20s does not exist!
! $ #CantStatFile
! 904 Could not stat file %.20s!
! $ #NotReadableByUser
! 905 %.50s isn't readable by user!
! $ #CheckingEncoding
! 906 Checking %s...
$ #CantOpenFile
907 Can't open %s!
$ #NoAttachments

--- 1638,1651 ----


901 Structured types must be encoded in leaf type!
$ #UnknownCommand2
902 Unknown command.
! $ #FileNotExistS
! 903 That file %S does not exist!
! $ #CantStatFileS
! 904 Could not stat file %S!
! $ #NotReadableByUserS
! 905 %S isn't readable by user!
! $ #CheckingEncodingS
! 906 Checking %S...
$ #CantOpenFile
907 Can't open %s!
$ #NoAttachments
***************

*** 1705,1712 ****


934 Header has 8BIT data and charset=US-ASCII, using charset=UNKNOWN-8BIT instead.
$ #HeaderBadCharset
935 Bad charset=%s, using charset=UNKNOWN-8BIT instead.
! $ #ErrorOpeningName
! 936 Error opening %s!
$ #ErrorWhenReading
937 Error when reading: %S
$ #FailedLeaveFolder

--- 1704,1711 ----


934 Header has 8BIT data and charset=US-ASCII, using charset=UNKNOWN-8BIT instead.
$ #HeaderBadCharset
935 Bad charset=%s, using charset=UNKNOWN-8BIT instead.
! $ #ErrorOpeningNameS
! 936 Error opening %S!
$ #ErrorWhenReading
937 Error when reading: %S
$ #FailedLeaveFolder
***************

*** 1819,1826 ****


$quote
$ #DbxCurrMsgNum
1005 Current message number = %d\t\t%d message(s) total\n
- $ #DbxHdrPage
- 1006 Header_page = %d \t\t%d possible page(s)\n
$ #DbxCurrMailFile
1007 \nCurrent mail file is %S.\n\r\n
$ #DbxPressAnyKey

--- 1818,1823 ----
***************
*** 2171,2178 ****


2094 "%2d Use '%s' to show %s/%s"
$ #Metamail
2095 "Metamail"
! $ #MailcapQuit
! 2096 "Answer questions, use m)etamail or q)uit menu: "
$ #TitleQuit
2097 "Elm: exiting"
$ #IconQuit

--- 2168,2175 ----


2094 "%2d Use '%s' to show %s/%s"
$ #Metamail
2095 "Metamail"
! $ #MailcapDone
! 2096 "Press enter for default or use y/n, use m)etamail or d)one: "
$ #TitleQuit
2097 "Elm: exiting"
$ #IconQuit
***************

*** 2230,2236 ****


$ #SearchingInMessageFound
2124 "Searching %d (%02d%%) FOUND"
$ #Level0PartLine2
! 2125 "d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, return to i)ndex"
$ #Level0PartLine3

2126 "To read a message, press <return>. j = move down, k = move up"
$ #Level1PartLine2
--- 2227,2233 ----


$ #SearchingInMessageFound
2124 "Searching %d (%02d%%) FOUND"
$ #Level0PartLine2

! 2125 "d)elete or u)ndelete mail, m)ail a message, r)eply mail, return to i)ndex"
$ #Level0PartLine3


2126 "To read a message, press <return>. j = move down, k = move up"
$ #Level1PartLine2
***************

*** 2250,2258 ****


$ #HdrEditComment
2134 "# Headers are automatically converted from %s charset and not need encoded\n"
$ #HdrEditCommentEnc
! 2135 "# MIME enconding of headers is supported\n"
$ #HdrEditCommentNo
! 2136 "# MIME enconding of headers is NOT supported\n"
$ #HdrNotSupported
2137 "Editing of %s header is not supported."
$ #HdrGarbage

--- 2247,2255 ----


$ #HdrEditComment
2134 "# Headers are automatically converted from %s charset and not need encoded\n"
$ #HdrEditCommentEnc
! 2135 "# MIME encoding of headers is supported\n"
$ #HdrEditCommentNo
! 2136 "# MIME encoding of headers is NOT supported\n"
$ #HdrNotSupported
2137 "Editing of %s header is not supported."
$ #HdrGarbage
***************

*** 2343,2355 ****
2176 'Also available: d)elete, u)ndelete, i)ndex'
$ #VfyMessageKept1
2177 'Message kept. Can be restored at next m)ail command.'
$ #FailedUserRC
! 2178 'Failed to open RC file %s: %s'
$ #ArgsNoFileBatch
! 2179 'Must specify a recipient in batch mode.'
$ #MagicOn
! 2180 '[Magic On]'
$ #MagicOff
! 2191 '[Magic Off]'
$ #ChangeMailbox
! 2192 'Change mailbox'
--- 2340,2419 ----
2176 'Also available: d)elete, u)ndelete, i)ndex'
$ #VfyMessageKept1
2177 'Message kept. Can be restored at next m)ail command.'
+ $ #ShownXNoSelectItem
+ 2178 %S with %d %S
+ $ #MailcapPage
+ 2179 'Press enter for default, use m)etamail or p)age mail: '
+ $quote "
+ $ #MetamailMenu1
+ 2180 "Viewing of this message requires metamail. Press 'm' to select metamail."
+ $ #MetamailMenu2
+ 2181 "Or you can p)age message without metamail."
+ $ #MetamailMenu
+ 2182 "Metamail selection"
+ $ #MailcapMenu1
+ 2183 "Viewing of this message requires external programs (press 'y' to confirm.)"
+ $ #MailcapMenu2
+ 2184 "To refuse external program press 'n'. Also you can page message with m)etamail."
+ $ #Done
+ 2185 "Done"
+ $ #ShownTitleNoMailbox
+ 2186 "No mailbox"
+ $ #NoItemToFlag
+ 2187 "No %S to flag!"
+ $ #LimitReturnToLastSelection
+ 2188 "Returned to last selection."
+ $ #ReverseUnstable
+ 2189 "(SPACE, R)everse or U)nstable)"
+ $ #PadUnsThread
+ 2190 "Unstable Reverse Thread "
+ $ #AbrUnsThread
+ 2191 "(Unstable) Reverse-Thread"
+ $ #LongUnsThread
+ 2192 "Unstable Reverse Thread"
+ $quote '
+ $ #BadLineInElmrc
+ 2193 'Keyword "%s" without = -character in line %d in "%s" file'
+ $ #DomainUnknown
+ 2194 'Domain %s of address %S is unknown'
+ $ #VerifyNot
+ 2195 'Unable to verify mail address %S'
+ $quote
+ $ #VerifyBad
+ 2196 Address %S is not e-mail address or Elm's alias
+ $ #VerifyBad1
+ 2197 Address %s is not e-mail address
+ $ #VerifyNot1
+ 2198 Unable to verify mail address %s
+ $ #ErrorReadingS
+ 2199 Error reading from %S
+ $ #CantOpenFileS
+ 2200 Can't open %S!
+ $ #FailErrnoS
+ 2201 Failed: %S: %.40s
+ $ #ArgsBadZoption
+ 2202 Option -z incompatible with given other options.
+ $ #ArgsBadYoption
+ 2203 Option -y incompatible with given other options.
+ $ #NoUnreadMail
+ 2204 You have no unread mail.
$ #FailedUserRC
! 2205 Failed to open RC file %s: %s
$ #ArgsNoFileBatch
! 2206 Must specify a recipient in batch mode.
$ #MagicOn
! 2207 [Magic On]
$ #MagicOff
! 2208 [Magic Off]
$ #ChangeMailbox
! 2209 Change mailbox
! $ #VfyMenuDSN
! 2210 D)SN
! $ #VfyMenuPGP
! 2211 P)gp
! $ #VfyPromptSendMessage
! 2212 Send message now? y
! $quote "
! $ #VfySelectLetter
! 2213 "Select letter of header to edit, "
!
Index: elmME+.2.5.alpha5-cvs/nls/C/C/C/s_elmrc.m
*** elmME+.2.5.alpha4/nls/C/C/C/s_elmrc.m 2003-05-28 21:49:27.000000000 +0300
--- elmME+.2.5.alpha5-cvs/nls/C/C/C/s_elmrc.m 2005-07-20 19:49:45.000000000 +0300
***************

! 16 # Saved automatically by %s %s for %s\n#\n\n
Index: elmME+.2.5.alpha5-cvs/nls/C/C/C/s_me.m
*** elmME+.2.5.alpha4/nls/C/C/C/s_me.m 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/nls/C/C/C/s_me.m 2005-07-20 19:49:45.000000000 +0300
***************

Index: elmME+.2.5.alpha5-cvs/OBSOLETE
*** elmME+.2.5.alpha4/OBSOLETE 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/OBSOLETE 2005-07-20 19:49:33.000000000 +0300
***************
*** 56,58 ****
--- 56,68 ----
doc/elm-help.2
doc/elm-help.3
hdrs/elmutil.h


+ lib/add_site.c
+ lib/strtokq.c
+ lib/mailer.c
+ doc/tmac.n

+ 2.4/doc/Alias.guide
+ 2.4/doc/Config.guid
+ 2.4/doc/Elm.cover
+ 2.4/doc/Form.guide
+ 2.4/doc/Ref.guide
+ 2.4/doc/Users.guide
Index: elmME+.2.5.alpha5-cvs/shared_libs/iconv/iconv.c
*** elmME+.2.5.alpha4/shared_libs/iconv/iconv.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/shared_libs/iconv/iconv.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: iconv.c,v 1.12 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: iconv.c,v 1.12.8.3 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 24,32 ****
#endif

/* UCS-2BE = UCS-2 big endian */
! static CONST char * UNICODE = "UCS-2BE";

! static CONST char * alternative[] = { "UCS-2", "UCS-2BE", NULL };

#define RAW_OVERHEAD 128
#define RAW_PER_UNICODE 8
--- 24,32 ----
#endif

/* UCS-2BE = UCS-2 big endian */
! static const char * UNICODE = "UCS-2BE";

! static const char * alternative[] = { "UCS-2", "UCS-2BE", NULL };

#define RAW_OVERHEAD 128
#define RAW_PER_UNICODE 8
***************
*** 86,105 ****

/* Gnu LIBICONV uses const, IRIX 6.5 does not use const on argument ...
*/
! #if _LIBICONV_VERSION
! #define GNUIconst CONST
#elif __GLIBC__ == 2 && __GLIBC_MINOR__ < 2
/* - Also GNU libc 2.x uses const on argument
- GNU libc 2.2 no longer uses const for iconv(3) args
*/
! #define GNUIconst CONST
#else
#define GNUIconst
#endif

static void convert_to_raw P_((const struct string *str));
static void convert_to_raw(str)


! CONST struct string *str;
{

uint16 *words;
int w_len;
--- 86,105 ----

/* Gnu LIBICONV uses const, IRIX 6.5 does not use const on argument ...
*/
! #if defined(_LIBICONV_VERSION)
! #define GNUIconst const
#elif __GLIBC__ == 2 && __GLIBC_MINOR__ < 2
/* - Also GNU libc 2.x uses const on argument
- GNU libc 2.2 no longer uses const for iconv(3) args
*/
! #define GNUIconst const
#else
#define GNUIconst
#endif

static void convert_to_raw P_((const struct string *str));
static void convert_to_raw(str)


! const struct string *str;
{

uint16 *words;
int w_len;
***************
*** 229,235 ****

static void convert_to_unicode P_((const struct string *str));
static void convert_to_unicode(str)


! CONST struct string *str;
{

unsigned char *bytes;
int b_len;
--- 229,235 ----

static void convert_to_unicode P_((const struct string *str));
static void convert_to_unicode(str)


! const struct string *str;
{

unsigned char *bytes;
int b_len;
***************
*** 429,435 ****
*/
S_(cs_check_length_string cs_check_length_iconv)
static void cs_check_length_iconv(str)


! CONST struct string *str;
{

/* First convert to unicode so length is correctly expressed
in terms of characters (instead of terms of bytes)
--- 429,435 ----
*/
S_(cs_check_length_string cs_check_length_iconv)
static void cs_check_length_iconv(str)


! const struct string *str;
{

/* First convert to unicode so length is correctly expressed
in terms of characters (instead of terms of bytes)


***************
*** 490,497 ****

S_(cs_cmp_string cs_cmp_iconv)
static int cs_cmp_iconv(str1,str2)

! struct string *str1;
! struct string *str2;
{

int i;

--- 490,497 ----

S_(cs_cmp_string cs_cmp_iconv)
static int cs_cmp_iconv(str1,str2)

! const struct string *str1;
! const struct string *str2;
{

int i;

***************
*** 521,527 ****

S_(cs_stream_from_string cs_stream_from_iconv)
static unsigned char * cs_stream_from_iconv(str,printable,terminal,reslen)


! CONST struct string *str;
int printable;
screen_info_p terminal;

int *reslen;
--- 521,527 ----

S_(cs_stream_from_string cs_stream_from_iconv)
static unsigned char * cs_stream_from_iconv(str,printable,terminal,reslen)


! const struct string *str;
int printable;
screen_info_p terminal;

int *reslen;
***************
*** 661,667 ****

S_(cs_can_ascii_string cs_can_ascii_iconv)
static int cs_can_ascii_iconv(str)


! CONST struct string *str;
{

int i;

--- 661,667 ----

S_(cs_can_ascii_string cs_can_ascii_iconv)
static int cs_can_ascii_iconv(str)


! const struct string *str;
{

int i;

***************
*** 678,684 ****

S_(cs_streamclip_from_string cs_streamclip_from_iconv)
static unsigned char * cs_streamclip_from_iconv(str,pos,len,terminal,printable_len)


! CONST struct string *str;
int *pos;
int len;

screen_info_p terminal; /* NOT USED */

--- 678,684 ----

S_(cs_streamclip_from_string cs_streamclip_from_iconv)
static unsigned char * cs_streamclip_from_iconv(str,pos,len,terminal,printable_len)


! const struct string *str;
int *pos;
int len;

screen_info_p terminal; /* NOT USED */
***************

*** 858,865 ****

S_(cs_find_pattern_from_string cs_find_pattern_from_iconv)
static int cs_find_pattern_from_iconv(str,pattern,ignore_case)


! CONST struct string *str;
! CONST struct string *pattern;
int ignore_case;
{

DPRINT(Debug,63,(&Debug,
--- 858,865 ----

S_(cs_find_pattern_from_string cs_find_pattern_from_iconv)
static int cs_find_pattern_from_iconv(str,pattern,ignore_case)


! const struct string *str;
! const struct string *pattern;
int ignore_case;
{

DPRINT(Debug,63,(&Debug,

***************
*** 868,877 ****
}

S_(cs_add_streambytes_to_string cs_add_streambytes_to_iconv)
! static int cs_add_streambytes_to_iconv(str,count,data)

struct string *str;
int count;

const unsigned char *data;
{
#if 0
/* We not currently use state for checking encoding ... */
--- 868,878 ----
}

S_(cs_add_streambytes_to_string cs_add_streambytes_to_iconv)
! static int cs_add_streambytes_to_iconv(str,count,data,errors)

struct string *str;
int count;

const unsigned char *data;
+ int *errors;

{
#if 0
/* We not currently use state for checking encoding ... */
***************
*** 883,888 ****

--- 884,891 ----
panic("STRING PANIC",__FILE__,__LINE__,"cs_add_streambytes_to_iconv",


"Negative length",0);

+ *errors = 0;
+

if (str->p->private_flag)
convert_to_raw(str);

***************

*** 913,919 ****

S_(cs_find_map_type cs_find_iconv)
static struct map_info *cs_find_iconv(map_name)


! CONST char * map_name;
{

static struct map_info **genmaps = NULL;
static int genmap_count = 0;
--- 916,922 ----

S_(cs_find_map_type cs_find_iconv)
static struct map_info *cs_find_iconv(map_name)


! const char * map_name;
{

static struct map_info **genmaps = NULL;
static int genmap_count = 0;
***************
*** 970,976 ****

S_(cs_remove_control cs_remove_control_iconv)
static void cs_remove_control_iconv(str)


! CONST struct string *str;
{

int i;
/* Convert to unicode so that we do not remove control
--- 973,979 ----

S_(cs_remove_control cs_remove_control_iconv)
static void cs_remove_control_iconv(str)


! const struct string *str;
{

int i;
/* Convert to unicode so that we do not remove control


***************
*** 999,1006 ****
if (str->p->private_flag) {
/* Add unicode value */

- if (ch->p->a.g1->unicode_value > 0xFFFF)
- return;

/* NOTE: str->p->a.words is not NUL terminated */
str->p->a.words = safe_realloc(str->p->a.words,
--- 1002,1007 ----
***************

*** 1264,1270 ****



S_(cs_estimate_clip_string cs_estimate_clip_unsupported)
static int cs_estimate_clip_unsupported(str,pos,len,terminal,printable_len)

! CONST struct string *str;
int pos;
int len; /* UPPER LIMIT */
screen_info_p terminal;

--- 1265,1271 ----



S_(cs_estimate_clip_string cs_estimate_clip_unsupported)
static int cs_estimate_clip_unsupported(str,pos,len,terminal,printable_len)

! const struct string *str;
int pos;
int len; /* UPPER LIMIT */
screen_info_p terminal;
***************

*** 1354,1360 ****
CS_auto_charset_f CS_auto_charset;
#endif
int CS_auto_charset(name,type,map)
! CONST char *name;


struct charset_type **type;
struct map_info **map;
{

--- 1355,1361 ----
CS_auto_charset_f CS_auto_charset;
#endif
int CS_auto_charset(name,type,map)
! const char *name;


struct charset_type **type;
struct map_info **map;
{
***************

*** 1378,1384 ****


static ZZZ_SAVE_TYPE save_info_data[] = {
! { "auto-charset", -1L, ZZZ_DT_BOL(&auto_charset), 0, NULL },
};

#if ANSI_C
--- 1379,1385 ----


static ZZZ_SAVE_TYPE save_info_data[] = {
! { "auto-charset", ZZZ_DT_BOL(&auto_charset), 0 },
};

#if ANSI_C

Index: elmME+.2.5.alpha5-cvs/shared_libs/iconv/Makefile.SH
*** elmME+.2.5.alpha4/shared_libs/iconv/Makefile.SH 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/shared_libs/iconv/Makefile.SH 2005-07-20 19:49:45.000000000 +0300
***************


*** 17,23 ****
echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.8.22.2 2004/09/25 10:14:33 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----


echo "Extracting shared_libs/iconv/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.8.22.3 2005/07/20 16:49:45 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************
*** 25,31 ****
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = $shlib/libelmme-iconv.so$d_shared_rev
AR = ar
CC = $cc

CCFLAGS = $ccflags $picflag $xencf

--- 25,31 ----
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-iconv.so$d_shared_rev
AR = ar
CC = $cc

CCFLAGS = $ccflags $picflag $xencf

***************
*** 36,42 ****
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister
!GROK!THIS!

A=
--- 36,42 ----
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister -M iconv
!GROK!THIS!

A=

Index: elmME+.2.5.alpha5-cvs/shared_libs/Makefile.SH
*** elmME+.2.5.alpha4/shared_libs/Makefile.SH 2004-01-24 13:51:43.000000000 +0200
--- elmME+.2.5.alpha5-cvs/shared_libs/Makefile.SH 2005-07-20 19:49:45.000000000 +0300
***************


*** 17,23 ****
echo "Extracting shared_libs/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.14 2004/01/24 11:06:02 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.

--- 17,23 ----


echo "Extracting shared_libs/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.14.22.1 2005/07/20 16:49:45 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
Index: elmME+.2.5.alpha5-cvs/shared_libs/smtp/config
*** elmME+.2.5.alpha4/shared_libs/smtp/config 2002-01-26 13:15:59.000000000 +0200
--- elmME+.2.5.alpha5-cvs/shared_libs/smtp/config 2005-07-20 19:49:45.000000000 +0300
***************


*** 4,19 ****
smtp_ok=''

if $test "$d_netdb" = "$define" ; then
! if $test $d_dynamic_main = "$define" ; then
! smtp_ok="$define"
! else
! $cat <<EOM
! Unable to found how resolve mail program symbols from dynamic libary,
! therefore SMTP is not available...
!
! EOM
! smtp_ok="$undef"
! fi
else
$echo "No <netdb.h> therefore SMTP is not available..."
smtp_ok="$undef"
--- 4,10 ----
smtp_ok=''

if $test "$d_netdb" = "$define" ; then
! smtp_ok="$define"
else
$echo "No <netdb.h> therefore SMTP is not available..."
smtp_ok="$undef"

Index: elmME+.2.5.alpha5-cvs/shared_libs/smtp/elmsmtp.h
*** elmME+.2.5.alpha4/shared_libs/smtp/elmsmtp.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/shared_libs/smtp/elmsmtp.h 2005-07-20 19:49:45.000000000 +0300
***************
*** 1,13 ****
! /* $Id: elmsmtp.h,v 1.8 2004/03/27 18:31:43 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

#include "elmshared.h"

#include "../../hdrs/mailer_imp.h"
#include "../../hdrs/mbx_imp.h"
#include "../../hdrs/ss_imp.h"
--- 1,14 ----

! /* $Id: elmsmtp.h,v 1.8.8.1 2005/07/20 16:49:45 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

#include "elmshared.h"

+ #include "../../hdrs/mailerlib.h"
#include "../../hdrs/mailer_imp.h"
#include "../../hdrs/mbx_imp.h"
#include "../../hdrs/ss_imp.h"

Index: elmME+.2.5.alpha5-cvs/shared_libs/smtp/Makefile.SH
*** elmME+.2.5.alpha4/shared_libs/smtp/Makefile.SH 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/shared_libs/smtp/Makefile.SH 2005-07-20 19:49:45.000000000 +0300
***************
*** 13,23 ****


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;

esac


echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.12.22.2 2004/09/25 10:14:33 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 13,40 ----

*/*) cd `expr X$0 : 'X\(.*\)/'` ;;

esac

+ # libelmme-smtp.so my be loaded with program, which do not have
+ # linked with libelmme-mailer.so. On that case loading failed
+ # with unresolved symbols. Therefore we link libelmme-smtp.so
+ # with libelmme-mailer.so. If loading program is linked with
+ # libelmme-smtp.so, that do not cause that libelmme-mailer.so
+ # is linked twice on run time.
+ #
+ libxs="../../shlib/libelmme-mailer.so"
+
+ # If it is not possible to resolve mail program symbols from
+ # dynamic library, link libelmme-smtp.so with libelmme-base.so
+

+ if $test $d_dynamic_main = "$define" ; then
+ :

+ else
+ libxs="$libxs ../../shlib/libelmme-base.so"
+ fi

echo "Extracting shared_libs/smtp/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.12.22.3 2005/07/20 16:49:45 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************
*** 25,31 ****

# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = $shlib/libelmme-smtp.so$d_shared_rev
AR = ar
CC = $cc

CCFLAGS = $ccflags $picflag $xencf

--- 42,48 ----
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-smtp.so$d_shared_rev
AR = ar
CC = $cc

CCFLAGS = $ccflags $picflag $xencf

***************
*** 36,42 ****
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister
!GROK!THIS!

A=
--- 53,60 ----
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! LIBXS = $libxs
! REG = ../../bin/elmregister -M smtp
!GROK!THIS!

A=
***************

*** 91,97 ****


clean:

elmsmtp.h: $(INCLDIR)/elmshared.h ../../hdrs/mailer_imp.h \
! ../../hdrs/mbx_imp.h ../../hdrs/ss_imp.h ../../hdrs/mime.h

$(CHMOD) u+w $@
$(TOUCH) $@

--- 109,116 ----


clean:

elmsmtp.h: $(INCLDIR)/elmshared.h ../../hdrs/mailer_imp.h \
! ../../hdrs/mbx_imp.h ../../hdrs/ss_imp.h ../../hdrs/mime.h \
! ../../hdrs/mailer_imp.h

$(CHMOD) u+w $@
$(TOUCH) $@

***************
*** 101,110 ****


$(AR) r $@ $?
$(RANLIB) $@

! ../../shlib/libelmme-smtp.so: $(OBJS)
! $(CC) $(CCFLAGS) $(SONAME) -o $@ $(OBJS)

$(INSTLIB): ../../shlib/libelmme-smtp.so


$(REG) copy -m 444 $? $@

!NO!SUBS!
--- 120,138 ----


$(AR) r $@ $?
$(RANLIB) $@

! ../../shlib/libelmme-smtp.so: $(OBJS) $(LIBXS)
! $(CC) $(CCFLAGS) $(SONAME) -o $@ $(OBJS) $(LIBXS)

$(INSTLIB): ../../shlib/libelmme-smtp.so


$(REG) copy -m 444 $? $@

!NO!SUBS!
+
+ for i in $libxs
+ do
+ y="`echo $i|$sed 's%^../../%%'`"
+ cat >>Makefile <<!SUBS!
+ $i:
+ cd ../..; \$(MAKE) \$(MJ) \$(MFLAGS) $y
+ !SUBS!
+ done

Index: elmME+.2.5.alpha5-cvs/shared_libs/smtp/smtp.c
*** elmME+.2.5.alpha4/shared_libs/smtp/smtp.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha5-cvs/shared_libs/smtp/smtp.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: smtp.c,v 1.42.8.1 2004/05/23 16:24:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: smtp.c,v 1.42.8.5 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 259,268 ****
(I->SMTP_flags & SMTP_submission) ?
"submission" : "SMTP");
close_it = 1;
}
}

- check_read:
if (n == 0) {
lib_error(FRM("Connection closed to %s server"),
(I->SMTP_flags & SMTP_submission) ? "submission" : "SMTP");
--- 259,271 ----
(I->SMTP_flags & SMTP_submission) ?
"submission" : "SMTP");
close_it = 1;


+ break;
+
+ default:
+ break;
}
}

if (n == 0) {
lib_error(FRM("Connection closed to %s server"),
(I->SMTP_flags & SMTP_submission) ? "submission" : "SMTP");
***************
*** 552,558 ****

static int smtp_push_data(I,data,len,is_data_line)
struct mailer_info_1 *I;
! CONST char *data;
int len;
int is_data_line;
{
--- 555,561 ----

static int smtp_push_data(I,data,len,is_data_line)
struct mailer_info_1 *I;
! const char *data;
int len;
int is_data_line;
{
***************
*** 564,570 ****

if (smtp_error == I->state ||
smtp_closing == I->state) {
! failure:
if (I->RA.stream ) {
DPRINT(Debug,12,(&Debug,
"smtp_push_data: Closing stream\n"));
--- 567,573 ----

if (smtp_error == I->state ||
smtp_closing == I->state) {
!
if (I->RA.stream ) {
DPRINT(Debug,12,(&Debug,
"smtp_push_data: Closing stream\n"));
***************
*** 624,630 ****
static void smtp_command_arg P_((struct mailer_info_1 *I, const char *str));
static void smtp_command_arg(I, str)
struct mailer_info_1 *I;
! CONST char *str;
{
int L = strlen(str);

--- 627,633 ----
static void smtp_command_arg P_((struct mailer_info_1 *I, const char *str));
static void smtp_command_arg(I, str)
struct mailer_info_1 *I;
! const char *str;
{
int L = strlen(str);

***************
*** 1082,1088 ****
SMTP_submission) ?
"Submission" : "SMTP",
response_code,r);
! while (r = smtp_command_response((*C)->head->p.p1,&idx)) {
lib_error(FRM("%s server: %s"),
((*C)->head->p.p1->SMTP_flags &
SMTP_submission) ?
--- 1085,1093 ----
SMTP_submission) ?
"Submission" : "SMTP",
response_code,r);
! while (NULL != (r =
! smtp_command_response((*C)->head->p.p1,
! &idx))) {
lib_error(FRM("%s server: %s"),
((*C)->head->p.p1->SMTP_flags &
SMTP_submission) ?
***************
*** 1180,1186 ****
"Submission" : "SMTP",
(*C)->addrs[i],
response_code,r);
! while (r = smtp_command_response((*C)->head->p.p1,&idx)) {
lib_error(FRM("%s server: %s"),
((*C)->head->p.p1->SMTP_flags &
SMTP_submission) ?
--- 1185,1193 ----
"Submission" : "SMTP",
(*C)->addrs[i],
response_code,r);
! while (NULL != (r =
! smtp_command_response((*C)->head->p.p1,
! &idx))) {
lib_error(FRM("%s server: %s"),
((*C)->head->p.p1->SMTP_flags &
SMTP_submission) ?
***************
*** 1259,1266 ****
* (but here should not be other \r or \n than \r\n)
*/

! while (l = mail_gets(buffer,sizeof buffer,
! out_state_FILE(&((*C)->OUT)))) {

if (!smtp_push_data((*C)->head->p.p1,buffer,l,1))
break;
--- 1266,1273 ----
* (but here should not be other \r or \n than \r\n)
*/

! while (0 < (l = mail_gets(buffer,sizeof buffer,
! out_state_FILE(&((*C)->OUT))))) {

if (!smtp_push_data((*C)->head->p.p1,buffer,l,1))
break;
***************
*** 1288,1294 ****
SMTP_submission) ?
"Submission" : "SMTP",
response_code,r);
! while (r = smtp_command_response((*C)->head->p.p1,&idx)) {
lib_error(FRM("%s server: %s"),
((*C)->head->p.p1->SMTP_flags &
SMTP_submission) ?
--- 1295,1303 ----
SMTP_submission) ?
"Submission" : "SMTP",
response_code,r);
! while (NULL != (r =
! smtp_command_response((*C)->head->p.p1,
! &idx))) {
lib_error(FRM("%s server: %s"),
((*C)->head->p.p1->SMTP_flags &
SMTP_submission) ?
***************
*** 1335,1340 ****
--- 1344,1350 ----


struct mailer_info *I;
{
FILE * F;
+ char *tmp;

if (C->magic != MAILER_magic)

panic("MAILER PANIC",__FILE__,__LINE__,"smtp_common_mailer_init",
***************
*** 1345,1350 ****
--- 1355,1364 ----
return 0;


}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ return 0;
+
if (I->p.p1->SMTP_flags & SMTP_reserve) {
panic("MAILER PANIC",__FILE__,__LINE__,
"smtp_common_mailer_init",
***************
*** 1360,1366 ****
}


! C->fname = tempnam(temp_dir, "snd.");
if (!C->fname) {
DPRINT(Debug,1,(&Debug,
"couldn't make temp file nam! (mail)\n"));

--- 1374,1380 ----


}


! C->fname = tempnam(tmp, "snd.");
if (!C->fname) {
DPRINT(Debug,1,(&Debug,
"couldn't make temp file nam! (mail)\n"));

***************
*** 1376,1385 ****
DPRINT(Debug,1, (&Debug,


"Attempt to open file %s for writing failed! (write_header_info)\n",

C->fname));
! DPRINT(Debug,1, (&Debug, "** %s **\n\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorTryingToWrite,
"Error %s encountered trying to write to %s."),
! error_description(err), C->fname);

return 0;
}
--- 1390,1399 ----
DPRINT(Debug,1, (&Debug,


"Attempt to open file %s for writing failed! (write_header_info)\n",

C->fname));
! DPRINT(Debug,1, (&Debug, "** %s **\n\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorTryingToWrite,
"Error %s encountered trying to write to %s."),
! strerror(err), C->fname);

return 0;
}
***************
*** 1411,1416 ****
--- 1425,1432 ----
"smtp_common_mailer_close: OH NO -- middle of data transfer\n"));
C->head->p.p1->state = smtp_error;


break;
+ default:
+ break;
}

if (smtp_start_command(C->head->p.p1,"RSET")) {
***************
*** 1471,1477 ****
static int smtp_tail_verify_addr(M,I,text,result)
struct mailer_config *M;
struct mailer_info *I;
! CONST char *text;
struct addr_item *result;
{
int i;
--- 1487,1493 ----
static int smtp_tail_verify_addr(M,I,text,result)
struct mailer_config *M;
struct mailer_info *I;
! const char *text;
struct addr_item *result;
{
int i;
***************
*** 1591,1597 ****
struct mailer_config *M;
struct mailer_info *I;
struct mailer_env_from *X;
! CONST char *value;
{


if (0 == strcmp(value,"<>")) {

/* Null envelope sender is only valid as sender (not as recipient)

--- 1607,1613 ----
struct mailer_config *M;
struct mailer_info *I;
struct mailer_env_from *X;
! const char *value;
{


if (0 == strcmp(value,"<>")) {

/* Null envelope sender is only valid as sender (not as recipient)

***************
*** 1978,1984 ****
static int submission_mailer_info_verify_addr(M,I,text,result)
struct mailer_config *M;
struct mailer_info *I;
! CONST char *text;
struct addr_item *result;
{
if (!submission_verify_address) {
--- 1994,2000 ----
static int submission_mailer_info_verify_addr(M,I,text,result)
struct mailer_config *M;
struct mailer_info *I;
! const char *text;
struct addr_item *result;
{
if (!submission_verify_address) {
***************
*** 2052,2058 ****
struct mailer_config *M;
struct mailer_info *I;
{
! CONST char * argv[3];
char response_code[3];

int options = SY_ENV_SHELL | SY_NOTTY;
--- 2068,2074 ----
struct mailer_config *M;
struct mailer_info *I;
{
! const char * argv[3];
char response_code[3];

int options = SY_ENV_SHELL | SY_NOTTY;
***************
*** 2074,2080 ****
if (-1 == r) {
int err = errno;
lib_error(FRM("socketpair failed: %s"),
! error_description(err));

free(I->p.p1);
I->p.p1 = NULL;
--- 2090,2096 ----
if (-1 == r) {
int err = errno;
lib_error(FRM("socketpair failed: %s"),
! strerror(err));

free(I->p.p1);
I->p.p1 = NULL;
***************
*** 2097,2103 ****
if (I->p.p1->RS.save_errno)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
"Failed: %.30s: %.40s"),
! argv[0],error_description(I->p.p1->RS.save_errno));
else
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStart,


"Can't start %.30s"),

--- 2113,2119 ----
if (I->p.p1->RS.save_errno)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
"Failed: %.30s: %.40s"),
! argv[0],strerror(I->p.p1->RS.save_errno));
else
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantStart,


"Can't start %.30s"),

***************
*** 2128,2134 ****
int err = errno;
DPRINT(Debug,12,(&Debug,
"sendmailbs_mailer_info_init: fcntl [O_NONBLOCK] failed: %s\n",
! error_description(err)));
}

I->p.p1->RA.stream = returnSimpleStream(pair[0]);
--- 2144,2150 ----
int err = errno;
DPRINT(Debug,12,(&Debug,
"sendmailbs_mailer_info_init: fcntl [O_NONBLOCK] failed: %s\n",
! strerror(err)));
}

I->p.p1->RA.stream = returnSimpleStream(pair[0]);
***************
*** 2308,2314 ****
static int sendmailbs_mailer_info_verify_addr(M,I,text,result)
struct mailer_config *M;
struct mailer_info *I;
! CONST char *text;
struct addr_item *result;
{
if (!sendmailbs_verify_address) {
--- 2324,2330 ----
static int sendmailbs_mailer_info_verify_addr(M,I,text,result)
struct mailer_config *M;
struct mailer_info *I;
! const char *text;
struct addr_item *result;
{
if (!sendmailbs_verify_address) {
Index: elmME+.2.5.alpha5-cvs/shared_libs/tls/elmtls.h
*** elmME+.2.5.alpha4/shared_libs/tls/elmtls.h 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/shared_libs/tls/elmtls.h 2005-07-20 21:21:34.000000000 +0300


***************
*** 1,18 ****
! /* $Id: elmtls.h,v 1.17 2004/03/27 18:31:43 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

- #include "elmshared.h"
-
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/rand.h>

#ifdef REMOTE_MBX

extern struct stream_type TLS_STREAM;
--- 1,20 ----

! /* $Id: elmtls.h,v 1.17.8.1 2005/07/20 18:21:34 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.17.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/rand.h>

+
+ #include "elmshared.h"
+
+
#ifdef REMOTE_MBX

extern struct stream_type TLS_STREAM;

Index: elmME+.2.5.alpha5-cvs/shared_libs/tls/Makefile.SH
*** elmME+.2.5.alpha4/shared_libs/tls/Makefile.SH 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/shared_libs/tls/Makefile.SH 2005-07-20 19:49:45.000000000 +0300
***************


*** 17,23 ****
echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.16.22.2 2004/09/25 10:14:33 hurtta Exp $
#
#
# Makefile for the ELM (ME+) mail program.
--- 17,23 ----


echo "Extracting shared_libs/tls/Makefile (with variable substitutions)"

$cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.16.22.3 2005/07/20 16:49:45 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************
*** 25,31 ****

# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = $shlib/libelmme-tls.so$d_shared_rev
AR = ar
CC = $cc

CCFLAGS = $ccflags $picflag $xencf

--- 25,31 ----
# Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
#
#
! INSTLIB = \$(ELM_ROOT)//$shlib/libelmme-tls.so$d_shared_rev
AR = ar
CC = $cc

CCFLAGS = $ccflags $picflag $xencf

***************
*** 36,42 ****
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister
!GROK!THIS!

A=
--- 36,42 ----
RANLIB = $ranlib
TOUCH = $touch
CHMOD = $chmod
! REG = ../../bin/elmregister -M tls
!GROK!THIS!

A=

Index: elmME+.2.5.alpha5-cvs/shared_libs/tls/tls.c
*** elmME+.2.5.alpha4/shared_libs/tls/tls.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/shared_libs/tls/tls.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: tls.c,v 1.32 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: tls.c,v 1.32.8.3 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 100,106 ****
if (0 != err) {
/* Error message? */
lib_error(FRM("TLS random file %s not writable: %s"),
! raw_rand_file,error_description(err));

(*errors)++;

--- 100,106 ----
if (0 != err) {
/* Error message? */
lib_error(FRM("TLS random file %s not writable: %s"),
! raw_rand_file,strerror(err));

(*errors)++;

***************
*** 137,143 ****
wants_rand_bits_f wants_rand_bits;
#endif
void wants_rand_bits(buf,size,entropy_bits)


! CONST char *buf;
int size;
int entropy_bits;
{

--- 137,143 ----
wants_rand_bits_f wants_rand_bits;
#endif
void wants_rand_bits(buf,size,entropy_bits)


! const char *buf;
int size;
int entropy_bits;
{
***************

*** 353,364 ****
int err1 = errno;
DPRINT(Debug,13,(&Debug,
" ... read error %s (errno %d)\n",
! error_description(err1),err1));

if (err1 != EINTR && err1 != EAGAIN &&
err1 != EWOULDBLOCK) {


ss->error_state = strmcpy(ss->error_state,

! error_description(err1));
}
}
} else if (0 == n) {
--- 353,364 ----
int err1 = errno;
DPRINT(Debug,13,(&Debug,
" ... read error %s (errno %d)\n",
! strerror(err1),err1));

if (err1 != EINTR && err1 != EAGAIN &&
err1 != EWOULDBLOCK) {


ss->error_state = strmcpy(ss->error_state,

! strerror(err1));
}
}
} else if (0 == n) {
***************
*** 477,488 ****
int err1 = errno;
DPRINT(Debug,13,(&Debug,
" ... write error %s (errno %d)\n",
! error_description(err1),err1));

if (err1 != EINTR && err1 != EAGAIN &&
err1 != EWOULDBLOCK) {


ss->error_state = strmcpy(ss->error_state,

! error_description(err1));
}
}
}
--- 477,488 ----
int err1 = errno;
DPRINT(Debug,13,(&Debug,
" ... write error %s (errno %d)\n",
! strerror(err1),err1));

if (err1 != EINTR && err1 != EAGAIN &&
err1 != EWOULDBLOCK) {


ss->error_state = strmcpy(ss->error_state,

! strerror(err1));
}
}
}
***************
*** 594,600 ****

if (0 != err) {
lib_error(FRM("TLS random file %s not writable: %s"),
! raw_rand_file,error_description(err));

strfcpy(raw_rand_file,"none", sizeof raw_rand_file);
strfcpy(rand_file,"none", sizeof rand_file);
--- 594,600 ----

if (0 != err) {
lib_error(FRM("TLS random file %s not writable: %s"),
! raw_rand_file,strerror(err));

strfcpy(raw_rand_file,"none", sizeof raw_rand_file);
strfcpy(rand_file,"none", sizeof rand_file);
***************
*** 1048,1059 ****
int err1 = errno;
DPRINT(Debug,13,(&Debug,
" ... write error %s (errno %d)\n",
! error_description(err1),err1));

if (err1 != EINTR && err1 != EAGAIN &&
err1 != EWOULDBLOCK) {


ss->error_state = strmcpy(ss->error_state,

! error_description(err1));
}
}
}
--- 1048,1059 ----
int err1 = errno;
DPRINT(Debug,13,(&Debug,
" ... write error %s (errno %d)\n",
! strerror(err1),err1));

if (err1 != EINTR && err1 != EAGAIN &&
err1 != EWOULDBLOCK) {


ss->error_state = strmcpy(ss->error_state,

! strerror(err1));
}
}
}
***************
*** 1190,1201 ****
int err1 = errno;
DPRINT(Debug,13,(&Debug,
" ... write error %s (errno %d)\n",
! error_description(err1),err1));

if (err1 != EINTR && err1 != EAGAIN &&
err1 != EWOULDBLOCK) {


ss->error_state = strmcpy(ss->error_state,

! error_description(err1));
}
}
}
--- 1190,1201 ----
int err1 = errno;
DPRINT(Debug,13,(&Debug,
" ... write error %s (errno %d)\n",
! strerror(err1),err1));

if (err1 != EINTR && err1 != EAGAIN &&
err1 != EWOULDBLOCK) {


ss->error_state = strmcpy(ss->error_state,

! strerror(err1));
}
}
}
***************
*** 1489,1495 ****
/* return: malloced string -- caller must free */
static char * tls_give_values(X,prefix)
struct SE_option *X;
! CONST char *prefix;
{
char * ret;
char * Y = "???";
--- 1489,1495 ----
/* return: malloced string -- caller must free */
static char * tls_give_values(X,prefix)
struct SE_option *X;
! const char *prefix;
{
char * ret;
char * Y = "???";


***************
*** 1586,1595 ****


static ZZZ_SAVE_TYPE save_info_data[] = {
! { "rand-egd", -1L, ZZZ_DT_STR(raw_rand_egd),
! sizeof raw_rand_egd, NULL },
! { "rand-file", -1L, ZZZ_DT_STR(raw_rand_file),
! sizeof raw_rand_file, NULL },

};

--- 1586,1593 ----


static ZZZ_SAVE_TYPE save_info_data[] = {
! { "rand-egd", ZZZ_DT_STR(raw_rand_egd), sizeof raw_rand_egd },
! { "rand-file", ZZZ_DT_STR(raw_rand_file), sizeof raw_rand_file },

};

Index: elmME+.2.5.alpha5-cvs/src/addr_util.c
*** elmME+.2.5.alpha4/src/addr_util.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/addr_util.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.42.8.2 2004/08/14 06:40:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: addr_util.c,v 1.42.8.6 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 28,33 ****
--- 28,34 ----



#include "def_elm.h"
#include "s_elm.h"
+ #include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"addr");

***************
*** 53,59 ****
int tagged = 0;
int ac = get_alias_count(aview);

! CONST int NEWPOS = x->addrs_len;

for (i=0; i < ac; i++) {
struct alias_rec *a = give_alias(aview,i);
--- 54,60 ----
int tagged = 0;
int ac = get_alias_count(aview);

! const int NEWPOS = x->addrs_len;

for (i=0; i < ac; i++) {
struct alias_rec *a = give_alias(aview,i);
***************
*** 143,155 ****
--- 144,171 ----


} else {
for (i = 0;
addrs[i].addr && addrs[i].fullname && addrs[i].comment; i++) {

+ const char *A, *B;
+

DPRINT(Debug,6,
(&Debug,
" [%d]: {addr=%s, fullname=%S, comment=%S}",
i,
addrs[i].addr, addrs[i].fullname,

addrs[i].comment));
+
+ A = get_string_MIME_name(addrs[i].fullname);
+ B = get_string_lang(addrs[i].fullname);
+ DPRINT(Debug,11,
+ (&Debug, " (fullname cs=%s lang=%s)",

+ A ? A : "<none>",
+ B ? B : "<none>"));

+ A = get_string_MIME_name(addrs[i].comment);
+ B = get_string_lang(addrs[i].comment);
+ DPRINT(Debug,11,
+ (&Debug, " (comment cs=%s lang=%s)",

+ A ? A : "<none>",
+ B ? B : "<none>"));
}
}

DPRINT(Debug,6,
***************
*** 209,215 ****

void update_expanded_from_edit_buffer(expanded,buffer,mailer_info,aview)
struct expanded_address *expanded;


! CONST struct string *buffer;

struct mailer_info *mailer_info;
struct AliasView *aview;
{
--- 225,231 ----

void update_expanded_from_edit_buffer(expanded,buffer,mailer_info,aview)
struct expanded_address *expanded;


! const struct string *buffer;

struct mailer_info *mailer_info;
struct AliasView *aview;
{
***************
*** 217,223 ****


struct expanded_address result;
struct textual *ptr = expanded->surface;

! struct string_token * tokenized = string_tokenize(buffer);

zero_expanded_address(&result);

--- 233,239 ----


struct expanded_address result;
struct textual *ptr = expanded->surface;

! struct string_token * tokenized = string_tokenize(buffer, TOK_mail);

zero_expanded_address(&result);

***************

*** 228,234 ****
*expanded);

for (i = 0; tokenized[i].token; i = next) {
! CONST int NEWPOS = result.addrs_len;
struct string * surface = NULL;
int q= 0, spacecount = 0, q_seen = 0;

--- 244,250 ----
*expanded);

for (i = 0; tokenized[i].token; i = next) {
! const int NEWPOS = result.addrs_len;
struct string * surface = NULL;
int q= 0, spacecount = 0, q_seen = 0;

***************
*** 305,311 ****
/* no change -- copy original */

for (j = 0; j < ptr->len; j++) {
! CONST struct addr_item *ptr1 = & (expanded->addrs[ptr->pos+j]);
int p = ADD_EXPANDED(result,ptr1->addr,ptr1->fullname,
ptr1->comment);
if (0 == count)
--- 321,327 ----
/* no change -- copy original */

for (j = 0; j < ptr->len; j++) {
! const struct addr_item *ptr1 = & (expanded->addrs[ptr->pos+j]);
int p = ADD_EXPANDED(result,ptr1->addr,ptr1->fullname,
ptr1->comment);
if (0 == count)
***************
*** 446,451 ****
--- 462,542 ----


*expanded);
}

+
+ #ifdef I_NETDB
+ static int verify_mail_domain P_((char *domain));
+ static int verify_mail_domain(domain)
+ char *domain;

+ {


+ static char * last_verify_domain = NULL;
+ static int last_verify_result = -1;
+ time_t last_verify_time = 0;
+
+ int result = -1;
+
+ time_t now;
+
+ time(&now);
+
+ if (last_verify_time + 1000 > now &&
+ last_verify_domain &&
+ 0 == istrcmp(last_verify_domain,domain))
+ result = last_verify_result;

+

+ if (-1 == result) {
+ struct hostent *he = NULL;
+
+ lib_transient(CATGETS(elm_msg_cat, MeSet,
+ MeLookingUp,
+ "Looking up %s ..."),
+ domain);
+
+ he = gethostbyname(domain);
+
+ if (!he) {
+ DPRINT(Debug,9,(&Debug,
+ "verify_mail_domain: %s: h_errno=%d\n",
+ domain,h_errno));
+
+ switch(h_errno) {
+ case HOST_NOT_FOUND:
+ result = 0;

+ break;
+
+ case NO_ADDRESS:


+ result = 1;
+

+ }
+ } else


+ result = 1;
+

+
+ if (result >= 0) {
+ last_verify_domain = strmcpy(last_verify_domain,domain);
+ last_verify_result = result;
+ last_verify_time = now;
+
+ if (result)
+ lib_transient(CATGETS(elm_msg_cat, MeSet,MeLookingUpOK,
+ "Looking up %s ... OK"),
+ domain);
+ else
+ lib_transient(CATGETS(elm_msg_cat, MeSet,MeLookingUpNotExists,
+ "Looking up %s ... Not exists"),
+ domain);
+ } else
+ lib_transient(CATGETS(elm_msg_cat, MeSet,
+ MeLookingUpFailed,
+ "Looking up %s ... Failed"),
+ domain);

+
+ }
+
+ return result;


+ }
+
+ #endif
+

int build_address_l(expanded,mailer_info,aview)
struct expanded_address *expanded;
struct mailer_info *mailer_info;
***************

*** 549,555 ****
sizeof (elim_list[0]));

elim_list[elim_list_len].addr =
! safe_strdup(utf8_textual+1);
elim_list[elim_list_len].fullname = /* must be non-null */
new_string2(utf8,utf8_textual+1);

--- 640,646 ----
sizeof (elim_list[0]));

elim_list[elim_list_len].addr =
! safe_strdup(us2s(utf8_textual)+1);
elim_list[elim_list_len].fullname = /* must be non-null */
new_string2(utf8,utf8_textual+1);

***************
*** 570,578 ****
for (ptr = expanded->surface;
ptr < expanded->surface + expanded->surface_len;
ptr++) {
! CONST int NEWPOS = result.addrs_len;

struct addr_item verify_result;

if (!ptr->Textual) {

--- 661,670 ----
for (ptr = expanded->surface;
ptr < expanded->surface + expanded->surface_len;
ptr++) {
! const int NEWPOS = result.addrs_len;



struct addr_item verify_result;
+ enum mailer_errcode errcode = MAILER_NOT_AVAIL;

if (!ptr->Textual) {

***************
*** 661,670 ****




int p;

! if (qstrpbrk(ptr1->addr,"!:@") == NULL &&
! mailer_info &&
! query_mailer_info(mailer_info,MI_USE_DOMAIN)) {
ptr1->addr = strmcat(ptr1->addr,"@");
ptr1->addr = strmcat(ptr1->addr, hostfullname);
}

--- 753,864 ----




int p;
+ char * sep = qstrpbrk(ptr1->addr,"!:@");

! if (sep) {

! DPRINT(Debug,9,
! (&Debug,

! "build_address_l: addr %s separator %c\n",
! ptr1->addr,
! *sep));
! }
!
! if (sep && '@' == *sep &&
! sep > ptr1->addr) {

!

! if (0 == istrcmp(sep+1,hostfullname) ||
! 0 == istrcmp(sep+1,hostname)) {
!
! if (verify_local_address) {
!
! if (mailer_info &&
! verify_mailer_domaddr(mailer_info,
! ptr1->addr,
! &verify_result,
! &errcode)) {
!
!
! DPRINT(Debug,5,
! (&Debug,
! "Address %s verified -- really %s\n",
! ptr1->addr,
! verify_result.addr));

!
!
!
!

! ptr1->addr = strmcpy(ptr1->addr,
! verify_result.addr);
!
! if (!ptr1->fullname) {
! ptr1->fullname = verify_result.fullname;
! verify_result.fullname = NULL;
! } else if (verify_result.fullname)
! free_string(&verify_result.fullname);
!
! if (!ptr1->comment) {
! ptr1->comment = verify_result.comment;
! verify_result.comment = NULL;
! } else if (verify_result.comment)
! free_string(&verify_result.comment);
! free(verify_result.addr);
! verify_result.addr = NULL;

!
! } else {
!

! switch (errcode) {
!
! case MAILER_NOT_AVAIL:
! lib_error(CATGETS(elm_msg_cat,
! ElmSet,
! ElmVerifyNot1,
! "Unable to verify mail address %s"),
! ptr1->addr);

! break;
!

! case MAILER_NOT_EXIST:
! lib_error(CATGETS(elm_msg_cat,
! ElmSet, ElmVerifyBad1,
! "Address %s is not e-mail address"),
! ptr1->addr);

! break;


!
! default:
! break;
! }

! }
!
!
!
! }

!
!
! } else


! #ifdef I_NETDB
! if (verify_domain) {
!
! int r;

!
! DPRINT(Debug,9,
! (&Debug,

! "build_address_l: verifying domain %s\n",
! sep+1));
!
! r = verify_mail_domain(sep+1);

!

! if (0 == r) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmDomainUnknown,
! "Domain %s of address %S is unknown"),
!
! sep+1,
! ptr->Textual);
! }
! }

! #endif
!

! } else if (sep == NULL &&
! mailer_info &&
! query_mailer_info(mailer_info,MI_USE_DOMAIN)) {
ptr1->addr = strmcat(ptr1->addr,"@");
ptr1->addr = strmcat(ptr1->addr, hostfullname);
}
***************

*** 772,778 ****



else if (mailer_info &&
verify_mailer_addr(mailer_info,us2s(utf8_textual),
! &verify_result)) {
int pos;

DPRINT(Debug,5,

--- 966,973 ----



else if (mailer_info &&
verify_mailer_addr(mailer_info,us2s(utf8_textual),
! &verify_result,
! &errcode)) {
int pos;

DPRINT(Debug,5,
***************

*** 818,823 ****
--- 1013,1037 ----
struct string * comment = NULL;
int pos;

+

+ if (verify_local_address) {
+ switch (errcode) {
+ case MAILER_NOT_AVAIL:
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmVerifyNot,
+ "Unable to verify mail address %S"),
+ ptr->Textual);
+ break;
+ case MAILER_NOT_EXIST:
+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmVerifyBad,
+ "Address %S is not e-mail address or Elm's alias"),
+ ptr->Textual);

+ break;
+
+ default:
+ break;
+ }
+ }
+

/* Preserve possible comment
*
* Use dup_string() to avoid shared pointer so

Index: elmME+.2.5.alpha5-cvs/src/a_edit.c
*** elmME+.2.5.alpha4/src/a_edit.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/a_edit.c 2005-07-20 19:49:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: a_edit.c,v 1.11 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: a_edit.c,v 1.11.8.1 2005/07/20 16:49:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.1 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************


*** 18,27 ****

#include "def_elm.h"

! int edit_aliases_text(aview, header_page, page)

struct AliasView *aview;
- int *header_page;
struct menu_context *page;
{

/** Allow the user to edit their aliases text, always resynchronizing
afterwards. This routine calls the function edit_a_file()
--- 18,27 ----

#include "def_elm.h"

! int edit_aliases_text(aview, page, LOC)

struct AliasView *aview;
struct menu_context *page;
+ struct screen_parts *LOC;
{

/** Allow the user to edit their aliases text, always resynchronizing
afterwards. This routine calls the function edit_a_file()
***************
*** 39,45 ****
/*
* Redo the hash table...always!
*/
! install_aliases(aview, header_page);

/*
* clear any limit in effect.
--- 39,45 ----
/*
* Redo the hash table...always!
*/
! install_aliases(aview, LOC);

/*
* clear any limit in effect.

Index: elmME+.2.5.alpha5-cvs/src/alias.c
*** elmME+.2.5.alpha4/src/alias.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/alias.c 2005-07-23 22:01:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.35.2.7 2004/10/22 19:34:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.2.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: alias.c,v 1.35.2.11 2005/07/23 19:01:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.2.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 49,85 ****


static int get_aliasname P_((char *aliasname, char *buffer,int *duplicate,
int size,int buffer_size,

struct AliasView *aview,
! struct menu_context *page));

static int superceed_system P_((int this_alias, char *buffer,
int buffer_size,

struct AliasView *aview,
! struct menu_context *page));

--- 49,86 ----


static int get_aliasname P_((char *aliasname, char *buffer,int *duplicate,
int size,int buffer_size,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));
static int superceed_system P_((int this_alias, char *buffer,
int buffer_size,

struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

/*
* A simple macro to make it easier to remember how to do a simple
* resync and not screw up whether or not to prompt on deletions.
*/

! #define resync_aliases(newaliases,aview, page, prompt_area) \
! delete_aliases(newaliases,TRUE, aview, page, prompt_area)

static int get_realnames P_((char *aliasname,
! char *firstname,
! char *lastname,
! char *comment,
! char *buffer,
! int size_first,
! int size_last,
! int size_comment,
! int size_buffer,
! int is_group,

! struct menu_context *page,


! struct menu_context *prompt_area));
static int add_alias P_((int replace, int to_replace,

! struct AliasView *aview,

! struct menu_context *page,
! struct screen_parts *LOC));

static int ask_accept P_((char *aliasname,
char *firstname,
char *lastname,
***************

*** 90,98 ****


int replacement,
int size_buffer,
struct AliasView *avies,
! int headerPage,

! struct menu_context *page));


! static void alias_help P_((struct menu_context *page));


extern int is_system; /* system file updating? */

--- 91,100 ----


int replacement,
int size_buffer,
struct AliasView *avies,

! struct menu_context *page,
! struct screen_parts *LOC));

! static void alias_help P_((struct menu_context *page,
! struct menu_context *prompt_area));


extern int is_system; /* system file updating? */
***************

*** 116,126 ****


*a_group_name, *a_person_name, *a_system_flag;


! void open_alias_files(aview, alias_header_page)

struct AliasView *aview;


! int *alias_header_page;
{
- static int first_time = TRUE;
/*
* Close and re-open the system and user alias files, if present,
* and if they have changed since last we opened them.

--- 118,127 ----


*a_group_name, *a_person_name, *a_system_flag;


! void open_alias_files(aview, LOC)
struct AliasView *aview;
! struct screen_parts *LOC;
{
/*
* Close and re-open the system and user alias files, if present,
* and if they have changed since last we opened them.
***************

*** 128,181 ****
* Also, parse the data files into memory if needed
*/

- int A,B;
-

if (OPMODE_IS_READMODE(opmode)) {
int tac = get_total_alias_count(aview);
--- 129,134 ----
***************
*** 183,208 ****


set_alias_current(aview,0);

if (tac) {
! sort_aliases(tac, FALSE, alias_header_page ? 1 : 0,aview);
set_alias_current(aview,1);
}
- if (alias_header_page) {
- struct menu_common MENU;

! set_mcommon_from_aliasview(&MENU, aview);
! (void) get_page(get_alias_current(aview), &MENU,
! alias_header_page);
! }
}
}

}

! static int add_alias(replace, to_replace, aview, header_page, page)
int replace, to_replace;

struct AliasView *aview;


- int header_page;
struct menu_context *page;
{
/*
* Add an alias to the user alias text file. If there

--- 136,164 ----


set_alias_current(aview,0);

if (tac) {
! sort_aliases(tac, FALSE, LOC ? 1 : 0,aview);
set_alias_current(aview,1);
}

! if (LOC) {

! struct menu_common MENU;
!

! set_mcommon_from_aliasview(&MENU, aview);
! copy_current(&MENU,LOC->header_page);
!

! get_page(&MENU, LOC->header_page);
! }
!
}
}

}


! static int add_alias(replace, to_replace, aview, page, LOC)
int replace, to_replace;

struct AliasView *aview;
struct menu_context *page;
+ struct screen_parts *LOC;
{

/*
* Add an alias to the user alias text file. If there

***************
*** 233,238 ****
--- 189,196 ----


char bufferA[100]; /* TODO: Can remove? */
int ac;

+ int delay_redraw = 0;
+

/*
* See if there are any tagged aliases.
*/
***************

*** 249,292 ****

if (tagged == 1) {


char * buffer = NULL;

- int LINES, COLUMNS;

- menu_get_sizes(page,&LINES,&COLUMNS);

/*
* There is only on alias tagged. Ask the question
* but the default response is NO.
*/
! PutLineX(LINES-3,0, CATGETS(elm_msg_cat,
! AliasesSet, AliasesOneTagged,
! "There is 1 alias tagged..."));
! CleartoEOLN();
buffer = elm_message(CATGETS(elm_msg_cat,
AliasesSet, AliasesCreateGroup,
"Create group alias? (%c/%c) "),

*def_ans_yes, *def_ans_no);


! ch = want_to(buffer, *def_ans_no, LINES-4, 0, page);
free(buffer);
}
else if (tagged > 1) {

char * buffer = NULL;

- int LINES, COLUMNS;

- menu_get_sizes(page,&LINES,&COLUMNS);

/*
* If multiple tagged aliases then we assume the user
* wants to create a group alias. The default response
* is YES.
*/
! PutLineX(LINES-3,0, CATGETS(elm_msg_cat,
! AliasesSet, AliasesManyTagged,
! "There are %d aliases tagged..."),
tagged);
! CleartoEOLN();
buffer = elm_message(CATGETS(elm_msg_cat,
AliasesSet, AliasesCreateGroup,
"Create group alias? (%c/%c) "),

*def_ans_yes, *def_ans_no);


! ch = want_to(buffer, *def_ans_yes, LINES-4, 0, page);
free(buffer);
}

--- 207,248 ----

if (tagged == 1) {


char * buffer = NULL;

/*
* There is only on alias tagged. Ask the question
* but the default response is NO.
*/
! menu_PutLineX(LOC->prompt_page,1,0, CATGETS(elm_msg_cat,
! AliasesSet,
! AliasesOneTagged,
! "There is 1 alias tagged..."));
! menu_CleartoEOLN(LOC->prompt_page);
buffer = elm_message(CATGETS(elm_msg_cat,
AliasesSet, AliasesCreateGroup,
"Create group alias? (%c/%c) "),

*def_ans_yes, *def_ans_no);


! ch = want_to(buffer, *def_ans_no, 0, 0, LOC->prompt_page);
free(buffer);
}
else if (tagged > 1) {

char * buffer = NULL;

/*
* If multiple tagged aliases then we assume the user
* wants to create a group alias. The default response
* is YES.
*/
! menu_PutLineX(LOC->prompt_page,
! 1,0, CATGETS(elm_msg_cat,
! AliasesSet, AliasesManyTagged,
! "There are %d aliases tagged..."),
tagged);
! menu_CleartoEOLN(LOC->prompt_page);
buffer = elm_message(CATGETS(elm_msg_cat,
AliasesSet, AliasesCreateGroup,
"Create group alias? (%c/%c) "),

*def_ans_yes, *def_ans_no);


! ch = want_to(buffer, *def_ans_yes, 0, 0, LOC->prompt_page);
free(buffer);
}

***************
*** 325,336 ****


*/
if (replace) {
char buffer[100]; /* TODO: Fix this mess! */
- int LINES, COLUMNS;

struct alias_rec * a = give_alias(aview,to_replace);

- menu_get_sizes(page,&LINES,&COLUMNS);
-
aliasname[0] = '\0';
if (a) {
strfcpy(aliasname, a->alias, sizeof aliasname);

--- 281,289 ----
***************
*** 350,357 ****


* then just return.
*/
if( ! superceed_system(to_replace, buffer, sizeof buffer,
! aview, page)) {
! ClearLine(LINES-3);
return(0);
}
}

--- 303,310 ----


* then just return.
*/
if( ! superceed_system(to_replace, buffer, sizeof buffer,
! aview, page, LOC->prompt_page)) {
! menu_ClearLine(LOC->prompt_page,1);
return(0);
}
}
***************

*** 367,391 ****


AliasesSet, AliasesEnterAliasName,
"Enter alias name: "),
sizeof buffer);
! PutLine0(LINES-3,0, buffer);
! CleartoEOLN();
*aliasname = '\0';

replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page);
while (REDRAW_MARK == replace) {
! PutLine0(LINES-3,0, buffer);
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page);
}

if (replace < 0) {
DPRINT(Debug,3,
(&Debug,
"Aliasname [%s] was rejected in add_alias\n", aliasname));
! ClearLine(LINES-3);
return(0);
}
}

--- 320,356 ----


AliasesSet, AliasesEnterAliasName,
"Enter alias name: "),
sizeof buffer);
! menu_PutLine0(LOC->prompt_page,1,0, buffer);
! menu_CleartoEOLN(LOC->prompt_page);
*aliasname = '\0';

replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page,LOC->prompt_page);
while (REDRAW_MARK == replace) {

! menu_ClearScreen(page); /* Reset possible redraw flag */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page);
! delay_redraw++;
!
! menu_PutLine0(LOC->prompt_page,1,0, buffer);
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page,LOC->prompt_page);
}

if (replace < 0) {
+

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

DPRINT(Debug,3,
(&Debug,
"Aliasname [%s] was rejected in add_alias\n", aliasname));
! menu_ClearLine(LOC->prompt_page,1);
return(0);
}
}
***************

*** 430,436 ****


char buffer[1000]; /* Fix this mess !!! */

int LINES, COLUMNS;

-
menu_get_sizes(page,&LINES,&COLUMNS);

elm_sfprintf(buffer, sizeof buffer,
--- 395,400 ----
***************
*** 440,448 ****


aliasname);


! PutLine0(LINES-3,0, buffer);

! CleartoEOLN();
if (replace) {

struct alias_rec * a = give_alias(aview,to_replace);

--- 404,412 ----


aliasname);


! menu_PutLine0(LOC->prompt_page,1,0, buffer);

! menu_CleartoEOLN(LOC->prompt_page);
if (replace) {

struct alias_rec * a = give_alias(aview,to_replace);
***************

*** 458,478 ****


}

do {
int status =
! optionally_enter(address1, LINES-3, strlen(buffer),

OE_REDRAW_MARK|


OE_SIG_CHAR /* Ctrl-C */, sizeof address1,
page);

while (REDRAW_MARK == status) {
elm_sfprintf(buffer, sizeof buffer,
CATGETS(elm_msg_cat,
AliasesSet, AliasesEnterAddress,
"Enter address for %s: "),
aliasname);
! PutLine0(LINES-3,0, buffer);
status =
! optionally_enter(address1, LINES-3, strlen(buffer),
OE_REDRAW_MARK|OE_APPEND_CURRENT|

OE_SIG_CHAR /* Ctrl-C */,
sizeof address1,
--- 422,452 ----
}

do {


+ /* FIXME --optionally_enter* should use prompt_page */
+ int line = menu_GetAbsLine(LOC->prompt_page,1);
int status =
! optionally_enter(address1, line, strlen(buffer),

OE_REDRAW_MARK|


OE_SIG_CHAR /* Ctrl-C */, sizeof address1,
page);

while (REDRAW_MARK == status) {

+ menu_ClearScreen(page); /* Reset possible redraw flag */
+ delay_redraw++; /* Can't trigger redraw yet... */
+

+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+

+ menu_ClearScreen(LOC->prompt_page);
+
elm_sfprintf(buffer, sizeof buffer,
CATGETS(elm_msg_cat,
AliasesSet, AliasesEnterAddress,
"Enter address for %s: "),
aliasname);
! menu_PutLine0(LOC->prompt_page,1,0, buffer);
status =
! optionally_enter(address1, line, strlen(buffer),
OE_REDRAW_MARK|OE_APPEND_CURRENT|

OE_SIG_CHAR /* Ctrl-C */,
sizeof address1,
***************
*** 481,486 ****
--- 455,465 ----



if (0 != status ||
strlen(address1) == 0) {
+

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

+
lib_error(CATGETS(elm_msg_cat, AliasesSet,
AliasesNoAddressSpec,
"No address specified!"));
***************

*** 496,508 ****



if (!get_realnames(aliasname, firstname, lastname, comment, bufferA,
sizeof firstname, sizeof lastname, sizeof comment,
! sizeof bufferA, is_group, page))
! return 0;


if(ask_accept(aliasname, firstname, lastname, comment, address1,
bufferA, replace, to_replace,
! sizeof bufferA, aview, header_page, page)) {
/*

* We can only clear the tags after we know that the
* alias was added. This allows the user to back out
--- 475,496 ----



if (!get_realnames(aliasname, firstname, lastname, comment, bufferA,
sizeof firstname, sizeof lastname, sizeof comment,
! sizeof bufferA, is_group, page,LOC->prompt_page)) {

!
! if (delay_redraw)
! menu_trigger_redraw(page);

+ return 0;
+ }

if(ask_accept(aliasname, firstname, lastname, comment, address1,
bufferA, replace, to_replace,
! sizeof bufferA, aview, page, LOC)) {

!
! if (delay_redraw)
! menu_trigger_redraw(page);
!
!

/*
* We can only clear the tags after we know that the
* alias was added. This allows the user to back out
***************
*** 516,547 ****

if (a &&
ison(a->status, TAGGED)) {
-
struct menu_common MENU;


!
! set_mcommon_from_aliasview(&MENU, aview);

clearit(a->status, TAGGED);
! show_msg_tag(i,&MENU, header_page);
}
}
}
return(1);
}
! else {
! return(0);
! }
}

static int add_current_alias P_((struct MailboxView *mailbox,
struct AliasView *aview,
! int header_page,
! struct menu_context *page));
! static int add_current_alias(mailbox,aview, header_page, page)
struct MailboxView *mailbox;
struct AliasView *aview;


- int header_page;
struct menu_context *page;
{
/*
* Alias the current message to the specified name and

--- 504,542 ----



if (a &&
ison(a->status, TAGGED)) {

struct menu_common MENU;
! int vis;

clearit(a->status, TAGGED);
!
! set_mcommon_from_aliasview(&MENU,aview);

!

! vis = compute_visible(i+1, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);
!
}
}
}
+
return(1);
}

!
!
! if (delay_redraw)
! menu_trigger_redraw(page);
!

! return(0);
}

static int add_current_alias P_((struct MailboxView *mailbox,

struct AliasView *aview,
! struct menu_context *page,
! struct screen_parts *LOC));

! static int add_current_alias(mailbox,aview, page, LOC)
struct MailboxView *mailbox;

struct AliasView *aview;
struct menu_context *page;
+ struct screen_parts *LOC;
{

/*
* Alias the current message to the specified name and

***************
*** 562,572 ****


int i, match;
int replace, to_replace;

int current_mail_message = get_current(mailbox);

- int LINES, COLUMNS;
-

- menu_get_sizes(page,&LINES,&COLUMNS);

if (current_mail_message == 0) {
DPRINT(Debug,3,

--- 557,565 ----


int i, match;
int replace, to_replace;

+ int delay_redraw = 0;

int current_mail_message = get_current(mailbox);


if (current_mail_message == 0) {
DPRINT(Debug,3,
***************

*** 590,614 ****


strfcpy(buffer, catgets(elm_msg_cat, AliasesSet, AliasesCurrentMessage,
"Current message address aliased to: "),
sizeof buffer);
! PutLine0(LINES-3,0, buffer);
! CleartoEOLN();

*aliasname = '\0';
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page);
while (REDRAW_MARK == replace) {
! PutLine0(LINES-3,0, buffer);
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page);
}
if (replace < 0) {
DPRINT(Debug,3,
(&Debug,
"Aliasname [%s] was rejected in add_current_alias\n",
aliasname));
! ClearLine(LINES-3);
return(0);
}

--- 583,623 ----


strfcpy(buffer, catgets(elm_msg_cat, AliasesSet, AliasesCurrentMessage,
"Current message address aliased to: "),
sizeof buffer);
! menu_PutLine0(LOC->prompt_page,1,0, buffer);
! menu_CleartoEOLN(LOC->prompt_page);

*aliasname = '\0';
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page,LOC->prompt_page);
while (REDRAW_MARK == replace) {

! menu_ClearScreen(page); /* Reset possible redraw flag */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/
!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! delay_redraw++;
!

! menu_PutLine0(LOC->prompt_page,1,0, buffer);
replace = get_aliasname(aliasname, buffer, &to_replace,
sizeof aliasname, sizeof buffer,
! aview, page,LOC->prompt_page);
}
+

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

if (replace < 0) {
DPRINT(Debug,3,
(&Debug,
"Aliasname [%s] was rejected in add_current_alias\n",
aliasname));
! menu_ClearLine(LOC->prompt_page,1);
return(0);
}

***************

*** 641,648 ****
*comment = '\0';
if (strlen(comment_buff) != 0) { /* There is something. */
bufptr = comment_buff;
! while (*bufptr == SPACE) bufptr++; /* Always strip leading WS */
! if ((chspace = index(bufptr, (int) SPACE)) != NULL) {
/*
* A space means that there is at least (firstname lastname)
* Get firstname and move bufptr.
--- 650,657 ----
*comment = '\0';
if (strlen(comment_buff) != 0) { /* There is something. */
bufptr = comment_buff;
! while (whitespace(*bufptr)) bufptr++; /* Always strip leading WS */
! if ((chspace = index(bufptr, ' ')) != NULL) {
/*
* A space means that there is at least (firstname lastname)
* Get firstname and move bufptr.
***************
*** 650,659 ****
*chspace = '\0';
strfcpy(firstname, bufptr, sizeof firstname);
bufptr = chspace + 1; /* Move the pointer */
! while (*bufptr == SPACE) bufptr++;
}

! above: if ((chspace = index(bufptr, (int) SPACE)) != NULL) {
/*
* Another space means a third+ word. We either have:
* 1. Word 3+ is a comment, or
--- 659,668 ----
*chspace = '\0';
strfcpy(firstname, bufptr, sizeof firstname);
bufptr = chspace + 1; /* Move the pointer */
! while (whitespace(*bufptr)) bufptr++;
}

! above: if ((chspace = index(bufptr, ' ')) != NULL) {
/*
* Another space means a third+ word. We either have:
* 1. Word 3+ is a comment, or
***************
*** 672,683 ****
strfcat(firstname, " ", sizeof firstname);
strfcat(firstname, bufptr, sizeof firstname);
bufptr = chspace + 1; /* Move the pointer */
! while (*bufptr == SPACE) bufptr++;
goto above;
}
strfcpy(lastname, bufptr, sizeof lastname);
bufptr = chspace + 1; /* Move the pointer */
! while (*bufptr == SPACE) bufptr++;
strfcpy(comment, bufptr, sizeof comment);
}
else {
--- 681,692 ----
strfcat(firstname, " ", sizeof firstname);
strfcat(firstname, bufptr, sizeof firstname);
bufptr = chspace + 1; /* Move the pointer */
! while (whitespace(*bufptr)) bufptr++;
goto above;
}
strfcpy(lastname, bufptr, sizeof lastname);
bufptr = chspace + 1; /* Move the pointer */
! while (whitespace(*bufptr)) bufptr++;
strfcpy(comment, bufptr, sizeof comment);
}
else {
***************
*** 717,723 ****



if (!get_realnames(aliasname, firstname, lastname, comment, buffer,
sizeof firstname, sizeof lastname, sizeof comment,
! sizeof buffer, 0, page))
return 0;

/* grab the return address of this message */

--- 726,732 ----



if (!get_realnames(aliasname, firstname, lastname, comment, buffer,
sizeof firstname, sizeof lastname, sizeof comment,
! sizeof buffer, 0, page,LOC->prompt_page))
return 0;

/* grab the return address of this message */
***************

*** 725,731 ****



return(ask_accept(aliasname, firstname, lastname, comment, address1,
buffer, replace, to_replace, sizeof buffer, aview,
! header_page, page));

}

--- 734,740 ----



return(ask_accept(aliasname, firstname, lastname, comment, address1,
buffer, replace, to_replace, sizeof buffer, aview,
! page, LOC));

}

***************

*** 754,760 ****
"Failure attempting to add alias to file %s within %s (can_open)",
fname, "add_to_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenAdd,
"Couldn't open %s to add new alias!"),
fname);
--- 763,769 ----
"Failure attempting to add alias to file %s within %s (can_open)",
fname, "add_to_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenAdd,
"Couldn't open %s to add new alias!"),
fname);
***************
*** 769,775 ****
"Failure attempting to add alias to file %s within %s",
fname, "add_to_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenAdd,
"Couldn't open %s to add new alias!"),
fname);
--- 778,784 ----
"Failure attempting to add alias to file %s within %s",
fname, "add_to_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenAdd,
"Couldn't open %s to add new alias!"),
fname);
***************
*** 794,800 ****
"Failure attempting to write alias to file %s within %s",
fname, "add_to_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntWrite,
"Couldn't write alias to file %s!"),
fname);
--- 803,809 ----
"Failure attempting to write alias to file %s within %s",
fname, "add_to_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntWrite,
"Couldn't write alias to file %s!"),
fname);
***************
*** 849,855 ****
"Failure attempting to delete alias from file %s within %s (can_open)",
fname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenDelete,
"Couldn't open %s to delete alias!"),
fname);
--- 858,864 ----
"Failure attempting to delete alias from file %s within %s (can_open)",
fname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenDelete,
"Couldn't open %s to delete alias!"),
fname);
***************
*** 864,870 ****
"Failure attempting to delete alias from file %s within %s",
fname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenDelete,
"Couldn't open %s to delete alias!"),
fname);
--- 873,879 ----
"Failure attempting to delete alias from file %s within %s",
fname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenDelete,
"Couldn't open %s to delete alias!"),
fname);
***************
*** 880,886 ****
"Failure attempting to open temp file %s within %s (can_open)",
tmpfname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenTemp,
"Couldn't open temp file %s to delete alias!"),
tmpfname);
--- 889,895 ----
"Failure attempting to open temp file %s within %s (can_open)",
tmpfname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenTemp,
"Couldn't open temp file %s to delete alias!"),
tmpfname);
***************
*** 896,902 ****
"Failure attempting to open temp file %s within %s",
tmpfname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenTemp,
"Couldn't open temp file %s to delete alias!"),
tmpfname);
--- 905,911 ----
"Failure attempting to open temp file %s within %s",
tmpfname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesCouldntOpenTemp,
"Couldn't open temp file %s to delete alias!"),
tmpfname);
***************
*** 949,955 ****
"Failure attempting to write to temp file %s within %s",
tmpfname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet,
AliasesCouldntWriteTemp,
"Couldn't write to temp file %s!"),
--- 958,964 ----
"Failure attempting to write to temp file %s within %s",
tmpfname, "delete_from_alias_text"));
DPRINT(Debug,2,
! (&Debug, "** %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, AliasesSet,
AliasesCouldntWriteTemp,
"Couldn't write to temp file %s!"),
***************
*** 977,1003 ****
return(0);
}

void alias(mailbox, aview)


struct MailboxView *mailbox;
struct AliasView *aview;
{

!
/*
* Work with alias commands...
*/

! char name[NLEN], buffer[SLEN];
! int ch;
! static int newaliases = 0;
! int i;
! int nutitle = 0;
! int too_long;
!
! int redraw = 0; /** do we need to rewrite the entire screen? **/
! int nufoot = 0; /** clear lines 16 thru bottom and new menu **/
! int header_page = 0;
!
! struct menu_context *page = new_menu_context();

/*
* We're going to try to match the way elm does it at

--- 986,1099 ----
return(0);
}

+ static void set_alias_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_alias_screen(page,LOC, LIST)


+ struct menu_context *page;
+ struct screen_parts *LOC;
+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ /* 1) Title part of screen */


+
+ if (! LOC->title_page)

+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+

+ /* 2) menu part */


+
+ if (LOC->menu_page)

+ menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
+ else if (mini_menu)
+ LOC->menu_page = new_menu_subpage(page,LINES-8,4,

+ sb_alias_menu,LIST);
+
+ mailbox_screen_common(page,LOC, LIST);

+ }
+

+ static void check_alias_screen P_((struct screen_parts *LOC,
+ struct menu_param *list));
+ static void check_alias_screen(LOC,list)

+ struct screen_parts *LOC;
+ struct menu_param *list;

+ {
+ /* 1) title page */

+ if (menu_resized(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));

+ sb_update_title(LOC->title_page,list);
+ }


+
+ if (LOC->menu_page) {

+ /* 2) menu page */

+ if (menu_resized(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->menu_page)) {

+ DPRINT(Debug,1, (&Debug, "menu page redraw???\n"));
+ sb_show_menu(LOC->menu_page,list);

+ }
+ }
+
+ /* 3) prompt part */


+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {

+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.
+ */
+ }
+

+ /* 4) headers part */
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page resized\n"));
+ }
+ if (menu_need_redraw(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page redraw\n"));
+ menu_ClearScreen(LOC->header_page);
+ }
+ }
+
+
void alias(mailbox, aview)


struct MailboxView *mailbox;
struct AliasView *aview;
{

!
/*
* Work with alias commands...
*/
+

+ char name[NLEN], buffer[SLEN];
+ int ch;
+ static int newaliases = 0;
+ int i;
+ int too_long;
+
+ struct menu_context *page = new_menu_context();
+
+
+ struct screen_parts LOC = { NULL, NULL };
+ struct menu_common MENU;


+ struct menu_param PARAM[elm_mp_COUNT+1] = {

+ { mp_menu_common, { 0 } },


+ { mp_integer, { 0 } },
+ { mp_END, { 0 } }
+ };

! static int first_time = TRUE;

/*
* We're going to try to match the way elm does it at

***************
*** 1005,1063 ****


* main menu routines, but I will "borrow" from them. RLH
*/

! main_state(); /* Save globals for return to main menu */



! open_alias_files(aview, NULL); /* First, read the alias files. RLH */

! alias_screen(newaliases,aview, &header_page, page);
! /* define_softkeys(ALIAS); */

! while (1) {

! struct menu_common MENU;


! resize_mark:
! set_mcommon_from_aliasview(&MENU, aview);

! if (menu_resized(page)) {

! int LINES, COLUMNS;


! menu_get_sizes(page,&LINES, &COLUMNS);

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))
! if (mini_menu)
! headers_per_page = max (LINES - 14, 1);
! else
! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;
! }

! else
! redraw += menu_need_redraw(page);

! nucurr = 0;
! nufoot = 0;

! {
! int lin,col;


! prompt_s(mcommon_give_item(&MENU, m_Prompt));
! GetXYLocation(&lin,&col);
!

! CleartoEOLN();


! ch = menu_ReadCh(page,
! REDRAW_MARK|READCH_CURSOR|
! READCH_resize);

! MoveCursor(lin,col); CleartoEOS();


! }

! if (isascii(ch) && isprint(ch)) {

! DPRINT(Debug,4,
! (&Debug, "-- Alias command: %c [%d]\n",ch,ch));
! } else {
! DPRINT(Debug,4,
! (&Debug, "-- Alias command: [%d]\n",ch));

! }

switch (ch) {
case RESIZE_MARK:

--- 1101,1224 ----

! while (1) {
!
! resize_mark:
! menu_set_default(page);


! set_mcommon_from_aliasview(&MENU, aview);

! if (menu_resized(page)) {

! int LINES, COLUMNS;

! set_alias_screen(page,&LOC,PARAM);
!

! menu_get_sizes(page,&LINES, &COLUMNS);

! menu_trigger_redraw(page);

! }

! if (menu_need_redraw(page)) { /* Redraw screen if necessary */
! DPRINT(Debug,7, (&Debug,

! "alias: pending redraw\n"));
!

! mp_list_set_integer(PARAM,elm_mp_modified,newaliases);
! alias_screen(aview, page);
!
! }
! check_alias_screen(&LOC, PARAM);

!
! {
! int lin,col;
!

! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));
!
! menu_GetXYLocation(LOC.prompt_page,&lin,&col);
!
! menu_CleartoEOLN(LOC.prompt_page);

! show_last_error();
! menu_MoveCursor(LOC.prompt_page,lin,col);

! ch = menu_ReadCh(LOC.prompt_page,
! REDRAW_MARK|READCH_CURSOR|

! READCH_resize);
! menu_MoveCursor(LOC.prompt_page,lin,col);
! menu_CleartoEOS(LOC.prompt_page);
!

!
! if (isascii(ch) && isprint(ch)) {

! DPRINT(Debug,4,
! (&Debug, "-- Alias command: %c [%d]\n",ch,ch));
! } else {
! DPRINT(Debug,4,
! (&Debug, "-- Alias command: [%d]\n",ch));
! }
!

! set_error(""); /* clear error buffer */
!

! menu_MoveCursor(LOC.prompt_page,lin,col);


! }

switch (ch) {
case RESIZE_MARK:
***************

*** 1066,1113 ****



case HELP_MARK:
case '?':
! alias_help(page);
! redraw += menu_need_redraw(page);
break;

case REDRAW_MARK:
! case 'L'&31: redraw++; break;

#ifdef ALLOW_SUBSHELL
! case '!' : Writechar('!');

! main_state(); /** reload index screen vars **/
! subshell(mailbox,page);
! redraw += menu_need_redraw(page);
! main_state(); /** reload alias screen vars **/
break;
#endif /* ALLOW_SUBSHELL */



case '$':
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet, AliasesResync,
! "Resynchronize aliases..."));
FlushBuffer();

/*
* Process deletions and then see if we need to
* re-run the "newalias" routine.
*/
! if (resync_aliases(newaliases,aview, page)) {
! install_aliases(aview,&header_page);
! newaliases = 0;
! redraw++;

! }
! break;

case 'a':

! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet,
AliasesAddCurrent,
"Add address from current message..."));
FlushBuffer();

clear_error();
! if (add_current_alias(mailbox,aview, header_page, page)) {
newaliases++;
! nutitle++;
}
break;

--- 1227,1281 ----



case HELP_MARK:
case '?':
! alias_help(page,LOC.prompt_page);
break;

case REDRAW_MARK:
! case 'L'&31:
! menu_trigger_redraw(page);
! break;

#ifdef ALLOW_SUBSHELL
! case '!' :

! menu_Writechar(LOC.prompt_page,'!');
! subshell(mailbox,page,LOC.prompt_page);
break;
#endif /* ALLOW_SUBSHELL */



case '$':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesResync,
! "Resynchronize aliases..."));
FlushBuffer();

/*
* Process deletions and then see if we need to
* re-run the "newalias" routine.
*/
! if (resync_aliases(newaliases,aview, page, LOC.prompt_page)
! >=0) {
! install_aliases(aview,&LOC);
! newaliases = 0;
! menu_trigger_redraw(page);

!
! }
! break;


case 'a':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet,
AliasesAddCurrent,
"Add address from current message..."));
FlushBuffer();

clear_error();
! if (add_current_alias(mailbox,aview, page, &LOC)) {
newaliases++;
!
! mp_list_set_integer(PARAM,elm_mp_modified,newaliases);
! menu_trigger_redraw(LOC.title_page);
!
}
break;

***************

*** 1115,1130 ****


int alias_current = get_alias_current(aview);

if (alias_current > 0) {
! Write_to_screen(CATGETS(elm_msg_cat,
! AliasesSet, AliasesReplaceCurrent,
! "Replace current alias in database..."));
FlushBuffer();

clear_error();
! if (add_alias(TRUE, alias_current-1, aview, header_page,
! page)) {
newaliases++;
! nutitle++;
}
}
else {

--- 1283,1302 ----


int alias_current = get_alias_current(aview);

if (alias_current > 0) {
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesReplaceCurrent,
! "Replace current alias in database..."));
FlushBuffer();

clear_error();
! if (add_alias(TRUE, alias_current-1, aview,
! page, &LOC)) {
newaliases++;
!
! mp_list_set_integer(PARAM,elm_mp_modified,newaliases);
! menu_trigger_redraw(LOC.title_page);
!
}
}
else {
***************

*** 1136,1143 ****


break;

case 'e':
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet, AliasesEdit,
! "Edit %s..."), USER_ALIAS_TEXT);
FlushBuffer();

/*

--- 1308,1317 ----


break;

case 'e':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet, AliasesEdit,
! "Edit %s..."),
! USER_ALIAS_TEXT);
FlushBuffer();

/*
***************

*** 1145,1155 ****


* have to do this *before* checking current because
* all aliases could be marked for deletion.
*/
! (void) resync_aliases(newaliases,aview, page);
! if (edit_aliases_text(aview, &header_page, page)) {
newaliases = 0;
}
! redraw++;

break;

--- 1319,1331 ----


* have to do this *before* checking current because
* all aliases could be marked for deletion.
*/
! if (resync_aliases(newaliases,aview, page,
! LOC.prompt_page) < 0)
! break;
! if (edit_aliases_text(aview, page, &LOC)) {
newaliases = 0;
}
! menu_trigger_redraw(page);

break;

***************

*** 1157,1170 ****


int alias_current = get_alias_current(aview);

if (alias_current > 0) {
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet, AliasesMail,
! "Mail..."));
FlushBuffer();

a_sendmsg(TRUE,allow_forms,
! mailbox, aview, header_page,

! page);
! redraw += menu_need_redraw(page);

}
else {
--- 1333,1346 ----


int alias_current = get_alias_current(aview);

if (alias_current > 0) {
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet, AliasesMail,
! "Mail..."));
FlushBuffer();

a_sendmsg(TRUE,allow_forms,
! mailbox, aview,
! page, &LOC);

}
else {
***************

*** 1176,1190 ****


break;

case 'n':
! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet, AliasesAddNew,
! "Add a new alias to database..."));
FlushBuffer();

clear_error();
! if (add_alias(FALSE, -1, aview, header_page,
! page)) {
newaliases++;
! nutitle++;
}
break;

--- 1352,1369 ----


break;

case 'n':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet, AliasesAddNew,
! "Add a new alias to database..."));
FlushBuffer();

clear_error();
! if (add_alias(FALSE, -1, aview, page, &LOC)) {
newaliases++;
!
! mp_list_set_integer(PARAM,elm_mp_modified,
! newaliases);
! menu_trigger_redraw(LOC.title_page);
}
break;

***************

*** 1193,1202 ****
case 'i':
case 'I':
case 'r':
! case 'R':

! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddReturn,
! "Return to main menu..."));
FlushBuffer();

/*

--- 1372,1383 ----
case 'i':
case 'I':
case 'r':
! case 'R': {
! int r;


! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddReturn,
! "Return to main menu..."));
FlushBuffer();

/*
***************

*** 1205,1223 ****


* on uppercase letters so that deletions are
* NOT queried.
*/

! if (delete_aliases(newaliases, islower(ch), aview, page)) {


! install_aliases(aview,&header_page);
! newaliases = 0;
! }

! clear_error();
! main_state(); /* Done with aliases. */

! goto OUT;

case RETURN:
case LINE_FEED:
! case SPACE:
! case 'v': {
int alias_current = get_alias_current(aview);

if (newaliases) { /* Need this ?? */
--- 1386,1409 ----


* on uppercase letters so that deletions are
* NOT queried.
*/
! r = delete_aliases(newaliases, islower(ch), aview, page,
! LOC.prompt_page);

! if (-1 == r) { /* Ctrl-C */
! break;
! }

! if (r > 0) {


! install_aliases(aview,&LOC);
! newaliases = 0;
! }

! clear_error();

+ goto OUT;
+ }
case RETURN:
case LINE_FEED:
! case ' ':
! case 'v': {
int alias_current = get_alias_current(aview);

if (newaliases) { /* Need this ?? */
***************
*** 1234,1262 ****


struct alias_rec *a = give_alias(aview,
alias_current-1);

! if (a) {

! int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES,&COLUMNS);
!

if (a->type & GROUP) {
! PutLineX(LINES-2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesGroupAlias,
! "Group alias: %-60.60s"),
! a->address);
}
else {
! PutLineX(LINES-2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAliasedAddress,
! "Aliased address: %-60.60s"),
a->address);
}
-
}
! }
! else {
lib_error(CATGETS(elm_msg_cat,
AliasesSet, AliasesNoneToView,
"Warning: no aliases to view!"));

--- 1420,1444 ----


struct alias_rec *a = give_alias(aview,
alias_current-1);

! if (a) {
if (a->type & GROUP) {
! menu_PutLineX(LOC.prompt_page,2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet,
! AliasesGroupAlias,
! "Group alias: %-60.60s"),
! a->address);
}
else {
! menu_PutLineX(LOC.prompt_page,2, 0,
! CATGETS(elm_msg_cat,
! AliasesSet,
! AliasesAliasedAddress,
! "Aliased address: %-60.60s"),
a->address);
}
}
! } else {
lib_error(CATGETS(elm_msg_cat,
AliasesSet, AliasesNoneToView,
"Warning: no aliases to view!"));
***************

*** 1266,1281 ****

case 'x':
case 'X':

! Write_to_screen(CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddReturn,
! "Return to main menu..."));
FlushBuffer();
!
! exit_alias(aview);
! clear_error();
! main_state(); /* Done with aliases. */
!
! goto OUT;

case 'f':
case 'F': {

--- 1448,1463 ----



case 'x':
case 'X':
! menu_Write_to_screen(LOC.prompt_page,

! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddReturn,
! "Return to main menu..."));
FlushBuffer();
!
! exit_alias(aview);
! clear_error();
!
! goto OUT;

case 'f':
case 'F': {
***************

*** 1289,1298 ****


strfcpy(name, a->alias, sizeof name);

if (ch == 'F') {
! int status;

! int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES,&COLUMNS);

/* TODO: Fix this mess... */
strfcpy(buffer, catgets(elm_msg_cat,

--- 1471,1478 ----


strfcpy(name, a->alias, sizeof name);

if (ch == 'F') {
! int status, line;

! int delay_redraw = 0;

/* TODO: Fix this mess... */
strfcpy(buffer, catgets(elm_msg_cat,
***************

*** 1300,1331 ****


AliasesFullyExpanded,
"Fully expand alias: "),
sizeof buffer);
! PutLine0(LINES-3,0, buffer);
! CleartoEOS();

! status = optionally_enter(name, LINES-3,
strlen(buffer),

OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,

sizeof name,
page);
while (REDRAW_MARK == status) {
! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(name, LINES-3,
strlen(buffer),
OE_REDRAW_MARK|
OE_APPEND_CURRENT|

OE_SIG_CHAR /* Ctrl-C */,


sizeof name,
page);
! redraw++;
}
if (0 != status)
break;
}

{
struct addr_item * address;
too_long = FALSE;
address = get_alias_address_l(name, TRUE,
&too_long, NULL,

--- 1480,1521 ----


AliasesFullyExpanded,
"Fully expand alias: "),
sizeof buffer);
! menu_PutLine0(LOC.prompt_page,1,0, buffer);
! menu_CleartoEOS(LOC.prompt_page);

! /* FIXME --optionally_enter* should use prompt_page */
! line = menu_GetAbsLine(LOC.prompt_page,1);
! status = optionally_enter(name, line,
strlen(buffer),

OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,

sizeof name,
page);
+
while (REDRAW_MARK == status) {

! menu_ClearScreen(page); /* Reset possible redraw flag */

! delay_redraw++; /* Can't trigger redraw yet... */
!

! menu_PutLine0(LOC.prompt_page,1,0, buffer);
! status = optionally_enter(name, line,
strlen(buffer),
OE_REDRAW_MARK|
OE_APPEND_CURRENT|

OE_SIG_CHAR /* Ctrl-C */,
sizeof name,
page);
!

}
+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

if (0 != status)
break;
}

{
struct addr_item * address;
+
too_long = FALSE;
address = get_alias_address_l(name, TRUE,
&too_long, NULL,
***************

*** 1346,1389 ****

--- 1536,1582 ----

*** 1404,1414 ****


* it must be a "motion" command (or an error).
*/
default :
! ch = motion(ch,&MENU,&nufoot, &header_page,
! page);
!
! redraw += menu_need_redraw(page);
!

switch (ch) {
case 0: /* OK */
break;

--- 1597,1604 ----


* it must be a "motion" command (or an error).
*/
default :
! ch = motion(ch,&MENU,&LOC, page);
!

switch (ch) {
case 0: /* OK */
break;
***************

*** 1423,1475 ****


}
}

! if (redraw) { /* Redraw screen if necessary */
DPRINT(Debug,7, (&Debug,
"alias: pending redraw\n"));
- alias_screen(newaliases, aview, &header_page, page);
- nutitle = 0;
- }

! if (nutitle) { /* Redraw title if necessary */
! alias_title(newaliases, aview);
! nutitle = 0;
}

! check_range(&MENU);

!
! if (nucurr == NEW_PAGE)

! show_headers(&MENU,&header_page,page);


! else if (nucurr == SAME_PAGE)

! show_current(&MENU,&header_page, page);
! else if (nufoot) {

! int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES,&COLUMNS);
!

! if (mini_menu) {
! MoveCursor(LINES-8, 0);
! CleartoEOS();

! show_alias_menu(page);


! }
! else {
! MoveCursor(LINES-5, 0);
! CleartoEOS();
! }

! show_last_error(); /* for those operations that have to
! * clear the footer except for a message.
! */
! }


! } /* BIG while loop... */

OUT:

! erase_menu_context(&page);
! return;
}

! void install_aliases(aview, header_page)

struct AliasView *aview;
! int *header_page;

{
/*
* Run the 'newalias' program and update the

--- 1613,1643 ----


}
}

! if (menu_need_redraw(page)) { /* Redraw screen if necessary */
DPRINT(Debug,7, (&Debug,
"alias: pending redraw\n"));

! mp_list_set_integer(PARAM,elm_mp_modified,newaliases);
! alias_screen(aview, page);
}

! check_range(&MENU, &LOC);
! check_alias_screen(&LOC, PARAM);
!
!
! } /* BIG while loop... */

OUT:

! free_mailbox_screen(&LOC);
!
! erase_menu_context(&page);
! return;
}

! void install_aliases(aview,LOC)
struct AliasView *aview;
! struct screen_parts *LOC;
{
/*
* Run the 'newalias' program and update the
***************

*** 1498,1511 ****


lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesReReading,
"Processed %d aliases. Re-reading the database..."),
na);
! open_alias_files(aview, header_page);
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesUpdatedOK,
"Aliases updated successfully."));
}
}

! static void alias_help(page)
struct menu_context *page;
{
/*
* Help section for the alias menu...

--- 1666,1680 ----


lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesReReading,
"Processed %d aliases. Re-reading the database..."),
na);
! open_alias_files(aview, LOC);
lib_error(CATGETS(elm_msg_cat, AliasesSet, AliasesUpdatedOK,
"Aliases updated successfully."));
}
}

! static void alias_help(page,prompt_area)

struct menu_context *page;


+ struct menu_context *prompt_area;
{
/*
* Help section for the alias menu...
***************

*** 1514,1549 ****


*/

int ch;
! int redraw=0;
! char *alias_prompt;

!
! int LINES, COLUMNS;

! menu_get_sizes(page,&LINES,&COLUMNS);
!
!

! if (mini_menu)
! alias_prompt = catgets(elm_msg_cat, AliasesSet, AliasesShortKey,
! "Key: ");
! else
! alias_prompt = catgets(elm_msg_cat, AliasesSet, AliasesLongKey,
! "Key you want help for: ");
!
! MoveCursor(LINES-4, 0); CleartoEOS();

!

if (mini_menu) {
! print_format_center(LINES-4,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesKeyMenu,
! "Press the key you want help for, '?' for a key list, or '.' to exit help"));
}

- lower_prompt(alias_prompt);

! while ((ch = menu_ReadCh(page,0|READCH_CURSOR|READCH_sig_char)) != '.') {

if (ch == TERMCH_interrupt_char)
-
break;
switch(ch) {
case EOF :

--- 1683,1726 ----


*/

int ch;
! int delay_redraw=0;

! redraw:
! menu_ClearScreen(prompt_area);

!

if (mini_menu) {
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesKeyMenu,
! "Press the key you want help for, '?' for a key list, or '.' to exit help"));
}


! do {
! menu_PutLineX(prompt_area,
! 2, 0,
! CATGETS(elm_msg_cat, AliasesSet, AliasesLongKey,
! "Key you want help for: "));
!
! ch = menu_ReadCh(prompt_area,
! REDRAW_MARK|READCH_CURSOR|READCH_sig_char);

!
! if (ch == REDRAW_MARK) {


! menu_ClearScreen(page); /* Clear possible redraw mark */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! delay_redraw++;
!
! /* This clear redraw mark from prompt_area */
! goto redraw;
! }

!
! if (ch == '.')
! break;


if (ch == TERMCH_interrupt_char)
break;
switch(ch) {
case EOF :
***************

*** 1552,1558 ****
case HELP_MARK:
case '?' :
display_helpfile("alias");
- redraw++;
menu_trigger_redraw(page);
return;

--- 1729,1734 ----
***************
*** 1569,1575 ****

case RETURN:
case LINE_FEED:
! case SPACE:
case 'v': lib_transient(CATGETS(elm_msg_cat, AliasesSet, AliasesHelpv,
"v = View the address for the currently selected alias."));
break;
--- 1745,1751 ----

case RETURN:
case LINE_FEED:
! case ' ':
case 'v': lib_transient(CATGETS(elm_msg_cat, AliasesSet, AliasesHelpv,
"v = View the address for the currently selected alias."));
break;
***************
*** 1660,1714 ****

- }
- }
-

static int parse_aliases(buffer, remainder, size_buffer, size_remainder)
char *buffer, *remainder;

int size_buffer, size_remainder;
--- 1836,1851 ----


"That key isn't used in this section."));
break;
}

! } while (ch != '.');

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

+ menu_trigger_redraw(prompt_area);
return;
}

static int parse_aliases(buffer, remainder, size_buffer, size_remainder)
char *buffer, *remainder;

int size_buffer, size_remainder;
***************
*** 1763,1774 ****


}

static int get_aliasname(aliasname, buffer, duplicate, size, buffer_size,
! aview, page)
char *aliasname, *buffer;
int *duplicate;
int size, buffer_size;

struct AliasView *aview;
struct menu_context *page;
{

/*
--- 1900,1912 ----


}

static int get_aliasname(aliasname, buffer, duplicate, size, buffer_size,
! aview, page, prompt_area)
char *aliasname, *buffer;
int *duplicate;
int size, buffer_size;

struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{

/*
***************

*** 1799,1816 ****




do {
! int status =
! optionally_enter(aliasname, LINES-3, strlen(buffer),
OE_REDRAW_MARK|OE_SIG_CHAR, size, page);

if (REDRAW_MARK == status)
! return REDRAW_MARK;

/*
* Return if nothing was entered.
*/
if (0 != status || strlen(aliasname) == 0)
! return(-1);

} while (check_alias(aliasname) == -1);

--- 1937,1956 ----




do {
! /* FIXME --optionally_enter* should use prompt_page */
! int line = menu_GetAbsLine(prompt_area,1);
! int status =
! optionally_enter(aliasname, line, strlen(buffer),
OE_REDRAW_MARK|OE_SIG_CHAR, size, page);

if (REDRAW_MARK == status)
! return REDRAW_MARK;

/*
* Return if nothing was entered.
*/
if (0 != status || strlen(aliasname) == 0)
! return(-1);

} while (check_alias(aliasname) == -1);

***************

*** 1823,1862 ****


struct alias_rec *a = give_alias(aview,loc);

if (a) {
DPRINT(Debug,2,
(&Debug,
"Attempt to add a duplicate alias [%s] in get_aliasname\n",
a->alias));

if (a->type & GROUP )
! PutLineX(LINES-3,0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAlreadyGroup,
! "Already a group with name %s."),
! a->alias);
else
! PutLineX(LINES-3,0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesAlreadyAlias,
! "Already an alias for %s."),
! a->alias);
! CleartoEOLN();
! elm_sfprintf(buffer, buffer_size,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesReplaceExisting,

! "Replace existing alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


/*
* If they don't want to replace the alias by that name
* then just return.
*/
! if (want_to(buffer, *def_ans_no, LINES-4, 0,
! page) != *def_ans_yes)
return(-1);
*duplicate = loc;
return(1);
}
}
/*
* If they have elected to replace an existing alias then
* we assume that they would also elect to superceed a

--- 1963,2033 ----

! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel,
! prompt_area,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesReplaceExisting,
! "Replace existing alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


!
! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {

! menu_ClearScreen(page); /* Reset possible redraw flag */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(prompt_area);
!
! redraw++; /* Can't trigger redraw yet... */
! goto againD;
! }
! if (redraw)
! menu_trigger_redraw(page);


!
! if (TERMCH_interrupt_char == answer)
! return -1;
!

! if (answer != *def_ans_yes)
return(-1);
+
*duplicate = loc;
return(1);
}
}
+
/*
* If they have elected to replace an existing alias then
* we assume that they would also elect to superceed a
***************

*** 1878,1884 ****


a->address));

if( ! superceed_system(loc, buffer, buffer_size,
! aview, page))
return(-1);
}
}

--- 2049,2055 ----


a->address));

if( ! superceed_system(loc, buffer, buffer_size,
! aview, page,prompt_area))
return(-1);
}
}
***************

*** 1886,1911 ****



}

! static int superceed_system(this_alias, buffer, buffer_size, aview,page)
int this_alias;
char *buffer;
int buffer_size;

struct AliasView *aview;
struct menu_context *page;
{

struct alias_rec *a = give_alias(aview,this_alias);


- int LINES, COLUMNS;
-

- menu_get_sizes(page,&LINES,&COLUMNS);

if (!a)
return 0;

! PutLineX(LINES-3, 0,
! CATGETS(elm_msg_cat,

! AliasesSet, AliasesSystemAlias,
! "System (%6s) alias for %s."),
! alias_type(a->type), a->alias);

elm_sfprintf(buffer, buffer_size,
CATGETS(elm_msg_cat, AliasesSet, AliasesSuperceed,

--- 2057,2080 ----



}

! static int superceed_system(this_alias, buffer, buffer_size, aview,page,prompt_area)
int this_alias;
char *buffer;
int buffer_size;

struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
struct alias_rec *a = give_alias(aview,this_alias);

if (!a)
return 0;

! menu_PutLineX(prompt_area,1, 0,
! CATGETS(elm_msg_cat,
! AliasesSet, AliasesSystemAlias,
! "System (%6s) alias for %s."),
! alias_type(a->type), a->alias);

elm_sfprintf(buffer, buffer_size,
CATGETS(elm_msg_cat, AliasesSet, AliasesSuperceed,
***************

*** 1914,2082 ****


* If they don't want to superceed the SYSTEM alias then
* return a FALSE.
*/
! return(want_to(buffer, *def_ans_no, LINES-4, 0,
! page) == *def_ans_yes);

}

static int get_realnames(aliasname, firstname, lastname, comment, buffer,
size_first, size_last, size_comment, size_buffer,
! is_group, page)
char *aliasname, *firstname, *lastname, *comment, *buffer;
int size_first, size_last, size_comment, size_buffer;
int is_group;
struct menu_context *page;
{
int status;

!
! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES,&COLUMNS);
!

if (is_group) {
lastname[0] = '\0';
firstname[0] = '\0';
} else {
elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterLastName,
"Enter last name for %s: "), aliasname);
! PutLine0(LINES-3,0, buffer);
! CleartoEOLN();
! status = optionally_enter(lastname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_last, page);
! while (REDRAW_MARK == status) {
! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(lastname, LINES-3, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! size_last, page);
! }

! if (status != 0) /* Error or Ctrl-C */
return 0;

! elm_sfprintf(buffer, size_buffer,
! CATGETS(elm_msg_cat, AliasesSet, AliasesEnterFirstName,
! "Enter first name for %s: "), aliasname);
! PutLine0(LINES-3,0, buffer);
! CleartoEOLN();
! status = optionally_enter(firstname, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|
! OE_SIG_CHAR /* Ctrl-C */, size_first, page);
! while (REDRAW_MARK == status) {
! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(firstname, LINES-3, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! size_first, page);
}

! if (0 != status) /* Ctrl-C or error */
return 0;

if (strlen(lastname) == 0) {
strfcpy(lastname, firstname, size_last);
*firstname = '\0';
}
! }

! elm_sfprintf(buffer, size_buffer,
! CATGETS(elm_msg_cat, AliasesSet, AliasesEnterComment,
! "Enter optional comment for %s: "), aliasname);
! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(comment, LINES-3, strlen(buffer),
! OE_REDRAW_MARK|

! OE_SIG_CHAR /* Ctrl-C */, size_comment, page);


! while (status == REDRAW_MARK) {

! PutLine0(LINES-3,0, buffer);
! status = optionally_enter(comment, LINES-3, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! size_comment, page);
! }


! if (0 != status) /* Ctrl-C or error */

! return 0;

! return 1;
}


static int ask_accept(aliasname, firstname, lastname, comment, address, buffer,
! replace, replacement, size_buffer, aview, header_page,
! page)
char *aliasname, *firstname, *lastname, *comment, *address, *buffer;
int replace, replacement;
int size_buffer;

struct AliasView *aview;
- int header_page;
struct menu_context *page;
{


! char ch;
! char *(old_alias[1]);

! int LINES, COLUMNS;

- menu_get_sizes(page,&LINES,&COLUMNS);

! "Messages addressed as: %s <%s>"),
! buffer,address);
}

--- 2083,2334 ----


* If they don't want to superceed the SYSTEM alias then
* return a FALSE.
*/
! return(want_to(buffer, *def_ans_no, 0, 0,
! prompt_area) == *def_ans_yes);

}

static int get_realnames(aliasname, firstname, lastname, comment, buffer,
size_first, size_last, size_comment, size_buffer,
! is_group, page, prompt_area)
char *aliasname, *firstname, *lastname, *comment, *buffer;
int size_first, size_last, size_comment, size_buffer;
int is_group;

struct menu_context *page;
+ struct menu_context *prompt_area;
{
int status;


! int delay_redraw = 0;

if (is_group) {
lastname[0] = '\0';
firstname[0] = '\0';
} else {
+ int line;
+
elm_sfprintf(buffer, size_buffer,
CATGETS(elm_msg_cat, AliasesSet, AliasesEnterLastName,
"Enter last name for %s: "), aliasname);
! menu_PutLine0(prompt_area,1,0, buffer);
! menu_CleartoEOLN(prompt_area);

!

! /* FIXME --optionally_enter* should use prompt_page */
! line = menu_GetAbsLine(prompt_area,1);
!
! status = optionally_enter(lastname, line, strlen(buffer),
! OE_REDRAW_MARK|

! OE_SIG_CHAR /* Ctrl-C */, size_last, page);
! while (REDRAW_MARK == status) {

! menu_ClearScreen(page); /* Reset possible redraw flag */

! delay_redraw++; /* Can't trigger redraw yet... */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(prompt_area);
!

! /* FIXME --optionally_enter* should use prompt_page */
! line = menu_GetAbsLine(prompt_area,1);
! menu_PutLine0(prompt_area,1,0, buffer);
! status = optionally_enter(lastname, line, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! size_last, page);
! }
!

! if (status != 0) { /* Error or Ctrl-C */

! if (delay_redraw)
! menu_trigger_redraw(page);

return 0;
+ }
+
+ {
+ int line;
+
+ elm_sfprintf(buffer, size_buffer,
+ CATGETS(elm_msg_cat, AliasesSet, AliasesEnterFirstName,
+ "Enter first name for %s: "), aliasname);
+ menu_PutLine0(prompt_area,1,0, buffer);
+ menu_CleartoEOLN(prompt_area);
+
+ /* FIXME --optionally_enter* should use prompt_page */
+ line = menu_GetAbsLine(prompt_area,1);
+
+ status = optionally_enter(firstname, line, strlen(buffer),
+ OE_REDRAW_MARK|
+ OE_SIG_CHAR /* Ctrl-C */, size_first, page);


+ while (REDRAW_MARK == status) {

+ menu_ClearScreen(page); /* Reset possible redraw flag */
+ delay_redraw++; /* Can't trigger redraw yet... */



! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(prompt_area);
!

! /* FIXME --optionally_enter* should use prompt_page */
! line = menu_GetAbsLine(prompt_area,1);
! menu_PutLine0(prompt_area,1,0, buffer);
! status = optionally_enter(firstname, line, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! size_first, page);
! }
}


! if (0 != status) { /* Ctrl-C or error */

! if (delay_redraw)
! menu_trigger_redraw(page);

return 0;
+ }

if (strlen(lastname) == 0) {
strfcpy(lastname, firstname, size_last);
*firstname = '\0';
}

! }
!
! {


! int line;
!
! elm_sfprintf(buffer, size_buffer,
! CATGETS(elm_msg_cat, AliasesSet, AliasesEnterComment,
! "Enter optional comment for %s: "), aliasname);
! menu_PutLine0(prompt_area,1,0, buffer);

!

! /* FIXME --optionally_enter* should use prompt_page */
! line = menu_GetAbsLine(prompt_area,1);
!
! status = optionally_enter(comment, line, strlen(buffer),
! OE_REDRAW_MARK|

! OE_SIG_CHAR /* Ctrl-C */, size_comment, page);


! while (status == REDRAW_MARK) {
! menu_ClearScreen(page); /* Reset possible redraw flag */

! delay_redraw++; /* Can't trigger redraw yet... */

!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(prompt_area);

! menu_PutLine0(prompt_area,1,0, buffer);
! status = optionally_enter(comment, line, strlen(buffer),

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! size_comment, page);


! }
! }

! if (delay_redraw)
! menu_trigger_redraw(page);

!

! if (0 != status) /* Ctrl-C or error */

! return 0;
!

! return 1;
}

static int ask_accept(aliasname, firstname, lastname, comment, address, buffer,
! replace, replacement, size_buffer, aview,
! page,LOC)
char *aliasname, *firstname, *lastname, *comment, *address, *buffer;
int replace, replacement;
int size_buffer;

struct AliasView *aview;
struct menu_context *page;
+ struct screen_parts *LOC;
{

! int delay_redraw = 0;

! int answer = 0;

! char *(old_alias[1]);


+ again:
/*
* If firstname == lastname, they probably just took all
* the deafaults. We *assume* they don't want lastname
* entered twice, so we will truncate it.
*/

! if (strcmp(firstname, lastname) == 0) {

! *firstname = '\0';
! }
!

! if (strlen(lastname) == 0) {
! menu_PutLineX(LOC->prompt_page,
! 2,0, CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddressAs1,
! "Messages addressed as: %s"),
! address);
! strfcpy(buffer, aliasname, size_buffer);
! } else {
! if (strlen(firstname) == 0) {
! strfcpy(buffer, lastname, size_buffer);
}
! else {
! elm_sfprintf(buffer, size_buffer,
! FRM("%s %s"), firstname, lastname);
}
! menu_PutLineX(LOC->prompt_page,
! 2,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddressAs,

! "Messages addressed as: %s <%s>"),
! buffer,address);


! }
! if (strlen(comment) != 0) {
! strfcat(buffer, ", ", size_buffer);
! strfcat(buffer, comment, size_buffer);
! }
!
! menu_PutLineX(LOC->prompt_page,1,0,
! CATGETS(elm_msg_cat, AliasesSet,
! AliasesAddressTo,
! "New alias: %s is '%s'."),
! aliasname, buffer);
! menu_CleartoEOLN(LOC->prompt_page);
/*
* Kludge Alert: Spaces are padded to the front of the prompt
* to write over the previous question. Should probably record
* the end of the line, move to it, and CleartoEOLN() it.
*/

! answer = prompt_letter(1,"",*def_ans_no,

! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel,
! LOC->prompt_page,

! CATGETS(elm_msg_cat, AliasesSet, AliasesAcceptNew,
! " Accept new alias? (%c/%c) "),
! *def_ans_yes, *def_ans_no);


! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {

! menu_ClearScreen(page); /* Reset possible redraw flag */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page);


!
! delay_redraw++; /* Can't trigger redraw yet... */

! goto again;


! }
! if (delay_redraw)
! menu_trigger_redraw(page);

!
! if (TERMCH_interrupt_char == answer)

! goto clean;
!


+ if(answer == *def_ans_yes) {
+ if (replace) {
+ struct alias_rec *a = give_alias(aview,replacement);
+
+ if (a) {
+ old_alias[0] = a->alias;
+
/*
* First, clear flag if this is marked to be deleted.
* This prevents the problem where they marked it for
***************

*** 2086,2109 ****


* the new alias we just so carefully added to the
* text file.
*/
! if (ison(a->status, DELETED)) {
! clearit(a->status, DELETED);
! }
/*
* Changed aliases are given the NEW flag.
*/
! setit(a->status, NEW);

! {
struct menu_common MENU;


! set_mcommon_from_aliasview(&MENU, aview);

! show_msg_status(replacement,&MENU, header_page);
! }
/*
* Now we can delete it...
*/
! delete_from_alias_text(old_alias, 1);

/*
* Kludge Alert: We need to get the trailing comma

--- 2338,2365 ----

*** 2111,2127 ****


* alias since the display won't be re-sync'd right
* away.
*/
! *((old_alias[0])+strlen(old_alias[0])-1) = '\0';
! }
}
- add_to_alias_text(aliasname, firstname, lastname, comment, address);
}
! ClearLine(LINES-3);
! ClearLine(LINES-2);
! return(ch == *def_ans_yes ? 1 : 0);

! }


/* Check whether an address is aliased; if so return the alias, otherwise
* return NULL. */
--- 2367,2384 ----


* alias since the display won't be re-sync'd right
* away.
*/
! *((old_alias[0])+strlen(old_alias[0])-1) = '\0';
}
}
! add_to_alias_text(aliasname, firstname, lastname, comment, address);
! }

! clean:
! menu_ClearLine(LOC->prompt_page,1);
! menu_ClearLine(LOC->prompt_page,2);

+ return(answer == *def_ans_yes ? 1 : 0);
+ }

/* Check whether an address is aliased; if so return the alias, otherwise
* return NULL. */

Kari E. Hurtta

unread,
Jul 28, 2005, 12:33:41 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.15

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 15/20 ) =========
Index: elmME+.2.5.alpha5-cvs/src/lock.c
*** elmME+.2.5.alpha4/src/lock.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/lock.c 2005-07-23 22:01:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: lock.c,v 1.18.8.1 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: lock.c,v 1.18.8.4 2005/07/23 19:01:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 31,43 ****
extern int errno;
#endif

- char *error_description();
-
- extern char *mk_lockname();
-
-
int lock(direction, folder)


! int direction;
struct folder_info *folder;
{

/** Create lock file to ensure that we don't get any mail
--- 31,38 ----
extern int errno;
#endif

int lock(direction, folder)


! enum lock_direction direction;
struct folder_info *folder;
{

/** Create lock file to ensure that we don't get any mail
***************
*** 73,83 ****
if (setgid(groupid) < 0) {
int err = errno;
lib_error(FRM("Lock: setgid(%d) FAILED: %s"),
! groupid,error_description(err));
}
}

! if (direction == INCOMING)
leave_locked();
else
emergency_exit(0);
--- 68,78 ----
if (setgid(groupid) < 0) {
int err = errno;
lib_error(FRM("Lock: setgid(%d) FAILED: %s"),
! groupid,strerror(err));
}
}

! if (direction == LOCK_INCOMING)
leave_locked();
else
emergency_exit(0);
Index: elmME+.2.5.alpha5-cvs/src/mailmsg1.c
*** elmME+.2.5.alpha4/src/mailmsg1.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/mailmsg1.c 2005-07-26 11:28:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.36.8.8 2004/08/14 06:40:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 1.36.8.11 2005/07/26 08:28:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 44,56 ****
cm_mimeforward, cm_CANCEL
} copy_the_msg P_((struct mailing_headers *headers,
int options,
! struct menu_context *page));


! static CONST unsigned char * csUs P_((const char *str));
! static CONST unsigned char * csUs(str)
! CONST char *str;
{
! return (CONST unsigned char *)str;
}

static void output_abbreviated_to P_((struct addr_item *addrs));
--- 44,57 ----
cm_mimeforward, cm_CANCEL
} copy_the_msg P_((struct mailing_headers *headers,
int options,


! struct menu_context *page,
! struct menu_context *prompt_area));

! static const unsigned char * csUs P_((const char *str));
! static const unsigned char * csUs(str)
! const char *str;
{
! return (const unsigned char *)str;
}

static void output_abbreviated_to P_((struct addr_item *addrs));
***************
*** 167,189 ****
free_string(&addr_string);
}

! int get_to(to,mailer_info,aview, page, cancel_view, cancel_selection)
struct expanded_address *to;


struct mailer_info *mailer_info;
struct AliasView *aview;

struct menu_context *page;
struct MailboxView *cancel_view;
int *cancel_selection;
{



struct string * buffer = NULL;

! int LINES, COLUMNS;


! int redraw = 0;

int can_flag = 0;
! int line;
!
! menu_get_sizes(page,&LINES, &COLUMNS);
! line = OPMODE_IS_SENDMODE(opmode) ? 3 : LINES-3;

if (cancel_selection)
*cancel_selection = -1;
--- 168,190 ----
free_string(&addr_string);
}

! int get_to(to,mailer_info,aview, page, cancel_view, cancel_selection,
! prompt_area)
struct expanded_address *to;


struct mailer_info *mailer_info;
struct AliasView *aview;

struct menu_context *page;
struct MailboxView *cancel_view;
int *cancel_selection;
+ struct menu_context *prompt_area;
{


struct string * buffer = NULL;

! int li, co;


! int delay_redraw = 0;

int can_flag = 0;
!
! menu_get_sizes(prompt_area,&li, &co);

if (cancel_selection)
*cancel_selection = -1;
***************
*** 198,205 ****
if (to->surface_len == 0) {
int canceled_count = 0;
int flag = 0;
! int oline = -1;
int code;

if (cancel_view)
canceled_count = get_message_count(cancel_view);
--- 199,209 ----
if (to->surface_len == 0) {
int canceled_count = 0;
int flag = 0;
!
! int line;
!
int code;

+ int ul = give_dt_enumerate_as_int(&user_level);

if (cancel_view)
canceled_count = get_message_count(cancel_view);
***************
*** 208,300 ****
"canceled_count=%d\n",
canceled_count));

if (canceled_count > 1 && cancel_selection) {
! print_format_center(line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceledX,
! "%d canceled mails. Use / to select one of them."),
! canceled_count);
! oline = line++;
flag |= OE_ALT_SOLIDUS;
} else if (1 == canceled_count && cancel_selection) {
! print_format_center(line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceled1,
! "1 canceled mail. Use / to select it."));
! oline = line++;
flag |= OE_ALT_SOLIDUS;
}


! if (user_level < 2) {
code = optionally_enter2(page,
! &buffer, line, 0,
OE_REDRAW_MARK|flag|


OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,

ElmSendTheMessageTo,
"Send the message to: "));


! while (REDRAW_MARK == code) {
! menu_get_sizes(page,&LINES, &COLUMNS);

! code = optionally_enter2(page,
! &buffer, line, 0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! flag|OE_SIG_CHAR /* Ctrl-C */,
! CATGETS(elm_msg_cat, ElmSet,
! ElmSendTheMessageTo,
! "Send the message to: "));


/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
! redraw = 1;
}
! }
! else {
code = optionally_enter2(page,
! &buffer, line, 0,
OE_REDRAW_MARK|flag|
OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));

! while (code == REDRAW_MARK) {
! menu_get_sizes(page,&LINES, &COLUMNS);

! code = optionally_enter2(page,
! &buffer, line, 0,
! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! flag|OE_SIG_CHAR /* Ctrl-C */,
! CATGETS(elm_msg_cat, ElmSet, ElmTo,
! "To: "));


/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
! redraw = 1;
}

}

- if (oline >= 0) {
- MoveCursor(oline,0);
- CleartoEOLN();
-
- }
-
-
if (OE_ALT_SOLIDUS == code) {
can_flag = view_canceled_mails(cancel_view,
cancel_selection,aview);
! redraw = 1;
}

if (0 != code || can_flag) {

if (-1 == code) { /* Ctrl-C */
! MoveCursor(line,0);
! CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));
}
--- 212,315 ----
"canceled_count=%d\n",
canceled_count));

+ redraw:
+ line = 1;
if (canceled_count > 1 && cancel_selection) {
! menu_print_format_center(prompt_area,line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceledX,
! "%d canceled mails. Use / to select one of them."),
! canceled_count);
! line++;
flag |= OE_ALT_SOLIDUS;
} else if (1 == canceled_count && cancel_selection) {
! menu_print_format_center(prompt_area,line,
! CATGETS(elm_msg_cat, ElmSet,
! ElmIsCanceled1,
! "1 canceled mail. Use / to select it."));
! line++;
flag |= OE_ALT_SOLIDUS;
}

+ /* On redrawing / sould not go to cancel view */
+
+ if (delay_redraw && buffer && string_len(buffer) > 0)
+ flag = OE_APPEND_CURRENT;
+

! if (ul < 2) {
! /* FIXME --optionally_enter* should use prompt_area */
! int line1 = menu_GetAbsLine(prompt_area,line);
!
code = optionally_enter2(page,
! &buffer, line1, 0,
OE_REDRAW_MARK|flag|


OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,

ElmSendTheMessageTo,
"Send the message to: "));

+ if (REDRAW_MARK == code) {
+ menu_ClearScreen(page); /* Clear possible redraw mark */



! /* Call refresh routines of children */
! menu_redraw_children(page);

! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/
!

/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
! delay_redraw++;
! goto redraw;
}
!
! } else {
! /* FIXME --optionally_enter* should use prompt_area */
! int line1 = menu_GetAbsLine(prompt_area,line);
!
code = optionally_enter2(page,
! &buffer, line1, 0,
OE_REDRAW_MARK|flag|
OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmTo,
"To: "));

! if (code == REDRAW_MARK) {


! menu_ClearScreen(page); /* Clear possible redraw mark */

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/
!

/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
! delay_redraw++;
! goto redraw;
}

}

if (OE_ALT_SOLIDUS == code) {
can_flag = view_canceled_mails(cancel_view,
cancel_selection,aview);
!
! menu_ClearScreen(page);

!
! /* Call refresh routines of children */
! menu_redraw_children(page);

! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/
!
! delay_redraw = 1;
}

if (0 != code || can_flag) {

if (-1 == code) { /* Ctrl-C */
! menu_ClearLine(prompt_area,1);
!
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));
}
***************
*** 302,308 ****
if (buffer)
free_string(&buffer);

! if (redraw)
menu_trigger_redraw(page);

if (can_flag > 0) {
--- 317,323 ----
if (buffer)
free_string(&buffer);

! if (delay_redraw)
menu_trigger_redraw(page);

if (can_flag > 0) {
***************
*** 315,325 ****

if (string_len(buffer) == 0) {
free_expanded_address(to);
! ClearLine(line);

free_string(&buffer);

! if (redraw)
menu_trigger_redraw(page);
return 0;
}
--- 330,341 ----

if (string_len(buffer) == 0) {
free_expanded_address(to);
!
! menu_ClearLine(prompt_area,1);

free_string(&buffer);

! if (delay_redraw)
menu_trigger_redraw(page);
return 0;
}
***************
*** 330,347 ****
build_address_l(to,mailer_info,aview);

if (to->addrs_len == 0) { /* bad address! Removed!! */
! ClearLine(LINES-3);

free_string(&buffer);

! if (redraw)
menu_trigger_redraw(page);
return 0;
}

free_string(&buffer);

! if (redraw)
menu_trigger_redraw(page);
return 1; /* everything is okay... */
}
--- 346,363 ----
build_address_l(to,mailer_info,aview);

if (to->addrs_len == 0) { /* bad address! Removed!! */
! menu_ClearLine(prompt_area,1);

free_string(&buffer);

! if (delay_redraw)
menu_trigger_redraw(page);
return 0;
}

free_string(&buffer);

! if (delay_redraw)
menu_trigger_redraw(page);
return 1; /* everything is okay... */
}
***************
*** 350,358 ****
int copy_message,
struct mailer_info *mailer_info,


struct AliasView *aview,
! struct menu_context *page));

static int get_subject P_((struct string **field,
! struct menu_context *page));

static void send_msg_middle P_((
int index,
--- 366,376 ----
int copy_message,
struct mailer_info *mailer_info,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

static int get_subject P_((struct string **field,


! struct menu_context *page,
! struct menu_context *prompt_area));

static void send_msg_middle P_((
int index,
***************
*** 363,375 ****
struct mailer_info *mailer_info,


struct MailboxView *mailbox,
struct AliasView *aview,
! struct menu_context *page

! ));

static void send_msg_middle(index,
! given_to, given_cc, given_subject, options,
! form_letter,mailer_info,
! mailbox,aview, page)
int index;
struct expanded_address *given_to, *given_cc;
char *given_subject;
--- 381,393 ----
struct mailer_info *mailer_info,


struct MailboxView *mailbox,
struct AliasView *aview,
! struct menu_context *page,

! struct menu_context *prompt_area));

static void send_msg_middle(index,
! given_to, given_cc, given_subject, options,
! form_letter,mailer_info,
! mailbox,aview, page, prompt_area)
int index;
struct expanded_address *given_to, *given_cc;
char *given_subject;
***************
*** 378,384 ****


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

! {
char *p;
struct mailing_headers headers;
struct MailboxView *cancel_view = NULL;
--- 396,404 ----


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

! struct menu_context *prompt_area; /* NULL in patch mode */
! {
! enum copy_msg_mode copy_msg = cm_no_copy;
char *p;
struct mailing_headers headers;
struct MailboxView *cancel_view = NULL;
***************
*** 387,393 ****
int forwarding = 0 != (options & MAIL_FORWARDING);
int replying = 0 != (options & MAIL_REPLYING);

-
zero_mailing_headers(&headers);

if (!mailer_info)
--- 407,412 ----
***************
*** 420,437 ****

free_string(&X);
}
!
!
! if (OPMODE_IS_INTERACTIVE(opmode)) {

/* copy msg into edit buffer? */
! enum copy_msg_mode copy_msg = copy_the_msg(&headers,
! options, page);
!
switch (copy_msg) {
case cm_CANCEL:
goto free_it;
!
case cm_get_copy:
options |= MAIL_COPY_MSG;
break;
--- 439,459 ----

free_string(&X);
}
!
! if (prompt_area) { /* Not a batch mode */

+ DPRINT(Debug,7,(&Debug,
+ "prompt_area=%p prompt questions -- not in batch mode\n",
+ prompt_area));
+
/* copy msg into edit buffer? */
! copy_msg = copy_the_msg(&headers,
! options, page, prompt_area);
!
switch (copy_msg) {
case cm_CANCEL:
goto free_it;
!
case cm_get_copy:
options |= MAIL_COPY_MSG;
break;
***************
*** 444,508 ****
if (!forwarding &&
!replying)
cancel_view = give_canceled_mail();
break;
}

-
/* get the To: address and expand --
*/
if (! get_to(&headers.to,mailer_info,aview, page,cancel_view,
! &cancel_selection)) {
goto free_it;
}

! display_to(headers.to, page);
!
! /* get the Subject: field */
!
! if (get_subject(&headers.subject, page) == 0) {
! goto free_it;
! }

! if (prompt_for_cc) {
! if (get_copies(&headers.cc, copy_msg, mailer_info,
! aview, page) == 0) {
! goto free_it;


}
}

! {
! int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES, &COLUMNS);
!

! MoveCursor(LINES-1,0); /* so you know you've hit <return> ! */
! FlushBuffer();
! }
! }
!
! if (cancel_selection >= 0) {
! struct header_rec * H = give_header(cancel_view,cancel_selection);
!
! if (H) {
! options |= MAIL_COPY_SELECTION | MAIL_DELETE_CANCEL;
!
! /* Copy some addresses from header struct
! *
! * Actually these addresses will be overwritten whan
! * canceled mail is readed and parsed
! */
!
! if (!headers.subject && H->subject)
! headers.subject = dup_string(H->subject);
!
! expanded_address_from_items (&headers.from, H->from);
! expanded_address_from_items (&headers.to, H->to);
! expanded_address_from_items (&headers.cc, H->cc);

- }
}

-
/* expand the Cc: address */
if (&headers.cc.surface_len)
build_address_l(&headers.cc,mailer_info,aview);
--- 466,516 ----
if (!forwarding &&
!replying)
cancel_view = give_canceled_mail();
+
+ DPRINT(Debug,7,(&Debug,"cancel_view=%p%s\n",
+ cancel_view,
+ cancel_view ? "" : " (NULL)"));
+
break;
}

/* get the To: address and expand --
*/
if (! get_to(&headers.to,mailer_info,aview, page,cancel_view,
! &cancel_selection,prompt_area)) {
goto free_it;
}
+
+ if (cancel_selection >= 0) {
+ struct header_rec * H = give_header(cancel_view,cancel_selection);

! if (H) {
! options |= MAIL_COPY_SELECTION | MAIL_DELETE_CANCEL;

! /* Copy some addresses from header struct
! *
! * Actually these addresses will be overwritten whan
! * canceled mail is readed and parsed
! */
!
! if (!headers.subject && H->subject)
! headers.subject = dup_string(H->subject);
!
! expanded_address_from_items (&headers.from, H->from);
! expanded_address_from_items (&headers.to, H->to);
! expanded_address_from_items (&headers.cc, H->cc);
!
}
}
+
+ } else { /* batch mode */

! /* expand the To: address */
! if (&headers.to.surface_len)
! build_address_l(&headers.to,mailer_info,aview);

}

/* expand the Cc: address */
if (&headers.cc.surface_len)
build_address_l(&headers.cc,mailer_info,aview);
***************
*** 535,543 ****
dump_expanded_address(4,"send_msg_middle -- from ",headers.from);
dump_expanded_address(4,"send_msg_middle -- to ",headers.to);
dump_expanded_address(4,"send_msg_middle -- cc ",headers.cc);
-

! if (! OPMODE_IS_INTERACTIVE(opmode) ||
(options & MAIL_COPY_SELECTION)) {


--- 543,550 ----
dump_expanded_address(4,"send_msg_middle -- from ",headers.from);
dump_expanded_address(4,"send_msg_middle -- to ",headers.to);
dump_expanded_address(4,"send_msg_middle -- cc ",headers.cc);

! if (!prompt_area ||
(options & MAIL_COPY_SELECTION)) {


***************
*** 549,554 ****
--- 556,579 ----

} else {

+ if (get_subject(&headers.subject, page,
+ OPMODE_IS_SENDMODE(opmode) ?
+ NULL : prompt_area) == 0) {
+ goto free_it;
+ }
+
+ if (prompt_for_cc) {
+ if (get_copies(&headers.cc, copy_msg, mailer_info,
+ aview, page,
+ OPMODE_IS_SENDMODE(opmode) ?
+ NULL : prompt_area) == 0) {
+ goto free_it;
+ }
+ }
+
+ menu_MoveCursor(prompt_area,3,0); /* so you know you've hit <return> ! */
+ FlushBuffer();
+
/** generate the In-Reply-To: header... **/

if ( 0 != (options & MAIL_REPLYING)) {
***************
*** 587,600 ****


free_mailing_headers(&headers);
!
return;
}

void send_msg_l(index,
! given_to, given_cc, given_subject, options, form_letter,
! mailbox, aview, page
! )
int index;
struct addr_item *given_to, *given_cc;
char *given_subject;
--- 612,628 ----


free_mailing_headers(&headers);
!
! if (prompt_area)
! menu_trigger_redraw(prompt_area);
!
return;
}

void send_msg_l(index,
! given_to, given_cc, given_subject, options, form_letter,
! mailbox, aview, page, prompt_area
! )
int index;
struct addr_item *given_to, *given_cc;
char *given_subject;
***************
*** 602,607 ****
--- 630,636 ----


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
/* If redraw is needed use
menu_trigger_redraw(page)
***************

*** 619,627 ****
addr_to_expanded(&B,given_cc,mailer_info,aview);

send_msg_middle(index,&A,&B,
! given_subject,options,form_letter,
! mailer_info,
! mailbox, aview, page);

/* send_msg_middle does menu_trigger_redraw(page),
do not need examine */
--- 648,657 ----
addr_to_expanded(&B,given_cc,mailer_info,aview);

send_msg_middle(index,&A,&B,
! given_subject,options,form_letter,
! mailer_info,
! mailbox, aview, page,
! prompt_area);

/* send_msg_middle does menu_trigger_redraw(page),
do not need examine */
***************
*** 636,642 ****
}

void send_msg_argv(argv, given_subject, options, form, mailbox, aview,
! page)
char *argv[];
char *given_subject;
int options;
--- 666,672 ----
}

void send_msg_argv(argv, given_subject, options, form, mailbox, aview,
! page, prompt_area)
char *argv[];
char *given_subject;
int options;
***************
*** 644,649 ****
--- 674,680 ----


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NULL in patch mode */
{
struct expanded_address A, B;


struct mailer_info *mailer_info = get_mailer_info();

***************
*** 658,664 ****

send_msg_middle(-1,&A,&B,
given_subject,options,form,mailer_info,
! mailbox, aview, page);

/* send_msg_middle uses menu_trigger_redraw(),
need not examine
--- 689,695 ----

send_msg_middle(-1,&A,&B,
given_subject,options,form,mailer_info,
! mailbox, aview, page, prompt_area);

/* send_msg_middle uses menu_trigger_redraw(),
need not examine
***************
*** 672,695 ****
return;
}

! static int get_subject(subject_field, page)
struct string **subject_field;
struct menu_context *page;
{
- char ch, msgbuf[SLEN];
int code;
charset_t utf7;
- int LINES, COLUMNS;
int prompt_line;


! int redraw = 0;

!
! menu_get_sizes(page,&LINES, &COLUMNS);
!

! /** get the subject and return non-zero if all okay... **/
! prompt_line = OPMODE_IS_SENDMODE(opmode) ? 4 : LINES-3;

redraw:


! if (user_level == 0) {

code = optionally_enter2(page,
subject_field, prompt_line, 0,
OE_APPEND_CURRENT|OE_REDRAW_MARK
--- 703,731 ----
return;
}

! static int get_subject(subject_field, page, prompt_area)
struct string **subject_field;
struct menu_context *page;
+ struct menu_context *prompt_area; /* NULL if mail only mode */
{
int code;
charset_t utf7;
int prompt_line;


! int delay_redraw = 0;

! struct menu_context *p;


! int ul = give_dt_enumerate_as_int(&user_level);

redraw:
! if (!prompt_area) { /* Mail only */
! p = page;
! prompt_line = 4;
! } else {
! /* FIXME --optionally_enter* should use prompt_area */
! p = prompt_area;
! prompt_line = menu_GetAbsLine(prompt_area,1);
! }
!
! if (ul == 0) {
code = optionally_enter2(page,
subject_field, prompt_line, 0,
OE_APPEND_CURRENT|OE_REDRAW_MARK
***************
*** 715,757 ****


/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
- redraw = 1;

goto redraw;
}

if(code==-1){
/** User hit Ctrl-C key! **/
MoveCursor(prompt_line,0);
CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));

! if (redraw)
menu_trigger_redraw(page);
return(0);
}

if (!*subject_field ||
string_len(*subject_field) == 0) { /* zero length subject?? */
! elm_sfprintf(msgbuf, sizeof msgbuf,
! CATGETS(elm_msg_cat, ElmSet, ElmNoSubjectContinue,
! "No subject - Continue with message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);

! ch = want_to(msgbuf, *def_ans_no, prompt_line, 0, page);
! if (ch != *def_ans_yes) { /* user says no! */
if (sleepmsg > 0)


sleep((sleepmsg + 1) / 2);

ClearLine(prompt_line);
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSend,
"Mail not sent."));
!
! if (redraw)
menu_trigger_redraw(page);
return(0);
! }
! else {
PutLineX(prompt_line,0,
CATGETS(elm_msg_cat, ElmSet,
ElmSubjectNone,
--- 751,838 ----


/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/

+ menu_ClearScreen(page); /* Clear possible redraw mark */


+
+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+

+ delay_redraw++;
+ if (prompt_area)
+ menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area */
goto redraw;
}

if(code==-1){
+ cancel:
/** User hit Ctrl-C key! **/
MoveCursor(prompt_line,0);
CleartoEOLN();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSent,
"Mail not sent."));

! if (delay_redraw)
menu_trigger_redraw(page);
return(0);
}

if (!*subject_field ||
string_len(*subject_field) == 0) { /* zero length subject?? */
!
! int answer;
!
! redraw2:
! if (prompt_area)

! answer = prompt_letter(1,"",*def_ans_no,
! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel,
! prompt_area,

! CATGETS(elm_msg_cat, ElmSet,
! ElmNoSubjectContinue,
! "No subject - Continue with message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
! else
! answer = prompt_letter(4,"",*def_ans_no,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel,

! page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmNoSubjectContinue,
! "No subject - Continue with message? (%c/%c) "),


! *def_ans_yes, *def_ans_no);
!
!
!
! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {
! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! if (prompt_area)
! menu_ClearScreen(prompt_area);


!
! delay_redraw++; /* Can't trigger redraw yet... */

! goto redraw2;
! }


! if (TERMCH_interrupt_char == answer ||
! EOF == answer)

! goto cancel;
!
! if (answer != *def_ans_yes) { /* user says no! */
if (sleepmsg > 0)


sleep((sleepmsg + 1) / 2);

ClearLine(prompt_line);
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMailNotSend,
"Mail not sent."));
!
! if (delay_redraw)
menu_trigger_redraw(page);
return(0);
!
! } else {
PutLineX(prompt_line,0,
CATGETS(elm_msg_cat, ElmSet,
ElmSubjectNone,
***************
*** 774,780 ****
*subject_field = XX;
}

! if (redraw)
menu_trigger_redraw(page);
return(1); /** everything is cruising along okay **/
}
--- 855,861 ----
*subject_field = XX;
}

! if (delay_redraw)
menu_trigger_redraw(page);
return(1); /** everything is cruising along okay **/
}
***************
*** 783,796 ****
int copy_message,
struct mailer_info *mailer_info,


struct AliasView *aview,
! struct menu_context *page));

! static int get_copies(cc,copy_message,mailer_info,aview, page)
struct expanded_address * cc;
int copy_message;


struct mailer_info *mailer_info;
struct AliasView *aview;

struct menu_context *page;
{
/* Get the list of people that should be cc'd, returning ZERO if
* any problems arise.
--- 864,880 ----
int copy_message,
struct mailer_info *mailer_info,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

! static int get_copies(cc,copy_message,mailer_info,aview, page,
! prompt_area)
struct expanded_address * cc;
int copy_message;


struct mailer_info *mailer_info;
struct AliasView *aview;

struct menu_context *page;
+ struct menu_context *prompt_area; /* NULL if mail only */
{
/* Get the list of people that should be cc'd, returning ZERO if
* any problems arise.
***************
*** 803,837 ****
int prompt_line;
int code;


struct string *buffer = NULL;

! int LINES, COLUMNS;
! int redraw = 0;

! menu_get_sizes(page,&LINES, &COLUMNS);

! prompt_line = OPMODE_IS_SENDMODE(opmode) ? 5 : LINES - 2;

FlushBuffer();
-
- hdr_to_buffer(*cc,&buffer);

code = optionally_enter2(page,
&buffer, prompt_line,0,
! OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));
! while (REDRAW_MARK == code) {
! code = optionally_enter2(page,
! &buffer, prompt_line,0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
! "Copies to: "));


!
/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
! redraw = 1;
}

if (code == -1) { /* Ctrl-C */
--- 887,936 ----
int prompt_line;
int code;


struct string *buffer = NULL;

! int delay_redraw = 0;

! struct menu_context *p;
! int flag = 0;

! hdr_to_buffer(*cc,&buffer);

! redraw:
! if (!prompt_area) { /* Mail only */
! p = page;
! prompt_line = 5;
! } else {
! /* FIXME --optionally_enter* should use prompt_area */
! p = prompt_area;
! prompt_line = menu_GetAbsLine(prompt_area,2);
! }

FlushBuffer();

+ if (delay_redraw && buffer &&
+ string_len(buffer) >0 )
+ flag = OE_APPEND_CURRENT;
+
+
code = optionally_enter2(page,
&buffer, prompt_line,0,
! OE_REDRAW_MARK|flag|
OE_SIG_CHAR /* Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet, ElmCopiesTo,
"Copies to: "));


! if (REDRAW_MARK == code) {

/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
*/
!

! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! delay_redraw++;

! if (prompt_area)
! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area */
! goto redraw;
!
}

if (code == -1) { /* Ctrl-C */
***************
*** 845,851 ****
if (buffer)
buffer_to_header(cc,&buffer,TRUE,mailer_info,aview);

! if (redraw)
menu_trigger_redraw(page);
return(0);
}
--- 944,950 ----
if (buffer)
buffer_to_header(cc,&buffer,TRUE,mailer_info,aview);

! if (delay_redraw)
menu_trigger_redraw(page);
return(0);
}
***************
*** 876,896 ****
}
}

! if (redraw)
menu_trigger_redraw(page);
return(1); /* everything looks okay! */
}

! static enum copy_msg_mode copy_the_msg(headers, options, page)
struct mailing_headers *headers;
int options;
struct menu_context *page;
{
int forwarding = 0 != (options & MAIL_FORWARDING);
int replying = 0 != (options & MAIL_REPLYING);



- int LINES, COLUMNS;
-

/** Returns True iff the user wants to copy the message being
replied to into the edit buffer before invoking the editor!
**/
--- 975,994 ----
}
}

! if (delay_redraw)
menu_trigger_redraw(page);
return(1); /* everything looks okay! */
}

! static enum copy_msg_mode copy_the_msg(headers, options, page, prompt_area)
struct mailing_headers *headers;
int options;


struct menu_context *page;
+ struct menu_context *prompt_area;
{

int forwarding = 0 != (options & MAIL_FORWARDING);
int replying = 0 != (options & MAIL_REPLYING);

/** Returns True iff the user wants to copy the message being
replied to into the edit buffer before invoking the editor!
**/
***************
*** 899,905 ****
int redraw = 0;

again:
- menu_get_sizes(page,&LINES, &COLUMNS);

if (forwarding) {
int X = mimeforward;
--- 997,1002 ----
***************
*** 910,924 ****



/* NOTICE: prompt_letter may return EOF */

! ret = prompt_letter(LINES-4,"",def,
PROMPT_yesno|PROMPT_redraw_mark|PROMPT_cancel|
PROMPT_ctrlL,
! page,
CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,
"Forward message as separate part? (%c/%c) "),
*def_ans_yes, *def_ans_no);

if (ret == ('L'&31) || REDRAW_MARK == ret) {



/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
--- 1007,1027 ----



/* NOTICE: prompt_letter may return EOF */

! ret = prompt_letter(0,"",def,
PROMPT_yesno|PROMPT_redraw_mark|PROMPT_cancel|
PROMPT_ctrlL,
! prompt_area,
CATGETS(elm_msg_cat, ElmSet, ElmMimeFWMessageYN,
"Forward message as separate part? (%c/%c) "),
*def_ans_yes, *def_ans_no);

if (ret == ('L'&31) || REDRAW_MARK == ret) {
+ menu_ClearScreen(page); /* Clear possible redraw mark */


+
+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+

+ menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/



/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
***************
*** 948,978 ****
if (ask_reply_copy) {

int ret;
!

/* NOTICE: prompt_letter may return EOF */

! if (user_level < 2)
! ret = prompt_letter(LINES-4,"",
reply_copy ? *def_ans_yes : *def_ans_no,
PROMPT_yesno|PROMPT_redraw_mark
|PROMPT_cancel|PROMPT_ctrlL,
! page,
CATGETS(elm_msg_cat, ElmSet,
ElmCopyMessageIntoReplyYN,
"Copy message into reply? (%c/%c) "),
*def_ans_yes, *def_ans_no);
else
! ret = prompt_letter(LINES-4,"",
reply_copy ? *def_ans_yes : *def_ans_no,
PROMPT_yesno|PROMPT_redraw_mark
|PROMPT_cancel|PROMPT_ctrlL,
! page,
CATGETS(elm_msg_cat, ElmSet,
ElmCopyMessageYN,
"Copy message? (%c/%c) "),
*def_ans_yes, *def_ans_no);

if (ret == ('L'&31) || REDRAW_MARK == ret) {



/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
--- 1051,1088 ----
if (ask_reply_copy) {

int ret;


! int ul = give_dt_enumerate_as_int(&user_level);
!

/* NOTICE: prompt_letter may return EOF */

! if (ul < 2)
! ret = prompt_letter(0,"",
reply_copy ? *def_ans_yes : *def_ans_no,
PROMPT_yesno|PROMPT_redraw_mark
|PROMPT_cancel|PROMPT_ctrlL,
! prompt_area,
CATGETS(elm_msg_cat, ElmSet,
ElmCopyMessageIntoReplyYN,
"Copy message into reply? (%c/%c) "),
*def_ans_yes, *def_ans_no);
else
! ret = prompt_letter(0,"",
reply_copy ? *def_ans_yes : *def_ans_no,
PROMPT_yesno|PROMPT_redraw_mark
|PROMPT_cancel|PROMPT_ctrlL,
! prompt_area,
CATGETS(elm_msg_cat, ElmSet,
ElmCopyMessageYN,
"Copy message? (%c/%c) "),
*def_ans_yes, *def_ans_no);

if (ret == ('L'&31) || REDRAW_MARK == ret) {
+ menu_ClearScreen(page); /* Clear possible redraw mark */


+
+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+

+ menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/



/* NOTICE: using menu_trigger_redraw(page) on here

may cause redraw loop!
***************
*** 999,1014 ****
out:
if (redraw)
menu_trigger_redraw(page);
return(answer);
}

! void a_sendmsg(edit_message, form_letter, mailbox, aview, header_page,
! page)
int edit_message, form_letter;


struct MailboxView *mailbox;
struct AliasView *aview;
- int header_page;
struct menu_context *page;
{

/** Prompt for fields and then call mail() to send the specified
message. If 'edit_message' is true then by defualt go to
--- 1109,1126 ----
out:
if (redraw)
menu_trigger_redraw(page);
+
+ DPRINT(Debug,7,(&Debug,"copy_the_msg=%d\n",answer));
return(answer);
}

! void a_sendmsg(edit_message, form_letter, mailbox, aview,
! page, LOC)
int edit_message, form_letter;


struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
+ struct screen_parts *LOC;
{

/** Prompt for fields and then call mail() to send the specified
message. If 'edit_message' is true then by defualt go to
***************
*** 1023,1031 ****

struct mailing_headers headers;


struct mailer_info *mailer_info = get_mailer_info();

- int LINES, COLUMNS;
-
- menu_get_sizes(page,&LINES, &COLUMNS);

zero_mailing_headers(&headers);

--- 1135,1140 ----
***************
*** 1045,1062 ****

/* get the Subject: field */

! if (get_subject(&headers.subject,page) == 0) {
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, FALSE,mailer_info, aview,
! page) == 0) {
goto free_it;
}
}

! MoveCursor(LINES-1,0); /* so you know you've hit <return> ! */
FlushBuffer();

/* and mail that puppy outta here! */
--- 1154,1172 ----

/* get the Subject: field */

! if (get_subject(&headers.subject,page,
! LOC->prompt_page) == 0) {
goto free_it;
}

if (prompt_for_cc) {
if (get_copies(&headers.cc, FALSE,mailer_info, aview,
! page, LOC->prompt_page) == 0) {
goto free_it;
}
}

! menu_MoveCursor(LOC->prompt_page,3,0); /* so you know you've hit <return> ! */
FlushBuffer();

/* and mail that puppy outta here! */
***************
*** 1072,1083 ****
dump_expanded_address(5,"cc",headers.cc);
dump_expanded_address(5,"bcc",headers.bcc);

- main_state();
mail(-1, edit_message ? MAIL_EDIT_MSG : 0, form_letter,
&headers,mailer_info,
mailbox, aview, page,
NULL,-1);
- main_state();

/*
* Since we got this far, it must be okay to clear the tags.
--- 1182,1191 ----
***************
*** 1087,1101 ****
struct alias_rec * a = give_alias(aview,i);

if (a &&
! ison(a->status, TAGGED)) {
!
struct menu_common MENU;

clearit(a->status, TAGGED);
!
set_mcommon_from_aliasview(&MENU,aview);
!
! show_msg_tag(i,&MENU, header_page);
tagged--;
}
i++;
--- 1195,1211 ----
struct alias_rec * a = give_alias(aview,i);

if (a &&
! ison(a->status, TAGGED)) {
struct menu_common MENU;
+ int vis;

clearit(a->status, TAGGED);
!

set_mcommon_from_aliasview(&MENU,aview);
!
! vis = compute_visible(i+1, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);
!

tagged--;
}
i++;
Index: elmME+.2.5.alpha5-cvs/src/mailmsg2.c
*** elmME+.2.5.alpha4/src/mailmsg2.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/mailmsg2.c 2005-07-26 11:28:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.8.16 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.16 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.8.22 2005/07/26 08:28:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.76.8.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 47,57 ****
return (unsigned char *)str;
}

! static CONST unsigned char *cs2cus P_((const char *str));
! static CONST unsigned char *cs2cus(str)

! CONST char *str;
{
! return (CONST unsigned char *)str;
}

#include <errno.h>
--- 47,57 ----
return (unsigned char *)str;
}

! static const unsigned char *cs2cus P_((const char *str));
! static const unsigned char *cs2cus(str)

! const char *str;
{
! return (const unsigned char *)str;
}

#include <errno.h>
***************
*** 61,70 ****

extern char version_buff[];

- char *error_description();
- long ftell();
-
-
int gotten_key;

static int verify_transmission P_((char *filename,int *form_p,
--- 61,66 ----
***************
*** 104,118 ****
FlushBuffer();


}

! static CONST unsigned char * csUs P_((const char *str));
! static CONST unsigned char * csUs(str)
! CONST char *str;
{
! return (CONST unsigned char *)str;
}

struct string * gen_From_buffer(current_header)
! CONST struct header_rec * current_header;
{
struct string * From_buffer = NULL;

--- 100,114 ----
FlushBuffer();


}

! static const unsigned char * csUs P_((const char *str));
! static const unsigned char * csUs(str)
! const char *str;
{
! return (const unsigned char *)str;
}

struct string * gen_From_buffer(current_header)
! const struct header_rec * current_header;
{
struct string * From_buffer = NULL;

***************
*** 154,159 ****
--- 150,156 ----
{
int i;
int changed = 0;


+ int an = give_dt_enumerate_as_int(&allow_no_encoding);

if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));
***************
*** 185,194 ****
}
}

! if (allow_no_encoding >= 2)
/* Just send BINARY anyway */
mime_info->raw_level = mailer_binary;
! else if (allow_no_encoding >= 1 &&
mime_info->raw_level < mailer_8bit)
/* Just send 8BIT anyway */
mime_info->raw_level = mailer_8bit;
--- 182,191 ----
}
}

! if (an >= 2)
/* Just send BINARY anyway */
mime_info->raw_level = mailer_binary;
! else if (an >= 1 &&
mime_info->raw_level < mailer_8bit)
/* Just send 8BIT anyway */
mime_info->raw_level = mailer_8bit;
***************
*** 233,238 ****
--- 230,236 ----
out_state_t state_out;
in_state_t state_in;
char *fname;
+ char *tmp;

if (0 != fseek(mailbox_file,mime_rec->offset,SEEK_SET)) {
DPRINT(Debug,3,(&Debug,
***************
*** 241,252 ****
return NULL;
}


out_state_clear(&state_out, STATE_out_file);
in_state_clear(&state_in, STATE_in_file);

fname = elm_message(FRM("%smsgpart.%d-%d"),
! temp_dir, getpid (),
PART_COUNT++);

F = safeopen_rdwr(fname);
--- 239,253 ----
return NULL;

}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ return NULL;

out_state_clear(&state_out, STATE_out_file);
in_state_clear(&state_in, STATE_in_file);

fname = elm_message(FRM("%smsgpart.%d-%d"),
! tmp, getpid (),
PART_COUNT++);

F = safeopen_rdwr(fname);
***************
*** 363,373 ****
charset_t cur_editcharset = NULL;



struct menu_context *page = NULL;

!
/* Fail if no mailer available */
if (!mailer_info)


return;

/* free_mailing_headers will free this */

if (!headers->env_from)
headers->env_from = mailer_get_env_from(mailer_info);
--- 364,380 ----
charset_t cur_editcharset = NULL;



struct menu_context *page = NULL;

! char *tmp;
!
! tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
! if (!tmp)
! return;
!
/* Fail if no mailer available */
if (!mailer_info)
return;

+

/* free_mailing_headers will free this */

if (!headers->env_from)
headers->env_from = mailer_get_env_from(mailer_info);
***************
*** 383,392 ****
gotten_key = 0; /* ignore previously gotten encryption key */

/** first generate the temporary filename **/

elm_sfprintf(cur_editfile,sizeof cur_editfile,
FRM("%s%s%d"),
! temp_dir, temp_file, getpid());


/* verify_transmission() displays new screen,
--- 390,400 ----
gotten_key = 0; /* ignore previously gotten encryption key */

/** first generate the temporary filename **/
+

elm_sfprintf(cur_editfile,sizeof cur_editfile,
FRM("%s%s%d"),
! tmp, temp_file, getpid());


/* verify_transmission() displays new screen,
***************
*** 403,412 ****
err = errno;
DPRINT(Debug,1,(&Debug,
"Attempt to write to temp file %s failed with error %s (mail)\n",
! cur_editfile, error_description(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotCreateFile,
"Could not create file %s (%s)."),
! cur_editfile, error_description(errno));

goto fail_label;

--- 411,420 ----
err = errno;
DPRINT(Debug,1,(&Debug,
"Attempt to write to temp file %s failed with error %s (mail)\n",
! cur_editfile, strerror(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotCreateFile,
"Could not create file %s (%s)."),
! cur_editfile, strerror(errno));

goto fail_label;

***************
*** 432,438 ****
if (err) {
DPRINT(Debug,1,(&Debug,
"Can't open included file %s (can_open). Failed with error %s (mail)\n",
! included_file, error_description(errno)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenFile,
"Could not open file %s."),
included_file);
--- 440,446 ----
if (err) {
DPRINT(Debug,1,(&Debug,
"Can't open included file %s (can_open). Failed with error %s (mail)\n",
! included_file, strerror(errno)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenFile,
"Could not open file %s."),
included_file);
***************
*** 443,449 ****
if ((input = fopen(included_file,"r")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Can't open included file %s. Failed with error %s (mail)\n",
! included_file, error_description(errno)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenFile,
"Could not open file %s."),
included_file);
--- 451,457 ----
if ((input = fopen(included_file,"r")) == NULL) {
DPRINT(Debug,1,(&Debug,
"Can't open included file %s. Failed with error %s (mail)\n",
! included_file, strerror(errno)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenFile,
"Could not open file %s."),
included_file);
***************
*** 467,474 ****
handle_mailer_options(mailer_info,&MIME_info,&dsn,
&attachments, NULL);

! if (mailbox && mail_index >= 0 &&
! (copy_msg || forwarding) ||
copy_selection) {
struct header_rec * hdr = NULL;
FILE * mailbox_file = NULL;
--- 475,483 ----
handle_mailer_options(mailer_info,&MIME_info,&dsn,
&attachments, NULL);

! if ((mailbox && mail_index >= 0 &&
! (copy_msg || forwarding))
! ||
copy_selection) {
struct header_rec * hdr = NULL;
FILE * mailbox_file = NULL;
***************
*** 500,506 ****

if (copy_msg == FORM) {
elm_sfprintf(fname, sizeof fname,


! FRM("%s%s%d"), temp_dir, temp_form_file, getpid());

/* we can't retransmit a form! */
fclose(reply); reply = NULL;
--- 509,515 ----

if (copy_msg == FORM) {
elm_sfprintf(fname, sizeof fname,


! FRM("%s%s%d"), tmp, temp_form_file, getpid());

/* we can't retransmit a form! */
fclose(reply); reply = NULL;
***************
*** 566,573 ****

elm_sfprintf (very_long_buffer, sizeof very_long_buffer,
FRM("%selmfwd.%d"),
! temp_dir, getpid ());
!
if (! (tmpfp = safeopen_rdwr (very_long_buffer))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailFileForward,
"Failed to create file for forwarding"));
--- 575,582 ----

elm_sfprintf (very_long_buffer, sizeof very_long_buffer,
FRM("%selmfwd.%d"),
! tmp, getpid ());
!
if (! (tmpfp = safeopen_rdwr (very_long_buffer))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailFileForward,
"Failed to create file for forwarding"));
***************
*** 576,591 ****

mime_t_zero(&attach);

! attach.pathname = safe_strdup(very_long_buffer);
!
copy_message_f(mailbox_file,hdr,tmpfp,
CM_REMOVE_ENVELOPE,NULL);

attach.length = fsize(tmpfp);
fclose (tmpfp);

! attach.unlink = 1; /* mark for later deletion */
! attach.TYPE = give_media_type2(MIME_TYPE_MESSAGE,"rfc822", 0);
if (!attach.TYPE)
mime_panic(__FILE__,__LINE__,"mail",
"message/rfc822 is not known");
--- 585,603 ----

mime_t_zero(&attach);

! attach.pathname0 = safe_strdup(very_long_buffer);
! attach.dispname = new_string2(system_charset,
! s2us(very_long_buffer));
!
copy_message_f(mailbox_file,hdr,tmpfp,
CM_REMOVE_ENVELOPE,NULL);

attach.length = fsize(tmpfp);
fclose (tmpfp);

! attach.unlink = 2; /* mark for later deletion */
! attach.TYPE = give_media_type2(MIME_TYPE_MESSAGE,"rfc822",
! 0);
if (!attach.TYPE)
mime_panic(__FILE__,__LINE__,"mail",
"message/rfc822 is not known");
***************
*** 620,628 ****
/* make referenced message as edited message */
header_list_ptr all_headers,walk;
int Flags, major;
! CONST char *subtype;
! char buffer[80];
!
DPRINT(Debug,4, (&Debug,
"Not forwarding, copying message normally or mime attaching, making message as edited -- copy_selection=%d\n",
copy_selection));
--- 632,639 ----
/* make referenced message as edited message */
header_list_ptr all_headers,walk;
int Flags, major;
! const char *subtype;
!
DPRINT(Debug,4, (&Debug,
"Not forwarding, copying message normally or mime attaching, making message as edited -- copy_selection=%d\n",
copy_selection));
***************
*** 636,642 ****


for (walk = all_headers; walk; walk = walk -> next_header) {
! CONST char * hdr_name = give_header_name(walk->header_name);

if (0 == strincmp(hdr_name,"Content-",8) ||
0 == istrcmp(hdr_name,"MIME-Version") ||
--- 647,653 ----


for (walk = all_headers; walk; walk = walk -> next_header) {
! const char * hdr_name = give_header_name(walk->header_name);

if (0 == strincmp(hdr_name,"Content-",8) ||
0 == istrcmp(hdr_name,"MIME-Version") ||
***************
*** 659,695 ****


if (! hdr->mime_rec.TYPE) {
! DPRINT(Debug,4, (&Debug, "no mime type -- will not pick message for sending\n"));
! goto fail1;
! }

! Flags = get_type_flags(hdr->mime_rec.TYPE);
! major = get_major_type_code(hdr->mime_rec.TYPE);
! subtype = get_subtype_name(hdr->mime_rec.TYPE);
!
! /* 1) Includes only one text part -- put it to edit buffer */
! if (MIME_TYPE_TEXT == major && 0 == istrcmp(subtype,"Plain") &&
! DISP_INLINE == hdr->mime_rec.disposition) {
!
! char * filename =
! mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
! reply,mime_body_keywords);
!
! if (filename) {
! unlink(filename);
! free(filename);
! }


! if (!mime_get_param("charset",buffer,hdr->mime_rec.type_opts,sizeof buffer)) {
! DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
! goto fail1;
! }

! cur_editcharset = MIME_name_to_charset(buffer,0);
if (!cur_editcharset) {
DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! buffer));
goto fail1;
}

--- 670,709 ----


if (! hdr->mime_rec.TYPE) {
! DPRINT(Debug,4, (&Debug, "no mime type -- will not pick message for sending\n"));
! goto fail1;
! }
!
! Flags = get_type_flags(hdr->mime_rec.TYPE);
! major = get_major_type_code(hdr->mime_rec.TYPE);
! subtype = get_subtype_name(hdr->mime_rec.TYPE);
!
! /* 1) Includes only one text part -- put it to edit buffer */
! if (MIME_TYPE_TEXT == major && 0 == istrcmp(subtype,"Plain") &&
! DISP_INLINE == hdr->mime_rec.disposition) {

! const char *cs = NULL;

+ char * filename =
+ mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
+ reply,mime_body_keywords);
+
+ if (filename) {
+ unlink(filename);
+ free(filename);
+ }

! cs = get_mime_param_compat(hdr->mime_rec.TYPE_opts,
! "charset");
! if (!cs) {
! DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
! goto fail1;
! }

! cur_editcharset = MIME_name_to_charset(cs,0);
if (!cur_editcharset) {
DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! cs));
goto fail1;
}

***************
*** 699,705 ****
cur_editcharset->MIME_name ?
cur_editcharset->MIME_name :
"<no MIME name>",
! buffer,
display_charset->MIME_name ?
display_charset->MIME_name :
"<no MIME name>"));
--- 713,719 ----
cur_editcharset->MIME_name ?
cur_editcharset->MIME_name :
"<no MIME name>",
! cs,
display_charset->MIME_name ?
display_charset->MIME_name :
"<no MIME name>"));
***************
*** 723,730 ****
(z = mime_parser_index(hdr->mime_rec.parser_data,0)) &&
z->TYPE) {
int major = get_major_type_code(z->TYPE);
! CONST char *subtype = get_subtype_name(z->TYPE);

if (MIME_TYPE_TEXT == major && 0 == istrcmp(subtype,"Plain") &&
DISP_INLINE == z->disposition) {

--- 737,746 ----
(z = mime_parser_index(hdr->mime_rec.parser_data,0)) &&
z->TYPE) {
int major = get_major_type_code(z->TYPE);
! const char *subtype = get_subtype_name(z->TYPE);

+ const char *cs = NULL;
+
if (MIME_TYPE_TEXT == major && 0 == istrcmp(subtype,"Plain") &&
DISP_INLINE == z->disposition) {

***************
*** 736,751 ****
free(filename);
}

!
! if (!mime_get_param("charset",buffer,z->type_opts,sizeof buffer)) {
DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
goto fail2;
}

! cur_editcharset = MIME_name_to_charset(buffer,0);
if (!cur_editcharset) {
DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! buffer));
goto fail2;
}

--- 752,768 ----
free(filename);
}

! cs = get_mime_param_compat(z->TYPE_opts,
! "charset");
! if (!cs) {
DPRINT(Debug,4, (&Debug, "No charset parameter?\n"));
goto fail2;
}

! cur_editcharset = MIME_name_to_charset(cs,0);
if (!cur_editcharset) {
DPRINT(Debug,4, (&Debug, "charset parameter %s unknown?\n",
! cs));
goto fail2;
}

***************
*** 755,761 ****
cur_editcharset->MIME_name ?
cur_editcharset->MIME_name :
"<no MIME name>",
! buffer,
display_charset->MIME_name ?
display_charset->MIME_name :
"<no MIME name>"));
--- 772,778 ----
cur_editcharset->MIME_name ?
cur_editcharset->MIME_name :
"<no MIME name>",
! cs,
display_charset->MIME_name ?
display_charset->MIME_name :
"<no MIME name>"));
***************
*** 794,809 ****

mime_t_zero(&attach);

! attach.pathname = mmsg_copy_part(mailbox_file,z,
NULL,0);
! if (!attach.pathname) {
DPRINT(Debug,4, (&Debug,
"Failed to copy part %d/%d\n",
x,c));
continue;
}

! attach.unlink = 1; /* mark for later deletion */
attach.TYPE = z->TYPE;
attach.encoding = z->encoding;
attach.disposition = z->disposition;
--- 811,829 ----

mime_t_zero(&attach);

! attach.pathname0 = mmsg_copy_part(mailbox_file,z,
NULL,0);
! if (!attach.pathname0) {
DPRINT(Debug,4, (&Debug,
"Failed to copy part %d/%d\n",
x,c));
continue;
}
+ attach.dispname = new_string2(display_charset,
+ s2us(attach.pathname0));

!
! attach.unlink = 2; /* mark for later deletion */
attach.TYPE = z->TYPE;
attach.encoding = z->encoding;
attach.disposition = z->disposition;
***************
*** 812,823 ****
attach.description = dup_string(z->description);
}

! if (z->type_opts) {
! attach.type_opts = safe_strdup(z->type_opts);
}

! if (z->disposition_opts) {
! attach.disposition_opts = safe_strdup(z->disposition_opts);
}

add_Attachments(&attachments,&attach);
--- 832,844 ----
attach.description = dup_string(z->description);
}

! if (z->TYPE_opts) {
! attach.TYPE_opts = copy_mime_param(z->TYPE_opts);
}

! if (z->DISPOSITION_opts) {
! attach.DISPOSITION_opts =
! copy_mime_param(z->DISPOSITION_opts);
}

add_Attachments(&attachments,&attach);
***************
*** 837,851 ****

mime_t_zero(&attach);

! attach.pathname = mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
NULL,0);
! if (!attach.pathname) {
DPRINT(Debug,4, (&Debug,
"Failed to copy messge \n"));
goto fail1;
}

! attach.unlink = 1; /* mark for later deletion */
attach.TYPE = hdr->mime_rec.TYPE;
attach.encoding = hdr->mime_rec.encoding;
attach.disposition = hdr->mime_rec.disposition;
--- 858,875 ----

mime_t_zero(&attach);

! attach.pathname0 = mmsg_copy_part(mailbox_file,& (hdr->mime_rec),
NULL,0);
! if (!attach.pathname0) {
DPRINT(Debug,4, (&Debug,
"Failed to copy messge \n"));
goto fail1;
}

! attach.dispname = new_string2(display_charset,
! s2us(attach.pathname0));
!
! attach.unlink = 2; /* mark for later deletion */
attach.TYPE = hdr->mime_rec.TYPE;
attach.encoding = hdr->mime_rec.encoding;
attach.disposition = hdr->mime_rec.disposition;
***************
*** 855,867 ****
dup_string(hdr->mime_rec.description);
}

! if (hdr->mime_rec.type_opts) {
! attach.type_opts = safe_strdup(hdr->mime_rec.type_opts);
}

! if (hdr->mime_rec.disposition_opts) {
! attach.disposition_opts =
! safe_strdup(hdr->mime_rec.disposition_opts);
}

add_Attachments(&attachments,&attach);
--- 879,892 ----
dup_string(hdr->mime_rec.description);
}

! if (hdr->mime_rec.TYPE_opts) {
! attach.TYPE_opts =
! copy_mime_param(hdr->mime_rec.TYPE_opts);
}

! if (hdr->mime_rec.DISPOSITION_opts) {
! attach.DISPOSITION_opts =
! copy_mime_param(hdr->mime_rec.DISPOSITION_opts);
}

add_Attachments(&attachments,&attach);
***************
*** 981,986 ****
--- 1006,1017 ----
MIME_info.encode_hdr,
aview,
page);
+
+
+ DPRINT(Debug,8,(&Debug,
+ " ... virify_transmission result = %d, attachment_count=%d\n",
+ code,attachments.attachment_count));
+
/* Empty ... */
if (-2 == code && !attachments.attachment_count) {
goto fail_label;
***************
*** 991,1000 ****
if (err) {
DPRINT(Debug,1,(&Debug,
"Attempt to open file %s for reading failed with error %s (mail) -- can_open\n",
! cur_editfile, error_description(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenReply,
"Could not open reply file (%s)."),
! error_description(err));

goto fail_label;
}
--- 1022,1031 ----
if (err) {
DPRINT(Debug,1,(&Debug,
"Attempt to open file %s for reading failed with error %s (mail) -- can_open\n",
! cur_editfile, strerror(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenReply,
"Could not open reply file (%s)."),
! strerror(err));

goto fail_label;
}
***************
*** 1003,1012 ****
err = errno;
DPRINT(Debug,1,(&Debug,
"Attempt to open file %s for reading failed with error %s (mail)\n",
! cur_editfile, error_description(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenReply,
"Could not open reply file (%s)."),
! error_description(err));

goto fail_label;
}
--- 1034,1043 ----
err = errno;
DPRINT(Debug,1,(&Debug,
"Attempt to open file %s for reading failed with error %s (mail)\n",
! cur_editfile, strerror(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCouldNotOpenReply,
"Could not open reply file (%s)."),
! strerror(err));

goto fail_label;
}
***************
*** 1046,1052 ****
MIME_info.need_enc |= check_8bit_string (headers->subject);
#endif

! if (check_for_multipart(reply, &MIME_info,mailer_info) < 0) {
/* Error in [include ...] */
if (code < 0)
goto fail_label;
--- 1077,1084 ----
MIME_info.need_enc |= check_8bit_string (headers->subject);
#endif

! if (check_for_multipart(reply, &MIME_info,mailer_info,
! cur_editcharset) < 0) {
/* Error in [include ...] */
if (code < 0)
goto fail_label;
***************
*** 1063,1069 ****
if (converted_buffer)
fclose(converted_buffer);
temp1 = elm_message(FRM("%selmcv-%d-%d"),
! temp_dir, getpid (),
conv_count++);
converted_buffer = safeopen_rdwr(temp1);
if (!converted_buffer) {
--- 1095,1101 ----
if (converted_buffer)
fclose(converted_buffer);
temp1 = elm_message(FRM("%selmcv-%d-%d"),
! tmp, getpid (),
conv_count++);
converted_buffer = safeopen_rdwr(temp1);
if (!converted_buffer) {
***************
*** 1106,1120 ****
} else
MIME_info.msg_is_multipart = MIME_info.top_parts_count > 1;

/* End of check_for_multipart failure loop */
} while (OPMODE_IS_INTERACTIVE(opmode) && reask_verify);

if (MIME_info.msg_is_multipart) {
(void) mime_generate_boundary (MIME_info.mime_boundary,
sizeof MIME_info.mime_boundary);
! add_parameter_1(&(MIME_info.type_opts_top), "boundary",
! MIME_info.mime_boundary,
! FALSE);
}

if (headers->from.addrs_len > 0) {
--- 1138,1159 ----
} else
MIME_info.msg_is_multipart = MIME_info.top_parts_count > 1;

+
+ DPRINT(Debug,8,(&Debug,
+ " ... top_parts_count=%d, msg_is_multipart=%d\n",
+ MIME_info.top_parts_count,
+ MIME_info.msg_is_multipart));
+
+
/* End of check_for_multipart failure loop */
} while (OPMODE_IS_INTERACTIVE(opmode) && reask_verify);

if (MIME_info.msg_is_multipart) {
(void) mime_generate_boundary (MIME_info.mime_boundary,
sizeof MIME_info.mime_boundary);
! mime_params_add_compat(&(MIME_info.TYPE_opts_top),
! "boundary",
! MIME_info.mime_boundary);
}

if (headers->from.addrs_len > 0) {
***************
*** 1141,1153 ****
headers->sender));
}

! if (code == -1 /* Forget */ ||
! code < 0 && MIME_info.msg_is_multipart) {

struct MailboxView *cm = give_canceled_mail();

char * lbuf = NULL;
- int i;
out_state_t fp_copy;
FILE *F = NULL;
time_t now = time(NULL);
--- 1180,1190 ----
headers->sender));
}

! if (code < 0 /* Forget */) {

struct MailboxView *cm = give_canceled_mail();

char * lbuf = NULL;
out_state_t fp_copy;
FILE *F = NULL;
time_t now = time(NULL);
***************
*** 1348,1354 ****


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
"Failed: %.30s: %.40s"),

get_mailer_path(fd.mail_fd),
! error_description(rs->save_errno));
else if (exit_code) {
lib_error(
CATGETS(elm_msg_cat, ElmSet,
--- 1385,1391 ----


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
"Failed: %.30s: %.40s"),

get_mailer_path(fd.mail_fd),
! strerror(rs->save_errno));
else if (exit_code) {
lib_error(
CATGETS(elm_msg_cat, ElmSet,
***************
*** 1361,1367 ****
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmLostErrno,
"%.30s lost: %.40s"),
get_mailer_path(fd.mail_fd),
! error_description(rs->save_errno));
}
}

--- 1398,1404 ----
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmLostErrno,
"%.30s lost: %.40s"),
get_mailer_path(fd.mail_fd),
! strerror(rs->save_errno));
}
}

***************
*** 1415,1430 ****

#define BOL 1
static struct menu_item dsn_items[] = {
! { "Return H)eaders only on FAILURE:", 'h', 3, BOL, (char *) &hdr_only,
! sizeof hdr_only },
! { "Return DSN on F)AILURE :", 'f', 5, BOL, (char *) &failure,
! sizeof failure },
! { " D)ELAY :", 'd', 6, BOL, (char *) &delay,
! sizeof delay },
! { " S)UCCESS :", 's', 7, BOL, (char *) &success,
! sizeof success },
! { "U)se defaults (DSN off) :", 'u', 12, BOL, (char *) &DSN_off,
! sizeof DSN_off }
};

if (0 == *dsn)
--- 1452,1472 ----

#define BOL 1
static struct menu_item dsn_items[] = {
! { "Return H)eaders only on FAILURE:", 'h', 3, BOL,
! { (char *) &hdr_only},
! sizeof hdr_only },
! { "Return DSN on F)AILURE :", 'f', 5, BOL,
! { (char *) &failure },
! sizeof failure },
! { " D)ELAY :", 'd', 6, BOL,
! { (char *) &delay },
! sizeof delay },
! { " S)UCCESS :", 's', 7, BOL,
! { (char *) &success },
! sizeof success },
! { "U)se defaults (DSN off) :", 'u', 12, BOL,
! { (char *) &DSN_off },
! sizeof DSN_off }
};

if (0 == *dsn)
***************
*** 1467,1473 ****
if (headers->env_from) {
int ret;
int can_edit;
! CONST char *t = mailer_env_from_value(headers->env_from,&can_edit);


struct string *buffer = NULL;

int LINES, COLUMNS;
--- 1509,1515 ----
if (headers->env_from) {
int ret;
int can_edit;
! const char *t = mailer_env_from_value(headers->env_from,&can_edit);


struct string *buffer = NULL;

int LINES, COLUMNS;
***************
*** 1521,1534 ****

if (can_edit) {
if (t)
! PutLineX(5,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFrom,
"R)eturn-path: %s"),
t);
else
! PutLineX(5,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFromDef,
"R)eturn-path: (default)"));
} else if (t)
! PutLineX(5,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFromNoEdit,
"Return-path: %s"),
t);

--- 1563,1576 ----

if (can_edit) {
if (t)
! PutLineX(12,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFrom,
"R)eturn-path: %s"),
t);
else
! PutLineX(12,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFromDef,
"R)eturn-path: (default)"));
} else if (t)
! PutLineX(12,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFromNoEdit,
"Return-path: %s"),
t);

***************
*** 1540,1545 ****
--- 1582,1588 ----
/*
* verify_transmission() - Ask the user to confirm transmission of the
* message. Returns 0 to send it, -1 to forget it.
+ * -2 to forget empty file
*/
static int verify_transmission(filename, form_p, need_redraw_p,
already_has_text, copy_file, force_cmd, options,
***************
*** 1569,1576 ****
struct menu_context *page; /* new menu context assumed! */
{
char *prompt_mssg = NULL; /* message to display prompting for cmd */
! char prompt_menu[SLEN], /* menu of available commands */
! prompt_menu2[SLEN];
int bad_cmd; /* set TRUE to bitch about user's entry */
int did_prompt; /* TRUE if cmd prompted for and entered */
int prev_form; /* "*form_p" value last time thru loop */
--- 1612,1620 ----
struct menu_context *page; /* new menu context assumed! */
{
char *prompt_mssg = NULL; /* message to display prompting for cmd */
! char prompt_menu1[SLEN], /* menu of available commands */
! prompt_menu2[SLEN],
! prompt_menu3[SLEN];
int bad_cmd; /* set TRUE to bitch about user's entry */
int did_prompt; /* TRUE if cmd prompted for and entered */
int prev_form; /* "*form_p" value last time thru loop */
***************
*** 1582,1603 ****
#ifdef USE_PGP
int was_pgp_encoded = 0 != (options & MAIL_HAVE_PGP_ENCODED);
#endif
! int def_cmd = 's';
int do_redraw = 1;


int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

#ifdef USE_PGP
if (replying && was_pgp_encoded &&
! (pgp_status & PGP_MESSAGE))
! def_cmd = 'p';
#endif

prev_form = *form_p + 1; /* force build of prompt strings */
bad_cmd = FALSE; /* nothing to complain about yet */

for (;;) {

if (0) {
redraw:
--- 1626,1656 ----
#ifdef USE_PGP
int was_pgp_encoded = 0 != (options & MAIL_HAVE_PGP_ENCODED);
#endif
! int def_cmd = 'y';
int do_redraw = 1;
int LINES, COLUMNS;
+ int ul = give_dt_enumerate_as_int(&user_level);
+ struct menu_context *prompt_area = NULL;
+ int ret = -1;
+

menu_get_sizes(page,&LINES, &COLUMNS);

+ prompt_area =
+ new_menu_subpage(page,LINES-4,4,
+ subpage_simple_noredraw,NULL);
+
#ifdef USE_PGP
if (replying && was_pgp_encoded &&
! (pgp_status & PGP_MESSAGE))
! def_cmd = 'P';
#endif

prev_form = *form_p + 1; /* force build of prompt strings */
bad_cmd = FALSE; /* nothing to complain about yet */

for (;;) {
+ menu_set_default(page);

if (0) {
redraw:
***************
*** 1608,1619 ****
--- 1661,1676 ----


if (menu_resized(page)) {

menu_get_sizes(page,&LINES, &COLUMNS);
+

+ menu_subpage_relocate(prompt_area,page,LINES-4,4);


+
do_redraw = 1;

} else if (menu_need_redraw(page))

do_redraw = 1;

if (do_redraw) {
+
do_redraw = 0;
*need_redraw_p = TRUE;

***************
*** 1627,1750 ****

show_presend_headers(headers,hdr_charset, page);

! if (headers->env_from && user_level > 0) {
int can_edit;
! CONST char *t = mailer_env_from_value(headers->env_from,&can_edit);

if (can_edit) {
if (t)
! PutLineX(5,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFrom,
"R)eturn-path: %s"),
t);
else
! PutLineX(5,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFromDef,
"R)eturn-path: (default)"));
} else if (t)
! PutLineX(5,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFromNoEdit,
"Return-path: %s"),
t);
}
}

/* build up prompt and menu strings */
if (prev_form == *form_p) {
; /* not changed - no need to rebuild the strings */
! } else if (user_level == 0) {
! prompt_mssg = catgets(elm_msg_cat, ElmSet, ElmVfyPromptPleaseChoose,
! "Please choose one of the following options by parenthesized letter: s");
! strfcpy(prompt_menu,
! catgets(elm_msg_cat, ElmSet, ElmVfyMenuUser0,
! "e)dit message, edit h)eaders, s)end it, or f)orget it."),
! sizeof prompt_menu);
! prompt_menu2[0] = '\0';

/* In some conditions add these also to menu in user_level == 0 */
- if (have_attachments)
- strfcat(prompt_menu2, "a)ttachments", sizeof prompt_menu2);

if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
DPRINT(Debug,10,(&Debug,"mailer supports DSN\n"));

if (dsn && *dsn != 0) {
! if (prompt_menu2[0]) strfcat(prompt_menu2,", ",
! sizeof prompt_menu2);
! strfcat(prompt_menu2, "D)SN", sizeof prompt_menu2);
}
}
#ifdef USE_PGP
if (replying && was_pgp_encoded) {
! if (prompt_menu2[0]) strfcat(prompt_menu2,", ",
! sizeof prompt_menu2);
! strfcat(prompt_menu2, "p)gp", sizeof prompt_menu2);
}
#endif
} else {
! prompt_mssg = catgets(elm_msg_cat, ElmSet, ElmVfyPromptAndNow,
! "And now: s");
switch (*form_p) {
case PREFORMATTED:
- prompt_menu[0] = '\0';
break;
case YES:
! strfcpy(prompt_menu, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuEditForm,
! "e)dit form, "),
! sizeof prompt_menu);
break;
case MAYBE:
! strfcpy(prompt_menu, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuEditMake,
! "e)dit msg, m)ake form, "),
! sizeof prompt_menu);
break;
default:
! strfcpy(prompt_menu, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuEditMsg,
! "e)dit message, "),
! sizeof prompt_menu);
break;
}
! strfcat(prompt_menu, catgets(elm_msg_cat, ElmSet, ElmVfyMenuVfyCpy,
! "h)eaders, c)opy, "),
! sizeof prompt_menu);
#ifdef ISPELL
! strfcat(prompt_menu, catgets(elm_msg_cat, ElmSet, ElmVfyMenuIspell,
! "i)spell, "),
! sizeof prompt_menu);
#endif
#ifdef ALLOW_SUBSHELL
! strfcat(prompt_menu, catgets(elm_msg_cat, ElmSet, ElmVfyMenuShell,
"!)shell, "),
! sizeof prompt_menu);
#endif
! /* The previous line was getting too full... */
! prompt_menu2[0] = '\0';
! strfcat(prompt_menu2, "a)ttachments", sizeof prompt_menu2);
if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
DPRINT(Debug,10,(&Debug,"mailer supports DSN\n"));

! if (dsn) strfcat(prompt_menu2, ", D)SN", sizeof prompt_menu2);
}
#ifdef USE_PGP
! if (prompt_menu2[0]) strfcat(prompt_menu2,", ",
! sizeof prompt_menu2);
! strfcat(prompt_menu2, "p)gp", sizeof prompt_menu2);
#endif
- strfcat(prompt_menu, catgets(elm_msg_cat, ElmSet, ElmVfyMenuSndFgt,
- "s)end, or f)orget"),
- sizeof prompt_menu);
}

prev_form = *form_p;

/* complain if last entry was bad */
if (bad_cmd) {
! Write_to_screen(FRM("%c??"), 07);
if (sleepmsg > 0)


error_sleep((sleepmsg + 1) / 2);

bad_cmd = FALSE;
}

/* if we don't have a cmd, display prompt and get response from user */
if (force_cmd != '\0' &&
isascii(force_cmd)) {
--- 1684,1858 ----

show_presend_headers(headers,hdr_charset, page);

! if (headers->env_from && ul > 0) {
int can_edit;
! const char *t = mailer_env_from_value(headers->env_from,&can_edit);

if (can_edit) {
if (t)
! PutLineX(12,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFrom,
"R)eturn-path: %s"),
t);
else
! PutLineX(12,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFromDef,
"R)eturn-path: (default)"));
} else if (t)
! PutLineX(12,0,CATGETS(elm_msg_cat, ElmSet, ElmPreSEnvFromNoEdit,
"Return-path: %s"),
t);
}
+
+ menu_redraw_children(page);
+
}

/* build up prompt and menu strings */
if (prev_form == *form_p) {
; /* not changed - no need to rebuild the strings */
! } else if (ul == 0) {
! prompt_mssg = catgets(elm_msg_cat, ElmSet,
! ElmVfyPromptSendTheMsg,
! "Send the message now? y");
!
! strfcpy(prompt_menu1, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenu1User0,
! "Select letter of header to edit, 'e' to edit the message,"),
! sizeof prompt_menu1);
! strfcpy(prompt_menu2, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenu2User0,
! "'a' to make attachments, 'y' to send message, or 'n' to cancel."),
! sizeof prompt_menu2);
!
! prompt_menu3[0] = '\0';

/* In some conditions add these also to menu in user_level == 0 */

if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
DPRINT(Debug,10,(&Debug,"mailer supports DSN\n"));

if (dsn && *dsn != 0) {
! strfcat(prompt_menu3, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuDSN,
! "D)SN"),
! sizeof prompt_menu3);
}
}
+
#ifdef USE_PGP
if (replying && was_pgp_encoded) {
! if (prompt_menu3[0]) strfcat(prompt_menu3,", ",
! sizeof prompt_menu3);
! strfcat(prompt_menu3, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuPGP,
! "P)gp"),
! sizeof prompt_menu3);
}
#endif
} else {
!
! prompt_mssg = catgets(elm_msg_cat, ElmSet,
! ElmVfyPromptSendMessage,
! "Send message now? y");
! strfcpy(prompt_menu1, catgets(elm_msg_cat, ElmSet,
! ElmVfySelectLetter,
! "Select letter of header to edit, "),
! sizeof prompt_menu1);
!
!
switch (*form_p) {
case PREFORMATTED:
break;
case YES:
! strfcat(prompt_menu1, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuEditForm,
! "e)dit form, "),
! sizeof prompt_menu1);
break;
case MAYBE:
! strfcat(prompt_menu1, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuEditMake,
! "e)dit msg, m)ake form, "),
! sizeof prompt_menu1);
break;
default:
! strfcat(prompt_menu1, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuEditMsg,
! "e)dit message, "),
! sizeof prompt_menu1);
break;
}
!
!
! strfcpy(prompt_menu2,catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuVfyCpy,
! "all h)eaders, a)ttachments, co(p)y, "),
! sizeof prompt_menu2);
#ifdef ISPELL
! strfcat(prompt_menu2, catgets(elm_msg_cat, ElmSet, ElmVfyMenuIspell,
! "i)spell, "),
! sizeof prompt_menu2);
#endif
+
+
#ifdef ALLOW_SUBSHELL
! strfcat(prompt_menu2, catgets(elm_msg_cat, ElmSet, ElmVfyMenuShell,
"!)shell, "),
! sizeof prompt_menu2);
#endif
!
! strcat(prompt_menu2, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuForgetOr,
! "f)orget, or:"));
!
! prompt_menu3[0] = '\0';
!
if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
DPRINT(Debug,10,(&Debug,"mailer supports DSN\n"));

! if (dsn)
! strfcat(prompt_menu3, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuDSN,
! "D)SN"),
! sizeof prompt_menu3);
!
!
}
#ifdef USE_PGP
! if (prompt_menu3[0]) strfcat(prompt_menu3,", ",
! sizeof prompt_menu3);
! strfcat(prompt_menu3, catgets(elm_msg_cat, ElmSet,
! ElmVfyMenuPGP,
! "P)gp"),
! sizeof prompt_menu3);
!
#endif
}

prev_form = *form_p;

/* complain if last entry was bad */
if (bad_cmd) {
! menu_Write_to_screen(prompt_area,
! FRM("%c??"), 07);
if (sleepmsg > 0)


error_sleep((sleepmsg + 1) / 2);

bad_cmd = FALSE;


}

+ if (menu_resized(prompt_area) ||
+ menu_need_redraw(prompt_area)) {
+
+ menu_ClearScreen(prompt_area);
+

+ menu_PutLine0(prompt_area,
+ 0, 0, prompt_mssg);
+
+ Centerline(1, prompt_menu1,prompt_area);
+ Centerline(2, prompt_menu2,prompt_area);
+ Centerline(3, prompt_menu3,prompt_area);
+
+ }
+
/* if we don't have a cmd, display prompt and get response from user */
if (force_cmd != '\0' &&
isascii(force_cmd)) {
***************
*** 1752,1774 ****
force_cmd = '\0';
did_prompt = FALSE;
} else {
! ClearLine(LINES-4);
! PutLine0(LINES-4, 0, prompt_mssg);

! GetXYLocation(&x_coord, &y_coord);
y_coord--; /* backspace over default answer */

! PutLineX(LINES-4, y_coord, FRM("%c"),def_cmd);
! ClearLine(LINES-3);
! Centerline(LINES-3, prompt_menu,page);
! ClearLine(LINES-2);
! Centerline(LINES-2, prompt_menu2,page);
FlushBuffer();

! MoveCursor(x_coord, y_coord);
! cmd = menu_ReadCh(page,REDRAW_MARK|READCH_resize);
! if (cmd == REDRAW_MARK)
goto redraw;

if (cmd == RESIZE_MARK) {

--- 1860,1892 ----
force_cmd = '\0';
did_prompt = FALSE;
} else {
! menu_PutLine0(prompt_area,
! 0, 0, prompt_mssg);

! menu_GetXYLocation(prompt_area,
! &x_coord, &y_coord);
y_coord--; /* backspace over default answer */

! menu_CleartoEOLN(prompt_area);
!
! menu_PutLineX(prompt_area,
! 0, y_coord, FRM("%c"),def_cmd);
FlushBuffer();

! menu_MoveCursor(prompt_area,
! x_coord, y_coord);
! cmd = menu_ReadCh(prompt_area,REDRAW_MARK|READCH_resize);
!
! if (cmd == REDRAW_MARK) {


! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/
!
goto redraw;
+ }

if (cmd == RESIZE_MARK) {

***************
*** 1778,1792 ****

if (cmd == EOF)
leave(0);
! #ifdef ASCII_CTYPE
! if (isascii(cmd))
! #endif
! cmd = tolower((unsigned char)cmd);
did_prompt = TRUE;
clear_error();

/* Put cursor pack to correct place */
! MoveCursor(x_coord, y_coord);
}

switch (cmd) {
--- 1896,1908 ----

if (cmd == EOF)
leave(0);
!
did_prompt = TRUE;
clear_error();

/* Put cursor pack to correct place */
! menu_MoveCursor(prompt_area,
! x_coord, y_coord);
}

switch (cmd) {
***************
*** 1800,1820 ****

case 'a':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuAtttach,
! "Attachments"));

attach_menu(NULL,NULL,attachments,display_charset,mailer_info,
NULL, aview);
do_redraw = 1;
break;

! case 'd':
if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));

if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuDsn,
! "Dsn"));
if (dsn) {
dsn_menu(dsn);
do_redraw = 1;
--- 1916,1938 ----

case 'a':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuAtttach,
! "Attachments"));

attach_menu(NULL,NULL,attachments,display_charset,mailer_info,
NULL, aview);
do_redraw = 1;
break;

! case 'D':
if (query_mailer_info(mailer_info,MI_HAVE_DSN)) {
DPRINT(Debug,8,(&Debug,"mailer supports DSN\n"));

if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuDsn,
! "Dsn"));
if (dsn) {
dsn_menu(dsn);
do_redraw = 1;
***************
*** 1822,1831 ****
}
break;

! case 's':
if (did_prompt) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuSend,
! "Send"));
/* Call FlushBuffer() after writing of "Send" so that
* user get immediately feedback (it may take time
* to encode big attachments)
--- 1940,1950 ----
}
break;

! case 'y':
if (did_prompt) {
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuSend,
! "Send"));
/* Call FlushBuffer() after writing of "Send" so that
* user get immediately feedback (it may take time
* to encode big attachments)
***************
*** 1835,1900 ****
#ifdef USE_PGP
if (replying && was_pgp_encoded &&
! (pgp_status & PGP_MESSAGE)) {
! ClearLine(LINES-3);
! PutLineX(LINES-3, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpRcvSure,
! "The recv'd message was PGP encoded, are you sure? "));
! for (;;) {
! cmd = menu_ReadCh(page,0);
! if (cmd == *def_ans_yes) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
! "Yes."));
! return(0);
! }
! if (cmd == *def_ans_no) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
break;
- }
}
- break;
- }
#endif /* USE_PGP */
! return 0;
! /*NOTREACHED*/

case ctrl('F'):
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmPassphraseForget,
! "Forget passphrase"));
forget_passphrase();
break;

! case 'f':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuForget,
! "Forget"));
#ifdef USE_PGP
pgp_status = 0; /* make sure to reset! */
#endif
if (bytes(filename) <= 0) {
; /* forget about empty files */
! return -2;
}
! return -1;
/*NOTREACHED*/

! case 'c':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuCopyFile,
! "Copy file"));
! if (name_copy_file(copy_file, aview, page) != 0) {
! *need_redraw_p = TRUE;
! do_redraw = 1;
! }
break;

case 'e':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuEdit, "Edit"));
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
--- 1954,2029 ----
#ifdef USE_PGP
if (replying && was_pgp_encoded &&
! (pgp_status & PGP_MESSAGE)) {
!
! menu_ClearLine(prompt_area,1);
! menu_PutLineX(prompt_area,1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpRcvSure,
! "The recv'd message was PGP encoded, are you sure? "));
! for (;;) {
! cmd = menu_ReadCh(prompt_area,0);
! if (cmd == *def_ans_yes) {
! menu_Write_to_screen(prompt_area,


! CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
! "Yes."));

! ret = 0;
! goto out;
! }
! if (cmd == *def_ans_no) {
! menu_Write_to_screen(prompt_area,


! CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));

! break;
! }
! }
break;
}
#endif /* USE_PGP */
! ret = 0;
! goto out;
! /*NOTREACHED*/

case ctrl('F'):
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPassphraseForget,
! "Forget passphrase"));
forget_passphrase();
break;

! case 'f':
! case 'n':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet, ElmVfyMenuForget,
! "Forget"));
#ifdef USE_PGP
pgp_status = 0; /* make sure to reset! */
#endif
if (bytes(filename) <= 0) {
; /* forget about empty files */
! ret = -2;
! goto out;
}
! ret = -1;
! goto out;
/*NOTREACHED*/

! case 'p':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuCopyFile,
! "Copy file"));
! name_copy_file(copy_file, aview, page);
! menu_trigger_redraw(prompt_area);
break;

case 'e':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuEdit, "Edit"));
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
***************
*** 1909,1929 ****
if (edit_the_message(filename, already_has_text,
headers,editor_val,file_set,
mailer_info, mailbox,
! aview, page) != 0)
! return -1;
} else {
sleep_message();
if (no_editor_edit_the_message(filename,headers,file_set,
! mailer_info,mailbox,aview))
! return -1;
}
}
break;

case 'h':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuHeaders,"Headers"));
edit_headers(headers,mailer_info,hdr_charset,encode_hdr,
aview);
*need_redraw_p = TRUE;
--- 2038,2063 ----
if (edit_the_message(filename, already_has_text,
headers,editor_val,file_set,
mailer_info, mailbox,
! aview, page) != 0) {
! ret = -1;
! goto out;
! }
} else {
sleep_message();
if (no_editor_edit_the_message(filename,headers,file_set,
! mailer_info,mailbox,aview)) {
! ret = -1;
! goto out;
! }
}
}
break;

case 'h':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuHeaders,"Headers"));
edit_headers(headers,mailer_info,hdr_charset,encode_hdr,
aview);
*need_redraw_p = TRUE;
***************
*** 1937,1947 ****
switch (check_form_file(filename)) {
case -1:
/* couldn't open file??? */
! return -1;
case 0:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyNoFieldsInForm,
! "No fields in form!\007"));
sleep_message();
break;
default:
--- 2071,2083 ----
switch (check_form_file(filename)) {
case -1:
/* couldn't open file??? */
! ret = -1;
! goto out;
case 0:
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyNoFieldsInForm,
! "No fields in form!\007"));
sleep_message();
break;
default:
***************
*** 1955,1962 ****
#ifdef ISPELL
case 'i':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuIspell2,"Ispell"));
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
--- 2091,2099 ----
#ifdef ISPELL
case 'i':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuIspell2,"Ispell"));
if (*form_p == PREFORMATTED) {
bad_cmd = TRUE;
} else {
***************
*** 1976,1982 ****



#ifdef ALLOW_SUBSHELL
case '!':
! subshell(NULL, page);

if (menu_need_redraw(page)) {
menu_ClearScreen(page);
*need_redraw_p = TRUE;
--- 2113,2121 ----

#ifdef ALLOW_SUBSHELL
case '!':
! menu_ClearLine(prompt_area,0);
! subshell(NULL, page, prompt_area);
!
if (menu_need_redraw(page)) {
menu_ClearScreen(page);
*need_redraw_p = TRUE;
***************
*** 1985,2000 ****
break;
#endif
#ifdef USE_PGP
! case 'p':
if (did_prompt)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuPgp,"Pgp"));
if (!pgp_status) {
pgp_status = pgp_menu (filename,headers, page);
if (pgp_status)
! def_cmd = 's';
else
! def_cmd = 'p';
*need_redraw_p = TRUE;
do_redraw = 1;
}
--- 2124,2140 ----
break;
#endif
#ifdef USE_PGP
! case 'P':
if (did_prompt)
! menu_Write_to_screen(prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmVfyMenuPgp,"Pgp"));
if (!pgp_status) {
pgp_status = pgp_menu (filename,headers, page);
if (pgp_status)
! def_cmd = 'y';
else
! def_cmd = 'P';
*need_redraw_p = TRUE;
do_redraw = 1;
}
***************
*** 2003,2009 ****
"This message is already encrypted and/or signed!"));
break;
#endif
! case 'r':
{
int c = edit_return_path(headers, page);

--- 2143,2149 ----
"This message is already encrypted and/or signed!"));
break;
#endif
! case 'R':
{
int c = edit_return_path(headers, page);

***************
*** 2011,2033 ****
bad_cmd = TRUE;
else if (REDRAW_MARK == c)
goto redraw;
}
break;
default:

{
int c = presend_action(headers,mailer_info,cmd,hdr_charset,
! aview, page);

! if (0 == c)
! bad_cmd = TRUE;
! else if (REDRAW_MARK == c)
! goto redraw;
}

break;
}
}
}

void write_header_info(mailer, headers,
--- 2151,2196 ----
bad_cmd = TRUE;
else if (REDRAW_MARK == c)
goto redraw;
+
+ menu_trigger_redraw(prompt_area);
}
break;
default:

{
int c = presend_action(headers,mailer_info,cmd,hdr_charset,
! aview, page, prompt_area);

! if (0 == c) { /* Accept also uppercase letters */
! int old = cmd;
! #ifdef ASCII_CTYPE
! if (isascii(cmd))
! #endif
! cmd = tolower((unsigned char)cmd);
!
! if (old != cmd)
! c = presend_action(headers,mailer_info,cmd,hdr_charset,
! aview, page, prompt_area);
!
! if (0 == c)
! bad_cmd = TRUE;
! else if (REDRAW_MARK == c)
! goto redraw;
!
! } else if (REDRAW_MARK == c)
! goto redraw;
!
! menu_trigger_redraw(prompt_area);
}

break;
}
}
+
+ out:
+ erase_menu_context(&prompt_area);
+
+ return ret;
}

void write_header_info(mailer, headers,
***************
*** 2045,2054 ****
mail.
**/

- time_t time();
- char *ctime();
-
- char *get_arpa_date();

mime_info -> encode_hdr = !form && !allow_no_hdrencoding;

--- 2208,2213 ----
***************
*** 2189,2195 ****
}
mime_info->cl_offset = 0;
if (copy) {
! CONST char * t = NULL;
int x;

if (headers->env_from)
--- 2348,2354 ----
}
mime_info->cl_offset = 0;
if (copy) {
! const char * t = NULL;
int x;

if (headers->env_from)
Index: elmME+.2.5.alpha5-cvs/src/Makefile.SH
*** elmME+.2.5.alpha4/src/Makefile.SH 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/Makefile.SH 2005-07-20 19:49:45.000000000 +0300
***************
*** 13,18 ****
--- 13,21 ----


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac

+ libx="../libs/libelmme-base.a ../libs/libelmme-mailer.a"
+ libxs="../shlib/libelmme-base.so ../shlib/libelmme-mailer.so"
+

echo "Extracting src/Makefile (with variable substitutions)"
: if mailermode is not 2755 then we dont need the chgrp
: set chgrp to a null command in this case
***************
*** 31,37 ****

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.50.20.4 2004/11/02 19:36:17 hurtta Exp $
#


# Makefile for the ELM mail program.
#

--- 34,40 ----

cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.50.20.5 2005/07/20 16:49:45 hurtta Exp $
#


# Makefile for the ELM mail program.
#
***************

*** 65,70 ****
--- 68,74 ----
RM = $rm -f
TOUCH = $touch
TAGS = ctags
+ LIBX = $libx

LOCALETARG = $localetarget

***************
*** 110,115 ****
--- 114,122 ----
cat >>Makefile <<'!NO!SUBS!'
SHLIST = $(BIN)/elm-shared
!NO!SUBS!
+ cat >>Makefile <<!SUBS!
+ LIBXS = $libxs
+ !SUBS!

else

***************
*** 346,357 ****
$(TOUCH) $@

def_elm.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/mime.h \
! $(INCLDIR)/me.h $(INCLDIR)/elm_globals.h


$(CHMOD) u+w $@
$(TOUCH) $@

# Dependencies of C object files

! addr_util.o: def_elm.h $(INCLDIR)/s_elm.h
alias.o: def_elm.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_aliases.h $(INCLDIR)/s_elm.h
aliaslib.o: def_elm.h $(INCLDIR)/s_elm.h
args.o: def_elm.h $(INCLDIR)/patchlevel.h $(INCLDIR)/s_elm.h
--- 353,364 ----
$(TOUCH) $@

def_elm.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/mime.h \
! $(INCLDIR)/me.h $(INCLDIR)/elm_globals.h $(INCLDIR)/mailerlib.h


$(CHMOD) u+w $@
$(TOUCH) $@

# Dependencies of C object files

! addr_util.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h
alias.o: def_elm.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_aliases.h $(INCLDIR)/s_elm.h
aliaslib.o: def_elm.h $(INCLDIR)/s_elm.h
args.o: def_elm.h $(INCLDIR)/patchlevel.h $(INCLDIR)/s_elm.h
***************
*** 403,410 ****
reply.o: def_elm.h $(INCLDIR)/s_elm.h
save_opts.o: def_elm.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h $(INCLDIR)/rc_imp.h
savecopy.o: def_elm.h $(INCLDIR)/s_elm.h
! screen.o: def_elm.h $(INCLDIR)/s_elm.h
! showmsg.o: def_elm.h $(INCLDIR)/s_elm.h
showmsg_c.o: def_elm.h $(INCLDIR)/s_elm.h
signals.o: def_elm.h $(INCLDIR)/s_elm.h
sort.o: def_elm.h $(INCLDIR)/s_elm.h
--- 410,417 ----
reply.o: def_elm.h $(INCLDIR)/s_elm.h
save_opts.o: def_elm.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h $(INCLDIR)/rc_imp.h
savecopy.o: def_elm.h $(INCLDIR)/s_elm.h
! screen.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_aliases.h
! showmsg.o: def_elm.h $(INCLDIR)/s_elm.h $(INCLDIR)/s_me.h
showmsg_c.o: def_elm.h $(INCLDIR)/s_elm.h
signals.o: def_elm.h $(INCLDIR)/s_elm.h
sort.o: def_elm.h $(INCLDIR)/s_elm.h
***************
*** 414,433 ****
utils.o: def_elm.h $(INCLDIR)/s_elm.h

# Dependencies and rules for compiling C programs
! $(BIN)/elm: $& $(ELM_OBJ) ../melib/libme.a ../lib/libutil.a messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a
! $(CC) $(LFLAGS) -o $@ $(ELM_OBJ) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a ../melib/libme.a ../lib/libutil.a $(LIBS) $(LIB2)

# Dependencies and rules for installing C programs


!NO!SUBS!



if $test "$d_shared" = "$define" ; then

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/elm-shared: $& $(ELM_OBJ) ../melib/libme.a ../shlib/libelmme-base.so messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELM_OBJ) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a ../melib/libme.a ../shlib/libelmme-base.so $(LIBS) $(LIB2)


$(DEST)/elm: $(BIN)/elm-shared
--- 421,449 ----
utils.o: def_elm.h $(INCLDIR)/s_elm.h

# Dependencies and rules for compiling C programs
! $(BIN)/elm: $& $(ELM_OBJ) ../melib/libme.a $(LIBX) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a
! $(CC) $(LFLAGS) -o $@ $(ELM_OBJ) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a ../melib/libme.a $(LIBX) $(LIBS) $(LIB2)

# Dependencies and rules for installing C programs




!NO!SUBS!

+ for i in $libx

+ do
+ y="`echo $i|$sed 's%^../%%'`"


+ cat >>Makefile <<!SUBS!
+ $i:

+ cd ..; \$(MAKE) \$(MJ) \$(MFLAGS) $y
+ !SUBS!
+ done


+
if $test "$d_shared" = "$define" ; then

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/elm-shared: $& $(ELM_OBJ) ../melib/libme.a $(LIBXS) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELM_OBJ) messages/libmessages.a screen/libscreen.a aliases/libaliases.a menu_common/libmcommon.a ../melib/libme.a $(LIBXS) $(LIBS) $(LIB2)


$(DEST)/elm: $(BIN)/elm-shared
***************
*** 435,440 ****
--- 451,466 ----

!NO!SUBS!



+ for i in $libxs
+ do

+ y="`echo $i|$sed 's%^../%%'`"


+ cat >>Makefile <<!SUBS!
+ $i:

+ cd ..; \$(MAKE) \$(MJ) \$(MFLAGS) $y
+ !SUBS!
+ done
+

+
else

cat >>Makefile <<'!NO!SUBS!'

Index: elmME+.2.5.alpha5-cvs/src/menu2.c
*** elmME+.2.5.alpha4/src/menu2.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu2.c 2005-07-20 19:49:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: menu2.c,v 1.10.8.1 2004/07/19 09:20:02 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: menu2.c,v 1.10.8.2 2005/07/20 16:49:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 24,76 ****
struct menu_item *it;
struct menu_context *page;
{
! short len;
! char buf[STRING];
! int ch;

! ClearLine (it->offset);
! Write_to_screen (FRM("%s"),it->option);
! len = strlen (it->option) + 1;
! if (it->type == STR)
! return
! optionally_enter (it->d.c, it->offset, len,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! it->size,page);
! else if (it->type == BOL) {
! for (;;) {
! MoveCursor (it->offset, len);
! CleartoEOLN ();
! if (*(it->d.i) == TRUE)
! Write_to_screen (CATGETS(elm_msg_cat, ElmSet,
! ElmMenu2True,
! "TRUE"));
! else if (*(it->d.i) == FALSE)
! Write_to_screen (CATGETS(elm_msg_cat, ElmSet,
! ElmMenu2False,
! "FALSE"));
! ch = menu_ReadCh (page,OE_REDRAW_MARK);


! if (ch == EOF)

! return -1;


! if (ch == REDRAW_MARK)

! return REDRAW_MARK;
! if (ch == '\n')
! return 0;
! else if (ch == ' ')
! *(it->d.i) = *(it->d.i) ? FALSE : TRUE;
}
! }
! else if (it->type == INT) {
! int code;
! elm_sfprintf (buf,sizeof buf,
! FRM("%d"), *(it->d.i));
! code = optionally_enter (buf, it->offset, len,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! sizeof buf, page);
! if (code != 0)
! return code;
! *(it->d.i) = atoi (buf);
! }
! return 0;
}

int generic_menu (items, max, title, prompt)
--- 24,87 ----
struct menu_item *it;
struct menu_context *page;
{
! short len;
! char buf[STRING];
! int ch;
!
! menu_ClearLine(page,
! it->offset);
! menu_Write_to_screen(page,
! FRM("%s"),it->option);
! len = strlen (it->option) + 1;
! if (it->type == STR)
! return
! optionally_enter (it->d.c, it->offset, len,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! it->size,page);
! else if (it->type == BOL) {
! int old_val = *(it->d.i);
! for (;;) {
! menu_MoveCursor(page,it->offset, len);
! menu_CleartoEOLN(page);
! if (*(it->d.i) == TRUE)


! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMenu2True,
! "TRUE"));
! else if (*(it->d.i) == FALSE)


! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMenu2False,
! "FALSE"));
! ch = menu_ReadCh(page,OE_REDRAW_MARK|READCH_sig_char);


! if (ch == EOF)

! return -1;


! if (ch == REDRAW_MARK)

! return REDRAW_MARK;
!
! if (ch == TERMCH_interrupt_char) {
! *(it->d.i) = old_val;
! return 0;
! }

! if (ch == '\n')
! return 0;
! else if (ch == ' ')
! *(it->d.i) = *(it->d.i) ? FALSE : TRUE;
! }
}
! else if (it->type == INT) {
! int code;
! elm_sfprintf (buf,sizeof buf,
! FRM("%d"), *(it->d.i));
! code = optionally_enter (buf, it->offset, len,
! OE_APPEND_CURRENT|OE_REDRAW_MARK,
! sizeof buf, page);
! if (code != 0)
! return code;
! *(it->d.i) = atoi (buf);
! }
! return 0;
}

int generic_menu (items, max, title, prompt)
***************
*** 91,96 ****
--- 102,109 ----
for (;;) {


int LINES, COLUMNS;

+ menu_set_default(page);
+

resize_mark:
menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 128,140 ****
}
update = FALSE;
}
! ClearLine (LINES-3);
! PutLine0 (LINES-3, 0, prompt);
! if (precmd) {
! ch = precmd;
! precmd = 0;
! } else
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_resize|READCH_sig_char);

if (ch == TERMCH_interrupt_char) {
ret = 0;
--- 141,154 ----
}
update = FALSE;
}
!
! menu_ClearLine(page,LINES-3);
! menu_PutLine0(page,LINES-3, 0, prompt);
! if (precmd) {
! ch = precmd;
! precmd = 0;
! } else
! ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize|READCH_sig_char);

if (ch == TERMCH_interrupt_char) {
ret = 0;
Index: elmME+.2.5.alpha5-cvs/src/menu.c
*** elmME+.2.5.alpha4/src/menu.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu.c 2005-07-20 19:49:48.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: menu.c,v 1.8 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: menu.c,v 1.8.8.1 2005/07/20 16:49:48 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 166,172 ****
Centerline(LINES-2, m->help, page);
m->update = 0;
}
! PutLine0(LINES-3, 0, m->prompt);

switch(cmd = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR|READCH_resize)) {
case RESIZE_MARK:
--- 166,174 ----
Centerline(LINES-2, m->help, page);
m->update = 0;
}
!
! menu_PutLine0(page,
! LINES-3, 0, m->prompt);

switch(cmd = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR|READCH_resize)) {
case RESIZE_MARK:
Index: elmME+.2.5.alpha5-cvs/src/menu_common/alias.c
*** elmME+.2.5.alpha4/src/menu_common/alias.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/alias.c 2005-07-23 20:14:19.000000000 +0300
***************
*** 1,14 ****
! static char rcsid[] = "@(#)$Id: alias.c,v 1.3 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"

DEBUG_VAR(Debug,__FILE__,"menu");



#if ANSI_C
#define S_(x) static x;

--- 1,17 ----
! static char rcsid[] = "@(#)$Id: alias.c,v 1.3.8.2 2005/07/23 17:14:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"
+ #include "s_aliases.h"

+ #if 0
DEBUG_VAR(Debug,__FILE__,"menu");
+ #endif



#if ANSI_C
#define S_(x) static x;
***************

*** 34,52 ****


S_(mc_setf_status_common mc_setf_status_alias)
! static int mc_setf_status_alias P_((union mcommon_union *u, int idx, int stat));
! static int mc_setf_status_alias(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct AliasView *aview = u->alias.aw;
struct alias_rec *a = give_alias(aview,idx);
int r = 0;

! if (a) {
! setit(a->status,stat);
! r = a->status;
}

return r;
--- 37,67 ----


S_(mc_setf_status_common mc_setf_status_alias)
! static int mc_setf_status_alias P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_setf_status_alias(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct AliasView *aview = u->alias.aw;
struct alias_rec *a = give_alias(aview,idx);
int r = 0;

! if (a) {
! switch (t) {
! case status_basic:
!
! setit(a->status,stat);
! r = a->status;


! break;
!
! default:

! /* other status types ignored */
! break;
! }
!
}

return r;
***************
*** 64,73 ****


S_(mc_ison_status_common mc_ison_status_alias)
! static int mc_ison_status_alias P_((union mcommon_union *u, int idx, int stat));
! static int mc_ison_status_alias(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct AliasView *aview = u->alias.aw;
--- 79,90 ----


S_(mc_ison_status_common mc_ison_status_alias)
! static int mc_ison_status_alias P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_ison_status_alias(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct AliasView *aview = u->alias.aw;
***************
*** 75,81 ****
int r = 0;

if (a) {
! r = ison(a->status,stat);
}

return r;
--- 92,107 ----
int r = 0;

if (a) {
! switch (t) {
!
! case status_basic:
! r = ison(a->status,stat);


! break;
!
! default:

! /* other status types ignored */
! break;
! }
}

return r;
***************
*** 83,92 ****


S_(mc_clearf_status_common mc_clearf_status_alias)
! static int mc_clearf_status_alias P_((union mcommon_union *u, int idx, int stat));
! static int mc_clearf_status_alias(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct AliasView *aview = u->alias.aw;
--- 109,120 ----


S_(mc_clearf_status_common mc_clearf_status_alias)
! static int mc_clearf_status_alias P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_clearf_status_alias(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct AliasView *aview = u->alias.aw;
***************
*** 94,101 ****
int r = 0;

if (a) {
! clearit(a->status,stat);
! r = a->status;
}

return r;
--- 122,138 ----
int r = 0;

if (a) {
! switch (t) {
! case status_basic:
!
! clearit(a->status,stat);
! r = a->status;


! break;
!
! default:

! /* other status types ignored */
! break;
! }
}

return r;
***************
*** 163,168 ****
--- 200,215 ----
}


+ S_(mc_title_common mc_title_alias)
+ static struct string * mc_title_alias P_((union mcommon_union *u));
+ static struct string * mc_title_alias(u)
+ union mcommon_union *u;
+ {
+ return format_string(CATGETS(elm_msg_cat, AliasesSet,
+ AliasesMode,
+ "Alias mode"));
+ }
+
static struct mcommon_type mcommon_alias = {
MCOMMON_TYPE_magic,
mc_get_type_alias,
***************
*** 181,187 ****
mc_limit_print_result_alias,
mc_match_in_text_alias,
mc_screen_print_alias_line,
! mc_give_item_alias
};

void set_mcommon_from_aliasview P_((struct menu_common *m, struct AliasView *aw));
--- 228,235 ----
mc_limit_print_result_alias,
mc_match_in_text_alias,
mc_screen_print_alias_line,
! mc_give_item_alias,
! mc_title_alias
};

void set_mcommon_from_aliasview P_((struct menu_common *m, struct AliasView *aw));
Index: elmME+.2.5.alpha5-cvs/src/menu_common/alias_item.c
*** elmME+.2.5.alpha4/src/menu_common/alias_item.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/alias_item.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias_item.c,v 1.3 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias_item.c,v 1.3.8.2 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************
***************
*** 18,24 ****
#include "s_aliases.h"
#include "s_elm.h"

! CONST struct string * mc_give_item_alias(I)
enum mcommon_item I;
{
static struct string * storage[MCOMMON_ITEM_COUNT] = { NULL };
--- 18,24 ----
#include "s_aliases.h"
#include "s_elm.h"

! const struct string * mc_give_item_alias(I)
enum mcommon_item I;
{
static struct string * storage[MCOMMON_ITEM_COUNT] = { NULL };
***************
*** 63,68 ****
--- 63,69 ----
if (! storage[I])
storage[I] = format_string(CATGETS(elm_msg_cat, ElmSet, ElmNoAliases,
"No aliases!"));
+ break;

default:
panic("MENU COMMON PANIC",__FILE__,__LINE__,"mc_give_item_alias",
Index: elmME+.2.5.alpha5-cvs/src/menu_common/alias_pattern.c
*** elmME+.2.5.alpha4/src/menu_common/alias_pattern.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/alias_pattern.c 2005-07-20 19:49:50.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias_pattern.c,v 1.4 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias_pattern.c,v 1.4.8.1 2005/07/20 16:49:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 152,162 ****
return(res);
}

! int mc_match_in_text_alias(u,meta_pattern, header_page, page)
union mcommon_union *u;
struct string * meta_pattern;


- int header_page;
struct menu_context *page;
{

struct AliasView *aview = u->alias.aw;

--- 152,162 ----
return(res);
}

! int mc_match_in_text_alias(u,meta_pattern, page, LOC)
union mcommon_union *u;
struct string * meta_pattern;


struct menu_context *page;
+ struct screen_parts *LOC;
{

struct AliasView *aview = u->alias.aw;

Index: elmME+.2.5.alpha5-cvs/src/menu_common/alias_screen.c
*** elmME+.2.5.alpha4/src/menu_common/alias_screen.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/alias_screen.c 2005-07-20 19:49:50.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: alias_screen.c,v 1.4 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: alias_screen.c,v 1.4.8.1 2005/07/20 16:49:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

******************************************************************************
***************
*** 52,62 ****
page);

if (selected && has_highlighting && ! arrow_cursor) {
! StartInverse();
! Write_to_screen(FRM("%S\n\r"), buffer); /* avoid '%' probs */
! EndInverse();
} else
! Write_to_screen(FRM("%S\n\r"), buffer); /* avoid '%' probs */

free_string(&buffer);
}
--- 52,62 ----
page);

if (selected && has_highlighting && ! arrow_cursor) {
! menu_StartXX(page,pg_INVERSE);
! menu_Write_to_screen(page,FRM("%S\n\r"), buffer); /* avoid '%' probs */
! menu_EndXX(page,pg_INVERSE);
} else
! menu_Write_to_screen(page,FRM("%S\n\r"), buffer); /* avoid '%' probs */

free_string(&buffer);
}
Index: elmME+.2.5.alpha5-cvs/src/menu_common/def_mcommon.h
*** elmME+.2.5.alpha4/src/menu_common/def_mcommon.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/def_mcommon.h 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,4 ****
! /* $Id: def_mcommon.h,v 1.4.8.1 2004/04/18 16:55:43 hurtta Exp $ */

#include "elm_defs.h"
#include "mime.h"
--- 1,4 ----
! /* $Id: def_mcommon.h,v 1.4.8.3 2005/07/26 08:28:45 hurtta Exp $ */

#include "elm_defs.h"
#include "mime.h"
***************
*** 27,36 ****
};

typedef int mc_get_type_common P_((union mcommon_union *u, int idx));
! typedef int mc_setf_status_common P_((union mcommon_union *u, int idx, int mask));
typedef int mc_get_current_common P_((union mcommon_union *u));
! typedef int mc_ison_status_common P_((union mcommon_union *u, int idx, int mask));
! typedef int mc_clearf_status_common P_((union mcommon_union *u, int idx, int mask));
typedef char * mc_show_status_common P_((union mcommon_union *u, int idx));
typedef int mc_get_count_common P_((union mcommon_union *u));
typedef int mc_matches_common P_((union mcommon_union *u, int idx, struct string * meta_pattern));
--- 27,39 ----
};

typedef int mc_get_type_common P_((union mcommon_union *u, int idx));
! typedef int mc_setf_status_common P_((union mcommon_union *u, int idx,
! enum status_x t, int mask));
typedef int mc_get_current_common P_((union mcommon_union *u));
! typedef int mc_ison_status_common P_((union mcommon_union *u, int idx,
! enum status_x t, int mask));
! typedef int mc_clearf_status_common P_((union mcommon_union *u, int idx,
! enum status_x t, int mask));
typedef char * mc_show_status_common P_((union mcommon_union *u, int idx));
typedef int mc_get_count_common P_((union mcommon_union *u));
typedef int mc_matches_common P_((union mcommon_union *u, int idx, struct string * meta_pattern));
***************
*** 47,57 ****
typedef void mc_limit_print_result_common P_((union mcommon_union *u));
typedef int mc_match_in_text_common P_((union mcommon_union *u,
struct string * meta_pattern,


! int header_page,
! struct menu_context *page));

typedef void mc_screen_print_common_line P_((union mcommon_union *u,int idx,
struct menu_context *page));
! typedef CONST struct string * mc_give_item_common P_((enum mcommon_item I));

struct mcommon_type {
unsigned short magic;
--- 50,62 ----
typedef void mc_limit_print_result_common P_((union mcommon_union *u));
typedef int mc_match_in_text_common P_((union mcommon_union *u,
struct string * meta_pattern,


! struct menu_context *page,
! struct screen_parts *LOC));

typedef void mc_screen_print_common_line P_((union mcommon_union *u,int idx,
struct menu_context *page));
! typedef const struct string * mc_give_item_common P_((enum mcommon_item I));
!
! typedef struct string * mc_title_common P_((union mcommon_union *u));

struct mcommon_type {
unsigned short magic;
***************
*** 73,78 ****
--- 78,84 ----
mc_match_in_text_common * mc_match_in_text_it;
mc_screen_print_common_line * mc_screen_print_it_line;
mc_give_item_common * mc_give_item_it;
+ mc_title_common * mc_title_it;
};

#if ANSI_C
***************
*** 114,133 ****
struct string * meta_pattern));
extern int mc_match_in_text_alias P_((union mcommon_union *u,
struct string * meta_pattern,


! int header_page,
! struct menu_context *page));

extern int mc_match_in_text_mbx P_((union mcommon_union *u,
struct string * meta_pattern,


! int header_page,
! struct menu_context *page));

extern void mc_screen_print_alias_line P_((union mcommon_union *u,int idx,
struct menu_context *page));
extern void mc_screen_print_mbx_line P_((union mcommon_union *u,int idx,
struct menu_context *page));

! extern CONST struct string * mc_give_item_alias P_((enum mcommon_item I));
! extern CONST struct string * mc_give_item_mbx P_((enum mcommon_item I));


extern int from_matches P_((struct header_rec *mss,
--- 120,139 ----
struct string * meta_pattern));
extern int mc_match_in_text_alias P_((union mcommon_union *u,
struct string * meta_pattern,


! struct menu_context *page,
! struct screen_parts *LOC));

extern int mc_match_in_text_mbx P_((union mcommon_union *u,
struct string * meta_pattern,


! struct menu_context *page,
! struct screen_parts *LOC));

extern void mc_screen_print_alias_line P_((union mcommon_union *u,int idx,
struct menu_context *page));
extern void mc_screen_print_mbx_line P_((union mcommon_union *u,int idx,
struct menu_context *page));

! extern const struct string * mc_give_item_alias P_((enum mcommon_item I));
! extern const struct string * mc_give_item_mbx P_((enum mcommon_item I));


extern int from_matches P_((struct header_rec *mss,
Index: elmME+.2.5.alpha5-cvs/src/menu_common/mailbox.c
*** elmME+.2.5.alpha4/src/menu_common/mailbox.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/mailbox.c 2005-07-23 20:14:19.000000000 +0300
***************
*** 1,14 ****
! static char rcsid[] = "@(#)$Id: mailbox.c,v 1.3 2004/03/27 18:31:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"

DEBUG_VAR(Debug,__FILE__,"menu");



#if ANSI_C
#define S_(x) static x;

--- 1,17 ----
! static char rcsid[] = "@(#)$Id: mailbox.c,v 1.3.8.2 2005/07/23 17:14:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"
+ #include "s_elm.h"

+ #if 0
DEBUG_VAR(Debug,__FILE__,"menu");
+ #endif



#if ANSI_C
#define S_(x) static x;
***************

*** 29,52 ****


S_(mc_setf_status_common mc_setf_status_mbx)
! static int mc_setf_status_mbx P_((union mcommon_union *u, int idx, int stat));
! static int mc_setf_status_mbx(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
- struct header_rec *a = give_header(mbxview,idx);
int r = 0;

! if (a) {
! setit(a->status,stat);
! r = a->status;

! /* TODO: What statuses should cause flagging??? */
! a->status_chgd = TRUE;
! }

return r;
}

--- 32,76 ----


S_(mc_setf_status_common mc_setf_status_mbx)
! static int mc_setf_status_mbx P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_setf_status_mbx(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
int r = 0;

! if (mbxview) {

! struct header_rec *a = give_header(mbxview,idx);
!
! if (a) {
! switch (t) {

+ case status_basic:
+ setit(a->status,stat);
+ r = a->status;
+ break;
+
+ case status_1:
+ setit(a->status1,stat);
+ r = a->status1;


+ break;
+
+ default:

+ panic("MENU COMMON PANIC",__FILE__,__LINE__,"mc_setf_status_mbx",
+ "bad status type",0);
+
+ }
+
+ /* TODO: What status codes should cause flagging??? */
+ a->status_chgd = TRUE;


+ }
+
+ }
return r;
}

***************
*** 57,79 ****
{
struct MailboxView *mbxview = u->mbx.mw;

return get_current(mbxview);
}


S_(mc_ison_status_common mc_ison_status_mbx)
! static int mc_ison_status_mbx P_((union mcommon_union *u, int idx, int stat));
! static int mc_ison_status_mbx(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
- struct header_rec *a = give_header(mbxview,idx);
int r = 0;

! if (a) {
! r = ison(a->status,stat);
}

return r;
--- 81,122 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return 0;
+
return get_current(mbxview);
}


S_(mc_ison_status_common mc_ison_status_mbx)
! static int mc_ison_status_mbx P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_ison_status_mbx(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
int r = 0;

! if (mbxview) {
! struct header_rec *a = give_header(mbxview,idx);
!
! if (a) {
! switch (t) {
! case status_basic:
! r = ison(a->status,stat);
! break;
! case status_1:
! r = ison(a->status1,stat);
! break;
! default:
! panic("MENU COMMON PANIC",__FILE__,__LINE__,
! "mc_ison_status_mbx",
! "bad status type",0);
! }
! }
}

return r;
***************
*** 81,102 ****


S_(mc_clearf_status_common mc_clearf_status_mbx)
! static int mc_clearf_status_mbx P_((union mcommon_union *u, int idx, int stat));
! static int mc_clearf_status_mbx(u,idx, stat)
union mcommon_union *u;
int idx;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
- struct header_rec *a = give_header(mbxview,idx);
int r = 0;

! if (a) {
! clearit(a->status,stat);
! r = a->status;
!
! /* TODO: What statuses should cause flagging??? */
! a->status_chgd = TRUE;
}

return r;
--- 124,164 ----


S_(mc_clearf_status_common mc_clearf_status_mbx)
! static int mc_clearf_status_mbx P_((union mcommon_union *u, int idx,
! enum status_x t, int stat));
! static int mc_clearf_status_mbx(u,idx, t, stat)
union mcommon_union *u;
int idx;
+ enum status_x t;
int stat;
{
struct MailboxView *mbxview = u->mbx.mw;
int r = 0;

! if (mbxview) {
! struct header_rec *a = give_header(mbxview,idx);
!
! if (a) {
! switch (t) {
! case status_basic:
! clearit(a->status,stat);
! r = a->status;
! break;
!
! case status_1:
! clearit(a->status1,stat);
! r = a->status1;


! break;
!
! default:

! panic("MENU COMMON PANIC",__FILE__,__LINE__,
! "mc_clearf_status_mbx",
! "bad status type",0);
! }
!
! /* TODO: What statuses should cause flagging??? */
! a->status_chgd = TRUE;
! }
}

return r;
***************
*** 109,119 ****
int idx;
{
struct MailboxView *mbxview = u->mbx.mw;
- struct header_rec *a = give_header(mbxview,idx);
char * r = "";

! if (a) {
! r = show_message_status(a);
}

return r;
--- 171,184 ----
int idx;
{
struct MailboxView *mbxview = u->mbx.mw;
char * r = "";

! if (mbxview) {
! struct header_rec *a = give_header(mbxview,idx);
!
! if (a) {
! r = show_message_status(a);
! }
}

return r;
***************
*** 126,131 ****
--- 191,199 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return 0;
+
return get_message_count(mbxview);
}

***************
*** 136,141 ****
--- 204,212 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return 0;
+
return get_selected(mbxview);
}

***************
*** 147,152 ****
--- 218,226 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return;
+
set_current(mbxview,cur);
}

***************
*** 159,167 ****
--- 233,259 ----
{
struct MailboxView *mbxview = u->mbx.mw;

+ if (!mbxview)
+ return;
+
set_selected(mbxview,cur);
}

+ S_(mc_title_common mc_title_mbx)
+ static struct string * mc_title_mbx P_((union mcommon_union *u));
+ static struct string * mc_title_mbx(u)
+ union mcommon_union *u;
+ {
+ struct MailboxView *mbxview = u->mbx.mw;
+
+ if (!mbxview)
+ return format_string(CATGETS(elm_msg_cat, ElmSet,
+ ElmShownTitleNoMailbox,
+ "No mailbox"));
+
+ return mailbox_title(mbxview);
+ }
+

static struct mcommon_type mcommon_mbx = {
MCOMMON_TYPE_magic,
***************
*** 181,187 ****
mc_limit_print_result_mbx,
mc_match_in_text_mbx,
mc_screen_print_mbx_line,
! mc_give_item_mbx
};

void set_mcommon_from_mbxview P_((struct menu_common *m, struct MailboxView *aw));
--- 273,280 ----
mc_limit_print_result_mbx,
mc_match_in_text_mbx,
mc_screen_print_mbx_line,
! mc_give_item_mbx,
! mc_title_mbx
};

void set_mcommon_from_mbxview P_((struct menu_common *m, struct MailboxView *aw));
Index: elmME+.2.5.alpha5-cvs/src/menu_common/mailbox_item.c
*** elmME+.2.5.alpha4/src/menu_common/mailbox_item.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/mailbox_item.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailbox_item.c,v 1.3 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mailbox_item.c,v 1.3.8.1 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************
***************
*** 16,22 ****
#include "def_mcommon.h"
#include "s_elm.h"

! CONST struct string * mc_give_item_mbx(I)
enum mcommon_item I;
{
static struct string * storage[MCOMMON_ITEM_COUNT] = { NULL };
--- 16,22 ----
#include "def_mcommon.h"
#include "s_elm.h"

! const struct string * mc_give_item_mbx(I)
enum mcommon_item I;
{
static struct string * storage[MCOMMON_ITEM_COUNT] = { NULL };
Index: elmME+.2.5.alpha5-cvs/src/menu_common/Makefile.SH
*** elmME+.2.5.alpha4/src/menu_common/Makefile.SH 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/Makefile.SH 2005-07-20 19:49:50.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/menu_common/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.2.20.1 2004/04/18 16:55:43 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables

--- 17,23 ----
echo "Extracting src/menu_common/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.2.20.2 2005/07/20 16:49:50 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************

*** 86,94 ****



# Dependencies of C object files

mcommon.o: def_mcommon.h
! alias.o: def_mcommon.h
! mailbox.o: def_mcommon.h
! mailbox.o: def_mcommon.h
alias_limit.o: def_mcommon.h $(INCLDIR)/s_aliases.h $(INCLDIR)/s_elm.h
message_limit.o: def_mcommon.h $(INCLDIR)/s_elm.h
alias_pattern.o: def_mcommon.h
--- 86,93 ----



# Dependencies of C object files

mcommon.o: def_mcommon.h
! alias.o: def_mcommon.h $(INCLDIR)/s_aliases.h
! mailbox.o: def_mcommon.h $(INCLDIR)/s_elm.h
alias_limit.o: def_mcommon.h $(INCLDIR)/s_aliases.h $(INCLDIR)/s_elm.h
message_limit.o: def_mcommon.h $(INCLDIR)/s_elm.h
alias_pattern.o: def_mcommon.h
Index: elmME+.2.5.alpha5-cvs/src/menu_common/mcommon.c
*** elmME+.2.5.alpha4/src/menu_common/mcommon.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/mcommon.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,14 ****
! static char rcsid[] = "@(#)$Id: mcommon.c,v 1.6 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"

DEBUG_VAR(Debug,__FILE__,"menu");

static void mcommon_st_to_union P_((struct menu_common *m,
union mcommon_union *u));
--- 1,16 ----
! static char rcsid[] = "@(#)$Id: mcommon.c,v 1.6.8.3 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/

#include "def_mcommon.h"

+ #if 0
DEBUG_VAR(Debug,__FILE__,"menu");
+ #endif

static void mcommon_st_to_union P_((struct menu_common *m,
union mcommon_union *u));
***************
*** 43,58 ****
return u.gen.mtype->mc_get_type_it(&u,idx);
}

! int mcommon_setf_status(m,idx, stat)
struct menu_common *m;
int idx;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_setf_status_it(&u,idx,stat);
}

int mcommon_get_current(m)
--- 45,61 ----
return u.gen.mtype->mc_get_type_it(&u,idx);
}

! int mcommon_setf_status(m,idx, t, stat)
struct menu_common *m;
int idx;
+ enum status_x t;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_setf_status_it(&u,idx,t, stat);
}

int mcommon_get_current(m)
***************
*** 65,93 ****
return u.gen.mtype->mc_get_current_it(&u);
}

! int mcommon_ison_status(m,idx, stat)
struct menu_common *m;
int idx;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_ison_status_it(&u,idx,stat);
}


! int mcommon_clearf_status(m,idx, stat)
struct menu_common *m;
int idx;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_clearf_status_it(&u,idx,stat);
}

char * mcommon_show_status(m,idx)
--- 68,98 ----
return u.gen.mtype->mc_get_current_it(&u);
}

! int mcommon_ison_status(m,idx, t, stat)
struct menu_common *m;
int idx;
+ enum status_x t;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_ison_status_it(&u,idx,t, stat);
}


! int mcommon_clearf_status(m,idx, t, stat)
struct menu_common *m;
int idx;
+ enum status_x t;
int stat;
{
union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_clearf_status_it(&u,idx,t, stat);
}

char * mcommon_show_status(m,idx)
***************
*** 195,212 ****
u.gen.mtype->mc_limit_print_result_it(&u);
}

! int mcommon_match_in_text(m, meta_pattern, header_page, page)
struct menu_common *m;
struct string * meta_pattern;


- int header_page;
struct menu_context *page;
{

union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_match_in_text_it(&u, meta_pattern, header_page,
! page);
}

void mcommon_screen_print_menu_line(m,idx,page)
--- 200,217 ----
u.gen.mtype->mc_limit_print_result_it(&u);
}

! int mcommon_match_in_text(m, meta_pattern, page,LOC)
struct menu_common *m;
struct string * meta_pattern;


struct menu_context *page;
+ struct screen_parts *LOC;
{

union mcommon_union u;

mcommon_st_to_union(m,&u);

! return u.gen.mtype->mc_match_in_text_it(&u, meta_pattern,
! page, LOC);
}

void mcommon_screen_print_menu_line(m,idx,page)
***************
*** 221,227 ****
u.gen.mtype->mc_screen_print_it_line(&u,idx,page);
}

! CONST struct string * mcommon_give_item(m,I)
struct menu_common *m;
enum mcommon_item I;
{
--- 226,232 ----
u.gen.mtype->mc_screen_print_it_line(&u,idx,page);
}

! const struct string * mcommon_give_item(m,I)
struct menu_common *m;
enum mcommon_item I;
{


***************
*** 236,241 ****
--- 241,264 ----

return m->mtype->mc_give_item_it(I);
}

+ struct string * mcommon_title(m)
+ struct menu_common *m;
+ {
+ union mcommon_union u;
+
+ if (m->magic != MENU_COMMON_magic)
+ panic("MENU COMMON PANIC",__FILE__,__LINE__,"mcommon_title",
+ "bad magic",0);
+
+ if (m->mtype->magic != MCOMMON_TYPE_magic)
+ panic("MENU COMMON PANIC",__FILE__,__LINE__,"mcommon_title",
+ "bad type magic",0);
+
+ mcommon_st_to_union(m,&u);
+
+ return m->mtype->mc_title_it(&u);
+ }
+

Kari E. Hurtta

unread,
Jul 28, 2005, 12:32:26 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.13

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 13/20 ) =========
Index: elmME+.2.5.alpha5-cvs/src/builtin++.c
*** elmME+.2.5.alpha4/src/builtin++.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/builtin++.c 2005-07-20 19:49:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.23.8.2 2004/07/19 09:20:00 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: builtin++.c,v 1.23.8.3 2005/07/20 16:49:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 84,94 ****
Write_to_screen (CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpQuestion,
"?\t\tThis help screen."));
NewLine ();


! PutLineX (LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpPressRet,

! "Press any key to return..."));
! if (REDRAW_MARK == menu_ReadCh (page,REDRAW_MARK))
! goto redraw;


erase_menu_context(&page);
--- 84,96 ----
Write_to_screen (CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpQuestion,
"?\t\tThis help screen."));
NewLine ();
!
! menu_PutLineX (page,
! LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpPressRet,
! "Press any key to return..."));
! if (REDRAW_MARK == menu_ReadCh(page,REDRAW_MARK))
! goto redraw;


erase_menu_context(&page);
***************
*** 123,130 ****
return ret;
}

! int builtinplusplus (bout)
struct stringbuffer * bout;
{
int idx = 0;
int is_end = 0;
--- 125,133 ----
return ret;
}

! int builtinplusplus (bout,pager_page)
struct stringbuffer * bout;
+ struct pager_page * pager_page;
{
int idx = 0;
int is_end = 0;
***************
*** 134,141 ****
int ret = '\0';
int X = 0;
struct string * search_pattern = NULL; /* Last seach string */
-
- struct menu_context *page = new_menu_context();

clear_error();

--- 137,142 ----
***************
*** 155,167 ****
so far */
FF_seen = 0;

! menu_ClearScreen(page);

cr_restart: /* so that we can handle CR specially --
ie. don't reset page variables
*/

! menu_get_sizes(page, &LINES, &COLUMNS);



--- 156,168 ----
so far */
FF_seen = 0;

! menu_ClearScreen(pager_page->root);

cr_restart: /* so that we can handle CR specially --
ie. don't reset page variables
*/



! menu_get_sizes(pager_page->root, &LINES, &COLUMNS);



***************
*** 176,183 ****
int visible_len;




! if (menu_resized(page)) {
! menu_get_sizes(page, &LINES, &COLUMNS);

! if (user_level == 0)

! PutLineX (LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltInMore0,
! "MORE (line %d-%d/%d, you've seen %d%%). Press <space> for more:"),
! idx_top+1,idx,linecount_stringbuffer(bout),
! relative);
else
! PutLineX (LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltInMore,
! "MORE (line %d-%d/%d, you've seen %d%%):"),
! idx_top+1,idx,linecount_stringbuffer(bout),
! relative);
is_end = 0;
}
EndBold();
CleartoEOS();
read_key:
! ch = menu_ReadCh (page, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);

if (ch != '/') {
if (search_pattern) {
--- 372,411 ----
StartBold();

if (idx >= linecount_stringbuffer(bout)) {
! menu_PutLineX (pager_page->root,LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinCommandi,

! "Command ('i' to return to index):"));
is_end = 1;
}
else {
int relative;

+ int ul = give_dt_enumerate_as_int(&user_level);
+

if (linecount_stringbuffer(bout) < 1)
relative = 100;
else
relative = 100 * idx / linecount_stringbuffer(bout);

! if (ul == 0)

! menu_PutLineX(pager_page->root,LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltInMore0,
! "MORE (line %d-%d/%d, you've seen %d%%). Press <space> for more:"),
! idx_top+1,idx,linecount_stringbuffer(bout),
! relative);
else
! menu_PutLineX(pager_page->root,

! LINES-1, 0,

! CATGETS(elm_msg_cat, ElmSet, ElmBuiltInMore,
! "MORE (line %d-%d/%d, you've seen %d%%):"),
! idx_top+1,idx,linecount_stringbuffer(bout),
! relative);
is_end = 0;
}
EndBold();
CleartoEOS();
read_key:

! ch = menu_ReadCh(pager_page->root, REDRAW_MARK|READCH_CURSOR|READCH_resize|
! READCH_sig_char);

***************
*** 491,496 ****


--- 495,502 ----
goto new_page; /* and draw match */
} else {
int relative;

+ int ul = give_dt_enumerate_as_int(&user_level);
+

if (linecount_stringbuffer(bout) < 1)
relative = 100;
else
***************
*** 498,504 ****

ClearLine (LINES-1);
StartBold();

! if (user_level == 0)

PutLineX (LINES-1, 0,
CATGETS(elm_msg_cat, ElmSet, ElmBuiltInNotFound0,
"NOT FOUND! (line %d-%d/%d, you've seen %d%%). Press <space> for more:"),
--- 504,510 ----

ClearLine (LINES-1);
StartBold();

! if (ul == 0)

Index: elmME+.2.5.alpha5-cvs/src/calendar.c
*** elmME+.2.5.alpha4/src/calendar.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/calendar.c 2005-07-23 22:01:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: calendar.c,v 1.13.8.1 2004/07/03 15:23:06 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: calendar.c,v 1.13.8.3 2005/07/23 19:01:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 38,45 ****

#include <s_error.h>

! char *error_description();
!
static int extract_info P_((FILE *save_to_fd,
struct MailboxView *mailbox));

--- 38,44 ----

#include <s_error.h>

! static char * is_cal_entry P_((char *string));
static int extract_info P_((FILE *save_to_fd,
struct MailboxView *mailbox));

***************

*** 65,71 ****
"Error: wrong permissions to append to calendar %s\n",
cal_val));
DPRINT(Debug,2,
! (&Debug, "** - %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, ErrorSet, ErrorCalendarCanOpen,
"Not able to append to file %s!"),
cal_val);
--- 64,70 ----
"Error: wrong permissions to append to calendar %s\n",
cal_val));
DPRINT(Debug,2,
! (&Debug, "** - %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, ErrorSet, ErrorCalendarCanOpen,
"Not able to append to file %s!"),
cal_val);
***************
*** 80,86 ****
"Error: couldn't append to calendar file %s (scan)\n",
cal_val));
DPRINT(Debug,2,(&Debug,
! "** - %s **\n", error_description(err)));
lib_error(CATGETS(elm_msg_cat, ErrorSet, ErrorCalendarAppend,
"Couldn't append to file %s!"),
cal_val);
--- 79,85 ----
"Error: couldn't append to calendar file %s (scan)\n",
cal_val));
DPRINT(Debug,2,(&Debug,
! "** - %s **\n", strerror(err)));
lib_error(CATGETS(elm_msg_cat, ErrorSet, ErrorCalendarAppend,
"Couldn't append to file %s!"),
cal_val);


***************
*** 118,124 ****

int entries = 0, lines;
int line_length;
! char buffer[SLEN], *cp, *is_cal_entry();

int current = get_current(mailbox);
struct header_rec *hdr = 0;
--- 117,123 ----

int entries = 0, lines;
int line_length;
! char buffer[SLEN], *cp;

int current = get_current(mailbox);
struct header_rec *hdr = 0;
***************
*** 161,167 ****
return(entries);
}

! char *
is_cal_entry(string)
register char *string;
{
--- 160,166 ----
return(entries);
}

! static char *
is_cal_entry(string)
register char *string;
{

Index: elmME+.2.5.alpha5-cvs/src/canceled.c
*** elmME+.2.5.alpha4/src/canceled.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/canceled.c 2005-07-23 20:14:16.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: canceled.c,v 1.5.4.2 2004/10/09 17:25:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.4.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: canceled.c,v 1.5.4.4 2005/07/23 17:14:16 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.4.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
****************************************************************************

***************
*** 19,66 ****

DEBUG_VAR(Debug,__FILE__,"ELM");

! static void cancel_menu P_((struct menu_context *page));
! static void cancel_menu(page)
! struct menu_context *page;
{


! /** write main system menu... **/

! int LINES, COLUMNS;

! menu_get_sizes(default_context,&LINES, &COLUMNS);
!

! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCancelMenuLine1,
! "To select canceled message for mailing, press <return>."));


! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCancelMenuLine2,
! "To read message, press space. j = move down, k = move up"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCancelMenuLine3,
! "Also available: d)elete, u)ndelete, i)ndex"));

}


static int showmsg_cancel_cmd P_(( struct MailboxView *mailbox,


! int cmd, int *screen_mangled,

! struct menu_context *page));
! static int showmsg_cancel_cmd(mailbox,cmd,screen_mangled, page)


struct MailboxView *mailbox;
int cmd;
! int *screen_mangled;
! struct menu_context *page;
{

-
return cmd;
}

/* This leaks on exit */
char * last_canceled_mail = NULL;

int view_canceled_mails(cancel_view,cancel_selection,aview)
struct MailboxView * cancel_view;
int *cancel_selection;

--- 19,150 ----

DEBUG_VAR(Debug,__FILE__,"ELM");

! #if ANSI_C
! static subpage_simple_redraw sb_cancel_menu;
! #endif
! static int sb_cancel_menu P_((struct menu_context *ptr,
! struct menu_param *list));
! static int sb_cancel_menu(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;
{

! menu_ClearScreen(ptr);



! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCancelMenuLine1,
! "To select canceled message for mailing, press <return>."));


! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCancelMenuLine2,
! "To read message, press space. j = move down, k = move up"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCancelMenuLine3,
! "Also available: d)elete, u)ndelete, i)ndex"));

+ return 1;
}


+
static int showmsg_cancel_cmd P_(( struct MailboxView *mailbox,


! int cmd,
! struct pager_page *pager_page));

! static int showmsg_cancel_cmd(mailbox,cmd,pager_page)


struct MailboxView *mailbox;
int cmd;
! struct pager_page *pager_page;
{

return cmd;
}

/* This leaks on exit */
char * last_canceled_mail = NULL;

+
+ static void set_mailbox_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_mailbox_screen(page,LOC, LIST)
+ struct menu_context *page;
+ struct screen_parts *LOC;


+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+
+ /* 1) Title part of screen */
+
+ if (! LOC->title_page)
+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */
+
+ if (LOC->menu_page)
+ menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
+ else if (mini_menu)
+ LOC->menu_page = new_menu_subpage(page,LINES-8,4,

+ sb_cancel_menu,LIST);


+
+ mailbox_screen_common(page,LOC, LIST);
+ }
+

+ static void check_mailbox_screen P_((struct screen_parts *LOC,
+ struct menu_param *list));
+ static void check_mailbox_screen(LOC,list)


+ struct screen_parts *LOC;
+ struct menu_param *list;
+ {

+ if (menu_resized(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));
+ sb_update_title(LOC->title_page,list);
+ }
+
+ if (LOC->menu_page) {
+ /* 2) menu page */
+ if (menu_resized(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page redraw???\n"));

+ sb_cancel_menu(LOC->menu_page,list);
+ }
+ }
+

+ /* 3) prompt part */
+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {
+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.
+ */
+ }
+
+ /* 4) headers part */
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page resized\n"));
+ }
+ if (menu_need_redraw(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page redraw\n"));
+ menu_ClearScreen(LOC->header_page);
+ }
+ }

+
+
+

int view_canceled_mails(cancel_view,cancel_selection,aview)
struct MailboxView * cancel_view;
int *cancel_selection;
***************
*** 68,168 ****
{

int leave = 0;
- int redraw = 0, nufoot = 0;
int can_flag = 0;
int i;



struct menu_context *page = new_menu_context();

struct menu_common MENU;
int LINES, COLUMNS;
!

! int header_page = 0;
if (get_message_count(cancel_view) > 0) {

if (! last_canceled_mail ||
! cancel_set_current(cancel_view,last_canceled_mail))
set_current(cancel_view,1); /* Set current to first message */

update_view(cancel_view);
! resort_mailbox(cancel_view,1, &header_page);
}

start_again:
leave = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

! set_mcommon_from_mbxview(&MENU,cancel_view);
!
! showscreen(cancel_view,

! cancel_menu,&header_page, page);



while (!leave) {
int ch;

if (menu_resized(page)) {

menu_get_sizes(page,&LINES, &COLUMNS);

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))
! if (mini_menu)
! headers_per_page = max (LINES - 14, 1);
! else
! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;

! } else
! redraw = menu_need_redraw(page);

- nufoot = 0;
- nucurr = 0;

! new_mail_check(cancel_view, &header_page, page);
! redraw += menu_need_redraw(page);


if (update_view(cancel_view)) {
! resort_mailbox(cancel_view,1, &header_page);
!
! redraw++;
}

! if (redraw) {
! redraw = 0;

! showscreen(cancel_view,
! cancel_menu,&header_page, page);
! show_last_error();
}

!
! {
! int lin,col;

! prompt_s(mcommon_give_item(&MENU,m_Prompt));


! GetXYLocation(&lin,&col);
!
! CleartoEOLN();

! ch = GetPrompt(page, elm_timeout);



- CleartoEOS();
-
- if (isascii(ch) && isprint(ch)) {
- DPRINT(Debug,4,(&Debug,
- "\nCommand: %c [%d]\n\n", ch, ch));
- } else {
- DPRINT(Debug,4,(&Debug,
- "\nCommand: %d\n\n", ch));
- }
-
- set_error(""); /* clear error buffer */
-
- MoveCursor(lin,col);
- }
-
- ch = motion(ch,&MENU,&nufoot, &header_page,

- page);


- redraw += menu_need_redraw(page);
-

switch (ch) {
case 0: /* OK */
break;

--- 152,253 ----
{

int leave = 0;
int can_flag = 0;
int i;



struct menu_context *page = new_menu_context();

+ struct screen_parts LOC = { NULL, NULL, NULL };



struct menu_common MENU;
+ struct menu_param PARAM[elm_mp_COUNT+1] = {
+ { mp_menu_common, { 0 } },
+ { mp_integer, { 0 } },
+ { mp_END, { 0 } }
+ };

+
int LINES, COLUMNS;
!

! set_mcommon_from_mbxview(&MENU,cancel_view);
! mp_list_set_mcommon(PARAM,elm_mp_menu,&MENU);
! set_mailbox_screen(page,&LOC,PARAM);
!
if (get_message_count(cancel_view) > 0) {

if (! last_canceled_mail ||
! cancel_set_current(cancel_view,last_canceled_mail))
+
set_current(cancel_view,1); /* Set current to first message */
+
+ copy_current(&MENU,LOC.header_page);

update_view(cancel_view);
! resort_mailbox(cancel_view,1);

! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
}

start_again:
+
leave = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

! showscreen(page);

while (!leave) {
int ch;

+ menu_set_default(page);
+
if (menu_resized(page)) {

+
+ set_mailbox_screen(page,&LOC,PARAM);



menu_get_sizes(page,&LINES, &COLUMNS);

! menu_trigger_redraw(page);
! }


! new_mail_check(cancel_view, page, &LOC);

if (update_view(cancel_view)) {
! resort_mailbox(cancel_view,1);
!

! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */ menu_trigger_redraw(LOC.header_page);


}

! if (menu_need_redraw(page))
! showscreen(page);

! check_mailbox_screen(&LOC, PARAM);


!
! {
! int lin,col;
!
! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));
! menu_GetXYLocation(LOC.prompt_page,&lin,&col);
!
! menu_CleartoEOLN(LOC.prompt_page);

! ch = GetPrompt(LOC.prompt_page, elm_timeout);
!
! menu_CleartoEOS(LOC.prompt_page);


!
! if (isascii(ch) && isprint(ch)) {

! DPRINT(Debug,4,(&Debug,
! "\nCommand: %c [%d]\n\n", ch, ch));


! } else {
! DPRINT(Debug,4,(&Debug,
! "\nCommand: %d\n\n", ch));

! }
!
! set_error(""); /* clear error buffer */
!
! menu_MoveCursor(LOC.prompt_page,lin,col);
}

! ch = motion(ch,&MENU,&LOC,
! page);

switch (ch) {
case 0: /* OK */
break;
***************

*** 206,211 ****
--- 291,297 ----
struct header_rec *hdr;


FILE *F;
int i = 0;
+ struct pager_page * PP = init_pager_page(&MENU);

/* define_softkeys(READ); */

***************
*** 215,221 ****
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(cancel_view),
! page);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 301,307 ----


mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(cancel_view),
! PP);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 224,238 ****
while (i > 0) {
i = process_showmsg_cmd(i, cancel_view,
showmsg_cancel_cmd,
! aview, &header_page,
! page);

switch (i) {
case EOF:
goto eof_mark;

case 'X': /* Quick Exit */

goto quit_mark;
case 0:
break;

--- 310,327 ----


while (i > 0) {
i = process_showmsg_cmd(i, cancel_view,
showmsg_cancel_cmd,
! aview,
! PP);

switch (i) {
case EOF:
+
+ exit_pager_page(&PP,page);
goto eof_mark;

case 'X': /* Quick Exit */

+ exit_pager_page(&PP,page);
goto quit_mark;
case 0:
break;
***************
*** 244,253 ****
}
}

current = get_current(cancel_view);

! redraw++;
! (void)get_page(current, &MENU, &header_page);
}
}
break;

--- 333,343 ----


}
}

+ exit_pager_page(&PP,page);
current = get_current(cancel_view);

! menu_trigger_redraw(page);
! get_page(&MENU, LOC.header_page);
}
}
break;
***************

*** 281,314 ****

}

! if (redraw)


! showscreen(cancel_view,
! cancel_menu,&header_page, page);
!

! check_range(&MENU);
!

! if (nucurr == NEW_PAGE) {

! DPRINT(Debug,5,(&Debug, " nucurr == NEW_PAGE\n"));
! show_headers(&MENU,&header_page, page);

! } else if (nucurr == SAME_PAGE) {

! DPRINT(Debug,5,(&Debug, " nucurr == SAME_PAGE\n"));

! show_current(&MENU,&header_page, page);
! } else if (nufoot) {

! if (mini_menu) {
! MoveCursor(LINES-8, 0);
! CleartoEOS();

! cancel_menu(page);


! }
! else {
! MoveCursor(LINES-5, 0);
! CleartoEOS();
! }
! show_last_error(); /* for those operations that have to
! * clear the footer except for a message.
! */
! }

} /* the BIG while loop! */


--- 371,383 ----



}

! if (menu_need_redraw(page))
! showscreen(page);

! check_range(&MENU, &LOC);

+ check_mailbox_screen(&LOC, PARAM);
+

} /* the BIG while loop! */


***************
*** 316,322 ****


int marked_deleted = 0;

for (i = 0; i < get_message_count(cancel_view); i++) {
! if (mcommon_ison_status(&MENU,i,DELETED))
marked_deleted++;
}

--- 385,391 ----


int marked_deleted = 0;

for (i = 0; i < get_message_count(cancel_view); i++) {
! if (mcommon_ison_status(&MENU,i,status_basic,DELETED))
marked_deleted++;
}

***************
*** 385,396 ****


if (get_current(cancel_view) > (n = get_message_count(cancel_view)))
set_current(cancel_view,n);

! resort_mailbox(cancel_view,1, &header_page);
!
goto start_again;
}

OUT:
erase_menu_context(&page);

DPRINT(Debug,4,(&Debug, "view_canceled_mails=%d *cancel_selection=%d\n",

--- 454,467 ----


if (get_current(cancel_view) > (n = get_message_count(cancel_view)))
set_current(cancel_view,n);

! resort_mailbox(cancel_view,1);

! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */

goto start_again;
}

OUT:
+ free_mailbox_screen(&LOC);
+
erase_menu_context(&page);

DPRINT(Debug,4,(&Debug, "view_canceled_mails=%d *cancel_selection=%d\n",

Index: elmME+.2.5.alpha5-cvs/src/date.c
*** elmME+.2.5.alpha4/src/date.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/date.c 2005-07-20 19:49:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: date.c,v 1.14 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: date.c,v 1.14.8.1 2005/07/20 16:49:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.1 $ $State: Exp $
*


* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************

Index: elmME+.2.5.alpha5-cvs/src/def_elm.h
*** elmME+.2.5.alpha4/src/def_elm.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/def_elm.h 2005-07-20 19:49:46.000000000 +0300
***************
*** 1,7 ****
! /* $Id: def_elm.h,v 1.3.8.1 2004/04/18 16:55:42 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.1 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! /* $Id: def_elm.h,v 1.3.8.2 2005/07/20 16:49:46 hurtta Exp $ */



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/

***************
*** 11,19 ****
--- 11,22 ----

#include "elm_defs.h"
#include "mime.h"


+ #include "mailerlib.h"
#include "me.h"

#include "elm_globals.h"



+ extern JMP_BUF GetPromptBuf; /* setjmp buffer */

+ extern int InGetPrompt; /* set if in GetPrompt() in read() */

/*
* Local Variables:
Index: elmME+.2.5.alpha5-cvs/src/delete.c
*** elmME+.2.5.alpha4/src/delete.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/delete.c 2005-07-20 19:49:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: delete.c,v 1.18 2004/03/27 18:31:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: delete.c,v 1.18.8.1 2005/07/20 16:49:46 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.1 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************

*** 20,217 ****
#include "def_elm.h"
#include "s_elm.h"

! void delete_msg(real_del, update_screen, menu, header_page)
! int real_del, update_screen;

struct menu_common *menu;
! int header_page;

{
/** Delete current message. If real-del is false, then we're
actually requested to toggle the state of the current
message...
**/

int current = mcommon_get_current(menu);
!

if (mcommon_get_type(menu, current-1) & SYSTEM)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoDelSysAlias,
"Can't delete a system alias!"));
else if (real_del) {

! mcommon_setf_status(menu,current-1,DELETED);

} else {

! if (mcommon_ison_status(menu,current-1,DELETED))
! mcommon_clearf_status(menu,current-1,DELETED);
else
! mcommon_setf_status(menu,current-1,DELETED);

}

! if (update_screen)
! show_msg_status(current-1,menu, header_page);
}

! void unread_msg(update_screen, mailbox, header_page)
! int update_screen;
struct MailboxView *mailbox;
! int header_page;
{
int current = get_current(mailbox);
struct header_rec * hdr = give_header(mailbox,current-1);

! /** change the message flag to unread **/

if (hdr) {
setit(hdr->status, UNREAD);

hdr->status_chgd = TRUE;
}
!

! if (update_screen) {
struct menu_common MENU;

! set_mcommon_from_mbxview(&MENU, mailbox);

! show_msg_status(current-1, &MENU, header_page);
}
}

! void undelete_msg(update_screen,menu,header_page)
! int update_screen;

struct menu_common *menu;
! int header_page;
{

int current = mcommon_get_current(menu);

! mcommon_clearf_status(menu,current-1,DELETED);

! if (update_screen)
! show_msg_status(current-1,menu, header_page);
! }

! void show_msg_status(msg, menu, header_page)
! int msg;

! struct menu_common *menu;


! int header_page;
! {
! /** show the status of the current message only. **/
!
! char tempbuf[3];

! int current = 0;
!

! /* ??? */
! strfcpy(tempbuf, mcommon_show_status(menu,msg), sizeof tempbuf);
!
! if (on_page(msg, menu, header_page)) {
! MoveCursor(((compute_visible(msg+1, menu)-1)
! % headers_per_page) + 4, 2);
! if (msg+1 == current && !arrow_cursor) {
! StartBold();
! Writechar( tempbuf[0] );
! EndBold();
! }
! else
! Writechar( tempbuf[0] );
}
}

! int tag_message(update_screen, menu, header_page)
! int update_screen;

struct menu_common *menu;
! int header_page;

{
/** Tag current message and return TRUE.
If already tagged, untag it and return FALSE. **/

! int istagged;

! int current = mcommon_get_current(menu);
!

! if (mcommon_ison_status(menu,current-1,TAGGED)) {
!
! mcommon_clearf_status(menu,current-1,TAGGED);
! istagged = FALSE;

!
! } else {
!
! mcommon_setf_status(menu,current-1,TAGGED);
! istagged = TRUE;
!
! }
!

! if(update_screen)
! show_msg_tag(current-1,menu, header_page);
!
! return(istagged);
! }
!
! void show_msg_tag(msg, menu, header_page)
! int msg;

! struct menu_common *menu;


! int header_page;
! {
! /** show the tag status of the current message only. **/

!
int current = mcommon_get_current(menu);

! if (on_page(msg, menu, header_page)) {
!
! MoveCursor(((compute_visible(msg+1, menu)-1) %
! headers_per_page) + 4, 4);
!
! if (msg+1 == current && !arrow_cursor) {
!
! StartBold();
! Writechar(mcommon_ison_status(menu,msg,TAGGED)? '+' : ' ');
! EndBold();

!
! } else {
!

! Writechar(mcommon_ison_status(menu,msg,TAGGED)? '+' : ' ');

! }
}
}

! void show_new_status(msg,menu, header_page)
! int msg;

struct menu_common *menu;
! int header_page;
{

- int header_page;
struct menu_context *page;
{

/** delete all tagged messages. return TRUE if the current message was

--- 20,172 ----
#include "def_elm.h"
#include "s_elm.h"


! void delete_msg(real_del, menu, LOC)
! int real_del;

struct menu_common *menu;
! struct screen_parts *LOC;
{

/** Delete current message. If real-del is false, then we're
actually requested to toggle the state of the current
message...
**/

int current = mcommon_get_current(menu);
!

if (mcommon_get_type(menu, current-1) & SYSTEM)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoDelSysAlias,
"Can't delete a system alias!"));
else if (real_del) {

! mcommon_setf_status(menu,current-1,status_basic,DELETED);

} else {

! if (mcommon_ison_status(menu,current-1,status_basic,DELETED))
! mcommon_clearf_status(menu,current-1,status_basic,DELETED);
else
! mcommon_setf_status(menu,current-1,status_basic,DELETED);

}

+
+ if (LOC) {
+ int vis;

! vis = compute_visible(current, menu);
! menu_header_status_update(LOC->header_page,vis-1);
! }
}

! void unread_msg(mailbox, header_area)
struct MailboxView *mailbox;


! struct menu_context *header_area;
{
int current = get_current(mailbox);

struct header_rec * hdr = give_header(mailbox,current-1);

! /** change the message flag to unread **/

if (hdr) {
setit(hdr->status, UNREAD);

hdr->status_chgd = TRUE;
}
!
! if (header_area) {


struct menu_common MENU;
+ int vis;

! set_mcommon_from_mbxview(&MENU,mailbox);

! vis = compute_visible(current, &MENU);
! menu_header_status_update(header_area,vis-1);
}
}

! void undelete_msg(menu,header_area)

struct menu_common *menu;
! struct menu_context *header_area;
{
int current = mcommon_get_current(menu);

! mcommon_clearf_status(menu,current-1,status_basic,DELETED);



! if (header_area) {
! int vis;

! vis = compute_visible(current, menu);
! menu_header_status_update(header_area,vis-1);
}
}

!
! int tag_message(menu, header_area)

struct menu_common *menu;


! struct menu_context *header_area;
{
/** Tag current message and return TRUE.
If already tagged, untag it and return FALSE. **/

! int istagged;

int current = mcommon_get_current(menu);
+

+ if (mcommon_ison_status(menu,current-1,status_basic,TAGGED)) {
+
+ mcommon_clearf_status(menu,current-1,status_basic,TAGGED);
+ istagged = FALSE;

+
+ } else {
+
+ mcommon_setf_status(menu,current-1,status_basic,TAGGED);
+ istagged = TRUE;
+
+ }
+

+ if (header_area) {
+ int vis;

! vis = compute_visible(current, menu);

! menu_header_status_update(header_area,vis-1);
}
+
+ return(istagged);
}

! int flag_message(menu, header_area)

struct menu_common *menu;


! struct menu_context *header_area;
{
! /** flag current message and return TRUE.
! If already flagged, untag it and return FALSE. **/

! int isflagged;

! int current = mcommon_get_current(menu);
!

! if (mcommon_ison_status(menu,current-1,status_1,S1_FLAGGED)) {

! mcommon_clearf_status(menu,current-1,status_1,S1_FLAGGED);
! isflagged = FALSE;

!
! } else {
!

! mcommon_setf_status(menu,current-1,status_1,S1_FLAGGED);
! isflagged = TRUE;

}
+
+ if (header_area) {
+ int vis;
+
+ vis = compute_visible(current, menu);
+
+ menu_header_status_update(header_area,vis-1);
+ }
+
+ return(isflagged);
}

! int DeleteTagged(menu, page, header_area)
struct menu_common *menu;

struct menu_context *page;


+ struct menu_context *header_area;
{

/** delete all tagged messages. return TRUE if the current message was
***************
*** 221,252 ****

int iindex, count = 0;
int mc = mcommon_get_count(menu);
int current = mcommon_get_current(menu);


int LINES, COLUMNS;

menu_get_sizes(page, &LINES, &COLUMNS);

for (iindex=0; iindex < mc; iindex++) {
- if (mcommon_ison_status(menu,iindex,TAGGED)) {

! mcommon_setf_status(menu,iindex,DELETED);
! count++;
! show_new_status(iindex,menu, header_page);
}
}

if (count == 1)
! print_format_center(LINES-1,
! CATGETS(elm_msg_cat, ElmSet, ElmItemDeleted,
! "%S deleted."),
! mcommon_give_item(menu,m_Item));
else
! print_format_center(LINES-1,
! CATGETS(elm_msg_cat, ElmSet, ElmItemsDeleted,
! "%d %S deleted."),
! count,
! mcommon_give_item(menu,m_items));

! return( mcommon_ison_status(menu,current-1, DELETED) ? 1 : 0);
}

/*
--- 176,216 ----

int iindex, count = 0;
int mc = mcommon_get_count(menu);
int current = mcommon_get_current(menu);
+ int selected = mcommon_get_selected(menu);
int LINES, COLUMNS;


menu_get_sizes(page, &LINES, &COLUMNS);

for (iindex=0; iindex < mc; iindex++) {

! if (!selected ||


! (selected && mcommon_ison_status(menu,iindex,
! status_basic,VISIBLE))) {
!
! if (mcommon_ison_status(menu,iindex,status_basic,TAGGED)) {
!
! mcommon_setf_status(menu,iindex,status_basic,DELETED);
! count++;

!
! if (header_area)


! menu_header_status_update(header_area,iindex);
!
! }
}
}

if (count == 1)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmItemDeleted,
! "%S deleted."),
! mcommon_give_item(menu,m_Item));
else
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmItemsDeleted,
! "%d %S deleted."),
! count,
! mcommon_give_item(menu,m_items));

! return( mcommon_ison_status(menu,current-1, status_basic,
! DELETED) ? 1 : 0);
}

/*

Index: elmME+.2.5.alpha5-cvs/src/digest.c
*** elmME+.2.5.alpha4/src/digest.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/digest.c 2005-07-23 20:14:16.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.10.8.2 2004/10/09 17:25:35 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.2 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: digest.c,v 1.10.8.4 2005/07/23 17:14:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
***************
*** 19,153 ****

DEBUG_VAR(Debug,__FILE__,"ELM");

! static void digest_menu P_((struct menu_context *page));
! static void digest_menu(page)
! struct menu_context *page;
{


! /** write main system menu... **/

! int LINES, COLUMNS;
!
! menu_get_sizes(page, &LINES, &COLUMNS);
!

! if (user_level == 0) { /* a rank beginner. Give less options */
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,


! "You can use any of the following commands by pressing the first character;"));
! print_format_center(LINES-7,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0DgtLine2,
! "m)ail a message, r)eply or f)orward mail, return to i)ndex"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0DgtLine3,
! "To read a message, press <return>. j = move down, k = move up"));
} else {
! print_format_center(LINES-8,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,

! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));
! print_format_center(LINES-7,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1DgtLine2,

! "a)lias, C)opy, f)orward, g)roup reply, m)ail,"));
! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1DgtLine3,


! "n)ext, o)ptions, P)rint text, r)eply, s)ave, t)ag, or i)index"));
}
}

static int showmsg_digest_cmd P_(( struct MailboxView *mailbox,


! int cmd, int *screen_mangled,

! struct menu_context *page));
! static int showmsg_digest_cmd(mailbox,cmd,screen_mangled,page)


struct MailboxView *mailbox;
int cmd;
! int *screen_mangled;
! struct menu_context *page;
{

return cmd;
}


static void digest_loop P_((struct MailboxView *mailbox,

! struct AliasView *aview,
! int header_page));
! static void digest_loop(mailbox, aview, header_page)


struct MailboxView *mailbox;
struct AliasView *aview;
- int header_page;

{
int leave = 0;
- int redraw = 0, nufoot = 0;

int auto_assemble = 1;



struct menu_context *page = new_menu_context();

!
! showscreen(mailbox,
! digest_menu,&header_page, page);
!

while (!leave) {
int ch;
- struct menu_common MENU;

int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);

if (menu_resized(page)) {

! menu_get_sizes(page,&LINES, &COLUMNS);
!

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))
! if (mini_menu)
! headers_per_page = max (LINES - 14, 1);
! else
! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;

! } else
! redraw = menu_need_redraw(page);

! nufoot = 0;


! nucurr = 0;


if (update_view(mailbox)) {
! resort_mailbox(mailbox,1, &header_page);
!
! redraw++;
}

! if (redraw) {
! redraw = 0;
! showscreen(mailbox,

! digest_menu,&header_page, page);
! show_last_error();


! }
!

! {
int lin,col;

! prompt_s(mcommon_give_item(&MENU, m_Prompt));
! GetXYLocation(&lin,&col);

! CleartoEOLN();

! if (auto_assemble && 2 == fragment_handling &&
have_partial(mailbox)) {
ch = 'A';
auto_assemble = 0;

DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else

! ch = GetPrompt(page, elm_timeout);

! CleartoEOS();



if (isascii(ch) && isprint(ch)) {
DPRINT(Debug,4,(&Debug,

--- 19,240 ----

DEBUG_VAR(Debug,__FILE__,"ELM");

! #if ANSI_C
! static subpage_simple_redraw sb_digest_menu;
! #endif
! static int sb_digest_menu P_((struct menu_context *ptr,
! struct menu_param *list));
! static int sb_digest_menu(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;

{


! int ul = give_dt_enumerate_as_int(&user_level);
!

! menu_ClearScreen(ptr);
!
! if (ul == 0) { /* a rank beginner. Give less options */
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,


! "You can use any of the following commands by pressing the first character;"));
! menu_print_format_center(ptr,1,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0DgtLine2,
! "m)ail a message, r)eply or f)orward mail, return to i)ndex"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0DgtLine3,
! "To read a message, press <return>. j = move down, k = move up"));
} else {
! menu_print_format_center(ptr,0,


! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,

! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));
! menu_print_format_center(ptr,1,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1DgtLine2,

! "a)lias, C)opy, f)orward, g)roup reply, m)ail,"));
! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1DgtLine3,
! "n)ext, o)ptions, P)rint text, r)eply, s)ave, t)ag, or i)index"));
}
+
+ return 1;
}

static int showmsg_digest_cmd P_(( struct MailboxView *mailbox,


! int cmd,
! struct pager_page *pager_page));

! static int showmsg_digest_cmd(mailbox,cmd,pager_page)


struct MailboxView *mailbox;
int cmd;
! struct pager_page *pager_page;
{

return cmd;
}


+
+ static void set_mailbox_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_mailbox_screen(page,LOC, LIST)
+ struct menu_context *page;
+ struct screen_parts *LOC;


+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+
+ /* 1) Title part of screen */
+
+ if (! LOC->title_page)
+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */
+
+ if (LOC->menu_page)
+ menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
+ else if (mini_menu)
+ LOC->menu_page = new_menu_subpage(page,LINES-8,4,

+ sb_digest_menu,LIST);


+
+ mailbox_screen_common(page,LOC, LIST);
+ }
+
+

+ static void check_mailbox_screen P_((struct screen_parts *LOC,
+ struct menu_param *list));
+ static void check_mailbox_screen(LOC,list)


+ struct screen_parts *LOC;
+ struct menu_param *list;
+ {

+ if (menu_resized(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));
+ sb_update_title(LOC->title_page,list);
+ }
+
+ if (LOC->menu_page) {
+ /* 2) menu page */
+ if (menu_resized(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page redraw???\n"));

+ sb_digest_menu(LOC->menu_page,list);
+ }
+ }
+

+ /* 3) prompt part */
+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {
+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.
+ */
+ }
+
+ /* 4) headers part */
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page resized\n"));
+ }
+ if (menu_need_redraw(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page redraw\n"));
+ menu_ClearScreen(LOC->header_page);
+ }
+ }
+

static void digest_loop P_((struct MailboxView *mailbox,
! struct AliasView *aview));
! static void digest_loop(mailbox, aview)


struct MailboxView *mailbox;
struct AliasView *aview;

{
int leave = 0;
int auto_assemble = 1;

struct menu_context *page = new_menu_context();

! struct screen_parts LOC = { NULL };

! struct menu_common MENU;


! struct menu_param PARAM[elm_mp_COUNT+1] = {
! { mp_menu_common, { 0 } },
! { mp_integer, { 0 } },

! { mp_END, { 0 } }


! };
!
! mp_list_set_mcommon(PARAM,elm_mp_menu,&MENU);
!
! set_mcommon_from_mbxview(&MENU,mailbox);
! set_mailbox_screen(page,&LOC,PARAM);
!

! resort_mailbox(mailbox,1);
! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */

! copy_current(&MENU,LOC.header_page);
!
! showscreen(page);

while (!leave) {
int ch;

int LINES, COLUMNS;

+ menu_set_default(page);
+

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);

if (menu_resized(page)) {

! set_mailbox_screen(page,&LOC,PARAM);

! menu_get_sizes(page,&LINES, &COLUMNS);

+ menu_trigger_redraw(page);
+ }


if (update_view(mailbox)) {
! resort_mailbox(mailbox,1);
! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! menu_trigger_redraw(LOC.header_page);
! menu_trigger_redraw(LOC.title_page);
}

! if (menu_need_redraw(page))
! showscreen(page);
! check_mailbox_screen(&LOC, PARAM);

! {

int lin,col;
+ int fh = give_dt_enumerate_as_int(&fragment_handling);



! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));

! menu_GetXYLocation(LOC.prompt_page,&lin,&col);

! menu_CleartoEOLN(LOC.prompt_page);

! if (auto_assemble && 2 == fh &&
have_partial(mailbox)) {
ch = 'A';
auto_assemble = 0;

DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else

! ch = GetPrompt(LOC.prompt_page,elm_timeout);

! menu_CleartoEOS(LOC.prompt_page);



if (isascii(ch) && isprint(ch)) {
DPRINT(Debug,4,(&Debug,

***************
*** 159,182 ****



set_error(""); /* clear error buffer */

! MoveCursor(lin,col);


}

! ch = mailbox_command(mailbox,ch, &nufoot,

showmsg_digest_cmd, aview,
! &header_page,page);

- redraw += menu_need_redraw(page);

switch (ch) {
case 0: /* OK */
break;

case 'A': {
- int current = get_current(mailbox);

!

! Write_to_screen(CATGETS(elm_msg_cat,
ElmSet, ElmAssemble,
"Assemble message fragments"));
FlushBuffer();

--- 246,267 ----



set_error(""); /* clear error buffer */

! menu_MoveCursor(LOC.prompt_page,lin,col);


}

! ch = mailbox_command(mailbox,ch, &LOC,

showmsg_digest_cmd, aview,
! page);




switch (ch) {
case 0: /* OK */
break;

case 'A': {

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat,

ElmSet, ElmAssemble,
"Assemble message fragments"));
FlushBuffer();
***************
*** 184,192 ****

ViewPartial(mailbox,aview);

! (void)get_page(current, &MENU, &header_page);
! redraw++;
!
}
break;

--- 269,276 ----

ViewPartial(mailbox,aview);

! get_page(&MENU, LOC.header_page);
! menu_trigger_redraw(page);
}
break;

***************
*** 196,204 ****
case 'i':
case 'x':
case 'X':


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmReturnIndex,
! "Return to index"));
FlushBuffer();

leave = 1;

--- 280,289 ----
case 'i':


case 'x':
case 'X':
! menu_Write_to_screen(LOC.prompt_page,

! CATGETS(elm_msg_cat, ElmSet,
! ElmReturnIndex,
! "Return to index"));
FlushBuffer();

leave = 1;
***************

*** 215,251 ****



}

! if (redraw)
! showscreen(mailbox,

! digest_menu,&header_page, page);
!
! check_range(&MENU);


- if (nucurr == NEW_PAGE) {
- DPRINT(Debug,5,(&Debug, " nucurr == NEW_PAGE\n"));
- show_headers(&MENU,&header_page, page);
- } else if (nucurr == SAME_PAGE) {
- DPRINT(Debug,5,(&Debug, " nucurr == SAME_PAGE\n"));
- show_current(&MENU, &header_page, page);
- } else if (nufoot) {
- if (mini_menu) {
- MoveCursor(LINES-8, 0);
- CleartoEOS();
- digest_menu(page);
- }
- else {
- MoveCursor(LINES-5, 0);
- CleartoEOS();
- }

- show_last_error(); /* for those operations that have to
- * clear the footer except for a message.
- */
- }
-

} /* the BIG while loop! */

OUT:
erase_menu_context(&page);

}

--- 300,315 ----



}

! if (menu_need_redraw(page))
! showscreen(page);

+ check_range(&MENU,&LOC);
+ check_mailbox_screen(&LOC,PARAM);



} /* the BIG while loop! */

OUT:
+ free_mailbox_screen(&LOC);
erase_menu_context(&page);

}
***************

*** 313,327 ****




if (new_mailbox) {
- int header_page = 0;
if (get_message_count(new_mailbox) > 0) {
set_current(new_mailbox,1); /* Set current to first message */

update_view(new_mailbox);
- resort_mailbox(new_mailbox,1, &header_page);
}

! digest_loop(new_mailbox, aview, header_page);

free_mailbox(& new_mailbox);
}
--- 377,389 ----




if (new_mailbox) {
if (get_message_count(new_mailbox) > 0) {
set_current(new_mailbox,1); /* Set current to first message */

update_view(new_mailbox);
}

! digest_loop(new_mailbox, aview);

free_mailbox(& new_mailbox);
}

Index: elmME+.2.5.alpha5-cvs/src/edit.c
*** elmME+.2.5.alpha4/src/edit.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/edit.c 2005-07-26 11:28:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: edit.c,v 1.19.8.2 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: edit.c,v 1.19.8.4 2005/07/26 08:28:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.19.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 25,38 ****


extern int errno;
#endif

- char *error_description();

- long bytes();
-
#ifdef ALLOW_MAILBOX_EDITING

! void edit_mailbox(mailbox, header_page, page)
struct MailboxView **mailbox;


- int *header_page;
struct menu_context *page;
{

/** Allow the user to edit their folder, always resynchronizing

--- 25,34 ----
extern int errno;
#endif


#ifdef ALLOW_MAILBOX_EDITING

! void edit_mailbox(mailbox, page)
struct MailboxView **mailbox;

struct menu_context *page;
{


/** Allow the user to edit their folder, always resynchronizing
***************
*** 48,54 ****

in this code.
**/

! CONST char *edited_file = NULL;
struct folder_info * f = get_main_folder(*mailbox);

if (!f)
--- 44,50 ----
in this code.
**/

! const char *edited_file = NULL;
struct folder_info * f = get_main_folder(*mailbox);

if (!f)
***************
*** 73,90 ****


}

menu_ClearScreen(page);
! newmbox_1(f, FALSE, mailbox, FALSE, header_page,
page);


! showscreen(*mailbox, show_menu, header_page, page);
return;
}

#endif

int edit_a_file(editfile, page)
! CONST char *editfile;
struct menu_context *page;
{
/** Edit a file. This routine is used by edit_mailbox()
--- 69,86 ----


}

menu_ClearScreen(page);
! newmbox_1(f, FALSE, mailbox, FALSE,
page);


! showscreen(page);
return;
}

#endif

int edit_a_file(editfile, page)
! const char *editfile;
struct menu_context *page;
{
/** Edit a file. This routine is used by edit_mailbox()
Index: elmME+.2.5.alpha5-cvs/src/editmsg.c
*** elmME+.2.5.alpha4/src/editmsg.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/editmsg.c 2005-07-26 11:28:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.42.8.4 2004/07/19 09:20:00 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: editmsg.c,v 1.42.8.8 2005/07/26 08:28:43 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.42.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 36,44 ****

DEBUG_VAR(Debug,__FILE__,"misc");

- char *error_description();


- long fsize();
-
/* The built-in editor is not re-entrant! */
static int builtin_editor_active = FALSE;
static char *simple_continue = NULL;

--- 36,41 ----
***************
*** 161,170 ****


Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmEditmsgEndMsg,
"\t. \tby itself on a line (or a control-D) ends the message.\n\r"));

! PutLineX (LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpPressRet,
! "Press any key to return..."));
! if (REDRAW_MARK == menu_ReadCh (page,REDRAW_MARK))
goto redraw;

erase_menu_context(&page);

--- 158,167 ----


Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmEditmsgEndMsg,
"\t. \tby itself on a line (or a control-D) ends the message.\n\r"));

! menu_PutLineX(page,LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmBuiltinHelpPressRet,
! "Press any key to return..."));
! if (REDRAW_MARK == menu_ReadCh(page,REDRAW_MARK))
goto redraw;

erase_menu_context(&page);
***************

*** 282,288 ****
int n;
int lines = 0, nchars = 0;
struct run_state RS;
! CONST char * argv[4];
uint16 ch = give_unicode_from_string(I->pvector[0],0);
int X;
struct string * arg;
--- 279,285 ----
int n;
int lines = 0, nchars = 0;
struct run_state RS;
! const char * argv[4];
uint16 ch = give_unicode_from_string(I->pvector[0],0);
int X;
struct string * arg;
***************
*** 423,429 ****


return;
}

! SIGHAND_TYPE
edit_interrupt(sig)
int sig;
{

--- 420,429 ----


return;
}

!
! static SIGHAND_TYPE edit_interrupt P_((int sig));
!
! static SIGHAND_TYPE
edit_interrupt(sig)
int sig;
{
***************

*** 458,463 ****
--- 458,465 ----


LONGJMP(edit_location, 1); /* get back */
}

+ static int enforce_newline P_((char *filename));
+
static int enforce_newline(filename)
char *filename;
{
***************

*** 473,503 ****
DPRINT(Debug,1,
(&Debug, "fopen failed on %s with mode r+\n", filename));
DPRINT(Debug,1,


! (&Debug, "** %s **\n", error_description(err)));

} else if (fseek(fp, -1, 2) == -1) {
err = errno;
DPRINT(Debug,1,(&Debug,
"fseek(-1,2) failed on %s\n", filename));
DPRINT(Debug,1,(&Debug,
! "** %s **\n", error_description(err)));
} else if ((ch = fgetc(fp)) == EOF) {
err = errno;
DPRINT(Debug,1,(&Debug,
"unexpected EOF on %s\n", filename));
if (ferror(fp))
DPRINT(Debug,1,(&Debug,
! "** %s **\n", error_description(err)));
} else if (ch == '\n') {
retcode = 1;
} else if (fseek(fp, 0, 2) == -1) {
err = errno;
DPRINT(Debug,1,(&Debug,"fseek(0,2) failed on %s\n", filename));
! DPRINT(Debug,1,(&Debug, "** %s **\n", error_description(err)));
fclose(fp);
} else if (fputc('\n', fp) == EOF) {
err = errno;
DPRINT(Debug,1,(&Debug, "fputc('\\n') failed on %s\n", filename));
! DPRINT(Debug,1,(&Debug, "** %s **\n", error_description(err)));
} else {
retcode = 1;
}
--- 475,505 ----
DPRINT(Debug,1,
(&Debug, "fopen failed on %s with mode r+\n", filename));
DPRINT(Debug,1,


! (&Debug, "** %s **\n", strerror(err)));

} else if (fseek(fp, -1, 2) == -1) {
err = errno;
DPRINT(Debug,1,(&Debug,
"fseek(-1,2) failed on %s\n", filename));
DPRINT(Debug,1,(&Debug,
! "** %s **\n", strerror(err)));
} else if ((ch = fgetc(fp)) == EOF) {
err = errno;
DPRINT(Debug,1,(&Debug,
"unexpected EOF on %s\n", filename));
if (ferror(fp))
DPRINT(Debug,1,(&Debug,
! "** %s **\n", strerror(err)));
} else if (ch == '\n') {
retcode = 1;
} else if (fseek(fp, 0, 2) == -1) {
err = errno;
DPRINT(Debug,1,(&Debug,"fseek(0,2) failed on %s\n", filename));
! DPRINT(Debug,1,(&Debug, "** %s **\n", strerror(err)));
fclose(fp);
} else if (fputc('\n', fp) == EOF) {
err = errno;
DPRINT(Debug,1,(&Debug, "fputc('\\n') failed on %s\n", filename));
! DPRINT(Debug,1,(&Debug, "** %s **\n", strerror(err)));
} else {
retcode = 1;
}
***************
*** 530,540 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEditCantExecute,
"Can't execute editor: %.50s: %.30s"),
! test, error_description(err));

DPRINT(Debug,5,(&Debug,
"have_editor: no access %s: %s\n",test,
! error_description(err)));
sleep_message();
return_value = 0;
}
--- 532,542 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEditCantExecute,
"Can't execute editor: %.50s: %.30s"),
! test, strerror(err));

DPRINT(Debug,5,(&Debug,
"have_editor: no access %s: %s\n",test,
! strerror(err)));
sleep_message();
return_value = 0;
}
***************
*** 680,686 ****
"System call failed with stat %d (edit_the_message)\n",
stat));
DPRINT(Debug,1,(&Debug,
! "** %s **\n", error_description(err)));

ClearLine(LINES-2); /* ? ? ? */

--- 682,688 ----
"System call failed with stat %d (edit_the_message)\n",
stat));
DPRINT(Debug,1,(&Debug,
! "** %s **\n", strerror(err)));

ClearLine(LINES-2); /* ? ? ? */

***************
*** 1295,1301 ****
if (err) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFile,


"Can't open %s!"),

! I->builtin->filename, error_description(err));
return 0;
}

--- 1297,1303 ----
if (err) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFile,


"Can't open %s!"),

! I->builtin->filename, strerror(err));
return 0;
}

***************
*** 1310,1323 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFile,


"Can't open %s!"),

! I->builtin->filename, error_description(err));

DPRINT(Debug,1,
(&Debug,
"Error encountered trying to open file %s;\n",
I->builtin->filename));
DPRINT(Debug,1,


! (&Debug, "** %s **\n", error_description(err)));

return 0;
}

--- 1312,1325 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFile,


"Can't open %s!"),

! I->builtin->filename, strerror(err));

DPRINT(Debug,1,
(&Debug,
"Error encountered trying to open file %s;\n",
I->builtin->filename));
DPRINT(Debug,1,


! (&Debug, "** %s **\n", strerror(err)));

return 0;
}

***************
*** 1369,1382 ****
err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFile,


"Can't open %s!"),

! I->builtin->filename, error_description(err));

DPRINT(Debug,1,
(&Debug,
"Error encountered trying to open file %s;\n",
I->builtin->filename));
DPRINT(Debug,1,


! (&Debug, "** %s **\n", error_description(err)));

return 0;
}

--- 1371,1384 ----
err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFile,


"Can't open %s!"),

! I->builtin->filename, strerror(err));

DPRINT(Debug,1,
(&Debug,
"Error encountered trying to open file %s;\n",
I->builtin->filename));
DPRINT(Debug,1,


! (&Debug, "** %s **\n", strerror(err)));

return 0;
}

***************
*** 1686,1693 ****


ElmUseSpecificCommand,
"(You need to use a specific command here. Continue.)"));
} else {
char * s3 = elm_message(FRM("%s%s.%d"),
! temp_dir, temp_edit, getpid());
char * s1;

X = 1;

--- 1688,1697 ----


ElmUseSpecificCommand,
"(You need to use a specific command here. Continue.)"));
} else {

+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
char * s3 = elm_message(FRM("%s%s.%d"),


! tmp ? tmp : "/tmp/",

! temp_edit, getpid());
char * s1;

X = 1;
***************

*** 1729,1737 ****
redraw2:



/* ? ? ? */

! PutLineX(LINES-1, 0, CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyToReturn,

! "\n\nPress any key to return to ELM: "));



if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {

goto redraw2;
--- 1733,1742 ----
redraw2:



/* ? ? ? */

! menu_PutLineX(cpage,
! LINES-1, 0, CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyToReturn,
! "\n\nPress any key to return to ELM: "));



if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {

goto redraw2;
***************
*** 1980,1988 ****
return editor_wrap(I);
case em_editor_escape:
return editor_escape(I);
}

- return NULL;
}


--- 1985,1994 ----
return editor_wrap(I);
case em_editor_escape:
return editor_escape(I);
+ default:
+ return NULL;
}

}


***************
*** 2003,2010 ****


routine above have a pretty incestuous relationship (!)...
**/

! SIGHAND_TYPE edit_interrupt();
! SIGHAND_TYPE (*oldint)(), (*oldquit)();


struct builtin_edit INFO_1;

--- 2009,2016 ----


routine above have a pretty incestuous relationship (!)...
**/

! SIGHAND_TYPE edit_interrupt P_((int));
! SIGHAND_TYPE (*oldint) P_((int)), (*oldquit)P_((int));


struct builtin_edit INFO_1;

Index: elmME+.2.5.alpha5-cvs/src/elm.c
*** elmME+.2.5.alpha4/src/elm.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/elm.c 2005-07-26 11:28:43.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elm.c,v 1.69.8.12 2004/11/01 08:03:06 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69.8.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elm.c,v 1.69.8.15 2005/07/26 08:28:43 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.69.8.15 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 50,66 ****


static void do_check_only P_((char *argv[],
struct AliasView *aview));
static void debug_screen P_((struct MailboxView *mailbox,
! int header_page));
static void debug_message P_((struct header_rec *hdr, int current,
struct folder_view *index));

! static void elm_panic_prepare P_((CONST int interrupt,

! CONST char * title,
! CONST char * ms));

static void elm_panic_prepare(interrupt,title,ms)


! CONST int interrupt;
! CONST char * title;
! CONST char * ms;
{

int do_cursor = RawState();

--- 50,66 ----


static void do_check_only P_((char *argv[],
struct AliasView *aview));
static void debug_screen P_((struct MailboxView *mailbox,

! struct screen_parts *LOC));


static void debug_message P_((struct header_rec *hdr, int current,
struct folder_view *index));

! static void elm_panic_prepare P_((const int interrupt,

! const char * title,
! const char * ms));

static void elm_panic_prepare(interrupt,title,ms)


! const int interrupt;
! const char * title;
! const char * ms;
{

int do_cursor = RawState();

***************
*** 73,79 ****


/* MoveCursor() is not safe on interrupt */

if (interrupt) {
! ClearScreen();

Raw(OFF|RAW_FROM_SIGNAL);
} else {

--- 73,79 ----


/* MoveCursor() is not safe on interrupt */

if (interrupt) {
! ClearScreen(1); /* 1 == is called from interrupt */

Raw(OFF|RAW_FROM_SIGNAL);
} else {
***************

*** 87,95 ****
}
}

! static void elm_panic_exit P_((CONST int interrupt));
static void elm_panic_exit(interrupt)
! CONST int interrupt;
{
emergency_exit(interrupt);
}
--- 87,95 ----
}
}

! static void elm_panic_exit P_((const int interrupt));
static void elm_panic_exit(interrupt)
! const int interrupt;
{
emergency_exit(interrupt);
}
***************
*** 117,133 ****
extern int errno;
#endif

! int mailbox_command(mailbox, ch, nufoot, cmdX, aview, header_page,
page)
struct MailboxView *mailbox;


int ch;
! int *nufoot;
showmsg_cmd cmdX;

struct AliasView *aview;
- int *header_page;
struct menu_context *page;
{


- int redraw = 0;

struct menu_common MENU;
int LINES, COLUMNS;

--- 117,131 ----
extern int errno;
#endif


! int mailbox_command(mailbox, ch, LOC, cmdX, aview,

page)
struct MailboxView *mailbox;


int ch;
! struct screen_parts *LOC;
showmsg_cmd cmdX;

struct AliasView *aview;
struct menu_context *page;
{

struct menu_common MENU;
int LINES, COLUMNS;

***************
*** 139,147 ****
switch (ch) {



#ifdef ALLOW_SUBSHELL
! case '!' : Writechar('!');

! subshell(mailbox, page);
! redraw += menu_need_redraw(page);

break;
#endif
--- 137,145 ----
switch (ch) {



#ifdef ALLOW_SUBSHELL
! case '!' :

! menu_Writechar(LOC->prompt_page,'!');
! subshell(mailbox, page,LOC->prompt_page);

break;
#endif

***************
*** 151,161 ****
#ifdef ENABLE_CALENDAR
int current = get_current(mailbox);


! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet,
! ElmScanForCalendar,
! "Scan message for calendar entries..."));
!

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,

ElmNoMailToScan,
--- 149,160 ----
#ifdef ENABLE_CALENDAR
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat,
! ElmSet,
! ElmScanForCalendar,
! "Scan message for calendar entries..."));
!

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,

ElmNoMailToScan,
***************
*** 181,187 ****



case 'a' :
alias(mailbox, aview);
! redraw++;
/* define_softkeys(MAIN); */
break;

--- 180,187 ----



case 'a' :
alias(mailbox, aview);
! menu_trigger_redraw(page);
!
/* define_softkeys(MAIN); */
break;

***************

*** 190,198 ****


struct header_rec *hdr;
FILE *F;

! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmBounceMessage,
! "Bounce message"));
FlushBuffer();

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,

--- 190,199 ----
struct header_rec *hdr;
FILE *F;



! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat,

! ElmSet, ElmBounceMessage,
! "Bounce message"));
FlushBuffer();

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************

*** 202,210 ****


} else if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
NO_mime_parse)) {

! (*nufoot) = remail(hdr,F, aview, page);


!
! redraw += menu_need_redraw(page);

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 203,211 ----


} else if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
NO_mime_parse)) {
!
! remail(hdr,F, aview, page, LOC->prompt_page);

!
} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 218,225 ****


struct header_rec *hdr;
FILE *F;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmExtractPGPKey,
! "Extract PGP public key"));

if (current < 1)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailInFolder,
--- 219,227 ----
struct header_rec *hdr;
FILE *F;

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet, ElmExtractPGPKey,


! "Extract PGP public key"));

if (current < 1)
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMailInFolder,
***************
*** 229,237 ****


&hdr,&F,NULL,NO_mime_parse)) {

if (hdr->pgp & PGP_PUBLIC_KEY) {
! /* FIX: mime structure is not currently used */
pgp_extract_public_key(hdr,F,page);
- redraw += menu_need_redraw(page);
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoPgpPublicKeys,

--- 231,238 ----


&hdr,&F,NULL,NO_mime_parse)) {

if (hdr->pgp & PGP_PUBLIC_KEY) {
! /* FIXME: mime structure is not currently used */
pgp_extract_public_key(hdr,F,page);
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoPgpPublicKeys,
***************

*** 242,253 ****



}
}
! break;
!
#endif

case ctrl('F'):
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
ElmPassphraseForget,
"Forget passphrase"));
forget_passphrase();

--- 243,254 ----

}
}
! break;
#endif

case ctrl('F'):


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

ElmPassphraseForget,
"Forget passphrase"));
forget_passphrase();
***************

*** 255,266 ****

case 'f' : {
int current = get_current(mailbox);
- struct header_rec *hdr;
- FILE *F;



! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmForward,
! "Forward"));
/* define_softkeys(YESNO); */
FlushBuffer();

--- 256,266 ----

case 'f' : {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmForward,
! "Forward"));
/* define_softkeys(YESNO); */
FlushBuffer();

***************

*** 270,283 ****


"No mail to forward!"));

else {

! forward(current-1,mailbox, aview, page);
!
! if (menu_need_redraw(page))
! redraw++;
! else {


! (*nufoot)++;
! show_msg_status(current-1,&MENU, *header_page);
! }
}
/* define_softkeys(MAIN); */
}

--- 270,280 ----


"No mail to forward!"));

else {
! forward(current-1,mailbox, aview,
! page,
! LOC->prompt_page,
! LOC->header_page);
!
}

/* define_softkeys(MAIN); */
}
***************
*** 286,297 ****
case 'g' : {
int current = get_current(mailbox);
struct header_rec *hdr;
- FILE *F;
-


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmGroupReply,
! "Group reply"));
FlushBuffer();

if (current < 1)

--- 283,293 ----
case 'g' : {
int current = get_current(mailbox);
struct header_rec *hdr;



! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmGroupReply,
! "Group reply"));
FlushBuffer();

if (current < 1)
***************

*** 310,322 ****


} else {
/* define_softkeys(YESNO); */

! reply_to_everyone(current-1, mailbox,
! aview,page);

! redraw += menu_need_redraw(page);


/* define_softkeys(MAIN); */

- if (!redraw)
- show_msg_status(current-1,&MENU, *header_page);
}
} else {
DPRINT(Debug,3,(&Debug,

--- 306,317 ----
} else {
/* define_softkeys(YESNO); */

! reply_to_everyone(current-1, mailbox, aview,
! page,


! LOC->prompt_page,
! LOC->header_page);
/* define_softkeys(MAIN); */

}
} else {
DPRINT(Debug,3,(&Debug,
***************

*** 331,345 ****


int current = get_current(mailbox);

if (elm_filter)
! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet,
! ElmMessageWithHeaders,
! "Message with headers..."));
else
! Write_to_screen(CATGETS(elm_msg_cat,

! ElmSet,
! ElmDisplayMessage,


! "Display message"));
FlushBuffer();

if (current < 1)

--- 326,342 ----


int current = get_current(mailbox);

if (elm_filter)

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat,

! ElmSet,
! ElmMessageWithHeaders,
! "Message with headers..."));
else

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat,

! ElmSet,
! ElmDisplayMessage,


! "Display message"));
FlushBuffer();

if (current < 1)
***************

*** 352,382 ****


int j = elm_filter;
int i = 0;

elm_filter = FALSE;
!
!
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! page);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i > 0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview, header_page,
! page);

switch (i) {
case EOF:
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

return i; /* "call" parent */
case 0:
break;

--- 349,381 ----


int j = elm_filter;
int i = 0;

+ struct pager_page * PP = init_pager_page(&MENU);
elm_filter = FALSE;
!
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! PP);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i > 0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview,
! PP);

switch (i) {
case EOF:
+ exit_pager_page(&PP,page);
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

+ exit_pager_page(&PP,page);
return i; /* "call" parent */
case 0:
break;
***************

*** 388,413 ****


}
}

!
current = get_current(mailbox);

elm_filter = j;
! redraw++;
! (void)get_page(current, &MENU, header_page);
}
}
break;

#ifdef USE_PGP

case ctrl('K'):
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,


! ElmMailPGPPublicKey,
! "Mail PGP public key"));
FlushBuffer();

! pgp_mail_public_key(mailbox, aview, page);
! redraw += menu_need_redraw(page);
!
break;
#endif

--- 387,413 ----


}
}

! exit_pager_page(&PP,page);
current = get_current(mailbox);

elm_filter = j;
! menu_trigger_redraw(page);
! get_page(&MENU, LOC->header_page);
}
}
break;

#ifdef USE_PGP

case ctrl('K'):


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMailPGPPublicKey,
! "Mail PGP public key"));
FlushBuffer();

! pgp_mail_public_key(mailbox, aview,
! page,
! LOC->prompt_page);
break;
#endif

***************
*** 426,444 ****

show_mlists = 1;
}
! redraw = 1; /* force redraw */

break;



! case 'm' : Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmMail,
! "Mail"));
FlushBuffer();
send_msg_l(-1, NULL, NULL, NULL,
! MAIL_EDIT_MSG,allow_forms,
! mailbox, aview,page);

!
! redraw += menu_need_redraw(page);

break;

--- 426,444 ----

show_mlists = 1;
}
! menu_trigger_redraw(LOC->header_page); /* force redraw */

break;

! case 'm' :

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMail,
! "Mail"));
FlushBuffer();
send_msg_l(-1, NULL, NULL, NULL,
! MAIL_EDIT_MSG,allow_forms,
! mailbox, aview,page, LOC->prompt_page);

break;

***************

*** 447,455 ****
case ctrl('M'): {
int current = get_current(mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmDisplayMessage,


! "Display message"));
FlushBuffer();

if (current < 1)

--- 447,456 ----
case ctrl('M'): {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmDisplayMessage,
! "Display message"));
FlushBuffer();

if (current < 1)
***************

*** 460,465 ****
--- 461,467 ----
struct header_rec *hdr;


FILE *F;
int i = 0;
+ struct pager_page * PP = init_pager_page(&MENU);

/* define_softkeys(READ); */

***************

*** 469,491 ****


mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! page);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i > 0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview, header_page,
! page);

switch (i) {
case EOF:
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

return i; /* "call" parent */
case 0:
break;

--- 471,495 ----


mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! PP);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i > 0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview,
! PP);

switch (i) {
case EOF:
+ exit_pager_page(&PP,page);
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

+ exit_pager_page(&PP,page);
return i; /* "call" parent */
case 0:

break;
***************
*** 497,506 ****
}
}

current = get_current(mailbox);

! redraw++;
! (void)get_page(current, &MENU, header_page);
}
}
break;

--- 501,511 ----


}
}

+ exit_pager_page(&PP,page);
current = get_current(mailbox);

! menu_trigger_redraw(page);
! get_page(&MENU, LOC->header_page);
}
}
break;
***************

*** 508,516 ****
case 'n' : {
int current = get_current(mailbox);


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmNextMessage,
! "Next Message"));
FlushBuffer();
/* define_softkeys(READ); */

--- 513,522 ----
case 'n' : {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmNextMessage,
! "Next Message"));
FlushBuffer();
/* define_softkeys(READ); */

***************

*** 523,552 ****


FILE *F;
int i = 0;
int mc;
!
/* define_softkeys(READ); */
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
mime_parse_routine))
i = show_msg(hdr, F, current,
get_message_count(mailbox),
! page);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i >0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview, header_page,
! page);

switch (i) {
case EOF:
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */
!
return i; /* "call" parent */

case 0:

--- 529,562 ----


FILE *F;
int i = 0;
int mc;
! struct pager_page * PP = init_pager_page(&MENU);
!
/* define_softkeys(READ); */
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
mime_parse_routine))
i = show_msg(hdr, F, current,
get_message_count(mailbox),
! PP);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

while (i >0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview,
! PP);

switch (i) {
case EOF:
+
+ exit_pager_page(&PP,page);
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */
!
! exit_pager_page(&PP,page);
return i; /* "call" parent */

case 0:
***************

*** 559,572 ****


}
}

current = get_current(mailbox);

! redraw++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

! (void)get_page(current, &MENU, header_page);
}
}
break;

--- 569,583 ----


}
}

+ exit_pager_page(&PP,page);
current = get_current(mailbox);

! menu_trigger_redraw(page);
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

! get_page(&MENU, LOC->header_page);
}
}
break;
***************

*** 574,582 ****
case ctrl('N'): {
int current = get_current(mailbox);


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmNextUMessage,
! "Next Unread Message"));
FlushBuffer();


--- 585,594 ----
case ctrl('N'): {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmNextUMessage,
! "Next Unread Message"));
FlushBuffer();


***************

*** 589,594 ****
--- 601,608 ----
current-1);
int mc;
int i = 0;
+

+ struct pager_page * PP = init_pager_page(&MENU);

if(ison(hdr->status, UNREAD)) {
struct header_rec *hdr;
***************

*** 600,606 ****


mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! page);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 614,620 ----


mime_parse_routine))
i = show_msg(hdr,F,current,
get_message_count(mailbox),
! PP);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 610,625 ****


i = ctrl('N');

while (i >0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview, header_page,
! page);

switch (i) {
case EOF:
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

return i; /* "call" parent */

case 0:

--- 624,642 ----


i = ctrl('N');

while (i >0) {
! i = process_showmsg_cmd(i, mailbox, cmdX, aview,
! PP);

switch (i) {
case EOF:
+
+ exit_pager_page(&PP,page);
return EOF;/* Read failed, control tty died? */

case 'X': /* Quick Exit */
case 'x': /* Exit */

+ exit_pager_page(&PP,page);
return i; /* "call" parent */

case 0:
***************

*** 632,645 ****


}
}

current = get_current(mailbox);

! redraw++;
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

! (void)get_page(current, &MENU, header_page);
}
}
break;

--- 649,664 ----


}
}

+ exit_pager_page(&PP,page);
current = get_current(mailbox);

!
! menu_trigger_redraw(page);
if (++current > (mc = get_message_count(mailbox)))
current = mc;
set_current(mailbox,current);

! get_page(&MENU, LOC->header_page);
}
}
break;
***************

*** 647,655 ****
case 'O' : {
int current = get_current(mailbox);


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmOverrideCharset,
! "Override charset"));
FlushBuffer();

if (current < 1)

--- 666,675 ----
case 'O' : {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideCharset,
! "Override charset"));
FlushBuffer();

if (current < 1)
***************

*** 657,672 ****


ElmNoMailToOverride,
"No mail to override!"));
else
! OverrideCharset(mailbox, *header_page, page);

}
break;
case 'P' : {

int current = get_current(mailbox);


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmPrintTextMail,
! "Print text of mail"));
FlushBuffer();

if (current < 1) {

--- 677,697 ----


ElmNoMailToOverride,
"No mail to override!"));
else
! OverrideCharset(mailbox, page,
! LOC->prompt_page,
! LOC->header_page);

}
break;
+
+
case 'P' : {

int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmPrintTextMail,
! "Print text of mail"));
FlushBuffer();

if (current < 1) {
***************

*** 677,687 ****


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
! print_text(TRUE, mailbox, *header_page, page);
! if (menu_need_redraw(page))

! redraw++;
! else
! show_msg_status(current-1,&MENU, *header_page);


} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 702,710 ----


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
!

! print_text(TRUE, mailbox, page, LOC->header_page);

!
} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 691,702 ****

case 'r' : {
int current = get_current(mailbox);
- struct header_rec *hdr;
- FILE *F;



! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmReplyToMessage,
! "Reply to message"));
FlushBuffer();

if (current < 1)

--- 714,724 ----

case 'r' : {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmReplyToMessage,
! "Reply to message"));
FlushBuffer();

if (current < 1)
***************

*** 704,715 ****


ElmNoMailToReplyTo,
"No mail to reply to!"));
else {

-
- reply(current-1,mailbox, aview, page);
- redraw += menu_need_redraw(page);

! if (!redraw)
! show_msg_status(current-1,&MENU, *header_page);
}
/* softkeys_on(); */
}
--- 726,737 ----


ElmNoMailToReplyTo,
"No mail to reply to!"));
else {

! reply(current-1,mailbox, aview,
! page,
! LOC->prompt_page,
! LOC->header_page);

!
}
/* softkeys_on(); */
}
***************
*** 722,734 ****
int current = get_current(mailbox);

if (ch != 'C')
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,


! ElmSaveToFolder,
! "Save to folder"));
else
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmCopyToFolder,
! "Copy to folder"));
FlushBuffer();

if (current < 1) {

--- 744,758 ----
int current = get_current(mailbox);

if (ch != 'C')


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmSaveToFolder,
! "Save to folder"));
else

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCopyToFolder,
! "Copy to folder"));
FlushBuffer();

if (current < 1) {
***************

*** 745,751 ****


NULL,NULL,NULL,NO_mime_parse)) {

if (save(FALSE, (ch != 'C'), 0,mailbox, aview,
! *header_page, page)
&& resolve_mode && ch != 'C') {
int i;

--- 769,777 ----


NULL,NULL,NULL,NO_mime_parse)) {

if (save(FALSE, (ch != 'C'), 0,mailbox, aview,
! page,
! LOC->prompt_page,
! LOC->header_page)
&& resolve_mode && ch != 'C') {

int i;

***************
*** 755,766 ****

current = i+1;
set_current(mailbox,current);

! nucurr = get_page(current,&MENU, header_page);

}
}

- redraw += menu_need_redraw(page);

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 781,791 ----


current = i+1;
set_current(mailbox,current);

! get_page(&MENU, LOC->header_page);

}
}

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 772,780 ****
case 'S' : {
int current = get_current(mailbox);


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmSaveTextToFileorFolder,
! "Save (copy) text to file or folder"));
FlushBuffer();

if (current < 1) {

--- 797,806 ----
case 'S' : {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmSaveTextToFileorFolder,
! "Save (copy) text to file or folder"));
FlushBuffer();

if (current < 1) {
***************

*** 785,797 ****


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {

- save(FALSE, 0, 1, mailbox, aview, *header_page,
- page);

! redraw += menu_need_redraw(page);


- if (!redraw)
- show_msg_status(current-1,&MENU, *header_page);

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 811,822 ----


} else if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {

! save(FALSE, 0, 1, mailbox, aview,
! page,

! LOC->prompt_page,
! LOC->header_page);

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 829,838 ****



}
else
! unread_msg(TRUE, mailbox, *header_page);
}
break;
!
case 'v' : {
struct header_rec *hdr;
FILE *F;

--- 854,863 ----



}
else
! unread_msg(mailbox, LOC->header_page);
}
break;
!
case 'v' : {
struct header_rec *hdr;
FILE *F;
***************

*** 843,854 ****


ElmNoMessages,
"There are no messages!"));
else {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmViewParts,
! "View parts of message"));

if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,mime_parse_routine)) {
if ((hdr->status & MIME_MESSAGE)) {

mime_warnings(hdr);

--- 868,882 ----


ElmNoMessages,
"There are no messages!"));
else {

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmViewParts,
! "View parts of message"));

if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,mime_parse_routine)) {
+ int vis;
+
if ((hdr->status & MIME_MESSAGE)) {

mime_warnings(hdr);
***************

*** 857,870 ****


NULL,
hdr->header_charset, NULL,
hdr,
! aview
! );
! redraw++;
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMIMEMessage,
"This is not a MIME message!"));
! show_msg_status(current-1,&MENU,*header_page);

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 885,900 ----


NULL,
hdr->header_charset, NULL,
hdr,
! aview);
! menu_trigger_redraw(page);
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoMIMEMessage,
"This is not a MIME message!"));
! /* FIXME ? */

! vis = compute_visible(current, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);
!

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 876,884 ****
case 'V': {
int current = get_current(mailbox);


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmViewDigest,
! "View digest as mailbox"));

FlushBuffer();

--- 906,915 ----
case 'V': {
int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmViewDigest,
! "View digest as mailbox"));

FlushBuffer();

***************

*** 892,904 ****


ViewDigest(mailbox,aview);

current = get_current(mailbox);
! (void)get_page(current, &MENU, header_page);
! redraw++;

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

! show_msg_status(current-1,&MENU,*header_page);
}
}
break;
--- 923,939 ----
ViewDigest(mailbox,aview);

current = get_current(mailbox);
! get_page(&MENU, LOC->header_page);


! menu_trigger_redraw(page);

} else {
+ int vis;

DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

!
! /* FIXME? */
! vis = compute_visible(current, &MENU);

! menu_header_status_update(LOC->header_page,vis-1);
}
}
break;
***************
*** 907,921 ****


return EOF;/* Read failed, control tty died? */

case '@' :
! debug_screen(mailbox, *header_page);
! redraw++;
break;

case '#' : {

int current = get_current(mailbox);


! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmCheckMessage,
! "Check message"));
FlushBuffer();

if (current < 1)

--- 942,957 ----


return EOF;/* Read failed, control tty died? */

case '@' :
! debug_screen(mailbox,LOC);
! menu_trigger_redraw(page);
break;

case '#' : {

int current = get_current(mailbox);


! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCheckMessage,
! "Check message"));
FlushBuffer();

if (current < 1)
***************

*** 932,938 ****


&index);

debug_message(hdr, current, &index);
! redraw++;
}
}
}

--- 968,974 ----


&index);

debug_message(hdr, current, &index);
! menu_trigger_redraw(page);
}
}
}
***************

*** 942,973 ****
try_motion:

/* Maybe motion command */

! ch = motion(ch,&MENU,nufoot, header_page,
! page);

/* motion() may already set, menu_trigger_redraw(page),
we do not examine it */

- if (redraw)
- menu_trigger_redraw(page);

return ch;



}

- if (redraw)
- menu_trigger_redraw(page);

return 0; /* Command OK */
}

! void new_mail_check (mailbox, header_page, page)
struct MailboxView *mailbox;


- int *header_page;
struct menu_context *page;
{

int idx, mbxcount;


struct menu_common MENU;
int LINES, COLUMNS;

- int redraw = 0;

menu_get_sizes(page,&LINES, &COLUMNS);

--- 978,1003 ----
try_motion:

/* Maybe motion command */

! ch = motion(ch,&MENU,LOC, page);

/* motion() may already set, menu_trigger_redraw(page),
we do not examine it */

return ch;

}

return 0; /* Command OK */
}

! void new_mail_check (mailbox, page, LOC)
struct MailboxView *mailbox;


struct menu_context *page;
+ struct screen_parts *LOC;
{

int idx, mbxcount;
struct menu_common MENU;

int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 989,997 ****
if (new_mail_on_folder(storage->current_folder,
&bytes)) {

- int current = get_current(mailbox);


- int was_on_page = on_page(current, &MENU, *header_page);
- int pageon = *header_page;
int last_in_folder = storage->message_count;

int selected = get_selected(mailbox);
int ok;
--- 1019,1024 ----
***************
*** 1007,1013 ****



if (ok)
clear_error();
- *header_page = pageon;

if (selected) {
/* update count of selected messages */

--- 1034,1039 ----
***************
*** 1015,1023 ****


set_selected(mailbox,selected);
}

! if (on_page(current, &MENU, *header_page) ||
! was_on_page || !ok) /* do we REALLY have to rewrite? */
! redraw++;

ClearLine(LINES-2); /* remove reading message... */

--- 1041,1048 ----
set_selected(mailbox,selected);


}

! menu_trigger_redraw(LOC->header_page);
! menu_trigger_redraw(LOC->title_page);

ClearLine(LINES-2); /* remove reading message... */

***************

*** 1045,1057 ****


}
}

! if (redraw)
! menu_trigger_redraw(page);

}



int main(argc, argv)
int argc;

char *argv[];
--- 1070,1271 ----


}
}

! }
!
! void mailbox_screen_common(page,LOC, LIST)

! struct menu_context *page;


! struct screen_parts *LOC;
! struct menu_param *LIST;

! {
! int LINES, COLUMNS;

! int headers_per_page;


!
! menu_get_sizes(page,&LINES, &COLUMNS);
!

! /* 3) prompt part */
!
! if (LOC->prompt_page)
! menu_subpage_relocate(LOC->prompt_page,page,LINES-4,4);
! else
! LOC->prompt_page = new_menu_subpage(page,LINES-4,4,
! subpage_simple_noredraw,LIST);
!
!
! headers_per_page = LOC->menu_page ? LINES-13 : LINES-9;
! if (headers_per_page < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWindowSizeTooSmall,
! "The window is too small to run Elm. It must have at least %d rows"),
! LINES - headers_per_page);
!
! headers_per_page = 1;
! }
!
! /* 4) headers of screen */
!
! if (! LOC->header_page)
! LOC->header_page = new_menu_header(page,4,
! headers_per_page,
! hdr_show_header,
! hdr_show_current,
! null_header_param_changed,
! hdr_show_status,
! LIST);
! else
! menu_header_relocate(LOC->header_page,page,
! 4,headers_per_page);
!
! }
!
! static void set_mailbox_screen P_((struct menu_context *page,
! struct screen_parts *LOC,
! struct menu_param *LIST));
! static void set_mailbox_screen(page,LOC, LIST)
! struct menu_context *page;


! struct screen_parts *LOC;
! struct menu_param *LIST;

! {
! int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES, &COLUMNS);
!

! /* 1) Title part of screen */
!
! if (! LOC->title_page)
! LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
! else
! menu_subpage_relocate(LOC->title_page,page,0,4);
!
! /* 2) menu part */
!
! if (LOC->menu_page && LINES < 14)
! erase_menu_context (&(LOC->menu_page));
! else if (LOC->menu_page)
! menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
! else if (mini_menu && LINES > 14)
! LOC->menu_page = new_menu_subpage(page,LINES-8,4,
! sb_show_menu,LIST);
!
! mailbox_screen_common(page,LOC, LIST);
! }
!
! void free_mailbox_screen(LOC)


! struct screen_parts *LOC;
! {

! erase_menu_context (&(LOC->title_page));
!
! if (LOC->menu_page)
! erase_menu_context (&(LOC->menu_page));
!
! erase_menu_context (&(LOC->prompt_page));
!
! if (LOC->header_page)
! erase_menu_context (&(LOC->header_page));
! }
!
! static void check_mailbox_screen P_((struct screen_parts *LOC,
! struct menu_param *list));
! static void check_mailbox_screen(LOC,list)
! struct screen_parts *LOC;


! struct menu_param *list;
! {

! /* 1) title page */
! if (menu_resized(LOC->title_page)) {
! DPRINT(Debug,1, (&Debug, "title page resized\n"));
!
! }
! if (menu_need_redraw(LOC->title_page)) {
! DPRINT(Debug,1, (&Debug, "title page redraw???\n"));
! sb_update_title(LOC->title_page,list);
! }
!
! if (LOC->menu_page) {
! /* 2) menu page */
! if (menu_resized(LOC->menu_page)) {
! DPRINT(Debug,1, (&Debug, "menu page resized\n"));
!
! }
! if (menu_need_redraw(LOC->menu_page)) {
! DPRINT(Debug,1, (&Debug, "menu page redraw\n"));
! sb_show_menu(LOC->menu_page,list);
! }
! }
!
! /* 3) prompt part */
! if (menu_resized(LOC->prompt_page)) {
! DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
! }
! if (menu_need_redraw(LOC->prompt_page)) {
! DPRINT(Debug,7, (&Debug, "prompt page redraw\n"));
! menu_ClearScreen(LOC->prompt_page);
!

! show_last_error(); /* for those operations that have to
! * clear the footer except for a message.
! */
! }
!

! /* 4) headers part */
! if (menu_resized(LOC->header_page)) {
! DPRINT(Debug,1, (&Debug, "header page resized\n"));
! }
! if (menu_need_redraw(LOC->header_page)) {
! DPRINT(Debug,1, (&Debug, "header page redraw\n"));
! menu_ClearScreen(LOC->header_page);
! }
! }

+ #if ANSI_C
+ static subpage_simple_redraw sb_update_sendtitle;
+ #endif


+ static int sb_update_sendtitle(ptr,list)
+ struct menu_context *ptr;

+ struct menu_param *list;
+ {

+ menu_ClearScreen(ptr);
+
+ menu_print_format_center(ptr,1,


+ CATGETS(elm_msg_cat, ElmSet, ElmSendOnlyMode,
+ "Send only mode [ELM %s]"),
+ version_buff);

+

+ return 1; /* Redraw completely done */
}

+ static void set_sendmode_screen P_((struct menu_context *page,

+ struct screen_parts *LOC,
+ struct menu_param *LIST));

+ static void set_sendmode_screen(page,LOC, LIST)
+ struct menu_context *page;
+ struct screen_parts *LOC;


+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;

+ menu_get_sizes(page,&LINES, &COLUMNS);



+ /* 1) Title part of screen */
+
+ if (! LOC->title_page)

+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_sendtitle,LIST);


+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */

+ LOC->menu_page = NULL;


+
+ /* 3) prompt part */
+

+ if (LOC->prompt_page)
+ menu_subpage_relocate(LOC->prompt_page,page,LINES-4,4);
+ else
+ LOC->prompt_page = new_menu_subpage(page,LINES-4,4,
+ subpage_simple_noredraw,LIST);

+

+ /* 4) headers of screen */
+ LOC->header_page = NULL;

+ }
+
+

+ int main P_((int argc, char *argv[]));

int main(argc, argv)
int argc;

char *argv[];
***************
*** 1060,1078 ****
char **req_mfile_vector = NULL; /* Malloced */
char **to_whom = NULL;
int auto_assemble = 1;
! int i,j; /** Random counting variables (etc) **/
!
! int redraw = 0, /* do we need to rewrite the entire screen? */
! nufoot = 0; /* clear lines 16 thru bottom and new menu */
! int header_page = 0; /* current header page */



struct menu_context *page = NULL;

struct MailboxView * cur_mailbox = NULL;
struct AliasView * cur_aliaslist = NULL;

set_panic_prepare(elm_panic_prepare);
set_panic_exit(elm_panic_exit);

#if DEBUG
init_debugfile("ELM");

--- 1274,1299 ----
char **req_mfile_vector = NULL; /* Malloced */
char **to_whom = NULL;
int auto_assemble = 1;
! int i; /** Random counting variables (etc) **/



struct menu_context *page = NULL;

+ struct screen_parts LOC = { NULL, NULL, NULL, NULL };


+ struct menu_common MENU;
+ struct menu_param PARAM[elm_mp_COUNT+1] = {
+ { mp_menu_common, { 0 } },
+ { mp_integer, { 0 } },
+ { mp_END, { 0 } }
+ };

+
struct MailboxView * cur_mailbox = NULL;
struct AliasView * cur_aliaslist = NULL;

set_panic_prepare(elm_panic_prepare);
set_panic_exit(elm_panic_exit);

+ set_mcommon_from_mbxview(&MENU,NULL); /* Clear initially */
+ mp_list_set_mcommon(PARAM,elm_mp_menu,&MENU);
+
#if DEBUG
init_debugfile("ELM");

***************

*** 1095,1102 ****
locale_init();



req_mfile_vector = parse_arguments(argc, argv, &to_whom);
! initialize(req_mfile_vector, &cur_mailbox, &cur_aliaslist,
! &header_page, &page);

if (req_mfile_vector) {
int i;
--- 1316,1351 ----
locale_init();



req_mfile_vector = parse_arguments(argc, argv, &to_whom);

! initialize(&cur_aliaslist, &page);
!
! if (OPMODE_IS_SENDMODE(opmode)) {
! DPRINT(Debug,2,(&Debug,
! "Mail-only: mailing to\n"));
!
! if (OPMODE_IS_INTERACTIVE(opmode)) {


! set_sendmode_screen(page,&LOC,PARAM);
! sb_update_sendtitle(LOC.title_page,PARAM);
!
! send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,

! (OPMODE_SEND_BATCH == opmode ? NO : allow_forms), cur_mailbox,


! cur_aliaslist, page,
! LOC.prompt_page);
! goto OUT;
! } else {
! send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,

! (OPMODE_SEND_BATCH == opmode ? NO : allow_forms), cur_mailbox,


! cur_aliaslist, page,
! NULL);
! goto OUT_1;
! }

! } else if (OPMODE_CHECK_ONLY == opmode) {
! do_check_only(to_whom, cur_aliaslist);


! goto OUT_1;
! }
! set_mailbox_screen(page,&LOC,PARAM);
!
! cur_mailbox = initialize_mailbox(req_mfile_vector,page,

! cur_aliaslist);

if (req_mfile_vector) {
int i;
***************
*** 1110,1230 ****
req_mfile_vector = NULL;
}

! if (OPMODE_IS_SENDMODE(opmode)) {
! DPRINT(Debug,2,(&Debug,
! "Mail-only: mailing to\n"));
!
! if (OPMODE_IS_INTERACTIVE(opmode)) {


! print_format_center(1,
! CATGETS(elm_msg_cat, ElmSet, ElmSendOnlyMode,
! "Send only mode [ELM %s]"),
! version_buff);
! }
!

! if (to_whom)
! send_msg_argv(to_whom, batch_subject, MAIL_EDIT_MSG,
! (OPMODE_SEND_BATCH == opmode ? NO : allow_forms),
! cur_mailbox,
! cur_aliaslist, page);
! else
! send_msg_l(-1, NULL, NULL, batch_subject, MAIL_EDIT_MSG,
! (OPMODE_SEND_BATCH == opmode ? NO : allow_forms),
! cur_mailbox,
! cur_aliaslist, page);
!

! leave(0);
! } else if (OPMODE_CHECK_ONLY == opmode) {
! do_check_only(to_whom, cur_aliaslist);


! leave(0);
! }

! showscreen(cur_mailbox,
! show_menu, &header_page, page);

while (1) {

- struct menu_common MENU;

int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,cur_mailbox);

if (menu_resized(page)) {



menu_get_sizes(page,&LINES, &COLUMNS);

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))
! if (mini_menu)
! headers_per_page = max (LINES - 14, 1);
! else
! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;
}

- else
- redraw += menu_need_redraw(page);


- nufoot = 0;
- nucurr = 0;

#ifdef BACKGROUD_PROCESSES
if (handle_sigchld)
sigchld_handler();
#endif

! new_mail_check(cur_mailbox,&header_page,

! page);
! redraw += menu_need_redraw(page);

!
!
/* ??? FIX Is this correct ?? */
if (update_view(cur_mailbox)) {
! resort_mailbox(cur_mailbox,1,&header_page);

! redraw++;
}

! if (redraw) {
DPRINT(Debug,7, (&Debug,

"main: pending redraw\n"));
!

! redraw = 0;
! showscreen(cur_mailbox,
! show_menu, &header_page, page);
! show_last_error();
}

!
! {
int lin,col;
!

! prompt_s(mcommon_give_item(&MENU, m_Prompt));
! GetXYLocation(&lin,&col);

! CleartoEOS();
show_last_error();
! MoveCursor(lin,col);

/* fragment_handling: 0 == none,
1 == manual,

2 == auto */


! if (auto_assemble && 2 == fragment_handling &&
have_partial(cur_mailbox)) {
ch = 'A';
auto_assemble = 0;

DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else

! ch = GetPrompt(page, elm_timeout);



/* ? ? ? resize again? */

! CleartoEOS();

if (isascii(ch) && isprint(ch)) {
DPRINT(Debug,4,(&Debug,

--- 1359,1450 ----


req_mfile_vector = NULL;
}

! if (!cur_mailbox)
! goto fail;

! set_mcommon_from_mbxview(&MENU,cur_mailbox);



! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! copy_current(&MENU,LOC.header_page);
!
! showscreen(page);

while (1) {



int LINES, COLUMNS;

+ menu_set_default(page);
+

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,cur_mailbox);

if (menu_resized(page)) {

+ set_mailbox_screen(page,&LOC,PARAM);
+
menu_get_sizes(page,&LINES, &COLUMNS);

! menu_trigger_redraw(page); /* ? Is needed? */
}


#ifdef BACKGROUD_PROCESSES
if (handle_sigchld)
sigchld_handler();
#endif

! new_mail_check(cur_mailbox,page, &LOC);
!
/* ??? FIX Is this correct ?? */
if (update_view(cur_mailbox)) {
! resort_mailbox(cur_mailbox,1);

! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! menu_trigger_redraw(LOC.header_page);
! menu_trigger_redraw(LOC.title_page);
}

! if (menu_need_redraw(page)) {
DPRINT(Debug,7, (&Debug,
"main: pending redraw\n"));
!

! showscreen(page);
}
+ check_mailbox_screen(&LOC, PARAM);
+
+

! {
int lin,col;
! int fh = give_dt_enumerate_as_int(&fragment_handling);

!
! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));

! menu_GetXYLocation(LOC.prompt_page,&lin,&col);



! menu_CleartoEOS(LOC.prompt_page);
!
show_last_error();
! menu_MoveCursor(LOC.prompt_page,lin,col);

/* fragment_handling: 0 == none,
1 == manual,

2 == auto */


! if (auto_assemble && 2 == fh &&
have_partial(cur_mailbox)) {
ch = 'A';
auto_assemble = 0;

DPRINT(Debug,4,(&Debug,"Automatic assemble ... \n"));
} else

! ch = GetPrompt(LOC.prompt_page, elm_timeout);



/* ? ? ? resize again? */

! menu_CleartoEOS(LOC.prompt_page);

if (isascii(ch) && isprint(ch)) {
DPRINT(Debug,4,(&Debug,

***************
*** 1236,1250 ****



set_error(""); /* clear error buffer */

! MoveCursor(lin,col);
}

! ch = mailbox_command(cur_mailbox,ch, &nufoot,
! showmsg_main_cmd,
! cur_aliaslist,
! &header_page,page);

!
! redraw += menu_need_redraw(page);

switch (ch) {
case 0: /* OK */

--- 1456,1469 ----



set_error(""); /* clear error buffer */

! menu_MoveCursor(LOC.prompt_page,lin,col);
}

! ch = mailbox_command(cur_mailbox,ch, &LOC,
! showmsg_main_cmd,
! cur_aliaslist,

! page);


!

switch (ch) {
case 0: /* OK */

***************
*** 1252,1288 ****

case HELP_MARK:
case '?' :

! help(FALSE, page);

- if (menu_need_redraw(page))
- redraw++;
- else
- nufoot++;
break;

case '$' : {
int current;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmResyncFolder,
! "Resynchronize folder"));
FlushBuffer();

! resync(& cur_mailbox, &header_page, page);
! redraw += menu_need_redraw(page);


/* FIX MENU pointer ... */
set_mcommon_from_mbxview(&MENU,cur_mailbox);

current = get_current(cur_mailbox);
! nucurr = get_page(current, &MENU, &header_page);
}
break;

case '|' : {
int current = get_current(cur_mailbox);

! Writechar('|');

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,

--- 1471,1504 ----

case HELP_MARK:
case '?' :

! help(FALSE, page, LOC.prompt_page);

break;

case '$' : {
int current;

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmResyncFolder,
! "Resynchronize folder"));
FlushBuffer();

! resync(& cur_mailbox, page, &LOC);

/* FIX MENU pointer ... */
set_mcommon_from_mbxview(&MENU,cur_mailbox);

current = get_current(cur_mailbox);
! get_page(&MENU, LOC.header_page);
}
break;

case '|' : {
int current = get_current(cur_mailbox);

! menu_Writechar(LOC.prompt_page,
! '|');

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************

*** 1294,1301 ****

/* softkeys_off(); */

! do_pipe(cur_mailbox, page);
! redraw += menu_need_redraw(page);

/* softkeys_on(); */
} else {
--- 1510,1517 ----

/* softkeys_off(); */

! do_pipe(cur_mailbox, page,LOC.prompt_page);
!


/* softkeys_on(); */
} else {
***************

*** 1323,1375 ****


case 'A': {
int current = get_current(cur_mailbox);

! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmAssemble,
! "Assemble message fragments"));
FlushBuffer();
sleep_message();

ViewPartial(cur_mailbox, cur_aliaslist);

current = get_current(cur_mailbox);
! (void)get_page(current, &MENU, &header_page);
! redraw++;

}
break;

! case 'c' :

if (TreatAsSpooled)
! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmChangeMailbox,
! "Change mailbox"));
! else
! Write_to_screen(CATGETS(elm_msg_cat,

! ElmSet, ElmChangeFolder,
! "Change folder"));

FlushBuffer();



/* define_softkeys(CHANGE); */
! change_file(& cur_mailbox, cur_aliaslist,

! &header_page, page);
! redraw += menu_need_redraw(page);


! /* FIX MENU pointer ... */
! set_mcommon_from_mbxview(&MENU,cur_mailbox);

/* define_softkeys(MAIN); */
break;

#ifdef ALLOW_MAILBOX_EDITING
case 'e' : {
int current = get_current(cur_mailbox);

! Write_to_screen(CATGETS(elm_msg_cat,
! ElmSet, ElmEditFolder,
! "Edit folder"));
!
! if (user_level < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoFolderEditing,
"You are not experienced to use folder editing"));

--- 1539,1610 ----


case 'A': {
int current = get_current(cur_mailbox);

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat,

! ElmSet, ElmAssemble,
! "Assemble message fragments"));
FlushBuffer();
sleep_message();

ViewPartial(cur_mailbox, cur_aliaslist);

current = get_current(cur_mailbox);
! get_page(&MENU, LOC.header_page);
! menu_trigger_redraw(page);

}
break;

! case 'c' : {

! struct MailboxView * new_mailbox = NULL;
!
if (TreatAsSpooled)
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat,
! ElmSet, ElmChangeMailbox,
! "Change mailbox"));
!
! else
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat,

! ElmSet, ElmChangeFolder,
! "Change folder"));

!
FlushBuffer();



/* define_softkeys(CHANGE); */
! new_mailbox = change_file(cur_mailbox, cur_aliaslist,
! page);

+ if (!new_mailbox)
+ break;

! /* FIX MENU pointer ... redraw may use it */
! set_mcommon_from_mbxview(&MENU,new_mailbox);
!

! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
!

! menu_trigger_redraw(LOC.header_page);
! menu_trigger_redraw(LOC.title_page);
!

! free_mailbox(&cur_mailbox);
! cur_mailbox = new_mailbox;

/* define_softkeys(MAIN); */
+ }
break;

#ifdef ALLOW_MAILBOX_EDITING
case 'e' : {
int current = get_current(cur_mailbox);

+ int ul = give_dt_enumerate_as_int(&user_level);
+

+ menu_Write_to_screen(LOC.prompt_page,
+ CATGETS(elm_msg_cat,
+ ElmSet, ElmEditFolder,
+ "Edit folder"));

! if (ul < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmNoFolderEditing,
"You are not experienced to use folder editing"));
***************

*** 1382,1388 ****


ElmFolderIsEmpty,
"Folder is empty!"));
else
! edit_mailbox(&cur_mailbox, &header_page,
page);

}

--- 1617,1623 ----


ElmFolderIsEmpty,
"Folder is empty!"));
else
! edit_mailbox(&cur_mailbox,
page);

}
***************

*** 1398,1421 ****


case 'o' : {
int current = get_current(cur_mailbox);

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmOptions,
! "Options"));
if((i=options(cur_mailbox, cur_aliaslist)) > 0) {
current = get_current(cur_mailbox);
! get_page(current, &MENU, &header_page);
} else if(i < 0)
! leave(0);
! redraw++; /* always fix da screen... */
}
break;

case 'p' : {

- int current = get_current(cur_mailbox);



! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmPrintMail,
! "Print mail"));
FlushBuffer();

#if DISABLE_PRINT

--- 1633,1658 ----


case 'o' : {
int current = get_current(cur_mailbox);

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOptions,
! "Options"));
if((i=options(cur_mailbox, cur_aliaslist)) > 0) {
current = get_current(cur_mailbox);
! get_page(&MENU, LOC.header_page);
} else if(i < 0)
! goto OUT;
!
! menu_trigger_redraw(page); /* always fix da screen... */
}
break;

case 'p' : {

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmPrintMail,
! "Print mail"));
FlushBuffer();

#if DISABLE_PRINT
***************

*** 1433,1441 ****
used
*/
print_msg(TRUE,cur_mailbox, page);


!
! redraw += menu_need_redraw(page);
!

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 1670,1676 ----
used
*/
print_msg(TRUE,cur_mailbox, page);


!
} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 1443,1461 ****


#endif
}
break;


! case 'q' : {

! int idx, mbxcount, found = 0;
!

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmQuit,
! "Quit"));

! FlushBuffer();
!
! mbxcount = get_storage_count(cur_mailbox);

! for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;

struct current_storage * storage =

--- 1678,1697 ----


#endif
}
break;
+
+
+ case 'q' : {
+ int idx, mbxcount, found = 0;

+ menu_Write_to_screen(LOC.prompt_page,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmQuit,
+ "Quit"));
+ FlushBuffer();

! mbxcount = get_storage_count(cur_mailbox);

! for (idx = 0 ; idx < mbxcount; idx++) {
int bytes;

struct current_storage * storage =
***************

*** 1473,1490 ****


}
}

! if (!found)
quit(TRUE, &cur_mailbox,&cur_aliaslist,
! &header_page, page);
}
break;

case 'Q' : {

int idx, mbxcount, found = 0;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,


! ElmQuickQuit,
! "Quick quit"));
FlushBuffer();

mbxcount = get_storage_count(cur_mailbox);

--- 1709,1733 ----


}
}

! if (!found) {
! free_mailbox_screen(&LOC);
!
quit(TRUE, &cur_mailbox,&cur_aliaslist,
! page);
!
! /* Canceled ... setup again */
! set_mailbox_screen(page,&LOC,PARAM);

! }
}
break;

case 'Q' : {


int idx, mbxcount, found = 0;

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmQuickQuit,
! "Quick quit"));
FlushBuffer();

mbxcount = get_storage_count(cur_mailbox);
***************

*** 1506,1514 ****


}
}

! if (!found)
quit(FALSE, &cur_mailbox,&cur_aliaslist,
! &header_page, page);
}
break;

--- 1749,1759 ----


}
}

! if (!found) {
! free_mailbox_screen(&LOC);
quit(FALSE, &cur_mailbox,&cur_aliaslist,
! page);
! }
}
break;

***************

*** 1516,1588 ****





! case 'X' : Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmQuickExit,
! "Quick Exit"));
! FlushBuffer();
! leave(0);
! break;

case ctrl('Q') :
! case 'x' : Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmExit,
! "Exit"));
! FlushBuffer();

exit_prog(&cur_mailbox,&cur_aliaslist,
&page);
break;

case EOF :
! leave(0);

/* Read failed, control tty died? */
! break;
!
!

default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmUnknownCommand,
"Unknown command. Use '?' for help."));
}

! if (redraw)
! showscreen(cur_mailbox,
! show_menu, &header_page, page);
!

! check_range(&MENU);
!
! if (nucurr == NEW_PAGE) {

! DPRINT(Debug,5,(&Debug, " nucurr == NEW_PAGE\n"));
! show_headers(&MENU,&header_page, page);

! } else if (nucurr == SAME_PAGE) {

! DPRINT(Debug,5,(&Debug, " nucurr == SAME_PAGE\n"));

! show_current(&MENU,&header_page, page);
! } else if (nufoot) {

! if (mini_menu) {
! MoveCursor(LINES-8, 0);
! CleartoEOS();

! show_menu(page);


! } else {
! MoveCursor(LINES-5, 0);
! CleartoEOS();
! }
! show_last_error(); /* for those operations that have to
! * clear the footer except for a message.
! */
! }

! } /* the BIG while loop! */
}

! static void debug_screen(mailbox, header_page)
struct MailboxView *mailbox;
! int header_page;
{
/**** spit out all the current variable settings and the table
entries for the current 'n' items displayed. ****/

int i, j;
int LINES, COLUMNS;

struct menu_context *page = new_menu_context();

redraw:
--- 1761,1839 ----



! case 'X' :
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmQuickExit,
! "Quick Exit"));
! FlushBuffer();
!

! goto OUT;
!

case ctrl('Q') :
! case 'x' :

! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmExit,
! "Exit"));
! FlushBuffer();

exit_prog(&cur_mailbox,&cur_aliaslist,
&page);
break;

case EOF :
!
! goto OUT;
/* Read failed, control tty died? */
!
default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmUnknownCommand,
"Unknown command. Use '?' for help."));
}

! if (menu_need_redraw(page))
! showscreen(page);

! check_range(&MENU,&LOC);
!
! check_mailbox_screen(&LOC, PARAM);
!

! } /* the BIG while loop! */

!
! OUT:
! free_mailbox_screen(&LOC);
!
! OUT_1:
! erase_menu_context(&page);
!
! leave(0);
!
! return 0;
!

! fail:
! free_mailbox_screen(&LOC);
! erase_menu_context(&page);
!
! Raw_OFF(1); /* Raw(OFF) and reprint error message */
! #ifdef REMOTE_MBX
! close_cached_connections();
! #endif

! return 1;
}

! static void debug_screen(mailbox,LOC)
struct MailboxView *mailbox;


! struct screen_parts *LOC;
{
/**** spit out all the current variable settings and the table
entries for the current 'n' items displayed. ****/

int i, j;

int LINES, COLUMNS;
+ int li,co;


struct menu_context *page = new_menu_context();

redraw:
***************
*** 1594,1628 ****

menu_ClearScreen(page);

- PutLineX(0,0,CATGETS(elm_msg_cat, ElmSet,
- ElmDbxCurrMsgNum,
- "Current message number = %d\t\t%d message(s) total\n"),
- get_current(mailbox),
- get_message_count(mailbox));
- PutLineX(2,0,CATGETS(elm_msg_cat, ElmSet,
- ElmDbxHdrPage,
- "Header_page = %d \t\t%d possible page(s)\n"),
- header_page, (int) (get_message_count(mailbox) /
- headers_per_page) + 1);
-

{

struct folder_info * f = get_main_folder(mailbox);
if (f) {
! PutLineX(4,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxCurrMailFile,
! "\nCurrent mail file is %S.\n\r\n"),
! f->cur_folder_disp);
}
}

! i = header_page*headers_per_page; /* starting header */

! if ((j = i + (headers_per_page-1)) >= get_message_count(mailbox))
j = get_message_count(mailbox)-1;

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDebugHeader,
! "Num From Subject Lines Offset Content\n\r\n\r"));

for (;i <= j; i++) {

struct header_rec * hdr = give_header(mailbox,i);
--- 1845,1873 ----

menu_ClearScreen(page);



{

struct folder_info * f = get_main_folder(mailbox);
if (f) {
! menu_PutLineX(page,
! 4,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxCurrMailFile,
! "\nCurrent mail file is %S.\n\r\n"),
! f->cur_folder_disp);
}
}

! i = menu_header_get(LOC->header_page,header_top_line); /* starting header */
! menu_get_sizes(LOC->header_page, &li, &co);

! if ((j = i + li-1) >= get_message_count(mailbox))
j = get_message_count(mailbox)-1;

! /* FIXME -- selected */
!

! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmDebugHeader,


! "Num From Subject Lines Offset Content\n\r\n\r"));

for (;i <= j; i++) {

struct header_rec * hdr = give_header(mailbox,i);
***************
*** 1642,1680 ****

! goto redraw;
!

! erase_menu_context(&page);
! return;

}

static void debug_message(current_header,current,index)

--- 1887,1928 ----


if (hdr->from &&
hdr->from->fullname &&
string_len(hdr->from->fullname))
! menu_Write_to_screen(page,
! FRM("%3d %-16.16S %-35.35S %4d %8d %8d\n\r"),
! i+1,
! hdr->from->fullname,
! x,
! hdr->lines,
! hdr->offset,
! hdr->content_length);

else
! menu_Write_to_screen(page,


! FRM("%3d %-16.16s %-35.35S %4d %8d %8d\n\r"),
! i+1,
! hdr->from &&
! hdr->from->addr &&
! hdr->from->addr[0] ?
! hdr->from->addr :
! hdr->env_from,
! x,
! hdr->lines,
! hdr->offset,
! hdr->content_length);

if (temp)
free_string(&temp);

}

! menu_PutLineX(page,
! LINES-1,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxPressAnyKey,"Press any key to return."));
if (REDRAW_MARK == menu_ReadCh(page, REDRAW_MARK))
! goto redraw;

+ erase_menu_context(&page);
+ return;
+
}

static void debug_message(current_header,current,index)
***************

*** 1698,1773 ****

menu_ClearScreen(page);

! Write_to_screen(FRM("\t\t\t----- Message %d -----\n\r\n\r\n\r\n\r"),
! current);
!

! Write_to_screen(FRM("Lines: %-17dStatus: A C D E F N P T U V O R M P U N\n\r"),
! current_header->lines);
! Write_to_screen(FRM("Content-Length: %-16dc o e x o e r a r i l e i r s H\n\r"),
! current_header->content_length);
! Write_to_screen(FRM("Binary: %-24dt n l p r w i g g s d p m e u d\n\r"),
! current_header->binary);
! Write_to_screen(FRM("'From ' on body: %-15dn f d d m v d n i l e M p r\n\r"),
! current_header->have_from);
!
! Write_to_screen(FRM("\n\rOffset: %-22ld%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d\n"),
! current_header->offset,

! (current_header->status & ACTION) != 0,
! (current_header->status & CONFIDENTIAL) != 0,
! (current_header->status & DELETED) != 0,
! (current_header->status & EXPIRED) != 0,
! (current_header->status & FORM_LETTER) != 0,
! (current_header->status & NEW) != 0,
! (current_header->status & PRIVATE_MAIL) != 0,
! (current_header->status & TAGGED) != 0,
! (current_header->status & URGENT) != 0,
! (current_header->status & VISIBLE) != 0,
! (current_header->status & UNREAD) != 0,
! (current_header->status & REPLIED_TO) != 0,
! (current_header->status & MIME_MESSAGE) != 0,
! (current_header->status & PRE_MIME_CONTENT) != 0,
! (current_header->status & MIME_UNSUPPORTED) != 0,
! (current_header->status & NOHDRENCODING) != 0);
!
! Write_to_screen(FRM("\n\rReceived on: %s\r"),
! asctime(localtime(&current_header->received_time)));

-
header_time = current_header->time_sent + current_header->tz_offset;
! Write_to_screen(FRM("\rMessage sent on: %s\r\nFrom timezone: %s (%d)\n\r"),
! asctime(gmtime(&header_time)),
! current_header->time_zone,
! current_header->tz_offset);
!
! Write_to_screen(FRM("(Env) From: %s\n\r"),
! current_header->env_from);

if (current_header->from) {
! int first = 1;
! struct addr_item *p;
! for (p = current_header->from;
! p->fullname && p->addr && p->comment;
! p++) {
! if (first)
! Write_to_screen(FRM( "From: "));
! else
! Write_to_screen(FRM(",\r\n "));
! Write_to_screen(FRM("%-30S <%s>"),p->fullname,p->addr);
! first = 0;
! if (string_len(p->comment))
! Write_to_screen(FRM(" (%S)"),p->comment);
! }
! Write_to_screen(FRM("\r\n"));
}
!


! Write_to_screen(FRM("Subject: %S\n\rInternal Index Reference Number = %d/%d (hdr index %d)\n\r"),
! current_header->subject,
! index->mailbox_number,
! index->index,
! current_header->index_number_X);
!
if (current_header->to) {
int first = 1;
struct addr_item *p;
--- 1946,2036 ----

menu_ClearScreen(page);

! menu_Write_to_screen(page,
! FRM("\t\t\t----- Message %d -----\n\r\n\r\n\r\n\r"),
! current);
!
! menu_Write_to_screen(page,
! FRM("Lines: %-17dStatus: A C D E F N P T U V O R M P U N\n\r"),
! current_header->lines);
! menu_Write_to_screen(page,
! FRM("Content-Length: %-16dc o e x o e r a r i l e i r s H\n\r"),
! current_header->content_length);
! menu_Write_to_screen(page,
! FRM("Binary: %-24dt n l p r w i g g s d p m e u d\n\r"),
! current_header->binary);
! menu_Write_to_screen(page,
! FRM("'From ' on body: %-15dn f d d m v d n i l e M p r\n\r"),
! current_header->have_from);
!
! menu_Write_to_screen(page,
! FRM("\n\rOffset: %-22ld%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d\n"),
! current_header->offset,
! (current_header->status & ACTION) != 0,
! (current_header->status & CONFIDENTIAL) != 0,
! (current_header->status & DELETED) != 0,
! (current_header->status & EXPIRED) != 0,
! (current_header->status & FORM_LETTER) != 0,
! (current_header->status & NEW) != 0,
! (current_header->status & PRIVATE_MAIL) != 0,
! (current_header->status & TAGGED) != 0,
! (current_header->status & URGENT) != 0,
! (current_header->status & VISIBLE) != 0,
! (current_header->status & UNREAD) != 0,
! (current_header->status & REPLIED_TO) != 0,
! (current_header->status & MIME_MESSAGE) != 0,
! (current_header->status & PRE_MIME_CONTENT) != 0,
! (current_header->status & MIME_UNSUPPORTED) != 0,
! (current_header->status & NOHDRENCODING) != 0);
!
! menu_Write_to_screen(page,
! FRM("\n\rReceived on: %s\r"),
! asctime(localtime(&current_header->received_time)));

header_time = current_header->time_sent + current_header->tz_offset;
!
! menu_Write_to_screen(page,
! FRM("\rMessage sent on: %s\r\nFrom timezone: %s (%d)\n\r"),
! asctime(gmtime(&header_time)),
! current_header->time_zone,
! current_header->tz_offset);
!
! menu_Write_to_screen(page,
! FRM("(Env) From: %s\n\r"),
! current_header->env_from);

if (current_header->from) {
! int first = 1;
! struct addr_item *p;
! for (p = current_header->from;
! p->fullname && p->addr && p->comment;
! p++) {
! if (first)
! menu_Write_to_screen(page,
! FRM( "From: "));
! else
! menu_Write_to_screen(page,
! FRM(",\r\n "));
! menu_Write_to_screen(page,
! FRM("%-30S <%s>"),p->fullname,p->addr);
! first = 0;
! if (string_len(p->comment))
! menu_Write_to_screen(page,
! FRM(" (%S)"),p->comment);
! }
! menu_Write_to_screen(page,
! FRM("\r\n"));
}
!


! menu_Write_to_screen(page,
! FRM("Subject: %S\n\rInternal Index Reference Number = %d/%d (hdr index %d)\n\r"),
! current_header->subject,
! index->mailbox_number,
! index->index,
! current_header->index_number_X);
!
if (current_header->to) {
int first = 1;
struct addr_item *p;
***************
*** 1775,1789 ****


p->fullname && p->addr && p->comment;
p++) {

if (first)
! Write_to_screen(FRM( "To: "));
else
! Write_to_screen(FRM(",\r\n "));
! Write_to_screen(FRM("%-30S <%s>"),p->fullname,p->addr);
first = 0;
if (string_len(p->comment))
! Write_to_screen(FRM(" (%S)"),p->comment);
}
! Write_to_screen(FRM("\r\n"));
}

if (current_header->cc) {
--- 2038,2057 ----


p->fullname && p->addr && p->comment;
p++) {

if (first)
! menu_Write_to_screen(page,
! FRM( "To: "));
else
! menu_Write_to_screen(page,
! FRM(",\r\n "));
! menu_Write_to_screen(page,
! FRM("%-30S <%s>"),p->fullname,p->addr);
first = 0;
if (string_len(p->comment))
! menu_Write_to_screen(page,
! FRM(" (%S)"),p->comment);
}
! menu_Write_to_screen(page,
! FRM("\r\n"));
}

if (current_header->cc) {
***************
*** 1793,1824 ****


p->fullname && p->addr && p->comment;
p++) {

if (first)
! Write_to_screen(FRM( "CC: "));
else
! Write_to_screen(FRM(",\r\n "));
! Write_to_screen(FRM("%-30S <%s>"),p->fullname,p->addr);
first = 0;
if (string_len(p->comment))
! Write_to_screen(FRM(" (%S)"),p->comment);
}
! Write_to_screen(FRM("\r\n"));
}


! Write_to_screen(FRM("Message-ID: %s\n\r"),
! strlen(current_header->messageid) > 0 ?
! current_header->messageid : "<none>");

! Write_to_screen(FRM("Status: %s\n\r"),
! current_header->mailx_status);

! Write_to_screen(FRM("Content-Transfer-Encoding: %s\n\r"),
! ENCODING(current_header->mime_rec.encoding));

! fail1:


! PutLineX(LINES-1,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxPressAnyKey,

! "Please Press any key to return."));


if (REDRAW_MARK == menu_ReadCh(page, REDRAW_MARK))

goto redraw;

--- 2061,2100 ----


p->fullname && p->addr && p->comment;
p++) {

if (first)
! menu_Write_to_screen(page,
! FRM( "CC: "));
else
! menu_Write_to_screen(page,
! FRM(",\r\n "));
! menu_Write_to_screen(page,
! FRM("%-30S <%s>"),p->fullname,p->addr);
first = 0;
if (string_len(p->comment))
! menu_Write_to_screen(page,
! FRM(" (%S)"),p->comment);
}
! menu_Write_to_screen(page,
! FRM("\r\n"));
}


! menu_Write_to_screen(page,
! FRM("Message-ID: %s\n\r"),
! strlen(current_header->messageid) > 0 ?
! current_header->messageid : "<none>");

! menu_Write_to_screen(page,
! FRM("Status: %s\n\r"),
! current_header->mailx_status);

! menu_Write_to_screen(page,
! FRM("Content-Transfer-Encoding: %s\n\r"),
! ENCODING(current_header->mime_rec.encoding));



! menu_PutLineX(page,
! LINES-1,0,CATGETS(elm_msg_cat, ElmSet,
! ElmDbxPressAnyKey,

! "Please Press any key to return."));


if (REDRAW_MARK == menu_ReadCh(page, REDRAW_MARK))

goto redraw;

***************
*** 1854,1861 ****
}
}

! void check_range(mc)
struct menu_common *mc;
{
int i;
int current = mcommon_get_current(mc);
--- 2130,2138 ----
}
}

! void check_range(mc,LOC)
struct menu_common *mc;
+ struct screen_parts *LOC;
{
int i;
int current = mcommon_get_current(mc);
***************
*** 1889,1916 ****
}

mcommon_set_current(mc,current);
!
}

- static char *no_aliases = NULL;
-
/* Return key if unknown */
! int motion(ch,mc, nufoot, header_page, page)
int ch;
struct menu_common *mc;
! int *nufoot;
! int *header_page;
struct menu_context *page;
{
/* Consolidated the standard menu navigation and delete/tag
* commands to a function. */

int i;
- int redraw = 0;

int current = mcommon_get_current(mc);

! switch (ch) {


case FIND_MARK:
--- 2166,2190 ----
}

mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
}

/* Return key if unknown */
! int motion(ch,mc, LOC, page)
int ch;
struct menu_common *mc;
! struct screen_parts *LOC;
struct menu_context *page;
{
+
/* Consolidated the standard menu navigation and delete/tag
* commands to a function. */

int i;

int current = mcommon_get_current(mc);

! switch (ch) {


case FIND_MARK:
***************
*** 1922,1933 ****

}
else {
! int x = pattern_match(mc, *header_page,
! page);



- redraw += menu_need_redraw(page);
-

-
if (EOF == x) {
return EOF; /* ERROR */

--- 2196,2203 ----

}
else {
! int x = pattern_match(mc, page, LOC);

if (EOF == x) {
return EOF; /* ERROR */

***************
*** 1935,1941 ****

if (x) {
current = mcommon_get_current(mc);
! nucurr = get_page(current,mc, header_page);
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmPatternNotFound,
--- 2205,2211 ----

if (x) {
current = mcommon_get_current(mc);
! get_page(mc, LOC->header_page);
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmPatternNotFound,
***************
*** 1944,1973 ****
}
break;

case PAGEDOWN_MARK :
case RIGHT_MARK :
case '+' : {
int selected = mcommon_get_selected(mc);
!
! /* move to next page if we're not on the last */

! if((selected &&
! (((*header_page)+1)*headers_per_page < selected))
! ||(!selected &&
! (((*header_page)+1)*headers_per_page < mcommon_get_count(mc)))) {

! (*header_page)++;
! nucurr = NEW_PAGE;

if(move_when_paged) {
/* move to first message of new page */
if(selected)
! current = visible_to_index((*header_page) *
! headers_per_page + 1,
! mc) + 1;
else
! current = (*header_page) * headers_per_page + 1;
mcommon_set_current(mc,current);
}
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 2214,2249 ----
}
break;

+
case PAGEDOWN_MARK :
case RIGHT_MARK :
case '+' : {
int selected = mcommon_get_selected(mc);
! int top = menu_header_get(LOC->header_page,header_top_line);
! int li,co;



! menu_get_sizes(LOC->header_page, &li, &co);
!

! /* move to next page if we're not on the last */
!
! if ((selected && (top+li < selected))
! ||
! (!selected && (top+li < mcommon_get_count(mc)))) {



! top += li;
!

! menu_header_change(LOC->header_page, header_top_line,top);

if(move_when_paged) {
/* move to first message of new page */
if(selected)
! current = visible_to_index(top+1,mc) + 1;
else
! current = top+1;
!
mcommon_set_current(mc,current);
+ menu_header_change(LOC->header_page,
+ header_current,top);
}
} else
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 1978,2229 ****

case PAGEUP_MARK :
case LEFT_MARK :
! case '-' : {
! int selected = mcommon_get_selected(mc);
!
! /* move to prev page if we're not on the first */
! if((*header_page) > 0) {
! (*header_page)--;
! nucurr = NEW_PAGE;
!
! if(move_when_paged) {
! /* move to first message of new page */
! if(selected)
! current = visible_to_index(
! (*header_page) * headers_per_page + 1,
! mc) + 1;
! else
! current = (*header_page) * headers_per_page + 1;
! mcommon_set_current(mc,current);
! }


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmAlreadyOnFirstPage,
!
! "Already on first page."));
! }
! break;

! case HOME_MARK:
! case '=' : {
! int selected = mcommon_get_selected(mc);

! if (selected)
! current = visible_to_index(1,mc)+1;
! else
! current = 1;
! mcommon_set_current(mc,current);
! nucurr = get_page(current, mc, header_page);
! }
! break;

! case '*' : {
! int selected = mcommon_get_selected(mc);

! if (selected)
! current = (visible_to_index(selected,mc)+1);
! else
! current = mcommon_get_count(mc);
!
! mcommon_set_current(mc,current);
! nucurr = get_page(current, mc, header_page);
}
! break;
!
case EOF : return EOF; /* ERROR */


! case ctrl('D') :
! case '^' :
case 'd' :
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToDelete,
! "No %S to delete!"),
! mcommon_give_item(mc,m_item));
!
! } else {
! if(ch == ctrl('D')) {
!
! /* if current item did not become deleted,
! * don't to move to the next undeleted item */
! if(!meta_match(DELETED, mc, *header_page,
! page))
! break;
!
! } else
! delete_msg((ch == 'd'), TRUE, mc,
! *header_page);
!
! /* If given '^' command (toggle delete flag)
! go to next command regagdles is next command
! marked for deletion or not on resolve mode.
! In other words works same way than u)undelete
! command works.
! */
!
! if (resolve_mode) /* move after mail resolved */
! if((i=next_message(current-1,
! (ch == 'd') ? TRUE : FALSE,
! mc)) != -1) {
!
! current = i+1;
! mcommon_set_current(mc,current);

- nucurr = get_page(current, mc, header_page);
- }
- }
- break;

! case 'J' : if(current > 0) {
! if((i=next_message(current-1, FALSE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current,mc, header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreItemBelow,
! "No more %S below."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

next_undel_msg:
case DOWN_MARK :
! case 'j' : if(current > 0) {
! if((i=next_message(current-1, TRUE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current,mc, header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoItemUndeletedBelow,
! "No more undeleted %S below."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));

! break;

! case 'K' : if(current > 0) {
! if((i=prev_message(current-1, FALSE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current,mc, header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreItemAbove,
! "No more %S above."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

case UP_MARK :
! case 'k' : if(current > 0) {
! if((i=prev_message(current-1, TRUE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current, mc, header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreUndeletedAbove,
! "No more undeleted %S above."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

! case 'l' : Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmLimitDisplayBy,
! "Limit displayed %S by..."),
! mcommon_give_item(mc,m_items));
! clear_error();
! limit(mc, page);
! if (menu_need_redraw(page)) {
! current = mcommon_get_current(mc);
! get_page(current, mc, header_page);
! redraw++;
! } else {
! (*nufoot)++;
! }
! break;

! case ctrl('T') :
! case 'T' :
! case 't' : if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToTag,
! "No %S to tag!"),
! mcommon_give_item(mc,m_items));
!
! }
! else if (ch == 't')
! tag_message(TRUE, mc,*header_page);
! else if (ch == 'T') {
! tag_message(TRUE, mc, *header_page);
! goto next_undel_msg;
! }
! else
! meta_match(TAGGED, mc, *header_page,
! page);
! break;
!
!
! case 'u' : if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToMarkUndeleted,
! "No %S to mark as undeleted!"),
! mcommon_give_item(mc,m_items));
!
! }
! else {
! undelete_msg(TRUE, mc, *header_page);
! if (resolve_mode) /* move after mail resolved */
! if((i=next_message(current-1, FALSE, mc)) != -1) {


! current = i+1;
! mcommon_set_current(mc,current);
! nucurr = get_page(current, mc, header_page);

! }
/*************************************************************************
** What we've done here is to special case the "U)ndelete" command to
** ignore whether the next message is marked for deletion or not. The
--- 2254,2537 ----

case PAGEUP_MARK :
case LEFT_MARK :
! case '-' : {
! int selected = mcommon_get_selected(mc);
! int top = menu_header_get(LOC->header_page,header_top_line);
! int li,co;



! menu_get_sizes(LOC->header_page, &li, &co);
!

! /* move to prev page if we're not on the first */
! if(top > 0) {
!
! top -= li;


! if (top < 0)
! top = 0;

! menu_header_change(LOC->header_page, header_top_line,top);

! if(move_when_paged) {
! /* move to first message of new page */
! if(selected)
! current = visible_to_index(top + 1, mc) + 1;
! else
! current = top + 1;
! mcommon_set_current(mc,current);
! menu_header_change(LOC->header_page,
! header_current,top);
! }


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmAlreadyOnFirstPage,
!
! "Already on first page."));
! }
! break;

! case HOME_MARK:
! case '=' : {
! int selected = mcommon_get_selected(mc);
!
! if (selected)
! current = visible_to_index(1,mc)+1;
! else
! current = 1;
! mcommon_set_current(mc,current);
! menu_header_change(LOC->header_page, header_current,0);
!
! get_page(mc, LOC->header_page);
! }
! break;
!
! case '*' : {
! int selected = mcommon_get_selected(mc);
!
! if (selected) {
! current = (visible_to_index(selected,mc)+1);
! } else {
! current = mcommon_get_count(mc);
}
!
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);
! }
! break;
!
case EOF : return EOF; /* ERROR */


! case ctrl('D') :
! case '^' :
case 'd' :
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToDelete,
! "No %S to delete!"),
! mcommon_give_item(mc,m_item));
!
! } else {
! if(ch == ctrl('D')) {
!
! /* if current item did not become deleted,
! * don't to move to the next undeleted item */
! if(!meta_match(DELETED, mc, page, LOC))
! break;
!
! } else
! delete_msg((ch == 'd'), mc, LOC);
!
! /* If given '^' command (toggle delete flag)
! go to next command regagdles is next command
! marked for deletion or not on resolve mode.
! In other words works same way than u)undelete
! command works.
! */
!
! if (resolve_mode) /* move after mail resolved */
! if((i=next_message(current-1,
! (ch == 'd') ? TRUE : FALSE,
! mc)) != -1) {
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);
! }
! }
! break;
!
! case 'F': { /* Actually this works onlye for messages
! * and not aliases
! */
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToFlag,
! "No %S to flag!"),
! mcommon_give_item(mc,m_items));
!
! } else
! flag_message(mc, LOC->header_page);
! }
! break;


! case 'J' :
! if (current > 0) {
! if((i=next_message(current-1, FALSE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreItemBelow,
! "No more %S below."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

next_undel_msg:
case DOWN_MARK :
! case 'j' :
! if (current > 0) {
! if((i=next_message(current-1, TRUE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoItemUndeletedBelow,
! "No more undeleted %S below."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));

! break;
!
! case 'K' :
! if (current > 0) {
! if((i=prev_message(current-1, FALSE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);

! get_page(mc, LOC->header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreItemAbove,
! "No more %S above."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;

case UP_MARK :
! case 'k' :
! if (current > 0) {
! if((i=prev_message(current-1, TRUE,
! mc)) != -1) {
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d\n",
! current,i+1));
!
! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);


! } else
! lib_error(CATGETS(elm_msg_cat, ElmSet,

! ElmNoMoreUndeletedAbove,
! "No more undeleted %S above."),
! mcommon_give_item(mc,m_items));
} else
lib_error(FRM("%S"),
mcommon_give_item(mc,m_no_item));
!
! break;
!
! case 'l' :

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLimitDisplayBy,
! "Limit displayed %S by..."),
! mcommon_give_item(mc,m_items));

! clear_error();
! limit(mc, page,LOC);
!
! break;
!
!
! case ctrl('T') :
! case 'T' :
! case 't' :
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToTag,
! "No %S to tag!"),
! mcommon_give_item(mc,m_items));
!
! } else if (ch == 't')
! tag_message(mc, LOC->header_page);
! else if (ch == 'T') {
! tag_message(mc, LOC->header_page);
! goto next_undel_msg;
! } else
! meta_match(TAGGED, mc, page, LOC);
! break;

! case 'u' :
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToMarkUndeleted,
! "No %S to mark as undeleted!"),
! mcommon_give_item(mc,m_items));
!
! } else {
! undelete_msg(mc, LOC->header_page);

+ if (resolve_mode) /* move after mail resolved */
+ if((i=next_message(current-1, FALSE, mc)) != -1) {

! current = i+1;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);

! }
/*************************************************************************
** What we've done here is to special case the "U)ndelete" command to
** ignore whether the next message is marked for deletion or not. The
***************
*** 2234,2306 ****
** The old way, for those people that might want to see what the previous
** behaviour was to call next_message with TRUE, not FALSE.
**************************************************************************/
! }
! break;

! case ctrl('U') : if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToUndelete,
! "No %S to undelete!"),
! mcommon_give_item(mc,m_items));
!
! }
! else
! meta_match(UNDELETE, mc, *header_page,
! page);
! break;

! case ctrl('L') : redraw++; break;

! case NO_OP_COMMAND : break; /* noop for timeout loop */

! default : if (ch > '0' && ch <= '9') {
! int LINES, COLUMNS;

int selected = mcommon_get_selected(mc);

! menu_get_sizes(page,&LINES, &COLUMNS);

- Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
- ElmNewCurrentItem,
- "New Current %S"),
- mcommon_give_item(mc,m_Item));
-
i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, page, LINES-4);
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d (?)\n",
! current,i));
!
! if( i > mcommon_get_count(mc))
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotThatMany,
! "Not that many %S."),
! mcommon_give_item(mc,m_items));
! else if(selected
! && mcommon_isoff_status(mc,i-1,VISIBLE))
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotInLimitedDisplay,
! "%S not in limited display."),
! mcommon_give_item(mc,m_Item));
! else {
! current = i;
! mcommon_set_current(mc,current);
!
! nucurr = get_page(current, mc, header_page);
! }
! }
! else {


! if (redraw)
! menu_trigger_redraw(page);

! return ch; /* UNKNOWN command */
!
! }


}

- if (redraw)
- menu_trigger_redraw(page);

return 0; /* COmmand OK */
}

--- 2542,2613 ----
** The old way, for those people that might want to see what the previous
** behaviour was to call next_message with TRUE, not FALSE.
**************************************************************************/
! }
! break;

! case ctrl('U') :
! if (mcommon_get_count(mc) < 1) {
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNoItemToUndelete,
! "No %S to undelete!"),
! mcommon_give_item(mc,m_items));
!
! } else
! meta_match(UNDELETE, mc, page, LOC);
! break;

! case ctrl('L') :
! menu_trigger_redraw(page);
! break;

! case NO_OP_COMMAND : break; /* noop for timeout loop */

! default :
! if (ch > '0' && ch <= '9') {

int selected = mcommon_get_selected(mc);



! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmNewCurrentItem,
! "New Current %S"),
! mcommon_give_item(mc,m_Item));

i = read_number(ch,
mcommon_give_item(mc,m_item),
! current, page, LOC->prompt_page);
!
! DPRINT(Debug,5,(&Debug,
! " current %d => %d (?)\n",
! current,i));
!
! if( i > mcommon_get_count(mc))
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotThatMany,
! "Not that many %S."),
! mcommon_give_item(mc,m_items));
! else if(selected
! && mcommon_isoff_status(mc,i-1,
! status_basic,VISIBLE))
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmNotInLimitedDisplay,
! "%S not in limited display."),
! mcommon_give_item(mc,m_Item));
! else {
! current = i;
! mcommon_set_current(mc,current);
! copy_current(mc,LOC->header_page);
!
! get_page(mc, LOC->header_page);
! }
!
! } else {
! return ch; /* UNKNOWN command */
!
! }
! break;
}

return 0; /* COmmand OK */
}

Kari E. Hurtta

unread,
Jul 28, 2005, 12:30:53 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.10

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 10/20 ) =========
Index: elmME+.2.5.alpha5-cvs/Makefile-1.SH
*** elmME+.2.5.alpha4/Makefile-1.SH 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha5-cvs/Makefile-1.SH 2005-07-20 19:49:33.000000000 +0300
***************


*** 27,33 ****
echo "Extracting Makefile-1 (with variable substitutions)"

cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.11.22.1 2004/05/22 14:50:33 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
--- 27,33 ----
echo "Extracting Makefile-1 (with variable substitutions)"

cat >Makefile-1 <<!GROK!THIS!
#!$make
! # $Id: Makefile-1.SH,v 1.11.22.2 2005/07/20 16:49:33 hurtta Exp $
#
#


# Makefile for the ELM (ME+) mail program.
***************

Index: elmME+.2.5.alpha5-cvs/Makefile.SH
*** elmME+.2.5.alpha4/Makefile.SH 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/Makefile.SH 2005-07-20 19:49:33.000000000 +0300
***************
*** 18,27 ****
*) sln='ln';;
esac

echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.20.20.1 2004/11/02 19:39:21 hurtta Exp $
#


# Makefile for the entire ELM mail system
#

--- 18,29 ----


*) sln='ln';;
esac

+ liblist="mailer"
+

echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.20.20.2 2005/07/20 16:49:33 hurtta Exp $
#


# Makefile for the entire ELM mail system
#

***************
*** 69,76 ****



install: config.h config.sh hdrs/sysdefs.h Makefile installer all
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) install_s
! bin/elmregister replay
! bin/elmregister unstage

uninstall: config.h config.sh installer
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) uninstall_s

--- 71,78 ----



install: config.h config.sh hdrs/sysdefs.h Makefile installer all
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) install_s
! bin/elmregister replay -M all
! bin/elmregister unstage -M all

uninstall: config.h config.sh installer
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) uninstall_s
***************

*** 78,91 ****


# Helper target for testing
install_libs: config.h config.sh hdrs/sysdefs.h Makefile installer all
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) install_libs_s
! bin/elmregister replay

install_libs_s: config.h config.sh hdrs/sysdefs.h
cd lib; $(MAKE) $(MJ) $(MFLAGS) install_s
cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) install_s

# Targets that are simply executed in each subordinate makefile as is
all install_s uninstall_s lint clean: config.h config.sh hdrs/sysdefs.h Makefile
cd lib; $(MAKE) $(MJ) $(MFLAGS) $@
cd melib; $(MAKE) $(MJ) $(MFLAGS) $@
cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) $@
--- 80,95 ----


# Helper target for testing
install_libs: config.h config.sh hdrs/sysdefs.h Makefile installer all
bin/elmregister master $(MAKE) $(MJ) $(MFLAGS) install_libs_s

! bin/elmregister replay -M all

install_libs_s: config.h config.sh hdrs/sysdefs.h
cd lib; $(MAKE) $(MJ) $(MFLAGS) install_s
+ cd lib/mailer; $(MAKE) $(MJ) $(MFLAGS) install_s
cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) install_s

# Targets that are simply executed in each subordinate makefile as is
all install_s uninstall_s lint clean: config.h config.sh hdrs/sysdefs.h Makefile
+ cd lib/mailer; $(MAKE) $(MJ) $(MFLAGS) $@
cd lib; $(MAKE) $(MJ) $(MFLAGS) $@
cd melib; $(MAKE) $(MJ) $(MFLAGS) $@
cd shared_libs; $(MAKE) $(MJ) $(MFLAGS) $@
***************
*** 144,151 ****
--- 148,190 ----
_utils:
cd utils; $(MAKE) $(MJ) $(MFLAGS) all

+
+ libs/libelmme-base.a:
+ cd lib; $(MAKE) $(MJ) $(MFLAGS) ../libs/libelmme-base.a
+
+ !NO!SUBS!
+
+ for i in $liblist
+ do
+ cat >>Makefile <<!SUBS!
+ libs/libelmme-$i.a:
+ cd lib/$i; \$(MAKE) \$(MJ) \$(MFLAGS) ../../libs/libelmme-$i.a
+

+ !SUBS!
+ done
+

+ if $test "$d_shared" = "$define" ; then
+
+ cat >>Makefile <<'!NO!SUBS!'
+

+ shlib/libelmme-base.so: libs/libelmme-base.a
+ cd lib; $(MAKE) $(MJ) $(MFLAGS) ../libs/libelmme-base.so
+
+
!NO!SUBS!

+ for i in $liblist
+ do
+ cat >>Makefile <<!SUBS!
+ shlib/libelmme-$i.so: libs/libelmme-$i.a
+ cd lib/$i; \$(MAKE) \$(MJ) \$(MFLAGS) ../../libs/libelmme-$i.so
+

+ !SUBS!
+ done
+

+ fi
+
+
if $test "$build_package" = "$define" ; then

cat >>Makefile <<!SUBS!
***************
*** 157,164 ****
@echo "# Package $package" >>\$(ROOT)/README.PACKAGE.sh
@echo "# package filelist is on .$etc/elm.filelist" >>\$(ROOT)/README.PACKAGE.sh
@echo "#To move files to final place, use command:" >>\$(ROOT)/README.PACKAGE.sh
! @echo ".$lib/elmregister replay -R \\\`pwd\\\` " >>\$(ROOT)/README.PACKAGE.sh
!
!SUBS!

fi
--- 196,203 ----
@echo "# Package $package" >>\$(ROOT)/README.PACKAGE.sh
@echo "# package filelist is on .$etc/elm.filelist" >>\$(ROOT)/README.PACKAGE.sh
@echo "#To move files to final place, use command:" >>\$(ROOT)/README.PACKAGE.sh
! @echo ".$lib/elmregister replay -M all -R \\\`pwd\\\` " >>\$(ROOT)/README.PACKAGE.sh
!
!SUBS!

fi
Index: elmME+.2.5.alpha5-cvs/MANIFEST
*** elmME+.2.5.alpha4/MANIFEST 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/MANIFEST 2005-07-20 19:49:33.000000000 +0300
***************
*** 14,26 ****
2.4/Patchlist
2.4/README
config.h.SH
- 2.4/doc/Alias.guide
- 2.4/doc/Config.guid
- 2.4/doc/Elm.cover
- 2.4/doc/Form.guide
doc/Makefile.SH
- 2.4/doc/Ref.guide
- 2.4/doc/Users.guide
doc/answer.1
doc/chkalias.1
doc/help-main
--- 14,20 ----
***************
*** 41,47 ****
doc/newmail.1
doc/printmail.1
doc/readmsg.1
- doc/tmac.n
hdrs/me.h
hdrs/menu.h
hdrs/menu2.h
--- 35,40 ----
***************
*** 65,71 ****
hdrs/save_opts.h
hdrs/sysdefs.SH
lib/Makefile.SH
- lib/add_site.c
lib/aliasdb.c
lib/atonum.c
lib/can_access.c
--- 58,63 ----
***************
*** 110,116 ****
lib/striparens.c
lib/strmcpy.c
lib/strstr.c
- lib/strtokq.c
lib/safeopen.c
nls/C/C/C/s_aliases.m
nls/C/C/C/s_answer.m
--- 102,107 ----
***************
*** 296,302 ****
shared_libs/iconv/elmiconv.h
shared_libs/iconv/iconv.c
shared_libs/iconv/README.ME+
! lib/mailer.c
lib/MAGIC
hdrs/mailer_imp.h
utils/elmrc-write.c
--- 287,293 ----
shared_libs/iconv/elmiconv.h
shared_libs/iconv/iconv.c
shared_libs/iconv/README.ME+
! lib/mailer/mailer.c
lib/MAGIC
hdrs/mailer_imp.h
utils/elmrc-write.c
***************
*** 423,425 ****
--- 414,434 ----
src/messages/canceled_mail.c
src/canceled.c
utils/def_utils.h
+ src/screen/subpage.c
+ src/screen/wrapper.c
+ src/screen/menu_param.c
+ src/screen/def_scommon.h
+ src/screen/scommon.c
+ src/screen/header.c
+ lib/cs_unknown.c
+ lib/cs_wfallback.c
+ charset/MAPPINGS/koi8-e.txt
+ lib/mailer/Makefile.SH
+ hdrs/mailerlib.h
+ lib/mailer/def_mailer.h
+ lib/mailer/shared_mailer.c
+ lib/mailer/init.c
+ lib/mailer/outheaders.c
+ lib/rc_delay.c
+ melib/mime_param.c
+ lib/write_rc.c
Index: elmME+.2.5.alpha5-cvs/melib/def_melib.h
*** elmME+.2.5.alpha4/melib/def_melib.h 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/melib/def_melib.h 2005-07-20 19:49:44.000000000 +0300
***************
*** 1,8 ****
! /* $Id: def_melib.h,v 1.3.8.1 2004/04/18 16:55:42 hurtta Exp $ */

#include "elm_defs.h"
#include "melib.h"


/*
* Local Variables:
--- 1,37 ----
! /* $Id: def_melib.h,v 1.3.8.2 2005/07/20 16:49:44 hurtta Exp $ */

#include "elm_defs.h"
#include "melib.h"

+ #define MIME_PARAM_magic 0xFC04
+
+ struct mime_param {
+ unsigned short magic; /* MIME_PARAM_magic */
+
+ struct mp_pair {
+ char *raw_param;
+ char *raw_value;
+ } * params;
+ int param_count;
+
+ charset_t def;
+
+ struct ascii_pair {
+ int is_compat;
+ char *param;
+ char *value;
+ } * ascii_params;
+ int ascii_param_count;
+
+ struct string_pair {
+ char *param;
+ struct string *value;
+
+ } * string_params;
+ int string_param_count;
+
+ };
+

/*
* Local Variables:
Index: elmME+.2.5.alpha5-cvs/melib/mailcap.c
*** elmME+.2.5.alpha4/melib/mailcap.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/melib/mailcap.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.13 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mailcap.c,v 1.13.8.4 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 477,483 ****
if (err) {
DPRINT(Debug,2,(&Debug,
"Failed to open mailcap %s: (errno=%d) %s (can_open)\n",
! mailcaps[mailcap_idx],err,error_description(err)));
continue;
}

--- 477,483 ----
if (err) {
DPRINT(Debug,2,(&Debug,
"Failed to open mailcap %s: (errno=%d) %s (can_open)\n",
! mailcaps[mailcap_idx],err,strerror(err)));
continue;
}

***************
*** 487,493 ****

DPRINT(Debug,2,(&Debug,
"Failed to open mailcap %s: (errno=%d) %s\n",
! mailcaps[mailcap_idx],err,error_description(err)));
continue;
}

--- 487,493 ----

DPRINT(Debug,2,(&Debug,
"Failed to open mailcap %s: (errno=%d) %s\n",
! mailcaps[mailcap_idx],err,strerror(err)));
continue;
}

***************
*** 550,556 ****

unsupported++;
} else if (mcES_error == entry_state ||
! !T && T_major == MIME_TYPE_UNKNOWN) {
unsupported++;
} else
process_field(mailcaps[mailcap_idx],linenum,
--- 550,557 ----

unsupported++;
} else if (mcES_error == entry_state ||
! ( !T && T_major == MIME_TYPE_UNKNOWN)
! ) {
unsupported++;
} else
process_field(mailcaps[mailcap_idx],linenum,
***************
*** 802,807 ****
--- 803,811 ----
case mcES_string:
arg_add(&string,c);
break;
+
+ default:
+ break;
}

break;
***************
*** 1002,1010 ****
for (i = 0; i < len; i++) {
switch(subvector[i].type) {
int tmp,l,l2;
! CONST char *ma, *mi;
char *e;
- char buffer[STRING];

case mv_literal:
tmp = retlen + subvector[i].arg.arg_len;
--- 1006,1013 ----
for (i = 0; i < len; i++) {
switch(subvector[i].type) {
int tmp,l,l2;
! const char *ma, *mi, *pv;
char *e;

case mv_literal:
tmp = retlen + subvector[i].arg.arg_len;
***************
*** 1071,1091 ****
retlen = tmp;
ret[retlen] = '\0';
break;
case mv_parameter:
!
! if (!mime_get_param(subvector[i].arg.arg,buffer,p->type_opts,sizeof buffer)) {
DPRINT(Debug,12,(&Debug,
"make_mailcap_arg: no param %s\n",
subvector[i].arg.arg));

goto fail;
}
! l = strlen(buffer);

tmp = retlen + l;
ret = safe_realloc(ret,tmp+1);

! memcpy(ret+retlen,buffer,l);
retlen = tmp;
ret[retlen] = '\0';
break;
--- 1074,1108 ----
retlen = tmp;
ret[retlen] = '\0';
break;
+
case mv_parameter:


! {
! int mp = give_dt_enumerate_as_int(&mime_parameters);
!

! /* 0 == plain
! 1 == encoded
! 2 == plain-and-encoded

! */
!
! if (mp)
! pv = get_mime_param_ascii(p->TYPE_opts,subvector[i].arg.arg);
! else
! pv = get_mime_param_compat(p->TYPE_opts,subvector[i].arg.arg);
! }
!
! if (!pv) {
DPRINT(Debug,12,(&Debug,
"make_mailcap_arg: no param %s\n",
subvector[i].arg.arg));

goto fail;
}
! l = strlen(pv);

tmp = retlen + l;
ret = safe_realloc(ret,tmp+1);

! memcpy(ret+retlen,pv,l);
retlen = tmp;
ret[retlen] = '\0';
break;
***************
*** 1169,1175 ****
int *exit_stat, int fn_seen));

static int run_mailcap(argv,file_handle,state_out,x,exit_stat, fn_seen)
! CONST char **argv;
FILE *file_handle;
out_state_t *state_out;
struct mailcap_entry *x;
--- 1186,1192 ----
int *exit_stat, int fn_seen));

static int run_mailcap(argv,file_handle,state_out,x,exit_stat, fn_seen)
! const char **argv;
FILE *file_handle;
out_state_t *state_out;
struct mailcap_entry *x;
***************
*** 1380,1386 ****

DPRINT(Debug,4,(&Debug,
"mailcap_is_valid_view: command %s not executable: %s\n",
! cmd,error_description(err)));

free(cmd);
return 0;
--- 1397,1403 ----

DPRINT(Debug,4,(&Debug,
"mailcap_is_valid_view: command %s not executable: %s\n",
! cmd,strerror(err)));

free(cmd);
return 0;
***************
*** 1403,1409 ****
return 0; /* Test command not executable */


! r = run_mailcap((CONST char **)argv,NULL,NULL,f,&ret, fn_seen);

for (i = 0; argv[i]; i++) {
free(argv[i]); argv[i] = NULL;
--- 1420,1426 ----
return 0; /* Test command not executable */


! r = run_mailcap((const char **)argv,NULL,NULL,f,&ret, fn_seen);

for (i = 0; argv[i]; i++) {
free(argv[i]); argv[i] = NULL;
***************
*** 1499,1505 ****
return 0; /* view command not executable */


! r = run_mailcap((CONST char **)argv,file_handle,
state_out,x,&ret,fn_seen);

for (i = 0; argv[i]; i++) {
--- 1516,1522 ----
return 0; /* view command not executable */


! r = run_mailcap((const char **)argv,file_handle,
state_out,x,&ret,fn_seen);

for (i = 0; argv[i]; i++) {
Index: elmME+.2.5.alpha5-cvs/melib/Makefile.SH
*** elmME+.2.5.alpha4/melib/Makefile.SH 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/melib/Makefile.SH 2005-07-20 19:49:44.000000000 +0300
***************
*** 16,22 ****
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17.44.2 2004/11/02 19:37:14 hurtta Exp $


# Makefile for the ELM mail program.
#

# Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>

--- 16,22 ----
echo "Extracting melib/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.17.44.3 2005/07/20 16:49:44 hurtta Exp $


# Makefile for the ELM mail program.
#

# Modified by Kari Hurtta Kari Hurtta <hurtt...@posti.FMI.FI>

***************
*** 50,55 ****
--- 50,56 ----
mailcap.c \
mime.c \
mime_decode.c \
+ mime_param.c \
mime_parse.c \
mime_selector.c \
mparser.c \
***************
*** 64,69 ****
--- 65,71 ----
mailcap.o \
mime.o \
mime_decode.o \
+ mime_param.o \
mime_parse.o \
mime_selector.o \
mparser.o \
***************
*** 123,128 ****
--- 125,131 ----
pgp_decode.o: def_melib.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
parse_util.o: def_melib.h $(INCLDIR)/s_me.h
mailcap.o: def_melib.h
+ mime_param.o: def_melib.h $(INCLDIR)/s_me.h
mime_parse.o: def_melib.h $(INCLDIR)/s_me.h
mime_decode.o: def_melib.h $(INCLDIR)/s_me.h
mime_selector.o: def_melib.h $(INCLDIR)/s_me.h
Index: elmME+.2.5.alpha5-cvs/melib/mime_decode.c
*** elmME+.2.5.alpha4/melib/mime_decode.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/melib/mime_decode.c 2005-07-26 11:28:41.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.64.8.1 2004/08/07 18:07:16 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_decode.c,v 1.64.8.4 2005/07/26 08:28:41 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.64.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 77,84 ****

int bytes = 0; /* the total number of bytes read so far */

! unsigned char ch,
! store_ch = 0; /* for astext */
int corrupted = FALSE;

int res = 0; /* Result of decoding */
--- 77,83 ----

int bytes = 0; /* the total number of bytes read so far */

! unsigned char store_ch = 0; /* for astext */
int corrupted = FALSE;

int res = 0; /* Result of decoding */
***************
*** 210,220 ****
s_out->prefix ? s_out->prefix : "<NULL>",
astext));

! len = state_getl (buffer, sizeof buffer, s_in);

! if (len > 0)
! bytes += len;

if (len < 6 || strncmp(buffer,"begin ",6) != 0) {
DPRINT(Debug,10,(&Debug,
"uudecode: 'begin' was expected\n"));
--- 209,226 ----
s_out->prefix ? s_out->prefix : "<NULL>",
astext));

! do {
! len = state_getl (buffer, sizeof buffer, s_in);

! if (len > 0)
! bytes += len;
!
! if (bytes >= length)
! break;

+ } while ( (len == 1 && 0 == strcmp(buffer,"\n")) ||
+ (len == 2 && 0 == strcmp(buffer,"\r\n")) );
+
if (len < 6 || strncmp(buffer,"begin ",6) != 0) {
DPRINT(Debug,10,(&Debug,
"uudecode: 'begin' was expected\n"));
***************
*** 368,373 ****
--- 374,386 ----

return;
}
+
+ static unsigned char * us_str P_((char *str));
+ static unsigned char * us_str(str)


+ char *str;
+ {
+ return (unsigned char *)str;
+ }

void quoted_printable_decode (s_in, s_out, length, astext)
in_state_t *s_in;
***************
*** 377,383 ****
{
int bytes = 0; /* number of bytes read */
int nl = TRUE; /* flag to indicate hitting a new line */
! char *p;
int c1, c2;
unsigned char ch, store_ch = 0;
char buf[VERY_LONG_STRING];
--- 390,396 ----
{
int bytes = 0; /* number of bytes read */
int nl = TRUE; /* flag to indicate hitting a new line */
! unsigned char *p;
int c1, c2;
unsigned char ch, store_ch = 0;
char buf[VERY_LONG_STRING];
***************
*** 399,405 ****
break;
bytes += len;

! p = buf;
while (*p) {

/* If there is a prefix and this is the beginning of a new
--- 412,418 ----
break;
bytes += len;

! p = us_str(buf);
while (*p) {

/* If there is a prefix and this is the beginning of a new
***************
*** 418,424 ****
p++;
/* Ignore spaces in end of line -- see MIME */
if (*p == '\r' || *p == ' ' || *p == '\t') {
! char *t = p;
while (*t && (*t == '\r' || *t == ' ' || *t == '\t'))
t++;
if (*t && *t == '\n')
--- 431,437 ----
p++;
/* Ignore spaces in end of line -- see MIME */
if (*p == '\r' || *p == ' ' || *p == '\t') {
! unsigned char *t = p;
while (*t && (*t == '\r' || *t == ' ' || *t == '\t'))
t++;
if (*t && *t == '\n')
***************
*** 426,432 ****
}

if (*p == '\n') { /* soft linebreak */
! if (p >= buf +len)
break;
p++;
} else {
--- 439,445 ----
}

if (*p == '\n') { /* soft linebreak */
! if (p >= us_str(buf) +len)
break;
p++;
} else {
***************
*** 463,469 ****
if (*p == '\n') {
nl = TRUE;
}
! if (p >= buf +len)
break;
p++;
}
--- 476,482 ----
if (*p == '\n') {
nl = TRUE;
}
! if (p >= us_str(buf) +len)
break;
p++;
}
***************
*** 504,510 ****


mime_t *sign;
in_state_t *state_in;
out_state_t *state_out;
! char *micalg;
charset_t defcharset;
struct header_rec *mss;
{

--- 517,523 ----


mime_t *sign;
in_state_t *state_in;
out_state_t *state_out;
! const char *micalg;
charset_t defcharset;
struct header_rec *mss;
{
***************

*** 557,565 ****
}


! static SG_decoder_t select_SG_decoder P_((char *protocol));
static SG_decoder_t select_SG_decoder(protocol)
! char *protocol;
{
#ifdef USE_PGP
if (0 == istrcmp(protocol,"application/pgp-signature")) {
--- 570,578 ----
}


! static SG_decoder_t select_SG_decoder P_((const char *protocol));
static SG_decoder_t select_SG_decoder(protocol)
! const char *protocol;
{
#ifdef USE_PGP
if (0 == istrcmp(protocol,"application/pgp-signature")) {
***************
*** 599,622 ****

) {

! char protocol[100];
SG_decoder_t sg_decode;
!
!

! if (!mime_get_param ("protocol", protocol, p->type_opts,
! sizeof protocol)) {
DPRINT(Debug,11,(&Debug,
! "signed_selector(%p) -- type: %p=%s/%s, flags=%d -- no 'protocol'\n",
! p,
! p->TYPE,
! get_major_type_name(p->TYPE),
! get_subtype_name(p->TYPE),
! get_type_flags(p->TYPE)));
flags |= NOTPLAIN_need_metamail;
goto done;
}
! sg_decode = select_SG_decoder(protocol);


if (MIME_selector_magic != p->handler_data->magic)
--- 612,634 ----

) {

! const char *pv;
SG_decoder_t sg_decode;
!
! pv = get_mime_param_compat(p->TYPE_opts,"protocol");

! if (! pv) {
DPRINT(Debug,11,(&Debug,
! "signed_selector(%p) -- type: %p=%s/%s, flags=%d -- no 'protocol'\n",
! p,
! p->TYPE,
! get_major_type_name(p->TYPE),
! get_subtype_name(p->TYPE),
! get_type_flags(p->TYPE)));
flags |= NOTPLAIN_need_metamail;
goto done;
}
! sg_decode = select_SG_decoder(pv);


if (MIME_selector_magic != p->handler_data->magic)
***************
*** 636,642 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));
goto done;
} else if (pagesigned) {
DPRINT(Debug,9,(&Debug,
--- 648,654 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));
goto done;
} else if (pagesigned) {
DPRINT(Debug,9,(&Debug,
***************
*** 646,652 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));
goto done;
}

--- 658,664 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));
goto done;
}

***************
*** 658,664 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));
flags |= NOTPLAIN_need_metamail;
}
else
--- 670,676 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));
flags |= NOTPLAIN_need_metamail;
}
else
***************
*** 682,689 ****


charset_t defcharset;
struct header_rec *mss;
{

! char protocol[100];
! char micalg[100];
SG_decoder_t decode;



if (ptr->magic != MIME_magic)

--- 694,701 ----


charset_t defcharset;
struct header_rec *mss;
{

! const char *pv;
! const char *micalg;
SG_decoder_t decode;



if (ptr->magic != MIME_magic)

***************
*** 697,703 ****


if (!ptr->parser_data) {
! CONST char * T = "multipart/signed";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
--- 709,715 ----


if (!ptr->parser_data) {
! const char * T = "multipart/signed";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
***************
*** 726,749 ****
return;
}

! if (!mime_get_param ("protocol", protocol, ptr->type_opts,
! sizeof protocol)) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
conversions */

state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeNoProtocol,
! "'protocol' paramater is missing from Multipart/Signed -type!"));
state_nlputs(" ]\n",state_out);
lib_error(CATGETS(elm_msg_cat, MeSet, MeDecodeNoProtocol,
! "'protocol' paramater is missing from Multipart/Signed -type!"));
return;
}

! if (!mime_get_param ("micalg", micalg, ptr->type_opts,
! sizeof micalg)) {
! micalg[0] = '\0';
}

if (MIME_selector_magic != ptr->handler_data->magic)
--- 738,763 ----
return;
}

! pv = get_mime_param_compat(ptr->TYPE_opts,"protocol");
!
! if (!pv) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
conversions */

state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeNoProtocol,
! "'protocol' parameter is missing from Multipart/Signed -type!"));
state_nlputs(" ]\n",state_out);
lib_error(CATGETS(elm_msg_cat, MeSet, MeDecodeNoProtocol,
! "'protocol' parameter is missing from Multipart/Signed -type!"));
return;
}

! micalg = get_mime_param_compat(ptr->TYPE_opts,"micalg");
!
! if (!micalg) {
! micalg = "";
}

if (MIME_selector_magic != ptr->handler_data->magic)
***************
*** 759,767 ****
}


! static EC_decoder_t select_EC_decoder P_((char *protocol));
static EC_decoder_t select_EC_decoder(protocol)
! char *protocol;
{
#ifdef USE_PGP
if (0 == istrcmp(protocol,"application/pgp-encrypted")) {
--- 773,781 ----
}


! static EC_decoder_t select_EC_decoder P_((const char *protocol));
static EC_decoder_t select_EC_decoder(protocol)
! const char *protocol;
{
#ifdef USE_PGP
if (0 == istrcmp(protocol,"application/pgp-encrypted")) {
***************
*** 793,802 ****
if (p->parser_data &&
mime_parser_subparts(p->parser_data) > 0) {
EC_decoder_t ec_decode;
! char protocol[100];

! if (!mime_get_param ("protocol", protocol, p->type_opts,
! sizeof protocol)) {
DPRINT(Debug,11,(&Debug,
"encrypted_selector(%p) -- type: %p=%s/%s, flags=%d -- no 'protocol'\n",
p,
--- 807,817 ----
if (p->parser_data &&
mime_parser_subparts(p->parser_data) > 0) {
EC_decoder_t ec_decode;
! const char *pv;

! pv = get_mime_param_compat(p->TYPE_opts,"protocol");
!
! if (!pv) {
DPRINT(Debug,11,(&Debug,
"encrypted_selector(%p) -- type: %p=%s/%s, flags=%d -- no 'protocol'\n",
p,
***************
*** 807,813 ****
flags |= NOTPLAIN_need_metamail;
goto out;
}
! ec_decode = select_EC_decoder(protocol);

if (MIME_selector_magic != p->handler_data->magic)
mime_panic(__FILE__,__LINE__,"encrypted_selector",
--- 822,828 ----
flags |= NOTPLAIN_need_metamail;
goto out;
}
! ec_decode = select_EC_decoder(pv);

if (MIME_selector_magic != p->handler_data->magic)
mime_panic(__FILE__,__LINE__,"encrypted_selector",
***************
*** 824,830 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));

/* TODO: We really not know on here can be show contents
because we must decode it first to see ....
--- 839,845 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));

/* TODO: We really not know on here can be show contents
because we must decode it first to see ....
***************
*** 842,848 ****
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! protocol));
flags |= NOTPLAIN_need_metamail;
} else
flags |= NOTPLAIN_need_metamail;
--- 857,863 ----
get_major_type_name(p->TYPE),
get_subtype_name(p->TYPE),
get_type_flags(p->TYPE),
! pv));
flags |= NOTPLAIN_need_metamail;
} else
flags |= NOTPLAIN_need_metamail;
***************
*** 864,870 ****


charset_t defcharset;
struct header_rec *mss;
{

! char protocol[100];
EC_decoder_t decode;



if (ptr->magic != MIME_magic)

--- 879,885 ----


charset_t defcharset;
struct header_rec *mss;
{

! const char *pv;
EC_decoder_t decode;



if (ptr->magic != MIME_magic)

***************
*** 877,883 ****
}

if (!ptr->parser_data) {
! CONST char * T = "multipart/encrypted";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
--- 892,898 ----
}

if (!ptr->parser_data) {
! const char * T = "multipart/encrypted";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
***************
*** 904,911 ****
return;
}

! if (!mime_get_param ("protocol", protocol, ptr->type_opts,
! sizeof protocol)) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
conversions */

--- 919,927 ----
return;
}

! pv = get_mime_param_compat(ptr->TYPE_opts,"protocol");
!
! if (!pv) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
conversions */

***************
*** 1009,1015 ****
}

if (!ptr->parser_data) {
! CONST char * T = "multipart/alternative";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
--- 1025,1031 ----
}

if (!ptr->parser_data) {
! const char * T = "multipart/alternative";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
***************
*** 1046,1051 ****
--- 1062,1068 ----

if (best) {

+
if (best->magic != MIME_magic)
mime_panic(__FILE__,__LINE__,"alternative_decode",
"Bad magic number (selected alternative)");
***************
*** 1088,1110 ****
}

tmp[0] = '\0';
! if (best->description) {
state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescA,
"\"%.60S\" ]\n"),
best->description);
state_puts("[ ",state_out);
! } else if (best->disposition_opts &&
! mime_get_param ("filename", tmp,
! best->disposition_opts,
! sizeof(tmp))) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
! MeDecodeDescFilenameA,
! "Filename: %.60s ]\n"),
! tmp);
! state_puts("[ ",state_out);
! }
!
Encoding = ENCODING(best->encoding);

/* state_nlputs or state_printf is needed for EOLN_is_CRLF
--- 1105,1148 ----
}

tmp[0] = '\0';
! if (best->description &&
! string_len(best->description) > 0) {
state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescA,
"\"%.60S\" ]\n"),
best->description);
state_puts("[ ",state_out);
! } else {


!
! int mp = give_dt_enumerate_as_int(&mime_parameters);

! const struct string *dv;
! const char * dva;


!
! /* 0 == plain
! 1 == encoded
! 2 == plain-and-encoded

! */
!
!
!

! if (mp &&
! (dv = get_mime_param(best->DISPOSITION_opts,"filename"))
! ) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
! MeDecodeDescFilenameA,
! "Filename: %.60S ]\n"),
! dv);
! state_puts("[ ",state_out);
! } else if ((dva = get_mime_param_compat(best->DISPOSITION_opts,
! "filename"))) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
! MeDecodeDescFilenameA1,
! "Filename: %.60s ]\n"),
! dva);
! state_puts("[ ",state_out);
! }
! }
!
Encoding = ENCODING(best->encoding);

/* state_nlputs or state_printf is needed for EOLN_is_CRLF
***************
*** 1234,1240 ****
"Bad magic number");

if (!ptr->parser_data) {
! CONST char * T = "multipart/*";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
--- 1272,1278 ----
"Bad magic number");

if (!ptr->parser_data) {
! const char * T = "multipart/*";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
***************
*** 1270,1276 ****

for (i = 0; i < count; i++) {
mime_t *att = mime_parser_index(ptr->parser_data,i);
! CONST int nattach = i+1;



if (att->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"multipart_decode_0",
--- 1308,1314 ----

for (i = 0; i < count; i++) {
mime_t *att = mime_parser_index(ptr->parser_data,i);
! const int nattach = i+1;



if (att->magic != MIME_magic)

mime_panic(__FILE__,__LINE__,"multipart_decode_0",
***************
*** 1321,1342 ****
}

tmp[0] = '\0';
! if (att->description) {
state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescA,
"\"%.60S\" ]\n"),
att->description);
state_puts("[ ",state_out);
! } else if (att->disposition_opts &&
! mime_get_param ("filename", tmp, att->disposition_opts,
! sizeof(tmp))) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescFilenameA,
! "Filename: %.60s ]\n"),
! tmp);
! state_puts("[ ",state_out);
! }
!
Encoding = ENCODING(att->encoding);

/* state_nlputs or state_printf is needed for EOLN_is_CRLF
--- 1359,1401 ----
}

tmp[0] = '\0';
! if (att->description &&
! string_len(att->description) > 0) {
state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescA,
"\"%.60S\" ]\n"),
att->description);
state_puts("[ ",state_out);
! } else {


!
! int mp = give_dt_enumerate_as_int(&mime_parameters);

! const struct string *dv;
! const char * dva;


!
! /* 0 == plain
! 1 == encoded
! 2 == plain-and-encoded

! */
!
! if (mp &&
! (dv = get_mime_param(att->DISPOSITION_opts,
! "filename"))
! ) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
MeDecodeDescFilenameA,
! "Filename: %.60S ]\n"),
! dv);
! state_puts("[ ",state_out);
! } else if ((dva = get_mime_param_compat(att->DISPOSITION_opts,
! "filename"))) {
! state_printf(state_out,CATGETS(elm_msg_cat, MeSet,
! MeDecodeDescFilenameA1,
! "Filename: %.60s ]\n"),
! dva);
! state_puts("[ ",state_out);
! }
! }
!
Encoding = ENCODING(att->encoding);

/* state_nlputs or state_printf is needed for EOLN_is_CRLF
***************
*** 1526,1532 ****
}

if (!mt->parser_data) {
! CONST char * T = "message/rfc822";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
--- 1585,1591 ----
}

if (!mt->parser_data) {
! const char * T = "message/rfc822";
state_puts("[ ",state_out);
state_printf(state_out,
CATGETS(elm_msg_cat, MeSet, MeDecodeTypeNotparsed,
***************
*** 1734,1740 ****
state -> filter = NULL; /* So that messages can be printed .. */


! code = mime_get_charset (&tmp, ptr->type_opts,
state->display_charset,
default_content_charset
);
--- 1793,1799 ----
state -> filter = NULL; /* So that messages can be printed .. */


! code = mime_get_charset (&tmp, ptr->TYPE_opts,
state->display_charset,
default_content_charset
);
***************
*** 1867,1873 ****
disp_vector[0] = display_charset;
disp_vector[1] = NULL;

! if ((r=mime_get_charset(&buf1,p->type_opts,disp_vector,NULL)) > 0) {
DPRINT(Debug,11,(&Debug,
"text_selector(%p) -- type: %p=%s/%s; charset=%s\n",
p,
--- 1926,1932 ----
disp_vector[0] = display_charset;
disp_vector[1] = NULL;

! if ((r=mime_get_charset(&buf1,p->TYPE_opts,disp_vector,NULL)) > 0) {
DPRINT(Debug,11,(&Debug,
"text_selector(%p) -- type: %p=%s/%s; charset=%s\n",
p,
***************
*** 1982,1988 ****
{
FILE * tmpfp = NULL;
char *fname = NULL;
!
DPRINT(Debug,11,(&Debug,
"arrange_binary -> state: offset=%ld, length=%ld \n",
(long) ptr -> offset, (long) ptr -> length));
--- 2041,2048 ----
{
FILE * tmpfp = NULL;
char *fname = NULL;
! char *tmp;
!
DPRINT(Debug,11,(&Debug,
"arrange_binary -> state: offset=%ld, length=%ld \n",
(long) ptr -> offset, (long) ptr -> length));
***************
*** 1997,2004 ****
in_state_ftell(state_in)));
}

fname = elm_message(FRM("%selmdecode-%d"),
! temp_dir, getpid ());
if (NULL == (tmpfp = safeopen_rdwr(fname))) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
conversions */
--- 2057,2068 ----
in_state_ftell(state_in)));

}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ return NULL;

+
fname = elm_message(FRM("%selmdecode-%d"),
! tmp, getpid ());
if (NULL == (tmpfp = safeopen_rdwr(fname))) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
conversions */
***************
*** 2070,2076 ****
int result = 1;
char *fname = NULL;
out_state_t newstate;
!
out_state_clear(&newstate,STATE_out_file);

DPRINT(Debug,11,(&Debug,
--- 2134,2141 ----
int result = 1;
char *fname = NULL;
out_state_t newstate;
! char *tmp;
!
out_state_clear(&newstate,STATE_out_file);

DPRINT(Debug,11,(&Debug,
***************
*** 2087,2094 ****
in_state_ftell(state_in)));
}

fname = elm_message(FRM("%selmdecode.%d"),
! temp_dir, getpid ());
if (NULL == (tmpfp = safeopen_rdwr(fname))) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
conversions */
--- 2152,2163 ----
in_state_ftell(state_in)));

}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ return NULL;

+
fname = elm_message(FRM("%selmdecode.%d"),
! tmp, getpid ());
if (NULL == (tmpfp = safeopen_rdwr(fname))) {
/* state_nlputs or state_printf is needed for EOLN_is_CRLF
conversions */
Index: elmME+.2.5.alpha5-cvs/melib/mime_param.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/melib/mime_param.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 0 ****
--- 1,2434 ----
+ static char rcsid[] = "@(#)$Id: mime_param.c,v 1.11.2.3 2005/07/26 08:28:42 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.11.2.3 $ $State: Exp $
+ *


+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ * or Kari Hurtta <e...@elmme-mailer.org>

+ *****************************************************************************/
+
+ #include "def_melib.h"
+

+ #include "s_me.h"
+
+

+ DEBUG_VAR(Debug,__FILE__,"mime");
+
+
+ static void free_parsed P_((struct mime_param *P));
+ static void free_parsed(P)
+ struct mime_param *P;
+ {
+ if (P->ascii_params) {
+ int i;
+
+ for (i = 0; i < P->ascii_param_count; i++) {
+ if (P->ascii_params[i].param) {
+ free(P->ascii_params[i].param);
+ P->ascii_params[i].param = NULL;
+ }
+
+ if (P->ascii_params[i].value) {
+ free(P->ascii_params[i].value);
+ P->ascii_params[i].value = NULL;
+ }
+ }
+
+ free(P->ascii_params);
+ P->ascii_params = NULL;
+ }
+ P->ascii_param_count =0;
+
+ if (P->string_params) {
+ int i;
+
+ for (i = 0; i < P->string_param_count; i++) {
+ if (P->string_params[i].param) {
+ free(P->string_params[i].param);
+ P->string_params[i].param = NULL;
+ }
+
+ if (P->string_params[i].value) {
+ free_string(& (P->string_params[i].value));
+ }
+ }
+
+ free(P->string_params);
+ P->string_params = NULL;
+ }
+ P->string_param_count =0;
+ }
+
+ static void free_raw P_((struct mime_param *P));
+ static void free_raw(P)
+ struct mime_param *P;
+ {
+ if (P->params) {
+ int i;
+
+ for (i = 0; i < P->param_count; i++) {
+ if (P->params[i].raw_param) {
+ free(P->params[i].raw_param);
+ P->params[i].raw_param = NULL;
+ }
+
+ if (P->params[i].raw_value) {
+ free(P->params[i].raw_value);
+ P->params[i].raw_value = NULL;
+ }
+ }
+
+ free(P->params);
+ P->params = NULL;
+ }
+ P->param_count =0;
+ }
+
+ void free_mime_param(x)
+ struct mime_param **x;
+ {
+ struct mime_param *P = *x;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"free_mime_param",
+ "Bad magic number");
+
+ free_raw(P);
+ free_parsed(P);
+
+
+ free(P);
+ P = NULL;
+
+ *x = P;
+ }
+
+ static struct mime_param * alloc_mime_param P_((void));
+ static struct mime_param * alloc_mime_param()
+ {
+ struct mime_param *P = safe_malloc(sizeof (*P));
+
+ bzero((void *)P, sizeof (*P));
+
+ P->magic = MIME_PARAM_magic;
+
+ P->params = NULL;
+ P->param_count = 0;
+
+ P->def = NULL;
+
+
+ P->ascii_params = NULL;
+ P->ascii_param_count = 0;
+
+ P->string_params = NULL;
+ P->string_param_count = 0;
+
+ return P;
+ }
+
+ struct mime_param * copy_mime_param(src)
+ struct mime_param *src;
+ {
+ struct mime_param *P = alloc_mime_param();
+
+ P->def = src->def;
+
+
+ if (src->params) {
+ int i;
+
+ P->params = safe_malloc(src->param_count * sizeof (P->params[0]));
+
+ for (i = 0; i < src->param_count; i++) {
+ if (src->params[i].raw_param)
+ P->params[i].raw_param = safe_strdup(src->params[i].raw_param);
+ if (src->params[i].raw_value)
+ P->params[i].raw_value = safe_strdup(src->params[i].raw_value);
+ }
+ P->param_count = src->param_count;
+ }
+
+
+ /* These params are rebuild from raw params */
+
+ P->ascii_params = NULL;
+ P->ascii_param_count = 0;
+
+ P->string_params = NULL;
+ P->string_param_count = 0;
+
+ return P;
+ }
+
+ static struct ascii_pair * add_ascii_pair_1 P_((struct ascii_pair **list, int *len));
+ static struct ascii_pair * add_ascii_pair_1(list,len)
+ struct ascii_pair **list;
+ int *len;
+ {
+ struct ascii_pair * ascii_params = *list;
+ int ascii_param_count = *len;
+ struct ascii_pair * ret = NULL;
+
+ ascii_params = safe_realloc(ascii_params,
+ (ascii_param_count+1) *
+ sizeof(ascii_params[0]));
+
+ bzero((void *)& (ascii_params[ascii_param_count]),
+ sizeof ((ascii_params[ascii_param_count])));
+
+ ascii_params[ascii_param_count].is_compat = 0;
+ ascii_params[ascii_param_count].param = NULL;
+ ascii_params[ascii_param_count].value = NULL;
+
+ ret = (&(ascii_params[ascii_param_count++]));
+
+ *list = ascii_params;
+ *len = ascii_param_count;


+
+ return ret;
+ }
+

+ static struct ascii_pair * add_ascii_pair P_((struct mime_param *P));
+ static struct ascii_pair * add_ascii_pair(P)
+ struct mime_param *P;
+ {
+ return add_ascii_pair_1( & (P->ascii_params),
+ & (P->ascii_param_count) );
+
+ }
+
+ static struct string_pair * add_string_pair_1 P_((struct string_pair **list,
+ int *len));
+ static struct string_pair * add_string_pair_1(list,len)
+ struct string_pair **list;
+ int *len;
+ {
+ struct string_pair *ret;
+ struct string_pair * string_params = *list;
+ int string_param_count = *len;
+
+ string_params = safe_realloc(string_params,
+ (string_param_count +1) *
+ sizeof(string_params[0]));
+
+ bzero((void *)& (string_params[string_param_count]),
+ sizeof ((string_params[string_param_count])));
+
+ string_params[string_param_count].param = NULL;
+ string_params[string_param_count].value = NULL;
+
+ ret = (&(string_params[string_param_count++]));
+
+ *list = string_params;
+ *len = string_param_count;


+
+ return ret;
+ }
+

+ static struct string_pair * add_string_pair P_((struct mime_param *P));
+ static struct string_pair * add_string_pair(P)
+ struct mime_param *P;
+ {
+ return add_string_pair_1 (& (P->string_params),
+ & (P->string_param_count));
+
+ }
+
+ static struct mp_pair * add_mp_pair_1 P_((struct mp_pair **list, int *len));
+ static struct mp_pair * add_mp_pair_1(list,len)
+ struct mp_pair **list;
+ int *len;
+ {
+ struct mp_pair *params = *list;
+ int param_count = *len;
+ struct mp_pair *ret = NULL;
+
+ params = safe_realloc(params,
+ (param_count +1) * sizeof (params[0]));
+
+ bzero ((void *) &(params[param_count]), sizeof (params[param_count]));
+
+ params[param_count].raw_param = NULL;
+ params[param_count].raw_value = NULL;
+
+ ret = (& (params[ param_count++]));
+
+ *list = params;
+ *len = param_count;


+
+ return ret;
+ }
+

+ static unsigned char * us_str P_((char *str));
+ static unsigned char * us_str(str)


+ char *str;
+ {
+ return (unsigned char *)str;
+ }
+

+ static struct mp_pair * add_mp_pair P_((struct mime_param *P));
+ static struct mp_pair * add_mp_pair(P)
+ struct mime_param *P;
+ {
+ return add_mp_pair_1(& (P->params), &(P->param_count));
+ }
+
+ static int append_encoded P_((struct string *buffer,char *value));
+ static int append_encoded(buffer,value)
+ struct string *buffer;
+ char *value;
+ {
+ unsigned char *p;
+
+ for (p = us_str(value); *p; p++) {
+ if ('\'' == *p || '"' == *p) {
+ DPRINT(Debug,9,(&Debug,
+ "append_encoded: bad character %c, value=%s\n",
+ *p,value));
+
+ return 0;
+ }
+
+ if ('%' == *p) {
+ int v1, v2;
+ unsigned char v;
+
+ p++;
+ if (! *p) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: short %% sequence, value=%s\n",
+ value));


+
+ return 0;
+ }

+ v1 = hex(*p);
+
+
+ p++;
+ if (! *p) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: short %% sequence, value=%s\n",
+ value));
+ return 0;
+ }
+
+ v2 = hex(*p);
+
+ if (v1 < 0 || v2 < 0) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: bad %% sequence, value=%s\n",
+ value));
+ return 0;
+ }
+
+ v = ( v1 << 4) | v2;
+
+ if (! add_streambyte_to_string(buffer,v)) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: bad character %%%02x, value=%s\n",
+ v,value));
+
+ return 0;
+ }
+
+ } else {
+ if (! add_streambyte_to_string(buffer,(unsigned char)*p)) {
+ DPRINT(Debug,9,(&Debug,
+ "append encoded: bad character %c, value=%s\n",
+ *p,value));
+ return 0;
+ }
+ }
+ }
+
+ return 1;
+ }
+
+ static struct string * parse_encoded_first P_((char *value));
+ static struct string * parse_encoded_first(value)
+ char *value;
+ {
+ struct string *ret = NULL;
+ int l = strlen(value);
+ char * buffer = safe_malloc(l+1);
+ char * lang = NULL;
+ char * cs = NULL;
+ charset_t cs1 = NULL;
+
+ char *p1,*p2;
+
+ /* character set */
+ cs = buffer;
+
+ for (p1 = value, p2 =buffer;
+ *p1 && '\'' != *p1 && p2 <= buffer + l;
+ p1++) {
+
+ *p2++ = *p1;
+ }
+ *p2 = '\0';
+
+ if ('\'' != *p1) {
+ DPRINT(Debug,9,(&Debug, "parse_encoded_first: Missing ': %s\n",value));
+ goto fail;
+ }
+ p1++;
+
+ if (p2 == cs)
+ cs = NULL;
+
+ /* language */
+ p2++;
+ lang = p2;
+
+ for (;
+ *p1 && '\'' != *p1 && p2 <= buffer + l;
+ p1++) {
+
+ *p2++ = *p1;
+ }
+ *p2 = '\0';
+
+ if ('\'' != *p1) {
+ DPRINT(Debug,9,(&Debug, "parse_encoded_first: Missing second ': %s\n",
+ value));
+ goto fail;
+ }
+ p1++;
+
+
+ if (p2 == lang)
+ lang = NULL;
+
+ if (cs) {
+ DPRINT(Debug,9,(&Debug, "parse_encoded_first: cs=%s\n",cs));
+ cs1 = MIME_name_to_charset(cs,CHARSET_create);
+ } else
+ cs1 = RAW_BUFFER; /* charset is not relevant to parameter value! */
+
+
+ if (lang) {
+ DPRINT(Debug,9,(&Debug, "parse_encoded_first: lang=%s\n",lang));
+ ret = new_langstring(cs1,lang);
+ } else
+ ret = new_string(cs1);
+
+ if (!append_encoded(ret,p1)) {
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_encoded_first: parse error .. ignoring result\n"));
+ free_string(&ret);
+ }
+
+ fail:
+ free(buffer);


+
+ return ret;
+ }
+
+

+ #define MAX_POSITIONAL 100
+
+ static void parse_raw_params P_((struct mime_param *P));
+ static void parse_raw_params(P)
+ struct mime_param *P;
+ {
+ struct positional_params {
+ char *name;
+ int bad;
+
+ struct loc_pos {
+ int is_new;
+ int loc;
+ } *locations ;
+ int location_count;
+ } * positional = NULL;
+ int positional_count = 0;
+
+ free_parsed(P);
+
+ /* Pass 1 look item 0 on parameters */
+
+ if (P->params) {
+ int i;
+
+ for (i = 0; i < P->param_count; i++) {
+ char * name = P->params[i].raw_param;
+ char * p;
+
+ if (!name)
+ continue;
+ if (!name[0]) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: parameter without name\n",
+ i));


+ continue;
+ }
+
+

+ for (p = name; *p; p++) {
+ if ('*' == *p)
+ break;
+ }
+
+ if ('\0' == *p) {
+ char *x;
+
+ /* compat parameter */
+
+ /* Check for 8-bit */
+
+ if (! P->params[i].raw_value) {
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: compat parameter without value\n",
+ i,name));
+

+
+ continue;
+ }
+

+ for (x = P->params[i].raw_value; *x; x++) {
+ if (0 != (*x & 0x80))
+ break;
+ }
+
+ if ('\0' == *x) {
+ /* Ascii value -- really compat */
+
+ struct ascii_pair * A = add_ascii_pair(P);
+ int l = x - P->params[i].raw_value;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,name,P->params[i].raw_value));
+
+ A->is_compat = 1;
+
+ A->param = safe_strdup(name);
+
+ A->value = dequote_opt(P->params[i].raw_value,l);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [compat] %s=%s\n",
+ A->param,
+ A->value));
+
+ } else {
+
+ struct string_pair * S = add_string_pair(P);
+ char * val;
+ int l;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: 8-bit data on compat parameter\n",
+ i,name));
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,name,P->params[i].raw_value));
+
+ if (! P->def ) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: NO DEFAULT CHARSET -- parameter ignored\n"));
+ continue;
+ }
+
+ S->param = safe_strdup(name);
+
+ while (*x)
+ x++;
+ l = x - P->params[i].raw_value;
+
+ val = dequote_opt(P->params[i].raw_value,l);
+
+ S->value = new_string2(P->def,us_str(val));
+
+ free(val);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [8-bit] %s=%S\n",
+ S->param,
+ S->value));
+
+ }
+
+
+ } else {
+
+ int is_new = 0;
+ int is_partial = 0;
+ int index = 0;
+ int l = p - name;
+ char * name1 = safe_malloc(l+1);
+
+ strncpy(name1,name,l);
+ name1[l] = '\0';
+
+ p++;
+ if ('\0' == *p ) {
+ /* '*' was last character on name */
+
+ is_new = 1;
+
+ } else if (*p >= '0' && *p <= '9') {
+ char *end = NULL;
+ long x;
+ is_partial = 1;
+
+ x= strtol(p,&end,10);
+
+ if (x > MAX_POSITIONAL) {
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s postion value %ld is too big (max %d)\n",
+ i,name,name1,x,
+ MAX_POSITIONAL));
+
+ goto fail1;
+ }
+ index = x;
+
+ if ('\0' != *end &&
+ '*' != *end) {
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s after position value %ld there is garbage: %s\n",
+ i,name,name1,x,end));
+
+ goto fail1;
+
+ }
+
+ p = end;
+ }
+
+ if ('*' == *p) {
+ is_new = 1;
+
+ p++;
+ }
+
+ if (*p) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s there is garbage after '*': %s\n",
+ i,name,name1,p));
+ goto fail1;
+ }
+
+ if (is_partial) {


+
+ int x;
+

+ for (x = 0; x < positional_count; x++) {
+ if (0 == istrcmp(name1,positional[x].name))
+ break;
+ }
+
+ if (x >= positional_count) {
+ positional = safe_realloc(positional,
+ (x+1) * sizeof(positional[0]));
+ positional[x].name = name1; name1 = NULL;
+ positional[x].bad = 0;
+
+ positional[x].locations = NULL;
+ positional[x].location_count = 0;
+ positional_count = x+1;
+ }
+
+ if (index >= positional[x].location_count) {
+ int y;
+
+ positional[x].locations = safe_realloc(positional[x].locations,
+ (index+1) *
+ sizeof(positional[x].locations[0]));
+ for (y = positional[x].location_count; y <= index; y++) {
+ positional[x].locations[y].is_new = 0;
+ positional[x].locations[y].loc = -1;
+ }
+ positional[x].location_count = index+1;
+ }
+
+ if (index < 0) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s position value %ld is negative\n",
+ i,name,positional[x].name,index));
+ positional[x].bad = 1;
+ goto fail1;
+ }
+
+ if (positional[x].locations[index].loc != -1) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: On paramater %s position value %ld is duplicate\n",
+ i,name,positional[x].name,index));
+ positional[x].bad = 1;
+ goto fail1;
+
+ }
+
+ positional[x].locations[index].loc = i;
+ positional[x].locations[index].is_new = is_new;
+
+ } else {
+ /* Not a partial value */
+ char *value = P->params[i].raw_value;
+ struct string * X;
+ struct string_pair * S;
+
+ if (!is_new)
+ mime_panic(__FILE__,__LINE__,"parse_raw_params",
+ "compat parameters should be handled already");
+
+ if (! value) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %d: %s: parameter %s without value\n",
+ i,name,name1));
+
+ goto fail1;
+ }
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,name,P->params[i].raw_value));
+
+ X = parse_encoded_first(value);
+
+ if (!X) {
+ goto fail1;
+ }
+
+ S = add_string_pair(P);
+ S->param = name1; name1 = NULL;
+ S->value = X;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [string] %s=%S\n",
+ S->param,
+ S->value));
+
+ }
+
+ fail1:
+ if (name1)
+ free(name1);


+
+ }
+ }
+ }
+

+ /* Pass 2 look positional arguments */
+
+ if (positional) {
+ int x;
+
+ for (x = 0; x < positional_count; x++) {
+ int y;
+ int new_seen = 0;
+
+ for (y = 0; y < positional[x].location_count; y++) {
+
+ if (positional[x].locations[y].loc == -1) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: On paramater %s position value %d is missing\n",
+ positional[x].name,y));
+ positional[x].bad = 1;
+ break;
+ }
+
+ if (positional[x].locations[y].loc < 0 ||
+ positional[x].locations[y].loc >= P->param_count)
+ mime_panic(__FILE__,__LINE__,"parse_raw_params",
+ "Bad location index");
+
+ new_seen |= positional[x].locations[0].is_new;
+ }
+
+ if (positional[x].location_count < 1)
+ mime_panic(__FILE__,__LINE__,"parse_raw_params",
+ "Inbossible location count");
+
+ if (positional[x].bad)
+ continue;
+
+ if (new_seen) {
+ struct string_pair * S = NULL;
+
+ /* Handle first parameter */
+
+ if (positional[x].locations[0].is_new) {
+ int i = positional[x].locations[0].loc;
+ char *value = P->params[i].raw_value;
+ struct string * X;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,
+ P->params[i].raw_param,
+ P->params[i].raw_value));
+
+
+ X = parse_encoded_first(value);
+
+ if (!X) {
+ goto fail2;
+ }
+
+ S = add_string_pair(P);
+ S->param = safe_strdup(positional[x].name);
+ S->value = X;
+
+
+ } else {
+ int i = positional[x].locations[0].loc;
+ char *value = P->params[i].raw_value;
+ int l = strlen(value);
+ char *val;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,
+ P->params[i].raw_param,
+ P->params[i].raw_value));
+
+ val = dequote_opt(value,l);
+
+ S = add_string_pair(P);
+ S->param = safe_strdup(positional[x].name);
+
+ /* FIXME ??? Is this correct ??? */
+ S->value = new_string2(RAW_BUFFER,us_str(val));
+
+ free(val);
+
+ }
+
+ /* Handle rest of parameters */
+
+ for (y = 1; y < positional[x].location_count; y++) {
+
+ int i = positional[x].locations[y].loc;
+ char *value = P->params[i].raw_value;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,
+ P->params[i].raw_param,
+ P->params[i].raw_value));
+
+ if (positional[x].locations[x].is_new) {
+
+ if (!append_encoded(S->value,value))
+ goto failX;
+
+
+ } else {
+ char * val;
+ int l1;
+ int errors = 0;
+
+ int l = strlen(value);
+
+ val = dequote_opt(value,l);
+ l1 = strlen(val);
+
+ if (!add_streambytes_to_string(S->value,l1,us_str(val),&errors)) {
+
+ free(val);
+ goto failX;
+ }
+
+ free(val);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [added %d] %s=%S\n",
+ x,
+ S->param,
+ S->value));


+
+ }
+
+ }
+

+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [splitted string] %s=%S\n",
+ S->param,
+ S->value));
+
+
+ if (0) {
+ failX:
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %s: Failed to parse value\n",
+ S->param));
+
+ free_string(& (S->value));
+ }
+
+
+ } else {
+
+ struct ascii_pair * A = add_ascii_pair(P);
+
+ char *p;
+
+ A->is_compat = 0;
+ A->param = safe_strdup(positional[x].name);
+ A->value = NULL;
+
+
+
+ for (y = 0; y < positional[x].location_count; y++) {
+
+ int i = positional[x].locations[y].loc;
+ char *value = P->params[i].raw_value;
+ int l = strlen(value);
+ char *val;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: *** %d: %s=%s\n",
+ i,
+ P->params[i].raw_param,
+ P->params[i].raw_value));
+
+ if (positional[x].locations[x].is_new)
+ mime_panic(__FILE__,__LINE__,"parse_raw_params",
+ "Inbossible encoding");
+
+
+
+ val = dequote_opt(value,l);
+
+ A->value = strmcat(A->value,val);
+
+ free(val);
+ }
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [splitted ascii] %s=%s\n",
+ A->param,
+ A->value));
+
+
+ for (p = A->value; *p; p++) {
+ if (0 != (*p & 0x80))
+ break;
+ }
+
+ if (*p) {
+ struct string_pair * S;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: %s: 8-bit data on parameter\n",
+ A->param));
+
+ if (! P->def ) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: NO DEFAULT CHARSET -- parameter ignored\n"));
+
+ /* Destroy non-ascii value */
+ free(A->value); A->value = NULL;


+
+ continue;
+ }
+

+ S = add_string_pair(P);
+
+ S->param = safe_strdup(A->param);
+ S->value = new_string2(P->def,us_str(A->value));
+
+ /* Destroy non-ascii value */
+ free(A->value); A->value = NULL;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_raw_params: [fixup string] %s=%S\n",
+ S->param,
+ S->value));


+
+ }
+
+ }
+

+ fail2: ;
+
+ }
+ }
+
+ /* Cleanup */
+
+ if (positional) {
+ int i;
+
+ for (i = 0; i < positional_count; i++) {
+ if (positional[i].locations) {
+ free(positional[i].locations);
+ positional[i].locations = NULL;
+ }
+ positional[i].location_count = 0;
+ }
+ free(positional);
+ }
+ }
+
+
+ struct mime_param * parse_mime_param(headername,value,def)
+ char *headername;
+ char *value;
+ charset_t def;
+ {
+ char *ptr;
+
+
+ struct mime_param *P = alloc_mime_param();
+
+ DPRINT(Debug,9,(&Debug,"parse_mime_param: headername=%s value=%s\n",
+ headername ? headername : "<not given>",
+ value));
+
+ P->def = def;
+
+ /* It is assumed that comments are already removed
+ with rfc822_reap_comments()
+ */
+
+ for (ptr = value; *ptr; ) {
+ char * start;
+ char * last;
+ int len;
+ struct mp_pair * mp = NULL;
+
+ while (*ptr && isascii(*ptr) && isspace(*ptr))
+ ptr++;
+
+ if (!*ptr)
+ break ;
+
+ start = ptr;
+ last = NULL;
+
+ /* Get param name */
+
+ while (*ptr) {
+
+ if (isascii(*ptr) && isspace(*ptr)) {
+ if (!last)
+ last = ptr;
+ } else if ('=' == *ptr) {
+ if (!last)
+ last = ptr;
+ break;
+ } else if ('"' == *ptr) {
+ if (!last)
+ last = ptr;
+ break;
+ } else if (';' == *ptr) {
+
+ if (!last)
+ last = ptr;
+ break;
+ } else if (last) {
+
+ break;
+ }
+
+ ptr++;
+ }
+
+ if (!last)
+ last = ptr;
+
+ while (*ptr && isascii(*ptr) && isspace(*ptr))
+ ptr++;
+
+ if ('=' == *ptr)
+ ptr++;
+ else {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingEqual,
+ "PARSE ERROR: Missing = on %s header"),
+ headername);
+ }
+
+ if (last == start) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingName,
+ "PARSE ERROR: Missing name of param on %s header"),
+ headername);
+
+ }
+
+ len = last-start;
+
+ mp = add_mp_pair(P);
+
+ mp->raw_param = safe_malloc(len+1);
+
+ strncpy(mp->raw_param,start,len);
+ mp->raw_param[len] = '\0';
+
+ DPRINT(Debug,9,(&Debug,"parse_mime_param: [%d] param=%s\n",
+ P->param_count-1,mp->raw_param));
+
+
+ while (*ptr && isascii(*ptr) && isspace(*ptr))
+ ptr++;
+
+ start = ptr;
+ last = NULL;
+
+ if ('"' == *ptr) {
+
+ ptr++;
+ while (*ptr && '"' != *ptr) {
+
+ if ('\\' == *ptr) {
+ ptr++;
+
+ if (!*ptr) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeTrailingBackslashHeader,
+ "PARSE ERROR: Trailing \\ on %s header"),
+ headername);
+
+ break;
+ }
+ }
+ ptr++;
+ }
+
+ if ('"' != *ptr) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingQuote,
+ "PARSE ERROR: Missing ending \" on %s header"),
+ headername);
+ } else
+ ptr++;
+
+
+ } else {
+
+ while (*ptr) {
+ if (isascii(*ptr) && isspace(*ptr)) {
+ if (!last)
+ last = ptr;
+ } else if ('=' == *ptr) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeEqualOnValue,
+ "PARSE ERROR: Missing ; or = on param value on %s header"),
+ headername);
+ } else if ('"' == *ptr) {
+ if (!last)
+ last = ptr;
+ break;
+ } else if (';' == *ptr) {
+ if (!last)
+ last = ptr;
+ break;
+ } else if (last) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeSpaceOnValue,
+ "PARSE ERROR: Missing ; or space on param value on %s header"),
+ headername);
+ last = NULL;
+ }
+
+ ptr++;
+ }
+ }
+
+ if (!last)
+ last = ptr;
+
+ while (*ptr && isascii(*ptr) && isspace(*ptr))
+ ptr++;
+
+
+ if (';' == *ptr)
+ ptr++;
+ else if (*ptr) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingSemicolonHeader,
+ "PARSE ERROR: Missing ; on %s header"),
+ headername);
+ }
+
+
+ if (last == start) {
+ if (show_header_errors && headername)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingValue,
+ "PARSE ERROR: Missing value of param on %s header"),
+ headername);
+
+ }
+
+ len = last-start;
+
+ mp->raw_value = safe_malloc(len+1);
+
+ strncpy(mp->raw_value,start,len);
+ mp->raw_value[len] = '\0';
+
+ DPRINT(Debug,9,(&Debug,"parse_mime_param: [%d] value=%s\n",
+ P->param_count-1,mp->raw_value));
+
+
+ }
+
+ return P;
+ }
+
+ static const char *find_ascii_param P_((struct mime_param *P,
+ char *name,
+ int compat));
+ static const char *find_ascii_param(P,name,compat)
+ struct mime_param *P;
+ char *name;
+ int compat;


+ {
+ int i;
+

+ for (i = 0; i < P->ascii_param_count; i++) {
+ if (P->ascii_params[i].is_compat == compat &&
+ P->ascii_params[i].param &&
+ 0 == istrcmp(P->ascii_params[i].param,name))
+ return P->ascii_params[i].value;


+ }
+ return NULL;
+ }
+

+ static const struct string *find_string_param P_((struct mime_param *P,
+ char *name));
+ static const struct string *find_string_param(P,name)
+ struct mime_param *P;
+ char *name;


+ {
+ int i;
+

+ for (i = 0; i < P->string_param_count; i++) {
+ if (P->string_params[i].param &&
+ 0 == istrcmp(P->string_params[i].param,name))
+ return P->string_params[i].value;


+ }
+ return NULL;
+ }
+

+ const char * get_mime_param_compat(P,name)
+ struct mime_param *P;
+ char *name;
+ {
+ if (!P)
+ return NULL;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"get_mime_param_compat",
+ "Bad magic number");
+
+ if (! P->ascii_params && ! P->string_params)
+ parse_raw_params(P);
+
+ if (P->ascii_params)
+ return find_ascii_param(P,name,1);
+
+ DPRINT(Debug,9,(&Debug, "get_mime_param_compat: No parameters\n"));


+
+ return NULL;
+ }
+

+ const char * get_mime_param_ascii(P,name)
+ struct mime_param *P;
+ char *name;
+ {
+ if (!P)


+ return NULL;
+
+

+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"get_mime_param_ascii",
+ "Bad magic number");
+
+
+ if (! P->ascii_params && ! P->string_params)
+ parse_raw_params(P);
+
+ if (P->ascii_params) {
+ const char *found = find_ascii_param(P,name,0);
+
+ if (found)
+ return found;
+
+ return find_ascii_param(P,name,1);
+ }
+
+ DPRINT(Debug,9,(&Debug, "get_mime_param_ascii: No parameters\n"));
+
+ return NULL;
+ }
+
+
+ static const unsigned char * cus_str P_((const char *str));
+ static const unsigned char * cus_str(str)


+ const char *str;
+ {

+ return (const unsigned char *)str;
+ }
+
+
+ const struct string * get_mime_param(P,name)
+ struct mime_param *P;
+ char *name;
+ {
+ if (!P)
+ return NULL;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"get_mime_param",
+ "Bad magic number");
+
+ if (! P->ascii_params && ! P->string_params)
+ parse_raw_params(P);
+
+ if (P->string_params) {
+ const struct string *found = find_string_param(P,name);
+
+ if (found)
+ return found;
+ }
+
+ if (P->ascii_params) {
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+
+ const char *found = find_ascii_param(P,name,0);
+ struct string_pair *S;
+
+ if (!found)
+ found = find_ascii_param(P,name,1);
+
+ if (!found)
+ return NULL;
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"get_mime_param",
+ "US-ASCII not found");
+
+ S = add_string_pair(P);
+ S->param = safe_strdup(name);
+ S->value = new_string2(ascii_ptr,cus_str(found));
+
+ return S->value;
+ }
+
+ DPRINT(Debug,9,(&Debug, "get_mime_param: No parameters\n"));


+
+ return NULL;
+ }
+

+ static int ascii_need_quote P_((char *value));
+ static int ascii_need_quote(value)
+ char *value;
+ {
+ char *p;
+
+ if (! value[0])
+ return 1;
+
+ for (p = value; *p; p++) {
+ if (*p <= ' ')
+ return 1;
+
+ if (*p >= '"' &&
+ *p <= '/')
+ return 1;
+
+ if (*p >= ':' &&
+ *p <= '?')
+ return 1;
+
+ if (*p == '\\')


+ return 1;
+ }
+

+ return 0;
+ }
+
+ static int string_is_ascii_control P_((struct string * value));
+ static int string_is_ascii_control(value)
+ struct string * value;
+ {
+ int len = string_len(value);
+ int i;
+
+ for (i = 0; i < len; i++) {
+ uint16 code = give_unicode_from_string(value,i);
+
+ if (code <= 0x0020 /* space */ )
+ return 1;
+
+ if (code >= 0x007F /* DEL */)


+ return 1;
+ }
+

+ return 0;
+ }
+
+ static int string_need_quote P_((struct string * value));
+ static int string_need_quote(value)
+ struct string * value;
+ {
+ int len = string_len(value);
+ int i;
+
+ if (0 == len)
+ return 1;
+
+ for (i = 0; i < len; i++) {
+ uint16 code = give_unicode_from_string(value,i);
+
+ if (code <= 0x0020 /* space */ )
+ return 1;
+
+ if (code >= 0x0022 /* " */ &&
+ code <= 0x002F /* / */)
+ return 1;
+
+ if (code >= 0x003A /* : */ &&
+ code >= 0x003F /* ? */)
+ return 1;
+
+ switch(code) {
+
+ case 0x005C /* \ */:
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+
+ static void append_quoted_to_string P_((struct string ** ret,
+ struct string * value));
+ static void append_quoted_to_string(ret,value)
+ struct string ** ret;
+ struct string * value;
+ {
+ charset_t cs = value->string_type;
+ int len = string_len(value);
+ int i;
+
+ struct string * tmp = new_string(cs);
+
+ add_ascii_to_string(tmp,us_str("\""));
+
+ for (i = 0; i < len; i++) {
+ uint16 code = give_unicode_from_string(value,i);
+
+ if (0x0022 /* " */ == code &&


+ 0x005C /* \ */ == code)

+ add_ascii_to_string(tmp,us_str("\\"));
+
+ add_unicode_to_string(tmp,1,&code);
+ }
+
+ add_ascii_to_string(tmp,us_str("\""));
+
+ append_string(ret,tmp);
+
+ free_string(&tmp);
+ }
+
+ struct string * unquote_string P_((struct string * value));
+ struct string * unquote_string(value)
+ struct string * value;
+ {
+ charset_t cs = value->string_type;
+ int len = string_len(value);
+ int i;
+ int q = 0;
+
+ struct string * ret = new_string(cs);
+
+ for (i = 0; i < len; i++) {
+ uint16 code = give_unicode_from_string(value,i);
+
+ if (0x0022 /* " */ == code) {
+ q = !q;
+ continue;
+ }
+
+ /* Recognize \ escape only in quoted strings */
+ if (0x005C /* \ */ == code && q) {
+ i++;
+
+ if (i < len)
+ code = give_unicode_from_string(value,i);
+ else {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeTrailingBackslashOnString,
+ "Trailing Backslash (\\) on %S"),
+ value);
+ break;
+
+ }
+ }
+
+ add_unicode_to_string(ret,1,&code);
+ }
+
+ if (q)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeMissingEndQuote,
+ "Missing ending quote (\") on %S"),
+ value);
+
+ return ret;
+ }
+
+ static void add_param_string P_((struct string ** ret,
+ char *param,
+ struct string * value));
+ static void add_param_string(ret,param,value)
+ struct string ** ret;
+ char *param;
+ struct string * value;
+ {
+ if (*ret)
+ add_ascii_to_string(*ret,us_str("; "));
+
+ if (!*ret)
+ *ret = new_string(display_charset);
+
+ add_ascii_to_string(*ret,us_str(param));
+ add_ascii_to_string(*ret,us_str("="));
+
+ if (string_need_quote(value))
+ append_quoted_to_string(ret,value);
+ else
+ append_string(ret,value);
+ }
+
+ static void add_param_ascii P_((struct string ** ret,
+ char *param,
+ char * value));
+ static void add_param_ascii(ret,param,value)
+ struct string ** ret;
+ char *param;
+ char * value;
+ {
+ struct string * tmp ;
+
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"add_param_ascii",
+ "US-ASCII not found");
+
+ tmp = new_string2(ascii_ptr,us_str(value));
+ add_param_string(ret,param,tmp);
+ free_string(&tmp);
+ }
+
+ struct string * show_mime_params(P)
+ struct mime_param *P;
+ {
+ struct string * ret = NULL;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"show_mime_params",
+ "Bad magic number");
+
+ if (! P->ascii_params && ! P->string_params)
+ parse_raw_params(P);
+
+
+ if (P->string_params) {
+ int i;
+
+ for (i = 0; i < P->string_param_count; i++) {
+ if (P->string_params[i].param &&
+ P->string_params[i].value)
+ add_param_string(&ret,P->string_params[i].param,
+ P->string_params[i].value);
+ }
+ }
+
+ if (P->ascii_params) {
+ int i;
+
+ for (i = 0; i < P->ascii_param_count; i++) {
+ if (!P->ascii_params[i].param)
+ continue;
+
+ if (find_string_param(P,P->ascii_params[i].param))
+ continue;
+
+ if (P->ascii_params[i].value)
+ add_param_ascii(&ret,P->ascii_params[i].param,
+ P->ascii_params[i].value);
+ }
+ }
+
+ return ret;
+ }
+
+ char * encode_mime_params(P)
+ struct mime_param *P;


+ {
+ char * ret = NULL;
+

+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"encode_mime_params",
+ "Bad magic number");
+
+ if (P->params) {
+ int i;
+
+ for (i = 0; i < P->param_count; i++) {
+ if (P->params[i].raw_param &&
+ P->params[i].raw_value) {
+ if (ret)
+ ret = strmcat(ret,"; ");
+
+ ret = strmcat(ret,P->params[i].raw_param);
+ ret = strmcat(ret,"=");
+ ret = strmcat(ret,P->params[i].raw_value);


+ }
+
+ }
+ }
+

+ return ret;
+ }
+
+
+
+ char ** encode_mime_params_v(P)
+ struct mime_param *P;
+ {
+ char ** ret = NULL;
+
+ if (MIME_PARAM_magic != P->magic)
+ mime_panic(__FILE__,__LINE__,"encode_mime_params",
+ "Bad magic number");
+
+ if (P->params) {
+ int i;
+ int X = 0;
+
+ ret = safe_malloc((P->param_count +1) * sizeof (ret[0]));
+
+ for (i = 0; i < P->param_count; i++) {
+ if (P->params[i].raw_param &&
+ P->params[i].raw_value) {
+
+ ret[X] = safe_strdup(P->params[i].raw_param);
+ ret[X] = strmcat(ret[X],"=");
+ ret[X] = strmcat(ret[X],P->params[i].raw_value);
+ X++;
+ }
+ }
+ ret[X] = NULL;
+ }
+ return ret;
+ }
+
+
+ static void gen_splitted_ascii_param P_((struct mime_param *P, char *name, char *value));
+ static void gen_splitted_ascii_param(P,name,value)
+ struct mime_param *P;
+ char *name;
+ char *value;
+ {
+ char * p, *p1;
+ int counter = 0;
+
+ for (p = value; *p; p = p1) {
+ struct mp_pair * mp = add_mp_pair(P);
+ char * tmp;
+ int len;
+
+ for (p1 = p; *p && p1-p < 70; p++)
+ /* nothing */;
+
+ len = p1-p;
+
+ mp->raw_param = elm_message(FRM("%s*%d"),name,counter++);
+
+ tmp = safe_malloc(len+1);
+ strncpy(tmp,p,len);
+ tmp[len] = '\0';
+
+ if (ascii_need_quote(tmp)) {
+ mp->raw_value = elm_message(FRM("%Q"),tmp);
+ free(tmp);
+ } else {
+ mp->raw_value = tmp;
+ }
+ }
+
+ if (counter == 0) {
+ struct mp_pair * mp = add_mp_pair(P);
+ mp->raw_param = elm_message(FRM("%s*%d"),name,counter++);
+ mp->raw_value = safe_strdup("\"\"");
+ }
+
+ }
+
+ static char * get_encoded P_((struct string *value));
+ static char * get_encoded(value)
+ struct string *value;


+ {
+ char * ret = NULL;

+ int alloclen = 0;
+ int len;
+ char * tmp;
+ int ok = charset_ok_p(value->string_type);
+ int i;
+ int count = 0;
+ const char *y = get_string_MIME_name(value);
+
+ if (y && (0 == istrcmp(y,"UTF-8") ||
+ 0 == istrcmp(y,"UTF-7")))
+ ok = 1;
+
+ /* Allow producing \0 values also ... */
+ bytestream_from_string(value,&tmp,&len);
+
+ alloclen = len+10;
+
+ if (!ok)
+ alloclen = len*3+2;
+
+ ret = safe_malloc(alloclen);
+
+ #define ADD(x) { if (count >= alloclen) { \
+ alloclen += 20; ret = safe_realloc(ret,alloclen); } \
+ ret[count++] = (x); }


+
+ for (i = 0; i <len; i++) {

+ unsigned char val =tmp[i];
+
+ if (!ok || val == '%' || !isascii(val) || !isalnum(val)) {
+ ADD('%');
+ ADD(hexchars[val / 16]);
+ ADD(hexchars[val % 16]);
+ } else {
+ ADD(val);
+ }
+ }
+
+ ADD('\0');
+
+ #undef ADD
+
+ free(tmp);
+ return ret;
+ }
+
+ static char * get_first_encoded P_((struct string *value));
+ static char * get_first_encoded(value)
+ struct string *value;
+ {
+ const char *cs;
+ const char *lang;
+ char *ret;
+ char *tmp;
+
+ if (value->string_type == RAW_BUFFER) /* charset is not relevant to parameter value! */
+ cs = "";
+ else {
+ cs = get_string_MIME_name(value);
+
+ if (!cs || NULL != strpbrk(cs," \t\r\n()\"?*'="))
+ cs = "UNKNOWN-8BIT";
+ }
+
+ lang = get_string_lang(value);
+
+ if (!lang || NULL != strpbrk(lang," \t\r\n()\"?*'="))
+ lang = "";
+
+ tmp = get_encoded(value);
+
+ ret = elm_message(FRM("%s'%s'%s"),cs,lang,tmp);
+
+ free(tmp);
+
+ return ret;
+ }
+
+ static void gen_string_param P_((struct mime_param *P, char *name,
+ struct string *value));
+ static void gen_string_param(P,name,value)
+ struct mime_param *P;
+ char *name;
+ struct string * value;
+ {
+ struct mp_pair * mp = add_mp_pair(P);
+
+ mp->raw_param = elm_message(FRM("%s*"),name);
+ mp->raw_value = get_first_encoded(value);
+
+ DPRINT(Debug,9,(&Debug,
+ "gen_string_param: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+ }
+
+ #define STRING_SPLIT_LEN 15
+
+ static void gen_splitted_string_param P_((struct mime_param *P, char *name,
+ struct string *value));
+ static void gen_splitted_string_param(P,name,value)
+ struct mime_param *P;
+ char *name;
+ struct string * value;
+ {
+ int len = string_len(value);


+ int pos = 0;

+ struct string *buffer;


+ int counter = 0;

+ struct mp_pair * mp = add_mp_pair(P);
+
+ buffer = clip_from_string(value,&pos,STRING_SPLIT_LEN);
+
+ mp->raw_param = elm_message(FRM("%s*%d*"),name,counter++);
+ mp->raw_value = get_first_encoded(buffer);
+
+ DPRINT(Debug,9,(&Debug,
+ "gen_splitted_string_param: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+
+ free_string(&buffer);
+
+ while (pos < len) {
+ buffer = clip_from_string(value,&pos,STRING_SPLIT_LEN);
+
+ mp = add_mp_pair(P);
+ mp->raw_param = elm_message(FRM("%s*%d*"),name,counter++);
+ mp->raw_value = get_encoded(buffer);
+
+ DPRINT(Debug,9,(&Debug,
+ "gen_splitted_string_param: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+
+ free_string(&buffer);
+ }
+ }
+
+ static char *us2s P_((unsigned char *str));
+ static char *us2s(str)
+ unsigned char *str;
+ {
+ return (char *)str;
+ }
+
+
+ static void parse_rest P_((struct mime_param *P, struct string_token *X,
+ int gen_compat_len,
+ int plain_mode));
+ static void parse_rest(P,X, gen_compat_len,plain_mode)
+ struct mime_param *P;
+ struct string_token *X;
+ int gen_compat_len;
+ int plain_mode;
+ {
+
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+
+ int i = 0;
+
+ struct string_pair * tmp_list = NULL;
+
+ int tmp_list_len = 0;
+
+ struct ascii_pair * a_list = NULL;
+ int a_list_len = 0;
+
+ struct mp_pair * mp_list = NULL;
+ int mp_list_len = 0;
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"parse_rest",
+ "US-ASCII not found");
+
+ while (X[i].token) {
+
+ struct string * name = NULL;
+ struct string *Y = NULL;
+ char * ascname = NULL;
+ const char *lang = NULL;
+
+ while (X[i].token &&
+ ( 0x0020 /* SPACE */ == X[i].special ||
+ 0x0028 /* ( */ == X[i].special)
+ ) {
+ i++;
+ }
+
+ if (! X[i].token)
+ break;
+
+ if (0 == X[i].special)
+ name = X[i].token;
+ else {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorNameExpected,
+ "Parse error on %S -- name expected"),
+ X[i].token);
+ goto recover;
+ }
+
+ if (!can_ascii_string(X[i].token))
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeAsciiRequiredTok,
+ "Ascii required for token %S"),
+ X[i].token);
+
+ i++;
+ while (X[i].token && ( 0x0020 /* SPACE */ == X[i].special ||
+ 0x0028 /* ( */ == X[i].special
+ )
+ ) {
+ i++;
+ }
+
+ if (! X[i].token) {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorEqualExpectedEOS,
+ "Parse error on end of string -- = expected"));
+ break;
+
+ }
+
+ if (0x003D /* = */ != X[i].special) {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorEqualExpected,
+ "Parse error on %S -- = expected"),
+ X[i].token);
+ goto recover;
+ }
+
+ i++;
+ while (X[i].token && (
+ 0x0020 /* SPACE */ == X[i].special ||
+ 0x0028 /* ( */ == X[i].special
+ )
+ ) {
+ i++;
+ }
+
+ if (! X[i].token) {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorValueExpectedEOS,
+ "Parse error on end of string -- value of param expected"));
+ break;
+
+ }
+
+ if (0x003B /* ';' */ == X[i].special) {
+
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorValueExpected,
+ "Parse error on %S -- value of param expected"),
+ X[i].token);


+ continue;
+ }
+
+

+ Y = convert_string(ascii_ptr,name,0);
+ ascname = us2s(stream_from_string(Y,0,NULL));
+ free_string(&Y);
+
+ if (NULL != strchr(ascname,'*')) {
+ struct mp_pair *mp = add_mp_pair_1(&mp_list,&mp_list_len);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: %s: String as raw parameter: %S\n",
+ ascname,X[i].token));
+
+ if (!can_ascii_string(X[i].token))
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeAsciiRequiredTok,
+ "Ascii required for token %S"),
+ X[i].token);
+
+ Y = convert_string(ascii_ptr,X[i].token,0);
+
+ mp->raw_param = ascname;
+ mp->raw_value = us2s(stream_from_string(Y,0,NULL));
+ free_string(&Y);
+
+ } else {
+ struct string * value1 = NULL;
+ struct string * value0 = NULL;
+
+ if (0x0022 /* " */ == X[i].special)
+ value1 = unquote_string(X[i].token);
+ else
+ value1 = dup_string(X[i].token);
+
+ value0 = value1; /* synonym */
+
+ if (plain_mode) {
+
+ struct ascii_pair *A = NULL;
+ struct string *Y;
+
+ if (!can_ascii_string(value1))
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeAsciiRequiredTok,
+ "Ascii required for token %S"),
+ value1);
+
+ Y = convert_string(ascii_ptr,value1,0);
+
+
+ A = add_ascii_pair_1(&a_list,&a_list_len);
+
+ A->param = ascname;
+ A->value = us2s(stream_from_string(Y,0,NULL));
+ A->is_compat = 1;
+
+ free_string(& Y);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [compat] %s=%s\n",
+ A->param,
+ A->value));
+
+ } else {
+
+ /* Ascii version ... */
+
+ lang = get_string_lang(value1);
+
+ if (plain_mode || (
+ !lang &&
+ can_ascii_string(value1) &&
+ !string_is_ascii_control(value1)
+ )
+ ) {
+ struct ascii_pair *A = NULL;
+
+ struct string *Y = convert_string(ascii_ptr,value1,0);
+ /* Is really ascii */
+
+ A = add_ascii_pair_1(&a_list,&a_list_len);
+
+ A->param = safe_strdup(ascname);
+ A->value = us2s(stream_from_string(Y,0,NULL));
+
+ A->is_compat = string_len(Y) < gen_compat_len;
+
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [%s] %s=%s\n",
+ A->is_compat ? "compat" : "ascii",
+ A->param,
+ A->value));
+
+ if (!A->is_compat)
+ goto gencompat;
+
+ } else {
+
+ const struct string * Y1;
+ const char * Y2;
+
+ {
+ struct string_pair *S = NULL;
+
+ S = add_string_pair_1(&tmp_list,&tmp_list_len);
+ S->param = ascname;
+ S->value = value1;
+
+ value1 = NULL;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [string] %s=%S\n",
+ S->param,
+ S->value));
+ }
+
+ gencompat:
+
+ Y1 = get_mime_param(P,ascname);
+ Y2 = find_ascii_param(P,ascname,1);
+
+ if (Y1 && 0 == string_cmp(Y1,value0,999) &&
+ Y2) {
+ /* Preserve existing compat parameter */
+
+ struct ascii_pair *A = NULL;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: %s: Preserving existing compat parameter: %s\n",
+ ascname,Y2));
+
+ A = add_ascii_pair_1(&a_list,&a_list_len);
+ A->param = safe_strdup(ascname);
+ A->value = safe_strdup(Y2);
+ A->is_compat = 1;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [compat] %s=%s\n",
+ A->param,
+ A->value));
+
+
+ } else {
+
+ if (Y1) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: old string param was: %S\n",
+ Y1));
+ }
+ if (Y2) {
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: old compat param was: %s\n",
+ Y2));
+ }
+
+ if (gen_compat_len) {
+
+ struct ascii_pair *A = NULL;
+ struct string *Y = convert_string(ascii_ptr,value0,0);


+ int pos = 0;
+

+ A = add_ascii_pair_1(&a_list,&a_list_len);
+ A->param = safe_strdup(ascname);
+ A->value = us2s(streamclip_from_string(Y,&pos,gen_compat_len,NULL,NULL));
+ A->is_compat = 1;
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: [compat] %s=%s\n",
+ A->param,
+ A->value));
+ }
+ }
+ }
+
+ if (value1)
+ free_string(& value1);
+ }
+ }
+
+ i++;
+ while (X[i].token && (
+ 0x0020 /* SPACE */ == X[i].special ||
+ 0x0028 /* ( */ == X[i].special
+ )
+ ) {
+ i++;
+ }
+
+ if (X[i].token &&
+ 0x003B /* ';' */ != X[i].special) {
+
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorSemicolonExpected,
+ "Parse error on %S -- ; or end of string expected"),
+ X[i].token);
+
+ /* syncronize */
+ recover:
+ while (X[i].token &&
+ 0x003B /* ';' */ != X[i].special )
+ i++;
+
+ }
+
+ if (X[i].token &&
+ 0x003B /* ';' */ == X[i].special)
+ i++;
+
+ }
+
+ if (X[i].token)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeParseErrorFailed,
+ "Parse error on %S -- failed to parse parameters"),
+ X[i].token);
+
+
+ free_parsed(P);
+
+ P->string_params = tmp_list;
+ P->string_param_count = tmp_list_len;
+
+ P->ascii_params = a_list;
+ P->ascii_param_count = a_list_len;
+
+ free_raw(P);
+
+ P->params = mp_list;
+ P->param_count = mp_list_len;
+
+ for (i = 0; i < a_list_len; i++) {
+ if (a_list[i].is_compat) {
+ struct mp_pair * mp = add_mp_pair(P);
+
+ mp->raw_param = safe_strdup(a_list[i].param);
+ if (ascii_need_quote(a_list[i].value))
+ mp->raw_value = elm_message(FRM("%Q"),a_list[i].value);
+ else
+ mp->raw_value = safe_strdup(a_list[i].value);
+
+ DPRINT(Debug,9,(&Debug,
+ "parse_rest: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+
+ } else {
+ gen_splitted_ascii_param(P,a_list[i].param,a_list[i].value);
+ }
+ }
+
+ for (i = 0; i < tmp_list_len; i++) {
+ /* If there exists ascii -- non-compat version of same
+ parameter, do not add this ...
+ */
+
+ if (find_ascii_param(P,tmp_list[i].param,0))
+ continue;
+
+ if (string_len(tmp_list[i].value) > STRING_SPLIT_LEN)
+ gen_splitted_string_param(P,tmp_list[i].param,tmp_list[i].value);
+ else
+ gen_string_param(P,tmp_list[i].param,tmp_list[i].value);
+ }
+ }
+
+ struct mime_param * parse_mime_param_string(value, gen_compat_len,
+ plain_mode)
+ struct string * value;
+ int gen_compat_len;
+ int plain_mode;
+ {
+ struct mime_param *P = alloc_mime_param();
+
+ struct string_token *X = string_tokenize(value,TOK_mime);
+
+ P->def = value->string_type;
+
+ if (X) {
+ parse_rest(P,X,gen_compat_len, plain_mode);
+
+ free_string_tokenized(&X);
+ }
+
+ return P;
+ }
+
+ char ** split_mime_params(P,in_buffer,gen_compat_len,plain_mode)
+ struct mime_param **P;
+ struct string *in_buffer;
+ int gen_compat_len;
+ int plain_mode;
+ {
+ char **ret = NULL;
+ struct string_token *X;
+ int i,count = 0;
+
+
+ if (!*P)
+ *P = alloc_mime_param();
+
+ if (MIME_PARAM_magic != (*P)->magic)
+ mime_panic(__FILE__,__LINE__,"split_mime_params",
+ "Bad magic number");
+
+
+
+ X = string_tokenize(in_buffer,TOK_mime);
+ if (!X)
+ return NULL;
+
+ for (i=0; X[i].token; i++) {
+ if (0x003B /* ';' */ == X[i].special)
+ break;
+ count++;
+ }
+
+ if (count) {
+ int j;
+ int k = 0;
+
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"split_mime_params",
+ "US-ASCII not found");
+
+ ret = safe_malloc((count+1) * sizeof(ret[0]));
+
+ for (j = 0; j < count; j++) {
+ struct string *Y;
+
+ if (0x0020 /* SPACE */ == X[j].special)
+ continue;
+
+ /* Skips comment */
+ if (0x0028 /* ( */ == X[j].special)
+ continue;
+
+ if (!can_ascii_string(X[j].token))
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeAsciiRequiredTok,
+ "Ascii required for token %S"),
+ X[j].token);
+
+ Y = convert_string(ascii_ptr,X[j].token,0);
+
+ ret[k] = us2s(stream_from_string(Y,0,NULL));
+
+ DPRINT(Debug,9,(&Debug,
+ "split_mime_params: ret[%d]=%s\n",
+ k,ret[k]));
+
+ k++;
+
+ free_string(&Y);
+ }
+
+ ret[k] = NULL;
+ }
+
+
+ if (0x003B /* ';' */ == X[i].special) {
+
+ i++;
+
+ parse_rest(*P,X+i,gen_compat_len, plain_mode);
+
+ } else {
+
+ DPRINT(Debug,9,(&Debug,
+ "split_mime_params: Removing all parameters\n"));
+
+ free_raw(*P);
+ free_parsed(*P);
+ }
+
+ free_string_tokenized(&X);


+ return ret;
+ }
+

+ void mime_params_add_compat(P,name,value)
+ struct mime_param **P;
+ char *name;
+ char *value;
+ {
+ struct ascii_pair *A = NULL;
+ struct mp_pair * mp = NULL;
+
+ if (!*P)
+ *P = alloc_mime_param();
+
+ if (MIME_PARAM_magic != (*P)->magic)
+ mime_panic(__FILE__,__LINE__,"mime_params_add_compat",
+ "Bad magic number");
+
+ A = add_ascii_pair(*P);
+
+ A->param = safe_strdup(name);
+ A->value = safe_strdup(value);
+ A->is_compat = 1;
+
+ DPRINT(Debug,9,(&Debug,
+ "mime_params_add_compat: [compat] %s=%s\n",
+ A->param,A->value));
+
+ mp = add_mp_pair(*P);
+ mp->raw_param = safe_strdup(name);
+
+ if (ascii_need_quote(value))
+ mp->raw_value = elm_message(FRM("%Q"),value);
+ else
+ mp->raw_value = safe_strdup(value);
+
+ DPRINT(Debug,9,(&Debug,
+ "mime_params_add_compat: *** %s=%s\n",
+ mp->raw_param,mp->raw_value));
+
+ }
+
+ void mime_params_add(P,name,value)
+ struct mime_param **P;
+ char *name;
+ struct string *value;
+ {
+ struct string_pair *S = NULL;
+ const char *lang;
+
+ charset_t ascii_ptr = MIME_name_to_charset("US-ASCII",0);
+
+ if (!*P)
+ *P = alloc_mime_param();
+
+ if (MIME_PARAM_magic != (*P)->magic)
+ mime_panic(__FILE__,__LINE__,"mime_params_add",
+ "Bad magic number");
+
+ if (!ascii_ptr)
+ mime_panic(__FILE__,__LINE__,"mime_params_add",
+ "US-ASCII not found");
+
+ S = add_string_pair(*P);
+
+ S->param = safe_strdup(name);
+ S->value = dup_string(value);
+
+ DPRINT(Debug,9,(&Debug,
+ "mime_params_add: [string] %s=%S\n",
+ S->param,S->value));
+
+ /* Compat parameter is not generated -- it is asusmed that
+ caller calls mime_params_add_compat instead ...
+ */
+
+ lang = get_string_lang(value);
+
+ if (!lang && can_ascii_string(value) &&
+ !string_is_ascii_control(value)) {
+
+ struct ascii_pair *A = NULL;
+
+ struct string *Y = convert_string(ascii_ptr,value,0);
+ /* Is really ascii */
+
+ A = add_ascii_pair(*P);
+
+ A->param = safe_strdup(name);
+ A->value = us2s(stream_from_string(Y,0,NULL));
+ A->is_compat = 0;
+
+
+ DPRINT(Debug,9,(&Debug,
+ "mime_params_add: [ascii] %s=%s\n",
+ A->param,A->value));
+
+ gen_splitted_ascii_param(*P,A->param,A->value);
+ } else {
+ if (string_len(S->value) > STRING_SPLIT_LEN)
+ gen_splitted_string_param(*P,S->param,S->value);
+ else
+ gen_string_param(*P,S->param,S->value);


+
+ }
+ }
+
+

+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/melib/mime_parse.c
*** elmME+.2.5.alpha4/melib/mime_parse.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha5-cvs/melib/mime_parse.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.45.8.1 2004/07/03 15:23:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_parse.c,v 1.45.8.4 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.45.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 43,69 ****

if (mt->description)
free_string (&(mt->description));
! if (mt->type_opts)
! free (mt->type_opts);
! mt->type_opts = NULL;
! if (mt->disposition_opts)
! free (mt->disposition_opts);
! mt->disposition_opts = NULL;

! if (mt->pathname) {
if (mt->unlink) {
DPRINT(Debug,15,(&Debug,
"mime_t_clear: %s marked for unlink\n",
! mt->pathname));

! if (0 == unlink(mt->pathname)) {
DPRINT(Debug,14,(&Debug,
"mime_t_clear: %s unlinked\n",
! mt->pathname));
}
}

! free (mt->pathname);

} else {
if (mt->unlink) {
--- 43,67 ----

if (mt->description)
free_string (&(mt->description));
! if (mt->TYPE_opts)
! free_mime_param (&(mt->TYPE_opts));
! if (mt->DISPOSITION_opts)
! free_mime_param (&(mt->DISPOSITION_opts));

! if (mt->pathname0) {
if (mt->unlink) {
DPRINT(Debug,15,(&Debug,
"mime_t_clear: %s marked for unlink\n",
! mt->pathname0));

! if (0 == unlink(mt->pathname0)) {
DPRINT(Debug,14,(&Debug,
"mime_t_clear: %s unlinked\n",
! mt->pathname0));
}
}

! free (mt->pathname0);

} else {
if (mt->unlink) {
***************
*** 72,79 ****
}
}

! mt->pathname = NULL;
!
mt->unlink = 0;

if (mt->dispname)
--- 70,76 ----
}
}

! mt->pathname0 = NULL;
mt->unlink = 0;

if (mt->dispname)
***************
*** 84,93 ****
return;
}

! void
! mime_get_disposition (str, mt)
char *str;
mime_t *mt;
{
char *c, tmp[VERY_LONG_STRING];

--- 81,90 ----
return;
}

! void mime_get_disposition (str, mt, def_charset)
char *str;
mime_t *mt;
+ charset_t def_charset;
{
char *c, tmp[VERY_LONG_STRING];

***************
*** 102,107 ****
--- 99,108 ----
strfcpy (tmp, str, sizeof(tmp));

rfc822_reap_comments (tmp, NULL, 0);
+
+ if (mt->DISPOSITION_opts) {
+ free_mime_param(&(mt->DISPOSITION_opts));
+ }

/* Look for the options field */
if ((c = strchr (tmp, ';')) != NULL) {
***************
*** 112,128 ****
c++;
while (*c && whitespace(*c))
c++;
! mt->disposition_opts = strmcpy (mt->disposition_opts, c);
}
else {
char *d = tmp + strlen(tmp);
while (d > tmp && whitespace(*(d-1)))
d--;
*d = '\0';
- if (mt->disposition_opts) {
- free (mt->disposition_opts);
- mt->disposition_opts = NULL;
- }
}

/* All that's left now is the main disposition */
--- 113,127 ----
c++;
while (*c && whitespace(*c))
c++;
! mt->DISPOSITION_opts = parse_mime_param("Content-Disposition",
! c, def_charset);
!
}
else {
char *d = tmp + strlen(tmp);
while (d > tmp && whitespace(*(d-1)))
d--;
*d = '\0';
}

/* All that's left now is the main disposition */
***************
*** 141,156 ****
mt->disposition = DISP_INLINE;

DPRINT(Debug,9,(&Debug,
! "mime_get_disposition(): disposition=\"%s\" (%d), disposition_opts=\"%s\"\n",
DISPOSITION(mt->disposition),
! mt->disposition,
! NONULL(mt->disposition_opts)));
}

! void
! mime_get_content (str, mt)
char *str;
mime_t *mt;
{
char *c, tmp[VERY_LONG_STRING];

--- 140,154 ----
mt->disposition = DISP_INLINE;

DPRINT(Debug,9,(&Debug,
! "mime_get_disposition(): disposition=\"%s\" (%d)\n",
DISPOSITION(mt->disposition),
! mt->disposition));
}

! void mime_get_content (str, mt, def_charset)
char *str;
mime_t *mt;
+ charset_t def_charset;
{
char *c, tmp[VERY_LONG_STRING];

***************
*** 168,173 ****
--- 166,176 ----

rfc822_reap_comments (tmp, NULL, 0);

+ if (mt->TYPE_opts) {
+ free_mime_param(&(mt->TYPE_opts));
+ }
+
+
/* Look for the options field */
if ((c = strchr (tmp, ';')) != NULL) {
char *d = c;
***************
*** 177,193 ****
c++;
while (*c && whitespace(*c))
c++;
! mt->type_opts = strmcpy (mt->type_opts, c);
}
else {
char *d = tmp + strlen(tmp);
while (d > tmp && whitespace(*(d-1)))
d--;
*d = '\0';
- if (mt->type_opts) {
- free (mt->type_opts);
- mt->type_opts = NULL;
- }
}

/* Get the subtype */
--- 180,194 ----
c++;
while (*c && whitespace(*c))
c++;
! mt->TYPE_opts = parse_mime_param("Content-Type",
! c, def_charset);
!
}
else {
char *d = tmp + strlen(tmp);
while (d > tmp && whitespace(*(d-1)))
d--;
*d = '\0';
}

/* Get the subtype */
***************
*** 217,249 ****
}

DPRINT(Debug,9,(&Debug,
! "mime_get_content(): %p -- type=\"%s\", subtype=\"%s\", opts=\"%s\"\n",
mt->TYPE,
get_major_type_name(mt->TYPE),
! get_subtype_name(mt->TYPE),
! NONULL(mt->type_opts)));

return;
}

! int mime_get_boundary (boundary, opts, size)
! char *opts, *boundary;
! int size;
{
! if (!mime_get_param ("boundary", boundary, opts, size)) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseNoBoundary,
! "'boundary' paramater is missing from Multipart -type!"));
! return 0;
! }

! return 1;
}


int mime_get_charset (charset_value, opts, display_charset,
default_content_charset)
charset_t *charset_value;
! CONST char *opts;
charset_t * display_charset; /* vector */
charset_t default_content_charset;
{
--- 218,253 ----
}

DPRINT(Debug,9,(&Debug,
! "mime_get_content(): %p -- type=\"%s\", subtype=\"%s\"\n",
mt->TYPE,
get_major_type_name(mt->TYPE),
! get_subtype_name(mt->TYPE)));
!

return;
}

! const char* mime_get_boundary (opts)
! struct mime_param *opts;
{
!
! const char * pv = get_mime_param_compat(opts,"boundary");
!
!
! if (!pv)
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseNoBoundary,
! "'boundary' parameter is missing from Multipart -type!"));

!
!
! return pv;
}


int mime_get_charset (charset_value, opts, display_charset,
default_content_charset)
charset_t *charset_value;
! struct mime_param *opts;
charset_t * display_charset; /* vector */
charset_t default_content_charset;
{
***************
*** 253,261 ****
without loss
*/
int ret = 0,j;
! char buffer[80];

! if (!mime_get_param("charset",buffer,opts,sizeof buffer)) {
if (default_content_charset &&
default_content_charset->MIME_name) {
DPRINT(Debug,9,(&Debug,
--- 257,268 ----
without loss
*/
int ret = 0,j;
! const char *pv;

! pv = get_mime_param_compat(opts,"charset");
!
!
! if (!pv) {
if (default_content_charset &&
default_content_charset->MIME_name) {
DPRINT(Debug,9,(&Debug,
***************
*** 265,289 ****
*charset_value = default_content_charset;

/* Charset name is also required on some confitions later */
! strfcpy(buffer,default_content_charset->MIME_name, sizeof buffer);

} else {

! strfcpy(buffer,"US-ASCII", sizeof buffer);
/* Default charset if nothing specified */

! *charset_value = MIME_name_to_charset(buffer,CHARSET_create);
}
} else
! *charset_value = MIME_name_to_charset(buffer,CHARSET_create);

- if (!opts) {
- DPRINT(Debug,9,(&Debug,
- "mime_get_charset: opts=NULL\n"));
- } else {
- DPRINT(Debug,9,(&Debug,
- "mime_get_charset: opts=\"%s\"\n",opts));
- }
DPRINT(Debug,9,(&Debug,
" : charset_value=%p '%s' (type=%p)\n",
*charset_value,
--- 272,289 ----
*charset_value = default_content_charset;

/* Charset name is also required on some confitions later */
! pv = default_content_charset->MIME_name;

} else {

! pv = "US-ASCII";
/* Default charset if nothing specified */

! *charset_value = MIME_name_to_charset(pv,CHARSET_create);
}
} else
! *charset_value = MIME_name_to_charset(pv,CHARSET_create);

DPRINT(Debug,9,(&Debug,
" : charset_value=%p '%s' (type=%p)\n",
*charset_value,
***************
*** 306,319 ****
/* Accept also charsets with same name although
charset is redefined
*/
! display_charset[j]->MIME_name &&
! 0 == istrcmp(buffer,display_charset[j]->MIME_name)) {
ret = 2; /* If display charset */
break;
} else if (charset_superset_of(display_charset[j],*charset_value)) {
ret = 2; /* if charset is subset of display */
break;
! } else if (0 == istrcmp(buffer,"US-ASCII") &&
charset_ok_p(display_charset[j])) {
ret = 2; /* If display_charset can show us-ascii? */
break;
--- 306,321 ----
/* Accept also charsets with same name although
charset is redefined
*/
! (
! display_charset[j]->MIME_name &&
! 0 == istrcmp(pv,display_charset[j]->MIME_name)
! )) {
ret = 2; /* If display charset */
break;
} else if (charset_superset_of(display_charset[j],*charset_value)) {
ret = 2; /* if charset is subset of display */
break;
! } else if (0 == istrcmp(pv,"US-ASCII") &&
charset_ok_p(display_charset[j])) {
ret = 2; /* If display_charset can show us-ascii? */
break;
***************
*** 362,369 ****
ptr->parser_data = NULL;
ptr->handler_data = NULL;

! ptr->type_opts = ptr->disposition_opts =
! ptr->pathname = NULL;
ptr->dispname = NULL;
ptr->description = NULL;

--- 364,371 ----
ptr->parser_data = NULL;
ptr->handler_data = NULL;

! ptr->TYPE_opts = ptr->DISPOSITION_opts = NULL;
! ptr->pathname0 = NULL;
ptr->dispname = NULL;
ptr->description = NULL;

***************
*** 427,439 ****
trg->description = dup_string(src->description);
}

! if (src->type_opts) {
! trg->type_opts = strmcpy(trg->type_opts, src->type_opts);
}

! if (src->disposition_opts) {
! trg->disposition_opts = strmcpy(trg->disposition_opts,
! src->disposition_opts);
}

DPRINT(Debug,15,(&Debug,
--- 429,440 ----
trg->description = dup_string(src->description);
}

! if (src->TYPE_opts) {
! trg->TYPE_opts = copy_mime_param(src->TYPE_opts);
}

! if (src->DISPOSITION_opts) {
! trg->DISPOSITION_opts = copy_mime_param(src->DISPOSITION_opts);
}

DPRINT(Debug,15,(&Debug,
***************
*** 497,503 ****
if (NULL != (this_header =
locate_header_by_name(headers,"Content-Type")) &&
NULL != this_header->body) {
! mime_get_content (this_header->body, ptr);
if (this_header->next_this_header &&
show_header_errors) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseErrorContent,
--- 498,506 ----
if (NULL != (this_header =
locate_header_by_name(headers,"Content-Type")) &&
NULL != this_header->body) {
!
! mime_get_content (this_header->body, ptr, hdr_charset);
!
if (this_header->next_this_header &&
show_header_errors) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseErrorContent,
***************
*** 511,517 ****
if (NULL != (this_header =
locate_header_by_name(headers,"Content-Disposition")) &&
NULL != this_header->body) {
! mime_get_disposition (this_header->body, ptr);
if (this_header->next_this_header &&
show_header_errors) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseErrorDisposition,
--- 514,522 ----
if (NULL != (this_header =
locate_header_by_name(headers,"Content-Disposition")) &&
NULL != this_header->body) {
!
! mime_get_disposition (this_header->body, ptr, hdr_charset);
!
if (this_header->next_this_header &&
show_header_errors) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParseErrorDisposition,
***************
*** 578,593 ****
DPRINT(Debug,9,(&Debug,
"parse_mime_headers1: 'Not plain'\n"));
if (no_content_disposition) {
DPRINT(Debug,9,(&Debug,
" : no content-disposition -- auto-attachment = %d\n",
! auto_attachment));
! if (get_major_type_code(ptr->TYPE) == MIME_TYPE_APPLICATION &&
! auto_attachment >= 1 ||
!
! get_major_type_code(ptr->TYPE) != MIME_TYPE_TEXT &&
! !(get_type_flags(ptr->TYPE) & MIME_RFC822) &&
! get_major_type_code(ptr->TYPE) != MIME_TYPE_MULTIPART &&
! auto_attachment >= 2) {
DPRINT(Debug,9,(&Debug,
" : Set disposition = auto attachment\n"));
ptr->disposition = DISP_AUTOATTACH;
--- 583,602 ----
DPRINT(Debug,9,(&Debug,
"parse_mime_headers1: 'Not plain'\n"));
if (no_content_disposition) {
+ int aa = give_dt_enumerate_as_int(&auto_attachment);
+
DPRINT(Debug,9,(&Debug,
" : no content-disposition -- auto-attachment = %d\n",
! aa));
! if (( get_major_type_code(ptr->TYPE) == MIME_TYPE_APPLICATION &&
! aa >= 1)
! ||
! (
! get_major_type_code(ptr->TYPE) != MIME_TYPE_TEXT &&
! !(get_type_flags(ptr->TYPE) & MIME_RFC822) &&
! get_major_type_code(ptr->TYPE) != MIME_TYPE_MULTIPART &&
! aa >= 2)
! ) {
DPRINT(Debug,9,(&Debug,
" : Set disposition = auto attachment\n"));
ptr->disposition = DISP_AUTOATTACH;
***************
*** 747,753 ****
NOTPLAIN_is_fallback, that may be set on hdr->mime_rec.mime_flags
*/

! if (! (tmp & NOTPLAIN_need_metamail)) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParsingMimeNoMetamail,
"Parsing MIME structure... metamail not needed"));
}
--- 756,763 ----
NOTPLAIN_is_fallback, that may be set on hdr->mime_rec.mime_flags
*/

! if (! (tmp & NOTPLAIN_need_metamail) &&
! ! prompt_metamail) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeParsingMimeNoMetamail,
"Parsing MIME structure... metamail not needed"));
}
Index: elmME+.2.5.alpha5-cvs/melib/mpar_multipart.c
*** elmME+.2.5.alpha4/melib/mpar_multipart.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/melib/mpar_multipart.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mpar_multipart.c,v 1.9 2004/03/27 18:31:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mpar_multipart.c,v 1.9.8.2 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 89,104 ****
{
int ret = 1; /* Always succeed ... */

! int have_boundary;
! char boundary[STRING];
int opts;
int i;

! int blen, len,last_pos;
long end_offset, debug_pos;
char buf[VERY_LONG_STRING];
char quess_boundary[STRING];
!
if (D->p.multipart->magic != MPAR_multipart_magic)
panic("MIME PARSER PANIC",__FILE__,__LINE__,"mpar_multipart_parse",
"Bad magic number",0);
--- 89,104 ----
{
int ret = 1; /* Always succeed ... */

! const char *boundary = NULL;
int opts;
int i;

! int blen = 0, len,last_pos;
long end_offset, debug_pos;
char buf[VERY_LONG_STRING];
char quess_boundary[STRING];
! int ambiguous = 0;
!
if (D->p.multipart->magic != MPAR_multipart_magic)
panic("MIME PARSER PANIC",__FILE__,__LINE__,"mpar_multipart_parse",


"Bad magic number",0);
***************

*** 113,128 ****

fseek (fp, s->offset, SEEK_SET);

! have_boundary = mime_get_boundary (boundary, s->type_opts,
! sizeof (boundary));

opts = get_type_flags(s->TYPE);

DPRINT(Debug,9,(&Debug,
"mpar_multipart_parse- --> length=%d, boundary=%s\n",
! s->length, boundary));

! blen = strlen (boundary);
end_offset = ftell (fp) + s->length;
last_pos = ftell(fp);

--- 113,129 ----

fseek (fp, s->offset, SEEK_SET);

! boundary = mime_get_boundary (s->TYPE_opts);

opts = get_type_flags(s->TYPE);

DPRINT(Debug,9,(&Debug,
"mpar_multipart_parse- --> length=%d, boundary=%s\n",
! s->length,
! boundary ? boundary : "<NONE>"));

! if (boundary)
! blen = strlen (boundary);
end_offset = ftell (fp) + s->length;
last_pos = ftell(fp);

***************
*** 136,149 ****


if (buf[0] == '-' && buf[1] == '-' &&
! strncmp (buf + 2, boundary, blen) == 0) {

header_list_ptr headers = NULL;
long part_offset;
long body_offset;

/* If we matched to null boundary */
! if (!have_boundary && len > 3) {
int x;
strnfcpy(quess_boundary,buf+2,len-2,sizeof quess_boundary,
&x);
--- 137,151 ----


if (buf[0] == '-' && buf[1] == '-' &&
! (!boundary ||
! strncmp (buf + 2, boundary, blen) == 0)) {

header_list_ptr headers = NULL;
long part_offset;
long body_offset;

/* If we matched to null boundary */
! if (!boundary && len > 3) {
int x;
strnfcpy(quess_boundary,buf+2,len-2,sizeof quess_boundary,
&x);
***************
*** 159,174 ****
"mpar_multipart_parse: Quessing boundary: %Q, len=%d\n",
quess_boundary,x));

! strfcpy(boundary,quess_boundary,sizeof boundary);
blen = x;
- have_boundary = 1;

lib_error(CATGETS(elm_msg_cat, MeSet,
MeParseQuessMultipart,
"Quessing multipart boundary"));

}
! }

/* Save the length of the previous part */
if (D->p.multipart->part_count > 0) {
--- 161,189 ----
"mpar_multipart_parse: Quessing boundary: %Q, len=%d\n",
quess_boundary,x));

! boundary = quess_boundary;
blen = x;

lib_error(CATGETS(elm_msg_cat, MeSet,
MeParseQuessMultipart,
"Quessing multipart boundary"));

}
!
! /* handle some ambiguous multipart boundary prefixes */
! } else if (len > blen+2 &&
! ' ' != buf[blen+2] &&
! '-' != buf[blen+2] &&
! '\t' != buf[blen+2] &&
! '\r' != buf[blen+2] &&
! '\n' != buf[blen+2]) {
!
! if (ambiguous++ == 0)
! lib_error(CATGETS(elm_msg_cat, MeSet,
! MeParseAmbiguousMultipart,
! "Ambiguous multipart boundary prefix"));
! goto noboundary;
! }

/* Save the length of the previous part */
if (D->p.multipart->part_count > 0) {
***************
*** 226,231 ****
--- 241,248 ----

}

+ noboundary: ;
+
{ /* mark position before CR LF */
int pos = ftell(fp);
if (len > 1 && buf[len-2] == '\r' && buf[len-1] == '\n')
Index: elmME+.2.5.alpha5-cvs/melib/mpar_rfc822.c
*** elmME+.2.5.alpha4/melib/mpar_rfc822.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/melib/mpar_rfc822.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mpar_rfc822.c,v 1.7 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: mpar_rfc822.c,v 1.7.8.1 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*
***************

*** 190,196 ****
static int mpar_rfc822_subparts(D)
struct mime_parser_data *D;
{
! return 1; /* CONSTANT */
}

S_(mpar_index mpar_rfc822_index)
--- 190,196 ----
static int mpar_rfc822_subparts(D)
struct mime_parser_data *D;
{
! return 1; /* constANT */
}

S_(mpar_index mpar_rfc822_index)
Index: elmME+.2.5.alpha5-cvs/melib/parse_util.c
*** elmME+.2.5.alpha4/melib/parse_util.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/melib/parse_util.c 2005-07-20 19:49:44.000000000 +0300
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: parse_util.c,v 1.24 2004/03/27 18:31:43 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: parse_util.c,v 1.24.8.1 2005/07/20 16:49:44 hurtta Exp $";


/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 22,35 ****
panic("HEADER PANIC",f,ln,pr,ms,0);
}

- static unsigned char * us_str P_((char *str));
- static unsigned char * us_str(str)
- char *str;
- {
- return (unsigned char *)str;
- }
-
-
long skip_envelope(hdr, fp)
struct header_rec *hdr;
FILE *fp;
--- 22,27 ----
***************
*** 154,175 ****
return 1;
}

- struct string * NULL_header_converter (hdr,demime,defcharset)
- header_list_ptr hdr;
- int demime;
- charset_t defcharset;
- {
- struct string * result = NULL;
-
- if (hdr -> magic != HEADER_magic)
- header_panic(__FILE__,__LINE__,
- "NULL_header_converter","Bad magic number");
-
-
- result = new_string2(defcharset,us_str(hdr->body));
-
- return result;
- }

void state_write_header(s,next,demime,defcharset)
out_state_t * s;
--- 146,151 ----
***************
*** 179,197 ****
{


struct string *buffer = NULL;

int X,L1;

DPRINT(Debug,13,(&Debug,
! "state_write_header: Writing header '%s': demime=%d defcharset=%s (charset filter=%s output charset=%s)",
give_header_name(next->header_name),
demime,
defcharset && defcharset -> MIME_name ?
defcharset -> MIME_name : "<not set>",
s -> filter && s -> filter -> MIME_name ?
! s -> filter -> MIME_name : "<not set>",
! s -> display_charset[0] &&
! s -> display_charset[0] -> MIME_name ?
! s -> display_charset[0] -> MIME_name :
! "<not set>"));

buffer = give_decoded_header(next,demime,defcharset);

--- 155,171 ----
{


struct string *buffer = NULL;

int X,L1;
+ charset_t Y;
+ int j;

DPRINT(Debug,13,(&Debug,
! "state_write_header: Writing header '%s': demime=%d defcharset=%s (charset filter=%s)",
give_header_name(next->header_name),
demime,
defcharset && defcharset -> MIME_name ?
defcharset -> MIME_name : "<not set>",
s -> filter && s -> filter -> MIME_name ?
! s -> filter -> MIME_name : "<not set>"));

buffer = give_decoded_header(next,demime,defcharset);

***************
*** 200,205 ****
--- 174,201 ----
buffer -> string_type -> MIME_name :
"<not set>"));

+ /* Use current header charset as filter .... */
+ Y = s->filter;
+
+ for (j = 0; s->display_charset[j]; j++) {
+
+ DPRINT(Debug,13,(&Debug,
+ " output charset [%d]: %s\n",
+ j,
+ s -> display_charset[j] -> MIME_name ?
+ s -> display_charset[j] -> MIME_name :
+ "<no MIME name>"));
+
+ if (match_charset_name(s->display_charset[j], buffer->string_type)) {
+ s->filter = buffer->string_type;
+
+ DPRINT(Debug,13,(&Debug,
+ "state_write_header: Setting charset filter to %s\n",
+ s -> filter -> MIME_name ?
+ s -> filter -> MIME_name : "<no MIME name>"));
+ }
+ }
+
state_add_prefix(s);
state_puts(give_header_name(next->header_name),s);
state_puts(": ",s);
***************
*** 231,237 ****
state_putc('\t',s);
}

! state_printf(s,FRM("%S\n"),data);
X++;

free_string(&data);
--- 227,234 ----
state_putc('\t',s);
}

! state_printf(s,FRM("%S"),data);
! state_putc('\n',s);
X++;

free_string(&data);
***************
*** 246,251 ****
--- 243,250 ----
state_nlputs("\n",s);
}
free_string(&buffer);
+
+ s->filter = Y;
}

void state_write_headers(s,hdr,filter,flag,demime,defcharset)
Index: elmME+.2.5.alpha5-cvs/melib/partial.c
*** elmME+.2.5.alpha4/melib/partial.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/melib/partial.c 2005-07-26 11:28:42.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.8 2004/03/27 18:31:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: partial.c,v 1.8.8.2 2005/07/26 08:28:42 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

*****************************************************************************/
***************
*** 38,46 ****
mime_t * reference;
{
int i;
! char id[100];
! char number[100];
! char total[100];

/* Already collected? */
for (i = 0; i < mss->partial_len; i++) {
--- 38,47 ----
mime_t * reference;
{
int i;
! const char *id;
! const char *number;
! const char *total;
!

/* Already collected? */
for (i = 0; i < mss->partial_len; i++) {
***************
*** 48,56 ****

return (& (mss->partial_vector[i] ));
}

! if (!mime_get_param ("id", id, reference->type_opts,
! sizeof id)) {

DPRINT(Debug,11,(&Debug,
"reg_partial: No id paramater -- corrupted.\n"));
--- 49,58 ----

return (& (mss->partial_vector[i] ));
}
+
+ id = get_mime_param_compat(reference->TYPE_opts,"id");

! if (!id) {

DPRINT(Debug,11,(&Debug,
"reg_partial: No id paramater -- corrupted.\n"));
***************
*** 58,66 ****
return NULL;
}

!
! if (!mime_get_param ("number", number, reference->type_opts,
! sizeof number)) {

DPRINT(Debug,11,(&Debug,
"reg_partial: No number paramater -- corrupted.\n"));
--- 60,67 ----
return NULL;
}

! number = get_mime_param_compat(reference->TYPE_opts,"number");
! if (!number) {

DPRINT(Debug,11,(&Debug,
"reg_partial: No number paramater -- corrupted.\n"));
***************
*** 77,87 ****
mss->partial_vector[mss->partial_len].number = atoi(number);
mss->partial_vector[mss->partial_len].total = -1;

! if (mime_get_param ("total", total, reference->type_opts,
! sizeof total)) {
!
! mss->partial_vector[mss->partial_len].total = atoi(total);
! }

return & (mss->partial_vector[mss->partial_len++]);
}
--- 78,86 ----
mss->partial_vector[mss->partial_len].number = atoi(number);
mss->partial_vector[mss->partial_len].total = -1;

! total = get_mime_param_compat(reference->TYPE_opts,"total");
! if (total)
! mss->partial_vector[mss->partial_len].total = atoi(total);

return & (mss->partial_vector[mss->partial_len++]);
}
***************
*** 96,108 ****
mime_t *p;
struct header_rec * hdr;
{
! char id[100];
! char number[100];

int ret = 0;

! if (!mime_get_param ("id", id, p->type_opts,
! sizeof id)) {

DPRINT(Debug,11,(&Debug,
"partial_selector: No id parameter -- corrupted.\n"));
--- 95,109 ----
mime_t *p;
struct header_rec * hdr;
{
! const char *id;
! const char *number;

int ret = 0;


+ int fh = give_dt_enumerate_as_int(&fragment_handling);

+
+ id = get_mime_param_compat(p->TYPE_opts,"id");

! if (!id) {

DPRINT(Debug,11,(&Debug,
"partial_selector: No id parameter -- corrupted.\n"));
***************
*** 110,117 ****
ret |= NOTPLAIN_need_metamail;
}

! if (!mime_get_param ("number", number, p->type_opts,
! sizeof number)) {

DPRINT(Debug,11,(&Debug,
"partial_selector: No number paremater -- corrupted.\n"));
--- 111,118 ----
ret |= NOTPLAIN_need_metamail;
}

! number = get_mime_param_compat(p->TYPE_opts,"number");
! if (!number) {

DPRINT(Debug,11,(&Debug,
"partial_selector: No number paremater -- corrupted.\n"));
***************
*** 123,129 ****


1 == manual,
2 == auto */

! if (0 == fragment_handling)
ret |= NOTPLAIN_need_metamail;

DPRINT(Debug,11,(&Debug,
--- 124,130 ----


1 == manual,
2 == auto */

! if (0 == fh)
ret |= NOTPLAIN_need_metamail;

DPRINT(Debug,11,(&Debug,
***************
*** 142,147 ****
--- 143,149 ----
struct header_rec *mss;
{
int print = 0;


+ int fh = give_dt_enumerate_as_int(&fragment_handling);

state_nlputs("\n[ ",s_out);

***************
*** 172,178 ****


1 == manual,
2 == auto */

! if (1 == fragment_handling && print &&
ptr == & mss->mime_rec && s_out->displaying)
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MeAssembleCommand,
--- 174,180 ----


1 == manual,
2 == auto */

! if (1 == fh && print &&
ptr == & mss->mime_rec && s_out->displaying)
state_printf(s_out,
CATGETS(elm_msg_cat, MeSet, MeAssembleCommand,

Kari E. Hurtta

unread,
Jul 28, 2005, 12:33:01 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.14

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 14/20 ) =========
Index: elmME+.2.5.alpha5-cvs/src/exitprog.c
*** elmME+.2.5.alpha4/src/exitprog.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/exitprog.c 2005-07-23 20:14:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: exitprog.c,v 1.12.8.2 2004/08/07 18:07:17 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: exitprog.c,v 1.12.8.3 2005/07/23 17:14:17 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 26,32 ****
any, and if the user say's it's ok)
**/

- char msg[SLEN];
int i, changes = 0;
int mc;
int LINES, COLUMNS;
--- 26,31 ----
Index: elmME+.2.5.alpha5-cvs/src/file.c
*** elmME+.2.5.alpha4/src/file.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/file.c 2005-07-23 20:14:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file.c,v 1.36.8.7 2004/10/09 12:26:48 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file.c,v 1.36.8.9 2005/07/23 17:14:17 hurtta Exp $";

/****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 42,48 ****
--- 42,50 ----

DEBUG_VAR(Debug,__FILE__,"mbox");

+ #ifndef errno


extern int errno;
+ #endif

static int save_message P_((int number,
struct folder_browser * XXX,
***************
*** 50,69 ****
WRITE_STATE ptr,
int pause, int appending,
int silently, int delete, int text_only,
- int *redraw,
struct MailboxView *mailbox,


struct AliasView *aview,
! int header_page));

struct string * prev_fold = NULL; /* name of previous folder */

! int save(silently, delete, text_only, mailbox, aview, header_page,
! page)
int silently, delete, text_only;


struct MailboxView *mailbox;
struct AliasView *aview;
- int header_page;

struct menu_context *page;
{
/** Save all tagged messages + current in a folder. If no messages
are tagged, save the current message instead! This routine
--- 52,72 ----
WRITE_STATE ptr,
int pause, int appending,
int silently, int delete, int text_only,


struct MailboxView *mailbox,
struct AliasView *aview,

! struct menu_context *header_area,
! struct menu_context *page));

struct string * prev_fold = NULL; /* name of previous folder */

! int save(silently, delete, text_only, mailbox, aview,
! page, prompt_area,header_area)
int silently, delete, text_only;


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
+ struct menu_context *prompt_area;
+ struct menu_context *header_area;
{
/** Save all tagged messages + current in a folder. If no messages
are tagged, save the current message instead! This routine
***************
*** 84,93 ****
is_ordinary_file, scount = 0;
int mesgnum = 0; /* message whose address is used for save-by-name fn */
int current_is_tagged = 0; /* is current message tagged? */
- char
- answer;

! int redraw = 0;
struct folder_browser * XXX;


struct string * buffer = NULL;

WRITE_STATE write_ptr = NULL;
--- 87,94 ----
is_ordinary_file, scount = 0;
int mesgnum = 0; /* message whose address is used for save-by-name fn */
int current_is_tagged = 0; /* is current message tagged? */



! int delay_redraw = 0;

struct folder_browser * XXX;


struct string * buffer = NULL;

WRITE_STATE write_ptr = NULL;
***************
*** 122,147 ****
/* XXXXX prompt? */

int ret;


! int LINES, COLUMNS;
!

! again:
! menu_get_sizes(page, &LINES, &COLUMNS);

! ret = prompt_letter(LINES-4,"",*def_ans_no,
PROMPT_yesno|PROMPT_redraw_mark|PROMPT_ctrlL|
PROMPT_cancel,
! page,
CATGETS(elm_msg_cat, ElmSet,
ElmSavecmdSaveMarked,
"Save marked messages? (%c/%c) "),


*def_ans_yes, *def_ans_no);

if (ret == ('L'&31) || REDRAW_MARK == ret) {

! redraw = 1;
! goto again;
}

if (TERMCH_interrupt_char == ret) {
return 0;
}
--- 123,159 ----
/* XXXXX prompt? */

int ret;


! int delay_redraw = 0;

! again0:

! ret = prompt_letter(0,"",*def_ans_no,
PROMPT_yesno|PROMPT_redraw_mark|PROMPT_ctrlL|
PROMPT_cancel,
! prompt_area,
CATGETS(elm_msg_cat, ElmSet,
ElmSavecmdSaveMarked,
"Save marked messages? (%c/%c) "),


*def_ans_yes, *def_ans_no);

if (ret == ('L'&31) || REDRAW_MARK == ret) {

!

! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(prompt_area);
!
! delay_redraw++; /* Can't trigger redraw yet... */
!
! goto again0;


}

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+
+

if (TERMCH_interrupt_char == ret) {
return 0;
}
***************
*** 171,185 ****

while (1) {
int code;
- int X,Y;
struct header_rec * mhdr = give_header(mailbox,mesgnum);

- int LINES, COLUMNS;
int r = 0;

- menu_get_sizes(page, &LINES, &COLUMNS);
-
-
if (!buffer && ( save_by_name || save_by_alias ) &&
mhdr && mhdr->from && mhdr->from[0].addr) {
char buffer1[1000];
--- 183,192 ----
***************
*** 200,246 ****
}

/* 2 == text_only -- Not envelope information */
if (text_only > 0) {
if (num_tagged == 1)
r = gen_browser(page,
! XXX,&buffer,&redraw,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveTextMesTo,
! "%s text of message to: "),
! (delete ? cap_save_word : cap_copy_word));
else
r = gen_browser(page,
! XXX,&buffer,&redraw,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveTextMessagesTo,
! "%s text messages to: "),
! (delete ? cap_save_word : cap_copy_word));
} else {
if (num_tagged == 1)
r = gen_browser(page,
! XXX,&buffer,&redraw,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveMessageTo,
! "%s message to: "),
! (delete ? cap_save_word : cap_copy_word));
else
r = gen_browser(page,
! XXX,&buffer,&redraw,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveMessagesTo,
! "%s messages to: "),
! (delete ? cap_save_word : cap_copy_word));
}

- GetXYLocation(&X,&Y);


if (!r) {
--- 207,258 ----
}

/* 2 == text_only -- Not envelope information */
+
+ /* XXX gen_browser do not take line !!!
+ FIXME
+ FIXME gen_browser should use prompt_area
+ */
+
if (text_only > 0) {
if (num_tagged == 1)
r = gen_browser(page,
! XXX,&buffer,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveTextMesTo,
! "%s text of message to: "),
! (delete ? cap_save_word : cap_copy_word));
else
r = gen_browser(page,
! XXX,&buffer,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveTextMessagesTo,
! "%s text messages to: "),
! (delete ? cap_save_word : cap_copy_word));
} else {
if (num_tagged == 1)
r = gen_browser(page,
! XXX,&buffer,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveMessageTo,
! "%s message to: "),
! (delete ? cap_save_word : cap_copy_word));
else
r = gen_browser(page,
! XXX,&buffer,
! delete ? word_save : word_copy,
! prev_fold,
! aview,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveMessagesTo,
! "%s messages to: "),
! (delete ? cap_save_word : cap_copy_word));
}



if (!r) {
***************
*** 288,314 ****
if (0 != (code & BROWSER_EXIST)) { /* already there!! */
appending = 1;
if (confirm_append || (confirm_files && is_ordinary_file)) {
! char * msg_buffer = NULL;

! if (is_ordinary_file)
! msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmConfirmFilesAppend,
! "Append to an existing file `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);
else
! msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmConfirmFolderAppend,


! "Append to mail folder `%s'? (%c/%c) "),

! buffer,
! *def_ans_yes,
! *def_ans_no);

- answer = want_to(msg_buffer, *def_ans_no, LINES-2, 1,
- page);

! free(msg_buffer);

if (answer != *def_ans_yes) {
continue; /* RETRY */
--- 300,350 ----
if (0 != (code & BROWSER_EXIST)) { /* already there!! */
appending = 1;
if (confirm_append || (confirm_files && is_ordinary_file)) {


! int answer = '\0';

! again:
! if (is_ordinary_file)
! answer = prompt_letter(2,"",*def_ans_no,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel|

! PROMPT_center,


! prompt_area,
! CATGETS(elm_msg_cat, ElmSet,

! ElmConfirmFilesAppend,
! "Append to an existing file `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);
else
! answer = prompt_letter(2,"",*def_ans_no,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel|

! PROMPT_center,


! prompt_area,
! CATGETS(elm_msg_cat, ElmSet,

! ElmConfirmFolderAppend,


! "Append to mail folder `%S'? (%c/%c) "),

! buffer,
! *def_ans_yes,
! *def_ans_no);


!
! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {
! menu_ClearScreen(page); /* Reset possible redraw flag */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(prompt_area);
!
! delay_redraw++; /* Can't trigger redraw yet... */

! goto again;


! }


! if (TERMCH_interrupt_char == answer ||
! EOF == answer)

! goto clean;

if (answer != *def_ans_yes) {
continue; /* RETRY */
***************
*** 316,343 ****
}
} else {
if (confirm_create || (confirm_folders && !is_ordinary_file)) {
! char * msg_buffer = NULL;

if (is_ordinary_file)
! msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
ElmConfirmFilesCreate,
"Create a new file `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);
else
! msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,
! ElmConfirmFolderCreate,
! "Create a new mail folder `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);

! answer = want_to(msg_buffer, *def_ans_no, LINES-2, 1,
! page);

! free(msg_buffer);

if (answer != *def_ans_yes) {
continue; /* RETRY */
}
--- 352,401 ----
}
} else {
if (confirm_create || (confirm_folders && !is_ordinary_file)) {
! int answer = '\0';

+ again2:
if (is_ordinary_file)
! answer = prompt_letter(2,"",*def_ans_no,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel|

! PROMPT_center,


! prompt_area,
! CATGETS(elm_msg_cat, ElmSet,

ElmConfirmFilesCreate,
"Create a new file `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);
else
! answer = prompt_letter(2,"",*def_ans_no,


! PROMPT_yesno|PROMPT_redraw_mark|
! PROMPT_ctrlL|PROMPT_cancel|

! PROMPT_center,


! prompt_area,
! CATGETS(elm_msg_cat, ElmSet,

! ElmConfirmFolderCreate,
! "Create a new mail folder `%S'? (%c/%c) "),
! buffer,
! *def_ans_yes,
! *def_ans_no);


!
! if (('L'&31) == answer ||
! REDRAW_MARK == answer) {
! menu_ClearScreen(page); /* Reset possible redraw flag */

! /* Call refresh routines of children */
! menu_redraw_children(page);

! menu_ClearScreen(prompt_area);

+ delay_redraw++; /* Can't trigger redraw yet... */
+ goto again2;
+ }


+
+ if (TERMCH_interrupt_char == answer)
+ goto clean;
+

if (answer != *def_ans_yes) {
continue; /* RETRY */
}
***************
*** 377,401 ****
* so whatever silently was, now it's true - we can't show those
* delete markings.
*/
! if(redraw)
silently = TRUE;

mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */


struct header_rec * hdr = give_header(mailbox,i);

! if (0 == num_tagged && mesgnum == i ||
! num_tagged > 0 && hdr && ison(hdr->status, TAGGED)) {
!

if (!save_message(i, XXX, buffer, write_ptr,
(num_tagged > 1), appending++,
! silently, delete, text_only, &redraw,
! mailbox, aview, header_page))
fail++;
! if(redraw)
silently = TRUE;
! scount++;
!
}
}

--- 435,466 ----
* so whatever silently was, now it's true - we can't show those
* delete markings.
*/
! if(delay_redraw || menu_need_redraw(page)) { /* ! ! ! */
silently = TRUE;
+ delay_redraw = 1;
+ }

mc = get_message_count(mailbox);
for (i=0; i < mc; i++) { /* save each tagged msg */


struct header_rec * hdr = give_header(mailbox,i);

! if ( (0 == num_tagged && mesgnum == i)
! ||
! (num_tagged > 0 && hdr && ison(hdr->status, TAGGED))
! ) {

if (!save_message(i, XXX, buffer, write_ptr,
(num_tagged > 1), appending++,
! silently, delete, text_only,
! mailbox, aview,
! header_area,page))
fail++;
!
! if (delay_redraw || menu_need_redraw(page)) { /* ! ! ! */
silently = TRUE;
! delay_redraw = 1;
! }
!
! scount++;
}
}

***************
*** 442,469 ****
free_string(&buffer);

DPRINT(Debug,8,(&Debug,
! "save=%d redraw=%d\n",
! retval,redraw));

! if (redraw)
menu_trigger_redraw(page);

return retval;
}

static int save_message(number, XXX, name,ptr,
pause, appending, silently,
! delete, text_only, redraw,
! mailbox, aview, header_page)
int number, pause, appending, silently, delete;
struct folder_browser * XXX;
struct string * name;
WRITE_STATE ptr;
int text_only;
- int *redraw;


struct MailboxView *mailbox;
struct AliasView *aview;

! int header_page;
{
int ret = 0;

--- 507,536 ----
free_string(&buffer);

DPRINT(Debug,8,(&Debug,
! "save=%d delay_redraw=%d\n",
! retval,delay_redraw));



! if (delay_redraw)
menu_trigger_redraw(page);
+ else

+ menu_trigger_redraw(prompt_area);

return retval;
}

static int save_message(number, XXX, name,ptr,
pause, appending, silently,
! delete, text_only,
! mailbox, aview, header_area,page)
int number, pause, appending, silently, delete;
struct folder_browser * XXX;
struct string * name;
WRITE_STATE ptr;
int text_only;


struct MailboxView *mailbox;
struct AliasView *aview;

! struct menu_context *header_area;
! struct menu_context *page;


{
int ret = 0;

***************

*** 478,485 ****
text_only == 2 no folder envelope will be saved
**/

! int save_current, is_new;
int is_tagged = 0;
struct header_rec *hdr;
FILE *infile;

--- 545,553 ----
text_only == 2 no folder envelope will be saved
**/

! int is_new;
int is_tagged = 0;


+ int delay_redraw = 0;

struct header_rec *hdr;
FILE *infile;

***************
*** 532,538 ****

/* Need redraw -- PGP output ?*/
if (raw_off_called()) {
! *redraw = TRUE;
silently = TRUE;
}

--- 600,608 ----

/* Need redraw -- PGP output ?*/
if (raw_off_called()) {
! DPRINT(Debug,9,(&Debug,
! "save_message: Raw OFF called\n"));
! delay_redraw = TRUE;
silently = TRUE;
}

***************
*** 580,593 ****
setit(hdr->status, TAGGED);
}

! if (! silently) {
struct menu_common MENU;
!
set_mcommon_from_mbxview(&MENU,mailbox);

! show_new_status(number, &MENU, header_page); /* update screen, if needed */
}

if (pause && (!silently) && (!appending))
sleep_message();

--- 650,672 ----
setit(hdr->status, TAGGED);
}

! if (! silently && header_area) {
struct menu_common MENU;
! int vis;
!
set_mcommon_from_mbxview(&MENU,mailbox);

! vis = compute_visible(number+1, &MENU);
! menu_header_status_update(header_area,vis-1);
!
}

+ DPRINT(Debug,9,(&Debug,
+ "save_message: delay_redraw=%d\n",delay_redraw));


+
+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

if (pause && (!silently) && (!appending))
sleep_message();

Index: elmME+.2.5.alpha5-cvs/src/fileio.c
*** elmME+.2.5.alpha4/src/fileio.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/fileio.c 2005-07-26 11:28:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fileio.c,v 1.56.8.7 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fileio.c,v 1.56.8.10 2005/07/26 08:28:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.56.8.10 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 42,59 ****


return (unsigned char *)str;
}

! static CONST unsigned char *cs2cus P_((const char *str));
! static CONST unsigned char *cs2cus(str)
! CONST char *str;
{
! return (CONST unsigned char *)str;
}

! static CONST unsigned char * csUs P_((const char *str));
! static CONST unsigned char * csUs(str)
! CONST char *str;
{
! return (CONST unsigned char *)str;
}

#include <errno.h>
--- 42,59 ----


return (unsigned char *)str;
}

! static const unsigned char *cs2cus P_((const char *str));
! static const unsigned char *cs2cus(str)
! const char *str;
{

! return (const unsigned char *)str;


}

! static const unsigned char * csUs P_((const char *str));
! static const unsigned char * csUs(str)
! const char *str;
{

! return (const unsigned char *)str;
}

#include <errno.h>
***************
*** 61,68 ****


extern int errno;
#endif

- char *error_description();
-

#ifdef USE_PGP
/* Prototype */
static int copy_pgp P_((out_state_t *,int, struct header_rec *,
--- 61,66 ----
***************
*** 908,923 ****
struct folder_browser *dir = NULL;
WRITE_STATE dest = NULL;

- int env_flags = 0;
- out_state_t buffer;
-
start_fd_write_state(dest_file,&dir,&dest);

ret = copy_message_df(infile,current_header,dir,dest,cm_options,
file_set);

- fail2:
-
end_fd_write_state(&dir,&dest);

/* Since fprintf is buffered, its return value is only useful for
--- 906,916 ----
***************
*** 931,937 ****
ret = 0;
}

- fail:
if (!ret) {
DPRINT(Debug,1,(&Debug,
"copy_message_f fails\n"));
--- 924,929 ----
***************
*** 988,1004 ****
header_list_ptr all_headers));

static void makeAttString(attribution, sel_field, messageHeader, dest_file, all_headers)
! CONST char *attribution; /* attribution string to expand */
int sel_field; /* field to select in "%[...]" list */
! CONST struct header_rec *messageHeader; /* current message header info */
out_state_t *dest_file;
header_list_ptr all_headers;
{
- const char *aptr = attribution; /* cursor into the attribution spec */

int in_selection; /* currently doing %[...] list? */
! int curr_field; /* field number of current %[...] list */
! char fromfield[STRING]; /* room for parsed from address */

/* Convert attribution to struct strincg so that multi-byte strings work */

--- 980,994 ----
header_list_ptr all_headers));

static void makeAttString(attribution, sel_field, messageHeader, dest_file, all_headers)
! const char *attribution; /* attribution string to expand */
int sel_field; /* field to select in "%[...]" list */
! const struct header_rec *messageHeader; /* current message header info */
out_state_t *dest_file;
header_list_ptr all_headers;
{

int in_selection; /* currently doing %[...] list? */
! int curr_field = 0; /* field number of current %[...] list */

/* Convert attribution to struct strincg so that multi-byte strings work */

***************
*** 1267,1273 ****
header_list_ptr all_headers = NULL, next_hdr;

int buf_len;
- int i;

DPRINT(Debug,5, (&Debug,
"copy_message_2: cm_options=(%d)%s%s%s%s%s%s%s%s%s%s \n",
--- 1257,1262 ----
***************
*** 1480,1486 ****
for (next_hdr = all_headers;
next_hdr;
next_hdr = next_hdr -> next_header) {
! CONST char * hdr_name = give_header_name(next_hdr->header_name);


if ((remail) && 0 == istrcmp("Sender",hdr_name)) {
--- 1469,1475 ----
for (next_hdr = all_headers;
next_hdr;
next_hdr = next_hdr -> next_header) {
! const char * hdr_name = give_header_name(next_hdr->header_name);


if ((remail) && 0 == istrcmp("Sender",hdr_name)) {
***************
*** 1624,1629 ****
--- 1613,1619 ----
}
}
if (update_status) {
+ char buffer[WLEN+10]; /* Enough space for status letters */
if (state_printf (dest_file,
FRM("%sStatus: "),
prefix) == EOF) {
***************
*** 1631,1676 ****
goto fail;
}

! if (ison(current_header->status, NEW)) {
! if (state_printf(dest_file, FRM("N")) == EOF) {
! DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
! goto fail;
! }
! } else {
! if (state_printf(dest_file, FRM("O")) == EOF) {
! DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));


! goto fail;
! }
! }

! if (isoff(current_header->status, UNREAD)) {
! /* read */
! if (state_printf(dest_file, FRM("R")) == EOF) {
! DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));


! goto fail;
! }
! }

! if (ison(current_header->status, REPLIED_TO)) {
! if (state_printf (dest_file, FRM("r")) == EOF) {
DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
goto fail;
! }
}
- /* save all the status flags that ELM doesn't understand */
- for (i=0; current_header->mailx_status[i] != '\0'; i++)
- switch (current_header->mailx_status[i]) {
- case 'N':
- case 'R':
- case 'O':
- case 'r':
- break;
- default:
- if (state_printf (dest_file, FRM("%c"),
- current_header->mailx_status[i]) ==
- EOF) {
- DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
- goto fail;
- }
- }

/* Must use state_printf so EOLN_is_CRLF conversion occurs! */
if (state_printf(dest_file,
--- 1621,1635 ----
goto fail;
}

! if (status_2_mailbox(current_header,buffer,sizeof buffer) > 0) {
! if (state_printf (dest_file,
! FRM("%s"),
! buffer) == EOF) {
!
DPRINT(Debug,1,(&Debug, "copy_message_2 fails\n"));
goto fail;
! }
}

/* Must use state_printf so EOLN_is_CRLF conversion occurs! */
if (state_printf(dest_file,
Index: elmME+.2.5.alpha5-cvs/src/file_util.c
*** elmME+.2.5.alpha4/src/file_util.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/file_util.c 2005-07-26 11:28:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: file_util.c,v 1.24.8.1 2004/08/07 18:07:17 hurtta Exp $";

/*****************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.24.8.1 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: file_util.c,v 1.24.8.4 2005/07/26 08:28:44 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 26,34 ****
extern int errno; /* system error number */
#endif

- char *error_description(), *getlogin();
- long fsize();
-
long bytes(name)
char *name;
{
--- 26,31 ----
***************
*** 48,54 ****
"\nError attempting fstat on file %s!\n"),
name);


lib_error(FRM("** %s. **\n"),

! error_description(err));
emergency_exit(0);
}
return(result);
--- 45,51 ----
"\nError attempting fstat on file %s!\n"),
name);


lib_error(FRM("** %s. **\n"),

! strerror(err));
emergency_exit(0);
}
return(result);
***************
*** 136,142 ****
READ_STATE state;

if (prepare_read_folder(mfile,PREPARE_NOLOCK,&state)) {
! CONST char * FORWARD = NULL;

if (NULL != (FORWARD = is_forwarded_folder(mfile,state))) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmMailBeingForwarded,
--- 133,139 ----
READ_STATE state;

if (prepare_read_folder(mfile,PREPARE_NOLOCK,&state)) {
! const char * FORWARD = NULL;

if (NULL != (FORWARD = is_forwarded_folder(mfile,state))) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmMailBeingForwarded,
***************
*** 145,151 ****
retcode = 2;
} else if (mfile->mailfile_size < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMail,
! "You have no mail.\n\r"));
retcode = 1;
} else
retcode = 0;
--- 142,148 ----
retcode = 2;
} else if (mfile->mailfile_size < 2) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMail,
! "You have no mail."));
retcode = 1;
} else
retcode = 0;
***************
*** 196,202 ****
DPRINT(Debug,1,
(&Debug,
"open_end_update: could not open file %s\n\tError: %s\n",

! name, error_description(err)));

return NULL;
}

--- 193,199 ----
DPRINT(Debug,1,
(&Debug,
"open_end_update: could not open file %s\n\tError: %s\n",

! name, strerror(err)));

return NULL;
}
***************

*** 206,212 ****

DPRINT(Debug,1,(&Debug,
"open_end_update: could not seek to EOF %s\n\tError: %s\n",
! name, error_description(err)));

fclose(fp);
return NULL;
--- 203,209 ----

DPRINT(Debug,1,(&Debug,
"open_end_update: could not seek to EOF %s\n\tError: %s\n",
! name, strerror(err)));

fclose(fp);
return NULL;
Index: elmME+.2.5.alpha5-cvs/src/forms.c
*** elmME+.2.5.alpha4/src/forms.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/forms.c 2005-07-23 22:01:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: forms.c,v 1.23.8.2 2004/08/07 18:07:17 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: forms.c,v 1.23.8.5 2005/07/23 19:01:38 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 48,55 ****


extern int errno;
#endif

- char *error_description();
-

static void prompt_for_sized_entry P_((char *prompt, char *buffer,
int field_size,
struct menu_context *page));
--- 48,53 ----
***************
*** 72,78 ****
if (err) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! error_description(err), filename);
return -1;
}

--- 70,76 ----
if (err) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! strerror(err), filename);
return -1;
}

***************
*** 81,92 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! error_description(err), filename);
return -1;
}

while (mail_gets(buffer, SLEN, form)) {
! field_count += occurances_of(COLON, buffer);
}

fclose(form);
--- 79,90 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningCheckFields,
"Error %s trying to open %s to check fields!"),
! strerror(err), filename);
return -1;
}

while (mail_gets(buffer, SLEN, form)) {
! field_count += occurances_of(':', buffer);
}

fclose(form);
***************
*** 105,112 ****

FILE *form, *newform;
char newfname[SLEN], buffer[SLEN];
! register int form_count = 0;
int len_buf, err;

DPRINT(Debug,4, (&Debug, "Formatting form file '%s'\n", filename));

--- 103,111 ----

FILE *form, *newform;
char newfname[SLEN], buffer[SLEN];
! int form_count = 0;
int len_buf, err;
+ char *tmp;

DPRINT(Debug,4, (&Debug, "Formatting form file '%s'\n", filename));

***************
*** 126,137 ****
"Can't read the message to validate the form!"));
DPRINT(Debug,1,(&Debug,
"** Error encountered opening file \"%s\" - %s (check_form) **\n",
! filename, error_description(err)));
return(-1);
}

elm_sfprintf(newfname, sizeof newfname,


! FRM("%s%s%d"), temp_dir, temp_form_file, getpid());

if ((newform = safeopen(newfname)) == NULL) {
err = errno;
--- 125,140 ----
"Can't read the message to validate the form!"));
DPRINT(Debug,1,(&Debug,
"** Error encountered opening file \"%s\" - %s (check_form) **\n",
! filename, strerror(err)));
return(-1);


}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ tmp = "/tmp/";
+
elm_sfprintf(newfname, sizeof newfname,


! FRM("%s%s%d"), tmp, temp_form_file, getpid());

if ((newform = safeopen(newfname)) == NULL) {
err = errno;
***************
*** 139,145 ****
"Couldn't open newform file for form output!"));
DPRINT(Debug,1,(&Debug,
"** Error encountered opening file \"%s\" - %s (check_form) **\n",
! newfname, error_description(err)));
return(-1);
}

--- 142,149 ----
"Couldn't open newform file for form output!"));
DPRINT(Debug,1,(&Debug,
"** Error encountered opening file \"%s\" - %s (check_form) **\n",
! newfname, strerror(err)));
! fclose(form);
return(-1);
}

***************
*** 154,160 ****
while (0 < (len_buf =
mail_gets(buffer, SLEN, form))) {
fwrite(buffer, 1, len_buf, newform);
! form_count += occurances_of(COLON, buffer);
}

fprintf(newform, "***\n"); /* that closing bit! */
--- 158,164 ----
while (0 < (len_buf =
mail_gets(buffer, SLEN, form))) {
fwrite(buffer, 1, len_buf, newform);
! form_count += occurances_of(':', buffer);
}

fprintf(newform, "***\n"); /* that closing bit! */
***************
*** 166,179 ****
if (unlink(filename) != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorUnlinkingFile,
"Error %s unlinking file %s."),
! error_description(errno),
filename);
return(-1);
}
if (link(newfname, filename)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorLinkingFile,
"Error %s linking %s to %s."),
! error_description(errno), newfname, filename);
return(-1);
}
}
--- 170,183 ----
if (unlink(filename) != 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorUnlinkingFile,
"Error %s unlinking file %s."),
! strerror(errno),
filename);
return(-1);
}
if (link(newfname, filename)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorLinkingFile,
"Error %s linking %s to %s."),
! strerror(errno), newfname, filename);
return(-1);
}
}
***************
*** 181,205 ****
if (unlink(newfname)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorUnlinkingFile,
"Error %s unlinking file %s."),
! error_description(errno), newfname);
return(-1);
}

return(form_count);
}

! int mail_filled_in_form(mail_index,address, subject,
! mailbox,aview)
int mail_index;
struct addr_item *address;
char *subject;


struct MailboxView *mailbox;
struct AliasView *aview;

{
! /** This is the interesting routine. This one will read the
! message and prompt the user, line by line, for each of
! the fields...returns non-zero if it succeeds
! **/

FILE *fd;
int lines = 0, count, len_buf, max_lines;
--- 185,210 ----
if (unlink(newfname)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorUnlinkingFile,
"Error %s unlinking file %s."),
! strerror(errno), newfname);
return(-1);
}

return(form_count);
}

! void mail_filled_in_form(mail_index,address, subject,
! mailbox,aview, parent_page)
int mail_index;
struct addr_item *address;
char *subject;


struct MailboxView *mailbox;
struct AliasView *aview;

+ struct menu_context *parent_page;
{
! /** This is the interesting routine. This one will read the
! message and prompt the user, line by line, for each of
! the fields...returns non-zero if it succeeds
! **/

FILE *fd;
int lines = 0, count, len_buf, max_lines;
***************
*** 208,213 ****
--- 213,219 ----
struct menu_context *cpage;
struct header_rec *hdr = NULL;
FILE * mail_file = NULL;
+ char *tmp;


DPRINT(Debug,4,
***************
*** 219,225 ****
if (!give_message_data(mailbox,mail_index,
&hdr,&mail_file,NULL,
NO_mime_parse))
! return 0;

/* now we can fly along and get to the message body... */

--- 225,231 ----
if (!give_message_data(mailbox,mail_index,
&hdr,&mail_file,NULL,
NO_mime_parse))
! return;

/* now we can fly along and get to the message body... */

***************
*** 231,237 ****
else if (lines >= max_lines) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoFormInMessage,
"No form in this message!?"));
! return(0);
}

if (buffer[len_buf - 1] == '\n')
--- 237,243 ----
else if (lines >= max_lines) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoFormInMessage,
"No form in this message!?"));
! return;
}

if (buffer[len_buf - 1] == '\n')
***************
*** 241,247 ****
if (len_buf == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoFormInMessage,
"No form in this message!?"));
! return(0);
}

DPRINT(Debug,6,(&Debug,
--- 247,253 ----
if (len_buf == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoFormInMessage,
"No form in this message!?"));
! return;
}

DPRINT(Debug,6,(&Debug,
***************
*** 263,285 ****
if (lines >= max_lines) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadForm,
"Badly constructed form. Can't reply!"));
! return(0);
}
}

if (len_buf == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadForm,
"Badly constructed form. Can't reply!"));
! return(0);
}

DPRINT(Debug,6,(&Debug,
"- skipped the non-forms-image stuff -\n"));

/* one last thing - let's open the tempfile for output... */
!
elm_sfprintf(buffer, sizeof buffer,


! FRM("%s%s%d"), temp_dir, temp_form_file, getpid());

DPRINT(Debug,2,(&Debug,
"-- forms sending using file %s --\n", buffer));
--- 269,294 ----
if (lines >= max_lines) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadForm,
"Badly constructed form. Can't reply!"));
! return;
}
}

if (len_buf == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBadForm,
"Badly constructed form. Can't reply!"));
! return;
}

DPRINT(Debug,6,(&Debug,
"- skipped the non-forms-image stuff -\n"));

/* one last thing - let's open the tempfile for output... */


! tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
! if (!tmp)
! tmp = "/tmp/";
!

elm_sfprintf(buffer, sizeof buffer,


! FRM("%s%s%d"), tmp, temp_form_file, getpid());

DPRINT(Debug,2,(&Debug,
"-- forms sending using file %s --\n", buffer));
***************
*** 287,297 ****
if ((fd = safeopen(buffer)) == NULL) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenAsOutputFile,
"Can't open \"%s\" as output file! (%s)."),
! buffer, error_description(errno));
DPRINT(Debug,1,(&Debug,
"** Error %s encountered trying to open temp file %s;\n",
! error_description(errno), buffer));
! return(0);
}

/* NOW we're ready to read the form image in and start prompting... */
--- 296,306 ----
if ((fd = safeopen(buffer)) == NULL) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenAsOutputFile,
"Can't open \"%s\" as output file! (%s)."),
! buffer, strerror(errno));
DPRINT(Debug,1,(&Debug,
"** Error %s encountered trying to open temp file %s;\n",
! strerror(errno), buffer));
! return;
}

/* NOW we're ready to read the form image in and start prompting... */
***************
*** 317,327 ****
if (lines > max_lines)
break; /* end of message */

! switch ((count = occurances_of(COLON, buffer))) {
case 0 : fwrite(buffer, 1, len_buf, stdout); /* output line */
fwrite(buffer, 1, len_buf, fd);
break;
! case 1 : if (buffer[0] == COLON) {
elm_fprintf(stdout,
CATGETS(elm_msg_cat, ElmSet, ElmEnterAsManyLines,
"(Enter as many lines as needed, ending with a '.' by itself on a line)\n"));
--- 326,336 ----
if (lines > max_lines)
break; /* end of message */

! switch ((count = occurances_of(':', buffer))) {
case 0 : fwrite(buffer, 1, len_buf, stdout); /* output line */
fwrite(buffer, 1, len_buf, fd);
break;
! case 1 : if (buffer[0] == ':') {
elm_fprintf(stdout,
CATGETS(elm_msg_cat, ElmSet, ElmEnterAsManyLines,
"(Enter as many lines as needed, ending with a '.' by itself on a line)\n"));
***************
*** 351,357 ****

erase_menu_context(&page);

! return(1);
}


--- 360,368 ----

erase_menu_context(&page);

! menu_trigger_redraw(parent_page);
!
! return;
}


***************
*** 379,385 ****

while (entries--) {
j=0;
! i = chloc((char *) buffer + offset, COLON) + 1;
while (j < i - 1) {
prompt[j] = buffer[j+offset];
j++;
--- 390,396 ----

while (entries--) {
j=0;
! i = chloc((char *) buffer + offset, ':') + 1;
while (j < i - 1) {
prompt[j] = buffer[j+offset];
j++;
Index: elmME+.2.5.alpha5-cvs/src/hdrconfg.c
*** elmME+.2.5.alpha4/src/hdrconfg.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/hdrconfg.c 2005-07-24 16:04:31.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.39.8.3 2004/08/07 18:07:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 1.39.8.7 2005/07/24 13:04:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.39.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 87,93 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page

));

/*
--- 87,94 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area
));

/*
***************
*** 127,139 ****
/*
* Local procedures.
*/
- static void hdrmenu_clear_promptarea P_((struct menu_context *page));
static int hdrmenu_get P_((struct hdr_menu_item *h,
struct mailing_headers *headers,
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

static void hdrmenu_put P_((struct hdr_menu_item *h,
int already_clear,
struct mailing_headers *headers,
--- 128,140 ----
/*
* Local procedures.
*/
static int hdrmenu_get P_((struct hdr_menu_item *h,
struct mailing_headers *headers,
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

static void hdrmenu_put P_((struct hdr_menu_item *h,
int already_clear,
struct mailing_headers *headers,
***************
*** 156,163 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,
struct AliasView *aview,
! struct menu_context *page
! ));


/* To: -header -------------------------------------------------------- */
--- 157,165 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area

! ));


/* To: -header -------------------------------------------------------- */
***************
*** 175,181 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

/* CC: -header -------------------------------------------------------- */

--- 177,184 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

/* CC: -header -------------------------------------------------------- */

***************
*** 192,198 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

/* BCC: -header -------------------------------------------------------- */

--- 195,202 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

/* BCC: -header -------------------------------------------------------- */

***************
*** 209,215 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));


/* Subject: -header -------------------------------------------------------- */
--- 213,220 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));


/* Subject: -header -------------------------------------------------------- */
***************
*** 227,233 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));


/* Reply-To: -header -------------------------------------------------- */
--- 232,239 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));


/* Reply-To: -header -------------------------------------------------- */
***************
*** 245,251 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));


/* Action: -header ---------------------------------------------------- */
--- 251,258 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));


/* Action: -header ---------------------------------------------------- */
***************
*** 263,269 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

/* Expires: -header ---------------------------------------------------- */

--- 270,277 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

/* Expires: -header ---------------------------------------------------- */

***************
*** 280,286 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

/* Priority: -header ---------------------------------------------------- */

--- 288,295 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

/* Priority: -header ---------------------------------------------------- */

***************
*** 297,303 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

/* Precedence: -header ---------------------------------------------------- */

--- 306,313 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

/* Precedence: -header ---------------------------------------------------- */

***************
*** 314,320 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

/* In-Reply-To: -header ---------------------------------------------------- */

--- 324,331 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

/* In-Reply-To: -header ---------------------------------------------------- */

***************
*** 331,337 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

/* User defined header ---------------------------------------------------- */

--- 342,349 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

/* User defined header ---------------------------------------------------- */

***************
*** 349,355 ****
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page));

/*
* Definition of all the header editing menu fields.
--- 361,368 ----
struct mailer_info *mailer_info,
charset_t hdr_charset,


struct AliasView *aview,
! struct menu_context *page,
! struct menu_context *prompt_area));

/*
* Definition of all the header editing menu fields.
***************
*** 357,367 ****
struct hdr_menu_item hmenu_item_list[] = {
{ 't', "T)o", 2, HF_DISP_3ROW|HF_APPENDENTRY|HF_ADD_COMMA|HF_ONPRE_SENDMENU,
inpval_to, expval_to, hdrproc_to },
! { 'c', "C)c", 5, HF_DISP_3ROW|HF_APPENDENTRY|HF_ADD_COMMA,
inpval_cc, expval_cc, hdrproc_cc },
! { 'b', "B)cc", 8, HF_DISP_2ROW|HF_APPENDENTRY|HF_ADD_COMMA,
inpval_bcc, expval_bcc, hdrproc_bcc },
! { 's', "S)ubject", 10, HF_DISP_2ROW,
inpval_subject, expval_subject, hdrproc_subject },
{ 'r', "R)eply-to", 12, HF_DISP_1ROW,
inpval_reply_to, expval_reply_to, hdrproc_reply_to },
--- 370,380 ----
struct hdr_menu_item hmenu_item_list[] = {
{ 't', "T)o", 2, HF_DISP_3ROW|HF_APPENDENTRY|HF_ADD_COMMA|HF_ONPRE_SENDMENU,
inpval_to, expval_to, hdrproc_to },
! { 'c', "C)c", 5, HF_DISP_3ROW|HF_APPENDENTRY|HF_ADD_COMMA|HF_ONPRE_SENDMENU,
inpval_cc, expval_cc, hdrproc_cc },
! { 'b', "B)cc", 8, HF_DISP_2ROW|HF_APPENDENTRY|HF_ADD_COMMA|HF_ONPRE_SENDMENU,
inpval_bcc, expval_bcc, hdrproc_bcc },
! { 's', "S)ubject", 10, HF_DISP_2ROW|HF_ONPRE_SENDMENU,
inpval_subject, expval_subject, hdrproc_subject },
{ 'r', "R)eply-to", 12, HF_DISP_1ROW,
inpval_reply_to, expval_reply_to, hdrproc_reply_to },
***************
*** 420,432 ****
1 if found
REDRAW_MARK is redraw required
*/
! int presend_action(headers,mailer_info,c,hdr_charset,aview,page)
struct mailing_headers *headers;
struct mailer_info *mailer_info;
int c;
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;
{

struct hdr_menu_item *h;
int LINES, COLUMNS;
--- 433,447 ----
1 if found
REDRAW_MARK is redraw required
*/
! int presend_action(headers,mailer_info,c,hdr_charset,aview,page,
! prompt_area)
struct mailing_headers *headers;
struct mailer_info *mailer_info;
int c;
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
struct hdr_menu_item *h;
int LINES, COLUMNS;
***************
*** 443,449 ****
CleartoEOS();

status = hdrmenu_get(h,headers,mailer_info,hdr_charset,aview,
! page);
if (REDRAW_MARK == status) {
return REDRAW_MARK;
}
--- 458,464 ----
CleartoEOS();

status = hdrmenu_get(h,headers,mailer_info,hdr_charset,aview,
! page,prompt_area);
if (REDRAW_MARK == status) {
return REDRAW_MARK;
}
***************
*** 495,500 ****
--- 510,516 ----

switch (mode) {
case mode_comment: putc(')',F); break;
+ default: break;
}

free(s1);
***************
*** 579,587 ****
{
charset_t edit_charset = system_charset;
FILE * F = NULL;

char * filename = elm_message(FRM("%s%sHDR%d"),
! temp_dir, temp_file, getpid());


char * buffer = NULL;

char buffer1[32*1024];
int stat;
--- 595,606 ----
{
charset_t edit_charset = system_charset;
FILE * F = NULL;
+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+

char * filename = elm_message(FRM("%s%sHDR%d"),

! tmp ? tmp : "/tmp/",

! temp_file, getpid());


char * buffer = NULL;

char buffer1[32*1024];
int stat;
***************
*** 620,631 ****
if (encoding_supported) {
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentEnc,
! "# MIME enconding of headers is supported\n"));

} else {
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentNo,
! "# MIME enconding of headers is NOT supported\n"));

}

--- 639,650 ----
if (encoding_supported) {
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentEnc,
! "# MIME encoding of headers is supported\n"));

} else {
elm_fprintf(F,
CATGETS(elm_msg_cat, ElmSet, ElmHdrEditCommentNo,
! "# MIME encoding of headers is NOT supported\n"));

}

***************
*** 657,663 ****


"System call failed with stat %d (edit_the_message)\n",
stat));
DPRINT(Debug,1,(&Debug,
! "** %s **\n", error_description(err)));
ClearLine(LINES-2);

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantInvokeEditor,
"Can't invoke editor '%s' for composition."),
--- 676,682 ----


"System call failed with stat %d (edit_the_message)\n",
stat));
DPRINT(Debug,1,(&Debug,
! "** %s **\n", strerror(err)));
ClearLine(LINES-2);

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantInvokeEditor,
"Can't invoke editor '%s' for composition."),
***************
*** 744,749 ****
--- 763,769 ----

}

+
void edit_headers(headers,mailer_info,hdr_charset, hdr_encoding_supported,
aview)
struct mailing_headers *headers;
***************
*** 761,795 ****
editor_val &&
strcmp(editor_val, "builtin") != 0 &&
strcmp(editor_val, "none") != 0;
!


int LINES, COLUMNS;

struct menu_context *page = new_menu_context();


menu_get_sizes(page, &LINES, &COLUMNS);

/*
* Placement of prompts and messages at the bottom of the screen.
*/
- #define INSTRUCT_LINE (LINES-5)
- #define INPUT_LINE (LINES-3)
- #define ERROR_LINE (LINES-2)
- #define TOPMOST_PROMPTAREA_LINE INSTRUCT_LINE
-
-

/* expand out all of the header values */
/* menu displays expanded values, user edits unexpended versions */

do_redraw = TRUE;
while (TRUE) { /* forever */

resize_mark:
if (menu_resized(page)) {

menu_get_sizes(page,&LINES, &COLUMNS);


do_redraw = 1;

} else if (menu_need_redraw(page))

--- 781,818 ----
editor_val &&
strcmp(editor_val, "builtin") != 0 &&
strcmp(editor_val, "none") != 0;


! int ul = give_dt_enumerate_as_int(&user_level);

int LINES, COLUMNS;

struct menu_context *page = new_menu_context();

+ struct menu_context * prompt_area = NULL;

menu_get_sizes(page, &LINES, &COLUMNS);

/*
* Placement of prompts and messages at the bottom of the screen.
*/

+ prompt_area =
+ new_menu_subpage(page,LINES-5,5,
+ subpage_simple_noredraw,NULL);
+
/* expand out all of the header values */
/* menu displays expanded values, user edits unexpended versions */

do_redraw = TRUE;
while (TRUE) { /* forever */
+ menu_set_default(page);

resize_mark:


if (menu_resized(page)) {

menu_get_sizes(page,&LINES, &COLUMNS);
+

+ menu_subpage_relocate(prompt_area,page,LINES-5,5);


+
do_redraw = 1;

} else if (menu_need_redraw(page))

***************
*** 804,811 ****
*/

hmenu_from.lineno = hmenu_to.lineno++;
! hmenu_to.flags = hmenu_to.flags & ~HF_DISP_MASK |
! HF_DISP_2ROW;
hmenu_from.flags = HF_DISP_1ROW;
do_redraw = 1;
}
--- 827,835 ----
*/

hmenu_from.lineno = hmenu_to.lineno++;
! hmenu_to.flags =
! ( hmenu_to.flags & ~HF_DISP_MASK) |
! HF_DISP_2ROW;
hmenu_from.flags = HF_DISP_1ROW;
do_redraw = 1;
}
***************
*** 822,869 ****
hdrmenu_put(h, TRUE, headers, hdr_charset, page);
}
do_redraw = FALSE;
- }

! /* display the instructions */
! if (user_level > 0 && editor_available) {

#ifdef ALLOW_SUBSHELL
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1,
! "Choose header, u)ser defined header, !)shell, invoke e(d)itor, or <return>."));
#else
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1NoShell,
! "Choose header, u)ser defined header, invoke e(d)itor, or <return>."));
#endif
!
! } else {
!
#ifdef ALLOW_SUBSHELL
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct,
! "Choose header, u)ser defined header, !)shell, or <return>."));
#else
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstructNoShell,
! "Choose header, u)ser defined header, or <return>."));
#endif
!
}
/* prompt for command */
! PutLineX(INPUT_LINE, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPrompt, "Choice: "));
if (precmd) {
! c = precmd;
! precmd = 0;
} else {
! c = menu_ReadCh(page,REDRAW_MARK|READCH_resize|READCH_sig_char);
if (c == REDRAW_MARK) {
do_redraw = TRUE;
continue;
}
--- 846,911 ----
hdrmenu_put(h, TRUE, headers, hdr_charset, page);
}
do_redraw = FALSE;

! menu_redraw_children(page);
! }



+ if (menu_resized(prompt_area) ||
+ menu_need_redraw(prompt_area)) {
+
+ menu_ClearScreen(prompt_area);
+

+ /* display the instructions */
+ if (ul > 0 && editor_available) {
+
#ifdef ALLOW_SUBSHELL
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1,
! "Choose header, u)ser defined header, !)shell, invoke e(d)itor, or <return>."));
#else
! menu_print_format_center(prompt_area,0
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct1NoShell,
! "Choose header, u)ser defined header, invoke e(d)itor, or <return>."));
#endif
!
! } else {
!
#ifdef ALLOW_SUBSHELL
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstruct,
! "Choose header, u)ser defined header, !)shell, or <return>."));
#else
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuInstructNoShell,
! "Choose header, u)ser defined header, or <return>."));
#endif
!
! }
}
+
+
+
/* prompt for command */
! menu_PutLineX(prompt_area,2, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPrompt, "Choice: "));
if (precmd) {
! c = precmd;
! precmd = 0;
} else {
! c = menu_ReadCh(prompt_area,REDRAW_MARK|READCH_resize|READCH_sig_char);
if (c == REDRAW_MARK) {


+ menu_ClearScreen(page); /* Clear possible redraw mark */
+
+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+
+ menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/

+
do_redraw = TRUE;
continue;
}
***************
*** 882,888 ****
if (isascii(c))
#endif
c = tolower(c);
! hdrmenu_clear_promptarea(page);

/* execute the command */
switch (c) {
--- 924,931 ----
if (isascii(c))
#endif
c = tolower(c);
!
! menu_ClearScreen(prompt_area);

/* execute the command */
switch (c) {
***************
*** 896,902 ****


#ifdef ALLOW_SUBSHELL
case '!':

! subshell(NULL, page);
if (menu_need_redraw(page))

do_redraw = TRUE;
break;
--- 939,946 ----
#ifdef ALLOW_SUBSHELL
case '!':

! subshell(NULL, page, prompt_area); /* !! */
!
if (menu_need_redraw(page))
do_redraw = TRUE;
break;
***************
*** 925,931 ****
if (h->menucmd == c) {
int status = hdrmenu_get(h,headers,mailer_info,
hdr_charset,aview,
! page);
if (REDRAW_MARK == status) {
precmd = c;
do_redraw = TRUE;
--- 969,975 ----
if (h->menucmd == c) {
int status = hdrmenu_get(h,headers,mailer_info,
hdr_charset,aview,
! page,prompt_area);
if (REDRAW_MARK == status) {
precmd = c;
do_redraw = TRUE;
***************
*** 942,951 ****
}
}
if (h->menucmd <= 0) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuBadChoice,
! "No such header!"));
Writechar('\007');
}
break;
--- 986,995 ----
}
}
if (h->menucmd <= 0) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuBadChoice,
! "No such header!"));
Writechar('\007');
}
break;
***************
*** 954,991 ****
}

OUT:
erase_menu_context(&page);
return;
}


- /*
- * Erase instructions, user input, left-over errors, etc.
- * This should be run after every user input command in this module.
- */
- static void hdrmenu_clear_promptarea(page)


- struct menu_context *page;
- {

- int LINES, COLUMNS;
-
- menu_get_sizes(page,&LINES, &COLUMNS);

-
- clear_error();
- MoveCursor(TOPMOST_PROMPTAREA_LINE, 0);
- CleartoEOS();
- }


/*
* Prompt the user for a header value, and do any required post-processing.
*/
! static int hdrmenu_get(h,headers,mailer_info,hdr_charset,aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct mailer_info *mailer_info;
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;
{

char *s;
int plen, ret, do_append, do_comma;
--- 998,1024 ----
}

OUT:
+ erase_menu_context(&prompt_area);
+
erase_menu_context(&page);
return;
}




/*
* Prompt the user for a header value, and do any required post-processing.
*/
! static int hdrmenu_get(h,headers,mailer_info,hdr_charset,aview,page,
! prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct mailer_info *mailer_info;
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
char *s;
int plen, ret, do_append, do_comma;
***************
*** 995,1019 ****

menu_get_sizes(page,&LINES, &COLUMNS);

/* display the instructions */
switch (h->flags & HF_PROMPT_MASK) {
case HF_PROMPT_EXP:
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetExpiresInstruct,
! "In how many days should this message expire? "));
break;
case HF_PROMPT_USR:
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetUserdefInstruct,
! "Enter in the format \"HeaderName: HeaderValue\"."));
break;
default:
! print_format_center(INSTRUCT_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetInstruct,
! "Enter value for the header."));
break;
}

--- 1028,1054 ----

menu_get_sizes(page,&LINES, &COLUMNS);

+ menu_ClearLine(prompt_area,0);
+
/* display the instructions */
switch (h->flags & HF_PROMPT_MASK) {
case HF_PROMPT_EXP:
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetExpiresInstruct,
! "In how many days should this message expire? "));
break;
case HF_PROMPT_USR:
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetUserdefInstruct,
! "Enter in the format \"HeaderName: HeaderValue\"."));
break;
default:
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuGetInstruct,
! "Enter value for the header."));
break;
}

***************
*** 1021,1027 ****
plen = 0;

if (h->hdrname != NULL) {
! MoveCursor(INPUT_LINE, 0);
for (s = h->hdrname ; *s != '\0' ; ++s) {
if (*s != '(' && *s != ')') {
if (plen > sizeof header_name -4)
--- 1056,1062 ----
plen = 0;

if (h->hdrname != NULL) {
! menu_MoveCursor(prompt_area,2,0);
for (s = h->hdrname ; *s != '\0' ; ++s) {
if (*s != '(' && *s != ')') {
if (plen > sizeof header_name -4)
***************
*** 1041,1068 ****
do_comma = ((h->flags & HF_ADD_COMMA) != 0 &&
string_len(buffer));

! ret = optionally_enter2(page, &buffer, INPUT_LINE, 0,
! (do_append ? OE_APPEND_CURRENT : 0) |
! (do_comma ? OE_ADD_COMMA : 0) |


! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,

! FRM("%s"),header_name);
if (ret == REDRAW_MARK) {
! h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page);
return REDRAW_MARK;
}

! hdrmenu_clear_promptarea(page);

/* bail out on error */
if (ret != 0) {
if (buffer)
h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,
! page);
return -1;
}
/* see if there is some processing required on this value */
return h->hdrproc(h,headers,&buffer,FALSE,mailer_info,hdr_charset,
! aview,page);
}


--- 1076,1109 ----
do_comma = ((h->flags & HF_ADD_COMMA) != 0 &&
string_len(buffer));

! {


! /* FIXME --optionally_enter* should use prompt_area */

! int line1 = menu_GetAbsLine(prompt_area,2);
!
! ret = optionally_enter2(page, &buffer, line1, 0,
! (do_append ? OE_APPEND_CURRENT : 0) |
! (do_comma ? OE_ADD_COMMA : 0) |


! OE_REDRAW_MARK|OE_SIG_CHAR /* Ctrl-C */,

! FRM("%s"),header_name);
! }
if (ret == REDRAW_MARK) {
! h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,page,
! prompt_area);
return REDRAW_MARK;
}

! menu_ClearScreen(prompt_area);

/* bail out on error */
if (ret != 0) {
if (buffer)
h->hdrproc(h,headers,&buffer,TRUE,mailer_info,hdr_charset,aview,
! page,prompt_area);
return -1;
}
/* see if there is some processing required on this value */
return h->hdrproc(h,headers,&buffer,FALSE,mailer_info,hdr_charset,
! aview,page,prompt_area);
}


***************
*** 1215,1224 ****
buffer = new_string(display_charset);

if (string_len(p->fullname) || ! p->addr[0] || '@' == p->addr[0]) {
/* We do not quote displayed (only) address */
struct string * temp = NULL;



! switch (phrase_display_mode) {
case 0:

temp = cat_strings(buffer,p->fullname,1);
break;
--- 1256,1267 ----
buffer = new_string(display_charset);

if (string_len(p->fullname) || ! p->addr[0] || '@' == p->addr[0]) {
+ int pd = give_dt_enumerate_as_int(&phrase_display_mode);
+
/* We do not quote displayed (only) address */
struct string * temp = NULL;

! switch (pd) {
case 0:
temp = cat_strings(buffer,p->fullname,1);
break;
***************
*** 1343,1349 ****
}

static int hdrproc_from (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1386,1392 ----
}

static int hdrproc_from (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1352,1357 ****
--- 1395,1401 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->from,ptr,free_only,mailer_info,
aview);
***************
*** 1377,1383 ****
}

static int hdrproc_to (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1421,1427 ----
}

static int hdrproc_to (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1386,1391 ****
--- 1430,1436 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->to,ptr,free_only,mailer_info,
aview);
***************
*** 1411,1417 ****
}

static int hdrproc_cc (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1456,1462 ----
}

static int hdrproc_cc (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1420,1425 ****
--- 1465,1471 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->cc,ptr,free_only,mailer_info,
aview);
***************
*** 1445,1451 ****
}

static int hdrproc_bcc (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1491,1497 ----
}

static int hdrproc_bcc (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1454,1459 ****
--- 1500,1506 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->bcc,ptr,free_only,mailer_info,
aview);
***************
*** 1491,1497 ****
}

static int hdrproc_subject (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1538,1544 ----
}

static int hdrproc_subject (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1500,1505 ****
--- 1547,1553 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
if (!free_only) {
charset_t utf7;
***************
*** 1545,1551 ****
}

static int hdrproc_reply_to (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1593,1599 ----
}

static int hdrproc_reply_to (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1554,1559 ****
--- 1602,1608 ----
charset_t hdr_charset; /* NOT USED */


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_header(&headers->reply_to,ptr,free_only,mailer_info,
aview);
***************
*** 1579,1585 ****
}

static int hdrproc_action (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
--- 1628,1634 ----
}

static int hdrproc_action (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h; /* NOT USED */
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1588,1593 ****
--- 1637,1643 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_text(&headers->action,ptr,free_only,hdr_charset);
}
***************
*** 1619,1625 ****
*/

static int hdrproc_expires (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 1669,1675 ----
*/

static int hdrproc_expires (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1628,1633 ****
--- 1678,1684 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
int ret_val = 0;

***************
*** 1661,1679 ****
/* verify the number of days is valid and in range */
days = string_to_long(*ptr,&fail_pos);
if (days < 1 || fail_pos >= 0) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuExpiresNotNumber,
! "Expiration must be specified as a number of days."));
ret_val = -1;
goto free_it;
}

if (days > 8*7) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuExpiresOutOfRange,
! "Expiration date must be within eight weeks of today."));
ret_val = -1;
goto free_it;
}
--- 1712,1730 ----
/* verify the number of days is valid and in range */
days = string_to_long(*ptr,&fail_pos);
if (days < 1 || fail_pos >= 0) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuExpiresNotNumber,
! "Expiration must be specified as a number of days."));
ret_val = -1;
goto free_it;
}

if (days > 8*7) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuExpiresOutOfRange,
! "Expiration date must be within eight weeks of today."));
ret_val = -1;
goto free_it;
}
***************
*** 1721,1728 ****
return text_to_expval(headers->priority,hdr_charset);
}

! static int hdrproc_priority (h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 1772,1779 ----
return text_to_expval(headers->priority,hdr_charset);
}

! static int hdrproc_priority(h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1731,1736 ****
--- 1782,1788 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area; /* NOT USED */
{
return buffer_to_text(&headers->priority,ptr,free_only,hdr_charset);
}
***************
*** 1763,1769 ****
*/

static int hdrproc_precedence(h,headers,ptr,free_only,mailer_info,
! hdr_charset,aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 1815,1821 ----
*/

static int hdrproc_precedence(h,headers,ptr,free_only,mailer_info,
! hdr_charset,aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1772,1777 ****
--- 1824,1830 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
int ret_val = 0;

***************
*** 1840,1849 ****

/* see if we reached the end of the list without a match */
if (prec == NULL) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPrecedenceBadValue,
! "Unknown precedence value specified."));
ret_val = -1;
free_string(&X);
free(buf);
--- 1893,1902 ----

/* see if we reached the end of the list without a match */
if (prec == NULL) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPrecedenceBadValue,
! "Unknown precedence value specified."));
ret_val = -1;
free_string(&X);
free(buf);
***************
*** 1904,1911 ****
add_ascii_to_string(m,s2us(headers->in_reply_to.id));

if (headers->in_reply_to.text) {

! switch (phrase_display_mode) {
int X;
struct string * temp;

--- 1957,1965 ----
add_ascii_to_string(m,s2us(headers->in_reply_to.id));

if (headers->in_reply_to.text) {
+ int pd = give_dt_enumerate_as_int(&phrase_display_mode);

! switch (pd) {
int X;
struct string * temp;

***************
*** 1943,1949 ****
}

static int hdrproc_in_reply_to (h,headers,ptr,free_only,mailer_info,
! hdr_charset,aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 1997,2003 ----
}

static int hdrproc_in_reply_to (h,headers,ptr,free_only,mailer_info,
! hdr_charset,aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 1952,1957 ****
--- 2006,2012 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
int ret_val = 0;

***************
*** 1981,1991 ****
}

if (!p1) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuMissAngle,
! "Missing > after < on in-reply-to header."));
!
ret_val = -1;
goto free_it;
}
--- 2036,2046 ----
}

if (!p1) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuMissAngle,
! "Missing > after < on in-reply-to header."));
!
ret_val = -1;
goto free_it;
}
***************
*** 2015,2024 ****
if (p < Xl) {

if (!add_irt_phrase)
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPhraseIRT,
! "In-reply-to header should include only message-id"));

headers->in_reply_to.text = clip_from_string(*ptr,&p,Xl);
}
--- 2070,2079 ----
if (p < Xl) {

if (!add_irt_phrase)
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuPhraseIRT,
! "In-reply-to header should include only message-id"));

headers->in_reply_to.text = clip_from_string(*ptr,&p,Xl);
}
***************
*** 2067,2073 ****
*/

static int hdrproc_userhdr(h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
--- 2122,2128 ----
*/

static int hdrproc_userhdr(h,headers,ptr,free_only,mailer_info,hdr_charset,
! aview,page,prompt_area)
struct hdr_menu_item *h;
struct mailing_headers *headers;
struct string **ptr;
***************
*** 2076,2081 ****
--- 2131,2137 ----
charset_t hdr_charset;


struct AliasView *aview;
struct menu_context *page;

+ struct menu_context *prompt_area;
{
int ret_val = 0;

***************
*** 2125,2134 ****

if (!isascii(utf8_value[0]) &&
!isalnum(utf8_value[0])) {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuUserdefNotAlnum,
! "The user-defined header must begin with a letter or number."));
ret_val = -1;

free(utf8_value);
--- 2181,2190 ----

if (!isascii(utf8_value[0]) &&
!isalnum(utf8_value[0])) {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuUserdefNotAlnum,
! "The user-defined header must begin with a letter or number."));
ret_val = -1;

free(utf8_value);
***************
*** 2145,2154 ****

/* there needs to be a colon at the end of the header name */
if (*s != ':') {
! print_format_center(ERROR_LINE,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuUserdefMissingColon,
! "The user-defined header must have a colon after the field name."));
ret_val = -1;

free(utf8_value);
--- 2201,2210 ----

/* there needs to be a colon at the end of the header name */
if (*s != ':') {
! menu_print_format_center(prompt_area,3,
! CATGETS(elm_msg_cat, ElmSet,
! ElmHdrmenuUserdefMissingColon,
! "The user-defined header must have a colon after the field name."));
ret_val = -1;

free(utf8_value);
Index: elmME+.2.5.alpha5-cvs/src/help.c
*** elmME+.2.5.alpha4/src/help.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/help.c 2005-07-20 19:49:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: help.c,v 1.18.8.5 2004/09/25 13:29:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: help.c,v 1.18.8.6 2005/07/20 16:49:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 35,43 ****
static int display_file P_((char *file));


! void help(pager_help,page)
int pager_help;
struct menu_context *page;
{
/** Process the request for help [section] from the user.
If pager_help is TRUE, then act a little differently from
--- 35,44 ----
static int display_file P_((char *file));


! void help(pager_help,page, prompt_area)
int pager_help;
struct menu_context *page;
+ struct menu_context *prompt_area;
{
/** Process the request for help [section] from the user.
If pager_help is TRUE, then act a little differently from
***************
*** 49,54 ****
--- 50,56 ----
int ch; /* character buffer for input */
char *s; /* string pointer... */
int prompt_line, info_line;


+ int delay_redraw = 0;

static char *unknown_command = NULL;
int LINES, COLUMNS;
***************
*** 63,105 ****
"Unknown command. Use '?' for a list of commands.");
}

! MoveCursor(LINES-5,0);
! CleartoEOS();

if(pager_help) {
- put_border(page);
print_format_center(LINES-1,
CATGETS(elm_msg_cat, ElmSet, ElmHelpMessage,


"Press the key you want help for, '?' for a key list, or '.' to exit help"));

! prompt_line = LINES-4;
} else {
! print_format_center(LINES-5,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpSystem,
! "ELM Help System"));
! print_format_center(LINES-4,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpMessage,


! "Press the key you want help for, '?' for a key list, or '.' to exit help"));

! prompt_line = LINES-3;
}
info_line = prompt_line + 1;

do {
! PutLineX(prompt_line, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpPrompt,
! "Help for key: "));



! ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR

|READCH_sig_char);

if (ch == REDRAW_MARK) {
! menu_trigger_redraw(page);
! return;


}
if (ch == '.')

! return;

if (ch == TERMCH_interrupt_char)
! return;

s = unknown_command;

--- 65,114 ----
"Unknown command. Use '?' for a list of commands.");
}

! redraw:
! menu_ClearScreen(prompt_area);

if(pager_help) {
print_format_center(LINES-1,
CATGETS(elm_msg_cat, ElmSet, ElmHelpMessage,


"Press the key you want help for, '?' for a key list, or '.' to exit help"));

! prompt_line = 0;
} else {
! menu_print_format_center(prompt_area,0,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpSystem,
! "ELM Help System"));
! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpMessage,


! "Press the key you want help for, '?' for a key list, or '.' to exit help"));

! prompt_line = 2;
}
info_line = prompt_line + 1;

do {
! menu_PutLineX(prompt_area,
! prompt_line, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmHelpPrompt,
! "Help for key: "));

! ch = menu_ReadCh(prompt_area,REDRAW_MARK|READCH_CURSOR
|READCH_sig_char);

if (ch == REDRAW_MARK) {
! menu_ClearScreen(page); /* clear possible redraw mark */


!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! delay_redraw++;
!

! /* This clear redraw mark from prompt_area */
! goto redraw;
}


if (ch == '.')
! break;

if (ch == TERMCH_interrupt_char)
! break;

s = unknown_command;

***************
*** 212,222 ****
break;

#ifdef ALLOW_MAILBOX_EDITING
! case 'e': if (user_level < 2)
! break;
! if(!pager_help) s = catgets(elm_msg_cat, ElmSet, ElmHelpEditor,
"e = Invoke the editor on the entire folder, resynchronizing when done.");
! break;
#endif

case 'f': s = catgets(elm_msg_cat, ElmSet, ElmHelpForward,
--- 221,235 ----
break;

#ifdef ALLOW_MAILBOX_EDITING
! case 'e': {


! int ul = give_dt_enumerate_as_int(&user_level);
!

! if (ul < 2)
! break;
! if(!pager_help) s = catgets(elm_msg_cat, ElmSet, ElmHelpEditor,
"e = Invoke the editor on the entire folder, resynchronizing when done.");
! }
! break;
#endif

case 'f': s = catgets(elm_msg_cat, ElmSet, ElmHelpForward,
***************
*** 386,396 ****
"<number> = Make specified number the current message.");
}

! ClearLine(info_line);
! Centerline(info_line, s, page);



} while (ch != '.');

!
return;
}

--- 399,413 ----
"<number> = Make specified number the current message.");
}

! menu_ClearLine(prompt_area,info_line);
! Centerline(info_line, s, prompt_area);



} while (ch != '.');

!
! if (delay_redraw)
! menu_trigger_redraw(page);
!

! menu_trigger_redraw(prompt_area);
return;
}

***************
*** 422,427 ****
--- 439,445 ----



struct menu_context *page = NULL;

int LINES, COLUMNS;
+ long oldpos = 0;

if (err) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmHelpCouldntOpenFile,
***************
*** 442,447 ****
--- 460,466 ----

page = new_menu_context();

+ redraw:
menu_ClearScreen(page);

menu_get_sizes(page,&LINES, &COLUMNS);
***************
*** 449,459 ****
while (fgets(buffer, SLEN, fileptr) != NULL) {
if (lines > LINES-4) {
int X;


! PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,

! ElmHelpPressSpaceToContinue,
! "Press <space> to continue, 'q' to return."));
! X = menu_ReadCh(page,READCH_sig_char);
if(X == 'q' || X == 'Q' ||
X == TERMCH_interrupt_char) {
clear_error();
--- 468,478 ----
while (fgets(buffer, SLEN, fileptr) != NULL) {
if (lines > LINES-4) {
int X;


! menu_PutLineX(page,LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,

! ElmHelpPressSpaceToContinue,
! "Press <space> to continue, 'q' to return."));
! X = menu_ReadCh(page,READCH_sig_char|REDRAW_MARK);
if(X == 'q' || X == 'Q' ||
X == TERMCH_interrupt_char) {
clear_error();
***************
*** 461,468 ****
--- 480,495 ----

goto OUT;
}
+
+ if (REDRAW_MARK == X) {
+ fseek(fileptr,oldpos,SEEK_SET);
+ lines = 0;
+ goto redraw;
+ }
+
lines = 0;
menu_ClearScreen(page);
+ oldpos = ftell(fileptr);
Write_to_screen(FRM("%s\r"), buffer);
}
else
***************
*** 475,482 ****
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressAnyKeyToReturn,


"Press any key to return."));

! (void) menu_ReadCh(page,0);
clear_error();

fclose(fileptr);
--- 502,516 ----
CATGETS(elm_msg_cat, ElmSet,
ElmHelpPressAnyKeyToReturn,


"Press any key to return."));

+ {
+ int X = menu_ReadCh(page,REDRAW_MARK);
+ if (X == REDRAW_MARK) {
+ fseek(fileptr,oldpos,SEEK_SET);
+ lines = 0;
+ goto redraw;
+ }

! }
clear_error();

fclose(fileptr);
Index: elmME+.2.5.alpha5-cvs/src/init.c
*** elmME+.2.5.alpha4/src/init.c 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/init.c 2005-07-23 22:01:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: init.c,v 1.49.8.9 2004/08/16 05:12:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: init.c,v 1.49.8.11 2005/07/23 19:01:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.49.8.11 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 53,85 ****



extern char version_buff[];

- char *error_description();
-

- #ifndef I_UNISTD
- char *getlogin();
- unsigned short getgid(), getuid();

- struct passwd *getpwuid();
- #endif

-
- char *get_full_name();
-
SIGHAND_TYPE
#ifdef SIGTSTP
! sig_user_stop(), sig_return_from_user_stop(),
#endif
#ifdef SIGWINCH
! winch_signal(),
#endif
! quit_signal(), term_signal(), ill_signal(),
! fpe_signal(), segv_signal(),
#ifdef SIGBUS
! bus_signal(),
#endif
! alarm_signal(), pipe_signal(), hup_signal(),
! usr1_signal(), usr2_signal() ;

- extern void init_opts_menu();
- extern void malloc_failed_exit();

static struct folder_info *arg_to_folder P_((char * arg, int prompt,
struct AliasView *aview,
--- 53,73 ----

extern char version_buff[];

SIGHAND_TYPE
#ifdef SIGTSTP
! sig_user_stop P_((int)), sig_return_from_user_stop P_((int)),
#endif
#ifdef SIGWINCH
! winch_signal P_((int)),
#endif
! quit_signal P_((int)), term_signal P_((int)), ill_signal P_((int)),
! fpe_signal P_((int)), segv_signal P_((int)),
#ifdef SIGBUS
! bus_signal P_((int)),
#endif
! alarm_signal P_((int)), pipe_signal P_((int)), hup_signal P_((int)),
! usr1_signal P_((int)), usr2_signal P_((int)) ;


static struct folder_info *arg_to_folder P_((char * arg, int prompt,
struct AliasView *aview,
***************
*** 98,104 ****


struct folder_browser * XXX = new_browser(selection_folder);

struct string * buffer = new_string2(local_fs_charset,
s2us(arg));


- int redraw = 0;

if (!browser_expand(XXX,&buffer,NULL,aview)) {
if (!prompt)
--- 86,91 ----
***************
*** 107,113 ****
if (with_title)
with_title = "";

! gen_browser(page, XXX,&buffer,&redraw,word_change,NULL,
aview,
CATGETS(elm_msg_cat, ElmSet,
ElmSelectFolder,
--- 94,100 ----
if (with_title)
with_title = "";

! gen_browser(page, XXX,&buffer,word_change,NULL,
aview,
CATGETS(elm_msg_cat, ElmSet,
ElmSelectFolder,
***************
*** 128,134 ****
DPRINT(Debug,1,
(&Debug,
"Error: given file %s as folder - unreadable (%s)!\n",
! folder->cur_folder_sys, error_description(errno)));

/* Free folder structure */

--- 115,121 ----
DPRINT(Debug,1,
(&Debug,
"Error: given file %s as folder - unreadable (%s)!\n",
! folder->cur_folder_sys, strerror(errno)));

/* Free folder structure */

***************
*** 136,159 ****
}

cleanup:
! free_string(&buffer);
free_dir(&XXX);

return folder;
}

! void initialize(requestedmfiles, main_mailbox, main_aliases, header_page,
page)
- char **requestedmfiles; /* first mail files to open, empty if the default */
- struct MailboxView **main_mailbox;
struct AliasView **main_aliases;
- int *header_page;
struct menu_context **page;
! {
! struct folder_info *folder = NULL;
! int several_folders = 0;



! char buffer[SLEN], *cp;


elm_sfprintf(version_buff, sizeof version_buff,
--- 123,143 ----
}

cleanup:


! if (buffer)
! free_string(&buffer);
!

free_dir(&XXX);

return folder;
}

! void initialize(main_aliases,
page)
struct AliasView **main_aliases;
struct menu_context **page;
! {

! int init_scr_return;


elm_sfprintf(version_buff, sizeof version_buff,
***************
*** 191,196 ****
--- 175,188 ----
*/
safe_malloc_fail_handler = malloc_failed_exit;

+ init_opts_menu();
+ init_scr_return = InitScreen(page);
+
+ out_util_setup();
+
+ /* make all newly created files private */
+ original_umask = umask(077);
+
/* get username and home directory
save original user and group ids
*/
***************
*** 205,211 ****


if (setgid(groupid) < 0) {
int err = errno;

lib_error(FRM("init: setgid(%d) FAILED: %s"),
! groupid,error_description(err));
}
}

--- 197,203 ----


if (setgid(groupid) < 0) {
int err = errno;

lib_error(FRM("init: setgid(%d) FAILED: %s"),
! groupid,strerror(err));
}
}

***************
*** 252,266 ****

/* directory_check() requires terminal */
if (OPMODE_IS_INTERACTIVE(opmode)) {
- int init_scr_return = -1;
int lines = -1;
int columns = -1;
!
! init_opts_menu();
! init_scr_return = InitScreen(page);
!
! out_util_setup();
!

if (init_scr_return < 0) {
if (init_scr_return == -1) {
--- 244,252 ----

/* directory_check() requires terminal */
if (OPMODE_IS_INTERACTIVE(opmode)) {
int lines = -1;
int columns = -1;
! char *cp;

if (init_scr_return < 0) {
if (init_scr_return == -1) {
***************
*** 365,375 ****
init_backgroud_handling();
#endif


*main_aliases = new_aliasview();
add_files_to_aview(*main_aliases);

-
if (write_elmrc) {
int err;
FILE *f = NULL;
--- 351,367 ----
init_backgroud_handling();
#endif

+ init_mailerlib();
+
+ /* Determine options that might be set in the global elmrc */
+ if (init_defaults() != 0) {
+ sleep(1);
+ }
+

*main_aliases = new_aliasview();
add_files_to_aview(*main_aliases);

if (write_elmrc) {
int err;
FILE *f = NULL;
***************
*** 382,407 ****
if (err)


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));
else if (!(f = fopen(tmp,"w"))) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));
} else {
dump_iso2022_map(f,ml_user);
if (EOF == fclose(f)) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));

} else if (0 != rename(tmp,user_iso2022_sets)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %30s"),
user_iso2022_sets,
! error_description(err));

} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 374,399 ----
if (err)


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));
else if (!(f = fopen(tmp,"w"))) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));
} else {
dump_iso2022_map(f,ml_user);
if (EOF == fclose(f)) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));

} else if (0 != rename(tmp,user_iso2022_sets)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %30s"),
user_iso2022_sets,
! strerror(err));

} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 418,443 ****
if (err)


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));
else if (!(f = fopen(tmp,"w"))) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));
} else {
dump_locale_map(f,user_locale_map);
if (EOF == fclose(f)) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));

} else if (0 != rename(tmp,user_mime_charsets)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %30s"),
user_mime_charsets,
! error_description(err));

} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 410,435 ----
if (err)


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));
else if (!(f = fopen(tmp,"w"))) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));
} else {
dump_locale_map(f,user_locale_map);
if (EOF == fclose(f)) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));

} else if (0 != rename(tmp,user_mime_charsets)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %30s"),
user_mime_charsets,
! strerror(err));

} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 453,478 ****
if (err)


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));
else if (!(f = fopen(tmp,"w"))) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));
} else {
dump_terminal_map(f,user_terminal_map);
if (EOF == fclose(f)) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));

} else if (0 != rename(tmp,user_terminal_info)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %30s"),
user_terminal_info,
! error_description(err));

} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 445,470 ----
if (err)


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));
else if (!(f = fopen(tmp,"w"))) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));
} else {
dump_terminal_map(f,user_terminal_map);
if (EOF == fclose(f)) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));

} else if (0 != rename(tmp,user_terminal_info)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %30s"),
user_terminal_info,
! strerror(err));

} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 489,514 ****
if (err)


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));
else if (!(f = fopen(tmp,"w"))) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));
} else {
dump_service_entries(f,0 /* USER */);
if (EOF == fclose(f)) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(err));

} else if (0 != rename(tmp,user_mail_services)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %30s"),
user_mail_services,
! error_description(err));

} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 481,506 ----
if (err)


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));
else if (!(f = fopen(tmp,"w"))) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));
} else {
dump_service_entries(f,0 /* USER */);
if (EOF == fclose(f)) {
int err = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(err));

} else if (0 != rename(tmp,user_mail_services)) {
int err = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %30s"),
user_mail_services,
! strerror(err));

} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 541,549 ****
/** clear the screen **/
menu_ClearScreen(*page);


! if (-1 != wanted_switchmode)
! allow_charset_switching = wanted_switchmode;

if (wanted_charset) {
charset_t X = MIME_name_to_charset(wanted_charset,0);
--- 533,546 ----
/** clear the screen **/
menu_ClearScreen(*page);

+ }
+
+ init_system_charset();

! if (-1 != wanted_switchmode)
! allow_charset_switching = wanted_switchmode;
!
! if (init_scr_return >= 0) {

if (wanted_charset) {
charset_t X = MIME_name_to_charset(wanted_charset,0);
***************
*** 592,754 ****
"Title name for terminal can not set"));
}
}
!


! post_process_charset_options();
!
! /* headers_per_page is needed also on send_only mode
! and not on only READMODE, because on sendmode
! '/' can be used for view canceled mails
! */


! {
! int LINES, COLUMNS;
!

! menu_get_sizes(*page,&LINES, &COLUMNS);
!
! if (mini_menu)
! headers_per_page = LINES - 14;
! else
! headers_per_page = LINES - 9; /* 5 more headers! */
!
! if (headers_per_page <= 0) {
! erase_menu_context(page);
!
! Raw(OFF);


! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmWindowSizeTooSmall,
! "The window is too small to run Elm. It must have at least %d rows"),
! LINES - headers_per_page);

! error_wait(); /* Be sure that we do not exit before error is shown */
!

! exit(1);
! }
! }
!
! if (OPMODE_IS_READMODE(opmode)) {
! /* figure out what folder we are reading and verify access */
!
! /* Determine the mail file to read */
! if (!requestedmfiles || ! requestedmfiles[0]) {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val)
! folder = enter_new_folder(default_val,
! TreatAsSpooled);
! else
! folder = NULL;
! } else {
! /* Assuming that file name given with -f is on
! local-fs-charset and not system_charset
! */

- if (requestedmfiles[1])
- several_folders++;

! folder = arg_to_folder(requestedmfiles[0], !several_folders,
! *main_aliases, *page);
! }
! if (!folder) {
! erase_menu_context(page);



! Raw_OFF(1); /* Raw(OFF) and reprint error message */
! #ifdef REMOTE_MBX
! close_cached_connections();
! #endif

! exit(0);
! }


! /* if "check_size" is set then we don't want to read empty mbox */
! if (opmode == OPMODE_READ_NONEMPTY) {
! if(check_mailfile_size(folder) != 0) {
! erase_menu_context(page);

! close_folder(folder,CLOSE_NORMAL);


! Raw_OFF(1); /* Raw(OFF) and reprint error message */

! #ifdef REMOTE_MBX
! close_cached_connections();
! #endif
!

! exit(0);
! }
}

! if (with_title)
! set_folder_window_title(folder,
! with_title[0] ? with_title : wanted_title_string,
! wanted_icon_string);
! else if (set_window_title)
! set_folder_window_title(folder,


! wanted_title_string,
! wanted_icon_string);
!

! /* read in the folder! */
! newmbox_1(folder, FALSE, main_mailbox, FALSE, header_page,
! *page);
!
! if (several_folders) {
! int i;

- if (wanted_mailbox_title) {
- /* must not fred -- shared/stored to structure
- -- set_mailbox_title will free_string()
- it later */
- set_mailbox_title(*main_mailbox,
- new_string2(system_charset,
- s2us(wanted_mailbox_title)));
- }
-
- /* Index 0 is already processed! */
- for (i = 1; requestedmfiles[i]; i++) {
- struct folder_info *folder =
- arg_to_folder(requestedmfiles[i],FALSE,*main_aliases,
- *page);
-
- if (folder) {
- newmbox_1(folder, FALSE, main_mailbox,TRUE,
- header_page, *page);
-
- }
-
- }
}
!
!
}
}

! /** fix the shell if needed **/

! if (shell[0] != '/') {
! elm_sfprintf(buffer, sizeof buffer,
! FRM("/bin/%s"),
! shell);
! strfcpy(shell, buffer, sizeof shell);
! }


! #ifdef DEBUG
! if (Debug.active >= 2 && Debug.active < 10) {
! debug_action_call(&Debug,
! "hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
! hostname, username, full_username);
! debug_action_call(&Debug,
! "home = %-20s \n",
! home);
!
! debug_action_call(&Debug,
! "folders = %-20s \tprintout = %-20s\n",
! folders, printout);
!
! debug_action_call(&Debug,
! " \tprefix = %-20s \tshell = %-20s\n\n",
! prefixchars, shell);
}
- #endif
- }


/*
* Local Variables:
--- 589,749 ----
"Title name for terminal can not set"));
}
}
! }


! post_process_charset_options();

! #ifdef DEBUG
! if (Debug.active >= 2 && Debug.active < 10) {
! debug_action_call(&Debug,
! "hostname = %-20s \tusername = %-20s \tfullname = %-20s\n",
! hostname, username, full_username);
! debug_action_call(&Debug,
! "home = %-20s \n",
! home);
! debug_action_call(&Debug,
! "printout = %-20s\n",
! printout);
!
! debug_action_call(&Debug,
! " \tprefix = %-20s \t\n\n",
! prefixchars);
! }
! #endif
! }


! struct MailboxView * initialize_mailbox(requestedmfiles,
! page, main_aliases)
! char **requestedmfiles; /* first mail files to open, empty if the default */
!
! struct menu_context *page;
! struct AliasView *main_aliases;
! {
! struct MailboxView *main_mailbox = NULL;
! struct folder_info *folder = NULL;
! int several_folders = 0;

! /* Determine the mail file to read */
! if (!requestedmfiles || ! requestedmfiles[0]) {
! char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");
!
! if (default_val)
! folder = enter_new_folder(default_val,
! TreatAsSpooled);
! else
! folder = NULL;
! } else {
! /* Assuming that file name given with -f is on
! local-fs-charset and not system_charset
! */

+ if (requestedmfiles[1])
+ several_folders++;
+
+ folder = arg_to_folder(requestedmfiles[0], !several_folders,
+ main_aliases, page);
+ }

! if (!folder && !several_folders) {
! return NULL;
! }

! if (folder) {

! /* if "check_size" is set then we don't want to read empty mbox */
! if (opmode == OPMODE_READ_NONEMPTY && !several_folders) {
! if(check_mailfile_size(folder) != 0) {
!
! leave_old_folder(&folder,CLOSE_NORMAL);
!
! return NULL; /* FIXME -- not completely correct */
}
+ }
+
+ if (with_title)
+ set_folder_window_title(folder,
+ with_title[0] ? with_title : wanted_title_string,
+ wanted_icon_string);
+ else if (set_window_title)
+ set_folder_window_title(folder,
+ wanted_title_string,
+ wanted_icon_string);
+
+ /* read in the folder! */
+ newmbox_1(folder, FALSE, &main_mailbox, FALSE,
+ page);
+ }

! if (several_folders) {
! int i;
!
! if (wanted_mailbox_title) {
! /* must not fred -- shared/stored to structure
! -- set_mailbox_title will free_string()
! it later */
! set_mailbox_title(main_mailbox,
! new_string2(system_charset,
! s2us(wanted_mailbox_title)));
! }
!
! /* Index 0 is already processed! */
! for (i = 1; requestedmfiles[i]; i++) {
! struct folder_info *folder =
! arg_to_folder(requestedmfiles[i],FALSE,main_aliases,
! page);
!
! if (folder) {
! newmbox_1(folder, FALSE, &main_mailbox,
! main_mailbox ? TRUE : FALSE,
! page);

}
! }
! }
!
! if (opmode == OPMODE_READ_NONEMPTY ||
! opmode == OPMODE_READ_UNREAD) {
! int mc = get_message_count(main_mailbox);
!
! if (0 == mc) {
!
! /* This also free's folder */
! free_mailbox(& main_mailbox);
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoMail,
! "You have no mail."));
!
! return NULL;
}
}

! if (opmode == OPMODE_READ_UNREAD) {
! int i;
! int unread = 0;
! int mc = get_message_count(main_mailbox);
!
! for (i = 0; i < mc; i++) {
! struct header_rec * hdr = give_header(main_mailbox,i);
!
! if (hdr &&
! ison(hdr->status, UNREAD))
! unread++;
! }

! if (!unread) {
! /* This also free's folder */
! free_mailbox(& main_mailbox);

+ lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoUnreadMail,
+ "You have no unread mail."));

! return NULL;
! }
}

+ return main_mailbox;


+ }

/*
* Local Variables:

Index: elmME+.2.5.alpha5-cvs/src/in_utils.c
*** elmME+.2.5.alpha4/src/in_utils.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/in_utils.c 2005-07-26 11:28:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35.8.6 2004/10/09 17:25:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: in_utils.c,v 1.35.8.9 2005/07/26 08:28:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 51,57 ****

extern int tabspacing;

! unsigned alarm();

#define erase_a_char() { Writechar(BACKSPACE); Writechar(' '); \
Writechar(BACKSPACE); FlushBuffer(); }
--- 51,57 ----

extern int tabspacing;

!

#define erase_a_char() { Writechar(BACKSPACE); Writechar(' '); \
Writechar(BACKSPACE); FlushBuffer(); }
***************
*** 72,79 ****
int def;
int flags;
struct menu_context *page;


! CONST char * format;
! CONST char *msg;
va_dcl
#endif
{

--- 72,79 ----
int def;
int flags;
struct menu_context *page;


! const char * format;
! const char *msg;
va_dcl
#endif
{
***************

*** 115,126 ****
DPRINT(Debug,6, (&Debug,"prompt_letter: pos line=%d column=%d\n",
line, (center || (cols < 2)) ? 0 : cols-2));


! MoveCursor(line, (center || (cols < 2)) ? 0 : cols-2);
! CleartoEOLN();
!
! PutLineX(line, center ? cols/2 : cols,
! FRM("%S%c%c"), question, def, BACKSPACE);
FlushBuffer();

ch = menu_ReadCh(page, REDRAW_MARK
--- 115,125 ----
DPRINT(Debug,6, (&Debug,"prompt_letter: pos line=%d column=%d\n",
line, (center || (cols < 2)) ? 0 : cols-2));

+ menu_MoveCursor(page,line, (center || (cols < 2)) ? 0 : cols-2);
+ menu_CleartoEOLN(page);

! menu_PutLineX(page,line, center ? cols/2 : cols,
! FRM("%S%c%c"), question, def, BACKSPACE);
FlushBuffer();

ch = menu_ReadCh(page, REDRAW_MARK
***************
*** 145,151 ****
for (x = letters; *x; x++) {

if (ch == *x) {
! Writechar(ch);
goto out;
}
}
--- 144,150 ----
for (x = letters; *x; x++) {

if (ch == *x) {
! menu_Writechar(page,ch);
goto out;
}
}
***************
*** 162,181 ****
for (x = letters; *x; x++) {

if (ch == *x) {
! Writechar(ch);
goto out;
}
}

if(ch == *def_ans_yes && yesno) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
break;
} else if (ch == *def_ans_no && yesno) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
break;
}

! Writechar('?');
FlushBuffer();
#if POLL_METHOD
wait_for_timeout(1);
--- 161,182 ----
for (x = letters; *x; x++) {

if (ch == *x) {
! menu_Writechar(page,ch);
goto out;
}
}

if(ch == *def_ans_yes && yesno) {
! menu_Write_to_screen(page,CATGETS(elm_msg_cat, ElmSet,
! ElmYesWord, "Yes."));
break;
} else if (ch == *def_ans_no && yesno) {
! menu_Write_to_screen(page,CATGETS(elm_msg_cat, ElmSet,
! ElmNoWord, "No."));
break;
}

! menu_Writechar(page,'?');
FlushBuffer();
#if POLL_METHOD
wait_for_timeout(1);
***************
*** 188,193 ****
--- 189,196 ----

out:
FlushBuffer();
+ free_string(&question);
+

if (EOF != ch && REDRAW_MARK != ch && ('L'&31) != ch &&
TERMCH_interrupt_char != ch) {
***************
*** 198,205 ****


sleep((sleepmsg + 1) / 2);

#endif
}
! MoveCursor(line, (center || (cols < 2)) ? 0 : cols-2);
! CleartoEOLN();
}

return ch;
--- 201,208 ----


sleep((sleepmsg + 1) / 2);

#endif
}
! menu_MoveCursor(page,line, (center || (cols < 2)) ? 0 : cols-2);
! menu_CleartoEOLN(page);
}

return ch;
***************
*** 219,225 ****
**/
int ch, cols;
int LINES, COLUMNS;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

--- 222,229 ----
**/
int ch, cols;
int LINES, COLUMNS;
! int redraw1 = 0;
!
redraw:
menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 231,246 ****
DPRINT(Debug,6, (&Debug,"want_to: pos line=%d column=%d\n",
where, (clear_and_center || (cols < 2)) ? 0 : cols-2));

! MoveCursor(where, (clear_and_center || (cols < 2)) ? 0 : cols-2);
! CleartoEOLN();
!
! PutLineX(where, clear_and_center ? cols/2 : cols,
! FRM("%s%c%c"), question, dflt, BACKSPACE);
FlushBuffer();

ch = menu_ReadCh(page, REDRAW_MARK);


! if (ch == REDRAW_MARK)

! goto redraw;
if (ch == EOF) {
leave(0);
}
--- 235,259 ----
DPRINT(Debug,6, (&Debug,"want_to: pos line=%d column=%d\n",
where, (clear_and_center || (cols < 2)) ? 0 : cols-2));

! menu_MoveCursor(page,
! where, (clear_and_center || (cols < 2)) ? 0 : cols-2);


! menu_CleartoEOLN(page);
!
! menu_PutLineX(page,

! where, clear_and_center ? cols/2 : cols,
! FRM("%s%c%c"), question, dflt, BACKSPACE);
FlushBuffer();

ch = menu_ReadCh(page, REDRAW_MARK);


! if (ch == REDRAW_MARK) {

! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! redraw1++;
! goto redraw;
! }
if (ch == EOF) {
leave(0);
}
***************
*** 248,255 ****

while (!( ch == *def_ans_yes || ch == *def_ans_no || ch == '\n' || ch == '\r')) {
ch = menu_ReadCh(page,REDRAW_MARK);


! if (ch == REDRAW_MARK)

goto redraw;
if (ch == EOF) {
leave(0); /* ???? global reference */
}
--- 261,275 ----

while (!( ch == *def_ans_yes || ch == *def_ans_no || ch == '\n' || ch == '\r')) {
ch = menu_ReadCh(page,REDRAW_MARK);


! if (ch == REDRAW_MARK) {

! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! redraw1++;
goto redraw;
+ }
if (ch == EOF) {
leave(0); /* ???? global reference */
}
***************
*** 262,270 ****
ch = dflt;

if(ch == *def_ans_yes)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
else if (ch == *def_ans_no)
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
else {
DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
return(ch); /* Don't write anything, just return */
--- 282,294 ----
ch = dflt;

if(ch == *def_ans_yes)
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
! "Yes."));


else if (ch == *def_ans_no)

! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
else {
DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
return(ch); /* Don't write anything, just return */
***************
*** 277,295 ****


sleep((sleepmsg + 1) / 2);

#endif
}
! MoveCursor(where, (clear_and_center || (cols < 2)) ? 0 : cols-2);
! CleartoEOLN();

DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
return(ch);
}

! int read_number(ch, item, dfltval, page, line)
int ch;
! CONST struct string *item;
int dfltval;
struct menu_context *page;
! int line;
{
/** Read a number, where 'ch' is the leading digit! **/

--- 301,323 ----


sleep((sleepmsg + 1) / 2);

#endif
}
! menu_MoveCursor(page,where,
! (clear_and_center || (cols < 2)) ? 0 : cols-2);
! menu_CleartoEOLN(page);
!
! if (redraw1)
! menu_trigger_redraw(page);

DPRINT(Debug,3,(&Debug,"want_to [%s]=%c\n",question,ch));
return(ch);
}

! int read_number(ch, item, dfltval, page,prompt_area)
int ch;
! const struct string *item;
int dfltval;
struct menu_context *page;
! struct menu_context *prompt_area;
{
/** Read a number, where 'ch' is the leading digit! **/

***************
*** 301,318 ****

int need_redraw = 0;
int num, status;
! int bad;
! int LINES, COLUMNS;
fill_ascii_to_string(buff,1,ch);

redraw:
! menu_get_sizes(page,&LINES, &COLUMNS);
!
! if (line >= LINES && LINES > 0)
! line = LINES-1;

status = optionally_enter2(page,
! &buff, line, COLUMNS-40,
OE_APPEND_CURRENT|OE_REDRAW_MARK|
OE_SIG_CHAR /* allow Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
--- 329,345 ----

int need_redraw = 0;
int num, status;
! int bad, li,co, line;
!
fill_ascii_to_string(buff,1,ch);
+ menu_get_sizes(page,&li, &co);

redraw:


! /* FIXME --optionally_enter* should use prompt_page */

! line = menu_GetAbsLine(prompt_area,0);

status = optionally_enter2(page,
! &buff, line, co-40,
OE_APPEND_CURRENT|OE_REDRAW_MARK|
OE_SIG_CHAR /* allow Ctrl-C */,
CATGETS(elm_msg_cat, ElmSet,
***************
*** 322,327 ****
--- 349,356 ----
if (status == -1) /* Ctrl-C */
return(dfltval);
if (status == REDRAW_MARK) {
+ menu_ClearScreen(page); /* Reset possible redraw flag */
+
/* Can not set menu_trigger_redraw here or causes
redraw loop ... */
need_redraw = 1;
***************
*** 331,344 ****
if (need_redraw)
menu_trigger_redraw(page);

! if (0 == string_len(buff))
return dfltval;

num = string_to_long(buff,&bad);

if (bad >= 0)
return dfltval;
-
return(num);
}

--- 360,376 ----
if (need_redraw)
menu_trigger_redraw(page);

! if (0 == string_len(buff)) {
! free_string(&buff);
return dfltval;
+ }

num = string_to_long(buff,&bad);

+ free_string(&buff);
+
if (bad >= 0)
return dfltval;
return(num);
}

***************
*** 407,415 ****

if (info->current_page != base_page) {

- resize = READCH_resize;
-
if (menu_resized(info->current_page)) {

if (info->ch_count == 0)
buffer = info->give_buffer(info,em_redraw_initial,
--- 439,448 ----

if (info->current_page != base_page) {

if (menu_resized(info->current_page)) {
+
+
+ menu_get_sizes(info->current_page, &LINES, &COLUMNS);

if (info->ch_count == 0)
buffer = info->give_buffer(info,em_redraw_initial,
***************
*** 420,425 ****
--- 453,461 ----

} else if (menu_need_redraw(info->current_page)) {

+ internal_redraw:
+
+ menu_ClearScreen(info->current_page); /* Reset redraw flag */
if (info->ch_count == 0)
buffer = info->give_buffer(info,em_redraw_initial,
base_page);
***************
*** 459,464 ****
--- 495,505 ----
goto resize_mark;

case REDRAW_MARK:
+ if (info->current_page != base_page) {
+ DPRINT(Debug,4, (&Debug," ... redrawing\n"));
+ goto internal_redraw;
+ }
+
ret = REDRAW_MARK;
goto out;
case TERMCH_eof_char:
***************
*** 714,721 ****
0x0009 /* HT */ != c)
goto other;

! GetXYLocation(&x1, &y1);
! StartBold();
while (ok) {

if (idx > 78) {
--- 755,762 ----
0x0009 /* HT */ != c)
goto other;

! menu_GetXYLocation(info->current_page,&x1, &y1);
! menu_StartXX(info->current_page,pg_BOLD);
while (ok) {

if (idx > 78) {
***************
*** 723,729 ****
break;
}
raw_data[idx++] = raw;
! Writechar(raw);

ch = menu_ReadCh2(info->current_page,
redraw|READCH_CURSOR|
--- 764,770 ----
break;
}
raw_data[idx++] = raw;
! menu_Writechar(info->current_page,raw);

ch = menu_ReadCh2(info->current_page,
redraw|READCH_CURSOR|
***************
*** 759,767 ****
break;
}
}
! EndBold();
! MoveCursor(x1,y1);
! CleartoEOLN();
raw_data[idx] = '\0';

DPRINT(Debug,4,(&Debug,
--- 800,808 ----
break;
}
}
! menu_EndXX(info->current_page,pg_BOLD);
! menu_MoveCursor(info->current_page,x1,y1);
! menu_CleartoEOLN(info->current_page);
raw_data[idx] = '\0';

DPRINT(Debug,4,(&Debug,
***************
*** 955,968 ****
out:

if (base_page != info->current_page) {
- erase_menu_context(& info->current_page);

DPRINT(Debug,9,(&Debug,
"enter_helper: erasing menu_context created by give_buffer()\n"));
!
info->current_page = base_page;
}

DPRINT(Debug,9,(&Debug,
"enter_helper=%d (returns)\n",ret));
return ret;
--- 996,1013 ----
out:

if (base_page != info->current_page) {

+ erase_menu_context(& info->current_page);
+
DPRINT(Debug,9,(&Debug,
"enter_helper: erasing menu_context created by give_buffer()\n"));
!
info->current_page = base_page;
+
+ menu_trigger_redraw(base_page);
}

+
DPRINT(Debug,9,(&Debug,
"enter_helper=%d (returns)\n",ret));
return ret;
***************
*** 1018,1023 ****
--- 1063,1071 ----
em));

return NULL;


+
+ default:
+ break;
}

DPRINT(Debug,4,(&Debug, "-- gb_optionally_enter(..,%d)=non null\n",
***************
*** 1049,1056 ****
int x;
int y;
int flags;

! CONST char * format;
! CONST char *msg;
va_dcl
#endif
{

--- 1097,1104 ----
int x;
int y;
int flags;

! const char * format;
! const char *msg;
va_dcl
#endif
{
***************

*** 1130,1136 ****

*buffer = vector[1];

- out:
nested_redraw_mark = 0;
free_string(&question);

--- 1178,1183 ----
Index: elmME+.2.5.alpha5-cvs/src/leavembox.c
*** elmME+.2.5.alpha4/src/leavembox.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/leavembox.c 2005-07-23 20:14:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.9 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: leavembox.c,v 1.44.8.12 2005/07/23 17:14:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.12 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 48,55 ****


extern int errno;
#endif

- char *error_description();
-

static void block_signals P_((void));
static void unblock_signals P_((void));

--- 48,53 ----
***************
*** 175,181 ****
storage->current_folder->cur_folder_sys));


! if(!open_folder_lock(OUTGOING,storage->current_folder)) {

DPRINT(Debug,2,(&Debug,
" Failed to lock %S (%s)\n",
--- 173,179 ----
storage->current_folder->cur_folder_sys));


! if(!open_folder_lock(LOCK_OUTGOING,storage->current_folder)) {

DPRINT(Debug,2,(&Debug,
" Failed to lock %S (%s)\n",
***************
*** 340,350 ****


int leave_mbox(resyncing, quitting, prompt, new_folder, mailbox,
! header_page, page)
int resyncing, quitting, prompt;
struct folder_info **new_folder;


struct MailboxView *mailbox;
- int *header_page;
struct menu_context *page;
{

/** Close folder, deleting some messages, storing others in mbox,
--- 338,347 ----


int leave_mbox(resyncing, quitting, prompt, new_folder, mailbox,
! page)
int resyncing, quitting, prompt;
struct folder_info **new_folder;


struct MailboxView *mailbox;
struct menu_context *page;

{
/** Close folder, deleting some messages, storing others in mbox,
***************
*** 372,381 ****
int to_delete = 0, to_store = 0, to_keep = 0, to_ignore = 0,
to_hide = 0;
int marked_deleted=0;
! int i,
! last_sortby, l_ask_delete, l_ask_keep, l_ask_store,
! asked_storage_q,
! num_chgd_status;

int return_value = -1;
struct folder_browser * recv_browser = new_browser(selection_folder);
--- 369,378 ----
int to_delete = 0, to_store = 0, to_keep = 0, to_ignore = 0,
to_hide = 0;
int marked_deleted=0;
! int i,
! l_ask_delete, l_ask_keep, l_ask_store,
! asked_storage_q;
!

int return_value = -1;
struct folder_browser * recv_browser = new_browser(selection_folder);
***************
*** 383,388 ****
--- 380,386 ----
int recv_flags = 0;
WRITE_STATE recv_writeptr = NULL;

+ int num_chgd_status = 0;
int can_store = 0;
int current_is_received = 0;
int new_is_received = 0;
***************
*** 1272,1278 ****

if (to_store > 0) {
if (!end_write_folder(recv_browser,&recv_writeptr)) {
- write_received_failure:
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCopyMessageFailed,
"OOPS! Storing of mail failed!"));
--- 1270,1275 ----
Index: elmME+.2.5.alpha5-cvs/src/limit.c
*** elmME+.2.5.alpha4/src/limit.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/limit.c 2005-07-23 20:14:17.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: limit.c,v 1.32.8.2 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: limit.c,v 1.32.8.4 2005/07/23 17:14:17 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 35,43 ****
}


- char *shift_lower();
- void ClearSelection();
-
static int SelectTaggedMessages P_((struct menu_common *menu,
int *vector));
static int SelectTaggedMessages(menu, vector)
--- 35,40 ----
***************
*** 49,65 ****


for (iindex = 0; iindex < mc; iindex++) {
! if (mcommon_ison_status(menu,iindex, TAGGED)) {
vector[count++] = iindex;
}
}
return(count);
}


! void limit(menu, page)


struct menu_common *menu;
struct menu_context *page;

{
/** if we changed selection criteria = need redraw
use menu_trigger_redraw(page)
--- 46,80 ----


for (iindex = 0; iindex < mc; iindex++) {
! if (mcommon_ison_status(menu,iindex, status_basic,TAGGED)) {
vector[count++] = iindex;
}
}
return(count);
}

+ static int SelectFlaggedMessages P_((struct menu_common *menu,
+ int *vector));
+ static int SelectFlaggedMessages(menu, vector)
+ struct menu_common *menu;
+ int *vector;
+ {
+ int iindex, count = 0;
+ int mc = mcommon_get_count(menu);
+
+
+ for (iindex = 0; iindex < mc; iindex++) {
+ if (mcommon_ison_status(menu,iindex, status_1,S1_FLAGGED)) {
+ vector[count++] = iindex;
+ }
+ }
+ return(count);
+ }

! void limit(menu, page,LOC)


struct menu_common *menu;
struct menu_context *page;

+ struct screen_parts *LOC;
{
/** if we changed selection criteria = need redraw
use menu_trigger_redraw(page)
***************
*** 67,125 ****

int last_selected, all;
struct string *criteria = NULL;


! int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES, &COLUMNS);

last_selected = mcommon_get_selected(menu);

all = 0;

if (mcommon_get_selected(menu)) {
int c;
! PutLineX(LINES-3, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitAlreadyHave,
! "Already have selection criteria - add more? (%c/%c) %c%c"),
! *def_ans_yes, *def_ans_no, *def_ans_no, BACKSPACE);
! c = menu_ReadCh(page,0);
! if (
#ifdef ASCII_CTYPE
! isascii(c) &&
#endif
! tolower((unsigned char)c) == *def_ans_yes) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
! PutLineX(LINES-4, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitAdding,
! "Adding criteria..."));
} else {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
! PutLineX(LINES-4, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitChanging,
! "Change criteria..."));

mcommon_set_selected(menu,0);
}
}



while(1) {
/* CLear previous prompt */
! MoveCursor(LINES-3,0); CleartoEOLN();

! if (0 != optionally_enter2(page,
! &criteria,LINES-3,0,
! OE_ALLOW_MIMEENC|


! OE_SIG_CHAR /* Ctrl-C */,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLimitEnterCriteria,
! "Enter criteria or '?' for help: "))
! ) {

if (criteria)
free_string(& criteria);

! menu_trigger_redraw(page);
return;

}
--- 82,200 ----

int last_selected, all;
struct string *criteria = NULL;
! int li,co;


! int delay_redraw = 0;

+ menu_get_sizes(LOC->prompt_page,&li,&co);
+
last_selected = mcommon_get_selected(menu);

all = 0;

if (mcommon_get_selected(menu)) {
int c;
!
! redraw0:
! menu_PutLineX(LOC->prompt_page,
! 1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitAlreadyHave,
! "Already have selection criteria - add more? (%c/%c) %c%c"),
! *def_ans_yes, *def_ans_no, *def_ans_no, BACKSPACE);
! c = menu_ReadCh(LOC->prompt_page,REDRAW_MARK);
!
! if (REDRAW_MARK == c) {


! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/
!

! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!

! */
! delay_redraw++;
! goto redraw0;


! }
!
! if (

#ifdef ASCII_CTYPE
! isascii(c) &&
#endif
! tolower((unsigned char)c) == *def_ans_yes) {
!
! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet, ElmYesWord, "Yes."));
!
! menu_PutLineX(LOC->prompt_page,
! 0, co-30,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitAdding,
! "Adding criteria..."));
} else {
! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet, ElmNoWord, "No."));
!
! menu_PutLineX(LOC->prompt_page,
! 0, co-30,
! CATGETS(elm_msg_cat, ElmSet, ElmLimitChanging,
! "Change criteria..."));

mcommon_set_selected(menu,0);
+
+ menu_trigger_redraw(LOC->title_page);
+ menu_trigger_redraw(LOC->header_page);
}
}



while(1) {
+ int line;
+ int code;
+ int f = 0;
+
/* CLear previous prompt */
! menu_MoveCursor(LOC->prompt_page,1,0);

! menu_CleartoEOLN(LOC->prompt_page);
!
!

! redraw:


! /* FIXME --optionally_enter* should use prompt_area */

! line = menu_GetAbsLine(LOC->prompt_page,1);

! code = optionally_enter2(page,
! &criteria,line,0,
! OE_REDRAW_MARK|OE_ALLOW_MIMEENC|f|


! OE_SIG_CHAR /* Ctrl-C */,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLimitEnterCriteria,
! "Enter criteria or '?' for help: "));
! if (REDRAW_MARK == code) {


! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/
!

! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */
! delay_redraw++;

! goto redraw;
! }
!

! if (0 != code) {

if (criteria)
free_string(& criteria);

! menu_trigger_redraw(LOC->title_page);
! menu_trigger_redraw(LOC->header_page);


!
! if (delay_redraw)
! menu_trigger_redraw(page);
!

return;

}
***************
*** 134,140 ****
free_string(& criteria);

mcommon_set_selected(menu,last_selected);
!
return;
}

--- 209,225 ----
free_string(& criteria);

mcommon_set_selected(menu,last_selected);
! menu_trigger_redraw(LOC->title_page);
! menu_trigger_redraw(LOC->header_page);
!
! if (last_selected)
! lib_error(CATGETS(elm_msg_cat, ElmSet,
! ElmLimitReturnToLastSelection,
! "Returned to last selection."));
!
!
! if (delay_redraw)
! menu_trigger_redraw(page);
return;
}

***************
*** 143,149 ****

mcommon_set_selected(menu,0);
} else if (string_matches_ascii(criteria,s2us("?"))) {
! mcommon_limit_print_help(menu,last_selected);
continue;
} else {
int X = 0;
--- 228,234 ----

mcommon_set_selected(menu,0);
} else if (string_matches_ascii(criteria,s2us("?"))) {
! mcommon_limit_print_help(menu,last_selected);
continue;
} else {
int X = 0;
***************
*** 177,182 ****
--- 262,275 ----

selarr = safe_malloc(n * sizeof(selarr[0]));
reslen = SelectTaggedMessages(menu,selarr);
+ } else if (string_matches_ascii(part, s2us("flagged"))) {
+ int n = mcommon_get_count(menu);
+
+ if (n < 1)
+ goto fail;
+
+ selarr = safe_malloc(n * sizeof(selarr[0]));
+ reslen = SelectFlaggedMessages(menu,selarr);

} else
reslen = mcommon_limit_helper(menu,part,&selarr,
***************
*** 192,198 ****
c = mcommon_get_count(menu);

for (i = 0; i < c; i++)
! mcommon_clearf_status(menu,i,VISIBLE);
goto action_or;
}
goto action_and;
--- 285,291 ----
c = mcommon_get_count(menu);

for (i = 0; i < c; i++)
! mcommon_clearf_status(menu,i,status_basic,VISIBLE);
goto action_or;
}
goto action_and;
***************
*** 214,220 ****
}

if (!match)
! mcommon_clearf_status(menu,i,VISIBLE);
}

break;
--- 307,313 ----
}

if (!match)
! mcommon_clearf_status(menu,i,status_basic,VISIBLE);
}

break;
***************
*** 227,233 ****
for (i = 0; i < reslen; i++) {
int x = selarr[i];

! mcommon_setf_status(menu,x,VISIBLE);
}

break;
--- 320,326 ----
for (i = 0; i < reslen; i++) {
int x = selarr[i];

! mcommon_setf_status(menu,x,status_basic,VISIBLE);


}

break;
***************
*** 251,265 ****

c = mcommon_get_count(menu);

for (i = 0; i < c; i++)
! if (mcommon_ison_status(menu,i,VISIBLE))
count++;

mcommon_set_selected(menu,count);
}

if (all && last_selected)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmLimitReturnToUnlimited,
! "Returned to unlimited display."));
else {

mcommon_limit_print_result(menu);
--- 344,358 ----
c = mcommon_get_count(menu);

for (i = 0; i < c; i++)
! if (mcommon_ison_status(menu,i,status_basic,VISIBLE))
count++;

mcommon_set_selected(menu,count);
}

if (all && last_selected)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmLimitReturnToUnlimited,
! "Returned to unlimited display."));
else {

mcommon_limit_print_result(menu);
***************
*** 275,292 ****
int current = mcommon_get_current(menu);

if (mcommon_get_selected(menu) &&
! mcommon_isoff_status(menu,current-1,VISIBLE)) {

current = visible_to_index(1,menu)+1;
mcommon_set_current(menu,current);
}
!
! menu_trigger_redraw(page);
! return;
! } else {
! return;
! }
}
}


--- 368,395 ----
int current = mcommon_get_current(menu);

if (mcommon_get_selected(menu) &&
! mcommon_isoff_status(menu,current-1,status_basic,
! VISIBLE)) {

current = visible_to_index(1,menu)+1;
mcommon_set_current(menu,current);
+ copy_current(menu,LOC->header_page);
}
! get_page(menu, LOC->header_page);
!
! menu_trigger_redraw(LOC->title_page);
! menu_trigger_redraw(LOC->header_page);
! }
! break;


}
+
+ if (delay_redraw)
+ menu_trigger_redraw(page);

+ else
+ menu_trigger_redraw(LOC->prompt_page);
+
+ if (criteria)
+ free_string(& criteria);
}


***************
*** 301,307 ****
If selected, return the iindex for the NEXT message marked VISIBLE.
**/

! int remember_for_debug, stat;
int mc = mcommon_get_count(menu);
int selected = mcommon_get_selected(menu);

--- 404,410 ----
If selected, return the iindex for the NEXT message marked VISIBLE.
**/

! int remember_for_debug;
int mc = mcommon_get_count(menu);
int selected = mcommon_get_selected(menu);

***************
*** 313,320 ****

for(iindex++; iindex < mc; iindex++) {

! if ((mcommon_ison_status(menu,iindex,VISIBLE) || !selected)
! && (mcommon_isoff_status(menu,iindex,DELETED) || (!skipdel))) {
DPRINT(Debug,9,(&Debug,
"[Next%s%s: given %d returning %d]\n",
(skipdel ? " undeleted" : ""),
--- 416,425 ----

for(iindex++; iindex < mc; iindex++) {

! if ((mcommon_ison_status(menu,iindex,
! status_basic,VISIBLE) || !selected)
! && (mcommon_isoff_status(menu,iindex,
! status_basic,DELETED) || (!skipdel))) {
DPRINT(Debug,9,(&Debug,
"[Next%s%s: given %d returning %d]\n",
(skipdel ? " undeleted" : ""),
***************
*** 332,338 ****
{
/** Like next_message, but the PREVIOUS message. **/

! int remember_for_debug, stat;
int mc = mcommon_get_count(menu);
int selected = mcommon_get_selected(menu);

--- 437,443 ----
{
/** Like next_message, but the PREVIOUS message. **/

! int remember_for_debug;
int mc = mcommon_get_count(menu);
int selected = mcommon_get_selected(menu);

***************
*** 343,351 ****

for(iindex--; iindex >= 0; iindex--) {

! if ((mcommon_ison_status(menu,iindex,VISIBLE)
! || (!selected))
! && (mcommon_isoff_status(menu,iindex,DELETED) || (!skipdel))) {
DPRINT(Debug,4,(&Debug,
"[Previous%s%s: given %d returning %d]\n",
(skipdel ? " undeleted" : ""),
--- 448,457 ----

for(iindex--; iindex >= 0; iindex--) {

! if ((mcommon_ison_status(menu,iindex,
! status_basic,VISIBLE) || (!selected))
! && (mcommon_isoff_status(menu,iindex,
! status_basic,DELETED) || (!skipdel))) {
DPRINT(Debug,4,(&Debug,
"[Previous%s%s: given %d returning %d]\n",
(skipdel ? " undeleted" : ""),
***************
*** 381,387 ****
"[compute-visible: displayed message %d is actually %d]\n",
count, message));

! if (mcommon_ison_status(menu,iindex,VISIBLE))
count++;
}

--- 487,493 ----
"[compute-visible: displayed message %d is actually %d]\n",
count, message));

! if (mcommon_ison_status(menu,iindex,status_basic,VISIBLE))
count++;
}

***************
*** 406,412 ****

for (iindex = 0; iindex < mc; iindex++) {

! if (mcommon_ison_status(menu,iindex,VISIBLE))
count++;
if (count == message) {
DPRINT(Debug,4,(&Debug,
--- 512,518 ----

for (iindex = 0; iindex < mc; iindex++) {

! if (mcommon_ison_status(menu,iindex,status_basic,VISIBLE))
count++;
if (count == message) {
DPRINT(Debug,4,(&Debug,
***************
*** 418,424 ****

DPRINT(Debug,4,(&Debug, "index %d is NOT displayed!\n", message));

! return mc+1;
}

/*
--- 524,530 ----

DPRINT(Debug,4,(&Debug, "index %d is NOT displayed!\n", message));

! return mc+1;
}

/*

Kari E. Hurtta

unread,
Jul 28, 2005, 12:39:23 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.16

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 16/20 ) =========
Index: elmME+.2.5.alpha5-cvs/src/menu_common/message_limit.c
*** elmME+.2.5.alpha4/src/menu_common/message_limit.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/message_limit.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: message_limit.c,v 1.7 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
******************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: message_limit.c,v 1.7.8.2 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.2 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
******************************************************************************
***************

*** 46,52 ****
struct menu_context *page));

static int limit_by_string_subject(pattern,vector,mailbox)


! CONST struct string *pattern;

int *vector;
struct MailboxView *mailbox;
{
--- 46,52 ----
struct menu_context *page));

static int limit_by_string_subject(pattern,vector,mailbox)


! const struct string *pattern;

int *vector;
struct MailboxView *mailbox;
{
***************
*** 373,382 ****
{
if (last_selected)
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmEnterLastSelected,
! "Enter: {\"subject\",\"to\",\"from\",\"cc\",\"header\"} [pattern] OR {\"thread\",\"tagged\",\"all\"}"));
else
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmEnterSelected,
! "Enter: {\"subject\",\"to\",\"from\",\"header\"} [pattern] OR \"thread\",\"tagged\"}"));

}

--- 373,382 ----
{
if (last_selected)
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmEnterLastSelected,
! "Enter: {\"subject\",\"to\",\"from\",\"cc\",\"header\"} [pattern] OR {\"tagged\",\"all\",...}"));
else
lib_transient(CATGETS(elm_msg_cat, ElmSet, ElmEnterSelected,
! "Enter: {\"subject\",\"to\",\"from\",\"header\"} [pattern] OR \"thread\",\"tagged\",...}"));

}

Index: elmME+.2.5.alpha5-cvs/src/menu_common/message_pattern.c
*** elmME+.2.5.alpha4/src/menu_common/message_pattern.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/menu_common/message_pattern.c 2005-07-27 14:51:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: message_pattern.c,v 1.4 2004/03/27 18:31:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
******************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: message_pattern.c,v 1.4.8.5 2005/07/27 11:51:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.5 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
******************************************************************************
***************

*** 25,35 ****
return (unsigned char *)str;
}

! static CONST unsigned char *cs2us P_((const char *str));
! static CONST unsigned char *cs2us(str)

! CONST char *str;
{
! return (CONST unsigned char *)str;
}

#if ANSI_C
--- 25,35 ----
return (unsigned char *)str;
}

! static const unsigned char *cs2us P_((const char *str));
! static const unsigned char *cs2us(str)

! const char *str;
{
! return (const unsigned char *)str;
}

#if ANSI_C
***************
*** 213,225 ****
hdl->u.search_mes -> pat, ptr->description));
}

! mime_get_charset(&res, ptr->type_opts,NULL,
default_mimetext_charset /* FIXME: No correct */);

while (0 < (l = state_getl(buffer,sizeof buffer,state_in))) {
struct string *x = new_string(res);

! add_streambytes_to_string(x,l,s2us(buffer));

if (find_pattern_from_string(x,hdl->u.search_mes -> pat,1)) {
hdl->u.search_mes -> found = 1;
--- 213,225 ----
hdl->u.search_mes -> pat, ptr->description));
}

! mime_get_charset(&res, ptr->TYPE_opts,NULL,
default_mimetext_charset /* FIXME: No correct */);

while (0 < (l = state_getl(buffer,sizeof buffer,state_in))) {
struct string *x = new_string(res);

! add_streambytes_to_string(x,l,s2us(buffer),NULL);

if (find_pattern_from_string(x,hdl->u.search_mes -> pat,1)) {
hdl->u.search_mes -> found = 1;
***************
*** 241,251 ****
mw_action_search
};

! int mc_match_in_text_mbx(u,meta_pattern, header_page, page)


union mcommon_union *u;
struct string * meta_pattern;

- int header_page;
struct menu_context *page;
{

struct MailboxView *mbxview = u->mbx.mw;

int LINES, COLUMNS;
--- 241,251 ----
mw_action_search
};

! int mc_match_in_text_mbx(u,meta_pattern, page, LOC)


union mcommon_union *u;
struct string * meta_pattern;

struct menu_context *page;
+ struct screen_parts *LOC;
{

struct MailboxView *mbxview = u->mbx.mw;

int LINES, COLUMNS;
***************
*** 259,266 ****
Returns 1 if found, 0 if not
**/

! char buffer[VERY_LONG_STRING];
! int message_number, lines, line, line_len, err;
int mc;
int ret = 0;
int selected = get_selected(mbxview);
--- 259,265 ----
Returns 1 if found, 0 if not
**/

! int message_number;
int mc;
int ret = 0;
int selected = get_selected(mbxview);
***************
*** 324,340 ****

if (!give_message_data(mbxview,message_number,
&hdr,&ZZ,NULL,mime_parse_routine)) {
err = errno;

DPRINT(Debug,1,(&Debug,
"Error: seek %ld bytes into file failed. errno %d (%s)\n",
hdr ? hdr->offset : -1, err,
"match_in_message"));
! failXX:
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMatchSeekFailed,
"ELM [match] failed looking %ld bytes into file (%s)."),
hdr ? hdr->offset : -1,
! error_description(err));
ret = 1; /* fake it out to avoid replacing error message */
goto out;
}
--- 323,342 ----

if (!give_message_data(mbxview,message_number,
&hdr,&ZZ,NULL,mime_parse_routine)) {
+ int err;
+
+ failXX:
err = errno;

DPRINT(Debug,1,(&Debug,
"Error: seek %ld bytes into file failed. errno %d (%s)\n",
hdr ? hdr->offset : -1, err,
"match_in_message"));
!
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmMatchSeekFailed,
"ELM [match] failed looking %ld bytes into file (%s)."),
hdr ? hdr->offset : -1,
! strerror(err));
ret = 1; /* fake it out to avoid replacing error message */
goto out;
}
***************
*** 344,350 ****
"mime_parse_routine was not called\n"));
mime_parse_routine(NULL,hdr,ZZ);
}
! show_msg_status(message_number, & (u->gen), header_page);

/* Copy some headers from part 1 */
if (skip_envelope(hdr, ZZ) != -1) {
--- 346,363 ----
"mime_parse_routine was not called\n"));
mime_parse_routine(NULL,hdr,ZZ);
}
!
! {
! struct menu_common MENU;
! int vis;
!
! set_mcommon_from_mbxview(&MENU,mbxview);
!
! vis = compute_visible(message_number+1, &MENU);
! menu_header_status_update(LOC->header_page,vis-1);
!
! }
!

/* Copy some headers from part 1 */
if (skip_envelope(hdr, ZZ) != -1) {
***************
*** 358,364 ****


for (next_hdr = all_headers;
next_hdr;
next_hdr = next_hdr -> next_header) {
! CONST char * hdr_name = give_header_name(next_hdr->header_name);

struct string *s = new_string2(ASCII_SET,cs2us(hdr_name));

struct string *buffer =
--- 371,377 ----


for (next_hdr = all_headers;
next_hdr;
next_hdr = next_hdr -> next_header) {
! const char * hdr_name = give_header_name(next_hdr->header_name);

struct string *s = new_string2(ASCII_SET,cs2us(hdr_name));

struct string *buffer =
Index: elmME+.2.5.alpha5-cvs/src/menu_common/message_screen.c
*** elmME+.2.5.alpha4/src/menu_common/message_screen.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/menu_common/message_screen.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: message_screen.c,v 1.4.8.3 2004/11/01 08:40:31 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.3 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
******************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: message_screen.c,v 1.4.8.5 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.5 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
******************************************************************************
***************

*** 64,72 ****

menu_get_sizes(page, &LINES, &COLUMNS);

-
if (selected && has_highlighting && ! arrow_cursor)
! StartInverse();

buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
ElmNotCollected,
--- 64,71 ----

menu_get_sizes(page, &LINES, &COLUMNS);

if (selected && has_highlighting && ! arrow_cursor)
! menu_StartXX(page,pg_INVERSE);

buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
ElmNotCollected,
***************
*** 83,103 ****
free_string(&buffer);

if (buffer1) {
! Write_to_screen(FRM("%S"),buffer1);
free_string(&buffer1);
}

if (selected && !arrow_cursor) {
while (l < COLUMNS) {
! Writechar(' ');
l++;
}
}

if (selected && has_highlighting && ! arrow_cursor)
! EndInverse();

! NewLine();
}

static void print_header_line(entry,message_number,selected,from,really_to,
--- 82,103 ----
free_string(&buffer);

if (buffer1) {
! menu_Write_to_screen(page,FRM("%S"),buffer1);
free_string(&buffer1);
}

if (selected && !arrow_cursor) {
while (l < COLUMNS) {
! menu_Writechar(page,' ');
l++;
}
}

if (selected && has_highlighting && ! arrow_cursor)
! menu_EndXX(page,pg_INVERSE);



! menu_Writechar(page,'\r');
! menu_Writechar(page,'\n');
}

static void print_header_line(entry,message_number,selected,from,really_to,
***************
*** 125,130 ****
--- 125,131 ----
int X,len1,fill_len;
int was_len;
int LINES, COLUMNS;
+ char tagged= ' ';

enum list_mode {
lm_unknown,
***************
*** 159,165 ****
}

if (show_mlists) {
! CONST int MLIST_LEN = 12;

/* 1) Just to me or to sender only */

--- 160,166 ----
}

if (show_mlists) {
! const int MLIST_LEN = 12;

/* 1) Just to me or to sender only */

***************
*** 289,294 ****
--- 290,302 ----
/* truncate 'from' to 18 characters -
* this includes the leading "To" if really_to is true.
*/
+
+ if (entry->status & TAGGED)
+ tagged = '+';
+ else if (entry->status1 & S1_FLAGGED)
+ tagged = 'F';
+ else
+ tagged = ' ';

if (*entry->time_menu == '\0')
make_menu_date(entry);
***************
*** 299,305 ****
}

if (selected && has_highlighting && ! arrow_cursor)
! StartInverse();

X = 0;
bufferwho = curses_printable_clip(from,&X,who_width,&len1,who_width);
--- 307,313 ----
}

if (selected && has_highlighting && ! arrow_cursor)
! menu_StartXX(page,pg_INVERSE);

X = 0;
bufferwho = curses_printable_clip(from,&X,who_width,&len1,who_width);
***************
*** 313,323 ****
if (fill_len < 0)
fill_len = 0;

! if (entry->lines < 0)
! buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s%S %.3s%S%*s (?) "),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
! (entry->status & TAGGED? '+' : ' '),
message_number,
entry->time_menu,
list_buffer,
--- 321,331 ----
if (fill_len < 0)
fill_len = 0;

! if (entry->lines < 0) {
! buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s%S %.3s%S%*s (?) "),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
! tagged,
message_number,
entry->time_menu,
list_buffer,
***************
*** 327,337 ****

fill_len,""
);
! else
buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s%S %.3s%S%*s (%d) %s"),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
! (entry->status & TAGGED? '+' : ' '),
message_number,
entry->time_menu,
list_buffer,
--- 335,345 ----

fill_len,""
);
! } else
buffer = format_string(FRM("%.2s%.2s%c%-3d %.10s%S %.3s%S%*s (%d) %s"),
(selected && arrow_cursor)? "->" : " ",
show_message_status(entry),
! tagged,
message_number,
entry->time_menu,
list_buffer,
***************
*** 369,375 ****
subj_width = COLUMNS-header_without_subj_width;

if (buffer1) {
! Write_to_screen(FRM("%S"),buffer1);
free_string(&buffer1);
}

--- 377,383 ----
subj_width = COLUMNS-header_without_subj_width;

if (buffer1) {
! menu_Write_to_screen(page,FRM("%S"),buffer1);
free_string(&buffer1);
}

***************
*** 383,389 ****
&was_len,subj_width);

if (buffer2) {
! Write_to_screen(FRM("%S"),buffer2);
free_string(&buffer2);
}
} else
--- 391,397 ----
&was_len,subj_width);

if (buffer2) {
! menu_Write_to_screen(page,FRM("%S"),buffer2);
free_string(&buffer2);
}
} else
***************
*** 395,409 ****


*/
if (selected && !arrow_cursor) {
while (was_len < subj_width) {

! Writechar(' ');
was_len++;
}
}
!
!
if (selected && has_highlighting && ! arrow_cursor)
! EndInverse();
! NewLine();
}

/*
--- 403,418 ----


*/
if (selected && !arrow_cursor) {
while (was_len < subj_width) {
! menu_Writechar(page,' ');
was_len++;
}
}
!
if (selected && has_highlighting && ! arrow_cursor)
! menu_EndXX(page,pg_INVERSE);
!
! menu_Writechar(page,'\r');
! menu_Writechar(page,'\n');
}

/*

Index: elmME+.2.5.alpha5-cvs/src/messages/canceled_mail.c
*** elmME+.2.5.alpha4/src/messages/canceled_mail.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/messages/canceled_mail.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.8.2.2 2004/09/25 10:14:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.2.2 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: canceled_mail.c,v 1.8.2.6 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.2.6 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/
***************

*** 111,116 ****
--- 111,118 ----

header_clear ( & ( mbx->u.canceldir->message_list[i].REC) );
}
+ free(mbx->u.canceldir->message_list);
+ mbx->u.canceldir->message_list = NULL;
}
mbx->u.canceldir->message_list_len = 0;

***************

*** 332,338 ****
struct MailboxView *mailbox;
{
int count;
- int i,x;

update_index(mailbox);

--- 334,339 ----
***************
*** 543,549 ****
array = safe_malloc(mailbox->view_len * sizeof (array[0]));

for (i = 0; i < mailbox->view_len; i++) {
- int mbx = mailbox->view[i].mailbox_number;

array[i].w = mailbox->view[i];
array[i].sort_data_type = &cm_sort;
--- 544,549 ----
***************
*** 719,725 ****

return format_string(CATGETS(elm_msg_cat, ElmSet,
ElmMDirectory,
! "Message directory %s"),
mailbox->u.canceldir->dirname);

}
--- 719,725 ----

return format_string(CATGETS(elm_msg_cat, ElmSet,
ElmMDirectory,
! "Message directory %s"),
mailbox->u.canceldir->dirname);

}
***************
*** 729,735 ****
struct MailboxView *mailbox;
{
int count = mailbox->u.canceldir->message_list_len;
! int i,x;


if (count < 1) {
--- 729,735 ----
struct MailboxView *mailbox;
{
int count = mailbox->u.canceldir->message_list_len;
! int x;


if (count < 1) {
***************
*** 1106,1114 ****
view,dir));

if (dir[0]) {
- int err,ret;
- char buffer[30];
-
view->u.canceldir->dirname = safe_strdup(dir);

view->u.canceldir->indexname =
--- 1106,1111 ----
***************
*** 1123,1129 ****

lib_error(CATGETS(elm_msg_cat, ElmSet,ElmErrorAccess,
"%.45s: %.33s"),
! dir,error_description(err));

return;
}
--- 1120,1126 ----

lib_error(CATGETS(elm_msg_cat, ElmSet,ElmErrorAccess,
"%.45s: %.33s"),
! dir,strerror(err));

return;


}
***************
*** 1229,1240 ****
}

fprintf(view->u.canceldir->index_F,
! "T %d\n",
! current->REC.received_time);

fprintf(view->u.canceldir->index_F,
! "d %d\n",
! current->REC.time_sent);

if (current->REC.env_from[0]) {
fprintf(view->u.canceldir->index_F,

--- 1226,1237 ----


}

fprintf(view->u.canceldir->index_F,
! "T %ld\n",
! (long int) current->REC.received_time);

fprintf(view->u.canceldir->index_F,
! "d %ld\n",
! (long int) current->REC.time_sent);

if (current->REC.env_from[0]) {
fprintf(view->u.canceldir->index_F,

***************
*** 1339,1345 ****
if (headers && headers->env_from &&
! current->REC.env_from[0]) {
int x;
! CONST char * t = mailer_env_from_value(headers->env_from,&x);
strfcpy(current->REC.env_from,t,
sizeof (current->REC.env_from));
}
--- 1336,1342 ----
if (headers && headers->env_from &&
! current->REC.env_from[0]) {
int x;
! const char * t = mailer_env_from_value(headers->env_from,&x);
strfcpy(current->REC.env_from,t,
sizeof (current->REC.env_from));
}
***************
*** 1799,1806 ****


if (t && 0 == mkdir(t,0700)) {
- int i;
-
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmDeadLetterDirCreated,
"\"dead-letter-dir\" %s created."),
t);
--- 1796,1801 ----
Index: elmME+.2.5.alpha5-cvs/src/messages/def_messages.h
*** elmME+.2.5.alpha4/src/messages/def_messages.h 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/messages/def_messages.h 2005-07-20 19:49:51.000000000 +0300
***************
*** 1,13 ****
! /* $Id: def_messages.h,v 1.6.8.3 2004/08/07 18:07:20 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/

#include "elm_defs.h"
#include "mime.h"
#include "me.h"

#if ANSI_C
--- 1,14 ----
! /* $Id: def_messages.h,v 1.6.8.4 2005/07/20 16:49:51 hurtta Exp $ */

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.4 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
*****************************************************************************/

#include "elm_defs.h"
#include "mime.h"
+ #include "mailerlib.h"
#include "me.h"

#if ANSI_C
Index: elmME+.2.5.alpha5-cvs/src/messages/digest.c
*** elmME+.2.5.alpha4/src/messages/digest.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/messages/digest.c 2005-07-23 20:14:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: digest.c,v 1.9.8.3 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.3 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: digest.c,v 1.9.8.4 2005/07/23 17:14:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.4 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 94,100 ****
struct MailboxView *mailbox;
{
int count = 0;
! int i,x;

for (i = 0; i < mailbox->u.digest->digest_count; i++)
count += mailbox->u.digest->the_digest[i]->message_count;
--- 94,100 ----
struct MailboxView *mailbox;
{
int count = 0;
! int i;

for (i = 0; i < mailbox->u.digest->digest_count; i++)
count += mailbox->u.digest->the_digest[i]->message_count;
***************
*** 425,432 ****
{
/* Show introduction part (usually text/plain) as message */

- header_list_ptr parsed_headers = NULL;
-
h->received_time = received_time;
h->time_sent = received_time - 60;

--- 425,430 ----
Index: elmME+.2.5.alpha5-cvs/src/messages/header_alloc.c
*** elmME+.2.5.alpha4/src/messages/header_alloc.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/messages/header_alloc.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.10.8.6 2004/11/03 12:24:50 hurtta Exp $";
!

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.6 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: header_alloc.c,v 1.10.8.9 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.10.8.9 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

***************
*** 71,76 ****
--- 70,76 ----


h->lines = 0;
h->index_number_X = 0;
h->status = 0;
+ h->status1 = 0;
h->encrypted = 0;
h->exit_disposition = 0;
h->status_chgd = 0;
***************

*** 133,138 ****
--- 133,139 ----

h->lines = 0;
h->index_number_X = 0;
h->status = 0;
+ h->status1 = 0;
h->encrypted = 0;
h->exit_disposition = 0;
h->status_chgd = 0;
***************

*** 253,258 ****
--- 254,261 ----


struct header_rec *current_header;
header_list_ptr parsed_headers;
{
+ int mh = give_dt_enumerate_as_int(&message_hide_hack);
+
header_list_ptr tmphdr;

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
***************

*** 315,339 ****



if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
"Status"))) {
! strfcpy(current_header->mailx_status, tmphdr->body, WLEN);
! remove_possible_trailing_spaces(current_header->
! mailx_status);
!
! /* Okay readjust the status. If there's an 'R', message
! * is read; if there is no 'R' but there is an 'O', message
! * is unread. In any case it isn't new because a new
! * message wouldn't have a Status: header.
! * -- if message is re$ynced there may now be
! * Status: -header
! */
! if (index(current_header->mailx_status, 'R') != NULL)
! current_header->status &= ~(NEW | UNREAD);
! else if (index(current_header->mailx_status,'O') != NULL) {
! current_header->status &= ~NEW;
! current_header->status |= UNREAD;
! }
! if (index(current_header->mailx_status, 'r') != NULL)

! current_header->status |= REPLIED_TO;


}

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,

--- 318,324 ----



if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
"Status"))) {
! mailbox_2_status(tmphdr->body,current_header);
}

if (NULL != (tmphdr = locate_header_by_name(parsed_headers,
***************

*** 355,361 ****



/* This does not work correctly with unknown character
sets... */
! remove_control(current_header->subject);

free(Subject);
} else if (!current_header->subject)

--- 340,347 ----



/* This does not work correctly with unknown character
sets... */
! if (current_header->subject)
! remove_control(current_header->subject);

free(Subject);
} else if (!current_header->subject)
***************

*** 367,372 ****
--- 353,363 ----
parse_list_id(current_header,tmphdr);


}

+
+ if (current_header->from)
+ free_addr_items(current_header->from);
+ current_header->from = NULL;
+
for (tmphdr = locate_header_by_name(parsed_headers,
"From");
tmphdr;

***************
*** 391,396 ****
--- 382,392 ----


}
}

+
+ if (current_header->to)
+ free_addr_items(current_header->to);
+ current_header->to = NULL;
+
for (tmphdr = locate_header_by_name(parsed_headers,
"To");
tmphdr;
***************

*** 413,418 ****
--- 409,418 ----


}
}

+ if (current_header->cc)
+ free_addr_items(current_header->cc);
+ current_header->cc = NULL;
+
for (tmphdr = locate_header_by_name(parsed_headers,
"Cc");
tmphdr;

***************
*** 437,443 ****


/* message_hide_hack values: 0 == none */

/* 1 = FOLDER INTERNAL DATA */

! switch (message_hide_hack) {
header_list_ptr tmphdr2;

case 1:

--- 437,443 ----


/* message_hide_hack values: 0 == none */

/* 1 = FOLDER INTERNAL DATA */

! switch (mh) {
header_list_ptr tmphdr2;

case 1:
***************

*** 449,455 ****


"DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA")) {
current_header->exit_disposition = HIDE;
DPRINT(Debug,10,(&Debug, "message_hide_hack=%d -- hiding message: %s\n",
! message_hide_hack,tmphdr->body));
}
break;
}

--- 449,455 ----


"DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA")) {
current_header->exit_disposition = HIDE;
DPRINT(Debug,10,(&Debug, "message_hide_hack=%d -- hiding message: %s\n",
! mh,tmphdr->body));
}
break;
}
***************

*** 477,488 ****


if (0 != (get_type_flags(current_header->mime_rec.TYPE) &
MIME_SIGNED)) {
#ifdef USE_PGP
! char protocol[STRING];
! if (mime_get_param ("protocol", protocol,
! current_header->
! mime_rec.type_opts,
! sizeof protocol) &&
! 0 == istrcmp(protocol,
"application/pgp-signature"))
current_header->pgp |= PGP_SIGNED_MESSAGE;
#endif

--- 477,489 ----


if (0 != (get_type_flags(current_header->mime_rec.TYPE) &
MIME_SIGNED)) {
#ifdef USE_PGP

! const char *pv;
!

! pv = get_mime_param_compat(current_header->
! mime_rec.TYPE_opts,"protocol");
!

! if (pv &&
! 0 == istrcmp(pv,
"application/pgp-signature"))
current_header->pgp |= PGP_SIGNED_MESSAGE;
#endif

Index: elmME+.2.5.alpha5-cvs/src/messages/Makefile.SH
*** elmME+.2.5.alpha4/src/messages/Makefile.SH 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/messages/Makefile.SH 2005-07-20 19:49:51.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.5.44.3 2004/08/07 18:07:19 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
--- 17,23 ----

echo "Extracting src/messages/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.5.44.4 2005/07/20 16:49:51 hurtta Exp $


# Makefile for the ELM mail program.
#

# Variables
***************
*** 75,81 ****


$(CHMOD) u+w $@
$(TOUCH) $@

! def_messages.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/me.h $(INCLDIR)/mime.h


$(CHMOD) u+w $@
$(TOUCH) $@

--- 75,82 ----


$(CHMOD) u+w $@
$(TOUCH) $@

! def_messages.h: $(INCLDIR)/elm_defs.h $(INCLDIR)/me.h \
! $(INCLDIR)/mime.h $(INCLDIR)/mailerlib.h


$(CHMOD) u+w $@
$(TOUCH) $@

Index: elmME+.2.5.alpha5-cvs/src/messages/messages.c
*** elmME+.2.5.alpha4/src/messages/messages.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/messages/messages.c 2005-07-23 20:14:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: messages.c,v 1.12.8.3 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.12.8.3 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: messages.c,v 1.12.8.4 2005/07/23 17:14:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.12.8.4 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 521,527 ****
FILE *fp;
struct MailboxView *mailbox;
{
! int i,j;
int count;

int cur_s = -1;
--- 521,527 ----
FILE *fp;
struct MailboxView *mailbox;
{
! int i;
int count;

int cur_s = -1;
Index: elmME+.2.5.alpha5-cvs/src/messages/partial.c
*** elmME+.2.5.alpha4/src/messages/partial.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/messages/partial.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.14.8.2 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.2 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: partial.c,v 1.14.8.5 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.14.8.5 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 506,514 ****

if (!mailbox->u.partial->fname) {
static int un = 1;
!
mailbox->u.partial->fname = elm_message(FRM("%selmpartial-%d-%d"),
! temp_dir, getpid (), un++);

DPRINT(Debug,9,(&Debug,
"check_tempfile: temporary folder name is %s\n",
--- 506,519 ----

if (!mailbox->u.partial->fname) {
static int un = 1;
! char *tmp;
!

! tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
! if (!tmp)
! tmp = "/tmp/";
!

mailbox->u.partial->fname = elm_message(FRM("%selmpartial-%d-%d"),
! tmp, getpid (), un++);

DPRINT(Debug,9,(&Debug,
"check_tempfile: temporary folder name is %s\n",
***************
*** 569,576 ****

/* Try build tagged messages */

! if (mailbox->u.partial->composite[i].mss &&
! (mailbox->u.partial->composite[i].mss->status & TAGGED) ||
cur_idx == i)
generate_mail_data(mailbox,i);

--- 574,582 ----

/* Try build tagged messages */

! if ((mailbox->u.partial->composite[i].mss &&
! (mailbox->u.partial->composite[i].mss->status & TAGGED))
! ||
cur_idx == i)
generate_mail_data(mailbox,i);

***************
*** 687,693 ****
}

for (i = 0; i < Z->view_len; i++) {
- int z;
struct header_rec *X = give_header(Z,i);

if (X && X->partial_len) {
--- 693,698 ----


***************
*** 828,848 ****
mt_add_partial_digest
};

- static struct partial_vector * locate_record(struct header_rec * hdr,
- char * id);
- static struct partial_vector * locate_record(hdr,id)
- struct header_rec * hdr;
- char * id;

- {
- int i;
-

- for (i = 0; i < hdr->partial_len; i++) {
- if (0 == strcmp(hdr->partial_vector[i].id, id))
- return (& (hdr->partial_vector[i] ));
- }

-
- return NULL;
- }

static struct info_rec {
FILE * F;
--- 833,838 ----

***************
*** 882,890 ****
for (k = 0; k < Z->locate_id_count; k++) {

struct folder_view res = Z->locate_ids[k];
- struct composite_vector *n1;
-
-

if (res.mailbox_number != 0) {

--- 872,877 ----
***************
*** 1261,1267 ****


for (next_hdr = all_headers;
next_hdr;
next_hdr = next_hdr -> next_header) {
! CONST char * hdr_name = give_header_name(next_hdr->header_name);


if (0 == istrcmp(hdr_name,"Received")) {
--- 1248,1254 ----


for (next_hdr = all_headers;
next_hdr;
next_hdr = next_hdr -> next_header) {
! const char * hdr_name = give_header_name(next_hdr->header_name);


if (0 == istrcmp(hdr_name,"Received")) {
Index: elmME+.2.5.alpha5-cvs/src/messages/storage.c
*** elmME+.2.5.alpha4/src/messages/storage.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/messages/storage.c 2005-07-23 20:14:20.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: storage.c,v 1.6.8.3 2004/08/07 18:07:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: storage.c,v 1.6.8.4 2005/07/23 17:14:20 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.4 $ $State: Exp $
*


* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 90,96 ****
{
int count = 0;
int hide = 0;
! int i,x;

for (i = 0; i < mailbox->u.storage->mailbox_count; i++) {
int j;
--- 90,96 ----
{
int count = 0;
int hide = 0;
! int i;

for (i = 0; i < mailbox->u.storage->mailbox_count; i++) {
int j;
Index: elmME+.2.5.alpha5-cvs/src/metapager.c
*** elmME+.2.5.alpha4/src/metapager.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/metapager.c 2005-07-23 22:01:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: metapager.c,v 1.38.8.3 2004/10/09 12:26:48 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: metapager.c,v 1.38.8.6 2005/07/23 19:01:39 hurtta Exp $";

/*****************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 36,44 ****
menu_get_sizes(cpage,&LINES, &COLUMNS);

redraw:

! PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmMetaPagePressAnyKey,
! "Press any key to continue..."));


if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK)

goto redraw;

--- 36,45 ----
menu_get_sizes(cpage,&LINES, &COLUMNS);

redraw:

! menu_PutLineX(cpage,
! LINES-1, 0,

! CATGETS(elm_msg_cat, ElmSet, ElmMetaPagePressAnyKey,
! "Press any key to continue..."));


if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK)

goto redraw;

***************
*** 65,77 ****
(*inf)++;
}

! int metapager (fp, hdr, do_headers, current, message_count, page)
FILE *fp;
struct header_rec *hdr;
int do_headers;
int current;
int message_count;

! struct menu_context *page;
{


int wait_ret, fork_ret, builtin = 0, status, len;
--- 66,301 ----
(*inf)++;
}

! struct string * title_text(hdr,current,message_count,width,cs)
! struct header_rec *hdr;
! int current, message_count;
! int width;
! charset_t cs;

! {

! struct addr_item *p;
!

! #define ADDRLEN 15
!
! for (p = hdr->from; p->addr && p->fullname; p++) {
! int left = len- buf4_visible_len -4;

! int total = 0;


! int reserve = strlen(p->addr);
!
! if (reserve > ADDRLEN)
! reserve = ADDRLEN;
!
! if (left < 4) {

! break;
! }
!

! if (string_len(buf4) > 0) {
! add_ascii_to_string(buf4,s2us(", "));
! buf4_visible_len += 2;
!
! left = len - buf4_visible_len-4;
! }
!
! if (reserve > left) {
! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! break;

! }
!
!

!
! } else {
!

! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! }
! if (s1)
! free_string(&s1);
! }
!
! free_string(&Sbase);

!
!

! } else if (total > 0) {
! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! }
!
! /* And include address */
! left = len - buf4_visible_len -4;
! if (left > 4) {
! char *T;

!

! }
! }
! }
!

! (*pager_page) = NULL;
! }
!

! int metapager (fp, hdr, do_headers, current, message_count, pager_page)
FILE *fp;
struct header_rec *hdr;
int do_headers;
int current;
int message_count;
! struct pager_page *pager_page;
{

int wait_ret, fork_ret, builtin = 0, status, len;

***************
*** 84,94 ****
int err; /* place holder for errno */
char tempfile[STRING];
charset_t charset_vector[255];
- int x1;


int LINES, COLUMNS;
char * exp_pager;

! menu_get_sizes(page,&LINES, &COLUMNS);

/* check to see if we want the internal pager */

--- 308,318 ----
int err; /* place holder for errno */
char tempfile[STRING];
charset_t charset_vector[255];


int LINES, COLUMNS;
char * exp_pager;
+ char *tmp;

! menu_get_sizes(pager_page->root,&LINES, &COLUMNS);

/* check to see if we want the internal pager */

***************
*** 107,115 ****
builtin++;
}

if (!builtin) {

elm_sfprintf (tempfile, sizeof tempfile,


! FRM("%selm.%d"), temp_dir, getpid());

unlink(tempfile);
fpout = safeopen_rdwr(tempfile);
--- 331,345 ----
builtin++;


}

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)

+ return 0;
+
if (!builtin) {
+
+

elm_sfprintf (tempfile, sizeof tempfile,


! FRM("%selm.%d"), tmp, getpid());

unlink(tempfile);
fpout = safeopen_rdwr(tempfile);
***************

*** 159,168 ****
err = errno;
DPRINT(Debug,1,(&Debug,
"Error: seek %d bytes into file, errno %s (show_message)\n",
! hdr->offset, error_description(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSeekFailedFile,
"ELM [seek] couldn't read %d bytes into file (%s)."),
! hdr->offset, error_description(err));

out_state_destroy(&buffer);
if (!builtin)
--- 389,398 ----
err = errno;
DPRINT(Debug,1,(&Debug,
"Error: seek %d bytes into file, errno %s (show_message)\n",
! hdr->offset, strerror(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSeekFailedFile,
"ELM [seek] couldn't read %d bytes into file (%s)."),
! hdr->offset, strerror(err));

out_state_destroy(&buffer);
if (!builtin)

- break;
- }
-

- if (string_len(buf4) > 0) {
- add_ascii_to_string(buf4,s2us(", "));
- buf4_visible_len += 2;
-
- left = len - buf4_visible_len-4;
- }
-
- if (reserve > left) {
- add_ascii_to_string(buf4,s2us("..."));
- buf4_visible_len += 3;
- break;

- }
-
-

!
! } else {
!

! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! }
! if (s1)
! free_string(&s1);
! }
!
! free_string(&Sbase);

!
!

! } else if (total > 0) {
! add_ascii_to_string(buf4,s2us("..."));
! buf4_visible_len += 3;
! }

- /* And include address */
- left = len - buf4_visible_len -4;
- if (left > 4) {
- char *T;

-

--- 403,427 ----


return (0);
}

! /* this is only true if metapager() is not called from ViewAttachment() */
if (do_headers) {
header_list_ptr all_hdrs = NULL, last_hdr = NULL;
int in_envelope = 1;

if (title_messages && current > 0) {
int addempty = 0;

! struct string *T = title_text(hdr,current,message_count,
! COLUMNS,
! buffer.display_charset[0]);

! /* first print a title line */
! int inf = 0;


! state_printf(&buffer,FRM("%S"),T);

! free_string(&T);

/** Print the subject line centered if there is enough room **/
if (hdr->subject &&
***************
*** 416,421 ****

--- 480,486 ----





+ #if 0
/* HACK: Required by state_write_headers / state_write_header so that 8bit headers are
printed correctly
*/
***************
*** 433,438 ****

--- 498,509 ----


buffer.filter = buffer.display_charset[x1];
} else

buffer.filter = buffer.display_charset[0];
+ #endif
+
+

+ /* Now state_write_header() changes itself buffer.filter according
+ * of current header charset and buffer.display_charset
+ */


/* read_header_line with flag = 1 (RHL_MARK_FOLDING)
***************
*** 520,526 ****
/** Now run the pager! **/

if (builtin) {
! ch = builtinplusplus (bout);
free_stringbuffer(&bout);
return (ch);
}

--- 591,597 ----


/** Now run the pager! **/

if (builtin) {
! ch = builtinplusplus (bout, pager_page);
free_stringbuffer(&bout);
return (ch);
}
***************

*** 547,556 ****
err = errno;
DPRINT(Debug,1,(&Debug,
"Error: fork failed, errno %s (metapager)\n",
! error_description(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmPreparePagerFork,
"Could not prepare for external pager(fork()-%s)."),
! error_description(err));
PressAnyKeyToContinue();
Raw (ON);

--- 618,627 ----
err = errno;
DPRINT(Debug,1,(&Debug,
"Error: fork failed, errno %s (metapager)\n",
! strerror(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmPreparePagerFork,
"Could not prepare for external pager(fork()-%s)."),
! strerror(err));
PressAnyKeyToContinue();
Raw (ON);

***************
*** 570,579 ****
err = errno;
DPRINT(Debug,1,(&Debug,
"Error: dup failed, errno %s (metapager)\n",
! error_description(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmPreparePagerDup,
"Could not prepare for external pager(dup()-%s)."),
! error_description(err));
_exit(err);
}

--- 641,650 ----
err = errno;
DPRINT(Debug,1,(&Debug,
"Error: dup failed, errno %s (metapager)\n",
! strerror(err)));
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmPreparePagerDup,
"Could not prepare for external pager(dup()-%s)."),
! strerror(err));
_exit(err);

}

***************
*** 601,619 ****
cpage = Raw(ON | NO_TITE);

if (prompt_after_pager) {
! StartBold ();

! PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,

! ElmCommandIToReturn,


! " Command ('i' to return to index): "));

! EndBold ();
FlushBuffer();
ch = menu_ReadCh(cpage, 'i' | READCH_CURSOR);
}
else
ch = 0;

! /* This is necessary so that that ti is outputted
* after te that was caused on Raw(OFF) before pager.
*/
Raw(OFF | NO_TITE);

--- 672,691 ----


cpage = Raw(ON | NO_TITE);

if (prompt_after_pager) {
! menu_StartXX(cpage,pg_BOLD);
! menu_PutLineX(cpage,

! LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmCommandIToReturn,


! " Command ('i' to return to index): "));

! menu_EndXX(cpage,pg_BOLD);
FlushBuffer();
ch = menu_ReadCh(cpage, 'i' | READCH_CURSOR);
}
else
ch = 0;

! /* This is necessary so that ti is outputted
* after te that was caused on Raw(OFF) before pager.
*/
Raw(OFF | NO_TITE);

Index: elmME+.2.5.alpha5-cvs/src/mime.c
*** elmME+.2.5.alpha4/src/mime.c 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/mime.c 2005-07-25 09:44:24.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime.c,v 1.31.8.3 2004/08/17 18:18:05 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime.c,v 1.31.8.7 2005/07/25 06:44:24 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.31.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 42,48 ****

mime_info->raw_level = mailer_7bit;

mime_info->encoding_top = ENCODING_7BIT;
! mime_info->type_opts_top = NULL;
mime_info->hdr_charset = text_charset;

/* FIXME: is this correct?

--- 42,48 ----


mime_info->raw_level = mailer_7bit;

mime_info->encoding_top = ENCODING_7BIT;
! mime_info->TYPE_opts_top = NULL;
mime_info->hdr_charset = text_charset;

/* FIXME: is this correct?
***************
*** 74,83 ****
mime_info->top_parts[ptr].encoding_part = ENCODING_7BIT;
mime_info->top_parts[ptr].encoding_part_text = NULL;
mime_info->top_parts[ptr].TYPE = 0;
! mime_info->top_parts[ptr].type_opts_part = NULL;

mime_info->top_parts[ptr].disposition = 0;
! mime_info->top_parts[ptr].disposition_opts = NULL;

mime_info->top_parts[ptr].description = NULL;

--- 74,83 ----


mime_info->top_parts[ptr].encoding_part = ENCODING_7BIT;
mime_info->top_parts[ptr].encoding_part_text = NULL;
mime_info->top_parts[ptr].TYPE = 0;
! mime_info->top_parts[ptr].TYPE_opts_part = NULL;

mime_info->top_parts[ptr].disposition = 0;
! mime_info->top_parts[ptr].DISPOSITION_opts = NULL;

mime_info->top_parts[ptr].description = NULL;

***************
*** 111,127 ****
}

mime_info->top_parts[i].TYPE = NULL;
! if (mime_info->top_parts[i].type_opts_part) {
! free(mime_info->top_parts[i].type_opts_part);
! mime_info->top_parts[i].type_opts_part = NULL;
! }
!
mime_info->top_parts[i].disposition = 0;
! if (mime_info->top_parts[i].disposition_opts) {
! free(mime_info->top_parts[i].disposition_opts);

! mime_info->top_parts[i].disposition_opts = NULL;
! }
!

if (mime_info->top_parts[i].description) {
free_string(&(mime_info->top_parts[i].description));
mime_info->top_parts[i].description = NULL;

--- 111,123 ----


}

mime_info->top_parts[i].TYPE = NULL;
! if (mime_info->top_parts[i].TYPE_opts_part)
! free_mime_param(&(mime_info->top_parts[i].TYPE_opts_part));
!
mime_info->top_parts[i].disposition = 0;
! if (mime_info->top_parts[i].DISPOSITION_opts)
! free_mime_param(&(mime_info->top_parts[i].DISPOSITION_opts));
!
if (mime_info->top_parts[i].description) {
free_string(&(mime_info->top_parts[i].description));
mime_info->top_parts[i].description = NULL;
***************
*** 150,159 ****

mime_info->encoding_top = 0;
mime_info->mime_boundary[0] = '\0';
! if (mime_info->type_opts_top) {
! free(mime_info->type_opts_top);
! mime_info->type_opts_top = NULL;
! }
mime_info->hdr_charset = NULL;
mime_info->encode_hdr = 1;
mime_info->msg_is_multipart = 0;

--- 146,153 ----



mime_info->encoding_top = 0;
mime_info->mime_boundary[0] = '\0';
! if (mime_info->TYPE_opts_top)
! free_mime_param(&(mime_info->TYPE_opts_top));
mime_info->hdr_charset = NULL;
mime_info->encode_hdr = 1;
mime_info->msg_is_multipart = 0;
***************
*** 179,184 ****

--- 173,179 ----


*ptr = strmcpy(*ptr,buffer);
}

+
static int write_one_part P_((mime_send_t *mime_info,
struct mime_send_part * X,
out_state_t *mailer,
***************
*** 257,269 ****
update_encoding(&(mime_info->encoding_top),X->encoding_part);

if (X->result_charset) {
/* Update Charset of part */

/* 1) If charset can be replaced with US-ASCII, do it */
if (!(need_enc & HAVE_8BIT) &&
X->result_charset != ascii_ptr &&
! charset_ok_p(X->result_charset))
X->result_charset = ascii_ptr;

/* 2) If charset claim to be US-ASCII, but there is 8-bit data
use UNKNOWN-8BIT instead (should not happen...)

--- 252,278 ----

--- 284,299 ----


"Text has 8BIT data and charset=US-ASCII, using charset=UNKNOWN-8BIT instead."));

X->result_charset = MIME_name_to_charset("UNKNOWN-8BIT",1);
+
+ DPRINT(Debug,8,(&Debug, "Replacing charset with UNKNOWN-8BIT\n"));
}

/* Add charset to options */
! mime_params_add_compat(&(X->TYPE_opts_part),
! "charset",
! X->result_charset->MIME_name ?
! X->result_charset->MIME_name :
! "UNKNOWN-8BIT");
}

state_putc('\n',mailer); /* filler */
***************
*** 336,342 ****
static int Include_Part P_((FILE *dest,char *buffer,
mime_send_t *mime_info,
struct mime_send_part * X,
! struct mailer_info *mailer_info));

/* Returns 1 if OK */
int convert_text(source,dest,mime_info,from_charset,to_charset,do_pgp,

--- 346,353 ----


static int Include_Part P_((FILE *dest,char *buffer,
mime_send_t *mime_info,
struct mime_send_part * X,
! struct mailer_info *mailer_info,
! charset_t from_charset));

/* Returns 1 if OK */
int convert_text(source,dest,mime_info,from_charset,to_charset,do_pgp,

***************
*** 359,364 ****
--- 370,379 ----

struct mime_send_part * X = NULL;



+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");

+ if (!tmp)
+ tmp = "/tmp/";
+

reset_parts(mime_info);

if (do_pgp) {
***************
*** 372,408 ****
X->encoding_part_text = NULL;

if (do_pgp & PGP_MESSAGE) {
! X -> TYPE = give_media_type2(MIME_TYPE_APPLICATION,"pgp",1);
! } else switch (pgp_sign_type) {
! case 0:
! default:
! X -> TYPE = give_media_type2(MIME_TYPE_APPLICATION,"pgp",1);

! break;
! case 1:

! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"plain",0);
! if (!X -> TYPE)
! mime_panic(__FILE__,__LINE__,"convert_text",
! "text/plain is not known");
! break;
! case 2:
! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"x-pgp",1);
}
!
if (do_pgp & PGP_PUBLIC_KEY)
! add_parameter_1(&(X->type_opts_part),"format","keys-only", FALSE);
else {
! add_parameter_1(&(X->type_opts_part), "format", "text", FALSE);
/* This next bit is a non-non-standard, but exmh does this and it
* can be very useful when parsing the message.
*/
if (pgp_status & PGP_MESSAGE) {
! add_parameter_1(&(X->type_opts_part), "x-action",
! (do_pgp & PGP_SIGNED_MESSAGE) ?
! "encryptsign" : "encrypt", FALSE);
! }
! else
! add_parameter_1(&(X->type_opts_part), "x-action", "sign",
! FALSE);
}

/* If message is signed, it can not be character set converted! */

--- 387,440 ----


X->encoding_part_text = NULL;

if (do_pgp & PGP_MESSAGE) {
! int pe = give_dt_enumerate_as_int(&pgp_encrypt_type);
!
! switch (pe) {
! case 0:
! default:
! X -> TYPE = give_media_type2(MIME_TYPE_APPLICATION,"pgp",1);

! break;
! case 1:

! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"plain",0);
! if (!X -> TYPE)
! mime_panic(__FILE__,__LINE__,"convert_text",

! "text/plain is not known");
! break;
! case 2:
! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"x-pgp",1);
! }
! } else {
! int ps = give_dt_enumerate_as_int(&pgp_sign_type);
!
! switch (ps) {
! case 0:
! default:
! X -> TYPE = give_media_type2(MIME_TYPE_APPLICATION,"pgp",1);

! break;
! case 1:

! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"plain",0);
! if (!X -> TYPE)
! mime_panic(__FILE__,__LINE__,"convert_text",

! "text/plain is not known");
! break;
! case 2:
! X -> TYPE = give_media_type2(MIME_TYPE_TEXT,"x-pgp",1);
! }
}
!
if (do_pgp & PGP_PUBLIC_KEY)

! mime_params_add_compat(&(X->TYPE_opts_part),"format","keys-only");
else {


! mime_params_add_compat(&(X->TYPE_opts_part), "format", "text");
/* This next bit is a non-non-standard, but exmh does this and it
* can be very useful when parsing the message.
*/
if (pgp_status & PGP_MESSAGE) {
! mime_params_add_compat(&(X->TYPE_opts_part), "x-action",
! (do_pgp & PGP_SIGNED_MESSAGE) ?
! "encryptsign" : "encrypt");
! } else
! mime_params_add_compat(&(X->TYPE_opts_part), "x-action", "sign");
}

/* If message is signed, it can not be character set converted! */
***************

*** 488,498 ****
fputc('\n',tmpfile);
}
change_part = 1;
! } else if (strncmp(buffer, START_ENCODE,
! strlen(START_ENCODE)) == 0 ||
! strncmp(buffer, DONT_SAVE, strlen(DONT_SAVE)) == 0 ||
! strncmp(buffer, DONT_SAVE2, strlen(DONT_SAVE2)) == 0 ||
! strncmp(buffer, MIME_INCLUDE, strlen(MIME_INCLUDE)) ==0)
change_part = 1;
else if (strncmp(buffer,"[[",2) != 0 &&
strncmp(buffer,"[ ",2) != 0) {
--- 520,530 ----
fputc('\n',tmpfile);
}
change_part = 1;
! } else if (strncmp(buffer, START_ENCODE, strlen(START_ENCODE)) == 0 ||
! strncmp(buffer, DONT_SAVE, strlen(DONT_SAVE)) == 0 ||
! strncmp(buffer, DONT_SAVE2, strlen(DONT_SAVE2)) == 0 ||
! strncmp(buffer, MIME_INCLUDE, strlen(MIME_INCLUDE)) == 0 ||
! strncmp(buffer, MIME_ATTACH, strlen(MIME_ATTACH)) == 0)
change_part = 1;
else if (strncmp(buffer,"[[",2) != 0 &&
strncmp(buffer,"[ ",2) != 0) {
***************
*** 552,564 ****

if (mime_body_keywords && buffer[0] == '[') {

! if (strncmp(buffer, MIME_INCLUDE, strlen(MIME_INCLUDE)) ==0) {
X = new_part(mime_info);


X->save_it_on_copy = !no_save;
X->is_text = 0;

! if (Include_Part(dest,buffer,mime_info,X,mailer_info) < 0)

! return ok = 0;


continue;
} else if (strncmp(buffer, START_ENCODE,

strlen(START_ENCODE))==0) {
--- 584,598 ----

if (mime_body_keywords && buffer[0] == '[') {

! if (strncmp(buffer, MIME_INCLUDE, strlen(MIME_INCLUDE)) == 0 ||
! strncmp(buffer, MIME_ATTACH, strlen(MIME_ATTACH)) == 0) {
X = new_part(mime_info);


X->save_it_on_copy = !no_save;
X->is_text = 0;

! if (Include_Part(dest,buffer,mime_info,X,mailer_info,
! from_charset) < 0)

! ok = 0;


continue;
} else if (strncmp(buffer, START_ENCODE,

strlen(START_ENCODE))==0) {
***************
*** 590,596 ****
int i;
for (i = 0; i < 10; i++) {
char * filename = elm_message(FRM("%selmsd-%d-%d"),
! temp_dir, getpid (),


tmpcount++);
tmpfile = safeopen_rdwr(filename);
if (!tmpfile) {

--- 624,630 ----
int i;
for (i = 0; i < 10; i++) {
char * filename = elm_message(FRM("%selmsd-%d-%d"),
! tmp, getpid (),


tmpcount++);
tmpfile = safeopen_rdwr(filename);
if (!tmpfile) {
***************

*** 598,604 ****
DPRINT(Debug,10,(&Debug,
"convert_text: safeopen_rdwr: %s: %s (errno %d)\n",
filename,
! error_description(err),err));
} else {
unlink(filename);
DPRINT(Debug,10,(&Debug,
--- 632,638 ----
DPRINT(Debug,10,(&Debug,
"convert_text: safeopen_rdwr: %s: %s (errno %d)\n",
filename,
! strerror(err),err));
} else {
unlink(filename);
DPRINT(Debug,10,(&Debug,
***************
*** 632,638 ****


if (!X -> TYPE)
mime_panic(__FILE__,__LINE__,
"convert_text",
! "text/X-ELM-encode is not known");

fputs(START_ENCODE,tmpfile);
fputc('\n',tmpfile);

--- 666,672 ----


if (!X -> TYPE)
mime_panic(__FILE__,__LINE__,
"convert_text",
! "application/X-ELM-encode is not known");

fputs(START_ENCODE,tmpfile);
fputc('\n',tmpfile);
***************

*** 783,802 ****


return ok;
}

! int check_for_multipart(filedesc, mime_info, mailer_info)
FILE *filedesc;
mime_send_t *mime_info;
struct mailer_info *mailer_info;
{
char buffer[SLEN];
int Multi_Part = FALSE;

while (mail_gets(buffer, SLEN, filedesc))
if (mime_body_keywords && buffer[0] == '[') {
! if (strncmp(buffer, MIME_INCLUDE, strlen(MIME_INCLUDE)) == 0) {


Multi_Part = TRUE;
if (Include_Part(NULL,buffer, mime_info, NULL,
! mailer_info) == -1) {
return(-1);
}
}

--- 817,839 ----


return ok;
}

! int check_for_multipart(filedesc, mime_info, mailer_info, from_charset)
FILE *filedesc;
mime_send_t *mime_info;
struct mailer_info *mailer_info;
+ charset_t from_charset;
{
char buffer[SLEN];
int Multi_Part = FALSE;

while (mail_gets(buffer, SLEN, filedesc))
if (mime_body_keywords && buffer[0] == '[') {
! if (strncmp(buffer, MIME_INCLUDE, strlen(MIME_INCLUDE)) == 0 ||
! strncmp(buffer, MIME_ATTACH, strlen(MIME_ATTACH)) == 0) {


Multi_Part = TRUE;
if (Include_Part(NULL,buffer, mime_info, NULL,
! mailer_info,
! from_charset) == -1) {
return(-1);
}
}
***************

*** 805,822 ****


return(Multi_Part);
}

! static int Include_Part(dest, buffer, mime_info, X, mailer_info)
FILE *dest;
char *buffer;
mime_send_t *mime_info;
struct mime_send_part * X;
struct mailer_info *mailer_info;
{
int check = (X == NULL);

! char *ptr;


char *incptr;
char Include_Filename[SLEN];
! char Expanded_Filename[SLEN];
char Primary_Type[SLEN];
char SubType[SLEN];
media_type_t Type;

--- 842,865 ----


return(Multi_Part);
}

! static int Include_Part(dest, buffer, mime_info, X, mailer_info, from_charset)
FILE *dest;
char *buffer;
mime_send_t *mime_info;
struct mime_send_part * X;
struct mailer_info *mailer_info;
+ charset_t from_charset;
{
int check = (X == NULL);

! char *ptr = NULL;


char *incptr;
char Include_Filename[SLEN];
! struct string * orig_filename = NULL;
! struct folder_browser * expanded_file = new_browser(selection_file);
! char * expanded_2 = NULL;
! int is_copy = 0;

! int ret = 0;
!

char Primary_Type[SLEN];
char SubType[SLEN];
media_type_t Type;
***************

*** 826,832 ****
FILE *incfile;
int is_text;

! ptr = buffer + strlen(MIME_INCLUDE);
while ((*ptr != '\0') && (*ptr == ' '))
ptr++;
incptr = Include_Filename;
--- 869,886 ----
FILE *incfile;
int is_text;

! int is_attachment = -1;
!
! if (0 == strncmp(buffer, MIME_INCLUDE, strlen (MIME_INCLUDE))) {
! ptr = buffer + strlen(MIME_INCLUDE);
! is_attachment = 0;
! } else if (0 == strncmp(buffer, MIME_ATTACH, strlen (MIME_ATTACH))) {
! ptr = buffer + strlen(MIME_ATTACH);
! is_attachment = 1;
! } else
! panic("MIME PANIC",__FILE__,__LINE__,"Include_Part",
! "Bad buffer",0);
!
while ((*ptr != '\0') && (*ptr == ' '))
ptr++;
incptr = Include_Filename;
***************
*** 888,943 ****


if (strlen(Include_Filename) == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoIncludeFilename,
"No Filename given, include line ignored"));
! return(-1);
}
! if (0 != expand_env(Expanded_Filename, Include_Filename,
! sizeof(Expanded_Filename))) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedToExpandInclude,
"Failed to expand include filename"));
! return -1;
}

if (strlen(Primary_Type) == 0 || strlen(SubType) == 0 ) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoContentTypeGiven,
"No Content-type given, include line ignored"));
! return(-1);
}

! Enc_Type = check_encoding(Encoding);



if (Enc_Type == ENCODING_ILLEGAL) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEncodingIsIllegal,
"Encoding is illegal"));
! return(-1);
}

! if (can_open(Expanded_Filename, "r")) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIncludeCannotAccess,
"Include File can't be accessed"), 0);
! return(-1);
}

/* Don't allow 7BIT if 8-bit charcters in any type,
* don't allow 8BIT if 'binary' characters - K E H */

! if (Enc_Type == ENCODING_7BIT || Enc_Type == ENCODING_NONE


|| Enc_Type == ENCODING_8BIT) {
!
! FILE * fp = fopen (Expanded_Filename, "r");
if (fp) {
int tmp = needs_encoding (fp);
if (tmp & HAVE_BINARY) {

! lib_error(CATGETS(elm_msg_cat, ElmSet,ElmIncludeBINARY,
! "Include file has BINARY data."));

! if (Enc_Type == ENCODING_7BIT || Enc_Type == ENCODING_8BIT)
! return -1; /* indicate failure */

! Enc_Type = ENCODING_BINARY;
! } else if ((tmp & HAVE_8BIT) && Enc_Type != ENCODING_8BIT) {
! lib_error (CATGETS(elm_msg_cat, ElmSet,ElmInclude8BIT,
! "Include file has 8BIT data."));

! if (Enc_Type == ENCODING_7BIT)
! return -1; /* indicate failure */

! Enc_Type = ENCODING_8BIT;

}
fclose(fp);
}
--- 942,1068 ----


if (strlen(Include_Filename) == 0) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoIncludeFilename,
"No Filename given, include line ignored"));

! ret = -1;


! goto check_out;
}
!
! orig_filename = new_string2(from_charset,s2us(Include_Filename));
!
! if (! select_dir_item(expanded_file,&orig_filename)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailedToExpandInclude,
"Failed to expand include filename"));

! ret = -1;


! goto check_out;
}

if (strlen(Primary_Type) == 0 || strlen(SubType) == 0 ) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmNoContentTypeGiven,
"No Content-type given, include line ignored"));

! ret = -1;
! goto check_out;
}

!
! if (! Encoding[0]) {
! Enc_Type = ENCODING_NONE;
!
! DPRINT(Debug,11,(&Debug,
! "Include_Part: Encoding not given\n"));
! } else
! Enc_Type = check_encoding(Encoding);



if (Enc_Type == ENCODING_ILLEGAL) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmEncodingIsIllegal,
"Encoding is illegal"));

! ret = -1;


! goto check_out;
}

!
! Type = give_media_type(Primary_Type,SubType,1);
!
! /* 1 if is text type (true)
! * 0 if not text type
! * -1 if can't be encoded (ie structured) Message/ or Multipart/

! */
!

! /* 7bit and 8bit are only allowed for line orienteed types */

! if (Enc_Type == ENCODING_7BIT ||

! Enc_Type == ENCODING_8BIT) {
! DPRINT(Debug,11,(&Debug,
! "Include_Part: textual encoding (%s)\n",
! ENCODING(Enc_Type)));
! is_text = 1;
! } else
! is_text = give_text_type_code(Type);
!

!
!
!

! if (!dir_make_ref(expanded_file,&expanded_2,&is_copy, is_text)) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmIncludeCannotAccess,

"Include File can't be accessed"), 0);
! ret = -1;


! goto check_out;
}

+
/* Don't allow 7BIT if 8-bit charcters in any type,
* don't allow 8BIT if 'binary' characters - K E H */

! if (Enc_Type == ENCODING_7BIT

! || Enc_Type == ENCODING_NONE


|| Enc_Type == ENCODING_8BIT) {
!
! FILE * fp = fopen (expanded_2, "r");
if (fp) {
int tmp = needs_encoding (fp);

+
if (tmp & HAVE_BINARY) {
!
! if (Enc_Type != ENCODING_NONE)
! lib_error(CATGETS(elm_msg_cat, ElmSet,ElmIncludeBINARY,
! "Include file has BINARY data."));

!
! if (Enc_Type == ENCODING_7BIT ||

! Enc_Type == ENCODING_8BIT) {
! /* indicate failure */
! ret = -1;
! goto check_out;
! }
!
!
! if (Enc_Type == ENCODING_NONE &&
! mime_info->raw_level < mailer_binary)
! Enc_Type = ENCODING_BASE64;
! else
! Enc_Type = ENCODING_BINARY;
!

+ } else if ((tmp & HAVE_8BIT) && Enc_Type != ENCODING_8BIT) {
+
+ if (Enc_Type != ENCODING_NONE)
+
+ lib_error (CATGETS(elm_msg_cat, ElmSet,ElmInclude8BIT,
+ "Include file has 8BIT data."));
+ if (Enc_Type == ENCODING_7BIT) {
+ /* indicate failure */
+ ret = -1;
+ goto check_out;
+ }
+
+ if (is_text > 0) {
+ if (Enc_Type == ENCODING_NONE &&
+ mime_info->raw_level < mailer_8bit)
+ Enc_Type = ENCODING_BASE64;
+ else
+ Enc_Type = ENCODING_8BIT;
+ } else {
+ if (Enc_Type == ENCODING_NONE &&
+ mime_info->raw_level < mailer_binary)
+ Enc_Type = ENCODING_BASE64;
+ else
+ Enc_Type = ENCODING_BINARY;
+ }
}
fclose(fp);
}
***************
*** 947,953 ****


if (mime_info->raw_level < mailer_8bit) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmDoesnt8BIT,
"Mailer (MTA) doesn't support 8BIT encoding."));
! return -1; /* indicate failure */
}
}

--- 1072,1079 ----


if (mime_info->raw_level < mailer_8bit) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmDoesnt8BIT,
"Mailer (MTA) doesn't support 8BIT encoding."));

! ret = -1; /* indicate failure */
! goto check_out;
}
}

***************
*** 955,1002 ****


if (mime_info->raw_level < mailer_binary) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmDoesntBINARY,
"Mailer (MTA) doesn't support BINARY encoding!"));
! return (-1);
}
}

- Type = give_media_type(Primary_Type,SubType,1);
-
- /* 1 if is text type (true)
- * 0 if not text type
- * -1 if can't be encoded (ie structured) Message/ or Multipart/

- */
-

--- 1081,1134 ----


if (mime_info->raw_level < mailer_binary) {
lib_error (CATGETS(elm_msg_cat, ElmSet,ElmDoesntBINARY,
"Mailer (MTA) doesn't support BINARY encoding!"));

! ret = -1;


! goto check_out;
}
}


if (is_text < 0 && (Enc_Type == ENCODING_QUOTED ||
Enc_Type == ENCODING_BASE64)) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmDontEncoding,
"Content-Type don't allow encoding -- ignoring this part."));
!

! ret = -1;


! goto check_out;
}


(void) update_encoding(&(mime_info->encoding_top),Enc_Type);

if (check) {
! check_out:
!
! if (orig_filename)
! free_string(&orig_filename);
! if (expanded_file)
! free_dir(&expanded_file);
!
! if (expanded_2) {
! if (is_copy &&
! 0 == unlink(expanded_2)) {
! DPRINT(Debug,4,(&Debug,

! "Include_Part: '%s' unlinked\n",
! expanded_2));
! }
! free(expanded_2);
!
! }
!

! return ret;
}

!
!
!
! incfile = fopen (expanded_2, "r");
if (incfile) {
DPRINT(Debug,4,(&Debug,
"Include_Part: '%s' C-T=%s/%s Params=%s Enc=%d is_text=%d\n",
! expanded_2,Primary_Type,SubType, Params, Enc_Type,
is_text));

X->encoding_part = Enc_Type;
***************

*** 1004,1019 ****


X->encoding_part_text = safe_strdup(Encoding);
}
X->TYPE = Type;
! if (Params[0])
! X->type_opts_part = safe_strdup(Params);

/* When user uses [include ...] it is better use disposition
* 'inline' instead of 'attachment'
*/
! X->disposition = DISP_INLINE;
! add_parameter_1(&(X->disposition_opts),"filename",
! Include_Filename,0);

!
fputc('\n',dest); /* filler */
X->start_loc = ftell(dest);

--- 1136,1217 ----


X->encoding_part_text = safe_strdup(Encoding);
}
X->TYPE = Type;
! if (Params[0]) {

! int mp = give_dt_enumerate_as_int(&mime_parameters);
! /* 0 == plain
! 1 == encoded
! 2 == plain-and-encoded
! */
!

! struct string * XX = new_string2(from_charset,s2us(Params));
!
! switch(mp) {
! case 0:
! X->TYPE_opts_part = parse_mime_param_string(XX,0,1);

! break;
! case 1:

! X->TYPE_opts_part = parse_mime_param_string(XX,0,0);
! break;
! default:


! X->TYPE_opts_part = parse_mime_param_string(XX,
! MAX_COMPAT_LEN,
! 0);
! break;
! }
! free_string(&XX);
! }

/* When user uses [include ...] it is better use disposition
* 'inline' instead of 'attachment'
*/


! {
! int mp = give_dt_enumerate_as_int(&mime_parameters);
! /* 0 == plain
! 1 == encoded

! 2 == ascii-and-encoded
! */
!

! int was_ok = 1;
! char * compat = compat_filename(Include_Filename,&was_ok);

! int have_encoded = 0;
!

! if (mp > 0 &&

! (!was_ok || !can_ascii_string(orig_filename))) {
!
!
! struct string *p1 = pick_name(orig_filename);
!
! if (p1) {
! mime_params_add(& (X->DISPOSITION_opts),
! "filename", p1);


!
! free_string(&p1);
!
! have_encoded ++;
! }
! }

!
! DPRINT(Debug,9,
! (&Debug,

! "include: mime_parameters=%d have_encoded=%d was_ok=%d\n",
! mp,have_encoded));

!
!
!

! if (0 == mp ||
! 2 == mp ||
! ! have_encoded) {
!

! mime_params_add_compat(&(X->DISPOSITION_opts),"filename",
! compat);
!
! }

! free(compat); compat = NULL;
!
! }

!
! X->disposition = is_attachment ? DISP_ATTACH: DISP_INLINE;


!
fputc('\n',dest); /* filler */
X->start_loc = ftell(dest);

***************

*** 1046,1052 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmWriteFailedCopy,


"Write failed to temp file in copy"));
! return -1; /* Just indicate failure */
}

DPRINT(Debug,4,(&Debug,

--- 1244,1252 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmWriteFailedCopy,


"Write failed to temp file in copy"));

! /* Just indicate failure */
! ret = -1;
! goto fail_out;
}

DPRINT(Debug,4,(&Debug,
***************
*** 1058,1066 ****


} else {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenIncludedFile,
"Can't open included File"));
! return -1;
}
! return(0);
}


--- 1258,1284 ----


} else {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenIncludedFile,
"Can't open included File"));

! ret = -1;
! goto fail_out;


}
!
! fail_out:
! if (orig_filename)
! free_string(&orig_filename);
! if (expanded_file)
! free_dir(&expanded_file);
!
! if (expanded_2) {
! if (is_copy &&
! 0 == unlink(expanded_2)) {
! DPRINT(Debug,4,(&Debug,

! "Include_Part: '%s' unlinked\n",
! expanded_2));
! }
! free(expanded_2);
! }
!

! return ret;
}


***************
*** 1129,1136 ****


return (ret);
}

- char *error_description();
-
int have_metamail()
{
int return_value = 1;

--- 1347,1352 ----
***************
*** 1144,1153 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantMetamail,
"Can't execute metamail: %s.30: %.30s"),
metamail_path,
! error_description(err));
DPRINT(Debug,6, (&Debug,
"have_metamail: no access %s: %s\n",metamail_path,


! error_description(err)));
sleep_message();
return_value = 0;
}

--- 1360,1369 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantMetamail,
"Can't execute metamail: %s.30: %.30s"),
metamail_path,
! strerror(err));
DPRINT(Debug,6, (&Debug,
"have_metamail: no access %s: %s\n",metamail_path,


! strerror(err)));
sleep_message();
return_value = 0;
}

Index: elmME+.2.5.alpha5-cvs/src/mime_encode.c
*** elmME+.2.5.alpha4/src/mime_encode.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/mime_encode.c 2005-07-23 22:01:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mime_encode.c,v 1.32 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.32 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mime_encode.c,v 1.32.8.2 2005/07/23 19:01:39 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.32.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 43,69 ****
return str;
}

- void add_parameter_t (t,name,value,quoted)
- mime_t *t;
- char *name, *value;
- int quoted;
- {
- char buffer[1025];
-
- if (t->magic != MIME_magic)
- mime_panic(__FILE__,__LINE__,"add_paramater_t",

- "Bad magic number");
-

- buffer[0] = '\0';
-
- if (t->type_opts)
- strfcpy(buffer,t->type_opts,sizeof(buffer));
-
- add_parameter(buffer,name,value,sizeof buffer,quoted);
-
- t->type_opts = strmcpy(t->type_opts,buffer);
- }
-
void add_parameter(opts,name,value,size,quoted)
char *opts, *name, *value;
int size, quoted;
--- 43,48 ----
***************
*** 110,127 ****

mime_panic(__FILE__,__LINE__,"attach_message",
"Bad magic number");


! if ((err = can_open(part->pathname,"r")) != 0) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrno,
! "Failed: %.30s: %.40s"),
! part->pathname,error_description(err));
return 0;
}

! srcfp = fopen (part->pathname, "r");
if (!srcfp) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorOpeningName,
! "Error opening %s!"),
! part->pathname);
}

/* 1 if is text type (true)
--- 89,106 ----

mime_panic(__FILE__,__LINE__,"attach_message",
"Bad magic number");


! if ((err = can_open(part->pathname0,"r")) != 0) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmFailErrnoS,
! "Failed: %S: %.40s"),

! part->dispname,strerror(err));

Index: elmME+.2.5.alpha5-cvs/src/mkhdrs.c
*** elmME+.2.5.alpha4/src/mkhdrs.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/mkhdrs.c 2005-07-20 19:49:49.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: mkhdrs.c,v 1.25 2004/03/27 18:31:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: mkhdrs.c,v 1.25.8.1 2005/07/20 16:49:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.25.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 28,35 ****
DEBUG_VAR(Debug,__FILE__,"header");
#endif

- char *elm_date_str();
-

static unsigned char *s2us P_((char *str));

static unsigned char *s2us(str)
--- 28,33 ----

Index: elmME+.2.5.alpha5-cvs/src/newmbox.c
*** elmME+.2.5.alpha4/src/newmbox.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/newmbox.c 2005-07-26 11:28:44.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.85.8.1 2004/08/07 18:07:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.85.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmbox.c,v 1.85.8.5 2005/07/26 08:28:44 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.85.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 24,31 ****


extern int errno;
#endif

- char *error_description();

- long bytes();
#if !defined(ANSI_C) && !defined(atol) /* avoid problems with systems that declare atol as a macro */
extern void rewind();
extern long atol();
--- 24,29 ----

***************
*** 36,42 ****
struct menu_context *page)); /* Prototype */

int open_folder_lock(direction,folder)

! int direction;
struct folder_info *folder;
{

DPRINT(Debug,10,(&Debug,
--- 34,40 ----
struct menu_context *page)); /* Prototype */

int open_folder_lock(direction,folder)

! enum lock_direction direction;
struct folder_info *folder;
{

DPRINT(Debug,10,(&Debug,

***************
*** 74,85 ****
return 1;
}

! void newmbox_1(new_folder, adds_only,mailbox, append, header_page,page)
struct folder_info *new_folder;
int adds_only;
struct MailboxView **mailbox;
int append;

- int *header_page;
struct menu_context *page;
{

int ret;
--- 72,82 ----
return 1;
}

! void newmbox_1(new_folder, adds_only,mailbox, append, page)
struct folder_info *new_folder;
int adds_only;
struct MailboxView **mailbox;
int append;

struct menu_context *page;
{
int ret;
***************
*** 201,208 ****


update_view(*mailbox);
! resort_mailbox(*mailbox, adds_only ||


! append && !same_file, header_page);

return;
}

--- 198,208 ----


update_view(*mailbox);
! resort_mailbox(*mailbox,
! adds_only
! ||
! ( append && !same_file )
! );



return;
}
***************
*** 266,272 ****

menu_get_sizes(default_context,&LINES, &COLUMNS);

! width = COLUMNS - 52
- ((skipcount >= 10000) ? 1 : 0)
- ((count >= 10000) ? 1 : 0);

--- 266,272 ----



menu_get_sizes(default_context,&LINES, &COLUMNS);

! width = COLUMNS - 53
- ((skipcount >= 10000) ? 1 : 0)
- ((count >= 10000) ? 1 : 0);

***************
*** 443,453 ****


/* Keep current_header->mime_rec.type_opts ! */
}
DPRINT(Debug,10,(&Debug,
! "-- encrypted, %d/%s; opts=%s\n",
get_major_type_code(current_header->
mime_rec.TYPE),
! get_subtype_name(current_header->mime_rec.TYPE),
! NONULL(current_header->mime_rec.type_opts)));
}

#ifdef USE_PGP

--- 443,453 ----


/* Keep current_header->mime_rec.type_opts ! */
}
DPRINT(Debug,10,(&Debug,
! "-- encrypted, %d/%s\n",
get_major_type_code(current_header->
mime_rec.TYPE),
! get_subtype_name(current_header->mime_rec.TYPE)));
!
}

#ifdef USE_PGP
***************
*** 457,463 ****
DPRINT(Debug,10,(&Debug, "-- PGP PUBLIC KEY: %s\n",
buffer));
} else {
- char pgpbuffer[STRING];

/* Text/plain can be converted to
* application/pgp. There will a possible

--- 457,462 ----


***************
*** 476,523 ****
}

if (strncmp(buffer + 15, "SIG", 3) == 0) {
current_header->pgp |= PGP_SIGNED_MESSAGE;
DPRINT(Debug,10,(&Debug, "-- PGP signed: %s\n",
buffer));

! if (!mime_get_param("x-action",
! pgpbuffer,
! current_header->
! mime_rec.type_opts,
! sizeof(pgpbuffer))) {
! add_parameter_t(&(current_header->mime_rec),
! "x-action", "sign",
! FALSE);
}
DPRINT(Debug,10,(&Debug,
! "-- PGP signed, %d/%s; opts=%s\n",
get_major_type_name(current_header->
mime_rec.TYPE),
get_subtype_name(current_header->
! mime_rec.TYPE),
! NONULL(current_header->

! mime_rec.type_opts)));
} else {


current_header->pgp |= PGP_MESSAGE;
DPRINT(Debug,10,(&Debug,
"-- PGP message: %s\n",
buffer));
!
! if (!mime_get_param("x-action",pgpbuffer,
! current_header->
! mime_rec.type_opts,
! sizeof(pgpbuffer))) {
! add_parameter_t(&(current_header->mime_rec),
! "x-action", "encrypt",FALSE);
}
DPRINT(Debug,10,(&Debug,
! "-- PGP message, %d/%s; opts=%s\n",
get_major_type_name(current_header->
mime_rec.TYPE),
get_subtype_name(current_header->
! mime_rec.TYPE),
! NONULL(current_header->
! mime_rec.type_opts)));
}
}
}

--- 475,524 ----


}

if (strncmp(buffer + 15, "SIG", 3) == 0) {

+ const char *mp;
+

current_header->pgp |= PGP_SIGNED_MESSAGE;
DPRINT(Debug,10,(&Debug, "-- PGP signed: %s\n",
buffer));

! mp = get_mime_param_compat(current_header->
! mime_rec.TYPE_opts,
! "x-action");
! if (!mp) {
! mime_params_add_compat(& (current_header->
! mime_rec.TYPE_opts),
! "x-action", "sign");
!
}
DPRINT(Debug,10,(&Debug,
! "-- PGP signed, %d/%s; \n",
get_major_type_name(current_header->
mime_rec.TYPE),
get_subtype_name(current_header->
! mime_rec.TYPE)));
} else {

+ const char *mp;
+

--- 565,573 ----


return 1;
}

! void resort_mailbox(mailbox, add_new_only)
struct MailboxView *mailbox;
int add_new_only;
{
int current;
int count = get_message_count(mailbox);
***************
*** 619,625 ****
goto found_new;
}
}
! switch (sortby) {
case SENT_DATE:
case RECEIVED_DATE:
case MAILBOX_ORDER:

--- 619,625 ----


goto found_new;
}
}
! switch (give_dt_sort_as_int(&sortby)) {
case SENT_DATE:
case RECEIVED_DATE:
case MAILBOX_ORDER:
***************
*** 631,643 ****

set_current(mailbox,current);

- {
- struct menu_common MENU;
-
- set_mcommon_from_mbxview(&MENU,mailbox);
-
- get_page(current, &MENU, header_page);
- }
}
}

--- 631,636 ----
***************
*** 661,667 ****
struct counter_data COUNTER;

struct read_folder_state * read_state_ptr = NULL;
! CONST char *msg;


int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

--- 654,660 ----
struct counter_data COUNTER;

struct read_folder_state * read_state_ptr = NULL;
! const char *msg;


int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

Index: elmME+.2.5.alpha5-cvs/src/options.c
*** elmME+.2.5.alpha4/src/options.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/options.c 2005-07-23 12:24:14.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: options.c,v 1.24.8.5 2004/09/25 13:29:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: options.c,v 1.24.8.7 2005/07/23 09:24:14 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 77,100 ****


#undef onoff
#define onoff(n) (n == 1? on_name : off_name)

- extern char *alias_sort_name(), *sort_name();
-
static void on_or_off P_((int *var, int x, int y,
struct menu_context *page));
- static void switch_user_level P_((int *ulevel, int x, int y,

- struct menu_context *page));
static void one_liner P_((char *string,
struct menu_context *page));
static void sort_one_liner P_((int sorting_by,
struct menu_context *page));
static void alias_sort_one_liner P_((int sorting_by,
struct menu_context *page));


! static int change_sort P_((int *var, int x, int y,
struct MailboxView *mailbox,
struct menu_context *page));
- static int change_alias_sort P_((int *var,int x, int y,
- struct AliasView *aview,
- struct menu_context *page));
static int info_enter P_((char *name, int ypos, int xpos, int append_current,

int passwd, struct MailboxView *mailbox,
struct AliasView *aview,
--- 77,94 ----


#undef onoff
#define onoff(n) (n == 1? on_name : off_name)

static void on_or_off P_((int *var, int x, int y,

struct menu_context *page));
static void one_liner P_((char *string,
struct menu_context *page));
static void sort_one_liner P_((int sorting_by,
struct menu_context *page));
static void alias_sort_one_liner P_((int sorting_by,
struct menu_context *page));


! static int change_sort P_((struct dt_sort_info *var, int x, int y,
struct MailboxView *mailbox,
+ struct AliasView *aview,

struct menu_context *page));


static int info_enter P_((char *name, int ypos, int xpos, int append_current,

int passwd, struct MailboxView *mailbox,
struct AliasView *aview,
***************
*** 110,132 ****


static int resort = 0;


-

-
-

- static int post_folder P_((int f));
- static int post_folder(f)
- int f;
- {
- (void) expand_env(folders, raw_folders, sizeof(folders));

- return 0;
- }
-

static int post_sort P_((int f));
static int post_sort(f)
int f;
{
! if (f)
resort++;
return 0;
}

--- 104,117 ----


static int resort = 0;


static int post_sort P_((int f));
static int post_sort(f)
int f;
{
! if (f) {
!
resort++;

+ }
return 0;
}

***************
*** 139,156 ****


return 0;
}

- /* ? ? ? What this is ? */
- static int post_menu P_((int f));
- static int post_menu(f)
- int f;

- {
- int LINES, COLUMNS;
-

- menu_get_sizes(default_context,&LINES, &COLUMNS);
-
- headers_per_page = LINES - (mini_menu ? 14 : 9);
- return 0;
- }

opts_menu cfg_opts[] = {

--- 124,129 ----
***************
*** 171,177 ****


{'e', "E)ditor (primary)", ElmOptionEditorMenu, "editor", NULL,
"This is the editor used for all outbound messages (may be 'builtin').", ElmOptionEditorHelp},

! {'f', "F)older directory", ElmOptionFolderMenu, "maildir", post_folder,
"This is the folders directory used when '=' (etc) is used in filenames.", ElmOptionFolderHelp},

{'h', "H)old sent message", ElmOptionHoldMenu, "copy", NULL,

--- 144,150 ----


{'e', "E)ditor (primary)", ElmOptionEditorMenu, "editor", NULL,
"This is the editor used for all outbound messages (may be 'builtin').", ElmOptionEditorHelp},

! {'f', "F)older directory", ElmOptionFolderMenu, "maildir", NULL,
"This is the folders directory used when '=' (etc) is used in filenames.", ElmOptionFolderHelp},

{'h', "H)old sent message", ElmOptionHoldMenu, "copy", NULL,
***************

*** 186,192 ****


{'l', "A(l)ias Sorting", ElmOptionaLiasMenu, "aliassortby", post_sort,
"This is used to specify the sorting criteria for the alias display.", ElmOptionaLiasHelp},

! {'m', "M)enu display", ElmOptionMenuMenu, "menu", post_menu,
"This determines if you have the mini-menu displayed or not.", ElmOptionMenuHelp},

{'n', "N)ames only", ElmOptionNameMenu, "names", NULL,

--- 159,165 ----


{'l', "A(l)ias Sorting", ElmOptionaLiasMenu, "aliassortby", post_sort,
"This is used to specify the sorting criteria for the alias display.", ElmOptionaLiasHelp},

! {'m', "M)enu display", ElmOptionMenuMenu, "menu", NULL,
"This determines if you have the mini-menu displayed or not.", ElmOptionMenuHelp},

{'n', "N)ames only", ElmOptionNameMenu, "names", NULL,
***************

*** 255,264 ****


return(o->parm ? o : NULL);
}

!
! char *
! one_liner_for(c)
! char c;
{
opts_menu *o;

--- 228,236 ----


return(o->parm ? o : NULL);
}

! static char * one_liner_for P_((int c));
! static char * one_liner_for(c)
! int c;
{
opts_menu *o;

***************

*** 270,276 ****


return(NULL);
}

-
static void display_options(page)
struct menu_context *page;
{

--- 242,247 ----
***************
*** 330,335 ****
--- 301,307 ----
CATGETS(elm_msg_cat, ElmSet, ElmPressKeyHelp,


"Press the key you want help for, '?' for a key list, or '.' to exit help"));

+ /* FIXME */
lower_prompt(prompt = catgets(elm_msg_cat, ElmSet, ElmKeyPrompt, "Key : "));

while ((c = menu_ReadCh(page,0|READCH_sig_char|READCH_CURSOR)) != '.') {
***************

*** 384,390 ****


}

char * level_name(n)
! int n;
{
/** return the 'name' of the level... **/

--- 356,362 ----


}

char * level_name(n)
! int n;
{
/** return the 'name' of the level... **/

***************

*** 459,466 ****


ElmSelectOptionLetter,
"Select letter of option line, '>' to save, or 'i' to return to index."));

! PutLineX(LINES-3, 0,

! CATGETS(elm_msg_cat, ElmSet, ElmPrompt, "Command: "));

ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize|READCH_CURSOR);
if (ch == REDRAW_MARK)

--- 431,439 ----


ElmSelectOptionLetter,
"Select letter of option line, '>' to save, or 'i' to return to index."));

! menu_PutLineX(page,

! LINES-3, 0,

! CATGETS(elm_msg_cat, ElmSet, ElmPrompt, "Command: "));

ch = menu_ReadCh(page, REDRAW_MARK|READCH_resize|READCH_CURSOR);
if (ch == REDRAW_MARK)
***************

*** 540,551 ****


int ch;
int oldvar = *var;

! PutLineX(x, y+6,
! CATGETS(elm_msg_cat, ElmSet, ElmUseSpaceToToggle,
! "(use <space> to toggle, any other key to leave)"));
!
! MoveCursor(x,y+3); /* at end of value... */

do {
ch = menu_ReadCh(page,READCH_sig_char|READCH_CURSOR);

--- 513,525 ----


int ch;
int oldvar = *var;

! menu_PutLineX(page,
! x, y+6,
! CATGETS(elm_msg_cat, ElmSet, ElmUseSpaceToToggle,
! "(use <space> to toggle, any other key to leave)"));

+ menu_MoveCursor(page,x,y+3); /* at end of value... */
+
do {
ch = menu_ReadCh(page,READCH_sig_char|READCH_CURSOR);

***************

*** 554,663 ****
break;
}

! if (ch == SPACE) {


*var = ! *var;
! PutLine0(x,y, onoff(*var));
! }
! } while (ch == SPACE);
!
! MoveCursor(x,y+4); CleartoEOLN(); /* remove help prompt */
}


! static void switch_user_level(ulevel, x, y, page)
! int *ulevel, x, y;

struct menu_context *page;
{


! /** step through possible user levels... **/

! PutLineX(x, y+20,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceToChange,
! "<space> to change"));

! MoveCursor(x,y); /* at end of value... */

! while (menu_ReadCh(page,0) == ' ') {
! *ulevel = (*ulevel >= 2? 0 : *ulevel + 1);
! PutLineX(x,y, FRM("%s"), level_name(*ulevel));
! }

! MoveCursor(x,y+20); CleartoEOLN(); /* remove help prompt */
}


! static int change_sort(var, x, y, mailbox, page)
! int *var;
int x,y;

struct MailboxView *mailbox;
struct menu_context *page;
{

! /** change the sorting scheme... **/
! /** return !0 if new sort order, else 0 **/

! int last_sortby, /* so we know if it changes... */
! sign = 1; /* are we reverse sorting?? */
! int ch; /* character typed in ... */

! int LINES, COLUMNS;


! menu_get_sizes(page,&LINES, &COLUMNS);


/* *var = sortby; or... *var == sortby; */
! last_sortby = sortby; /* remember current ordering */

- PutLineX(x, COLUMNS-29,
- CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
- "(SPACE for next, or R)everse)"));
- sort_one_liner(sortby, page);
- MoveCursor(x, y);

! do {
! ch = menu_ReadCh(page, READCH_sig_char|READCH_CURSOR);

! if (ch == TERMCH_interrupt_char) {
! sortby = last_sortby;
! break;

! }

#ifdef ASCII_CTYPE


! if (isascii(ch))
#endif
ch = tolower(ch);
! switch (ch) {
! case SPACE : if (sortby < 0) {
! sign = -1;
! sortby = - sortby;
! }
! else sign = 1; /* insurance! */
! sortby = sign * ((sortby + 1) % (STATUS+3));
! if (sortby == 0) sortby = sign; /* snicker */
! PutLine0(x, y, sort_name(PAD));
! sort_one_liner(sortby, page);
! MoveCursor(x, y);

! break;
!

! case 'r' : sortby = - sortby;
! PutLine0(x, y, sort_name(PAD));
! sort_one_liner(sortby, page);
! MoveCursor(x, y);
! }
! } while (ch == SPACE || ch == 'r');
!
! MoveCursor(x, COLUMNS-30); CleartoEOLN();
!
! if (sortby != last_sortby) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmResortingFolder,
! "Resorting folder..."));
! if (sleepmsg > 0) {
! error_sleep((sleepmsg + 1) / 2);
! }
! sort_mailbox(get_message_count(mailbox), 0, mailbox);
}
! ClearLine(LINES-3); /* clear sort_one_liner()! */
! *var=sortby;
! sortby=last_sortby;
! return(*var-sortby);
}

static void one_liner(string, page)

--- 528,823 ----
break;
}

! if (ch == ' ') {


*var = ! *var;
! menu_PutLine0(page,x,y, onoff(*var));
! }

! } while (ch == ' ');


!
! menu_MoveCursor(page,x,y+4);
! menu_CleartoEOLN(page); /* remove help prompt */
}


! static void change_enum P_((struct dt_enumerate_info *enumeration,
! int x, int y,

! struct menu_context *page));


! static void change_enum(enumeration, x, y, page)
! struct dt_enumerate_info *enumeration;
! int x, y;

struct menu_context *page;
{


! int c;
! int val = enumeration->val;
!
! menu_PutLineX(page,
! x,y, FRM("%s"),
! give_dt_enumerate_as_str(enumeration));

! menu_CleartoEOLN(page);
!
! menu_PutLineX(page,

! x, y+20,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceToChange,
! "<space> to change"));

! menu_MoveCursor(page,
! x,y); /* at end of value... */

! while ((c = menu_ReadCh(page,0)) == ' ') {

! val = (val +1 ) % enumeration->nlen;
!
! menu_PutLineX(page,
! x,y, FRM("%s"), enumeration->list[val]);
!

! menu_CleartoEOLN(page);
!
! menu_PutLineX(page,

! x, y+20,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceToChange,
! "<space> to change"));
!
! menu_MoveCursor(page,
! x,y); /* at end of value... */
! }
!
! if (c == TERMCH_interrupt_char) {
! fail:
! menu_PutLineX(page,
! x,y, FRM("%s"),
! give_dt_enumerate_as_str(enumeration));
! menu_CleartoEOLN(page);
! return;
! }

!

! if (c != '\n') {
! char buffer[SLEN+1];
! int code;
!
! menu_MoveCursor(page,
! x,y); /* at end of value... */
! menu_CleartoEOLN(page);

! buffer[0] = c;
! buffer[1] = '\0';
!
! code = optionally_enter(buffer, x,y,
! OE_SIG_CHAR|OE_REDRAW_MARK|OE_APPEND_CURRENT,
! sizeof buffer,page);

!

! if (0 != code) /* Ctrl-C, error or REDRAW_MARK*/

! goto fail;
!

! if (! set_dt_enumerate_as_str(enumeration,buffer))
! goto fail;
! } else
! enumeration->val = val;
!
! menu_PutLineX(page,
! x,y, FRM("%s"),
! give_dt_enumerate_as_str(enumeration));
! menu_CleartoEOLN(page);
! return;
}


! static int change_sort(var, x, y, mailbox, aview, page)
! struct dt_sort_info *var;
int x,y;
struct MailboxView *mailbox;

+ struct AliasView *aview;
struct menu_context *page;


{
! /** change the sorting scheme... **/

! /** return !0 if new sort order, else 0 **/
!
! int last_sortby, /* so we know if it changes... */
! sign = 1; /* are we reverse sorting?? */
! int ch; /* character typed in ... */
!
! int last_unstable = unstable_reverse_thread;

! int LINES, COLUMNS;


! int z,lastval=0;

! menu_get_sizes(page,&LINES, &COLUMNS);

! /* mailbox sort values are not in order! */
! for (z = 0; var->sortval[z].kw; z++)
! if (lastval < var->sortval[z].sv)
! lastval = var->sortval[z].sv;


/* *var = sortby; or... *var == sortby; */
! last_sortby = var->val; /* remember current ordering */


! if (var != &sortby ||
! var->val != REVERSE THREAD)
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
! " (SPACE for next, or R)everse)"));
! else
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmReverseUnstable,
! "(SPACE, R)everse or U)nstable)"));
!

! if (var == &sortby) {

! PutLine0(x, y, sort_name(PAD));

! sort_one_liner(var->val, page);
! }
! else if (var == &alias_sortby) {

! PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(var->val,page);


! }
! else {
! PutLine0(x, y, give_dt_sort_as_str(var));
! menu_CleartoEOLN(page);
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
! " (SPACE for next, or R)everse)"));
! }

! menu_MoveCursor(page,x, y);
!
! do {
! int o = var->val;
!
! ch = menu_ReadCh(page, READCH_sig_char|READCH_CURSOR);
!
! if (ch == TERMCH_interrupt_char) {
! var->val = last_sortby;
! unstable_reverse_thread = last_unstable;
! break;

! }

#ifdef ASCII_CTYPE


! if (isascii(ch))
#endif
ch = tolower(ch);
!
! switch (ch) {

! case ' ' :

! if (var->val < 0) {
! sign = -1;
! var->val = - var->val;
! } else
! sign = 1; /* insurance! */
!
! var->val = sign * ((var->val + 1) % (lastval+1));
! if (var->val == 0 &&
! var->sortval[0].sv != 0)
! var->val = sign; /* snicker */
!

! if (var == &sortby) {

! PutLine0(x, y, sort_name(PAD));


! sort_one_liner(var->val, page);
! } else if (var == &alias_sortby) {

! PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(var->val,page);


! } else {
! PutLine0(x, y, give_dt_sort_as_str(var));
! menu_CleartoEOLN(page);
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,

! " (SPACE for next, or R)everse)"));
! }
!
! MoveCursor(x, y);

! break;
!
! case 'r' :
! var->val = - var->val;
!

! if (var == &sortby) {

! PutLine0(x, y, sort_name(PAD));


! sort_one_liner(var->val, page);
! }
! else if (var == &alias_sortby) {

! PutLine0(x, y, alias_sort_name(PAD));
! alias_sort_one_liner(var->val,page);
! }
! else
! {


! PutLine0(x, y, give_dt_sort_as_str(var));
! menu_CleartoEOLN(page);
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,

! " (SPACE for next, or R)everse)"));
! }
!
! MoveCursor(x, y);

!
! break;
!

! case 'u':
! if (var == &sortby &&
! var->val == REVERSE THREAD) {
!
! unstable_reverse_thread = !unstable_reverse_thread;

! PutLine0(x, y, sort_name(PAD));
! sort_one_liner(var->val, page);
! MoveCursor(x, y);


!
! }
! break;
}
!

! if (var == &sortby &&
! ( o == REVERSE THREAD ||
! var->val == REVERSE THREAD)) {
!
! if (var->val != REVERSE THREAD)
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmSpaceForNext,
! " (SPACE for next, or R)everse)"));
! else
! menu_PutLineX(page,x, COLUMNS-30,
! CATGETS(elm_msg_cat, ElmSet, ElmReverseUnstable,
! "(SPACE, R)everse or U)nstable)"));
! MoveCursor(x, y);
!
! }
!

! } while (ch == ' ' || ch == 'r' || ch == 'u');


!
! menu_MoveCursor(page,x, COLUMNS-30);
! menu_CleartoEOLN(page);
!
! ClearLine(LINES-3); /* clear sort_one_liner()! */
!
! if (var == &sortby &&
! (var->val != last_sortby ||
! unstable_reverse_thread != last_unstable)) {
!
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmResortingFolder,
! "Resorting folder..."));
! if (sleepmsg > 0) {
! error_sleep((sleepmsg + 1) / 2);
! }
! sort_mailbox(get_message_count(mailbox), 0, mailbox);
!
!
! if (unstable_reverse_thread != last_unstable) {
! mark_local_changed(&unstable_reverse_thread);
! }

! return 1;
! }
!

! if (var == &alias_sortby &&
! var->val != last_sortby) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmResortingAliases,
! "Resorting aliases..."));
! if (sleepmsg > 0) {

! error_sleep((sleepmsg + 1) / 2);
! }


!
! sort_aliases(get_alias_count(aview), FALSE, FALSE, aview);
!

! return 1;
! }
!

! return(var->val != last_sortby);
}

static void one_liner(string, page)
***************

*** 772,847 ****


}
}

- static int change_alias_sort(var, x, y, aview, page)
- int *var;
- int x,y;
- struct AliasView *aview;

- struct menu_context *page;
- {

- /** change the sorting scheme... **/
- /** return !0 if new sort order, else 0 **/
-
- int last_sortby, /* so we know if it changes... */
- sign = 1; /* are we reverse sorting?? */
- int ch; /* character typed in ... */

-
- int LINES, COLUMNS;
-
- menu_get_sizes(page,&LINES, &COLUMNS);
-

--- 932,937 ----
***************
*** 919,949 ****


if (q)
return(1);

! if (DT_SRT == save_info[x].dt_type) {
! number = *SAVE_INFO_SRT(x);
! if (change_sort(&number, ypos, xpos, mailbox, page) != 0) {
! *SAVE_INFO_SRT(x) = number;

++q;
}

- } else if(DT_ASR == save_info[x].dt_type) {
- number = *SAVE_INFO_ASR(x);
- if (change_alias_sort(&number, ypos, xpos, aview, page) != 0) {
- *SAVE_INFO_ASR(x) = number;
- ++q;
- }
-

- } else if(DT_NUM == save_info[x].dt_type) {
- number = *SAVE_INFO_NUM(x);
- if (equal(name, "userlevel")) {
- switch_user_level(&number, ypos, xpos, page);
- }
-
- if (number != *SAVE_INFO_NUM(x)) {
-
- *SAVE_INFO_NUM(x) = number;
- ++q;
- }

} else if (DT_BOL == save_info[x].dt_type) {
number = *SAVE_INFO_BOL(x);

--- 1009,1020 ----


if (q)
return(1);

! if (&rc_DT_SORT == save_info[x].dt_type) {
! if (change_sort(save_info[x].val.sort,
! ypos, xpos, mailbox, aview,page) != 0) {
++q;
}


} else if (DT_BOL == save_info[x].dt_type) {
number = *SAVE_INFO_BOL(x);
***************

*** 954,959 ****
--- 1025,1034 ----


++q;
}

+ } else if (&rc_DT_ENUM == save_info[x].dt_type) {
+
+ change_enum(save_info[x].val.enumerate, ypos, xpos, page);
+
} else { /* Hopefully generic routine ... */
int code;
char * s;
***************

*** 983,995 ****


if (save_info[x].dt_type->parse_line(& save_info[x],
1 /* local */ ,buffer,
0,"<config editor>",
! 0,0))
q++;
}
}

if (q)
! save_info[x].flags |= FL_LOCAL;

return(q != 0);
}

--- 1058,1070 ----


if (save_info[x].dt_type->parse_line(& save_info[x],
1 /* local */ ,buffer,
0,"<config editor>",
! 0))
q++;
}
}

if (q)

! mark_XX(& (save_info[x]));

return(q != 0);
}
Index: elmME+.2.5.alpha5-cvs/src/out_utils.c
*** elmME+.2.5.alpha4/src/out_utils.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/out_utils.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.23.8.2 2004/07/19 09:20:02 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.23.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: out_utils.c,v 1.23.8.4 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.23.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 26,32 ****

static time_t LAST_ERROR = 0;

! static void error_middle P_((CONST char *s));
void show_last_error()
{
/** rewrite last error message! **/
--- 26,32 ----

static time_t LAST_ERROR = 0;

! static void error_middle P_((const char *s));
void show_last_error()
{
/** rewrite last error message! **/
***************
*** 102,110 ****
strfcpy(err_buffer, s, sizeof err_buffer);
}

! static void error_help P_((CONST char *s));
static void error_help (s)
! CONST char *s;
{
int LINES, COLUMNS;

--- 102,110 ----
strfcpy(err_buffer, s, sizeof err_buffer);
}

! static void error_help P_((const char *s));
static void error_help (s)
! const char *s;
{
int LINES, COLUMNS;

***************
*** 117,123 ****
}

static void error_middle (s)
! CONST char *s;
{
if(!RawState()) {
fprintf(stderr,"%s\n", s);
--- 117,123 ----
}

static void error_middle (s)
! const char *s;
{
if(!RawState()) {
fprintf(stderr,"%s\n", s);
***************
*** 161,167 ****
}

int error(s)
! CONST char *s;
{
/** outputs error 's' to screen at line 22, centered! **/
if (0 == strcmp(err_buffer,s)) {
--- 161,167 ----
}

int error(s)
! const char *s;
{
/** outputs error 's' to screen at line 22, centered! **/
if (0 == strcmp(err_buffer,s)) {
***************
*** 179,187 ****
return 0;
}

! static int transient P_((CONST char *s));
static int transient(s)
! CONST char *s;
{
/** outputs error 's' to screen at line 22, centered! **/
DPRINT(Debug,1,(&Debug,
--- 179,187 ----
return 0;
}

! static int transient P_((const char *s));
static int transient(s)
! const char *s;
{
/** outputs error 's' to screen at line 22, centered! **/
DPRINT(Debug,1,(&Debug,
***************
*** 193,201 ****
return 0;
}

! static char * prompt_it P_((CONST char *str, int pass));
static char * prompt_it (str,pass)
! CONST char *str;
int pass;
{
int len = strlen(str);
--- 193,201 ----
return 0;
}

! static char * prompt_it P_((const char *str, int pass));
static char * prompt_it (str,pass)
! const char *str;
int pass;
{
int len = strlen(str);
***************
*** 325,342 ****
}
}

! void prompt_s(S)
! CONST struct string *S;


{
/** prompt user for input on LINES-3 line, left justified **/

if(RawState()) {


int LINES, COLUMNS;

! menu_get_sizes(default_context,&LINES, &COLUMNS);

! PutLineX(LINES-4,0,FRM("%S"),S);
! CleartoEOLN();
} else {
lib_transient(FRM("%S\n"),S);
}

--- 325,343 ----
}
}

! void prompt_s(page,S)
! struct menu_context *page;
! const struct string *S;


{
/** prompt user for input on LINES-3 line, left justified **/

if(RawState()) {


int LINES, COLUMNS;

! menu_get_sizes(page,&LINES, &COLUMNS);

! menu_PutLineX(page,LINES-4,0,FRM("%S"),S);
! menu_CleartoEOLN(page);
} else {
lib_transient(FRM("%S\n"),S);
}
***************

*** 352,359 ****


#endif
)
#if !ANSI_C
! CONST char *format;

! CONST char *line;
va_dcl
#endif
{
--- 353,360 ----


#endif
)
#if !ANSI_C
! const char *format;

! const char *line;
va_dcl
#endif
{
***************
*** 414,419 ****
--- 415,464 ----


PutLineX(line,(COLUMNS - l1)/2,FRM("%S"),buffer);
}

+ void menu_print_center(ptr,line,buffer)

+ struct menu_context *ptr;


+ int line;
+ struct string * buffer;
+ {
+ int l1 = string_len(buffer);

+ int LINES, COLUMNS;
+

+ menu_get_sizes(ptr,&LINES, &COLUMNS);
+
+ if (l1 < COLUMNS)
+ menu_PutLineX(ptr,line,(COLUMNS - l1)/2,FRM("%S"),buffer);

+ }
+
+
+ void menu_print_format_center(
+ #if ANSI_C


+ struct menu_context *ptr,
+ int lineY,const char *format, const char *line, ...
+ #else
+ ptr,lineY,format,line,va_alist
+ #endif
+ )
+ #if !ANSI_C

+ struct menu_context *ptr;
+ int lineY;
+ const char *format;
+ const char *line;


+ va_dcl
+ #endif
+ {
+ va_list vl;
+
+ struct string *text;
+
+ Va_start(vl, line); /* defined in defs.h */
+ text = elm_smessage(0,format,line,vl);
+ va_end(vl);
+
+ menu_print_center(ptr,lineY,text);
+
+ free_string(&text);
+ }
+
void print_format_center(
#if ANSI_C
int lineY,const char *format, const char *line, ...

***************
*** 423,430 ****
)
#if !ANSI_C
int lineY;
! CONST char *format;
! CONST char *line;
va_dcl
#endif
{
--- 468,475 ----
)
#if !ANSI_C
int lineY;
! const char *format;
! const char *line;
va_dcl
#endif
{
Index: elmME+.2.5.alpha5-cvs/src/partial.c
*** elmME+.2.5.alpha4/src/partial.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/partial.c 2005-07-23 20:14:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: partial.c,v 1.9.8.2 2004/10/09 17:25:35 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.2 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: partial.c,v 1.9.8.4 2005/07/23 17:14:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.9.8.4 $ $State: Exp $
*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 20,72 ****

DEBUG_VAR(Debug,__FILE__,"ELM");

! static void partial_menu P_((struct menu_context *page));
! static void partial_menu(page)
! struct menu_context *page;
{


! /** write main system menu... **/
! int LINES, COLUMNS;

- menu_get_sizes(default_context,&LINES, &COLUMNS);
-


! if (user_level == 0) { /* a rank beginner. Give less options */
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,
! "You can use any of the following commands by pressing the first character;"));
! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLevel0PartLine2,
! "d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, return to i)ndex"));


! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLevel0PartLine3,


! "To read a message, press <return>. j = move down, k = move up"));
} else {
! print_format_center(LINES-8,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,
! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));
! print_format_center(LINES-7,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLevel1PartLine2,
! "a)lias, C)opy, d)elete, f)orward, g)roup reply, m)ail,"));


! print_format_center(LINES-6,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLevel1PartLine3,


! "n)ext, o)ptions, P)rint text, r)eply, s)ave, t)ag, or i)index"));
}
}

static int showmsg_partial_cmd P_(( struct MailboxView *mailbox,


! int cmd, int *screen_mangled,
! struct menu_context *page));

! static int showmsg_partial_cmd(mailbox,cmd,screen_mangled, page)


struct MailboxView *mailbox;
int cmd;
! int *screen_mangled;
! struct menu_context *page;
{

struct menu_common MENU;

--- 20,78 ----



DEBUG_VAR(Debug,__FILE__,"ELM");

!
! #if ANSI_C

! static subpage_simple_redraw sb_partial_menu;
! #endif
! static int sb_partial_menu P_((struct menu_context *ptr,
! struct menu_param *list));
! static int sb_partial_menu(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;
{

! int ul = give_dt_enumerate_as_int(&user_level);


! menu_ClearScreen(ptr);
!
! if (ul == 0) { /* a rank beginner. Give less options */
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,
! "You can use any of the following commands by pressing the first character;"));
! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLevel0PartLine2,
! "d)elete or u)ndelete mail, m)ail a message, r)eply mail, return to i)ndex"));


! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLevel0PartLine3,


! "To read a message, press <return>. j = move down, k = move up"));
} else {
! menu_print_format_center(ptr,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,
! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));
! menu_print_format_center(ptr,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLevel1PartLine2,
! "a)lias, C)opy, d)elete, f)orward, g)roup reply, m)ail,"));


! menu_print_format_center(ptr,2,
! CATGETS(elm_msg_cat, ElmSet,

! ElmLevel1PartLine3,


! "n)ext, o)ptions, P)rint text, r)eply, s)ave, t)ag, or i)index"));
}
+
+ return 1;
}

static int showmsg_partial_cmd P_(( struct MailboxView *mailbox,


! int cmd,
! struct pager_page *pager_page));

! static int showmsg_partial_cmd(mailbox,cmd,pager_page)


struct MailboxView *mailbox;
int cmd;
! struct pager_page *pager_page;
{

struct menu_common MENU;

***************
*** 76,94 ****
case '|' : {

int current = get_current(mailbox);


! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmPipe, "Pipe"),
! TRUE, &MENU, page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))

! (void) do_pipe(mailbox, page); /* do pipe - ignore return val */


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

- menu_ClearScreen(page);
- build_bottom(&MENU,page);
}
break;
}

--- 82,101 ----
case '|' : {
int current = get_current(mailbox);


! put_cmd_name(pager_page, TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmPipe, "Pipe"));

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))
! do_pipe(mailbox,
! pager_page->root,
! pager_page->prompt_area);

!
else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}
}

break;
}
***************
*** 97,193 ****
}


static void partial_loop P_((struct MailboxView *mailbox,

! struct AliasView *aview,
! int header_page));


! static void partial_loop(mailbox, aview, header_page)

struct MailboxView *mailbox;
struct AliasView *aview;
- int header_page;

{
int leave = 0;
- int redraw = 0, nufoot = 0;

struct menu_context *page = new_menu_context();

!

struct menu_common MENU;
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);

! showscreen(mailbox,
! partial_menu,&header_page, page);




while (!leave) {
int ch;

if (menu_resized(page)) {

!

menu_get_sizes(page,&LINES, &COLUMNS);

! #undef max
! #define max(a,b) ((a) < (b) ? (b) : (a))

! if (mini_menu)


! headers_per_page = max (LINES - 14, 1);

! else


! headers_per_page = max (LINES - 9, 1); /* 5 more headers! */
! #undef max
! redraw++;
! } else
! redraw = menu_need_redraw(page);
!
! nufoot = 0;
! nucurr = 0;

! new_mail_check(mailbox, &header_page, page);
! redraw += menu_need_redraw(page);


- if (update_view(mailbox)) {
- resort_mailbox(mailbox,1, &header_page);

! redraw++;
! }

! if (redraw) {
! redraw = 0;
! showscreen(mailbox,

! partial_menu,&header_page, page);
! show_last_error();
}
-

! {
! int lin,col;
! prompt_s(mcommon_give_item(&MENU,m_Prompt));
! GetXYLocation(&lin,&col);

! CleartoEOLN();
! ch = GetPrompt(page, elm_timeout);

!
! CleartoEOS();


!
! if (isascii(ch) && isprint(ch)) {

DPRINT(Debug,4,(&Debug,

"\nCommand: %c [%d]\n\n", ch, ch));
! } else {
! DPRINT(Debug,4,(&Debug,
! "\nCommand: %d\n\n", ch));
! }
!
! set_error(""); /* clear error buffer */
!

! MoveCursor(lin,col);
! }



! ch = mailbox_command(mailbox,ch, &nufoot,

! showmsg_partial_cmd, aview, &header_page,


page);

- redraw += menu_need_redraw(page);
-
switch (ch) {
case 0: /* OK */
break;

--- 104,283 ----


}


+
+ static void set_mailbox_screen P_((struct menu_context *page,
+ struct screen_parts *LOC,
+ struct menu_param *LIST));
+ static void set_mailbox_screen(page,LOC, LIST)

+ struct menu_context *page;
+ struct screen_parts *LOC;


+ struct menu_param *LIST;
+ {
+ int LINES, COLUMNS;
+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ /* 1) Title part of screen */
+

+ if (! LOC->title_page)
+ LOC->title_page = new_menu_subpage(page,0,4,sb_update_title,LIST);
+ else
+ menu_subpage_relocate(LOC->title_page,page,0,4);
+
+ /* 2) menu part */
+
+ if (LOC->menu_page)
+ menu_subpage_relocate(LOC->menu_page,page,LINES-8,4);
+ else if (mini_menu)
+ LOC->menu_page = new_menu_subpage(page,LINES-8,4,

+ sb_partial_menu,LIST);
+
+
+ mailbox_screen_common(page,LOC, LIST);

+ }
+

+ static void check_mailbox_screen P_((struct screen_parts *LOC,
+ struct menu_param *list));
+ static void check_mailbox_screen(LOC,list)
+ struct screen_parts *LOC;
+ struct menu_param *list;
+ {
+ if (menu_resized(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->title_page)) {
+ DPRINT(Debug,1, (&Debug, "title page redraw???\n"));
+ sb_update_title(LOC->title_page,list);
+ }
+ if (LOC->menu_page) {
+ /* 2) menu page */
+ if (menu_resized(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page resized\n"));
+
+ }
+ if (menu_need_redraw(LOC->menu_page)) {
+ DPRINT(Debug,1, (&Debug, "menu page redraw???\n"));

+ sb_partial_menu(LOC->menu_page,list);
+ }
+ }
+

+ /* 3) prompt part */
+ if (menu_resized(LOC->prompt_page)) {
+ DPRINT(Debug,1, (&Debug, "prompt page resized\n"));
+ }
+ if (menu_need_redraw(LOC->prompt_page)) {
+ menu_ClearScreen(LOC->prompt_page);
+
+ show_last_error(); /* for those operations that have to
+ * clear the footer except for a message.
+ */
+ }
+
+ /* 4) headers part */
+ if (menu_resized(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page resized\n"));
+ }
+ if (menu_need_redraw(LOC->header_page)) {
+ DPRINT(Debug,1, (&Debug, "header page redraw\n"));
+ menu_ClearScreen(LOC->header_page);

+ }
+ }
+
static void partial_loop P_((struct MailboxView *mailbox,
! struct AliasView *aview));
! static void partial_loop(mailbox, aview)


struct MailboxView *mailbox;
struct AliasView *aview;

{
int leave = 0;



struct menu_context *page = new_menu_context();

! struct screen_parts LOC = { NULL };

struct menu_common MENU;
+ struct menu_param PARAM[elm_mp_COUNT+1] = {
+ { mp_menu_common, { 0 } },
+ { mp_integer, { 0 } },
+ { mp_END, { 0 } }
+ };
+
int LINES, COLUMNS;

+ mp_list_set_mcommon(PARAM,elm_mp_menu,&MENU);
+
+
menu_get_sizes(page,&LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);
+ set_mailbox_screen(page,&LOC,PARAM);
+

+ resort_mailbox(mailbox,1);



! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! copy_current(&MENU,LOC.header_page);
!
! showscreen(page);


while (!leave) {
int ch;

+ menu_set_default(page);
+
if (menu_resized(page)) {

!

! set_mailbox_screen(page,&LOC,PARAM);
!
menu_get_sizes(page,&LINES, &COLUMNS);

! menu_trigger_redraw(page);

! }


! new_mail_check(mailbox, page, &LOC);
!

! if (update_view(mailbox)) {


! resort_mailbox(mailbox,1);

! get_page(&MENU, LOC.header_page); /* resort_mailbox no longer call get_page() */
! menu_trigger_redraw(LOC.header_page);
! menu_trigger_redraw(LOC.title_page);
}

! if (menu_need_redraw(page))
! showscreen(page);
! check_mailbox_screen(&LOC, PARAM);

! {

! int lin,col;
!
! menu_PutLineX(LOC.prompt_page,0,0,
! FRM("%S"),mcommon_give_item(&MENU, m_Prompt));
! menu_GetXYLocation(LOC.prompt_page,&lin,&col);
!
! menu_CleartoEOLN(LOC.prompt_page);
! ch = GetPrompt(LOC.prompt_page, elm_timeout);
!
! menu_CleartoEOS(LOC.prompt_page);
!
! if (isascii(ch) && isprint(ch)) {

DPRINT(Debug,4,(&Debug,

"\nCommand: %c [%d]\n\n", ch, ch));
! } else {
! DPRINT(Debug,4,(&Debug,
! "\nCommand: %d\n\n", ch));
! }
!
! set_error(""); /* clear error buffer */
!
! menu_MoveCursor(LOC.prompt_page,lin,col);
! }

! ch = mailbox_command(mailbox,ch, &LOC,

! showmsg_partial_cmd, aview,

page);

switch (ch) {
case 0: /* OK */
break;
***************

*** 195,201 ****
case '|' : {
int current = get_current(mailbox);


! Writechar('|');

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,

--- 285,292 ----
case '|' : {
int current = get_current(mailbox);


! menu_Writechar(LOC.prompt_page,
! '|');

if (current < 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************

*** 207,214 ****

/* softkeys_off(); */

! do_pipe(mailbox, page);

! redraw += menu_need_redraw(page);

/* softkeys_on(); */
} else {

--- 298,304 ----

/* softkeys_off(); */

! do_pipe(mailbox, page,LOC.prompt_page);


/* softkeys_on(); */
} else {
***************

*** 225,233 ****


case 'i':
case 'x':
case 'X':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmReturnIndex,
! "Return to index"));
FlushBuffer();

leave = 1;

--- 315,324 ----


case 'i':
case 'x':
case 'X':
! menu_Write_to_screen(LOC.prompt_page,
! CATGETS(elm_msg_cat, ElmSet,
! ElmReturnIndex,
! "Return to index"));
FlushBuffer();

leave = 1;
***************

*** 235,241 ****
break;
case EOF:

! return;

default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
--- 326,332 ----
break;
case EOF:

! goto OUT;

default:
lib_error(CATGETS(elm_msg_cat, ElmSet,
***************
*** 244,280 ****



}

! if (redraw)
! showscreen(mailbox,

! partial_menu,&header_page, page);

! check_range(&MENU);
!

!
! if (nucurr == NEW_PAGE) {
! DPRINT(Debug,5,(&Debug, " nucurr == NEW_PAGE\n"));
! show_headers(&MENU,&header_page, page);
! } else if (nucurr == SAME_PAGE) {
! DPRINT(Debug,5,(&Debug, " nucurr == SAME_PAGE\n"));
! show_current(&MENU,&header_page, page);
! } else if (nufoot) {
! if (mini_menu) {
! MoveCursor(LINES-8, 0);
! CleartoEOS();

! partial_menu(page);


! }
! else {
! MoveCursor(LINES-5, 0);
! CleartoEOS();
! }
! show_last_error(); /* for those operations that have to
! * clear the footer except for a message.
! */
! }

} /* the BIG while loop! */

OUT:
erase_menu_context(&page);

}
--- 335,351 ----



}

! if (menu_need_redraw(page))
! showscreen(page);

! check_range(&MENU, &LOC);

! check_mailbox_screen(&LOC, PARAM);


!

} /* the BIG while loop! */

OUT:
+ free_mailbox_screen(&LOC);
erase_menu_context(&page);

}
***************

*** 288,302 ****
new_mailbox = partial_to_mailbox_view(parent_mailbox);

if (new_mailbox) {
- int header_page = 0;
if (get_message_count(new_mailbox) > 0) {
set_current(new_mailbox,1); /* Set current to first message */

update_view(new_mailbox);
- resort_mailbox(new_mailbox,1, &header_page);
}

! partial_loop(new_mailbox, aview, header_page);

free_mailbox(& new_mailbox);
}
--- 359,371 ----
new_mailbox = partial_to_mailbox_view(parent_mailbox);



if (new_mailbox) {
if (get_message_count(new_mailbox) > 0) {
set_current(new_mailbox,1); /* Set current to first message */

update_view(new_mailbox);
}

! partial_loop(new_mailbox, aview);

free_mailbox(& new_mailbox);
}
***************
*** 314,323 ****
struct header_rec * hdr = give_header(parent_mailbox,i);
int z;

! if (hdr && (hdr->partial_len ||
! (hdr->status & MIME_MESSAGE) &&
! (z = get_type_flags(hdr->mime_rec.TYPE)) &&
! ( z & MIME_PARTIAL))) {
DPRINT(Debug,4,(&Debug,
"have_partial=1 (message %d)\n",
i+1));
--- 383,394 ----
struct header_rec * hdr = give_header(parent_mailbox,i);
int z;

! if (hdr && (hdr->partial_len
! ||
! (
! (hdr->status & MIME_MESSAGE) &&
! (z = get_type_flags(hdr->mime_rec.TYPE)) &&
! ( z & MIME_PARTIAL)))) {
DPRINT(Debug,4,(&Debug,
"have_partial=1 (message %d)\n",
i+1));

Kari E. Hurtta

unread,
Jul 28, 2005, 12:36:22 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.18

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 18/20 ) =========
Index: elmME+.2.5.alpha5-cvs/src/screen/curs_input.c
*** elmME+.2.5.alpha4/src/screen/curs_input.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/curs_input.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.6.8.4 2004/08/15 17:22:35 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.4 $ $State: Exp $
*

* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curs_input.c,v 1.6.8.7 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 52,58 ****

SIGDPRINT(Debug,4,(&Debug,
"background_read: errno = %d [%s]\n",err,
! error_description(err)));

if((err == EINTR)
#ifdef EAGAIN
--- 52,58 ----

SIGDPRINT(Debug,4,(&Debug,
"background_read: errno = %d [%s]\n",err,
! strerror(err)));

if((err == EINTR)
#ifdef EAGAIN
***************
*** 141,155 ****
#endif
}

! int cur_ReadCh(flags,break_flag,mc)
int flags;
int break_flag;
- struct menu_context *mc;
{
int ret = 0;

do {
! struct charset_state *ch = cur_ReadCh2(flags,break_flag, mc);

if (!ch) {
ret = EOF;
--- 141,154 ----
#endif
}

! int cur_ReadCh(flags,break_flag)
int flags;
int break_flag;
{
int ret = 0;

do {
! struct charset_state *ch = cur_ReadCh2(flags,break_flag);

if (!ch) {
ret = EOF;
***************
*** 180,190 ****
#include <termios.h>
#endif

! struct charset_state * cur_ReadCh2(flags,break_flag,
! mc)
int flags;
int break_flag;
- struct menu_context *mc;
{
int redraw = (flags & READCH_MASK);
int cursorkeys = (flags & READCH_CURSOR) != 0;
--- 179,214 ----
#include <termios.h>
#endif

! struct charset_state * last_state = NULL;
!
! void set_last_state(cs)
! charset_t cs;
! {
! if (last_state && last_state->charset != cs) {
! DPRINT(Debug,4,(&Debug,
! "Keyboard input charset is changed -- was %s\n",
! last_state->charset->MIME_name ?
! last_state->charset->MIME_name :
! "<no MIME name>"));
! free_state(&last_state);
! }
!
! if (!last_state) {
! last_state = new_state(cs);
! DPRINT(Debug,4,(&Debug,
! "Keyboard input charset is %s\n",
! last_state->charset->MIME_name ?
! last_state->charset->MIME_name :
! "<no MIME name>"));


! }
!
!
! }
!

!
! struct charset_state * cur_ReadCh2(flags,break_flag)
int flags;
int break_flag;
{
int redraw = (flags & READCH_MASK);
int cursorkeys = (flags & READCH_CURSOR) != 0;
***************
*** 207,214 ****
/* This is static array so we can initialize it in here ...
*/
static struct {
! char ** CONST str;
! CONST int result;
int maybe;
} keytable[] =
{ { &_key_up, UP_MARK, 0 },
--- 231,238 ----
/* This is static array so we can initialize it in here ...
*/
static struct {
! char ** const str;
! const int result;
int maybe;
} keytable[] =
{ { &_key_up, UP_MARK, 0 },
***************
*** 233,238 ****
--- 257,276 ----
bzero((void *)&T,sizeof T);
#endif

+ DPRINT(Debug,4,(&Debug,
+ "cur_ReadCH2: flags=%d %s%s%s%s%s%s%s %s\n",
+ flags,
+ redraw ? " redraw" : "",
+ cursorkeys ? " cursorkeys" : "",
+ nocursor ? " nocurosr" : "",
+ term_char ? " term_char" : "",
+ resize_flag ? " resize_flag" : "",
+ sig_char ? " sig_char" : "",
+ quote_char ? " quote_char" : "",
+
+ break_flag ? "break_flag" : ""));
+
+
#if POLL_METHOD
change_action(terminal_fd,0,background_read,no_action_routine,
no_action_routine,
***************
*** 243,256 ****
DPRINT(Debug,4,(&Debug,"cur_ReadCH2: line=%d col=%d\n",
line,col));

! if (!last_state) {
! last_state = new_state(system_charset);
! DPRINT(Debug,4,(&Debug,
! "Keyboard input charset is %s\n",
! last_state->charset->MIME_name ?
! last_state->charset->MIME_name :
! "<no MIME name>"));
! }

if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
--- 281,287 ----
DPRINT(Debug,4,(&Debug,"cur_ReadCH2: line=%d col=%d\n",
line,col));

! set_last_state(system_charset);

if (state_ready(last_state)) {
DPRINT(Debug,4,(&Debug,
***************
*** 282,288 ****
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
! cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;
--- 313,319 ----
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
! cur_ClearScreen();

reset_state(last_state,1);
last_state->caller_flags = redraw;
***************
*** 293,303 ****
return last_state;
}

! cur_MoveCursor(line,col);
FlushBuffer();

check_changes();
! if (resize_flag && mc->changed) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Pending resize...\n"));
reset_state(last_state,1);
--- 324,334 ----
return last_state;
}

! cur_MoveCursor(line,col,NULL);
FlushBuffer();

check_changes();
! if (resize_flag && default_context->changed) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Pending resize...\n"));
reset_state(last_state,1);
***************
*** 309,318 ****
return last_state;
}

! if (redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Pending redraw...\n"));
! cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;
--- 340,349 ----
return last_state;
}

! if (redraw && default_context->redraw) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Pending redraw...\n"));
! cur_ClearScreen();

reset_state(last_state,1);
last_state->caller_flags = redraw;
***************
*** 323,336 ****
return last_state;
}

! if ((_intransmit != ON || mc->redraw) &&
cursorkeys && _transmit_on) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Enabling cursor keys...\n"));
transmit_functions(ON);
}

! if ((_intransmit != OFF || mc->redraw) &&
nocursor && _transmit_off) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Disabling cursor keys...\n"));
--- 354,367 ----
return last_state;
}

! if ((_intransmit != ON || default_context->redraw) &&
cursorkeys && _transmit_on) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Enabling cursor keys...\n"));
transmit_functions(ON);
}

! if ((_intransmit != OFF || default_context->redraw) &&
nocursor && _transmit_off) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Disabling cursor keys...\n"));
***************
*** 343,349 ****
"cur_ReadCh2: Available function keys:"));

for (i = 0; keytable[i].str != 0; i++) {
! char * CONST str = *(keytable[i].str);
if(str && str[0] != '\0') {
keytable[i].maybe = 1; /* Initially every function key is possible */
SIGDPRINT(Debug,8,(&Debug,
--- 374,380 ----
"cur_ReadCh2: Available function keys:"));

for (i = 0; keytable[i].str != 0; i++) {
! char * const str = *(keytable[i].str);
if(str && str[0] != '\0') {
keytable[i].maybe = 1; /* Initially every function key is possible */
SIGDPRINT(Debug,8,(&Debug,
***************
*** 363,373 ****
if (errno != 0) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: wait_for_action got error %d (%s)\n",
! errno, error_description(errno)));

check_changes();

! if (resize_flag && mc->changed) {
DPRINT(Debug,4,(&Debug,
" ... return resize to caller\n"));

--- 394,404 ----
if (errno != 0) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: wait_for_action got error %d (%s)\n",
! errno, strerror(errno)));

check_changes();

! if (resize_flag && default_context->changed) {
DPRINT(Debug,4,(&Debug,
" ... return resize to caller\n"));

***************
*** 378,384 ****


/* Return error: */
! if ((redraw && mc->redraw)
|| break_flag /* GetPrompt wants to see errors! */
) {
DPRINT(Debug,4,(&Debug,
--- 409,415 ----


/* Return error: */
! if ((redraw && default_context->redraw)
|| break_flag /* GetPrompt wants to see errors! */
) {
DPRINT(Debug,4,(&Debug,
***************
*** 419,425 ****

check_changes();

! if (resize_flag && mc->changed) {
DPRINT(Debug,4,(&Debug,
" ... return resize to caller\n"));

--- 450,456 ----

check_changes();

! if (resize_flag && default_context->changed) {
DPRINT(Debug,4,(&Debug,
" ... return resize to caller\n"));

***************
*** 429,435 ****
}

/* Return error: */
! if ((redraw && mc->redraw)
|| break_flag /* GetPrompt wants to see errors! */
) {
found_key = -1;
--- 460,466 ----
}

/* Return error: */
! if ((redraw && default_context->redraw)
|| break_flag /* GetPrompt wants to see errors! */
) {
found_key = -1;
***************
*** 440,446 ****
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: background_read got error %d (%s)\n",
last_read_error,
! error_description(last_read_error)));
found_key = -1;
}
continue; /* continue or quit */
--- 471,477 ----
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: background_read got error %d (%s)\n",
last_read_error,
! strerror(last_read_error)));
found_key = -1;
}
continue; /* continue or quit */
***************
*** 458,464 ****
int err = errno;
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: errno = %d [%s]\n",err,
! error_description(err)));

check_changes();

--- 489,495 ----
int err = errno;
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: errno = %d [%s]\n",err,
! strerror(err)));

check_changes();

***************
*** 472,478 ****
}

/* Return error: */
! if (redraw && mc->redraw
|| break_flag /* GetPrompt wants to see errors! */
) {
found_key = -1;
--- 503,509 ----
}

/* Return error: */
! if (redraw && default_contect->redraw
|| break_flag /* GetPrompt wants to see errors! */
) {
found_key = -1;
***************
*** 550,556 ****
if (VQUIT_char == ch)
found_key = TERMCH_interrupt_char;
if (VSUSP_char == ch) {
! SIGHAND_TYPE (*sig1)(), (*sig2)();

DPRINT(Debug,1,(&Debug,
"cur_ReadCh2: Found suspend character!\n"));
--- 581,587 ----
if (VQUIT_char == ch)
found_key = TERMCH_interrupt_char;
if (VSUSP_char == ch) {
! SIGHAND_TYPE (*sig1) P_((int)), (*sig2) P_((int));

DPRINT(Debug,1,(&Debug,
"cur_ReadCh2: Found suspend character!\n"));
***************
*** 581,587 ****
if (redraw) {
DPRINT(Debug,1,(&Debug,
"cur_ReadCh2: returning redraw because of suspend\n"));
! cur_ClearScreen(mc);
found_key = redraw;
} else
goto reinit_ReadChar;
--- 612,618 ----
if (redraw) {
DPRINT(Debug,1,(&Debug,
"cur_ReadCh2: returning redraw because of suspend\n"));
! cur_ClearScreen();
found_key = redraw;
} else
goto reinit_ReadChar;
***************
*** 603,609 ****
int i;
for (i = 0; keytable[i].str != NULL; i++) {
if (keytable[i].maybe) {
! unsigned char * CONST str =
(unsigned char *) *(keytable[i].str);
if (str[read_p] == ch) {
match++;
--- 634,640 ----
int i;
for (i = 0; keytable[i].str != NULL; i++) {
if (keytable[i].maybe) {
! unsigned char * const str =
(unsigned char *) *(keytable[i].str);
if (str[read_p] == ch) {
match++;
***************
*** 683,689 ****
#endif



/* Ring a bell */

! cur_Writechar('\007');
goto reinit_ReadChar;
}
} else
--- 714,720 ----
#endif



/* Ring a bell */

! cur_Writechar('\007',NULL);
goto reinit_ReadChar;
}
} else
***************
*** 693,699 ****

}

! if (found_key <= 0 && redraw && mc->redraw) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Redraw...\n"));
if(!cur_RawState()) { /* Check that we have in 'raw' mode */
--- 724,730 ----

}

! if (found_key <= 0 && redraw && default_context->redraw) {
DPRINT(Debug,4,(&Debug,
"cur_ReadCh2: Redraw...\n"));
if(!cur_RawState()) { /* Check that we have in 'raw' mode */
***************
*** 701,707 ****
"cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
}
! cur_ClearScreen(mc);

reset_state(last_state,1);
last_state->caller_flags = redraw;
--- 732,738 ----
"cur_ReadCh2: Going to Raw mode\n"));
cur_Raw(ON);
}
! cur_ClearScreen();

reset_state(last_state,1);
last_state->caller_flags = redraw;
***************
*** 713,719 ****
return last_state;
}

! cur_MoveCursor(line,col);

DPRINT(Debug,50,(&Debug,
"cur_ReadCh2: found_key=%d (line=%d col=%d)\n",
found_key, line,col));

--- 744,750 ----


return last_state;
}

! cur_MoveCursor(line,col,NULL);
DPRINT(Debug,50,(&Debug,
"cur_ReadCh2: found_key=%d (line=%d col=%d)\n",
found_key, line,col));

Index: elmME+.2.5.alpha5-cvs/src/screen/def_scommon.h


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/src/screen/def_scommon.h 2005-07-20 19:49:51.000000000 +0300
***************


*** 0 ****
--- 1,107 ----
+ /******************************************************************************

+ * The Elm (ME+) Mail System - $Revision: 1.3.32.1 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <e...@elmme-mailer.org>
+ *****************************************************************************/
+

+ struct subpage_common {
+ unsigned short magic; /* MENU_SCOMMON_magic */
+
+ int rel_start_line;
+ struct menu_param * param_ptr;
+ };
+
+ extern void scommon_zero P_((struct subpage_common *c));
+ extern void scommon_clear P_((struct subpage_common *c));
+
+ extern void calculate_printing_area P_((struct menu_context *ctx));
+ extern void scommon_relocate P_((struct menu_context *subpage,
+ struct menu_context *parent,
+ int rel_start_line,
+ int lines));

+
+ #if ANSI_C
+ #define E_(x) extern x;
+ #else

+
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/src/screen/def_screen.h
*** elmME+.2.5.alpha4/src/screen/def_screen.h 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/def_screen.h 2005-07-20 19:49:51.000000000 +0300
***************
*** 1,4 ****
! /* $Id: def_screen.h,v 1.4.8.4 2004/08/15 19:56:29 hurtta Exp $ */

#include "elm_defs.h"


#include "mime.h"
--- 1,4 ----

! /* $Id: def_screen.h,v 1.4.8.5 2005/07/20 16:49:51 hurtta Exp $ */



#include "elm_defs.h"
#include "mime.h"
***************

*** 11,24 ****


extern int InGetPrompt; /* set if in GetPrompt() in read() */

/* HACK */

! #define pg_BOLD 0x01
! #define pg_UNDERLINE 0x02
! #define pg_HALFBRIGHT 0x04
! #define pg_INVERSE 0x08
!

/* curses.c */


extern int cur_tabspacing; /* Default? */

--- 11,29 ----


extern int InGetPrompt; /* set if in GetPrompt() in read() */

/* HACK */

! extern int CUR_modes;
! extern void EndSyncronize P_((struct menu_context *ctx));
! extern void Syncronize P_((struct menu_context *ctx));

/* curses.c */

+ struct cur_printarea {
+ /* Currently disables scrolling */
+
+ int first_line, last_line;
+
+ int gone_out;
+ };

extern int cur_tabspacing; /* Default? */

***************

*** 37,63 ****



extern void cur_ScreenSize P_((int *lines, int *columns));
extern void cur_GetXYLocation P_((int *line, int *col));
! extern int cur_ClearScreen P_((struct menu_context *mc));
! extern void cur_CursorUp P_((int n));
! extern void cur_CursorDown P_((int n));
! extern void cur_CursorLeft P_((int n));
! extern int cur_MoveCursor P_((int row, int col));

extern void cur_changemode P_((int *mode, int set, int reset));

/* This assumes one byte charset */
! extern void cur_Writechar P_((int ch));

! extern void cur_PutLineS P_((struct string *S));

! extern void cur_Write_to_screen P_((const char *format,
const char *msg, ...));

! extern void cur_PutLine0 P_((int x, int y, const char *line));
! extern void cur_PutLineX P_((int x, int y, const char *format,
const char *line, ...));
! extern int cur_CleartoEOLN P_((void));
! extern int cur_CleartoEOS P_((void));

extern int cur_RawState P_((void));

--- 42,68 ----



extern void cur_ScreenSize P_((int *lines, int *columns));
extern void cur_GetXYLocation P_((int *line, int *col));
! extern void cur_ClearScreen P_((void));
! extern void cur_MoveCursor P_((int row, int col, struct cur_printarea *lim));

extern void cur_changemode P_((int *mode, int set, int reset));

/* This assumes one byte charset */
! extern void cur_Writechar P_((int ch, struct cur_printarea *lim));

! extern void cur_PutLineS P_((struct string *S, struct cur_printarea *lim));

! extern void cur_Write_to_screen P_((struct cur_printarea *lim,

! const char *format,

const char *msg, ...));

! extern void cur_PutLine0 P_((int row, int col, const char *line,
! struct cur_printarea *lim));
! extern void cur_PutLineX P_((int row, int col, struct cur_printarea *lim,
! const char *format,
const char *line, ...));
! extern void cur_CleartoEOLN P_((void));
! extern void cur_CleartoEOS P_((void));

extern int cur_RawState P_((void));

***************

*** 68,86 ****



extern void transmit_functions P_((int newstate));


#if POLL_METHOD
extern void clear_input_buffer P_((void));
#endif

! extern int cur_ReadCh P_((int flags, int break_flag,
! struct menu_context *mc));
extern struct charset_state * cur_ReadCh2 P_((int flags,
! int break_flag,
! struct menu_context *mc));

extern void cur_FlushInput P_((void));



extern int cursor_control;
extern int _intransmit; /* are we transmitting keys? */

extern char *_key_up, *_key_down, *_key_left, *_key_right,
--- 73,93 ----



extern void transmit_functions P_((int newstate));

+ extern void init_system_charset P_((void));
+

#if POLL_METHOD
extern void clear_input_buffer P_((void));
#endif

! extern void set_last_state P_((charset_t cs));
! extern int cur_ReadCh P_((int flags, int break_flag));
extern struct charset_state * cur_ReadCh2 P_((int flags,
! int break_flag));

extern void cur_FlushInput P_((void));

+

extern int cursor_control;
extern int _intransmit; /* are we transmitting keys? */

extern char *_key_up, *_key_down, *_key_left, *_key_right,
***************
*** 109,142 ****



/* -------------------------------------------------------------------- */

#define MENU_CONTEXT_magic 0xF800

extern struct menu_context {
unsigned short magic; /* MENU_CONTEXT_magic */

int lines, columns;
int changed;
int redraw;
!
struct menu_context * next_menu;
struct menu_context * prev_menu;
} ROOT_MENU, COOKED_MENU;

extern void check_changes P_((void));

/* init.c */

extern void get_term_chars P_((int fd));

extern char backspace, /* the current backspace char */
! kill_line, /* the current kill-line char */
! word_erase, /* the current word-erase char */
! interrupt_char, /* the current interrupt char */
! reprint_char, /* the current reprint-line char */
! eof_char; /* the current end-of-file char */

extern char VQUIT_char, /* the current quit char */
! VSUSP_char; /* the current suspend char */

/*
* Local Variables:
--- 116,258 ----

! int x, int y,

! w_menu_free * wra_free;
!

! w_menu_Writechar * wra_Writechar;
! w_menu_PutLineS * wra_PutLineS;
! w_menu_PutLine0 * wra_PutLine0;
! w_menu_CleartoEOLN * wra_CleartoEOLN;
! w_menu_CleartoEOS * wra_CleartoEOS;
! w_menu_ReadCh2 * wra_ReadCh2;
! w_menu_ReadCh * wra_ReadCh;
! w_menu_ScreenSize * wra_ScreenSize;
! w_menu_GetXYLocation * wra_GetXYLocation;
! w_menu_ClearScreen * wra_ClearScreen;
! w_menu_MoveCursor * wra_MoveCursor;
! w_menu_changemode * wra_changemode;
! w_menu_SyncEnter * wra_SyncEnter;
! w_menu_SyncLeave * wra_SyncLeave;
! w_menu_resized * wra_resized;
! w_menu_calculate_line * wra_calculate_line;
! w_menu_get_linelimit * wra_get_linelimit;
! w_menu_reset_redraw * wra_reset_redraw;
! w_menu_do_redraw * wra_do_redraw;
!

! } CURSES_ROUTINES;
!

! extern struct menu_context * new_menu_type P_((struct menu_draw_routine *T));
! extern void mp_set_any1 P_((struct menu_param *list, int idx, struct menu_param *v));

/*
* Local Variables:
Index: elmME+.2.5.alpha5-cvs/src/screen/header.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/src/screen/header.c 2005-07-23 20:14:20.000000000 +0300
***************
*** 0 ****
--- 1,333 ----
+ static char rcsid[] = "@(#)$Id: header.c,v 1.3.32.2 2005/07/23 17:14:20 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.3.32.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <e...@elmme-mailer.org>
+ *****************************************************************************/
+

+ #include "def_screen.h"
+ #include "def_scommon.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ #define MENU_HEADER_magic 0xF804
+ struct menu_header {
+ struct subpage_common c;
+ unsigned short magic; /* MENU_HEADER_magic */
+
+ int params[HEADER_PARAMS_COUNT];
+ header_line_redraw * line_redraw;
+ header_line_redraw * current_redraw;
+ header_param_changed * param_change;
+ header_line_redraw * status_redraw;
+ };

+
+
+ #if ANSI_C

+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ S_(w_menu_init mheader_init)
+ static void mheader_init P_((struct menu_context *ctx));
+ static void mheader_init(ctx)
+ struct menu_context *ctx;

+ {
+ int i;
+

+ DPRINT(Debug,10, (&Debug, "mheader_init: %p\n",
+ ctx));
+
+ ctx->u.header = safe_malloc (sizeof (* ctx->u.header));

+
+ /* bzero is defined hdrs/defs.h */

+ bzero((void *)ctx->u.header,sizeof (* ctx->u.header));
+
+ scommon_zero(&(ctx->u.header->c));
+ ctx->u.header->magic = MENU_HEADER_magic;
+
+ for (i = 0; i < HEADER_PARAMS_COUNT; i++)

+ ctx->u.header->params[i] = 0;
+

+ ctx->u.header->line_redraw = header_line_noredraw;
+ ctx->u.header->current_redraw = header_line_noredraw;
+ ctx->u.header->param_change = null_header_param_changed;
+ ctx->u.header->status_redraw = header_line_noredraw;
+ }
+
+ S_(w_menu_free mheader_free)
+ static void mheader_free P_((struct menu_context *ctx));
+ static void mheader_free(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "mheader_free: %p\n",
+ ctx));
+
+ if (MENU_HEADER_magic != ctx->u.header->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"subpage_free",


+ "Bad magic number",0);
+

+ scommon_clear( & (ctx->u.header->c) );
+
+ ctx->u.header->magic = 0; /* Invalidate */
+ free(ctx->u.header);
+ ctx->u.header = NULL;
+ }

+
+

+ static void header_change_current P_((struct menu_context *ctx,
+ int old_value));
+ static void header_change_current(ctx,old_value)
+ struct menu_context *ctx;
+ int old_value;
+ {
+ int current = ctx->u.header->params[header_current];
+ int top = ctx->u.header->params[header_top_line];

+
+ int i;
+

+ }
+
+ return 1;
+ }
+

+ static struct menu_draw_routine HEADER_ROUTINES = {
+ MENU_DRAW_magic,
+
+ mheader_init,
+ mheader_free,
+
+ scommon_Writechar,
+ scommon_PutLineS,
+ scommon_PutLine0,
+ scommon_CleartoEOLN,
+ scommon_CleartoEOS,
+ scommon_ReadCh2,
+ scommon_ReadCh,
+ scommon_ScreenSize,

+ scommon_GetXYLocation,
+ scommon_ClearScreen,


+ scommon_MoveCursor,
+ scommon_changemode,
+ scommon_SyncEnter,
+ scommon_SyncLeave,
+ scommon_resized,
+ scommon_calculate_line,
+ scommon_get_linelimit,
+ scommon_reset_redraw,
+ mheader_do_redraw,

+ };
+
+
+ void header_line_noredraw(ptr,list,line_number,index,is_current)
+ struct menu_context *ptr;


+ struct menu_param *list;
+ int line_number;
+ int index;
+ int is_current;
+ {

+ return;
+ }
+
+ void null_header_param_changed(ptr,list,param_index)
+ struct menu_context *ptr;


+ struct menu_param *list;
+ int param_index;
+ {

+ return;
+ }
+

+ struct menu_context * new_menu_header(parent,rel_start_line,lines,
+ line_redraw,current_redraw,
+ param_change,status_redraw,list)
+ struct menu_context *parent;
+ int rel_start_line;
+ int lines;
+ header_line_redraw line_redraw;
+ header_line_redraw current_redraw;
+ header_param_changed param_change;
+ header_line_redraw status_redraw;
+ /* only rereference is saved */

+ struct menu_param *list;
+ {

+ int rline = 0;

+ int lline = 0;
+

+ struct menu_context *ret = new_menu_type(&HEADER_ROUTINES);
+
+ if (MENU_CONTEXT_magic != parent->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_header",

+ "Bad parent magic number",0);
+

+ ret->lines = lines;
+ ret->columns = parent->columns;
+ ret->u.header->c.rel_start_line = rel_start_line;
+ ret->u.header->c.param_ptr = list;
+
+ ret->u.header->line_redraw = line_redraw;
+ ret->u.header->current_redraw = current_redraw;
+ ret->u.header->param_change = param_change;
+ ret->u.header->status_redraw = status_redraw;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_header",

+ "Bad parent draw magic number",0);
+

+ parent->routine->wra_calculate_line(parent,rel_start_line,&rline);
+
+ lline = rline + lines -1; /* calculate_printing_area() fixes */
+
+ attach_subpage(parent,ret,rline,lline);
+
+ calculate_printing_area(ret);
+
+ return ret;

+ }
+
+

+ default:


+ break;
+ }
+
+ }
+

+ int menu_header_get(subpage,param)
+ struct menu_context *subpage;

+ enum header_params param;
+ {

+
+ }
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/src/screen/init.c
*** elmME+.2.5.alpha4/src/screen/init.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/init.c 2005-07-27 14:51:38.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: init.c,v 1.3.8.1 2004/07/19 09:20:03 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: init.c,v 1.3.8.3 2005/07/27 11:51:38 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 46,52 ****
#endif



char backspace, /* the current backspace char */

-

kill_line, /* the current kill-line char */

word_erase, /* the current word-erase char */

interrupt_char, /* the current interrupt char */

--- 46,51 ----
***************
*** 71,77 ****
DPRINT(Debug,3,
(&Debug,
"Error: %s encountered on ioctl call (get_term_chars, fd=%d)\n",
! error_description(err), fd));

/* set to defaults for terminal driver */
backspace = 010; /* backspace */
--- 70,76 ----
DPRINT(Debug,3,
(&Debug,
"Error: %s encountered on ioctl call (get_term_chars, fd=%d)\n",
! strerror(err), fd));

/* set to defaults for terminal driver */
backspace = 010; /* backspace */
Index: elmME+.2.5.alpha5-cvs/src/screen/Makefile.SH
*** elmME+.2.5.alpha4/src/screen/Makefile.SH 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/Makefile.SH 2005-07-20 19:49:51.000000000 +0300
***************
*** 17,23 ****
echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.3.12.2 2004/07/19 09:20:02 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
--- 17,23 ----

echo "Extracting src/screen/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # $Id: Makefile.SH,v 1.3.12.3 2005/07/20 16:49:51 hurtta Exp $


# Makefile for the ELM mail program.
#
# Variables
***************

*** 43,49 ****
SHELL = /bin/sh

OBJ = screen.o curses.o curs_input.o termbuffer.o \
! termtitle.o termcharset.o cur_process.o context.o init.o

all: Makefile libscreen.a

--- 43,50 ----
SHELL = /bin/sh

OBJ = screen.o curses.o curs_input.o termbuffer.o \
! termtitle.o termcharset.o cur_process.o context.o init.o subpage.o \
! wrapper.o menu_param.o scommon.o header.o

all: Makefile libscreen.a

***************
*** 63,69 ****
$(RANLIB) $@

# Dependencies of header files upon other header files they include

! .PRECIOUS: def_screen.h $(INCLDIR)/defs.h $(INCLDIR)/headers.h



$(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@

--- 64,70 ----
$(RANLIB) $@



# Dependencies of header files upon other header files they include

! .PRECIOUS: def_screen.h $(INCLDIR)/defs.h $(INCLDIR)/headers.h def_scommon.h



$(INCLDIR)/defs.h: $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
$(CHMOD) u+w $@
***************

*** 94,97 ****
--- 95,104 ----


cur_process.o: def_screen.h $(INCLDIR)/s_elm.h
context.o: def_screen.h
init.o: def_screen.h
+ wrapper.o: def_screen.h
+ menu_param.o: def_screen.h
+ #
+ subpage.o: def_screen.h def_scommon.h
+ scommon.o: def_screen.h def_scommon.h
+ header.o: def_screen.h def_scommon.h
!NO!SUBS!

Index: elmME+.2.5.alpha5-cvs/src/screen/menu_param.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/src/screen/menu_param.c 2005-07-23 20:14:20.000000000 +0300
***************
*** 0 ****
--- 1,78 ----
+ static char rcsid[] = "@(#)$Id: menu_param.c,v 1.2.36.2 2005/07/23 17:14:20 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.2.36.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+
+ #include "def_screen.h"
+
+ #if 0
+ DEBUG_VAR(Debug,__FILE__,"screen");
+ #endif
+
+ int mp_lookup_integer(list,idx)
+ struct menu_param *list;
+ int idx;


+ {
+ int i;
+

+ for (i = 0; i < idx; i++) {
+ if (mp_END == list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_lookup_integer",
+ "Bad index",0);
+ }
+ if (mp_integer != list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_lookup_integer",

+ "Bad type",0);
+

+ return list[i].u.i;
+ }
+
+ struct menu_common * mp_lookup_mcommon(list,idx)

+ struct menu_param *list;
+ int idx;


+ {
+ int i;
+

+ for (i = 0; i < idx; i++) {
+ if (mp_END == list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_lookup_mcommon",
+ "Bad index",0);
+ }
+ if (mp_menu_common != list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_lookup_mcommon",

+ "Bad type",0);
+

+ return list[i].u.c;
+ }
+
+ void mp_set_any1(list,idx,v)

+ struct menu_param *list;

+ int idx;
+ struct menu_param *v;

+ {
+ int i;
+

+ for (i = 0; i < idx; i++) {
+ if (mp_END == list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_set_any1",

+ "Bad index",0);
+ }
+

+ if (v->t != list[i].t)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"mp_set_any1",
+ "Bad type",0);
+
+ list[i].u = v->u;

+ }
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/src/screen/scommon.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/src/screen/scommon.c 2005-07-26 11:28:46.000000000 +0300
***************


*** 0 ****
--- 1,726 ----

+ static char rcsid[] = "@(#)$Id: scommon.c,v 1.4.6.2 2005/07/26 08:28:46 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.4.6.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+

+ #include "def_screen.h"
+ #include "def_scommon.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ #define MENU_SCOMMON_magic 0xF805
+
+ void scommon_zero(c)
+ struct subpage_common *c;
+ {
+
+ c->magic = MENU_SCOMMON_magic;
+ c->rel_start_line = 0;

+ c->param_ptr = NULL;
+ }
+

+ void scommon_clear(c)
+ struct subpage_common *c;
+ {
+ c->magic = 0; /* Invalidate */
+ }
+
+ void calculate_printing_area(ctx)
+ struct menu_context *ctx;
+ {
+ struct menu_context *parent;
+ int startline = 0;
+ int endline;
+
+ int S, E;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"calculate_printing_area",

+ "Bad container magic number",0);
+

+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"calculate_printing_area",

+ "Bad parent draw magic number",0);
+

+ /* Need to calculate absolute from relative position */
+
+ parent->routine->wra_calculate_line(parent,
+ ctx->u.common->rel_start_line,
+ &startline);
+
+ endline = startline + ctx->lines -1;
+
+ parent->routine->wra_get_linelimit(parent,&S,&E);
+
+ if (startline < S)
+ startline = S;
+ if (endline > E)
+ endline = E;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"calculate_printing_area",

+ "Bad container magic number",0);
+

+ ctx->container->location.first_line = startline;
+ ctx->container->location.last_line = endline;
+
+ DPRINT(Debug,11, (&Debug,
+ "calculate_printing_area(%p): startline=%d endline=%d\n",
+ ctx,startline,endline));
+ }
+
+ void scommon_Writechar(ctx,ch)
+ struct menu_context * ctx;

+ int ch;
+ {


+ int remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_Writechar",

+ "Bad container magic number",0);
+

+ struct string *text;
+ {

+ int remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLineS",

+ "Bad container magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_putlineS(%p,\"%S\")\n",ctx,text));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw
+ */
+
+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location)); /* syncronize position */
+ if (ctx->container->location.gone_out)
+ return; /* Not in drawing area */
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);

+ cur_changemode(&CUR_modes,ctx->modes, remove);
+

+ cur_PutLineS(text, & (ctx->container->location));
+
+ cur_GetXYLocation(& ctx->row,& ctx->col);
+ }
+
+ void scommon_PutLine0(ctx,row,col,line)
+ struct menu_context * ctx;
+ int row;
+ int col;

+ const char *line;


+ {
+ int rline, remove;
+ struct menu_context * parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLine0",

+ "Bad container magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_Putline0(%p,%d,%d,\"%s\")\n",
+ ctx,row,col,line));
+
+
+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLine0",

+ "Bad parent draw magic number",0);
+

+ if (MENU_SCOMMON_magic != ctx->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLine0",

+ "Bad subpage magic number",0);
+

+ "Bad container magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_CleartoEOLN(%p)\n",ctx));
+
+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw
+ */
+
+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location)); /* syncronize position */
+ if (ctx->container->location.gone_out)
+ return; /* Not in drawing area */
+
+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+ cur_CleartoEOLN();
+

+ /* CleartoEOLN do not move cursor ... */
+ }
+

+ void scommon_CleartoEOS(ctx)
+ struct menu_context * ctx;
+ {
+ int row, remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_PutLineS",

+ "Bad container magic number",0);
+

+ /* CleartoEOS do not move cursor ... */
+ }
+

+ struct charset_state * scommon_ReadCh2(ctx,flags,break_flag)
+ struct menu_context *ctx;
+ int flags;
+ int break_flag;
+ {
+ int remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_ReadCh2",

+ "Bad container magic number",0);
+

+ "Bad container magic number",0);
+

+ "Bad container magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_getXYLocation(%p,%p,%p)\n",

+ ctx,row,col));
+

+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_GetXYLocation",

+ "Bad parent draw magic number",0);
+

+ if (MENU_SCOMMON_magic != ctx->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_GetXYLocation",

+ "Bad subpage magic number",0);
+

+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* Need to calculate absolute from relative position */
+
+ parent->routine->wra_calculate_line(parent,
+ ctx->u.common->rel_start_line,
+ &diff);
+
+ /* NOTE: ctx->row, col are absolute
+
+ therefore needs to call cur_ routines, not
+ parents routines for draw

+ */
+
+

+ cur_MoveCursor(ctx->row,ctx->col, & (ctx->container->location)); /* syncronize position */
+
+ *col = ctx->col;
+ *row = ctx->row - diff;
+ }
+
+ void scommon_ClearScreen(ctx)
+ struct menu_context *ctx;
+ {
+ int row, remove;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_ClearScreen",

+ "Bad container magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_ClearScreen(%p)\n"));
+

+ /* recalculate ctx->container->location */
+ if (ROOT_MENU.changed || ctx->changed)
+ calculate_printing_area(ctx);
+
+ /* cur_ClearScreen() reset redraw flag ... we simulate it also on here */

+ ctx->redraw = 0;
+

+ /* Fix modes */
+ remove = CUR_modes & ~(ctx->modes);
+ cur_changemode(&CUR_modes,ctx->modes, remove);
+
+
+ /* clear lines */
+ for (row = ctx->container->location.first_line;
+ row <= ctx->container->location.last_line;
+ row++) {
+ cur_MoveCursor(row, 0, & (ctx->container->location)); /* syncronize position */
+ cur_CleartoEOLN();
+ }
+

+ /* ClearScreen do not move cursor ... */
+ }
+

+ void scommon_MoveCursor(ctx,row,col)
+ struct menu_context *ctx;
+ int row;
+ int col;
+ {
+ int rline;
+ struct menu_context * parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_MoveCursor",

+ "Bad container magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_MoveCursor(%p,%d,%d)\n",

+ ctx,row,col));
+

+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_MoveCursor",

+ "Bad parent draw magic number",0);
+

+ if (MENU_SCOMMON_magic != ctx->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_MoveCursor",

+ "Bad subpage magic number",0);
+

+
+ }
+

+ void scommon_resized(ctx)
+ struct menu_context *ctx;
+ {
+ struct menu_context *parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_resized",

+ "Bad container magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_resized(%p)\n",ctx));
+
+ parent = ctx->container->parent;
+
+ /* FIX: resizing of lines not supported */
+
+ ctx->columns = parent->columns;
+ ctx->changed = parent->changed; /* ? ? ? ? */
+
+ calculate_printing_area(ctx);
+ }
+
+ void scommon_calculate_line(ctx,rel_line,result)
+ struct menu_context *ctx;
+ int rel_line;
+ int *result;
+ {
+ struct menu_context * parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_calculate_line",

+ "Bad container magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_calculate_line(%p,%d,%p)\n",
+ ctx,rel_line,result));
+
+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_calculate_line",

+ "Bad parent draw magic number",0);
+

+ if (MENU_SCOMMON_magic != ctx->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_calculate_line",

+ "Bad subpage magic number",0);
+

+ /* Need to calculate absolute from relative position */
+
+ parent->routine->wra_calculate_line(parent,
+ ctx->u.common->rel_start_line + rel_line,
+ result);
+ }
+
+ void scommon_get_linelimit(ctx,startline,endline)

+ struct menu_context *ctx;
+ int *startline;

+ int *endline;
+ {
+ int S, E;
+ struct menu_context * parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_get_linelimit",

+ "Bad container magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_get_linelimit(%p,%p,%p)\n",
+ ctx,startline,endline));
+
+ *startline = ctx->container->location.first_line;
+ *endline = ctx->container->location.last_line;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_get_linelimit",

+ "Bad container magic number",0);
+

+ parent = ctx->container->parent;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_get_linelimit",

+ "Bad parent draw magic number",0);
+

+ parent->routine->wra_get_linelimit(parent,&S,&E);
+
+ if (*startline < S)
+ *startline = S;
+
+ if (*endline > E)
+ *endline = E;

+ }
+

+ /* called by need_redraw() */
+ void scommon_reset_redraw(ctx)
+ struct menu_context *ctx;
+ {
+ struct menu_context *parent;
+
+ if (MENU_CONTAINER_magic != ctx->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_reset_redraw",

+ "Bad container magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_reset_redraw(%p)\n",
+ ctx));
+
+ parent = ctx->container->parent;
+

+ ctx->redraw = parent->redraw; /* ? ? ? ? */
+ }
+

+ #if 0
+ void scommon_mp_set_any P_((struct menu_context *ptr,
+ int idx,
+ struct menu_param *v));
+
+ void scommon_mp_set_any(ptr,idx,v)

+ struct menu_context *ptr;


+ int idx;
+ struct menu_param *v;
+ {
+ if (MENU_SCOMMON_magic != ptr->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_mp_set_any",
+ "Bad magic number",0);
+
+ DPRINT(Debug,11, (&Debug, "scommon_mp_set_any(%p,%d,%p)\n",
+ ptr,idx,v));
+
+ mp_set_any1(ptr->u.common->param_ptr,idx,v);

+ }
+ #endif
+

+ void scommon_relocate(subpage,parent,rel_start_line,lines)
+ struct menu_context *subpage;
+ struct menu_context *parent;
+ int rel_start_line;
+ int lines;
+ {
+ if (MENU_CONTEXT_magic != subpage->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",

+ "Bad subpage magic number",0);
+
+

+ if (MENU_SCOMMON_magic != subpage->u.common->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",

+ "Bad subpage magic number",0);
+

+ if (MENU_CONTEXT_magic != parent->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",

+ "Bad parent magic number",0);
+

+ DPRINT(Debug,11, (&Debug, "scommon_relocate(%p,%p,%d,%d)\n",
+ subpage,parent,rel_start_line,lines));
+
+ subpage->lines = lines;
+ subpage->columns = parent->columns;
+ subpage->u.common->rel_start_line = rel_start_line;
+
+ if (subpage->container) {
+ if (MENU_CONTAINER_magic != subpage->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",

+ "Bad container magic number",0);
+

+ if (parent != subpage->container->parent) {
+ detach_subpage(subpage);
+ goto attach_new;

+ }
+
+
+ } else {

+ int rline, lline;
+
+ attach_new:
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"scommon_relocate",

+ "Bad parent draw magic number",0);
+
+

+ parent->routine->wra_calculate_line(parent,rel_start_line,&rline);
+
+ lline = rline + lines -1; /* calculate_printing_area() fixes */
+
+ attach_subpage(parent,subpage,rline,lline);
+ }
+
+ calculate_printing_area(subpage);

+ }
+
+ /*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/src/screen/screen.c
*** elmME+.2.5.alpha4/src/screen/screen.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/screen.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: screen.c,v 1.7.8.2 2004/07/19 09:20:03 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.2 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
******************************************************************************
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: screen.c,v 1.7.8.5 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)

******************************************************************************
***************
*** 20,25 ****


--- 20,30 ----

DEBUG_VAR(Debug,__FILE__,"screen");

+ static struct menu_context * sync_ctx = NULL;
+
+ #define SYNC(x) while (x != sync_ctx) { Syncronize(x); }
+
+ static void StartSyncronize P_((struct menu_context *ctx));

static void PutLineS P_((struct string *S));

***************

!
return r;
}

***************
*** 69,89 ****


{
DPRINT(Debug,49, (&Debug, "Writechar('%c')\n",ch));

! cur_Writechar(ch);
}

/*VARARGS2*/

void Write_to_screen (


#if ANSI_C
! CONST char *format, CONST char *msg, ...
#else
format, msg, va_alist

#endif
)
#if !ANSI_C
! CONST char *format;

! CONST char *msg;
va_dcl
#endif
{
--- 81,119 ----


{
DPRINT(Debug,49, (&Debug, "Writechar('%c')\n",ch));

! SYNC(default_context);
! cur_Writechar(ch, NULL);
! }
!
! void menu_Writechar(ctx,ch)
! struct menu_context * ctx;

! int ch;
! {


! DPRINT(Debug,49, (&Debug, "menu_Writechar(%p,'%c')\n",ctx,ch));
!
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_Writechar",
! "Bad type magic number",0);
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_Writechar",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_Writechar(ctx,ch);
}

/*VARARGS2*/

void Write_to_screen (


#if ANSI_C
! const char *format, const char *msg, ...
#else
format, msg, va_alist

#endif
)
#if !ANSI_C
! const char *format;

! const char *msg;
va_dcl
#endif
{
***************

*** 92,97 ****
--- 122,129 ----

DPRINT(Debug,49, (&Debug, "Write_to_screen(format=\"%s\",...)\n",format));

+ SYNC(default_context);
+
Va_start(vl, msg); /* defined in defs.h */

/** This routine writes to the screen at the current location.
***************
*** 106,118 ****

}

void PutLine0(x, y, line)
int x,y;

! CONST char *line;


{
DPRINT(Debug,49, (&Debug, "PutLine0(%d,%d,\"%s\")\n",x,y,line));

! cur_PutLine0(x,y,line);
}


--- 138,221 ----

}

+
+ /*VARARGS2*/
+
+ void menu_Write_to_screen (

+ #if ANSI_C
+ struct menu_context * ctx,
+ const char *format, const char *msg, ...


+ #else
+ ctx, format, msg, va_alist

+ #endif
+ )
+ #if !ANSI_C

+ struct menu_context * ctx;
+ const char *format;
+ const char *msg;


+ va_dcl
+ #endif
+ {
+ va_list vl;
+ struct string *text;
+

+ DPRINT(Debug,49, (&Debug,
+ "menu_Write_to_screen(%p,format=\"%s\",...)\n",
+ ctx,format));
+
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_Write_to_screen",
+ "Bad type magic number",0);
+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_Write_to_screen",

+ "Bad draw magic number",0);
+
+ SYNC(ctx);
+
+ Va_start(vl, msg); /* defined in defs.h */
+

+ /** This routine writes to the screen at the current location.
+ when done, it increments lines & columns accordingly by
+ looking for "\n" sequences... **/
+
+ text = elm_smessage(0,format,msg,vl);
+
+ ctx->routine->wra_PutLineS(ctx,text);

+
+ free_string(&text);
+

+ va_end(vl);
+
+ }
+
void PutLine0(x, y, line)
int x,y;

! const char *line;


{
DPRINT(Debug,49, (&Debug, "PutLine0(%d,%d,\"%s\")\n",x,y,line));

! SYNC(default_context);
! cur_PutLine0(x,y,line,NULL);
! }
!
! void menu_PutLine0(ctx, x, y, line)
! struct menu_context * ctx;
! int x,y;

! const char *line;


! {
! DPRINT(Debug,49, (&Debug,
! "menu_PutLine0(%p,%d,%d,\"%s\")\n",
! ctx,x,y,line));
!
! if (MENU_CONTEXT_magic != ctx->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_PutLine0",
! "Bad type magic number",0);
! if (MENU_DRAW_magic != ctx->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_PutLine0",
! "Bad draw magic number",0);
!
! SYNC(ctx);
! ctx->routine->wra_PutLine0(ctx,x,y,line);
}


***************

*** 126,133 ****
#if !ANSI_C
int x;
int y;

! CONST char *format;
! CONST char *line;
va_dcl
#endif
{

--- 229,236 ----
#if !ANSI_C
int x;
int y;

! const char *format;
! const char *line;
va_dcl
#endif
{
***************

*** 136,141 ****
--- 239,246 ----

DPRINT(Debug,49, (&Debug, "PutLineX(%d,%d,format=\"%s\",...)\n",x,y,format));

+ SYNC(default_context);

+
Va_start(vl, line); /* defined in defs.h */

MoveCursor(x,y);
***************
*** 149,172 ****


}


! int CleartoEOLN()
{
! int r;

DPRINT(Debug,49, (&Debug, "CleartoEOLN()\n"));
- r = cur_CleartoEOLN();

! return r;
}

! int CleartoEOS()
{
! int r;

DPRINT(Debug,49, (&Debug, "CleartoEOS()\n"));
! r = cur_CleartoEOS();

! return r;
}

int RawState()

--- 254,352 ----


}


! void menu_PutLineX(
! #if ANSI_C
! struct menu_context * ctx,
! int x, int y, const char *format, const char *line, ...
! #else
! ctx, x, y, format, line, va_alist
! #endif
! )
! #if !ANSI_C
! struct menu_context * ctx;
! int x;
! int y;

! const char *format;
! const char *line;

! va_dcl
! #endif
{
! va_list vl;
! struct string *text;
!
! DPRINT(Debug,49, (&Debug,
! "menu_PutLineX(%p,%d,%d,format=\"%s\",...)\n",
! ctx, x,y,format));

+ if (MENU_CONTEXT_magic != ctx->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_PutLineX",


+ "Bad type magic number",0);
+ if (MENU_DRAW_magic != ctx->routine->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_PutLineX",
+ "Bad draw magic number",0);
+
+ SYNC(ctx);
+ ctx->routine->wra_MoveCursor(ctx, x, y);


+
+ Va_start(vl, line); /* defined in defs.h */
+

+

+ text = elm_smessage(0,format,line,vl);
+

+ ctx->routine->wra_PutLineS(ctx,text);
+
+ free_string(&text);
+
+ va_end(vl);
+
+ }
+

--- 389,417 ----

--- 433,440 ----



DPRINT(Debug,49, (&Debug, "ReadCh2(%d)\n",flags));

! SYNC(default_context);
! st = cur_ReadCh2(flags,InGetPrompt);

return st;
}
***************
*** 250,258 ****
{
struct charset_state *st;

! DPRINT(Debug,49, (&Debug, "menu_ReadCh2(...,%d)\n",flags));

! st = cur_ReadCh2(flags,InGetPrompt,ptr);

return st;
}

--- 445,481 ----


{
struct charset_state *st;

! DPRINT(Debug,49, (&Debug, "menu_ReadCh2(%p,...,%d)\n",ptr,flags));

! if (MENU_CONTEXT_magic != ptr->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh2",
! "Bad type magic number",0);
! if (MENU_DRAW_magic != ptr->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh2",
! "Bad draw magic number",0);
!
! SYNC(ptr);
! if (ptr->redraw && (flags & READCH_MASK)) {
! set_last_state(system_charset);
!
! reset_state(last_state,1);
! last_state->caller_flags = (flags & READCH_MASK);
!
! return last_state; /* cur_ReadCh2 checks now default_contect

! */
! }
!

! if (ptr->changed && (flags & READCH_resize)) {
! set_last_state(system_charset);
!
! reset_state(last_state,1);
! last_state->caller_flags = RESIZE_MARK;
!
! return last_state; /* cur_ReadCh2 checks now default_contect

! */
! }
!

! st = ptr->routine->wra_ReadCh2(ptr,flags,InGetPrompt);

return st;
}
***************
*** 264,270 ****

DPRINT(Debug,49, (&Debug, "ReadCh(%d)\n",flags));

! c = cur_ReadCh(flags,InGetPrompt,default_context);

DPRINT(Debug,50, (&Debug, "ReadCh=0x%02x\n",c));

--- 487,494 ----



DPRINT(Debug,49, (&Debug, "ReadCh(%d)\n",flags));

! SYNC(default_context);
! c = cur_ReadCh(flags,InGetPrompt);

DPRINT(Debug,50, (&Debug, "ReadCh=0x%02x\n",c));

***************

*** 284,296 ****


{
int c;

if (ptr->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh",
"Bad type magic number",0);

- DPRINT(Debug,49, (&Debug, "menu_ReadCh(...,%d)\n",flags));

! c = cur_ReadCh(flags,InGetPrompt,ptr);

DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x\n",c));

--- 508,539 ----


{
int c;

+ DPRINT(Debug,49, (&Debug, "menu_ReadCh(%p,...,%d)\n",ptr,flags));
+
if (ptr->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh",
"Bad type magic number",0);
+ if (MENU_DRAW_magic != ptr->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ReadCh",
+ "Bad draw magic number",0);
+ SYNC(ptr);
+
+ if (ptr->redraw && (flags & READCH_MASK)) {
+ c = (flags & READCH_MASK);
+ DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x (REDRAW_MARK)\n",c));
+ return c; /* cur_ReadCh checks now
+ default_contect

+ */
+ }
+

+ if (ptr->changed && (flags & READCH_resize)) {
+ c = RESIZE_MARK;
+ DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x (RESIZE_MARK)\n",c));
+ return c;
+ }


! c = ptr->routine->wra_ReadCh(ptr,flags,InGetPrompt);

DPRINT(Debug,50, (&Debug, "menu_ReadCh=0x%02x\n",c));

***************

*** 308,368 ****


cur_ScreenSize(lines,columns);

((*lines)--);

}

void GetXYLocation(x,y)
int *x,*y;
{
DPRINT(Debug,49, (&Debug, "GetXYLocation(*,*)\n"));

cur_GetXYLocation(x,y);
}

/* NOTE: Is called fron interrupt! */
! int ClearScreen()
{
! int r;

! DPRINT(Debug,49, (&Debug, "ClearScreen()\n"));

! r = cur_ClearScreen(default_context);

! return r;
}

! int menu_ClearScreen(ptr)
struct menu_context *ptr;
{

! int r;



if (ptr->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ClearScreen",
"Bad type magic number",0);

- DPRINT(Debug,49, (&Debug, "menu_ClearScreen(...)\n"));

! r = cur_ClearScreen(ptr);

! return r;
}

! int MoveCursor(row, col)
int row, col;
{
- int r;
-
DPRINT(Debug,49, (&Debug, "MoveCursor(%d,%d)\n",row,col));

! r = cur_MoveCursor(row, col);

! return r;
}

void CarriageReturn()
{

DPRINT(Debug,49, (&Debug, "CarriageReturn()\n"));
/** move the cursor to the beginning of the current line **/
Writechar('\r');
}

--- 551,707 ----


cur_ScreenSize(lines,columns);

((*lines)--);
+ }
+
+ void menu_ScreenSize(ctx,lines, columns)
+ struct menu_context *ctx;
+ int *lines, *columns;
+ {
+
+ DPRINT(Debug,49, (&Debug, "ScreenSize(%p,*,*)\n",ctx));
+
+ if (ctx->magic != MENU_CONTEXT_magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ScreenSize",
+ "Bad type magic number",0);
+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_ScreenSize",

+ "Bad draw magic number",0);

+

+ /* menu_ScreenSize DO NOT return lines-1 (as ScreenSize() did) */
+
+ ctx->routine->wra_ScreenSize(ctx,lines,columns);
}

+
void GetXYLocation(x,y)
int *x,*y;
{
DPRINT(Debug,49, (&Debug, "GetXYLocation(*,*)\n"));

+ SYNC(default_context);
cur_GetXYLocation(x,y);
}

+ void menu_GetXYLocation(ctx,row,col)
+ struct menu_context *ctx;
+ int *row,*col;
+ {
+ DPRINT(Debug,49, (&Debug, "menu_GetXYLocation(%p,*,*)\n",ctx));
+
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_GetXYLocation",

+ "Bad type magic number",0);
+

+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_GetXYLocation",

+ "Bad draw magic number",0);
+

+ SYNC(ctx);
+ ctx->routine->wra_GetXYLocation(ctx,row,col);
+
+ /* WARNING:
+
+ row,col != ctx->row, ctx->col
+
+ because row,col are relative and ctc->row, ctx->col
+ are absolute
+

+ */
+
+ }
+

+
/* NOTE: Is called fron interrupt! */
! void ClearScreen(interrupt)
! int interrupt;
{
! if (interrupt) {

! SIGDPRINT(Debug,49, (&Debug, "ClearScreen() -- interrupt\n"));

! } else {


! DPRINT(Debug,49, (&Debug, "ClearScreen() -- no interrupt\n"));
! SYNC(default_context);
! }

! cur_ClearScreen();
}

! void menu_ClearScreen(ptr)
struct menu_context *ptr;
{

! DPRINT(Debug,49, (&Debug, "menu_ClearScreen(%p,...)\n",ptr));

*** 372,451 ****


DPRINT(Debug,49, (&Debug, "NewLine()\n"));
/** move the cursor to the beginning of the next line **/

Writechar('\r');
Writechar('\n');
FlushBuffer();
}

! int modes = 0;

! int StartBold()
{
DPRINT(Debug,49, (&Debug, "StartBold()\n"));
- cur_changemode(&modes, pg_BOLD,0);

! return 0;
}

! int EndBold()
{
DPRINT(Debug,49, (&Debug, "EndBold()\n"));
/** compliment of startbold **/

! cur_changemode(&modes, 0, pg_BOLD);

!
! return 0;
}


! int StartInverse() {
!
DPRINT(Debug,49, (&Debug, "StartInverse()\n"));
- cur_changemode(&modes, pg_INVERSE,0);
-

- return 0;
- }


! int EndInverse() {

DPRINT(Debug,49, (&Debug, "EndInverse()\n"));
- cur_changemode(&modes, 0, pg_INVERSE);
-

- return 0;
- }


- int StartUnderline() {

DPRINT(Debug,49, (&Debug, "StartUnderline()\n"));
- cur_changemode(&modes, pg_UNDERLINE,0);

-
- return 0;
- }

! int EndUnderline() {

DPRINT(Debug,49, (&Debug, "EndUnderline()\n"));
! cur_changemode(&modes, 0, pg_UNDERLINE);

!
! return 0;
}


! int StartHalfbright() {

DPRINT(Debug,49, (&Debug, "StartHalfbright()\n"));
! cur_changemode(&modes, pg_HALFBRIGHT,0);

!
! return 0;
}


! int EndHalfbright() {

DPRINT(Debug,49, (&Debug, "EndHalfbright()\n"));
- cur_changemode(&modes, 0, pg_HALFBRIGHT);

! return 0;
}

int get_tabspacing()
{
DPRINT(Debug,49, (&Debug, "get_tabspacing()\n"));

--- 711,978 ----

+ void menu_StartXX(ctx,f)
+ struct menu_context *ctx;
+ int f;


+ {
+ if (MENU_CONTEXT_magic != ctx->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_StartXX",
+ "Bad type magic number",0);
+

+ if (MENU_DRAW_magic != ctx->routine->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_StartXX",
+ "Bad draw magic number",0);
+
+ SYNC(ctx);
+ ctx->routine->wra_changemode(ctx, f, 0);
+ }
+
+ void menu_EndXX(ctx,f)
+ struct menu_context *ctx;
+ int f;


+ {
+ if (MENU_CONTEXT_magic != ctx->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_EndXX",
+ "Bad type magic number",0);
+

+ if (MENU_DRAW_magic != ctx->routine->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_EndXX",
+ "Bad draw magic number",0);
+
+ SYNC(ctx);
+ ctx->routine->wra_changemode(ctx, 0, f);
+ }
+
+ void EndSyncronize(ctx)


+ struct menu_context *ctx;
+ {
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"EndSyncronize",

+ "Bad type magic number",0);
+

+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"EndSyncronize",

+ "Bad draw magic number",0);
+
+ if (sync_ctx != ctx)


+ return; /* Nothing need to do */
+
+ if (ctx == &COOKED_MENU) {

+ DPRINT(Debug,9, (&Debug, "EndSyncronize: Skippig cooked meny syncronize\n"));
+ sync_ctx = NULL;
+ return;
+ }
+
+ DPRINT(Debug,9, (&Debug, "EndSyncronize: Syncronize from %p\n",ctx));
+
+ ctx->routine->wra_SyncLeave(ctx);
+ sync_ctx = NULL;
+ }
+

+ static void StartSyncronize(ctx)
+ struct menu_context *ctx;
+ {
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"EndSyncronize",

+ "Bad type magic number",0);
+

+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"EndSyncronize",

+ "Bad draw magic number",0);
+

+ if (sync_ctx == ctx)
+ return; /* Nothing need to do */
+
+ if (ctx == &COOKED_MENU) {
+ DPRINT(Debug,9, (&Debug, "StartSyncronize: Skippig cooked menu syncronize\n"));
+ sync_ctx = ctx;

+ return;
+ }
+

+ DPRINT(Debug,9, (&Debug, "StartSyncronize: Syncronize to %p\n",ctx));
+
+ ctx->routine->wra_SyncEnter(ctx);
+ sync_ctx = ctx;

+ }
+
+

+ void Syncronize(ctx)
+ struct menu_context *ctx;
+ {
+ if (sync_ctx == ctx)
+ return; /* Nothing need to do */
+
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"Syncronize",

+ "Bad type magic number",0);
+

+ if (MENU_DRAW_magic != ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"Syncronize",

+ "Bad draw magic number",0);
+

+ if (sync_ctx == &COOKED_MENU) {
+ DPRINT(Debug,9, (&Debug, "Syncronize: Skippig cooked menu syncronize\n"));

+ sync_ctx = NULL;
+ }
+
+

+ if (sync_ctx) {
+ if (MENU_CONTEXT_magic != sync_ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"Syncronize",

+ "Bad type magic number",0);
+

+ if (MENU_DRAW_magic != sync_ctx->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"Syncronize",

+ "Bad draw magic number",0);
+

+ DPRINT(Debug,9, (&Debug, "Syncronize: Syncronize from %p\n",sync_ctx));
+
+ sync_ctx->routine->wra_SyncLeave(sync_ctx);
+ }
+
+ if (ctx == &COOKED_MENU) {
+ DPRINT(Debug,9, (&Debug, "Syncronize: Skippig cooked menu syncronize\n"));
+ sync_ctx = ctx;

+ return;
+ }
+

+ DPRINT(Debug,9, (&Debug, "Syncronize: Syncronize to %p\n",ctx));
+
+ ctx->routine->wra_SyncEnter(ctx);
+ sync_ctx = ctx;
+ }
+
+ void menu_set_default(ctx)
+ struct menu_context *ctx;
+ {
+ if (default_context == ctx)
+ return;
+
+ if (MENU_CONTEXT_magic != ctx->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_set_default",

+ "Bad type magic number",0);
+

+ if (sync_ctx->routine != &CURSES_ROUTINES)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_set_default",
+ "Not a main menu",0);
+
+ SYNC(ctx);
+ default_context = ctx;
+
+ DPRINT(Debug,9, (&Debug, "menu_set_default: Clearing screen, and setting redraw flag\n"));
+ cur_ClearScreen();

+ ctx->redraw = 1;
+
+

+ DPRINT(Debug,9, (&Debug,
+ "menu_set_default: default context to %p\n",
+ default_context));
+ }
+
+ void mp_list_set_integer(list,idx,v)

+ struct menu_param *list;

+ int idx;
+ int v;
+ {
+ struct menu_param v1;
+
+ v1.t = mp_integer;
+ v1.u.i = v;
+
+ mp_set_any1(list,idx,&v1);
+ }
+
+ void mp_list_set_mcommon(list,idx,v)

+ struct menu_param *list;


+ int idx;
+ struct menu_common *v;
+ {
+ struct menu_param v1;
+
+ v1.t = mp_menu_common;
+ v1.u.c = v;
+
+ mp_set_any1(list,idx,&v1);
+ }
+
+
int get_tabspacing()
{
DPRINT(Debug,49, (&Debug, "get_tabspacing()\n"));

Index: elmME+.2.5.alpha5-cvs/src/screen/subpage.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/src/screen/subpage.c 2005-07-20 19:49:51.000000000 +0300
***************


*** 0 ****
--- 1,181 ----

+ static char rcsid[] = "@(#)$Id: subpage.c,v 1.8.10.1 2005/07/20 16:49:51 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.8.10.1 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+

+ #include "def_screen.h"
+ #include "def_scommon.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");
+
+ #define MENU_SUBPAGE_magic 0xF803
+
+ struct menu_subpage {
+ struct subpage_common c;
+ unsigned short magic; /* MENU_SUBPAGE_magic */
+

+ subpage_simple_redraw * redraw_routine;
+ };
+

+
+ #if ANSI_C
+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ int subpage_simple_noredraw P_((struct menu_context *ptr,

+ struct menu_param *list));
+

+ S_(w_menu_init subpage_init)
+ static void subpage_init P_((struct menu_context *ctx));
+ static void subpage_init(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "subpage_init: %p\n",
+ ctx));
+
+ ctx->u.subpage = safe_malloc (sizeof (* ctx->u.subpage));

+
+ /* bzero is defined hdrs/defs.h */

+ bzero((void *)ctx->u.subpage,sizeof (* ctx->u.subpage));
+
+ scommon_zero(&(ctx->u.subpage->c));
+ ctx->u.subpage->magic = MENU_SUBPAGE_magic;
+
+ ctx->u.subpage->redraw_routine = subpage_simple_noredraw;
+ }
+
+ S_(w_menu_free subpage_free)
+ static void subpage_free P_((struct menu_context *ctx));
+ static void subpage_free(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "subpage_free: %p\n",
+ ctx));
+
+ if (MENU_SUBPAGE_magic != ctx->u.subpage->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"subpage_free",


+ "Bad magic number",0);
+

+ scommon_clear( & (ctx->u.subpage->c) );
+
+ ctx->u.subpage->magic = 0; /* Invalidate */
+ free(ctx->u.subpage);

+ ctx->u.subpage = NULL;
+ }
+
+

+ S_(w_menu_do_redraw subpage_do_redraw)
+ static int subpage_do_redraw P_((struct menu_context *ctx));
+ static int subpage_do_redraw(ctx)
+ struct menu_context *ctx;
+ {
+ if (MENU_SUBPAGE_magic != ctx->u.subpage->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"subpage_do_redraw",
+ "Bad magic number",0);
+
+ return ctx->u.subpage->redraw_routine(ctx,
+ ctx->u.subpage->c.param_ptr);

+ }
+
+

+ static struct menu_draw_routine SUBPAGE_ROUTINES = {
+ MENU_DRAW_magic,
+
+ subpage_init,
+ subpage_free,
+
+ scommon_Writechar,
+ scommon_PutLineS,
+ scommon_PutLine0,
+ scommon_CleartoEOLN,
+ scommon_CleartoEOS,
+ scommon_ReadCh2,
+ scommon_ReadCh,
+ scommon_ScreenSize,

+ scommon_GetXYLocation,
+ scommon_ClearScreen,


+ scommon_MoveCursor,
+ scommon_changemode,
+ scommon_SyncEnter,
+ scommon_SyncLeave,
+ scommon_resized,
+ scommon_calculate_line,
+ scommon_get_linelimit,
+ scommon_reset_redraw,
+ subpage_do_redraw,
+ };
+
+ int subpage_simple_noredraw(ptr,list)

+ struct menu_context *ptr;


+ struct menu_param *list;
+ {

+ return 0;
+ }
+

+ struct menu_context * new_menu_subpage(parent,rel_start_line,lines,redraw,
+ list)
+ struct menu_context *parent;
+ int rel_start_line;
+ int lines;
+ subpage_simple_redraw redraw;

+ struct menu_param *list;
+ {

+ int rline = 0;

+ int lline = 0;
+

+ struct menu_context *ret = new_menu_type(&SUBPAGE_ROUTINES);
+
+ if (MENU_CONTEXT_magic != parent->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_subpage",

+ "Bad parent magic number",0);
+

+ ret->lines = lines;
+ ret->columns = parent->columns;
+ ret->u.subpage->c.rel_start_line = rel_start_line;
+ ret->u.subpage->c.param_ptr = list;
+ ret->u.subpage->redraw_routine = redraw;
+
+ if (MENU_DRAW_magic != parent->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_subpage",

+ "Bad parent draw magic number",0);
+

+ parent->routine->wra_calculate_line(parent,rel_start_line,&rline);
+
+ lline = rline + lines -1; /* calculate_printing_area() fixes */
+
+ attach_subpage(parent,ret,rline,lline);
+
+ calculate_printing_area(ret);

+
+ return ret;
+ }
+

+ void menu_subpage_relocate(subpage,parent,rel_start_line,lines)
+ struct menu_context *subpage;
+ struct menu_context *parent;
+ int rel_start_line;
+ int lines;
+ {
+
+ if (&SUBPAGE_ROUTINES != subpage->routine)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_subpage_relocate",
+ "Not a subpage",0);
+
+ scommon_relocate(subpage,parent,rel_start_line,lines);

+ }
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/src/screen/termbuffer.c
*** elmME+.2.5.alpha4/src/screen/termbuffer.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/termbuffer.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: termbuffer.c,v 1.4 2004/03/27 18:31:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: termbuffer.c,v 1.4.8.1 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 14,20 ****
int terminal_fd = 1; /* Standard output, later terminal ... */

static char outchar_write_buffer[2048];
! VOLATILE static char * buffer_ptr = &(outchar_write_buffer[0]);

/* Note that there is several race conditions -- losing of characters possible
(this may be called from signal handler)
--- 14,20 ----
int terminal_fd = 1; /* Standard output, later terminal ... */

static char outchar_write_buffer[2048];
! volatile static char * buffer_ptr = &(outchar_write_buffer[0]);

/* Note that there is several race conditions -- losing of characters possible
(this may be called from signal handler)
***************
*** 75,81 ****
FlushBuffer();

if (buffer_ptr < outchar_write_buffer + sizeof (outchar_write_buffer)) {
! VOLATILE char *p = buffer_ptr++;

*p = c;

--- 75,81 ----
FlushBuffer();

if (buffer_ptr < outchar_write_buffer + sizeof (outchar_write_buffer)) {
! volatile char *p = buffer_ptr++;

*p = c;

Index: elmME+.2.5.alpha5-cvs/src/screen/termcharset.c
*** elmME+.2.5.alpha4/src/screen/termcharset.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/termcharset.c 2005-07-20 19:49:51.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: termcharset.c,v 1.4 2004/03/27 18:31:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: termcharset.c,v 1.4.8.1 2005/07/20 16:49:51 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 11,17 ****
DEBUG_VAR(Debug,__FILE__,"elmpage");

charset_t target_display_charset = NULL;
- struct charset_state * last_state = NULL;
screen_info_p last_display_state = NULL;


--- 11,16 ----
***************
*** 54,63 ****
--- 53,115 ----
return 0;

target_display_charset = set;
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "set_display_charset: Initializes target_display_charset to %s\n",
+ target_display_charset->MIME_name ?
+ target_display_charset->MIME_name : ""));
+
+
switch_display_charset(1);
return 1;
}

+ void init_system_charset()
+ {

+ char *str;
+

+ /* Changes system_charset to type unknown if system supports
+ wide characters and there is DW flag on terminal.info
+ */
+ terminal_change_system_charset(terminal_type);
+
+ target_display_charset = system_charset;
+ display_charset = system_charset;
+
+ if (!last_display_state) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "init_system_charset: Creating terminal state\n"));
+
+ last_display_state = create_terminal_info();

+ }
+

+ /* if buffer is set to NULL, malloces result */
+ str = terminal_set_info(terminal_type,system_charset,last_display_state);
+
+ if (str) {

+ int i;
+

+ DPRINT(Debug,4,(&Debug,
+ "init_system_charset: Extra initialization for %s (",
+ system_charset->MIME_name ?
+ system_charset->MIME_name : "<no MIME name>"));
+ for (i = 0; str[i]; i++) {
+ DPRINT(Debug,4,(&Debug,
+ "%s%02X",
+ i ? " " : "", str[i]));
+ }
+ DPRINT(Debug,4,(&Debug,
+ ") for terminal %s\n",terminal_type));

+

+ for (i = 0; str[i]; i++) {

+ outchar(str[i]);
+ }
+
+ free(str);
+ }
+ }
+
+

void switch_display_charset(to_display)
int to_display;
{
***************
*** 66,77 ****
charset_t t;
char * str;

! if (!target_display_charset)
target_display_charset = display_charset;
!

- if (!last_display_state)
- last_display_state = create_terminal_info();


t = to_display ? target_display_charset : system_charset;
--- 118,137 ----
charset_t t;
char * str;

! if (!target_display_charset) {
target_display_charset = display_charset;
! SIGDPRINT(Debug,4,(&Debug,
! "switch_display_charset: Initializes target_display_charset to %s\n",
! target_display_charset->MIME_name ?

! target_display_charset->MIME_name : ""));
! }
!

! if (!last_display_state) {
! SIGDPRINT(Debug,4,(&Debug,
! "switch_display_charset: Creating terminal state\n"));
! last_display_state = create_terminal_info();
! }



t = to_display ? target_display_charset : system_charset;
***************
*** 82,89 ****
return;
}

! str = terminal_switch_to(terminal_type,t,&last_display_state,
! buffer, sizeof buffer);

if (str) {
int i;
--- 142,149 ----
return;
}

! str = terminal_switch_to(terminal_type,t,last_display_state,
! buffer, sizeof buffer, 1);

if (str) {
int i;

Index: elmME+.2.5.alpha5-cvs/src/screen/termtitle.c
*** elmME+.2.5.alpha4/src/screen/termtitle.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/termtitle.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: termtitle.c,v 1.4 2004/03/27 18:31:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: termtitle.c,v 1.4.8.1 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.4.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 20,31 ****
static char * title_quit_string = NULL;
static char * icon_quit_string = NULL;

! static CONST char ELM_EXITING[] = "Elm: exiting";

static char * title_suspended_string = NULL;
static char * icon_suspended_string = NULL;

! static CONST char ELM_SUSPENDED[] = "Elm: suspended";

int set_terminal_titles(title,icon)
char *title;
--- 20,31 ----
static char * title_quit_string = NULL;
static char * icon_quit_string = NULL;

! static const char ELM_EXITING[] = "Elm: exiting";

static char * title_suspended_string = NULL;
static char * icon_suspended_string = NULL;

! static const char ELM_SUSPENDED[] = "Elm: suspended";

int set_terminal_titles(title,icon)
char *title;
Index: elmME+.2.5.alpha5-cvs/src/screen/wrapper.c


*** /tmp/16095-very-long-file-name/NULL-16095-comes-in-here--XXXXXXXXX 2005-07-27 16:56:55.000000000 +0300

--- elmME+.2.5.alpha5-cvs/src/screen/wrapper.c 2005-07-26 11:28:46.000000000 +0300
***************


*** 0 ****
--- 1,280 ----

+ static char rcsid[] = "@(#)$Id: wrapper.c,v 1.7.32.2 2005/07/26 08:28:46 hurtta Exp $";
+
+ /******************************************************************************
+ * The Elm (ME+) Mail System - $Revision: 1.7.32.2 $ $State: Exp $
+ *
+ * Author: Kari Hurtta <hurtt...@posti.FMI.FI>
+ *****************************************************************************/
+

+ #include "def_screen.h"
+
+ DEBUG_VAR(Debug,__FILE__,"screen");

+
+ #if ANSI_C


+ #define S_(x) static x;
+ #else
+ #define S_(x)
+ #endif
+

+ static void CUR_init P_((struct menu_context *ctx));
+ static void CUR_init(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "CUR_init: %p\n",
+ ctx));
+

+ }
+

+ static void CUR_free P_((struct menu_context *ctx));
+ static void CUR_free(ctx)
+ struct menu_context *ctx;
+ {
+
+ DPRINT(Debug,10, (&Debug, "CUR_free: %p\n",
+ ctx));
+
+ }

+
+

+ static void CUR_Writechar P_((struct menu_context * ctx, int ch));
+ static void CUR_Writechar(ctx,ch)
+ struct menu_context * ctx;

+ int ch;
+ {
+ cur_Writechar(ch, NULL);
+ }
+

+ static void CUR_PutLineS P_((struct menu_context * ctx,
+ struct string *text));
+ static void CUR_PutLineS(ctx,text)
+ struct menu_context * ctx;

+ struct string *text;
+ {
+

+ cur_PutLineS(text,NULL);
+ }
+

+ static void CUR_PutLine0 P_((struct menu_context * ctx,
+ int x, int y,
+ const char *line));
+ static void CUR_PutLine0(ctx,x,y,line)
+ struct menu_context * ctx;

+ int x;
+ int y;
+ const char *line;
+ {
+ cur_PutLine0(x,y,line,NULL);
+ }
+

+ static void CUR_CleartoEOLN P_((struct menu_context * ctx));
+ static void CUR_CleartoEOLN(ctx)
+ struct menu_context * ctx;
+ {
+ cur_CleartoEOLN();

+ }
+

+ static void CUR_CleartoEOS P_((struct menu_context * ctx));
+ static void CUR_CleartoEOS(ctx)
+ struct menu_context * ctx;
+ {
+ cur_CleartoEOS();

+ }
+

+ static struct charset_state * CUR_ReadCh2 P_((struct menu_context *ctx,
+ int flags,
+ int break_flag));
+ static struct charset_state * CUR_ReadCh2(ctx,flags,break_flag)
+ struct menu_context *ctx;
+ int flags;
+ int break_flag;
+ {
+
+ return cur_ReadCh2(flags,break_flag);

+ }
+

+ static int CUR_ReadCh P_((struct menu_context *ctx,
+ int flags,
+ int break_flag));
+ static int CUR_ReadCh(ctx,flags,break_flag)
+ struct menu_context *ctx;
+ int flags;
+ int break_flag;
+ {
+ return cur_ReadCh(flags,break_flag);

+ }
+

+ static void CUR_ScreenSize P_((struct menu_context *ctx,
+ int *lines, int *columns));
+
+ static void CUR_ScreenSize(ctx,lines,columns)
+ struct menu_context *ctx;
+ int *lines;
+ int *columns;
+ {
+ cur_ScreenSize(lines,columns);
+
+ /* ? ? ? syncronize? */
+ ctx->lines = *lines;
+ ctx->columns = *columns;

+ }
+

+ static void CUR_GetXYLocation P_((struct menu_context *ctx,
+ int *x, int *y));
+ static void CUR_GetXYLocation(ctx,x,y)
+ struct menu_context *ctx;
+ int *x;
+ int *y;
+ {
+ cur_GetXYLocation(x,y);

+ }
+

+ static void CUR_ClearScreen P_((struct menu_context *ctx));
+ static void CUR_ClearScreen(ctx)
+ struct menu_context *ctx;
+ {
+ ctx->redraw = 0; /* cur_ClearScreen() clear flag from
+ default_context now */
+ cur_ClearScreen();

+ }
+

+ static void CUR_MoveCursor P_((struct menu_context *ctx,
+ int row, int col));
+ static void CUR_MoveCursor(ctx,row,col)
+ struct menu_context *ctx;
+ int row;
+ int col;
+ {
+ cur_MoveCursor(row, col,NULL);

+ }
+

+ static void CUR_changemode P_((struct menu_context *ctx,
+ int start, int end));
+ static void CUR_changemode(ctx,start,end)
+ struct menu_context *ctx;
+ int start;
+ int end;
+ {
+ cur_changemode(&ctx->modes, start, end);

+ }
+

+ static void CUR_SyncEnter P_((struct menu_context *ctx));
+ static void CUR_SyncEnter(ctx)
+ struct menu_context *ctx;
+ {
+ DPRINT(Debug,10, (&Debug,
+ "CUR_SyncEnter: %p: Setting mode=0x%02x row=%d col=%d\n",
+ ctx,ctx->modes,ctx->row,ctx->col));
+
+ /* Switch attributes */
+ cur_changemode(&CUR_modes,ctx->modes,CUR_modes);
+
+ /* Move cursor */
+ cur_MoveCursor(ctx->row,ctx->col,NULL);

+ }
+

+ static void CUR_SyncLeave P_((struct menu_context *ctx));
+ static void CUR_SyncLeave(ctx)
+ struct menu_context *ctx;
+ {
+ /* Remeber attributes */
+ ctx->modes |= CUR_modes;
+
+ /* disable attributes */
+ cur_changemode(&CUR_modes,0,ctx->modes);
+
+ /* Remember cursor location */
+
+ cur_GetXYLocation(&ctx->row, &ctx->col);
+
+ DPRINT(Debug,10, (&Debug,
+ "CUR_SyncLeave: %p: mode=0x%02x row=%d col=%d\n",
+ ctx,ctx->modes,ctx->row,ctx->col));

+
+ }
+

+ /* called from menu_resized() */
+ static void CUR_resized P_((struct menu_context *ctx));
+ static void CUR_resized(ctx)
+ struct menu_context *ctx;
+ {
+ ctx->lines = ROOT_MENU.lines;
+ ctx->columns = ROOT_MENU.columns;
+ ctx->changed = ROOT_MENU.changed; /* ? ? ? ? */

+ }
+

+ static void CUR_calculate_line P_((struct menu_context *ctx,
+ int rel_line, int *result));
+
+ static void CUR_calculate_line(ctx,rel_line,result)
+ struct menu_context *ctx;
+ int rel_line;
+ int *result;
+ {
+ *result = rel_line;

+ }
+

+ static void CUR_get_linelimit P_((struct menu_context *ctx,
+ int *startline, int *endline));
+ static void CUR_get_linelimit(ctx,startline,endline)

+ struct menu_context *ctx;
+ int *startline;

+ int *endline;
+ {
+ *startline = 0;
+
+ *endline = ctx->lines-1;
+ if (ROOT_MENU.lines <= *endline)
+ *endline = ROOT_MENU.lines-1;

+ }
+

+ /* called by need_redraw() */
+ static void CUR_reset_redraw P_((struct menu_context *ctx));
+ static void CUR_reset_redraw(ctx)
+ struct menu_context *ctx;
+ {
+ ctx->redraw = ROOT_MENU.redraw; /* ? ? ? ? */

+ }
+

+ static int CUR_do_redraw P_((struct menu_context *ctx));
+ static int CUR_do_redraw(ctx)
+ struct menu_context *ctx;

+ {
+ return 0;
+ }
+

+ };
+
+
+ /*

+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * buffer-file-coding-system: iso-8859-1
+ * End:
+ */

Index: elmME+.2.5.alpha5-cvs/src/showmsg.c
*** elmME+.2.5.alpha4/src/showmsg.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/showmsg.c 2005-07-23 22:01:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.36.8.3 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg.c,v 1.36.8.6 2005/07/23 19:01:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 18,23 ****
--- 18,24 ----

#include "def_elm.h"
#include "s_elm.h"


+ #include "s_me.h"

DEBUG_VAR(Debug,__FILE__,"ui");

***************

*** 26,39 ****
extern int errno;
#endif

! VOLATILE int pipe_abort = FALSE; /* not used anymore, but won't compile without it */
!
!
!
! void OverrideCharset(mailbox, header_page, page)
struct MailboxView *mailbox;


- int header_page;
struct menu_context *page;
{

int oldstat = 0, tagged = 0;
int current = get_current(mailbox);
--- 27,37 ----
extern int errno;
#endif


! void OverrideCharset(mailbox, page, prompt_area, header_area)

struct MailboxView *mailbox;
struct menu_context *page;

+ struct menu_context *prompt_area;
+ struct menu_context *header_area;
{

int oldstat = 0, tagged = 0;
int current = get_current(mailbox);
***************
*** 43,51 ****
int code;
charset_t res = NULL;
int mc,i;

! int LINES, COLUMNS;
!

! menu_get_sizes(page, &LINES, &COLUMNS);


if (chdr)
oldstat = chdr->status; /* remember */
--- 41,48 ----
int code;
charset_t res = NULL;
int mc,i;

! int delay_redraw = 0;

OE_SIG_CHAR /* Ctrl-C */,


sizeof override_charset, page);

switch(code) {
case REDRAW_MARK:
goto redraw;
case -1: /* Interrupt */
return;
case 1: /* EOF */
return;

case 0:
/* OK */
break;

default:
DPRINT(Debug,9,(&Debug, "optionally enter returned %d (unexpected)n",
code));
return;
}

if (! override_charset[0])
return;

--- 65,138 ----
else
strfcpy(override_charset,"none", sizeof override_charset);

! redraw:
if (tagged > 1)

! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideTagged,
! "Override charset of %d tagged messages. Use \"none\" to cancel override."),
! tagged);
else if (1 == tagged)

! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideTaggedOne,
! "Override charset of tagged message. Use \"none\" to cancel override."));
else if (chdr && chdr->override_charset)

! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideCurrentOver,
! "Override charset of current message. Use \"none\" to cancel override."));
else

! menu_print_format_center(prompt_area,1,
! CATGETS(elm_msg_cat, ElmSet,

! ElmOverrideCurrent,
! "Override charset of current message."));


+ /* FIXME --optionally_enter* should use prompt_area */
+ line = menu_GetAbsLine(prompt_area,2);
+
+ menu_PutLineX(page,line,0,CATGETS(elm_msg_cat, ElmSet, ElmOverrideCSprompt,
+ "Override charset: "));
code = optionally_enter(override_charset,-1,-1,OE_REDRAW_MARK|

OE_SIG_CHAR /* Ctrl-C */,


sizeof override_charset, page);

switch(code) {
case REDRAW_MARK:

+ menu_ClearScreen(page); /* Reset possible redraw flag */

+ delay_redraw++; /* Can't trigger redraw yet... */
+

goto redraw;
case -1: /* Interrupt */

+ if (delay_redraw)
+ menu_trigger_redraw(page);

+ menu_trigger_redraw(prompt_area);
+
return;
case 1: /* EOF */

+ if (delay_redraw)
+ menu_trigger_redraw(page);

+ menu_trigger_redraw(prompt_area);
+
return;


case 0:
/* OK */
break;

default:


+ if (delay_redraw)
+ menu_trigger_redraw(page);

+ menu_trigger_redraw(prompt_area);
+
DPRINT(Debug,9,(&Debug, "optionally enter returned %d (unexpected)n",
code));
return;
}

+ if (delay_redraw)
+ menu_trigger_redraw(page);

+ menu_trigger_redraw(prompt_area);
+
if (! override_charset[0])
return;

***************
*** 157,165 ****
for (i=0; i < mc; i++) { /* get each tagged msg */
struct header_rec * hdr = give_header(mailbox,i);
if (hdr && ison(hdr->status, TAGGED)) {

- struct menu_common MENU;


- set_mcommon_from_mbxview(&MENU,mailbox);

hdr->override_charset = res;

--- 176,182 ----
***************
*** 168,174 ****
mime_classify_media(&(hdr->mime_rec),hdr);

clearit(hdr->status, TAGGED);
! show_new_status(i,&MENU,header_page); /* update screen, if needed */


}
--- 185,200 ----
mime_classify_media(&(hdr->mime_rec),hdr);

clearit(hdr->status, TAGGED);
!
! if (header_area) {

! struct menu_common MENU;
! int vis;
!

! set_mcommon_from_mbxview(&MENU,mailbox);


!
! vis = compute_visible(i+1, &MENU);

! menu_header_status_update(header_area,vis-1);
! }


}
***************
*** 180,185 ****
--- 206,270 ----
}


+ struct screen_parts2 {
+ struct menu_context * title_area;

+ struct menu_context * prompt_area;
+ };
+

+ static void set_prompt_screen P_((struct menu_context *page, struct screen_parts2 *LOC, int current));
+ static void set_prompt_screen(page,LOC,current)

+ struct menu_context *page;

+ struct screen_parts2 *LOC;
+ int current;

+ {
+ int LINES, COLUMNS;

+ int C = 5;


+
+ menu_get_sizes(page,&LINES, &COLUMNS);
+

+ if (title_messages && current > 0) {
+ C = 7;
+ }

+
+ /* 1) Title part of screen */
+

+ if (! LOC->title_area)
+ LOC->title_area = new_menu_subpage(page,0,C,
+ subpage_simple_noredraw,NULL);
+ else
+ menu_subpage_relocate(LOC->title_area,page,0,C);
+
+

+ /* 2) Prompt part of screen */
+

+ if (! LOC->prompt_area)
+ LOC->prompt_area = new_menu_subpage(page,C,LINES-C,
+ subpage_simple_noredraw,NULL);
+ else
+ menu_subpage_relocate(LOC->title_area,page,C,LINES-C);

+ }
+

+ static void free_prompt_screen P_((struct screen_parts2 *LOC));
+ static void free_prompt_screen(LOC)
+ struct screen_parts2 *LOC;
+ {
+ erase_menu_context (&(LOC->title_area));
+ erase_menu_context (&(LOC->prompt_area));

+ }
+

+ static void redraw_prompt_screen P_((struct menu_context *page));
+ static void redraw_prompt_screen(page)

+ struct menu_context *page;
+ {
+ menu_ClearScreen(page);


+
+ /* Call refresh routines of children */
+ menu_redraw_children(page);
+

+ show_last_error();
+ }
+
+
/* Returns 0 on quit */

struct prompt_list {
***************
*** 189,227 ****
int col;
};

! static void update_prompt P_((struct prompt_list ** list, int *list_len,
! int *current_offset, int idx,

struct menu_context *page));


! static void update_prompt (list,list_len,current_offset,idx,page)
! struct prompt_list ** list;
! int *list_len;
! int *current_offset;
int idx;

! struct menu_context *page; /* new context assumed */
{


int LINES, COLUMNS;
!
! menu_get_sizes(page,&LINES, &COLUMNS);



if (idx < 0) {
int i;

! *current_offset = 0;
menu_ClearScreen(page);

- print_format_center(1,


- CATGETS(elm_msg_cat, ElmSet, ElmMailcapMenu,
- "Mailcap program selection"));
-
for (i = *current_offset;
i >= 0 &&
i < *current_offset - 2 + LINES / 3 &&
i < *list_len;
i++)
! update_prompt(list,list_len,current_offset,i, page);

} else if (idx >= 0 &&
idx >= *current_offset &&
--- 274,435 ----
int col;
};

! struct update_params {
! struct prompt_list ** list;
! int *list_len;
! int *current_offset;

! };
!

! static void update_prompt P_((struct update_params *P,

! int idx,
struct menu_context *page));

!

! static void prompt_Z P_((struct menu_context *page,
! int ask_metamail));
! static void prompt_Z(page,ask_metamail)

! struct menu_context *page;
! int ask_metamail;


! {
! int lin,col;
!

! menu_get_sizes(page, &lin,&col);
!
! if (ask_metamail)
! menu_PutLineX(page,
! lin-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapPage,
! "Press enter for default, use m)etamail or p)age mail: "));
! else
! menu_PutLineX(page,
! lin-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapDone,

! "Press enter for default or use y/n, use m)etamail or d)one: "));
!
! }
!

! static void check_prompt_screen P_((struct screen_parts2 *LOC,
! struct update_params *P,
! int ask_metamail,
! int current,
! int message_count,
! struct header_rec *hdr));
! static void check_prompt_screen(LOC,P,ask_metamail,current,message_count,hdr)
! struct screen_parts2 *LOC;
! struct update_params *P;
! int ask_metamail;
! int current;
! int message_count;

! struct header_rec *hdr;


! {
!
! /* 1) Title part of screen */
! if (menu_resized(LOC->title_area)) {
! DPRINT(Debug,1, (&Debug, "title area resized\n"));

!
! }
!

! if (menu_need_redraw(LOC->title_area)) {
! int X = 1;
!

! DPRINT(Debug,7, (&Debug, "title area redraw\n"));
!

! menu_ClearScreen(LOC->title_area);
!
! if (title_messages && current > 0) {
! int li,co;
! struct string *T;
!
! menu_get_sizes(LOC->title_area,&li,&co);
!
! X = 3;
!
! T = title_text(hdr,current,message_count,
! co,
! display_charset);
!
! menu_PutLineX(LOC->title_area,0,0,FRM("%S"),T);
! free_string(&T);
!
!
! if (hdr->subject)
! menu_print_format_center(LOC->title_area,1,
! FRM("%S"),
! hdr->subject);

!
! }
!

! if (ask_metamail) {
! menu_print_format_center(LOC->title_area,X,
! CATGETS(elm_msg_cat, ElmSet, ElmMetamailMenu,
! "Metamail selection"));
!
! menu_PutLineX(LOC->title_area,X+2,0,
! CATGETS(elm_msg_cat, ElmSet, ElmMetamailMenu1,
! "Viewing of this message requires metamail. Press 'm' to select metamail."));
! menu_PutLineX(LOC->title_area,X+3,0,
! CATGETS(elm_msg_cat, ElmSet, ElmMetamailMenu2,

! "Or you can p)age message without metamail."));
!
! } else {


! menu_print_format_center(LOC->title_area,X,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapMenu,
! "Mailcap program selection"));
!
! menu_PutLineX(LOC->title_area,X+2,0,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapMenu1,
! "Viewing of this message requires external programs (press 'y' to confirm.)"));
!
! menu_PutLineX(LOC->title_area,X+3,0,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapMenu2,

! "To refuse external program press 'n'. Also you can page message with m)etamail."));


!
!
! }
! }
!

! /* 2) Prompt part of screen */
!

! if (menu_resized(LOC->prompt_area)) {
! DPRINT(Debug,1, (&Debug, "prompt area resized\n"));

!
! }
!

! if (menu_need_redraw(LOC->prompt_area)) {
!

! DPRINT(Debug,7, (&Debug, "prompt area redraw\n"));
!

! update_prompt(P,-1, LOC->prompt_area);
!
! prompt_Z(LOC->prompt_area,ask_metamail);

! }
! }
!

! static void update_prompt (P,idx,page)
! struct update_params *P;
int idx;

! struct menu_context *page;
{

CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
"Yes."));

else
! PutLineX(X,(*list)[idx].col,

! CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
}

free_string(&S1);
--- 462,474 ----
(*list)[idx].selected) {

if ((*list)[idx].structure->handler_data->use_entry)
! menu_PutLineX(page,X,(*list)[idx].col,

CATGETS(elm_msg_cat, ElmSet, ElmYesWord,
"Yes."));

else
! menu_PutLineX(page,X,(*list)[idx].col,

! CATGETS(elm_msg_cat, ElmSet, ElmNoWord,
! "No."));
}

free_string(&S1);
***************
*** 340,346 ****

i = (*list_len)++;

! update_prompt(list,list_len,current_offset,i,page);
}
}

--- 548,561 ----

i = (*list_len)++;

! {
! struct update_params P;
! P.list = list;
! P.list_len = list_len;
! P.current_offset = current_offset;
! update_prompt(&P,i,page);
! }
!
}
}

***************
*** 379,624 ****
}
}

! /* return TRUE if metamail is used instead */
! static int prompt_programs P_((struct mimeinfo *structure));
! static int prompt_programs(structure)
! struct mimeinfo *structure;
{
int r = TRUE;

struct prompt_list * list = NULL;
int list_len = 0;

int offset = 0;



struct menu_context *page = new_menu_context();

- int LINES, COLUMNS;
-

- menu_get_sizes(page, &LINES, &COLUMNS);


! update_prompt(&list,&list_len,&offset,-1, page);
!
! prompt_programs_1(structure,&list,&list_len,&offset, page);

! if (list_len > 0) {
! int q = 0;
! int ch;

! /* Check if all programs was trusted ... */

! while (q < list_len &&
! list[q].selected &&
! list[q].structure &&
! list[q].structure->handler_data &&
! list[q].structure->handler_data->use_entry)
! q++;
!
! r = FALSE;

! if (q >= list_len && !internal_mailcap_t_prompt)
! goto out;
!

! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,
! "Answer questions, use m)etamail or q)uit menu: "));

! do {
! int defans;

! resize_mark:
! defans = *def_ans_no;

! if (menu_resized(page)) {

! menu_get_sizes(page, &LINES, &COLUMNS);
}

! if (menu_need_redraw(page))
! goto redraw;
!

! if (q >= list_len) {

! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,
! "Answer questions, use m)etamail or q)uit menu: "));
! defans = 'q';

!
! } else {

! int X = (q - offset) * 3 + 3;
!
! if (X <= 1) {
! offset = q-1;
! if (offset < 0)
! offset = 0;
! ch = REDRAW_MARK;

! goto redraw;
! }


! if (X >= LINES-2) {
! offset = q;
! ch = REDRAW_MARK;

! goto redraw;
! }


! MoveCursor(X,list[q].col);
}
!

! CleartoEOLN(); /* Clear current answer */

! Write_to_screen(FRM("%c%c"),defans,BACKSPACE);
FlushBuffer();
!
!

! ch = menu_ReadCh(page,REDRAW_MARK|READCH_CURSOR|READCH_resize);

! if (ch == '\n')
! ch = defans;

! switch (ch) {


! case RESIZE_MARK:
!
! DPRINT(Debug,4, (&Debug," .... resizing\n"));
! goto resize_mark;
!
! case REDRAW_MARK:
! redraw:
! update_prompt(&list,&list_len,&offset,-1, page);
!
! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,

! "Answer questions, use m)etamail or q)uit menu: "));
! break;
!

! case '-':
! case LEFT_MARK:
! case PAGEUP_MARK:
! offset -= LINES / 3 - 2;
! if (offset < 0)
! offset = 0;
! q = offset;

! goto redraw;
!

! case '+':
! case RIGHT_MARK:
! case PAGEDOWN_MARK:
!
! offset += LINES / 3 - 2;
! if (offset >= list_len);
! offset = list_len-1;
! q = offset;

! goto redraw;
!

! case DOWN_MARK:
! if (q < list_len) {
! update_prompt(&list,&list_len,&offset,q, page);
! q++;

! }
! break;
!

! case UP_MARK:
! if (q < list_len)
! update_prompt(&list,&list_len,&offset,q, page);
! if (q > 0)
! q--;

! break;
!
! case 'q':
ch = 0;
!

! if (q < list_len)
! update_prompt(&list,&list_len,&offset,q, page);
!
! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,

! "Answer questions, use m)etamail or q)uit menu: "));


!
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
! ElmQuit,
! "Quit"));

!
! break;
!

! case 'm':
!
! if (q < list_len)
! update_prompt(&list,&list_len,&offset,q, page);
!
! PutLineX(LINES-2,1,
! CATGETS(elm_msg_cat, ElmSet, ElmMailcapQuit,

! "Answer questions, use m)etamail or q)uit menu: "));
!
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,


! ElmMetamail,
! "Metamail"));
!
! if (have_metamail()) {
! ch = 0;
! r = TRUE;

! }
!
! break;
}
!

! if (q < list_len) {

! if (ch == *def_ans_yes) {
! list[q].selected = 1;
! list[q].structure->handler_data->use_entry = 1;
! update_prompt(&list,&list_len,&offset,q, page);
! q++;

! } else if (ch == *def_ans_no) {
!

! list[q].selected = 1;
! list[q].structure->handler_data->use_entry = 0;
! update_prompt(&list,&list_len,&offset,q, page);
! q++;

!
! }
! }
!

int result = 0;


! if ((hdr->status & (MIME_MESSAGE)) && (hdr->status & MIME_UNSUPPORTED))
! result = have_metamail();
!
/* Do not call metamail if Disposition is not inline */
! else if ((hdr->status & MIME_MESSAGE) &&
! hdr->mime_rec.disposition != DISP_INLINE)
result = FALSE;
else if (hdr->status & (MIME_MESSAGE | PRE_MIME_CONTENT)) {

--- 594,911 ----
}
}

! /* return TRUE if metamail is used instead,
! -1 to cancel
! */
! static int prompt_programs P_((struct header_rec *hdr, int ask_metamail,
! int current, int message_count));
! static int prompt_programs(hdr, ask_metamail, current, message_count)

! struct header_rec *hdr;


! int ask_metamail;
! int current;
! int message_count;
{
int r = TRUE;
+ struct mimeinfo *structure = &(hdr->mime_rec);

struct prompt_list * list = NULL;
int list_len = 0;

int offset = 0;



struct menu_context *page = new_menu_context();

+ struct screen_parts2 LOC = { NULL, NULL };
+ struct update_params P;


+ int q = 0;

+ int ch = '\0';



! if (ask_metamail)
! ask_metamail = have_metamail();

! P.list = &list;
! P.list_len = &list_len;
! P.current_offset = &offset;

! set_prompt_screen(page,&LOC,current);

! redraw_prompt_screen(page);
!
! prompt_programs_1(structure,&list,&list_len,&offset, LOC.prompt_area);

! check_prompt_screen(&LOC,&P,ask_metamail, current,message_count,hdr);

! /* Check if all programs was trusted ... */
!
! while (q < list_len &&
! list[q].selected &&
! list[q].structure &&
! list[q].structure->handler_data &&
! list[q].structure->handler_data->use_entry)
! q++;
!
! r = FALSE;

! if (q >= list_len && !internal_mailcap_t_prompt)
! goto out;

!
! do {


! int defans;
! int sel = q;
!
! resize_mark:
! defans = *def_ans_no;
!
! if (menu_resized(page)) {
! set_prompt_screen(page,&LOC,current);
! }
!
! if (menu_need_redraw(page))

! goto redraw;
!

! /* Search first not selected entry */
! while (sel < list_len &&
! list[sel].selected)
! sel++;

! if (q >= list_len) {
!
! prompt_Z(LOC.prompt_area,ask_metamail);
!
! defans = ask_metamail ? 'm' : 'd';

!
! } else {

! FlushBuffer();
!
!

! ch = menu_ReadCh(LOC.prompt_area,REDRAW_MARK|READCH_CURSOR|
! READCH_resize|READCH_sig_char);

!

! if (ch == '\n')
! ch = defans;

!
! switch (ch) {


! case TERMCH_interrupt_char:
! r=-1;
! goto failure;
! case 'i':
! case 'q':
! menu_Write_to_screen(LOC.prompt_area,

! CATGETS(elm_msg_cat, ElmSet,


! ElmQuit,
! "Quit"));
! FlushBuffer();

! r=-1;
! goto failure;

! case RESIZE_MARK:
!
! DPRINT(Debug,4, (&Debug," .... resizing\n"));
! goto resize_mark;
!
! case REDRAW_MARK:
! redraw:
!
! redraw_prompt_screen(page);

!
! break;
!

! case 'd':
! done:
! ch = 0;
!

! if (q < list_len)
! update_prompt(&P,q, LOC.prompt_area);
!
! prompt_Z(LOC.prompt_area,ask_metamail);
!
! menu_Write_to_screen(LOC.prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmDone,
! "Done"));
FlushBuffer();

! break;

! case 'm':


! if (q < list_len)
! update_prompt(&P,q, LOC.prompt_area);

! prompt_Z(LOC.prompt_area,ask_metamail);
!
! menu_Write_to_screen(LOC.prompt_area,
! CATGETS(elm_msg_cat, ElmSet,
! ElmMetamail,
! "Metamail"));

! if (have_metamail()) {
ch = 0;
! r = TRUE;
}
!
! break;
!

! case 'p':
! if (q < list_len)
! update_prompt(&P,q, LOC.prompt_area);
!
! if (sel >= list_len)
! goto done;
! q = sel;
! ask_metamail = 0;
!
! menu_trigger_redraw(LOC.prompt_area);
! menu_trigger_redraw(LOC.title_area);

!
! break;
!
!

! }
!
! if (q < list_len) {
!

! if (ch == *def_ans_yes) {
! list[q].selected = 1;
! list[q].structure->handler_data->use_entry = 1;
! update_prompt(&P,q, LOC.prompt_area);
! q++;

! } else if (ch == *def_ans_no) {

! list[q].selected = 1;
! list[q].structure->handler_data->use_entry = 0;
! update_prompt(&P,q, LOC.prompt_area);
! q++;

!
! }
! }
!

int result = 0;

int current, message_count;
! struct menu_context *page;
{


/*** Display number'th message. Get starting and ending lines
of message from headers data structure, then fly through
--- 931,941 ----
return result;
}

! int show_msg(current_header, infile, current,message_count, pager_page)
struct header_rec *current_header;
FILE *infile;

int current, message_count;
! struct pager_page *pager_page;
{


/*** Display number'th message. Get starting and ending lines
of message from headers data structure, then fly through
***************
*** 660,669 ****



! int is_need_meta = 0;

! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES, &COLUMNS);

DPRINT(Debug,4,(&Debug,
"displaying %d lines from message #%d\n",
--- 949,974 ----



! int is_need_meta = 0;

! int LINES, COLUMNS;
!

! menu_get_sizes(pager_page->root,&LINES, &COLUMNS);
!
! /* erase showmsg_c border line and prompt area */
!
! if (pager_page->border_line)
! erase_menu_context( &(pager_page->border_line));
! if (pager_page->prompt_area)
! erase_menu_context( &(pager_page->prompt_area));

!
! #if 0


! /* Do not erase screen on here, copying mail may take long time
! lefting screen empty before it can be displayed
! */
!
! menu_ClearScreen(pager_page->root);
! #endif
!

DPRINT(Debug,4,(&Debug,
"displaying %d lines from message #%d\n",
***************

*** 680,706 ****


current_header->status_chgd = TRUE;
}



- is_need_meta = need_meta(current_header);
-
if (is_need_meta) {
char fname[STRING], Cmd[SLEN];
int err;
FILE *fpout;

elm_sfprintf(fname, sizeof fname,


! FRM("%semm.%d.%d"), temp_dir, getpid(), getuid());

if ((fpout = safeopen_rdwr(fname)) == NULL) {

err = errno;
DPRINT(Debug,1,(&Debug,
"Error: open of temporary file %s, errno %s (show_message)\n",
! fname, error_description(err)));


lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCantOpenAsOutputFile,
"Can't open \"%s\" as output file! (%s)."),

! fname, error_description(err));
return(0);
}
/* Let metamail decode it!
--- 985,1018 ----


current_header->status_chgd = TRUE;
}

+ is_need_meta = need_meta(current_header,current,message_count);
+ if (is_need_meta < 0) {

+ return 0;
+ }


if (is_need_meta) {
char fname[STRING], Cmd[SLEN];
int err;
FILE *fpout;

+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+

+ if (!tmp)
+ return 0;
+

elm_sfprintf(fname, sizeof fname,


! FRM("%semm.%d.%d"), tmp, getpid(), getuid());

if ((fpout = safeopen_rdwr(fname)) == NULL) {

err = errno;
DPRINT(Debug,1,(&Debug,
"Error: open of temporary file %s, errno %s (show_message)\n",
! fname, strerror(err)));


lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmCantOpenAsOutputFile,
"Can't open \"%s\" as output file! (%s)."),

! fname, strerror(err));
return(0);
}
/* Let metamail decode it!

***************
*** 719,727 ****
elm_sfprintf(Cmd, sizeof Cmd,
FRM("%s -p -z -m Elm %s"),
metamail_path, fname);
! Raw(OFF);
! ClearScreen();
! printf ("Executing metamail...\n");
system_call(Cmd, SY_ENAB_SIGINT|SY_ENV_METAMAIL, NULL);
(void) unlink (fname);

--- 1031,1050 ----
elm_sfprintf(Cmd, sizeof Cmd,
FRM("%s -p -z -m Elm %s"),
metamail_path, fname);
!
! {
! struct menu_context *xpage;
!
! xpage = Raw(OFF);
!
! menu_ClearScreen(xpage);
! menu_Write_to_screen(xpage,
! CATGETS(elm_msg_cat, MeSet,
! MeExecuteMetamail,

! "Executing metamail...\n"));
! FlushBuffer();
! }
!

system_call(Cmd, SY_ENAB_SIGINT|SY_ENV_METAMAIL, NULL);
(void) unlink (fname);

***************
*** 732,745 ****
redraw:
menu_get_sizes(cpage,&LINES, &COLUMNS);

! PutLineX(LINES-1,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyIndex,

! "Press any key to return to index."));


if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK)
goto redraw;

! printf("\r\n");
Raw(OFF | NO_TITE); /* Raw off so raw on takes effect */
}

--- 1055,1069 ----
redraw:
menu_get_sizes(cpage,&LINES, &COLUMNS);

! menu_PutLineX(cpage,
! LINES-1,0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyIndex,

! "Press any key to return to index."));


if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK)
goto redraw;

Kari E. Hurtta

unread,
Jul 28, 2005, 12:37:26 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.20

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 20/20 ) =========
Index: elmME+.2.5.alpha5-cvs/utils/elmstringconvert.c
*** elmME+.2.5.alpha4/utils/elmstringconvert.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/elmstringconvert.c 2005-07-23 22:01:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.8.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmstringconvert.c,v 1.8.8.5 2005/07/23 19:01:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.5 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 48,53 ****
--- 48,54 ----
char * res;
int reslen;
int written;


+ int errors = 0;

if ('\n' == buffer[line_len-1])
count++;
***************
*** 61,67 ****
count+1,name,buffer);
}

! l = add_streambytes_to_string(in_str,line_len,s2us(buffer));

if (l < line_len) {
DPRINT(Debug,7,(&Debug,
--- 62,68 ----
count+1,name,buffer);
}

! l = add_streambytes_to_string(in_str,line_len,s2us(buffer),&errors);

if (l < line_len) {
DPRINT(Debug,7,(&Debug,
***************
*** 72,78 ****
count,name,buffer);
errcount++;
}
!
out_str = convert_string(target_charset,in_str,0);

bytestream_from_string(out_str,&res,&reslen);
--- 73,84 ----
count,name,buffer);
errcount++;
}
! if (errors) {
! DPRINT(Debug,7,(&Debug,
! "Feeding of line failed: %d errors\n",
! errors));
! errcount += errors;
! }
out_str = convert_string(target_charset,in_str,0);

bytestream_from_string(out_str,&res,&reslen);
***************
*** 113,119 ****
int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),
! argv[optind], error_description(errcode));
errcount++;
continue;
}
--- 119,125 ----
int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),
! argv[optind], strerror(errcode));
errcount++;
continue;
}
***************
*** 123,129 ****
int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),
! argv[optind], error_description(errcode));
errcount++;
continue;
}
--- 129,135 ----
int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),
! argv[optind], strerror(errcode));
errcount++;
continue;
}
***************
*** 151,156 ****
--- 157,163 ----

static char version_buff[NLEN];



+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 229,235 ****
if (errcode != ENOENT) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! targetfile, error_description(errcode));
err++;
goto fail;
}
--- 236,242 ----
if (errcode != ENOENT) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! targetfile, strerror(errcode));
err++;
goto fail;
}
***************
*** 296,302 ****
if (errcode) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(errcode));

err++;
free(tmp);
--- 303,309 ----
if (errcode) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(errcode));

err++;
free(tmp);
***************
*** 307,313 ****
int errcode = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(errcode));

err++;
free(tmp);
--- 314,320 ----
int errcode = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(errcode));

err++;
free(tmp);
***************
*** 327,333 ****
int errcode = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(errcode));

unlink(tmp);

--- 334,340 ----
int errcode = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(errcode));

unlink(tmp);

***************
*** 339,345 ****
int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! targetfile, error_description(errcode));

err++;
free(tmp);
--- 346,352 ----
int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! targetfile, strerror(errcode));

err++;
free(tmp);
Index: elmME+.2.5.alpha5-cvs/utils/elmterminal.c
*** elmME+.2.5.alpha4/utils/elmterminal.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/elmterminal.c 2005-07-26 11:28:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.13.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmterminal.c,v 1.13.8.8 2005/07/26 08:28:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.8 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 16,26 ****
extern char *optarg;
extern int optind;

! char * program_name = "elmterminal";
int register_fd = -1;

static char version_buff[NLEN];



int main(argc, argv)
int argc;
char *argv[];

--- 16,28 ----
extern char *optarg;
extern int optind;

! const char * program_name = "elmterminal";
int register_fd = -1;
+ char * register_module = NULL;

static char version_buff[NLEN];



+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 65,71 ****
if (errcode != ENOENT) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! targetfile, error_description(errcode));
err++;
goto fail;
}
--- 67,73 ----
if (errcode != ENOENT) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! targetfile, strerror(errcode));
err++;
goto fail;
}
***************
*** 88,101 ****
Debug output of the ELMTERMINAL program (version %s).\n",
version_buff);

- #if 0
if (d >= 50) {
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

- lower_prompt("WARNING: Debug file may include passwords -- edit it!");
- sleep(5+sleepmsg);
}
! #endif
}
#endif

--- 90,100 ----
Debug output of the ELMTERMINAL program (version %s).\n",
version_buff);

if (d >= 50) {
panic_dprint("WARNING: Edit manually out sensitive information from that file!\n");

}
!
}
#endif

***************
*** 128,134 ****
if (errcode) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(errcode));

err++;
free(tmp);
--- 127,133 ----
if (errcode) {


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(errcode));

err++;
free(tmp);
***************
*** 139,145 ****
int errcode = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(errcode));

err++;
free(tmp);
--- 138,144 ----
int errcode = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(errcode));

err++;
free(tmp);
***************
*** 150,156 ****
int errcode = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, error_description(errcode));

err++;
free(tmp);
--- 149,155 ----
int errcode = errno;


lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! tmp, strerror(errcode));

err++;
free(tmp);
***************
*** 160,166 ****
int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! targetfile, error_description(errcode));

err++;
free(tmp);
--- 159,165 ----
int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! targetfile, strerror(errcode));

err++;
free(tmp);
Index: elmME+.2.5.alpha5-cvs/utils/elmunidata.c
*** elmME+.2.5.alpha4/utils/elmunidata.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/elmunidata.c 2005-07-26 11:28:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.18.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmunidata.c,v 1.18.8.7 2005/07/26 08:28:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 15,27 ****
#include "reghelper.h"

int register_fd = -1;
! char * program_name = "elmunidata";

extern char *optarg;
extern int optind;

static char version_buff[NLEN];



int main(argc, argv)
int argc;
char *argv[];

--- 15,29 ----
#include "reghelper.h"

int register_fd = -1;
! const char * program_name = "elmunidata";
! char * register_module = NULL;

extern char *optarg;
extern int optind;

static char version_buff[NLEN];



+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 139,146 ****
goto fail;
}
if (logfile) {
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeFileParsed,
! "%s parsed"),
argv[optind]);
putc('\n',logfile);
}
--- 141,149 ----
goto fail;
}
if (logfile) {
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeFileParsed,
! "%s parsed"),
argv[optind]);
putc('\n',logfile);
}
***************
*** 167,175 ****

if (logfile) {
if (err) {
! fprintf(logfile,catgets(elm_msg_cat, MeSet, MeProgFailed,
! "%s failed; exit code=%d"),
! argv[0],err);
putc('\n',logfile);
}
fclose(logfile);
--- 170,179 ----

if (logfile) {
if (err) {
! elm_fprintf(logfile,
! CATGETS(elm_msg_cat, MeSet, MeProgFailed,
! "%s failed; exit code=%d"),
! argv[0],err);
putc('\n',logfile);
}
fclose(logfile);
Index: elmME+.2.5.alpha5-cvs/utils/fastmail.c
*** elmME+.2.5.alpha4/utils/fastmail.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/fastmail.c 2005-07-23 22:01:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.30.8.2 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: fastmail.c,v 1.30.8.4 2005/07/23 19:01:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.30.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 44,49 ****
--- 44,50 ----
**/

#include "def_utils.h"
+ #include "mailerlib.h"
#include "s_fastmail.h"

#if 0
***************
*** 52,59 ****

#define temphome "/tmp/fastmail."

! char *get_arpa_date();
! static void usage();



static unsigned char *s2us P_((char *str));
static unsigned char *s2us(str)

--- 53,60 ----

#define temphome "/tmp/fastmail."

!
! static void usage P_((void));



static unsigned char *s2us P_((char *str));
static unsigned char *s2us(str)

***************
*** 84,90 ****
lib_error(CATGETS(elm_msg_cat, FastmailSet, FastmailFailErrno,


"Failed: %.30s: %.40s"),
get_mailer_path(fd.mail_fd),
! error_description(rs->save_errno));
else if (exit_code) {
lib_error(

CATGETS(elm_msg_cat, FastmailSet,
--- 85,91 ----
lib_error(CATGETS(elm_msg_cat, FastmailSet, FastmailFailErrno,


"Failed: %.30s: %.40s"),
get_mailer_path(fd.mail_fd),
! strerror(rs->save_errno));
else if (exit_code) {
lib_error(

CATGETS(elm_msg_cat, FastmailSet,
***************
*** 98,104 ****
lib_error(CATGETS(elm_msg_cat, FastmailSet, FastmailLostErrno,


"%.30s lost: %.40s"),
get_mailer_path(fd.mail_fd),
! error_description(rs->save_errno));
}
}

--- 99,105 ----
lib_error(CATGETS(elm_msg_cat, FastmailSet, FastmailLostErrno,


"%.30s lost: %.40s"),
get_mailer_path(fd.mail_fd),
! strerror(rs->save_errno));
}
}

***************

*** 154,162 ****
free_addr_items(TMP);
}

-
static char version_buff[NLEN];



int main(argc, argv)
int argc;
char *argv[];

--- 155,163 ----
free_addr_items(TMP);
}

static char version_buff[NLEN];



+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 202,207 ****
--- 203,210 ----

user_init();
init_defaults();
+ init_mailerlib();
+
read_rc_file(0);

mailer_info = get_mailer_info();
Index: elmME+.2.5.alpha5-cvs/utils/from.c
*** elmME+.2.5.alpha4/utils/from.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/from.c 2005-07-26 11:28:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: from.c,v 1.48.8.5 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: from.c,v 1.48.8.9 2005/07/26 08:28:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.48.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 101,112 ****
int *selected,
char *realname));

- #ifndef ANSI_C


- struct passwd *getpwuid();
- #endif
-

static char version_buff[NLEN];



int main(argc, argv)
int argc;
char *argv[];

--- 101,109 ----
int *selected,
char *realname));

static char version_buff[NLEN];



+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 118,123 ****
--- 115,122 ----
char realname[SLEN];
int TreatAsSpool = 0;

+ int df = give_dt_enumerate_as_int(&def_folder_status);
+
extern int optind;
extern char *optarg;

***************
*** 253,259 ****

infile[0] = '\0';

! if (no_files = (optind == argc)) { /* assignment intentional */


char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");

if (!default_val)
--- 252,260 ----

infile[0] = '\0';

! if (
! (no_files = (optind == argc))
! ){ /* assignment intentional */


char * default_val = give_dt_estr_as_str(&defaultfile_e,"incoming-mailbox");

if (!default_val)
***************
*** 267,273 ****
for ( ; optind < argc; optind++) {


struct folder_info *folder = NULL;

struct read_folder_state * read_state_ptr = NULL;
! CONST char *msg;

enum sessionlock_mode m;

/* copy next argument into infile */
--- 268,274 ----
for ( ; optind < argc; optind++) {


struct folder_info *folder = NULL;

struct read_folder_state * read_state_ptr = NULL;
! const char *msg;

enum sessionlock_mode m;

/* copy next argument into infile */
***************
*** 351,357 ****
m = SESSIONLOCK_NONE;
if ((selct == NEW_MSG) &&
FOLDER_FILE == get_folder_mode(folder) &&
! FOLDER_STATUS_NEW != def_folder_status) {


lib_error(CATGETS(elm_msg_cat,
--- 352,358 ----
m = SESSIONLOCK_NONE;
if ((selct == NEW_MSG) &&
FOLDER_FILE == get_folder_mode(folder) &&
! FOLDER_STATUS_NEW != df) {


lib_error(CATGETS(elm_msg_cat,
***************
*** 365,371 ****


if (!sessionlock_folder(folder,m)) {
! CONST char * X = folder_type(folder);
lib_error(CATGETS(elm_msg_cat,FromSet,FromCouldntOpenX,
"Couldn't open %s \"%s\".\n"), X,infile);
goto clean;
--- 366,372 ----


if (!sessionlock_folder(folder,m)) {
! const char * X = folder_type(folder);
lib_error(CATGETS(elm_msg_cat,FromSet,FromCouldntOpenX,
"Couldn't open %s \"%s\".\n"), X,infile);
goto clean;
***************
*** 376,384 ****
}

if ((msg = is_forwarded_folder(folder,read_state_ptr)) != NULL) {
! printf(catgets(elm_msg_cat, ElmSet, ElmMailBeingForwardTo,
! "Mail being forwarded to %s"),
! msg);
putchar('\n');
} else {
int user_mailbox =
--- 377,385 ----
}

if ((msg = is_forwarded_folder(folder,read_state_ptr)) != NULL) {
! elm_fprintf(stdout,CATGETS(elm_msg_cat, ElmSet, ElmMailBeingForwardTo,
! "Mail being forwarded to %s"),
! msg);
putchar('\n');
} else {
int user_mailbox =
***************
*** 397,454 ****
/* no messages at all? */
if (total_msgs == 0) {
if (user_mailbox)
! printf(catgets(elm_msg_cat,FromSet,FromStringNoMail,
! "%s no mail.\n"),
! whos_mail(infile, realname));
else
if (!summarize) {
if (get_folder_mode(folder) & FOLDER_MBOX)
! printf(catgets(elm_msg_cat,FromSet,
! FromNoMesgInMailbox,
! "No messages in that mailbox!\n"));

else
! printf(catgets(elm_msg_cat,FromSet,
! FromNoMesgInFolder,
! "No messages in that folder!\n"));
}
}
else
/* no selected messages then? */
if (selected_msgs == 0) {
if (user_mailbox)
! printf(catgets(elm_msg_cat,FromSet,FromNoExplainMail,
! "%s no %s mail.\n"),
! whos_mail(infile, realname),
! explain(selct,NEG));
else
if (!summarize) {
if (get_folder_mode(folder) & FOLDER_MBOX)
! printf(catgets(elm_msg_cat,
! FromSet,FromNoExplainMessagesMbox,
! "No %s messages in that mailbox.\n"),
! explain(selct,NEG));
else
! printf(catgets(elm_msg_cat,
! FromSet,FromNoExplainMessages,
! "No %s messages in that folder.\n"),
! explain(selct,NEG));
}
}
else
/* there's mail, but we just want a one-liner */
if (quiet && !summarize) {
if (user_mailbox)
! printf(catgets(elm_msg_cat,
! FromSet,FromStringStringMail,
! "%s %s mail.\n"),
! whos_mail(infile,realname),
! explain(selct,POS));
else
! printf(catgets(elm_msg_cat,FromSet,
! FromThereAreMesg,
! "There are %s messages in that folder.\n"),
! explain(selct,POS));
}
}

--- 398,463 ----
/* no messages at all? */
if (total_msgs == 0) {
if (user_mailbox)
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromStringNoMail,
! "%s no mail.\n"),
! whos_mail(infile, realname));
else
if (!summarize) {
if (get_folder_mode(folder) & FOLDER_MBOX)
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,
! FromNoMesgInMailbox,
! "No messages in that mailbox!\n"));

else
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,
! FromNoMesgInFolder,
! "No messages in that folder!\n"));
}
}
else
/* no selected messages then? */
if (selected_msgs == 0) {
if (user_mailbox)
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromNoExplainMail,
! "%s no %s mail.\n"),
! whos_mail(infile, realname),
! explain(selct,NEG));
else
if (!summarize) {
if (get_folder_mode(folder) & FOLDER_MBOX)
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,
! FromSet,FromNoExplainMessagesMbox,
! "No %s messages in that mailbox.\n"),
! explain(selct,NEG));
else
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,
! FromSet,FromNoExplainMessages,
! "No %s messages in that folder.\n"),
! explain(selct,NEG));
}
}
else
/* there's mail, but we just want a one-liner */
if (quiet && !summarize) {
if (user_mailbox)
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,
! FromSet,FromStringStringMail,
! "%s %s mail.\n"),
! whos_mail(infile,realname),
! explain(selct,POS));
else
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,
! FromThereAreMesg,
! "There are %s messages in that folder.\n"),
! explain(selct,POS));
}
}

***************
*** 666,684 ****
if (verbose && selected_msgs == 0) {
if (user_mailbox) {
if (selct == ALL_MSGS)
! printf(catgets(elm_msg_cat,FromSet,FromFollowingMesg,
! "%s the following mail messages:\n"),
! whos_mail(infile, realname));
else
! printf(catgets(elm_msg_cat,FromSet,FromStringStringMail,
! "%s %s mail.\n"), whos_mail(infile, realname),
! explain(selct,POS));
}
else
! printf(catgets(elm_msg_cat,
! FromSet,FromFolderContainsFollowing,
! "Folder contains the following %s messages:\n"),
! explain(selct,POS));
}

selected_msgs++;
--- 675,696 ----
if (verbose && selected_msgs == 0) {
if (user_mailbox) {
if (selct == ALL_MSGS)
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromFollowingMesg,
! "%s the following mail messages:\n"),
! whos_mail(infile, realname));
else
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromStringStringMail,
! "%s %s mail.\n"), whos_mail(infile, realname),
! explain(selct,POS));
}
else
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,
! FromSet,FromFolderContainsFollowing,
! "Folder contains the following %s messages:\n"),
! explain(selct,POS));
}

selected_msgs++;
***************
*** 739,746 ****
if (user_mailbox)
printf("%s ", whos_mail(infile, realname));
else
! printf(catgets(elm_msg_cat,FromSet,FromFolderContains,
! "Folder contains "));

for (i=0; i<ALL_MSGS; i++) {
if (summary[i] > 0) {
--- 751,758 ----
if (user_mailbox)
printf("%s ", whos_mail(infile, realname));
else
! elm_fprintf(stdout,CATGETS(elm_msg_cat,FromSet,FromFolderContains,
! "Folder contains "));

for (i=0; i<ALL_MSGS; i++) {
if (summary[i] > 0) {
***************
*** 784,791 ****
if (output)
printf(".\n");
else
! printf(catgets(elm_msg_cat,FromSet,FromNoMessages,
! "no messages.\n"));
}
}

--- 796,804 ----
if (output)
printf(".\n");
else
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromNoMessages,
! "no messages.\n"));
}
}

***************
*** 826,844 ****
static void usage(prog)
char *prog;
{
! printf(catgets(elm_msg_cat,FromSet,FromUsage,
! "Usage: %s [-n] [-v] [-t] [-s {new|old|read}] [filename | username] ...\n"),
! prog);
}

static void print_help()
{

! printf(catgets(elm_msg_cat,FromSet,FromHelpTitle,
! "frm -- list from and subject lines of messages in mailbox or folder\n"));

usage("frm");
! printf(catgets(elm_msg_cat,FromSet,FromHelpText,
"\noption summary:\n\
-h\tprint this help message.\n\
-n\tdisplay the message number of each message printed.\n\
--- 839,859 ----
static void usage(prog)
char *prog;
{
! lib_error(CATGETS(elm_msg_cat,FromSet,FromUsage,
! "Usage: %s [-n] [-v] [-t] [-s {new|old|read}] [filename | username] ...\n"),
! prog);
}

static void print_help()
{

! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromHelpTitle,
! "frm -- list from and subject lines of messages in mailbox or folder\n"));

usage("frm");
! elm_fprintf(stdout,
! CATGETS(elm_msg_cat,FromSet,FromHelpText,
"\noption summary:\n\
-h\tprint this help message.\n\
-n\tdisplay the message number of each message printed.\n\
Index: elmME+.2.5.alpha5-cvs/utils/Makefile.SH
*** elmME+.2.5.alpha4/utils/Makefile.SH 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/Makefile.SH 2005-07-20 19:49:52.000000000 +0300
***************
*** 13,22 ****


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac

echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.34.38.4 2004/11/02 19:36:17 hurtta Exp $
#


# Makefile for the Elm system utilities
#

--- 13,25 ----


*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac

+ libx="../libs/libelmme-base.a ../libs/libelmme-mailer.a"
+ libxs="../shlib/libelmme-base.so ../shlib/libelmme-mailer.so"
+

echo "Extracting utils/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
#!$make
! # @(#)$Id: Makefile.SH,v 1.34.38.5 2005/07/20 16:49:52 hurtta Exp $
#


# Makefile for the Elm system utilities
#
***************

*** 279,358 ****

# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
! .PRECIOUS: def_utils.h $(INCLDIR)/elm_defs.h $(INCLDIR)/defs_major.h ../lib/libutil.a

checkalias: checkalias.SH ; sh $?
listalias: listalias.SH ; sh $?
messages: messages.SH ; sh $?
printmail: printmail.SH ; sh $?

! $(BIN)/answer: $(ANSWER_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ANSWER_OBJ) ../lib/libutil.a $(LIB2)

answer_lint: $(ANSWER_SRC)
$(LINT) $(LINTFLAGS) $(ANSWER_SRC) >> LINT.OUT

! $(BIN)/elmalias: $(ELMALIAS_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMALIAS_OBJ) ../lib/libutil.a $(LIB2)

elmalias_lint: $(ELMALIAS_SRC)
$(LINT) $(LINTFLAGS) $(ELMALIAS_SRC) >> LINT.OUT

! $(BIN)/fastmail: $(FASTMAIL_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(FASTMAIL_OBJ) ../lib/libutil.a $(LIB2)

fastmail_lint: $(FASTMAIL_SRC)
$(LINT) $(LINTFLAGS) $(FASTMAIL_SRC) >> LINT.OUT

! $(BIN)/frm: $(FRM_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(FRM_OBJ) ../lib/libutil.a $(LIB2)

frm_lint: $(FRM_SRC)
$(LINT) $(LINTFLAGS) $(FRM_SRC) >> LINT.OUT

! $(BIN)/newalias: $(NEWALIAS_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(NEWALIAS_OBJ) ../lib/libutil.a $(LIB2)

newalias_lint: $(NEWALIAS_SRC)
$(LINT) $(LINTFLAGS) $(NEWALIAS_SRC) >> LINT.OUT

! $(BIN)/newmail: $(NEWMAIL_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(NEWMAIL_OBJ) ../lib/libutil.a $(LIB2)

newmail_lint: $(NEWMAIL_SRC)
$(LINT) $(LINTFLAGS) $(NEWMAIL_SRC) >> LINT.OUT

! $(BIN)/readmsg: $(READMSG_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(READMSG_OBJ) ../lib/libutil.a $(LIB2)

readmsg_lint: $(READMSG_SRC)
$(LINT) $(LINTFLAGS) $(READMSG_SRC) >> LINT.OUT

! $(BIN)/prlong: $(PRLONG_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(PRLONG_OBJ) ../lib/libutil.a $(LIB2)

prlong_lint: $(PRLONG_SRC)
$(LINT) $(LINTFLAGS) $(PRLONG_SRC) >> LINT.OUT

! $(BIN)/elmcharset: $(ELMCHARSET_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMCHARSET_OBJ) ../lib/libutil.a $(LIB2)

! $(BIN)/elmrc-write: $(ELMRCWRITE_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMRCWRITE_OBJ) ../lib/libutil.a $(LIB2)


! $(BIN)/elmterminal: $(ELMTERMINAL_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMTERMINAL_OBJ) ../lib/libutil.a $(LIB2)


! $(BIN)/elmunidata: $(ELMUNIDATA_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMUNIDATA_OBJ) ../lib/libutil.a $(LIB2)

! $(BIN)/elmbindata: $(ELMBINDATA_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMBINDATA_OBJ) ../lib/libutil.a $(LIB2)

! $(BIN)/elmstringconvert: $(ELMSCONV_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMSCONV_OBJ) ../lib/libutil.a $(LIB2)

../lib/putenv.o:
cd ../lib; $(MAKE) putenv.o
--- 282,362 ----

# Dependencies and rules
# Dependencies and rules for compiling and linting C programs
! .PRECIOUS: def_utils.h $(INCLDIR)/elm_defs.h $(INCLDIR)/defs_major.h

checkalias: checkalias.SH ; sh $?
listalias: listalias.SH ; sh $?
messages: messages.SH ; sh $?
printmail: printmail.SH ; sh $?

! $(BIN)/answer: $(ANSWER_OBJ) ../libs/libelmme-base.a ../libs/libelmme-mailer.a
! $(CC) $(LFLAGS) -o $@ $(ANSWER_OBJ) ../libs/libelmme-base.a ../libs/libelmme-mailer.a $(LIB2)

answer_lint: $(ANSWER_SRC)
$(LINT) $(LINTFLAGS) $(ANSWER_SRC) >> LINT.OUT

! $(BIN)/elmalias: $(ELMALIAS_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMALIAS_OBJ) ../libs/libelmme-base.a $(LIB2)

elmalias_lint: $(ELMALIAS_SRC)
$(LINT) $(LINTFLAGS) $(ELMALIAS_SRC) >> LINT.OUT

! $(BIN)/fastmail: $(FASTMAIL_OBJ) ../libs/libelmme-base.a ../libs/libelmme-mailer.a
! $(CC) $(LFLAGS) -o $@ $(FASTMAIL_OBJ) \
! ../libs/libelmme-base.a ../libs/libelmme-mailer.a $(LIB2)

fastmail_lint: $(FASTMAIL_SRC)
$(LINT) $(LINTFLAGS) $(FASTMAIL_SRC) >> LINT.OUT

! $(BIN)/frm: $(FRM_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(FRM_OBJ) ../libs/libelmme-base.a $(LIB2)

frm_lint: $(FRM_SRC)
$(LINT) $(LINTFLAGS) $(FRM_SRC) >> LINT.OUT

! $(BIN)/newalias: $(NEWALIAS_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(NEWALIAS_OBJ) ../libs/libelmme-base.a $(LIB2)

newalias_lint: $(NEWALIAS_SRC)
$(LINT) $(LINTFLAGS) $(NEWALIAS_SRC) >> LINT.OUT

! $(BIN)/newmail: $(NEWMAIL_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(NEWMAIL_OBJ) ../libs/libelmme-base.a $(LIB2)

newmail_lint: $(NEWMAIL_SRC)
$(LINT) $(LINTFLAGS) $(NEWMAIL_SRC) >> LINT.OUT

! $(BIN)/readmsg: $(READMSG_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(READMSG_OBJ) ../libs/libelmme-base.a $(LIB2)

readmsg_lint: $(READMSG_SRC)
$(LINT) $(LINTFLAGS) $(READMSG_SRC) >> LINT.OUT

! $(BIN)/prlong: $(PRLONG_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(PRLONG_OBJ) ../libs/libelmme-base.a $(LIB2)

prlong_lint: $(PRLONG_SRC)
$(LINT) $(LINTFLAGS) $(PRLONG_SRC) >> LINT.OUT

! $(BIN)/elmcharset: $(ELMCHARSET_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMCHARSET_OBJ) ../libs/libelmme-base.a $(LIB2)

! $(BIN)/elmrc-write: $(ELMRCWRITE_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMRCWRITE_OBJ) ../libs/libelmme-base.a $(LIB2)


! $(BIN)/elmterminal: $(ELMTERMINAL_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMTERMINAL_OBJ) ../libs/libelmme-base.a $(LIB2)


! $(BIN)/elmunidata: $(ELMUNIDATA_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMUNIDATA_OBJ) ../libs/libelmme-base.a $(LIB2)

! $(BIN)/elmbindata: $(ELMBINDATA_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMBINDATA_OBJ) ../libs/libelmme-base.a $(LIB2)

! $(BIN)/elmstringconvert: $(ELMSCONV_OBJ) ../libs/libelmme-base.a
! $(CC) $(LFLAGS) -o $@ $(ELMSCONV_OBJ) ../libs/libelmme-base.a $(LIB2)

../lib/putenv.o:
cd ../lib; $(MAKE) putenv.o
***************
*** 362,369 ****
$(BIN)/elmregister: elmregister.o reghelper.o ../lib/putenv.o $(STROBJ)
$(CC) $(LFLAGS) -o $@ elmregister.o reghelper.o \
../lib/putenv.o $(STROBJ)
! $(BIN)/elmlibregister: $(ELMLIBREG_OBJ) ../lib/libutil.a
! $(CC) $(LFLAGS) -o $@ $(ELMLIBREG_OBJ) ../lib/libutil.a $(LIB2)

# Rules to make shell scripts in bin directory
$(BIN)/checkalias: checkalias
--- 366,373 ----
$(BIN)/elmregister: elmregister.o reghelper.o ../lib/putenv.o $(STROBJ)
$(CC) $(LFLAGS) -o $@ elmregister.o reghelper.o \
../lib/putenv.o $(STROBJ)
! $(BIN)/elmlibregister: $(ELMLIBREG_OBJ) ../libs/libelmme-base.a ../libs/libelmme-mailer.a
! $(CC) $(LFLAGS) -o $@ $(ELMLIBREG_OBJ) ../libs/libelmme-mailer.a ../libs/libelmme-base.a $(LIB2)

# Rules to make shell scripts in bin directory
$(BIN)/checkalias: checkalias
***************
*** 399,411 ****


$(TOUCH) $@

# Dependencies of C object files

! prlong.o: def_utils.h
! answer.o: def_utils.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_answer.h $(INCLDIR)/sysdefs.h
elmalias.o: def_utils.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_elmalias.h
! fastmail.o: def_utils.h $(INCLDIR)/s_fastmail.h
from.o: def_utils.h $(INCLDIR)/s_from.h $(INCLDIR)/s_elm.h
newalias.o: def_utils.h $(INCLDIR)/s_newalias.h
newmail.o: def_utils.h $(INCLDIR)/s_newmail.h
readmsg.o: def_utils.h $(INCLDIR)/s_readmsg.h
elmcharset.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h charmapcopy.h
--- 403,416 ----


$(TOUCH) $@

# Dependencies of C object files

! answer.o: def_utils.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_answer.h \
! $(INCLDIR)/sysdefs.h $(INCLDIR)/mailerlib.h
elmalias.o: def_utils.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_elmalias.h
! fastmail.o: def_utils.h $(INCLDIR)/s_fastmail.h $(INCLDIR)/mailerlib.h
from.o: def_utils.h $(INCLDIR)/s_from.h $(INCLDIR)/s_elm.h
newalias.o: def_utils.h $(INCLDIR)/s_newalias.h
newmail.o: def_utils.h $(INCLDIR)/s_newmail.h
+ prlong.o: def_utils.h
readmsg.o: def_utils.h $(INCLDIR)/s_readmsg.h
elmcharset.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/cs_imp.h $(INCLDIR)/reghelper.h charmapcopy.h
***************
*** 420,432 ****
$(INCLDIR)/bindata.h $(INCLDIR)/reghelper.h $(INCLDIR)/cs_imp.h \
charmapcopy.o
elmstringconvert.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
! elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h $(INCLDIR)/reghelper.h
reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
$(INCLDIR)/reghelper.h
! charmapcopy.o: charmapcopy.h $(INCLDIR)/s_elm.h $(INCLDIR)/elm_defs.h $(INCLDIR)/s_me.h $(INCLDIR)/reghelper.h
elmlibregister.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
! $(INCLDIR)/reghelper.h

# Dependencies and rules for installing programs from bin directory

--- 425,439 ----
$(INCLDIR)/bindata.h $(INCLDIR)/reghelper.h $(INCLDIR)/cs_imp.h \
charmapcopy.o
elmstringconvert.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h
! elmregister.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
! $(INCLDIR)/reghelper.h
reghelper.o: $(INCLDIR)/defs_major.h $(INCLDIR)/patchlevel.h \
$(INCLDIR)/reghelper.h
! charmapcopy.o: charmapcopy.h $(INCLDIR)/s_elm.h $(INCLDIR)/elm_defs.h \
! $(INCLDIR)/s_me.h $(INCLDIR)/reghelper.h
elmlibregister.o: def_utils.h $(INCLDIR)/s_me.h $(INCLDIR)/s_elm.h \
$(INCLDIR)/rc_imp.h $(INCLDIR)/save_opts.h $(INCLDIR)/s_elmrc.h \
! $(INCLDIR)/reghelper.h $(INCLDIR)/mailerlib.h

# Dependencies and rules for installing programs from bin directory

***************
*** 454,473 ****

!NO!SUBS!



if $test "$d_shared" = "$define" ; then

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/answer-shared: $(ANSWER_OBJ) ../shlib/libelmme-base.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ANSWER_OBJ) ../shlib/libelmme-base.so $(LIB2)


$(BIN)/elmalias-shared: $(ELMALIAS_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMALIAS_OBJ) ../shlib/libelmme-base.so $(LIB2)


! $(BIN)/fastmail-shared: $(FASTMAIL_OBJ) ../shlib/libelmme-base.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(FASTMAIL_OBJ) ../shlib/libelmme-base.so $(LIB2)


$(BIN)/frm-shared: $(FRM_OBJ) ../shlib/libelmme-base.so
--- 461,489 ----

!NO!SUBS!


+ for i in $libx
+ do
+ y="`echo $i|$sed 's%^../%%'`"

+ cat >>Makefile <<!SUBS!


+ $i:
+ cd ..; \$(MAKE) \$(MJ) \$(MFLAGS) $y

+ !SUBS!
+ done
+

if $test "$d_shared" = "$define" ; then

cat >>Makefile <<'!NO!SUBS!'

! $(BIN)/answer-shared: $(ANSWER_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ANSWER_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so $(LIB2)


$(BIN)/elmalias-shared: $(ELMALIAS_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMALIAS_OBJ) ../shlib/libelmme-base.so $(LIB2)


! $(BIN)/fastmail-shared: $(FASTMAIL_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(FASTMAIL_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so $(LIB2)


$(BIN)/frm-shared: $(FRM_OBJ) ../shlib/libelmme-base.so
***************
*** 492,499 ****
$(BIN)/elmrc-write-shared: $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so $(LIB2)

! $(BIN)/elmlibregister-shared: $(ELMLIBREG_OBJ) ../shlib/libelmme-base.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMLIBREG_OBJ) ../shlib/libelmme-base.so $(LIB2)

$(BIN)/elmterminal-shared: $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so $(LIB2)
--- 508,515 ----
$(BIN)/elmrc-write-shared: $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMRCWRITE_OBJ) ../shlib/libelmme-base.so $(LIB2)

! $(BIN)/elmlibregister-shared: $(ELMLIBREG_OBJ) ../shlib/libelmme-base.so ../shlib/libelmme-mailer.so
! $(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMLIBREG_OBJ) ../shlib/libelmme-mailer.so ../shlib/libelmme-base.so $(LIB2)

$(BIN)/elmterminal-shared: $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so
$(CC) $(LFLAGS) -o $@ $(RPATH) $(ELMTERMINAL_OBJ) ../shlib/libelmme-base.so $(LIB2)
***************
*** 559,564 ****
--- 575,589 ----

!NO!SUBS!


+ for i in $libxs
+ do
+ y="`echo $i|$sed 's%^../%%'`"

+ cat >>Makefile <<!SUBS!


+ $i:
+ cd ..; \$(MAKE) \$(MJ) \$(MFLAGS) $y

+ !SUBS!
+ done
+

else

cat >>Makefile <<'!NO!SUBS!'
Index: elmME+.2.5.alpha5-cvs/utils/newalias.c
*** elmME+.2.5.alpha4/utils/newalias.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/newalias.c 2005-07-20 19:49:52.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newalias.c,v 1.15.8.2 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newalias.c,v 1.15.8.3 2005/07/20 16:49:52 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 33,44 ****
#include "def_utils.h"
#include "s_newalias.h"

- void error();
-

extern int is_system; /* system file updating? */

static char version_buff[NLEN];



int main(argc, argv)
int argc;
char *argv[];

--- 33,43 ----
#include "def_utils.h"
#include "s_newalias.h"



extern int is_system; /* system file updating? */

static char version_buff[NLEN];



+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 126,139 ****
/*NOTREACHED*/
}

- void
- error(err_message)
- char *err_message;
- {
- fflush(stdout);
- fprintf(stderr, "\n%s\n", err_message);
- return;
- }

/*
* Local Variables:
--- 125,130 ----
Index: elmME+.2.5.alpha5-cvs/utils/newmail.c
*** elmME+.2.5.alpha4/utils/newmail.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/newmail.c 2005-07-23 20:14:21.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35.8.5 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: newmail.c,v 1.35.8.7 2005/07/23 17:14:21 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 105,118 ****

#define metachar(c) (c == '+' || c == '=' || c == '%')

- char *getusername();
- long bytes();
-
struct folder_struct {
struct folder_info *F;
char prefix[NLEN];
int access_error;
! } folder_list[MAX_FOLDERS] = {0};

static int read_headers P_((register struct folder_struct *cur_folder,
struct read_folder_state * read_state_ptr));
--- 105,115 ----

#define metachar(c) (c == '+' || c == '=' || c == '%')

struct folder_struct {
struct folder_info *F;
char prefix[NLEN];
int access_error;
! } folder_list[MAX_FOLDERS];

static int read_headers P_((register struct folder_struct *cur_folder,
struct read_folder_state * read_state_ptr));
***************
*** 165,170 ****
--- 162,168 ----

static char version_buff[NLEN];



+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 262,268 ****
}
#endif

! if (interval_time < 10)
if (interval_time == 1)
lib_error(CATGETS(elm_msg_cat, NewmailSet, NewmailShort,
"Warning: interval set to 1 second. I hope you know what you're doing!\n"));
--- 260,266 ----
}
#endif

! if (interval_time < 10) {
if (interval_time == 1)
lib_error(CATGETS(elm_msg_cat, NewmailSet, NewmailShort,
"Warning: interval set to 1 second. I hope you know what you're doing!\n"));
***************
*** 270,275 ****
--- 268,274 ----
lib_error(CATGETS(elm_msg_cat, NewmailSet, NewmailShortPlur,
"Warning: interval set to %d seconds. I hope you know what you're doing!\n"),
interval_time);
+ }

/* now let's parse the foldernames, if any are given */

***************
*** 814,820 ****


/** return the number of bytes in the specified file. This

is to check to see if new mail has arrived.... **/

- extern int errno; /* system error number! */
struct stat buffer;

if (stat(name, &buffer) != 0)
--- 813,818 ----
***************
*** 836,857 ****

}

- char *getusername()
- {
- /** Getting the username on some systems is a real pain, so...
- This routine is guaranteed to return a usable username **/
-
- char *return_value, *getlogin(), *cuserid();
-
- if ((return_value = getlogin()) == NULL)
- if ((return_value = cuserid(NULL)) == NULL) {
- lib_error(CATGETS(elm_msg_cat, NewmailSet, NewmailErrUsername,
- "Newmail: I can't get username!\n"));
- exit(1);
- }
-
- return( (char *) return_value);
- }

static void usage(name)
char *name;
--- 834,839 ----
Index: elmME+.2.5.alpha5-cvs/utils/prlong.c
*** elmME+.2.5.alpha4/utils/prlong.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/prlong.c 2005-07-20 19:49:53.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11.8.3 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: prlong.c,v 1.11.8.4 2005/07/20 16:49:53 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.11.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 57,67 ****
char inbuf[1024]; /* space to hold an input record */
char outbuf[4096]; /* space to accumulate output record */

! int calc_col(); /* calculate output column position */

!
! void usage_error(prog)
! char *prog;
{
fprintf(stderr,
"usage: %s [-w wid] [-1 first_leader] [-l leader] [-f sep]\n", prog);
--- 57,68 ----
char inbuf[1024]; /* space to hold an input record */
char outbuf[4096]; /* space to accumulate output record */

! /* calculate output column position */
! static int calc_col P_((int col, char *s));

! static void usage_error P_((char *prog));
! static void usage_error(prog)
! char *prog;
{
fprintf(stderr,
"usage: %s [-w wid] [-1 first_leader] [-l leader] [-f sep]\n", prog);
***************
*** 70,75 ****
--- 71,77 ----

static char version_buff[NLEN];



+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 208,216 ****
}


! int calc_col(col, s)
! register int col;
! register char *s;
{


while (*s != '\0') {

switch (*s) {
--- 210,218 ----
}


! static int calc_col(col, s)
! register int col;
! register char *s;
{


while (*s != '\0') {

switch (*s) {
Index: elmME+.2.5.alpha5-cvs/utils/readmsg.c
*** elmME+.2.5.alpha4/utils/readmsg.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/readmsg.c 2005-07-26 11:28:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.18.8.4 2004/09/26 15:18:33 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: readmsg.c,v 1.18.8.8 2005/07/26 08:28:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.18.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 128,137 ****
/*
* local procedures
*/
- void weed_headers P_((char *buf));
- void setup_weed_info P_((const char *sel_weed_str));

! char *skip_word();

static int print_patmatch_mssg P_((FILE *fp,
char *pat,
--- 128,136 ----
/*
* local procedures
*/

! static void weed_headers P_((char *buf));
! static void setup_weed_info P_((const char *sel_weed_str));

static int print_patmatch_mssg P_((FILE *fp,
char *pat,
***************
*** 145,152 ****
extern int optind; /* .. starting arguments */


!
! void usage_error()
{
lib_error(CATGETS(elm_msg_cat, ReadmsgSet, ReadmsgUsage,
"Usage: %s [-anhp] [-f Folder] [-w weedlist] {MessageNum ... | pattern | *}\n"),
--- 144,151 ----
extern int optind; /* .. starting arguments */


! static void usage_error P_((void));
! static void usage_error()
{
lib_error(CATGETS(elm_msg_cat, ReadmsgSet, ReadmsgUsage,
"Usage: %s [-anhp] [-f Folder] [-w weedlist] {MessageNum ... | pattern | *}\n"),
***************
*** 154,160 ****
exit(1);
}

! void malloc_fail_handler(proc, size)
char *proc;
unsigned size;
{
--- 153,161 ----
exit(1);
}

! static void malloc_fail_handler P_((char *proc,
! unsigned size));
! static void malloc_fail_handler(proc, size)
char *proc;
unsigned size;
{
***************
*** 225,230 ****
--- 226,232 ----

static char version_buff[NLEN];



+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 237,243 ****
int do_all_matches; /* true to show all mssgs which match pat*/
int ign_no_request; /* terminate if no actions requested */
int exit_status; /* normally zero, set to one on error */
! FILE *fp; /* file stream for opened folder */
long idx; /* seek offset within folder */
char *sel_weed_str; /* header weeding specification */
char buf[SLEN];
--- 239,245 ----
int do_all_matches; /* true to show all mssgs which match pat*/
int ign_no_request; /* terminate if no actions requested */
int exit_status; /* normally zero, set to one on error */
! FILE *fp = NULL; /* file stream for opened folder */
long idx; /* seek offset within folder */
char *sel_weed_str; /* header weeding specification */
char buf[SLEN];
***************
*** 719,726 ****
}

/* just accumulate newlines */
! if (buf[0] == '\n' && buf[1] == '\0' ||
! buf[0] == '\r' && buf[1] == '\n' && buf[2] == '\0') {
if (in_header) {
in_header = FALSE;
}
--- 721,730 ----
}

/* just accumulate newlines */
! if ((buf[0] == '\n' && buf[1] == '\0')
! ||
! (buf[0] == '\r' && buf[1] == '\n' && buf[2] == '\0')
! ) {
if (in_header) {
in_header = FALSE;
}
***************
*** 778,785 ****
* line should (at least in some cases) continue to the next line, but we
* don't handle that.
*/
! void weed_headers(buf)
! char *buf;
{
struct weed_header_info *w;
static int accept_header = FALSE;
--- 782,790 ----
* line should (at least in some cases) continue to the next line, but we
* don't handle that.
*/
!
! static void weed_headers(buf)
! char *buf;
{
struct weed_header_info *w;
static int accept_header = FALSE;
***************
*** 806,812 ****
* The header weeding info is a linked list of (struct weed_header_info).
*/
void setup_weed_info(sel_weed_str)
! CONST char *sel_weed_str;
{
struct weed_header_info *w;
char *weed_str, *fld, *s;
--- 811,817 ----
* The header weeding info is a linked list of (struct weed_header_info).
*/
void setup_weed_info(sel_weed_str)
! const char *sel_weed_str;
{
struct weed_header_info *w;
char *weed_str, *fld, *s;
***************
*** 828,834 ****
w->next = (struct weed_header_info *)
safe_malloc(sizeof(struct weed_header_info));
w = w->next;
! if (w->hdrskip = (*fld == '!'))
++fld;
w->hdrname = fld;
w->hdrlen = strlen(fld);
--- 833,841 ----
w->next = (struct weed_header_info *)
safe_malloc(sizeof(struct weed_header_info));
w = w->next;
! if (
! (w->hdrskip = (*fld == '!'))
! )
++fld;
w->hdrname = fld;
w->hdrlen = strlen(fld);
***************
*** 872,889 ****
}


- /*
- * Advance to the start of the next word.
- */
- char *skip_word(str)
- char *str;
- {
- while (*str != '\0' && !isspace(*str))
- ++str;
- while (isspace(*str))
- ++str;
- return str;
- }

/*
* Local Variables:
--- 879,884 ----
Index: elmME+.2.5.alpha5-cvs/utils/reghelper.c
*** elmME+.2.5.alpha4/utils/reghelper.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/utils/reghelper.c 2005-07-26 11:28:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reghelper.c,v 1.6 2004/03/27 18:31:49 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: reghelper.c,v 1.6.8.3 2005/07/26 08:28:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 90,96 ****


register_fd = fd;
!
}

void log_config(file)
--- 90,96 ----


register_fd = fd;
! register_module = getenv("ELM_MODULE");
}

void log_config(file)
***************
*** 101,126 ****
file++;

if (register_fd != -1)
! log_it("C",file,"-","-",0);
}

! void log_it(letter,target_r,user,group,mode)
! char * letter;
! char * target_r;
! char * user;
! char * group;
int mode;
{
int l_letter = strlen(letter);
int l_target = strlen(target_r);
int l_user = strlen(user);
int l_group = strlen(group);

char buffer[ MAX_PIPE_LOG];
char *ptr;
char mode_s[6];

! int L = 14 + l_letter + l_target + l_user + l_group;

sprintf(mode_s,"%05o",mode);

--- 101,128 ----
file++;

if (register_fd != -1)
! log_it("C",file,"-","-",0, register_module);
}

! void log_it(letter,target_r,user,group,mode, module)
! const char * letter;
! const char * target_r;
! const char * user;
! const char * group;
int mode;
+ const char * module;
{
int l_letter = strlen(letter);
int l_target = strlen(target_r);
int l_user = strlen(user);
int l_group = strlen(group);
+ int l_module = module ? strlen(module) : 0;

char buffer[ MAX_PIPE_LOG];
char *ptr;
char mode_s[6];

! int L = 17 + l_letter + l_target + l_user + l_group + l_module;

sprintf(mode_s,"%05o",mode);

***************
*** 132,137 ****
--- 134,144 ----

ptr = buffer;

+ if (module) {
+ add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);
+ add_to_buffer(buffer, sizeof buffer,&ptr,module,l_module);
+ }
+
add_to_buffer(buffer, sizeof buffer,&ptr,letter,l_letter);
add_to_buffer(buffer, sizeof buffer,&ptr,user,l_user);
add_to_buffer(buffer, sizeof buffer,&ptr,group,l_group);
***************
*** 190,200 ****
char *buffer;
size_t blen;
char **ptr;
! char *str;
int s_len;
{
char *p = *ptr;
! char *s = str;
int abt = 0;

if (p < buffer || p >= buffer +blen) {
--- 197,207 ----
char *buffer;
size_t blen;
char **ptr;
! const char *str;
int s_len;
{
char *p = *ptr;
! const char *s = str;
int abt = 0;

if (p < buffer || p >= buffer +blen) {

Kari E. Hurtta

unread,
Jul 28, 2005, 12:36:51 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.19

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 19/20 ) =========
Index: elmME+.2.5.alpha5-cvs/src/showmsg_c.c
*** elmME+.2.5.alpha4/src/showmsg_c.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/showmsg_c.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.35.8.2 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 1.35.8.5 2005/07/26 08:28:45 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.5 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

***************
*** 60,70 ****



! int showmsg_main_cmd(mailbox,cmd,screen_mangled, page)


struct MailboxView *mailbox;
int cmd;
! int *screen_mangled;
! struct menu_context *page;
{
struct menu_common MENU;

--- 60,69 ----



! int showmsg_main_cmd(mailbox,cmd, pager_page)

struct MailboxView *mailbox;
int cmd;
! struct pager_page *pager_page;
{
struct menu_common MENU;

***************

*** 73,103 ****
switch (cmd) {
case '?' :

! help(TRUE, page);
!
! if (menu_need_redraw(page)) {


! menu_ClearScreen(page);
! build_bottom(&MENU,page);
! } else
! *screen_mangled = TRUE;
return 256;

case '|' : {
int current = get_current(mailbox);

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmPipe, "Pipe"),
! TRUE, &MENU, page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))

! do_pipe(mailbox, page);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

! menu_ClearScreen(page);
! build_bottom(&MENU, page);
}
return 256;

--- 72,100 ----
switch (cmd) {
case '?' :

! put_cmd_name(pager_page,TRUE,FRM("?"));
! help(TRUE,

! pager_page->root,
! pager_page->prompt_area);
!

return 256;



case '|' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page,TRUE,


! CATGETS(elm_msg_cat, ElmSet, ElmPipe, "Pipe"));

!

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse))
! do_pipe(mailbox, pager_page->root,pager_page->prompt_area);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

!
}
return 256;

***************
*** 108,141 ****
}


! int process_showmsg_cmd(command, mailbox, XX, aview, header_page, page)
int command;
struct MailboxView *mailbox;
showmsg_cmd XX;

struct AliasView *aview;
! int *header_page;
! struct menu_context *page;
{


int i, intbuf; /* for dummy parameters...etc */
int istagged; /* for tagging and subsequent msg */


! /* FIXME: Should this allocate new page context ? ? ? */
!

! /* ? ? ? Why this Raw is on here ? ? ? */
! Raw(ON);

while (TRUE) {
struct menu_common MENU;

- int LINES, COLUMNS;
-
- menu_get_sizes(page, &LINES, &COLUMNS);

set_mcommon_from_mbxview(&MENU,mailbox);

clear_error();

! command = XX(mailbox,command,&screen_mangled, page);

switch (command) {

--- 105,291 ----
}


! #if ANSI_C
! static subpage_simple_redraw sb_update_border;
! #endif
! static int sb_update_border(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;

! {
! int li,co,i;
!
! DPRINT(Debug,9, (&Debug, "sb_update_border\n"));
! menu_get_sizes(ptr,&li, &co);
!
! menu_ClearScreen(ptr);
! menu_MoveCursor(ptr,0,0);
!
! for (i = 0; i < co; i++)
! menu_Writechar(ptr,'-');
!
! return 1;

! }
!

! static void set_border P_((struct pager_page *pager_page));
! static void set_border(pager_page)
! struct pager_page *pager_page;
! {

! int LINES, COLUMNS;
!
! menu_get_sizes(pager_page->root,&LINES, &COLUMNS);
!

! if (! pager_page->border_line)
! pager_page->border_line = new_menu_subpage(pager_page->root,
! LINES-5,1,sb_update_border,
! pager_page->PARAM
! );
! else
! menu_subpage_relocate(pager_page->border_line,pager_page->root,
! LINES-5,1);
! }

!
! #if ANSI_C
! static subpage_simple_redraw sb_update_prompt;
! #endif
! static int sb_update_prompt(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;

! {


! struct menu_common *mptr = mp_lookup_mcommon(list,elm_mp_menu);
!

! DPRINT(Debug,9, (&Debug, "sb_update_prompt\n"));

!
! menu_ClearScreen(ptr);
!

! menu_PutLineX(ptr,0,0,
! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
!
! menu_PutLineX(ptr,0, 45,
! CATGETS(elm_msg_cat, ElmSet, ElmUseIToReturnIndex,

! "(Use 'i' to return to index.)"));
! return 1;


! }
!
!
!
!

! static void set_prompt P_((struct pager_page *pager_page));
! static void set_prompt(pager_page)


! struct pager_page *pager_page;
! {

! int LINES, COLUMNS;
!
! menu_get_sizes(pager_page->root,&LINES, &COLUMNS);
!

! if (! pager_page->prompt_area)
! pager_page->prompt_area = new_menu_subpage(pager_page->root,
! LINES-4,4,sb_update_prompt,
! pager_page->PARAM);
! else
! menu_subpage_relocate(pager_page->prompt_area,pager_page->root,
! LINES-4,4);
! }
!
! void put_cmd_name (
! #if ANSI_C
! struct pager_page *pager_page,
! int will_mangle,
! const char * format, const char *msg, ...
! #else
! pager_page,will_mangle,format,msg, va_alist


! #endif
! )
! #if !ANSI_C

! struct pager_page *pager_page;
! int will_mangle;


! const char * format;
! const char *msg;

! va_dcl
! #endif
! {
! struct string *cmd;
! int r;
! int r1;
! struct menu_common *mptr = mp_lookup_mcommon(pager_page->PARAM,
! elm_mp_menu);
!
! va_list vl;
!
! Va_start(vl, msg); /* defined in defs.h */
! cmd = elm_smessage(0,format,msg,vl);
! va_end(vl);
!
! r = menu_resized(pager_page->root);
! r1 = menu_need_redraw(pager_page->root);
!
! if (r1) {
! menu_ClearScreen(pager_page->root);
! }
!
! if (r || r1 || will_mangle) {
! set_border(pager_page);
! menu_trigger_redraw(pager_page->border_line);
! }
!
! if (pager_page->border_line &&
! menu_need_redraw(pager_page->border_line)) {
! DPRINT(Debug,1, (&Debug, "border line redraw???\n"));
! sb_update_border(pager_page->border_line, NULL);
! }
!
! if (r || r1 || will_mangle) {
! set_prompt(pager_page);
! menu_trigger_redraw(pager_page->prompt_area);
! }
!
! if (pager_page->border_line &&
! menu_need_redraw(pager_page->border_line)) {
! DPRINT(Debug,1, (&Debug, "prompt area redraw???\n"));
! sb_update_border(pager_page->border_line,
! pager_page->PARAM);
! }
!
! if (pager_page->prompt_area &&
! menu_need_redraw(pager_page->prompt_area)) {
! DPRINT(Debug,1, (&Debug, "prompt area redraw???\n"));
! sb_update_prompt(pager_page->prompt_area,
! pager_page->PARAM);
! }
!
! if (pager_page->prompt_area) {
! menu_PutLineX(pager_page->prompt_area,
! 0,0,


! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
!

! menu_Write_to_screen(pager_page->prompt_area,
! FRM("%S"),cmd);
! }
!
! free_string(&cmd);
! }
!
! int process_showmsg_cmd(command, mailbox, XX, aview, pager_page)


int command;
struct MailboxView *mailbox;
showmsg_cmd XX;
struct AliasView *aview;

! struct pager_page *pager_page;
{


int i, intbuf; /* for dummy parameters...etc */
int istagged; /* for tagging and subsequent msg */

+ int LINES, COLUMNS;

! menu_get_sizes(pager_page->root, &LINES, &COLUMNS);


while (TRUE) {
struct menu_common MENU;

set_mcommon_from_mbxview(&MENU,mailbox);

clear_error();

! command = XX(mailbox,command,pager_page);

switch (command) {

***************
*** 148,159 ****

#ifdef ALLOW_SUBSHELL
case '!' :
! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmSystemCall,
! "System call"), TRUE, &MENU,
! page);
! (void) subshell(mailbox,page);


! menu_ClearScreen(page);
! build_bottom(&MENU, page);

break;
#endif

--- 298,309 ----

#ifdef ALLOW_SUBSHELL
case '!' :
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmSystemCall,
! "System call"));
!
! subshell(mailbox,pager_page->root,pager_page->prompt_area);
!
break;
#endif

***************
*** 161,175 ****
int current = get_current(mailbox);

#ifdef ENABLE_CALENDAR
! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmScanForCalendarCmd,
! "Scan messages for calendar entries"),

! TRUE, &MENU, page);
if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,

/* !!! */
NO_mime_parse))


/* FIX: mime structure is not currently used */

! scan_calendar(mailbox);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 311,325 ----
int current = get_current(mailbox);

#ifdef ENABLE_CALENDAR
! put_cmd_name(pager_page,FALSE,
! CATGETS(elm_msg_cat, ElmSet, ElmScanForCalendarCmd,
! "Scan messages for calendar entries"));
if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
/* !!! */
NO_mime_parse))


/* FIX: mime structure is not currently used */

! scan_calendar(mailbox);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 186,217 ****


struct header_rec *hdr;
FILE *F;

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmBounceMessage,
! "Bounce message"), TRUE, &MENU,
! page);
!
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
/* !!! */
NO_mime_parse))
! remail(hdr,F, aview, page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}
}

break;

! case 'd' :
! delete_msg(TRUE, FALSE, &MENU, *header_page);
/* really delete it, silent */

! if (! resolve_mode)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageMarkedForDeleteion,
! "Message marked for deletion."));
! else
! goto next_undel_msg;
! break;

#ifdef USE_PGP
case ctrl('E'): {
--- 336,370 ----


struct header_rec *hdr;
FILE *F;

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmBounceMessage,
! "Bounce message"));
!
if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
/* !!! */
NO_mime_parse))
! remail(hdr,F, aview,

! pager_page->root,
! pager_page->prompt_area);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}

+
}
break;

! case 'd' :
! delete_msg(TRUE, &MENU, NULL);
/* really delete it, silent */

! if (! resolve_mode)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageMarkedForDeleteion,
! "Message marked for deletion."));
! else
! goto next_undel_msg;
! break;

#ifdef USE_PGP
case ctrl('E'): {
***************
*** 219,226 ****


struct header_rec *hdr;
FILE *F;

! put_cmd_name("Extract PGP public key", TRUE,&MENU,
! page); /* ??? */

if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
--- 372,380 ----


struct header_rec *hdr;
FILE *F;

! put_cmd_name(pager_page,TRUE,


! CATGETS(elm_msg_cat, ElmSet, ElmExtractPGPKey,
! "Extract PGP public key"));

if (give_message_data(mailbox,current-1,
&hdr,&F,NULL,
***************
*** 228,238 ****
NO_mime_parse)) {

if (hdr->pgp & PGP_PUBLIC_KEY) {

/* FIX: mime structure is not currently used */

- pgp_extract_public_key (hdr,F, page);
-
- if (menu_need_redraw(page)) /* ? ? ? Is this correct */
- put_border(page);

} else
store_msg("This message does not contain any keys!");
} else {
--- 382,391 ----
NO_mime_parse)) {

if (hdr->pgp & PGP_PUBLIC_KEY) {

/* FIX: mime structure is not currently used */

+ pgp_extract_public_key (hdr,F,
+ pager_page->root);
+
} else
store_msg("This message does not contain any keys!");
} else {
***************
*** 244,283 ****
break;

case ctrl('F'):
! put_cmd_name(catgets(elm_msg_cat, ElmSet,
ElmPassphraseForget,
! "Forget passphrase"),
! TRUE, &MENU, page);
forget_passphrase();
break;
#endif


case 'f' : {
int current = get_current(mailbox);
- struct header_rec *hdr;
- FILE *F;

-
- put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmForwardMessage,
- "Forward message"), TRUE, &MENU,
- page);
-
- forward(current-1,mailbox, aview, page);
-
- if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
- put_border(page);

}
break;



case 'g' : {
int current = get_current(mailbox);

- struct header_rec *hdr;
- FILE *F;

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmGroupReply,
! "Group reply"), TRUE, &MENU,
! page);
!
! (void) reply_to_everyone(current-1,mailbox, aview, page);
}
break;

--- 397,437 ----
break;

case ctrl('F'):
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet,


ElmPassphraseForget,
! "Forget passphrase"));

!
forget_passphrase();
break;
#endif


case 'f' : {
int current = get_current(mailbox);

+ put_cmd_name(pager_page,TRUE,
+ CATGETS(elm_msg_cat, ElmSet, ElmForwardMessage,
+ "Forward message"));
+
+ forward(current-1,mailbox, aview,
+ pager_page->root,
+ pager_page->prompt_area,
+ NULL);
+
}
break;

case 'g' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmGroupReply,
! "Group reply"));
!
! reply_to_everyone(current-1,mailbox, aview,
! pager_page->root,
! pager_page->prompt_area,
! NULL);
!
}
break;

***************
*** 295,307 ****
elm_filter = 0;
intbuf = show_msg(hdr,F,current,
get_message_count(mailbox),
! page);
elm_filter = 1;
return(intbuf);
} else
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 449,461 ----
elm_filter = 0;
intbuf = show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page);
elm_filter = 1;
return(intbuf);
} else
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 311,321 ****

case 'q' :
case 'i' : {


- int current = get_current(mailbox);
-

- (void) get_page(current, &MENU, header_page);
clear_error(); /* zero out pending msg */
- screen_mangled = 0;
return(0); /* avoid <return> looping */
}

--- 465,471 ----
***************
*** 327,333 ****
case 'n' : {

int current = get_current(mailbox);
! screen_mangled = 0;
if((i=next_message(current-1, TRUE, &MENU)) != -1) {


struct header_rec *hdr;
FILE *F;

--- 477,483 ----
case 'n' : {



int current = get_current(mailbox);
!

if((i=next_message(current-1, TRUE, &MENU)) != -1) {


struct header_rec *hdr;
FILE *F;
***************

*** 340,358 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}
}

- return(0);


}

case ctrl('N'): {
int current = get_current(mailbox);

- screen_mangled = 0;
for (i = next_message(current-1, TRUE, &MENU);
i != -1;
i = next_message(i, TRUE, &MENU)) {
--- 490,521 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));
}
}
}

+ return(0);
+
+ #ifdef USE_PGP
+ case ctrl('K'):
+ put_cmd_name(pager_page,TRUE,
+ CATGETS(elm_msg_cat, ElmSet,
+ ElmMailPGPPublicKey,
+ "Mail PGP public key"));
+
+ pgp_mail_public_key(mailbox, aview,
+ pager_page->root,
+ pager_page->prompt_area);
+ break;
+
+ #endif



case ctrl('N'): {
int current = get_current(mailbox);

for (i = next_message(current-1, TRUE, &MENU);
i != -1;
i = next_message(i, TRUE, &MENU)) {
***************
*** 373,379 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 536,542 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 398,404 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 561,567 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 411,417 ****
case 'k' : {
int current = get_current(mailbox);

- screen_mangled = 0;
if((i=prev_message(current-1, TRUE, &MENU)) != -1) {


struct header_rec *hdr;
FILE *F;

--- 574,579 ----
***************
*** 424,430 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 586,592 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 436,442 ****
case 'K' : {
int current = get_current(mailbox);

- screen_mangled = 0;
if((i=prev_message(current-1, FALSE, &MENU)) != -1) {


struct header_rec *hdr;
FILE *F;

--- 598,603 ----
***************
*** 449,455 ****
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 610,616 ----
mime_parse_routine))
return(show_msg(hdr,F,current,
get_message_count(mailbox),
! pager_page));


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 460,489 ****

case 'm' : {


int current = get_current(mailbox);
- struct header_rec *hdr;
- FILE *F;

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmMailMessage,
! "Mail message"), TRUE, &MENU,
! page);

send_msg_l(current-1,
NULL,NULL,NULL, MAIL_EDIT_MSG,
allow_forms,
mailbox, aview,
! page);
!
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
! put_border(page);
}
break;

! case 'p' : {
! int current = get_current(mailbox);
!
! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmPrintMessage,
! "Print message"), FALSE, &MENU,
! page);
#if DISABLE_PRINT
lib_error(FRM("p)rint currently disabled, try P)rint text instead"));
#else
--- 621,657 ----

case 'm' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmMailMessage,
! "Mail message"));

send_msg_l(current-1,
NULL,NULL,NULL, MAIL_EDIT_MSG,
allow_forms,
mailbox, aview,


! pager_page->root,
! pager_page->prompt_area);
}

break;

! case 'O':
! put_cmd_name(pager_page,TRUE,


! CATGETS(elm_msg_cat, ElmSet,
! ElmOverrideCharset,
! "Override charset"));

!
! OverrideCharset(mailbox,
! pager_page->root,
! pager_page->prompt_area,
! NULL);


! break;
!
! case 'p' : {
!

! put_cmd_name(pager_page,FALSE,
! CATGETS(elm_msg_cat, ElmSet, ElmPrintMessage,
! "Print message"));
#if DISABLE_PRINT
lib_error(FRM("p)rint currently disabled, try P)rint text instead"));
#else
***************
*** 492,539 ****
/* !!! */
NO_mime_parse))
/* FIX: mime structure is not used */
! (void) print_msg(FALSE, mailbox, page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

}

#endif
! }
break;

! case 'P' : {


int current = get_current(mailbox);

! put_cmd_name(catgets(elm_msg_cat, ElmSet,

ElmPrintTextMessage,
! "Print text of message"), FALSE, &MENU,
! page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine))
! (void) print_text(FALSE, mailbox, *header_page, page);


else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

}
}
break;

case 'r' : {
int current = get_current(mailbox);
- struct header_rec *hdr;
- FILE *F;

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmReplyToMessage,
! "Reply to message"), TRUE, &MENU,
! page);
!
! reply(current-1,mailbox, aview, page);
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
! put_border(page);


}
--- 660,710 ----
/* !!! */
NO_mime_parse))
/* FIX: mime structure is not used */
! (void) print_msg(FALSE, mailbox,
! pager_page->root);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

}

#endif
! }
break;

! case 'P' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page,FALSE,
! CATGETS(elm_msg_cat, ElmSet,
ElmPrintTextMessage,
! "Print text of message"));
!

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine))
! print_text(FALSE, mailbox, pager_page->root,
! NULL);

else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

}

+
}
break;

case 'r' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmReplyToMessage,


! "Reply to message"));

!
! reply(current-1,mailbox, aview,
! pager_page->root,
! pager_page->prompt_area,
! NULL);


}
***************
*** 544,564 ****
case 's' : {
int current = get_current(mailbox);

! put_cmd_name((command != 'C' ?
! cap_save_word : cap_copy_word), TRUE, &MENU,
! page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse)) {

save(TRUE, (command != 'C'),0,
! mailbox, aview, *header_page,
! page);
!
! if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
! put_border(page);



} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 715,738 ----
case 's' : {
int current = get_current(mailbox);

! if (command != 'C')
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmCapSave, "Save"));
! else
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmCapCopy, "Copy"));

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
NO_mime_parse)) {

save(TRUE, (command != 'C'),0,
! mailbox, aview,
! pager_page->root,
! pager_page->prompt_area,
! NULL);

+

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 569,591 ****
goto next_undel_msg;
}
break;
case 'S' : {
int current = get_current(mailbox);

! put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmSaveText,
! "Save text"), TRUE, &MENU,
! page);

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {
- save(TRUE, 0,1, mailbox, aview,
- *header_page,
- page);
-
- if (menu_need_redraw(page)) /* ? ? ? Is this correct? */
- put_border(page);



} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

--- 743,765 ----
goto next_undel_msg;
}
break;
+
case 'S' : {
int current = get_current(mailbox);

! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmSaveText,
! "Save text"));

if (give_message_data(mailbox,current-1,
NULL,NULL,NULL,
mime_parse_routine)) {

+ save(TRUE, 0,1, mailbox, aview,
+ pager_page->root,
+ pager_page->prompt_area,
+ NULL);
+

} else {
DPRINT(Debug,3,(&Debug,
"give_message_data [%d] fails",current-1));

***************
*** 594,618 ****
}
break;



! case 'T' :
! case 't' :

! istagged=tag_message(FALSE, &MENU, *header_page);
! if(istagged)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageTagged,
! "Message tagged."));
! else
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageUntagged,
! "Message untagged."));
! if (command == 'T')
! goto next_undel_msg;
! break;

case 'u' :
! undelete_msg(FALSE, &MENU, *header_page); /* undelete it, silently */
! if (! resolve_mode)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageUndeleted,
! "Message undeleted."));
! else {
/******************************************************************************
** We're special casing the U)ndelete command here *not* to move to the next
** undeleted message ; instead it'll blindly move to the next message in the
--- 768,794 ----
}
break;



! case 'T' :
! case 't' :

! istagged=tag_message(&MENU, NULL);
!
! if(istagged)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageTagged,
! "Message tagged."));
! else
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageUntagged,
! "Message untagged."));
! if (command == 'T')
! goto next_undel_msg;
! break;

case 'u' :
! undelete_msg(&MENU, NULL); /* undelete it, silently */
!
! if (! resolve_mode)
! store_msg(catgets(elm_msg_cat, ElmSet, ElmMessageUndeleted,
! "Message undeleted."));
! else {
/******************************************************************************
** We're special casing the U)ndelete command here *not* to move to the next
** undeleted message ; instead it'll blindly move to the next message in the
***************
*** 647,785 ****
}
return(0);
}
! case 'X' : put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmQuickExit,
! "Quick Exit"), TRUE, &MENU,
! page);
!
! prompt_s(mcommon_give_item(&MENU,m_Prompt)); /* Command name will be reprinted */
! return 'X'; /* Call caller */
!
!
! case 'x' : put_cmd_name(catgets(elm_msg_cat, ElmSet, ElmExit, "Exit"), TRUE,
! &MENU,
! page);
!
! prompt_s(mcommon_give_item(&MENU,m_Prompt)); /* Command name will be reprinted */
return 'x'; /* Call caller */
!

! case ctrl('J'):
! case ctrl('M'): {
! int current = get_current(mailbox);
! struct header_rec *hdr;
! FILE *F;
!
! screen_mangled = 0;
! if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine))
! return(show_msg(hdr,F,current,
! get_message_count(mailbox),
! page));
! else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
! return 0;
}

! case EOF :
! return EOF; /* FAILURE */
!

! default : putchar((char) 007); /* BEEP! */
! }

- /* display prompt */
- if (screen_mangled) {
- /* clear what was left over from previous command
- * and display last generated message.
- */
- int lin,col;
-
- prompt_s(mcommon_give_item(&MENU,m_Prompt));
- GetXYLocation(&lin,&col);
-
- CleartoEOS();
- PutLineX(LINES-4, 45,
- CATGETS(elm_msg_cat, ElmSet, ElmUseIToReturnIndex,
- "(Use 'i' to return to index.)"));
-
-
- /* TODO: Fix this! */
- Centerline(LINES-1, msg_line, page);
- MoveCursor(lin, col);
- } else {
- /* display bottom line prompt with last generated message */
- MoveCursor(LINES-1, 0);
- CleartoEOS();
- StartBold();
- Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmCommandLine,
- "%s Command ('i' to return to index): "),
- msg_line);
- EndBold();
- }
- *msg_line = '\0'; /* null last generated message */

! command = menu_ReadCh(page,
! 'i'|READCH_CURSOR); /* get next command from user */
! }
! }

- void put_cmd_name(command, will_mangle, menu, page)
- char *command;
- int will_mangle;
- struct menu_common *menu;


- struct menu_context *page;
- {

! /* If screen is or will be mangled display the command name
! * and erase the bottom of the screen.
! * But first if the border line hasn't yet been drawn, draw it.
! */
! if(will_mangle && !screen_mangled) {
! build_bottom(menu,page);
! screen_mangled = TRUE;
! }
! if(screen_mangled) {
! prompt_s(mcommon_give_item(menu, m_Prompt));

- Write_to_screen(FRM("%s"), command);
- CleartoEOS();
- }
- }

! void put_border(page)
! struct menu_context *page;
! {
! int LINES, COLUMNS;

! menu_get_sizes(page, &LINES, &COLUMNS);


- PutLine0(LINES-5, 0,
- "--------------------------------------------------------------------------\n");
- }

! void build_bottom(menu, page)
! struct menu_common *menu;
! struct menu_context *page;
! {
! int LINES, COLUMNS;

! menu_get_sizes(page, &LINES, &COLUMNS);


! MoveCursor(LINES-5, 0);
! CleartoEOS();

! put_border(page);
! prompt_s(mcommon_give_item(menu,m_Prompt));
! PutLineX(LINES-4, 45,
! CATGETS(elm_msg_cat, ElmSet, ElmUseIToReturnIndex,
! "(Use 'i' to return to index.)"));



}


/*
* Local Variables:
* mode:c

--- 823,957 ----
}
return(0);
}
! case 'X' :
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmQuickExit,


! "Quick Exit"));
!

! /* Command name will be reprinted */
! {
! struct menu_common *mptr = mp_lookup_mcommon(pager_page->PARAM,
! elm_mp_menu);
! menu_PutLineX(pager_page->prompt_area,0,0,


! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
! }

! return 'X'; /* Call caller */
!
!
! case 'x' :
! put_cmd_name(pager_page,TRUE,
! CATGETS(elm_msg_cat, ElmSet, ElmExit, "Exit"));
!
! /* Command name will be reprinted */
! {


! struct menu_common *mptr = mp_lookup_mcommon(

! pager_page->PARAM,
! elm_mp_menu);
! menu_PutLineX(pager_page->prompt_area,0,0,


! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
! }

return 'x'; /* Call caller */
!

! case ctrl('J'):
! case ctrl('M'): {
! int current = get_current(mailbox);
! struct header_rec *hdr;
! FILE *F;
!
! if (give_message_data(mailbox,current-1,
! &hdr,&F,NULL,
! mime_parse_routine))
! return(show_msg(hdr,F,current,
! get_message_count(mailbox),
! pager_page));
! else {
! DPRINT(Debug,3,(&Debug,
! "give_message_data [%d] fails",current-1));
! }
! return 0;
}

! case EOF :
! return EOF; /* FAILURE */
!
!
! default :
! putchar((char) 007); /* BEEP! */
! break;
! }

! /* whole screen */


! if (menu_resized(pager_page->root)) {
! menu_get_sizes(pager_page->root, &LINES, &COLUMNS);

! menu_trigger_redraw(pager_page->root);
! }
! if (menu_need_redraw(pager_page->root)) {
! menu_ClearScreen(pager_page->root);
! menu_redraw_children(pager_page->root);
! }


! /* display prompt */
! if (pager_page->prompt_area) {
! /* clear what was left over from previous command
! * and display last generated message.
! */
!
! /* create areas if missing */
! if (!pager_page->border_line)
! sb_update_border(pager_page->border_line,
! pager_page->PARAM);


! if (menu_need_redraw(pager_page->border_line)) {
! DPRINT(Debug,1, (&Debug, "border line redraw???\n"));
! sb_update_border(pager_page->border_line,
! pager_page->PARAM);
! }
! if (menu_need_redraw(pager_page->prompt_area)) {
! DPRINT(Debug,1, (&Debug, "prompt area redraw???\n"));
! sb_update_border(pager_page->prompt_area, NULL);
! }


! Centerline(LINES-1, msg_line, pager_page->root);
!
! {
! struct menu_common *mptr = mp_lookup_mcommon(
! pager_page->PARAM,
! elm_mp_menu);

! menu_PutLineX(pager_page->prompt_area,0,0,


! FRM("%S"),mcommon_give_item(mptr, m_Prompt));
! }

+ command = menu_ReadCh(pager_page->prompt_area,
+ 'i'|READCH_CURSOR); /* get next command from user */


! } else {
! /* display bottom line prompt with last generated message */
! menu_MoveCursor(pager_page->root,LINES-1, 0);
! menu_CleartoEOS(pager_page->root);
! menu_StartXX(pager_page->root,pg_BOLD);
! menu_Write_to_screen(pager_page->root,
! CATGETS(elm_msg_cat, ElmSet, ElmCommandLine,
! "%s Command ('i' to return to index): "),
! msg_line);
! menu_EndXX(pager_page->root,pg_BOLD);

! command = menu_ReadCh(pager_page->root,
! 'i'|READCH_CURSOR); /* get next command from user */

! }
! *msg_line = '\0'; /* null last generated message */
! }



}


+
/*
* Local Variables:

* mode:c
Index: elmME+.2.5.alpha5-cvs/src/signals.c
*** elmME+.2.5.alpha4/src/signals.c 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/signals.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: signals.c,v 1.24.8.4 2004/08/16 05:12:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: signals.c,v 1.24.8.6 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 23,29 ****

DEBUG_VAR(Debug,__FILE__,"signal");

! extern VOLATILE int pipe_abort; /* set to TRUE if receive SIGPIPE */

SIGHAND_TYPE
quit_signal(sig)
--- 23,29 ----

DEBUG_VAR(Debug,__FILE__,"signal");

! volatile int pipe_abort; /* set to TRUE if receive SIGPIPE */

SIGHAND_TYPE
quit_signal(sig)
***************
*** 210,216 ****
usr1_signal(sig)
{
int result = 0;


- int dummy = 0;

struct MailboxView *m;
int idx2 = 0;

--- 210,215 ----
***************
*** 225,232 ****

/* !! FIXME?? Differs from Elm 2.5 */
while (m &&
! (result = leave_mbox(TRUE, FALSE, FALSE, NULL, m,
! &dummy, default_context))
== -1) {
int idx;
int mbxcount = get_storage_count(m);
--- 224,231 ----

/* !! FIXME?? Differs from Elm 2.5 */
while (m &&
! (result = leave_mbox(TRUE, FALSE, TRUE, NULL, m,
! default_context))
== -1) {
int idx;
int mbxcount = get_storage_count(m);
***************
*** 254,260 ****
usr2_signal(sig)
{
int result = 0;


- int dummy = 0;

struct MailboxView *m;
int idx2 = 0;

--- 253,258 ----
***************
*** 269,275 ****

while (m &&
(result = leave_mbox(FALSE, TRUE, FALSE, NULL,
! m, &dummy,
default_context)) == -1) {
int idx;
int mbxcount = get_storage_count(m);
--- 267,273 ----

while (m &&
(result = leave_mbox(FALSE, TRUE, FALSE, NULL,
! m,
default_context)) == -1) {
int idx;
int mbxcount = get_storage_count(m);
Index: elmME+.2.5.alpha5-cvs/src/sort.c
*** elmME+.2.5.alpha4/src/sort.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/sort.c 2005-07-20 19:49:50.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: sort.c,v 1.22 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: sort.c,v 1.22.8.1 2005/07/20 16:49:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.22.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 31,38 ****
return (unsigned char *)str;
}

- char *sort_name(), *skip_re();
-
static void find_old_current P_((struct folder_view * iindex,
struct MailboxView *mailbox));

--- 31,36 ----
***************
*** 78,84 ****
}

/* Prototype */
- static int subject_compare P_((struct sort_data *p1, struct sort_data *p2));
static int subject_compare_1 P_((struct header_rec *h1,
struct header_rec *h2));
static int compare_headers P_((struct sort_data *p1, struct sort_data *p2));
--- 76,81 ----
***************
*** 92,98 ****

struct folder_view last_index;

- int compare_headers(); /* for sorting */
int current;

last_index.mailbox_number = 0;
--- 89,94 ----
***************
*** 109,121 ****
/* Don't get last_index if no entries or no current. */
/* There would be no current if we are sorting a new mail file. */

- /* FIXME: last_index does not work when there is mor ethan one storage...
- * (in other words several mails with same index)
- */

if (entries > 0 && current > 0) {
give_index_number(mailbox,current-1, &last_index);
-
}

if (entries > 30 && visible)
--- 105,113 ----
***************
*** 124,135 ****
sort_name(FULL));

if (entries > 1) {
! switch (sortby) {
int i;
struct header_rec * hdr;

! case THREAD:
! sortby = SUBJECT;

sort_mailbox_view(mailbox,compare_headers);

--- 116,127 ----
sort_name(FULL));

if (entries > 1) {
! switch (give_dt_sort_as_int(&sortby)) {
int i;
struct header_rec * hdr;

! case THREAD:
! set_dt_sort_as_int(&sortby,SUBJECT);

sort_mailbox_view(mailbox,compare_headers);

***************
*** 146,188 ****
hdr->time_sent < hdr0->time_sent -
(long) sort_thread_max_time * 24 * 60 * 60)
hdr->thread_time = hdr->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! }
! else {
! hdr->thread_time = hdr->time_sent;
! }
}
! sortby = THREAD;
!
sort_mailbox_view(mailbox,compare_headers);
break;

case REVERSE THREAD:
! sortby = REVERSE SUBJECT;
!
! sort_mailbox_view(mailbox,compare_headers);
!
! hdr = give_header(mailbox,entries-1);
! hdr->thread_time = hdr->time_sent;

! for (i=entries-2; i >= 0; i--) {
! struct header_rec * hdr0 = hdr; /* 'previous' header */
! if (subject_compare_1(hdr,hdr0)==0) {
!
! if (hdr->time_sent > hdr0->time_sent +
! (long) sort_thread_max_time * 24 * 60 * 60 ||
! hdr->time_sent < hdr0->time_sent -
! (long) sort_thread_max_time * 24 * 60 * 60)
! hdr->thread_time = hdr0->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! }
! else {
! hdr->thread_time = hdr->time_sent;
! }
! }
! sortby = REVERSE THREAD;

sort_mailbox_view(mailbox,compare_headers);
break;
--- 138,211 ----
hdr->time_sent < hdr0->time_sent -
(long) sort_thread_max_time * 24 * 60 * 60)
hdr->thread_time = hdr->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! } else {
! hdr->thread_time = hdr->time_sent;
! }
}
! set_dt_sort_as_int(&sortby,THREAD);
!
sort_mailbox_view(mailbox,compare_headers);
break;

case REVERSE THREAD:
! set_dt_sort_as_int(&sortby,REVERSE SUBJECT);
!
! sort_mailbox_view(mailbox,compare_headers);
!
!
! if (unstable_reverse_thread) {
! /* Move thread new location when new mail arrives,
! REVERSE SUBJECT but lastest message (on mailbox
! order) with same subject to first. Therefore
! count from beginning
! */
!
! hdr = give_header(mailbox,0);
! hdr->thread_time = hdr->time_sent;
! for (i=1; i<entries; i++) {
! struct header_rec * hdr0 = hdr; /* previous header */
!
! hdr = give_header(mailbox,i);
!
! if (subject_compare_1(hdr,hdr0)==0) {
! if (hdr->time_sent > hdr0->time_sent +
! (long) sort_thread_max_time * 24 * 60 * 60 ||
! hdr->time_sent < hdr0->time_sent -
! (long) sort_thread_max_time * 24 * 60 * 60)
! hdr->thread_time = hdr->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! } else {
! hdr->thread_time = hdr->time_sent;
! }
! }

! } else {
! hdr = give_header(mailbox,entries-1);
! hdr->thread_time = hdr->time_sent;
!
! for (i=entries-2; i >= 0; i--) {
! struct header_rec * hdr0 = hdr; /* 'previous' header */
!
! hdr = give_header(mailbox,i);
!
! if (subject_compare_1(hdr,hdr0)==0) {
!
! if (hdr->time_sent > hdr0->time_sent +
! (long) sort_thread_max_time * 24 * 60 * 60 ||
! hdr->time_sent < hdr0->time_sent -
! (long) sort_thread_max_time * 24 * 60 * 60)
! hdr->thread_time = hdr->time_sent;
! else
! hdr->thread_time = hdr0->thread_time;
! } else {
! hdr->thread_time = hdr->time_sent;
! }
! }
! }
! set_dt_sort_as_int(&sortby,REVERSE THREAD);

sort_mailbox_view(mailbox,compare_headers);


break;
***************
*** 228,244 ****

return ret;
}

! static int subject_compare(p1,p2)
! struct sort_data *p1;
! struct sort_data *p2;
! {
! struct header_rec *h1 = give_header_s(p1);
! struct header_rec *h2 = give_header_s(p2);
!
! return subject_compare_1(h1,h2);
! }
!
! int compare_headers_1(first, second)
struct header_rec *first, *second;
{
/** compare two headers according to the sortby value.
--- 251,259 ----
return ret;
}

! static int compare_headers_1 P_((struct header_rec *first,
! struct header_rec *second));
! static int compare_headers_1(first, second)
struct header_rec *first, *second;
{
/** compare two headers according to the sortby value.
***************
*** 259,265 ****
if (!first || !second)
return 0;

! switch (abs(sortby)) {
case SENT_DATE:
diff = first->time_sent - second->time_sent;
if ( diff < 0 ) ret = -1;
--- 274,280 ----
if (!first || !second)
return 0;

! switch (abs(give_dt_sort_as_int(&sortby))) {
case SENT_DATE:
diff = first->time_sent - second->time_sent;
if ( diff < 0 ) ret = -1;
***************
*** 344,350 ****
else ret = 0;
}

! if (sortby < 0)


ret = -ret;

return ret;

--- 359,365 ----
else ret = 0;
}

! if (give_dt_sort_as_int(&sortby) < 0)


ret = -ret;

return ret;
***************

*** 354,366 ****
struct sort_data *p1;
struct sort_data *p2;
{
struct header_rec *h1 = give_header_s(p1);
struct header_rec *h2 = give_header_s(p2);

! switch (abs(sortby)) {
! int ret;
struct folder_view i1,i2;

case MAILBOX_ORDER:
give_index_number_s(p1,&i1);
give_index_number_s(p2,&i2);
--- 369,393 ----
struct sort_data *p1;
struct sort_data *p2;


{
+ int ret = 0;

struct header_rec *h1 = give_header_s(p1);
struct header_rec *h2 = give_header_s(p2);

! switch (abs(give_dt_sort_as_int(&sortby))) {
struct folder_view i1,i2;

+ default:
+ ret = compare_headers_1(h1,h2);
+
+ /* NOTE: compare_headers already reserves return for
+ reverse sorting orders
+ */
+
+
+ /* Is compare result is same, then use mailbox order */
+ if (0 != ret)
+ break;
+
case MAILBOX_ORDER:
give_index_number_s(p1,&i1);
give_index_number_s(p2,&i2);
***************
*** 368,378 ****
ret = i1.mailbox_number - i2.mailbox_number;
if (0 == ret)
ret = i1.index - i2.index;
- return ret;

! default:
! return compare_headers_1(h1,h2);
}
}


--- 395,410 ----
ret = i1.mailbox_number - i2.mailbox_number;
if (0 == ret)
ret = i1.index - i2.index;

! if (give_dt_sort_as_int(&sortby) < 0)
! ret = -ret;
!
! break;
!

}
+
+
+ return ret;
}


***************
*** 387,399 ****


pad = (type == PAD);
abr = (type == SHORT);

! if (sortby < 0) {
! switch (- sortby) {
case SENT_DATE : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadRevDateMailSent, "Reverse Date Mail Sent ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrtRevDateMailSent, "Reverse-Sent") :
catgets(elm_msg_cat, ElmSet, ElmLongRevDateMailSent, "Reverse Date Mail Sent"));
! case THREAD : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadRevThread, "Reverse Thread ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrRevThread, "Reverse-Thread") :
catgets(elm_msg_cat, ElmSet, ElmLongRevThread, "Reverse Thread"));
--- 419,441 ----


pad = (type == PAD);
abr = (type == SHORT);

! if (give_dt_sort_as_int(&sortby) < 0) {
! switch (- give_dt_sort_as_int(&sortby)) {
case SENT_DATE : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadRevDateMailSent, "Reverse Date Mail Sent ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrtRevDateMailSent, "Reverse-Sent") :
catgets(elm_msg_cat, ElmSet, ElmLongRevDateMailSent, "Reverse Date Mail Sent"));
! case THREAD :
!
! if (unstable_reverse_thread) { /* HACK */
! return(
! pad? catgets(elm_msg_cat, ElmSet, ElmPadUnsThread, "Unstable Reverse Thread ") :
! abr? catgets(elm_msg_cat, ElmSet, ElmAbrUnsThread, "(Unstable) Reverse-Thread") :
! catgets(elm_msg_cat, ElmSet, ElmLongUnsThread, "Unstable Reverse Thread"));
!
! }
!
! return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadRevThread, "Reverse Thread ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrRevThread, "Reverse-Thread") :
catgets(elm_msg_cat, ElmSet, ElmLongRevThread, "Reverse Thread"));
***************
*** 426,432 ****
}
}
else {
! switch (sortby) {
case SENT_DATE : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadMailSent, "Date Mail Sent ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrMailSent, "Sent") :
--- 468,474 ----
}
}
else {
! switch (give_dt_sort_as_int(&sortby)) {
case SENT_DATE : return(
pad? catgets(elm_msg_cat, ElmSet, ElmPadMailSent, "Date Mail Sent ") :
abr? catgets(elm_msg_cat, ElmSet, ElmAbrMailSent, "Sent") :
Index: elmME+.2.5.alpha5-cvs/src/string2.c
*** elmME+.2.5.alpha4/src/string2.c 2004-03-30 19:38:44.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/string2.c 2005-07-20 19:49:50.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: string2.c,v 1.8 2004/03/27 18:31:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: string2.c,v 1.8.8.1 2005/07/20 16:49:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.8.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 33,78 ****
return(count);
}

- int
- qoccurances_of(ch, string)
- char ch, *string;
- {
- /** returns the number of occurances of 'ch' in string 'string' **/
-
- register int count = 0, len;
-
- while(*string) {
- len = len_next_part(string);
- if (len == 1 && *string == ch) count++;
- string += len;
- }
-
- return(count);
- }
-
- void remove_possible_trailing_spaces(string)
- char *string;
- {
- /** an incredibly simple routine that will read backwards through
- a string and remove all trailing whitespace.
- **/
-

- int i, j;
-

- for ( j = i = strlen(string); --i >= 0 && whitespace(string[i]); )
- /** spin backwards, semicolon intented **/ ;
-
- if (i > 0 && string[i-1] == '\\') /* allow for line to end with \blank */
- i++;
-
- if (i < j)
- string[i+1] = '\0'; /* note that even in the worst case when there
- are no trailing spaces at all, we'll simply
- end up replacing the existing '\0' with
- another one! No worries, as M.G. would say
- */
- }


-
/*
* Local Variables:

* mode:c
--- 33,38 ----
Index: elmME+.2.5.alpha5-cvs/src/strings.c
*** elmME+.2.5.alpha4/src/strings.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/strings.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: strings.c,v 1.15.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: strings.c,v 1.15.8.5 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 40,46 ****

while (*ptr) {
int len = rfc822_toklen(ptr);
! if (len == 1 && *ptr == COMMA)
count++;

ptr += len;
--- 40,46 ----

while (*ptr) {
int len = rfc822_toklen(ptr);
! if (len == 1 && *ptr == ',')
count++;

ptr += len;
***************
*** 156,180 ****
char *string;
struct menu_context *page;
{
! /** Output 'string' on the given line, centered. **/
!
! int length, col;


! int LINES, COLUMNS;
!
! menu_get_sizes(page, &LINES, &COLUMNS);

!
! length = strlen(string);
!
! if (length > COLUMNS)
! col = 0;
! else
! col = (COLUMNS - length) / 2;
!
! PutLine0(line, col, string);
}

char *argv_zero(string)
! CONST char *string;
{
/** given a string of the form "/something/name" return a
string of the form "name"... **/
--- 156,183 ----
char *string;
struct menu_context *page;
{
! /** Output 'string' on the given line, centered. **/
!
! int length, col;


! int LINES, COLUMNS;
!
! menu_get_sizes(page, &LINES, &COLUMNS);

!
! length = strlen(string);
!
! if (length > COLUMNS) {
! DPRINT(Debug,8,(&Debug,
! "Centerline: length=%d > columns=%d",
! length,COLUMNS));
! col = 0;
! } else
! col = (COLUMNS - length) / 2;
!
! menu_PutLine0(page,line, col, string);
}

char *argv_zero(string)
! const char *string;
{
/** given a string of the form "/something/name" return a
string of the form "name"... **/
***************
*** 191,247 ****
return( (char *) buffer);
}

- #define MAX_RECURSION 20 /* up to 20 deep recursion */
-
- char *get_token(source, keys, depth)
- char *source, *keys;
- int depth;
- {
- /** This function is similar to strtok() (see "opt_utils")
- but allows nesting of calls via pointers...
- **/


-
- register int last_ch;

- static char *buffers[MAX_RECURSION];
- char *return_value, *sourceptr;
-
- if (depth > MAX_RECURSION) {
- lib_error(CATGETS(elm_msg_cat, ElmSet, ElmGetTokenOverNested,
- "Get_token calls nested greater than %d deep!"),
- MAX_RECURSION);
- emergency_exit(0);
- }


-
- if (source != NULL)

- buffers[depth] = source;
-
- sourceptr = buffers[depth];


-
- if (*sourceptr == '\0')

- return(NULL); /* we hit end-of-string last time!? */
-

- sourceptr += qstrspn(sourceptr, keys); /* skip the bad.. */


-
- if (*sourceptr == '\0') {

- buffers[depth] = sourceptr;


- return(NULL); /* we've hit end-of-string */
- }
-

- last_ch = qstrcspn(sourceptr, keys); /* end of good stuff */


-
- return_value = sourceptr; /* and get the ret */
-
- sourceptr += last_ch; /* ...value */
-

- if (*sourceptr != '\0') /** don't forget if we're at end! **/
- sourceptr++;

-
- return_value[last_ch] = '\0'; /* ..ending right */
-

- buffers[depth] = sourceptr; /* save this, mate! */


-
- return((char *) return_value); /* and we're outta here! */

- }

/*
* Local Variables:

--- 194,199 ----
Index: elmME+.2.5.alpha5-cvs/src/syscall.c
*** elmME+.2.5.alpha4/src/syscall.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/syscall.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33.2.5 2004/10/09 12:26:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.2.5 $ $State: Exp $

!

*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: syscall.c,v 1.33.2.9 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.2.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 46,54 ****

#ifdef ALLOW_SUBSHELL

! void subshell(mailbox, page)


struct MailboxView *mailbox;
struct menu_context *page;

{
/** spawn a subshell with either the specified command

--- 45,54 ----

#ifdef ALLOW_SUBSHELL

! void subshell(mailbox, page, prompt_area)


struct MailboxView *mailbox;
struct menu_context *page;
+ struct menu_context *prompt_area;

{
/** spawn a subshell with either the specified command

***************
*** 58,111 ****
char command[SLEN];
int redraw = FALSE;
int old_raw, helpful, ret, status;
- int LINES, COLUMNS;
struct menu_context *cpage;



! menu_get_sizes(page, &LINES, &COLUMNS);
!

! helpful = (user_level == 0);

if (helpful)
! PutLineX(LINES-4, COLUMNS-40,
! CATGETS(elm_msg_cat, ElmSet,
! ElmUseShellName,
! "(Use the shell name for a shell.)"));
! PutLineX(LINES-3, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
! "Shell command: "));
! CleartoEOS();
command[0] = '\0';
! status = optionally_enter(command, LINES-3, 15, OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,
sizeof command, page);

while (REDRAW_MARK == status) {
! redraw = TRUE;
! PutLineX(LINES-1-2, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
! "Shell command: "));
! status = optionally_enter(command, LINES-3, 15,
! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! OE_SIG_CHAR /* Ctrl-C */,

! sizeof command, page);

- }

if (0 != status || command[0] == 0) {
! if (helpful)
! MoveCursor(LINES-4,COLUMNS-40);
! else
! MoveCursor(LINES-3,0);
! CleartoEOS();
!
! if (redraw)
! menu_trigger_redraw(page);

return;
}

! MoveCursor(LINES-1,0);
! CleartoEOLN();

if ((old_raw = RawState()) == ON)
Raw(OFF);
--- 58,134 ----
char command[SLEN];
int redraw = FALSE;
int old_raw, helpful, ret, status;
struct menu_context *cpage;
+ int li,co;
+ int LINES, COLUMNS;
+ int line;


+ int ul = give_dt_enumerate_as_int(&user_level);
+

+ menu_get_sizes(prompt_area, &li, &co);

! helpful = (ul == 0);

if (helpful)
! menu_PutLineX(prompt_area,0, co-40,
! CATGETS(elm_msg_cat, ElmSet,
! ElmUseShellName,
! "(Use the shell name for a shell.)"));
!
! menu_PutLineX(prompt_area,1, 0,
! CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
! "Shell command: "));
!
! menu_CleartoEOS(prompt_area);
!
! /* FIXME --optionally_enter* should use prompt_area */
! line = menu_GetAbsLine(prompt_area,1);
command[0] = '\0';
! status = optionally_enter(command, line, 15, OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,
sizeof command, page);

while (REDRAW_MARK == status) {


! menu_ClearScreen(page); /* Clear possible redraw mark */
!

! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(prompt_area); /* Clear redraw mark from prompt_area*/


!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */


+ redraw = TRUE;
+ menu_PutLineX(prompt_area,1, 0,
+ CATGETS(elm_msg_cat, ElmSet, ElmShellCommand,
+ "Shell command: "));
+ status = optionally_enter(command, line, 15,
+ OE_REDRAW_MARK|OE_APPEND_CURRENT|


+ OE_SIG_CHAR /* Ctrl-C */,

+ sizeof command, page);
+ }
+
if (0 != status || command[0] == 0) {
! if (helpful)
! menu_MoveCursor(prompt_area,0,co-40);
! else
! menu_MoveCursor(prompt_area,1,0);
! menu_CleartoEOS(prompt_area);
!
! if (redraw)
! menu_trigger_redraw(page);
! else
! menu_trigger_redraw(prompt_area);

return;


}

!
! menu_get_sizes(page, &LINES, &COLUMNS);

! menu_MoveCursor(page,LINES-1,0);
! menu_CleartoEOLN(page);

if ((old_raw = RawState()) == ON)
Raw(OFF);
***************
*** 123,136 ****

redraw2:



! PutLineX(LINES-1, 0, CATGETS(elm_msg_cat, ElmSet,

ElmPressAnyKeyToReturn,
"\n\nPress any key to return to ELM: "));



if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {

goto redraw2;


}
! printf("\r\n");

Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
if (old_raw == ON)
Raw(ON);
--- 146,163 ----

redraw2:

! menu_PutLineX(cpage,LINES-1, 0, CATGETS(elm_msg_cat, ElmSet,
ElmPressAnyKeyToReturn,
"\n\nPress any key to return to ELM: "));

if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {
+ menu_ClearScreen(cpage); /* Reset possible redraw flag */
+
goto redraw2;
}
!
! menu_Write_to_screen(cpage, FRM("\r\n"));
!
Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
if (old_raw == ON)
Raw(ON);
***************
*** 187,216 ****

int system_call(string, options, mailbox)
char *string;
! VOLATILE int options;
struct MailboxView *mailbox;
{
/** execute 'string', setting uid to userid... **/

int pfd[2], stat, w;
int pid = -1;
! VOLATILE int iteration;
/* figure out what shell we are using here */
S__ status;
! register SIGHAND_TYPE (*istat)(), (*qstat)();
#ifdef SIGTSTP
! register SIGHAND_TYPE (*oldstop)(), (*oldstart)();
#endif
!

/* flush any pending output */
FlushBuffer();

DPRINT(Debug,2, (&Debug,
"System Call: command=%s\n", string));
if (options & SY_USER_SHELL) {
DPRINT(Debug,2, (&Debug,
! " Using user's shell=%s\n", shell));
}

/* if we aren't reading a folder then a state dump is meaningless */
--- 214,248 ----

int system_call(string, options, mailbox)
char *string;
! volatile int options;
struct MailboxView *mailbox;
{
/** execute 'string', setting uid to userid... **/

int pfd[2], stat, w;
int pid = -1;
! volatile int iteration;
/* figure out what shell we are using here */
S__ status;
! register SIGHAND_TYPE (*istat) P_((int)), (*qstat) P_((int));
#ifdef SIGTSTP
! register SIGHAND_TYPE (*oldstop) P_((int)), (*oldstart) P_((int));
#endif
! char *sh = "/bin/sh";

/* flush any pending output */
FlushBuffer();

DPRINT(Debug,2, (&Debug,
"System Call: command=%s\n", string));
+
if (options & SY_USER_SHELL) {
+ char * s = give_dt_estr_as_str(&shell_e,"shell");
+ if (s)
+ sh = s;
+
DPRINT(Debug,2, (&Debug,
! " Using user's shell=%s\n", sh));
}

/* if we aren't reading a folder then a state dump is meaningless */
***************
*** 275,281 ****
close(pfd[1]);
}
else if (pid == 0) {
! CONST char *sh = ((options & SY_USER_SHELL) ? shell : "/bin/sh");

/*
* Set group and user back to their original values.
--- 307,313 ----
close(pfd[1]);
}
else if (pid == 0) {
!

/*
* Set group and user back to their original values.
***************
*** 284,290 ****


if (-1 == setgid(groupid)) {
int err = errno;

fprintf(stderr,"system_call: setgid(%d) FAILED: %s\n",
! groupid,error_description(err));
fflush(stderr);
write(pfd[1], "", 1);
_exit(127);
--- 316,322 ----


if (-1 == setgid(groupid)) {
int err = errno;

fprintf(stderr,"system_call: setgid(%d) FAILED: %s\n",
! groupid,strerror(err));
fflush(stderr);
write(pfd[1], "", 1);
_exit(127);
***************
*** 292,298 ****


if (-1 == setuid(userid)) {
int err = errno;

fprintf(stderr,"system_call: setuid(%d) FAILED: %s\n",
! setuid,error_description(err));
fflush(stderr);
write(pfd[1], "", 1);
_exit(127);
--- 324,330 ----


if (-1 == setuid(userid)) {
int err = errno;

fprintf(stderr,"system_call: setuid(%d) FAILED: %s\n",
! userid,strerror(err));
fflush(stderr);
write(pfd[1], "", 1);
_exit(127);
***************
*** 357,365 ****
return(stat);
}

! void do_pipe(mailbox, page)


struct MailboxView *mailbox;
struct menu_context *page;

{
/** pipe the current message or tagged messages to
the specified sequence..
--- 389,398 ----
return(stat);
}

! void do_pipe(mailbox, page, prompt_area)


struct MailboxView *mailbox;
struct menu_context *page;
+ struct menu_context *prompt_area;

{
/** pipe the current message or tagged messages to
the specified sequence..
***************
*** 374,405 ****
int status;
int LINES, COLUMNS;
struct menu_context *cpage;

menu_get_sizes(page, &LINES, &COLUMNS);

/* TODO: Fix this mess ... */
prompt = catgets(elm_msg_cat, ElmSet, ElmPipeTo, "Pipe to: ");
! PutLine0(LINES-3, 0, prompt);
command[0] = '\0';
! status = optionally_enter(command, LINES-3, strlen(prompt),
OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */, sizeof command,
page);
while (status == REDRAW_MARK) {
! redraw = TRUE;
! PutLine0(LINES-1-2, 0, prompt);
! status = optionally_enter(command, LINES-3, strlen(prompt),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! OE_SIG_CHAR /* Ctrl-C */,

! sizeof command, page);

}
if (0 != status || command[0] == '\0') {
! MoveCursor(LINES-3,0);
! CleartoEOLN();

if (redraw)
menu_trigger_redraw(page);
return;
}

--- 407,447 ----
int status;
int LINES, COLUMNS;
struct menu_context *cpage;
+ int line;

menu_get_sizes(page, &LINES, &COLUMNS);

/* TODO: Fix this mess ... */
prompt = catgets(elm_msg_cat, ElmSet, ElmPipeTo, "Pipe to: ");
!
! menu_PutLine0(prompt_area,1, 0, prompt);
command[0] = '\0';
!
! /* FIXME --optionally_enter* should use prompt_area */
! line = menu_GetAbsLine(prompt_area,1);
! status = optionally_enter(command, line, strlen(prompt),
OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */, sizeof command,
page);
while (status == REDRAW_MARK) {
! menu_ClearScreen(prompt_area); /* Reset possible redraw flag */
!
! redraw = TRUE;
! menu_PutLine0(prompt_area,1, 0, prompt);
! status = optionally_enter(command, line, strlen(prompt),
! OE_REDRAW_MARK|OE_APPEND_CURRENT|


! OE_SIG_CHAR /* Ctrl-C */,

! sizeof command, page);

}
if (0 != status || command[0] == '\0') {
! menu_MoveCursor(prompt_area,1,0);
! menu_CleartoEOLN(prompt_area);

if (redraw)


menu_trigger_redraw(page);
+ else
+ menu_trigger_redraw(prompt_area);

return;
}

***************
*** 418,443 ****
redraw2:
InvalidateLocation();


! PutLineX(LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,

! ElmPressAnyKeyToReturn,
! "\n\nPress any key to return to ELM: "));

if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {

! goto redraw2;


}
! printf("\r\n");

Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
if (old_raw == ON)
! Raw(ON);

if (ret != 0)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReturnCodeWas,
! "Return code was %d."),
! ret);
!
!
menu_trigger_redraw(page);
return;
}
--- 460,487 ----
redraw2:
InvalidateLocation();

! menu_PutLineX(cpage,LINES-1, 0,
! CATGETS(elm_msg_cat, ElmSet,
! ElmPressAnyKeyToReturn,
! "\n\nPress any key to return to ELM: "));

if (menu_ReadCh(cpage, REDRAW_MARK) == REDRAW_MARK) {
+ menu_ClearScreen(cpage); /* Reset possible redraw flag */

! goto redraw2;


}
! menu_Write_to_screen(cpage,FRM("\r\n"));

!
Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
if (old_raw == ON)
! Raw(ON);

if (ret != 0)
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmReturnCodeWas,
! "Return code was %d."),
! ret);
!
!
menu_trigger_redraw(page);
return;
}
***************
*** 465,475 ****
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmPrintCantExecute,
"Can't execute \"print\": %.50s: %.30s"),


! test, error_description(err));

DPRINT(Debug,5, (&Debug,

"have_printout: no access %s: %s\n",test,


! error_description(err)));
sleep_message();
return_value = 0;
}

--- 509,519 ----
int err = errno;
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmPrintCantExecute,
"Can't execute \"print\": %.50s: %.30s"),


! test, strerror(err));

DPRINT(Debug,5, (&Debug,

"have_printout: no access %s: %s\n",test,


! strerror(err)));
sleep_message();
return_value = 0;
}

***************
*** 483,493 ****
return return_value;
}

! void print_text(pause_on_scroll, mailbox, header_page, page)
int pause_on_scroll;


struct MailboxView *mailbox;
- int header_page;
struct menu_context *page;
{

/* If redraw is needed use
menu_trigger_redraw(page)

--- 527,537 ----
return return_value;
}

! void print_text(pause_on_scroll, mailbox, page, header_area)
int pause_on_scroll;


struct MailboxView *mailbox;
struct menu_context *page;

+ struct menu_context *header_area;


{
/* If redraw is needed use
menu_trigger_redraw(page)
***************

*** 503,514 ****
int retcode = -1;
int res = 0;


struct run_state RS;
! CONST char * argv[4];

int mc;



struct menu_common MENU;
int LINES, COLUMNS;

menu_get_sizes(page,&LINES, &COLUMNS);

--- 547,559 ----
int retcode = -1;
int res = 0;


struct run_state RS;
! const char * argv[4];

int mc;



struct menu_common MENU;
int LINES, COLUMNS;

+ char *tmp;

menu_get_sizes(page,&LINES, &COLUMNS);

***************
*** 520,527 ****
if (!have_printout() || !mailbox)
return;

fname = elm_message(FRM("%sprintdecode-%d"),


! temp_dir, getpid ());

if (NULL == (tmpfp = safeopen_rdwr(fname))) {

lib_error(CATGETS(elm_msg_cat, MeSet, MeDecodeFailedCreate,
--- 565,576 ----
if (!have_printout() || !mailbox)
return;



+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ return;
+

fname = elm_message(FRM("%sprintdecode-%d"),


! tmp, getpid ());

if (NULL == (tmpfp = safeopen_rdwr(fname))) {

lib_error(CATGETS(elm_msg_cat, MeSet, MeDecodeFailedCreate,
***************
*** 573,581 ****
}
clearit(hdr->status, TAGGED); /* not tagged anymore */

! if (!redraw_it && pause_on_scroll)
! show_new_status(i, &MENU, header_page); /* update screen, if needed */
}
}
}
if (EOF == fclose(tmpfp))
--- 622,643 ----
}
clearit(hdr->status, TAGGED); /* not tagged anymore */

! if (!redraw_it) {


!
! if (header_area) {
! struct menu_common MENU;
! int vis;
!
! set_mcommon_from_mbxview(&MENU,mailbox);
!
! vis = compute_visible(i+1, &MENU);

! /* update screen, if needed */
! menu_header_status_update(header_area,vis-1);
! }
!
! }
}
+
}
}
if (EOF == fclose(tmpfp))
***************
*** 639,649 ****
menu_get_sizes(cpage,&LINES, &COLUMNS);

redraw:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPrintPressAKey,
! "\nPress any key to continue:"));
FlushBuffer();

if (menu_ReadCh(cpage,REDRAW_MARK) == REDRAW_MARK) {

redraw_it = TRUE;
goto redraw;
--- 701,713 ----
menu_get_sizes(cpage,&LINES, &COLUMNS);

redraw:
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmPrintPressAKey,
! "\nPress any key to continue:"));
FlushBuffer();

if (menu_ReadCh(cpage,REDRAW_MARK) == REDRAW_MARK) {
+ menu_ClearScreen(cpage); /* Reset possible redraw flag */

redraw_it = TRUE;
goto redraw;
***************
*** 675,681 ****
* above message from being wiped out by the command prompt.
*/
if (!pause_on_scroll)
! putchar('\n');

if (nlines> 1)
redraw_it = 1;
--- 739,745 ----
* above message from being wiped out by the command prompt.
*/
if (!pause_on_scroll)
! menu_Write_to_screen(page,FRM("\n"));

if (nlines> 1)
redraw_it = 1;
***************
*** 690,697 ****
if (fname)
free(fname);

! if (redraw_it)
! menu_trigger_redraw(page);
return;
}

--- 754,760 ----
if (fname)
free(fname);

!
return;
}

***************
*** 731,737 ****
char * filename = NULL;
int res = 0;


struct run_state RS;
! CONST char * argv[4];

char XX[sizeof printhdrs +10];

int LINES, COLUMNS;
--- 794,800 ----
char * filename = NULL;
int res = 0;


struct run_state RS;
! const char * argv[4];

char XX[sizeof printhdrs +10];

int LINES, COLUMNS;
***************
*** 767,777 ****
*/
if (in_string(printout, "%s")) {
char * printbuffer;
/*
* Temp file name used by "old style" printing.
*/
filename = elm_message(FRM("%s%s%d"),
! temp_dir, temp_print, getpid());

printbuffer = elm_message(FRM(printout), filename);

--- 830,845 ----
*/
if (in_string(printout, "%s")) {
char * printbuffer;
+

+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");

+ if (!tmp)
+ tmp = "/tmp/";
+

/*
* Temp file name used by "old style" printing.
*/
filename = elm_message(FRM("%s%s%d"),
! tmp, temp_print, getpid());

printbuffer = elm_message(FRM(printout), filename);

***************
*** 837,849 ****
cpage = Raw(ON | NO_TITE);
menu_get_sizes(cpage, &LINES, &COLUMNS);
redraw:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPrintPressAKey,
! "\nPress any key to continue:"));
FlushBuffer();

if (ReadCh(REDRAW_MARK) == REDRAW_MARK) {

- menu_trigger_redraw(page);
nlines = 2;
goto redraw;
}
--- 905,918 ----
cpage = Raw(ON | NO_TITE);
menu_get_sizes(cpage, &LINES, &COLUMNS);
redraw:
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmPrintPressAKey,
! "\nPress any key to continue:"));
FlushBuffer();

if (ReadCh(REDRAW_MARK) == REDRAW_MARK) {


+ menu_ClearScreen(page); /* Reset possible redraw flag */

nlines = 2;
goto redraw;
}
***************
*** 874,880 ****
* above message from being wiped out by the command prompt.
*/
if (!pause_on_scroll)
! putchar('\n');

done:
/* softkeys_on(); */
--- 943,949 ----
* above message from being wiped out by the command prompt.
*/
if (!pause_on_scroll)
! menu_Write_to_screen(page,FRM("\n"));

done:
/* softkeys_on(); */
***************
*** 922,930 ****
int create_folder_state_file(mailbox)
struct MailboxView *mailbox;
{
- int count, i;
FILE *fp;
- int sc;

/* format an environ param with the state file and pick out file name */
sprintf(folder_state_env_param, "%s=%s%s%d",
--- 991,997 ----
Index: elmME+.2.5.alpha5-cvs/src/utils.c
*** elmME+.2.5.alpha4/src/utils.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/utils.c 2005-07-20 19:49:50.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: utils.c,v 1.33.8.1 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: utils.c,v 1.33.8.2 2005/07/20 16:49:50 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 28,38 ****

void create_new_folders()
{
! /* this creates a new folders directory */

! (void) mkdir(folders, 0700);

! (void) elm_chown(folders, userid, groupid);
}

void create_new_elmdir()
--- 28,41 ----

void create_new_folders()


{
! /* give_dt_estr_as_str adds / to end */
! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");

! /* this creates a new folders directory */

! (void) mkdir(folders_val, 0700);
!
! (void) elm_chown(folders_val, userid, groupid);
}

void create_new_elmdir()
***************
*** 55,60 ****
--- 58,65 ----
*/
/*ARGSUSED*/
void malloc_failed_exit(proc, len)
+ char *proc;
+ unsigned len;
{
int LINES, COLUMNS;

***************
*** 92,107 ****


/* MoveCursor() is not safe on interrupt */

if (interrupt) {
! ClearScreen();

! Raw(OFF|RAW_FROM_SIGNAL);
} else {


- int LINES, COLUMNS;
-

- menu_get_sizes(default_context, &LINES, &COLUMNS);
-
-
- MoveCursor(LINES-1,0);
- NewLine();

Raw_OFF(0);
}
--- 97,105 ----


/* MoveCursor() is not safe on interrupt */

if (interrupt) {

! ClearScreen(0);
! Raw(OFF|RAW_FROM_SIGNAL);
} else {

Raw_OFF(0);
}
***************
*** 446,485 ****
}
#endif

! int get_page(msg_pointer, menu, header_page)
! int msg_pointer;
struct menu_common *menu;
! int *header_page;
{
! /** Ensure that 'current' is on the displayed page,
! returning NEW_PAGE iff the page changed! **/

! int first_on_page, last_on_page;


! int selected = mcommon_get_selected(menu);

- if (headers_per_page == 0)
- return(SAME_PAGE); /* What else can I do ? */

! first_on_page = ((*header_page) * headers_per_page) + 1;
!
! last_on_page = first_on_page + headers_per_page - 1;
!
! if (selected) /* but what is it on the SCREEN??? */
! msg_pointer = compute_visible(msg_pointer, menu);
!
! if (selected && msg_pointer > selected)
! return(SAME_PAGE); /* too far - page can't change! */

! if (msg_pointer > last_on_page) {
! *header_page = (int) (msg_pointer-1)/ headers_per_page;
! return(NEW_PAGE);
}
! else if (msg_pointer < first_on_page) {
! *header_page = (int) (msg_pointer-1) / headers_per_page;
! return(NEW_PAGE);
}
- else
- return(SAME_PAGE);
}

/*
--- 444,503 ----
}
#endif

! void get_page(menu, header_page)
struct menu_common *menu;
! struct menu_context *header_page;
{
! /** Ensure that 'current' is on the displayed page,**/



! int current = mcommon_get_current(menu);

! int top = menu_header_get(header_page,header_top_line);
! int topO = top;
! int j = menu_header_get(header_page,header_current);


! /* but what is it on the SCREEN??? */
! int msg_pointer = compute_visible(current, menu) -1;
!
! int li,co;
!
!
! if (j != msg_pointer) {
! DPRINT(Debug,5,(&Debug,
! "get_page: current %d: header_page current %d => %d\n",
! current,j,msg_pointer));
! menu_header_change(header_page, header_current,msg_pointer);
! }

!
! menu_get_sizes(header_page, &li, &co);
!
! if (msg_pointer >= top+li) {
! top = msg_pointer;
!
! DPRINT(Debug,5,(&Debug,
! "get_page: current %d: header_page top %d => %d\n",
! current,topO,top));
!
! menu_header_change(header_page, header_top_line,top);
}
!
! if (msg_pointer < top) {


!
! top -= li;
!

! if (msg_pointer < top)
! top = msg_pointer -2;
!

! if (top < 0)
! top = 0;
!

! DPRINT(Debug,5,(&Debug,
! "get_page: current %d: header_page top %d => %d\n",
! current,topO,top));
!
! menu_header_change(header_page, header_top_line,top);
}
}

/*
Index: elmME+.2.5.alpha5-cvs/utils/answer.c
*** elmME+.2.5.alpha4/utils/answer.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/answer.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: answer.c,v 1.16.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: answer.c,v 1.16.8.8 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.8 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 21,40 ****

**/
#include "def_utils.h"
#include "ndbz.h"
#include "s_answer.h"
#include "sysdefs.h"

#define ELM "elm" /* where the elm program lives */

- int user_data; /* fileno of user data file */
DBZ *hash; /* dbz file for same */

static int translate P_((char *fullname, char *name, int namesize));
- static void print_long P_((char *buffer,
- int init_len));

! char *get_alias_address(), *get_token(), *strip_parens(), *shift_lower();

static char *quit_word, *exit_word, *done_word, *bye_word;

--- 21,40 ----



**/
#include "def_utils.h"
+ #include "mailerlib.h"

#include "ndbz.h"
#include "s_answer.h"
#include "sysdefs.h"

#define ELM "elm" /* where the elm program lives */

DBZ *hash; /* dbz file for same */

static int translate P_((char *fullname, char *name, int namesize));

! static char *get_alias_address P_((char *name, int mailing, int depth));
! static char *get_token P_((char *string, const char *sepset, int depth));
!

static char *quit_word, *exit_word, *done_word, *bye_word;

***************
*** 42,47 ****
--- 42,48 ----



static char version_buff[NLEN];

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 94,99 ****
--- 95,104 ----
}
}

+ init_mailerlib();
+
+ user_init();
+ init_defaults();
read_rc_file(0);

elm_sfprintf(version_buff, sizeof version_buff,
***************
*** 156,164 ****
if (allow_name)
address = name;
else {
! printf(catgets(elm_msg_cat, AnswerSet, AnswerSorryNotFound,
! "Sorry, could not find '%s' [%s] in list!\n"),
! user_name, name);
goto prompt;
}
}
--- 161,169 ----
if (allow_name)
address = name;
else {
! lib_error(CATGETS(elm_msg_cat, AnswerSet, AnswerSorryNotFound,
! "Sorry, could not find '%s' [%s] in list!\n"),
! user_name, name);
goto prompt;
}
}
***************
*** 273,281 ****
fprintf(fd,"%s%s",buffer,in_line);
}

! printf(catgets(elm_msg_cat, AnswerSet, AnswerEnterMessage,
! "\n\nEnter message for %s ending with a blank line.\n\n"),
! user_name);

fprintf(fd,"\n\n");

--- 278,287 ----
fprintf(fd,"%s%s",buffer,in_line);
}

! elm_fprintf(stdout,
! CATGETS(elm_msg_cat, AnswerSet, AnswerEnterMessage,
! "\n\nEnter message for %s ending with a blank line.\n\n"),
! user_name);

fprintf(fd,"\n\n");

***************
*** 314,328 ****
#endif
fullname[i] = tolower(fullname[i]);

! if (fullname[i] == ' ')
! if (lastname) {
! printf(catgets(elm_msg_cat, AnswerSet, AnswerCannotHaveMoreNames,
! "** Can't have more than 'FirstName LastName' as address!\n"));
! return(0);
! }
! else
! lastname = i+1;
!
}

if (lastname)
--- 320,333 ----
#endif
fullname[i] = tolower(fullname[i]);

! if (fullname[i] == ' ') {
! if (lastname) {
! lib_error(CATGETS(elm_msg_cat, AnswerSet, AnswerCannotHaveMoreNames,
! "** Can't have more than 'FirstName LastName' as address!\n"));
! return(0);
! } else
! lastname = i+1;
! }
}

if (lastname)
***************
*** 346,353 ****
if ((hash = dbz_open(fname, O_RDONLY, 0)) == NULL)
exit(printf("** Fatal Error: Could not open %s!\n", fname));

- if ((user_data = open(fname, O_RDONLY)) == -1)
- return;
}

static int expand_group P_((
--- 351,356 ----
***************
*** 357,365 ****
int targetsize));


! char *get_alias_address(name, mailing, depth)
! char *name;
! int mailing, depth;
{
/** return the line from either datafile that corresponds
to the specified name. If 'mailing' specified, then
--- 360,371 ----
int targetsize));


! static char *get_alias_address P_((char *name,
! int mailing, int depth));
!
! static char *get_alias_address(name, mailing, depth)
! char *name;
! int mailing, depth;
{
/** return the line from either datafile that corresponds
to the specified name. If 'mailing' specified, then
***************
*** 367,400 ****
Depth is the nesting depth, and varies according to the
nesting level of the routine. **/

- static char buffer[VERY_LONG_STRING];
static char sprbuffer[VERY_LONG_STRING];
! datum key, value;
! int loc;
! struct alias_rec entry;
!
! name = shift_lower(name);
! key.dptr = name;
! key.dsize = strlen(name);
! value = dbz_fetch(hash, key);
! if (value.dptr == NULL)
! return( (char *) NULL); /* not found */
!
! bcopy(value.dptr, (char *) &loc, sizeof(loc));
! loc -= sizeof(entry);
! lseek(user_data, loc, 0L);
! read(user_data, (char *) &entry, sizeof(entry));
! read(user_data, buffer, entry.length > VERY_LONG_STRING ? VERY_LONG_STRING : entry.length);
! if ((entry.type & GROUP) != 0 && mailing) {
! if (expand_group(sprbuffer, buffer + (int) entry.address,
! depth, sizeof sprbuffer) < 0)
return NULL;
} else {
elm_sfprintf(sprbuffer, sizeof sprbuffer,
FRM("%s (%s)"),
! buffer + (int) entry.address,
! buffer + (int) entry.name);
}
return sprbuffer;
}

--- 373,402 ----
Depth is the nesting depth, and varies according to the
nesting level of the routine. **/

static char sprbuffer[VERY_LONG_STRING];
! struct alias_rec *entry1;
!
!
! entry1 = fetch_alias(hash,name);
!
! if (entry1 == NULL)
! return( NULL); /* not found */
!
! if ((entry1->type & GROUP) != 0 && mailing) {
! if (expand_group(sprbuffer, entry1->address,
! depth, sizeof sprbuffer) < 0) {
!
! free(entry1);
return NULL;
+ }
} else {
elm_sfprintf(sprbuffer, sizeof sprbuffer,
FRM("%s (%s)"),
! entry1->address,
! entry1->name);
}
+
+ free(entry1);
return sprbuffer;
}

***************
*** 445,469 ****
#undef NULL
#define NULL (char *) 0 /* for this routine only */

! char *get_token(string, sepset, depth)
! char *string, *sepset;
! int depth;
{

/** string is the string pointer to break up, sepstr are the
list of characters that can break the line up and depth
is the current nesting/recursion depth of the call **/

! register char *p, *q, *r;
static char *savept[MAX_RECURSION];

/** is there space on the recursion stack? **/

if (depth >= MAX_RECURSION) {
! fprintf(stderr, catgets(elm_msg_cat, AnswerSet, AnswerRecursionTooDeep,
! "Error: Get_token calls nested greater than %d deep!\n"),
! MAX_RECURSION);
! exit(1);
}

/* set up the pointer for the first or subsequent call */
--- 447,472 ----
#undef NULL
#define NULL (char *) 0 /* for this routine only */

! static char *get_token(string, sepset, depth)
! char *string;
! const char *sepset;
! int depth;
{

/** string is the string pointer to break up, sepstr are the
list of characters that can break the line up and depth
is the current nesting/recursion depth of the call **/

! char *p, *q, *r;
static char *savept[MAX_RECURSION];

/** is there space on the recursion stack? **/

if (depth >= MAX_RECURSION) {
! lib_error(CATGETS(elm_msg_cat, AnswerSet, AnswerRecursionTooDeep,
! "Error: Get_token calls nested greater than %d deep!\n"),
! MAX_RECURSION);
! exit(1);
}

/* set up the pointer for the first or subsequent call */
Index: elmME+.2.5.alpha5-cvs/utils/charmapcopy.c
*** elmME+.2.5.alpha4/utils/charmapcopy.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/utils/charmapcopy.c 2005-07-23 22:01:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: charmapcopy.c,v 1.5.8.1 2004/04/18 16:55:43 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.1 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: charmapcopy.c,v 1.5.8.3 2005/07/23 19:01:40 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 16,23 ****
int copydir_count = 0;

#include <errno.h>
extern int errno;
!
FILE *charmap_copy(name,pathname)
const char *name;
const char *pathname;
--- 16,24 ----
int copydir_count = 0;



#include <errno.h>
+ #ifndef ANSI_C

extern int errno;
! #endif
FILE *charmap_copy(name,pathname)
const char *name;
const char *pathname;
***************
*** 58,64 ****



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! pathname, error_description(errcode));

fclose(F);
return NULL;
--- 59,65 ----



lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),

! pathname, strerror(errcode));

fclose(F);
return NULL;
***************
*** 74,80 ****
int err = errno;


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorTryingToWrite,
"Error %s encountered trying to write to %s."),

! error_description(err),pathname);
fclose(F);
fclose(res);
return NULL;
--- 75,81 ----
int err = errno;


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmErrorTryingToWrite,
"Error %s encountered trying to write to %s."),

! strerror(err),pathname);
fclose(F);
fclose(res);
return NULL;
Index: elmME+.2.5.alpha5-cvs/utils/elmalias.c
*** elmME+.2.5.alpha4/utils/elmalias.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/elmalias.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.16.8.2 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.2 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmalias.c,v 1.16.8.5 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.16.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 71,80 ****
#include "s_elmalias.h"
#include <pwd.h>

- char *getenv();


- #ifndef ANSI_C
- struct passwd *getpwuid();
- #endif

/*
* Maximum number of alias files we can consult.
--- 71,76 ----
***************
*** 90,108 ****
/*
* "aliasdb" library routines.
*/
- extern struct alias_rec *fetch_alias();
- extern char *next_addr_in_list();



/*
* Local procedures.
*/

! DBZ *open_user_aliases(), *open_system_aliases();
! struct alias_rec *make_dummy_rec();
! void exp_print_alias(), print_alias();
! char *sel_alias_mem();
!

! void usage_error()
{
lib_error(CATGETS(elm_msg_cat, ElmaliasSet, ElmaliasUsage,
"usage: %s [-adenrsuvV] [-f format] [alias ...]\n"),
--- 86,106 ----
/*
* "aliasdb" library routines.
*/



/*
* Local procedures.
*/

! static DBZ *open_user_aliases P_((void));
! static DBZ *open_system_aliases P_((void));
! static struct alias_rec *make_dummy_rec P_((char *val));
! static void exp_print_alias P_((DBZ *dblist[], const char *fmt,
! struct alias_rec *ar));
! static void print_alias P_((const char *fmt, struct alias_rec *ar));
! static char *sel_alias_mem P_((struct alias_rec *ar,
! int sel));



! static void usage_error P_((void));
! static void usage_error()
{

lib_error(CATGETS(elm_msg_cat, ElmaliasSet, ElmaliasUsage,
"usage: %s [-adenrsuvV] [-f format] [alias ...]\n"),
***************
*** 112,119 ****
}


/*ARGSUSED*/


! void malloc_fail_handler(proc, size)
char *proc;
unsigned size;
{

--- 110,120 ----
}


+ static void malloc_fail_handler P_((char *proc, unsigned size));
+
+
/*ARGSUSED*/


! static void malloc_fail_handler(proc, size)
char *proc;
unsigned size;
{
***************

*** 133,143 ****



static char version_buff[NLEN];

int main(argc, argv)
int argc;
char *argv[];

{
! char *out_fmt; /* output printing format */
int do_user_alias; /* TRUE to examine user alias file */
int do_system_alias; /* TRUE to examine system alias file */
int do_expand; /* TRUE to recursively expand aliases */
--- 134,145 ----



static char version_buff[NLEN];

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];

{
! const char *out_fmt; /* output printing format */
int do_user_alias; /* TRUE to examine user alias file */
int do_system_alias; /* TRUE to examine system alias file */
int do_expand; /* TRUE to recursively expand aliases */
***************
*** 326,338 ****
}


! DBZ *open_system_aliases()
{
return dbz_open(system_data_file, O_RDONLY, 0);
}


! DBZ *open_user_aliases()
{
DBZ *db;
db = dbz_open(user_data_file, O_RDONLY, 0);
--- 328,340 ----
}


! static DBZ *open_system_aliases()
{
return dbz_open(system_data_file, O_RDONLY, 0);
}


! static DBZ *open_user_aliases()
{
DBZ *db;
db = dbz_open(user_data_file, O_RDONLY, 0);
***************
*** 343,358 ****
/*
* Cobble up an alias record structure to hold some address info.
*/
! struct alias_rec *make_dummy_rec(val)
char *val;
{
struct alias_rec *ar;
ar = (struct alias_rec *) safe_malloc(sizeof(struct alias_rec));
ar->status = 0;
ar->alias = val;
! ar->last_name = "";
! ar->name = "";
! ar->comment = "";
ar->address = val;
ar->type = 0;
ar->length = 0;
--- 345,360 ----
/*
* Cobble up an alias record structure to hold some address info.
*/
! static struct alias_rec *make_dummy_rec(val)
char *val;
{
struct alias_rec *ar;
ar = (struct alias_rec *) safe_malloc(sizeof(struct alias_rec));
ar->status = 0;
ar->alias = val;
! ar->last_name = safe_strdup("");
! ar->name = safe_strdup("");
! ar->comment = safe_strdup("");
ar->address = val;
ar->type = 0;
ar->length = 0;
***************
*** 363,372 ****
/*
* Recursively expand out a list of addresses and print the expansions.
*/
! void exp_print_alias(dblist, fmt, ar)
! DBZ *dblist[];
! char *fmt;
! struct alias_rec *ar;
{
char *abuf; /* list of addresses we can scribble upon */
char *acurr; /* pointer to current address within "abuf" */
--- 365,374 ----
/*
* Recursively expand out a list of addresses and print the expansions.
*/
! static void exp_print_alias(dblist, fmt, ar)
! DBZ *dblist[];
! const char *fmt;
! struct alias_rec *ar;
{
char *abuf; /* list of addresses we can scribble upon */
char *acurr; /* pointer to current address within "abuf" */
***************
*** 407,414 ****
* Print out alias information according to a format specification.
*/
void print_alias(fmt, ar)
! char *fmt;
! struct alias_rec *ar;
{
char pfmt[64]; /* buffer to hold "%m.ns" formats */
int in_conditional; /* TRUE if in middle of cond expression */
--- 409,416 ----
* Print out alias information according to a format specification.
*/
void print_alias(fmt, ar)
! const char *fmt;
! struct alias_rec *ar;
{
char pfmt[64]; /* buffer to hold "%m.ns" formats */
int in_conditional; /* TRUE if in middle of cond expression */
***************
*** 508,516 ****
/*
* Select a member of the alias record structure.
*/
! char *sel_alias_mem(ar, sel)
! struct alias_rec *ar;
! int sel;
{
switch (sel) {
case 'a':
--- 510,518 ----
/*
* Select a member of the alias record structure.
*/
! static char *sel_alias_mem(ar, sel)
! struct alias_rec *ar;
! int sel;
{
switch (sel) {
case 'a':
Index: elmME+.2.5.alpha5-cvs/utils/elmbindata.c
*** elmME+.2.5.alpha4/utils/elmbindata.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/elmbindata.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.5.8.2 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.2 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmbindata.c,v 1.5.8.6 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.5.8.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 15,24 ****

#include "reghelper.h"

DEBUG_VAR(Debug,__FILE__,"util");

int register_fd = -1;
! char * program_name = "elmbindata";

#include "charmapcopy.h"

--- 15,27 ----

#include "reghelper.h"

+ #if 0
DEBUG_VAR(Debug,__FILE__,"util");
+ #endif

int register_fd = -1;
! const char * program_name = "elmbindata";

! char * register_module = NULL;

#include "charmapcopy.h"

***************
*** 27,32 ****
--- 30,36 ----



static char version_buff[NLEN];

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 101,107 ****
text_target_dir);

if (register_fd != -1)
! log_it("M",text_target_dir,"-","-",0700);

} else if (EEXIST != errno) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeCantCreateDir,
--- 105,111 ----
text_target_dir);

if (register_fd != -1)
! log_it("M",text_target_dir,"-","-",0700,NULL);

} else if (EEXIST != errno) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeCantCreateDir,
Index: elmME+.2.5.alpha5-cvs/utils/elmcharset.c
*** elmME+.2.5.alpha4/utils/elmcharset.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/elmcharset.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.29.8.3 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmcharset.c,v 1.29.8.7 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.29.8.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 18,30 ****


extern char *optarg;
extern int optind;

! char * program_name = "elmcharset";
int register_fd = -1;

#include "charmapcopy.h"



static char version_buff[NLEN];

int main(argc, argv)
int argc;
char *argv[];

--- 18,32 ----


extern char *optarg;
extern int optind;

! const char * program_name = "elmcharset";


int register_fd = -1;
+ char * register_module = NULL;

#include "charmapcopy.h"



static char version_buff[NLEN];

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 80,86 ****


if (errcode != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! targetfile, error_description(errcode));
err++;
goto fail;
}

--- 82,88 ----


if (errcode != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! targetfile, strerror(errcode));
err++;
goto fail;
}
***************

*** 91,97 ****


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, error_description(errcode));
err++;
goto fail;
}
--- 93,99 ----


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, strerror(errcode));
err++;
goto fail;
}
***************
*** 100,106 ****


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, error_description(errcode));
err++;
goto fail;
}
--- 102,108 ----


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, strerror(errcode));
err++;
goto fail;
}
***************
*** 207,213 ****


if (errcode) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmp, error_description(errcode));

err++;
free(tmp);

--- 209,215 ----


if (errcode) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmp, strerror(errcode));

err++;
free(tmp);
***************

*** 218,224 ****


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmp, error_description(errcode));

err++;
free(tmp);

--- 220,226 ----


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmp, strerror(errcode));

err++;
free(tmp);
***************

*** 234,240 ****


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmp, error_description(errcode));

err++;
free(tmp);

--- 236,242 ----


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! tmp, strerror(errcode));

err++;
free(tmp);
***************

*** 244,250 ****


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! targetfile, error_description(errcode));

err++;
free(tmp);

--- 246,252 ----


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
"Failed to rename temporary file to %.50s: %.30s"),
! targetfile, strerror(errcode));

err++;
free(tmp);

Index: elmME+.2.5.alpha5-cvs/utils/elmlibregister.c
*** elmME+.2.5.alpha4/utils/elmlibregister.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/elmlibregister.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,11 ****
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.6.8.4 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Some code based on ../src/save_optc.c


* That code was following copyright:

*


* The Elm Mail System

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: elmlibregister.c,v 1.6.8.9 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.6.8.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Some code based on ../src/save_opts.c (but that code may be moved to
! * lib/write_rc.c)


* That code was following copyright:

*


* The Elm Mail System

***************
*** 15,20 ****
--- 16,22 ----
*****************************************************************************/



#include "def_utils.h"
+ #include "mailerlib.h"

#include "s_me.h"
#include "s_elm.h"
#include "s_elmrc.h"
***************
*** 24,39 ****

#include "reghelper.h"

DEBUG_VAR(Debug,__FILE__,"util");



extern char *optarg;
extern int optind;

int register_fd = -1;
! char * program_name = "elmrc-write";


static char version_buff[NLEN];

int main(argc, argv)
int argc;
char *argv[];

--- 26,45 ----

#include "reghelper.h"

+ #if 0
DEBUG_VAR(Debug,__FILE__,"util");
+ #endif



extern char *optarg;
extern int optind;

int register_fd = -1;
! const char * program_name = "elmrc-write";

! char * register_module = NULL;

static char version_buff[NLEN];

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 44,51 ****
int write_default = 0;
char * targetfile = NULL;
FILE * commentfile = NULL;
!
! int x;

#if DEBUG
init_debugfile("ELMLIBREGISTER");
--- 50,58 ----
int write_default = 0;
char * targetfile = NULL;
FILE * commentfile = NULL;
! char * elmrc_changes = NULL;
! struct elmrc_recorder * recorder = NULL;
! FILE * elmrc_changes_F = NULL;

#if DEBUG
init_debugfile("ELMLIBREGISTER");
***************
*** 54,60 ****

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:r:")) != EOF) {

switch(c) {
case 'G':
--- 61,67 ----

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:r:c:")) != EOF) {

switch(c) {
case 'G':
***************
*** 86,104 ****


if (errcode != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! targetfile, error_description(errcode));
err++;
goto fail;
}
}

break;

case 'C':
if (0 != access(optarg,READ_ACCESS)) {


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, error_description(errcode));
err++;
goto fail;
}
--- 93,142 ----


if (errcode != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! targetfile, strerror(errcode));
err++;
goto fail;
}
}

break;

+
+ case 'c':
+ elmrc_changes = optarg;
+ if (0 != access(elmrc_changes,WRITE_ACCESS)) {


+ int errcode = errno;
+

+ if (errcode != ENOENT) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ elmrc_changes, strerror(errcode));
+ err++;
+ goto fail;
+ }
+ }
+
+
+ elmrc_changes_F = open_or_create(elmrc_changes);
+ if (!elmrc_changes_F) {


+ int errcode = errno;
+

+ if (errcode != ENOENT) {
+ lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
+ "File %.50s is not writeable: %s"),
+ elmrc_changes, strerror(errcode));
+ err++;


+ goto fail;
+ }
+ }

+
+ break;
+
case 'C':
if (0 != access(optarg,READ_ACCESS)) {


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, strerror(errcode));
err++;
goto fail;
}
***************
*** 108,114 ****


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, error_description(errcode));
err++;
goto fail;

--- 146,152 ----


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, strerror(errcode));
err++;
goto fail;

***************
*** 123,128 ****
--- 161,175 ----
}

user_init();
+
+ if (elmrc_changes_F) {
+ recorder = enable_recorder(global ? SYSTEM_RC : LOCAL_RC);
+
+ seed_history(elmrc_changes_F,elmrc_changes,recorder);
+ }
+
+ init_mailerlib();
+
init_defaults();

elm_sfprintf(version_buff, sizeof version_buff,
***************
*** 161,174 ****
}


- if (!commentfile) {
- commentfile = fopen(ELMRC_INFO,"r");
- if (!commentfile)
- lib_error(CATGETS(elm_msg_cat, ElmrcSet,
- ElmrcSavingWithoutComments,
- "Warning: saving without comments! Can't get to %s."),
- ELMRC_INFO);
- }

if (targetfile && write_default) {
lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcNoBothwI,
--- 208,213 ----
***************
*** 182,394 ****


if (targetfile) {
- char * tmp = elm_message(FRM("%s.N"),targetfile);
- int errcode = can_open(tmp,"w");
- int x;
- FILE *f;

!
! if (errcode) {
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
err++;
- free(tmp);
goto fail;
}
- f = fopen(tmp,"w");
- if (!f) {
- int errcode = errno;
- lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
- "File %.50s is not writeable: %s"),
- tmp, error_description(errcode));
-
- err++;
- free(tmp);


- goto fail;
- }
-

- elm_fprintf(f,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoLIB,
- "# Saved automatically by ELMLIBREGISTER %s\n#\n\n"),
- version_buff);
-
-
- if (commentfile) {
- char line_buffer[SLEN];
- int x;
- int len;
- int local_value;
- int skip = 1;
-
- while (0 < (len =
- mail_gets(line_buffer, sizeof line_buffer,
- commentfile))) {
-
- int y = 0;
-
-
- if (line_buffer[len-1] != '\n') {
- DPRINT(Debug,1,(&Debug,
- "Too long line (read len=%d): %s\n",
- len,line_buffer));
- break;
- }
- line_buffer[--len] = '\0';
- if (0 == len)
- continue;

! if ('#' == line_buffer[0] || whitespace(line_buffer[0])) {
!
! if (strncmp(line_buffer, "#$HDR", 5) == 0) {
! skip = 0;
! continue;
! }
!
! if (skip)
! continue;
!
! /* Copy initial comments */
!
! fprintf(f,"%s\n",line_buffer);
! continue;
! }
! skip = 1;
!
!
! for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
! y = strcmp(line_buffer, save_info[x].name);
! if (y <= 0)
! break;
! }
!
! if (x >= NUMBER_OF_SAVEABLE_OPTIONS || y != 0) {
!
! DPRINT(Debug,15,(&Debug,
! "Skipping option %s ... \n",
! line_buffer));


!
! continue;
! }
!

! if (global &&
! ! (save_info[x].flags & FL_CHANGED) &&
! ! (save_info[x].flags & FL_SYS)) {
! DPRINT(Debug,15,(&Debug,
! "Skipping user option %s ... \n",
! line_buffer));


!
! continue;
! }
!

! if (!global &&


! (save_info[x].flags & FL_SYS)) {

! DPRINT(Debug,15,(&Debug,
! "Skipping system option %s ... \n",
! line_buffer));


!
! continue;
! }
!

! fprintf(f,"\n");
!
! /* Copy comments */
! while (0 < (len =
! mail_gets(line_buffer, sizeof line_buffer,
! commentfile))) {
! if ('#' != line_buffer[0])
! break;
! fputs(line_buffer,f);
! }
!
! if (global)
! local_value = save_info[x].flags & FL_CHANGED;
! else
! local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"main",
! "Bad config item type",0);
!
! save_info[x].dt_type->print_value(f,
! & save_info[x],
! !local_value);
!
!
! save_info[x].flags |= FL_SAVED;
! }
! }
!
! for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
! int local_value;
!
!
! if (save_info[x].flags & FL_SAVED)
! continue;
!
! if (global &&
! ! (save_info[x].flags & FL_CHANGED) &&
! ! (save_info[x].flags & FL_SYS)) {
! DPRINT(Debug,15,(&Debug,
! "Skipping user option %s ... \n",
! save_info[x].name));


!
! continue;
! }
!

! if (!global &&


! (save_info[x].flags & FL_SYS)) {

! DPRINT(Debug,15,(&Debug,
! "Skipping system option %s ... \n",
! save_info[x].name));


!
! continue;
! }
!

! fprintf(f,"\n");
!
! if (global)
! local_value = save_info[x].flags & FL_CHANGED;
! else
! local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"main",
! "Bad config item type",0);
!
! save_info[x].dt_type->print_value(f,
! & save_info[x],
! !local_value);
! }

! print_local_shared_options(f,global);

! if (EOF == fclose(f)) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
! err++;
! free(tmp);
! goto fail;
! }
! if (0 != rename(tmp,targetfile)) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
! "Failed to rename temporary file to %.50s: %.30s"),
! targetfile, error_description(errcode));
!
! err++;
! free(tmp);
! goto fail;
! }

! log_config(targetfile);

- free(tmp);
}

fail:
if (commentfile)
fclose(commentfile);

--- 221,254 ----


if (targetfile) {

! int r = write_rc(targetfile,commentfile,global,
! "ELMLIBREGISTER",NULL,version_buff);
!
! if (!r) {
err++;
goto fail;
}

! log_config(targetfile);
! }

! if (elmrc_changes_F) {
! rewind(elmrc_changes_F);

! #ifdef FTRUNCATE
! /* Not really necessary */
! ftruncate(fileno(elmrc_changes_F),0);
! #endif

! print_history_changed(elmrc_changes_F,recorder);

}

fail:
+ if (elmrc_changes_F)
+ fclose(elmrc_changes_F);
+
if (commentfile)
fclose(commentfile);

Index: elmME+.2.5.alpha5-cvs/utils/elmrc-write.c
*** elmME+.2.5.alpha4/utils/elmrc-write.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/utils/elmrc-write.c 2005-07-26 11:28:47.000000000 +0300
***************
*** 1,11 ****
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.13.8.4 2004/09/26 15:18:32 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.4 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Some code based on ../src/save_optc.c


* That code was following copyright:

*


* The Elm Mail System

--- 1,12 ----
! static char rcsid[] = "@(#)$Id: elmrc-write.c,v 1.13.8.9 2005/07/26 08:28:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.13.8.9 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************

! * Some code based on ../src/save_optc.c (but that code may be moved to
! * lib/write_rc.c)


* That code was following copyright:

*


* The Elm Mail System

***************
*** 24,39 ****

#include "reghelper.h"

DEBUG_VAR(Debug,__FILE__,"util");



extern char *optarg;
extern int optind;

int register_fd = -1;
! char * program_name = "elmrc-write";


static char version_buff[NLEN];

int main(argc, argv)
int argc;
char *argv[];

--- 25,44 ----

#include "reghelper.h"

+ #if 0
DEBUG_VAR(Debug,__FILE__,"util");
+ #endif



extern char *optarg;
extern int optind;

int register_fd = -1;
! const char * program_name = "elmrc-write";

! char * register_module = NULL;

static char version_buff[NLEN];

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];
***************

*** 44,49 ****
--- 49,58 ----
int write_default = 0;
char * targetfile = NULL;
FILE * commentfile = NULL;
+ char * elmrc_changes = NULL;
+ struct elmrc_recorder * recorder = NULL;
+ FILE * elmrc_changes_F = NULL;
+

#if DEBUG
init_debugfile("ELMRC-WRITE");
***************
*** 52,58 ****

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:r:")) != EOF) {

switch(c) {
case 'G':
--- 61,67 ----

REGHELPER_INIT(argv[0]);

! while ((c = getopt(argc, argv, "GId:w:C:r:c:")) != EOF) {

switch(c) {
case 'G':
***************
*** 84,102 ****


if (errcode != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! targetfile, error_description(errcode));
err++;
goto fail;
}
}

break;

case 'C':
if (0 != access(optarg,READ_ACCESS)) {


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, error_description(errcode));
err++;
goto fail;
}
--- 93,143 ----


if (errcode != ENOENT) {
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
"File %.50s is not writeable: %s"),
! targetfile, strerror(errcode));

! err++;
! goto fail;


! }
! }
! break;
!

! case 'c':
! elmrc_changes = optarg;
! if (0 != access(elmrc_changes,WRITE_ACCESS)) {
! int errcode = errno;
!
! if (errcode != ENOENT) {
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! elmrc_changes, strerror(errcode));
! err++;
! goto fail;
! }
! }
!
!
! elmrc_changes_F = open_or_create(elmrc_changes);
! if (!elmrc_changes_F) {
! int errcode = errno;
!
! if (errcode != ENOENT) {
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! elmrc_changes, strerror(errcode));
err++;
goto fail;
}
}
+
break;

+
+
case 'C':
if (0 != access(optarg,READ_ACCESS)) {


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, strerror(errcode));
err++;
goto fail;
}
***************
*** 106,112 ****


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, error_description(errcode));
err++;
goto fail;

--- 147,153 ----


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),

! optarg, strerror(errcode));
err++;
goto fail;

***************
*** 121,126 ****
--- 162,174 ----
}

user_init();
+
+ if (elmrc_changes_F) {
+ recorder = enable_recorder(global ? SYSTEM_RC : LOCAL_RC);
+
+ seed_history(elmrc_changes_F,elmrc_changes,recorder);
+ }
+
init_defaults();

elm_sfprintf(version_buff, sizeof version_buff,
***************
*** 156,162 ****


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),
! argv[optind], error_description(errcode));

err++;
goto fail;
}
--- 204,210 ----


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),
! argv[optind], strerror(errcode));

err++;
goto fail;
}
***************
*** 166,172 ****


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),
! argv[optind], error_description(errcode));

err++;
goto fail;
}
--- 214,220 ----


int errcode = errno;
lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotReadable,
"File %.50s is not readable: %s"),
! argv[optind], strerror(errcode));

err++;
goto fail;
}
***************
*** 180,193 ****
goto fail;
}

- if (!commentfile) {
- commentfile = fopen(ELMRC_INFO,"r");
- if (!commentfile)
- lib_error(CATGETS(elm_msg_cat, ElmrcSet,
- ElmrcSavingWithoutComments,
- "Warning: saving without comments! Can't get to %s."),
- ELMRC_INFO);
- }

if (targetfile && write_default) {
lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcNoBothwI,
--- 228,233 ----
***************
*** 199,415 ****
if (write_default)
targetfile = global ? system_rc_file : user_rc_file;


if (targetfile) {
- char * tmp = elm_message(FRM("%s.N"),targetfile);
- int errcode = can_open(tmp,"w");
- int x;
- FILE *f;

!
! if (errcode) {
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
err++;
- free(tmp);
goto fail;
}
- f = fopen(tmp,"w");
- if (!f) {
- int errcode = errno;
- lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
- "File %.50s is not writeable: %s"),
- tmp, error_description(errcode));
-
- err++;
- free(tmp);


- goto fail;
- }
-

- elm_fprintf(f,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoWrite,
- "# Saved automatically by ELMRC-WRITE %s\n#\n\n"),
- version_buff);
-
-
- if (commentfile) {
- char line_buffer[SLEN];
- int x;
- int len;
- int local_value;
- int skip = 1;
-
- while (0 < (len =
- mail_gets(line_buffer, sizeof line_buffer,
- commentfile))) {
-
- int y = 0;
-
-
- if (line_buffer[len-1] != '\n') {
- DPRINT(Debug,1,(&Debug,
- "Too long line (read len=%d): %s\n",
- len,line_buffer));
- break;
- }
- line_buffer[--len] = '\0';
- if (0 == len)
- continue;
-
- if ('#' == line_buffer[0] || whitespace(line_buffer[0])) {
-
- if (strncmp(line_buffer, "#$HDR", 5) == 0) {
- skip = 0;
- continue;
- }
-
- if (skip)
- continue;
-
- /* Copy initial comments */

! fprintf(f,"%s\n",line_buffer);
! continue;
! }
! skip = 1;
!
!
! for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
! y = strcmp(line_buffer, save_info[x].name);
! if (y <= 0)
! break;
! }
!
! if (x >= NUMBER_OF_SAVEABLE_OPTIONS || y != 0) {
!
! DPRINT(Debug,15,(&Debug,
! "Skipping option %s ... \n",
! line_buffer));


!
! continue;
! }
!

! if (global &&
! ! (save_info[x].flags & FL_CHANGED) &&
! ! (save_info[x].flags & FL_SYS)) {
! DPRINT(Debug,15,(&Debug,
! "Skipping user option %s ... \n",
! line_buffer));


!
! continue;
! }
!

! if (!global &&


! (save_info[x].flags & FL_SYS)) {

! DPRINT(Debug,15,(&Debug,
! "Skipping system option %s ... \n",
! line_buffer));


!
! continue;
! }
!

! fprintf(f,"\n");
!
! /* Copy comments */
! while (0 < (len =
! mail_gets(line_buffer, sizeof line_buffer,
! commentfile))) {
! if ('#' != line_buffer[0])
! break;
! fputs(line_buffer,f);
! }
!
! if (global)
! local_value = save_info[x].flags & FL_CHANGED;
! else
! local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"main",
! "Bad config item type",0);
!
! save_info[x].dt_type->print_value(f,
! & save_info[x],
! !local_value);
!
!
! save_info[x].flags |= FL_SAVED;
! }
! }
!
! for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
! int local_value;
!
!
! if (save_info[x].flags & FL_SAVED)
! continue;
!
! if (global &&
! ! (save_info[x].flags & FL_CHANGED) &&
! ! (save_info[x].flags & FL_SYS)) {
! DPRINT(Debug,15,(&Debug,
! "Skipping user option %s ... \n",
! save_info[x].name));


!
! continue;
! }
!

! if (!global &&


! (save_info[x].flags & FL_SYS)) {

! DPRINT(Debug,15,(&Debug,
! "Skipping system option %s ... \n",
! save_info[x].name));
!
! continue;
! }

- fprintf(f,"\n");

! if (global)
! local_value = save_info[x].flags & FL_CHANGED;
! else
! local_value = save_info[x].flags & FL_LOCAL;
! if (RCTYPE_magic != save_info[x].dt_type->magic)
! panic("RC PANIC",__FILE__,__LINE__,"main",
! "Bad config item type",0);
!
! save_info[x].dt_type->print_value(f,
! & save_info[x],
! !local_value);
! }

! #ifdef USE_DLOPEN
! print_local_shared_options(f,global);
#endif

! if (EOF == fclose(f)) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotWriteable,
! "File %.50s is not writeable: %s"),
! tmp, error_description(errcode));
!
! err++;
! free(tmp);
! goto fail;
! }
! if (0 != rename(tmp,targetfile)) {
! int errcode = errno;
! lib_error(CATGETS(elm_msg_cat, MeSet, MeFileNotRenamed,
! "Failed to rename temporary file to %.50s: %.30s"),
! targetfile, error_description(errcode));
!
! err++;
! free(tmp);


! goto fail;
! }
!

! log_config(targetfile);

- free(tmp);
}

fail:
if (commentfile)
fclose(commentfile);

--- 239,276 ----
if (write_default)
targetfile = global ? system_rc_file : user_rc_file;

+

if (targetfile) {

! int r = write_rc(targetfile,commentfile,global,
! "ELMRCWRITE", NULL, version_buff);
!
! if (!r) {
err++;
goto fail;
}

! log_config(targetfile);
! }


! if (elmrc_changes_F) {
! rewind(elmrc_changes_F);

! #ifdef FTRUNCATE
! /* Not really necessary */
! ftruncate(fileno(elmrc_changes_F),0);
#endif

! print_history_changed(elmrc_changes_F,recorder);

}

fail:
+ if (elmrc_changes_F)
+ fclose(elmrc_changes_F);
+
if (commentfile)
fclose(commentfile);

Index: elmME+.2.5.alpha5-cvs/utils/elmregister.c
*** elmME+.2.5.alpha4/utils/elmregister.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/utils/elmregister.c 2005-07-26 11:28:47.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.15.8.2 2004/08/07 18:07:20 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.2 $ $State: Exp $
*

* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: elmregister.c,v 1.15.8.7 2005/07/26 08:28:47 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.15.8.7 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI> (was hurtt...@ozone.FMI.FI)
*****************************************************************************/
***************

*** 17,23 ****
* installer root given on $ELM_ROOT
*
* filenames are relative to $ELM_ROOT
! *
*
* -- copy file
*
--- 17,25 ----
* installer root given on $ELM_ROOT
*
* filenames are relative to $ELM_ROOT
! *
! * -- module
! * 'm' module {rest of line}
*
* -- copy file
*
***************
*** 51,57 ****

/* putenv.c */
#ifndef PUTENV
! xtern int putenv P_((char *));
#endif

/* strstr.c */
--- 53,59 ----

/* putenv.c */
#ifndef PUTENV
! extern int putenv P_((char *));
#endif

/* strstr.c */
***************
*** 79,99 ****
#endif

static char * filelist = SYSTEM_DEFAULT_FILELIST;
! static char * stage_dir = STAGE_DIR;
! static char * register_pipe = "$ELM_INSTALLER"; /* To be assigned */
int register_fd = -1;
! static char * installer_root = "$ELM_ROOT"; /* To be assigned */

! char * program_name = "elmregister"; /* To be assigned */

static int create_pipe P_((int argc, char *argv[], int x, int *PID,
! char *root));
! static int create_pipe(argc,argv,x,PID,root)
int argc;
char *argv[];
int x;
int *PID;
! char *root;
{
static char array[] = "ELM_INSTALLER=XXXX";
int filedes[2];
--- 81,103 ----
#endif

static char * filelist = SYSTEM_DEFAULT_FILELIST;
! static const char * stage_dir = STAGE_DIR;
! static const char * register_pipe = "$ELM_INSTALLER"; /* To be assigned */
int register_fd = -1;
! static const char * installer_root = "$ELM_ROOT"; /* To be assigned */

! const char * program_name = "elmregister"; /* To be assigned */


! char * register_module = NULL;

static int create_pipe P_((int argc, char *argv[], int x, int *PID,
! const char *root, char *module));
! static int create_pipe(argc,argv,x,PID,root,module)
int argc;
char *argv[];
int x;
int *PID;
! const char *root;
! char *module;
{
static char array[] = "ELM_INSTALLER=XXXX";
int filedes[2];
***************
*** 120,125 ****
--- 124,130 ----
int l = strlen(root) + 12;
char *array2 = malloc(l);

+
sprintf(array,"ELM_INSTALLER=%d",filedes[1]);

if (!array2) {
***************
*** 138,143 ****
--- 143,161 ----
exit(1);
}

+ if (module) {
+ int l = strlen(root) + 15;
+ char *array3 = malloc(l);
+
+ sprintf(array3,"ELM_MODULE=%s",module);
+
+ if (0 != putenv(array3)) {
+ fprintf(stderr,"%s: putenv() failed\n",program_name);
+ exit(1);
+ }
+
+ }
+
close(filedes[0]); /* read end */

fprintf(stdout,"%s: Running %s ...\n",
***************
*** 162,171 ****

#define MAX_ARGS 300

! static void make_package_dir P_((char *y,char *root));
static void make_package_dir(y,root)
char *y;
! char *root;
{
int l = strlen(root);

--- 180,189 ----

#define MAX_ARGS 300

! static void make_package_dir P_((char *y,const char *root));
static void make_package_dir(y,root)
char *y;
! const char *root;
{
int l = strlen(root);

***************
*** 206,212 ****
--- 224,233 ----
char * buffer;
int buffer_len;

+ char * module_ptr;
+
int command_letter;
+ char * command_ptr;

/* Following points to space on buffer ... */

***************
*** 275,280 ****
--- 296,317 ----

}

+ static void parse_log_tail P_((
+ struct log_record *l,
+ char buffer1[MAX_PIPE_LOG +10 ],
+
+ int ptr,
+
+ int module_ptr,
+ int command_ptr,
+ int user_ptr,
+ int group_ptr,
+ int mode_ptr,
+
+ int args_ptr[MAX_ARGS],
+ int argnum));
+
+
static void parse_log P_((FILE *F, struct log_record *l));
static void parse_log(F,l)
FILE *F;
***************
*** 287,295 ****

int c = fgetc(F);

! int user_ptr = -1;
! int group_ptr = -1;
! int mode_ptr = -1;

int args_ptr[MAX_ARGS];
int argnum = 0;
--- 324,334 ----

int c = fgetc(F);

! int module_ptr = -1;
! int command_ptr = -1;
! int user_ptr = -1;
! int group_ptr = -1;
! int mode_ptr = -1;

int args_ptr[MAX_ARGS];
int argnum = 0;
***************
*** 297,302 ****
--- 336,344 ----
l->buffer = NULL;
l->buffer_len = 0;

+
+ l->module_ptr = NULL;
+ l->command_ptr = NULL;
l->user_ptr = NULL;
l->group_ptr = NULL;
l->mode_ptr = NULL;
***************
*** 312,318 ****

ungetc(c,F); /* add_bytes reread character */

! add_bytes(F,buffer1,&ptr);

if (buffer1[0] != c) {
fprintf(stderr,"%s: Character %c not buffered (reading from pipe or file)\n",
--- 354,360 ----

ungetc(c,F); /* add_bytes reread character */

! command_ptr = ptr; add_bytes(F,buffer1,&ptr);

if (buffer1[0] != c) {
fprintf(stderr,"%s: Character %c not buffered (reading from pipe or file)\n",
***************
*** 320,325 ****
--- 362,375 ----
exit(1);
}

+ if ('m' == c) {
+
+ module_ptr = ptr; add_bytes(F,buffer1,&ptr); /* module */
+ command_ptr = ptr; add_bytes(F,buffer1,&ptr); /* command */
+ c = buffer1[command_ptr];
+
+ }
+
l->command_letter = c;

switch (c) {
***************
*** 355,361 ****
args_ptr[0] = ptr; add_bytes(F,buffer1,&ptr); /* file1 file */
args_ptr[1] = ptr; add_bytes(F,buffer1,&ptr); /* file2 file */
argnum = 2;
!
case 'R':
case 'E':

--- 405,412 ----
args_ptr[0] = ptr; add_bytes(F,buffer1,&ptr); /* file1 file */
args_ptr[1] = ptr; add_bytes(F,buffer1,&ptr); /* file2 file */
argnum = 2;
! break;
!
case 'R':
case 'E':

***************
*** 419,426 ****
--- 470,506 ----

}

+ parse_log_tail(l,buffer1,ptr,module_ptr,command_ptr,user_ptr,
+ group_ptr,mode_ptr,args_ptr,argnum);
+
+ }
+
+ static void parse_log_tail(l,buffer1,ptr,module_ptr,command_ptr,user_ptr,
+ group_ptr,mode_ptr,args_ptr,argnum)
+ struct log_record *l;
+ char buffer1[MAX_PIPE_LOG +10 ]; /* write routines quarantee that
+ this is enough! */
+
+ int ptr;
+
+ int module_ptr;
+ int command_ptr;
+ int user_ptr;
+ int group_ptr;
+ int mode_ptr;
+
+ int args_ptr[MAX_ARGS];
+ int argnum;
+ {
+
memcpy(l->buffer,buffer1,l->buffer_len);

+ if (module_ptr != -1)
+ l->module_ptr = l->buffer + module_ptr;
+
+ if (command_ptr != -1)
+ l->command_ptr = l->buffer + command_ptr;
+
if (user_ptr != -1)
l->user_ptr = l->buffer + user_ptr;

***************
*** 600,606 ****
if (!last -> version) {
fprintf(stderr,
"%s: Failed to strdup string (%d bytes?): %s\n",
! program_name,ptr-1,my_version);

fclose(LI->file);
exit(1); /* FAILURE */
--- 680,686 ----
if (!last -> version) {
fprintf(stderr,
"%s: Failed to strdup string (%d bytes?): %s\n",
! program_name,ptr-buffer-1,my_version);

fclose(LI->file);
exit(1); /* FAILURE */
***************
*** 752,762 ****
}
}

! static char * make_rooted P_((struct log_record * ptr, char *rel, char *root));
static char * make_rooted(ptr,rel,root)
struct log_record * ptr;
char *rel;
! char *root;
{
int L = strlen(root);
int l = strlen(rel) + 2 + L;
--- 832,843 ----
}
}

! static char * make_rooted P_((struct log_record * ptr, char *rel,
! const char *root));
static char * make_rooted(ptr,rel,root)
struct log_record * ptr;
char *rel;
! const char *root;
{
int L = strlen(root);
int l = strlen(rel) + 2 + L;
***************
*** 786,796 ****
return translated;
}

! static void remove_unlinked P_((struct log_instance *target,char *root,
int *remove_count));
static void remove_unlinked(target,root,remove_count)
struct log_instance *target;
! char *root;
int *remove_count;
{
int i;
--- 867,878 ----
return translated;
}

! static void remove_unlinked P_((struct log_instance *target,
! const char *root,
int *remove_count));
static void remove_unlinked(target,root,remove_count)
struct log_instance *target;
! const char *root;
int *remove_count;
{
int i;
***************
*** 974,980 ****


int w;
S__ status;

! FILE *fd;
struct log_entries * last = NULL;

struct stat X;

--- 1056,1062 ----


int w;
S__ status;

! FILE *fd = NULL;
struct log_entries * last = NULL;

struct stat X;
***************

*** 985,1002 ****

clear_log_instance(&LI);

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {

! filelist = argv[x+1];
! x += 2;
}

- if (x < argc -1 && 0 == strcmp("-R", argv[x])) {

! installer_root = argv[x+1];
! x += 2;
! } else
! installer_root = "/";

if ('\0' == installer_root[0]) {
fprintf(stderr,"%s: -R '' invalid\n",
--- 1067,1099 ----

clear_log_instance(&LI);

! installer_root = "/";

! while (x < argc && '-' == argv[x][0]) {
!
! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
!
! filelist = argv[x+1];
! x += 2;
! } else if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
!
! installer_root = argv[x+1];
! x += 2;
! } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
!
! register_module = argv[x+1];
! x += 2;
!
! } else {
! fprintf(stderr,
! "%s: Bad option %s\n",
! program_name,argv[x]);
! exit(1);
! }
}


!

if ('\0' == installer_root[0]) {
fprintf(stderr,"%s: -R '' invalid\n",


***************
*** 1026,1041 ****
}


-

- read_pipe = create_pipe(argc,argv,x,&PID,installer_root);


-
- fd = fdopen(read_pipe,"r");
- if (!fd) {
- fprintf(stderr,"%s: fdopen() failed\n",program_name);
- close(read_pipe);
- return 1; /* FAILURE */
- }
-
/* We use open instead of fopen so that we can create file

and not truncate existing file
*/
--- 1123,1128 ----
***************
*** 1083,1089 ****


fprintf(stderr,
"%s: Failed to create or open file %s on %s: %s\n",
program_name,filelist,installer_root, LI.filename);
- fclose(fd);
return 1; /* FAILURE */

}

--- 1170,1175 ----
***************
*** 1094,1100 ****


if (! LI.file) {
fprintf(stderr,"%s: fdopen() failed\n",program_name);
close(t);
- fclose(fd);
return 1; /* FAILURE */
}

--- 1180,1185 ----
***************
*** 1107,1113 ****


"%s: File %s is not elmregister filelist\n",
program_name,LI.filename);
close(t);
- fclose(fd);
return 1; /* FAILURE */
}

--- 1192,1197 ----
***************
*** 1117,1122 ****
--- 1201,1220 ----



last = add_last(&LI);

+
+
+
+ read_pipe = create_pipe(argc,argv,x,&PID,installer_root,register_module);
+
+ fd = fdopen(read_pipe,"r");
+ if (!fd) {
+ fprintf(stderr,"%s: fdopen() failed\n",program_name);
+ close(read_pipe);

+ return 1; /* FAILURE */
+ }
+
+
+
log_copy_loop(fd,&LI,last);

remove_unlinked(&LI,installer_root,&remove_count);
***************
*** 1127,1133 ****


fprintf(stderr,
"%s: Write(?) failed on closing of file: %s\n",
program_name,LI.filename);
- fclose(fd);
return 1; /* FAILURE */
}

--- 1225,1230 ----
***************
*** 1155,1161 ****
return 0;
}

! static char * rel_path = ""; /* Path to prepended
to log written on pipe
?? is this needed ??
*/
--- 1252,1258 ----
return 0;
}

! static const char * rel_path = ""; /* Path to prepended
to log written on pipe
?? is this needed ??


*/
***************
*** 1385,1391 ****

static void copy_dir P_((char *src,char *trg, char *rel,
struct log_instance *LI,
! struct log_entries * last));

#ifdef DIROPS

--- 1482,1489 ----

static void copy_dir P_((char *src,char *trg, char *rel,
struct log_instance *LI,
! struct log_entries * last,
! char *register_module));

#ifdef DIROPS

***************
*** 1396,1407 ****
#include <sys/dir.h>
#endif /* DIROPS == USE_SYSDIR */

! static void copy_dir(src,trg,rel,LI,last)
char *src;
char *trg;
char *rel;
struct log_instance *LI;
struct log_entries * last;
{
DIR * handle;

--- 1494,1506 ----
#include <sys/dir.h>
#endif /* DIROPS == USE_SYSDIR */

! static void copy_dir(src,trg,rel,LI,last, register_module)
char *src;
char *trg;
char *rel;
struct log_instance *LI;
struct log_entries * last;
+ char *register_module;
{
DIR * handle;

***************
*** 1538,1544 ****
strcat(relname,entryname);

if (!last)
! log_it("s",relname,"-","-", X.st_mode & 0777);
else {


char buffer[ MAX_PIPE_LOG];
char *ptr;

--- 1637,1644 ----
strcat(relname,entryname);

if (!last)
! log_it("s",relname,"-","-", X.st_mode & 0777,
! register_module);
else {


char buffer[ MAX_PIPE_LOG];
char *ptr;

***************
*** 1546,1561 ****
int rname = strlen(relname);
int L;
struct log_record L1;
! int ptrs[4];

sprintf(mode_s,"%05o",X.st_mode & 0777);

ptr = buffer;
! add_to_buffer(buffer, sizeof buffer,&ptr,"s",1);
! ptrs[0] = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"-",1);
! ptrs[1] = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"-",1);
! ptrs[2] = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,mode_s,5);
! ptrs[3] = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,relname,rname);

/* NO terminating NL to buffer */

--- 1646,1681 ----
int rname = strlen(relname);
int L;
struct log_record L1;
!
!
! int module_ptr = -1;
! int command_ptr = -1;
! int user_ptr = -1;
! int group_ptr = -1;
! int mode_ptr = -1;
! int args_ptr[1];
! int argnum = 0;

sprintf(mode_s,"%05o",X.st_mode & 0777);

+
+
+
ptr = buffer;
! if (register_module) {
! int l = strlen(register_module);
! add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);
!
! module_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,
! register_module,l);
! }
!
! command_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"s",1);
! user_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"-",1);
! group_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,"-",1);
! mode_ptr = ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,mode_s,5);
! args_ptr[argnum++] =
! ptr-buffer; add_to_buffer(buffer, sizeof buffer,&ptr,relname,rname);

/* NO terminating NL to buffer */

***************
*** 1566,1592 ****
program_name,L);
exit(1);
}
!
! L1.buffer = malloc(L);
! if (! L1.buffer) {
! fprintf(stderr,"%s: malloc %d bytes failed\n",
! program_name,L);
! exit(1); /* FAILURE */
! }
! L1.buffer_len = L;
! memcpy(L1.buffer,buffer,L);
L1.command_letter = 's';
! L1.user_ptr = L1.buffer + ptrs[0];
! L1.group_ptr = L1.buffer + ptrs[1];
! L1.mode_ptr = L1.buffer + ptrs[2];
! L1.arg_ptrs = malloc(2 * sizeof(L1.arg_ptrs[0]));
! if (! L1.arg_ptrs) {
! fprintf(stderr,"%s: malloc %d items failed\n",
! program_name,2);
! exit(1);
! }
! L1.arg_ptrs[0] = L1.buffer + ptrs[3];
! L1.arg_ptrs[1] = NULL;

last -> log = realloc(last -> log,
(last -> log_count+1) *
--- 1686,1696 ----
program_name,L);
exit(1);
}
!
!
L1.command_letter = 's';
! parse_log_tail(&L1,buffer,L,module_ptr,command_ptr,user_ptr,
! group_ptr,mode_ptr,args_ptr,argnum);

last -> log = realloc(last -> log,
(last -> log_count+1) *
***************
*** 1631,1642 ****

#else

! static void copy_dir(src,trg, char *rel,LI,last)
char *src;
char *trg;
char *rel;
struct log_instance *LI;
struct log_entries * last;
{
char * x = strrchr(trg,'/');
int w;
--- 1735,1747 ----

#else

! static void copy_dir(src,trg, char *rel,LI,last,register_module)
char *src;
char *trg;
char *rel;
struct log_instance *LI;
struct log_entries * last;
+ char *register_module;
{
char * x = strrchr(trg,'/');
int w;
***************
*** 1701,1711 ****

#endif /* DIROPS */

! static void make_argcopy P_((char *arg, int arg_len, char * stage_subdir ));
! static void make_argcopy(arg,arg_len, stage_subdir)
char *arg;
int arg_len;
char * stage_subdir;
{
struct stat X;

--- 1806,1818 ----

#endif /* DIROPS */

! static void make_argcopy P_((char *arg, int arg_len, char * stage_subdir,
! char *register_module));
! static void make_argcopy(arg,arg_len, stage_subdir, register_module)
char *arg;
int arg_len;
char * stage_subdir;
+ char *register_module;
{
struct stat X;

***************
*** 1752,1760 ****


if (0 != R)
! log_it(arg,source_r,"-", "-", 0444);
else
! log_it(arg,source_r,"-", "-", X.st_mode & 0777);

free(source_r);
free(source_f);
--- 1859,1868 ----


if (0 != R)
! log_it(arg,source_r,"-", "-", 0444, register_module);
else
! log_it(arg,source_r,"-", "-", X.st_mode & 0777,
! register_module);

free(source_r);
free(source_f);
***************
*** 1853,1861 ****
#endif
) {

! copy_dir(bufferz,target_f,target_r,NULL,NULL);

! log_it(arg,target_r,"-", "-", X.st_mode & 0777);

}
else {
--- 1961,1970 ----
#endif
) {

! copy_dir(bufferz,target_f,target_r,NULL,NULL,register_module);

! log_it(arg,target_r,"-", "-", X.st_mode & 0777,
! register_module);

}
else {
***************
*** 1870,1876 ****
exit(1); /* FAILURE */
}

! log_it(arg,target_r,"-", "-", X.st_mode & 0777);
}


--- 1979,1986 ----
exit(1); /* FAILURE */
}

! log_it(arg,target_r,"-", "-", X.st_mode & 0777,
! register_module);
}


***************
*** 1882,1888 ****

}

-
static int command P_((int argc, char *argv[], int x));
static int command(argc, argv, x)
int argc;
--- 1992,1997 ----
***************
*** 1948,1980 ****



return 1; /* FAILURE */
}

!
! if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
! int l;
!
! rel_path = argv[x+1];
! x += 2;
!
! l = strlen(rel_path);
!
! if (l > 0 && '/' != rel_path[l-1]) {
! char * X = malloc(l+2);
! if (!X) {
! fprintf(stderr,"%s: malloc %d bytes failed\n",
! argv[0],l+2);
! return 1; /* FAILURE */
}

! strncpy(X,rel_path,l+2);
! X[l] = '/';

- fprintf(stdout,"%s: Adding / to -R %s: %s\n",
- argv[0],rel_path,X);
- rel_path = X;
}
-
}

/* COPY mode ?? */


--- 2057,2102 ----



return 1; /* FAILURE */
}

!
! while (x < argc && '-' == argv[x][0]) {
!
! if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
! int l;
!
! rel_path = argv[x+1];
! x += 2;
!
! l = strlen(rel_path);
!
! if (l > 0 && '/' != rel_path[l-1]) {
! char * X = malloc(l+2);
! if (!X) {
! fprintf(stderr,"%s: malloc %d bytes failed\n",
! argv[0],l+2);
! return 1; /* FAILURE */
! }
!
! strncpy(X,rel_path,l+2);
! X[l] = '/';
!
! fprintf(stdout,"%s: Adding / to -R %s: %s\n",
! argv[0],rel_path,X);
! rel_path = X;
}
+
+ } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
+
+ register_module = argv[x+1];
+ x += 2;
+
+ } else {

! break;

}
}

+
/* COPY mode ?? */


***************
*** 2030,2035 ****
--- 2152,2164 ----
}

ptr = buffer;
+
+ if (register_module) {
+ int l = strlen(register_module);


+ add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);

+ add_to_buffer(buffer, sizeof buffer,&ptr,register_module,l);
+ }
+
add_to_buffer(buffer, sizeof buffer,&ptr,"R",1);
for (j = 0; j < i; j++) {
int l = strlen(relative[j]);
***************
*** 2117,2122 ****
--- 2246,2256 ----


ptr = buffer;
+ if (register_module) {
+ int l = strlen(register_module);


+ add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);

+ add_to_buffer(buffer, sizeof buffer,&ptr,register_module,l);
+ }
add_to_buffer(buffer, sizeof buffer,&ptr,"L",1);
for (j = 0; j < i; j++) {
int l = strlen(relative[j]);
***************
*** 2306,2312 ****


return 1; /* FAILURE */
}

! log_it("M",target_r,s_user, s_group, f_mode);


free(target_r); free(target_f);
--- 2440,2447 ----


return 1; /* FAILURE */
}

! log_it("M",target_r,s_user, s_group, f_mode,
! register_module);


free(target_r); free(target_f);
***************
*** 2388,2396 ****
}

if (0 == strcmp("copydoc",cmd))
! log_it("d",target_r,s_user, s_group, f_mode);
else
! log_it("F",target_r,s_user, s_group, f_mode);

free(source_r); free(source_f);
free(target_r); free(target_f);
--- 2523,2531 ----
}

if (0 == strcmp("copydoc",cmd))
! log_it("d",target_r,s_user, s_group, f_mode, register_module);
else
! log_it("F",target_r,s_user, s_group, f_mode, register_module);

free(source_r); free(source_f);
free(target_r); free(target_f);
***************
*** 2408,2414 ****
int L = 4;

if (x < argc -1 && 0 == strcmp("-s", argv[x])) {
- int l;

stage_subdir = argv[x+1];
x += 2;
--- 2543,2548 ----
***************
*** 2426,2432 ****
int z;
if ('{' == argv[j][0] && (z = strlen(argv[j])) && '}' == argv[j][z-1]) {

! make_argcopy(argv[j],z, stage_subdir);
}

L += strlen(argv[j]) +1;
--- 2560,2566 ----
int z;
if ('{' == argv[j][0] && (z = strlen(argv[j])) && '}' == argv[j][z-1]) {

! make_argcopy(argv[j],z, stage_subdir,register_module);
}

L += strlen(argv[j]) +1;
***************
*** 2439,2444 ****
--- 2573,2583 ----
}

ptr = buffer;
+ if (register_module) {
+ int l = strlen(register_module);


+ add_to_buffer(buffer, sizeof buffer,&ptr,"m",1);

+ add_to_buffer(buffer, sizeof buffer,&ptr,register_module,l);
+ }
add_to_buffer(buffer, sizeof buffer,&ptr,"E",1);
for (j = x; j < argc; j++) {
int l = strlen(argv[j]);
***************
*** 2607,2622 ****
return translated;
}


static int copy_list P_((struct log_entries *entry,
struct log_instance *source,
struct log_instance *target,
! struct log_entries *last));
! static int copy_list(entry,source,target,last)
struct log_entries *entry;
struct log_instance *source;
struct log_instance *target;
struct log_entries *last;
{
struct log_record * ptr;
int L = strlen(installer_root);
--- 2746,2797 ----
return translated;
}

+ static int filter_record P_((struct log_record *record,
+ char **module, int match_all));
+ static int filter_record(record,module,match_all)
+ struct log_record *record;
+ char **module;
+ int match_all;
+ {
+ int i;
+ if (module && module[0] &&
+ 0 == strcmp(module[0], "all"))
+ return 1;
+
+ if (! record->module_ptr) {
+ if (!module)
+ return 1;
+

+ return 0;
+ }
+

+ if (match_all &&
+ 0 == strcmp(record->module_ptr,"all"))
+ return 1;
+
+ if (!module)
+ return 0;
+
+ for (i = 0; module[i]; i++) {
+ if (0 == strcmp(record->module_ptr,
+ module[i]))


+ return 1;
+ }
+

+ return 0;
+ }

static int copy_list P_((struct log_entries *entry,
struct log_instance *source,
struct log_instance *target,
! struct log_entries *last,
! char **module));
! static int copy_list(entry,source,target,last, module)
struct log_entries *entry;
struct log_instance *source;
struct log_instance *target;
struct log_entries *last;
+ char **module;
{
struct log_record * ptr;
int L = strlen(installer_root);
***************
*** 2631,2636 ****
--- 2806,2814 ----
int mode;
int is_dir;

+ if (! filter_record(ptr,module,1))
+ continue;
+
switch (ptr->command_letter) {
char *trg;

***************
*** 2818,2823 ****
--- 2996,3076 ----
return 0;
}

+
+ static struct log_record * on_other_module P_((struct log_instance *LI,
+ char *entry,
+ char **module));
+ static struct log_record * on_other_module(LI,entry,module)
+ struct log_instance *LI;
+ char *entry;
+ char **module;


+ {
+ int i;
+

+ for (i = 0; i < LI->entries_count; i++) {
+
+ struct log_record * ptr;
+
+ for (ptr = LI->entries[i].log;
+ ptr < LI->entries[i].log +
+ LI->entries[i].log_count; ptr++) {
+
+
+ /* Check if entry is mentioned on filtered module */
+
+ if (!filter_record(ptr,module,1)) {
+
+ switch (ptr->command_letter) {
+
+ case '\0': /* ENTRY DELETED */
+ break;
+
+ case '{':
+ case 's':
+ case 'F':
+ case 'd':
+ case 'C':
+ case 'M':
+
+ if (ptr->arg_ptrs && ptr->arg_ptrs[0] &&
+ 0 == strcmp(ptr->arg_ptrs[0],entry))
+ return ptr;
+
+ break;
+
+ case 'L':
+
+ /* second argument is new name */
+
+ if (ptr->arg_ptrs && ptr->arg_ptrs[1] &&
+ 0 == strcmp(ptr->arg_ptrs[1],entry))
+ return ptr;
+
+ break;
+
+ case 'E':
+ /* execute ... */
+ break;
+
+ case 'R':
+ /* remove ... */
+ break;
+
+
+ default:
+ fprintf(stderr,
+ "%s: [on_other_module] Bad command letter: %c \n",
+ program_name,ptr->command_letter);


+
+ }
+ }
+ }
+ }

+
+ return NULL;
+ }
+
+
static int on_current P_((struct log_instance *LI,char *entry));
static int on_current(LI,entry)
struct log_instance *LI;
***************
*** 2893,2906 ****
}

static void trim_list P_((struct log_entries *entry,
! struct log_instance *source));
! static void trim_list(entry,source)
struct log_entries *entry;
struct log_instance *source;
{
struct log_record * ptr;

for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {

switch (ptr->command_letter) {

--- 3146,3165 ----
}

static void trim_list P_((struct log_entries *entry,
! struct log_instance *source,
! char **module));
! static void trim_list(entry,source,module)
struct log_entries *entry;
struct log_instance *source;
+ char **module;
{
struct log_record * ptr;

for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {
+
+ if (! filter_record(ptr,module,0))
+ continue;
+

switch (ptr->command_letter) {

***************
*** 2975,2984 ****


static int unstage_list P_((struct log_entries *entry,
! struct log_instance *source));
! static int unstage_list(entry,source)
struct log_entries *entry;
struct log_instance *source;
{
int exit_stat = 0;
struct log_record * ptr;
--- 3234,3245 ----


static int unstage_list P_((struct log_entries *entry,
! struct log_instance *source,
! char **module));
! static int unstage_list(entry,source,module)
struct log_entries *entry;
struct log_instance *source;
+ char **module;
{
int exit_stat = 0;
struct log_record * ptr;
***************
*** 2986,2991 ****
--- 3247,3257 ----

for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {
int ok = 0;
+
+ if (! filter_record(ptr,module,0))
+ continue;
+
+
switch (ptr->command_letter) {

case '\0': /* ENTRY DELETED */
***************
*** 3001,3007 ****
--- 3267,3278 ----
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

+
if (0 == strncmp(stage_dir,ab,X)) {
+
+ struct log_record *other =
+ on_other_module(source,ptr->arg_ptrs[0],module);
+
struct stat X;

if (stat(ab,&X) < 0)
***************
*** 3022,3028 ****
}
} else {

! if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Stage file %s uninstalled\n",
program_name,ab);
--- 3293,3308 ----
}
} else {

! if (other) {
!
! fprintf(stdout,
! "%s: Keeping stage file %s, used by %s package/module\n",
! program_name,ab,
! other->module_ptr ? other->module_ptr : "main");
!
! ok = 1; /* Remove double reference */
!
! } else if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Stage file %s uninstalled\n",
program_name,ab);
***************
*** 3069,3087 ****

}

static int uninstall_list P_((struct log_entries *entry,
! struct log_instance *source));
! static int uninstall_list(entry,source)
struct log_entries *entry;
struct log_instance *source;
{
int exit_stat = 0;
struct log_record * ptr;
- int X = strlen(stage_dir);

for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {
int ok = 0;

switch (ptr->command_letter) {

case '\0': /* ENTRY DELETED */
--- 3349,3375 ----

}

+ static dev_t this_program_dev = 0;
+ static ino_t this_program_ino = 0;
+ static int this_program = 0;
+
static int uninstall_list P_((struct log_entries *entry,
! struct log_instance *source,
! char **module));
! static int uninstall_list(entry,source,module)
struct log_entries *entry;
struct log_instance *source;
+ char **module;
{
int exit_stat = 0;
struct log_record * ptr;

for (ptr = entry->log; ptr < entry->log + entry->log_count; ptr++) {
int ok = 0;

+ if (! filter_record(ptr,module,0))
+ continue;
+
switch (ptr->command_letter) {

case '\0': /* ENTRY DELETED */
***************
*** 3094,3101 ****
if (ptr->arg_ptrs && ptr->arg_ptrs[1]) {

char *ab = make_absolute(ptr,ptr->arg_ptrs[1]);

! if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Link %s uninstalled\n",
program_name,ab);
--- 3382,3440 ----
if (ptr->arg_ptrs && ptr->arg_ptrs[1]) {

char *ab = make_absolute(ptr,ptr->arg_ptrs[1]);
+ struct log_record *other =
+ on_other_module(source,ptr->arg_ptrs[1],module);
+
+ struct stat X;
+
+ if (stat(ab,&X) < 0) {
+
+ if (ENOENT == errno)
+ ok = 1;
+ else {
+ fprintf(stderr,
+ "%s: Can't stat %s\n",
+ program_name,ab);
+ exit_stat = 1;
+ }
+
+ } else if (
+
+ #ifdef S_ISLNK
+ ! S_ISREG(X.st_mode)
+ #else
+ S_IFREG != (X.st_mode & S_IFMT)


+ #endif
+ ) {
+

+ fprintf(stderr,
+ "%s: Name %s is not regular file (link)\n",
+ program_name,ab);
+
+ } else if (other) {
+
+ fprintf(stdout,
+ "%s: Keeping link %s, used by %s package/module\n",
+ program_name,ab,
+ other->module_ptr ? other->module_ptr : "main");
+
+ ok = 1; /* Remove double reference */
+
+ } else if ((!module || !module[0] ||
+ 0 != strcmp(module[0],"all")) &&
+ (
+ (X.st_dev == this_program_dev &&
+ X.st_ino == this_program_ino)
+ ||
+ 0 == strcmp(program_name,ab))) {
+
+ fprintf(stdout,
+ "%s: Keeping link %s, is this program\n",
+ program_name,ab);
+
+ this_program++;

! } else if (0 == unlink(ab)) {
fprintf(stdout,
"%s: Link %s uninstalled\n",
program_name,ab);
***************
*** 3143,3149 ****
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

! if (0 == unlink(ab)) {
fprintf(stdout,
"%s: File %s uninstalled\n",
program_name,ab);
--- 3482,3539 ----
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

! struct log_record *other =
! on_other_module(source,ptr->arg_ptrs[0],module);
!
! struct stat X;
!
! if (stat(ab,&X) < 0) {
!
! if (ENOENT == errno)
! ok = 1;
! else {
! fprintf(stderr,
! "%s: Can't stat %s\n",
! program_name,ab);
! exit_stat = 1;

! }
!
! } else if (

!
! #ifdef S_ISREG
! ! S_ISREG(X.st_mode)
! #else
! S_IFREG != (X.st_mode & S_IFMT)


! #endif
! ) {
!

! fprintf(stderr,
! "%s: Name %s is not regular file\n",
! program_name,ab);
!
! } else if (other) {
!
! fprintf(stdout,
! "%s: Keeping file %s, used by %s package/module\n",
! program_name,ab,
! other->module_ptr ? other->module_ptr : "main");
!
! ok = 1; /* Remove double reference */
!
! } else if ((!module || !module[0] || 0 != strcmp(module[0],"all")) &&
! (
! (X.st_dev == this_program_dev &&
! X.st_ino == this_program_ino)
! ||
! 0 == strcmp(program_name,ab))) {
!
! fprintf(stdout,
! "%s: Keeping file %s, is this program\n",
! program_name,ab);
!
! this_program++;
!
! } else if (0 == unlink(ab)) {
fprintf(stdout,
"%s: File %s uninstalled\n",
program_name,ab);
***************
*** 3166,3183 ****
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

! if (0 == unlink(ab)) {
! fprintf(stdout,
! "%s: Config file %s uninstalled\n",
! program_name,ab);
! ok = 1;
! } else if (ENOENT == errno)
! ok = 1;
! else {
! fprintf(stdout,
! "%s: Can't unlink %s\n",
! program_name,ab);
! exit_stat = 1;
}

free(ab);
--- 3556,3611 ----
if (ptr->arg_ptrs && ptr->arg_ptrs[0]) {
char *ab = make_absolute(ptr,ptr->arg_ptrs[0]);

! struct log_record *other =
! on_other_module(source,ptr->arg_ptrs[0],module);
!
! struct stat X;
!
! if (stat(ab,&X) < 0) {
!
! if (ENOENT == errno)
! ok = 1;
! else {
! fprintf(stderr,
! "%s: Can't stat %s\n",
! program_name,ab);
! exit_stat = 1;

! }
!
! } else if (

!
! #ifdef S_ISREG
! ! S_ISREG(X.st_mode)
! #else
! S_IFREG != (X.st_mode & S_IFMT)


! #endif
! ) {
!

! fprintf(stderr,
! "%s: Name %s is not regular file\n",
! program_name,ab);
!
! } else if (other) {
!
! fprintf(stdout,
! "%s: Keeping config file %s, used by %s package/module\n",
! program_name,ab,
! other->module_ptr ? other->module_ptr : "main");
!
! ok = 1; /* Remove double reference */
!
! } else if (0 == unlink(ab)) {
! fprintf(stdout,
! "%s: Config file %s uninstalled\n",
! program_name,ab);
! ok = 1;
! } else if (ENOENT == errno)
! ok = 1;
! else {
! fprintf(stdout,
! "%s: Can't unlink %s\n",
! program_name,ab);
! exit_stat = 1;
}

free(ab);
***************
*** 3215,3226 ****
static int replay_list P_((struct log_entries *entry,
struct log_instance *source,
struct log_instance *target,
! struct log_entries * last));
! static int replay_list(entry,source,target,last)
struct log_entries *entry;
struct log_instance *source;
struct log_instance *target;
struct log_entries * last;
{
struct log_record * ptr;
struct log_record * LAST_ARG = NULL;
--- 3643,3656 ----
static int replay_list P_((struct log_entries *entry,
struct log_instance *source,
struct log_instance *target,
! struct log_entries * last,
! char **module));
! static int replay_list(entry,source,target,last, module)
struct log_entries *entry;
struct log_instance *source;
struct log_instance *target;
struct log_entries * last;
+ char **module;
{
struct log_record * ptr;
struct log_record * LAST_ARG = NULL;
***************
*** 3237,3242 ****
--- 3667,3677 ----
*/
ptr = & entry->log[n];

+ if (! filter_record(ptr,module,1)) {
+ LAST_ARG = NULL;
+ continue;
+ }
+
switch (ptr->command_letter) {

case '\0': /* ENTRY DELETED */
***************
*** 3293,3301 ****

for (k = LAST_ARG; k < ptr; k++) {
if ('{' == k->command_letter &&
! k->buffer &&
0 == strcmp(ptr->arg_ptrs[i],
! k->buffer))
break;
}

--- 3728,3736 ----

for (k = LAST_ARG; k < ptr; k++) {
if ('{' == k->command_letter &&
! k->command_ptr &&
0 == strcmp(ptr->arg_ptrs[i],
! k->command_ptr))
break;
}

***************
*** 3324,3330 ****

} else if (is_dir) {

! copy_dir(src,trg,k->arg_ptrs[0],target,last);

} else {

--- 3759,3766 ----

} else if (is_dir) {

! copy_dir(src,trg,k->arg_ptrs[0],target,last,
! k->module_ptr);

} else {

***************
*** 3398,3404 ****
fprintf(stdout,"\n");
fflush(stdout);

! pipefd = create_pipe(i,translated,0,&pid,"/");

fd = fdopen(pipefd,"r");
if (!fd) {
--- 3834,3841 ----
fprintf(stdout,"\n");
fflush(stdout);

! pipefd = create_pipe(i,translated,0,&pid,"/",
! ptr->module_ptr);

fd = fdopen(pipefd,"r");
if (!fd) {
***************
*** 3457,3462 ****
--- 3894,3902 ----
ptr < entry->log + entry->log_count;
ptr++) {

+ if (! filter_record(ptr,module,1))
+ continue;
+
switch (ptr->command_letter) {
char *X;
struct passwd * p;
***************
*** 3633,3638 ****
--- 4073,4081 ----
struct log_instance LI_target;


struct log_entries * last = NULL;

+ char **module_filter = NULL;
+ int module_count = 0;
+
int remove_count;

#if ANSI_C
***************
*** 3646,3663 ****
clear_log_instance(&LI_source);
clear_log_instance(&LI_target);

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {

! filelist = argv[x+1];
! x += 2;
! }

! if (x < argc -1 && 0 == strcmp("-R", argv[x])) {

! installer_root = argv[x+1];
! x += 2;
! } else
! installer_root = "/";

if (stat(installer_root,&X) < 0) {
fprintf(stderr,"%s: -R %s invalid\n",
--- 4089,4132 ----
clear_log_instance(&LI_source);
clear_log_instance(&LI_target);

! installer_root = "/";

! while (x < argc && '-' == argv[x][0]) {

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
!
! filelist = argv[x+1];
! x += 2;
! } else if (x < argc -1 && 0 == strcmp("-R", argv[x])) {

! installer_root = argv[x+1];
! x += 2;
! } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
!
! module_filter = realloc(module_filter,
! (module_count+2) *
! sizeof (module_filter[0]));
!
! if (! module_filter) {
! fprintf(stderr,
! "%s: Failed to realloc -M option\n",
! program_name);


! exit(1);
! }
!
!

! module_filter[module_count++] = argv[x+1];
! module_filter[module_count] = NULL;
! x += 2;
!
! } else {
! fprintf(stderr,
! "%s: Bad option %s\n",
! program_name,argv[x]);


! exit(1);
! }
! }
!

if (stat(installer_root,&X) < 0) {
fprintf(stderr,"%s: -R %s invalid\n",
***************
*** 3678,3683 ****
--- 4147,4161 ----

return 1; /* FAILURE */
}
+
+ if (x < argc) {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);
+ exit(1);
+ }
+
+

LI_source.filename = filelist;
if (0 != strcmp(installer_root,"/")) {
***************
*** 3770,3776 ****
if (0 == strcmp(LI_source.entries[i].version, my_version)) {

r = copy_list(& LI_source.entries[i], &LI_source, &LI_target,
! last);
if (0 != r)
goto fail;
} else {
--- 4248,4254 ----
if (0 == strcmp(LI_source.entries[i].version, my_version)) {

r = copy_list(& LI_source.entries[i], &LI_source, &LI_target,
! last, module_filter);
if (0 != r)
goto fail;
} else {
***************
*** 3798,3804 ****

/* EXECUTE commands and fix permissions */
r = replay_list(&LI_source.entries[LI_source.entries_count-1],
! &LI_source,target,last);

/* Trim files marked for other versions ...
LAST entry is current so not need handle it ...
--- 4276,4283 ----

/* EXECUTE commands and fix permissions */
r = replay_list(&LI_source.entries[LI_source.entries_count-1],
! &LI_source,target,last,
! module_filter);

/* Trim files marked for other versions ...
LAST entry is current so not need handle it ...
***************
*** 3807,3813 ****
for (i = 0; i < target->entries_count-1; i++) {
if (0 != strcmp(target->entries[i].version, my_version)) {

! trim_list(& target->entries[i], target);
}
}

--- 4286,4292 ----
for (i = 0; i < target->entries_count-1; i++) {
if (0 != strcmp(target->entries[i].version, my_version)) {

! trim_list(& target->entries[i], target, module_filter);
}
}

***************
*** 3838,3843 ****
--- 4317,4327 ----
int remove_count;
int i;

+ char **module_filter = NULL;
+ int module_count = 0;
+
+ struct stat X;
+
#if ANSI_C
char my_version[] = "[ELM" VERSION " " PATCHLEVEL "]";
#else
***************
*** 3848,3859 ****

clear_log_instance(&LI);

- if (x < argc -1 && 0 == strcmp("-F", argv[x])) {

! filelist = argv[x+1];
! x += 2;
}

LI.filename = filelist;
LI.file = fopen(LI.filename,"r+");
if (!LI.file) {
--- 4332,4394 ----

clear_log_instance(&LI);


! while (x < argc && '-' == argv[x][0]) {
!
! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
!
! filelist = argv[x+1];
! x += 2;
!
! } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
!
! module_filter = realloc(module_filter,
! (module_count+2) *
! sizeof (module_filter[0]));
!
! if (! module_filter) {
! fprintf(stderr,
! "%s: Failed to realloc -M option\n",
! program_name);
! exit(1);
! }
!
! module_filter[module_count++] = argv[x+1];
! module_filter[module_count] = NULL;
! x += 2;
!
! } else {
! fprintf(stderr,
! "%s: Bad option %s\n",
! program_name,argv[x]);
! exit(1);
! }
! }
!
! if (x < argc) {
! fprintf(stderr,
! "%s: Bad option %s\n",
! program_name,argv[x]);
! exit(1);
! }
!
! if (module_count != 1 ||
! 0 != strcmp(module_filter[0],"all")) {
!
! if (stat(program_name,&X) < 0) {
! fprintf(stderr,
! "%s: Failed to stat this program name -- needed to avoid unistalling this program\n",
! program_name);
!
! r = 1;
! } else {
! this_program_dev = X.st_dev;
! this_program_ino = X.st_ino;
! }
}

+
+
LI.filename = filelist;
LI.file = fopen(LI.filename,"r+");
if (!LI.file) {
***************
*** 3880,3888 ****
remove_unlinked(&LI,"/",&remove_count);

for (i = 0; i < LI.entries_count; i++) {
! if (0 != unstage_list(& LI.entries[i], &LI))
r = 1;
! if (0 != uninstall_list(& LI.entries[i], &LI))
r = 1;
}

--- 4415,4423 ----
remove_unlinked(&LI,"/",&remove_count);

for (i = 0; i < LI.entries_count; i++) {
! if (0 != unstage_list(& LI.entries[i], &LI,module_filter))
r = 1;
! if (0 != uninstall_list(& LI.entries[i], &LI,module_filter))
r = 1;
}

***************
*** 3895,3901 ****


return 1; /* FAILURE */
}

! fail:
return r;
}

--- 4430,4442 ----
return 1; /* FAILURE */
}

! if (this_program) {
! fprintf(stdout,
! "%s: To unistall this program use %s -M all\n",
! program_name,program_name);
! }
!
!
return r;
}

***************
*** 3911,3916 ****
--- 4452,4460 ----
int remove_count;
int i;

+ char **module_filter = NULL;
+ int module_count = 0;
+
#if ANSI_C
char my_version[] = "[ELM" VERSION " " PATCHLEVEL "]";
#else
***************
*** 3921,3932 ****

clear_log_instance(&LI);

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {

! filelist = argv[x+1];
! x += 2;
}

LI.filename = filelist;
LI.file = fopen(LI.filename,"r+");
if (!LI.file) {
--- 4465,4509 ----

clear_log_instance(&LI);

! while (x < argc && '-' == argv[x][0]) {

! if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
!
! filelist = argv[x+1];
! x += 2;
! } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
!
! module_filter = realloc(module_filter,
! (module_count+2) *
! sizeof (module_filter[0]));
!
! if (! module_filter) {
! fprintf(stderr,
! "%s: Failed to realloc -M option\n",
! program_name);
! exit(1);
! }
!
! module_filter[module_count++] = argv[x+1];
! module_filter[module_count] = NULL;
! x += 2;
!
! } else {
! fprintf(stderr,
! "%s: Bad option %s\n",
! program_name,argv[x]);
! exit(1);
! }
! }
!
! if (x < argc) {
! fprintf(stderr,
! "%s: Bad option %s\n",
! program_name,argv[x]);
! exit(1);
}

+
LI.filename = filelist;
LI.file = fopen(LI.filename,"r+");
if (!LI.file) {
***************
*** 3953,3959 ****
remove_unlinked(&LI,"/",&remove_count);

for (i = 0; i < LI.entries_count; i++) {
! if (0 != unstage_list(& LI.entries[i], &LI))
r = 1;
}

--- 4530,4536 ----
remove_unlinked(&LI,"/",&remove_count);

for (i = 0; i < LI.entries_count; i++) {
! if (0 != unstage_list(& LI.entries[i], &LI, module_filter))
r = 1;
}

***************
*** 3966,3984 ****


return 1; /* FAILURE */
}

- fail:
return r;


}



int main(argc, argv)
int argc;
char *argv[];

{

int x = 1;
! int r;
char *y;

enum register_mode {
--- 4543,5099 ----
return 1; /* FAILURE */
}

return r;
}

+ static int rpm_list P_((int argc, char *argv[], int x));
+ static int rpm_list(argc, argv, x)
+ int argc;
+ char *argv[];
+ int x;
+ {
+ int r = 0;
+ struct stat X;
+
+ struct log_instance LI;
+ int i;
+ char *user1 = "-";
+ char *group1 = "-";
+
+ char **module_filter = NULL;
+ int module_count = 0;
+
+ #if ANSI_C
+ char my_version[] = "[ELM" VERSION " " PATCHLEVEL "]";
+ #else
+ char my_version[40];
+
+ sprintf(my_version,"[ELM %s %s]",VERSION,PATCHLEVEL);
+ #endif
+
+ clear_log_instance(&LI);
+
+ installer_root = "/";
+
+ while (x < argc && '-' == argv[x][0]) {
+
+ if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
+
+ filelist = argv[x+1];
+ x += 2;
+ } else if (x < argc -1 && 0 == strcmp("-u", argv[x])) {
+ user1 = argv[x+1];
+ x += 2;
+ } else if (x < argc -1 && 0 == strcmp("-g", argv[x])) {
+ group1 = argv[x+1];
+ x += 2;
+ } else if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
+
+ installer_root = argv[x+1];
+ x += 2;
+
+ } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
+
+ module_filter = realloc(module_filter,
+ (module_count+2) *
+ sizeof (module_filter[0]));
+
+ if (! module_filter) {
+ fprintf(stderr,
+ "%s: Failed to realloc -M option\n",
+ program_name);
+ exit(1);
+ }
+
+ module_filter[module_count++] = argv[x+1];
+ module_filter[module_count] = NULL;
+ x += 2;
+
+ } else {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);
+ exit(1);
+ }
+ }
+
+ if (x < argc) {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);
+ exit(1);
+ }
+
+
+ if (stat(installer_root,&X) < 0) {
+ fprintf(stderr,"%s: -R %s invalid\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */


+ }
+
+ if (

+ #ifdef S_ISDIR
+ ! S_ISDIR(X.st_mode)
+ #else
+ S_IFDIR != (buf.st_mode & S_IFMT)
+ #endif
+ ) {
+ fprintf(stderr,"%s: -R %s invalid (not a directory)\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */
+ }
+
+
+ LI.filename = filelist;
+ if (0 != strcmp(installer_root,"/")) {
+ int l = strlen(filelist) + strlen(installer_root) +2;
+ LI.filename = malloc(l);
+ if (!LI.filename) {
+ fprintf(stderr,"%s: malloc %d bytes failed\n",
+ program_name,l);
+ return 1; /* FAILURE */
+ }
+ sprintf(LI.filename,"%s%s",installer_root,filelist);
+ }
+
+ LI.file = fopen(LI.filename,"r");
+ if (!LI.file) {
+ fprintf(stderr,
+ "%s: Failed to open file %s\n",
+ program_name,LI.filename);
+ return 1; /* FAILURE */
+ }
+
+ add_entries(&LI);
+
+ if (LI.entries_count < 1 ||
+ 0 != strcmp(LI.entries[LI.entries_count-1].version,
+ my_version)) {
+
+ fprintf(stderr,
+ "%s: Last version on file %s is not %s\n",
+ program_name,
+ LI.filename,
+ my_version);
+ r = 1;
+ }
+
+ for (i = 0; i < LI.entries_count; i++) {
+ struct log_entries *I = &(LI.entries[i]);
+ int r;
+
+ /* Skip error message if list is actually empty */
+ if (I->log_count < 1)
+ continue;
+
+ if (0 != strcmp(I->version,my_version)) {
+ fprintf(stderr,
+ "%s: File %s includes version %s entries (current %s)\n",
+ program_name,
+ LI.filename,
+ I->version,
+ my_version);
+
+ }
+
+ for (r = 0; r < I->log_count; r++) {
+ struct log_record * R = & (I->log[r]);
+
+ char * user = R->user_ptr;
+ char * group = R->group_ptr;
+ char * mode = R->mode_ptr;
+ char * file = NULL;;
+
+ if (! filter_record(R,module_filter,1))
+ continue;
+
+ if (R->arg_ptrs && R->arg_ptrs[0])
+ file = R->arg_ptrs[0];
+
+ if (!user || 0 == strcmp(user,"-"))
+ user = user1;
+ if (!group || 0 == strcmp(group,"-"))
+ group = group1;
+ if (!mode || 0 == atoi(mode))
+ mode = "-";
+
+ if (!file)
+ continue;
+
+ switch (R->command_letter) {
+ case 'M':
+
+ fputs("%dir ",stdout);
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+ break;
+
+ case 'd':
+
+ fputs("%doc ",stdout);
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+ break;
+
+ case 'F':
+ case 's':
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+ break;
+
+ case 'C':
+
+ fputs("%config ",stdout);
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+ break;
+
+ case 'E':
+ break;
+
+ case 'R':
+ case 'L':
+ break;
+
+ case '{': {
+ char *F = make_rooted(R,file,installer_root);
+ struct stat X;
+
+ if (stat(F,&X) < 0) {
+ if (ENOENT != errno)
+ fprintf(stderr,
+ "%s: '%c' File %s (%s) not accessible\n",
+ program_name,R->command_letter,
+ file,F);
+
+ } else if (
+ #ifdef S_ISDIR
+ S_ISDIR(X.st_mode)
+ #else
+ S_IFDIR == (X.st_mode & S_IFMT)


+ #endif
+ ) {
+

+ fprintf(stderr,
+ "%s: '%c' File %s (%s) is directory\n",
+ program_name,R->command_letter,
+ file,F);
+
+ #ifdef DIROPS
+ /* Files are already logged ... */
+ fputs("%dir ",stdout);
+ #endif
+
+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);


+
+
+ } else {
+

+ if (0 != strcmp(user,"-") ||
+ 0 != strcmp(group,"-") ||
+ 0 != strcmp(mode,"-"))
+ printf("%%attr(%s,%s,%s) ",mode,user,group);
+
+ printf("%s%s\n",
+ file[0] != '/' ? "/" : "",
+ file);
+
+ }
+
+ free(F);
+ }
+ break;
+
+ default:
+ fprintf(stderr,
+ "%s: '%c' Bad command letter\n",
+ program_name,R->command_letter);


+
+ }
+ }
+ }
+

+
+ if (EOF == fclose(LI.file)) {
+ fprintf(stderr,
+ "%s: Failed on closing of file: %s\n",
+ program_name,LI.filename);
+ return 1; /* FAILURE */


+ }
+
+ return r;

+ }
+
+ static int filter P_((int argc, char *argv[], int x));
+ static int filter(argc, argv, x)
+ int argc;
+ char *argv[];
+ int x;
+ {
+ int r = 0;
+ struct stat X;
+
+ struct log_instance * target = NULL;
+ struct log_entries * last = NULL;
+
+ struct log_instance LI;
+ struct log_instance LI_target;


+
+ int i;
+

+ char **module_filter = NULL;
+ int module_count = 0;
+
+ #if ANSI_C
+ char my_version[] = "[ELM" VERSION " " PATCHLEVEL "]";
+ #else
+ char my_version[40];
+
+ sprintf(my_version,"[ELM %s %s]",VERSION,PATCHLEVEL);
+ #endif
+
+ clear_log_instance(&LI);
+ clear_log_instance(&LI_target);
+
+ installer_root = "/";
+
+ while (x < argc && '-' == argv[x][0]) {
+
+ if (x < argc -1 && 0 == strcmp("-F", argv[x])) {
+
+ filelist = argv[x+1];
+ x += 2;
+
+ } else if (x < argc -1 && 0 == strcmp("-w", argv[x])) {
+
+ char * file = argv[x+1];
+ int t;
+ x += 2;
+
+ if (LI_target.filename) {
+ fprintf(stderr,
+ "%s: Duplicate -w option\n",
+ program_name);
+ exit(1);
+
+ }
+
+ LI_target.filename = file;

+ t = open(LI_target.filename,O_RDWR|O_CREAT,0644);
+ if (t < 0) {
+ fprintf(stderr,
+ "%s: Failed to open file %s on targe: %s\n",
+ program_name,filelist,LI_target.filename);
+
+ fclose(LI.file);

+ return 1; /* FAILURE */
+ }
+
+
+ LI_target.file = fdopen(t,"r+");
+ if (!LI_target.file) {
+ fprintf(stderr,
+ "%s: Failed to fdopen file %s on target (/): %s\n",
+ program_name,filelist,LI_target.filename);
+
+ fclose(LI.file);
+ close(t);
+ return 1; /* FAILURE */
+ }
+
+ add_entries(&LI_target);
+
+ target = &LI_target;
+
+ last = add_last(target);
+
+
+ } else if (x < argc -1 && 0 == strcmp("-R", argv[x])) {
+
+ installer_root = argv[x+1];
+ x += 2;
+
+ } else if (x < argc -1 && 0 == strcmp("-M", argv[x])) {
+
+ module_filter = realloc(module_filter,
+ (module_count+2) *
+ sizeof (module_filter[0]));
+
+ if (! module_filter) {
+ fprintf(stderr,
+ "%s: Failed to realloc -M option\n",
+ program_name);
+ exit(1);
+ }
+
+ module_filter[module_count++] = argv[x+1];
+ module_filter[module_count] = NULL;
+ x += 2;
+
+ } else {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);
+ exit(1);
+ }
+ }
+
+ if (x < argc) {
+ fprintf(stderr,
+ "%s: Bad option %s\n",
+ program_name,argv[x]);
+ exit(1);
+ }
+
+
+ if (stat(installer_root,&X) < 0) {
+ fprintf(stderr,"%s: -R %s invalid\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */


+ }
+
+ if (

+ #ifdef S_ISDIR
+ ! S_ISDIR(X.st_mode)
+ #else
+ S_IFDIR != (buf.st_mode & S_IFMT)
+ #endif
+ ) {
+ fprintf(stderr,"%s: -R %s invalid (not a directory)\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */
+ }
+
+
+ LI.filename = filelist;
+ if (0 != strcmp(installer_root,"/")) {
+ int l = strlen(filelist) + strlen(installer_root) +2;
+ LI.filename = malloc(l);
+ if (!LI.filename) {
+ fprintf(stderr,"%s: malloc %d bytes failed\n",
+ program_name,l);
+ return 1; /* FAILURE */
+ }
+ sprintf(LI.filename,"%s%s",installer_root,filelist);
+ }
+
+ LI.file = fopen(LI.filename,"r");
+ if (!LI.file) {
+ fprintf(stderr,
+ "%s: Failed to open file %s\n",
+ program_name,LI.filename);
+ return 1; /* FAILURE */
+ }
+
+ add_entries(&LI);
+
+ if (LI.entries_count < 1 ||
+ 0 != strcmp(LI.entries[LI.entries_count-1].version,
+ my_version)) {
+
+ fprintf(stderr,
+ "%s: Last version on file %s is not %s\n",
+ program_name,
+ LI.filename,
+ my_version);
+ r = 1;
+ }
+
+
+ if (target) {
+
+ for (i = 0; i < LI.entries_count; i++) {
+ struct log_entries *I = &(LI.entries[i]);
+ int r;
+
+ /* Skip error message if list is actually empty */
+ if (I->log_count < 1)
+ continue;
+
+ if (0 != strcmp(I->version,my_version)) {
+ fprintf(stderr,
+ "%s: File %s includes version %s entries (current %s)\n",
+ program_name,
+ LI.filename,
+ I->version,
+ my_version);
+
+ }
+
+ for (r = 0; r < I->log_count; r++) {
+ struct log_record * R = & (I->log[r]);
+
+ if (! filter_record(R,module_filter,1))
+ continue;
+
+ /* NOTE: NULLs buffer and arg_ptrs from R */
+ move_record(target,last,R);


+
+ }
+
+ }
+

+ if (EOF == fclose(target->file)) {
+ fprintf(stderr,
+ "%s: Write(?) failed on closing of file: %s\n",
+ program_name,target->filename);
+ return 1; /* FAILURE */
+ }
+ }
+

+ return r;
+ }
+
+

+ int main P_((int argc, char *argv[]));
int main(argc, argv)
int argc;
char *argv[];

{

int x = 1;
! int r = 0;
char *y;

enum register_mode {
***************
*** 3986,3996 ****
register_command,
register_replay,
register_uninstall,
! register_unstage
} mode = register_command;

register_pipe = getenv("ELM_INSTALLER");
installer_root = getenv("ELM_ROOT");

program_name = argv[0];

--- 5101,5114 ----
register_command,
register_replay,
register_uninstall,
! register_unstage,
! register_rpm_list,
! register_filter
} mode = register_command;

register_pipe = getenv("ELM_INSTALLER");
installer_root = getenv("ELM_ROOT");
+ register_module = getenv("ELM_MODULE");

program_name = argv[0];

***************
*** 4036,4060 ****

x += 1;
mode = register_unstage;
! }

if (mode != register_command) {

if (register_pipe) {
fprintf(stderr,
! "%s: $ELM_INSTALLER=%s incompatible with arguments 'master' and 'replay'\n",
argv[0],register_pipe);



return 1; /* FAILURE */
}

if (installer_root) {
! fprintf(stderr,"%s: $ELM_ROOT=%s incompatible with arguments 'master' and 'replay'\n",
argv[0],installer_root);



return 1; /* FAILURE */
}

}


--- 5154,5194 ----

x += 1;
mode = register_unstage;
! } else if (x < argc && 0 == strcmp("rpm-list", argv[x])) {
!
! x += 1;
! mode = register_rpm_list;
! } else if (x < argc && 0 == strcmp("filter", argv[x])) {
!
! x += 1;
! mode = register_filter;
! }

if (mode != register_command) {

if (register_pipe) {
fprintf(stderr,
! "%s: $ELM_INSTALLER=%s incompatible with arguments 'master' and 'replay', 'unstage'\n",
argv[0],register_pipe);



return 1; /* FAILURE */
}

if (installer_root) {
! fprintf(stderr,"%s: $ELM_ROOT=%s incompatible with arguments 'master' and 'replay, 'unstage'\n",
argv[0],installer_root);

return 1; /* FAILURE */
}

+ if (installer_root) {
+ fprintf(stderr,"%s: $ELM_MODULE=%s incompatible with arguments 'master' and 'replay, 'unstage'\n",
+ argv[0],installer_root);
+
+ return 1; /* FAILURE */
+ }
+
+
}


***************
*** 4064,4070 ****
case register_command: r = command(argc,argv,x); break;
case register_replay: r = replay(argc,argv,x); break;
case register_uninstall: r = uninstall(argc,argv,x); break;
! case register_unstage: r = unstage(argc,argv,x); break;
}

return r;
--- 5198,5206 ----
case register_command: r = command(argc,argv,x); break;
case register_replay: r = replay(argc,argv,x); break;
case register_uninstall: r = uninstall(argc,argv,x); break;
! case register_unstage: r = unstage(argc,argv,x); break;
! case register_rpm_list: r = rpm_list(argc,argv,x); break;
! case register_filter: r = filter(argc,argv,x); break;
}

return r;

Kari E. Hurtta

unread,
Jul 28, 2005, 12:35:53 PM7/28/05
to @elmme-mailer.org Archive
Archive-name: elmME+2.5/PLalpha4.17

Before applying patch catenate parts 1 - 20 first.
Also it should be possible to apply parts 1 - 20
individually.


This patch (Elm ME+ 2.5 PLalpha5) is agaist Elm ME+ 2.5 PLalpha4.

============================================= ( part 17/20 ) =========
Index: elmME+.2.5.alpha5-cvs/src/pattern.c
*** elmME+.2.5.alpha4/src/pattern.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/pattern.c 2005-07-23 20:14:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pattern.c,v 1.33.8.2 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.33.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: pattern.c,v 1.33.8.4 2005/07/23 17:14:18 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.33.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 26,37 ****
return (unsigned char *)str;
}


- static CONST unsigned char *cs2us P_((const char *str));
- static CONST unsigned char *cs2us(str)
- CONST char *str;
- {
- return (CONST unsigned char *)str;
- }

#include <errno.h>
#ifndef ANSI_C

--- 26,31 ----
***************
*** 44,50 ****
#define S_(x)
#endif


- char *error_description(), *shift_lower();
static char *tag_word = NULL;
static char *tagged_word = NULL;
static char *Tagged_word = NULL;
--- 38,43 ----
***************
*** 55,71 ****
static char *undeleted_word = NULL;
static char *Undeleted_word = NULL;

! static int DoAll P_((int func,struct menu_common *menu, int header_page));

DEBUG_VAR(Debug,__FILE__,"mbox");

! int meta_match(function, menu, header_page,page)
int function;

struct menu_common *menu;
! int header_page;
! struct menu_context *page;
{


- char ch, tagmsg[SLEN];

/** Perform specific function based on whether an entered string
matches either the From or Subject lines..
--- 48,66 ----
static char *undeleted_word = NULL;
static char *Undeleted_word = NULL;

! static int DoAll P_((int func,struct menu_common *menu,

! struct screen_parts *LOC));


! static int DoFlagged P_((int func, struct menu_common *menu,
! struct screen_parts *LOC));

DEBUG_VAR(Debug,__FILE__,"mbox");

! int meta_match(function, menu, page, LOC)
int function;

struct menu_common *menu;
! struct menu_context *page;

! struct screen_parts *LOC;
{

/** Perform specific function based on whether an entered string
matches either the From or Subject lines..
***************

*** 73,85 ****
**/

int i, tagged=0, count=0, curtag = 0;
- char msg[SLEN];



struct string * meta_pattern = NULL;
! int status;

! int LINES, COLUMNS;
!

! menu_get_sizes(page,&LINES, &COLUMNS);

if (delete_word == NULL) {
tag_word = catgets(elm_msg_cat, ElmSet, ElmTag, "Tag");

--- 68,76 ----
**/

int i, tagged=0, count=0, curtag = 0;



struct string * meta_pattern = NULL;
! int status, line;

if (delete_word == NULL) {
tag_word = catgets(elm_msg_cat, ElmSet, ElmTag, "Tag");
***************
*** 93,170 ****

Undeleted_word = catgets(elm_msg_cat, ElmSet, ElmCapUndeleted, "Undeleted");
}

! Write_to_screen(CATGETS(elm_msg_cat, ElmSet,

! ElmMessagesMatchPattern,
! "%s %S that match pattern..."),
! function==TAGGED?tag_word: function==DELETED?delete_word:undelete_word,
! mcommon_give_item(menu, m_items));

if (function == TAGGED) { /* are messages already tagged??? */
int mc = mcommon_get_count(menu);

for (i=0; i < mc; i++) {

for (i=0; i < mc; i++) {

! mcommon_clearf_status(menu,i,TAGGED);
! show_new_status(i, menu, header_page);
}
}
}
}

!
status = optionally_enter2(page,
! &meta_pattern, LINES-1-2, 0,

OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmEnterPattern,
"Enter pattern: "));

! while (status == REDRAW_MARK) {


! status = optionally_enter2(page,
! &meta_pattern, LINES-1-2, 0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet,
! ElmEnterPattern,
! "Enter pattern: "));
}
!
if (status != 0 || !meta_pattern ||
string_len(meta_pattern) == 0) {

if (meta_pattern)
free_string( & (meta_pattern));

! ClearLine(LINES-1-2);
return(curtag);
}

--- 84,219 ----


Undeleted_word = catgets(elm_msg_cat, ElmSet, ElmCapUndeleted, "Undeleted");
}

! menu_Write_to_screen(LOC->prompt_page,
! CATGETS(elm_msg_cat, ElmSet,

! ElmMessagesMatchPattern,
! "%s %S that match pattern..."),
! function==TAGGED?tag_word: function==DELETED?delete_word:undelete_word,
! mcommon_give_item(menu, m_items));

if (function == TAGGED) { /* are messages already tagged??? */

int mc = mcommon_get_count(menu);
+

for (i=0; i < mc; i++) {

! if (mcommon_ison_status(menu,i,status_basic,TAGGED))
tagged++;
}

+
if (tagged) {
+ char tagmsg[SLEN];

+ int ch;
+

+ int delay_redraw = 0;
+ again:
if (tagged > 1) {
elm_sfprintf(tagmsg, sizeof tagmsg,
CATGETS(elm_msg_cat, ElmSet,
ElmSomeMessagesATagged,
"Some %S are already tagged."),
mcommon_give_item(menu,m_items));
!
! ch = prompt_letter(1,"",*def_ans_yes,

! PROMPT_yesno|PROMPT_redraw_mark|


! PROMPT_ctrlL|PROMPT_cancel,
! LOC->prompt_page,

! CATGETS(elm_msg_cat, ElmSet, ElmRemoveTags,
! "%s Remove Tags? (%c/%c) "),
! tagmsg, *def_ans_yes, *def_ans_no);
} else {
elm_sfprintf(tagmsg, sizeof tagmsg,
CATGETS(elm_msg_cat, ElmSet,
ElmAMessageATagged,
"One %S is already tagged."),
mcommon_give_item(menu,m_item));
! ch = prompt_letter(1,"",*def_ans_yes,

! PROMPT_yesno|PROMPT_redraw_mark|


! PROMPT_ctrlL|PROMPT_cancel,
! LOC->prompt_page,

! CATGETS(elm_msg_cat, ElmSet, ElmRemoveTag,
! "%s Remove Tag? (%c/%c) "),
! tagmsg, *def_ans_yes, *def_ans_no);
}

! if (('L'&31) == ch ||
! REDRAW_MARK == ch) {

! menu_ClearScreen(page); /* Reset possible redraw flag */


!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/


!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */

! delay_redraw++;


! goto again;
! }
!

! if (delay_redraw)
! menu_trigger_redraw(page);
!

! if (TERMCH_interrupt_char == ch)
! goto clean;
!
if (ch != *def_ans_no) { /* remove tags... */

for (i=0; i < mc; i++) {

! int vis;
!
! mcommon_clearf_status(menu,i,status_basic,TAGGED);
!
! vis = compute_visible(i+1, menu);
! menu_header_status_update(LOC->header_page,vis-1);


!
}
}
}
}

! /* FIXME --optionally_enter* should use prompt_area */

! line = menu_GetAbsLine(LOC->prompt_page,1);
status = optionally_enter2(page,
! &meta_pattern, line, 0,

OE_REDRAW_MARK|
OE_SIG_CHAR /* Ctrl-C */,

CATGETS(elm_msg_cat, ElmSet, ElmEnterPattern,
"Enter pattern: "));

! {


! int delay_redraw = 0;
!

! while (status == REDRAW_MARK) {
! menu_ClearScreen(page); /* Reset possible redraw flag */


!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/
!

! delay_redraw++; /* Can't trigger redraw yet... */
!
! status = optionally_enter2(page,
! &meta_pattern, line, 0,

! OE_REDRAW_MARK|OE_APPEND_CURRENT|
! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet,
! ElmEnterPattern,

! "Enter pattern: "));
! }
!

! if (delay_redraw)
! menu_trigger_redraw(page);
}
!
if (status != 0 || !meta_pattern ||
string_len(meta_pattern) == 0) {

if (meta_pattern)
free_string( & (meta_pattern));

! menu_ClearLine(LOC->prompt_page,1);
return(curtag);
}

***************
*** 174,183 ****


if (meta_pattern)
free_string( & (meta_pattern));

! return(DeleteTagged(menu, header_page, page));

! } else if (string_matches_ascii(meta_pattern, s2us("all")))
! count = DoAll(function, menu, header_page);

else {
int mc = mcommon_get_count(menu);

--- 223,235 ----


if (meta_pattern)
free_string( & (meta_pattern));

! return(DeleteTagged(menu, page, LOC->header_page));

! } else if (string_matches_ascii(meta_pattern, s2us("flagged")))
! count = DoFlagged(function, menu, LOC);
!
! else if (string_matches_ascii(meta_pattern, s2us("all")))
! count = DoAll(function, menu, LOC);

else {
int mc = mcommon_get_count(menu);
***************
*** 187,197 ****
for (i = 0; i < mc; i++) {
if (mcommon_matches(menu,i,meta_pattern) &&
(!selected ||
! (selected && mcommon_ison_status(menu,i,VISIBLE))
)) {

if (function == UNDELETE)
! mcommon_clearf_status(menu,i,DELETED);

else if ((function == DELETED) &&
(mcommon_get_type(menu,i) & SYSTEM)) {

--- 239,250 ----


for (i = 0; i < mc; i++) {
if (mcommon_matches(menu,i,meta_pattern) &&
(!selected ||
! (selected && mcommon_ison_status(menu,i,
! status_basic,VISIBLE))
)) {

if (function == UNDELETE)
! mcommon_clearf_status(menu,i,status_basic,DELETED);

else if ((function == DELETED) &&
(mcommon_get_type(menu,i) & SYSTEM)) {
***************
*** 200,215 ****
count--;

} else
! mcommon_setf_status(menu,i, function);

- show_new_status(i,menu, header_page);
if(i == current - 1) curtag++;
count++;
}
}
}

! ClearLine(LINES-1-2); /* remove "pattern: " prompt */

if (count > 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTaggedMessages,

--- 253,269 ----


count--;

} else
! mcommon_setf_status(menu,i, status_basic,function);
!
! menu_header_status_update(LOC->header_page,i); /* ! */

if(i == current - 1) curtag++;
count++;
}
}
}

! menu_ClearLine(LOC->prompt_page,1); /* remove "pattern: " prompt */

if (count > 1) {
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmTaggedMessages,
***************
*** 231,247 ****
function==TAGGED? tagged_word :
function==DELETED? mark_delete_word: undeleted_word);
}
!
if (meta_pattern)
free_string( & (meta_pattern));

return(curtag);
}

! int pattern_match(menu, header_page, page)
struct menu_common *menu;

- int header_page;
struct menu_context *page;
{

/** Get a pattern from the user and try to match it with the
from/subject lines being displayed. If matched (ignoring

--- 285,302 ----


function==TAGGED? tagged_word :
function==DELETED? mark_delete_word: undeleted_word);
}
!
! clean:
if (meta_pattern)
free_string( & (meta_pattern));

return(curtag);
}

! int pattern_match(menu, page, LOC)
struct menu_common *menu;

struct menu_context *page;


+ struct screen_parts *LOC;
{
/** Get a pattern from the user and try to match it with the
from/subject lines being displayed. If matched (ignoring
***************
*** 261,337 ****
static struct string * alt_pattern = NULL;

int ret = 0 ;

! int redraw = 0;
int anywhere = FALSE;
- int matched;


- struct string * buffer = NULL;
- struct string *buffer1 = NULL;

struct string * SEARCH = NULL; /* SHARED: point either to
pattern or alt_pattern */

int val;

! int LINES, COLUMNS;


- menu_get_sizes(page,&LINES, &COLUMNS);

! buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmMatchPatternInEntire,
! "Match pattern (in entire %S):"),
! mcommon_give_item(menu,m_item));
!
! PutLineX(LINES-4,40, CATGETS(elm_msg_cat, ElmSet, ElmMatchAnywhere,
! "/ = Match anywhere in %S."),
! mcommon_give_item(menu, m_items));
!
! buffer1 = format_string(CATGETS(elm_msg_cat, ElmSet, ElmMatchPattern,
! "Match pattern:"));



! val = pattern_enter(&pattern, &alt_pattern, LINES-2,0,
! buffer, buffer1, &redraw, page);

! /* 0 == pattern given
! 1 == alt_pattern given
! -1 == EOF ...
!
! */

! if (val < 0) {
! ret = EOF;

! goto out;
! }


! if (1 == val) {
! if (! alt_pattern ||
! string_len(alt_pattern) == 0) {

! ret = 1;

! goto out;
! }


! anywhere = TRUE;
! SEARCH = alt_pattern;

! }


! if (0 == val) {
! if (! pattern ||
! string_len(pattern) == 0) {
! ret = 0;
goto out;
- }

! anywhere = FALSE;
! SEARCH = pattern;
}
!
if (SEARCH) {

! if (anywhere)
! ret = mcommon_match_in_text(menu,SEARCH, header_page,
! page);
! else {

int current = mcommon_get_current(menu);
int mc = mcommon_get_count(menu);
--- 316,433 ----


static struct string * alt_pattern = NULL;
int ret = 0 ;

! int delay_redraw = 0;

int anywhere = FALSE;



struct string * SEARCH = NULL; /* SHARED: point either to
pattern or alt_pattern */

int val;

! int line;


! int append = 0;


+ /* Redraw loop */
+ append = OE_ALT_SOLIDUS;
+ do {

! menu_PutLineX(LOC->prompt_page,0,40,
! CATGETS(elm_msg_cat, ElmSet, ElmMatchAnywhere,
! "/ = Match anywhere in %S."),
! mcommon_give_item(menu, m_items));

! /* FIXME --optionally_enter* should use prompt_area */

! line = menu_GetAbsLine(LOC->prompt_page,1);
! val = optionally_enter2(page,
! &pattern, line, 0,
! OE_REDRAW_MARK|append|

! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet, ElmMatchPattern,
! "Match pattern:"));

! if (REDRAW_MARK == val) {

! menu_ClearScreen(page); /* Clear possible redraw mark */

! /* Call refresh routines of children */
! menu_redraw_children(page);

! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/


!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */

! delay_redraw++;
! if (pattern &&
! string_len(pattern) > 0)
! append = OE_APPEND_CURRENT;
! }
! } while (val == REDRAW_MARK);
!
! anywhere = FALSE;
! SEARCH = pattern;
!
! if (val == OE_ALT_SOLIDUS) {

! append = 0;

! menu_MoveCursor(LOC->prompt_page,0,40);

! menu_CleartoEOLN(LOC->prompt_page);
!
!

! do {


!
! /* FIXME --optionally_enter* should use prompt_area */

! line = menu_GetAbsLine(LOC->prompt_page,1);
! val = optionally_enter2(page,
! &alt_pattern, line, 0,
! OE_REDRAW_MARK|append|

! OE_SIG_CHAR /* Ctrl-C */,

! CATGETS(elm_msg_cat, ElmSet,
! ElmMatchPatternInEntire,
! "Match pattern (in entire %S):"),
! mcommon_give_item(menu,m_item));

!
! if (REDRAW_MARK == val) {

! menu_ClearScreen(page); /* Clear possible redraw mark */
!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!

! menu_ClearScreen(LOC->prompt_page); /* Clear redraw mark from prompt_area*/


!
! /* NOTICE: using menu_trigger_redraw(page) on here
! may cause redraw loop!
! */

! delay_redraw++;
! append = OE_APPEND_CURRENT;
! }
!
! } while (val == REDRAW_MARK);
!
! anywhere = TRUE;
! SEARCH = alt_pattern;
! }

!

! if (0 != val) {
! if (-1 == val) /* Ctrl-C */

goto out;


! ret = EOF;
! goto out;
}
!
if (SEARCH) {

! if (string_len(SEARCH) == 0) {
! ret = 0;

! goto out;
! }
!

! if (anywhere)
! ret = mcommon_match_in_text(menu,SEARCH,page, LOC);
! else {

int current = mcommon_get_current(menu);


int mc = mcommon_get_count(menu);
***************
*** 340,350 ****
for (i = current; i < mc; i++) {
if (mcommon_matches(menu,i,SEARCH) &&
(!selected ||
! (selected && mcommon_ison_status(menu,i,VISIBLE))
)) {

current = ++i;
mcommon_set_current(menu,current);

ret = 1;
goto out;

--- 436,449 ----

struct menu_common *menu;
! int header_page;
{
int i, count = 0;
int mc = mcommon_get_count(menu);
--- 459,479 ----


and should have remembered, so that behauviour matches
to Elm 2.4
*/

! if (delay_redraw)
menu_trigger_redraw(page);
+ else

+ menu_trigger_redraw(LOC->prompt_page);

return(ret);
}

+
/* This will tag, delete, or undelete all or the currently visible messages */
! static int DoAll(func, menu, LOC)
int func;

struct menu_common *menu;
! struct screen_parts *LOC;
{
int i, count = 0;
int mc = mcommon_get_count(menu);
***************
*** 385,400 ****


for (i=0; i < mc; i++) {

if (!selected ||


! (selected && mcommon_ison_status(menu,i,VISIBLE))) {
if (func == UNDELETE)
! mcommon_clearf_status(menu,i,DELETED);
else
! mcommon_setf_status(menu,i,func);

! show_new_status(i,menu, header_page);
++count;
}
}
return(count);
}

--- 482,534 ----


for (i=0; i < mc; i++) {

if (!selected ||


! (selected && mcommon_ison_status(menu,i,status_basic,VISIBLE))) {
if (func == UNDELETE)
! mcommon_clearf_status(menu,i,status_basic,DELETED);
else
! mcommon_setf_status(menu,i,status_basic,func);
!

! menu_header_status_update(LOC->header_page,i); /* ! ! ! */
!
! ++count;
! }
! }
!

! DPRINT(Debug,7,(&Debug, "DoAll=%d\n",count));
!
! return(count);
! }

! static int DoFlagged(func, menu, LOC)
! int func;

! struct menu_common *menu;


! struct screen_parts *LOC;
! {

! int i, count = 0;
! int mc = mcommon_get_count(menu);


! int selected = mcommon_get_selected(menu);

!
! for (i=0; i < mc; i++) {
! if (!selected ||


! (selected && mcommon_ison_status(menu,i,status_basic,VISIBLE))) {
!
! if (mcommon_ison_status(menu,i,status_1,S1_FLAGGED)) {
!
! if (func == UNDELETE)
! mcommon_clearf_status(menu,i,status_basic,DELETED);
! else
! mcommon_setf_status(menu,i,status_basic,func);
!
! menu_header_status_update(LOC->header_page,i); /* ! ! ! */
!
++count;
+ }
}
}
+
+
+ DPRINT(Debug,7,(&Debug, "DoFlagged=%d\n",count));
+
return(count);
}

Index: elmME+.2.5.alpha5-cvs/src/pgp.c
*** elmME+.2.5.alpha4/src/pgp.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/pgp.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38.8.5 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38.8.9 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.38.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 100,106 ****

char buf[STRING], address[STRING], *c, **keys=0, *pc, userpart[STRING];
int i=0, keys_len=0, keys_max=0, return_val=0, start=0;
- pid_t pid;
FILE *p;

if (!name || !target) {
--- 100,105 ----
***************
*** 137,143 ****
for (;;) {
int fd[2];
int array[1];
! CONST char * argv[10];
int code;
int stat = -1;

--- 136,142 ----
for (;;) {
int fd[2];
int array[1];
! const char * argv[10];
int code;
int stat = -1;

***************
*** 194,199 ****
--- 193,203 ----
argv[n++] = c;
argv[n++] = NULL;
break;
+
+ default:
+ n = 0;
+ argv[n] = NULL;
+ break;
}

code = start_run(&RS, SY_RUN_STATE_INIT, argv ,
***************
*** 260,266 ****
--- 264,272 ----
switch(v) {
case pgp2: pc = buf + PGP2_USERID_OFFSET; break;
case gpg: pc = buf + GPG_USERID_OFFSET; break;
+ default: break;
}
+
Len = strlen(pc)+1;
keys[keys_len] = (char*)safe_malloc(Len);
strfcpy(keys[keys_len], pc, Len);
***************
*** 287,292 ****
--- 293,301 ----
strfcpy(keys[keys_len], pc, Len);
++keys_len;


}
+ break;
+ default:
+ break;
}
}

***************
*** 476,489 ****
char
keyid[STRING], buf[VERY_LONG_STRING], **id_array=0, *c,
*p;
! CONST char ** joined = NULL;
int close_fd;
#define MAX_ARG 1000
! CONST char * argv[MAX_ARG];
char * argv0[MAX_ARG];
char * env[2];
int a;
int ret = 0;


struct run_state RS;
int exit_code;
int LINES, COLUMNS;

--- 485,499 ----
char
keyid[STRING], buf[VERY_LONG_STRING], **id_array=0, *c,
*p;
! const char ** joined = NULL;
int close_fd;
#define MAX_ARG 1000
! const char * argv[MAX_ARG];
char * argv0[MAX_ARG];
char * env[2];
int a;
int ret = 0;


+ int was_redraw = 0; /* FIXME */
struct run_state RS;
int exit_code;

int LINES, COLUMNS;
***************
*** 509,514 ****
--- 519,525 ----

--- 527,555 ----


CleartoEOS ();
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmPgpNoMatch,
"Couldn't find key matching '%s'!"),
! c);
print_format_center (LINES-3,
CATGETS(elm_msg_cat, ElmSet, ElmPgpKeyError,
"e)dit recipient list, s)kip recipient, q)uit"));

! menu_PutLineX (page,LINES-1-3, 0,
! CATGETS(elm_msg_cat, ElmSet,

! ElmPgpSelect,
! "Select [e/s/q]: "));
! menu_GetXYLocation(page, &x_coord, &y_coord);
! menu_PutLineX (page,x_coord, y_coord,FRM("%c"),def_ans);
! menu_MoveCursor(page, x_coord, y_coord);

switch((ans = menu_ReadCh(page,REDRAW_MARK))) {
case '\n':
case '\r':
ans = def_ans;
+ case REDRAW_MARK:
+ was_redraw = 1;
+ menu_ClearScreen(page);
+ goto redraw1;
}

+
switch(ans) {
case 'e':
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,
***************

*** 595,600 ****
--- 612,619 ----
close_fd = fd[1];
}
env[1] = NULL;
+ default:
+ break;
}

/* copy the file into it's final destination */
***************


*** 602,608 ****
FRM("%s.asc"), filename);

Raw(OFF);
! ClearScreen();
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,ElmRunningPgp,
"Running PGP..."));
Write_to_screen(FRM("\n\n"));

--- 621,627 ----


FRM("%s.asc"), filename);

Raw(OFF);
! ClearScreen(0);
Write_to_screen(CATGETS(elm_msg_cat, ElmSet,ElmRunningPgp,
"Running PGP..."));

Write_to_screen(FRM("\n\n"));
***************
*** 757,762 ****
--- 776,783 ----
argv,-1,-1);



break;
+ default:
+ break;
}


***************
*** 773,779 ****
if (RS.save_errno)
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),


! argv[0],error_description(RS.save_errno));
else
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantStart,
"Can't start %.30s"),

--- 794,800 ----
if (RS.save_errno)
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),


! argv[0],strerror(RS.save_errno));
else
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantStart,
"Can't start %.30s"),
***************

*** 802,808 ****
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),
! argv[0],error_description(RS.save_errno));
return FALSE;
} else if (exit_code) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpErrorStatus,
--- 823,829 ----
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),
! argv[0],strerror(RS.save_errno));
return FALSE;
} else if (exit_code) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmPgpErrorStatus,
***************
*** 821,829 ****
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmLostErrno,
"%.30s lost: %.40s"),
! argv[0],error_description(RS.save_errno));
return TRUE;
}
return opts;
}

--- 842,854 ----
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmLostErrno,
"%.30s lost: %.40s"),
! argv[0],strerror(RS.save_errno));


return TRUE;
}
+
+ if (was_redraw) /* FIXME: Should not needed */
+ menu_trigger_redraw(page);
+
return opts;
}

***************

*** 833,839 ****


struct menu_context *page;
{
int update = TRUE;
! enum pgp_version v = send_pgp_version;
enum pgp_version version;
int x_coord = 0, y_coord = 0;
int def_ans = 'q';

--- 858,864 ----


struct menu_context *page;
{
int update = TRUE;
! enum pgp_version v = (enum pgp_version) give_dt_enumerate_as_int(&send_pgp_version);
enum pgp_version version;
int x_coord = 0, y_coord = 0;
int def_ans = 'q';
***************

*** 852,865 ****


print_format_center(LINES-3,
CATGETS(elm_msg_cat, ElmSet, ElmPgpEncSign,
"e)ncrypt, s)ign, b)oth encrypt and sign or q)uit"));
! PutLineX (LINES-4, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpP,
! "pgp: "));
! GetXYLocation(&x_coord, &y_coord);

update = FALSE;
}

! PutLineX (x_coord, y_coord,FRM("%c"),def_ans);
! MoveCursor(x_coord, y_coord);

switch((ans = menu_ReadCh(page, REDRAW_MARK))) {
case '\n':

--- 877,894 ----


print_format_center(LINES-3,
CATGETS(elm_msg_cat, ElmSet, ElmPgpEncSign,
"e)ncrypt, s)ign, b)oth encrypt and sign or q)uit"));

!
! menu_PutLineX (page,
! LINES-4, 0, CATGETS(elm_msg_cat, ElmSet, ElmPgpP,
! "pgp: "));
! menu_GetXYLocation(page,
! &x_coord, &y_coord);

update = FALSE;
}
! menu_PutLineX (page,
! x_coord, y_coord,FRM("%c"),def_ans);
! menu_MoveCursor(page,x_coord, y_coord);

switch((ans = menu_ReadCh(page, REDRAW_MARK))) {
case '\n':
***************
*** 871,892 ****

switch(ans) {
case 'e':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPgpEncrypt,
! "Encrypt"));
return (pgp_call (filename, PGP_MESSAGE, headers, version, page));
case 's':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPgpSign,
! "Sign"));
return (pgp_call (filename, PGP_SIGNED_MESSAGE, headers,
version, page));
case 'b':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPgpSignEncrypt,
! "Sign and Encrypt"));
return (pgp_call (filename, PGP_MESSAGE | PGP_SIGNED_MESSAGE,
headers, version, page));
case 'q':
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmPgpQuit,
! "Quit"));
return FALSE;
case REDRAW_MARK:
case ctrl('L'):
--- 900,925 ----

switch(ans) {
case 'e':
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpEncrypt,
! "Encrypt"));
return (pgp_call (filename, PGP_MESSAGE, headers, version, page));
case 's':
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpSign,
! "Sign"));
return (pgp_call (filename, PGP_SIGNED_MESSAGE, headers,
version, page));
case 'b':
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpSignEncrypt,
! "Sign and Encrypt"));
return (pgp_call (filename, PGP_MESSAGE | PGP_SIGNED_MESSAGE,
headers, version, page));
case 'q':
! menu_Write_to_screen(page,
! CATGETS(elm_msg_cat, ElmSet, ElmPgpQuit,
! "Quit"));
return FALSE;
case REDRAW_MARK:
case ctrl('L'):
***************
*** 896,905 ****
/* not reached */
}

! void pgp_mail_public_key (mailbox, aview, page)
struct MailboxView *mailbox;
struct AliasView *aview;


struct menu_context *page;
{
/* If redraw is needed use
menu_trigger_redraw(page)

--- 929,939 ----
/* not reached */
}

! void pgp_mail_public_key (mailbox, aview, page, prompt_area)
struct MailboxView *mailbox;
struct AliasView *aview;


struct menu_context *page;
+ struct menu_context *prompt_area;
{

/* If redraw is needed use
menu_trigger_redraw(page)
***************

*** 907,920 ****

int ret;
struct run_state RS;
! CONST char * argv[20];
int argc = 0;
char userid[SLEN], pgpkey[SLEN], tmpfil[STRING], subj[STRING];
int status;
int need_redraw = FALSE;


! enum pgp_version v = send_pgp_version;
enum pgp_version version;

int LINES, COLUMNS;

menu_get_sizes(page, &LINES, &COLUMNS);

--- 941,959 ----

int ret;
struct run_state RS;
! const char * argv[20];
int argc = 0;
char userid[SLEN], pgpkey[SLEN], tmpfil[STRING], subj[STRING];
int status;
int need_redraw = FALSE;


! enum pgp_version v = (enum pgp_version) give_dt_enumerate_as_int(&send_pgp_version);
enum pgp_version version;

int LINES, COLUMNS;
+ char *tmp;

+

+ tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+ if (!tmp)
+ return;

menu_get_sizes(page, &LINES, &COLUMNS);

***************
*** 944,949 ****
--- 983,990 ----
if ( status != 0) {
if (need_redraw)
menu_trigger_redraw(page);
+
+ menu_trigger_redraw(prompt_area);
return;
}

***************
*** 957,963 ****
return;
}
elm_sfprintf(tmpfil, sizeof tmpfil,
! FRM("%selm.%d.asc"), temp_dir, getpid());

switch(version) {
static char path[1000];
--- 998,1004 ----
return;
}
elm_sfprintf(tmpfil, sizeof tmpfil,
! FRM("%selm.%d.asc"), tmp, getpid());

switch(version) {
static char path[1000];
***************
*** 989,994 ****
--- 1030,1038 ----
elm_sfprintf(buffer, sizeof buffer,FRM("<%s>"),pgpkey);
argv[argc++] = buffer;
break;
+
+ default:
+ break;
}
argv[argc++] = NULL;

***************
*** 1012,1018 ****
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),
! argv[0],error_description(RS.save_errno));

menu_trigger_redraw(page);
return;
--- 1056,1062 ----
if (RS.save_errno) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),
! argv[0],strerror(RS.save_errno));

menu_trigger_redraw(page);
return;
***************
*** 1030,1036 ****
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmLostErrno,
"%.30s lost: %.40s"),
! argv[0],error_description(RS.save_errno));
menu_trigger_redraw(page);
return;
}
--- 1074,1080 ----
} else {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmLostErrno,
"%.30s lost: %.40s"),
! argv[0],strerror(RS.save_errno));
menu_trigger_redraw(page);
return;
}
***************
*** 1038,1044 ****
if (RS.save_errno)
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),


! argv[0],error_description(RS.save_errno));
else
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantStart,
"Can't start %.30s"),

--- 1082,1088 ----
if (RS.save_errno)
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmFailErrno,
"Failed: %.30s: %.40s"),


! argv[0],strerror(RS.save_errno));
else
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmCantStart,
"Can't start %.30s"),
***************

*** 1057,1063 ****

/* Now send the message off! */
send_msg_l(-1,NULL, NULL, subj, 0, 0, mailbox, aview,
! page);

unlink (included_file); /* make sure to clean up. */
included_file[0] = '\0';
--- 1101,1108 ----

/* Now send the message off! */
send_msg_l(-1,NULL, NULL, subj, 0, 0, mailbox, aview,
! page,
! prompt_area /* XXX Redraw will be triggered anyway to page*/);

unlink (included_file); /* make sure to clean up. */
included_file[0] = '\0';
***************
*** 1078,1089 ****

char tempfile[STRING];
struct run_state RS;
! CONST char *argv[20];
int argc = 0;
FILE *fpout;
int res;


! enum pgp_version v = send_pgp_version;
enum pgp_version version;

if (!hdr)
return;
--- 1123,1138 ----

char tempfile[STRING];
struct run_state RS;
! const char *argv[20];
int argc = 0;
FILE *fpout;
int res;


! enum pgp_version v = (enum pgp_version) give_dt_enumerate_as_int(&send_pgp_version);
enum pgp_version version;

+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+

+ if (!tmp)
+ return;

if (!hdr)
return;
***************
*** 1092,1098 ****


return;

elm_sfprintf(tempfile,sizeof tempfile,
! FRM("%selm.%d"),temp_dir,getpid());

fpout=safeopen_rdwr(tempfile);
if (!fpout) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmOpenTmpWriting,
--- 1141,1147 ----
return;

elm_sfprintf(tempfile,sizeof tempfile,
! FRM("%selm.%d"),tmp,getpid());
fpout=safeopen_rdwr(tempfile);
if (!fpout) {
lib_error(CATGETS(elm_msg_cat, ElmSet,ElmOpenTmpWriting,
***************
*** 1128,1133 ****
--- 1177,1184 ----
argv[argc++] = "--import";
argv[argc++] = tempfile;


break;
+ default:
+ break;
}

argv[argc++] = NULL;

Index: elmME+.2.5.alpha5-cvs/src/quit.c
*** elmME+.2.5.alpha4/src/quit.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/quit.c 2005-07-23 22:01:39.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: quit.c,v 1.36.8.5 2004/08/14 12:06:11 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.5 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: quit.c,v 1.36.8.7 2005/07/23 19:01:39 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.36.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 27,40 ****


extern int errno; /* system error number on failure */
#endif

- long bytes();
- char *error_description();

! void quit(prompt, mailbox,aview, header_page, page)
int prompt;
struct MailboxView **mailbox;
struct AliasView **aview;


- int *header_page;
struct menu_context *page;
{

--- 27,37 ----


extern int errno; /* system error number on failure */
#endif


! void quit(prompt, mailbox,aview, page)
int prompt;
struct MailboxView **mailbox;
struct AliasView **aview;
struct menu_context *page;
{

***************
*** 44,50 ****
int LINES, COLUMNS;

status = leave_mbox(FALSE, TRUE, prompt, NULL, *mailbox,
! header_page, page);
if ( status == -1)
/* new mail - leave not done - can't change to another file yet
* check for change in mailfile_size in main() will do the work
--- 41,47 ----
int LINES, COLUMNS;

status = leave_mbox(FALSE, TRUE, prompt, NULL, *mailbox,
! page);
if ( status == -1)
/* new mail - leave not done - can't change to another file yet
* check for change in mailfile_size in main() will do the work
***************
*** 96,105 ****
leave(0);
}

! void resync(mailbox, header_page, page)
struct MailboxView **mailbox;


- int *header_page;
struct menu_context *page;
{

/** Resync on the current folder. Leave current and read it back in.

--- 93,102 ----
leave(0);
}

! void resync(mailbox, page, LOC)
struct MailboxView **mailbox;
struct menu_context *page;
+ struct screen_parts *LOC;
{
/** Resync on the current folder. Leave current and read it back in.

***************
*** 113,119 ****
int result;
int sc,i;

! result = leave_mbox(TRUE, FALSE, TRUE, NULL, *mailbox, header_page,
page);
if( result == -1)
/* new mail - leave not done - can't change to another file yet
--- 110,116 ----
int result;
int sc,i;

! result = leave_mbox(TRUE, FALSE, TRUE, NULL, *mailbox,
page);
if( result == -1)
/* new mail - leave not done - can't change to another file yet
***************
*** 147,177 ****
DPRINT(Debug,1,(&Debug,

"Error: given file %s as folder - unreadable (%s)!\n",

storage->current_folder->cur_folder_sys,
! error_description(err)));

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFolderRead,
"Can't open folder '%S' for reading: %s"),
storage->current_folder->cur_folder_disp,
! error_description(err));

Raw_OFF(1); /* Will reprint error */

leave(0);
}

! newmbox_1(storage->current_folder, FALSE, mailbox,1, header_page,
page);
}
}

! menu_trigger_redraw(page);
return;
}

! void change_file(mailbox, aview, header_page, page)
! struct MailboxView **mailbox;
struct AliasView *aview;
- int *header_page;
struct menu_context *page;
{
/* Prompt user for name of folder to change to.
--- 144,182 ----
DPRINT(Debug,1,(&Debug,

"Error: given file %s as folder - unreadable (%s)!\n",

storage->current_folder->cur_folder_sys,
! strerror(err)));

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmCantOpenFolderRead,
"Can't open folder '%S' for reading: %s"),
storage->current_folder->cur_folder_disp,
! strerror(err));

Raw_OFF(1); /* Will reprint error */

leave(0);
}

! newmbox_1(storage->current_folder, FALSE, mailbox,1,
page);
}
}

! {
! struct menu_common MENU;
! set_mcommon_from_mbxview(&MENU,*mailbox);
!
! get_page(&MENU, LOC->header_page); /* resort_mailbox no longer call get_page() */
! }
!

! menu_trigger_redraw(LOC->header_page);
! menu_trigger_redraw(LOC->title_page);

!
return;
}

! struct MailboxView * change_file(mailbox, aview, page)
! struct MailboxView *mailbox;
struct AliasView *aview;
struct menu_context *page;
{
/* Prompt user for name of folder to change to.
***************
*** 186,191 ****
--- 191,197 ----
struct folder_info *new_folder = NULL;


struct folder_browser * XXX = new_browser(selection_folder);

struct string * buffer = NULL;
+ struct MailboxView * new_mailbox = NULL;

int file_changed = 0;

***************
*** 198,204 ****
int i;

new_folder = folder_browser(page,
! XXX,&buffer,&redraw,
aview,
CATGETS(elm_msg_cat, ElmSet,
ElmChangeToWhichFolder,
--- 204,210 ----
int i;

new_folder = folder_browser(page,
! XXX,&buffer,
aview,
CATGETS(elm_msg_cat, ElmSet,
ElmChangeToWhichFolder,
***************
*** 207,216 ****
break;


! mbc = get_storage_count(*mailbox);

for (i = 0; i < mbc; i++) {
! struct current_storage *storage = get_storage(*mailbox,i);

if (!storage)
continue;
--- 213,226 ----
break;


! DPRINT(Debug,3,(&Debug,
! "change_file(%p): new folder = %p\n",
! mailbox,new_folder));
!
! mbc = get_storage_count(mailbox);

for (i = 0; i < mbc; i++) {
! struct current_storage *storage = get_storage(mailbox,i);

if (!storage)
continue;
***************
*** 262,279 ****
CleartoEOS();


! if (*mailbox) {
int result;

if (redraw) {
menu_ClearScreen(page);
- /* Show folder name which we are leaving ... */
- update_title(*mailbox, page);

}

! result = leave_mbox(FALSE, FALSE, TRUE, &new_folder, *mailbox,
! header_page, page);
if(result ==-1) {
/* new mail - leave not done - ca not change to another file
* yet check for change in mailfile_size in main() will do the
--- 272,290 ----
CleartoEOS();


! if (mailbox) {
int result;

if (redraw) {
+ /* Show page what we are leaving... */
menu_ClearScreen(page);

+ /* Call refresh routines of children */
+ menu_redraw_children(page);
}

! result = leave_mbox(FALSE, FALSE, TRUE, &new_folder, mailbox,
! page);
if(result ==-1) {
/* new mail - leave not done - ca not change to another file
* yet check for change in mailfile_size in main() will do the
***************
*** 347,364 ****
emergency_exit(0);
}

! }
!
!
!
}
! redraw = TRUE;
!
if (set_window_title || with_title)
set_folder_window_title(new_folder,
! wanted_title_string,wanted_icon_string);

! newmbox_1(new_folder, FALSE,mailbox,0, header_page, page);
}

fail:
--- 358,374 ----
emergency_exit(0);
}

! }
}
!
if (set_window_title || with_title)
set_folder_window_title(new_folder,


! wanted_title_string,
! wanted_icon_string);
!

! newmbox_1(new_folder, FALSE,&new_mailbox,0, page);

! /* No redraws before data is updated ... */
}

fail:
***************
*** 370,376 ****

if (redraw)
menu_trigger_redraw(page);
! return;
}

/*
--- 380,395 ----

if (redraw)
menu_trigger_redraw(page);
!
! if (!new_mailbox) {
! DPRINT(Debug,3,(&Debug,
! "change_file(%p) = NULL\n",mailbox));
! } else {
! DPRINT(Debug,3,(&Debug,
! "change_file(%p) = %p\n",mailbox,new_mailbox));
! }
!
! return new_mailbox;
}

/*
Index: elmME+.2.5.alpha5-cvs/src/read_rc.c
*** elmME+.2.5.alpha4/src/read_rc.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/read_rc.c 2005-07-23 20:14:18.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.24.8.4 2004/08/14 06:40:48 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.4 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.24.8.6 2005/07/23 17:14:18 hurtta Exp $";



/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.24.8.6 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 93,106 ****

DEBUG_VAR(Debug,__FILE__,"config");

- extern opts_menu *find_cfg_opts();
-
#include <errno.h>


#ifndef ANSI_C
extern int errno;

#endif

- char *error_description(), *shift_lower(), *mode_to_str();

static void dump_rc_results P_((void));

--- 93,103 ----
***************
*** 136,146 ****

NewLine();
cpage = Raw(ON | NO_TITE);
! MoveCursor(LINES-1,0);
! CleartoEOS();

redraw1:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNotice,
"\n\rNotice:\
\n\rThis version of ELM requires the use of a .elm directory in your home\
\n\rdirectory to store your elmrc and alias files. Shall I create the\
--- 133,143 ----

NewLine();
cpage = Raw(ON | NO_TITE);
! menu_MoveCursor(cpage,LINES-1,0);
! menu_CleartoEOS(cpage);

redraw1:
! menu_Write_to_screen(cpage,CATGETS(elm_msg_cat, ElmSet, ElmDirNotice,
"\n\rNotice:\
\n\rThis version of ELM requires the use of a .elm directory in your home\
\n\rdirectory to store your elmrc and alias files. Shall I create the\
***************
*** 164,183 ****
ch = *def_ans_no;

if (ch == *def_ans_no) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeNo,
! "No.\n\rVery well. I won't create it.\n\rBut, you may run into difficulties later.\n\r"));
if (sleepmsg > 0) {
error_sleep(sleepmsg *2);
}
}
else if (ch == *def_ans_yes) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeYes,
! "Yes.\n\rGreat! I'll do it now.\n\r"));
create_new_elmdir();
}
else {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeQuit,
! "Quit.\n\rOK. Bailing out of ELM.\n\r"));
Raw(OFF | NO_TITE);
exit(1);
}
--- 161,183 ----
ch = *def_ans_no;

if (ch == *def_ans_no) {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeNo,
! "No.\n\rVery well. I won't create it.\n\rBut, you may run into difficulties later.\n\r"));
if (sleepmsg > 0) {
error_sleep(sleepmsg *2);
}
}
else if (ch == *def_ans_yes) {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeYes,
! "Yes.\n\rGreat! I'll do it now.\n\r"));
create_new_elmdir();
}
else {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeQuit,
! "Quit.\n\rOK. Bailing out of ELM.\n\r"));
Raw(OFF | NO_TITE);
exit(1);
}
***************
*** 185,249 ****
}

/* see if the user has a folders directory */
! if (access(folders, 00) == -1) {
! struct menu_context *cpage;
!
! if( ! OPMODE_IS_INTERACTIVE(opmode)) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBatchNoticeFoldersDir,
! "\n\
Notice:\n\
ELM requires the use of a folders directory to store your mail folders in.\n\
I'd like to create the directory %s for you,\n\
but I can't in \"batch mode\". Please run ELM in \"normal mode\" first.\n"),
! folders);
! exit(1);
! }
!
! NewLine();
! cpage = Raw( ON | NO_TITE );
! MoveCursor(LINES-1,0);
! CleartoEOS();
!
! redraw2:
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmNoticeFoldersDir,
! "\n\rNotice:\n\r\
ELM requires the use of a folders directory to store your mail folders in.\n\r\
Shall I create the directory %s for you (%c/%c/q)? %c%c"),
! folders, *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
!
! FlushBuffer();
! ch = menu_ReadCh(cpage,REDRAW_MARK);
! if (REDRAW_MARK == ch)
! goto redraw2;


!
#ifdef ASCII_CTYPE
! if (isascii(ch))
#endif

! ch = tolower(ch);

! if (ch == '\n' || ch == '\r') /* they took the default by pressing cr */
! ch = *def_ans_yes;

! if (ch == *def_ans_no) {
! Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeNo,
! "No.\n\rVery well. I won't create it.\n\rBut, you may run into difficulties later.\n\r"));
! if (sleepmsg > 0) {
! error_sleep(sleepmsg *2);
}
}
- else if (ch == *def_ans_yes) {
- Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeYes,
- "Yes.\n\rGreat! I'll do it now.\n\r"));
- create_new_folders();
- }
- else {
- Write_to_screen(CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeQuit,
- "Quit.\n\rOK. Bailing out of ELM.\n\r"));
- Raw(OFF | NO_TITE);
- exit(0);
- }
- Raw( OFF | NO_TITE );
- }

/* validate/correct config_options string */

--- 185,259 ----
}

/* see if the user has a folders directory */
! {


! /* give_dt_estr_as_str adds / to end */
! char * folders_val = give_dt_estr_as_str(&folders_e,"maildir");
!

! if (folders_val) {
! if (access(folders_val, 00) == -1) {
! struct menu_context *cpage;
!
! if (! OPMODE_IS_INTERACTIVE(opmode)) {
! lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBatchNoticeFoldersDir,
! "\n\
Notice:\n\
ELM requires the use of a folders directory to store your mail folders in.\n\
I'd like to create the directory %s for you,\n\
but I can't in \"batch mode\". Please run ELM in \"normal mode\" first.\n"),
! folders_val);
! exit(1);
! }
!
! NewLine();
! cpage = Raw(ON | NO_TITE );
! menu_MoveCursor(cpage,LINES-1,0);
! menu_CleartoEOS(cpage);
!
! redraw2:
! menu_Write_to_screen(cpage,CATGETS(elm_msg_cat, ElmSet, ElmNoticeFoldersDir,
! "\n\rNotice:\n\r\
ELM requires the use of a folders directory to store your mail folders in.\n\r\
Shall I create the directory %s for you (%c/%c/q)? %c%c"),
! folders_val, *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
!
! FlushBuffer();
! ch = menu_ReadCh(cpage,REDRAW_MARK);
! if (REDRAW_MARK == ch)
! goto redraw2;


!
#ifdef ASCII_CTYPE
! if (isascii(ch))
#endif

! ch = tolower(ch);

! if (ch == '\n' || ch == '\r') /* they took the default by pressing cr */
! ch = *def_ans_yes;

! if (ch == *def_ans_no) {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeNo,
! "No.\n\rVery well. I won't create it.\n\rBut, you may run into difficulties later.\n\r"));
! if (sleepmsg > 0) {
! error_sleep(sleepmsg *2);
! }
! }
! else if (ch == *def_ans_yes) {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeYes,
! "Yes.\n\rGreat! I'll do it now.\n\r"));
! create_new_folders();
! }
! else {
! menu_Write_to_screen(cpage,
! CATGETS(elm_msg_cat, ElmSet, ElmDirNoticeQuit,
! "Quit.\n\rOK. Bailing out of ELM.\n\r"));
! Raw(OFF | NO_TITE);
! exit(0);
! }
! Raw( OFF | NO_TITE );
! }
}
}

/* validate/correct config_options string */

***************
*** 268,277 ****
#define on_off(s) (s == 1? "ON " : "OFF")
static void dump_rc_results()
{
! int i, j, len = 0;

for (i = 0; i < NUMBER_OF_SAVEABLE_OPTIONS; i++) {
- extern char *sort_name(), *alias_sort_name();

if (DT_SYN == save_info[i].dt_type ||
DT_MLT == save_info[i].dt_type)
--- 278,286 ----
#define on_off(s) (s == 1? "ON " : "OFF")
static void dump_rc_results()
{
! int i;

for (i = 0; i < NUMBER_OF_SAVEABLE_OPTIONS; i++) {

if (DT_SYN == save_info[i].dt_type ||
DT_MLT == save_info[i].dt_type)
Index: elmME+.2.5.alpha5-cvs/src/remail.c
*** elmME+.2.5.alpha4/src/remail.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/remail.c 2005-07-23 22:01:40.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: remail.c,v 1.35.8.2 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35.8.2 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: remail.c,v 1.35.8.5 2005/07/23 19:01:40 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35.8.5 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 28,36 ****
extern int errno;
#endif

- char *error_description();
- extern void display_to();
-
static void remail_sent P_((union any_fd fd, char * title,
struct run_state *rs,
int ret, int exit_stat));
--- 28,33 ----
***************
*** 51,80 ****
FlushBuffer();
}

! int remail(current_header,F1, aview, page)
struct header_rec *current_header;
FILE *F1;
! struct AliasView *aview;
struct menu_context *page;
{
! /** remail a message... returns TRUE if new foot needed ... **/
!
struct mail_send_state * mailer = NULL;


- int redraw = 0;

-
- char buffer[VERY_LONG_STRING], ch;

int encoding = ENCODING_NONE;
char title[80];
struct mailing_headers mailing_headers;



struct mailer_info *mailer_info = get_mailer_info();

! int LINES, COLUMNS;

! menu_get_sizes(page, &LINES, &COLUMNS);

if (!mailer_info)
! return 0;

/* Actually headers are not written. headers structure is just
* used to pass mailing addresses to backend .
--- 48,75 ----
FlushBuffer();
}

! void remail(current_header,F1, aview, page, prompt_area)
struct header_rec *current_header;
FILE *F1;
! struct AliasView *aview;


struct menu_context *page;
+ struct menu_context *prompt_area;
{

!
struct mail_send_state * mailer = NULL;

int encoding = ENCODING_NONE;
char title[80];
struct mailing_headers mailing_headers;



struct mailer_info *mailer_info = get_mailer_info();

! int li,co,ch;


! int delay_redraw = 0;

! menu_get_sizes(prompt_area, &li, &co);

if (!mailer_info)
! return;

/* Actually headers are not written. headers structure is just
* used to pass mailing addresses to backend .
***************
*** 82,90 ****
zero_mailing_headers(&mailing_headers);

if (!current_header || !F1)


! return 0;
!
!

/* free_mailing_headers will free this */

if (!mailing_headers.env_from)
--- 77,83 ----
zero_mailing_headers(&mailing_headers);

if (!current_header || !F1)
! return;



/* free_mailing_headers will free this */

if (!mailing_headers.env_from)
***************
*** 96,102 ****
}

if (! get_to(&mailing_headers.to,mailer_info, aview, page,
! NULL, NULL))
goto free_it;

display_to(mailing_headers.to, page);
--- 89,95 ----
}

if (! get_to(&mailing_headers.to,mailer_info, aview, page,
! NULL, NULL,prompt_area))
goto free_it;

display_to(mailing_headers.to, page);
***************
*** 126,149 ****

/** Got the messsage, now let's ensure the person really wants to
remail it... **/
-
- ClearLine(LINES-1-1);
- ClearLine(LINES-1);
- elm_sfprintf(buffer, sizeof buffer,
- CATGETS(elm_msg_cat, ElmSet, ElmSureYouWantToRemail,
- "Are you sure you want to remail this message (%c/%c)? "),
- *def_ans_yes, *def_ans_no);
- FlushBuffer();

! ch = want_to(buffer, *def_ans_yes, LINES-2, 0, page);

- if (ch == *def_ans_no) { /* another day, another No... */
lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBounceCancelled,
"Bounce of message canceled."));
! goto free_it;


}
! redraw += menu_need_redraw(page);
!

if (current_header -> status & MIME_MESSAGE) {
encoding = current_header->mime_rec.encoding;

--- 119,161 ----

/** Got the messsage, now let's ensure the person really wants to
remail it... **/

! again:
! menu_ClearLine(prompt_area,2);
! menu_ClearLine(prompt_area,3);
!
!
! ch = prompt_letter(2,"",*def_ans_yes,
! PROMPT_yesno|PROMPT_redraw_mark|PROMPT_ctrlL|
! PROMPT_cancel,
! prompt_area,
!
! CATGETS(elm_msg_cat, ElmSet, ElmSureYouWantToRemail,
! "Are you sure you want to remail this message (%c/%c)? "),
! *def_ans_yes, *def_ans_no);


! if (('L'&31) == ch ||
! REDRAW_MARK == ch) {

! menu_ClearScreen(page); /* Reset possible redraw flag */


!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area);

!
! delay_redraw++; /* Can't trigger redraw yet... */
! goto again;
! }

! if (delay_redraw)
! menu_trigger_redraw(page);
!
! if (ch == *def_ans_no ||
! TERMCH_interrupt_char == ch) { /* another day, another No... */

lib_error(CATGETS(elm_msg_cat, ElmSet, ElmBounceCancelled,
"Bounce of message canceled."));
! goto free_it;
}
!
if (current_header -> status & MIME_MESSAGE) {
encoding = current_header->mime_rec.encoding;

***************
*** 168,180 ****
if(mailer)
free_mail_send_state(&mailer);



- if (redraw)
- menu_trigger_redraw(page);

-
free_mailing_headers(&mailing_headers);

free_mailer_info(&mailer_info);
! return(1);
}

static void remail_sent (fd,title,rs,ret,exit_code)
--- 180,192 ----
if(mailer)
free_mail_send_state(&mailer);

free_mailing_headers(&mailing_headers);

free_mailer_info(&mailer_info);
!
! menu_trigger_redraw(prompt_area);
!
! return;
}

static void remail_sent (fd,title,rs,ret,exit_code)
***************
*** 197,203 ****
ElmFailErrno,


"Failed: %.30s: %.40s"),
get_mailer_path(fd.mail_fd),
! error_description(rs->save_errno));
else if (exit_code) {

lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmMailerReturnedError,
--- 209,215 ----
ElmFailErrno,


"Failed: %.30s: %.40s"),
get_mailer_path(fd.mail_fd),
! strerror(rs->save_errno));
else if (exit_code) {

lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmMailerReturnedError,
***************
*** 210,216 ****
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmLostErrno,"%.30s lost: %.40s"),
get_mailer_path(fd.mail_fd),
! error_description(rs->save_errno));
}
}

--- 222,228 ----
lib_error(CATGETS(elm_msg_cat, ElmSet,
ElmLostErrno,"%.30s lost: %.40s"),
get_mailer_path(fd.mail_fd),
! strerror(rs->save_errno));
}
}

Index: elmME+.2.5.alpha5-cvs/src/reply.c
*** elmME+.2.5.alpha4/src/reply.c 2004-08-15 21:14:21.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/reply.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: reply.c,v 1.35.8.5 2004/08/07 18:07:19 hurtta Exp $";

/******************************************************************************


! * The Elm (ME+) Mail System - $Revision: 1.35.8.5 $ $State: Exp $
*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)

--- 1,7 ----
! static char rcsid[] = "@(#)$Id: reply.c,v 1.35.8.9 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.9 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 34,47 ****
be altered while in the editor composing the reply message!
**/

- char *get_token();

#include <errno.h>


#ifndef ANSI_C
extern int errno;

#endif

- char *error_description();

/* Prototype */
static void get_reply_subj P_((char *, char *, char *, int));
--- 34,45 ----
***************
*** 67,77 ****
strfcat( strfcpy( out_subj, "Re: ", size ), in_subj, size);
}

! static int optimize_and_add P_((CONST struct addr_item * new_address,
struct addr_item **full_address));

static int optimize_and_add(new_address, full_address)
! CONST struct addr_item * new_address;
struct addr_item ** full_address;
{
int len;
--- 65,75 ----
strfcat( strfcpy( out_subj, "Re: ", size ), in_subj, size);
}

! static int optimize_and_add P_((const struct addr_item * new_address,
struct addr_item **full_address));

static int optimize_and_add(new_address, full_address)
! const struct addr_item * new_address;
struct addr_item ** full_address;
{
int len;
***************
*** 148,158 ****
int err = errno;
DPRINT(Debug,1,(&Debug,
"Error: seek %ld resulted in errno %s (%s)\n",
! current_header->offset, error_description(err),
"handle_reply_to"));


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSeekFailedFile,
"ELM [seek] couldn't read %d bytes into file (%s)."),

! current_header->offset, error_description(err));
return NULL;
}

--- 146,156 ----
int err = errno;
DPRINT(Debug,1,(&Debug,
"Error: seek %ld resulted in errno %s (%s)\n",
! current_header->offset, strerror(err),
"handle_reply_to"));


lib_error(CATGETS(elm_msg_cat, ElmSet, ElmSeekFailedFile,
"ELM [seek] couldn't read %d bytes into file (%s)."),

! current_header->offset, strerror(err));
return NULL;
}

***************
*** 271,276 ****
--- 269,275 ----
switch (count) {
case h_to: addrs = current_header->to; break;
case h_cc: addrs = current_header->cc; break;
+ default: break;
}

/* go through all addresses in this line */
***************
*** 307,317 ****
return result;
}

! void reply(index, mailbox, aview, page)
int index;


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
{
/** Reply to the current message.

--- 306,318 ----
return result;
}

! void reply(index, mailbox, aview, page, prompt_area, header_area)
int index;


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
+ struct menu_context *prompt_area;

+ struct menu_context *header_area;
{
/** Reply to the current message.

***************
*** 319,325 ****
**/

char subject[SLEN];


- int redraw = 0;

int form_letter;
struct addr_item * rt = NULL;
struct string * temp1 = NULL;
--- 320,325 ----
***************
*** 356,371 ****
"Re: your mail") ),
sizeof subject);

! if (form_letter)
! redraw = mail_filled_in_form(index,rt, subject,
! mailbox, aview);
! else {
send_msg_l(index,rt, NULL, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
NO, mailbox, aview,
! page);

- redraw += menu_need_redraw(page);
}

if (rt)
--- 356,372 ----
"Re: your mail") ),
sizeof subject);

! if (form_letter) {
! mail_filled_in_form(index,rt, subject,
! mailbox, aview,
! page); /* Generates always new page ... */
!
! } else {
send_msg_l(index,rt, NULL, subject,
MAIL_EDIT_MSG | MAIL_REPLYING,
NO, mailbox, aview,
! page, prompt_area);

}

if (rt)
***************
*** 374,390 ****
free_string(&temp1);
free(temp2);


! if (redraw)
! menu_trigger_redraw(page);

return;
}

! void reply_to_everyone(index,mailbox, aview, page)
int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;
! struct menu_context *page;
{
/** Reply to everyone who received the current message.
This includes other people in the 'To:' line and people
--- 375,401 ----
free_string(&temp1);
free(temp2);

! /* XXX Is this needed? */


! if (header_area) {
! int vis;

! struct menu_common MENU;
!

! set_mcommon_from_mbxview(&MENU,mailbox);
!
! vis = compute_visible(index+1, &MENU);
! menu_header_status_update(header_area,vis-1);
! }

return;
}

! void reply_to_everyone(index,mailbox, aview, page, prompt_area, header_area)
int index;
struct MailboxView *mailbox /* for save_copy */;
struct AliasView *aview;
! struct menu_context *page;
! struct menu_context *prompt_area;
! struct menu_context *header_area;
{
/** Reply to everyone who received the current message.
This includes other people in the 'To:' line and people
***************
*** 392,398 ****
has to be rewritten. **/

char subject[SLEN];


- int redraw = 0;

struct addr_item * rt;
struct addr_item * cc;

--- 403,408 ----
***************
*** 428,438 ****
sizeof subject);

send_msg_l(index,rt, cc, subject,
! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page);
!
! redraw += menu_need_redraw(page);

if (rt)
free_addr_items(rt);
--- 438,446 ----
sizeof subject);

send_msg_l(index,rt, cc, subject,
! MAIL_EDIT_MSG | MAIL_REPLYING,
! NO, mailbox, aview,
! page, prompt_area);

if (rt)
free_addr_items(rt);
***************
*** 441,458 ****

free_string(&temp1);
free(temp2);

!
! if (redraw)
! menu_trigger_redraw(page);

return;
}

! void forward(index,mailbox,aview, page)
int index;


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
{
/** Forward the current message. What this actually does is
to temporarily set forwarding to true, then call 'send' to
--- 449,476 ----

free_string(&temp1);
free(temp2);
!
! /* XXX Is this needed? */


! if (header_area) {
! int vis;

! struct menu_common MENU;
!

! set_mcommon_from_mbxview(&MENU,mailbox);
!
! vis = compute_visible(index+1, &MENU);
! menu_header_status_update(header_area,vis-1);
! }

return;
}

! void forward(index,mailbox,aview, page, prompt_area,header_area)
int index;


struct MailboxView *mailbox;
struct AliasView *aview;

struct menu_context *page;
+ struct menu_context *prompt_area;

+ struct menu_context *header_area;
{
/** Forward the current message. What this actually does is
to temporarily set forwarding to true, then call 'send' to
***************
*** 466,498 ****

char subject[SLEN];
int edit_msg = FALSE;
! int LINES, COLUMNS;
struct header_rec *current_header = give_header(mailbox,index);

! menu_get_sizes(page, &LINES, &COLUMNS);

if (! current_header)
return;

if (current_header->status & FORM_LETTER)
! PutLineX(LINES-4,COLUMNS-40,
! CATGETS(elm_msg_cat, ElmSet,
! ElmNoEditingAllowed,
! "<No editing allowed.>"));
else {
! int X1 = prompt_letter(LINES-4,"",*def_ans_yes,
! PROMPT_yesno|PROMPT_cancel,page,
!
! CATGETS(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
! "Edit outgoing message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);

! if (TERMCH_interrupt_char == X1) {
! return;
}

if (EOF == X1)
! return;

edit_msg = (X1 != *def_ans_no);
}
--- 484,538 ----

char subject[SLEN];
int edit_msg = FALSE;
! int li, co;
struct header_rec *current_header = give_header(mailbox,index);

! menu_get_sizes(prompt_area, &li, &co);

if (! current_header)
return;

if (current_header->status & FORM_LETTER)
! menu_PutLineX(prompt_area,0,co-40,
! CATGETS(elm_msg_cat, ElmSet,
! ElmNoEditingAllowed,
! "<No editing allowed.>"));
else {


! /* NOTICE: prompt_letter may return EOF */
!

! int X1;


! int delay_redraw = 0;
!

! again:
! X1 = prompt_letter(0,"",*def_ans_yes,
! PROMPT_yesno|PROMPT_redraw_mark|PROMPT_ctrlL|
! PROMPT_cancel,prompt_area,
!
! CATGETS(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
! "Edit outgoing message? (%c/%c) "),
! *def_ans_yes, *def_ans_no);
!
! if (('L'&31) == X1 ||
! REDRAW_MARK == X1) {
! menu_ClearScreen(page); /* Reset possible redraw flag */


!
! /* Call refresh routines of children */
! menu_redraw_children(page);
!
! menu_ClearScreen(prompt_area);

! delay_redraw++; /* Can't trigger redraw yet... */
! goto again;


}

+ if (delay_redraw)
+ menu_trigger_redraw(page);
+

+ if (TERMCH_interrupt_char == X1)
+ goto out;
+
if (EOF == X1)
! goto out;

edit_msg = (X1 != *def_ans_no);
}
***************
*** 520,532 ****
strfcat(subject, " (fwd)", sizeof subject);

send_msg_l(index,
! NULL, NULL, subject,
! (edit_msg ? MAIL_EDIT_MSG : 0 ) |
! MAIL_FORWARDING,
! current_header->status & FORM_LETTER ?
! PREFORMATTED : allow_forms,
! mailbox, aview,
! page);

free_string(&temp1);
free(temp2);
--- 560,572 ----
strfcat(subject, " (fwd)", sizeof subject);

send_msg_l(index,
! NULL, NULL, subject,
! (edit_msg ? MAIL_EDIT_MSG : 0 ) |
! MAIL_FORWARDING,
! current_header->status & FORM_LETTER ?
! PREFORMATTED : allow_forms,
! mailbox, aview,
! page, prompt_area);

free_string(&temp1);
free(temp2);
***************
*** 534,550 ****
}
else
send_msg_l(index,
! NULL, NULL,
! /* TODO: Fix this mess... */
! catgets(elm_msg_cat, ElmSet, ElmForwardedMail,
! "Forwarded mail..."),
! (edit_msg ? MAIL_EDIT_MSG : 0 ) |
! MAIL_FORWARDING,
! current_header->status & FORM_LETTER ?
! PREFORMATTED : allow_forms,
! mailbox, aview,
! page);
!
return;
}

--- 574,604 ----
}
else
send_msg_l(index,
! NULL, NULL,
! /* TODO: Fix this mess... */
! catgets(elm_msg_cat, ElmSet, ElmForwardedMail,
! "Forwarded mail..."),
! (edit_msg ? MAIL_EDIT_MSG : 0 ) |
! MAIL_FORWARDING,
! current_header->status & FORM_LETTER ?
! PREFORMATTED : allow_forms,
! mailbox, aview,
! page, prompt_area);
!
! out:
!
! menu_trigger_redraw(prompt_area);
!
! if (header_area) {
! int vis;


! struct menu_common MENU;
!

! set_mcommon_from_mbxview(&MENU,mailbox);
!
! vis = compute_visible(index+1, &MENU);
! menu_header_status_update(header_area,vis-1);
! }
!
return;
}

Index: elmME+.2.5.alpha5-cvs/src/savecopy.c
*** elmME+.2.5.alpha4/src/savecopy.c 2004-11-06 12:52:08.000000000 +0200
--- elmME+.2.5.alpha5-cvs/src/savecopy.c 2005-07-26 11:28:45.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44.8.4 2004/10/09 12:26:48 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.4 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: savecopy.c,v 1.44.8.6 2005/07/26 08:28:45 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.44.8.6 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************
*** 31,38 ****

DEBUG_VAR(Debug,__FILE__,"mbox");

- char *error_description(), *ctime();
-
#include <errno.h>


#ifndef ANSI_C
extern int errno;

--- 31,36 ----
***************
*** 310,316 ****
else
msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,

ElmConfirmFolderAppend,
! "Append to mail folder `%s'? (%c/%c) "),

cf->copy_file,
*def_ans_yes, *def_ans_no);

--- 308,314 ----
else
msg_buffer = elm_message(CATGETS(elm_msg_cat, ElmSet,

ElmConfirmFolderAppend,
! "Append to mail folder `%S'? (%c/%c) "),

cf->copy_file,
*def_ans_yes, *def_ans_no);

***************
*** 478,504 ****
return 1;
}

! int name_copy_file(cf,aview, page)
struct copy_file *cf;


struct AliasView *aview;
struct menu_context *page;
{

/** Prompt user for name of file for saving copy of outbound msg to.
! Return true if we need a redraw. **/
!
! int redraw = 0; /* set when we ask for help = need redraw */

if (!cf->dir)
cf->dir = new_browser(selection_folder);

gen_browser(page,
cf->dir, &(cf->copy_file),
! &redraw,word_save_copy,NULL,
aview,
CATGETS(elm_msg_cat, ElmSet, ElmSaveCopyInPrompt,
"Save copy in (use '?' for help): "));

- return redraw;
}

int append_copy_to_file(headers, dir, form, mime_info, conv_file,dest)
--- 476,499 ----
return 1;
}

! void name_copy_file(cf,aview, page)
struct copy_file *cf;


struct AliasView *aview;
struct menu_context *page;
{

/** Prompt user for name of file for saving copy of outbound msg to.
! Called menu_trigger_redraw(page) if we need redraw **/

if (!cf->dir)
cf->dir = new_browser(selection_folder);

gen_browser(page,
cf->dir, &(cf->copy_file),
! word_save_copy,NULL,
aview,
CATGETS(elm_msg_cat, ElmSet, ElmSaveCopyInPrompt,
"Save copy in (use '?' for help): "));

}

int append_copy_to_file(headers, dir, form, mime_info, conv_file,dest)
***************
*** 517,527 ****
dest is not seekable !!!
*/
int env_flag;

char * fname_copy = elm_message(FRM("%selmcopy-%d"),
! temp_dir, getpid ());
out_state_t buffer;
charset_t charset_vector[2];

/* Needed by STATE_out_dir */
charset_vector[0] = RAW_BUFFER;
--- 512,526 ----
dest is not seekable !!!
*/
int env_flag;


+ char * tmp = give_dt_estr_as_str(&temp_dir_e,"tmpdir");
+

char * fname_copy = elm_message(FRM("%selmcopy-%d"),


! tmp ? tmp : "/tmp/",

! getpid ());
out_state_t buffer;
charset_t charset_vector[2];
+

/* Needed by STATE_out_dir */
charset_vector[0] = RAW_BUFFER;
***************
*** 532,538 ****

if (headers->env_from) {


int x;
! CONST char *t = mailer_env_from_value(headers->env_from,&x);

if (t)
strfcpy(X.env_from,t,sizeof X.env_from);
}
--- 531,537 ----

if (headers->env_from) {


int x;
! const char *t = mailer_env_from_value(headers->env_from,&x);

if (t)
strfcpy(X.env_from,t,sizeof X.env_from);
}
Index: elmME+.2.5.alpha5-cvs/src/save_opts.c
*** elmME+.2.5.alpha4/src/save_opts.c 2004-07-04 14:36:51.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/save_opts.c 2005-07-23 20:14:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.26.8.1 2004/07/03 15:23:07 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: save_opts.c,v 1.26.8.3 2005/07/23 17:14:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.26.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 30,51 ****

#define absolute(x) ((x) < 0? -(x) : (x))

extern int errno;
extern char version_buff[];

! char *error_description(), *sort_name(), *alias_sort_name(), *level_name();
! char *mode_to_str();
! long ftell();

#include "rc_imp.h"
#include "save_opts.h"

FILE *elminfo; /* informational file as needed... */

- static void add_comment P_((int iindex, FILE *fd));
- static void build_offset_table P_((FILE *elminfo_fd));
- static int find_and_store_loc P_((char *name, long offset));
-
void save_options()
{
/** Save the options currently specified to a file. This is a
--- 30,47 ----

#define absolute(x) ((x) < 0? -(x) : (x))



+ #ifndef errno
extern int errno;
+ #endif

extern char version_buff[];

!

#include "rc_imp.h"
#include "save_opts.h"

FILE *elminfo; /* informational file as needed... */

void save_options()
{
/** Save the options currently specified to a file. This is a
***************
*** 64,72 ****
and such.
**/

- FILE *newelmrc;
char oldfname[SLEN], newfname[SLEN];
! int err;

strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
--- 60,67 ----
and such.
**/

char oldfname[SLEN], newfname[SLEN];
! int r;

strfcpy(newfname,user_rc_file,sizeof newfname);
elm_sfprintf(oldfname, sizeof oldfname,
***************
*** 86,123 ****
}

/** now let's open the datafile if we can... **/
-
- if ((elminfo = fopen(ELMRC_INFO, "r")) == NULL)
- lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavingWithoutComments,


- "Warning: saving without comments! Can't get to %s."),
- ELMRC_INFO);
-

- /** next, open the new .elm/elmrc file... **/
-
- err = can_open(newfname, "w");
- if (err) {
- lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
- "Can't save configuration! Can't write to %s [%s]."),
- newfname, error_description(errno));
- return;
- }

! if ((newelmrc = fopen(newfname, "w")) == NULL) {
! lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcCantSaveConfig,
! "Can't save configuration! Can't write to %s [%s]."),
! newfname, error_description(errno));
! return;
! }

- save_user_options(elminfo, newelmrc);
restore_file_stats(newfname);
-
- lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcOptionsSavedIn,
- "Options saved in file %s."), newfname);
- }


! int find_opt(s)
char *s;
{


int x, y = 0;

--- 81,98 ----
}

/** now let's open the datafile if we can... **/

! r = write_rc(newfname,NULL,0,"ELM",full_username,version_buff);

restore_file_stats(newfname);

+ if (r)
+ lib_error(CATGETS(elm_msg_cat, ElmrcSet, ElmrcOptionsSavedIn,
+ "Options saved in file %s."), newfname);
+ }

! static int find_opt P_((char *s));
! static int find_opt(s)
char *s;
{


int x, y = 0;

***************
*** 142,148 ****
if (0 == strcmp("aliassortby",s))
t = alias_sort_name(SHORT);
else if (0 == strcmp("userlevel",s))
! t = level_name(user_level);
else {
int x = find_opt(s);
if (x >= 0) {
--- 117,123 ----
if (0 == strcmp("aliassortby",s))
t = alias_sort_name(SHORT);
else if (0 == strcmp("userlevel",s))
! t = level_name(give_dt_enumerate_as_int(&user_level));
else {
int x = find_opt(s);
if (x >= 0) {
***************
*** 158,316 ****
return(t);
}

-
- void save_user_options(elminfo_fd, newelmrc)
- FILE *elminfo_fd, *newelmrc;
- {
- int x, local_value;
- char buf[SLEN];
-
- /** save the information in the file. If elminfo_fd == NULL don't look
- for comments!
- **/
-
- if (elminfo_fd != NULL)
- build_offset_table(elminfo_fd);
-
- elm_fprintf(newelmrc,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcOptionsFile,
- "#\n# .elm/elmrc - options file for the ELM mail system\n#\n"));
-
- if (strlen(full_username) > 0)
- elm_fprintf(newelmrc,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAutoFor,
- "# Saved automatically by ELM %s for %s\n#\n\n"),
- version_buff, full_username);
- else
- elm_fprintf(newelmrc,
- CATGETS(elm_msg_cat, ElmrcSet, ElmrcSavedAuto,
- "# Saved automatically by ELM %s\n#\n\n"),
- version_buff);
-
- if (elminfo_fd != NULL) {
- x = FALSE;
- rewind(elminfo_fd);
- while (!x && fgets(buf, sizeof(buf), elminfo_fd) != NULL)
- x = (strncmp(buf, "#$HDR", 5) == 0);
- if (x) {
- while (fgets(buf, sizeof(buf), elminfo_fd) != NULL) {
- if (buf[0] != '#')
- break;
- fputs(buf, newelmrc);
- }
- }
- }
-
- for (x = 0; x < NUMBER_OF_SAVEABLE_OPTIONS; x++) {
-
- /** skip system-only options **/
- if (save_info[x].flags & FL_SYS) {
- DPRINT(Debug,15,(&Debug,
- "Option %d -- \"%s\" system-only, flags=%0x\n",
- x,save_info[x].name, save_info[x].flags ));
- continue;
- }
-
- local_value = save_info[x].flags & FL_LOCAL;
- add_comment(x, newelmrc);
-
- if (RCTYPE_magic != save_info[x].dt_type->magic)
- panic("RC PANIC",__FILE__,__LINE__,"save_user_options",
- "Bad config item type",0);
-
- save_info[x].dt_type->print_value(newelmrc,
- & save_info[x],
- !local_value);
- }
-
- #ifdef USE_DLOPEN
- print_local_shared_options(newelmrc,0);
- #endif
-
- fclose(newelmrc);
- if ( elminfo_fd != NULL ) {
- fclose(elminfo_fd);
- }
- }
-
- static void add_comment(iindex, fd)
- int iindex;
- FILE *fd;
- {
- /** get to and add the comment to the file **/


- char buffer[SLEN];
-

- /** always put a blank line between options */
- fputc('\n', fd);
-
- /** add the comment from the comment file, if available **/
- if (save_info[iindex].offset > 0L) {
- if (fseek(elminfo, save_info[iindex].offset, 0) == -1) {
- DPRINT(Debug,1,(&Debug,
- "** error %s seeking to %ld in elm-info file!\n",
- error_description(errno),
- save_info[iindex].offset));
- } else {
- while (fgets(buffer, SLEN, elminfo) != NULL) {
- if (buffer[0] != '#')
- break;
- fputs(buffer, fd);
- }
- }
- }
- }
-
- static void build_offset_table(elminfo_fd)
- FILE *elminfo_fd;
- {
- /** read in the info file and build the table of offsets.
- This is a rather laborious puppy, but at least we can
- do a binary search through the array for each element and
- then we have it all at once!
- **/
-

- char line_buffer[SLEN];
-

- while (fgets(line_buffer, SLEN, elminfo_fd) != NULL) {
- if (strlen(line_buffer) > 1)
- if (line_buffer[0] != '#' && !whitespace(line_buffer[0])) {
- no_ret(line_buffer);
- if (find_and_store_loc(line_buffer, ftell(elminfo_fd))) {
- DPRINT(Debug,1,(&Debug,
- "** Couldn't find and store \"%s\" **\n",
- line_buffer));
- }
- }
- }
- }
-
- static int find_and_store_loc(name, offset)
- char *name;
- long offset;
- {
- /** given the name and offset, find it in the table and store it **/
-
- int first = 0, last, middle, compare;
-
- last = NUMBER_OF_SAVEABLE_OPTIONS;
-
- while (first <= last) {
-
- middle = (first+last) / 2;
-
- if ((compare = strcmp(name, save_info[middle].name)) < 0) /* a < b */
- last = middle - 1;
- else if (compare == 0) { /* a = b */
- save_info[middle].offset = offset;
- return(0);
- }
- else /* greater */ /* a > b */
- first = middle + 1;
- }
-
- return(-1);


- }
-
/*
* Local Variables:
* mode:c

--- 133,138 ----
Index: elmME+.2.5.alpha5-cvs/src/screen.c
*** elmME+.2.5.alpha4/src/screen.c 2004-05-16 17:43:45.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen.c 2005-07-23 20:14:19.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: screen.c,v 1.35.8.1 2004/05/15 20:11:36 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.1 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: screen.c,v 1.35.8.3 2005/07/23 17:14:19 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.35.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 20,25 ****
--- 20,26 ----

#include "def_elm.h"
#include "s_elm.h"
+ #include "s_aliases.h"

DEBUG_VAR(Debug,__FILE__,"ui");

***************
*** 27,34 ****

extern char version_buff[];

- static int fix_header_page P_((struct menu_common *menu,
- int *header_page));



static char *us2s P_((unsigned char *str));

static char *us2s(str)
--- 28,33 ----
***************
*** 38,64 ****
}


!
! void showscreen(mailbox,menu, header_page, page)
! struct MailboxView *mailbox;
! menu_func *menu;
! int *header_page;
struct menu_context *page; /* new page assumed */


{
- struct menu_common MENU;
-

- set_mcommon_from_mbxview(&MENU,mailbox);
-
menu_ClearScreen(page);
-
- update_title(mailbox, page);



! last_header_page = -1; /* force a redraw regardless */
! show_headers(&MENU, header_page, page);

- if (mini_menu)
- menu(page);
-
show_last_error();

/* define_softkeys(MAIN); */
--- 37,50 ----
}


! void showscreen(page)
struct menu_context *page; /* new page assumed */
{
menu_ClearScreen(page);



! /* Call refresh routines of children */
! menu_redraw_children(page);

show_last_error();

/* define_softkeys(MAIN); */
***************
*** 111,508 ****
free_string(&title_1);
}

!
! void update_title(mailbox, page)
! struct MailboxView *mailbox;
! struct menu_context *page;
{
! /** display a new title line, probably due to new mail arriving **/
!

struct string * buffer = NULL;

struct string * buffer2 = NULL;
! struct string * f1 = mailbox_title(mailbox);
! int message_count = get_message_count(mailbox);
! int selected = get_selected(mailbox);

int l1,l2,l;


int LINES, COLUMNS;

! menu_get_sizes(page, &LINES, &COLUMNS);

! ClearLine(1);
! ClearLine(2);

if (selected)
buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
ElmShownXWithSelect,
"%S with %d shown out of %d"),
f1,selected,
message_count);
! else if (message_count == 1)
! buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmShownXNoSelect,
! "%S with 1 message"),
! f1);
! else
! buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmShownXNoSelectPlural,
! "%S with %d messages"),
! f1,message_count);

free_string(&f1);

l1 = string_len(buffer);

! buffer2 = format_string(FRM("[ELM %s]"),version_buff);
l2 = string_len(buffer2);
l = l1 + l2 + 1; /* Assumed */

if (l > COLUMNS) {
if (l2 < COLUMNS)
! PutLineX(2,(COLUMNS - l2)/2,FRM("%S"),buffer2);
if (l1 > COLUMNS)
! PutLineX(1,1,FRM("%S"),buffer);
else
! PutLineX(1,(COLUMNS - l1)/2,FRM("%S"),buffer);
} else {
! PutLineX(1,(COLUMNS - l)/2,FRM("%S %S"),buffer,buffer2);
}
!
free_string(&buffer);
free_string(&buffer2);

}

! void show_menu(page)
! struct menu_context *page;
{


! /** write main system menu... **/

! int LINES, COLUMNS;

! menu_get_sizes(page,&LINES, &COLUMNS);



! if (user_level == 0) { /* a rank beginner. Give less options */

! print_format_center(LINES-1-7,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine1,
! "You can use any of the following commands by pressing the first character;"));

! print_format_center(LINES-1-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine2,
! "d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit"));
! print_format_center(LINES-1-5,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine3,
! "To read a message, press <return>. j = move down, k = move up, ? = help"));
} else {
! print_format_center(LINES-1-7,

! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine1,
! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));

! print_format_center(LINES-1-6,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine2,
! "a)lias, C)opy, c)hange folder, d)elete, e)dit, f)orward, g)roup reply, m)ail,"));
! print_format_center(LINES-1-5,
! CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine3,
! "n)ext, o)ptions, p)rint, q)uit, r)eply, s)ave, t)ag, u)ndelete, or e(x)it"));
}
}

!
! int show_headers(menu, header_page, page)
! struct menu_common *menu;
! int *header_page;
! struct menu_context *page; /* not really currently used */
!
{
- /** Display page of headers (10) if present. First check to
- ensure that header_page is in bounds, fixing silently if not.
- If out of bounds, return zero, else return non-zero
- Modified to only show headers that are "visible" to ze human
- person using ze program, eh?
- **/
-
- int this_msg = 0, line = 4, last = 0, last_line,
- displayed = 0, using_to;
-
- int selected = mcommon_get_selected(menu);


int LINES, COLUMNS;

! menu_get_sizes(default_context,&LINES, &COLUMNS);
!

! if (fix_header_page(menu,header_page))
! return(FALSE);
!
! if (selected) {
! if (((*header_page)*headers_per_page) > selected)
! return(FALSE); /* too far! too far! */
!
! this_msg = visible_to_index((*header_page) * headers_per_page + 1,
! menu);
! displayed = (*header_page) * headers_per_page;
!
! last = displayed+headers_per_page;
!
! } else {
! if ((*header_page) == last_header_page) /* nothing to do! */
! return(FALSE);
!
! /** compute last header to display **/
!
! this_msg = (*header_page) * headers_per_page;
! last = this_msg + (headers_per_page - 1);
! }
!
! if (last >= mcommon_get_count(menu))
! last = mcommon_get_count(menu)-1;
!
! /** Okay, now let's show the header page! **/
!
! ClearLine(line); /* Clear the top line... */
!
! MoveCursor(line, 0); /* and move back to the top of the page... */
!
! DPRINT(Debug,15,(&Debug,
! "show_headers: inalias=%d, selected=%d, last=%d\n",
! inalias,selected,last));
!
! while ((selected && displayed < last) || this_msg <= last) {
!
! #if DEBUG && 0
! if (Debug.active > 10 && !inalias) {
! struct addr_item * p;
! struct header_rec * hdr = give_header(mailbox,this_msg);
!
! DPRINT(Debug,15,(&Debug,
! "-- %d: %x \n",
! this_msg,hdr));
!
! for (p = hdr->from; p && p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- %d:from[%d] addr='%s' comment='%S' fullname='%S'\n",
! this_msg,
! p - hdr->from,
! p->addr,
! p->comment,
! p->fullname));
! }
!
! for (p = hdr->to; p && p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- %d: to[%d] addr='%s' comment='%S' fullname='%S'\n",
! this_msg,
! p - hdr->to,
! p->addr,
! p->comment,
! p->fullname));
! }
!
! for (p = hdr->cc; p && p->addr; p++) {
! DPRINT(Debug,15,(&Debug,
! "-- %d: cc[%d] addr='%s' comment='%S' fullname='%S'\n",
! this_msg,
! p - hdr->cc,
! p->addr,
! p->comment,
! p->fullname));
! }
! }
!

! if (Debug.active > 10 && inalias) {
! struct alias_rec * a = give_alias(aview,this_msg);

! DPRINT(Debug,15,(&Debug,
! "-- %d: %x alias='%s'\n",
! this_msg,a, a->alias));

! }
!
! #endif
! mcommon_screen_print_menu_line(menu,this_msg, page);
!
! if (selected)
! displayed++;

! CleartoEOLN();
! line++; /* for clearing up in a sec... */
!
! if (selected) {
! if ((this_msg = next_message(this_msg, FALSE, menu)) < 0)
! break; /* GET OUTTA HERE! */
!
! /* the preceeding looks gross because we're using an INDEX
! variable to pretend to be a "current" counter, and the
! current counter is always 1 greater than the actual
! index. Does that make sense??
! */
}
! else
! this_msg++; /* even dumber... */
!
}
!
! /* clear unused lines */
!
! if (mini_menu)
! last_line = LINES-9;
! else
! last_line = LINES-5;
!
! while (line < last_line) {
! CleartoEOLN();
! NewLine();
! line++;
! }
!
! display_central_message();
!
! last_current = mcommon_get_current(menu);
! last_header_page = (*header_page);
!
! return(TRUE);
}

! void show_current(menu, header_page, page)
! struct menu_common *menu;


! int *header_page;
! struct menu_context *page;
{

! /** Show the new header, with all the usual checks **/

! int first = 0, last = 0, last_line, new_line, using_to;


! int selected = mcommon_get_selected(menu);

!
! (void) fix_header_page(menu, header_page); /* Who cares what it does? ;-) */
!
! /** compute the first and last header on this page **/
! first = (*header_page) * headers_per_page + 1;
! last = first + (headers_per_page - 1);
!
! /* if not a full page adjust last to be the real last */
! if (selected && last > selected)
! last = selected;
! if (!selected && last > mcommon_get_count(menu))
! last = mcommon_get_count(menu);
!
! /** okay, now let's show the pointers... **/

! /** have we changed??? **/
! if (mcommon_get_current(menu) == last_current) {
! DPRINT(Debug,5,(&Debug,"show_current: Not changed last_current=%d\n",
! last_current));
! return;
}

! if (selected) {
! last_line = ((compute_visible(last_current, menu)-1) %
! headers_per_page)+4;
! new_line = ((compute_visible(mcommon_get_current(menu),
! menu)-1) %
! headers_per_page)+4;
! } else {
! last_line = ((last_current-1) % headers_per_page)+4;
! new_line = ((mcommon_get_current(menu)
! -1) % headers_per_page)+4;
}
!
! if (has_highlighting && ! arrow_cursor) {
!
! /* clear last current if it's in proper range */
! if (last_current > 0) { /* not a dummy value */
! int vis = compute_visible(last_current, menu);
!
! if (vis <= last && vis >= first) {
!
! DPRINT(Debug,5,(&Debug,
! "\nlast_current = %d ... clearing [1] before we add [2]\n",
! last_current));
! DPRINT(Debug,5,(&Debug,
! "first = %d, and last = %d\n\n",
! first, last));
!
! ClearLine(last_line);
! MoveCursor(last_line,0);
!
! mcommon_screen_print_menu_line(menu,last_current-1,
! page);

- } else {
- DPRINT(Debug,5,(&Debug, "show_current: last_current %d not visible: %d (range: %d - %d)\n",
- last_current,vis,first,last));
- }

! }


! MoveCursor(new_line, 0);
!
! {


! int current = mcommon_get_current(menu);
!

! mcommon_screen_print_menu_line(menu,current-1,
! page);
!
! DPRINT(Debug,5,(&Debug, "show_current: ... adding new (line %d) current=%d\n",
! new_line,current));

}

} else {


! int current = mcommon_get_current(menu);
!

! if (on_page(last_current-1, menu,*header_page))
! PutLine0(last_line,0," "); /* remove old pointer... */
! if (on_page(current-1, menu,*header_page))
! PutLine0(new_line, 0,"->");
}

! last_current = mcommon_get_current(menu);

}

! static int fix_header_page(menu, header_page)
! struct menu_common *menu;
! int *header_page;
{
! /** this routine will check and ensure that the current header
! page being displayed contains messages! It will silently
! fix 'header-page' if wrong. Returns TRUE if changed. **/
!
! int last_page, old_header;
!
! old_header = (*header_page);
!
! last_page = (int) ((mcommon_get_count(menu)-1) /
! headers_per_page);
!
! if ((*header_page) > last_page)
! (*header_page) = last_page;
! if ((*header_page) < 0)
! (*header_page) = 0;

! return(old_header != (*header_page));
! }

! int on_page(message,menu,header_page)
! int message;
! struct menu_common *menu;
! int header_page;
! {


! int selected = mcommon_get_selected(menu);

! /** Returns true iff the specified message is on the displayed page. **/

! if (selected)
! message = compute_visible(message, menu);

! if (message >= (header_page) * headers_per_page)
! if (message < (((header_page)+1) * headers_per_page))
! return(TRUE);
!
! return(FALSE);
}

/*
--- 97,413 ----
free_string(&title_1);
}

! #if ANSI_C
! subpage_simple_redraw sb_update_title;
! #endif
! int sb_update_title(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;
{

! struct menu_common *mptr = mp_lookup_mcommon(list,elm_mp_menu);

! int modified = mp_lookup_integer(list,elm_mp_modified);
!
! int message_count = mcommon_get_count(mptr);
! int selected = mcommon_get_selected(mptr);
! struct string * f1 = mcommon_title(mptr);
!

struct string * buffer = NULL;

struct string * buffer2 = NULL;
! struct string * modmsg = NULL;

int l1,l2,l;
int LINES, COLUMNS;
+
+ DPRINT(Debug,9, (&Debug, "sb_update_title\n"));

! menu_ClearScreen(ptr);
! menu_get_sizes(ptr, &LINES, &COLUMNS);


! if (modified) {
! modmsg = format_string(CATGETS(elm_msg_cat, AliasesSet,
! AliasesModified,

! "(modified, resync needed) "));
! }
! else {
! modmsg = new_string(system_charset);
! }

+
if (selected)
buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
ElmShownXWithSelect,
"%S with %d shown out of %d"),
f1,selected,
message_count);
! else
! buffer = format_string(CATGETS(elm_msg_cat, ElmSet,
! ElmShownXNoSelectItem,
! "%S with %d %S"),
! f1, message_count,
! (message_count == 1) ?
! mcommon_give_item(mptr,m_item) :
! mcommon_give_item(mptr,m_items));
!

+
free_string(&f1);

l1 = string_len(buffer);

! buffer2 = format_string(FRM("%S[ELM %s]"),
! modmsg,version_buff);
l2 = string_len(buffer2);
l = l1 + l2 + 1; /* Assumed */

if (l > COLUMNS) {
if (l2 < COLUMNS)
! menu_PutLineX(ptr,2,(COLUMNS - l2)/2,FRM("%S"),buffer2);
if (l1 > COLUMNS)
! menu_PutLineX(ptr,1,1,FRM("%S"),buffer);
else
! menu_PutLineX(ptr,1,(COLUMNS - l1)/2,FRM("%S"),buffer);
} else {
! menu_PutLineX(ptr,1,(COLUMNS - l)/2,FRM("%S %S"),buffer,buffer2);
}
!
! free_string(&modmsg);
free_string(&buffer);
free_string(&buffer2);

+ return 1; /* subpage area updated completely */
}

! #if ANSI_C
! subpage_simple_redraw sb_show_menu;
! #endif
! int sb_show_menu(ptr,list)


! struct menu_context *ptr;
! struct menu_param *list;
{

! int ul = give_dt_enumerate_as_int(&user_level);
!

! DPRINT(Debug,9, (&Debug, "sb_show_menu\n"));

! menu_ClearScreen(ptr);



! if (ul == 0) { /* a rank beginner. Give less options */
! menu_print_format_center(ptr,

! 0, CATGETS(elm_msg_cat, ElmSet,

! ElmLevel0MenuLine1,
! "You can use any of the following commands by pressing the first character;"));

! menu_print_format_center(ptr,
! 1, CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine2,
! "d)elete or u)ndelete mail, m)ail a message, r)eply or f)orward mail, q)uit"));
! menu_print_format_center(ptr,
! 2, CATGETS(elm_msg_cat, ElmSet,
! ElmLevel0MenuLine3,
! "To read a message, press <return>. j = move down, k = move up, ? = help"));
} else {
! menu_print_format_center(ptr,
! 0, CATGETS(elm_msg_cat, ElmSet,

! ElmLevel1MenuLine1,
! "|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern"));

! menu_print_format_center(ptr,
! 1, CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine2,
! "a)lias, C)opy, c)hange folder, d)elete, e)dit, f)orward, g)roup reply, m)ail,"));
! menu_print_format_center(ptr,
! 2, CATGETS(elm_msg_cat, ElmSet,
! ElmLevel1MenuLine3,
! "n)ext, o)ptions, p)rint, q)uit, r)eply, s)ave, t)ag, u)ndelete, or e(x)it"));
}
+
+ return 1;
}

! static void draw_dummy_hl P_((struct menu_context *ptr, int line_number,
! int is_current));
! static void draw_dummy_hl(ptr,line_number,is_current)
! struct menu_context *ptr;
! int line_number;
! int is_current;
{
int LINES, COLUMNS;

! menu_get_sizes(ptr, &LINES, &COLUMNS);

! menu_MoveCursor(ptr,line_number,0);

! if (is_current) {
! int l = 0;

! menu_StartXX(ptr,pg_INVERSE);

! while (l < COLUMNS) {
! menu_Writechar(ptr,' ');
! l++;
}
! menu_EndXX(ptr,pg_INVERSE);
}
!
! menu_Writechar(ptr,'\r');
! menu_Writechar(ptr,'\n');
}

!
! #if ANSI_C
! header_line_redraw hdr_show_header;
! #endif
! void hdr_show_header(ptr,list,line_number,index,is_current)


! struct menu_context *ptr;
! struct menu_param *list;

! int line_number;
! int index;
! int is_current;
{
! struct menu_common *menu = mp_lookup_mcommon(list,elm_mp_menu);
! int count = mcommon_get_count(menu);


! int selected = mcommon_get_selected(menu);

! int rindex = index;
!
! DPRINT(Debug,9, (&Debug, "hdr_show_header\n"));
!
! /* mcommon_screen_print_menu_line() looks current pointer
! from 'menu', so is_current is not needed
! */

! menu_ClearLine(ptr,line_number);
! menu_MoveCursor(ptr,line_number,0);

! if (selected) {
! if (index < 0 || index >= selected)
! goto out;
! rindex = visible_to_index(index+1,menu);
}

! if (rindex >= 0 && rindex < count)
! mcommon_screen_print_menu_line(menu,rindex,ptr);
! else {
! out:
! if (has_highlighting && ! arrow_cursor) {
! draw_dummy_hl(ptr,line_number,is_current);
! } else {
! if (is_current)
! menu_PutLine0(ptr,line_number,0,"->");


! }
}
! }


! #if ANSI_C

! header_line_redraw hdr_show_current;
! #endif
! void hdr_show_current(ptr,list,line_number,index,is_current)


! struct menu_context *ptr;
! struct menu_param *list;

! int line_number;
! int index;
! int is_current;
! {
! struct menu_common *menu = mp_lookup_mcommon(list,elm_mp_menu);
! int count = mcommon_get_count(menu);
!
! DPRINT(Debug,9, (&Debug, "hdr_show_current\n"));

+ if (has_highlighting && ! arrow_cursor) {


+ int selected = mcommon_get_selected(menu);

+ int rindex = index;

! /* mcommon_screen_print_menu_line() looks current pointer
! from 'menu', so is_current is not needed
! */
! menu_ClearLine(ptr,line_number);
! menu_MoveCursor(ptr,line_number,0);

+ if (selected) {
+ if (index < 0 || index >= selected)
+ goto out;
+ rindex = visible_to_index(index+1,menu);
}

+
+ if (rindex >= 0 && rindex < count)
+ mcommon_screen_print_menu_line(menu,rindex,ptr);
+ else {
+ out:
+ draw_dummy_hl(ptr,line_number,is_current);
+ }
} else {
! if (!is_current)
! menu_PutLine0(ptr,line_number,0," "); /* remove old pointer... */
! else
! menu_PutLine0(ptr,line_number,0,"->");
}
+ }

! void copy_current(menu,ptr)
! struct menu_common *menu;
! struct menu_context *ptr;
! {


! int current = mcommon_get_current(menu);

! int j = menu_header_get(ptr,header_current);
! /* Compute visible takes account is there selected messages or not.
! Note that it is 1 based ... */
! int n = compute_visible(current,menu)-1;
!
! DPRINT(Debug,5,(&Debug,
! "copy_current: current %d: header_page current %d => %d\n",
! current,j,n));

+ menu_header_change(ptr, header_current,n);
}

! void hdr_show_status(ptr,list,line_number,index,is_current)


! struct menu_context *ptr;
! struct menu_param *list;

! int line_number;
! int index;
! int is_current;
{
! struct menu_common *menu = mp_lookup_mcommon(list,elm_mp_menu);
! int count = mcommon_get_count(menu);


! int selected = mcommon_get_selected(menu);

! int rindex = index;


! char * s = "";

! char tagged = ' ';
!
! DPRINT(Debug,9, (&Debug, "hdr_show_status\n"));

! if (selected) {
! if (index < 0 || index >= selected)
! goto out;
! rindex = visible_to_index(index+1,menu);
! }
!
! if (rindex >= 0 && rindex < count) {
! s = mcommon_show_status(menu,rindex);
! if (mcommon_ison_status(menu,rindex,status_basic,TAGGED))
! tagged = '+';
! else if (mcommon_ison_status(menu,rindex,status_1,S1_FLAGGED))
! tagged = 'F';
! else
! tagged = ' ';
! } else {
! out:
! s = " ";
! tagged = ' ';
! }

! menu_MoveCursor(ptr,line_number,0);

! if (has_highlighting && ! arrow_cursor && is_current)
! menu_StartXX(ptr,pg_INVERSE);

! menu_Write_to_screen(ptr,
! FRM("%.2s%.2s%c"),
! (is_current && arrow_cursor)? "->" : " ",
! s,tagged);

! if (has_highlighting && ! arrow_cursor && is_current)
! menu_EndXX(ptr,pg_INVERSE);
!
! return;
}

/*
***************
*** 512,514 ****
--- 417,423 ----
* buffer-file-coding-system: iso-8859-1
* End:


*/
+
+
+
+

Index: elmME+.2.5.alpha5-cvs/src/screen/context.c
*** elmME+.2.5.alpha4/src/screen/context.c 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/context.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: context.c,v 1.3.8.3 2004/08/15 19:56:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.3 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
--- 1,7 ----
! static char rcsid[] = "@(#)$Id: context.c,v 1.3.8.6 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.3.8.6 $ $State: Exp $


*
* Author: Kari Hurtta <hurtt...@posti.FMI.FI>

*****************************************************************************/
***************
*** 13,21 ****
--- 13,29 ----
struct menu_context ROOT_MENU = {
MENU_CONTEXT_magic,

+ &CURSES_ROUTINES, /* menu_draw_routine */
+ NULL, NULL, /* subpages, container */
+
DEFAULT_LINES_ON_TERMINAL,DEFAULT_COLUMNS_ON_TERMINAL, /* lines, columns */
+
0,0, /* changed, redraw */

+ 0, /* modes */
+ 0,0, /* row,col */
+
+ { NULL }, /* dummy */

NULL /* prev */,
NULL /* next */
***************
*** 25,33 ****
--- 33,49 ----
struct menu_context COOKED_MENU = {
MENU_CONTEXT_magic,

+ &CURSES_ROUTINES, /* menu_draw_routine */
+ NULL, NULL, /* subpages, container */
+
DEFAULT_LINES_ON_TERMINAL,DEFAULT_COLUMNS_ON_TERMINAL, /* lines, columns */
+
0,0, /* changed, redraw */

+ 0, /* modes */
+ 0,0, /* row,col */
+
+ { NULL }, /* dummy */

NULL /* prev */,
NULL /* next */
***************
*** 36,56 ****

struct menu_context * default_context = &COOKED_MENU;

! struct menu_context * new_menu_context()
{
struct menu_context *ret = safe_malloc(sizeof (*ret));



/* bzero is defined hdrs/defs.h */

bzero((void *)ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;


ret->lines = ROOT_MENU.lines;
ret->columns = ROOT_MENU.columns;
ret->changed = ROOT_MENU.changed;
ret->redraw = ROOT_MENU.redraw;

/* chain to list */

ret->next_menu = ROOT_MENU.next_menu;
--- 52,106 ----

struct menu_context * default_context = &COOKED_MENU;

! struct menu_context * new_menu_type(T)
! struct menu_draw_routine *T;
{
struct menu_context *ret = safe_malloc(sizeof (*ret));

+ if (MENU_DRAW_magic != T->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"new_menu_type",
+ "Bad routine magic number",0);


+
/* bzero is defined hdrs/defs.h */

bzero((void *)ret,sizeof (*ret));

ret->magic = MENU_CONTEXT_magic;
+ ret->routine = T;
+
+ ret->subpages = NULL;
+ ret->container = NULL;
+
+ ret->lines = 0;
+ ret->columns = 0;
+ ret->changed = 0;
+ ret->redraw = 0;
+
+ ret->modes = 0;
+ ret->row = 0;
+ ret->col = 0;
+
+ ret->u.dummy = NULL;
+
+ T->wra_init(ret);


+
+ return ret;
+ }
+

+ struct menu_context * new_menu_context()
+ {
+ struct menu_context *ret = new_menu_type(&CURSES_ROUTINES);

+ /* Take data from root menu */

ret->lines = ROOT_MENU.lines;
ret->columns = ROOT_MENU.columns;
ret->changed = ROOT_MENU.changed;
ret->redraw = ROOT_MENU.redraw;

+ ret->modes = ROOT_MENU.modes;
+ ret->row = ROOT_MENU.row;
+ ret->col = ROOT_MENU.col;
+
/* chain to list */

ret->next_menu = ROOT_MENU.next_menu;
***************
*** 63,77 ****
if (default_context == &COOKED_MENU) {
DPRINT(Debug,1, (&Debug,
"new_menu_context: On COOKED MENU, not changing default context\n"));
! } else
default_context = ret;

return ret;
}

void erase_menu_context(ptr)
struct menu_context **ptr;
{
if ((*ptr)->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",


"Bad type magic number",0);

--- 113,136 ----
if (default_context == &COOKED_MENU) {
DPRINT(Debug,1, (&Debug,
"new_menu_context: On COOKED MENU, not changing default context\n"));
! } else {
default_context = ret;

+ DPRINT(Debug,9, (&Debug,
+ "new_menu_context: default context to %p\n",
+ default_context));
+
+ Syncronize(default_context);
+ }
+
return ret;
}

void erase_menu_context(ptr)
struct menu_context **ptr;
{
+ struct menu_subpages *list, *next = NULL;
+
if ((*ptr)->magic != MENU_CONTEXT_magic)
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",


"Bad type magic number",0);

***************
*** 84,106 ****
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"attempt to erase cooked menu",0);

! if (default_context == (*ptr))
default_context = (*ptr)->prev_menu;

if (!default_context)
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"no default content",0);

if ((*ptr)->next_menu)
(*ptr)->next_menu->prev_menu = (*ptr)->prev_menu;
if ((*ptr)->prev_menu)
(*ptr)->prev_menu->next_menu = (*ptr)->next_menu;

(*ptr)->magic = 0; /* Invalidate */
free(*ptr);
*ptr = NULL;
}

int menu_resized(ptr)
struct menu_context *ptr;
{
--- 143,354 ----
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"attempt to erase cooked menu",0);

! if (MENU_DRAW_magic != (*ptr)->routine->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
! "Bad routine magic number",0);
!
! EndSyncronize(*ptr);
!
! if ((*ptr)->container)
! detach_subpage(*ptr);
!
! if ((*ptr)->subpages) {
! DPRINT(Debug,1, (&Debug,
! "erase_menu_context: %p: WARNING: subpages not erased / detached\n",
! *ptr));
!
! for (list = (*ptr)->subpages; list; list = next) {
! if (MENU_CONTAINER_magic != list->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
! "Bad subpage type magic number",0);
! if (list->parent != *ptr)
! panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
! "Bad parent pointer on subpage",0);
! next = list->next;
!
! if (list->subpage) {
! if (list != list->subpage->container)
! panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
! "Bad container pointer on subpage",0);
!
! /* Reset congtainer pointer so that erase menu
! content do not call detach_subpage()
! */
! list->subpage->container = NULL;
!
! erase_menu_context( & (list->subpage) );
! }
!
! list->prev = NULL;
! list->next = NULL;
! list->magic = 0; /* Invalidate */
! free(list);
! }
!
! (*ptr)->subpages = NULL;
! }
!
! if (default_context == (*ptr)) {
default_context = (*ptr)->prev_menu;

+ DPRINT(Debug,9, (&Debug,
+ "erase_menu_context: default context to %p\n",


+ default_context));
+
+ }
+

if (!default_context)
panic("SCREEN PANIC",__FILE__,__LINE__,"erase_menu_context",
"no default content",0);
+
+ Syncronize(default_context);

if ((*ptr)->next_menu)
(*ptr)->next_menu->prev_menu = (*ptr)->prev_menu;
if ((*ptr)->prev_menu)
(*ptr)->prev_menu->next_menu = (*ptr)->next_menu;

+ (*ptr)->routine->wra_free(*ptr);
+
+ if ((*ptr)->u.dummy) {
+ DPRINT(Debug,1, (&Debug,
+ "erase_menu_context: Data not free'ed\n"));
+ }
+
+
(*ptr)->magic = 0; /* Invalidate */
free(*ptr);
*ptr = NULL;
}

+ void attach_subpage(parent,subpage, first_line, last_line)
+ struct menu_context *parent;
+ struct menu_context *subpage;


+ /* absolute screen cordinates */

+ int first_line, last_line;
+ {
+ struct menu_subpages * X;


+
+ if (MENU_CONTEXT_magic != parent->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"attach_subpage",
+ "Bad parent type magic number",0);
+

+ if (MENU_CONTEXT_magic != subpage->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"attach_subpage",
+ "Bad subpage type magic number",0);
+
+ X = safe_malloc(sizeof (*X));


+
+ /* bzero is defined hdrs/defs.h */

+ bzero((void *)X,sizeof (*X));
+
+ X->magic = MENU_CONTAINER_magic;
+ X->location.first_line = first_line;
+ X->location.last_line = last_line;
+ X->location.gone_out = 0;
+
+ subpage->lines = last_line - first_line + 1;


+ subpage->columns = parent->columns;

+ subpage->redraw = 1;
+ subpage->container = X;
+
+ X->subpage = subpage;
+ X->parent = parent;
+ X->next = parent->subpages;
+ X->prev = NULL;
+ if (parent->subpages) {
+ if (parent->subpages->prev)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"attach_subpage",
+ "parentäs subpage list do not point to first item",0);
+
+ parent->subpages->prev = X;
+ }
+ parent->subpages = X;
+
+ }
+
+
+ extern void detach_subpage(subpage)
+ struct menu_context *subpage;


+ {
+ if (MENU_CONTEXT_magic != subpage->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad subpage type magic number",0);
+

+ if (MENU_CONTAINER_magic != subpage->container->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad container type magic number",0);
+
+ if (MENU_CONTEXT_magic != subpage->container->parent->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad parent type magic number",0);
+ if (subpage->container->subpage != subpage)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad subpage of container",0);
+
+
+ /* Remove from list */
+ if (subpage->container->prev) {
+ if (subpage->container != subpage->container->prev->next)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad prev of container",0);
+
+ subpage->container->prev->next = subpage->container->next;
+ } else {
+ if (subpage->container != subpage->container->parent->subpages)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad subpages of parent",0);
+
+ subpage->container->parent->subpages = subpage->container->next;
+ }
+
+ if (subpage->container->next) {
+ if (subpage->container != subpage->container->next->prev)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"detach_subpage",
+ "Bad next of container",0);
+
+ subpage->container->next->prev = subpage->container->prev;
+ }
+
+ subpage->container->subpage = NULL;
+ subpage->container->magic = 0; /* Invalidate */
+ free(subpage->container);
+ subpage->container = NULL;
+ }
+
+ static struct menu_context * get_root_menu P_((struct menu_context *ptr,
+ int *pending_redraw));
+ static struct menu_context * get_root_menu(ptr,pending_redraw)
+ struct menu_context *ptr;
+ int *pending_redraw;
+ {
+ struct menu_context *pptr = ptr;
+
+ while (pptr->container) {
+ if (MENU_CONTAINER_magic != pptr->container->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"get_root_menu",
+ "Bad subpage container type magic number",0);
+
+ pptr = pptr->container->parent;
+
+ if (pptr->redraw)
+ (*pending_redraw) ++;
+
+ if (pptr->magic != MENU_CONTEXT_magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"get_root_menu",
+ "Bad parent type magic number",0);
+ }
+
+ if (pptr != default_context) {
+ DPRINT(Debug,7, (&Debug,
+ "get_root_menu(%p): root %p is not default context %p\n",
+ ptr,pptr,default_context));
+ }
+
+ return pptr;
+ }
+
+
int menu_resized(ptr)
struct menu_context *ptr;
{
***************
*** 110,120 ****

check_changes();

if (ptr->changed) {

! ptr->lines = ROOT_MENU.lines;
! ptr->columns = ROOT_MENU.columns;
! ptr->changed = ROOT_MENU.changed; /* ? ? ? ? */

return 1;
}
--- 358,391 ----

check_changes();

+
if (ptr->changed) {
+ struct menu_subpages *list;
+

+ if (MENU_DRAW_magic != ptr->routine->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_resized",
+ "Bad routine magic number",0);
+
+
+ ptr->routine->wra_resized(ptr);

! /* Turn changed flag for subpages ... */
!
! for (list = ptr->subpages; list; list = list->next) {
! if (MENU_CONTAINER_magic != list->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_resized",
! "Bad subpage container type magic number",0);
! if (list->parent != ptr)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_resized",
! "Bad parent pointer on subpage",0);
!
! if (list->subpage) {
! if (MENU_CONTEXT_magic != list->subpage->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_resized",
! "Bad subpage type magic number",0);
! list->subpage->changed = 1;


! }
! }

return 1;
}
***************

*** 122,128 ****
return 0;
}

! extern void menu_get_sizes(ptr,lines,columns)
struct menu_context *ptr;
int *lines;
int *columns;
--- 393,399 ----
return 0;
}

! void menu_get_sizes(ptr,lines,columns)
struct menu_context *ptr;
int *lines;
int *columns;
***************
*** 135,180 ****
*columns = ptr->columns;
}

int menu_need_redraw(ptr)
struct menu_context *ptr;
{


if (ptr->magic != MENU_CONTEXT_magic)

panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",


"Bad type magic number",0);

check_changes();

if (ptr->redraw) {

/* Reset ptr->redraw .... */

- ptr->redraw = ROOT_MENU.redraw; /* ? ? ? ? */

! DPRINT(Debug,7, (&Debug,
! "menu_need_redraw(%p): returning redraw\n",
! ptr));

! return 1;
}

return 0;
}

void menu_trigger_redraw(ptr)
struct menu_context *ptr;
{


if (ptr->magic != MENU_CONTEXT_magic)

panic("SCREEN PANIC",__FILE__,__LINE__,"menu_trigger_redraw",


"Bad type magic number",0);

DPRINT(Debug,7, (&Debug,
"menu_trigger_redraw(%p): triggering redraw\n",
ptr));
! ptr->redraw = 1;
}


! static VOLATILE int resize_screen = 0; /** SIGWINCH occured? **/
! static VOLATILE int redraw_screen = 0; /** Elm suspended? **/


/* called from signal handler */
--- 406,594 ----
*columns = ptr->columns;
}

+
int menu_need_redraw(ptr)
struct menu_context *ptr;
{
+ struct menu_context *pptr;
+ int pending_redraw = 0;


+
if (ptr->magic != MENU_CONTEXT_magic)

panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",


"Bad type magic number",0);

check_changes();

+ /* Check parents */
+ pptr = get_root_menu(ptr,&pending_redraw);
+
+ if (pending_redraw) {
+ DPRINT(Debug,7, (&Debug,
+ "menu_need_redraw(%p): pending redraw on parent\n",
+ ptr));
+ ptr->redraw = 1;
+ }
+
+ if (pptr->routine != &CURSES_ROUTINES) {
+ DPRINT(Debug,1, (&Debug,
+ "menu_need_redraw(%p): ERROR -- parent %p not main manu (not connected) -- quiting%s\n",
+ ptr,pptr,
+ ptr->redraw ? " (returning redraw)": ""));
+
+ return ptr->redraw;
+ }
+
+ if (pptr != default_context) {
+ DPRINT(Debug,9, (&Debug,
+ "menu_need_redraw: default context to %p (redraw needed)\n",
+ pptr));
+ default_context = pptr;
+ Syncronize(default_context);
+ pptr->redraw = 1;
+ ptr->redraw = 1;
+ }
+
if (ptr->redraw) {
+ struct menu_subpages *list;
+ int r;
+

+ if (MENU_DRAW_magic != ptr->routine->magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",
+ "Bad routine magic number",0);
+

/* Reset ptr->redraw .... */
+ ptr->routine->wra_reset_redraw(ptr);


! /* Turn redraw flag for subpages ... */

! for (list = ptr->subpages; list; list = list->next) {
! if (MENU_CONTAINER_magic != list->magic)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",
! "Bad subpage container type magic number",0);
! if (list->parent != ptr)
! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_need_redraw",
! "Bad parent pointer on subpage",0);
!
! if (list->subpage)
! menu_trigger_redraw(list->subpage);
! }
!
!
! r = ptr->routine->wra_do_redraw(ptr);
!
! if (r) {
! DPRINT(Debug,7, (&Debug,
! "menu_need_redraw(%p): redraw done\n", ptr));
! } else {
! DPRINT(Debug,7, (&Debug,
! "menu_need_redraw(%p): returning redraw\n",
! ptr));
! return 1;
! }
}

return 0;
}

+ /* Call refresh routines of children */
+ void menu_redraw_children(ptr)
+ struct menu_context *ptr;
+ {
+ struct menu_subpages *list;
+

+ if (ptr->magic != MENU_CONTEXT_magic)

+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",


+ "Bad type magic number",0);
+

+ for (list = ptr->subpages; list; list = list->next) {
+ if (MENU_CONTAINER_magic != list->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",
+ "Bad subpage container type magic number",0);
+
+ if (list->parent != ptr)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",
+ "Bad parent pointer on subpage",0);
+
+ if (list->subpage) {
+ struct menu_context *ptr1 = list->subpage;
+ int r;
+
+ if (ptr1->magic != MENU_CONTEXT_magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",


+ "Bad type magic number",0);
+
+

+ if (MENU_DRAW_magic != ptr1->routine->magic)
+ panic("SCREEN PANIC",__FILE__,__LINE__,"menu_redraw_children",
+ "Bad routine magic number",0);
+
+ r = ptr1->routine->wra_do_redraw(ptr1);
+
+ if (r) {
+ DPRINT(Debug,7, (&Debug,
+ "menu_redraw_children(%p): %p: redraw done\n",
+ ptr,ptr1));
+ } else
+ ptr1->redraw = 1;
+ }
+ }
+ }
+
+
void menu_trigger_redraw(ptr)
struct menu_context *ptr;
{
+ struct menu_context *pptr;
+ int pending_redraw = 0;
+ int r;


+
if (ptr->magic != MENU_CONTEXT_magic)

panic("SCREEN PANIC",__FILE__,__LINE__,"menu_trigger_redraw",


"Bad type magic number",0);

DPRINT(Debug,7, (&Debug,
"menu_trigger_redraw(%p): triggering redraw\n",
ptr));
!

! if (MENU_DRAW_magic != ptr->routine->magic)

! panic("SCREEN PANIC",__FILE__,__LINE__,"menu_trigger_redraw",
! "Bad routine magic number",0);
!
! /* Check parents */
!
! pptr = get_root_menu(ptr,&pending_redraw);
!
! if (pptr == default_context) {
! /* Is active */
!
! if (pending_redraw) {
! DPRINT(Debug,7, (&Debug,
! "menu_trigger_redraw(%p): pending redraw on parent\n",
! ptr));
! ptr->redraw = 1;
! } else {
!
! r = ptr->routine->wra_do_redraw(ptr);
!
! if (r) {
! DPRINT(Debug,7, (&Debug,
! "menu_trigger_redraw(%p): redraw done\n",
! ptr));
! } else
! ptr->redraw = 1;
! }
! } else {
! DPRINT(Debug,7, (&Debug,
! "menu_trigger_redraw(%p): parent %p not active\n",
! ptr,pptr));
! ptr->redraw = 1;
! }
}


! static volatile int resize_screen = 0; /** SIGWINCH occured? **/
! static volatile int redraw_screen = 0; /** Elm suspended? **/


/* called from signal handler */
Index: elmME+.2.5.alpha5-cvs/src/screen/curses.c
*** elmME+.2.5.alpha4/src/screen/curses.c 2004-08-18 18:41:37.000000000 +0300
--- elmME+.2.5.alpha5-cvs/src/screen/curses.c 2005-07-26 11:28:46.000000000 +0300
***************
*** 1,7 ****
! static char rcsid[] = "@(#)$Id: curses.c,v 1.7.8.3 2004/08/15 19:56:29 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.3 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
--- 1,7 ----

! static char rcsid[] = "@(#)$Id: curses.c,v 1.7.8.7 2005/07/26 08:28:46 hurtta Exp $";

/******************************************************************************
! * The Elm (ME+) Mail System - $Revision: 1.7.8.7 $ $State: Exp $


*
* Modified by: Kari Hurtta <hurtt...@posti.FMI.FI>
* (was hurtt...@ozone.FMI.FI)
***************

*** 15,22 ****

#include "def_screen.h"

- char *tgetstr();
-
DEBUG_VAR(Debug,__FILE__,"screen");

#ifdef I_CURSES
--- 15,20 ----
***************
*** 26,31 ****
--- 24,35 ----
#include <term.h> /* Defination for tgetent.h and so on ... */
#endif /* I_TERM */

+ #if !defined(I_CURSES) && !defined(I_TERM)
+ char *tgetstr();
+ int tgetent(); /* get termcap entry */
+ char *tgoto();
+ #endif
+
#undef lines /* ... But undefine lines macro */
#undef columns /* ... But undefine columns macro */

***************
*** 46,52 ****
/* Lose 'const' */
static char * cs2s P_((const char *str));
static char * cs2s(str)
! CONST char *str;
{

return (char *)str;
--- 50,56 ----
/* Lose 'const' */
static char * cs2s P_((const char *str));
static char * cs2s(str)
! const char *str;
{

return (char *)str;
***************
*** 57,64 ****
char * on;
char * off;

! CONST char *set_on;
! CONST char *set_off;

} set_modes[] = {

--- 61,68 ----
char * on;
char * off;

! const char *set_on;
! const char *set_off;

} set_modes[] = {

***************
*** 123,130 ****

static char *ptr = _capabilities; /* for buffering */

! static VOLATILE int _line = -1; /* initialize to "trash" */
! static VOLATILE int _col = -1;

int cursor_control = 0;
int cur_tabspacing = 8; /* Default? */
--- 127,134 ----

static char *ptr = _capabilities; /* for buffering */

! static volatile int _line = -1; /* initialize to "trash" */
! static volatile int _col = -1;

int cursor_control = 0;
int cur_tabspacing = 8; /* Default? */
***************
*** 151,158 ****
-2..-n No termcap for this terminal type known
*/

! int tgetent(), /* get termcap entry */
! err;
char *termenv;
int fd;

--- 155,162 ----
-2..-n No termcap for this terminal type known
*/

!
! int err;
char *termenv;
int fd;

***************
*** 308,320 ****
*columns = _columns;
}

! void cur_GetXYLocation(x,y)
! int *x,*y;
{
/* return the current cursor location on the screen */

! *x = _line;
! *y = _col;
}

static int need_moveabsolute = 0;
--- 312,324 ----
*columns = _columns;
}

! void cur_GetXYLocation(row,col)
! int *row,*col;
{
/* return the current cursor location on the screen */

! *row = _line;
! *col = _col;
}

static int need_moveabsolute = 0;
***************
*** 326,353 ****
_col = 0;
}

! int cur_ClearScreen(mc)
! struct menu_context *mc;
{
! /* clear the screen: returns -1 if not capable */

! _line = 0; /* clear leaves us at top... */
! _col = 0;

! mc->redraw = 0;
! _intransmit = -1; /* Re-set state */

! if (!_clearscreen)
! return(-1);

! tputs(_clearscreen, 1, outchar);
! FlushBuffer(); /* clear the output buffer */
! return(0);
}

static void moveabsolute P_((int col, int row));

! void cur_CursorUp(n)
int n;
{
/** move the cursor up 'n' lines **/
--- 330,365 ----
_col = 0;
}

! void cur_ClearScreen()
{
! /* clear the screen: returns -1 if not capable */

! _line = 0; /* clear leaves us at top... */
! _col = 0;

! if (default_context->redraw) {
! SIGDPRINT(Debug,7,(&Debug,
! "cur_ClearScreen: clearing redraw context from default context\n"));
! default_context->redraw = 0;
! }
! _intransmit = -1; /* Re-set state */

! if (!_clearscreen) {
! SIGDPRINT(Debug,4,(&Debug, "cur_ClearScreen: NO _clearscreen set!!\n"));

! return;
! }
!
! tputs(_clearscreen, 1, outchar);
! FlushBuffer(); /* clear the output buffer */
!
! return;
}

static void moveabsolute P_((int col, int row));

! static void cur_CursorUp P_((int n));
! static void cur_CursorUp(n)
int n;
{
/** move the cursor up 'n' lines **/
***************
*** 359,365 ****
_line = (_line-n > 0? _line - n: 0); /* up 'n' lines... */

if (n > 1 && _up_many) {
! char *stuff, *tgoto();

stuff = tgoto(_up_many,0,n);
tputs(stuff, 1, outchar);
--- 371,377 ----
_line = (_line-n > 0? _line - n: 0); /* up 'n' lines... */

if (n > 1 && _up_many) {
! char *stuff;

stuff = tgoto(_up_many,0,n);
tputs(stuff, 1, outchar);
***************
*** 369,387 ****

}

! void cur_CursorDown(n)
int n;
{
/** move the cursor down 'n' lines **/
/** Caller must check that _down is not null before calling **/

if (need_moveabsolute)
! moveabsolute(_col, _line);;

_line = (_line+n < _lines? _line + n: _lines-1); /* down 'n' lines... */

if (n > 1 && _down_many) {
! char *stuff, *tgoto();

stuff = tgoto(_down_many,0,n);
tputs(stuff, 1, outchar);
--- 381,400 ----

}

! static void cur_CursorDown P_((int n));
! static void cur_CursorDown(n)
int n;
{
/** move the cursor down 'n' lines **/
/** Caller must check that _down is not null before calling **/

if (need_moveabsolute)
! moveabsolute(_col, _line);

_line = (_line+n < _lines? _line + n: _lines-1); /* down 'n' lines... */

if (n > 1 && _down_many) {
! char *stuff;

stuff = tgoto(_down_many,0,n);
tputs(stuff, 1, outchar);
***************
*** 391,397 ****
}


! void cur_CursorLeft(n)
int n;
{
/** move the cursor 'n' characters to the left **/
--- 404,411 ----
}


! static void cur_CursorLeft P_((int n));
! static void cur_CursorLeft(n)
int n;
{
/** move the cursor 'n' characters to the left **/
***************
*** 403,409 ****
_col = (_col - n> 0? _col - n: 0); /* left 'n' chars... */

if (n > 1 && _left_many) {
! char *stuff, *tgoto();

stuff = tgoto(_left_many,0,n);
tputs(stuff, 1, outchar);
--- 417,423 ----
_col = (_col - n> 0? _col - n: 0); /* left 'n' chars... */

if (n > 1 && _left_many) {
! char *stuff;

stuff = tgoto(_left_many,0,n);
tputs(stuff, 1, outchar);
***************
*** 413,419 ****

}

! static int cur_CursorRight(n)
int n;
{
/** move the cursor 'n' characters to the right (nondestructive) **/
--- 427,434 ----

}

! static void cur_CursorRight P_((int n));
! static void cur_CursorRight(n)
int n;
{
/** move the cursor 'n' characters to the right (nondestructive) **/
***************
*** 428,434 ****
/* right 'n' chars... */

if (n > 1 && _right_many) {
! char *stuff, *tgoto();

stuff = tgoto(_right_many,0,n);
tputs(stuff, 1, outchar);
--- 443,449 ----
/* right 'n' chars... */

if (n > 1 && _right_many) {
! char *stuff;

stuff = tgoto(_right_many,0,n);
tputs(stuff, 1, outchar);
***************
*** 436,449 ****
} else while (n-- > 0)
tputs(_right, 1, outchar);

- return(0);
}

static void moveabsolute(col, row)
int col, row;
{

! char *stuff, *tgoto();

if (need_moveabsolute) {
SIGDPRINT(Debug,4,(&Debug,
--- 451,463 ----
} else while (n-- > 0)
tputs(_right, 1, outchar);

}

static void moveabsolute(col, row)
int col, row;
{

! char *stuff;

if (need_moveabsolute) {
SIGDPRINT(Debug,4,(&Debug,
***************
*** 460,478 ****
need_moveabsolute = 0;
}

! int cur_MoveCursor(row, col)
int row, col;
{
/** move cursor to the specified row column on the screen.
0,0 is the top left! **/

int scrollafter = 0;
!
/* we don't want to change "rows" or we'll mangle scrolling... */

if (need_moveabsolute)
moveabsolute(_col, _line);;

if (col < 0)
col = 0;
if (col >= _columns)
--- 474,535 ----
need_moveabsolute = 0;
}

! static int in_area P_((int line, struct cur_printarea *lim));
! static int in_area(line,lim)
! int line;
! struct cur_printarea *lim;
! {
! int r = line >= lim->first_line && line <= lim->last_line;
!
! if (line >= _lines) {
! DPRINT(Debug,4, (&Debug, "in_area: Not in screen (line=%d)\n",line));
! r = 0;
! }
!
! DPRINT(Debug,12, (&Debug,
! "in_area(line=%d,lim=%p)=%d: first_line=%d last_line=%d\n",
! line,lim,r,lim->first_line,lim->last_line));
!
! return r;
! }
!
! void cur_MoveCursor(row, col, lim)
int row, col;
+ struct cur_printarea *lim;
+
{
/** move cursor to the specified row column on the screen.
0,0 is the top left! **/

int scrollafter = 0;
!
/* we don't want to change "rows" or we'll mangle scrolling... */

if (need_moveabsolute)
moveabsolute(_col, _line);;

+ if (lim) {
+ int in = in_area(row,lim);
+
+
+ if (lim->gone_out && in) {
+ DPRINT(Debug,4,(&Debug,"cur_MoveCursor: Going to printing area, enabling printing\n"));
+ lim->gone_out = 0;
+ }
+
+ if (!in) {
+
+ if ( ! lim->gone_out) {
+ DPRINT(Debug,4,(&Debug,"cur_MoveCursor: Going out of printing area, disabling printing\n"));
+ lim->gone_out = 1;
+ }
+
+ return;


+ }
+
+ }
+
+

if (col < 0)
col = 0;
if (col >= _columns)
***************
*** 484,502 ****
scrollafter = row - _lines +1;
row = _lines -1;
}
-
- if (!_moveto)
- return(-1);

if (row == _line) {
if (col == _col)
! return(0); /* already there! */

else if (col == 0)
outchar('\r');

! else if (abs(col - _col) < 5 /* within 5 spaces... */ ||
! _left_many && _right_many
) {
if (col > _col && _right)
cur_CursorRight(col - _col);
--- 541,563 ----
scrollafter = row - _lines +1;
row = _lines -1;
}

+ if (!_moveto) {
+ DPRINT(Debug,4,(&Debug, "curses: NO _moveto set!!\n"));


+
+ return;
+ }
+

if (row == _line) {
if (col == _col)
! return; /* already there! */

else if (col == 0)
outchar('\r');

! else if (abs(col - _col) < 5 /* within 5 spaces... */
! ||
! (_left_many && _right_many)
) {
if (col > _col && _right)
cur_CursorRight(col - _col);
***************
*** 513,520 ****
outchar('\r');
outchar('\n');
}
! else if (col == _col && (abs(row - _line) < 5 ||
! _up_many && _down_many
)) {
if (row < _line && _up)
cur_CursorUp(_line - row);
--- 574,582 ----
outchar('\r');
outchar('\n');
}
! else if (col == _col && (abs(row - _line) < 5
! ||
! (_up_many && _down_many)
)) {
if (row < _line && _up)
cur_CursorUp(_line - row);
***************
*** 530,536 ****
--- 592,607 ----
_col = col;

if (scrollafter) {
+
DPRINT(Debug,49, (&Debug, " scrollafter=%d\n",scrollafter));
+
+ if (lim) {
+ DPRINT(Debug,4,(&Debug,"cur_MoveCursor: scroling not allowed, disabling printing\n"));
+ lim->gone_out = 0;
+
+ FlushBuffer();
+ return;
+ }

outchar('\r');

***************
*** 540,546 ****
}

FlushBuffer();
- return(0);
}

void cur_changemode(mode,set,reset)
--- 611,616 ----
***************
*** 550,555 ****
--- 620,635 ----
{
int i;

+ /* To allow switching modes from 'reset' to 'set', run reset first */
+
+ for (i =0 ; i < (sizeof set_modes) / sizeof (set_modes[0]); i++) {
+ if ((reset & set_modes[i].mode) && set_modes[i].off) {
+ tputs(set_modes[i].off, 1, outchar);
+ *mode &= ~(set_modes[i].mode);
+ }
+ }
+
+
for (i =0 ; i < (sizeof set_modes) / sizeof (set_modes[0]); i++) {

if ((set & set_modes[i].mode) && set_modes[i].on) {
***************
*** 557,593 ****
*mode |= set_modes[i].mode;
}

- if ((reset & set_modes[i].mode) && set_modes[i].off) {
- tputs(set_modes[i].off, 1, outchar);
- *mode &= ~(set_modes[i].mode);
- }
-
}

}

/* ----------------------------------------------------------- */

! VOLATILE static int wrappedlastchar = 0;
static int tabexpand = 0; /* Is terminal driver expanding tabs? */

/* called with value of -1 if just preprosessing needed
(ie need_moveabsolute)
*/
! static int write_control P_((int ch));
! static int write_control(ch)
int ch;
{
int justwrapped, nt;

if (need_moveabsolute)
moveabsolute(_col, _line);

justwrapped = 0;

switch (ch) {
/* if return, just go to left column. */
case 0x0D: /* CR */
if (wrappedlastchar)
justwrapped = 1; /* preserve wrap flag */
else {
--- 637,703 ----
*mode |= set_modes[i].mode;
}

}

}

/* ----------------------------------------------------------- */

! volatile static int wrappedlastchar = 0;
static int tabexpand = 0; /* Is terminal driver expanding tabs? */

/* called with value of -1 if just preprosessing needed
(ie need_moveabsolute)
+
+ returns value indication is character printing needed
*/
! static int write_control P_((int ch, struct cur_printarea *lim));
! static int write_control(ch,lim)
int ch;
+ struct cur_printarea *lim;
{
+ /* Setting lim disables scrooling !!
+ */
+
int justwrapped, nt;
+ static int warn = 0;

if (need_moveabsolute)
moveabsolute(_col, _line);

justwrapped = 0;

+ /* We do nothing if cursor is not currently on area ... */
+ if (lim && !in_area(_line,lim)) {
+ if (!warn) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "write_control: Cursor not in print area (lines %d-%d): line %d\n",
+ lim->first_line,
+ lim->last_line,
+ _line));
+ }
+ warn++;


+ return 0;
+ }
+

+ if (lim && lim->gone_out) {
+ if (!warn) {
+ SIGDPRINT(Debug,4,(&Debug,
+ "write_control: Cursor was going out of print area (lines %d-%d): line %d\n",
+ lim->first_line,
+ lim->last_line,
+ _line));
+ }
+ warn++;


+ return 0;
+ }
+

+ warn = 0;
+
switch (ch) {
/* if return, just go to left column. */
case 0x0D: /* CR */
+
if (wrappedlastchar)
justwrapped = 1; /* preserve wrap flag */
else {
***************
*** 600,605 ****
--- 710,727 ----
* do nothing, else output a newline and increment the line count */
case 0x0A: /* LF */
if (!wrappedlastchar) {
+
+ if (lim && _line == lim->last_line) {
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "write_control: going out of printing area (CR), disabling printing\n"));
+
+ /* Disable printing */
+ need_moveabsolute = 1;
+ lim->gone_out = 1;


+ return 0;
+ }
+

outchar('\n');
if (_line < _lines-1)
++_line;
***************
*** 612,618 ****
--- 734,748 ----
tputs(_left, 1, outchar);
_col--;
}
+
else if (_line > 0) {
+
+ if (lim && _line == lim->first_line) {
+
+ /* BACKSPACE does nothing */
+ break;
+ }
+
_col = _columns - 1;
_line--;
moveabsolute (_col, _line);
***************
*** 641,646 ****
--- 771,791 ----
moveabsolute (_col, _line);
break;
default: /* Is 'printable' character (or -1) */
+
+ if (lim && _col == _columns-1 && _automargin &&
+ _line == _lines-1) {
+
+ SIGDPRINT(Debug,4,(&Debug,
+ "write_control: going out of printing area and screen, disabling printing on last column\n"));
+
+ /* Disable printing */
+ need_moveabsolute = 1;
+ lim->gone_out = 1;


+
+ return 0;
+ }
+
+

return 1;
}

***************
*** 648,656 ****
return 0; /* Need no printing */
}

! static void increment_position P_((int len));
! static void increment_position(len)
int len;
{
int justwrapped;

--- 793,802 ----
return 0; /* Need no printing */
}

! static void increment_position P_((int len,struct cur_printarea *lim));
! static void increment_position(len,lim)
int len;
+ struct cur_printarea *lim;
{
int justwrapped;

***************
*** 667,680 ****
/* if we only had one column left, simulate automargins if
* the terminal doesn't have them */
if (_col + len == _columns) {
! if (!_automargin || _eatnewlineglitch) {
! outchar('\r');
! outchar('\n');
}
- if (_line < _lines-1)
- ++_line;
- _col = 0;
- justwrapped = 1;
}
/* if we are here this means we have no interference from the
* right margin - just increment the column position. */
--- 813,842 ----
/* if we only had one column left, simulate automargins if
* the terminal doesn't have them */
if (_col + len == _columns) {
!
! if (lim && _col == _columns-1 && _line == lim->last_line) {
!
! SIGDPRINT(Debug,4,(&Debug,
! "increment_position: going out of printing area (CR), disabling printing\n"));
!
! /* Disable printing */
! need_moveabsolute = 1;
! lim->gone_out = 1;
!
! } else {
!
! if (!_automargin || _eatnewlineglitch) {
! SIGDPRINT(Debug,40,(&Debug, "increment_position: EOLN -- printing CR LF\n"));
! outchar('\r');
! outchar('\n');
! } else {
! SIGDPRINT(Debug,40,(&Debug, "increment_position: EOLN -- screen wrapping assumed\n"));
! }
! if (_line < _lines-1)
! ++_line;
! _col = 0;
! justwrapped = 1;
}
}
/* if we are here this means we have no interference from the
* right margin - just increment the column position. */
***************
*** 688,696 ****
/* Called by signal handler ... */

void WriteRaw(str)
! CONST char *str;
{
! CONST char * p;


/* If WriteRaw() is called, then screen must be redraw
--- 850,858 ----
/* Called by signal handler ... */

void WriteRaw(str)
! const char *str;
{
! const char * p;


/* If WriteRaw() is called, then screen must be redraw
***************
*** 706,716 ****

ch &= 0xFF;

! need_print = write_control(ch);

if (need_print) {
outchar(ch);
! increment_position(1);
}
}

--- 868,878 ----

ch &= 0xFF;

! need_print = write_control(ch, NULL);

if (need_print) {
outchar(ch);
! increment_position(1, NULL);
}
}

***************
*** 720,727 ****




/* This assumes one byte charset */

! void cur_Writechar(ch)
int ch;
{
/** write a character to the current screen location. **/
int need_print = 1;
--- 882,890 ----




/* This assumes one byte charset */

! void cur_Writechar(ch, lim)
int ch;
+ struct cur_printarea *lim;
{
/** write a character to the current screen location. **/
int need_print = 1;
***************
*** 729,735 ****
ch &= 0xFF;

/* ASCII assumed */
! need_print = write_control(ch);

if (need_print) {
#ifndef ASCII_CTYPE
--- 892,898 ----
ch &= 0xFF;

/* ASCII assumed */
! need_print = write_control(ch,lim);

if (need_print) {
#ifndef ASCII_CTYPE
***************
*** 753,769 ****
free_state(&st);
}
outchar(ch);
! increment_position(1);
}
}


static int preinit_output P_((struct string *S, struct string **buffer,
! charset_t *stored_display));
! static int preinit_output(S,buffer,stored_display)
struct string *S;
struct string **buffer;
! charset_t *stored_display;
{
int sw = -1;

--- 916,932 ----
free_state(&st);
}
outchar(ch);
! increment_position(1,lim);
}
}


static int preinit_output P_((struct string *S, struct string **buffer,
! charset_t stored_display));
! static int preinit_output(S,buffer, stored_display)
struct string *S;
struct string **buffer;
! charset_t stored_display;
{
int sw = -1;

***************
*** 776,781 ****
--- 939,945 ----
switch_display_charset(0); /* Print using system charset */
} else if (allow_charset_switching &&
0 != (charset_properties(S->string_type) & CS_printable) &&
+ stored_display &&
set_display_charset(S->string_type,1)) {
sw = 2; /* Arrange return to correct display charset */
*buffer = S;
***************
*** 811,817 ****

struct string *ret1 = NULL;

! sw = preinit_output(S,&buffer,&stored_display);

DPRINT(Debug,35,(&Debug,
"curses_printable_clip: S=%S cs=%s -- using %s\n",
--- 975,981 ----

struct string *ret1 = NULL;

! sw = preinit_output(S,&buffer, stored_display);

DPRINT(Debug,35,(&Debug,
"curses_printable_clip: S=%S cs=%s -- using %s\n",
***************
*** 869,876 ****
return ret1;
}

! void cur_PutLineS(S)
struct string *S;
{
int idx = 0;


struct string *buffer = NULL;

--- 1033,1041 ----
return ret1;
}

! void cur_PutLineS(S, lim)
struct string *S;
+ struct cur_printarea *lim;
{
int idx = 0;


struct string *buffer = NULL;

***************
*** 881,887 ****



! sw = preinit_output(S,&buffer,&stored_display);

buffer_len = string_len(buffer);

--- 1046,1052 ----



! sw = preinit_output(S,&buffer, stored_display);

buffer_len = string_len(buffer);

***************
*** 908,917 ****

/* ASCII assumed */
if (ch <= 31)
! need_print = write_control(ch);
else
! need_print = write_control(-1); /* HACK for position of cursor */
if (!need_print) {
DPRINT(Debug,40,(&Debug,
"PutLineS: [%d] unicode=%d (control)\n",
idx,ch));
--- 1073,1090 ----

/* ASCII assumed */
if (ch <= 31)
! need_print = write_control(ch, lim);
else
! need_print = write_control(-1, lim); /* HACK for position of cursor */
if (!need_print) {
+
+ if (lim && !in_area(_line,lim)) {
+ DPRINT(Debug,40,(&Debug,
+ "PutLineS: [%d] not in area ... \n",
+ idx));
+ break;
+ }
+
DPRINT(Debug,40,(&Debug,
"PutLineS: [%d] unicode=%d (control)\n",
idx,ch));
***************
*** 965,979 ****
}

if (printable_len)
! increment_position(printable_len->ret_len);
else
! increment_position(idx-old_idx);

if (idx == old_idx) {
DPRINT(Debug,10,(&Debug,"No any characters printed...\n"));
CleartoEOLN();
! cur_Writechar('\r');
! cur_Writechar('\n');
}

free(s);
--- 1138,1152 ----
}

if (printable_len)
! increment_position(printable_len->ret_len, lim);
else
! increment_position(idx-old_idx, lim);

if (idx == old_idx) {
DPRINT(Debug,10,(&Debug,"No any characters printed...\n"));
CleartoEOLN();
! cur_Writechar('\r',lim);
! cur_Writechar('\n',lim);
}

free(s);
***************
*** 990,1003 ****

void cur_Write_to_screen (


#if ANSI_C
! CONST char *format, CONST char *msg, ...
#else

! format, msg, va_alist


#endif
)
#if !ANSI_C
! CONST char *format;
! CONST char *msg;
va_dcl
#endif
{

--- 1163,1178 ----

void cur_Write_to_screen (
#if ANSI_C
! struct cur_printarea *lim,
! const char *format, const char *msg, ...
#else
! lim, format, msg, va_alist
#endif
)
#if !ANSI_C
! struct cur_printarea *lim;


! const char *format;
! const char *msg;
va_dcl
#endif
{
***************

*** 1011,1093 ****


looking for "\n" sequences... **/

text = elm_smessage(0,format,msg,vl);
! cur_PutLineS(text);
free_string(&text);

va_end(vl);

}

! void cur_PutLine0(x, y, line)
! int x,y;
! CONST char *line;
{
/** Write a zero argument line at location x,y **/

! cur_MoveCursor(x,y);
! while(*line)
! cur_Writechar(*line++);
}

void cur_PutLineX(
! #if ANSI_C


! int x, int y, const char *format, const char *line, ...

#else
! x, y, format, line, va_alist
#endif
)
#if !ANSI_C


! int x;
! int y;

! CONST char *format;
! CONST char *line;
va_dcl
#endif
{

va_list vl;
struct string *text;

Va_start(vl, line); /* defined in defs.h */

! cur_MoveCursor(x,y);

text = elm_smessage(0,format,line,vl);
! cur_PutLineS(text);
free_string(&text);

va_end(vl);

}

! int cur_CleartoEOLN()
{
/** clear to end of line **/

if (need_moveabsolute)
moveabsolute(_col, _line);

! if (!_cleartoeoln)
! return(-1);

tputs(_cleartoeoln, 1, outchar);

! return(0);
}


! int cur_CleartoEOS()
{
/** clear to end of screen **/

if (need_moveabsolute)
moveabsolute(_col, _line);

! if (!_cleartoeos)
! return(-1);

tputs(_cleartoeos, 1, outchar);

! return(0);
}

static int _inraw = 0; /* are we IN rawmode? */
--- 1186,1317 ----


looking for "\n" sequences... **/

text = elm_smessage(0,format,msg,vl);
! cur_PutLineS(text, lim);
free_string(&text);

va_end(vl);

}

! void cur_PutLine0(row, col, line, lim)
! int row,col;
! const char *line;
! struct cur_printarea *lim;
{
/** Write a zero argument line at location x,y **/

! if (lim && ! in_area(row,lim)) {
! DPRINT(Debug,10,(&Debug,
! "cur_Putline0: (row %d,col %d) not in area row %d-%d\n",
! row,col,
! lim->first_line,
! lim->last_line));
!
! lim->gone_out = 1;
! return;
! }
! if (lim)
! lim->gone_out = 0;
!
! cur_MoveCursor(row,col, lim);
! while(*line) {
! cur_Writechar(*line++, lim);
!
! if (lim && !in_area(_line,lim)) {
! DPRINT(Debug,40,(&Debug,
! "cur_Putline0: not in area ... \n"));


! break;
! }
!
!

! }
}

+
+
void cur_PutLineX(
! #if ANSI_C
! int row, int col,
! struct cur_printarea *lim,


! const char *format, const char *line, ...

#else
! row, col, lim, format, line, va_alist
#endif
)
#if !ANSI_C
! int row;
! int col;
! struct cur_printarea *lim;


! const char *format;
! const char *line;
va_dcl
#endif
{

va_list vl;
struct string *text;

+ if (lim && ! in_area(row,lim)) {
+ DPRINT(Debug,10,(&Debug,
+ "cur_PutlineX: (row %d,col %d) not in area row %d-%d\n",
+ row,col,
+ lim->first_line,
+ lim->last_line));
+
+ lim->gone_out = 1;
+ return;
+ }
+ if (lim)
+ lim->gone_out = 0;
+
+
Va_start(vl, line); /* defined in defs.h */

! cur_MoveCursor(row,col, lim);

text = elm_smessage(0,format,line,vl);
! cur_PutLineS(text,lim);
free_string(&text);

va_end(vl);

}

! void cur_CleartoEOLN()
{
/** clear to end of line **/

if (need_moveabsolute)
moveabsolute(_col, _line);

! if (!_cleartoeoln) {
! SIGDPRINT(Debug,4,(&Debug, "curses: NO _cleartoeoln set!!\n"));
!
! return;
! }
!

tputs(_cleartoeoln, 1, outchar);

! return;
}


! void cur_CleartoEOS()
{
/** clear to end of screen **/

if (need_moveabsolute)
moveabsolute(_col, _line);

! if (!_cleartoeos) {
! SIGDPRINT(Debug,4,(&Debug, "curses: NO _cleartoeos set!!\n"));
!
! return;
! }

tputs(_cleartoeos, 1, outchar);

! return;
}

static int _inraw = 0; /* are we IN rawmode? */

It is loading more messages.
0 new messages